I hereby claim:
- I am ludflu on github.
- I am ludflu (https://keybase.io/ludflu) on keybase.
- I have a public key whose fingerprint is CB64 897A 29BD ED98 BC18 3383 7E60 514A 57EC B7DC
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
window.rjm.app.rjmNgDirectives.directive "validateBigCommerce", [ | |
() -> | |
require: 'ngModel' | |
restrict: 'A' | |
link: (scope, ele, attrs, controller) -> | |
# var initializing used to prevent error messages from | |
# showing right away. | |
initializing = true | |
scope.$watch attrs.ngModel, (value) -> |
#this is the variable that will hold a reference to the python function | |
PyObject *py_callback; | |
#the following function will invoked from python to populate the call back reference | |
PyObject *set_py_callback(PyObject *callable) | |
{ | |
py_callback = callable; /* Remember new callback */ | |
return Py_None; | |
} | |
... |
window :: Int -> [a] -> [[a]] | |
--base case | |
window sz [] = [] | |
-- the "@" sign lets you alias the destructed variable as in "whole@(head:tail)" | |
-- "take N list" gives you the first N elements of list | |
window sz lst@(h:tl)= [take sz lst] ++ window sz tl | |
main = do | |
let seq = window 2 [1..25] |
Building a great app is hard, and so is building an audience. The exposure you get in the app store is critical, so developers need to make the most of it. Many apps ask their users to leave a review, in hopes of boosting their ranking in the app store. But pitfalls abound.
Recently the creators of Circa, the popular news app, shared some insights on how they achieved a stellar 5-star rating from 90% of the users who chose to leave a review.
There are several techniques that Circa used. We're going to breakdown two of their reccommendations and show how you can use Artisan tools to handle the drudgework, allowing you to implement their strategy quickly and easily.
Instead of asking any random user for a rating, smart developers can use analytics to send their request to the people most likely to give great ratings. Frequent users are your biggest fans, and its a good
import com.twitter.scalding._ | |
import com.twitter.scalding.ReplImplicits._ | |
import com.twitter.scalding.ReplImplicitContext._ | |
import org.joda.time.DateTime | |
import org.joda.time.format.DateTimeFormat | |
case class LatLonRecord(date : DateTime, msidn : String, lat : Double, lon : Double, cellname : String) | |
implicit def stringToDateTime(dateStr: String) : DateTime = | |
DateTime.parse(dateStr, DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss.S")) |
#!/usr/local/bin/python | |
import subprocess | |
from os import listdir,rename,mkdir,system | |
from os.path import isfile, join | |
try: | |
mkdir('bad') | |
except: | |
print "already exists" |
import System.Environment | |
contains :: String -> Int | |
contains s = if (elem 'e' s) then 1 else 0 | |
main = do | |
args <- getArgs | |
content <- readFile (args !! 0) | |
let ws = concatMap words $ lines content | |
matchCount = map contains ws in |
#Why Functional Programming Matters (to me)
This is my response to being asked not to use functional programming techniques.
###What I mean by "Functional Programming" Different people mean different things by "Functional Programming". Here's what it means to me:
def parseInt1( s : String) : Option[Int] = { | |
try { | |
Some(s.toInt) | |
} catch { | |
case _ : Throwable => None | |
} | |
} | |
def parseInt2(s: String): Option[Int] = { | |
Try(s.toInt) match { |