< >Blog< >Software< >Profile


Narkisr.com

<< posts from 2009rss

Automation, automation, automation! [0..2]{automation}!

20/08/2010

There are always tasks that look too small to worry about, copying a file pasting that line, the comforting sound of repetition.
Uh? as devs we are better than that, we can program complex logic in commercial settings there is no reason not to apply our knowledge to every day tasks, let the machines do what they do best, repeat!

Dive in ..


Fasten your seatbelt

03/07/2010

Using your IDE effeciently is an integral part of being a profeficent developer, Intellij offers a multitude of options to turn your coding experience into a fast mouseless one.
While most developers memorize the key bindings they tend to less explore other options of cutting key strokes away, in this post ill cover couple of those, while the examples ill be showing are in Java land the ideas should be useful in other languages as well.

Dive in ..


APT Bandwidth Diet

17/04/2010

In this post ill cover how to sync your Ubuntu installation without sacrificing a large amount of bandwidth, its commons to have a number of machines with the same packages installed the question is how we sync them all up (especially clean installs) without using up bandwidth.
One could setup a proxy if the machines share the same local network however for distributed scenario's (multiple networks) this won't do.

Dive in ..


Update Couchdb via FUSE

10/04/2010

FUSE is one of my favorite projects it really makes FS development accessible, it can abstract almost any resource as a file system making it first class citizen in the UNIX realm,
an option that I was thinking about is to represent a Couchdb database as a folder. A possible use case might be a Dropbox/Ubuntu-one like clone (taking an advantage on Couchdb excellent replication) another one might be "greping" documents, the entire UNIX set will be able to process them.

Dive in ..


Artifactory meets VPS

05/04/2010

If your using Maven/Gradle/Lein/Buildr to build your projects than you must have stumbled upon one common issue which is where to host your artifacts,
syncing your local repository between machines is impossible without a proxy, a nice solution is to host it on a VPS.
I didn't find a single clear source of information on how to do so in a safe manner so ill try to cover the main points in this post.


Dive in ..


The world as a sequence

03/04/2010

Hey there! welcome to my new blog, after long time of blogsphere absence iv returned with a new self hosted blog that iv developed, this little project gave me a couple of insights that id like to share.

One of the main abstractions that Clojure uses is that of a Sequence, a seq is an interface (a java one) that represents a logical immutable persistent list, any data structure that expose this interface enables a vast number of core functions to our disposal.
Nothing up to this point should sound out of the ordinary except that the real fun begins when we define our own sequences!

Lets take for example the entries of a Jar file, by using repeatedly on the archive input stream we get a seqence of entries to work with, this turns the stream into a first class Clojure citizen that we can doseq on, in this case to extract the entries in the unjar function:
(defn- jar-stream-seq [stream]
  (take-while #(not= nil %) (repeatedly #(.getNextEntry stream))))

; extract-entry emitted for brevity
(defn unjar [src dest]
  (with-open [jar-stream (JarArchiveInputStream. (file-in-stream src))]
    (let [dir (file dest)]
      (doseq [entry (jar-stream-seq jar-stream)] (extract-entry entry dir jar-stream)))))

Another example is CouchDb to Clojure state syncronization, most applications that interacts with CouchDb (or any other persistent storage) hold some state that need to be updated in order to reflect lastest changes.

Dive in ..


Cool Groovy techniques

09/01/2010

Groovy is a versatile & very powerful language to code with, as a Java super set it enables a Java programmer to write its code with all the known Java idioms & progress into Groovy land in small steps, in this post ill present two techniques that I find to be very powerful.

Dive in ..