Skip to content

Instantly share code, notes, and snippets.

View clholgat's full-sized avatar

Carson Holgate clholgat

View GitHub Profile
[carson@Monster MA437-RSA]$ git push origin master
fatal: remote error:
You can't push to git://github.com/clholgat/MA437-RSA.git
Use git@github.com:clholgat/MA437-RSA.git
#include <stdio.h>
#include <stdlib.h>
void genseq(int *a, int N, int P);
void numPairs(int *a, int *b, int P, int L);
int pairs = 0;
int M = 0;
int N = 0;
from datetime import datetime
def build_request_url(symbol, start_date, end_date):
"""
This function should take a stock symbol as a string
along with the start and end dates as Python dates
and return the yahoo csv download url.
"""
values = { 'symbol' : symbol,
@clholgat
clholgat / gist:866623
Created March 11, 2011 21:36
Error, this is with the full file
>>> from datetime import datetime
>>> import project
>>> project.build_request_url('IBM', datetime.today(), datetime.today())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "project.py", line 41, in build_request_url
'e' : end_date.day,
ValueError: unsupported format character '&' (0x26) at index 53
"""
This assignement will walk you through gathering data for a
pair of stocks and calculating the correlation between those stocks
using the daily returns.
Yahoo makes their historical stock data available in CSV format.
Below is the url for IBM stock data from Jan 1, 2010 to Dec 31, 2010.
http://ichart.finance.yahoo.com/table.csv?s=IBM&a=00&b=1&c=2010&d=11&e=31&f=2010&g=d&ignore=.csv
The data is returned in CSV (comma separated format) with the flowing columns:
#include <stdio.h>
int main(int argc, char *argv[]){
int zero = 0;
double zerof = 0.0;
double negZerof = -0.0;
if(zero == zerof){
printf("zero == zeof\n");
}else{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
AccountManager mgr = AccountManager.get(this);
Account[] accts = mgr.getAccountsByType("com.google");
final String[] items = new String[accts.length];
for(int i = 0; i < accts.length; i++){
items[i] = accts[i].name;
}
builder.setTitle("Choose Account To Log Into SilverBullet");
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
package silver_bullet.app;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
@clholgat
clholgat / EBNF
Created May 1, 2012 01:22
ice9 Spec
EBNF for ice9
All input is enclosed in quotes. This is meant to be taken literally.
Anything outside of quotes has a meta-meaning. For example,
{ exp }
means zero or more exp's. Whereas,
'{' exp '}'
@clholgat
clholgat / Error
Created November 14, 2012 02:37
Broken things
11-14 02:19:57.030: E/AndroidRuntime(1436): java.lang.NoClassDefFoundError: com.anompom.fanfictionreader.ViewStoryActivity