Installing JDK 6, 7, 8 on Windows XP (without admin) [SOLVED]

7zip extract the .exe unzip the tools.zip Create a install.bat in the top level directory FOR /R %%f IN (*.pack) DO .\bin\unpack200.exe -r -v “%%f” “%%~pf%%~nf.jar Extract the src.zip from an equivalent linux tar.gz distribution as 7zip doesn’t manage to extract this – it’s the same file

Published
Categorized as geek

Mythtv transcode for Android

After a number of issues with avconv I switched to ffmpeg. Out of memory (OOM) errors. Non-monotonic timestamp issues, and audio/video sync problems Sometimes mythtranscode can fail. If it does, the recommended way to fix it is to stream copy the .mpg using ffmpeg, replace the original file and try again. Android only supports H264… Continue reading Mythtv transcode for Android

Published
Categorized as geek

non monotonically increasing dts error with mythtranscode [solved]

I found the error when processing the output from mythtranscode with avconv. invalid non monotonically increasing dts to muxer in stream 1 I fixed it with a stream copy using mencoder mencoder “input.mpg” -oac copy -ovc copy -o output.mp4 The same technique with avconv did not work, it crashed with the same non monotonic error.… Continue reading non monotonically increasing dts error with mythtranscode [solved]

Published
Categorized as geek

Responsive 2D table

For WeatherSupermarket I need to layout a grid forecasts for five days for up to six providers, Met Office, AccuWeather etc. I have the providers vertically, each with the location, and a dropdown box to change the location. The days are laid out horizontally. This has always worked fine for Desktop browsers with plenty of… Continue reading Responsive 2D table

CSS spriting using RMagick

I wanted to give CSS spriting a go – i.e. one large image montage and then using background-position to ‘see-through’ to the correct image. The best off the shelf solution looks like SmartSprites but this requires you annotate your CSS with configuration… So I wondered if I could knock something cheap and cheerful using RMagick… Continue reading CSS spriting using RMagick

Assorted IE8 polyfills: forEach, trim, placeholders

I ended up using all of the following during recent development of weathersupermarket 2.0 and another site. Array.prototype.forEach() implemented using a for loop and fn.apply if (typeof Array.prototype.forEach !== ‘function’) { Array.prototype.forEach = function(callback, context) { for (var i = 0; i < this.length; i++) { callback.apply(context, [ this[i], i, this ]); } }; }… Continue reading Assorted IE8 polyfills: forEach, trim, placeholders

Rails, active record, concurrency and scaling

Coming from a Java background I’m confused by ruby’s poor support for concurrency The problem… I’m rewriting weathersupermarket, a screen scraper for weather forecasts using Rails. This is the basic logic of server forecast service. user requests forecast for location 123 get location 123 from database if last forecast retrieved more than N seconds ago… Continue reading Rails, active record, concurrency and scaling

“unknown compression method” with open-uri

In my local build of ruby 2.1.1 I see “unknown compression method” when calling open on certain URLs… net/http/response.rb:357:in finish’: unknown compression method (Zlib::DataError) It looks like open-uri adds the header saying it can accept gzip and deflate (Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3) but if deflate is sent it blows up. # broken – defaults to “Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3″… Continue reading “unknown compression method” with open-uri

Published
Categorized as geek

Simulating a server with netcat

Note use of \r\n. and echo -n, i.e. no automatic new line and -e escape chars echo -ne “HTTP/1.1 200 OK\r\nContent-Encoding: gzip$(echo hello-world | gzip)\n” | netcat -l 4000

Published
Categorized as geek

jQuery building array selector

I’ve just been working on code to dynamically show/hide columns in a horizontal table to fit the width of the browser, i.e. show 1 column on 320px mobile, but all on desktop etc. To support this I need to animate the Nth cell from each row concurrently. Firstly create an empty selector $([]). Apparently $()… Continue reading jQuery building array selector

Published
Categorized as geek