https://docs.oracle.com/javase/6/docs/api/java/lang/System.html#currentTimeMillis() says: Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, man…
Tag: linux
linux script that monitors file changes within folders (like autospec does!)
I want to automatically kick off a build whenever a file changes. I’ve used autospec (RSpec) in Ruby and loved that. How can this be done in bash? Answer After reading replies to other posts, I found a post (now gone), I created this script :-
Parsing line with delimiter in Python
I have lines of data which I want to parse. The data looks like this: What I want to do is to have a subroutine that parse them and return 2 values (score and expect) for each line. However this function of mine doesn’t seem to work: Please advice what’s the right way to do it? Answer It looks lik…
how to find whether a script run as a nohup finished or not?
I tried running a script using nohup like, When I tried I couldn’t find it there except for the grep which is being run with that string as a parameter. Am I doing it right?. Does this mean that the process has indeed finished execution? Thanks. Answer At the beginning of your shell script, write the PI…
How to take snapshot of PDF file in linux?
How I can take snapshot of first page of PDF file in Linux? I wanna do this on VPS server automaticaly. My distribution is Debian. Answer ImageMagick can convert PDF pages if you have Ghostscript installed.
Why does my code run slower with multiple threads than with a single thread when it is compiled for profiling (-pg)?
I’m writing a ray tracer. Recently, I added threading to the program to exploit the additional cores on my i5 Quad Core. In a weird turn of events the debug version of the application is now running slower, but the optimized build is running faster than before I added threading. I’m passing the &#…
Incremental backup Linux command [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …
Convert .cshrc to .bashrc [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago. Improve this question I am new to Linux and I am trying to compile some code that needs environment variables set …
single common address space for all tasks
How to give single common address space for all tasks. IF its happening like this can we avoid virtual to physical memory mapping. I f all task sharing common address space then how can we avoid virtual to physical memory mapping. Answer I’m not sure why you would want to disable virtual memory mapping …
Linux process memory consumption in bytes (not Kbytes)
In Linux is there any way to check processes memory measured on bytes (using top or ps for example). Not in kbytes, but bytes. Thanks in advance! Answer Beyond the obvious answer of multiplying by 1024 (or 1000 if you want to be SI-correct)? AFAIK top, ps etc. get their info from reading /proc/[PID]/status or…