Skip to content

Instantly share code, notes, and snippets.

View vutuanhai237's full-sized avatar
🐷
Always available

Vu Tuan Hai vutuanhai237

🐷
Always available
View GitHub Profile
import sys
sys.path.insert(..)
@vutuanhai237
vutuanhai237 / SolveTriangle.mw
Created July 30, 2023 03:33
Solve any triangle problem
<?xml version="1.0" encoding="UTF-8"?>
<Worksheet>
<Version major="2023" minor="1"/>
<Label-Scheme value="2" prefix=""/>
<View-Properties presentation="true" autoexpanding_sections="true" UserProfileName="Maple Default Profile" NumericFormat-ApplyInteger="true" NumericFormat-ApplyRational="true" NumericFormat-ApplyExponent="false" editable="true">
</View-Properties>
<MapleNet-Properties prettyprint="3" warnlevel="3" compactdisplay="false" preplot="" helpbrowser="standard" displayprecision="-1" echo="1" scientificx="true" unitattributes="&quot;fontweight&quot; = &quot;bold&quot;" imaginaryunit="I" longdelim="true" elisiontermsthreshold="10000" elisiondigitsafter="100" elisiondigitsbefore="100" plotdevice="inline" errorbreak="1" plotoptions="" plotdriver="opengl" quiet="false" elisiontermsbefore="100" elisiontermsafter="100" historytimestamp="false" screenwidth="79" indentamount="4" plotoutput="terminal" screenpixelheight="900" rtablesize="[10, 10]" useclientjvm="true" format="document" labelwidth="20" postplot
-- command.sh
while read -r com;
do
$com;
$echo $com
done < commands.txt
cmd /k
-- gen.py
import pandas as pd
from unidecode import unidecode
#include <iostream>
using namespace std;
class Chai {
public:
virtual void Nhap() = 0;
virtual float TinhDienTich() = 0;
virtual float TinhTheTich() = 0;
};
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
class TestPer {
Person p = new Person("Aidan", "Burke");
@Test
public void testGetFullName() {
assertEquals("Aidan Burke", p.getFullName());
public class Person {
private String firstName;
private String lastName;
public Person(String firstName, String lastName) {
if (firstName == null && lastName == null) {
throw new IllegalArgumentException("Both names cannot be null");
}
this.firstName = firstName;
this.lastName = lastName;
}
#include <iostream>
using namespace std;
static int TongSoSP = 0;
static int TongSoNLV = 0;
class NhanVien {
public:
string HoTen;
@vutuanhai237
vutuanhai237 / KnuthUpArrow.txt
Created March 19, 2022 15:31
Knuth Up Arrow
#include <iostream>
#include <math.h>
using namespace std;
long long KnuthUpArrow(int a, int n, int b)
{
if(n == 1)
return pow(a,b);
if(b == 0)
return 1;
import qiskit
import numpy as np
def cf(qc: qiskit.QuantumCircuit, theta: float, qubit1: int, qubit2: int):
"""Add Controlled-F gate to quantum circuit
Args:
qc (qiskit.QuantumCircuit): Added circuit
theta (float): = arccos(1/sqrt(num_qubits), base on number of qubit
qubit1 (int): control qubit
qubit2 (int): target qubit
@vutuanhai237
vutuanhai237 / craw.py
Last active October 8, 2020 14:22
Craw face images on https://thispersondoesnotexist.com by Selenium
import urllib.request
from PIL import Image
from selenium import webdriver
driver = webdriver.Firefox(executable_path=r'C:\Users\haime\Downloads\geckodriver-v0.27.0-win64\geckodriver.exe')
def craw(driver, url):
driver.get(url)
opener = urllib.request.build_opener()
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
urllib.request.install_opener(opener)