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
require("thread") | |
class Foo | |
def initialize(arr) | |
@arr = arr | |
end | |
def update | |
i = @arr[-1] | |
@arr.push(i + 1) |
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 Control.Monad.State | |
import Data.Foldable | |
import Text.Read | |
import Control.Applicative | |
import System.IO | |
data Regs = Regs { | |
ax::Int, | |
cx::Int, | |
dx::Int, |
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 Def | |
class DataContainer | |
def initialize(name) | |
@name = name | |
@members = [] | |
@last_constructor = nil | |
Object.const_set(name, self) | |
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
use std::cell::{RefCell}; | |
/**************************************** | |
* Abstractions | |
*/ | |
trait Task { | |
fn get_name(&self) -> String; | |
fn get_description(&self) -> String; | |
fn is_complete(&self) -> bool; |
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 "SDL.h" | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <time.h> | |
#define SIZE 1000 | |
struct cell { |
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 pyxel | |
import random | |
class App: | |
def __init__(self, size, game_of_life): | |
super().__init__() | |
self.size = size | |
self.game_of_life = game_of_life |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <pthread.h> | |
#define EXAMPLE_SIZE 100 | |
#define CONSUMER_COUNT 10 | |
static pthread_mutex_t q_mtx; // = PTHREAD_MUTEX_INITIALIZER; | |
static pthread_cond_t q_cond = PTHREAD_COND_INITIALIZER; |
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
{- | |
Funcitonal Maze | |
Run: runhaskell <SOURCE> <WIDTH::Int> <HEIGHT::Int> <RANDOM_SEED::Int> | |
Control: | |
- [W] [A] [S] [D]: move up, left, down, right | |
- [Q] [E|SPACE]: rotate counter-clockwise, clockwise | |
- [ESC]: quit | |
-} |
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
require 'pp' | |
require "test/unit" | |
class String | |
def parse_response | |
ParseResponse.new(self) | |
end | |
def token | |
for_tokens(self) |