Narkisr - blog

Narkisr.com where code writes itself.


26
Dec 8

Pure Java entertainment

Iv really enjoyed this presentation about Java puzzlers.
The main moral of this presentation in my mind is that we should relay more on static tools in order to avoid such corner cases (there is no way to remember them all).[...]

18
Dec 8

VMware recovery methods

Iv been using VMware server and player for a time now and usually the hosted OS is XP, it happens to be that iv had the "luck" to witness the crash/corruption of such images and have devised two nifty tricks/methods of data recovery that i think worth sharing.
The first is for data recovery for an unbootable image, it matches cases in which you don't seem to be able to boot XP up but the image itself is readable & loaded by VMware (you see the black screen loading), the basic idea is to change the first boot device of the image to a Linux live cd (Ubuntu works perfectly), after booting up all you need to do is to mount the NTFS folder and copy it out (by scp, thumb drive, etc..).[...]

16
Dec 8

Java statefull callbacks

Any programmer comes to know callbacks at some point or another, in Java it looks something like this:
public interface Callback {
 void doCall();
}

public class CallbackCosumer {
 public void execute(final Callback callback){
  callback.doCall();
 }
}

// usage
public class Main {
 public static void main(String[] args) {
  final CallbackConsumer consumer = new CallbackConsumer();
  consumer.execute(new Callback() {
   public void doCall() {
    System.out.println("doing my callback thingy");
   }
  });
 }
}
[...]

21
Nov 8

Keeping your Zen with Linux

Creative mp3 players seemed to be a reasonable choice in the early IPod mania days, the single main problem that iv had for years with my trusty Nomad Zen Xtra is the fact that there was no Linux interoperability what so ever, the only (somewhat shaky) solution was to wait for Gnomad to mature.
Things has changed and the Zen access has worked with Gnomad, but two major issues remained:[...]

13
Nov 8

Objectifying conditionals

Im sure that any programmer has come across a code snippet which included a long list of nested conditionals, like follows:
public class NaiveImpl {
 public void process(final String option) {// mapping a type code to behaviour
  if (option.equals("first")) {
    // first option ..
  } else if (option.equals("second")) {
    // second option code ..
  }//.. a ton load of other conditionals
 }
}
[...]

24
Oct 8

The spreading Java and Ubunut love

These days it seems that the Java community is more and more Ubuntu friendly, the integration of Java and Linux (Ubuntu in particular) has been steadily improving making it easy to install (with a bit tinkering) Java 6 update 10, Netbeans and other Java goodies.
The Linux and Java open spirit are starting to merge, these are good times to be a Java developer on Linux systems.[...]

20
Oct 8

Oracle Cursor and SimpleJdbcCall

The title does sound innocent enough, calling a store procedure by using Spring SimpleJdbcCall should be simple and well documented, in usual circumstances this is the case however when Oracle Cursor is involved all hell brakes loose.
[...]

17
Oct 8

Gookup 0.0.3 is out

For those of you who don't know Gookup is a backup utility for three Google online main services (Gmail Blogger and Reader), the basic idea is taking back control on your data and back it up.
Its true that Google has some strong back up procedures however even they can't protect you 100%.[...]

28
Sep 8

Custom findbugs detectors and maven

Iv been writing a custom find bugs detector during the weekend, the bug that this detector has to detect is String.getBytes() usages, default system encoding is used when converting the char sequence into bytes which can make it work on one machine and fail on another (use String.getBytes(charsetName) instead).
The writing of the detector was not straight forward but im not going to focus on this issue (see this and this), instead id like to focus on how to create a findbugs plugin by using maven and running it with maven findbugs plugin. [...]

30
Aug 8

AMF serialization from Java to Flex and back

There are some scenarios in which you want to pass objects to and from a Flex application to a Java back end, if your using an Adobe framework (LCDS or BlazeDS) than you get this functionality out of the box however there are some cases that you wish to escape Adobe's grip and uses some third party technology.
Some solutions that may come to mind are JSon or XML, the problem with these solutions is that they may require a lot of bandwidth and even lots of computing power for complex objects graphs, AMF to the rescue. [...]

22
Aug 8

Google collection API

If your using Java collection API you should really see the following presentation about Google collection API, this is truly a gem for any Java programmer:
[...]

21
Aug 8

Code is data or so they say..

Iv been writing some custom checkstyle checks, the process of doing so is laborious and annoying, checkstyle uses an ANTLR visitor to allow the programmer to validate the tokens he wishes, this approach doesn't scale too well since it makes the programmer think of the "how" and not on "what", by that i mean that instead of being declarative its imperative.
After writing a couple of those it made me realize that there must be a better tool in which i could query the code instead of running along side the it, as a matter of a fact we are using such a tool every day, the IDE.[...]

16
Jul 8

snipplr CLI gem

Well being a CLI (Bash) kind of guy i really like to master my entire computer experience from within its black and white glory, one of the most frequent usages of CLI in my case is code manipulation.
Its only natural for me that ill be able to access my Snipplr stored snippets straight from the CLI and pipe them along, im not aware for such an existing tool therefor iv decided to create one by myself.[...]

03
Jul 8

Polish your ruby gems

Rubygems was just released (by just i mean a week), for those of you who are no Ruby evangelist it won't ring a bell (Ruby equivalent of maven) for those who do its highly recommended to update.
On my system (Ubuntu with rubygems 1.1) the gem update --system approach didn't work so iv taken the second path and ran gem install rubygems-update followed by update_rubygems.[...]

14
Jun 8

Effective Java Reloaded

I don't think that this book needs any introduction (Effective Java written by Josh Bloch), in this day and age in which languages go in and fade out on a daily rate, I feel that we have a still long road to go with Java (and i like it!), checkout this Effecive Java Reloaded presentation.[...]

08
Jun 8

I looooooovve Git!

After using Git for a while returning back to subversion is like a step back to stone age, im going to use it in all of my personal projects narkisr@github.
Note: An excellent git screencasts web site.[...]

02
Jun 8

JRuby and the pittfalls of bytes

JRuby is an amazing environment to code in, you can get clean concise and elegant Java based code by using Ruby powerful constructs, like for example:
JBIStream=java.io.BufferedInputStream

def read_body_as_stream(method)
 bis = JBIStream.new( method.responseBodyAsStream())
 res = ''
 bytes=Java::byte[8192].new # creating new Java byte primitive array
 count = bis.read( bytes )
 while( count != -1)
  res
  count = bis.read(bytes);
 end
 bis.close()
 res
end
[...]

28
May 8

Gookup second alpha is out!

In this version iv improved the Gmail backup process, its now fully resumable (download those Gig's of stored data in one shoot isn't always reasonable), faster and less resource hungry, progress info display.
On the duller side of things iv added a couple of specs and ironed out all sorts of bugs and errors.[...]

21
May 8

From ugly to usefull

Iv encountered a troubling error in Flex remote services, those of you who are familiar with Flex remote Java services know that results of remote services are serialized into Action script objects by the Flex framework so that the RIA client may consume them.
The problem is that due to some weird reason Java Float values are not converted properly into Numeric objects, for example a float value of 1.51 on the server side will be converted into 1.5099999904632568 Numeric value on the client side.[...]

28
Apr 8

Quick and dirty code search

There are some situations in which i need to query some code folder quick and dirty on my hard drive.
There are existing tools like desktop search applications (such as Google desktop) but it usually takes some time for them to index new folders and they are also quite resources hungry. [...]

24
Apr 8

Ububtu 8.04 is out!

I'm downloading it at the moment, I'm pretty excited over this (more than i was when Leopold came out) & can't wait to get my hands on some of the new features, with its simplicity elegance & power Ubuntu is in my humble opinion one of the best Os's out there, go ahead and give a go![...]

22
Apr 8

Making FunFx Flex 2 compatible

Moving to the latest and greatest software version in the enterprise takes time, Flex 3 came out not long ago and so did FunFx which a really cool tool for Flex integration testing.
FunFx got compiled with Flex 3 SDK which means that it won't run with Flex 2 projects out of the box, the developer does states that its possible to compile it from source with Flex 2 SDK however the procedure isn't trivial and took me some trial and error that i hope to save for the rest of you out there.[...]

23
Mar 8

Entering the Flex realm (with Spring & Cairnagorm)

In this post ill present Flex development combined with the Cairngorm micro architecture & Spring IOC, it should provide an easy stepping point to any Java developer who wishes to get acquainted with the above.
Ill follow along these action items:
  • Flex server side setup & Spring related configuration.
  • Client side setup including Caringorm, Caringen & FlexBuilder.
  • Simple demo application client side walk through.
  • Simple demo application server side walk through.
[...]

11
Mar 8

First gookup version released to the wild!

Iv uploaded the first version of gookup & im quite happy with it, there's still more work to be done (as always) how ever im happy to say that from inception to realization this is all mine :). [...]

05
Mar 8

Getting ahead with the program

Well it's been a week since my last post (time moves fast isn't it?) and had the need to write about some new idea's/solutions/stuff that iv found, so without further ado:
[...]

27
Feb 8

Yet another informational post (yaip)

After not writing for some time in this blog iv decided that i should post more regularly and share cool ideas/technologies that i encounter on daily/weekly bases, my agenda these days revolves around some of the following:
    [...]

    This website content by Ronen Narkis is licensed under a Creative Commons Attribution 2.5 Israel License, based on a work at narkisr.com, Permissions beyond the scope of this license may be available at narkisr.com.