Skip to content

Instantly share code, notes, and snippets.

Kotaro Terada kotarot

View GitHub Profile
@kotarot
kotarot / count_tree_nodes_3.py
Last active Oct 15, 2015
For my blog article "Fewest moves vs God's number" http://www.terabo.net/blog/fmc-vs-gods-number/
View count_tree_nodes_3.py
#!/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)
@kotarot
kotarot / count_tree_nodes_2.py
Last active Oct 15, 2015
For my blog article "Fewest moves vs God's number" http://www.terabo.net/blog/fmc-vs-gods-number/
View count_tree_nodes_2.py
#!/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)
@kotarot
kotarot / count_tree_nodes_1.py
Last active Oct 15, 2015
For my blog article "Fewest moves vs God's number" http://www.terabo.net/blog/fmc-vs-gods-number/
View count_tree_nodes_1.py
#!/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)
@kotarot
kotarot / wca_my_record.php
Created Mar 8, 2015
Getting personal records from WCA database. This file is for my blog article at: http://www.terabo.net/blog/practical-wcadb/
View wca_my_record.php
<?php
// DB connection
try {
$pdo = new PDO(
'mysql:dbname=xxxx;host=localhost;charset=utf8',
'xxxx',
'xxxxxxxx',
$options = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
@kotarot
kotarot / wcadb_example.php
Created Dec 7, 2014
For my blog article.
View wcadb_example.php
<?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);
@kotarot
kotarot / wca_importer.php
Last active Jun 21, 2016
A simple automatic WCA database importer. ** Newer version: https://github.com/kotarot/wca-importer ** This file is for my blog article at: http://www.terabo.net/blog/import-wcadb-automatically/
View wca_importer.php
<?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', '********');
@kotarot
kotarot / MyFirstGist.txt
Last active Oct 9, 2015
This is my first gist.
View MyFirstGist.txt
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.
You can’t perform that action at this time.