Tom Lachecki

(Tomalak Geret'kal)


On Stopping Firefox 4's Tabs From Jumping Into The Title Bar

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.

Tags: ,
Permalink | No Comments  
Tomalak's Tuesday Tip #11: Sleep Your Way To Success

Tempted to write code like this on Linux?

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:

Tags: , ,
Permalink | No Comments  
Thoughts on V: "Mother's Day"

V's second season ended on a doozy, though I do have a few gripes:

Everything else was great, including:

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.

Permalink | 1 Comment  
Windows 7's Route To Nowhere

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.

Tags: , ,
Permalink | No Comments