Archive

Archive for October, 2007

Upgrading WordPress sucks.

October 30th, 2007 2 comments

It is almost perfect - just tar xvfz latest.tar.gz and let it overwrite the files in the wordpress/ dir... but life isn't easy like that.

A bunch of files have been deprecated from various releases and just sit around getting stale. Currently the installation instructions are to just "remove all files" in various places. I would rather just get a list of files that are safe to remove, and be able to blindly copy the archive using tar (or remotely using FTP, etc.)

That shouldn't be too hard.

Right now I have my WP installs for work and home in Subversion, and I can't just move the files because the SVN metadata and directories get lost. I'd prefer to just get a list and I can manually just "svn del" the files myself. So please, for future WP releases, would someone publish the list of files so I don't have to do all this manual work each time? How about a quick and dirty cheat sheet like so:

List of files deprecated by this release:

  • foo.php
  • bar.php

Database upgrade required: Yes/No

Functions changed or deprecated:

  • wp_insert_post() now does this instead of that...
  • etc...

This might also make it easy for [us] plugin authors to look at the function deprecation list and easily know if something we're doing could be in trouble :)

Categories: WordPress

Handling events pre-$(document).ready() in jQuery

October 30th, 2007 3 comments

jQuery is the best thing since velcro. No doubt. However, there is one thing that I've stumbled across that other people seem to have wondered about too. jQuery's got this great $(document).ready() capability to let you know when the DOM is ready and jQuery is loaded. However, what about those events (like a user quickly clicking on something) prior to this happening? If any of those require jQuery's functionality, you're SOL.

For right now, what I figured out is just doing this in the HTML:

<a href="javascript:;" id="somediv">Some link</a>

In the Javascript, it would be this:

$(document).ready(function() {
   $("#somediv").click(function() {
      ... your actions here ...
   });
});

This currently is the only way I could figure it out. This guy had a neat idea basically creating a cache of the events to trigger the minute the DOM is ready. I was thinking of just blindly applying this to all $("a"), but that still requires jQuery to be available, and that's the whole problem to begin with.

This issue makes me nervous because I'm trying to play within the rules that Yahoo! has worked out for optimal performance. However, when you put JavaScript files at the bottom of the page, that means it will be even longer before jQuery is loaded. The more I try to get the pages working with JavaScript files loading at the bottom, the more apparent it becomes that jQuery should still be called at the top/as soon as possible. Unless someone else has figured out a way to make both sides happy...

Categories: Development

jQuery Spy improvements

October 29th, 2007 2 comments

I've made a diff against spy 1.4 to make sure it will not allow multiple spy instances on the page with the same object ID. If .spy() is called again, the old timer will be cleared and the new one (with new settings) will take over. It should still allow multiple *different* spies on the same page, just not two of the same thing (I was having an issue  where it would keep reloading the same ID over and over because of a .click() event changing the configuration settings) - this allows real-time changing of the settings (say, the AJAX URL) without spawning additional timers.

I also added in a Math.random() parameter to force reloads every call and changed $.post to $.get - those can easily be removed if desired. :) Essentially I just create an array that has a list of all the spy IDs that are called, if a dupe is detected, the old timer is disabled and the new one starts like normal. Oh, and I changed the epoch behavior, for some reason on my browser it wasn't reporting the right time. I don't see why it needed the spy.epoch calculation at all.

Here's the patch file:
spy-1.4-diff.patch.txt

Feel free to submit your comments. This was the cleanest method I could figure out.

Categories: Development

A bad credit score can screw you out of more than a loan...

October 23rd, 2007 No comments

I learned some pretty disturbing news from my friend earlier. Looks like he was turned down for a job he was fully qualified for due to his bad credit. That sounded a little bit discrimatory to me. Someone's previous lifestyle should not affect their future employment. Not to mention how many people have crappy credit. How are people with bad credit supposed to advance? Working crappy pizza jobs for years until their credit score is improved?

Besides, a person in need might even work harder! Most people probably want their credit to improve, I'd imagine.

Something about this really rubs me wrong. Like, write-to-my-senator-or-congressman wrong. We already have things like the Fair Credit Reporting Act and all this privacy around our credit, why should our employer have access to information about how we spend our money? As long as the work gets done, that is all they should care about.

I do agree however that criminal background checks are a good thing. But credit? What's next? We won't be hired if we have poor bowling skills or some other equally personal detail?

Categories: Consumerism

Are you getting the most out of your DVI port?

October 16th, 2007 3 comments

Did you know there are five types of DVI connectors? I didn't. DVI-D dual link, DVI-D single link, DVI-I dual link, DVI-I single link, and DVI-A. Of course, I learned this the hard way, and I bet most people still haven't. I don't have much previous experience with DVI, but now that I have a Macbook Pro and an HDTV, I wanted to connect it at 1080p once I realized I could (using an HDMI port on the TV, not the VGA connection.)

I thought it would be as simple as going and picking up an HDMI to DVI cable. Not even close. After I picked one up at a local shop and brought it home, I realized it was "missing" pins. It would function still, but not at its full potential. I wondered about this and hit up Wikipedia, and sure enough, there are multiple types of DVI connections.

After shopping at five different stores (including the Apple Store and the Mac Store) I realized that nobody actually sells DVI-D or DVI-I dual link cables (or even adapters) which is what is required for 1080p. I had to go down to Fry's in Wilsonville and finally was able to pick one up. 15 feet for $24.99, actually much cheaper than most of the single link options at all the other stores (and those were shorter cables, too.)

Sure enough, DVI-D dual link saves the day. I can now use the Macbook at full 1080p on my 47" Vizio GV47LF, although I have to say the text is pretty small. Using Front Row and watching movie trailers through it using all 47" is pretty neat though.

Categories: Consumerism, Toys