McGivrer’s Home - Frenchy soul about life

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.

Loading mentions Retweet

Comments [0]

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)

Loading mentions Retweet
Filed under  //   hints   hobo   rails   relation   tutorial  

Comments [0]

My first Hobo application: My Library

Hello, just as I have published the previous article about Hobo, discovering the full featured rails over layer framework, I can't wait to publish my first test: creating a very simple Web Application to manage a library.

The first step is just to provide an interface to list all my books
So please, follow the guide !
Installation of the framework
Just run the following command in your prefered terminal (gnome-terminal for example in Ubuntu):
 sudo gem install rails
 sudo gem install hobo
 sudo gem install sqlite3-ruby -v=1.2.3
 sudo apt-get install sqlite3
First App
Now we are going to create our first Hobo application
 hobo MyLibrary
focus in the just create app directory
 cd MyLibrary
And now create our first datamodel :  a book modelisation
 script/generate hobo_model_resource book title:string author:string year:integer resume:text note:integer
now, we are going to create this model persistence into the default sqlite3  database
 script/generate hobo_migration 
(choose the 'm' option)
Ok, done.  now run the rails server (WebBrick):
 script/server
Look at the title of the application :"My Library" !  Just because we call our project "MyLibrary" (without any space), Hobo kindly titled our welcome page with a beautiful "My Library" in a plain old good english. 
Identify yourself by creating the first user account which will act as administrator for this new application.
And now start playing with your books collection !
1. your first connection to "My Library"
2. The welcome page (also modifiable 
3. Let see our books collection
4. Go and create our first book in our collection
5. Fill all the fields, and "Create Book"
6. and it's done, the first book is ready to be parsed
Yes I am impressed to discover how the Hobo dev team has been very careful with all details.
The new Hobo player.

Loading mentions Retweet
Filed under  //   firstapp   framework   hobo   installation   rails  

Comments [0]

Hobo, the rails next layer !

One more time, seeking the web for some fast way to produce RAD WebApp, I have found on the hobocentral.net website, the fantastic Hobo framework.  This thing is an enhancement of the Rails scripts, with some beautiful hobo_model_resource or hobo_migration scripts !

The first one produce a full feature ModelObject with administration layer, just what you need to create, retrieve, delete, update, yes, I know, just like Rails do.  But here we have more than simple rails, we have user rights management, simple crazy dryml langague to perform some beautiful and tricky design, and yes, a beatiful default design for the script generated CRUD pages !

The second one is a layer over the Rails standard migration, but not only create some ruby script to perform database model modification, ut also propose you to execute these migration automatically for you !

So, if you want to create a very simple application in a minute, just try a "gem install hobo" on your linux box or Win box or Mac box. yes...  we are in open source softawre, so the basic thing for an well feated open source software is to provide cross platform things ;)

Oh. Just one more word: all database are supported, and if you want to boost your creativity to an industrial environment, you can try to have a look to JRuby and the "Java'ification" of your rails application, some first pieces to get it work:
In a next post I'll present my own experience with such a framework and provided tools.

Be happy, be a Hobo coder !

Loading mentions Retweet

Comments [0]

How to format length lines of a file ?

Simple answer :

perl -ple '$_.= " " x (500-length($_))' file1>file2

thanks to perl

But be carefull on line greater than 500 characters !

Loading mentions Retweet

Comments [0]

Acer Revo 3610, Ubuntu 9.10 and XBMC !

For my 37th anniversary (sic) my dear honey wife offers me a brand new ACER REVO 3610 with an Atom N330 with 2GB RAM and 320GB HD, running the full featured and beautifull new Windows 7 from our friends from Redmond Firm. Totaly excited, the Geek in me connect the "box" to its TV and VGA flat screen and start playing with the small "beast".

Playing HD video on a 40"Samsung LCD is incredible fluid and smooth ! Microsoft HD player work very weel. 
But but but, Windows 7 wifi Atheros drivers are not so powerfull and, due to low power of my Wifi Box, and due to long distance between it a the Revo, only (40% of power) prevent Wifi from well working :( and can't connect without a "low connectivity" status.
ok.
Where is my Ubuntu USB key ?
Starting my Live Ubuntu 9.10 on the Revo and...  WHAT ?  all is working out of the box !  Including the not working Wifi in the Win7 OS  (due to long distance between my internet box and the Revo) !!
So, only listening to my heart, I decided to install Linux Ubuntu 9.10 in dual boot with Win7 (we never know...).
And cliking on the "Install Ubuntu on my Disk" icon onto the Live Desktop, I started the Quick Install process.
Reboot
And ...
Freezing and blinking on the "old text mode" console, asking for user to logon.  but no keyboard and no mouse !
Digging the web with my laptop, i've found this very interresting post explaining how to install Ubuntu on the Revo with Boxee. And their is 2 most interresting things:
  • One is about HDMI Audio, about using the console version of the alsamixer to get it work by "un-muting" the "IEC958 1" output canal. Without this activation, my Revo was mute !
    The alsamixer program
  • The second was in comments of this post, discribing the exact symptoms of my problem with the blinking screen: Don't install from the Live desktop, but directly from the USB key initial menu, (second obtion in the displayed menu, just after selecting the prefered language).
So, I just have to restart the Ubuntu install process and it will work ?
All my hopes were based on these small comments, pray and re-install...
So after 2 tries, the good way consists in creating an USB key without persistance, and on menu of Usb live key, select direct "installation" (second item in the menu).

And it Rocks !!!

After first boot on the brand new install, install the last version of the NVIDIA driver and all work well, even the HD Video reading !

Just for your information, to install such driver, follow this short lines of commands:
sudo add-apt-repository ppa:nvidia-vdpau/ppa
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CEC06767
sudo apt-get update
sudo apt-get install nvidia-190-modaliases nvidia-glx-190 nvidia-settings-190
Then to install XBMC, just go and run this lines into a gnome-terminal:
sudo add-apt-repository ppa:team-xbmc
sudo apt-get update
sudo apt-get install xbmc

Good luck, and have fun

Image:Home_-_Videos2.jpg

 

Loading mentions Retweet

Comments [0]

SCRUM and Agility process for big project

Today, I'm going to attend to a workshop based on agility methodology apply to big project management.
Try to give feed back soon !

Loading mentions Retweet
Filed under  //   agile   agility   management   methodology   project   scrum  

Comments [0]

'Wish you A merry Christmas !

Just a small post to wish all the people a merry christmas and an happy new year for 2010..
Just have to wait for 2 days and we will switch to a new SF year !  If we follow the famous book "2010: odyssey two"  from author
Arthur C. Clarke we would have been on Moon and start traveling accross our Solar System, and installed a
Mars Base Camp...  Where are NASA, ESA and other occidental actors ?

Will Indian or Chinese space agencies reach first these great targets ?


Some credits for the photos:
1. 2010: odyssey two - first british edition 1982 found on wikipedia
2. Mars Explorer - ESA/DLR/FU Berlin (G. Neukum)
3. Mars Rover - a NASA artist's view

     
Click here to download:
Wish_you_A_merry_Christmas.zip (144 KB)

Loading mentions Retweet

Comments [0]

Iceberg Office

Working in a cold atmosphere is not so easy... cOLD Hands on the keyboard and mouse often input wrong words and left click n wrong place ;) Dear mister president, would you swith on the warm AC, please ?

IceBerg from wikipedia

Loading mentions Retweet
Filed under  //   hot   iceberg   office   switch on   warmer  

Comments [0]

Typography and the Web

Here is the most interresting presentation I've ever red on this hot subject: how to integrate types into your own web site or into your customer's website, without falling into the standard Verdana, MS Trebuchet, Tahoma, Serif and other fonts already installed, ready to use on each desktop computers ?

Parts of the answer are in the following sharepoint :

 

Beautiful Web Typography v5.3 Edge of the Web presentation
View more documents from Pascal Klein.

Loading mentions Retweet
Filed under  //   design   font-faces   fonts   types   web  

Comments [0]