First week in NYC

Okay, I,m already staying for one week in New York City. And I want to write a few sentences about my impressions. First of all, it is saver as I know it from the movies.  I run every morning and everybody says “Hi” or “How are you?”. I like that. I go every working day to school to improve my English. The teacher there is just amazing. We have so much fun with this guy. He was traveling a lot and he lived in Prag for 7 years. Btw the name of the school is New York Language Center and I can recommend it.

My favorite place is the subway. The reason is: It is cold and I can read a lot. It is not so warm here in New York but the humility is quite high compared to Zurich.

Last Tuesday I joint  Brooklyn Code. There was a great table with a lot of laptops on top of it and the coders sitting in front of it. It was a nice experience to see and here how there are working in Brooklyn – very kind
A evening later I listened to a presentation of Jason van Zyl in one of this big hotels here in New York. He introduced the new product of sonatype called “Insight”. A lot of people know Jason because he is the inventor of Apache Maven and btw he is a good speaker too.people and good talks.  I walked over the Brooklyn Bridge to come to the meeting.

On Wednesday evening I was at the Rooftop BBQ Summer Tech Mixer at one of the New York City’s best roof top bars, as they describe this place beside the Williamsburg Bridge. A lot of entrepreneurs, software engineers, foreigners ( I was not alone ) and  students eating, drinking and talking together. The funny

thing about this bar is: It’s on the second floor.

I visited the Time Square of course and walked along the 5, 6 and 7 Avenue. On last Saturday I was in the Central Park. There are so many things to look to. I was sitting on a bench for more then two hours only watching Beach-Volleyball. These guys are very good in this.

The Friday before I was in the MoMA (Museum of Modern Art). A very friendly woman invited me to come with her into the museum, so I saved the 25 Dollars.  Yesterday I visited the Met (Metropolian Museum of Art). They have very nice pictures from the 20. Century. I was very impressed. And I found one of my favorite pictures “Two Men Contemplating the Moon” from Caspar David Friedrich too. I didn’t know about the existence of three versions of this picture.

I was in the American Museum of Natural History too. (Uhhh… I did a lot in the last week.) I like the exhibition about the dinosaurs. There are nice exhibits in full size.

So, I have to finish now. It is more a list of what I did as a description of my impressions. But I’m writing this story  in English and I’m still slow with typing.

Bye for the moment!

running all tests of vert.x on a gentoo box

so after setting up the dev environment (btw. IDEA setup was much smoother) I wants to run all tests via

$./mk test

After getting errors like:

Exception in Ruby verticle: no such file to load -- rubygems

or

Exception in Ruby verticle: no such file to load -- json

I figured out that I have to install ruby and jruby properly on my Gentoo box. In short, run the following commands:

$sudo emerge -va dev-java/jruby dev-ruby/rubygems dev-lang/ruby
$sudo eselect ruby set ruby19
$sudo jruby -S gem install json

and add the following lines to your ~/.bashrc

...
export JRUBY_HOME=/usr/share/jruby
export RUBY_HOME=/usr/lib64/ruby/1.9.1
...

Don’t forget

$source ~/.bashrc

I used

$equery files jruby

and

$equery files ruby

to find the right directories.

Result:

$~/mk test

...

Information: Starting test: test_echo_binary

:test

BUILD SUCCESSFUL

Total time: 2 mins 19.355 secs

vert.x, the new gradle build and Eclipse 4.2

Developing vert.x with Eclipse 4.2:

  1. Fork the vert.x repo at github (help) and clone it to your local machine (let’s say to /tmp/vert.x )
  2. change directory cd /tmp/vert.x und run ./mk eclipse
  3. Install Gradle 1.0 / Java SDK 7 / Eclipse 4.2 (Eclipse Classic)
  4. Optional Install Grovvy Eclipse Plugin
  5. Start Eclipse and import  every project (I can’t find a solution to import all at once.)
    1. Import…
    2. Existing Projects into Workspace
    3. Select root directory
      1. /tmp/vert.x
    4. Finish
    5. Import…
    6. Existing Projects into Workspace
      1. /tmp/vert.x/vertx-boot
    7. Finish
  6. Seclect Project vert.x
    1. Right click
    2. Team -> Share Project
    3. Git
    4. Next, Finish
  7. Project -> Clean -> Clean all Projects
  8. Happy Hacking

I read about gradle support in SpringSource STS but I did not tried it.

vert.x, the new gradle build and Intellij IDEA

I just want to show how easy it is to start developing for vert.x with Intellij IDEA 11.1 and the brand new gradle based build system.

  1. Fork the vert.x repo at github (help) and clone it to your local machine (let’s say to /tmp/vert.x )
  2. Install Gradle 1.0 / Java SDK 7 / Intellij Idea 11.1
  3. Open Idea and import the project
    1. File -> New Project
    2. Import project from external model
    3. choose “Gradle”
    4. select
      1. Gradle Project: /tmp/vert.x/build.gradle
      2. Gradle home: /opt/gradle-1.0 (this depends on your gradle installation)
    5. Press next and choose
      1. Language Level: 7.0
      2. SDK: 1.7
    6. Press Finish
  4. Press Build -> Make Project
  5. Happy hacking.

2..27 – noch nicht angekommen

So, nun bin ich in der zweiten Woche meiner Auszeit. Einige Leute fragen schon, wie es läuft und wie es geht und was ich so mache…

Meine Antwort derzeit ist, dass ich noch nicht angekommen bin. Es fällt mir zum Beispiel schwer 2 Stunden am Stück an einem Buch zu lesen. Mich überkommt immer noch so eine Unruhe.

Aber ich habe schon ein paar Erfahrungen gemacht, die ich ohne diese Pause nicht gemacht hätte. Da ist dieses Projekt vert.x . Ich lese jeden Eintrag in der Google Group, jeden Twitter Pieps von @TimFox und jedes Ticket was aufgemacht wird und bekomme so sehr viel von dem Projekt mit. Auch andere kämpfen mit Git und nicht jeder Schalter  ist sofort klar. Warum ist die vorgeschlagen Verzeichnisstruktur von Maven so nett und warum sollte man nicht grössere Codeänderungen ankündigen und dann lange nicht machen. Alle warten darauf und sie kommen nicht…

Und mir geht der Code von dieser einen Klasse nicht aus dem Kopf. Da ist dieser Code in org.vertx.java.deploy.impl.cli.Starter :

    private Starter(String[] sargs) {
	String vertxVersion = String.format("vert.x %s", System.getProperty("vertx.version", "0.0.0-UNKNOWN!"));
    if (sargs.length < 1) {
      displaySyntax();
    } else {
      String command = sargs[0].toLowerCase();
      Args args = new Args(sargs);
      if ("version".equals(command)) {
        log.info(vertxVersion);
      } else {
        if (sargs.length < 2) {
          displaySyntax();
        } else {
          String operand = sargs[1];
          switch (command) {
            case "version":
              log.info(vertxVersion);
              break;
            case "run":
              runVerticle(false, operand, args);
              break;
            case "runmod":
              runVerticle(true, operand, args);
              break;
            case "install":
              installModule(operand, args);
              break;
            case "uninstall":
              uninstallModule(operand);
              break;
            default:
              displaySyntax();
          }
        }
      }
    }
  }
...

  private void runVerticle(boolean module, String main, Args args) {
    boolean clustered = args.map.get("-cluster") != null;
    if (clustered) {
      log.info("Starting clustering...");
      int clusterPort = args.getInt("-cluster-port");
      if (clusterPort == -1) {
        clusterPort = 25500;
      }
      String clusterHost = args.map.get("-cluster-host");
      if (clusterHost == null) {
        clusterHost = getDefaultAddress();
        if (clusterHost == null) {
          log.error("Unable to find a default network interface for clustering. Please specify one using -cluster-host");
          return;
        } else {
          log.info("No cluster-host specified so using address " + clusterHost);
        }
      }
      vertx = new DefaultVertx(clusterPort, clusterHost);
    }
    String repo = args.map.get("-repo");
    mgr = new VerticleManager(vertx, repo);

    boolean worker = args.map.get("-worker") != null;

    String cp = args.map.get("-cp");
    if (cp == null) {
      cp = ".";
    }

    // Convert to URL[]

    String[] parts;

    if (cp.contains(CP_SEPARATOR)) {
      parts = cp.split(CP_SEPARATOR);
    } else {
      parts = new String[] { cp };
    }
    int index = 0;
    final URL[] urls = new URL[parts.length];
    for (String part: parts) {
      try {
        URL url = new File(part).toURI().toURL();
        urls[index++] = url;
      } catch (MalformedURLException e) {
        throw new IllegalArgumentException("Invalid path " + part + " in cp " + cp) ;
      }
    }

    String sinstances = args.map.get("-instances");
    int instances;
    if (sinstances != null) {
      try {
        instances = Integer.parseInt(sinstances);

        if (instances != -1 && instances < 1) {
          log.error("Invalid number of instances");
          displaySyntax();
          return;
        }
      } catch (NumberFormatException e) {
        displaySyntax();
        return;
      }
    } else {
      instances = 1;
    }

    String configFile = args.map.get("-conf");
    JsonObject conf;

    if (configFile != null) {
      try {
        String sconf = new Scanner(new File(configFile)).useDelimiter("\A").next();
        try {
          conf = new JsonObject(sconf);
        } catch (DecodeException e) {
          log.error("Configuration file does not contain a valid JSON object");
          return;
        }
      } catch (FileNotFoundException e) {
        log.error("Config file " + configFile + " does not exist");
        return;
      }
    } else {
      conf = null;
    }

    Handler doneHandler = new Handler() {
      public void handle(String id) {
        if (id == null) {
          // Failed to deploy
          mgr.unblock();
        }
      }
    };
    if (module) {
      mgr.deployMod(main, conf, instances, null, doneHandler);
    } else {
      mgr.deploy(worker, main, conf, urls, instances, null, doneHandler);
    }

    addShutdownHook();
    mgr.block();
  }

Ich habe in der letzen Woche so viel über diesen Zeilen nachgedacht. Meine erste Reaktion war: “Das muss umgebaut werden.” Der Boolean “module” ist nicht gut: lieber zwei Methoden runVertical und runModule – ja und dann muss das Auslesen von den Konfigurationsparametern an anderer Stelle gemacht werden… und überhaupt lässt sich das Ding derzeit mit ”

vertx version version version version

aufrufen. Kein Fehler – komisch. Ich werde das umschreiben … macht das Sinn? Dies sind keine funktionalen Erweiterungen – und bekomme ich es so hin, dass es verständlicher sein wird? Unsicherheit!

 

half year off

So, mein Sabbatical startet heute. Während eines halben Jahres werde ich mich Weiterbilden und mit Sachen beschäftigen, für die ich im täglichen Geschäft nicht genug Zeit hatte. Mein Arbeitgeber Inventage war so lieb und hat mir ein halbes Jahr unbezahlten Urlaub gegeben.

Eine Pause wollte ich schon so lange mal machen. Bisher war es allerdings immer ein Reden darüber. Letzten Februar haben meine Frau und ich, bei unserer Fahrt in den Winterurlaub, wieder einmal darüber geredet und festgestellt, dass es eigentlich jetzt eine gute Zeit für uns wäre. Also, dann machen wir es. Im Prinzip soll alles wie bisher funktionieren. Die Zeit die ich bisher im Büro war, beschäftige ich mich nun mit anderen Sachen. Meine Aufgaben in der Familie bleiben die gleichen.

Was habe ich alles vor:

  • Viel lesen. Bei mir liegen so viele Bücher rum, die ich endlich mal in die Hand nehmen möchte. Habe gestern mit “The Annotated Turing” von Charles Petzold angefangen
  • 3 Wochen New York
    • Englisch lernen/verbessern
    • Stadt erleben und anschauen, ich war noch nie an der Ostküste und bin sehr gespannt
  • Software bauen, insbesondere bei interessanten Open Source Projekten helfen,
    • werde mir auf jeden Fall vert.x anschauen.
  • mich mit Single Page Html Seiten/Applikationen beschäftigen, dazu gehört auch das ich in Coffeescript, Knockout, jQuery usw eintauchen möchte
  • mit Leuten treffen
  • und wenn noch Zeit ist

Zumindest habe ich mir dies alles auf die Liste gesetzt. Was passieren wird, werde ich sehen… und protokollieren, werde ich es hier auf dieser Seite.

So, let’s have fun. vert.x is compiling…