Skip to content

Instantly share code, notes, and snippets.

View chintanparikh's full-sized avatar
🎯
Focusing

Chintan Parikh chintanparikh

🎯
Focusing
View GitHub Profile
@chintanparikh
chintanparikh / Failing spec output
Created October 29, 2012 21:40
listings_controller_spec.rb
Failures:
1) ListingsController#create not logged in valid attributes it should behave like Unauthorized action
Failure/Error: it { should redirect_to new_user_session_path }
ActionController::RoutingError:
No route matches {:controller=>"listings", :action=>"create"}
Shared Example Group: "Unauthorized action" called from ./spec/controllers/listings_controller_spec.rb:52
# ./spec/controllers/listings_controller_spec.rb:48:in `block (3 levels) in <top (required)>'
# ./spec/support/authorization_support.rb:8:in `block (2 levels) in <top (required)>'
#include <stdio.h>
#include <stdlib.h>
struct node {
int data;
struct *node next;
};
void push(struct node** headRef, int data)
{
@chintanparikh
chintanparikh / Something.c
Created November 6, 2012 01:53
Something.c
#include <stdio.h>
#include <stdlib.h>
struct node {
unsigned long long int data;
struct node *next;
};
void push(struct node** headRef, unsigned long data)
{
$ ./3
NUM: 600851475143
Factor: 71, Num: 600851475143
NUM: 8462696833
Factor: 839, Num: 8462696833
NUM: 10086647
Factor: 1471, Num: 10086647
NUM: 6857
Factor: 6857, Num: 6857
NUM: 1
char* reverseString(char* string)
{
int i, j;
char reversed[sizeof(string)];
j = strlen(string);
for (i = strlen(string); i >= 0; i--)
{
reversed[j - i] = string[i];
}
@chintanparikh
chintanparikh / DisplayPanel.java
Created November 13, 2012 00:57
DisplayPanel.java
import java.awt.event.*;
import javax.swing.*;
import java.awt.Graphics;
public class DisplayPanel extends JPanel
{
private Tile[][] tiles;
private Creature[] creatures;
private Dungeon dungeon;
private Player player;
import java.awt.event.*;
import javax.swing.*;
import java.awt.Graphics;
public class DisplayPanel extends JPanel
{
private Tile[][] tiles;
private Creature[] creatures;
private Dungeon dungeon;
private Player player;
import java.awt.event.*;
import javax.swing.*;
import java.awt.Graphics;
public class DisplayPanel extends JPanel
{
private Tile[][] tiles;
private Creature[] creatures;
private Dungeon dungeon;
private Player player;
@chintanparikh
chintanparikh / Dungeon.java
Created November 13, 2012 04:52
Dungeon.java
import java.awt.event.KeyEvent;
import java.util.Random;
import java.awt.Point;
import javax.swing.JOptionPane;
import java.util.Timer;
import java.util.TimerTask;
/**
* In order to help learn course concepts, I worked on this homework with Chris Lewis,
* discussed homework topics and issues with Chris Lewis
import java.awt.event.KeyEvent;
import java.util.Random;
import java.awt.Point;
import javax.swing.JOptionPane;
import java.util.Timer;
import java.util.TimerTask;
/**
* In order to help learn course concepts, I worked on this homework with Chris Lewis,
* discussed homework topics and issues with Chris Lewis