1. error: Permission denied sending UDP broadcast packets

    Sorry, gentle reader, this one’s a bit technical.

    I was reusing some of the code Apple supply for sending UDP packets between servers, but the system I’m working with listens for broadcast packets. I set it up to use the address 255.255.255.255, but got the EACCESS error: Permission denied

    I found an example that did work (without using Apple’s CFSocket class) and did a line by line what’s different. You need this to do broadcast

    int broadcastEnable=1;

    int ret=setsockopt(sd, SOL_SOCKET, SO_BROADCAST, &broadcastEnable, sizeof(broadcastEnable));

    if (ret) {
        NSLog(@”Error: Could not open set socket to broadcast mode”);
        close(sd);
        return;
    }
    If you edit this into Apple’s UDP echo project then it will allow broadcast. Give thanks and praise at http://splinter.com.au/sending-a-udp-broadcast-packet-in-c-objective

    1 week ago  /  0 notes

  2. LoadError: OpenSSL::SSL requires the jruby-openssl gem

    I had to hack the bundler executable to load the jruby-openssl gem before it tried to load bundler. Then it worked.

    I think the gem command uses openssl, which is built into the MRI version of Ruby, but has to be included as a gem by JRuby and therefore it happens too late.

    2 months ago  /  0 notes

  3. PGError: ERROR: date out of range for timestamp

    Note - this assumes you’ve enabled the pgbackup plugin in Heroku - as it does the full database backup for you for free - I suggest you do it right now!

    Oh, the fun I just had with this one. One of my clients’ systems started throwing this message over the last week or so.

    I’m lazy so I was using sqlite for my development database and Heroku’s Postgres for live.

    So, thinks I, time to switch to using Postgres in my development environment, because it must be the database, mustn’t it?

    I’d installed it on my Macbook ages ago but hadn’t actually used it with Rails. So I found a couple of blog posts and changed things around. I had already told Postgres to use passwords for validation.

    It took me ages to realise I needed to set a password for the postgres Unix user - this was the password I needed to connect to the database. Then I followed these instructions and got my dev database set up.

    So - pull stuff down from heroku and then import it to my dev environment.

    Right - everything works perfectly - right!

    So where is the error? 

    I googled for it and found a forum posting suggesting that you could have a date stamp that is outside the range of time stamps and the coercion of date stamps is going boom. Did a lot of messing around in the heroku console to no avail, trying to issue commands like analyze table and count things.

    Also, the column is a timestamp anyway, so you can’t store nonsense in it in the first place.

    So, I put the app into maintenance mode, took another backup, restored that backup over the existing database, and all was well.

    This might be a better solution than trying to rescue the database in any event, because all of the statistics will have been reset too.

    I was a little bit hampered by heroku not letting you connect to a shared database because I was trying to issue commands using Active Record - but hey - it’s free. I do wish that heroku console was slightly more informative than server error

    3 months ago  /  0 notes

  4. Rails for Designers

    This is a short post to help designers who aren’t familiar with Rails understand their way around it enough to change things and work with developers. It assumes that you know CSS and HTML and aren’t scared of HTML that has embedded code in it.

    Read More

    4 months ago  /  11 notes

  5. Dead Time at East Didsbury

    Sometimes time is dead time; you have to wait and hope that it will pass

    Dangerous thought - how good it would be to edit your life away, but how would that be good?

    Once lost it doesn’t come back, whatever it might be

    So this moment is of waiting and not exactly enough, or not moving forward to where you would like to be:

    So what?

    Is it really that different from all the other moments?

    This body waits for the next thing - driven by this mind

    This mind is what cares about forward and back

    This mind judges and measures

    This mind does not see its own nature

    So what is waiting?

    What is impatient?

    What is hurting?

    What is sad?

    Does it have a colour, shape or presence anywhere?

    Can you touch it? Except maybe indirectly?

    Why does it want so much?

    Why does it need anything?

    The thing it needs is not there.

    It is closed and also open

    The warm train arrives - the moment dies

    7 months ago  /  1 note