Linq Read Inserted Id of a Record

Suppose we have the following code sinppets: <br /> private BlogDataContext db = new BlogDataContext ();<br /> ... article.Created = DateTime.UtcNow; article.Modified = DateTime.UtcNow; db.Articles.InsertOnSubmit(article); db.SubmitChanges( ); The ID of the article is automatically generated. How do we get the Id of the newly inserted record? It turns out that the article is updated with the value of Id after the method SubmitChanges( ) is invoked. So, we can just get the Id this way: ...

August 4, 2009 · 1 min · 88 words · kenno

Convert wav to m4a with GNU/Linux

There are probably a gazillion ways to do this. I use FAAC, Freeware Advanced Audio Coder, to do this job. It works very well: <br /> faac originalfile.wav -o outputfile.m4a<br />

July 27, 2009 · 1 min · 31 words · kenno

FIXED: extconf.rb:8:in 'require': no such file to load - mkmf (LoadError)

While reading Linux Journal Issue 181 today, I stumbled upon a section explaining about running Ruby on Rails on Apache using an Apache module called Phusion Passenger, also known as mod_rails. To install Passenger, I followed the instruction provided in the magazine: sudo gem install passenger Unxpectedly, I got the following error: Building native extensions. This could take a while... ERROR: Error installing passenger: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb extconf.rb:8:in `require': no such file to load -- mkmf (LoadError) from extconf.rb:8 Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.7 for inspection. Results logged to /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.7/ext/fastthread/gem_make.out What’s happening? What did I do wrong? ...

July 25, 2009 · 1 min · 188 words · kenno

Copy hard disks or partitions with dd

Warning: The following is for personal note only, and is not meant to be a tutorial or guide. On Debian server at work, we have /home mounted to /dev/hda6 partition, and I want to move that to a new hard disk /dev/hdb. First, I need to create the new partition on /dev/hdb using fdisk with a desired size. Then, use dd to copy the content from /dev/hda6 to /dev/hdb1. # dd if=/dev/hda6 of=/dev/hdb1 bs=1024 The above command instructs dd to read the content from /dev/hda6 and writes it to /dev/hdb1. bs=1024 sets the block size to 1024 bytes. ...

July 14, 2009 · 1 min · 145 words · kenno

Pidgin – Old Version of libpurple and "Unknown Protocol"

I fixed the Pidgin “Unknown Protocol” problem just five minutes after my previous post. I’m going to describe how I found the problem and how I fixed it. If you’re interested, keep reading. In the previous post, I mentioned that I would completely remove the Pidgin package, including its configuration files: # apt-get --purge remove pidgin I did that and then re-installed Pidgin, but unfortunately, it didn’t fix anything. Then I checked the About dialog (Help > About) and noticed it listed libpurple 2.5.4 under Pidgin 2.5.6. This had to be the source of the problem! I remembered that libpurple had been upgraded to 2.5.6, and Aptitude said so. So what could possibly be wrong? ...

July 10, 2009 · 2 min · 235 words · kenno