Skip to content

Instantly share code, notes, and snippets.

@pvg
pvg / fl.py
Created August 28, 2017 15:55
from flask import Flask, render_template, request, url_for, redirect
app = Flask(__name__)
app.debug = True
@app.route('/input/')
def input():
return render_template("input.html")
@app.route('/input/', methods=["POST"])
from slackclient import SlackClient
import time
cl = SlackClient('secret')
if cl.rtm_connect():
cl.api_call('chat.postMessage', channel='#test', text='boo', as_user=True)
while True:
data = cl.rtm_read()
if (data and data[0]['type'] == 'message'):
status = cl.api_call('chat.delete',
from slackclient import SlackClient
import time
cl = SlackClient('xxxx')
if cl.rtm_connect():
cl.api_call('chat.postMessage', channel='#test', text='boo', as_user=True)
while True:
data = cl.rtm_read()
if (data and data[0]['type'] == 'message'):
status = cl.api_call('chat.delete',
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1504.82">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Times; color: #000000}
<!DOCTYPE html>
<html>
<head><meta charset="utf-8"/></head>
<body>
<script>
function wait() {
// I know this is obsolete
var ms = 3000 + new Date().getTime();
while(ms > new Date()) {}
console.log("3 Seconds Are Over");
for (j = 0; j < ARRAY_SIZE; j += 20) {
double sum0 = array[j] + array[j+1] + array[j+2] + array[j+3] + array[j+4];
double sum1 = array[j+5] + array[j+6] + array[j+7] + array[j+8] + array[j+9];
double sum2 = array[j+10] + array[j+11] + array[j+12] + array[j+13] + array[j+14];
double sum3 = array[j+15] + array[j+16] + array[j+17] + array[j+18] + array[j+19];
sum += sum0 + sum1 + sum2 +sum3;
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Line # Mem usage Increment Line Contents
================================================
10 15.074 MiB 0.000 MiB @profile
11 def ztest(r):
12 43.652 MiB 28.578 MiB firstColumn = tuple(zip(*r))[0]
13 43.652 MiB 0.000 MiB return firstColumn
Filename: ziptest.py
import sqlite3
import timeit
def fetch():
con = sqlite3.connect('chinook.sqlite')
c = con.cursor()
c.execute('select * from Track')
return c.fetchall()
def ztest(r):