I know it sounds daft. But let me start by saying that — having recently installed a big WordPress upgrade for my blog, having upgraded to the flashy new Firefox 4, and having used Windows 7 for over a year now — it's quite an exciting time using all these new 2010s interfaces.
I've previously resisted tab bars being moved around my browser, the introduction of collapsed menus to save space, and the inevitable "making buttons glow" that seems to come with the desktop application equivalent of the Web 2.0 movement… but lately I'm quite enjoying it.
Anyway, having bitten my tongue and agreed to try collapsing my menu bar into the "Firefox button", what was one step too far was that the tab-bar would now collapse into the window's titlebar when maximised, then drop down to its own line again when the window was restored. This is inconsistent, and also annoyed me because it meant I could no longer safely click on the titlebar to do silly things like close context menus, a habit that I've only just realised I have.
Fortunately, Firefox's immense customisation powers come to the rescue: setting browser.tabs.drawInTitlebar
to false
solved that in a heartbeat.
Tempted to write code like this on Linux?
include
include
int main()
{
std::time_t target = clock() + (30 * CLOCKS_PER_SEC);
while (clock() < target) {
usleep(100000);
}
std::cout << "Done!";
// ^ 30 seconds after program start.. or is it?
}
Don't.
clock()
measures the CPU time taken by the current process, not the absolute passage of time ("wall time"). On most systems, the time spent in a sleep()
or usleep()
call does not count towards the process's runtime; the OS simply diverts all of its attention to other processes whilst your program waits. The program above could feasibly run for far longer than thirty seconds… perhaps years.
(I'm ignoring here that sleep()
will actually wait for at least the duration you give it; sleep(1)
is allowed to sleep from anywhere between one second and ten years. Of course, realistically, you'll get close to a second's wait on a sane platform. I'm also ignoring that clock()
wraps around, and will do so every 72 minutes that complies with POSIX by having a CLOCKS_PER_SEC
value of 1000000.)
You're better off using a function like plain old time()
or gettimeofday()
(which can usually give you microseconds' resolution) if you want to measure the wall time:
include
include
int main()
{
std::time_t target = time(0) + 30;
while (time(0) < target) {
usleep(100000);
}
std::cout << "Done!";
// ^ Around 30 seconds after program start.. for real
}
V's second season ended on a doozy, though I do have a few gripes:
- Why didn't Evil Lisa need to wait for her breeding skin to develop?
- I don't like the FBI guys turning out to be Project Ares members. It could have worked, but I don't think it makes sense given their behaviour in the past. Felt rushed in. And even if it does, wow what a waste that Erica was hiding her work from them all this time! And, besides, the whole "secret government organisation with large underground bunker and amazing logic-defying software" thing is really tired now.
- Ryan's death was anti-climactic in the extreme.
- How on earth does one of those lizards fit into the human-sized skin suit?!
- And why is Anna going on about using emotion to manipulate humans when she's being doing that anyway from the very start?
- The Fifth Column was so dumb to rely on Lisa to kill her mother. Duh. And to leave a mirror right in front of her chair. Duh.
- Why was Erica not affected by the global bliss? Do you get to ignore the film if you miss the opening credits sequence?
Everything else was great, including:
- Fast-moving story;
- Laura Vandervoort sex, yay (great acting too, btw);
- Lots of shake-ups;
- No more Tyler, yay;
- Now that's how you kill your mother;
- Jack was the only member of the team to stay true to his principles throughout, and now he's lost them to blissness… aww.
On and off, I've been critical of this series despite watching it almost religiously every week, but I do hope that we'll get to watch a third season. Will we… won't we…? Up to you, ABC.
Upon updating Windows 7 for the first time in a while and rebooting, I was soon horrified to discover that I was unable to connect to any remote hosts over the internet. Miffed, I immediately performed a System Restore but no connectivity was regained.
Looking a bit deeper, I soon realised that I could reach my router's configuration webpage and other machines on my local network, so quickly suspected a routing issue. I also noted that Windows thought I had two "networks", one my "Home Network" and one an "Unidentified Network". With only one NIC installed, I found this odd. I tried to use the options given to delete one of the two, but one seemed to be a bit of a ghost, with no real presence other than in that window.
With help from Steve Hathaway's answer to this thread, I found the answer: a phantom persistent route left in place by Windows pointing to 0.0.0.0 for no apparent reason.
Within an elevated command prompt, I ran ROUTE DELETE 0.0.0.0
to delete the phantom route, then IPCONFIG /RENEWALL
to regain the proper route information. And then everything was fine.
Watch out for this one.
Bootnote
Regarding this post's title, yes I know that 0.0.0.0 isn't an address to "nowhere". I thought it was an apt title anyway.