Rails conf 2008/6/2

Its aways nice to know whats going on in rails field


Whats new for me was flog:

  • http://on-ruby.blogspot.com/2007/12/flog-profiling-complexity.html
  • http://ruby.sadi.st/Flog.html

Some more video links

Нова търсачка за цените

От известно време си имаме на http://www.cenite.com чисто нова търсачка.

Преди беше просто досадно да се търси в сайта и макар, сайта върши работа.

Резултатите с новата търсачка са налице, вижте разликата:

  • Преди за един резултат се чакаше приблизително от 2 до 4 (олеле) секунди.
  • Търсеше се само в името на продукта


  • Търсенето става мигновенно – повече време отнема да се изобрази страницата от броузера :)
  • Търсенето е едновременно в заглавието на продукта, както и в описанието му, като се дава превес в резултатите съдържащи ключовите думи в името на продукта.
  • Може да се избира по кой полета да се търси, макар че не ми е останало време да публикувам HELP към търсачката.
  • Сортиране по точност на намерите резултати.
  • Отпаднаха притесненията за Иванчо ;drop table students;

Изглежда и посетителите също оценяват предимствата на новото търсене, от 1000 посетителя на ден в момента са над 2500 като всеки ден се увеличават.

Only get, head, post, put, and delete requests are allowed.

I got this error when I have to upgrade one old project from rails 1.2.5 to rails 2.1 (the problem is not in rails)

The exception:

I got this error only when I access URL’s with param like

I found that the problem was in the :id because without the :id the method was called correctly

This means that there is something with the routes.

Not working routes.rb: ….

it will work if you swap the last two lines….

It seems that it does reading the comments in the routes.rb is usefull. There is written:

Upgrading Rails

Here is nice tutorial how to move your project from rails 1.2.x to 2.0

  • upgrade the gems: http://wiki.rubyonrails.org/rails/pages/HowtoUpgrade
  • http://macournoyer.wordpress.com/2007/10/28/moving-to-rails-20/
    • nice task to find the deprecated elements: “rake -T deprecated”, 10x!

Gentoo Cheatsheet

Java install

ls /usr/portage/dev-java/sun-jdk/
emerge -av =dev-java/sun-jdk-
java-config -L
java-config -S 1
/usr/sbin/env-update && source /etc/profile

Emerge and Equery

Taken from here

emerge brings in new packages. equery looks at the package database.

update repository:
emerge –sync
install package with query
emrge -av sun-jdk
start with this software
emerge links wget htop
emerge …
manipulate package database
emerge -NDtu world
–update packages and packages that depend on updated packages (–deep) in the world list. Give output in –tree format. Consider packages changed if their USE flags have changed (–newuse, -N) Add –pretend (-p) to just see what it will do first.
emerge –skipfirst …
skip first pkg on a rebuild; very useful if something doesn’t work
equery …
query package database
equary belongs
who owns these files?
equery list
list packages on system


Taken from here

Do this whenever you want a steaming pile of fresh packages.

# emerge --sync
# emerge --update system
# etc-update
if necessary
# emerge --update world

I have seen Meddle to do it this way

emerge –newuse –deep –update world
emerge –ask –verbose coreutils
emerge –resume

Fix the mktemp / coreutils block in Gentoo

Looks like mktemp is now provided by coreutils. No wonder. This block has been bugging me (read: I’ve been ignoring it) for months.

To fix just unmerge mktemp and update coreutils.

Update: Same for the setarch / util-linux block should you come across it. Unmerge setarch.

CSS Tricks


<div style=”clear: both”> – do you remember this? I hate it.

The people has found a solution for this.


.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;

.clearfix {display: inline-block;}

/* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
.clearfix {display: block;}
/* End hide from IE-mac */

CSS tools

Layout generator – http://csscreator.com/tools/layout

PNG Patch for IE

Since IE6 doesn’t render PNG-24 properly, the following hack is required in order to display the transparent PNG (add anywhere in between the <head> tag):


Windows Install Software

Hardware detection

CPUz – CPU, Motherboard, RAM

Everest Home Edition

performance test

Rsync for windows

  • I have tried this one. A lot of GUI it has run without any problem.
  • Next I will try this one it has an rsync server – nice…but it wants cygwin…maybe next time.
  • DeltaCopy Seems like a good match, but i cant just run the rsync that is in the zip file, you must setup some local servers etc.
  • Wonderfull blog with a lot more to read/try
  • Favorite clone: not found :(

Reset Windows Vista/XP/NT passwords

Download the iso from here, burn, boot (DBB), then use the

“NTFS TOOLS” > “Offline NT Password & Registry Editor”

Gigabyte Drivers

Very good driver services – > http://driveragent.com/

Skin your windows

wallpapers http://www.socksoff.co.uk/

you will need to patch your UXTheme.dll, nice faq on the topic

New Pc Installation

Group Policy mmc will popup. On left panel:
* Double-click Computer Configuration to open submenu
* Double-click Administrative Templates to open submenu
* Double-click System to open submenu
* Double-click Turn autoplay off option which will be near the
bottom of the list in the right panel.

The default is the Not configured . Set it to Enabled.

Good tutorials for securing windows XP

Dealing with Virus/Trojan Thread

  • Upload some suspisious file for testing on some antivirus sofware webpage for online check

Full Text search with MySQL

Goodbye MySQL

I was optimistic that I could make http://www.cenite.com, a price monitoring website to use the fulltext search of mysql. Unfortuntly I have found so many drawbacks that I have to leave this idea. The main source for information for me was:



At first the speed was wonderfull. I was searching in 300k> records apx. 350mb. But then I have to surrender. I cant configure mysql to work as I want. I know that If I spend two days to become expert on C/C++ with Unicode I will success but this is not the case. I want working solution.

The resons that make me not to use mysql for searching:

There is no way to change the default operator by default it is OR. You must parse the user query and rewrite it.

I want automaticaly truncation on all my terms.

There is no way to tell MySQL what are characters, and what are not…..sorry, there are two ways:

1. Touching the sources,

2. Configuring in xmls

No documentation on both. Maybe there is …somewhere.

If you use the default configuration then you will wonder how you get or not get the required results.

Here is a summary of the comands that I use to tweak my mysql server:

SET @global.ft_min_word_len=2;
SET @local.ft_min_word_len=2;

But it is better to have those options in my.conf


To check what characterset is using your mysql:

SHOW VARIABLES LIKE ‘character_sets_dir’;

/usr/share/mysql/charsets | E:MySQL Server 5.1sharecharsets

After that you need to rebuild your index with one of those commands
slow: REPAIR TABLE products QUICK;
slow: myisamchk –recover –ft_min_word_len=3 tbl_name.MYI