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 Post < ActiveRecord::Base | |
attr_accessible :body, :title, :tag_names | |
attr_reader :tag_names | |
has_many :taggings | |
has_many :tags, :through => :taggings | |
def tag_names=(tag_list) | |
tag_names = tag_list.gsub(/\s+/, "").split(",") | |
existing = self.tags.map {|t| t.name } |
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
package eu.geekproject; | |
import java.awt.BorderLayout; | |
import java.awt.Color; | |
import java.awt.Graphics; | |
import javax.swing.JFrame; | |
import javax.swing.JPanel; | |
/** | |
* Basic JPanel that draws a YinYang symbol. |
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
static void generateCodeCallStmt(Absyn *node, Table *table, Entry *currentMethod, | |
int returnLabel, int breakLabel) { | |
Absyn *rcvr = node->u.callStm.rcvr; | |
Absyn *args = node->u.callStm.args; | |
Sym *name = node->u.callStm.name; | |
Class *rcvrClass = node->u.callStm.rcvrClass; | |
Class *rcvrMetaClass = rcvrClass->metaClass; | |
Entry *methodEntry; | |
int offset; | |
int numParams; |
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
public class Main extends Object { | |
public static void main() { | |
local Integer x; | |
local Integer y; | |
x = 42.add(23); | |
y = 42.add(23); | |
System.writeInteger(x); | |
System.writeInteger(y); | |
} | |
} |
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
/* | |
* semant.c -- semantic analysis | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdbool.h> |
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
// Programm | |
void f(boolean b) { | |
local integer a1; | |
local integer a2; | |
if (b) { | |
a1 = 2; | |
a2 = 22; | |
} else { | |
a1 = 3; |
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
18 2 23 4 25 6 7 21 9 34 | |
36 0 0 0 0 0 0 0 0 16 | |
35 0 0 0 0 0 0 0 0 12 | |
10 0 0 0 0 0 0 0 0 27 | |
33 0 0 0 0 0 0 0 0 14 | |
15 0 0 0 0 0 0 0 0 32 | |
31 0 0 0 0 0 0 0 0 11 | |
30 0 0 0 0 0 0 0 0 17 | |
19 0 0 0 0 0 0 0 0 1 | |
28 13 26 3 24 5 22 8 20 29 |
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
// Generate random genes | |
ts.genes = make([]ga.Gene, ts.nGenes) | |
var proto = make([]int, ts.geneLength) | |
var i int = 0 | |
for key, _ := range coords { | |
proto[i] = key | |
i++ | |
} | |
// Initialize all len(genes) and shuffle |
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 <stdbool.h> | |
#include <stdio.h> | |
bool test = false; | |
int main(void) { | |
if(test) { | |
printf("Test is true"); | |
} | |
else { |
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
<?php | |
class CreateUsers extends ActiveRecord\Migration { | |
public function up() { | |
$this->create_table('users', array( | |
// <field> => array(<type>, <length>, <nullable>) | |
'name' => array('varchar', 12, FALSE), | |
'email' => array('varchar', 255, FALSE) | |
)); |