C# Math.Round

This is just a quick note to remind myself: <br /> Math.Round(4.4); //Returns 4.0.<br /> Math.Round(4.5); //Returns 4.0.<br /> Math.Round(4.6); //Returns 5.0. Credit: Math.Round Method

June 23, 2009 · 1 min · 25 words · kenno

Pidgin 2.5.5 &#8211; cannot connect to Yahoo messenger

I just noticed the abnormality with Pidgin 2.5.5 (running on Debian) these few days — I couldn’t connect my Yahoo messenger account at all. According to the discussion of Bug #389278 it appears that Yahoo was trying to change its protocol. A quick way to have Pidgin connecting to Yahoo messenger server again is to change the Pager server setting for the Yahoo account in Pidgin. To do this, from Pidgin: ...

June 20, 2009 · 1 min · 158 words · kenno

NHibernate.MappingException: Unknown entity class

If you get MappingException error, there are two things you should check out: Make sure the name of the *.hbm.xml is spelled correctly — not *.hmb.xml nor *.mbh.xml Make sure the Build Action property is set to “Embeded Resource.” I learned this the hard way. First, I wrongly spelled hbm.xml and I had its Buld Action property set to “Content”. The above 2 points fixed the problem. Credit: VerySimple, Inc

May 26, 2009 · 1 min · 70 words · kenno

Debian JSON for Ruby

I tried to install JSON for Ruby via RubyGem, # gem install json and I got the following error message: Building native extensions. This could take a while...<br /> ERROR: Error installing json:<br /> ERROR: Failed to build gem native extension. <br /> /usr/bin/ruby1.8 extconf.rb install json<br /> extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)<br /> from extconf.rb:1<br /> <br /> Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/json-1.1.6 for inspection.<br /> Results logged to /usr/lib/ruby/gems/1.8/gems/json-1.1.6/ext/json/ext/generator/gem_make.out<br /> ...

May 24, 2009 · 1 min · 120 words · kenno

LoadError: no such file to load &#8212; openssl

On a Debian system, if the Ruby complains about “LoadError: no such file to load — openssl” try to install this package libopenssl-ruby $ sudo apt-get install libopenssl-ruby Now test if the problem resolved: $ irb -rubygems<br /> irb(main):001:0> require 'openssl'<br /> => true Voilla, there is no more load error. Credit: Ruby Forum

May 23, 2009 · 1 min · 54 words · kenno