Skip to content

Instantly share code, notes, and snippets.

@busti
busti / ForgeModLoaderLog
Created June 20, 2014 21:23
Forge Error Log
[23:20:03] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[23:20:03] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[23:20:03] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
[23:20:03] [main/INFO] [FML]: Forge Mod Loader version 7.2.211.1121 for Minecraft 1.7.2 loading
[23:20:03] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_05, running on Windows 8.1:amd64:6.3, installed at C:\Program Files\Java\jdk1.8.0_05\jre
[23:20:03] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[23:20:03] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[23:20:03] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
[23:20:03] [main/INFO] [LaunchWrapper]: Calling tweak cl
#include "avr/interrupt.h"
int inPin = 3;
int outPin = 4;
volatile boolean state = false;
void setup() {
pinMode(inPin, INPUT);
digitalWrite(inPin, HIGH);
void setup() {
DDRB = B00001000;
PORTB = B00001000;
}
void loop() {
bitWrite(PORTB, 4, bitRead(PINB, 3));
}
<?php
mb_internal_encoding('UTF-8');
function addInformation(DOMDocument $dom, $fields) {
$tags = $dom->getElementsByTagName('input');
for ($i = 0; $i < $tags->length; $i++) {
foreach ($tags->item($i)->attributes as $attr) {
if ($attr->nodeName == 'name') {
$tags->item($i)->setAttribute('value', $fields[$attr->nodeValue]);
@busti
busti / java
Created April 13, 2016 21:02
Dumb assignment is dumb
public void train(List<Data> data) {
//Initialize the weight array with random values.
for (int i = 0; i < weights.length; i++) {
weights[i] = rand.nextFloat();
}
//Create an Iterator for the training data
Iterator<Data> iter = data.iterator();
//Train as often as there are numbers in epochen...
@busti
busti / java
Created May 18, 2016 19:11
Crappy runtime Enum
import java.util.Set;
import java.util.TreeSet;
class RuntimeEnum {
private final Set<String> allowedValues;
private String value;
public RuntimeEnum(String[] vals) {
allowedValues = new TreeSet<String>();
allowedValues.addAll(vals);
@busti
busti / java
Created May 18, 2016 19:34
Less Crappy runtime Enum
class EnumValues {
private final Set<String> values;
public EnumValues(String[] vals) {
values = new TreeSet<String>();
values.addAll(vals);
}
public boolean isAllowed(String val) {
return values.contains(val);
/**
* @file traverse.cpp
*/
#include "traverse.h"
#include <set>
#include <vector>
#include <stack>
#include <algorithm>
public void draw(final int programHandle) {
final int positionHandle = GLES20.glGetAttribLocation(programHandle, "vertPos");
final int colorHandle = GLES20.glGetUniformLocation(programHandle, "vertColor");
GLES20.glEnableVertexAttribArray(positionHandle);
GLES20.glVertexAttribPointer(positionHandle, 3, GLES20.GL_FLOAT, false, 12, vertexBuffer);
GLES20.glEnableVertexAttribArray(colorHandle);
GLES20.glVertexAttribPointer(colorHandle, 4, GLES20.GL_FLOAT, false, 16, colorBuffer);
@busti
busti / test.yml
Created January 3, 2017 19:03
Mockup yaml document containing some recursive Data.
%YAML 1.1
%TAG ! tag:lorem.org,2002:
---
config:
version: 1.7.2
foo: test
bar: true
foo:
#Every String value within this map should be parsed into a custom Object of type foo.bar.ClassName
#Other types of data will not be parsed.