$ erl
> i().
| -module(date_util). | |
| -compile(export_all). | |
| epoch() -> | |
| now_to_seconds(now()) | |
| . | |
| epoch_hires() -> | |
| now_to_seconds_hires(now()) | |
| . |
| -module(netmask). | |
| -export([in_network/3]). | |
| in_network(Net, CIDR, IP) | |
| when is_binary(Net), is_binary(IP), is_integer(CIDR) -> | |
| <<NetworkPrefix:CIDR/bits, _/bits>> = Net, | |
| case IP of | |
| <<NetworkPrefix:CIDR/bits, _Host/bits>> -> | |
| in_net; | |
| _ -> not_in_net |
| #!/usr/bin/env python | |
| # kd-tree index and nearest neighbour search | |
| # includes doctests, run with: python -m doctest kdtree.py | |
| class KDTree(object): | |
| """ | |
| kd-tree spatial index and nearest neighbour search | |
| http://en.wikipedia.org/wiki/Kd-tree | |
| """ |
| import logging | |
| from math import exp | |
| from random import random | |
| from time import sleep | |
| from time import time | |
| from uuid import uuid1 | |
| from redis.exceptions import WatchError |
| diff --git a/iPhoneTrackingAppDelegate.m b/iPhoneTrackingAppDelegate.m | |
| index 1d22ecb..4af2bcf 100644 | |
| --- a/iPhoneTrackingAppDelegate.m | |
| +++ b/iPhoneTrackingAppDelegate.m | |
| @@ -146,7 +146,7 @@ | |
| return NO; | |
| } | |
| - const float precision = 100; | |
| + const float precision = 10000; |
| #!/bin/sh | |
| OTP_VERSION=$(erl -noinput \ | |
| -noshell \ | |
| -eval 'io:fwrite(erlang:system_info(otp_release)).' \ | |
| -s init stop) | |
| PLT_DIR="$HOME/.dialyzer/${OTP_VERSION}" | |
| CURRENT_APP=$(basename $(pwd)); |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
| -module(crc17). | |
| -export([calc/1]). | |
| calc(List) -> calc(List,16#FFFF). | |
| calc(<<>>,CRC) -> | |
| CRC; | |
| calc(<<Value:8,Rest/binary>>,CRC) -> | |
| Index = (CRC bxor Value) band 255, |