Windows and me
As it turns out, I share a birthday with the Windows OS. Windows is exactly one year older than me. I’ll drink to that.
Nifty.
As it turns out, I share a birthday with the Windows OS. Windows is exactly one year older than me. I’ll drink to that.
Nifty.
b2evolution didn’t go quite as well as I had hoped. A couple of days ago it started giving me HTTP 406 errors for some posts for no apparent reason, and filling my error log with fascinating things like…
[15-Oct-2008 04:52:15] b2evolution error: MySQL error! / Duplicate entry ‘c-events-are-accessors’ for key 2(Errno=1062) / Your query: DataObject::dbinsert()INSERT INTO evo_items__item (post_datestart, post_creator_user_ID, post_notifications_status, post_renderers, post_status, post_locale, post_priority, post_main_cat_ID, post_ptyp_ID, post_url, post_excerpt, post_urltitle, post_comment_status, post_title, post_content, post_wordcount, post_datecreated, post_datemodified, post_lastedit_user_ID) / VALUES (’2008-10-15 12:52:14′, ‘1′, ‘noreq’, ‘b2evSmil.b2evALnk.evo_videoplug.b2WPAutP.evo_code’, ‘draft’, ‘en-US’, ‘3′, 16, 1, ”, ”, ‘c-events-are-accessors’, ‘open’, ‘C# events are accessors’, ‘An interesting feature of C# I discovered recently is that events are actually accessors, [...] is’, 60, ‘2008-10-15 12:52:14′, ‘2008-10-15 12:52:14′, 1) in /home/sonic12/public_html/sunstormlabs/inc/_core/model/db/_db.class.php at line 568 / REQUEST_URI: /admin.php / HTTP_REFERER: http://www.sunstormlabs.net/admin.php?ctrl=items&action=new&blog=1
[30-Oct-2008 04:51:01] XML error: Invalid document end at line 2, column 1
Being patient with software faggotry like the programmer I am, I promptly fixed the error by installing WordPress.
I was fed up with b2evolution anyway. It was doing a lot of stuff that I didn’t care for, and wasn’t doing a lot of stuff that I did want. It had support for multiple blogs for people with MPD, and statistics rendered useless by Analytics, but it also had some 3 good (ie: not fixed width) skins available, couldn’t do comments and their formatting right, had at least 3 URLs for everything, wasn’t very friendly about posting images, no decent syntax highlighting plugin, and I was feeling left out of all the WordPress feature wanking I keep seeing on other blogs.
The irony is that I picked b2evo in the first place because it wasn’t WordPress and I wanted to be different. No matter how much I try to convince myself that “alternative” doesn’t mean “worse” in every possible context, 10 out of 10.1 times I get a cockslap to the face. Why do I bother?
An interesting feature of C# I discovered recently is that events are actually accessors into Multicast Delegates, much like properties are accessors into other fields.
private string myData; public string MyData // A property { get { return myData; } // called when the property is read set { myData = value; } // called when the property is written to } private EventHandler myDataChanged; public event EventHandler MyDataChanged // An event { add { myDataChanged = (EventHandler)Delegate.Combine( myDataChanged, value ); } // called when a handler is attached remove { myDataChanged = (EventHandler)Delegate.Remove( myDataChanged, value ); } // called when a handler is detached }
My Logitech G15 got wet again and none of the keys were working. The logical thing to do, then, is to take it apart and try to figure out what’s wrong with it.
Note: Don’t try this at home. It WILL irrevocably void your warranty, and you can easily cause permanent damage to the keyboard.
Lets imagine that you have some music in MP3 format, and you’ve never heard the original source. This could be because you downloaded it from the internet, or bought it at an online music store like iTunes. You imagine that you’re getting the full musical experience with your 192kbps MP3, because you can listen to it perfectly well with no distortion or anything, and if the music really needs it, just bump it up to 320kbps to make it absolutely indistinguishable from CD quality.
For the most part, that’s true, to the point that standard MP3s cover most peoples’ listening needs. I’ve happily built up a 40+GB MP3 library for several years because of this. But only to a point. My opinion changed when I discovered FLAC.
When it comes to the web, I prefer to stay on the server, where it’s safe. I love the stability of the environment I get in server side code, and I detest the client side chaos that goes on in the faggotry of browser wars and their incompatibilities and differences.
If I can, I try to avoid scripting completely. In the current state of browser affairs, I don’t feel like I can rely on Javascript for anything more than decoration and minor UI enhancements. When I do have to work with Javascript (and by that I mean any client side scripting language), I do it in a very conservative, “1.0″ way.
You’d think that the Logitech G15, the greatest achievement in keyboard technology known to man, would react better to the common task of removing the keys to clean the coke I just snorted all over it (I’m talking about the drink; the G15 handles powder spills just fine). And yet, now the keys are sticking if they’re not pressed exactly in the middle.
It seems that the plastic hooks that keep the keys upright don’t take too well to bending, and now that I pried them out, the bent hooks let the keys play from side to side. So pressing the key slightly from the side will make it tilt and get stuck in its shaft, making it hard to press, and sometimes making it stick.
One of the greatest offenders is the left Ctrl key, which now makes it hell to copy and paste, and the F key, which now makes it hell to tell Logitech to go Fuck themselves for making me consider dropping a hundred bucks every time I want to clean my keyboard.
My problem with internet advertising is that during my entire decade or so of browsing, I haven’t once seen an ad for anything that I’ve ever been even remotely interested in. I don’t see it happening any time in the future either, unless ad targeting systems somehow learn to scan my mind for my deepest desires. A lot of this is because I live in a small, obscure, European country (the local websites of which I do not browse), which makes my relevant ad domain a lot smaller.
But the main issue is that ads are the internet equivalent of cold calls. And cold calls are deplorable because they assume that I’m somehow incapable of finding what I want on my own. If I want a product to perform some specific task, then I will search for it. I don’t want to be constantly reminded that there’s an application that can insert gay ass smilies into my emails. I’m not interested, I don’t need your products, and I don’t want to hear about them, because I am not going to buy them, period. When and if I, for some reason, start needing a gay smilie application, then I’ll Google it. I will then commit seppuku to retain my honor.
I left Windows Update installing Vista SP1 today, however, instead of a nice and upgraded system, I got locked out of my computer with this lovely message:
Clicking on Learn More Online took me Microsoft’s Genuine Advantage validation site, which happily reported that my copy of Vista isn’t genuine, with error code 0xc004d401. It was convinced that I had some kind of incompatible software that was interfering with validation, and gave me a list of anti-virus and malware checker programs that have been known to cause this problem. Obviously, I had none of them, or at all, ever.
It turns out that this was caused by Vista hosing itself while trying to update to SP1. I’m not sure if it’s caused specifically by SP1, or any of the updates that I installed before SP1, but actually getting SP1 to install fixes the problem. Microsoft’s suggestion to reboot into safe mode won’t help, because you can run neither WGA, or Windows Update from there. Luckily, It doesn’t take much to circumvent the lockout.
If that doesn’t work for you, or SP1 doesn’t show up as an update, then you likely have a different problem. You can still make life easier for yourself by navigating to the Windows directory and from there launching Explorer.exe, which will give you your desktop back. Some things will be disabled, and you’ll have a memory quota that’ll only allow you to launch two or three programs at a time, but it’ll make troubleshooting a bit less painful.
I installed SP1 and the problem went away, and Windows validates fine now. I was tipped off to a failed SP1 install being the culprit, because there was a task in the Task Scheduler that called for a “HitmanSp1.exe” (which didn’t exist) to be launched. Microsoft, your killers fail again!
PHP’s register_shutdown_function lets me run code after it finishes running the script, be that naturally or forcibly. This makes it a perfect fit for a whole bunch of things, like running maintenance database queries or showing debugging information.
function do_maintenance() { $db->doSomeQueries(); } function debug_write() { echo 'some debugging information'; } // Last things to execute register_shutdown_function( 'do_maintenance' ); register_shutdown_function( 'debug_write' );
There’s one caveat, and it’s explained in the PHP documentation:
Multiple calls to register_shutdown_function() can be made, and each will be called in the same order as they were registered.
Powered by WordPress