how computers learn from input? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how computers learn from input?

in machine learning computers learn from inputs but can i do it with java or c++. i want my program to take input and store it in memory every time i use it.. for eg like- first it takes input 5 i want it to store, so when next time i run it i will get 5 and input computer has taken this time. how can i do it??

24th Aug 2017, 2:36 PM
shobhit
shobhit - avatar
2 Answers
+ 10
Read from / Write to local files, e.g. database/text file.
24th Aug 2017, 3:14 PM
Hatsy Rei
Hatsy Rei - avatar
+ 4
There seem to be two questions here; I'm interpreting the first towards in-memory persistence. Also, I'm 'dumping' several options, partially for future visitors / answers to explore... + in case you have a preference. PERSISTING IN MEMORY ===================== To stay in memory (vs flat file, database, registry or online) people regularly use a persistent process. Whatever variables the non-exiting process defines is your (volatile) storage. c++ can fork (just don't exit normally from the fork; now it's a resident process) but Java has to 'exec'. These processes live as long as the user is logged in. For more persistence you need a background service or elevated privileges to survive account teardown. LISTENING FOR DATA =================== The resident process has to 'listen' (network stacks, unix-style sockets, etc) or agree to accept INTerrupts and/or SIGnals. Windows... UDP, TCP, named pipes, IPC (Inter-Process Communication), share a public interface, COM (Component Object Model), OLE (Object Linking and Embedding, DDE (Dynamic Data Exchange) message queues and more. Linux also has standard networking + UNIX sockets (file endpoints in the file system that work like network streams), message queues and buses (everybody talks on the bus; you scoop up messages meant for you), etc. Android/OSX has the Linux stuff + more, but this is already pretty long, so I'll leave a piece of advice: Your resident process should not just sit in a 'while' loop: It should sleep when it's not busy.
24th Aug 2017, 4:20 PM
Kirk Schafer
Kirk Schafer - avatar