Aug 26

What a nice feature:

Aug 19

Just wondered why I got no results after executing a search via Sphinx and Thinking Sphinx. The problem was, that I used a negative value in a filter attribute and that Sphinx only supports unsigned integers:

Attributes are named. Attribute names are case insensitive. Attributes are not full-text indexed; they are stored in the index as is. Currently supported attribute types are:

  • unsigned integers (1-bit to 32-bit wide);
  • UNIX timestamps;
  • floating point values (32-bit, IEEE 754 single precision);
  • string ordinals (specially computed integers);
  • strings (since 1.10-beta);
  • MVA, multi-value attributes (variable-length lists of 32-bit unsigned integers).
  • Tagged with:
    Aug 12

    Here is a small code snippet to check for retarded browsers in Ruby on Rails:

        user_agent = request.user_agent
        unless user_agent[/msie/i].nil?
          session[:browser] = 'retarded'
        else
          session[:browser] = 'normal'
        end
    Tagged with:
    Aug 06

    I just had the following problem when trying to start a Ruby on Rails application on a fresh installation of Mac OS X Snow Leopard after I installed the mysql gem via gem install mysql:

    uninitialized constant MysqlCompat::MysqlRes

    I searched a bit and found a solution here. It was a problem with a buggy version of  the Mysql driver. So you need to use a different version when installing the mysql gem. So first uninstall the existing gem via

    gem uninstall mysql

    and reinstall it via

    export ARCHFLAGS="-arch i386 -arch x86_64" ;sudo gem install --no-rdoc --no-ri  -v=2.7 mysql -- --with-mysql-dir=/usr/local/mysql  --with-mysql-config=/usr/local/mysql/bin/mysql_config
    Tagged with:
    Aug 06
    Logo for ImageMagick
    Image via Wikipedia

    The easiest way to install ImageMagick on a Mac system (Snow Leopard) is to download and install MacPorts:

    http://www.macports.org/install.php

    After installing MacPorts via the package installer just enter

    sudo port install ImageMagick

    and that’s it.

    Jul 06

    I just wondered if LinkedIn supports company profile retrieval via their API. Unfortunately they don’t support it yet. :(

    We dont have company APIs yet. You can certainly search for people at a specific company using the Search API, but we dont have company APIs that let you get the company profile. Something wed like to do in the future, but we dont have any specific plans yet.

    via LinkedIn Developer Network: Company Profile.

    Tagged with:
    Jul 02

    I just had the problem that I added multiple markers to a v3 Google Map and executed fitBounds to see them all at ones. But the zoom level was much to high, when having only one marker. Calling the setZoom() method afterwards didn’t make any difference, so I searched a little bit and found this nice snippet of code:

    google.maps.event.addListener(map, 'zoom_changed', function() {
            zoomChangeBoundsListener = google.maps.event.addListener(map, 'bounds_changed', function(event) {
                if (this.getZoom() > 10) // Change max/min zoom here
                    this.setZoom(10);
    
                google.maps.event.removeListener(zoomChangeBoundsListener);
            });
    });

    via Boogle’s Blog (Google Groups respectively)

    Tagged with:
    Jun 30

    Firefox 4 is coming and you can test it in a first beta version:

    Index of /pub/mozilla.org/firefox/nightly/4.0b1-candidates/build1.

    Get some more information in this nice slideshow:

    Tagged with:
    Jun 29

    Just found this little plugin which is maybe interesting to protect against Cross-site scripting in Ruby on Rails.

    xss_terminate is a plugin in that makes stripping and sanitizing HTML stupid-simple. Install and forget. And forget about forgetting to h your output, because you won‘t need to anymore.

    via xssterminate – Project Hosting on Google Code.

    Tagged with:
    Jun 28
    Image representing iPhone 3G as depicted in Cr...
    Image via CrunchBase

    If you set the NSZombieEnabled environment variable, the Objective C runtime will leave a dummy object behind for every deallocated object. When the zombie object is called, execution stops and you can see the message that was sent to the object and the call stack that tells you where the message came from it doesn’t tell you where you over released the object, but knowing where the object is called from should get you pretty close to the problem.

    via codza » how to debug EXC_BAD_ACCESS on iPhone.

    Tagged with:
    preload preload preload