Skip to content

Instantly share code, notes, and snippets.

View valinurovam's full-sized avatar

Valinurov Alexander valinurovam

View GitHub Profile
package main
import (
"fmt"
"math/rand"
)
func getSlice(n int) []int {
var slice []int
for n > 0 {
<?php
/**
* Created by PhpStorm.
* User: Alexander
* Date: 27.01.15
* Time: 0:54
*/
$post_data = 'next=okay';
$url = 'http://delphir.com/protocol.html';
1> DefArray = ets:new(def_and_array, [bag]).
16400
2> ets:insert(DefArray, {903, [{4450000,4456999,8230},{9999000,9999999,4646},{3030303,3030303,4646}]}).
true
3>
3>
3> ets:tab2list(DefArray).
[{903,
[{4450000,4456999,8230},
{9999000,9999999,4646},
get_country_id_by_dest(0) -> undefined;
get_country_id_by_dest(Msisdn) when is_list(Msisdn) =:= true ->
get_country_id_by_dest(erlang:list_to_integer(Msisdn));
get_country_id_by_dest(Msisdn)->
case ets:lookup(?TCOUNTRY_CODE, Msisdn) of
[{_Code, {_CodeLength, CountryID, _NumLength}}] ->
CountryID;
[] ->
get_country_id_by_dest(Msisdn div 10)
end.
[ts@terasmsinferno rebar]$ ./rebar create-node
==> rebar (create-node)
Read File "/home/ts/.rebar/templates/simplenode.template"
Read File "/home/ts/.rebar/templates/simplenode.template"
Read File "/home/ts/.rebar/templates/simplenode.reltool.config"
ERROR: 'create-node' failed while processing /home/ts/bin/rebar: {'EXIT',{{badmatch,{error,enoent}},
[{rebar_templater,load_file,3,
[{file,"src/rebar_templater.erl"},{line,239}]},
{rebar_templater,execute_template,7,
[{file,"src/rebar_templater.erl"},{line,337}]},
[ts@terasmsinferno rel]$ ../rebar create-node nodeid=test -vvv
DEBUG: Rebar location: "/home/ts/bin/test_project/rel/../rebar"
DEBUG: Consult config file "/home/ts/bin/test_project/rel/rebar.config"
DEBUG: is_rel_dir(/home/ts/bin/test_project/rel) -> false
DEBUG: Available deps: []
DEBUG: Missing deps : []
DEBUG: Predirs: []
==> rel (create-node)
DEBUG: Available templates: [{file,"/home/ts/.rebar/templates/simplemod.template"},
{file,"/home/ts/.rebar/templates/ctsuite.template"},
[ts@terasmsinferno rebar]$ cd src/
[ts@terasmsinferno src]$ ls -al
total 440
drwxrwxr-x 2 ts ts 4096 Dec 6 15:42 .
drwxr-xr-x 9 ts ts 4096 Dec 6 15:42 ..
-rw-rw-r-- 1 ts ts 26225 Dec 6 15:42 getopt.erl
-rw-rw-r-- 1 ts ts 7611 Dec 6 15:42 mustache.erl
-rw-rw-r-- 1 ts ts 4251 Dec 6 15:42 rebar_abnfc_compiler.erl
-rw-rw-r-- 1 ts ts 8039 Dec 6 15:42 rebar_appups.erl
-rw-rw-r-- 1 ts ts 7610 Dec 6 15:42 rebar_app_utils.erl
[ts@terasmsinferno rel]$ ../rebar create-node nodeid=status_server
==> rel (create-node)
ERROR: 'create-node' failed while processing /home/ts/bin/status_server/rel: {'EXIT',{{badmatch,{error,enoent}},
[{rebar_templater,load_file,3,
[{file,"src/rebar_templater.erl"},{line,238}]},
{rebar_templater,execute_template,7,
[{file,"src/rebar_templater.erl"},{line,336}]},
{rebar_core,run_modules,4,[{file,"src/rebar_core.erl"},{line,405}]},
{rebar_core,execute,5,[{file,"src/rebar_core.erl"},{line,334}]},
{rebar_core,process_dir1,6,[{file,"src/rebar_core.erl"},{line,197}]},
ERROR: 'create-node' failed while processing /home/ts/bin/status_server/rel: {'EXIT',{{badmatch,{error,enoent}},
[{rebar_templater,load_file,3,
[{file,"src/rebar_templater.erl"},{line,238}]},
{rebar_templater,execute_template,7,
[{file,"src/rebar_templater.erl"},{line,336}]},
{rebar_core,run_modules,4,[{file,"src/rebar_core.erl"},{line,405}]},
{rebar_core,execute,5,[{file,"src/rebar_core.erl"},{line,334}]},
{rebar_core,process_dir1,6,[{file,"src/rebar_core.erl"},{line,197}]},
{rebar_core,process_commands,2,
[{file,"src/rebar_core.erl"},{line,61}]},
.rebar]$ tree
.
└── templates
├── basicnif.c
├── basicnif.erl
├── basicnif.template
├── ctsuite.erl
├── ctsuite.template
├── simpleapp_app.erl
├── simpleapp.app.src