February 2012
1 post
Vancouver's Clojure Club is ALIVE! →
Some friends and myself decided to formalize a study group we were having for learning Clojure, at this point I think there is enough people that could comfortably work on open source projects.
The idea is to join and share projects as a group to gain more feedback from others, this way if a group checks and uses the libraries instead of individuals this libraries will definitely get more...
December 2011
1 post
2 tags
Most of the biggest problems in software are problems of misconception.
– Rich Hickey.
November 2011
3 posts
3 tags
Haskell's Show and pretty printing bad practice
Most of times when I was coding Haskell code, I always implemented the Show classtype whenever I wanted to print things on the screen in a nice and fashionable way.
It seems however this is a really bad practice that hasn’t been taught enough in the Haskell community. I discovered this in a StackOverflow question that had nothing to do with pretty printing, but the discussion led to...
2 tags
Clojure's repeatedly gotcha
When using Clojure’s repeatedly function to read lines from a terminal, or when trying to do IO of some sort, the behavior won’t be as expected
This is because repeatedly instead of calling the action n times, it generates a lazy seq for each time the action function gets called. Given that it is a lazy seq, if you don’t force the evaluation of the list, all but the first...
2 tags
Vim's Fugitive's "Error detected while processing...
At a random time on my development cycle, I was using the awesome Fugitive plugin developed by Tim Pope, and I got the following strange error:
Error detected while processing function 51_Commit:
line 52:
E480: No match: `=msgfile`
Press ENTER or type command to continue
After some googling, I found out the reason was that I installed just a few days ago the also awesome ctrlp plugin. When...
October 2011
3 posts
1 tag
The distinction between mechanism and policy is one of the best ideas behind the...
– Jonathan Corbet, Greg Kroah-Hartman, Alessandro Rubini on Linux Device Drivers, 3rd Edition
September 2011
9 posts
3 tags
Testing URI canonicalization using QuickCheck
Today I was working on a custom web crawler for the company I’m working in. One of the problems I was having in the first implementations was that I was not canonicalizing the links, and I was visiting the same link more than once in the crawl.
Canonicalization of URI’s basically consist on removing any query string and fragment out of the given URI (at least, that is my...
2 tags
Puppet: ERROR 400 on SERVER: Must pass...
I’m currently playing with puppet doing some changes to my modules to support Archlinux, at this time I did several changes to my git module, Initially the implementation was something like this:
And then, it became something like this:
In the end I added some new parameters to my git class, and changed my nodes.pp file accordingly:
For some crazy reason, the puppet agent was throwing...
2 tags
Don’t, Please ***don’t*** install puppet 2.7.3 with Ruby 1.9.2 ever,...
– Me.
Thanks to this guy for pointing me in the right direction.
Stupid puppet and stupid ruby 1.9.2
4 tags
Loading package double-conversion- ... : can't...
Recently I’ve been playing with the aeson library in Ubuntu oneiric, unfortunately I ran across this compilation error:
Loading package double-conversion-0.2.0.1 ... : can't load .so/.DLL for: stdc++ (libstdc++.so: cannot open shared object file: No such file or directory)
After a lot of investigation, I found a ticket on the Ttrac site of GHC that came up with a solution, I will...
4 tags
Crawler implementation in Haskell
Today at Noomii I was getting some new requirements for our crawler that is implemented in Ruby. The requirement list was quite dense, and I was wondering if it was a good idea to implement this functionality in Haskell :-).
Later, after finishing the morning scrum meeting, I got my hands on Bryan O’Sullivan’s slides from the StrangeLoop conference, I was really interested in...
5 tags
Aníbal Rojas: Como ser un mejor programador (un... →
anibalrojas:
Yo no soy un gram programador, creo que nunca lo he sido, aunque por mucho años me dedicara a programar profesionalmente. No me entiendan mal, no es que no me guste programar ni que mi código apestte, en realidad me gusta mucho y he tenido muy buenos momentos programado, pero el trabajo no me deja…
Great post by one of my menthors back in Venezuela, hopefully at some point...
Elegance and familiarity are orthogonal
– Rich Hickey (author of Clojure)
Meaning: Unless you are familiar with a concept/language etc, you are not able to tell if something is elegant or not.
All the adversity I’ve had in my life, all my troubles and obstacles, have...
– Walt Disney.
Personal note: On the hardest times, just remember this.
3 tags
Using and Parsing Dates in Haskell
Recently I’ve been playing around with the Github API, and I wanted to do some code using Haskell. I’ve been using several libraries like aeson, enumerator, http-enumerator, among others.
One of the details I was really concerned about was the time structures in Haskell, I didn’t know exactly which module to use, and there were at least two options:
System.Time
...
August 2011
6 posts
Do yourself a favor...
Never compile ghc-platform… ever, it took me around 12 hours to finish compilation, not fun at all.
1 tag
Adrian Bravo's tumblr: Creating a Vagrant Base Box... →
This is for me so that I don’t forget how to build vagrant boxes again…
2 tags
Any fool can write code that computers can understand. Good programmers write...
–
Martin Fowler (via edgar)
2 tags
Haskell's Tuple like structures in Clojure
As you may know by now, there is no equivalent for Haskell’s tuples in Clojure, in order to replicate this behavior, you will need to use vectors of two items. Clojure provides the functions first and second to get the elements out of the tuple vector
Tuples in Haskell are very useful when using the zip function, one way to replicate this behavior in Clojure is using the map function with...
If you want to do something, you’ll find a way to do it. Otherwise,...
– Jim Rohn
It is better to have 100 functions operate on one data structure than 10...
– Alan Perlis (read from The Joy Of Clojure)
June 2011
4 posts
2 tags
Puppet - Could not retrieve catalog from remote...
Today I was having issues running puppet (for the first time), I bought an Amazon EC2 micro instance to run the master, and I was working with a vagrant lucid64 box to check that the initial setup for agent nodes was working correctly; sadly I got stuck with an error for a few hours, after doing the SSL certification on the agent. The error was the following:
err: Could not retrieve catalog...
4 tags
Erlang and Haskell sitting on a Tree
Last night I was reading the paper Haskell for the cloud [pdf], written by the super kick-ass Haskell guru Simon Peyton-Jones.
Two paragraphs got my eye, and I wanted to share them with you
We use the term “cloud” to mean a large number of processors with separate memories that are connected by a network and have independent failure modes. We don’t believe that shared-memory concurrency is...
3 tags
vim-ruby slowness fix
Lately whenever I was working on a rails project, I was having such a pain editing the routes file of this specific project, it went super slow on me on editing time. My “patch” fix was to always disable the syntax or set the filetype to something different than ruby to make it go normal speed again.
This came even more unbearable when it was happening on other files, and my crappy...
4 tags
QuickFix errrorformat for Haskell
If you are wondering how to get the whole potential of QuickFix with Haskell, here you have a snippet of my vim config.
Have to thank to Martin Norbäck for his post in the GHC mailing list for the errorformat value.
January 2011
1 post
2 tags
On how Haskell's Arrows might just be function...
Update: The post you are about to read explains just a tiny portion of what Arrows are, pure functions are just one instance of this quite complex classtype. I’m not trying to say that Arrows are just pure functions, I’m saying that in your program, they might be just that. Just to clarify, this post simplify the concept of Arrows — for you the novice reader — to digest it...
December 2010
2 posts
2 tags
October 2010
1 post
3 tags
We are unable to upload this Certificate file...
At this moment, you are probably being victim of Apple’s Provisioning Portal mysterious error messages.
I know.
you are frustrated
you are following each single step in a really detailed fashion
you have repeated the whole thing at least 4 times and still getting this stupid cryptic error message
Time for google to solve it right? Well, fear no more, I have the one and true answer...
April 2010
0 posts
3 tags
Default mutable values in Python functions are...
If you use mutable default values on functions, this will keep it state in recurrent calls:
def myAppend(x, L=[]):
L.append(x)
return L
#=============
>>> myAppend(1)
=> [1]
>>> myAppend(2)
=> [1, 2]
That’s seriously messed up o.O
March 2010
2 posts
3 tags
Use form_for from Rails' console
As a curious developer, I always like to inspect an objects guts on the console, that way I can now as much as I can from the class without reading the documentation. It was the time for the rails form_for view helper. I had no idea how to access that from the terminal whatsoever, so I googled a bit and I found nice tidbits that got me going pretty quickly.
However when you try to use a method...
November 2009
4 posts
4 tags
Randoms and Haskell
Right now I’m on chapter 15 of my RWH book. This one talks about problems that get complicated without the use of a Monad, one of them is the System.Random API of Haskell. I’m going to start by introducing two typeclasses that this module exports for clarity’s sake:
RandomGen: a RandomGen represents an state that holds the random input, I like to think of it like a stream of...
October 2009
0 posts
6 tags
An implementation of a jQuery plugin using BDD
On Web apps, sometimes we want to avoid unnecessary requests, one of those situations happens when there is a form that represents a record, and the values of this record haven’t changed. On these cases you would like the user to send an update request only when the values of the record’s form actually changed, this technique is called “dirty form”, and is a very common...
September 2009
4 posts
3 tags
"Object is not missing !" + Amazon::S3
Today at the office, we had one of the weirdest Rails errors I have ever encountered
rails-project/vendor/rails/activesupport/lib/active_support/dependencies.rb:417:in `load_missing_constant’: Object is not missing constant Photo! (ArgumentError)
We looked up into the stack trace and we found the problem was being caused by this...
4 tags
The jQuery DSL
For the last 4 months I’ve been using jQuery for Javascript development. To be honest, I didn’t got started before with jQuery because it didn’t seem too practical to me (no Class approach), but after looking carefully at the plugin model, it was truly a revelation of a good API for development.
So I started to accommodate to the jQuery’s way of things, and one of the...
3 tags
(ActiveRecord::Callbacks +...
Have you ever been in a situation where you have this strange bug, that takes you more time than expected to find out what (tha hell) is going on? That happened to us (me and my team) last Rails Rumble when we were trying to have some stuff done after the creation of an element that had some tags associated to it.
The code looked something like the following:
## app/models/entry.rb
class Entry...
August 2009
5 posts
3 tags
Rails Rumble 2009: The competition
So… it happened, the last weekend was the Rails Rumble, a really kick ass event that made me squeeze all my skills and drop all my social life for 48 hours. I learned a lot of lessons (some the hard way).
The Event Organization.
The competition organization was OUTSTANDING, starting with the registration/team page, everything worked really well. At the competition, the little details stand...
3 tags
RailsRumble 2009. Paperback: A Post Mortem...
So, to make life easier to the judges of my application, I will straight down the main features and the issues I’ve found along the way. We start now.
What it supposed to be.
Paperback in one sentence: “A day activity log manager with twitter-like interface”.
Paperback may look very similar to twitter when you log in, please be patient enough to pass through that. Paperback is...
3 tags
My Crush On Vim
So it has been a while since I don’t talk about vi/vim… I sadly had at some point to leave behind my goal to use vi/vim to work in more important things in the office. But last week I regained my will to learn vim; and a lot of people at the office asked me why I do this… well what I’ve tell to them (and to myself) is that I needed to learn it because I don’t know in...
3 tags
July 2009
4 posts
4 tags
walruz: Creating Basic Authorization Policies
Last post we checked the architecture of the walruz authorization framework, now we will continue on the implementation of basic policies. Creation of Authorization Policies.
To create a policy you have to create a class that extends from the Walruz::Policy class, once that is done, you’ll need to define the authorized? method. This method will receive 2 parameters: the actor, and the...
5 tags
walruz: Simple but powerful authorization...
You have been there already… your kick-ass app suddenly becomes an insatiable beast when you have to add special conditions for authorized access, roles types, etc. And as soon as a new kind of user is added, or new more specific conditions are created for the existing authorizations, you just want to shoot your application just to put it out of its misery.
Well it doesn’t have to be...
2 tags
Updates approaching
Hello guys… I’m adding this post just to apologize with the readers of this blog (If there’s any besides me). I started to work almost 2 months ago in this place called noomii and I have been really busy afterwards. Anyways! I have been doing some interesting stuff with Ruby and I will be posting new API soon-ish enough.
Peace out.
Rule of thumb… whenever you query with datetime, date, or time attributes...
– Me