This file contains hidden or 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 http = require('http'); | |
var uparse = require('url').parse; | |
http.createServer(function ({url}, res) { | |
const {headerCharset, responseText, htmlCharset} = uparse(url, true).query; | |
const ctype = 'text/html' + (headerCharset ? '; charset=' + headerCharset : ''); | |
res.writeHead(200, {'Content-Type': ctype}); | |
const meta = htmlCharset ? `<meta charset="${htmlCharset}">` : ``; | |
res.end(`<!doctype html> | |
<html> |
This file contains hidden or 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 Data.Maybe | |
import Data.List | |
import Data.Ord | |
data DicTrie = DicTrie [(Char, DicTrie)] deriving Show | |
emptyTrie = DicTrie [] | |
mainDict = DicTrie [ | |
('e', DicTrie[ | |
('n', DicTrie[ |
This file contains hidden or 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
#!/usr/bin/env python3 | |
from collections import Counter | |
import numpy as np | |
import pickle | |
MAX_COUNTER_SIZE = 2**16 | |
MAX_SEQ_SIZE = 16 | |
MAX_SIMILARITY = .75 |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import pandas as pd | |
import numpy as np | |
import sys | |
import logging | |
def is_valid_line(line: bytes): | |
return line and b"SQLProxy" not in line and b"P2_COD" not in line |
This file contains hidden or 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
#version: 0.2 | |
e s</w> | |
d e</w> | |
e n | |
a n | |
o n | |
t i | |
l e</w> | |
o u | |
e s |
This file contains hidden or 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
CREATE TABLE SUBJECT1 ( | |
NAME VARCHAR(100), | |
SURNAME VARCHAR(100), | |
CITY VARCHAR(100) | |
); | |
INSERT INTO SUBJECT1 | |
SELECT NAME, SURNAME, CITY | |
FROM SUBJECT | |
GROUP BY NAME, SURNAME, CITY; |
This file contains hidden or 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
package com.qwant.debouncer; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.ScheduledExecutorService; | |
import java.util.concurrent.TimeUnit; | |
import java.util.function.Function; |
This file contains hidden or 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
-- Employees and departments | |
CREATE TABLE EMPLOYEES(ID INTEGER, NAME VARCHAR, CHIEF_ID INTEGER, SALARY INTEGER, DEPARTMENT_ID INTEGER); | |
CREATE TABLE DEPARTMENTS(ID INTEGER, NAME VARCHAR); | |
INSERT INTO DEPARTMENTS VALUES (1, "DEP 1"), (2, "DEP 2"), (3, "DEP 3"); | |
INSERT INTO EMPLOYEES VALUES | |
(1,"Աշոտ",2,3000,1), | |
(2,"Ophir",NULL,2500,1), | |
(3,"Армен",1,4000,2); |
This file contains hidden or 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
#include <iostream> | |
using namespace std; | |
bool in(int x, int y, int x1, int x2, int y1, int y2){ | |
return x1<=x && x<=x2 | |
&& y1<=y && y<=y2; | |
} | |
int main() | |
{ |
This file contains hidden or 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
#include<iostream> | |
using namespace std; | |
unsigned int read_base2() { | |
int n=0; char c; | |
for(cin.get(c); c=='0'||c=='1'; cin.get(c)) n = (n<<1)|(c-'0'); | |
return n; | |
} | |
void write_base2(unsigned int n, bool first=true) { |