LG UltraFine 5K Display works with Windows 10 PCs

Saturday, 09 January 2016

The LG UltraFine 5K Display works to some extent with Windows 10 PCs. Although the motherboard in my Windows PC did not include Thunderbolt 3 connections, I was able to upgrade it using the ASUS ThunderboltEX 3 Expansion Card. This should work with most Z170 and X99 based motherboards (I have a Gigabyte GA-Z170MX-GAMING 5 Micro). If you are unsure double check your motherboard manual to see if it has a 5-pin Thunderbolt header.

After installing the card and connecting it to the Thunderbolt header you run a DisplayPort connection between your graphics card and the Thunderbolt card using the included external cable. Very old school, reminds me of connecting a Voodoo2 up to a 2D graphics card back in the day.

Plug it into the monitor using the Thunderbolt 3 cable that comes included and it will show a picture immediately - no drivers required. Some notes:

  • Speakers work great and can be adjusted on screen or using keyboard volume controls.
  • Maximum 4k resolution as expected due to the single DisplayPort passthrough.
  • Brightness cannot be adjusted using keyboard or onscreen. I expect this is a driver issue that may get addressed eventually. The display does retain the brightness across connections so to adjust it you must plug in a Mac for now.
  • The built in webcam barely works. I was seeing sub 1fps and distortion in video recordings and Skype calls.
  • BIOS and POST screens are all displayed during boot.
  • Can be plugged and unplugged without a reboot.
  • I tried out a few different drivers from the LG website but nothing seemed to be compatible. For now it just shows as Generic PnP Monitor in device manager.

Here is the crazy passthrough setup at the back of my PC now.

LG UltraFine 5K Display works with Windows 10 PCs

LG UltraFine 5K Display works with MacBook Pro (Retina, 15-inch, Late 2013)

Saturday, 09 January 2016

The LG UltraFine 5K Display works great with the MacBook Pro Retina 15-inch from Late 2013. The Apple Support pages state it will only work with Mac Book Pros from mid 2014 onwards.

I decided to take a gamble and give it a try with my 2013 MBP given that the 2013 and 2014 models are nearly identical. To get it working connect a regular Thunderbolt 2 cable to a Thunderbolt 3 (USB-C) to Thunderbolt 2 Adapter and plug that into the monitor. Speakers, camera and keyboard controls all work as expected.

LG UltraFine 5K Display works with MacBook Pro (Retina, 15-inch, Late 2013)

Rails 4.1: Database URLs

Tuesday, 29 April 2014

DHH mentioned in the Rails 4.1 announcement blog post that it now supports configuration of database connetions through URLs. I couldn’t find any documentation for the feature so here’s how it works.

Your config/database.yml can now go from something like this:

development:
  adapter: postgresql
  database: app_development
  host: localhost

To this:

development: "postgresql://localhost/app_development"

You can also specifiy the database URL as an environment variable when running your app, for example:

DATABASE_URL=postgresql://localhost/app_development bundle exec rails s

Unfortunately you can only override an existing config with an env var if you use the original (non url based) syntax in your database.yml file.

Configuration via env var is very useful in production environments where service discovery is used and saves having to rewriting the database.yml each time just to point at a different database.

Heroku: Your account vavramuk@gmail.com does not have access to appname

Tuesday, 29 April 2014

Encountered this error while trying to deploy an app to Heroku today.

 !  Your account vavramuk@gmail.com does not have access to appname.
 !
 !  SSH Key Fingerprint: aa:bb:aa:bb:aa:bb:aa:bb:aa:bb:aa:bb:aa:bb:aa:bb

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I thought I had been hacked but “vavramuk@gmail.com” is actually the default public key for Vagrant, which I had been using earlier. To solve the problem run:

ssh-add -D

And try to push again.

Via @dmathieu

Running Faye on Port 80 via Nginx

Tuesday, 18 February 2014

I have found on restricted networks it’s tricky to get faye running using it’s default settings. Faye normally runs on port 9292 which is blocked on many firewalls. To get around this I configured an Nginx proxy to sit in front of the main web app and the faye process and route all requests to the correct service. This means all traffic can be served over port 80 or 443 if you’re using SSL.

This is an example of the configuration I used.

server {
  listen      80;
  server_name app;
  root        /srv/app/current/public;

  location ^~ /faye {
    proxy_pass         http://127.0.0.1:9292/faye;
    proxy_redirect     off;
    proxy_set_header   Upgrade    $http_upgrade;
    proxy_set_header   Connection "upgrade";
    proxy_http_version 1.1;
    proxy_buffering    off;
    proxy_cache_bypass $http_pragma $http_authorization;
    proxy_no_cache     $http_pragma $http_authorization;
  }
}

Guardian Filtered Feed

Sunday, 17 February 2013

UPDATE This stopped working because the feed format changed several times. I also no longer subscribe to the feed.

I forgot to make this project public when I created it for myself and started using it a couple of years ago.

I put together a filtered version of the Guardian’s RSS feed which is more to my tastes. It removes sports news, podcasts and other non news items that appear in the feed. It also inserts images seen at the top of stories on the website, which for some reason are removed from the official feed. It’s also in atom format but that’s more a side effect of atom being simpler to generate in rails.

It has been working fine with Google Reader for a number of years now, maybe someone else will find it useful too.

Far Cry 3 on MacBook Pro with Retina Fix

Tuesday, 04 December 2012

This works for me when booting into Windows 7.

  • Navigate to your Far Cry 3 installation folder, usually c:\Program Files (x86)\Ubisoft\FarCry3 (or wherever Steam is installed).
  • Go into the bin folder.
  • Right click on farcry3_d3d11.
  • Click Compatibiliy
  • Check “Disable display scaling on high DPI settings”
  • Apply
  • Play the game.

Fixes the flickering black screen problem when first loading and allows the game to run in fullscreen mode.

Gibdo - My HTML5 Game Engine In CoffeeScript

Monday, 05 March 2012

Recently, inspired by the work of Notch and Bret Victor, I have been doing a little more game programming in my spare time. The only game development I had done previously was in C/C++ and I found it just didn’t have the tight feedback loop that both Notch and Bret demonstrate so well when they code. As I didn’t feel like firing up Eclipse and going down the Java rabbit hole with Notch I decided to take Bret’s approach and work on an HTML5 Canvas game.

What I have been able to put together so far is called Gibdo - a top-down 2D game starting point featuring,

  • A scrolling view window that tracks the player across the game world.
  • View limit detection to allow the player to move off the centre of the screen as the edges of the game world are reached.
  • Sprite collision detection.
  • Keyboard input.
  • Sprite animation and sprite swapping based on the player’s direction.

Screenshot right

It’s all written in CoffeeScript which has been a great fit for working on a game due to it’s clean handling of JavaScript’s prototypal inheritance. You need only compare it to the compiled JavaScript to realise how much easier it is to reason about the CoffeeScript code.

I have also take then time to fully document the code using Docco. You can find the annotated source here which I highly recommend checking out to see how it works.

It’s obviously not a full game but I feel it’s a good starting point to build off. In the future I would like to add,

  • Multiplayer support (maybe using pusher).
  • Tile based world generation.
  • Game mechanics such as combat, levels, etc.
  • Sound effects.
  • Massively Improved sprites (a pixel artist I am not).

You can try it out in your browser right here. Feel free to submit pull requests on GitHub if you would like to add any new features.

Backbone.js vs Ember.js

Wednesday, 11 January 2012

In the last few years a trend in web development has been gathering pace. It used to be the case that we could write all of our views and templates on the server side to rendered by a web framework. Now if you want to build a modern web app you need to be comfortable putting the bulk of that logic on the client side.

Backbone

Up until very recently I had been using Backbone.js to do that. Backbone is a great way to provide structure to your client side Javascript and provides MVC tools including routing and data syncing. Due to it’s stellar documentation and wealth of examples it was the obvious choice for many developers and gained a ton of traction.

But there was always a key problem with Backbone. I felt like I was writing lots and lots of code just to do very standard interfaces. This is mainly because Backbone gives a lot of freedom in how you choose to render templates and handle events. As I got more familiar with it I realised there was scope for a meta framework that could sit on top of Backbone and perform a lot of the heavy lifting for the developer. Of course this never happened, but Ember.js did appear!

Ember

Ember.js is a new framework that specifically addresses the problems I encountered with Backbone development. Instead of manually wiring everything together you can, for example, point a view at an array and it will automatically rerendered as the array is manipulated. This is because of Ember’s brilliant binding system and tight integration with the Handlebars.js templating language.

It was such a smart move for the Ember team to rebrand the framework (it used to be called SproutCore 2.0) as it grabbed my attention and I understood the angle they were coming from immediately.

The biggest problem facing Ember right now is documentation. I found it very difficult to discover the best practices and techniques so that I wasn’t fighting against the framework. I found the most success by reading through the Ember source, the unit tests and hanging out in the IRC channel. If more example applications were available to read through this problem could be solved.

I have also found other areas of the framework slightly lacking - specifically routing and persistence where I feel Backbone is more mature. The good news is that since I started using Ember last month a ton of work has gone in to both areas resulting in ember-states and Ember Data which are great steps towards addressing these holes.

Am I Sticking With Ember?

Yes, although it’s a little rough around the edges the core idea is solid and Ember is getting better on a daily basis. It’s probably not a good fit if you need to both learn client side MVC and release an app pretty soon but it’s just a matter of time before documentation and more example apps are released. If you are familiar with Backbone or another framework give it a try and see if it cuts down the amount of boilerplate you need.

Confident Code

Saturday, 17 September 2011

This talk from Avdi Grimm is essential viewing for Rubyists or just OO programmers in general. He has some very clever techniques for avoiding nil at all costs which can be easily added to your own development arsenal.

Warning - if you watch this you will find it even more frustrating to read through poorly written libraries.