Narkisr - blog

Narkisr.com where code writes itself.


20
Aug 10

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

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!

[...]

03
Jul 10

Fasten your seatbelt

Using your IDE effeciently is an integral part of being a proficient 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.

[...]

17
Apr 10

APT Bandwidth Diet

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.

[...]

10
Apr 10

Update Couchdb via FUSE

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.

[...]

05
Apr 10

Artifactory meets VPS

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.


[...]

03
Apr 10

The world as a sequence

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.

[...]

09
Jan 10

Cool Groovy techniques

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.
[...]

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.