2008

2007

2006

2005

2004

Frustration, thy name is iSolitaire

▁ apr 30 2008

As per this,

iSolataire is a game for the iPhone/iPod Touch. I must’ve been playing ~50 games by now, and haven’t won a single one. I have decided that this game is unbeatable and that this is a hoax designed to delude you into thinking you can win. Which you can’t. Ever. ‘Kay?

*sigh*.

The thing about this one is that it won’t allow you to ever turn all the cards. Especially towards the right, at least 3 or 4 of the cards will always remain unturned. It happily gives you all the aces, but it always keeps back the 2 in one of the colors, so you can’t go a go-home-rampage to try and mix and match. Or it’ll keep at least one king out of your reach.

If anyone has beat this, let me know.

. o .

Microsoft hands law-enforcement the key to the city

▁ apr 29 2008

Where by “city” I mean the computers of everybody running Windows.

Feel free to to post the CPIO when it’s leaked in the comments here.

Link - no “via” as this is something you can comment on.

. o .

What I'd look like if I was in Southpark

▁ apr 28 2008

Like this, apparently:

jesper-sp.png

. o .

Impressive Canvas

▁ apr 27 2008

Mathieu Henri, or p01 as he prefers, has done something really impressive with javascript and canvas.

Check it out here.

If you don’t see anything fancy, try another browser, like Opera 9.5 or the latest Firefox. It doesn’t work in Safari 3.1 for me.

I worked with Mathieu at Opera for a bit over a year, and even though he’s absolutely terrible at tabletennis, he’s pretty awesome at graphics and demos.

. o .

Robert Zubek: Clojure webserver in sub-hundred LOC

▁ apr 27 2008

Robert Zubek wrote a blogpost on how to write a webserver in Clojure in less than 100 lines of code. Interestingly, he uses Jetty for the actual serving part — interesting because Clojure has an excellent bridge to Java (as it runs on the JVM itself.)

It’s nice to see how you can tie in a Lisp-1 with something as shoddy and sordid as Java itself, and still keep it somewhat elegant.

You have to admit this is darn cute:

user=> (import '(org.mortbay.jetty Server))
nil
user=> (new Server)
Server@1f0f8ff
user=>

Clojure was previously mentioned here.

. o .

Obscure reference

▁ apr 25 2008

From Adium:

10:57 Vetle
you made me google for "wesley snipes house boat"

Obscure reference

3 comments — category: reference
. o .

Pretty cool django app: django-photologue

▁ apr 25 2008

There are a lot of promising Django applications surfacing lately. I think there’s even a site where they group ‘em all. There are some for tagging things, some for communities, and some for images. Specifically the lovely django-photologue.

Citing the source:

Photologue is a Django application, more specifically, it’s a complete image management solution for your Django site. Photologue replaces the ImageField in Django with a powerful system that supports resizing and image effects as well as providing a turn-key photo gallery solution. Photologue embraces the Django admin and smoothly integrates with photo thumbnails and effect previews.

I found myself writing a bunch of code the other day, hooking up signals to a Photo model, creating thumbnails when images were uploaded and what-not. It worked, sorta, kinda, until it broke today. Thankfully it wasn’t live. Anyway, so I google for “django photo resize” to see if someone has simplified the process (by subclassing a model or a field, e.g.), and lo and behold, up comes this photologue thingie.

Now I’m usually the biggest skeptic when it comes to out-of-the-box-just-works code stuff (I’m looking in your direction, RoR-camp. Phooey.) Couldn’t hurt to give it a whirl, though. Guess what, it turned out to be pretty cool.

photologue comes with some flimsy-dimsy automagic gallery stuff, and has its own urlmappings. I don’t want those, and I was a little scared that they would be hard to cut from the core. They weren’t. I easily integrated it into my already running app, without using any of its functionality beyond image resizing, pre-caching and some image enhancements (which is brilliant, wish I had thought of it.)

There were a few bugs, but I found a way to work around them, and since only I will be adjusting the settings, that’s OK. It’s developed by one guy, and it’s just in 1.0b now, so I’m sure it has a bright future.

If you’re doing any kind of photo/gallery/resize in Django, photologue is highly recommended.

. o .

Another vile bug report

▁ apr 24 2008

Continuing todays earlier mention of a somewhat disturbing bug report, this one takes the cake.

Scroll towards to the bottom for full effect. Ouch.

. o .

"Insulting source code"

▁ apr 24 2008
===================================================================
--- player.py (Revision 4026)
+++ player.py (Revision 4027)
@@ -287,7 +287,9 @@

  def init(pipeline, librarian):
      gst.debug_set_default_threshold(gst.LEVEL_ERROR)
 - if gst.element_make_from_uri(gst.URI_SRC, "file://", ""):
 + if gst.element_make_from_uri(
 + gst.URI_SRC,
 + "file:///Sebastian/Droge/please/choke/on/a/bucket/of/cocks", ""):
          global playlist
          playlist = PlaylistPlayer(pipeline or "gconfaudiosink",
 librarian)
          return playlist
 daniel@bert:~/1/quodlibet-1.x$ svn log -r 4026:4027
 ------------------------------------------------------------------------
 r4027 | piman | 2007-04-27 05:17:05 +0200 (Fr, 27 Apr 2007) | 1 line

 player.init: Give a fake filename to trick GStreamer 0.10.12's filesrc.
 ------------------------------------------------------------------------

Woah.

Bug report here.

. o .

Closing MySQL: Marten Mickos Responds

▁ apr 24 2008
. o .

Optimus Maximus keyboards - out now, costs more than your car

▁ apr 23 2008

OK, maybe not, but remember those shiny keyboards that were debated to death the past 2-3 years? The one with the OLED keys? Well it was rumored to arrive Real Soon Now for years, and now it’s finally here. It’s by those darn Russians, Art Lebedev, too!

Oh yeah, and it’s $1600. Yep. It is cool, though.

$1600

Buy it here.

. o .

Desperate business idea of the day

▁ apr 21 2008
  1. Make an identical copy of Donkey Kong (the game), but replace the monkey with a donkey.
  2. Call the game Monkey Kong.
  3. Stand back and let your consumers appreciate the irony.
  4. ???
  5. Profit!
. o .

MySQL closing some of its doors

▁ apr 17 2008

MySQL will start offering some features (specifically ones related to online backups) only in MySQL Enterprise. This represents a substantive change to their development model — previously they have been developing features in both MySQL Community and MySQL Enterprise. However, with a shift to offering some features only in MySQL Enterprise, this means a shift to development of those features occurring (and thus code being tested) only in MySQL Enterprise.

(Shameless citation from jcole.us)

Hm. When Sun first bought MySQL, most of us thought that was a Good Thing™ — apparently not so much. This seems to be the old story retold; A friendly company with a good track record, doing things mainly open source, gets acquired by a larger company with intentions of monetizing it. Bad Sun. Bad.

Oracle bought Innobase a couple of years ago, effectively taking over ownership of the InnoDB storage engine (the only real engine in MySQL supporting near-ACID capabilities). This had all of us trembling in our shorts, I suppose the somewhat seamless non-evil merger back then had us more calm this time.

I wonder how long it will be before the LAMP stack will go out of fashion. I remember the days where web development meant mastering PHP and phpMyAdmin. *shudder*.

Seems like my earlier post, Migrating from MySQL to PostgreSQL, will come in handy.

3 comments — category: databases
. o .

Our eco system rocks!

▁ apr 17 2008

In case you haven’t seen it yet, I feel it necessary to direct your devout attention to this:

Even though it’s (hopefully) fake, I still wonder who took the time to make this.

(With thanks to Brad Choate)

. o .

App Engine ported to EC2

▁ apr 16 2008
. o .

On Clojure (and concurrency in general)

▁ apr 15 2008

I just finished watching Clojure Concurrency, a presentation given by the ever-talented Rich Hickey. It’s almost 2 hours, so don’t just watch it if you’re bored.

Now Rich is a really smart guy. He does a talk on this language he wrote called Clojure (pronounced ‘closure’), which is a Lisp-1 running on top of the JVM. I had previously spotted this some time ago on proggit, but it was still in a very early stage (pre-alpha), and I was more infatuated with Erlang at the moment, while reading Armstrong’s Programming Erlang: Software for a Concurrent World.

Concurrency is a very hot topic these days. The big-shots say it’s a new paradigm, and I’m with them on that one. Well, sorta. In his talk, Rich says at one point that “we’ve been doing it wrong.” If you ever tried creating a multithreaded application, ending up in a living hell acquiring locks and having more mutex’es than normal variables, you know the problem at hand.

The “new” proposed way of doing things, tie in directly with the also-hyped functional languages (I’m sure you’ve seen Haskell or F# mentioned, no?) — the gist of this being immutability. That’s a big word that just means “you can’t change it.” Once you’ve assigned a value to something, you can’t change it. There’s a section in the aforementioned video that talks about “Persistent Datastructures” which offers some great insight on how this works beyond simple strings or integers (but on stuff like vectors or hashes.) Once you take the mutable part out of the equation, there’s no need to lock anything. You still need transactions every once in a while, but we’ve been using those in databases for years, so they’re not so scary anymore.

Clojure does not yet have a “platform” for seamlessly distributing computing over a network (only via threads running on the CPU, running on your OS, like Haskell), unlike Erlang who offers “green threads”—that is, threads running in the VM, and not on the operating system. This allows for creating and communicating between threads while keeping it extremely cheap. While it may be argued that distributed computing over a network right in the VM is pretty cool, it might not be a very good indicator when choosing your next programming language.

If you want to read more about concurrency and the languages prevailing on the subject these days, I suggest you read Concurrency (computer science) - Wikipedia, the free encyclopedia) which debates the infamous “Dining Philosophers” problem, and definitely Joe Armstrong’s essay “Concurrency is easy”.

. o .

More App Engine stuff

▁ apr 14 2008

Todays word is “Bum Rush”.

The act of attacking someone or something (usually by a group) with the reckless abandon and fervor of one who has nothing to loose.

The children bum rushed the home baked cookies as they were brought out.

or

The kids bum rushed double-G with “feature requests” the second it came out.

Earlier today I had a few minutes to kill, and I figured the App Engine issue tracker would be a great source of amusement.

There’s plenty more.

In other news, gu...@python.org (fijne dag, Guido!) has commented on the continuing issue of breaking urllib/urllib2 in the SDK, as discussed earlier. If anyone has the time and is in the know on how to implement this properly, go do it.

. o .

Office 2008 invaluable feature

▁ apr 10 2008

“Dude, check out this call I just found in the Cocoa animation API”

“It’s, like, a ripple. Woah. Show the project manager!”

“I did, he pre-approved it already.”

. o .

Stupid Programming Tricks: Abusing Exceptions

▁ apr 10 2008

So I’m reading The Daily WTF and they have this horror story. I’m paraphrasing in pseudocode:

if not customer.isActive():
    throw RedirectException("/support/accountdisabled/")
else if ...

OK, see, what happens here is that the programmer raises an exception to control the flow of the code. Exceptions are meant to be errors and shit like that.

“This is not really a big deal,” I think to myself. Go through the comments, and people are in shock and awe. Uh. Let me explain to you why this has absolute merit and why I do this myself several times a day.

When you return something from your method, that obviously gets returned to whatever was calling you. Crucial piece of programming logic, there. Well, what if I’m building a web framework where I have some code sitting in my core to handle headers and what-not, and to deal with actual content and requests, I outsource that to, like, handlers, that the developer can write, if they use my awesome framework. Now if I want to redirect, I have to return a special object back from my handler, call it HttpRedirect, or something.

Now this is where “correct code” really steals my peach. Say that I do some elaborate magic in my handlers, and the redirection might—in fact—be handled by another method called by my handler. What then? “Oh, just return the result of the call to that method,” you say. Like this:

function myhandler():
    return somefunc_thatmightreturnaredir()

O…kay. Uh. Well. I guess I have to make sure that somefunc_ doesn’t .. wait, no. I don’t want to return if it’s not a redirect. So lets just check whether the type of the returned value is a HttpRedirect! Well, what if somefunc_ calls another method that might potentially redirect? Then I have to move all my logic into somefunc_ as well, right? Or do a return-loop all through that flow, and I basically end up moving the step up one from the core web framework to my own handler. I guess you could quickly whip up a method named maybeRedirectIfReturnValueFromTheThingIJustCalledHasTheCorrectType and reuse this throughout your code, but that’s just fucking stupid.

What if my web framework comes with some authentication kit you can use, and this framework happens to do some redirection on its own? If this is not the correct behavior for your app and you want to intercept it, you’re out of luck.

You startin’ to see where I’m getting at?

Here’s the stupid programming trick: Exceptions are like a chain reaction. They burn through the fuse you’ve laid out through all your method calls and your code has every opportunity to catch it before it reaches the gunpowder barrel and your program explodes—it raises an exception and displays that to the user, or something. Not what you want, anyway.

Now why is this so god damn immensely useful to you as a programmer? Because you don’t have to return-link anything, no race conditions, no repetitive logic throughout your code.

In my example from before, in my core web framework, I’d simply do this:

try:
    result = handler(request)
    print result
except HttpRredirect, redir:
    print "Location:", redir.url

Cool, eh? This is more stable functionality in your app than any kind of return-linking, type-checking hell you can come up with. I do this all the fucking time, and it works really well.

Oh, this is common practice in CherryPy and you should also read Pylons FAQ: Why do redirect_to and abort raise exceptions, instead of returning a Response?.

But then that’s just me. What about you, do you think exceptions have legitimate use outside traditional error handling?

. o .

Joyeur: Joyent's Garden of Eden for Python Web Applications

▁ apr 09 2008
. o .

suds 0.1.7

▁ apr 09 2008
. o .

On App Engines custom HTTP implementation

▁ apr 09 2008

James from B-List writes:

I understand that they need to sandbox things for safety, but cutting off the standard Python modules for doing URL retriveal and speaking HTTP throws out an unbelievably large amount of software that you’ll now either have to rewrite or fork:

  • Want to use Akismet to filter spam submissions? Better come up with a wrapper that uses Google’s fetch API.
  • Want to sync to popular services like Flickr or del.icio.us? Yup, gonna have to put that together yourself.
  • Want to use the API of the hot new Web 2.0 property? You guessed it: existing Python wrappers aren’t going to work.

The list just goes on and on; all this stuff needs to either be rewritten to use Google’s API, or needs to be forked and patched. And it seems you can just forget about anything that isn’t doing HTTP. And that’s just the tip of the iceberg: it looks like a simply vast amount of useful Python software is going to be verboten on App Engine.

I must say that I agree with James (and the rest of the community) on this one; the decision to to cripple Pythons stdlib is half-baked. Hey, G-Men, you do realize that most of Pythons library is written in… Python? Instead of providing your own from google.half.baked.solution import handicap, write your own version of urllib/urllib2. Whatever magic you had in your own solution, you can move to there.

Ramin has posted a bug report on this very issue.

. o .

First roundup of the double-G paranoia

▁ apr 08 2008

Speaking of which, I love SafariStand‘s “Copy Link as Markdown”-feature more than buttered pancakes.

markdownme-20080320-150922.png

. o .

Book of Shadows

▁ apr 08 2008

Or..? I don’t know. I got this lovely journal as a delayed birthday present.

il_430xN.22608510.jpg

Looks like something out of Pirates of the Caribbean, doesn’t it? Not really sure what to write in there; seems kind of a waste to keep my TODO- or shopping lists in it. Maybe I can rent it out as a movie prop, this is the kind of place you’d expect to find a an evil spell or whatever’d make you gasp.

More pictures from lapaperie.

. o .

Opera BTS, bug 320859

▁ apr 08 2008

Let it be clear as day that I did not report this, I’m merely re-posting it for you people without access to the Opera bug tracker.

Bug 320859 Reported: 2008-04-01 13:52:14, author censored

In order to remain competitive in the browser market, it is necessary that we provide webmasters with extra features unavailable in other browsers. It is true that we offer nearly complete support for <blink> and <marquee>, but neither of these offers features that make Opera unique.

We should offer proprietary extensions to the <blink> tag, which currently offers way too few parameters. Here are the proposed extensions…

The first issue with <blink> is that it does not provide the flexibility that <marquee> does in terms of timing, events, etc. Here are some attributes to alleviate that:

  • INTERVAL: Control the blinking interval
  • TRUESPEED: Actually control the blinking interval
  • ONBLINK/ONUNBLINK: Events that fire when the text is made visible/invisible

One issue with <blink> is accessibility. Webmasters may be concerned that it is difficult to convey the semantic meaning of the <blink> tag to users with low or no vision. These attributes allow webmasters to make <blink> more accessible to those users by providing enhanced audio/visual cues to the blinking behavior:

  • STROBE: Make the entire screen flash the text in 72 point font, 60 times a second
  • BGSOUND: Play a sound each time the text blinks
  • ONPIEZO: Plays a beep (using the PC speaker) at a specified frequency (Hz) when the text is visible
  • OFFPIEZO: Plays a beep at the specified frequency (Hz) when the text is no longer visible
  • GLITTER: Prints the text using glitter on future printers that may have this useful capability

It is critical that the underlying semantic content of these attributes be conveyed to users of browsers that do not support these extensions to the <blink> element. For this reason, we will introduce a <noblink> element to provide fallback content, like this: <noblink>Please blink your eyes at 23Hz while loudly singing “Never Gonna Give You Up” by Rick Astley when reading the following text: </noblink><blink interval="23" bgsound="rickroll.wav"><font size="100" color="blue"><b><i><u>NEVER GONNA GIVE YOU UP, NEVER GONNA LET YOU DOWN, NEVER GONNA RUN AROUND, AND DESERT YOU!!!<marquee></u></marquee></b></blink></i> This way, users of other browsers won’t be missing any important content.

The funny thing is that in my blogging client (MarsEdit), the damn thing is actually marquee’ing a rickroll on me.

. o .

Double-G reinvents Django/RoR/Pylons/ORM

▁ apr 08 2008

Google has released App Engine. They have a video too (TextMate gets some free advertisement, like in the infamous RoR videos.)

gql.png

At first, I lol’d. GQL? Come on. But then I read the documentation. It has some fancy ANCESTOR IS stuff, so it would appear as if they’re actually using Bigtable for this; that also explains the seamless schema evolution they do in the video.

I didn’t make the first 10,000 signups, so I’ll have to wait and see how it is. They say that you can deploy your app with almost any Python framework, and they even include Django 0.96.1 in the SDK, so that’s pretty awesome. I hope they allow you to use SQLAlchemy or any of the other big ORMs that people have come to love these days. It shouldn’t be any harder than adding a Bigtable backend (bigtable://?). HDFS wold be cool here too, guys. Hint.

What App Engine needs for my further praise:

  • Ability to deploy on your own domain (perhaps via CNAME DNS, like they are doing with enterprise hosted email on gmail?) — It might even add credibility to your product if you’re obviously hosted by the big G.
  • Openness. So far it sounds really cool, with the “almost any framework” and all that.
  • Some kind of clever deployment. For now it seems to be using appcfg to package up your code and ship it over. Perhaps some kind of clever SCM-integration? Tag something for release and tell appcfg to deploy that tag? Forcing people to use SCM is not bad practice either, IMHO.

Personally, I’m very happy to see the continued adoption of Python and all things pythonic. Several other players on the market has gotten all the attention, but I feel times are a’changin’.

. o .

Why I hate the Ruby folks

▁ apr 03 2008

First of, I don’t consider myself a bigot. I have a fine habit of evaluating my tools before I choose them. As of this morning, the Rails camp have chosen Git as their SCM. Now there’s nothing wrong with this choice on its own, DVCS is great in almost all its shapes and sizes.

What really gets to me is this:

So now both our repository and ticket tracking will be powered by Rails applications, which is a nice bonus treat.

They couldn’t possibly have chosen Git over, say, Mercurial because Github and Lighthouse is written in Rails, and hg is written in Python, could they?

. o .

Changes.app + Mercurial + extdiff = Awesome

▁ apr 02 2008

Use version control? Hate reviewing merge conflicts manually, scouring through <<<<<<<<‘s? I do. If you’re lucky, you know of FileMerge.app, which sort of simplifies things, but it doesn’t allow you to edit either of the columns.

Things just got a whole lot easier; Use Changes to review your changes. It’s $40, but so far I’ve found it well worth the price. It features integration with all the big players — TextMate, BBEdit, TextWrangler, has a Terminal utility (/usr/bin/chdiff), and it has a nifty wiki for how to integrate with your favorite SCM (works with every SCM I know of, perhaps with the exception of RCS.)

. o .

No way.

▁ apr 01 2008
powered by