Filed under 'programming':

Wordpress hack: detecting login cookies when Wordpress is not installed at your blog URL

Sep 25, 2009 in , , , with 3 comments

This is a technical description of a programming trick with the blogging engine Wordpress (which runs this blog). I know the useless blather you usually read–or, more accurately, ignore–here has nothing to do with programming, but bear with me for one post, because I think people searching on Google might find this trick useful.

UPDATE 9/26/09: This hack doesn’t actually work, because the login cookies need to be set to two different directories–your blog url and your Wordpress installation folder–in order for all parts of your blog to work. I’ll post a fix once I figure out a way around this. It won’t be pretty though, since Wordpress 2.8 hasn’t been set up to directly deal with this issue yet.

So Wordpress has a cool feature / semi-intentional built-in hack that allows you to install the Wordpress scripts in one folder (e.g. jueseph.com/blog), but have your blog URL be something different (e.g. jueseph.com). This is helpful for people who want to have a nice short URL for the blog, but don’t want to have to have all those ‘wp-’ scripts cluttering up their root directory on the webserver.

Unfortunately, this trick has a fatal flaw, which I noticed today when I was implementing it for a a friend’s new blog: Wordpress no longer recognizes that you are logged in, even if you are! (more…)

Google Chrome

[UPDATE 17:16: It's out! Download the Google browser here.] Yes, they’re making a browser too, and it’ll be ready for download later today. Here is the official info page, and a comic book about the technology behind the browser — if you’ve ever done any programming or just appreciate good UI design, prepare to salivate.

[via Official Google Blog]

After the jump: first thoughts on the browser, T = 5 min after download

Where’s the Music?


[music map, a classical music concert visualizer]

Ever ask yourself, I wonder where major-record-label classical concerts are taking place in the world? Does Deutsche Grammophon have more concerts in central U.S. than EMI does? (They don’t.) What about central Europe? Just check out my CS171 final project: “Where’s the music?” (If you’ve never asked yourself these questions before, well, now you don’t have to!)

A few technical details about the project if you’re curious. (more…)

Context-free

Community of Variation
[via Context Free Art Gallery and Community of Variation]

For a computer science assignment last week I wrote a program with a friend in Scheme that generates sentences using context-free grammar. By specifying a few basic rules for parts of speech and including a simple word list, you can get some remarkably coherent results — coherent, that is, in a strictly grammatical, minimalist sense. There’s actually no attention paid to the meaning of the words used, or to their relationship with each other, a consequence of the grammar being “context-free.” We had a few laughs using our program to generate bogus math proofs, but instead of puzzling you with a slew of inside jokes and insomnia-induced geekiness, I’ll point your way to a much more impressive — not to mention amusing — application of the same algorithm, this time used to generate an entire scientific paper. You can even put your own name down as an author! Here’s an example passage:

We question the need for digital-to-analog converters. It should be noted that we allow DHCP to harness homogeneous epistemologies without the evaluation of evolutionary programming [2], [12], [14]. Contrarily, the lookaside buffer might not be the panacea that end-users expected. However, this method is never considered confusing. Our approach turns the knowledge-base communication sledgehammer into a scalpel.
[Stribling et. al (PDF)]

Not too bad for randomly generated babble, is it? (more…)

Made for me

Birds!
[via flight404]

I love shopping week at the beginning of every semester, because it is a time of beautiful leisure and carefree distraction.

Okay, so I skip class for a couple days. But consider this–other, much more ambitious students will go to 20 classes that they don’t end up taking. And guess what? I also end up not taking those same 20 classes! I’ve effectively simulated Ivy-league-grade ambition by sitting in my room and surfing YouTube, and nobody is the wiser. A pareto-efficient transaction of sorts, between myself and The Man. (Maybe you question the correctness of my econ verbiage here. Maybe you’re right. Maybe I never sat in on any econ classes.)

Ah! But even without me once having to go outside, that perfect someone or something (but actually some thing) still strikes me like a thunderbolt between the eyes. (more…)