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
SDL_Surface *load_image(std::string filename) { | |
SDL_Surface* loadedImage = NULL; | |
SDL_Surface* optimizedImage = NULL; | |
loadedImage = IMG_Load(filename.c_str()); | |
if (loadedImage != NULL) { | |
optimizedImage = SDL_DisplayFormat(loadedImage); | |
SDL_FreeSurface(loadedImage); | |
} |
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
pygame.image.load(filename).convert() |
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
# cache of http://download.zope.org/Zope2/index/2.13.19/versions.cfg | |
[buildout] | |
extends = http://download.zope.org/zopetoolkit/index/1.0.7/ztk-versions.cfg | |
versions = versions | |
[versions] | |
# Zope2-specific | |
Zope2 = 2.13.19 | |
AccessControl = 2.13.11 |
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
#grabFrame.py: | |
#!/usr/bin/env python | |
import time | |
import sys | |
import cv | |
import cv2 | |
cam = cv2.VideoCapture(-1) |
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
void main(){ | |
int a[1000]={ 0 }; | |
int z, m, y, sum_1, n; | |
z = m = y = sum_1 = 0; | |
a[0]= 1; | |
while(z != 1000){ | |
for(n = 0; n <= m; n++){ | |
a[n] = a[n] * 2 + y; |
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
#include<stdlib.h> | |
#include<stdio.h> | |
struct bin_tree { | |
long key, value; | |
struct bin_tree *right, *left; | |
}; | |
typedef struct bin_tree node; |
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
collatz = {1:1} | |
def Collatz(n): | |
global collatz | |
if not collatz.has_key(n): | |
if n%2 == 0: | |
collatz[n] = Collatz(n/2) + 1 | |
else: | |
collatz[n] = Collatz(3*n + 1) + 1 | |
return collatz[n] |
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
/* | |
* main.cpp | |
* | |
* Created on: Oct 23, 2013 | |
* Author: david | |
*/ | |
#include <iostream> | |
#include <map> | |
#include <stdio.h> |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(){ | |
unsigned int maxRecord = 0; | |
unsigned int upperBound = 1000000; | |
unsigned int chainLen[upperBound + 1]; | |
size_t x; |
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
private class DownloadWebPageTask extends AsyncTask<String, Void, String> { | |
@Override | |
protected String doInBackground(String... urls) { | |
String result = new String(); | |
try { | |
URL location = new URL(url); | |
URLConnection connection = location.openConnection(); | |
BufferedReader data = new BufferedReader(new InputStreamReader(connection.getInputStream())); | |
String line; | |
while ((line = data.readLine()) != null) { |
OlderNewer