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.

martes, 2 de diciembre de 2014

DYI Simon Says - Using BeagleBone Black

Today...I was thinking what else could I built using the BeagleBone Black...and what came out was...making a Simon Says game! -:D

For this I simply used Python and AdaFruit_BBIO -:)

Of course...I need to add music and put a new color LED -;)


Development Culture.

My first BeagleBone Black Project

As you may know...I started with the BeagleBone Black, almost a month ago...and of course...I have a project done already -;)

Sorry for the crappy quality of the video...but I shot it with my IPhone and uploaded to YouTube...

As you can will play the Happy Birthday song while lighting the LEDs simulating a keyboard...not way cool...but it was a really good start for me -:)

I used Python, AdaFruit_BBIO, PyGame and Pyknon.


Development Culture.

martes, 11 de noviembre de 2014

Starting up with the BeagleBone Black

I have always been a software guy...always immersed in programming and cool projects...but a couple of days ago I start playing with my first electronics toy...a BeagleBone Black...

I got myself The Ultimate BeagleBone Black Development Kit from Amazon which is really good to get you started...the only problem is that it comes with an PTBB-170B breadboard which is really small and doesn't really come with the ground and positive I have no clue how to use it...yet -:(

Good thing is...I work at the d-shop in SAP Labs Palo we have plenty of regular and extra big breadboards -;)

Anyway...I started building up my first simple projects and using Adafruit BBIO on Python to code...which is really nice -:)

Of course...I still have a very long to go...but I have a couple ideas on my mind that could become really nice projects...let's see what becomes on my first adventure on electronics -;)


Development Culture.

miércoles, 5 de noviembre de 2014

Web scrapping with Go and PhatomJS

Some time ago I wrote a blog called Web scrapping with Julia and PhantomJS...then I wrote another blog called Web scrapping with Haskell and PhantomJS...

This's Go's time -;)

The concept is the same...we create a PhantomJS script that will read a "user" Twitter page and get the hashtags of the first 5's the PhantomJS script...

var system = require('system');

var webpage = require('webpage').create();
webpage.viewportSize = { width: 1280, height: 800 };
webpage.scrollPosition = { top: 0, left: 0 };

var userid = system.args[1];
var profileUrl = "" + userid;, function(status) {
 if (status === 'fail') {
  console.error('webpage did not open successfully');
 var i = 0,
 queryFn = function() {
  return document.body.scrollHeight;
 setInterval(function() {
  top = webpage.evaluate(queryFn);
  webpage.scrollPosition = { top: top + 1, left: 0 };

  if (i >= 5) {
   var twitter = webpage.evaluate(function () {
    var twitter = [];
    forEach = Array.prototype.forEach;
    var tweets = document.querySelectorAll('[data-query-source="hashtag_click"]');, function(el) {
    return twitter;

   twitter.forEach(function(t) {

}, 3000);

If we run the script we're going to see the following output...

Now...what I want to do with this to send it to Go...and get the most used I will summarize them and then get rid of the ones that only appear less than 5 times...

Let's see the Go code...

package main

import ( "os/exec"
  "fmt" )

func main() {
 cmd := exec.Command("phantomjs","--ssl-protocol=any","Hashtags.js", "Blag")
 out, err := cmd.Output()
 if err != nil {
 Tweets := strings.Split(string(out), "\n")
 charmap := make(map[string]int)
 for _, value := range Tweets {
  if value != "" {
   charmap[value] += 1
 for key, value := range charmap {
  if value >= 5 {
   fmt.Print("(", key, ", ")
   fmt.Println(value, ")")

The only problem with this script is that there's not an easy way to sort a map[string] I will simply leave it like that -:)

Here's the result...

If someone knows an easy way to sort this...please let me know -:)


Development Culture.

miércoles, 29 de octubre de 2014

LED is my new Hello World - Go Time

As I keep learning Go, I'm learning more's my take on LED Numbers...maybe not the best code ever...but it works -:)

package main

import ( "fmt"
   "strings" )

func main() {
 fmt.Print("Enter a number: ")
 var num int
 var list []string
 var line1, line2, line3 string
 fmt.Scanf("%d", &num)
 numList := strings.Split(strconv.Itoa(num), "")
 romans := map[string]string {
  "0" : " _  ,| | ,|_| ",
  "1" : "  ,| ,| ",
  "2" : " _  , _| ,|_  ",
  "3" : "_  ,_| ,_| ",
  "4" : "    ,|_| ,  | ",
  "5" : " _  ,|_  , _| ",
  "6" : " _  ,|_  ,|_| ",
  "7" : "_   , |  , |  ",
  "8" : " _  ,|_| ,|_| ",
  "9" : " _  ,|_| , _| ",
 for _, value := range numList {
  list = strings.Split(romans[value],",")
  line1 += list[0]
  line2 += list[1]
  line3 += list[2]

Here are the screenshots...


Development Culture.

Mi first post on Go

As Go is gaining some popularity...I decided to give it a try...and sure...the fact that Ken Thompson is one of the three main designers of the language helped as well -:P

In order to learn I'm reading the book An Introduction to Programming in Go so expect a book review soon... first impression of Go is that is basically C/C++ without the makeup...meaning...take out some nasty and weird features and you have yourself the Go programming language...

Go is supposed to be compiled, concurrent, imperative and structured.

Anyway...C++ was one of the first languages I ever learned so learning Go feels like going back home for a while...

For sure...the best way to learn a new language is to code again I start by building something simple like the Fibonacci number generator based on Haskell code from another post...

package main

import ( "fmt"
   "strconv" )

func main() {
 fmt.Print("Enter a number: ")
 var num int
 fmt.Scanf("%d", &num)
 fmt.Print(fib(num, 0, 1))

func fib(num int, a int, b int) string{
 var result string
 if a > 0 && num > 1 {
  result += strconv.Itoa(a+b) + " " + fib(num-1, a+b, a)
 } else if a == 0 {
  result = strconv.Itoa(a) + " " + strconv.Itoa(b) + 
                             " " + strconv.Itoa(a+b) + 
                             " " + fib(num-1, a+b, b)
 return result

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


Development Culture.

How to Design Programs - Book Review

I just finished reading How to Design Programs, a book meant for beginners that want to get into the wonderful world of programming...and for that they use Scheme and DrScheme (which is now called Racket).

Of course, they don't focus on Scheme but on the design principles of programming...which makes this one a really important book.

The book itself is pretty big...with 565 pages...

There's a lot of really nice examples ranging from really basic to somehow complex, so there's a good learning curve attached to it.

Using Scheme as a starting point for learning programming is in my opinion a really smart choice...the syntax might be kind of weird sometimes but the good thing is that there are not so many keywords so learning it it's not a hard task...

Even if you have experience in programming...this book is really helpful and it goes beyond the simple act of programming as it teaches you how to design, build and test your application...making it more robust and less error prone...

If you have the this will not regret it -;)


Development Culture.