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
#pragma once | |
#include "Audio.h" | |
Audio::Audio(std::string str) { | |
if (str.substr(str.size() - 4) != ".wav") | |
throw std::invalid_argument("Can only read WAV files!"); | |
load_wav(str); | |
} |
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
/** | |
* Create a class that uses the builder pattern and only allows the 'send' method to be called only | |
* when both setUrl and setMethod have been called before it (in any order) | |
*/ | |
interface WithUrl { | |
getUrl(): string; | |
setMethod(method: string): ReadyToSend; | |
} |
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 <iostream> | |
#include <bitset> | |
#include <cmath> | |
using namespace std; | |
int main(){ | |
const int sieve_size = 1024; | |
bitset<sieve_size> sieve; | |
sieve.flip(); |
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 <cstdio> | |
#define min(a, b) a < b ? a : b | |
using namespace std; | |
template<typename lt = long, typename sz = size_t> | |
struct MCMF { | |
static constexpr lt INF = 1e9; | |
static constexpr lt MAX_NODES = 1e6 + 5; |
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 <limits> | |
#define min(a, b) a < b ? a : b | |
using namespace std; | |
// note - only works with positive flows | |
// for negative flows just add to make positive | |
template<typename lt = long, typename sz = size_t> | |
struct Dinic { |
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
#ifndef JSONLIB_H | |
#define JSONLIB_H | |
#include <iostream> | |
#include <cctype> | |
#include <unordered_map> | |
#include <sstream> | |
#include <memory> | |
#include <type_traits> | |
#include <iterator> |
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
version: "3.4" | |
services: | |
pgAdmin: | |
restart: always | |
image: dpage/pgadmin4 | |
container_name: "pgadmin" | |
ports: | |
- "8000:80" |
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
#ifndef PARSER_H | |
#define PARSER_H | |
#include <iostream> | |
#include <string> | |
#include <curl/curl.h> | |
#include <jsoncpp/json/json.h> | |
#include <jsoncpp/json/reader.h> | |
#include <jsoncpp/json/writer.h> |
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 | |
from bs4 import BeautifulSoup | |
import sys | |
import os | |
template = """#include <bits/stdc++.h> | |
using namespace std; | |
class Solution { |
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
<!DOCTYPE html> | |
<!-- Similar to: https://storage.googleapis.com/spec-host-backup/mio-design%2Fassets%2F1eZNTdj8h1J0BFkbl23LyzEwjjvMzY_uV%2Fcards-elements-2b.png --> | |
<html> | |
<style> | |
body { | |
font-family: 'Roboto', sans-serif; | |
} | |
.row-container { | |
display: flex; | |
flex-direction: row; |
NewerOlder