All about EDEN's Open Source adventures!

Powered by Ruby on Rails

The Bullet Search!

by: admin | Posted 26 days

After months of work, Eden Search is ready to roll.

Eden Search is a website where can search on many different search engines at once, the greatest part is that it is fully ajax, also fully navigable and can work even when JavaScript is not supported (fully unobstructed).

This is the prove of a new client side architecture called BALAH, in Eden Search is the first website to fully use the BALAH Architecture, Bookmarkable Ajax Links And HTTP, That make it as unobstructed and fast as a BULLET!

1 Comments

AI Jonh Le

by: admin | Posted about 1 month

I started to build an smart Web PET with javascript and jQuery. Je has Artificial Inteligence in some ohn Le is an beatle that will walk on any web page and run away from the mouse, as son as he is ready i will put it here to give some live to this almost dead blog, you can check it out in http://3den.org/ai

3 Comments

I know what I know because everybody knows...

by: admin | Posted 3 months

I was thinking, about ubuntu filosofy when came this frase in my head... I know what I know because every body knows... doesnt in some unscotious level we all know about everythink? are our minds connectet just like our computers?

1 Comments

Multimedia sites, Wakaup!

by: admin | Posted 4 months

After a long time of sleep, JMultimedia project finally wake up. JMultimedia is a Suite of extensions Joomla! that can let you easily create dinamic galeries of videos, photos, games and aplets.
I've fixed all know bugs and added SEF support to this new version, as is getting fashion to crete strange names for software releases, JMultimedia 1.0 code name is Wakaup, you can see more here on Extensions Directory or check the Oficial Site

Now lets talk about code! the implementantions of a router in joomla is not a trivial task, there is no pattern to folow so ive tryed to create a simple one for simple components:


/*
 * function that convert the query to a 
 * SEFriendly URL
 */
function JMultimediaBuildRoute( &$query )
{
	$segments = array();

	// Page View
	if(isset($query['view']))
	{
		$segments[] = $query['view'];
	    unset( $query['view'] );
		
		// Task
		if(isset($query['layout'])){   
	   		$segments[] = $query['layout'];
			unset($query['layout']);
		}else{
			$segments[] = 'default';
		}			
		
	} // Controler
	elseif(isset($query['controller'])){   		
		$segments[] = $query['controller'];
		unset($query['controller']);
		
		// Task
		if(isset($query['task'])){   
	   		$segments[] = $query['task'];
			unset($query['task']);
		}else{
			$segments[] = 'default';
		}
	}
	
	// Controller
	
	// Item ID
	if(isset($query['id']))
	{	
		$id = $query['id'];			
	    $segments[] = $id;
		unset( $query['id'] );
		// Alias
		$db =& JFactory::getDBO();
		$db->setQuery('SELECT alias FROM #__jmultimedia WHERE id='.(int)$id);// Alias from your table
		$alias = $db->loadResult();
		if(!empty($alias)) $segments[] = $alias;
	}

	// Otheer
	$access_denied = array('option', 'limit', 'limitstart', 'start', 'Itemid');
	foreach($query as $k => $val){
		if(!in_array($k, $access_denied)){
			$segments[] = $k.','.$val;
	   		unset( $query[$k] );
		}
	}
	return $segments;
}

/*
 * fuction that converts the routes 
 * back to a query array 
 */
function JMultimediaParseRoute( $segments )
{
	$vars = array();
	
	// Every other thinks
	foreach($segments as $k => $value ){
		$option = explode(',', $value);		
		if(count($option)==2){ 
			$vars[ $option[0] ] = $option[1]; 
			unset($segments[$k]);
		} 			
	}	
	
	// Controller + View
	if(isset($segments[0]) ){
		$vars['view'] = $segments[0];
		$vars['controller'] = $segments[0];
		unset($segments[0]);
	}
	
	// Layout + Task
	if(isset($segments[1])){
		$vars['layout'] = $segments[1];
		$vars['task'] = $segments[1]; 
		unset($segments[1]);	
	}
	
	// ID + ALIAS
	if(isset($segments[2]) && is_numeric($segments[2])){
   		$vars['id'] = $segments[2];
	   	unset($segments[2]);
		unset($segments[3]);
	 }

	return $vars;
}

This code is as simple as can be and you can use it as base to build you own router, in many cases all a developer need to is to change the name of the funcion to point their own component, whould be much helpfull if joomla gived us some generic router like this in the CORE...

361 Comments

Hello World!!!!!!!!!!!!!!!

by: admin | Posted 4 months

After a hole carnival of codes Ive finaly put this project on line, well and so what? now i shall give a feedback about what is like to develop with rails and a quick comparation beten ruby and php,

As a friend once sad "I dont know i like PHP or if ive just get used to it", Ruby is really beautfull to read and code, while php is not always so clean, For a php programer is confusing to se functions without "(" ")" and symbols like :some_thing, there is large diferences in the syntax but both are dinamicaly typed, and flexible

Simple and fast web aplicatons php has alot of CMS, hte one i like most is joomla! with joomla you can do a site just like this in one day and also with mamy more features, without writing a line of code, While the Ruby was none CMS that powerfull.
In the other hand php also have a lot o frameworks also some MVC ones, but from my point of view none compares with Rails, dude rails just rock! it is not perfect yet, but rocks!

the command line stuff sounds very retro, but Rails just made it more productive than many grafical IDEs around for example if to baical CRUD operations all you need to do is:
script/scaffold content body:string title:string
this line of code just generate the data base table, with the respective columns, a model for that can manipulate all data in that table a controller and all basic layouts to CRUD operations, of course the code is not 100% ready but all hand work is done.

I didnt need to write a single line of SQL and yet this blog is fuly database oriented, well i like SQL, but is write migrations is not that bad.

The worst part of the project was to host, while in php we have alot of options and free-hosts, Ruby is a little harder to host, I this year ive joined HostGator one of worlds largest host companies, and they host Rails, but to publish this site ive got many problems every tech gived me the link to the same tutorial in their forum and the tutorial didnt work! So I had to try every impossible way, now if you are reading this means i did fine, as some one sad "no pain no gain!"!

In performance PHP is far superior than ruby, and any think else, man php is a bullet! The rails way is very cool, I realy liked the DRY philosofy and shall use it even in PHP now

About

by: admin | Posted 4 months

I'm Marcelo Eden Siquera, an Open Source entusiast and this blog is all about open source and Me!
English is not my native language so please forgiveme if i make some (many) speling or typng errors

I rater code then chat, but i'll try to keep this blog as updated as possible...

This is my first Rails experiment, here i try to do all things from the scrash, which is a cool way to learn Rail and improve my super coding skills!

This one of my favorite projects, bellow there are some my other works

331 Comments

1st Post

by: admin | Posted 4 months

I'm a Brazilian coder named Marcelo Eden. Ive been working with PHP for more than 5 years, it is almost my native language, i now more PHP then Portuguese... I'm also familiar with other web technologies as html Javascript, CSS... etc.

Now, Im beginning a to learn the rails way and this blog is my first experiment.

1 Comments

Welcome

by: random | Posted 5 months

I, have just deleted a post that i spend an hour to add, This is my first Rails project here i shall use core rails only , with less plugins as possible

2 Comments