ArgumentError: wrong number of arguments (3 for 2) with Better Nested Set Plugin

Ruby on Rails No Comments »

If you’re using the Better Nested Set plugin in your 2.1 Rails app and get an error such as

ArgumentError: wrong number of arguments (3 for 2)
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:2479:in `attributes_with_quotes’

upon saving your model or upon calling update_attributes, you have two options:

Happy nesting!

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Dual-Screen on Ubuntu with Intel 945GM Chipset

Computing, Linux No Comments »

You’ve surely read this article on the topic, which describes a long (and arduous) process to set up dual monitors on an Ubuntu system with a lowly graphics chip such as the Intel 945GM.

However, there is a much easier option which is outlined here

For my system, all I had to was add the bold line in /etc/X11/xorg.conf

Section "Screen"
	Identifier	"Default Screen"
	Device		"Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller"
	Monitor		"Generic Monitor"
	DefaultDepth	24
	SubSection "Display"
		Modes		"1280x800"
Virtual                 2048 2048
	EndSubSection
EndSection

I then “activate” the secondary monitor with the command:

xrandr –output LVDS –below VGA

There is a 2048 pixel limit for the height and the width of the total display. For me that’s no problem as I have a vertical setup (secondary screen ABOVE notebook screen), but your mileage may vary if you need the screens side-by-side.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Thai-English Dictionary for Linux (Debian, Ubuntu)

Thailand No Comments »

It’s not easy to find a Thai-English-Thai dictionary for Debian-based Linux distributions (Ubuntu, Mint etc.) but this package is the most painless option I’ve come across so far:
ftp://ftp.nectec.or.th/linux-distributions/Linux_TLE/archive/patong/pool/main/s/stardict-lexitron/stardict-lexitron_2.4.2-1tle1_all.deb
Download and double-click to install.
For other distributions you can find packages on the Nectec website (http://lexitron.nectec.or.th/downloadLex_detail.html).

Blogged with the Flock Browser
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Combining TOP and GROUP BY with SQL Server 2005

SQL No Comments »

It’s an every day task: Select the ten top-selling widgets from each category. The obvious approach is to combine TOP and GROUP BY, which usually comes with some annoying “Column ‘xxx’ is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause” errors you try to work around. The culprit is a misunderstanding of the GROUP BY clause. It will NOT give you multiple result sets, but rather ONE result set with a single row for each group. From Books Online:

GROUP BY produces a single result set. There is one row for each group containing only the grouping columns and aggregate functions that show the subaggregate for that group. The select list can contain only the grouping columns and aggregate functions.

Here’s how to achieve the desired “TOP X PER GROUP” results using a variety of features introduced with SQL Server 2005.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Mount a Shared Windows Drive in Ubuntu Linux to Use Open Office

Active Directory, Linux No Comments »

Accessing files located on a Windows Active Directory network share from your Linux machine is easy via Samba (and probably NFS, which I’ve never tried). However, trying to use Open Office applications such as Writer or Calc to open these files will likely fail. OO apps will start up and then die silently. That’s why it’s usually necessary to mount the shared drive with a command such as this: 
sudo mkdir /media/mynetworkserverc
sudo mount -t cifs //mynetworkserver/c /media/mynetworkserverc -o username=myusername,password=mypassword

Blogged with the Flock Browser
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in