This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import imap | |
def polynomial(coefs, x): | |
"""computes the value of a polynomial with | |
the given coefficients for a given value x""" | |
# For example, if coefs contains 3 values then exponents is [2 1 0] | |
exponents = reversed(range(len(coefs))) | |
return sum(map(lambda c,e: c * x**e, coefs, exponents)) | |
def derivative(coefs, x): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==> ./configure --prefix=/usr/local/Cellar/valgrind/3.7.0 --mandir=/usr/local/Cellar/valgrind/3.7.0/share/man --enable-only64bit --build=amd64-darwin | |
==> make | |
echo "# This is a generated file, composed of the following suppression rules:" > default.supp | |
echo "# " exp-sgcheck.supp xfree-3.supp xfree-4.supp darwin10-drd.supp darwin11.supp >> default.supp | |
cat exp-sgcheck.supp xfree-3.supp xfree-4.supp darwin10-drd.supp darwin11.supp >> default.supp | |
make all-recursive | |
Making all in include | |
make[2]: Nothing to be done for `all'. | |
Making all in VEX | |
make all-am |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Credit: Programming Clojure http://pragprog.com/book/shcloj/programming-clojure | |
; Fibonacci infinite sequence | |
(defn lazy-seq-fibo | |
([] | |
(concat [0 1] (lazy-seq-fibo 0N 1N))) | |
([a b] | |
(let [n (+ a b)] | |
(lazy-seq | |
(cons n (lazy-seq-fibo b n)))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Credit: http://java.ociweb.com/mark/clojure/article.html | |
(defn- polynomial | |
"computes the value of a polynomial | |
with the given coefficients for a given value x" | |
[coefs x] | |
; For example, if coefs contains 3 values then exponents is (2 1 0). | |
(let [exponents (reverse (range (count coefs)))] | |
; Multiply each coefficient by x raised to the corresponding exponent | |
; and sum those results. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Day Job: Software engineer / technical lead | |
Open Source contribution (if any): I've contributed to vimerl. | |
Tell me about your experience with Ruby/Rails: I use ruby and sinatra for side projects. I've contributed to MrT (command-line competion). I tend to do round-robin between ruby and python for scripting. I'm very often using ruby in my projects, even if it's not directly: git custom workflows, presentations (showoff), configuration management (puppet, vagrant), email client (vmail), etc. | |
How do you use GitHub: I use it all the time. I use it to follow projects I'm interested in or to find new projects. I put my side projects and presentations on github. And I also use it at work with private repositories (pull requests, code review, issues, etc.). I couldn't live without it. | |
Favorite luchador(es): Octagón and el Santo. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function( exports, imports ) { | |
return imports( function | |
( run | |
, node$listen | |
, node$fs | |
, route | |
, html | |
, head | |
, sleep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List getPromocionesSeleccionadas() { | |
List promociones = null; | |
List promoList = getPromociones(); | |
if ( promoList != null && promoList.size() > 0 ) { | |
promociones = new ArrayList(); | |
Iterator iter = promoList.iterator(); | |
while (iter.hasNext()) { | |
Integer promoId = (Integer) iter.next(); | |
String promocion = (String) promocionesDisponibles.get(promoId); | |
promociones.add(promocion); |