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
require 'set' | |
require 'prime' | |
unless ARGV.size == 2 | |
puts "usage: #{__FILE__} letters max-word-length" | |
exit 1 | |
end | |
letters = ARGV[0].to_i | |
max_word_length = ARGV[1].to_i |
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
<?xml version="1.0"?> | |
<!DOCTYPE jml SYSTEM "file://jml.dtd"> | |
<jml version="1.2"> | |
<pattern> | |
<title>88888800888888008888880088889700888888008888970088888800888a86008888880088a86800888888008a86880088888800a86888008888880088b88500888888008b88580088888800b885880088888800a86a860088888800b8b5850088888800ab6a560088888800bbb55500</title> | |
<prop type="ball" mod="color={229,49,114};diam=8"/> | |
<prop type="ball" mod="color={146,91,154};diam=10"/> | |
<prop type="ball" mod="color={71,145,199};diam=12"/> | |
<prop type="ball" mod="color={25,177,166};diam=14"/> | |
<prop type="ball" mod="color={107,218,128};diam=16"/> |
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
lo=-20 | |
hi=90 | |
width=90 | |
left=-(width/2) | |
right=(width/2) | |
balls=6 | |
pos = [] | |
i = 0 |
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
rows = 24 | |
columns = 32 | |
blank = '.' | |
grid = Array.new(rows) { Array.new(columns) } | |
for row in 0..rows-1 | |
for column in 0..columns-1 | |
grid[row][column] = blank | |
end | |
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
xxd -b my-file | cut -d ' ' -f 2-7 | sed 's/ //g' | awk '{for (i=1;i<=NF;i++) a[$i]++} END{for (c in a) print c,a[c]}' FS="" |
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
private static String formatBytes(double bytes) { | |
int exp = (int) (Math.log(bytes) / Math.log(1024)); | |
return String.format("%.1f %c%s", bytes / Math.pow(1024, exp), "BKMGTPEZY".charAt(exp), bytes < 1024 ? "" : "B"); | |
} |
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
import cv2 | |
import numpy as np | |
linewidth = 1 | |
#h = 0 | |
linecolor = (255, 255, 255) | |
linetype = cv2.LINE_AA | |
def nothing(arg): pass |
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
1159 | 497 | 919 | 431 | 1293 | 958 | |
---|---|---|---|---|---|---|
1174 | 519 | 940 | 416 | 1276 | 985 | |
1190 | 538 | 962 | 404 | 1260 | 1006 | |
1209 | 552 | 984 | 395 | 1245 | 1021 | |
1229 | 562 | 1006 | 388 | 1230 | 1029 | |
1250 | 567 | 1028 | 384 | 1217 | 1032 | |
1274 | 569 | 1050 | 382 | 1204 | 1028 | |
1302 | 565 | 1073 | 383 | 1191 | 1018 | |
1333 | 557 | 1096 | 386 | 1179 | 1001 | |
1364 | 544 | 1120 | 392 | 1168 | 978 |
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
File.open('z.csv') do |file| | |
a=1 | |
fb = {} | |
puts 'b0x=[]; b0y=[]; b1x=[]; b1y=[]; b2x=[]; b2y=[]' | |
file.each do |line| | |
n = line.split(',') | |
b = [[n[0].to_i,n[1].to_i], [n[2].to_i,n[3].to_i], [n[4].to_i,n[5].to_i]] | |
sorted = [] |
NewerOlder