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 * from crime_scene_report | |
where date = '20180115' | |
and city = 'SQL City' | |
and type = 'murder'; | |
select id, name | |
from person | |
where address_street_name = 'Northwestern Dr' | |
group by address_street_name | |
having max(address_number); |
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
// appends an Untappd link to each of search results on SmakPiwa.pl site | |
const titles = Array.from(document.querySelectorAll('h3.abs-product-name')); | |
titles.forEach(title => { | |
const untappdLink = document.createElement('a'); | |
untappdLink.innerText = '[UT]'; | |
untappdLink.target = '_blank'; | |
const name = title.innerText.replace(/[^\S ]+/g, ' ').replace('(puszka)', '').replace(/\d+( ml)?/g, ''); | |
untappdLink.href = 'https://untappd.com/search?q=' + name.split(' ').join('+'); | |
title.appendChild(untappdLink); | |
}); |
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
""" | |
https://github.com/qofnaught/wykop_wyzwaniepython/tree/master/edycja1 | |
Otrzymujesz katalog zawierający 1000 plików o losowych nazwach które są wypełnione | |
3 losowymi znakami. Twoim zadaniem jest: | |
Wersja łatwa | |
- Odczytać rok i miesiąc modyfikacji pliku | |
- skopiowac wszystkie pliki z danego roku do do jednego katalogu a poźniej to samo dla miesięcy | |
Wersja trudna | |
- To co łatwa |
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 time | |
import copy | |
import os | |
import random | |
N = 20 | |
M = 20 | |
ALIVE = '#' |
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 string | |
import random | |
ALL_CHARS = string.ascii_letters + string.digits + string.punctuation | |
target = input('Enter your target text: ') | |
output_list = [] | |
for _ in target: |
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 re | |
n = int(input()) | |
for _ in range(n): | |
output = 'Neither' | |
line = str(input()) | |
match = re.match(r'^(\d{0,3})\.(\d{0,3})\.(\d{0,3})\.(\d{0,3})$', line) | |
if match is not None: |
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
#coding=utf-8 | |
import pyaudio | |
import wave | |
import time | |
from datetime import datetime | |
import sys | |
def main(): |
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
# Bailey-Borwein-Plouffe formula for calculating Pi | |
N = 15 | |
def calculate_pi(): | |
pi = 0 | |
for k in range(0, N): | |
dividend = dividend_for_k(k) | |
divider = pow(16, k) | |
pi += dividend/divider |
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 unittest | |
def find_anagrams(list_of_strings, word): | |
anagrams = [] | |
for str_element in list_of_strings: | |
if len(word) == len(str_element): | |
list_of_chars = list(str_element) | |
for char in word: |
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 unittest | |
import re | |
def adjacent_digits_product(numb_str, digits_count): | |
max_product = 0 | |
numb_str = re.sub('[\s+]', '', numb_str) | |
for i in range(len(numb_str) - digits_count): | |
sub_str = numb_str[i:i+digits_count] |
NewerOlder