GTK Popup Window Bug Fixed

Back in March 2003, I filed a bug against GTK on Windows. You see, it wasn't handling popup menus correctly, so when the window with the popup lost focus, the menu would stay up on the screen.

This bug has finally been fixed - only two years and five months after it was reported. I guess I should be happy, but frankly, I'm not really.

You see, this was a pretty major bug in GTK on Windows - it broke some pretty basic Windows functionality. That it took so long for it to get fixed is, frankly, amazing to me.

The whole idea behind Open Source is that there are many eyes looking at it, which leads to fewer bugs, and faster bug fixes.

To that, I say, in best Steve Carrell tradition, "Where's your god now, Moses?!"

(This is the only Open Source / Linux post that will ever be made to this blog. Treasure it, for it is an only child).

(more...)
#technology, #rants, #oss
Bookmark the permalink.

Hangover cures...

There's a reason this blog is called Accidental Scientist. I originally started it up to post things I'd discovered about life, the universe and everything else... but especially about the things that I like to call "stupid human tricks". So without further ado, it's time to get stuck in with the first little tidbit that I've found so far...

How to cure a hangover

As I've gotten older (and I hear that most people are like this), I've had more and more hangovers after a night on the town. Admittedly, as I've gotten older, I've started drinking a hell of a lot more (stress will do that to you), but that's beside the point. Some hangovers have been so bad that they've completely taken away my Sundays from me - as I've spent them wandering around in a daze going, well, ouch.

No longer. I think I finally figured out the perfect hangover cure.

You will need:

  • Two eggs
  • A bottle of gatorade
  • Eyedrops (preferably just natural tears - Genteal are pretty good)
  • Water
  • Caffeine, aspirin and ibuprofen (not acetaminophen or paracetamol)
  • Two multivitamin tablets.

NOTE: I am not a doctor, nor am I pretending to be one. This advice could help you, it could kill you, or it could turn you bright blue. I honestly don't know. Follow it at your own risk.

Here's how you use the ingredients.

Water

Drink this before you go to bed - as much as you can manage. Drink it while you're drinking, and it'll help too. But drink as much as you can - alcohol dehydrates you, and your liver and kidneys work much better at getting rid of toxins when they have water to work with. Drinking water is your first line of defence against a hangover.

Gatorade

You drink this the next day. It's basically sugar water, with electrolytes to rebalance your system a bit (because when you get dehydrated with alcohol, you're peeing out most of the salt in your system, and as your body is basically a large bag of salt water, you really need to replace it).

It's the best and easiest way to get fluid into your system, and has its own handy-dandy built in automatic rehydration indicator - if it tastes good, you need to drink more of it. Once it starts tasting unappealing, you've had enough - you're rehydrated. Sneaky, huh?

Eggs

Boiled, fried, poached, whatever. You just need them. You can try eating them the night before if you can stomach them - but that will depend on how drunk you are. (And cooking when drunk, like driving when drunk, is a recipe for disaster).

Eggs help a hangover in two ways. Firstly, and most importantly, they're one of the most nutritious sources of cholesterol you can get.

Yes, that's right, cholesterol. You know that thing that doctors tell you is bad for you? Welllll... you see, there's another side to that argument. Cholesterol is bad - when it's clogging your arteries. When you're drunk, however, it's a whole other story. You see, your liver runs pretty much exclusively on cholesterol, and it burns fat to metabolize alcohol. This is why, among other things, doctors now say that drinking will lower your cholesterol (it does - because your liver kicks it up a gear). It's also why hardened Russian vodka drinkers will eat very fatty foods while they drink - because it helps them metabolize the alcohol.

If you've ever wanted to drink someone under the table, eat a lot of eggs. Or other similarly high-fat foods. And keep eating them while you drink. You'll be able to carry on (relatively sober) while they slowly slip into oblivion...

Eggs don't just contain fat, they contain plenty of incredibly bio-available protein. Your body loves eggs - in fact, some people claim that eggs contain about the easiest protein for your body to digest.

Protein's really good when you have a hangover, because protein is broken down into amino acids in your body, and amino acids are used to build neurotransmitters - which you screwed up by drinking. Alcohol makes your body dump norepinephrine and dopamine into your system, rapidly depleting your supply (the lack of norepinephrine, by the way, is why you snore more when you've been drinking than when you're not... and if you don't naturally build your supplies back up fast it also can cause anxiety days afterwards). So if you really want to feel happy, you're going to need to replenish those guys - and eggs (and sardines - but let's face it, who can eat sardines with a hangover?) are probably one of the best ways of doing it short of spooning down one of those muscle-building amino acid gloopy concotions you can buy at the gym.

Alcohol, in case you're wondering, also screws with about 100 other neurotransmitters. Which is why you shouldn't drink if you're on any kind of psychoactive medication.

Eggs also contain vitamin C and B12, both of which are water soluble vitamins, which means that when you spent all that time the night before peeing your hard earned cash down the drain, you lost a lot of those too. You need to replenish them - and eggs are a great way to do this.

Eyedrops

Why eyedrops? Well, do you remember the film Withnail and I? Where Withnail says that he has "a real bastard behind the eyes"?

Nine times out of ten, the worst part of your hangover is caused simply by the fact that your eyes are dry. No, really. They're about the first thing to dehydrate in your entire body, other than possibly your T-zone.

The thing about eyes is that they're not exactly good at reporting problems to your brain. They have pain sensors, and touch sensors, but they're pretty lousy at what they do (and spread pretty far apart, so they're not that accurate). Not only that, but until you train yourself to recognize the difference between a real (vascular) headache and the pain that comes from dry eyes, you won't even figure out that the pain you're feeling is really in your eyes - because it feels like a band of pain behind your eyes, or across the front of your head.

Sure, sounds like a bad design, but it's like that because your eyes are busy doing other things - like seeing things - so nature skimped a bit on the pain receptor part. Either way, the pain that you get from a hangover is mainly this pain from your eyes. Try to visualize it next time you have a hangover, and the lightbulb will suddenly go on. By the way, when your eyes are in pain, they have an amazing ability to make you feel tired. It's automatic - nature's way of protecting them is to get you to shut them, and the easiest way to do this is to make you feel tired and go to sleep. It's half of why you feel like a slug after a night on the town. (The other half is probably real sleep deprivation).

How do you fix this? Really easy. Apply eyedrops frequently (once every 10 minutes or so) to each eye, until you've drunk enough Gatorade that it stops being a problem. Genteal are recommended by my eye doctor because they're preservative free in the eye. (And he's a great eye doctor - one of the best I've ever been to - if not the best).

Multivitamin tablets

As I said earlier, you pee out a good portion of all of the water soluble vitamins in your body when you're on a bender. Take one before you go to bed (if you can stomach it), and one in the morning when you get up (again, if you can stomach it - you might need to take it after eating the eggs) to replenish your system's supply.

Caffeine, Aspirin and Ibuprofen

In cases where the hangover's not too bad, you can skip the caffeine, aspirin and ibuprofen. (I skip the caffeine most times myself). However, if the other tips just won't shift it, aspirin, ibuprofen and caffeine will help. This cocktail is basically a version of Excedrin which swaps liver damage for stomach bleeding - frankly, I prefer to have a internal bleeding than risk shutting down my liver - and as Excedrin uses Acetaminophen/Paracetamol instead of Ibuprofen, it's a bit too risky to take after drinking.

Caffeine

Caffeine is a vasodilator - it opens up the blood vessels in your head. These blood vessels can constrict while drinking, causing a vascular headache (this is a true headache, unlike the eye-pain I mentioned above) - and the caffeine cures that. It'll also give you a bit of a buzz and perk you up - but I avoid it if I have a hangover - it just makes me feel weird and almost hollow, like I'm not really there. It's also a diuretic, which isn't exactly productive when you're already dehydrated.

Aspirin

Aspirin's an old folk remedy made good - people realized that taking willow bark made people feel better when they had a headache. Enter chemistry, and pharmaceuticals, and whaddya know, we have the refined version. It's mainly an analgesic and anti-inflammatory agent, shutting down production of pain transmitting chemicals in the body. Helps me anyway.

If you're taking aspirin, make sure you take the enteric coated ones, to avoid stomach problems.

Ibuprofen

Another anti-inflammatory/analgesic, but it appears to work on different pathways, and at least for me, will shift headaches that aspirin (or acetaminophen) cannot. It can cause stomach problems, so try to go for coated tablets.

What if all this doesn't work?

Well... either pray, or try more eggs and Gatorade. There's a reason people go to Beth's (home of the 12 egg omelette) in Seattle after a night on the town, you know...

[edit: Added the real Other reason for eggs than fat, which is protein. I missed it last time by accident - and believe me, while vitamins C and B12 are good for ya, the lack of them doesn't really make you feel that bad. Not on that time scale anyway]

[edit: fixed a badly structured sentence which made it look like I was saying that caffeine caused vascular headaches, not cured them]

(more...)

First London... now Birmingham?

20,000 people have been evacuated from Birmingham city center due to a potential terrorist threat.

BBC News coverage: http://news.bbc.co.uk/1/hi/uk/4668313.stm

No more news as of yet... they started evacuating people two and a half hours ago, at 21:00BST.

(more...)

Speaking of ketchup...

There's a small farm in New Mexico called Desert Farms, which makes some fantastic completely organic, home grown, jalapeno ketchup. It has 6 ingredients - tomatoes, water, vinegar, salt, sugar and jalapenoes. Nothing more. Nothing less.

It kicks ass. And may kick your ass, if you're not particularly into hot stuff.

I was introduced to it by a friend of mine at work, who buys it by the crate when he visits New Mexico. These days, he also buys it online here: http://newmexicosown.com/Detailed/105.html

(Oh, and if you're looking for something else that's spicy and yummy, but want more of a dessert than a desert, try these: http://www.cowgirlchocolates.com/, which are also quite excellent).

(more...)

Beat Seattle Traffic with your phone...

Seattle has some cool traffic monitoring technology (LA has it too - as do many other cities). Sensors under the road let you see in pretty much realtime (ok - to within 5 minutes or so) how much traffic is going through a given area. It's great for avoiding traffic jams. They have an app on your PC that you can use (called Webflow), or you can just check their website before you head home. Neat, huh?

But I'm looking for a more ... mobile solution. After all, I have a Smartphone, so I can install apps on it.

You can buy a cute little LCD gizmo with a pager built in from http://www.trafficgauge.com/ - and ok, that's not bad. Except it's $50 for the device, and then there's a $5/month fee.

Pharos has an app for the Smartphone (at http://www.pharosgps.com/smartphone/) , but it's $44 for a year's subscription, or $5 a month, and I hate the idea of paying yet another bill - especially given that the actual data that the Washington State Department of Transport puts out there is available for free.

OK, so there are other (read: less expensive) ways to do it. One is this site - http://www.manoli.net/seattletraffic/ - but frankly, I just don't want a text-only interface. I like the ease of just seeing the visual layout of where things are congested, and where they're not so I can route accordingly. There are some J2ME solutions too, but I was up for a challenge at this point.

So I started writing my own app. I've nearly finished the display code; all that's left is the network code and the plumbing to turn that into stuff you can see on the display. Oh, and given that the WSDOT maps are copyrighted, come up with my own.

Here's a screenshot of where I am right now:

Now, admittedly, this is a bit hard to read, but it's the overall coverage map of Seattle. Hey, think of it this way - at least I know that the bilinear minify routine I wrote works.

(As soon as I have a finalized routine, I'll post an article to CodeProject with the bilinear interpolated stretchblt I've been working on - heck, other people may find it useful).

(more...)

subscribe via RSS