This file contains 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 random | |
def writeFile(fileName,kq): | |
f=open(fileName,mode='w')#, encoding='utf-8') | |
f.write(kq) | |
f.close() | |
# render 2D matrix | |
''' | |
N=1000 | |
kq='' |
This file contains 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
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) |
This file contains 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 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); |
This file contains 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
''' | |
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 |
This file contains 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 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) | |
This file contains 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
#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 |
This file contains 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 min(x,y): | |
if x<y: | |
return x | |
else: | |
return y | |
visit=set() | |
def minSteps(x,y): | |
if x == 0: | |
return 1000 |
This file contains 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 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' |
This file contains 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 peewee import * | |
from utils import * | |
import requests | |
import json | |
import datetime | |
# host='localhost' | |
# db_name = 'thaygiaoba' | |
# db_user='root' | |
# db_pass='' |
This file contains 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
find ./ -maxdepth 1 -type f -name "*.jpg" -print0 | sort -z -R | head -z -n 100 | xargs -0 rm |