Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="color:Links" content="#ba1820" />
<meta name="image:Background" content="" />
<meta name="if:Show People I Follow" content=""/>
<meta name="if:Show Tags" content="1" />
<meta name="if:Show Description" content="" />
<meta name="text:Disqus Shortname" content="" />
<meta name="text:Slogan" content="This is where your Slogan / Short Subtitle goes. Edit this at Customization Section" />
@projectxcappe
projectxcappe / AngryStockholdersViewController.h
Created September 6, 2011 16:57
Angry Stockholders iOS
//
// Angry_StockholdersViewController.h
// Angry Stockholders
//
// Created by Cassidy Pangell on 7/21/11.
//
#import <UIKit/UIKit.h>
@interface Angry_StockholdersViewController : UIViewController {
@projectxcappe
projectxcappe / sudoku2cnf.cpp
Created September 6, 2011 16:49
Sudoku to cnf solver
//Cass Pangell
//9.23.2008
//sudoku2cnf rewrite
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <string>
using namespace std;
@projectxcappe
projectxcappe / gist:1182236
Created August 30, 2011 22:08
with regression
//
// GOCustomView.m
// CustomViewExample
//
// Created by Cassidy Pangell on 8/26/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import "CPCustomView.h"
#include "math.h"
@projectxcappe
projectxcappe / CPCustomView.m
Created August 30, 2011 15:56
Multiple dynamic graphing
//
// GOCustomView.m
// CustomViewExample
//
// Created by Cassidy Pangell on 8/26/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import "CPCustomView.h"
#include "math.h"
//
// GOCustomView.m
// CustomViewExample
//
// Created by Cassidy Pangell on 8/26/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import "CPCustomView.h"
#include "math.h"
#import "CPCustomView.h"
#include "math.h"
#define LENGTH 250
#define HEIGHT 250
@implementation CPCustomView
@synthesize bgColor = _bgColor;
@synthesize MVO_D_Points = _MVO_D_Points;
@synthesize TCP_U_Points = _TCP_U_Points;
@synthesize TCP_D_Points = _TCP_D_Points;
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
[self.bgColor setFill];
NSUInteger count = [self.points count];
CGFloat prevValX;
CGFloat prevValY;
CGFloat deltaX = LENGTH / (count - 1);
// Draw a point (filled circle)
CGContextFillEllipseInRect(context, CGRectMake(xVal, yVal, 5, 5));
CGFloat red[4] = {1.0f, 0.0f, 0.0f, 1.0f};
CGContextSetFillColor(context, red);
//----- AXIS
CGFloat white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
CGContextSetStrokeColor(context, white);
CGContextBeginPath(context);
#import <UIKit/UIKit.h>
@interface GOCustomView : UIView {
NSMutableArray *xArr;
}
@property(nonatomic, retain) UIColor *bgColor;
@property (nonatomic,retain) NSMutableArray *xArr;