My blog has moved!

You should be automatically redirected in 6 seconds. If not, visit
http://kavachai.com
and update your bookmarks.

Monday, March 23, 2009

Handling move from Rails 2.2.2 to 2.3.2 version

As I preffer to work on virtual machines (by the way my personal choice is VMware) I used one of them while getting in touch with Rails. I had version 2.2.2 installed there.
Today I created a new VM for working with Rails and found out that 2.3.2 version of Rails appeared there as a result of installation. New version of Rails arrived :)
Unfortunally I was not able to run any of my demos :(

To fix this issue I started with change in "config/environment.rb" by updating
RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION
to
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
Then I had to run "rake rails:update".

Thats it. These two steps brought demos to life :)

Monday, March 16, 2009

Borland C++ 3.1

Today I needed to check some code in C++ and decided to use old good Borland C++ 3.11 just because it's fast to install it.
Unfortunatly I found out that my copy of it died together with my external drive :((
I must confess that it was not such an easy thing to find working download link on the web. But I found one at http://www.eni4ever.com/downloads.php?cat_id=1. This page also contains links to some old IDEs for other languages.

Friday, March 6, 2009

Blogger and Picasa are connected

Just discovered connection between Blogger and Picasa. I don't use Picasa to hold my photos. So when I navigated to Picasa on web from my Gmail account I was surprised to find out that I have four images in there.
After eximining what are these images I recognized images from my posts in Blogger. I didn't know about this kind of integration between Blogger and Picasa. Pretty interesting fact.

Tuesday, February 24, 2009

"services.exe" virus

Today when going to the web site of Nissan dealer present in my city I've got a virus. What it does is sending e-mails from my machine. Pretty unexpected situation.
Unfortunaly my antivirus did not stop it, but I found solution in a couple of minutes:
  • With the help of Task Manager I found additional services.exe running on the machine. The file was located at "C:\Windows\services.exe".
  • Since Windows thinks that this virus is a system component it does not allow to stop it. I used CopyLock application to remove it at the next system start.
  • Finally I removed this services.exe from the system startup list.
My system is healthy again!

Thursday, February 12, 2009

MVC vs MVP

Recently during my recearch on the different between MVC and MVP patterns I found two great articles.
Hear are two quotes from them.

1. Everything You Wanted To Know About MVC and MVP But Were Afraid To Ask

The two patterns are similar in that they both are concerned with separating concerns and they both contain Models and Views. Many consider the MVP pattern to simply be a variant of the MVC pattern. The key difference is suggested by the problem that the MVP pattern sought to solve with the MVP pattern. Who handles the user input?
With MVC, it’s always the controller’s responsibility to handle mouse and keyboard events. With MVP, GUI components themselves initially handle the user’s input, but delegate to the interpretation of that input to the presenter.

2. MVC or MVP Pattern – Whats the difference?

Here are the key differences between the patterns:

* MVP Pattern
o View is more loosely coupled to the model. The presenter is responsible for binding the model to the view.
o Easier to unit test because interaction with the view is through an interface
o Usually view to presenter map one to one. Complex views may have multi presenters.
*MVC Pattern
o Controller are based on behaviors and can be shared across views
o Can be responsible for determining which view to display (Front Controller Pattern)

Tuesday, February 3, 2009

Getting Ruby on Rails 2.2.2 working on Windows XP

When installing Rails 2.2.2 I ancountered a problem with sqlite3. Although sqlite3 is a default database used by Rails starting from version 2.2.2 on Windows XP is not such a trivial thing to make it work.

I started by trying to install sqlite3 using gem like this:
gem install sqlite3-ruby
But I got an error:
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.

C:/ruby/bin/ruby.exe extconf.rb install sqlite3-ruby
checking for fdatasync() in rt.lib... no
checking for sqlite3.h... no

nmake

Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

NMAKE : fatal error U1073: don't know how to make 'ruby.h'
Stop.
The solution is quite strange from my point of view:
  1. Download sqlite and sqlitedll from sqlite downloads (by now they are "sqlite-3_6_10.zip" and "sqlitedll-3_6_10.zip").

  2. Unzip both archives to Ruby bin folder ("C:\ruby\bin" on my machine). There should be three files: sqlite3.exe, sqlite3.dll and sqlite3.def.

  3. Install sqlite-ruby using such a command:
    gem install sqlite3-ruby --version 1.2.3
The strange thing is that if you do not use the version parameter installation will be unsuccessfull.

Thursday, January 29, 2009

The most unexpected explenation of delegates I've ever read

Once upon a time, in a strange land south of here, there was a worker named Peter. He was a diligent worker who would readily accept requests from his boss. However, his boss was a mean, untrusting man who insisted on steady progress reports. Since Peter did not want his boss standing in his office looking over his shoulder, Peter promised to notify his boss whenever his work progressed.


To read full story follow the link .NET Delegates: A C# Bedtime Story.