Skip to content

Instantly share code, notes, and snippets.

@Danny02
Danny02 / App.java
Last active August 29, 2015 14:07
Showcases a compiler bug in the JDK 8_20
class App {
interface B<T>{T get();}
interface C<S>{}
static void error() {
C a = null;
/*
* No error, but an Error with Java 7(which is correct).
* Foo returns a Rawtype which gets mapped to B<Float>
Element position = new Element(new GenericVector(DataType.FLOAT, 3), "Position");
DataLayout layout = new DataLayout(position);
VertexBuffer vertexBuffer = new VertexBuffer(layout, 100);
vertexBuffer.fullyInitialize();
for(Vertex v: vertexBuffer)
{
v.setAttribute(position, 3f, 2f, 4f);
}
final Element position = new Element(new GenericVector(DataType.FLOAT, 3), "Position");
DataLayout layout = new DataLayout(position);
VertexBuffer vertexBuffer = new VertexBuffer(layout, 100);
//Erstellt eine tessiliertes Quadrat,
//der tessFactor sagt wieviele spalten udn reihen es geben soll
CellFactory factory = new CellFactory(10);
factory.createCell(new Vector2(0,0));
factory.fillVBufferPerVertex(vertexBuffer, new PerVertexFiller() {
package mdes.j4k.tools;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
public class ArrayTranslate {
/** Max number of entities */
public static final int COUNT = 10;
@Danny02
Danny02 / IRCClient.java
Last active December 20, 2015 08:29
some old little IRC client
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package communication;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
@Danny02
Danny02 / physical.c
Last active December 23, 2015 06:19
some basic GLSL fragment shader show casing physical correct lighting
in vec3 normal;
in vec3 eye;//from vertex to eye/origin
const light = vec3(0.12708472893924555, -2.5399460893115735, 2.8320502943377743) // from vertex to lightsource
const vec3 LIGHT_COLOR = vec3(1, 0.7, 0.4);
//created textures have to have realistic values
//Fresh asphalt 0.04
//Worn asphalt 0.12
//Bare soil 0.17
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>info.yeppp</groupId>
<artifactId>yeppp</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<properties>
@Danny02
Danny02 / bull.scala
Last active December 24, 2015 02:59
import shapeless._
object Bullshit {
sealed abstract class Size[T](val size:Int)
object Size{
implicit object sizeForString extends Size[String](9)
implicit object sizeForInt extends Size[Int](4)
implicit object sizeForFloat extends Size[Float](7)
}
trait A[T]{
def foo(): Any
}
implicit object B extends A[Bar]{
def foo(): String = "Hi"
}
val a: String = B.foo()
use strict;
use warnings;
package VarVal;
sub println
{
print @_, "\n";
}
sub val
{