News for hackers. Stuff that matters.
Re:What to do with the one-shot scripts by evfanknitram on Saturday February 24, 2018 @12:44PM (#16454334)
If potential employers rate my skill based on one-off scripts I should probably stay away anyway.

Just add a README that the repo contains that kind of stuff.

We have a tools repo at work with this kind of random stuff. We use internal gits but if we're using public repository I would put it up there without blinking..

Re:What to do with the one-shot scripts by Piskvorrr on Saturday February 24, 2018 @04:13PM (#16455443)
Exactly. I'd comb the script a bit (since it will probably share some traits with the rest of them), but other than that, don't worry.
Re:What to do with the one-shot scripts by weinzierl on Saturday February 24, 2018 @01:22PM (#16454517)
> Yes, I know, civilized people don’t use ‘sleep’, because that is a waste of CPU

I'm not sure what language the example is in and don't really understand the script.

That being said: In most languages sleep just is a wrapper around the system call with the same name. Again for most current and common operating systems this doesn't waste CPU cycles because it just puts your thread of process in an inactive state. Other threads or processes can use the CPU during that time.

That doesn't mean calling sleep with a small argument repeatedly is a good idea because it causes two context switches per call which might be an indirect waste of CPU cycles.

Re:What to do with the one-shot scripts by banyek on Sunday February 25, 2018 @04:05AM (#16457979)
Yea, you have right (https://stackoverflow.com/questions/17075788/python-is-time-...), but this was only an example.
Re:What to do with the one-shot scripts by banyek on Saturday February 24, 2018 @12:42PM (#16454317)
I am really curious what is your solution?