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
#!/usr/bin/python -tt | |
# MIT licensed by Abraham Williams - http://abrah.am | |
# Pulls your Facebook friends likes and interest and finds who you have the most in common with. | |
import urllib, json, sys | |
graph_url = 'https://graph.facebook.com/' | |
def print_intersect_count(access_token): | |
tally = {} |
/* | |
Copyright 2011 Martin Hawksey | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
// This example shows how to render pages that perform AJAX calls | |
// upon page load. | |
// | |
// Instead of waiting a fixed amount of time before doing the render, | |
// we are keeping track of every resource that is loaded. | |
// | |
// Once all resources are loaded, we wait a small amount of time | |
// (resourceWait) in case these resources load other resources. | |
// | |
// The page is rendered after a maximum amount of time (maxRenderTime) |
<?php | |
class FacebookAPI | |
{ | |
protected $_token; | |
public function __construct($token) | |
{ | |
$this->_token = $token; | |
} |
/* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
*/ | |
#include <arpa/inet.h> | |
#include <linux/if_packet.h> | |
#include <stdio.h> |
#!/bin/bash -e | |
# opinionated Flask bootstrap script | |
# assumes you'll be using MySQL/PG, Fabric, Webassets, WTForms and Blueprints | |
# creates a virtualenv and an Alembic migrations system | |
# The script will halt on any error, and remove the project dir, if it created one | |
# accepts a single argument: a new directory name under which to create the project | |
# check that Python is installed | |
type python >/dev/null 2>&1 || { echo >&2 "Python doesn't appear to be installed. Aborting."; exit 1; } |
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 |
#include <stdio.h> | |
#include <WinSock2.h> | |
#include <MSWSock.h> | |
#include <WS2tcpip.h> | |
#pragma comment(lib, "Ws2_32.lib") | |
struct mswsock_s { | |
LPFN_CONNECTEX ConnectEx; | |
} mswsock; |
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
package com.github.super8.fragments; | |
import android.os.Bundle; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.AdapterView; | |
import android.widget.GridView; | |
import com.github.super8.R; |