If you're on a system where long is 64 bits, using a double is a terrible idea. You can only count integers up to 2**53. With a long, you get up to 2**63 (2**64 if it's an unsigned long).
@Mego Well, I'm really trying to track how long "x" has been running, so I'm using a timestamp (ms since epoch) and subtracting the start time from the current time
Anonymous
@feersum Assuming it meets POSIX spec, yes
Anonymous
@DJMcMayhem There are much better ways to do that
Anonymous
auto start = std::chrono::high_resolution_clock().now();
// do stuff
auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock().now()-start).count()
Ugh. People shouldn't write about DST if they're going to say stupid things like this:
> Daylight saving time will end at 2 a.m. on Sunday, Nov. 6. And with it comes short days and long nights.
Anonymous
Although in this case, he's incorrect - BST (British Summer Time, because the brits always have to use their own terms for stuff) just ended on the 30th
DST seems to be the result of some legislative cabbages looking back at the Gregorian reform and thinking "Man, skipping ahead 10 days was cool. We should mimic that at a smaller scale by twiddling with our clocks twice a year for no real effect."
@DrMcMoylex Doing away with time zones will probably not happen for a long time.
Anonymous
@muddyfish DST is to "save daylight" in the summer - allowing for more time outside of normal work hours with daylight, by shifting one daytime hour forward (from morning to evening)
Your task is simple. You have to Make a compiler/interpreter that compiles/interprets the language you made it in. E.g if you made a compiler/interpreter in C, it would have to compile/interpret C.
Test Cases
A simple "Hello, World" program.
Your compiler/interpreter. Yes, try feeding your com...
Background
Back in the late 90's / first 00's when Flash Web Design so much cool that noone could live without having a full Flash site, or at least an animated widget, I was hired to develop a "horse races viewer" in Flash/Actionscript, in the shape of an 80's videogame style animation, so the ...
@El'endiaStarman Not really. I usually had EST, GMT, and JPT all running in my head while I lived in Japan. Just takes a bit of getting used to.
Anonymous
@El'endiaStarman Just look at your clock less. Or recognize that the number shown on a clock is almost entirely meaningless, regardless of the presence or absence of time zones
@Geobits Hmm, but each of those is associated with a specific place (in a generic sense). Not the same as it being the same time everywhere, but with similar things happening at different times.
@El'endiaStarman True, but changing time zones doesn't happen all that often for the vast majority of people. And even so, it's not hard to go from "the shops open at 8am" to "the shops open at 6pm". Unless you travel very often, I don't think you'd have an issue with it.
@Geobits Well, but everyone (except for the lucky sods in GMT) will have to make that adjustment. If we abolish time zones all at once, then suddenly 6 pm is 3 am but nothing else changes.
You don't have to do the whole world at once, really. Individual countries/states could just choose to use GMT for everything (just like they choose whether to DST). Eventually, I'd hope that common sense wins (but not holding my breath).
I'm not sure how it would actually be financially catastrophic though.
@Geobits Well, maybe not so much since computers do a lot of the stock trading these days, but I was thinking that you might have problems with people being confused about when stuff was happening, leading to missed meetings or opportunities etc.
@Poke I know right?! Screw those metric overlords!
The confusing part of DST is that we teach children only that we're changing the time on the clocks; not that we're switching timezones for half a year
Right, but I don't know too many people nowadays that get confused about metric vs imperial. It's just one or the other. Plus our government doesn't help with that, since many things are mandatorily labeled with imperial. Dropping it would be really easy if labeling reqs changed.
Teach kids metric only in school, and in ten/twenty years the whole thing would be over.