Skip to content

Instantly share code, notes, and snippets.

View nghiahsgs's full-sized avatar
🎯
Focusing

nghiahsgs nghiahsgs

🎯
Focusing
  • nghiahsgs
  • Việt Nam <3
View GitHub Profile
import random
def writeFile(fileName,kq):
f=open(fileName,mode='w')#, encoding='utf-8')
f.write(kq)
f.close()
# render 2D matrix
'''
N=1000
kq=''
all_tr=document.querySelector('tbody#container').querySelectorAll('tr.pe__metrics__row')
kq=''
all_tr.forEach(row=>{
kq+=row.querySelector('td').innerText+'\n'
})
console.log(kq)
var express = require("express");
var router = express.Router();
//load model
userModel = require("../model/user.model");
router.get("/", async function (req, res) {
let { _start, _end } = req.query;
_start = parseInt(_start);
_end = parseInt(_end);
'''
2. cho trước 2 số y, x (y > x). Bây h cần tăng x để đạt được giá trị bằng y. Có 2 cách thay đổi giá trị của x:
- tăng gấp đôi x
- bớt x đi 1 đơn vị
Tìm số bước nhỏ nhất để x = y.
'''
#cho so x va so y nguyen
# tim buoc toi thieu de x bang y
# x co 2 lua chon : nhan 2 or tru di 1 gia tri
import queue
class node:
def __init__(self, val, level):
self.val = val
self.level = level
def __str__(self):
return 'level: %s and val: %s'%(self.level,self.val)
#123456789
#chen dau + hoac dau tru hoac none de duoc ket qua la 100
# result: 12+3-4+5+67+8+9=100 || 123+45-67+8-9=100
import random
import numpy
def find_random_expression(L,list_operator,total_ref):
while(True):
total=0
def min(x,y):
if x<y:
return x
else:
return y
visit=set()
def minSteps(x,y):
if x == 0:
return 1000
import os
import zipfile
from selenium import webdriver
PROXY_HOST = '209.127.191.180' # rotating proxy
PROXY_PORT = 80
PROXY_USER = 'azdcylgo-dest'
PROXY_PASS = '7j8grsj3rkgz'
from peewee import *
from utils import *
import requests
import json
import datetime
# host='localhost'
# db_name = 'thaygiaoba'
# db_user='root'
# db_pass=''
find ./ -maxdepth 1 -type f -name "*.jpg" -print0 | sort -z -R | head -z -n 100 | xargs -0 rm