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 io import BufferedReader, StringIO, UnsupportedOperation | |
# Because this is a read-only stream, write methods raise an exception. | |
class BufferedStringReader: | |
def __init__(self, string, name, mode): | |
if mode != 'rb' and mode != 'br': | |
raise ValueError("invalid mode: " + mode) | |
self.reader = open(name, mode) | |
self.stringio = StringIO(string) | |
self.string = string |
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 | |
#++++++++ 1 | |
No_man = ['________', | |
'| |', | |
'| ', | |
'| ', | |
'| ', | |
'| ', | |
'| '] |
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
#!/bin/python3 | |
import math | |
import os | |
import random | |
import re | |
import sys | |
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
#define BOOST_TEST_MODULE paintColor | |
#include <boost/test/included/unit_test.hpp> | |
using namespace std; | |
void colorpaint_test_function( string s, string out, vector<float> expected ) | |
{ | |
cout << out << endl << "=========" << endl; | |
vector<float> v = paintColor(s); // paintColor() defined elsewhere | |
copy(v.begin(), v.end(), ostream_iterator<float>(cout, " ")); | |
cout << endl; |
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
╔██╗╔██╗╔██╗ ╔██╗╔██╗╔██╗ ╔███████╗ ╔███╗ ╔████╗ | |
║██║║██║║██║╔████████████╗╔██╔██╔══╝╔██╗ ╔███╔╝ ╔██╔╗██ | |
║██║╚══╝╚══╝╚╗██╗╔██╗╔██╔╝╚╗██████╗ ╚══╝╔███╔╝ ╚╗████╝╔█╗ | |
╚══╝ ╔████████████╗ ╚═╗██╗██╗ ╔███╔╝╔██╗╔██╔╗███╔╝ | |
╔██╗ ╚╗██╔╗██╔╗██╔╝╔███████╔╝ ╔███╔╝ ╚══╝╚╗███████╗ | |
╚══╝ ╚══╝╚══╝╚══╝ ╚═══════╝ ╚═══╝ ╚═══════╝ | |
╔███╗ ╔████╗╔████╗ ╔██╔██╗ ╔██╗ ╔███╗ | |
║███║╔██╔══╝╚══╗██╗╔███████╗╔██████╗ ╔███╔╝ | |
╚═══╝║██║ ║██║╚╗██╔██╔╝╚═╗██╔═╝ ╔█████╗ ╔███╔╝ | |
║██║ ║██║ ╚══╝╚═╝ ╚══╝ ╔█╗╚═════╝ ╔███╔╝ |
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 <QtWidgets> | |
#include <iostream> | |
#include <cstdlib> | |
// extern "C" prevents linker errors when using this in a C++ program. | |
// Remove 'extern "C" {' if putting this in a C program. | |
extern "C" { | |
#include <libavcodec/avcodec.h> | |
#include <libavformat/avformat.h> | |
#include <libswscale/swscale.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 json | |
import os | |
import glob | |
import ntpath | |
mp4path_dir = "/directory/path" # No trailing slash please | |
actual_json = json.load(open('path to json file')) | |
os.chdir(mp4path_dir) |
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 . -name 'index.html*' -exec grep -H 'STRING' {} \; |
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
componentDidMount() { | |
// Other initialization... | |
// IMPORTANT: Put this after "document.body.classList.toggle" | |
let hash = this.props.location.hash.replace('#', ''); | |
if (hash) { | |
let node = ReactDOM.findDOMNode(this.refs[hash]); | |
if (node) { | |
node.scrollIntoView(); | |
} | |
} |
OlderNewer