RubyOnRails: Create a Controller and Views for it using a single command

On February 6, 2011, in Rails, Ruby, by Dipin Krishna

Lets create a controller named ‘home‘ with  views ‘index‘, ‘view2′ view3′. Fortunately, you can do that in a single command. Enter this command in your terminal: $ rails generate controller home index view2 view3 Rails will create several files for you, including app/views/home/index.html.erb. This is the template that will be used to display the results [...]

Tagged with:  
Tagged with:  

Perl: Send a chat message to your gmail buddy using Jabber

On December 23, 2010, in PERL, by Dipin Krishna

Net::Jabber provides a Perl user with access to the Jabber Instant Messaging protocol. Net::Jabber is a convenient tool to use for any perl script that would like to utilize the Jabber Instant Messaging protocol. While not a client in and of itself, it provides all of the necessary back-end functions to make a CGI client [...]

Tagged with:  

Perl: Send a message to a queue or topic using Stomp

On December 21, 2010, in PERL, by Dipin Krishna

 Net::Stomp module allows you to write a Stomp client. Stomp is the Streaming Text Orientated Messaging Protocol (or the Protocol Briefly Known as TTMP and Represented by the symbol :ttmp). It’s a simple and easy to implement protocol for working with Message Orientated Middleware from any language. Net::Stomp is useful for talking to Apache ActiveMQ, an [...]

Tagged with:  

Perl: Function to print a HASH completely

On December 15, 2010, in PERL, by Dipin Krishna

Below is a perl function that i wrote to print a HASH completely. What i mean by ‘completely’ is that it will expand all hashes and arrays found within the given HASH. sub print_hash { my ($hash,$str) = @_; while( my ($k, $v) = each %{$hash}) { print $str."$k => $v\n"; if( $v =~ /hash/i [...]

Tagged with:  

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...