viernes, 22 de mayo de 2015

Clojure in Action - Book Review

I just finished reading this book a couple of minutes here's my small review...

The book is kinda big...with 434 pages...and it's the first book and my first approach to Clojure.

I have to say...I'm not a big fan of Java...I don't even actually like it...but's something else -:) With its Lisp like syntax and it's functional's a delightful programming language...

The book itself it's a great introduction to have us ready for something Clojure is still a young language...some of the examples don't work mainly because some keywords or libraries had become obsolete...gladly most of the examples work just out of the box...

There are also many examples that help to fully understand what Clojure is all about...

If you haven't heard about closures, recursion, higher-order functions or currying...the this book is for you...

While I'm planning to read more Clojure books, I can say that this book is the perfect way to get started...


Development Culture.

miércoles, 22 de abril de 2015

An Introduction to Programming in Go - Book Review

I finished this book a long time ago...but somehow...I never wrote a review for it...sorry about that -:P

This was the first book I read about Go...and I have to say...I totally love it -;)

It's very concise and to the point with only 165 pages...more than enough to get your feet wet and nurture your interest in learning Go -;)

In a fast and nicely explained way, this book guide through Arrays, Slices, Maps, Functions, Concurrency, Pointers, and the Core Packages...

A good programming book doesn't have to be huge...doesn't need to teach you about every single command or technique...a good programming book should give you the basics...the elements that you need to start grasping the language itself and slowly build up so you can gain confidence and the start to move forward on your own...

I totally recommend this book to anyone learning Go...and I wish every programming language had a book like would make beginners life much easier -;)


Development Culture.

The Way to Go - Book Review

I finished this book a long time ago...but somehow...I never wrote a review for it...sorry about that -:P

This book has 629 pages, so it's really big...

The book is really good and it's a really nice and comprehensive guide for anyone learning Go...

It's full...and I mean it...full of examples! -:D

And I might be getting picky here...but I would have appreciate more images -:)

The books of course goes along installing Go, explain it's syntax and touch interesting topics like Interfaces and Reflection, Error-Handling and Testing and hooking up with Google App Engine.

I would like to say more about it...but's been a while since I finished my last words are only...if you're new to Go...this is really good book to begin with...if you have some Go's up to you...


Development Culture.

miércoles, 1 de abril de 2015

LED is my new Hello World - Clojure Time

The more I learn Clojure...the more I like it...and I'm liking it so much that I couldn't help myself and start working on my beloved "LED_Numbers" application...

After making the Fibonnaci Generator app work...this one wasn't as hard as I expected...actually I think I'm slowly getting used to Clojure...which is always nice when learning a new language -;)

Here's the source code...

(def leds {"0" (list " _  " "| | " "|_| ") "1" (list "  " "| " "| ")
           "2" (list " _  " " _| " "|_  ") "3" (list "_  " "_| " "_| ")
           "4" (list "    " "|_| " "  | ") "5" (list " _  " "|_  " " _| ")
           "6" (list " _  " "|_  " "|_| ") "7" (list "_   " " |  " " |  ")
           "8" (list " _  " "|_| " "|_| ") "9" (list " _  " "|_| " " _| ")})

(defn toList [number]
 (map str(seq(str number))))

(defn get_led [x n num]
  (> (count x) 0)
   (concat (nth (get leds (first x)) n) (get_led (rest x) n num))
  (and (= (count x) 0) (< n 2))
   (concat "" "\n" (get_led (toList num) (+ 1 n) num))
  (and (= (count x) 0) (= n 2))
   (concat "" "\n")))

(defn showLED [num]
 (do (print (apply str (get_led (toList num) 0 num))))(symbol ""))

Wanna see it in action? Of course you want to -:)

Well...let's go back and keep learning -:D


Development Culture.

My first post on Clojure

My good friend and Programming Languages adviser Chris Whealy, send me tweet saying this...

I knew then that I needed to learn Clojure...after all...Chris was the one who get me into Erlang -;)

So...I started to read this book Clojure in Action so can expect a review later on...

I have experience with Functional Programming and specially with Lisp-like languages (Racket) so I guess my Clojure experience was going to be an easy's being fun but not easy as I thought...and not because Clojure's learning path is hard...but just because I keep thinking that it's pretty much like Racket when indeed its not so...

Clojure is a Lisp-like language...but being based on Java (on the JVM to be exact) it has some really "weird" things that take some time to digest and assimilate...but of course...that has never discourage me...I have learned Haskell after no challenge is too big enough for me -;) (Ok...maybe ASM...but I'm planning to learn Fasm one of this days...)

As always...I couldn't get myself happy by just reading the book...I needed to write some code for it...and what better than a Fibonacci generator...

(defn fib [num a b]
  (and (> a 0) (> num 1))
   (concat [(+ a b)] (fib (- num 1) (+ a b) a))
  (= a 0)
   (concat (conj (conj [a] b) (+ a b)) (fib (- num 1) (+ a b) b))))

(defn showFib [num]
  (fib num 0 1))

Here's the screenshot.. can see that I based my code on my previous Racket code...but the only similarities that remain are the parenthesis...being a Lisp-like can't expect no to use parenthesis, right? -:P


Development Culture.

jueves, 19 de marzo de 2015

Real World OCaml - Book Review

I finally finished reading the Real World OCaml book...and I really enjoyed it -:)

This book, just like all the "Real World" series gives you a deep introduction into the language and allow you to start coding pretty fast...of course...if you have used any Functional programming language before...that really helps and OCaml has of course some aspects that makes it not so easy to learn...

The more you read this book, the more you're going to like's a really nice language -:)

The book covers the basics like Lists and Patterns, Records, Variants and Error-Handling.  But of course it goes beyond with Functors, Objects and Command-Line Parsing...not letting important concepts like JSON handling Concurrent Programming aside.'s a pretty complete reference to start out.

By the way...the book is 509 it's pretty long...but full of examples and demonstrations...

Here's a little code that I wrote to flat out lists -;)
open Core.Std

let rec flat list =
 match list with
  | [] -> ""
  | head :: tail -> head ^ (flat tail)

let () = 
 printf "%s" (flat ["1";"2";"3"])

Here's the result...

As you can see...OCaml is go this book and expand your knowledge -;)


Development Culture.

lunes, 2 de marzo de 2015

LED is my new Hello World - OCaml Time

Learning OCaml is not easy...I have to admit that...but I'm moving forward -;) So, here's my take on LED Numbers...
open Core.Std

let get_leds number =
let leds = [0, [" _  ";"| | ";"|_| "];
            1, ["  ";"| ";"| "];
            2, [" _  ";" _| ";"|_  "];
            3, ["_  ";"_| ";"_| "];
            4, ["    ";"|_| ";"  | "];
            5, [" _  ";"|_  ";" _| "];
            6, [" _  ";"|_  ";"|_| "];
            7, ["_   ";" |  ";" |  "];
            8, [" _  ";"|_| ";"|_| "];
            9, [" _  ";"|_| ";" _| "]] in
 for i = 0 to 2 do
  for j = 0 to String.length(number) - 1 do
   let line = List.Assoc.find_exn leds 
        (int_of_string(Char.to_string(number.[j]))) in
   printf "%s" (List.nth_exn line i)
  print_string "\n"
let () =
 print_string "Enter a number: "
 let num = read_line() in
 get_leds num

The funny thing is that at first I tried to translate my previous Julia and Go codes...but then I remembered that even when OCaml can be made into some sort of an imperative's actually Functional in its I said...Ok...I need to reuse my Haskell code...but somehow I start thinking about a new whole different way of doing it...and I think I came out with a more cleaner and well done version...which is something that only learning a new programming language can give you...a new way of thinking about old problems -;)

Here are the screenshots as always -:)


Development Culture.

martes, 24 de febrero de 2015

My first weekend with Amazon Echo

So...after a not so long wait...this Saturday, the Amazon Echo arrived home -:) After a weekend using are my thoughts...

Being an Amazon Prime Member, I got a discount on the Echo, so I get it for $100...which is a pretty good deal...

The Echo comes in a nice black box...which makes it more elegant...

The Echo itself is of course...Black too -;)

It comes with a charger and a remote control...that I haven't used yet as Echo comes with enough microphones to hear you out even a long distances...

Setting it up was easy no time I had it on my network and the companion app was linked to it...

Of course, I tried the expected, like..."Alexa, what's the weather" or "Alexa, play some music"...I even when farther beyond as asking "Alexa, make me a sandwich"...which Alexa (the waking up word for Echo) kindly replied that she lack the skills for that...

When I told her "Alex, I'm hungry", she told me that I should get something to eat -:)

Of course...there are some things when I asked her "Alexa, where's the nearest Italian Restaurant"...where she replied to me that she didn't had enough information to answer my question...but...Echo is still young and in constant it's all good in the hood -:)

If you want to see and hear's a small video...

So far...I can only say that I love Echo...I can pair it with my phone via Bluetooth and stream music...I can ask it about Wikipedia facts...and many more things that I'm sure I haven't tried yet...

And of course, I have applied already to be able to code for it as soon as it's always I have a lot of ideas in my mind...

Would I have bought it if it cost me $200 instead of $100? Sure...of course...after having for a weekend...I can't think of not having it -:) And I'm excited about all the possibilities that it can bring in the future...

Happy Echoing!


Development Culture.

sábado, 21 de febrero de 2015

My first post on OCaml

After tasting some Functional Programming with Erlang and Haskell I knew it was time to keep moving forward -;) This time...I choose to learn OCaml -:D

OCaml is a multi-paradigm, imperative, functional, object oriented programming language.

Of course...I'm reading a book to learn about it -:) So will see my review as soon as I finish it...

My first impressions on OCaml is that it looks like Haskell...but with some differences...which makes it akward because I tend to code in Haskell but then realized that some things are quite different...anyway...OCaml seems like a really nice language so far and of's not a pure as Haskell...

As the best way to learn is to code...I build a Fibonacci Sequence Generator...based of course of my previous Haskell code -;)
open Core.Std

let rec fib num a b = 
 match num with 
 | num when a > 0 && num > 1 -> string_of_int (a + b) ^ " " ^ fib (num - 1) (a+b) a
 | num when a = 0 -> string_of_int a ^ " " ^ string_of_int b ^ " " ^ 
                     string_of_int (a + b) ^ " " ^ fib (num - 1) (a+b) b
 | num -> ""
let () =
 print_string "Enter a number: "
 let num = read_int() in
 printf "%s" (fib num 0 1)

When we run it...we're going to see this -;)


Development Culture.

miércoles, 3 de diciembre de 2014

Keep going with BeagleBone Black - Small Midi Piano

Looks like I'm on fire these days -;) I got somehow the plan of building new things on the BeagleBone Black as fast and often as I can...better way to learn for sure -:)

This time I have made a small Midi Piano...and excuse my total lack of Piano skills -:(

For this I used Python, AdaFruit_BBIO, PyGame and Timidity++.


Development Culture.