Hi, this blog is no longer maintained, my new blog is here

Ruby On Rails and a Conning Israeli entrepreneur

|OFF| If languages were religions

Ruby would be Neo-Paganism - A mixture of different languages and ideas that was beaten together into something that might be identified as a language. Its adherents are growing fast, and although most people look at them suspiciously, they are mostly well-meaning people with no intention of harming anyone.

http://www.aegisub.net/2008/12/if-programming-languages-were-religions.html

Finally on Mephisto

It wasn't easy, but i made it.
finally the move is complete and 'Elad on Rails' is running safe and sound on my local machine (domain move is expected soon, after Christmas maybe).
The move was not as simple as i expected, Blogger does not offer an out-of-the-box solution for exporting your blog posts/comments, but as i mentioned in the move planning post, i found a way to do that using the Blogger draft engine. This was a hugh disappointment, the xml that was produced by the export option was terrible and made me realize that there is no simple way to get out of blogger (and Mephisto didn't help as well, no BloggerConverter implemented...rrrr).
So, i decided to do the easiest and simplest thing as possible, installed a local version of WordPress, imported Blogger (yes, WordPress has a blogger import tool) and from WordPress to Mephisto it went like a breeze (Using the Mephito WordPressConverted).
They only thing that went wrong is that i had to lose the Hebrew tags from blogger, apperantly Mephisto doesn't like Hebrew.
That's it.

Moo.rd: lightweight Mootools extestion

Mootools is awesome, but it still lacks some of the features that JQuery has when dealing with effects and some other not-so-important stuff.
Moo.rd is an excellent extension which implements some more features back to mootools. features such as some extra effects (finally, a mootools shake effect!), windows, sliders and more.
recommended, get it here.

Javascript Frameworks: i am changing my mind

well, originally i chose JQuery, which seems too-awesome-to-ignore at the time, but a recent project made me decide to try Mootools once again, well, it's amazing.
MochaUI is an excellent UI library in Mootools, the simplicity is overwhelming and on top of it all the dynamic pseudo selectors as lately mentioned in David Walsh's blog... amazing.


/* grab "checked" elements */
Selectors.Pseudo.checked = function() {
return ('input' == this.get('tag') && ('radio' == this.get('type') || 'checkbox' == this.get('type')) && this.checked);
};

/* grab "selected" option elements */
Selectors.Pseudo.selected = function() {
return ('option' == this.get('tag') && this.selected);
};

/* grab random elements */
/* credit: http://blog.kassens.net/custom-pseudo-selectors */
Selectors.Pseudo.random = function(probability, local) {
return Math.random() < (probability || .5).toFloat();
};

/* grab elements with no value */
Selectors.Pseudo.noValue = function() {
return '' === this.value;
}

/* grab elements with a specific empty attribute */
Selectors.Pseudo.emptyAttribute = function(att) {
return this.get(att) == '';
}


i think i might have some second thoughts about JQuery..

Observers, Associations and Callbacks

In my latest project, i need to notify a user via email about a certain kind of instance being created, so far normal.
This instance is created with a several of associated instances, let's say i am creating an article instance with linked categories using the virtual attribute technique (RailsCasts #16).
I created an observer for the article class to send an email with the article and categories after a successful creation of an article instance, therefore i immediately assumed that the correct callback is after_create. well, it's not.

when i used after_create, the email arrived with an empty list of categories, almost like they weren't saved, but a short trip to the console showed that the categories were created and that they are associated to the article as i wanted.

The problem resides in the order rails does this nested object creation, first the initial object is being created (the artical) and only than the association are created (after i used #build, watch the screen cast!), which causes the email to be triggered one step earlier than i wanted.

after finding this article i changed the observer's callback to after_save which apperantly is being triggers after the associations are saved as well.

i spent a lot of time on it, hope this helps.

Ajaxian: YQL - converting the web to JSON with mock SQL

Yahoo! now enables us to query a web page just like we would in sql. give it a try at YQL - converting the web to JSON with mock SQL

Google's Native Client plugin

Google has released a new experimental browser plugin that allows web applications to securely run native code on the underlying platform. The plugin, which is called Native Client, is distributed under the open source BSD license and is designed to work with all major platforms and browsers.

Native Client provides a sandboxed web-embeddable runtime environment for portable x86 binaries. It also provides a bridge to facilitate communication between JavaScript and Native Client executables. This makes it possible for complex web applications to seamlessly leverage native code for processor-intensive computations.

i don't know about you all, but it scares me :)
Source

Using ruby on rails with Oracle Legacy.

Great slide on SlideShare.
introduces the ruby-plsql gem, which makes it easier to preform database functions and stored procedures from ruby/rails applications (and supports bind variables).
i personally wrote a module of my own to handle this need (which supports bind variables as well).
Check out the slide and pay attention to the oracle_enhanced_adapter now available.
The slide is over here at SlideShare.

Moving to Mephisto (hopefully)

i have had it with this blogger account, you can say a lot of good things about this blog platform, but it is still a shared blog platform and it's not very professional to store you crown jewel on a blog platform which is written in Python :).
So i decided, i am moving to Mephisto. Mephisto is a Ruby on Rails blog platform and a self proclaimed "Best blog platform ever". well, i don't really know if that is true or not, but after checking it out locally i decided to use Mephisto for my permanent new blog.
The only problem i have right now, is how to transfer my Blogger posts/comments into my brand new Mephisto database. Mephisto is equipped with a "converstion" tools from Wordpress and Movable-type and as far as i know, nothing for blogger.
the blogger draft service (experimental blogger interface) enables you to download your entire post and comment history as XML so i might try to simply parse it into the DB (Or write a Converter).
Anyway, i'll be kinda busy doing it in the near future, so probably no posts in the near future.


The Web Ask eizesus.com

Subscribe

    follow me on Twitter

    Twiters Around

    About Me

    My photo
    I am a web developer for more than 9 years, managed, cried, coded, designed and made money in this industry. now trying to do it again.

    Labels