This file contains 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
result on client: | |
> free -m | |
total used free shared buffers cached | |
Mem: 7680 5190 2489 629 40 939 | |
-/+ buffers/cache: 4211 3469 | |
Swap: 0 0 0 | |
> erl | |
Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10] |
This file contains 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
2> redbug:start("lists:nth -> return"). | |
{30,1} | |
3> lists:nth(5, [a, b, c, d]). | |
13:29:13 <0.33.0>(dead) {lists,nth,[5,[a,b,c,d]]} | |
13:29:13 <0.33.0>(dead) {lists,nth,[4,[b,c,d]]} | |
13:29:13 <0.33.0>(dead) {lists,nth,[3,[c,d]]} |
This file contains 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 MyApp = angular.module('MyApp'); | |
MyApp.factory('msgBus', ['$rootScope', function($rootScope) { | |
var msgBus = {}; | |
msgBus.emitMsg = function(msg, data) { | |
data = data || {}; | |
$rootScope.$emit(msg, data); | |
}; | |
msgBus.onMsg = function(msg, func, scope) { | |
var unbind = $rootScope.$on(msg, func); | |
if (scope) { |
This file contains 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_deps(X) when not is_list(X) -> | |
start_deps([X]); | |
start_deps([]) -> | |
ok; | |
start_deps([A|T]) -> | |
case application:ensure_started(A) of | |
ok -> | |
start_deps(T); |
This file contains 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
julia> type(Union) | |
() | |
end | |
Warning: imported binding for Union overwritten in module Main | |
julia> Union() | |
ERROR: `Union` has no method matching Union() |
This file contains 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
const vovels = ['a', 'o', 'e', 'u', 'y', 'i'] | |
const consonants = filter(x -> x != nothing, | |
[i in vovels ? nothing : i | |
for i in 'a':'z']) | |
const vrx = Regex("[$(convert(String, vovels))]{3}\$") | |
const crx = Regex("[$(convert(String, consonants))]{3}\$") |
This file contains 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 Tconverter | |
export convert | |
import Base.convert | |
abstract Temperature | |
type Celsius <: Temperature | |
value :: Real | |
end |
This file contains 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
MemTotal: 5801372 kB | |
MemFree: 2391956 kB | |
Buffers: 774192 kB | |
Cached: 1015376 kB | |
SwapCached: 0 kB | |
Active: 1327312 kB | |
Inactive: 753192 kB | |
Active(anon): 493284 kB | |
Inactive(anon): 77992 kB | |
Active(file): 834028 kB |
This file contains 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
let lwt_call f = | |
let t1,w1 = Lwt.wait () in | |
Lwt.ignore_result | |
(let res = f () in | |
Lwt.wakeup w1 res; | |
Lwt.return_unit); | |
t1 | |
;; | |
let read_direction dir = |
This file contains 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
keyOrder = ['first_name', 'last_name', 'email', 'password1', | |
'password2', 'post', 'birthday', 'phone', 'city'] | |
res = OrderedDict() | |
for key in keyOrder: | |
res[key] = self.fields.get(key) | |
self.fields = res |
OlderNewer