Skip to content

Instantly share code, notes, and snippets.

@jamiely
jamiely / offline_map.md
Created September 1, 2012 19:17
Generating offline maps for iOS applications

Intro

Recently, I had to implement an offline mapping solution for an iOS application. Here's a walkthrough of how to do it.

Summary

I generated a tile database using TileMill. I used the Route-Me iOS library which provides a map view that supports offline tile sources.

TileMill

@chintak
chintak / install_simplecv.sh
Last active June 1, 2018 15:56
Install SimpleCV/OpenCV in a Virtual Environment on Mac OSX
# First install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
# Choose the name of the virtualenv as simplecv
virtualenv simplecv --no-site-packages
source simplecv/bin/activate
# This activates the virtualenv; your command prompt should change from `$` to `(simplecv)$`
# Next the dependencies
sudo easy_install pip # Can be ignored, if pip already present
import Prelude hiding (map)
-- Generalizar el mapeo (por ejemplo) consiste en definirlo
class Mappeable f where
map :: (a -> b) -> f a -> f b
*** AVISO, si lees ésto podrías llegar a desaprender ***
Cuidado con las mónadas, yo estoy bastante seguro de no entenderlas (bien).
Me explico, el concepto "por definición" de mónada es bastante simple,
bastante confuso al principio (como todo, supongo) pero luego es simple
(simple en el sentido de que las reglas que se aplican son sencillas,
luego cada mónada ya... puede ser infumable de entender).
(Ojo, lo que sigue hasta el siguiente aviso es una explicación CONCEPTUAL,
// La currificación (estilo Haskell) se consigue
// de forma efectiva con sólo separar los
// argumentos 1º, 2º, ... con paréntesis en lugar
// de comas.
//
// Por ejemplo, en lugar de
//
// miFuncion(arg1, arg2, arg3)
//
// Hacer
_"es generación Lazy"_
tienes razón y quizás la he obviado injustamente, es una buena herramienta, pero piensa
por ejemplo que en C#, tú puedes escribir igualmente lo siguiente:
{{
var ApiGit = new JsonProvider<Repo>("http...");
var repo = ApiGit.Load("https://api.github.com/repos/"+user+"/"+repoName);
var gIndex = 3 * repo.Forks + repo.StargazersCount + repo.WatchersCount;
}}
Entonces, VS te dará errores de tipo, pero *si tienes en background el "generador de wrappers"*
@jhaberstro
jhaberstro / hkt.cpp
Last active September 25, 2020 12:28
Functor, Maybe, and Higher-Kinded Types in C++
// Example program
#include <iostream>
#include <string>
#include <vector>
#include <type_traits>
//---------------------
// Maybe and MyVector, two totally unrelated classes whose only commanilty is that they are both type constructors of the same arity (e.g. 1) and order (e.g. 1).
//---------------------
template< typename T >