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
WiceGridProcessor = (name, base_request_for_filter, base_link_for_show_all_records, link_for_export, parameter_name_for_query_loading, parameter_name_for_focus, environment) -> | |
this.checkIfJsFrameworkIsLoaded = () -> | |
if ! jQuery | |
alert "jQuery not loaded, WiceGrid cannot proceed!" | |
this.checkIfJsFrameworkIsLoaded() | |
this.name = name | |
this.parameter_name_for_query_loading = parameter_name_for_query_loading |
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 WiceGridProcessor, toggle_multi_select; | |
WiceGridProcessor = function(name, base_request_for_filter, base_link_for_show_all_records, link_for_export, parameter_name_for_query_loading, parameter_name_for_focus, environment) { | |
this.checkIfJsFrameworkIsLoaded = function() { | |
if (!jQuery) { | |
return alert("jQuery not loaded, WiceGrid cannot proceed!"); | |
} | |
}; | |
this.checkIfJsFrameworkIsLoaded(); | |
this.name = name; | |
this.parameter_name_for_query_loading = parameter_name_for_query_loading; |
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
# Yuri Leikind && Dmitry Adamushko :) | |
require 'set' | |
class Array # To understand recursion you have to understand recursion | |
def permutations(i = 0, *a) | |
return [a] if i == size | |
self[i].map do |x| | |
self.permutations(i+1, *(a + [x])) |
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(route). | |
-compile(export_all). | |
main(Filename) -> | |
% Filename = "road.txt", | |
{ok, Binary} = file:read_file(Filename), | |
NumberList = parse_input(Binary), | |
RouteTuples = lists:reverse(split_by_three(NumberList, [])), | |
Optimal = calculate_route(RouteTuples), |
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(game_of_life). | |
% -export([run/0, neighbours_for/1]). | |
-compile(export_all). | |
%%%% Coordinates %%%% | |
make_coordinate(List) when is_list(List) -> {coordinates, List}; | |
make_coordinate(_) -> erlang:error(badarg). |
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(trap). | |
-export([simple_exit_demo/0, kill_demo_v2/0, kill_demo/0, successfully_killing_a_non_system_process/0]). | |
listen() -> | |
receive | |
Message -> io:format("~p has caught a system message: ~p~n~n", [self(), Message]), | |
listen() | |
after 1000 -> | |
io:format("I, ~p, live on~n", [self()]), |
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(dog_fsm). | |
-behaviour (gen_fsm). | |
% gen_fsm behavior implementation | |
-export([ init/1, handle_event/3, handle_sync_event/4, handle_info/3, terminate/3, code_change/4]). | |
% states | |
-export([ barks/2, wag_tail/2, sit/2]). | |
% test | |
-export([ test/0]). |
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(cat_fsm). | |
-behaviour(gen_fsm). | |
% gen_fsm behavior implementation | |
-export([ init/1, handle_event/3, handle_sync_event/4, handle_info/3, terminate/3, code_change/4]). | |
% states | |
-export([ dont_give_crap/3]). | |
% test | |
-export([ test/0]). |
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(roman_to_num). | |
% https://github.com/ruby-fatecsp/dojos/blob/8cb15023eec6d4a5c9cdcf1723adff1ed5864a03/roman_to_numerals/lib/roman_to_num.rb | |
-export([convert/1, test/0]). | |
digit_to_num(D) -> | |
% io:format("~p~n", [D]), | |
case D of | |
$I -> 1; | |
$V -> 5; |
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(roman_to_num). | |
% https://github.com/ruby-fatecsp/dojos/blob/8cb15023eec6d4a5c9cdcf1723adff1ed5864a03/roman_to_numerals/lib/roman_to_num.rb | |
-export([convert/1, test/0]). | |
digit_to_num(D) -> | |
case D of | |
$I -> 1; | |
$V -> 5; | |
$X -> 10; | |
$L -> 50; |