- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Substituting one small hassle for a very large hassle is, unfortunately, something some managers excel at. Usually it means the small hassle is off their plate and the very large hassle is on someone else.
Admin
Well, if a vaginal birth is not possible, I guess...Oh, you meant something else. Sorry.
Admin
I was commenting on the apparent tendency of UNIX commands to be obscure for the sake of obscurity. To each their own, though...
Admin
So you believe all statically typed languages are insane? If you do 5/2 in C, Java or pretty much any statically typed language it's going to give you 2. You've gotta explicitly cast those ints to floats if you want a float as a result.
Admin
It would have to be fortran 77 as that's when block ifs were introduced
Admin
I take it you have never typed a significant amount of text on the teletype machines that Unix originally ran on. Slow, clumsy keyboards with giant mechanical keys that (slightly exaggerated) you had to mash with your fist to use.
5 minutes with one of those and you will quickly realize that those commands are not "obscure for the sake of obscurity" but rather "shortened for your fingers' sake".
Admin
So explain to me how the "biff" command got named when something else with 4 characters would have been much better.
Admin
Not "pretty much any statically typed language." Just the C family, which is insane for many reasons, including this one.
In Pascal, on the other hand, (which is also statically typed,) "5/2" returns 2.5; if you want a result of 2, you use the integer division operator: "5 div 2". Which is the right way to do it: division behaves as actual division, and if you want something that's not quite real division but is similar, you use a different operator.
Admin
It doesn't matter. They aren't actually counting milliseconds, anyway.
Admin
No, thankfully. But, surely not needed now? I guess it's a matter of not changing anything you don't have to...
Admin
Admin
So TRWTF is nobody has noticed for 6 years, that this clock was skewed by around 30% to 50% because 15ms is not equal 1cs?
Admin
Errr...The issue with the 0 ain't got nought to do with speed of a computer....
There's a bug in the code that means 0 will ALWAYS appear to be missed. But noone else noticed that, right?
Admin
Am I the only one who starts with a timestamp and then just polls the difference for intervals? If you have to roll your own then thats probably the most reliable way I can see to do it.
Admin
That and several decade's worth of legacy programs, scripts, and software...
Of course you can customize the shell's commands with the alias command if you feel that the defaults are too cryptic
Original
Shorter
Windows Flavour
Politely Verbose
Whimsical
Admin
Admin
Admin
So you're giving it a zero?
If you have 5 people and 2 offices, and you put 5/2 (integer valued) in each office, you're still not going to be getting the correct answer. ("Well, Tom, the good news is we're not going to cut you in half. The bad news is that you've been truncated out of an office.")
Admin
As well as saving fingers, I thought some of the idea was saving sapce. Back in the day when we didn't have massive hard disk, 1 character was a lot, so wasting characters having a command like "copy" when you could call it "cp" seemed a silly thing to do.
Admin
Admin
Time wounds all heels.
Admin
Admin
p.s. Programming on an ASR33 will humble many a young programmer quite quickly!
Admin
Please forgive my ignorance here - years ago I was forced at gunpoint to modify a large Java program and swore to never touch it again - but, is there seriously no way to get the local time in seconds since the epoch (or other reference point), in JavaScript?
Admin
Is there a way?
Is there a way that the original developer knew about? Maybe not. He also doesn't seem to know about setInterval() in place of setTimeout().
Worse, using a 1ms timeout instead of a 1s timeout when the lowest resolution your timer needs is at the second level shows not just a lack of knowledge, but a lack of understanding.
Admin
I really like this change in Python 3. Rather than inheriting the approach of C like Python 2, they now treat "/" as floating point division and "//" as integer division. This makes code more reusable because the operation is the same all the time; the type of the arguments doesn't matter.
Sure you could cast to get the same effect. But it's nice that you don't have to.
Admin
"If your database is having deadlock problems, the solution is to give users 40 minutes (your mileage may vary) to submit the form?
First of all, deadlocks arise from two (ignorantly written) updates occurring at roughly the same time. Not 40 minutes apart. "
Deadlocks can easily come from 2 different events far from each other in time. A deadlock is not always a race condition.
I guess that in this case, the system locked some entries in the database, from the user started his action, and until he finished his work. In that case, forcing the user to work faster would decrease the risk of deadlock, because the time the user held the problematic locks could be decreased.
Or maybe the developer is just an idiot.
Admin
Oh, and does it coerce floats to integers before or after the // division? (i.e. does 0.41 // 0.1 give 4 or a div-by-zero trap?)
Admin
That piece of crap is not even beginners code, author could've used google to search for a working version...
Admin
Admin
Don't need no Steeenking block ifs:
C Assume some code above that sets I,B,C,D
100 CONTINUE A = B GOTO 400 200 CONTINUE A = C GOTO 400 300 CONTINUE A = D GOTO 400 400 CONTINUE
C ..and more code below. The extra GOTO allows us to C insert code between it and 400 that we can C 'spaghetti into' if we want to be really perverse.
Admin
Admin
Sure "//" isn't going to fly in languages that use it for comments, but since Python uses "#" for that, who cares?
Admin
I guess sometimes the fix can be worse than the bug.
Admin
Well, I think there's more to this code when examined carefully - there are a 1,000 milliseconds in a second, not a 100 !
Admin
I always read it as "measure the timing (indirectly ascertaining their speed) of the flies with the alacrity of the flight of an arrow through the air" - that is, "I want you to time those flies - get a move on!"
Admin
Admin
By the way, Firefox has a preference for the minimum interval, so you can make survey time pass more slowly. (Or just switch tabs, as the default for background tabs is higher.) The preference also applies to self-resetting timeouts, although obviously the first one is unaffected. Before that preference existed, there was a 10ms minimum on timeouts and intervals.
Admin
Admin
Since "5/2 == 2" is clearly a programming expression, not a mathematical expression, it only makes sense if you understand what language it's written in. In most C-family languages, it's true. In, say, Python 3, it's false. Neither one of those is "right" outside of context.
The right answer, of course, is to use Applescript (or Hypercard), where you write "5 ÷ 2", just as you did in grade school, and by the time you've figured out how to type the "÷" on a keyboard with no such symbol, you no longer care what the answer was.
Admin
Admin
That's how pretty much everyone wrote division that I'm aware of in high school and university.
a la
e/m = c²
or
e
Why would you ever use the basic division symbol when it takes up more room and takes longer to write out? Especially since it's just a pictograph for the slash version anyway, with the dots representing the numerator/denominator.
Admin
Lets make time fly even faster: