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
catch (Exception e) { | |
// meh | |
} |
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
public E peek () throws EmptyStackException { | |
if (empty()) | |
throw new EmptyStackException(); | |
return stack[top]; | |
} | |
public E pop () throws EmptyStackException { | |
if (empty()) | |
throw new EmptyStackException(); | |
E element = stack[top]; |
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
public E peek () throws EmptyStackException { | |
if (empty()) | |
throw new EmptyStackException(); | |
return stack[top]; | |
} | |
public E pop () throws EmptyStackException { | |
if (empty()) | |
throw new EmptyStackException(); | |
E element = stack[top]; |
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
/** | |
* Evaluates the command at the program counter. | |
*/ | |
public void eval() { | |
int currentInstruction = ram[counter.getModule()][counter.getIndex()]; | |
int tempA = 0x00000000; | |
int tempB = 0x00000000; | |
short address = 0x0000; |
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
import java.io.Serializable; | |
public interface Cerealizable extends Serializable { | |
// Mmm, delicious serial | |
} |
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
// compare this... | |
while (!instructionCompileStack.empty()) { | |
if (getReqArgs(instructionCompileStack.peek()) == 1) { | |
currentInstruction = Byte | |
.parseByte(instructionCompileStack.pop()); | |
currentAddress = Byte.parseByte(instructionCompileStack | |
.pop()); | |
engine.fillRAM(wordBuilder(currentInstruction, | |
currentAddress)); | |
} else if (getReqArgs(instructionCompileStack.peek()) == 0) { |
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
while (!filterQueue.empty()) { | |
// if we find a comment-closing character... | |
if (filterQueue.front().contains("(")) { | |
// ...pop until we find a comment character | |
while (!filterQueue.empty() | |
&& !filterQueue.front().contains(")")) { | |
filterQueue.dequeue(); | |
} | |
if (!filterQueue.empty()) | |
filterQueue.dequeue(); |
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
---- Minecraft Crash Report ---- | |
// This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~] | |
Time: 6/12/13 1:11 PM | |
Description: Failed to start game | |
java.lang.ArrayIndexOutOfBoundsException: 4 | |
at binnie.extrabees.genetics.EnumExtraBeeSpecies.registerItemIcons(EnumExtraBeeSpecies.java:1215) | |
at forestry.apiculture.items.ItemBeeGE.func_94581_a(ItemBeeGE.java:126) | |
at net.minecraft.client.renderer.texture.TextureMap.func_94247_b(TextureMap.java:85) |
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 <stdlib.h> | |
#include <string.h> | |
#include "MIPSCodeGen.h" | |
/* | |
* lineCount(): returns the number of lines in a file. | |
*/ | |
int lineCount (FILE *target) { |
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
/* | |
* Generates semi-optimizing moves for the MarsBot based on the next move and the current position. | |
* | |
* By semi-optimizing, I mean that relative moves are computed at compile-time rather than at runtime. | |
* This adds a little extra complexity to the code generation program (in that it has to track the | |
* MarsBot's current position), but significantly reduces the complexity of the resulting MIPS program, | |
* removing the necessity to do two memory-access operations (to get the MarsBot's navigational data) | |
* at runtime. | |
* | |
* This function outputs programmatically generated MIPS instructions to the destination file stream, |
OlderNewer