Skip to content

Instantly share code, notes, and snippets.

@projectxcappe
projectxcappe / viewcontroller.h
Created July 13, 2011 15:18
viewcontroller.h
//
// Wasted_SpaceViewController.h
// Wasted Space
//
// Created by Cassidy Pangell on 7/12/11.
// Copyright 2011 Circadence. All rights reserved.
//
#import <UIKit/UIKit.h>
-(void)showSplash {
UIViewController *modalViewController = [[UIViewController alloc] init];
modalViewController.view = modelView;
[self presentModalViewController:modalViewController animated:NO];
[self performSelector:@selector(hideSplash) withObject:nil afterDelay:1.0];
}
-(void)hideSplash{
[[self modalViewController] dismissModalViewControllerAnimated:YES];
}
#import <UIKit/UIKit.h>
@interface GOCustomView : UIView {
NSMutableArray *xArr;
}
@property(nonatomic, retain) UIColor *bgColor;
@property (nonatomic,retain) NSMutableArray *xArr;
// 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);
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
[self.bgColor setFill];
NSUInteger count = [self.points count];
CGFloat prevValX;
CGFloat prevValY;
CGFloat deltaX = LENGTH / (count - 1);
#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;
//
// 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"
@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 / 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;