Time for an 2014 update…

This commit is contained in:
Ingy döt Net 2014-01-17 05:32:22 +00:00
parent 372c577f83
commit 09687c4926
2520 changed files with 34227 additions and 7318 deletions

View file

@ -5,7 +5,7 @@
out_dates_from_file( Name ) ->
{ok, Binary} = file:read_file( Name ),
Lines = binary:split( Binary, <<"\n">>, [global] ),
{_N, Dict} = lists:foldl( fun out_dates/2, {0, dict:new()}, Lines ),
{_N, _Date, Dict} = lists:foldl( fun out_dates/2, {0, "", dict:new()}, Lines ),
[{X, dict:fetch(X, Dict)} || X <- dict:fetch_keys( Dict )].
task() ->
@ -15,11 +15,11 @@ task() ->
out_dates( <<>>, Acc ) -> Acc;
out_dates( Line, {N, Dict} ) ->
[_License, Direction, <<"@">>, Date | _T] = [X || X <- binary:split(Line, <<" ">>, [global]), X =/= <<>>],
out_dates( Line, {N, Date, Dict} ) ->
[_License, Direction, <<"@">>, New_date | _T] = [X || X <- binary:split(Line, <<" ">>, [global]), X =/= <<>>],
New_n = out_dates_n( N, Direction ),
New_dict = out_dates_dict( N, New_n, Date, Dict ),
{New_n, New_dict}.
{New_n, New_date, New_dict}.
out_dates_dict( N, New_n, Date, Dict ) when N > New_n -> dict:append( N, Date, Dict );
out_dates_dict( _N, _New_n, _Date, Dict ) -> Dict.

View file

@ -4,6 +4,3 @@ LC = 0; LCMax = 0; Scan[
If[LCMax == LC, AppendTo[LCMaxtimes, #[[4]]]],
LC--;] &, Import["mlijobs.txt", "Table"]]
Print["The maximum number of licenses used was ", LCMax, ", at ", LCMaxtimes]
output:
-> The maximum number of licenses used was 99, at {2008/10/03_08:39:34,2008/10/03_08:40:40}