Skip to content

Instantly share code, notes, and snippets.

public class Human
{
private String name = "unnamed"; // the name of this human
private Human friend = null; // the human's friend
/**
* This "creates" a new Human
*/
public Human(String name, Human friend) {
this.name = name;
function uploadFile(file) {
var xhr = new XMLHttpRequest();
xhr.upload.onprogress = function(e) {
$( ".progress" ).show();
var percentComplete = Math.ceil((e.loaded / e.total) * 100);
$("#info_text").text("Uploaded: " + percentComplete + "%");
$('.bar').width(percentComplete + "%");
console.log("Uploaded: " + percentComplete + "%");
};
@rymate1234
rymate1234 / ai.js
Last active August 29, 2015 13:57 — forked from bbarry/ai.js
var log2 = Math.log2;
if(!log2) {
log2 = function (x) { return Math.log(x) / Math.LN2; };
}
function Ai() {
var score = function (grid, previous) {
var total = 0, count = 0, ptotal = 0, pcount = 0;
grid.eachCell(function (x, y, tile) {
if (tile) { total += (log2(tile.value)-1)*tile.value; count += 1; }
function Ai() {
this.init = function() {
// This method is called when AI is first initialized.
}
this.restart = function() {
// This method is called when the game is reset.
}
this.step = function(grid) {
package net.rymate.VirtuaCity;
import java.util.Random;
import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.graphics.GL10;
@rymate1234
rymate1234 / main build.gradle
Last active December 30, 2015 22:49
why is this happening with gradle :/
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
@rymate1234
rymate1234 / gist:7811086
Created December 5, 2013 18:53
sample dxdiag because yolo
------------------
System Information
------------------
Time of this report: 12/5/2013, 18:51:15
Machine name: RYAN-PC
Operating System: Windows 7 Ultimate 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.130828-1532)
Language: English (Regional Setting: English)
System Manufacturer: System manufacturer
System Model: System Product Name
BIOS: Phoenix - AwardBIOS v6.00PG
Ryan@Ryan-PC /z/GitHub/Minecraft-Overviewer
$ gdb-python27.exe python
GNU gdb (GDB) 7.5
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
For bug reporting instructions, please see:
minecraft@znc:~/Minecraft-Overviewer$ python main.py ~/vanilla/world/ /var/www/oil/
2013-11-02 19:31:26 Welcome to Minecraft Overviewer!
2013-11-02 19:31:26 E Could not find the textures while searching for 'assets/minecraft/textures/blocks/stone.png'. Try specifying the 'texturepath' option in your config file.
Set it to the path to a Minecraft Resource pack.
Alternately, install the Minecraft client (which includes textures)
Also see <http://docs.overviewer.org/en/latest/running/#installing-the-textures>
(Remember, this version of Overviewer requires a 1.6-compatible resource pack)
(Also note that I won't automatically use snapshots; you'll have to use the texturepath option to use a snapshot jar)
minecraft@znc:~/Minecraft-Overviewer$ wget https://s3.amazonaws.com/Minecraft.Download/versions/1.6.2/1.6.2.jar -P ~/.minecraft/versions/1.6.2/
--2013-11-02 19:31:51-- https://s3.amazonaws.com/Minecraft.Download/versions/1.6.2/1.6.2.jar
default: default
groups:
manager:
permissions:
- essentials.*
groups:
- default
meta:
prefix: '&c[Manager]'
default: