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
This | |
This is | |
This is my | |
This is my first | |
This is my first gist. | |
This is very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long line. |
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
<?php | |
define('WCA_EXPORT_DIR', 'https://www.worldcubeassociation.org/results/misc/'); | |
define('WCA_EXPORT_HTML', 'export.html'); | |
define('MYSQL_HOST', 'localhost'); | |
define('MYSQL_USER', '********'); | |
define('MYSQL_PASS', '********'); | |
define('MYSQL_DB', '********'); |
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
<?php | |
// Definitions by the user. | |
define('MYSQL_HOST', 'localhost'); | |
define('MYSQL_USER', '********'); | |
define('MYSQL_PASS', '********'); | |
define('MYSQL_DB', '********'); | |
// DB connection without error handlings. | |
$link = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_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
<?php | |
// DB connection | |
try { | |
$pdo = new PDO( | |
'mysql:dbname=xxxx;host=localhost;charset=utf8', | |
'xxxx', | |
'xxxxxxxx', | |
$options = array( | |
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, |
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
#!/usr/bin/env python | |
""" | |
This scripts counts number of nodes | |
in 3x3x3 search tree (1) | |
http://www.terabo.net/blog/fmc-vs-gods-number/ | |
""" | |
ALL_POS = 43252003274489856000 | |
print 'All possible positions: {0:,d}'.format(ALL_POS) |
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
#!/usr/bin/env python | |
""" | |
This scripts counts number of nodes | |
in 3x3x3 search tree (2) | |
http://www.terabo.net/blog/fmc-vs-gods-number/ | |
""" | |
ALL_POS = 43252003274489856000 | |
print 'All possible positions: {0:,d}'.format(ALL_POS) |
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
#!/usr/bin/env python | |
""" | |
This scripts counts number of nodes | |
in 3x3x3 search tree (3) | |
http://www.terabo.net/blog/fmc-vs-gods-number/ | |
""" | |
ALL_POS = 43252003274489856000 | |
print 'All possible positions: {0:,d}'.format(ALL_POS) |
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
<body> | |
<p>A1</p> | |
<p>A1 foo foo foo foo</p> | |
<p>A1 foo foo foo foo <span>bar bar</span></p> | |
<div>A1 foo foo foo foo <a>A2 bar bar</a></div> | |
</body> |
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 <stdio.h> | |
#include <stdlib.h> | |
// Returns 1 if the given date exists, 0 if not. | |
// Ref: Leap year https://ja.wikipedia.org/wiki/%E9%96%8F%E5%B9%B4 | |
int is_correct_day(int y, int m, int d) { | |
if (m == 2) { | |
if (d > 29) { // d = 30,31 is incorrect | |
return 0; | |
} else if (d == 29) { |
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
# 長方形詰め込み | |
class TwoDimPackingClass: | |
""" | |
2次元パッキング問題 | |
ギロチンカットで元板からアイテムを切り出す(近似解法) | |
入力 | |
width, height: 元板の大きさ | |
items: アイテムの(横,縦)のリスト | |
出力 | |
容積率と入ったアイテムの(id,横,縦,x,y)のリスト |
OlderNewer