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.c | |
// LinkedList-C | |
// | |
// Created by Ryan Breaker on 5/15/16. | |
// Copyright © 2016 Ryan Breaker. All rights reserved. | |
// | |
#include <stdio.h> | |
#include <stdlib.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
enum Command { | |
NEW_PERSON { | |
final char KEY = 'P'; | |
}, | |
ADD_FRIEND { | |
final char KEY = 'A'; | |
}, | |
UNFRIEND { | |
final char KEY = 'U'; | |
}, |
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
func isPrime(n: Int) -> Bool { | |
if n % 2 == 0 { | |
return false | |
} | |
for i in 3.stride(to: (n+1)/2, by: 2) { | |
if n % i == 0 { | |
return false | |
} | |
} |
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
/* | |
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. | |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
* | |
* This code is free software; you can redistribute it and/or modify it | |
* under the terms of the GNU General Public License version 2 only, as | |
* published by the Free Software Foundation. Oracle designates this | |
* particular file as subject to the "Classpath" exception as provided | |
* by Oracle in the LICENSE file that accompanied this code. | |
* |
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 | |
// cipher | |
// | |
// Created by Ryan Breaker on 3/14/16. | |
// Copyright © 2016 Ryan Breaker. All rights reserved. | |
// | |
#include <fstream> | |
#include <iostream> | |
#include <string> |
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> | |
void PrintShampooInstructions(int numCycles) { | |
if (numCycles < 1) { | |
printf("Too few.\n"); | |
return; | |
} | |
if (numCycles > 4) { | |
printf("Too many.\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
package csci242.assignments.stringhandler; | |
import org.junit.Before; | |
import org.junit.Test; | |
import static csci242.assignments.stringhandler.StringHandlerTestHelper.*; | |
import static org.junit.Assert.*; | |
/** | |
* Short description. |
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
class Vehicle {} | |
class Car extends Vehicle {} | |
ArrayList<Car> cAl = new ArrayList<>(); | |
void stuff(ArrayList<Vehicle> al) {} | |
stuff(cAl); // Mismatched type? |
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 <string.h> | |
char *replace_str(char *str, char *orig, char *rep) | |
{ | |
static char buffer[64]; | |
char *p; | |
// Is 'orig' even in 'str'? | |
if(!(p = strstr(str, orig))) |
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 <stdbool.h> | |
char board[3][3]; | |
char pieces[] = {'A', 'B', 'C', '1', '2', '3', 'a', 'b', 'c'}; | |
// | |
void initialSetup() |