This file contains hidden or 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 Course < ActiveRecord::Base | |
mount_uploader :CourseData, CourseDataUploader | |
validates :year, :name, :teacher, :grade, :category, :grade_id, :semester_id, :presence => true | |
validates :CourseData, :presence => true | |
belongs_to :grade | |
belongs_to :semester |
This file contains hidden or 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
There is a Javascript interpreter in the JavaScriptCore framework that comes with OS X. The interpreter is called jsc and can be found at the following path: | |
/System/Library/Frameworks/JavaScriptCore.framework/Resources/jsc | |
There is a built-in function, quit(), which will exit interactive mode. | |
If you want to make it easier to use I suggest creating a symlink to a location in your path, e.g.: | |
sudo ln -s /System/Library/Frameworks/JavaScriptCore.framework/Resources/jsc /usr/bin |
This file contains hidden or 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
Download Link: | |
http://www.adakoda.com/adakoda/android/asm/ | |
termainl: | |
brew install android-sdk | |
android update sdk --no-ui --filter 'platform-tools' | |
java -jar asm.jar |
This file contains hidden or 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
Re: How to compile OpenCL example in GCC? | |
Precisely, the kernel compilation in OpenCL is make in running time (library call). | |
In Gcc, for compilation, you only need the headers (aviables on Kronos site). But for linkage, you have to install OpenCL compatible driver. | |
in the Makefile : | |
for Mac OSX : -framework OpenCL | |
for Linux : -lOpenCL |
This file contains hidden or 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 <iostream> | |
#include <fstream> | |
#include <pthread.h> | |
using namespace std; | |
//---------------------------------------------------- | |
/* Initialization */ | |
//---------------------------------------------------- | |
string filename[4]={"testdata1.txt", |
This file contains hidden or 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
g++ <your_file.c> -framework GLUT -framework OpenGL |
This file contains hidden or 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
g++ m.cpp -o app `pkg-config --cflags --libs opencv` |
This file contains hidden or 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
# Ignore all | |
* | |
# Unignore all with extensions | |
!*.* | |
# Unignore all dirs | |
!*/ | |
### Above combination will ignore all files without extension ### |
This file contains hidden or 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
### INSTALLATION NOTES ### | |
# 1. Install Homebrew (https://github.com/mxcl/homebrew) | |
# 2. brew install zsh | |
# 3. Install OhMyZsh (https://github.com/robbyrussell/oh-my-zsh) | |
# 4. brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace | |
# 5. Install iTerm2 | |
# 6. In iTerm2 preferences for your profile set: | |
# Character Encoding: Unicode (UTF-8) | |
# Report Terminal Type: xterm-256color | |
# 7. Put itunesartist and itunestrack into PATH |
This file contains hidden or 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
int* a = NULL; // Pointer to int, initialize to nothing. | |
int n; // Size needed for array | |
cin >> n; // Read in the size | |
a = new int[n]; // Allocate n ints and save ptr in a. | |
for (int i=0; i<n; i++) { | |
a[i] = 0; // Initialize all elements to zero. | |
} | |
. . . // Use a as a normal array | |
delete [] a; // When done, free memory pointed to by a. | |
a = NULL; // Clear a to prevent using invalid memory reference. |