Skip to content

Instantly share code, notes, and snippets.

@jittat
jittat / demo1.lean
Created July 5, 2022 01:01
demo1 for LEAN
-- Mostly taken from Xena project at
-- https://github.com/ImperialCollegeLondon/M40001_lean/blob/master/src/2021/logic/README.md
import tactic -- imports all the Lean tactics
variables (P Q R W S: Prop)
/-
## Tactics:

Keybase proof

I hereby claim:

  • I am jittat on github.
  • I am jittat (https://keybase.io/jittat) on keybase.
  • I have a public key ASB3KKWyANrRfJTIv5KCGWeqAn3f71jxzvLuDyyi5f57uAo

To claim this, I am signing this object:

@jittat
jittat / funfun1.ipynb
Created March 7, 2019 07:53
fun python example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class Box:
def __init__(self,r,c,board):
self.r = r
self.c = c
self.board = board
class Player:
def __init__(self,r,c,board):
self.r = r
self.c = c
class Box:
def __init__(self,r,c,board):
self.r = r
self.c = c
self.board = board
class Player:
def __init__(self,r,c,board):
self.r = r
self.c = c
@jittat
jittat / sokoban.py
Last active February 22, 2019 05:55
Sokoban template
class Box:
def __init__(self,r,c,board):
pass
class Player:
def __init__(self,r,c,board):
pass
def move_up(self):
pass
@jittat
jittat / pepmass.ipynb
Created February 12, 2019 06:01
Pep mass
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def extract_line(line):
"""
>>> extract_line("* hello world")
('hello world', 1)
>>> extract_line("** this is a ** test!!")
('this is a ** test!!', 2)
"""
depth = 0
l = len(line)
while (depth < l) and (line[depth] == '*'):
@jittat
jittat / classlist.py
Created July 21, 2014 19:50
Load student lists from all sections from regis.ku.ac.th
import sys
import getpass
import requests
import codecs
from bs4 import BeautifulSoup
CAMPUS = 'B'
def login(username, password):
logindata = { 'UserName': username,
@jittat
jittat / lcs_len_th.py
Created February 28, 2013 04:21
This code calculates the length of the LCS between two strings. It also deals with Thai digits and roman digits.
def to_roman(a):
if a >= '๐' and a <= '๙':
return chr(ord(a) - ord('๐') + ord('0'))
return a
def is_same_digit(a,b):
if a < '0' and a > '9':
return False
aa = to_roman(a)