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
USING: kernel sequences sequences.deep math math.order math.parser | |
arrays splitting assocs sorting ; | |
IN: 21lesson | |
! 希望リストから配属候補を求める | |
: wish-list>candidate ( wish-list -- candidate ) | |
{ 1 2 3 4 5 } swap [ | |
[ second first over = ] filter | |
[ first ] map swap drop | |
] curry map ; |
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
USING: arrays generalizations kernel math | |
math.parser sequences sorting strings ; | |
IN: 18notfork | |
SYMBOL: o ! 客を表す記号 | |
SYMBOL: x ! 絶望的に長くかかる客を表す記号 | |
: throughput ( -- seq ) { 2 7 3 5 2 } ; ! 各レジの処理能力 | |
: shortest ( regi -- n ) ! 最も短いレジを探す とは |
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
digraph irrpas { | |
start -> tokens [ label="Data" ]; | |
subgraph cluster_solve { | |
label="solve"; | |
tokens [ label="string:tokens\n':'で分ける", fontname="IPAexGothic" ]; | |
tokens -> parse_size [ label="SizeStr" ]; | |
tokens -> parse_concat_list [ label="ConcatListStr" ]; | |
parse_size [ label="parse_size\n文字列→サイズ", fontname="IPAexGothic" ]; | |
parse_size -> init_dep_map [ label="Size" ]; | |
parse_size -> get_renum_map [ label="Size" ]; |
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 ( irrpas2 ). | |
-compile ( export_all ). | |
solve ( DataString ) -> | |
[ { Width, Height } | ConcatCells ] = parse_input_string ( DataString ), | |
TargetCellValueWithMemo = get_value ( Width - 1, Height - 1, ConcatCells, [] ), | |
get_right_two_digit ( element ( 1, TargetCellValueWithMemo ) ). | |
parse_input_string ( InputString ) -> | |
NumberStrings = string:tokens ( lists:delete ( $x, InputString ), ":," ), |
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
#!/bin/sh | |
# calculate maximum drawdown. | |
awk ' | |
START {max=0;maxdrawdown=0} | |
max<$3 {max=$3;print "set max",$1,max} | |
{drawdown=max-$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
include Math | |
def main | |
puts "6 digits" | |
check_range((100..999), 1000) | |
puts "10 digits" | |
check_range((10000..99999), 100000) | |
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
javascript:(function(){var%20s=window.prompt("%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB%E3%81%AE%E4%B8%80%E9%83%A8%E3%82%92%E5%85%A5%E5%8A%9B%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82");if(!s)return;document.getElementById("gbqfq").value="in:inbox%20subject:"+s;document.getElementById("gbqfb").click();})(); |
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
// Maybe monad. | |
var Maybe = { | |
Just: function(a) { | |
this.value = a; | |
this.bind = function(f) { return f(this.value); }; | |
}, | |
None: function() { | |
this.bind = function() { return this; }; | |
}, |
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
#!/bin/sh | |
echo "Input first file, then Ctrl-D" | |
echo -n "> " | |
cat >old.txt | |
echo "Input second file, then Ctrl-D" | |
echo -n "> " | |
cat >new.txt |
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
package controllers | |
import play.api._ | |
import play.api.mvc._ | |
import play.api.db._ | |
import play.api.Play.current | |
import anorm._ | |
import java.sql._ | |
object Application extends Controller { |
OlderNewer