New Bicycle

April 17, 2010 Leave a comment

Last week I bought a new bicycle, a Trek 4300 with disk brakes. I took it out for a brief spin after putting it together, but nothing too significant, since I wanted to buy a helmet first. It was the first time I had been on a non-motorized bike in years, and I was a bit unstable, but pretty quickly figured it out.

Fast forward to today… I went for the first real ride on the new bike. Let’s just say it kicked my ass. I probably only rode five or so miles, but there were a lot of hills. When I was climbing the main big hill on my chosen route I thought my heart and lungs were going to explode. I’ve been exercising a lot more regularly since I had heart surgery a few months back (usually doing cardio six days a week). But all that cardio just wasn’t enough to prepare me for that hill. At the end of my ride my legs were just burning and rubbery. I cam home and basically went straight to a nap.

But now I’m feeling better, and certainly glad I bought the bike. It’s going to be great exercise and a good addition to my workout routine to break things up.

Categories: Personal

No Surprise the US Post Office is a Failure

April 15, 2010 Leave a comment

Today I had the wonderful opportunity to participate in National Slavery Day (or the day taxes are due for the unawakened). I submitted my taxes electronically and said a prayer of thanks for free enterprise companies like Turbo Tax who make the process palatable. (Although I do realize that if the tax code were simple, or even non-existent, then there would be no need for such companies.) Unfortunately, I still had to go to the Post Office today to mail a different bill.

Once upon a time I could walk into my Post Office and commune with a vending machine that would happily take my money and spit me out a stamp. Apparently all this efficiency wasn’t good for the USPS and they decided to remove said machine. So today I got to wait in line for 45 minutes to buy a single stamp (I never buy more than one because I usually only mail something once a year). The line was backed out the front door, and yet there were only two employees working at the desk.

Any normal company would be forced to recognize (by simple economic facts) that they need to improve efficiencies, cut costs, and make their customers happy. The USPS is not a normal company! They have the luxury of being able to obtain subsidization from the Federal Government to make up for their incompetency.

This is a perfect example of what happens when the government provides assistance to a company with the excuse that the company is too important to be allowed to fail. The end result is that resources (manpower, property, money, etc.) remain invested in a very inefficient way, preventing those resources from being used to their fullest potential. If the USPS were allowed to fail, they would either improve their business practices so they wouldn’t fail, or they would fail and the resources would be reallocated to something more useful. If there were still a need for the USPS functionality, it would be met by another company or through other means.

Categories: Politics

Welcome to the Chaos

April 14, 2010 Leave a comment

Welcome to my new and improved blog. Okay, maybe not really improved, but at least managed by somebody else’s server, time, and money.

I chose the name for this blog for two reasons. First, I believe in the principle of spontaneous order arising from the chaos of many individuals making independent decisions in their own self interests. Second, I hope that out of the random chaos of my musings on different topics, some ordered thinking or coalescence of thought will arise spontaneously. I also wanted to have a really cool, pretentious-sounding Latin title for my blog. It must be the wanna-be-lawyer in me.

Update: I have also imported all the posts from my old blog site into this one, so none of the goodness has been lost.

Categories: Personal

More debugging-geekness

January 20, 2010 2 comments

So yesterday I was troubleshooting some window creation issues, and had to fool around in the kernel side of window creation, down in win32k.sys. Specifically I was looking at window class registration, which happens when you call RegisterClassEx from your Windows app. Down in the kernel, some magic happens with creating Atoms as part of the window class registration. I traced through a bunch of win32k.sys routines to figure out where in memory they were storing this, and then I wanted to dump the table. After dumping about 4 of the entries manually, I got bored and wrote this little gem:

r $t0=poi(poi(win32k!UserAtomTableHandle)+c)
.for ( r $t1=0; @$t1 < @$t0; r $t1 = @$t1 + 1 ) { du poi(poi(win32k!UserAtomTableHandle)+10+( @$t1 * 4))+c }

Basically, this uses the symbol win32k!UserAtomTableHandle to find the length of the table, and then uses a for loop to go through, calculating the offset of each item, and them dumping its string value. On my Windows 7 system it produced something like this:

8c2a3d1c “Native”
878b0c9c “ObjectLink”
87e1e18c “AeroWizardInternalFrameButtonCli”
87e1e1cc “cked”
878cb314 “Static”
878cb104 “DDEMLUnicodeClient”
9620faec “DataObject”
8c2affa4 “ACTIVATESHELLWINDOW”
8c2afe34 “FlashWState”
9620fa84 “SysCH”
8c2b2ce4 “PBrush”
8c3b8f24 “MSUIM.Msg.RpcSendReceive”
878bb7b4 “SysIC”
878cb1ec “DDEMLEvent”
878bb784 “SHELLHOOK”
8c2b2e0c “Custom Link Source”
9159dc84 “AltTab_KeyHookWnd”
91529084 “Search Box”
878bb6f4 “SysDT”
8c2b2dd4 “Link Source”
9620fb8c “FileName”
87e35b0c “GDI+ Accessibility”
878bb664 “SysWNDO”
878bb854 “DDEMLAnsiServer”
87e0c0bc “SysLink”
9620fb24 “NetworkName”
8c2cde3c “USER32″
8c2b2d14 “OleDraw”
9620fb5c “FileNameW”
8c2b2bec “MoreOlePrivateData”
8c282434 “Edit”
9620fbbc “Binary”
878cb374 “OleClipboardPersistOnFlush”
8c2a3d4c “OwnerLink”
878cb2e4 “ListBox”
8c2b2e54 “Embed Source”
878bb634 “SysIMEL”
878cb224 “ComboLBox”

Categories: Computing and Software Tags:

Neato Debugging Trick

December 9, 2009 Leave a comment

I had to debug an annoying little problem today that I thought might be worth writing about. I was interested in walking through some code that was failing, but the same code was getting called in a recursive loop, so there were literally hundreds of successful runs that I was not interested in prior to the single failure I did care about.

Now a normal usermode developer might just add some special code at the point of failure to detect the failure and recall the failing function. Nice and easy. But that’s really not any fun, and when you’re doing kernel debugging, writing some new code and getting it running on the machine is not quite as simple (it’s not hard, just more time consuming).

Enter this neato debugging trick…

bp address “j (dwo(status)!=0) ‘r @rip=fffff880`02b5bd1f’; ‘gc’”

Basically this executes a conditional test (the “j” command) each time the breakpoint is hit. If the DWORD value represented by the variable named ‘status’ is non-zero, then I know I’ve hit the failure condition. In that case, I just adjust the instruction pointer back up to before the failing function call, leaving me right where I am ready to trace into the function and see the failure. Otherwise, the breakpoint essentially just hits ‘Go’ to continue on to the next hit.

The syntax here is a bit rough, and would have to be modified if your program isn’t always at the same code location (since I hard-coded the rip register). It could be replaced with an offset from the current location to be a bit more elegant. But since I was working on a driver, it was always in memory and at the same place, so I was lazy. (A habit that always pays off immediately.)

Categories: Computing and Software Tags:

Sean Hannity is Math Challenged

August 23, 2009 Leave a comment

So I was just driving back home from getting some lunch and the Hannity show happened to be on the radio. He was talking to a “liberal” about the health care reform issues. The caller was pointing out that the U.S. ranks #38 in the world in life expectancy. (According to the CIA World Factbook 2009, the U.S. actually ranks #50 in the world for life expectancy at birth.) The caller was trying to make the point that maybe our health care system isn’t that great.

Hannity’s response was that the numbers were skewed by the fact that the U.S. has so many soldiers dying around the world to protect the freedom of all those other countries (and ourselves). So it got me thinking about the numbers on the way home, and when I got back I decided to do a little math.

According to the CIA Factbook the 2009 population of the U.S. is 307,212,123. The life expectancy at birth is 78.11. So if you take away 10,000 of that population and replace them with 10,000 people who die at age 19, guess what the average life expectancy becomes… that’s right. 78.11. Exactly the same.

The reality is that we would have to have around 325,000 of our soldiers die at age 19 in order to move our placement at 50th into 51st (behind Albania). So what can we learn from this lesson… Hannity is FULL OF S**T.

Note that this exercise doesn’t say anything about the health care reform. Hannity’s lack of math skills don’t imply that we need a public option, single payer, etc. I think that there are small, much less costly ways to improve our health care system, and we should explore those LONG before we create another Medicare to bankrupt us.

Categories: Politics

Stanley Cup Finals Game 7

June 12, 2009 4 comments

Tonight I had the experience of a lifetime. I was able to attend the final game of the 2009 Stanley Cup playoffs, and (more importantly) I was able to see MY team – the Pittsburgh Penguins – win the Cup.

I decided Wednesday night that I would try to get a ticket, and I was actually able to find one online through the Red Wings ticket exchange. It wasn’t cheap, but I figured that this kind of opportunity doesn’t come along all that often. I bought the ticket, a plane ticket, booked a hotel and a rental car, and less than 24 hours later, I was off.

I got to Detroit late Thursday night, checked into an airport near the airport, and the Friday morning I headed into downtown Detroit. I had lunch at the Hockeytown Cafe, and then walked down to Joe Louis arena. There was a party at the riverwalk next to the stadium. I hung out there for hours, listened to some bands, and watched some planes doing some racing and aerobatics over the river.

The game was MOST EXCELLENT. It was by no means a given that the Pens would win. There were some tense moments, particularly in the third period. As the buzzer sounded signaling the end of the game, there was a half-second of disbelief, and then the moment hit me!

I snapped as many pictures as I could, met some very nice Red Wings fans, and some very nice Penguins fans as well. The negative stories that I had heard about Detroit prior to coming turned out to be not true at all. Everyone I ran into during my stay was friendly, in spite of me wearing the wrong colors.

What an awesome trip! Go Penguins!

Categories: Personal

Audit the Federal Reserve Bank

April 25, 2009 1 comment

I would imagine that anyone who reads my blog is probably already aware of some of the controversy surrounding the Federal Reserve Bank. But just in case, I wanted to make a quick post and encourage everyone to look into H.R. 1207 “Audit the Federal Reserve Bank”. Give your representative a call today and encourage them to support this resolution or thank them for their support. (Almost 100 representatives have already co-sponsored this resolution.)

The Federal Bank is basically in charge of massive portions of our financial system. They control the money supply, borrow money from other countries, lend money to financial institutions, etc. And the truly scary part about this is that NOBODY OVERSEES WHAT THEY DO. They report whatever numbers they feel like, and in recent years have stopped publishing data about the money supply. Even the Congress does not hold them accountable or exercise any oversight on their actions.

The problem is, that the Constitution gives CONGRESS many these financial powers: “to borrow money on the credit of the United States . . . to coin money, regulate the value thereof.” These are powers, than even when exercised, should NOT be turned over to a third party with complete autonomy. Congress has the responsibility to make sure that these powers are used correctly and responsibly, and WE should hold THEM accountable to do so.

Categories: Politics

Does it Ever Make You (Double)Think?

April 23, 2009 3 comments

This semester in school, I have been taking a course titled “Foundations of American Constitutionalism.” It has been a brutal course simply because of the amount of work required, but it has also been one of the best courses I have ever taken. I have learned more about the Constitution, and the thousands of years of change that let to its creation, than I was aware even existed.

Last night we had our last lecture, and as I was leaving class I was thinking about everything we had covered. I started thinking about another student who I know is an active member of a certain political party and appears to support anything they do. Which party isn’t important since what I was wondering applies equally to both.

Does somebody who studies the Constitution and what the Founders thought was good and right ever question their own modern beliefs and party actions? If you’re a good little party Democrat, do you ever stop and realize that the Founders didn’t think government should be limited to protecting the basic natural rights such as life, liberty and property. If you’re a good little Republican, do you ever stop and think that the Founders would be disgusted by all we do in the name of “national security” today?

Or do you somehow compartmentalize so that you can simultaneously believe two things that are completely incompatible? Have we come to the point where George Orwell’s 1984 is true? Are many modern American’s so adept at “doublethink”?

Categories: Politics

Blog Wars 2009

February 27, 2009 1 comment

My brother is having this pretty funny blog war with his wife right now. It’s pretty amusing to see all the back and forth. Who knew blogs could be such a big deal?

Categories: Personal
Follow

Get every new post delivered to your Inbox.