Congratulations to the neccesitas project for joining KDE. I’m not sure what this means as far as KDE’s orientation or how this reflects the latest attitude of, “shit! we spent all this time fussing over Nokia’s mobile hype, and now we realize the desktop is rotting and we need to save it,” but it’s nonetheless exciting to know that neccesitas is supported by a good organization.

With that said, maybe it’s time for me to find a smartphone. I still use an old Nokia 1100, which doesn’t support much more than calling and SMS. And Snake II. Windows Phone 7 is out. Meego is dead. WebOS is limping. Blackberry has an arcane dev environment. What’s that leave? Junked up Android. As a platform, Android seems to already be experiencing some bloat and disorganization and Java doesn’t seem too hot. But at the very least it runs Qt now.

The big problem is finding a satisfactory phone. My critera are fairly simple:

  • QWERTY physical keyboard (I actually would prefer T9, but this is now long past :-( ). This is very important. I will not compromise about this.
  • GSM that runs on AT&T’s 3G network, as well as general GSM support for Europe.
  • Rootable and/or rom-unlockable.
  • Sensible update policy / recent operating system.
  • Big pretty screen.
  • Fast processor.
  • Solid construction.
  • The usual assortment of GPS, Bluetooth, etc do-dads.
  • But nothing like this exists. Well, the Xperia Pro looks almost perfect — AT&T 3G (approx), fast processor, pretty screen, great keyboard, etc — except so far it’s only available for pre-order in the UK and it’s looking unlikely it’ll be hitting the US.

    What is out there that meets these criteria? Why has my research turned up dry continually?

    [Sidenote: actually, the perfect phone for me might be the very dated Nokia E52, but I can't seem to find a north american model anywhere, even on eBay.]

    June 2, 2011 · 43 comments


    Update: Now instead of using HtmlUnit, which proved to be very slow and memory intensive, I’ve written my own ServerExecute app based on WebKit using QtWebKit. Check it out here.

    PhotoFloat follows the design of using a static html page with a static javascript app that creates dynamic layouts from static json files on the server. This means that googlebot has nothing to index, since it doesn’t run javascript. Uh oh!

    But not quite. A comment in my blog post pointed me toward Google’s AJAX Crawl specification, which is incredible. Basically, sites that use URLs like: http://photos.​jasondonenfeld.​com/#!/​columbia_winter_senior​/img_1712.jpg with the #! in there (as Twitter does, for example) get rewritten by googlebot to http://photos.​jasondonenfeld.​com/?_escaped_fragment_=​columbia_winter_senior​/img_1712.jpg. Then, on the server, using a combination of mod_rewrite, a lil php script as a loader, and a tiny Java app I wrote around HtmlUnit (Google says HtmlUnit it’s industry standard), the server sends back static HTML as if a browser had already run all the JavaScript and executed HTML requests.

    Aside from SEO, it means that Facebook’s crawler can get the proper title and the thumbnails:

    The web evidently is moving away from server-generated HTML and onto JavaScript interfaces, and this is a way to keep up SEO.

    Source:

  • Java app
  • PHP loader
  • .htaccess lines:
    RewriteCond %{QUERY_STRING} _escaped_fragment_=
    RewriteRule . staticrender.php [L]
  • Hope this is useful.

    May 9, 2011 · 2 comments


    UPDATE: Because of the wonderful reception across the internet, I’ve put together an instruction page on how to get this set up on your own server.

    I don’t really like database driven photo management software, and prefer instead to manage my photos in a good old no-nonsense directory structure. For this reason, I was particularly attracted to Zenphoto as a means of getting my photos online, as it works on directory structures. Unfortunately, Zenphoto is horrible; it’s riddled with bugs, inconstant, a cluttered architecture, and most of all, it’s extremely slow. Every time it runs, it re-scans directories and makes a bazillion SQL calls. The viewer interface is also outdated and clunky, having a different html page for each photo. So I went back to the drawing board and considered how to make things better.

    Introducing PhotoFloat. The idea is this — instead of scanning and caching metadata and thumbnails during page load time, everything is to be done prior. It’s a bit of an old school mentality. There is a script that generates static json files of metadata and album structures and static thumbnails of images, so that all the content can be served directly by Apache. Why? Because I only need to generate new thumbnails and data files when I upload new images (or alternatively, on a cron job). So that’s what I did; I wrote a simple python script that walks a directory structure looking for new or changed images and albums. It’s smart too — to be super zippy, it does file modification time comparisons. It also cleans up after itself, deleting stale files.

    So I have all my original images on my webserver, because I have Dreamhost’s unlimited hosting. I also have another directory that I populate with symlinks to the directories I actually want online. Every time there are new images, my python script fires up, and updated json data files and thumbnail files are generated.

    Great, but where does this leave us? What can we do with json files? This is where things become wonderful. Since all the data for the gallery is AJAX fetchable, there is a single html page and a single javascript file that takes care of the whole gallery. That’s right — all of the display of views is done client side, and in one page load.

    To keep track of pages and for swapping around links, each different album and different image has it’s own hash url, like, for example: #!/new_hampshire_in_snow_3.15.11-3.17.11/img_1919.jpg. It’s all lower case with naughty characters stripped out to keep up with the patterns of wordpress and other web apps. These function as permalinks.

    The albums have extensive support for EXIF metadata, which can be loaded by clicking ‘show metadata’, and a transparent box slides up over the photo. There’s also the ability to download the original photos.

    Each album gets a randomized thumbnail which assigns probabilities to each image in the album based on the number of images in each album and the depth of subalbums. The randomization algorithm is all done at client side.

    Images are preloaded. Album data is prefetched. Everything is cached sanely. JSON files are gzipped. There are animations between views and smooth scrolling. The right and left arrow keys work. Clicking on the photo advances it, like on Facebook. Finally, I do include one dynamic script — a simple php script that takes old Zenphoto URLs and translates them into the new ones, so that people with old links can still access the same photos.

    Essentially, there are a lot of little details that had to be done right, and to my knowledge, no web gallery that works on directory structures has done it well, making an ajaxy and speedy gallery. So now you have PhotoFloat. I’ve just finished writing it, and the code is a bit of a mess, but let me know if you have any suggestions or find any bugs.

    You can browse the code in the git repository or try it out live on my photo site. If you make any modifications of my code or use it on your own site, please inform me and send any modifications back to me. Remember to run make on the web directory to minify the css and javascript, and also, be sure to change the google analytics tracking ID in web/js/999-googletracker.js.

    Comments? Suggestions?

    Update 2 for KDEers: It looks like some people from kipi-plugins and kphotoalbum are interested in building integration for this in.

    Update 3: Following a suggestion in the comments below, URLs now use #!, which google translates to a special query string, and I’ve written a serverside component that executes the JavaScript and displays static content for googlebot. This allows the metadata to be crawled.

    May 8, 2011 · 30 comments


    Martin’s post set off an eruption of ideas and debates over integrating dbusmenu and kwin and proposals for a new tabbed API. To quote José Pedro‘s comment:

    The most important things I see lacking in Kwin from KDE 4.5 are an API to allow windows to open in a specific existing group (make a new tab in the decoration), and that the windows from a specific group are not grouped in the taskbar. I also think that if these 2 problems are fixed, most apps in KDE could use the decoration tabs instead of relying on the currently used tabs, inside the application itself. The important thing to notice here is the natural mix between the application tabs and the menu button. These complete each other, and all apps in KDE which rely on tabs to show documents would ideally use this system (dolphin, rekonq, kate, kword… just to name a few).

    Here are some screen shots proposed in the comment thread:



    Having an easy API to enable this would be very welcome.
    setMainMenu(menu);
    setWindowTabs(tabWidget);

    Elsewhere in KWin settings:

    [ X ] Place tabs in window border when supported.
    [   ] Place main menu in window border when supported.
    April 5, 2011 · 54 comments


    In a comment from a Qt Nokia engineer:

    Qt on the desktop is currently not a priority for our R&D team, even though Nokia does use Qt for desktop applications (and not only Qt Creator). That doesn’t mean that nobody is working on it, however we do believe that Qt is a great development tool for desktop applications, even if we just maintain it and keep it working on the desktop platforms. We definitely want to keep it that way, and we continue to improve and modernize Qt on the desktop as well, but I personally don’t really see that there are a lot of new features we could add to make Qt significantly more powerful for desktop development (esp features that are already provided by other libraries – why cannibalize our own community?).

    Perhaps obvious and expected, but are we okay with this admission?

    February 19, 2011 · 12 comments


    …or is this just wishful thinking?

    If his prediction is correct, does that mean Meego will be revived?

    February 13, 2011 · 39 comments


    …before Nokia kills Qt.

    Update: Our voice has been heard about this, but they still don’t know what the hell is happening.

    February 11, 2011 · 9 comments


    Uhhh what?

    August 14, 2010 · Comments Off


    Hugo Pereira Da Costa and Thomas Luebking are geniuses. If you’ve used KDE 4.5, you’ve probably noticed that you can now drag windows by selecting any blank area. You’ve also probably read that, as expected, this only works with Qt apps. How does such hackery work? What in Qt allows this kind of interaction? How can a window decoration enable such an interaction with the window manager? How do we know which events on which widgets to intercept? I suggest that if you haven’t already seen it, you give oxygenwindowmanager.cpp a close read. It’s extremely educational.

    August 14, 2010 · 6 comments


    I frequently find myself wanting to look through the Qt source or look through a couple of commits. I could keep a copy of Qt checked out on all the computers I use, and flick through the repository using git command-line or qgit or even git instaweb, but this is usually less convenient than simply heading over to gitorious. Unfortunately, gitorious is notoriously sluggish and I find their site design a bit hindering as well.

    So I’ve decided to mirror Qt’s repository on my personal server running cgit, which is much much faster than Gitorious. It’s synced once an hour by cron. And if nobody abuses this, I’ll keep it open for the community.

    Head on over to git.zx2c4.com/qt.

    Next up, I might attempt to mirror KDE’s subversion repository on my CGit. I’m not a very big fan of websvn, and I know KDE is moving to git, but the main tree won’t be moved for quite some time. Anyone an expert at git-svn and can provide some tips for a mirroring script to a bare repository? As we speak, I’m running git svn fetch on a repository made with git svn init --stdlayout svn://anonsvn...., and then manually adjusted to be bare. The import is taking a long time…

    Update update update: Holy cow. After leaving git svn fetch running overnight, I’m on revision 41671 of 1159974… which is only 3.5% done (and by the way, I’m running this out of a data center’s über-bandwidth connection). KDE has a huge history; this is obscene. Any pointers here? Should I stop this? Have I done something silly that will render the eventual result unusable?

    August 6, 2010 · 6 comments