Skip to content

Instantly share code, notes, and snippets.

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) {
@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 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 + "%");
};
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;
<html>
<head><title>Testing</title></head>
<body style="font-family: 'Segoe UI';">
<?php
// this will read a 3 column csv file and spew it onto a web page
$myfile = fopen ("people.csv", "r");
?>
<table style="border-style: solid; border-width: 1px;" >
<?php
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?attr/colorPrimary" >
<item
android:bottom="7dp"
android:left="10dp"
android:right="10dp"
android:top="5dp">
<shape android:shape="rectangle">
<solid android:color="@color/card_white"
android:alpha="?android:attr/disabledAlpha"/>
This file has been truncated, but you can view the full file.
[
{
"text": "\u003cp\u003eLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.\u003c/p\u003e\n\n\u003cp\u003eEtiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit
@rymate1234
rymate1234 / Note.java
Last active August 29, 2015 14:12
my recycler view isn't populated wat do
package net.rymate.rymatenotes2;
/**
* Created by Ryan on 01/01/2015.
*/
public class Note {
private int id;
private String title;
private String content;
------------------
System Information
------------------
Time of this report: 1/20/2015, 10:00:55
Machine name: LCCA24286
Operating System: Windows 7 Enterprise 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.140303-2144)
Language: English (Regional Setting: English)
System Manufacturer: OEGStone
System Model: DG41RQ
BIOS: BIOS Date: 02/08/08 17:50:03 Ver: 08.00.10
@rymate1234
rymate1234 / BetterHomeListener.java
Created June 26, 2011 21:01
BetterHome listener
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Ryan
*/
public class BetterHomeListener extends PluginListener {