Category: Uncategorized

I finally pushed myself long enough to complete my first ruby application. It’s called Twitter multifollow and here is a basic description.
When you login into your twitter account. You’ll see new box with search button. After writing down name of some twitter accounts you’ll see a list of twitter accounts which he follow. You can select some and press follow button. Then you will follow them. So instead of going to each twitter account page you can follow
people from one place.
I used Sintra and Twitter gem so the main part i wrote is at js. I also use html5 and css3 so if you have older browser or IEx, you’ll see different UI.

I recently started write pomodoro aplication to practice my skills and try out new technologies.
One of new technology that I tried is HTML5 storage. Storage is actually database but I prefer the word storage.
I show you some examples here. I also
must tell you that Html5 storage works only at Safari. I tried it at Firefox 3.5 and Chrome
but didn’t work even after installation WebKit Nightly.

Fist step is change doctype definition and put manifest at html tag:

1: <!doctype html>
2: <html manifest="PomodoroTimer.manifest">

Ar row 2 you can see defintion of manifest file which is like cache. You can named it
as you like.

Step two is javascript. Because you need somehow dynamicaly add and remove or create records at your hmtl5 storage,
javascript is the right choice. So here is how you can create storage.

if (window.openDatabase){
storage = openDatabase("pomodoro_timer", "1.0",
"HTML5 Database for PomodoroTimer", 200000);
if (!storage)
alert("Failed to open the database on disk.");
} else {
alert("Couldn't open the database.);
}

At first line you can see how to check if window object support starage. At line 2 I create instance
of a storage: storage name, a storage version, a display name, and an estimated size, in bytes, of the data to be stored in the storage/database.
Rest of lines didn’t need an explanation.

At line one we create an anonymous function for storage transaction. Official definition of transaction method:
“The transaction method takes one to three arguments:
a transaction callback, an error callback, and a success callback. The transaction callback gets passed a SQL transaction object on
which you can use the executeSQL() method.This method takes from one to four arguments: a SQL statement, arguments, a SQL statement callback,
and a SQL statement error callback. The SQL statement callback gets passed the transaction object and a SQL statement result object which gives access to the rows, last inserted ID, et cetera.
“

I just finished pair programming with my friend Laco who live at Barcelona. We used Skype, Collabedit and gitHub for code synchronization. I’m really tired after six hours, but I’ve good feeling about this. I hope we will continue on that soon. You can see our work here.

I started testing with Ruby. So i first use Test::Unit and then i want to test some functionality on web. I read some examples at mechanize documentation, which is here or at your ruby/gems directory. So let’s look at the code. require ‘mechanize’
require ‘test/unit’

class LoginTest < Test::Unit::TestCase
def test_login

#creating mechanize object agent = WWW::Mechanize.new

#setting url page = agent.get(‘http://zaparka.cz/wp-login.php’)

# get first html form on page, u can use page.form(‘form_name’) login_form = page.forms.first

Because I started learning Ruby on Rails I needed to run some database server for ruby. I like mysql. I developing web aplications with WAMP (Windows + Apache + Mysql + PHP). So i tried to run Ruby on Rails with pre-installed version of mysql 5.1.33 but Rails didn’t work properly. I tried to find how to fix the problem bud it seems that Ruby on Rails has some problems with mysql 5.1.33.

So i refused SQLite and PostgreSQL for my personal reasons, than only one option left, another mysql server. I downloaded mysql server 5.0. run installation and than configuration that failed in last item (security settings). But mysql server worked quite well.

I was wondering if Rails are going to accept another sqlserver. It didn’t let use say it did but i forget set different port to mysql server 5.0. So i had an idea that this port problem can cause the security problem. So i run configuaration tools set port to 3309 and click to final step and security problem appeared again.Never mind I thought. I added a line port: 3309 as you can see below,

I has been developing Internet aplication about 9 years. In everyday work i use PHP and AJAX technology. It is quite a long time ago when my friend Ladislav Martincik told me about Ruby on Rails. I seen some amazing presentation of Rails framework he showed me. I wonder why I did not start learning and using Rails and Ruby at that time. Maby it was too early for me or maybe i was too lazy.

But …

I starting now. I bought book Begining Ruby on Rails last week. But the book seems to me that is little confusing. So i was browsing a little and I found this cool book called ‘Poignant Guide to Ruby”. It is kind of unconventional but i love it. It is funny and very brightly written. I’m looking forward to read more chapters tomorow.

Ps: I wonder how high can insects fly, because I live at 8th floor and it still bothers me.