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
SELECT name, date, hall_id, COUNT(*) AS cnt | |
FROM meals | |
GROUP BY name, date, hall_id | |
HAVING COUNT(*) > 1; | |
SELECT * FROM meals | |
WHERE id NOT IN | |
( | |
SELECT MAX(id) | |
FROM meals |
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 requests | |
cookies = { | |
'_people_search_session': input('_people_search_session cookie: '), | |
} | |
headers = { | |
'X-CSRF-Token': input('X-CSRF-Token header: '), | |
} | |
params = { | |
'email': input('Email to look up: '), |
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
let runs = 0; | |
function clickShare() { | |
document.getElementsByClassName('wpO6b')[3].click(); | |
setTimeout(clickShareToDirect, 1000); | |
} | |
function clickShareToDirect() { | |
document.querySelector('._7UhW9.xLCgt.MMzan.KV-D4.fDxYl').click(); | |
setTimeout(clickRecipients, 3000); | |
} |
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
#lang racket | |
(define (all-numbers? lst) | |
(cond [(empty? lst) #t] | |
[(and (number? (car lst)) | |
(all-numbers? (cdr lst))) #t] | |
[else #f])) | |
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
#include <stdio.h> | |
int main() { | |
FILE* f = fopen("try.txt", "r"); | |
ungetc('c', f); | |
ungetc('b', f); | |
ungetc('a', f); | |
char c; | |
while ((c = fgetc(f)) != EOF) { | |
putchar(c); |
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
class Player | |
def should_shoot?(spaces) | |
spaces.each do |space| | |
if space.captive? | |
return false | |
elsif space.enemy? | |
return true | |
end | |
end | |
return false |
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 sort(array): | |
less = [] | |
equal = [] | |
greater = [] | |
if len(array) > 1: | |
pivot = array[0] | |
for x in array: | |
if x < pivot: | |
less.append(x) |
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 math | |
from queue import Queue | |
class Node: | |
def __init__(self, value: int, left=None, right=None): | |
self.value = value | |
self.left = left | |
self.right = right | |
def valid(self, minimum: int = -math.inf, maximum: int = math.inf): |
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
BASE = 10 | |
def find_sum(a, b): | |
res = '' | |
# Variable to store current sum while traversing strings | |
s = 0 | |
a_i = len(a) - 1 | |
b_i = len(b) - 1 | |
while a_i >= 0 or b_i >= 0 or s > 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
import math | |
class Node: | |
def __init__(self, value: int, left=None, right=None): | |
self.value = value | |
self.left = left | |
self.right = right | |
def valid(self, minimum: int = -math.inf, maximum: int = math.inf): | |
if not (minimum < self.value < maximum): |