Too Cool for Internet Explorer

Saturday, October 18, 2008

Rails Summit Latin America Unplugged

Why unplugged? Well, just like a few other guys on this event (I have counted six on the same situation), I have no notebook, no iPhone, and I was not connected to the Web the four days I get there.

But to be honest, I feel good at the end. Why? Well, I’m a speaker too, and I will never be caught accessing the Web when a presentation is taking place. So, looking this way it was good. I give these fantastic guys my FULL attention.

Stand up: Fabio Kung, David Chelimsky, Obie Fernandes, Phillippe Hanrigou, Dr. Nic Williams and Chad Fowler.
Seated: Fabio Akita, Hongli Lai, Gilberto Mautner, Carlos Brando, Danilo Sato and Luis Lavena.

Stand up: Obie Fernandes, Phillippe Hanrigou, Dr. Nic Williams, Chad Fowler, Chris Wanstrath and Manoel Lemos.
Seated: Carlos Brando, Danilo Sato, Luis Lavena, Vinícius M. Teles and Carl Youngblood.
Laid down: Gilberto Mautner.

Anyway, this event was really really awesome! It will be a mark on Latin America’s Rails Community. Not only Brazil, but other neighborhood countries where present on the audience.

About the 1st day, there were two very short and special moments:

At the beginning when Gregg Pollack and Jason Seifer from RailsEnvy and EnvyCasts bring us a new video about the event. Very Funny ! Thanks to Carlos Brando.

And at the end, another good surprise at the Birds of a Feather session. The name: Elomar França a 17 years old guy from Rio Grande do Norte state, talking about how to create a studying group, on the same style of The infamous "identity 2.0" presentation from OSCON 2005.

Elomar França keynoting and a surprised Fabio Akita.

Good work Elomar !

Ah! And he speaks in Portuguese twice as fast as Dr. Nic does in English !

You can see more photos from Rails Summit Latin America here.

And a Video from the Happy End here.

Thursday, October 9, 2008

Who cares about Git ? Or Mercurial ?

I do of course, most of you do I know, but that is not the point.

Why are Git and Mercurial being so popular ?

Why is so important where the code is, if it is inaccessible anyway.

Inaccessible here means you can’t easily access the code you need just because it is on this or on that repository.

There is an interesting article about Git and Mercurial in Technological Wasteland.

The current situation is: I’m learning Rails, in fact, more: I’m learning all this web application development stuff, having chosen Ruby as a language and Rails as a framework.

I was just trying to follow the 14th lesson from LearningRails, thanks to the BuildingWebApps guys, when this subject, about DVCS (Distributed Version Control System), comes up.

Why ? Just because one of the plugins I need to accomplish that lesson (“acts_as_textiled”) changed from SVN, which is a Centralized Version Control System, to GIT.

Well, I’m one of these members of the dumb majority who uses Windows.

Yes I have used it for years developing in VB, then more recently don’t need to change when developing in Java, and see no reason to change now (OK, OK, may be I see some reasons, but I’m a lazy 50 years old developer, Windows will be).

The point is: I use Windows and I use Netbeans, and none of them give nice and easy support for Git.

That was the first point of changing my mind, installing a Rails plugin into a Rails project through Netbeans, is ease, you just need to right click the project, open the plugins pane add the plugin project URL and install it.

It works fine for SVN stored plugins, but what the hell, appears to me now, every single project in the world is going into Git !

Planned support for Git in Netbeans ? Yes, but may take a while.

Support for Git in Windows, Yes, but you need to install Cygwin which was the first reason I give up from e-Editor, because it needs Cygwin for “advanced features”.

To be honest I’m not a command line fan, but since the changes on this Rails Web App community are so fast, you must be an agnostic IDE guy, or turn yourself into a command line fan.

Anyway, I give a Try on “Komodo Edit”, which appears to be a good option to Windows users.

After a full day of research about how to install an already downloaded Rails plugin through Netbeans, I give up; I just copied the plugin into the project vendor folder, restart the IDE and it appear to work. I will see soon.

After a few months using Netbeans, I start thinking I’m becoming productive on this Windows environment. But now, I’m not so sure…

I need to start testing some “command line” + “simple program editor” options on Windows environment.

Monday, October 6, 2008

How does this wide “Web World” works ?

The first and obvious step: the user connects to the internet. OK, everybody knows that, but this means, he is now able to connect his computer to others around the globe (or outside it I guess).

Each computer (like any other device), connected to the WWW has a unique address, this is called an IP address, like this: “172.16.254.1”.

Since each connected computer is identified, we just need they talk to each other.

To send and receive packages of information between them, they use a common suite of two protocols named the TCP/IP protocol for short.

There are two basic kind of computers connected to the internet: Clients like ourselves, and Servers, where the data and applications we need are stored.

Since the computers are connected they need a higher level protocol and a program on each one to establish a “conversation”.

This high level protocol is the HTTP, and the programs are: a Web browser on the client side and a Web server on the server side.

Most of the time we are sending and receiving files trough the internet, so, we will use the internet to send a file like this: “file:///C:/MySfuff/Pictures/Christmas/PIC002_20071225.jpg” to another computer, or ask for a file like this: “http://204.2.249.122/business/world/prexy.html?hp”, from another one.

The strings above, completely identifies a resource. A resource here is anything that can be identified, named, addressed or handled, in any kind of networked information system. These strings are called URI - Uniform Resource Identifier, and the popular URL - Uniform Resource Locator, is just a sub-set of it.

The language that let’s the client and the server really establish a “conversation” is the Hyper Text Markup Language (HTML for short), most of the time.

That is the language the web browsers understand, so, that is what the web servers delivers for their clients: HTML files on the first instance and all the associated files, like images, sounds, animations, videos, etc.

Wrapped around the HTML language, there are many operations that could be done. And any kind of these operations must be supplied by different kinds of servers. For instance, if you want to send or receive emails you will need an e-mail server, if you want to download or upload files, you may need a FTP server (short for File Transfer Protocol).

Now, we can establish a conversation, between the Client and the Server through the browser, here is an example:

A user types a URL into his browser and click ENTER, or simply clicks on a link addressed to it:

http://www.nypublished.com/pages/business/index.html

The browser will translate this URL into an HTTP request, like this:

GET //pages/business/index.html HTTP/1.1 Host: www.nypublished.com

The browser wraps this request into the TCP/IP protocol and sends it.

When the web server on www.nypublished.com, receives it, it will append the given path to the path of its root directory, “/nyp/www/”, by instance. The result is the local file system resource path:

/nyp/www/pages/business/index.html

At this moment there are a few alternatives to the web server, but the common action is trying to find the file locally and sends a response back to the client’s web browser.

It sounds a bit simpler to be true. OK it is a simplification here; it could be true on the early days of internet with just a few static pages, but now, with all that interactivity, no way. We need to add more elements to the equation.

And besides the browser evolved a lot all this years, the big difference is on the server side.

Let’s take a look on another example, accessing an interactive (application) page, like this:

http://www.campinghq.com/mastercamp/forums/1

As you can see, there is no file name at the end. What will be happening on this case?

The browser will translate this URL into an HTTP request, like this:

POST /mastercamp/forums.rb HTTP/1.0 From: newbie@webworld.com User-Agent: HTTPTool/1.0 Content-Type: application/x-www-form-urlencoded Content-Length: 32 home=forum=1

The browser wraps this request into the TCP/IP protocol and sends it through the internet (1).

Now we need to go deeply into the server side. On this case, there is no file with the content you need on the web server itself. That is a situation where the web server needs help from other servers.

This is what we call a dynamic page. In fact, there is not an HTML file on the web server that simply could be returned to you in response. The file containing your response will be created “on the fly” in this case.

There is a three tier structure (not necessary three different machines), that will be used to give you the answer. There is a Web Server, which receives the request, depicts it, and tries to find an answer to it; this is the first tier (2).

In case the Web Server couldn’t find an answer to the request, it sends the request to an Application Server, the second tier, which in turn tries to find an application and functionality to send the request (3).

In this example, “mastercamp/forums”are respectively the application and functionality to be used.

There is an application called “mastercamp”, and there is a “forums” functionality on it that will be called.

The last parameter, “1”, will be used to pick information (data) from the Database Server, the third tier (4).

So, the “forums” functionality gatherers information from the database (5) and prepares it, the “mastercamp” application, transforms it into an HTML file, and send it back to the Web Server (6).

The Web Server then generates an HTTP response, like this:

HTTP/1.1 200 OK Server: Apache/2.2.9 Date: Wed, 14 Jul 2007 09:48:04 GMT Content-type: text/html X-Powered-By: Ruby/1.8.6 Set-Cookie: rbrd2mysql_data=a%3A0%3A%7B%7D; expires=Thu, 14-Jul-2007 09:48:04 GMT; path=/ Set-Cookie: rbrd2mysql_sid=b389d63f8226cc6c8ad349b3aadf41f3; path=/ Refresh: 0; URL=http://SERVER/rbrd2foobar Content-Length: 0 HTTP/1.0 200 OK Content-Length: 7

Wrap this response into the TCP/IP protocol and send it back to the internet (7) to get it back to the client (8).

Here is “The Big Picture”:




That is a short description on “How the Internet works”.

I do not go deep in any details but all the basic points are here, with links to more detailed explanation.

Saturday, October 4, 2008

Rails, what happens to you ?


Hey man, four weeks focused on my regular work (problems, problems, problems) and a lot of new versions are available !

Rails is now 2.1.1, Ruby is now 1.8.7-P72 or 1.8.6-287. Not to mention gems and plugins.

So many changes, but let’s continue the journey…

By the way, some answers I can give to my team mates about being productive using Rails on Windows.

To be honest I’m not that kind of a “command line guy” I like to use an IDE, but I need to admit if you choose the right tools and like that “command line way”, YOU CAN BE AS PRODUCTIVE ON WINDOWS AS ON OS/X.

I will tell you about it on a later article.

Back to web applications, now we have the whole history, you can access it from here.

Next step will be to understand how the internet really works.

If we pretend to create a web application, the first step, of course, is to know how all that stuff works.

On the last month I have unsuccessfully tried to find a real basic guide to developing Web application using Rails, but when I say “basic” I mean really basic.

A guide to someone that has NEVER ever, developed a Web application: could be a COBOL programmer for instance.

I’m still planning to publish Ruby related articles, but from now on I will start to publish a sequence of Web and Rails related articles, and will call it “WEB on Rails from A to Z” (you will see this on the subheadings).

So, on a future article I will explore the basics on publishing a static page on the Web, using the very raw Web and Ruby / Rails resources.

The reason ?

That is simple, I’m learning from the raw basics myself, I’m not a COBOL programmer anymore (nothing against it), but still dealing with VB client-server applications(nothing against it too), and was dropped into the Java / J2EE (Ooops) jungle last year.

My knowledge on Web applications was limited to a couple of HTML / Java script courses in the past, so, you can imagine the suffering.

And about that WEB thing take care of it !