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
;; This buffer is for notes you don't want to save, and for Lisp evaluation. | |
;; If you want to create a file, visit that file with C-x C-f, | |
;; then enter the text in that file's own buffer. | |
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
;; This buffer is for notes you don't want to save, and for Lisp evaluation. | |
;; If you want to create a file, visit that file with C-x C-f, | |
;; then enter the text in that file's own buffer. | |
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 <unistd.h> | |
#include <sys/mman.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#define CONSUMER_ERROR(msg) \ | |
do {perror("Consumer Error: " msg "\n"); exit(1); }while(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
foo |
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 <unistd.h> | |
#include <sys/mman.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#define CONSUMER_ERROR(msg) \ | |
do {perror("Consumer Error: " msg "\n"); exit(1); }while(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
class BaseOperator<T> implements IOperator<T> { | |
public T operate(T x, T y) {} | |
public boolean apply (Stack<T> stack) { | |
try { | |
T x = stack.pop(); | |
T y = stack.pop(); | |
} catch (EmptyStackException e) { | |
System.out.println("Stack has to few arguments, you cant operate on it."); |
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 BaseOperator<T> implements IOperator<T> { | |
public T operate(T x, T y) {} | |
public boolean apply (Stack<T> stack) { | |
try { | |
T x = stack.pop(); | |
T y = stack.pop(); | |
} catch (EmptyStackException e) { | |
System.out.println("Stack has to few arguments, you cant operate on it."); |
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.text.*; | |
import java.util.*; | |
// Calculator will only accept numbers of type T | |
// A calculator knows how to parse a given string | |
public class Calculator <T extends Number> { | |
Stack<T> st = new Stack<T>(); | |
List<IOperator<T>> operators = new LinkedList<IOperator<T>>(); | |
Calculator (List<IOperator<T>> ops) { |
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
(defun my-cc-newline-and-indent () | |
"If we are between braces (that were mos probably created by | |
electric-pairs) prepare for writing the body of something" | |
(interactive) | |
(if (and (looking-at "}") (looking-back "{")) | |
(progn (newline-and-indent) (newline-and-indent) (previous-line) (c-indent-line-or-region)) | |
(newline-and-indent))) |
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
abstract class NumberHandler implements ActionListener { | |
CalculatorGui gui; | |
int number; | |
public NumberHandler(CalculatorGui _gui, int num) { | |
gui = _gui; | |
number = num; | |
} | |
public void actionPerformed(ActionEvent e) { |