This file contains hidden or 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
| sudo apt-get install mercurial | |
| sudo apt-get install git-core | |
| sudo apt-get install imagemagick | |
| sudo apt-get -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxgtk2.8-dev libglu1-mesa-dev fop xsltproc default-jdk | |
| mkdir -p /src/erlang | |
| cd /src/erlang | |
| wget http://www.erlang.org/download/otp_src_R14B04.tar.gz | |
| tar -xvzf otp_src_R14B04.tar.gz | |
| chmod -R 777 otp_src_R14B04 | |
| cd otp_src_R14B04 |
This file contains hidden or 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
| start(_Type, _Args) -> | |
| Dispatch = [ | |
| {'_', [ | |
| {[<<"users">>, id, <<"messages">>], users_handler, []}, | |
| {'_', default_handler, []} | |
| ]} | |
| ], | |
| cowboy:start_listener(http, 100, | |
| cowboy_tcp_transport, [{port, 8080}], | |
| cowboy_http_protocol, [{dispatch, Dispatch}] |
This file contains hidden or 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
| /* | |
| Alchemy Websockets Client Library | |
| Copyright 2011 Olivine Labs, LLC. | |
| http://www.olivinelabs.com | |
| */ | |
| /* | |
| This program is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation, either version 3 of the License, or | |
| (at your option) any later version. |
This file contains hidden or 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
| // Copyright: Hiroshi Ichikawa <http://gimite.net/en/> | |
| // License: New BSD License | |
| // Reference: http://dev.w3.org/html5/websockets/ | |
| // Reference: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol | |
| (function () { | |
| if (window.WebSocket || window.MozWebSocket) return; | |
| var console = window.console; | |
| if (!console || !console.log || !console.error) { |
This file contains hidden or 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(random_password). | |
| -export([make_random_password/1]). | |
| make_random_password(N) -> | |
| {A1,A2,A3} = now(), | |
| random:seed(A1, A2, A3), | |
| lists:map(fun(_) -> make_random_unfunny_char() end, lists:seq(1, N)). | |
| make_random_unfunny_char() -> | |
| R = random:uniform(62), |
This file contains hidden or 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(random_password). | |
| -export([make_random_password/1]). | |
| make_random_password(N) -> | |
| {A1,A2,A3} = now(), | |
| random:seed(A1, A2, A3), | |
| lists:map(fun(_) -> make_random_unfunny_char() end, lists:seq(1, N)). | |
| make_random_unfunny_char() -> | |
| R = random:uniform(62), |
This file contains hidden or 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(removedup). | |
| -export([removedup/1]). | |
| compare(H, []) -> [H]; | |
| compare(H, [H|T]) -> [H|T]; | |
| compare(H1, [H|T]) -> | |
| L = [H|T], | |
| [H1|L]. | |
This file contains hidden or 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
| var a = (function outer() { | |
| var b = 0; | |
| return function inner() { | |
| var d = 10; | |
| b = d + b + 1; | |
| console.log(b); | |
| }; | |
| })(); | |
| a(); |
This file contains hidden or 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
| var total = (function f(item) { | |
| var tax= 0.08; | |
| var fee = 10; | |
| var sinTax = 0.02; | |
| var calGas = function(price) { return price + price*tax + fee; }; | |
| var calSinProd = function(price) { return price + price*tax + price*sinTax; }; | |
| var calFood = function(price) { return price + price*tax; }; | |
| var h = { |
This file contains hidden or 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
| var calculateTotal = function f(item) { | |
| var tax= 0.08; | |
| var fee = 10; | |
| var sinTax = 0.02; | |
| var calGas = function(price) { return price + price*tax + fee; }; | |
| var calSinProd = function(price) { return price + price*tax + price*sinTax; }; | |
| var calFoodAsDefault = function(price) { return price + price*tax; }; | |
| var h = { |