As I got quoted recently in “Scala — 1★ Would Not Program Again” I though I finally should write up a little Wat moment we had recently: So does anyone know “wat” the following Scala code returns? (Value and Type) List(1,2,3).toSet() A Set<Int> containing 1,2,3? Nope how about I give you a clue, there are […]
An alternative approach to just doing CSV export (which is fast and more cross platform/app) is to use web queries (.iqy files that point to fairly HTML) or data queries (.dqy extension but point to the DB) Pro Supports refreshing data / live data model Web based integration Very easy to do Works with all […]
If you use C3PO you can make it do it when it checks the connection out. As properties: c3p0.preferredTestQuery=alter session set current_schema=animals c3p0.testConnectionOnCheckout=true As Java code: ComboPooledDataSource dataSource = new ComboPooledDataSource(); dataSource.setPreferredTestQuery(“alter session set current_schema=animals”); dataSource.setTestConnectionOnCheckout(true); Downside is this will happen every time the connection is taken out of the pool If you are using […]
This is a quick post in response to Elliotte Rusty Harold article titled Why Functional Programming in Java is Dangerous. Lets look at the some of the points made: Lazy evaluation JIT / JavaC can’t optimise Recursion The example that Elliotte uses comes from Bob Martins article done in clojure (take 25 (squares-of (integers))) Lets […]
So one of the last things that wasn’t perfectly working was coming out of suspend when I opened the lid. First thing you need to so is find the name of the LID switch: ls /proc/acpi/button/lid/ LID0 Mine seems to be LID0 or LID1. You can then check it’s current state by doing: cat /proc/acpi/button/lid/LID0/state […]
UPDATE: Ubuntu 14.10 settings Ubuntu 12.10 works pretty well out of the box (for me it was just power management and keybindings that needed work), see Ubuntu wiki if you have any other issues . Using powertop I was able to understand what needed doing. What follows are my settings: /etc/rc.local #!/bin/sh -e # Temp […]
Previous to Gnome 3 I had a nice simple flat file for my keyboard settings, that I just unzipped into .gconf and all was good. Now Gnome is copying the very bad idea of a registry from Windows, you have go through the gsettings API or tool. Locate the keyboard shortcut schema “org.gnome.desktop.wm.keybindings” Now lets […]
I found this article http://ip6.com/projects/?p=363 So I just changed the IP address to match the default that the Vigor modem uses: ifconfig eth1:1 192.168.2.9 netmask 255.0.0.0 iptables -I POSTROUTING -t nat -o eth1 -d 192.0.0.0/8 -j MASQUERADE It’s not perfect but it’s a start.