Setting Firefox location bar search engine

firefox

Recently I installed a freeware which came with ask.com plugin for firefox. This plugin after installing became default for lot of features in the browser which was really irritating me so had to remove the plugin. Even then any search I do by entering the keyword directly in the address bar (location bar) went through ask.com. If you are also facing similar problem here are the steps to set your favorite search engine. 1. Type in about:config in the location bar and press Enter 2. You … [Read more...]

Declaring java package and method signature in JRuby

jruby3

We can add the package declaration for the java classes generated by JRubyc by using java_package. Just add the following line before the JRuby class declaration java_package 'package name' And also make sure you have included the statement require 'java'. Now once you convert the code using jrubyc you will find that the package structure is automatically created. Similarly you can declare signatures for java methods using java_signature 'put method signature here' Now … [Read more...]

Converting JRuby to Java

jrubyc1

Now that we know how to write a basic JRuby code lets see how to convert the JRuby code in to Java code. JRuby comes with JRubyc a cross compiler that does the magic! Convert to Java code Convert JRuby Java class files Okay great! now you have Java source class for your JRuby class but what if you want to declare package and method signature for the generated java class? … [Read more...]

Introduction to JRuby

jruby1

JRuby JRuby is an implementation of Ruby which runs on top of Java Virtual Machine. JRuby code can be embedded in Java code and your JRuby code can interact with Java Objects and has access to every Java API. Why to use JRuby? Ruby being a scripting language is dynamic and much faster than Java. There are lot of things that can be easily accomplished in Ruby for example I found that parsing & scraping HTML is much easier and faster in Ruby using HPricot. As a Java programmer and you can … [Read more...]

Handling Home Key in Android

I recently came across "Todler lock" application which had lot of interesting features. One of the most intriguing feature was handling¬† of Home key event. 1.Create a Activity Alias We use Activity alias in order to programmatically enable or disable home screen launcher. An alias of an activity acts as an independent entity and intent filters that are not in the original activity can be added. Declare your activity and declare an alias for your activity with the following intent … [Read more...]