Usability of Human Interfaces

Feb 8th, 2010

How to pass JSON UTF-8 from Smarty template to Open Flash Chart 2

Jan 27th, 2010

Recently I ran into the problem with passing UTF-8 JSON from Smarty to Open Flash Chart 2. By default Smarty is striping slashes from all variables that it passes to the template, and JSON is converting every UTF-8 Character with ‘\u’ in the beginning. Of cause Smarty was returning only ‘u’.

To force Smarty to pass variables with slashes you can do next:

1
$this->smarty->assign("chart", addslashes($chart->toString()) );

After that $chart will have correct JSON with correct UTF-8 Characters

Tags: ,

The Office Season 4 (Andy asks out Angela)

Dec 20th, 2009

Come on, McDonalds

Nov 1st, 2009

Why I have to pay for ketchup in your “fast food restaurant” in Russia?

Howto install rails on Ubuntu 8.04 LTS Server

Oct 2nd, 2009

If you have Ubuntu 8.04 LTS Server and you are installing rails from gem, you most propbably will run into the problem when rack will need thin and thin will need rack and this will create infinitive loop. There is a very simple and fast fix for it. All you have to do is update RubyGems. Please keep in mind that update will remove all your installed gems and you will have to install it once again.

sudo gem update --system

Then you have to remove old gem file from /usr/bin and link it to newer one.

1
2
sudo mv /usr/bin/gem /usr/bin/gem.bak
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

After that you should be able to install Rails with following command:

sudo gem install rails

Happy coding!

Tags: , , ,