Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
// This file contains code on how to convert a string to lowercase at compile time. | |
// A large part of the imlementation was taken from http://stackoverflow.com/a/15912824/3161376 which solved the problems that I had in the old implementation. | |
// The string struct will hold our data | |
// The declaration of our string struct that will contain the character array | |
template<char... str> | |
struct string | |
{ | |
// The characters are immediately converted to lowercase when they are put in the array |
#include <SFML/Graphics.hpp> | |
#include <vector> | |
#include <iostream> | |
int main() { | |
sf::RenderWindow window(sf::VideoMode(640, 480), "Tile Culling"); | |
// our view | |
sf::View camera; |
#While this particular version takes files of the text on my followers and following pages, | |
#it can be easily modified to check a past list of followers against a more recent list - | |
#just replace following.txt with the "past followers" file and followers.txt with "present followers". | |
#encoding may be 'utf-8' depending on the type of files you are using | |
with open('following.txt', 'r', encoding = 'latin-1') as following_file: | |
with open('followers.txt', 'r', encoding = 'latin-1') as followers_file: | |
discrepancy = set(following_file).difference(followers_file) |
#include<cmath> | |
#include<iostream> | |
#include<climits> | |
using namespace std; | |
int Maximum_Sum_Subarray(int arr[],int n) //Overall Time Complexity O(n) | |
{ | |
int ans = A[0],sum = 0; | |
for(int i = 1;i < n; ++i) //Check if all are negative | |
ans = max(ans,arr[i]); |
#include <iostream> | |
#include <future> | |
using namespace std; | |
template <typename Fn, typename... Args> | |
auto do_async_with_log(ostream& os, Fn&& fn, Args&&... args) -> | |
future<decltype(fn(args...))> | |
{ | |
os << "[TID=" << this_thread::get_id() |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
#!/usr/bin/env python | |
""" | |
Very simple HTTP server in python (Updated for Python 3.7) | |
Usage: | |
./dummy-web-server.py -h | |
./dummy-web-server.py -l localhost -p 8000 | |
Send a GET request: |