25m
revised Searching in file - java
removed stray static
26m
comment Searching in file - java
See the edited version. If it seems too complicated, pass the result of Files.readAllLines(FileSystems.getDefault().getPath(fileName), Charset.defaultCharset()); instead the new IterableReader(fileName)
33m
revised Searching in file - java
Added file-reading logic
12h
comment Searching in file - java
If the answer is correct & helpful, you should upvote and/or accept it
19h
comment Why toString is not called for functions parameter?
If you really, really hate typing the .toString(), use automatic conversion by prefixing ""+
20h
comment Java: update statuses concurrently
How are you persisting things into your database? Databases are good at concurrency, and as @VitalijZadneprovskij writes, many can achieve concurrent writes (as long as the rows are different); and will use locking to prevent synchronization issues without you having to do anything.
22h
comment Git: Recover file created in ignored directory
If it exists locally, what is preventing you from adding it to the repo?. When I write "repo", I meant your local repo (the one in your .git folder). If it is still in your working folder but not in your local repo, what is preventing you from git add path-to-my-file && git commit -m "added the effing file"?
22h
comment Git: Recover file created in ignored directory
If it never went into the repo, there is no way you can get it out. The file, from the repo's point of view, has never existed.
1d
comment Searching for a file with .java extension
I use grep <query> $( find <dir> -name *.java | xargs ), which is worse if there's a LOT of java files, but slightly quicker to type when out-of-IDE
1d
answered Searching in file - java
1d
comment Searching in file - java
Will the dates always be in increasing order? Are you always returning the sum of all hours for the requested person between (or at) the two dates?. This simplifies things a lot.
2d
comment How can I form commands in multisensor networks?
You need to add actual examples of a) what the user would see and b) what your program would generate; otherwise the question can be interpreted in a lot of different ways.
2d
comment How can I form commands in multisensor networks?
I thought that sensors only "sensed" (=generated readings). If your sensor can process setMaxTemp(20), then it seems to be actually controlling the temperature, and is no longer a simple sensor.
2d
comment Functional Programming Way: How to avoid overhead of copy object in Java?
One option is to use wrappers. I am not saying that this is done, but it is certainly possible to have WrapperClass extends MassiveClass and implement the methods of MassiveClass by delegation into a contained, unmodified massive.
May
12
comment Encoding phone number to word and searching dictionary
Do they give you a dictionary to look up words in? That would restrict the search-space a lot, and greatly speed up your code, too.
May
11
comment Optimize algorithm to find intersection points in 2d roads (lines)
It is similar - I started to write before he posted, but finished afterwards.
May
11
answered Optimize algorithm to find intersection points in 2d roads (lines)
May
11
answered External Source Map Tool
May
11
comment User are not able to download exe file , antivirus treats the file as threat
Care to say which AV flagged it as a virus? And how the exe was generated?
May
11
comment The logic of programming
If the user is not logged in, attempting to logout would (a) probably produce some sort of error, and (b) be pointless. With more error-correction, (a) can be protected about. But here the programmer thought that (b) was not worth it, and therefore decided to do nothing if the user is not logged in.
1 2 3 4 5