Skip to content

Instantly share code, notes, and snippets.

View nhatminhbui's full-sized avatar
🤤
Chaos

Nhat Bui nhatminhbui

🤤
Chaos
View GitHub Profile
from flask import Flask, render_template, request, jsonify
from flask_cors import CORS, cross_origin
import highlighter
from mycalendar import main as calendar_main
import palette
from urllib.request import urlopen
app = Flask(__name__)
@nhatminhbui
nhatminhbui / check.py
Last active September 13, 2022 08:38
check.py
def check(A, r, c):
"""
ARGs:
- tick position
RETURN:
boolean
"""
global win_array
# row
cbw = c
def wins(player, A):
for case in [[0, 1, 2],
[3, 4, 5],
[6, 7, 8],
[0, 3, 6],
[1, 4, 7],
[2, 5, 8],
[0, 4, 8],
[2, 4, 6]]:
import bisect
class NFA(object):
EPSILON = object()
ANY = object()
def __init__(self, start_state):
self.transitions = {}
self.final_states = set()
self._start_state = start_state
import sys, time
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtCore import QRunnable, QThreadPool
from gui import Ui_MainWindow
from firebase import Firebase
class MainWindow(QMainWindow):
def __init__(self, led, humi, temp):
-- 1
SELECT mamh, tenmh, tclt, tcth
FROM Khoa JOIN Monhoc
ON (Khoa.makhoa = Monhoc.makhoa)
WHERE tenkhoa = N'Ngoại ngữ';
-- 2
SELECT *
FROM Monhoc
WHERE tclt > tcth;
#include <stdio.h>
void PrintASCII() {
for(int i = 0; i < 256; ++i){
printf("%d %c\n", i, i);
}
}
int SumOdd(int n) {
// 1 3 5 7... 2n+1
// Online C compiler to run C program online
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
struct node {
int info;
struct node* left;
struct node* right;
};
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
char Lowercase(char c) {
// A to Z only
char uppercase = (int)c;
if (uppercase >= 65 && uppercase <= 90) uppercase += 32;
return uppercase; //printf("%c")
}
#include <stdio.h>
const float pi = 3.14;
void ToChar(int); // 6a
void GetOrder(char); // 6b
void AreaVolumnGlob(float); // 7
void Power(int); // 8
void HourMinSec(unsigned int); // 9
void SumAllDigit(unsigned int); //10