This file contains hidden or 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
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <style> | |
| body { | |
| font: 10px sans-serif; | |
| } | |
| .axis path, | |
| .axis line { |
This file contains hidden or 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
| var path = require('path') | |
| var webpack = require('webpack') | |
| module.exports = { | |
| entry: "./index.js", | |
| output: { | |
| path: __dirname, | |
| filename: "build.js" | |
| }, |
This file contains hidden or 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
| from math import sqrt, sin | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| d = 0.8 | |
| data = [] | |
| x_values = [] | |
| theta_values = [] | |
| n_values = [] |
This file contains hidden or 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
| def flatten(my_list): | |
| for a in my_list: | |
| if not a: | |
| continue | |
| for b in a: | |
| yield b | |
This file contains hidden or 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 time | |
| file_name = 'my_file.{}'.format(time.time()) | |
| with open(file_name, 'w') as outfile: | |
| outfile.write('hello') | |
This file contains hidden or 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 time | |
| string_to_add = 'my_new_characters' | |
| file_name = 'my_file.{}'.format(time.time()) | |
| file_name = '{}{}'.format(file_name, string_to_add) | |
| with open(file_name, 'w') as outfile: | |
| outfile.write('hello') | |
This file contains hidden or 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
| >>> line = '\something' | |
| >>> line | |
| '\\something' | |
| >>> line.startswith('\some') | |
| True | |
| >>> line.startswith('\\some') | |
| True |
This file contains hidden or 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 chess, sys | |
| import chess.svg | |
| # Install python-chess to your Python3 virtualenv | |
| # virtualenv -p python3 ~/path/to/myvenv | |
| # source /path/to/myvenv/bin/activate | |
| # Usage: python3 fen-to-svg.py 'myfenstring' outputfilename | |
| # or /path/to/myvenv/bin/python3 fen-to-svg.py 'myfenstring' outputfilename | |
| fen = sys.argv[1] | |
| file_name = '{}.svg'.format(sys.argv[2]) |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <style> | |
| body { | |
| font: 10px sans-serif; | |
| } | |
| .axis path, | |
| .axis line { |
This file contains hidden or 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
| python -c 'import sys; print(sys.path)' |