McGivrer’s Home

McGivrer’s Home

Frédéric Delorme  //  Java/J2EE Expert
Technical Manager
Web Standard evangelizer

May 4 / 4:01pm

OS/web browser : the statistics on mcgivrer.fr !

Thanks to Google analytics, this is the statistics for the past year.

Interesting !
Filed under  //  browser   firefox   IE   os   statistics   web  

Comments (0)

May 4 / 3:48pm

Ubuntu 10.04: a social edition

Ubuntu 10.04 bring a lot of interesting features on social side, twitter, facebook, and so on. But...
The new Look of the gnome interface contains a strange choice about User interface:  The window buttons side !

Left side for window size and action management is, IMHO, a wrong choice.

Right side is what human kind is usefull with.

So to bring back old uses :

Start gconf-editor, and go to the apps/metacity/general configuration to edit the button_layout key, and set:


menu:maximize,minimize,close

and get your window with the right side ;)

Filed under  //  10.04   button   linux   metacity   ubuntu   window  

Comments (0)

Apr 26 / 6:00am

HTML5 full demo story

http://apirocks.com/html5/html5.html#slide1

nothing more, just read/see/contemplate :)

Flash would have only some months to survive, after the "go live" of HTML5 ...

Filed under  //  design   html5   interactivity   presentation   web  

Comments (0)

Apr 6 / 3:52pm

Simple design with simple color and simple tools !

Yes, working as Web developer prevent me to be a good web designer. And sometime, I need focus on state of my knowledge about simple web languages as HTML and CSS.

This is my "State Of the Art"  about web design.  A tentative of design ;)

Comments are welcome.

Note: please, notate that red part at bottom is only for debug purpose ;)

Filed under  //  css   demo   design   html   js   web  

Comments (0)

Mar 17 / 11:56am

Skype is a great communication tool !

Even if 8000 kms separate me and my home, I am able to communicate in video mode with my family !

Thanks Skype !

But where are the correspondent ? :)

Filed under  //  chat   communication   internet   tools  

Comments (0)

Mar 16 / 12:14pm

Hobo: Step 4 - adding a cover image

As we've now get a running web application to manage our library, I propose you to add an image field management to our Book model.
To manage this part, we are going to need 3 things:
  • an imaging tool like mini_magick or image_magick,
  • the paperclip plugin for rail
  • and the paper_clip_with_hobo to be used with Hobo framework.
1. The image tool
My choice go to imagemagick, but i know that this is working well with others tools like

2. Paperclip plugin
You will find very interesting infoirmation about this plugin usage at this page: http://jimneath.org/2008/04/17/paperclip-attaching-files-in-rails/
And you  will be able to download it from http://github.com/thoughtbot/paperclip

To install this small plugin, just go to your hobo application root path and run the following command:

script/plugin install git://github.com/thoughtbot/paperclip.git
Now you have downloaded it, you are ready to use it.

3. Get the paperclip_with_hobo
Just fololowing the same process, you have to download/install this rails plugin from git:

script/plugin install git:http://github.com/tablatom/paperclip_with_hobo.git


ok. let's apply some model modification to our Book modelisation.

Book.rb

we need to add some new field to our app/model/book.rb

class Book < ActiveRecord::Base

hobo_model # Don't put anything above this

fields do
title :string
author :string
year :integer
resume :text
note :integer
timestamps
end

has_attached_file :cover, :styles => {
:full=>"600x600>",
:medium => "300x300>",
:thumb => "100x100>",
:mini => "60x60>" },
:path => " :rails_root/public/media/books/covers/:id/:style.:extension",
:url => "media/books/covers/:id/;style.:extension"
...
end

Adding such "has_attached_file" field to our Book model add in reality 4 fields to our database model after running the rake db:migrate standard rails operation :

see db/migrate/20100221172242_add_attachements_cover_to_book.rb migration file

class AddAttachmentsCoverToBook < ActiveRecord::Migration
def self.up
add_column :books, :cover_file_name, :string
add_column :books, :cover_content_type, :string
add_column :books, :cover_file_size, :integer
add_column :books, :cover_updated_at, :datetime
end

def self.down
remove_column :books, :cover_file_name
remove_column :books, :cover_content_type
remove_column :books, :cover_file_size
remove_column :books, :cover_updated_at
end
end


Ok, now our model is updated, database too. we are ready to modify some dryml file to show this image.

Go to app/views/taglibs/application.dryml and add the following declaration:

At file beginning in existing "include" lines:

<include src="paperclip" plugin="paperclip_with_hobo"/>

And at end of file :

<extend tag="form" for="Book">
<old-form merge multipart>
<field-list fields="title, author, year, resume, note, cover, category" param/>
<div param="actions">
<submit label="#{ht 'books.actions.save', :default=>['Save']}" param/><or-cancel param="cancel"/>
</div>
</old-form>
</extend>

This is a view modifier for a Book, adding the cover field and removing the 4 database fields.

Then, modify the card dryml for Book model, in the same previous file (application.dryml) :

<extend tag="card" for="Book">
  <card>
    <h5><a /></h5>
    <p><view:title /></p>
    <p>
     
      <view:resume />
    </p>
    <p>
      <%= I18n.t :uploaded_label %><br />
      <view:created_at format="%B %d, %Y" /> by <you:user />.
    </p>
    <delete-button class="actions" />
   
  </card>
</extend>

Let's test our new cover field !
Filed under  //  development   hobo   image   rad   rails   tutorial   web  

Comments (0)

Mar 16 / 9:54am

Interesting browser comparison

Please, find bellow an interesting document find on the web (really don't remeber where), showing performence comparison between all browser.
Surprising !

Filed under  //  browser   comparison   rendering   standard   w3c   web  

Comments (0)

Mar 16 / 1:03am

Chennai 3rd stay

Yes, this is my third travel to Chennai.  And, basically, certainly the last one...


here is my Bangalore room hotel, yes it's a backpacking tent, but a deluxe one, with a marble bathroom :)

Anyway, starting with some flight difficulties, all things go right now, and i've spent a quiet night in a beautiful hotel in Bangalore (thanks to David and Hureen, some business colleagues who arrange the room booking for me).  Now I'm in Chennai in a European Standard hotel, with some comfort features like internet, swimming pool, continetanl breakfast, and so on ...

I'll try to stay connected during this 2 weeks to relate all my new indian's adventures.

So, yes, A brand new project to launch into the Pneumatics manufacturer space !  The first "First release" project to drive with Back Office, here, in Chennai, with thought constraints on time and delay ! Indian team is constitued of experimented people, but, I am sure the "First Release" Murphy's law will mishandle us a bit, or It won't be an offshored project !

Next step will be to meet the team to start first phase oif back office operations: technical designs !  it will become a great memory, I am sure !

Stay tuned !

Filed under  //  chennai   india   job   travel  

Comments (0)

Mar 7 / 4:42am

RedCar, it's not a red car !

RedCar is a brand new programmer's editor ruby oriented, and ruby developed.
And on of the main feature of this new text editor, it's to be JRuby compatible natively !  A good news for the multiplatform world.


to be tested to help dev team to improve this cool programmer's tool.

Is it possible to optimize such editor for Rails and Hobo ?

McG.
Filed under  //  code   editor   hobo   java   linux   multiplatform   rails   tools   windows  

Comments (0)

Feb 15 / 4:46pm

Hobo: step2 and 3, add categories and some relation

Ok, we have just created the first step of our library.
Now we have hundreds of books, maybe we can dispatch all these books in some categories ?
Ok, l'est add categories to our web app "My Library"
 script/generate hobo_model_resource category name:string sorder:integer
And we hjev to update the databse with our new model:
 script/generate hobo_migration
don't forget the 'm' option to run the migration right now !
ok, just for fun, run the application with a 
 script/server
browse to http://localhost:3000/ and go to the "Categories" tab..  
1.View the Category tab
2.and add a new "Novel" category
yes ok, nothing really new here.  It's working just like Books.
Let's dye into the code:
We are going to add the link between Book and Category, knwoing that a category can have many book, and one book belong to one category.
Open the file book.rb and just after fields declaration, add the following "belongs_to": 
 class Book < ActiveRecord::Base

  hobo_model # Don't put anything above this

  fields do
    title  :string
    author :string
    year   :integer
    resume :text
    note   :integer
    timestamps
  end

  belongs_to :category
  ...
 end
Open now the category.rb and add the small "has_many" property:
 class Category < ActiveRecord::Base

  hobo_model # Don't put anything above this

  fields do
    name   :string
    sorder :integer
    timestamps
  end

  has_many :books
  ...
 end
we have to generate a small migration to add this field into the Book data model.
 script/generate hobo_migration
note: choose the 'm' option to apply modifications.
and start the server to test !
 script/server
let's browse the Books page
And choose one of the created book, you can see the new "Category" field at end of page.
Click the "edit book" link and you will be invited to change the value for category wich is currently set with the default "(No category)".
ok, back to your code editor and open the file category_hints.rb. and replace all the commented lines by the following single line. 
 class CategoryHints < Hobo::ViewHints

   children :books

 end
Telling that Category has Books has children will modify automatically the Category page, showing the number of book attached to a category.
1. What's new in the "Categories" page
2. Let's see the detail of a Category
3. And on the Book side, a new top/left link appear "<<Novel"
you can see that with  very small add to the generated code, you considerably inflect the default behaviour of the application and the links in the model.
Even if model link declaration and manipulation already exists in Rails, Hobo brings the corresponding mechanisms for the UI side.
Next, more to be discover in the dryml taglib and tags personalization.
Hobo man.
Note: please find attached bellow the project in each step state, from step 1 to step 3.

Click here to download:
MyLibrary-step-1.tar.gz (120 KB)

Click here to download:
MyLibrary-step-2-categories.tar.gz (122 KB)

Click here to download:
MyLibrary-step-3-hints.tar.gz (128 KB)

Filed under  //  hints   hobo   rad   rails   relation   tutorial   web  

Comments (0)