Skip to content

Instantly share code, notes, and snippets.

View txominpelu's full-sized avatar

Inigo Mediavilla Saiz txominpelu

View GitHub Profile
txominpelu /
Created July 24, 2015 14:31
lines = 30000
types = {
"date" : "01-04-2015",
"string" : "hello",
"number" : "10000"
class Column(object):
def __init__(self, name, t):
txominpelu / log
Last active August 29, 2015 14:19
#<Gem::Version "2.2.0">
D, [2015-04-14T17:08:28.311546 #11332] DEBUG -- : HTTPI GET request to (net_http)
I, [2015-04-14T17:08:29.677913 #11332] INFO -- : SOAP request:
I, [2015-04-14T17:08:29.677983 #11332] INFO -- : SOAPAction: "Create", Content-Type: text/xml;charset=UTF-8, Content-Length: 895
D, [2015-04-14T17:08:29.678013 #11332] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="" xmlns:xsi="" xmlns:tns="" xmlns:env=""><env:Header><wsse:Security xmlns:wsse=""><wsse:UsernameToken wsu:Id="UsernameToken-1" xmlns:wsu=""><wsse:Username></wsse:Username><wsse:Password Type="
#!/usr/bin/env bash
set -o nounset
set -o errexit
set -o pipefail
declare -r max=2
declare i=0
function wrap() {
#lang scheme
(define (convert char)
[(char=? char #\<)
[(char=? char #\>)
[else (string char)]))
txominpelu / ReadKeys.scala
Created December 18, 2013 13:21
Retrieving rates from json object
import play.api.libs.json._
import scala.concurrent.ExecutionContext.Implicits._
import scala.concurrent.Await
import scala.concurrent.duration._
// Just for the example in the console - Await is WRONG
val result = WS.url("").get()
val json = Await.result(result, DurationInt(5).seconds).json
txominpelu /
Last active December 29, 2015 14:19
Glossary - Functional programming and type systems

Principal typings

The process of type inference is the fact of guessing, given an user-written program, what the type of this program is. In general, there may be several correct types for a given program. For example, the program fun x -> x can be given the types int -> int and bool -> bool.

Given a program, a type for this program is principal if it is the most general type that can be given to this program, in the sense that all other psosible types are specialization (instances) of this type. With my fun x -> x example, the polymorphic 'a -> 'a is a principal type.

A type system has the property of principal typing if for every term in the system, there's a principal type that subsumes (is a more general version, or a "supertype") all the other possible typings of the term.

Type systems with principal typing: ML, System F

txominpelu / traverse-validation
Created August 9, 2013 07:22
How to traverse a list of validation
import scalaz._
import scalaz.syntax.validation._
import scalaz.syntax.traverse._
import scalaz.std.list._
scala> List("1".successNel[String], "2".failNel[String], "3".failNel[String]).sequenceU
res5: scalaz.Validation[scalaz.NonEmptyList[String],List[String]] = Failure(NonEmptyList(2, 3))
txominpelu / index.html
Created August 22, 2012 22:12
Full code for the tutorial on ember.js states
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Playing with ember states</title>
<script src="" type="text/javascript" charset="utf-8"></script>
<script src="handlebars.js" type="text/javascript" charset="utf-8"></script>
<script src="ember-1.0.pre.debug.js" type="text/javascript" charset="utf-8"></script>
<script type="text/x-handlebars" data-template-name="master">
txominpelu /
Created January 19, 2011 18:49
Interfaz del catalogo de refactorizaciones
package dynamicrefactoring.domain.metadata.interfaces;
import java.util.List;
public interface ClassifiedFilterableCatalog<K> {
* Agrega un condicion al filtro actual que se esta aplicando al catalogo.
//Clase original:
package com.proyecto.prueba;
import java.util.*;
public class HolaMundo {
* @param args