Skip to content

Instantly share code, notes, and snippets.

@moomoohk
moomoohk / generate_build.py
Created April 7, 2015 12:55
Cactus (http://cactusformac.com/) plugin that generates an external build folder that doesn't overwrite your git files. Perfect for usage with GitHub pages, just stick your .git in the generated build folder.
import distutils.dir_util
import shutil
import os
def copytree(src, dst):
for item in os.listdir(src):
s, d = os.path.join(src, item), os.path.join(dst, item)
if os.path.isdir(s):
shutil.copytree(s, d, False, None)
else:
void save() {
Store store1 = new Store(dbName, store1Name); // Opening first nonexistent store, all good
store1.open().then((_) {
store1.batch({
// This will run sucessfully and the data will be saved
});
});
Store store2 = new Store(dbName, store2Name);
store2.open().then((_) {
[2014-10-03T14:42:09+0300] <@moomoohk> i think i got it
[2014-10-03T14:42:10+0300] <FleshyPig> yo moomoohk, i played the just cause 2 demo
[2014-10-03T14:42:12+0300] <FleshyPig> it is sick
[2014-10-03T14:42:19+0300] <@moomoohk> figured as much
[2014-10-03T14:42:31+0300] <FleshyPig> totally gonna get it soon
[2014-10-03T14:42:36+0300] <St1nG> fleshypig, just cause 2 is legit
[2014-10-03T14:42:43+0300] <FleshyPig> so is my ass
[2014-10-03T14:42:45+0300] <FleshyPig> ooooohhhhh
[2014-10-03T14:42:46+0300] <St1nG> I prefer it to gta
[2014-10-03T14:43:31+0300] <FleshyPig> cool
package com.moomoohk.MarketMaven.Components;
import java.io.Serializable;
import com.moomoohk.MarketMaven.Game;
public class Person extends Agent implements Serializable
{
private static final long serialVersionUID = 1L;
public class InstanceCalculator
{
public dd(int num1, int num2)
{
return num1 + num2;
}
public ubtract(int num1, int num2)
{
return num1 - num2;
@moomoohk
moomoohk / BrokerTest.java
Created August 4, 2014 04:17
A little demo+docs of how the TradeOrder system will work in Market Maven
/**
*
* @author Meshulam Silk (moomoohk@ymail.com)
* @since Aug 4, 2014
*/
public class BrokerTest
{
public static void main(String[] args)
{
/*
@moomoohk
moomoohk / Mult.java
Last active December 30, 2015 02:09 — forked from anonymous/gist:7760387
// return C = A * B
public static double[][] multiply(double[][] A, double[][] B)
{
int mA = A.length; //row
int nA = A[0].length; //col
int mB = B.length;
int nB = A[0].length;
if (nA != mB)
throw new RuntimeException("Illegal matrix dimensions.");
double[][] C = new double[mA][nB];
public matrix mul(matrix B)
{
// Return a new matrix which is the matrix product of this
// with B.
if((rows()!=B.rows()) || (cols()!=B.cols()))
{
System.out.println("Error, cannot add since the 2 matrices do not have the same dimensions.");
System.exit(0);
}
matrix M = new matrix(rows(), cols());
@moomoohk
moomoohk / Grid.java
Last active December 27, 2015 13:39
package gridCheck;
import java.util.Scanner;
public class Grid
{
private boolean[][] grid;
public Grid(int row, int col)
{
package networking;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.io.BufferedReader;
import java.io.EOFException;