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
numbers = [1e-15, 0.111111111111, 0.1, 12435.34314, 134341.33, 2423.11, 2423.1, 123124123.3, 0.123456789, -12.12313123, -0.111111111, -98.34, -98.3451] | |
[ 1e-15, | |
0.111111111111, | |
0.1, | |
12435.34314, | |
134341.33, | |
2423.11, | |
2423.1, | |
123124123.3, | |
0.123456789, |
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
QString letters = "AAAAAAAAABBCCDDDDEEEEEEEEEEEEFFGGGHHIIIIIIIIIJKLLLLMMNNNNNNOOOOOOOOPPQRRRRRRSSSSTTTTTTUUUUVVWWXYYZ"; | |
void genLetterCombinations(QString n, int k, QSet<QString> &combinations, QString soFar) { | |
if (soFar.length() == k) { | |
combinations.insert(soFar); | |
if (combinations.size() % 10000 == 0) { | |
qDebug() << "Combinations so far:" << combinations.size(); | |
} | |
return; | |
} |
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
{"number: 35} |
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
// Example use case for pushing a number to a widget | |
pushNumber("yourNumberStream", 14600); | |
// Example use case for pushing a location to a map widget | |
pushGeo("yourGeoStream", 37.8, -122.6); | |
// Or choose a color for your map point (red, blue, green, purple, and yellow only) | |
pushGeo("yourGeoStream", 37.8, -122.6, "blue"); | |
// Example use case for pushing a title and message to a text feed widget |
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
user nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
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
server { | |
listen 80; | |
rewrite ^(.*) https://beta.example.com$1 permanent; | |
} | |
server { | |
listen 443; | |
ssl on; | |
server_name www.example.com; | |
.... |
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 multiprocessing | |
bind = "127.0.0.1:8000" | |
#workers = multiprocessing.cpu_count() * 2 + 1 | |
workers = 3 | |
pidfile = "/home/ec2-user/Webolith/gunicorn.pid" | |
logfile = "/home/ec2-user/Webolith/gunicorn.log" | |
worker_class = "sync" | |
timeout = 30 | |
#daemon = True |
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 initializeByUserList(self, file, lex, user, secs): | |
# returns a table number | |
t1 = time.time() | |
lineNumber = 0 | |
alphaSet = set() | |
for line in file: | |
word = line.strip() | |
if len(word) > 15 or len(word) < 2: | |
return 0 | |
lineNumber += 1 |
NewerOlder