Displaying the three most recent posts.

Recreating PC Globe, Part 0: Introduction

— Arvada, Colorado UNITED STATES

So, I've had computer trouble lately. My laptop died, and I had nothing backed up. Fortunately, I purchased a replacement, and I was able to recover my data in spite of the fact that I had nothing backed up. That is a mistake that I won't let happen again.

Anyway, we're well past the holidays at this point. However, due to the aforementioned computer problems and just general laziness on my part, I'm finally getting around to throwing up another blog post that I meant to throw up during the holidays. This Christmas, I managed to get three of my nieces a globe as a present. Perhaps the gift says more about me than it does my nieces: the oldest of the nieces is four years old. When I was about four years old (back in 1990), my father installed a neat computer program on our 25 MHz, 386 personal computer: PC Globe. That, combined with other geographic artifacts such as Where In The World Is Carmen Sandiego?) and a real globe that my grandmother bought for my brother, began a hopeless descent into the world of geography nerdism that still haunts me today.

Anyway, PC Globe: it was a DOS program that was a cross between an atlas and a statistics book containing data on various countries. It had a slick (for the time) point-and-shoot interface; you pointed the mouse cursor over a country on a map and clicked the mouse button. Up popped information about the country that you clicked on: population estimates, age distribution, GNP, languages spoken, ethnic groups, religions, imports, exports… you get the idea. One very neat feature was that you could even get it to display the country's flag while it simultaneously played that country's national anthem on the computer's shitty internal speaker.

I still have a copy of the program. However, it has to be run it through DOSBox because of technical issues. I run it purely for nostalgia purposes; it's entirely useless as a usable tool in this day of age mostly because it's out of date. Remember how I said 1990? If you remember correctly, that was during a period of transition. The Berlin Wall fell in 1989, and the Soviet Union collapsed in 1991. I remember, after being told that the USSR had broken up into smaller countries, calling my father at his workplace to ask him if he could “draw lines across Russia” in PC Globe once he came home from work.

He never did. As disappointed as I was then (i.e., I wasn't), it's entirely understandable to me know how my father didn't want to spend hours hacking someone else's proprietary software… even though he was a computer programmer. Even if he wanted to, writing software back then was incredibly different; mainly, there was no World Wide Web to rely on: that means no Google, no Stack Overflow and no way to download all of the free programming tools… and then there's data. PC Globe wasn't just an electronic atlas: it was a database of a ton of information about each country. We don't appreciate enough the fact that, before Wikipedia, we had paper encyclopaedias. If you wanted up-to-date information, you had to purchase a new set.

Today, none of those limitations exist, so I can finally set out to break the Soviet Union apart. However, rather than tweak the original program, I'm going to recreate my own atlas and database. It's probably going to be an overwhelming task to begin with. Then, once I'm finished, I have the impossible task of… keeping the information up to date.

Yeah.

My finished result probably isn't going to be a perfect clone of PC Globe. I wouldn't want to recreate it exactly anyway even if I could. Besides, this project isn't about the product; it's more just for fun… and nostalgia.

screenshot

screenshot

screenshot

screenshot

screenshot

Tags: Geography, PC Globe, Software Development

Write or View CommentsPermanent Link

Add Comment

If you would like to comment on something that you read, by all means, leave a note here. Please note that all comments are approved before being displayed to prevent spam comments.

Alcohol by Volume vs. Alcohol by Weight

— Arvada, Colorado UNITED STATES

Let's talk about math. If math scares you, don't worry: we're really going to talk about beer.

Beer (or any alcoholic drink for that matter) is mostly just water with some ethyl alcohol thrown in for good measure and trace amounts of other stuff that provides the flavor. Typically, about 5% of a beer is alcohol, so a 12 floz serving of beer will have 0.6 floz of alcohol. Now, I said that a beer is typically 5% alcohol: beer does come in many different strengths. For example, last night, at the Wynkoop Brewing Company, I had a beer that was 8.2% alcohol, and, because the content was so high, the bar gave me a “short pour” which means that they gave me a brandy snifter's worth of beer.

One common strength of beer that is seen especially in the retail area is 3.2% beer. In Colorado, where I live, beer can only be sold in a grocery store if its strength is less than 3.2%. If you're fine with drinking 3.2% beer, you can pick up your watered-down, mass-marketed, American pale lager at the same time you buy your milk and eggs. If you prefer wine, whisky or beer that's stronger than 3.2%, you need to make a special trip to the liquor store.

So, if we do the simple math on this and divide 3.2 by 5, 3.2% beer has only 64% percent of the amount of alcohol that a normal 5% beer has. That math would be fine except that it's completely wrong.

For some legal or historical oddity that I think has to do with taxation laws (but I am not sure), when a beer advertises itself as 3.2%, what it means is 3.2% by weight as in 3.2% of the total weight of the liquid is alcohol. Just about every other time you look at an alcoholic beverage label, the alcohol content is listed by volume… and they are most definitely not the same. Well, they are the same, but only in exactly two instances: 0% alcohol by weight is 0% by volume, and 100% by weight is also 100% by volume. However, between those two extremes, the relationship is not linear.

Most calculators that I come across on the Internet, however, do assume that the relationship is linear with the common assumption that the alcohol by weight (ABW) is 80% of the alcohol by volume (ABV). This may be close enough for the range of alcohol that covers most beers, but “close enough” only counts in horseshoes and handgrenades. We can do better.

So, let's think: how is alcohol by volume (or ABV) defined? Well, it's a ratio of the volume of alcohol divided by the total volume. Now, the total volume of an alcoholic beverage is alcohol and water… and some other stuff that provides the taste, but for our purposes, let's just ignore that other stuff—alcohol, water and nothing else. When we put it together, we get something like this:

$$ABV = \frac{VolumeOfAlcohol}{VolumeOfAlcohol + VolumeOfWater}$$

Okay, but we're dealing in weights—not volumes. Since a volume of something is equal to the weight of that something divided by its density, we can replace the volumes with weights, so let's consult Wikipedia (the most peer reviewed publication on the planet). If we look up the appropriate articles, we'd find that ethyl alcohol (the type used in alcoholic beverages) has a density of 0.78945 kilograms per liter at 20°C (68°F). At that same temperature, water has a density of 0.9982336 kilograms per liter. For this exercise, let's round it at 0.99823 kilograms per liter. If we replace the volumes in our equation, we end up with:

$$ABV = \frac{\frac{WeightOfAlcohol}{0.78945 \frac{\mathrm{kg}}{\mathrm{l}}}}{\frac{WeightOfAlcohol}{0.78945 \frac{\mathrm{kg}}{\mathrm{l}}} + \frac{WeightOfWater}{0.99823 \frac{\mathrm{kg}}{\mathrm{l}}}}$$

…and if we simplify that, do the dimensional analysis and eliminate the decimals, we get:

$$ABV = \frac{99823 \cdot WeightOfAlcohol}{99823 \cdot WeightOfAlcohol + 78945 \cdot WeightOfWater}$$

Our units cancel out in the dimensional analysis, which, since the ABV is a ratio, makes sense. Now, remember when I said that we're dealing with weights? I lied. What we actually know is the alcohol by weight (ABW), and we know the ABW is the ratio of the weight of the alcohol to the total weight. This is very similar to the equation that we started with for the volumes:

$$ABW = \frac{WeightOfAlcohol}{WeightOfAlcohol + WeightOfWater}$$

Well, we could try to solve this all as a system of equations. Let's solve our ABW equation for either the weight of the alcohol or the weight of the water. (It won't matter which one in the end, but let's pick weight of water.) When we go through the steps to solve for the weight of water, we get:

$$WeightOfWater = \frac{WeightOfAlcohol \cdot (1 - ABW)}{ABW}$$

Let's plug that into tho ABV equation and simplify. If you've been following along on your TI-89 from high school, you should get:

$$ABV = \frac{99823 \cdot ABW}{20878 \cdot ABW + 78945}$$

…and there's our formula. What's interesting is that when we plug in the weight of water from the ABW equation, the weight of the alcohol gets canceled out. If we would have plugged in the weight of alcohol instead, we get the same results.

If you need to convert the other way around (i.e., obtain the ABW from an ABV), you just need to solve the above formula for ABW:

$$ABW = \frac{-78945 \cdot ABV}{20878 \cdot ABV - 99823}$$

So, when we put 3.2% into the equation for the ABW, we come within a rounding error of 4.0%. Remember how we did the math and we said that 3.2% beer is 64% as strong as regular beer? Well, it turns out that, since 3.2% beer should really be marketed as 4.0% beer, it's really 80% as strong as regular beer. Keep that in mind before you consider chugging down another 3.2% bottle after you've already had a few: it may be more potent that you think.

Tags: Beer, Mathematics

Write or View CommentsPermanent Link

Add Comment

If you would like to comment on something that you read, by all means, leave a note here. Please note that all comments are approved before being displayed to prevent spam comments.

Meta Matters

— Arvada, Colorado UNITED STATES

I've had this blog since January of 2005. Every month for the past nine years and eight months, I've been pretty faithfully updating this blog by posting an entry at least once a month, but it's not the same as it used to be. In 2006, I managed to write 139 blog posts with no problem. So far, this year, I've only written nine… and we're already nine months into the year. In addition, the past few posts were written close to the end of the month. I somehow managed to be lazy for twenty-nine days of the month only to arrive at day thirty and hastily have to chalk up a blog entry in order to claim that I've kept my streak alive.

It's impressive to say that you've been blogging for the past ten years, but, for me, it's time to put an end to this blog. Essentially, I'm starting over on the blogging. Sometime within the next few days, I'll be removing all of my old posts and… starting over. For a few years, I've been toying with the idea of making a software-development blog, but I never felt that combining software-development topics here was appropriate given the topics of my other posts. If I'm starting over, I no longer have that constraint. However, I'm not sure if I really want to go towards software development as a theme. Looking at my bookshelf, I see books about not only software development but history, religion, linguistics and now homebrewing too. I think that any of these topics could be good material.

One thing that I'm sure of is that I want to write in a more professional manner. What really irritates me is that, when I go back to read old posts, I'm embarrassed about the quality. Many or most of my previous posts show little or no research effort; it's just somebody's incoherent ramblings put down on paper (metaphorically). After doing a short stint in graduate school (for the second time) and after looking at some other quality blogs carefully, I've come to appreciate the value of well-written prose. If I really need to ramble incoherently, I still have Facebook and Twitter to fall back on.

Back when I started blogging, it seemed that everyone had a blog. (Remember Xanga?) Now, it seems that fewer people still blog. Fortunately, I believe that the blogs that are still out there are better quality. If I'm choosing to continue blogging, I need to keep up with the times.

In summary, I don't know what I'll be writing about from here on out, but I can definitely say that I'll be focusing more on quality than quantity. Don't be too surprised if, ten months later, this is still the only post on the site. Fortunately, it means no more midnight writing on the last day of the month just to keep the streak alive.

Tags: Meta, Personal

Write or View CommentsPermanent Link

Add Comment

If you would like to comment on something that you read, by all means, leave a note here. Please note that all comments are approved before being displayed to prevent spam comments.