AT&T Sucks

AT&T sure hates the fact that their 3G coverage sucks and Verizon is pointing it out.  The latest ad (been out for a while, actually) says that only AT&T allows you to talk and download at the same time.  Big deal if you can't get 3G service!

I hate AT&T.  I have to have them for local phone service because I use DSL and their monopoly makes them the only game in town -- and a very expensive option at that.  Cable is better for internet, but Time Warner is even lower on the scale of "good companies" in my book.  Better of the two evils -- so AT&T wins.  Thankfully, my actual DSL provider is a local company (Portbridge) and they are very good.  It's still AT&T's loop and I have to have local phone service, but at least AT&T is getting the least money possible from me.  I hate monopolies. 

I thought deregulation was supposed to fix all this?

Of course not!  Deregulation never helps the consumer.  Well I've derailed from my original point.  So, in conclusion, fuck AT&T and fuck Time Warner!

And Happy New Year!  :-)


President War Hawk

As usual, The Rude Pundit is right.  President Obama never promised to not escalate the war/occupation in Afghanistan.  I knew this voting for him.  And yes, Rude is also right that I made that little platform negotiation in my head (I'll trade war for health care, etc.).  However, one point I think Rude is a bit wrong on is on how Obama's liberal plans are panning out.  Aside from Gitmo, I think he's done a good job advocating liberally.  It's not that he's just waffling on liberal issues because he doesn't believe strongly in them.  He's doing it because he has absolutely no choice. 

The fact is, despite an overwhelming majority of Democrats, we do not have a liberal -- let alone socialist (I LOL every time I hear a winger say that) congress.  We have a center-right congress.  For every Al Franken, Bernie Sanders, and Brad Miller, we have nearly as many Blue Dogs, Republicans, and Conservadems.  That's not even including the truly "moderate" Democrats (conservative Democrats are not moderate, by definition).  That makes it very difficult for a progressive agenda.  But if there is one thing the majority of congress agrees on, it's killing foreigners!  Especially if they have brown skin or happen to be of the Islamic faith.  Show me any federal politician (except a very small handful) and I'll show you a war hawk!  So when Obama proposes his Afghan strategy, expect much rejoicing at our country's ability to wag its gigantic military penis at everybody else.  Oh, sure, Republicans will whine about how they don't like it.  But it won't be because they are anti-war.  Hell to the no!  It will be because it's not hawkish enough!

So, I don't see any reason to blame Obama about this American Empire Building Adventure or, by contrast, the watered down nature of his liberal promises.  He's just delivering what he can within the best of his abilities and a stubborn congress.  And that just happens to favor the righties more than us lefties.  Although, I do think he should take a stronger stand on Gitmo.  But that's just my opinion.

So what can you do to stem the hawkishness if you are anti-war, like myself?  Well, one way is to invoke the other great fear that the conservative (Democrat and Republican) hawkers have: taxes.  You probably thought I was going to say deficit and/or debt.  Nope.  Oh, sure, they say they are all against rising deficit and debt.  But that's a complete load of campaign trail sales pitch BS.  The Clenis (aka Uberliberal Circa Nineteen Hundred and Ninety Two – according to hawks) left us a freaking budget surplus!  Fiscal Conservative Reagan?  No.  Fiscal Conservative Bush The Smarter?  No.  Fiscal Conservative W?  No.  Now, it's easy to just blame W for the squandering of the surplus.  But remember, he wasn't the enabler.  He needed congress to do it, and boy howdy, did they ever!   And who was at the center of it all?  The "tax and spend" liberals?  No.  The "fiscal conservative" (heavy irony quotes) war hawks were.  So, anyway, yea, you can't fight them by complaining about how it adds to the deficit.  They just do not care. 

But the hawks can hear when you mention a tax!  Have you seen the outrage of Rep. David Obey's proposition that our wonderful adventures in Afghanistan actually be paid for like healthcare?  The hypocritical outrage is absolutely laughable.

So that's why I absolutely, 100%, support a special tax on wars.  In fact, there should be constitutional amendment requiring that all foreign military adventures (whether or not they are officially declared "war" by congress) be paid for by a special progressively increasing income tax (structured similar to the standard federal income tax, but without any exemptions or limitations to those not in poverty).  It's time the rest of us feel a teensy tiny pinch while military families and families in the areas we are attacking are literally torn apart.  Wars should simply not be allowed to be funded by deficit dollars.  Budget neutral!  End of story.  How on earth could a real fiscal conservative disagree with that?

But that will never happen because the majority of our current congressional representatives care more about getting reelected than following their stated principals, let alone doing good for simple the sake of doing good.  Remember that when you are voting for your representative and senators.  I am not a pessimist.  We can change this.  Obama's campaign (not Obama himself) proved this.  All politics are local, etc.

So do something, already!  Write your reps.

Post-Obama Speech Update (8:41PM): I don't want to deeply analyze what he said or get all pundity here, so I'll leave that to the professionals.  I do, though, want to comment on Obama's timeline.  He said in 18 months after the January "Afghanistan Surge" we will begin bringing troops home.  Now, I don't want to imply that he said everybody will be home in June, 2011 -- that's not the case.  But I was honestly shocked that in a mere three Friedman Units, he thinks we can get this under control and to some degree successful and secure enough to where even moderate war hawks can be happy with drawing down forces.  I'm still anti-war, but I would be extremely pleasantly surprised if that ends up being the case.  I'm a bit skeptical this timeline will not be extended, though.  That said, I am much more confident than any time anybody from the previous administration, or Little Tommy Friedman himself, proclaimed all will be well in just six more months.  Whether or not you agree with Obama's approach, at the very least, the adults are back in charge.  President Chimpy certainly left a lot to be desired in that respect.


Quickly Dimming an Arbitrary Bitmap in Compact Framework for VB.Net

I had a need to directly manipulate the bytes in a bitmap for my VB.Net app for Windows Phone.  I found quite a few articles with The Google on how to do this in C#, using the unsafe keyword.  That's a perfectly fine way of doing it for C# users.  However, VB.Net does not have anything like the unsafe keyword, so there is no way to run unsafe (unmanaged) code blocks.  Philosophically, this might be a "good" thing to Managed Code purists.  I'm actually neutral on the issue.  Still, just because you can't do arbitrary pointer and memory manipulation in VB.Net does not mean you can't do this very simple thing (dimming the color brightness of each byte of a bitmap).  It's pretty easy and I can't believe nobody out there has posted how to do it this way VB.Net or C#.  I came up with this code for the Compact Framework for Windows Phone specifically, but it will also work in the big Framework for big Windows.  It will work in both VB.Net and C# just fine.

The key to this method is using the Marshal.Copy method.  This copies a block of memory from an IntPtr to various types of arrays and then back again.  Whereas the unsafe method directly manipulates the bytes in the bitmap, this code block copies the unmanaged bytes to an array, manipulates them, then copies them back to the unmanaged buffer.  Using the 'unsafe' method is likely a hair faster, but in real world performance metrics, even on Windows Phone you would be hard pressed to see any noticeable difference between the two.  Copying blocks of memory is a very fast operation.

This code adjusts the brightness of a bitmap, dimming it by half (a bit shift of >>1 for each color component of each pixel).  Windows Phone natively uses 16bit bitmaps ('565' format, as in RRRRRGGGGGGBBBBB).  The below code block can be adjusted to work with 24 and 32 bit bitmaps as needed.  It's actually easier to use 24 and 32 bit bitmaps as you just manipulate the brightness of  individual Byte primitives without needing to break apart the Int16 (short) using bit masks, as below.  However, the act of converting the 16 bit bitmap to a 32 bit bitmap on Windows Phone seems to cause a significant a performance hit!  So don't do that on Windows Phone.  Stay with the 16-bit bitmap and use bit masks, as I did below.  For big Windows, you will want to use 32 bit bitmaps, not 16 bit bitmaps.

Private Sub DimBitmapByHalf(ByRef bmp As Bitmap)
  Dim bmd As Imaging.BitmapData = bmp.LockBits(New Rectangle(0, 0, bmp.Width, bmp.Height), Imaging.ImageLockMode.ReadWrite, Imaging.PixelFormat.Format16bppRgb565)
    Dim bufLen As Integer = (bmd.Stride * bmd.Height) / 2 ' Because bmd.Stride and bmd.Height are in units of 8-bit bytes
    Dim buf(bufLen - 1) As Short
    Dim r As Short
    Dim g As Short
    Dim b As Short

    System.Runtime.InteropServices.Marshal.Copy(bmd.Scan0, buf, 0, bufLen)
    For i = 0 To bufLen - 1
      '                              RRRRR GGGGGG BBBBB
      r = (buf(i) >> 1) And &H7800 ' 01111 000000 00000
      g = (buf(i) >> 1) And &H3E0  ' 00000 011111 00000
      b = (buf(i) >> 1) And &HF    ' 00000 000000 01111
      buf(i) = r Or g Or b
    System.Runtime.InteropServices.Marshal.Copy(buf, 0, bmd.Scan0, bufLen)
  End Try
End Sub


Water on the Moon! But...

I love science!  NASA has confirmed that the projectile launched into the moon's surface that offered a less than Hollywood spectacular boom uncovered 24 gallons of water.  That is so awesome!  Water on the moon has many benefits.  First, astronauts can drink it.  They can also breath the oxygen, once the water molecule is broken apart.  Finally, the hydrogen can be used for rocket fuel.  Since all these essential resources do not need to be taken to the hypothetical future moon base, a ton of money can be saved!

But with every bit of good news, seems to come a lot of bad, these days.  NASA's Ares rocket system (part of the Constellation program) is apparently over budget and the Obama administration is trying to figure out what to do about this.  This is sad.  After health care and jobs, science is a top priority in my book.  And highly visible, highly inspirational science like the space program should be a huge priority.

Please write the president and tell them how important the space program is to human kind.  Some good talking points would include the number of jobs created by the Ares program and potential future moon missions, the inspiration to the next generation of kids to get interested in science, and the importance of the USA becoming the space leader again. 

The money needed is a drop in the bucket compared to the perpetual needless wars we are involved in.  Only three billion more dollars is needed each year.  Compare that to the nearly one trillion dollars spent so far on killing people in the middle east.

If we don't lead the world on space exploration, it appears China will be glad to fill that role


My DNS Provider Was Hacked

If you tried to visit the Avian Waves website in the last 24 hours, you may have noticed that a spam page (with an embedded virus download) came up instead.  My site, itself, was not hacked.  No, it was much worse.  The DNS provider at Enom (the company the registrar I use, Arbor Domains, is a reseller for) was hacked.  A very large number of sites had their DNS redirected.

Time to switch to GoDaddy.  They are cheaper anyway.  Enom has proven they cannot be trusted with security.  Sorry, Arbor.  It's been a great ten plus year run.  But your DNS and registration tools haven't been updated since the early 2000s.  Plus, I need DNS service I can trust to not be hacked.  And if it is hacked, it needs to be fixed ASAP.


How Come Nobody Told Me The Prisoner Was Being Reimagined?!

Wow!  This is shaping up to be  a good season for teevee science fiction!  First, we get a remade V (which didn't disappoint, although the first episode wasn't as strong as the original, IMHO), now I see that The Prisoner (an absolutely iconic science fiction series from the 60s) is being remade for AMC.  Go AMC!  Go teevee!


More Energy Lobby Sock Puppets!

For several years now, BP has subjected us to the endless "common sense" of its scripted sock puppets on the teevee machine.  Now the Natural Gas lobby has started the same type of ad campaign.  Did you know we have over 100 years of Natural Gas?!  ZOMG BURN IT ALL UP NOW BABY!  SCREW THE ENVIRONMENT!

For crying out loud.  Give me Solar, damn it.  Screw your fossil fuels.



I am a big fan of the original mini-series, V, that aired in 1983.  I was pretty young back then, so my recollection of the series is primarily through re-runs on Syfy years ago before the channel had a stupid name.  The mini-series was gripping and original.  The WWII analogies were strong and well written, and the character reactions of the story were very plausible.  In addition, the main protagonist was a cameraman.  Give it up for the geeks!  The story ended with a victorious battle, but the war was very far from over.  There were lots of open ended questions and cliff hangers.

The next year, a sequel mini-series was made, V: The Final Battle.  It completely sucked1.  They either ignored or quickly wrapped up the very dramatically laid loose ends from the previous year in very unsatisfactory ways.  The story devolved from a WWII analogy into more of a religious analogy, with the hybrid human-visitor having magical Christ-like powers that neither parent possessed (seriously, wtf?).  And they had Michael Ironside(Has your favorite show jumped the shark?  If Michael Ironside was just added to the cast then the answer is yes!)   And to top it all off, the humans beat the visitors with the most lame War of the Worlds deus ex machina2 rip-off ending ever – complete with like fifteen minutes of stock footage cheering and rejoicing!  After that, NBC started a series sequel to V.  The visitors quickly developed an immunity to the poison dust, lost their warbled distorted voices (no explanation given), regained rule over the planet with little resistance, and the series continued to suck and disappoint like only a series that jumps the shark before it even begins can!

Anyway, so there's a new V series starting tomorrow.  I'm very excited about it.  The whole premise of V is very rich and exciting.  It's unique in that the aliens don't just nuke cities a la Independence Day, but instead use politics, torture, mind control, and media manipulation to gain control of Earth.  I think the WWII parallels also create a very eerie sense of "omg, dude, this could totally really actually happen" since in human history it did actually happen (sans aliens) in Germany.

The one thing that concerns me about the new V series is that the synopsis sounds more like the reimagined Battlestar Galactica than the old V.  There is plenty of room for the writers to come up with great storylines, don't get me wrong, I just hope that it does the original honor with a lot of manipulation and very little nuking.  Battlestar already thoroughly explored the human condition (IN SPACE) with regard to modern problems (terrorism, modern warfare, torture, etc.).  I want a strong manipulative invasion story, where humans are pitted against humans and the visitors are pulling the strings.  Here's hoping it doesn't suck!  (Reviews are good so far, so I'm excited!)

1. The Final  Battle was apparently made without much input from original "V" mythos creator, Kenneth Johnson.  Mr. Johnson eventually published a book in 2008 which contained (I would presume) his preferred ending to the V story, ignoring the entire Final Battle and subsequent series storylines completely.  I need to read this.

2. I should point out that War of the Worlds is not lame, despite the lameness of the similar ripped-off ending used in V: The Final Battle.


My Letter to Senator Hagan Regarding the American Health Security Act of 2009

Senator Hagan - I am writing this letter to urge you to support Senator Bernie Sanders' American Health Security Act of 2009, which is a Single Payer health care bill.  I have no delusions of this bill's ability to pass the Senate - it surely will not. 

The reason to vote in favor of it is to measure the support in the Senate of a single payer style health care bill.  This is something that likely will not be able to pass for decades, but what Sen. Sanders is doing is important because it gives us a baseline to see how many votes we have now, and how many we need to work for in the future.

I am currently 32 years old.  I hope to see a single payer system implemented in the USA before I die.  This is a fantastic first step.

Please show the rest of the country that North Carolinians are progressive Southerners -- not knee-jerk-reaction head-in-the-sand conservatives.

Please support the American Health Security Act of 2009.


Mystery of the Server 2008 + IIS7 + OLE = "MDAC Not Installed" Error

Talk about barking up the wrong tree!

I just solved a very peculiar error regarding migrating old ASP.Net OLEDB Excel/Access file access code to a new 64-bit Windows Server 2008 under IIS7.  The first steps for migrating this application were obvious.  The application pool needs to run under 32-bit compatibility mode, the pipeline needs to be classic, etc.  But when we got to the Excel export functionality, all hell broke loose.  No matter what we did, we would get the following exception.

Exception of type 'System.Web.HttpUnhandledException' was thrown. [System.Web.HttpUnhandledException]
The .Net Framework Data Providers require Microsoft Data Access Components(MDAC). Please install Microsoft Data Access Components(MDAC) version 2.6 or later. [System.InvalidOperationException]
Retrieving the COM class factory for component with CLSID {2206CDB2-19C1-11D1-89E0-00C04FD7A829} failed due to the following error: 800703fa. [System.Runtime.InteropServices.COMException]

The error was a red herring.  The problem is not that MDAC is not installed – it is far more obscure.  WDAC (MDAC's successor) is included in Windows Server 2008 and has plenty of backward compatibility built into it.  That part of the equation is perfectly fine.  In fact, if you run console/forms apps, you probably will never see this problem.  It is only when you are running ASP.Net code and use a custom identity for the Application Pool (possibly some other situations too) that this error occurs.

By doing a ProcMon trace, I was able to pin down the problem.  If you follow all the steps that w3wp.exe performs, you will see one really weird line.

Line from ProcMon 

Okay, the unknown result code is weird enough, but ProcMon couldn't even tell me which registry key it couldn't find!  Examining the stack trace confirmed that this was the only request logged that had ole32.dll loaded, plus it showed ole32.dll throwing an error, so it really appeared to be related to my problem.

ProcMon stack trace

Thankfully, the Great Gazoogle did not let me down.  It turns out that 0xC0000425 indicates that an application was attempting to access a registry hive  after it was unloaded.  What the heck?

This is a good time to explain how the registry works at a very high (and simple) level.  Each registry hive is a self-contained database in an independent file in the file system.  A good example is NTUSER.DAT located in your user profile folder.  That's your very own HKCU.  Not all of the registry is always loaded all the time.  This is what allows Windows to move your profile around, or copy your profile (registry included) without having to do individual registry read/writes (much slower).

If HKLM or HKCR were unloaded while Windows was running, your computer would probably just freeze up completely, so those were not good candidates for this problem.  It had to be a user hive.  Since it was the application pool identity that got this error, it had to be that user's profile.  But how can its own registry get unloaded in the middle of execution?

I found the answer at a Sun support forum, of all places.  It turns out that in previous versions of Windows, you could download a program called UPHClean that would help unload user profiles when they were no longer needed (supposedly) to avoid the annoying user profile deadlocks that would sometimes occur, causing you to have to use a temporary profile, instead of your own user profile.  If you haven't experienced this error before, you are lucky!  It is rare, but when it occurs, it is very annoying.  It's apparently more common on Terminal Servers than other servers, from what I've seen.

Well, in Server 2008, the functionality of the UPHClean service has been rolled into the User Profile service, which always runs.  So Server 2008, on the whole, more aggressively shuts down dangling registry handles when a user logs off.  The aforementioned support forum participant recommended shutting off the UPHClean functionality entirely.  I'm not a big advocate of fixing shovel-sized problems with a back ho, so I decided to dig a little more.

To see if this really was the cause of my woes, I searched for Event ID 1530 in the event log to see a user's HKCU was ever forcefully unloaded.  Yes, there have been occurrences, yes the process involved was w3wp.exe, and yes the SID corresponds to the application pool identity.  I'm getting closer to a solution!

Windows detected your registry file is still in use by other applications or services. The file will be unloaded now. The applications or services that hold your registry file may not function properly afterwards. 

2 user registry handles leaked from \Registry\User\S-1-5-21-1129910693-4165624395-2147873099-2135_Classes:
Process 6632 (\Device\HarddiskVolume1\Windows\SysWOW64\inetsrv\w3wp.exe) has opened key \REGISTRY\USER\S-1-5-21-1129910693-4165624395-2147873099-2135_CLASSES\Wow6432Node
Process 10144 (\Device\HarddiskVolume1\Windows\SysWOW64\inetsrv\w3wp.exe) has opened key \REGISTRY\USER\S-1-5-21-1129910693-4165624395-2147873099-2135_CLASSES\Wow6432Node

So why was this happening?  Clearly my application has not exited.  Why does the User Profile Service think it can arbitrarily close that registry hive while my application pool is still doing work?  I'm guessing that UPHClean detects the open handles and when enumerating loaded profiles, sees that the user's profile is not loaded, so decides that those open handles must be dangling and should be forcefully closed.

The solution to preventing this problem turns out to be a very simple configuration setting in IIS7's Application Pool Advanced Settings.  To fix this problem, all you need to do is enable profile loading in IIS.  What this does is tell IIS to completely load the user profile for the entirety of the execution of the application.  The default approach is the IIS6 approach, where the profile is not loaded when the user is impersonated by the IIS service.  In IIS6, this was okay because on Server 2003 UPHCLean was an optional download and not installed by default.  If it's not installed, it can't unload the hive, obviously.  :-) I would imagine if you did install it on 2003, you would have a similar problem in a similar situation.

IIS7 advanced settings

So, in conclusion, no profile loading means premature registry unloading, which means no OLE, no MDAC, and, therefore, no Excel/Access.

Mystery solved.

Recent Comments
  1. Re: DPM 2016 + SQL 2016 and "An unexpected error occurred during the installation" ID: 4387
    Derek: Edward, great find. +1 on the fix... Thanks!!
  2. Re: DPM 2016 + SQL 2016 and "An unexpected error occurred during the installation" ID: 4387
    milo: Thanx MIKE - this helped me: DPM 2016 setup will fail if you have SQL Server Management Studio (SSMS...
  3. Re: DPM 2016 + SQL 2016 and "An unexpected error occurred during the installation" ID: 4387
    Terry: Edward, you are the Man!!!! Looked for a solution for hours, then found your post and BAM!!! it worked...
  4. Re: DPM 2016 + SQL 2016 and "An unexpected error occurred during the installation" ID: 4387
    Mr. JoeM: Edward! Thank you, saved me hours of work.
  5. Re: DPM 2016 + SQL 2016 and "An unexpected error occurred during the installation" ID: 4387
    Brian: Thank you so much Edward! :-)
  6. Re: DPM 2016 + SQL 2016 and "An unexpected error occurred during the installation" ID: 4387
    Tom: Thank you Edward! After beating my head against a wall for days, tried your suggestion out and lo and...
  7. Re: DPM 2016 + SQL 2016 and "An unexpected error occurred during the installation" ID: 4387
    Mike: DPM 2016 setup will fail if you have SQL Server Management Studio (SSMS) V17.x installed. Re-Install...
  8. Re: DPM 2016 + SQL 2016 and "An unexpected error occurred during the installation" ID: 4387
    Rob: Edward, thanks man! you were a lifesaver. My scenario was Win Server 2016 from scratch, SQL 2016 (N...
  9. Re: DPM 2016 + SQL 2016 and "An unexpected error occurred during the installation" ID: 4387
    Edward: It also crashes with the 4387 error if you have the SQL Management Studio 17 tools installed. Installing...
  10. Re: DPM 2016 + SQL 2016 and "An unexpected error occurred during the installation" ID: 4387
    Ram: Hi - I followed richsmif instruction and was able to successfully install DPM 2016 on SQL 2016. Completed...