amazing development » google http://amazing-development.com ruby, java and the rest Fri, 29 Nov 2013 18:57:08 +0000 en-US hourly 1 http://wordpress.org/?v=3.4.2 Customize Chrome Omnibar http://amazing-development.com/archives/2010/05/20/customize-chrome-omnibar/ http://amazing-development.com/archives/2010/05/20/customize-chrome-omnibar/#comments Thu, 20 May 2010 06:31:13 +0000 Frank Spychalski http://amazing-development.com/?p=453 I love Chrome! But one thing drove me crazy: we have numerous internal web-apps running on different hosts. From Firefox was easy to get to these tools by just typing the toolname (not the FQDN) in the url bar. Chrome knows it better and assumes that I want to search for toolname. A moment later it asked me if I meant toolname/ and remebers this choice (at least it annoys me only once per tool).

Yesterday I I got an idea and tryed a snippet of javascript as a search engine and was happy to see that it worked as intended. A few minutes of javascript hacking later the omnibar behaved the way I like it:

  • multiple words are a search query
  • single words are URLs, even without the trailing slash, always!
  • fix broken http at the start of an URL (happens to me sometimes when I cut’n'paste)

This is the current version of my default search engine, feel free to criticize, I’m a JS noob:
javascript:query="%s"; if (query.search(/\\s/) != -1) { window.location="http://www.google.com/search?q=" + query; } else { query = query.replace(/^h?t?t?p?:\/\//, ""); window.location="http://"+query; }

Enjoy and let me know if you have other ideas on how to improve this!

]]>
http://amazing-development.com/archives/2010/05/20/customize-chrome-omnibar/feed/ 2
Buzz… http://amazing-development.com/archives/2010/02/10/buzz/ http://amazing-development.com/archives/2010/02/10/buzz/#comments Wed, 10 Feb 2010 14:35:16 +0000 Frank Spychalski http://amazing-development.com/?p=439 This is mainly a test to see how adding this blog to my Buzz account works. Additionally I want to say how thrilled I am to finally buzz with people outside work ;-)

]]>
http://amazing-development.com/archives/2010/02/10/buzz/feed/ 0
JRuby on appengine with Ubuntu http://amazing-development.com/archives/2010/01/06/jruby-on-appengine-with-ubuntu/ http://amazing-development.com/archives/2010/01/06/jruby-on-appengine-with-ubuntu/#comments Wed, 06 Jan 2010 11:09:20 +0000 Frank Spychalski http://amazing-development.com/?p=426 Overall the instructions on code.google.com are really good, so this is just a dump to remind me of the Ubuntu specific stuff I did on a pristine Ubuntu installation…


sudo apt-get install sun-java6-jdk
sudo apt-get install ruby-full rubygems

This installs only rubygems 1.3.1 but appengine needs 1.3.5.

ERROR: Error installing google-appengine:
bundler requires RubyGems version >= 1.3.5


sudo gem install rubygems-update
sudo /var/lib/gems/1.8/bin/update_rubygems
sudo gem install google-appengine

Et voilà! Ten minutes later I have a running hello world in the cloud ;-)

]]>
http://amazing-development.com/archives/2010/01/06/jruby-on-appengine-with-ubuntu/feed/ 0
Android scripting environment supports JRuby http://amazing-development.com/archives/2009/08/04/android-scripting-environment-supports-jruby/ http://amazing-development.com/archives/2009/08/04/android-scripting-environment-supports-jruby/#comments Tue, 04 Aug 2009 06:21:19 +0000 Frank Spychalski http://amazing-development.com/?p=396 Quite some time has passed since the last time I wrote something on this blog, mostly because I did little non-work related worth mentioning.

But last week I helped Damon to finally support JRuby on his Android Scripting Environment (ASE).

  • Downloaded JRuby sources (jruby-1.2.0RC1) from http://www.jruby.org/download.
  • Patched the build.xml to not include doc/index.html from dynalang.jar otherwise dx will complain about an HTML page in the ruby-complete.jar.

    $ diff -r jruby-1.2.0RC1 jruby-1.2.0RC1.patched/
    Only in jruby-1.2.0RC1.patched/: build
    diff -r jruby-1.2.0RC1/build.xml jruby-1.2.0RC1.patched/build.xml
    42c42
    <
    ---
    >
    238c238,240
    <         <zipfileset src="${build.lib.dir}/dynalang-0.3.jar"/>
    ---
    >         <zipfileset src="${build.lib.dir}/dynalang-0.3.jar">
    >           <exclude name="**/doc/index.html"/>
    >         </zipfileset>
    268c270,272
    <         <zipfileset src="${build.lib.dir}/dynalang-0.3.jar"/>
    ---
    >         <zipfileset src="${build.lib.dir}/dynalang-0.3.jar">
    >           <exclude name="**/doc/index.html"/>
    >         </zipfileset>
    387c391,393
    <         <zipfileset src="${build.lib.dir}/dynalang-0.3.jar"/>
    ---
    >         <zipfileset src="${build.lib.dir}/dynalang-0.3.jar">
    >           <exclude name="**/doc/index.html"/>
    >         </zipfileset>
  • Downloaded the JSON sources from http://rubyforge.org/frs/?group_id=953 and put them in lib/ruby/1.8/json/
  • Copied android.rb to lib/ruby/1.8/.
  • Built jar-complete (ant jar-complete) and added jruby-complete.jar to eclipse project.
  • Connected the bits and pieces in com.google.ase.interpreter.jruby

    But beware! The new ASE apk is HUGE (4.6M) and JRuby is fairly slow. But it works ;-)


]]>
http://amazing-development.com/archives/2009/08/04/android-scripting-environment-supports-jruby/feed/ 7
Code reviews work http://amazing-development.com/archives/2009/02/22/code-reviews-work/ http://amazing-development.com/archives/2009/02/22/code-reviews-work/#comments Sun, 22 Feb 2009 20:24:50 +0000 Frank Spychalski http://amazing-development.com/?p=354 Seems like nowadays I only write blog posts in response to other blog articles… But I hope this is better than not writing at all. Ted Neward asks if code reviews do actually work because evidence suggests, that the scientific review process does not.

Only 8% members of the Scientific Research Society agreed that “peer review works well as it is”. (Chubin and Hackett, 1990; p.192).

“A recent U.S. Supreme Court decision and an analysis of the peer review system substantiate complaints about this fundamental aspect of scientific research.” (Horrobin, 2001)

Horrobin concludes that peer review “is a non-validated charade whose processes generate results little better than does chance.” (Horrobin, 2001). This has been statistically proven and reported by an increasing number of journal editors.

But, “Peer Review is one of the sacred pillars of the scientific edifice” (Goodstein, 2000), it is a necessary condition in quality assurance for Scientific/Engineering publications, and “Peer Review is central to the organization of modern science…why not apply scientific [and engineering] methods to the peer review process” (Horrobin, 2001).

Chubin, D. R. and Hackett E. J., 1990, Peerless Science, Peer Review and U.S. Science Policy; New York, State University of New York Press.

Horrobin, D., 2001, “Something Rotten at the Core of Science?” Trends in Pharmacological Sciences, Vol. 22, No. 2, February 2001. Also at http://www.whale.to/vaccine/sci.html and http://post.queensu.ca/~forsdyke/peerrev4.htm (both pages were accessed on February 1, 2009)

Goodstein, D., 2000, “How Science Works”, U.S. Federal Judiciary Reference Manual on Evidence, pp. 66-72 (referenced in Hoorobin, 2000)

This sounds so true to me. I heard way more than one story from Ph.D. students where the professors who were supposed to review papers just forwarded this work to their slaves.

But the fact that academic peer reviews are possibly a failure should not be used to argue against the usefulness of code reviews.

As a reviewee
My first project at Google was written in Python. I had never written a single line of Python before. The feedback I got from the first few reviews helped me learn a lot about Python in a very short time. I don’t know how many times I got these “Yes, this would work but if you replace these 6 lines with that short statement it would work, too” comments.

The same is true for my second project in C++. I have written some C++ before but this was for my Diploma thesis and the code was far from professional. Again the feedback I got from my reviewers helped me learn C++ a lot faster than I would have otherwise. This project was a lot bigger than the first one so I got a few “we already have this implemented here” comments.

As a reviewer
I usually don’t pay that much attention to our coding conventions but my pet peeve is looking out for missing comments. Every time I have to think about a single line of code, this is a pretty good signal that a comment is missing.

Reviewing other people’s code makes sure that I have at least a little knowledge about the areas of our project I do not work on directly.

Conclusion
Code reviews take time and need the proper tool support. But if it is done right, they are useful and help in a couple of different areas:

  • Learning a new language or about new piece of code.
  • Avoiding code duplication.
  • Making sure code is documented.
  • Distribute the knowledge.
]]>
http://amazing-development.com/archives/2009/02/22/code-reviews-work/feed/ 0
Looking for an intern http://amazing-development.com/archives/2008/04/25/looking-for-an-intern/ http://amazing-development.com/archives/2008/04/25/looking-for-an-intern/#comments Fri, 25 Apr 2008 13:43:22 +0000 Frank Spychalski http://amazing-development.com/?p=319 Asok the internI am looking for an intern (more details) for later this year. I have a number of interesting ideas for projects, most of them involve Ruby (more specific JRuby), Android and Eclipse. Your skill set should include at least Java and if possible Ruby and/or Eclipse API.

I’m looking for a commitment of at least three months (I would prefer six) and you should be within one or two years of receiving degree. If this sounds interesting please apply here and add a note that you would like to work with Frank Spychalski in Munich.

]]>
http://amazing-development.com/archives/2008/04/25/looking-for-an-intern/feed/ 0
Girl’s day in the office http://amazing-development.com/archives/2008/04/25/girls-day-in-the-office/ http://amazing-development.com/archives/2008/04/25/girls-day-in-the-office/#comments Fri, 25 Apr 2008 09:20:02 +0000 Frank Spychalski http://amazing-development.com/?p=318 Google had a special doodle for the Girl's day
Yesterday was Girl’s day and our office hosted a few girls from schools in and around Munich.

We used Kara to teach them a little bit about programming. You can create finite state machines to control a bug which runs around and tries to solve different problems. The girls did much better than I expected and finished all the exercises we thought would be enough for a whole day before lunch.

Kara screenshot

Kara for Ruby Logo

Without much preparation I decided to teach them a little about “real” programming and Ruby because there is a Ruby version of Kara which lets you write Ruby code to control the bug.

The experiment was very successful. The girls solved all the problems again, this time in Ruby and from their feedback they really enjoyed it.

A couple of years ago I taught a programming course for kids at the Volkshochschule in Karlsruhe. At that time I used Perl (it was a loooong time ago and I didn’t know Ruby then) but if I ever do this again I will use RubyKara.

]]>
http://amazing-development.com/archives/2008/04/25/girls-day-in-the-office/feed/ 0
JRuby on Android http://amazing-development.com/archives/2007/12/14/jruby-on-android/ http://amazing-development.com/archives/2007/12/14/jruby-on-android/#comments Fri, 14 Dec 2007 03:43:27 +0000 Frank Spychalski http://amazing-development.com/archives/2007/12/14/jruby-on-android/ a red robotToday I tried to run JRuby on Android. I failed. This article is more like a lab report so expect more boring details…

At first I tried the easiest way and added the JRuby jar to my android project. This would have been way to easy and as I expected it did not work.

Then I copied all the JRuby sources into my android project and eclipse gave me more than 100 errors. I had to remove org.jruby.javasupport.bsf.BSFExample and the whole org.jruby.demo package because of dependencies to awt and swing. Now only a single error message was left with a dependency on some class I can’t remember in java.beans. So I downloaded the Java sources and copied the class into my project which gave me a few new dependencies. So I copied the whole java.beans package into the project and removed all dependencies to awt and swing from the code. Now I needed to add only 2 more classed com.sun.beans.ObjectHandler and sun.awt.EventListenerAggregate for eclipse to stop complaining.

a red robotAt this point I encountered my first bug in Android: dx(the compiler for Dalvik) complained about the bsf.jar file which came with JRuby[1]. Fortunately I could work on with the 2.4.0 version of bsf.

At this point eclipse stopped complaining and dx was able to create Dalvik byte code for my test application and package the result.

But when I started the result on the emulator all I got was an exception… This is where I will stop for today and continue whenever I find some time. If someone out there has already successfully used JRuby on Android please leave me a comment on how you managed to do it.

[1] the bug was fixed less than 3h after I reported it. Kudos to the Dalvik team!

]]>
http://amazing-development.com/archives/2007/12/14/jruby-on-android/feed/ 5
First glance at Android http://amazing-development.com/archives/2007/12/07/first-glance-at-android/ http://amazing-development.com/archives/2007/12/07/first-glance-at-android/#comments Fri, 07 Dec 2007 19:07:28 +0000 Frank Spychalski http://amazing-development.com/archives/2007/12/07/first-glance-at-android/

As you can see I’m toying around with the android SDK. I guess this will be my first 20 percent project here at Google.

So far I’m impressed with the state of the SDK. There is a ton of documentation and up to now everything worked at once.

I have a couple of ideas I would like to try on android but unfortunately all of them involve bluetooth and there is no bluetooth support for the emulator (yet?).

If you have a great idea you would like to see as an app for your next cellphone, just leave me a comment or implement it on your own :-)

]]>
http://amazing-development.com/archives/2007/12/07/first-glance-at-android/feed/ 5