This file contains hidden or 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
PROGRAM example | |
REAL enought,t,phi | |
WRITE(6,*)'Enter accelerating voltage in kV' | |
READ(5,*)enought | |
WRITE(6,*)'Enter sample thickness in Angstroms' | |
READ(5,*)t | |
WRITE(6,*)'Enter cone semi-angle in mrad' | |
READ(5,*)phi | |
CALL prec_2beam(enought,t,phi) |
This file contains hidden or 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
//Some necessary imports | |
import java.net.URLEncoder; | |
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
import org.apache.commons.codec.binary.Hex; | |
... | |
public static String generateTypekitPreviewSignature(String apiToken, String apiTokenPublicId, String host, long timeToExpire){ |
This file contains hidden or 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/sh | |
screen -X split | |
screen -X focus down | |
screen -X screen | |
COMMAND="call SetupScreen('$STY')" | |
screen -S "$STY" -p0 -X stuff "vim -c \"call SetupScreen('" | |
screen -S "$STY" -p0 -X stuff "$STY" | |
screen -S "$STY" -p0 -X stuff "')\"" | |
screen -S "$STY" -X focus up | |
screen -S "$STY" -p0 -X eval 'stuff "\015"' |
This file contains hidden or 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
*background: rgb:02/02/02 | |
*foreground: rgb:d6/d6/d6 | |
*color0: rgb:00/00/00 | |
*color1: rgb:98/56/5e | |
*color2: rgb:66/82/5d | |
*color3: rgb:96/91/76 | |
*color4: rgb:4d/65/85 | |
*color5: rgb:96/73/95 | |
*color6: rgb:5f/7f/7b | |
*color7: rgb:b3/b3/b3 |
This file contains hidden or 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 pymongo | |
import random | |
from collections import defaultdict | |
import time | |
import sys | |
from pymongo import Connection | |
connection = Connection() | |
connection.drop_database('test_db') | |
collection = connection['test_db']['testing'] |
This file contains hidden or 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
use test | |
var bytes = "iVBORw0KGgoAAAANSUhEUgAAAPoAAAA8CAYAAABPXaeUAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAD9lJR" | |
bytes += "EFUeNrsXVuMW8UZ/nfjTeyQ1N7AosQJWUNoqLgkRiQorQScIBUi9RLzBFKDcF5AVStlaQsvtMWRSqW2AowEQq1a4QgqlTcv8EDhAS" | |
bytes += "95SCSC8IZsICkhZ5MQmkuJN95kd7OXdP6z//GOx3Nu9vGxl51POtq1fTyeMzPf/NeZAVBQUFBQUFCY/+ho14pFfv1eL/uTYleSXQn" | |
bytes += "uoxK7CniNPf/AoOpCBYV5SHRG8PvYnwy7NBe3F9mVZYTfo7pSQWEeEJ0RPMr+5F0SXARK+BQj/IjqUgWFNiU6I/lGIrmhokfDIfjJ" | |
bytes += "7T3suh7uWdcNsUhX5d7hb8bgw2MX4O1DZ+GdoXMgqPSaUucVFNqQ6GSLowoew9fPPHAT/OKetVXktgKS/qn+IzzhFdkVFNqU6J+wP" | |
bytes += "0mU4u/+fBNsXL3ccxmvf3QannhziLfbNaXGKyjMobPFJH+2UZIjHt0cZ9+/y3yJXvo+1bUKCgFIdHKupejSTNWcQ5Fs8ti+J7fUTX" | |
bytes += "IeL384DE+/ddRU4RNKqisoNFGik6TW2ZUjosckt6HkjaFN7gfJEb+8t9dw3tHvpVX3Kig0QaKTYy1PJDawtjtseM/Ri74hvrzKyfb" | |
bytes += "hsW9q3msUWOa2Vz82NYYsTTQJvk4wG47DiSjPpH6/GgYKiujuSb6RCGRIb7S7UVqjlA0aW17YBwdPj7q9HQmPSTcvqeGgoIjubI/r" | |
bytes += "Jsk3xJfBm+kk9K6ItOShUKqPjE3VxODNz94+dA7e+Og0jIxPiT4DTLoZVsNCQRFdTvQPgDLakOToQfdTHW8GSmOT8MreE/Dce1 |
This file contains hidden or 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/sh | |
projectname=$1 | |
mkdir $projectname | |
mkdir $projectname/$projectname | |
mkdir -p $projectname/$projectname/templates | |
mkdir -p $projectname/$projectname/static | |
echo "#!/usr/bin/env python | |
from $projectname import app | |
app.debug = True | |
if __name__ == '__main__': |
This file contains hidden or 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 | |
from pymongo.objectid import ObjectId | |
from pymongo import json_util | |
from pymongo import Connection | |
db = Connection().newdb | |
items = list(db.spider.find()) | |
print json.dumps(items, default=json_util.default, sort_keys=True, indent=4) |
This file contains hidden or 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 handler(obj): | |
if hasattr(obj, 'isoformat'): | |
return obj.isoformat() | |
else: | |
raise TypeError, 'Object of type %s with value of %s is not JSON serializable' % (type(obj), repr(obj)) |
This file contains hidden or 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 code | |
code.interact(local=locals()) |
OlderNewer