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 class TextColorTerm { | |
static final int RESET = 0; | |
static final int BRIGHT = 1; | |
static final int DIM = 2; | |
static final int UNDERLINE = 3; | |
static final int BLINK = 4; | |
static final int REVERSE = 7; | |
static final int HIDDEN = 8; | |
static final int BLACK = 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
Construct some objects: | |
Constructor 1 | |
Constructor 2 | |
Constructor 3 | |
Do some assignment: | |
Assignment of Foo#1 to Foo#3 | |
Copy-constructor? | |
Copy Constructor Foo#4 from Foo#2 |
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
// For Linux, NOT CROSS-PLATFORM | |
#include <GL/glut.h> | |
#include <SOIL/SOIL.h> | |
#include <iostream> | |
GLuint texImg; | |
int loadedImageWidth; | |
int loadedImageHeight; | |
unsigned char *loadedImageData; |
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
// For Linux, NOT CROSS-PLATFORM | |
#include <GL/glew.h> | |
#include <GL/glut.h> | |
#include <SOIL/SOIL.h> | |
#include <cstdio> | |
#include <iostream> | |
using namespace std; | |
GLuint texImg; |
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
private static Map mapFromJSON(String json) throws ScriptException{ | |
ScriptEngineManager factory = new ScriptEngineManager(); | |
ScriptEngine engine = factory.getEngineByName("JavaScript"); | |
engine.eval("var s = " + json); | |
return ((Map)engine.eval("s;")); | |
} |
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 <stdio.h> | |
#import <Foundation/Foundation.h> | |
@interface Foo : NSObject | |
- (void)foo; | |
@end | |
@implementation Foo | |
- (void) foo { | |
printf("hello\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
#import <stdio.h> | |
#import <Foundation/Foundation.h> | |
@interface Foo : NSObject | |
- (void)foo; | |
@end | |
@implementation Foo | |
+ (void) initialize { |
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
cmake_minimum_required(VERSION 2.8) | |
PROJECT(myeditor) | |
FIND_PACKAGE(Qt4 REQUIRED) | |
SET(CMAKE_EXPORT_COMPILE_COMMANDS ON) | |
SET(myeditor_SOURCES main.cpp MyEditor.cpp) | |
SET(myeditor_HEADERS MyEditor.h) | |
SET(myeditor_RESOURCES myeditor.qrc) |
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 "foo.h" | |
@interface Foo (foobar) | |
- (void) foo; | |
- (void) bar; | |
@end |
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 sg.nus.edu.cs2020.scratch; | |
import java.util.*; | |
// In class I forgot to put the generics as part of Tree. | |
// (And so my code was wrong -- exposing TreeNode to outside of Tree is 'bad'). | |
// This is how you might do that: | |
public class Tree<T extends Comparable<T>> extends TreeBase<T> { | |
@Override |
OlderNewer