378 reputation
17
bio website localhost
location San Francisco, CA
age 38
visits member for 2 years, 6 months
seen Mar 19 at 9:20

Manager of computing infrastructure for the Department of Electrical Engineering and Computer Sciences (EECS) at the University of California, Berkeley


Feb
1
revised Converting multiple image files from JPEG to PDF format
added 987 characters in body
Feb
1
comment How can I do a “copy if changed” operation?
If you want to use your Windows-based editor you can do that quite easily with Shared Folders if you install Guest Additions... but hey, if Cygwin suits you, then who am I to say any different? It just seems a shame to have to jump through weird hoops like this... and compilation in general would be faster in a VM, too.
Feb
1
comment How can I do a “copy if changed” operation?
Cygwin is all kinds of problematic, so that doesn't surprise me. I am curious, though, what keeps you tied to Cygwin? Seems to me it would be easier to spin up a Linux VM with VirtualBox and do the primary development there, but then test it on Cygwin when you need to... you can still have Cygwin as a target platform (though with VM tech what it is, I don't see why Cygwin is still around anymore), but develop elsewhere.
Jan
31
revised Converting multiple image files from JPEG to PDF format
re-added info about arg list too long and zsh recursive globbing
Jan
31
revised Converting multiple image files from JPEG to PDF format
added comment about - and -iname
Jan
31
revised Converting multiple image files from JPEG to PDF format
removed unnecessary --
Jan
31
comment Converting multiple image files from JPEG to PDF format
@enzotib Also with find you do not have problems with filenames that begin with -, so there is no need for adding ./ like you must with the shell for loop.
Jan
31
comment Converting multiple image files from JPEG to PDF format
@enzotib ah, thanks for pointing that out. I was not aware that it behaved differently in a for loop. I have removed my erroneous comment, but that was not the only reason I down-voted. The mogrify command as cjm suggests is much simpler and find is more versatile since it can handle directory hierarchies (you can do recursive globbing with **/*.jpg in zsh, but that is shell-specific, whereas find is not) and it is easy to make find case-insensitive with -iname instead of -name, which is harder to do and shell-specific for globbing.
Jan
31
comment How can I do a “copy if changed” operation?
No, I was not suggesting that you copy all the files, rather you can just autogenerate your .c files in-place (remove the copy step and write to them directly). And then just use ccache. I don't know what you mean by starting hundreds of ccache processes... it is just a light-weight wrapper around gcc that is quite fast and will speed up re-building other parts of your project, too. Have you tried using it? I would like to see a comparison of the timing between using your copy-method vs ccache. You could, in fact, combine the two methods to get the benefits of both.
Jan
31
answered What is in the output of “getent ahosts”?
Jan
31
comment How can I do a “copy if changed” operation?
Or better yet, for this specific case use ccache.
Jan
31
awarded  Commentator
Jan
31
comment How can I do a “copy if changed” operation?
@user2436 +1 for rsync --checksum as a good general way to accomplish this, but in this particular case it would be better to use ccache.
Jan
31
comment How can I do a “copy if changed” operation?
@hesse if you want to show the unique files you can use diff, but if you want to see just what has changed then use rsync -avnc or the long way rsync --archive --verbose --dry-run --checksum.
Jan
31
comment How can I do a “copy if changed” operation?
@brooks-moses this is really a job suited for ccache!
Jan
31
answered How can I do a “copy if changed” operation?
Jan
30
comment How can I do a “copy if changed” operation?
-1 because this is overly-complicated, non-portable (-J is bsd-specific; with GNU xargs it is -I), and does not work correctly if the same set of files do not exist in both locations already (if I touch x/boo then grep gives me Only in ./x: boo which causes errors in the pipeline). Use a tool built for the job, like rsync --checksum.
Jan
30
comment Converting multiple image files from JPEG to PDF format
Good idea to use mogrify instead of convert. This will work for 100 files, but using globbing with *.jpg does not scale to thousands of files; that can be done by combining the command in a simple one-liner with find.
Jan
30
comment Converting multiple image files from JPEG to PDF format
Resorting to make seems a little over-complicated when a simple one-liner will do the trick.
Jan
30
awarded  Editor