This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object SomeRandomPass extends Pass { | |
val title = "Stuff" | |
val description = "Stuff" | |
//Magie: dieser Code fügt zwei Methoden zur Klasse BufferedImage hinzu | |
//Tu dies in dein Pass herein unter "val description = ..." um es zu aktivieren | |
case class Color(a: Int, r: Int, g: Int, b: Int) | |
implicit def addColorAccessTo(img: BufferedImage) = new { | |
def apply(x: Int, y: Int) = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package se.dflemstr.imgproc.passes | |
import java.awt.image.BufferedImage | |
import se.dflemstr.imgproc.graphics.Texture | |
object NearestNeighbor extends Pass { | |
val title = "Nearest Neighbor interpolation detection" | |
val description = "A pass that highlights duplicate pixels in an image." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package se.dflemstr.imgproc.passes | |
import java.awt.image.BufferedImage | |
import se.dflemstr.imgproc.graphics.Texture | |
object NearestNeighbor extends Pass { | |
val title = "Nearest Neighbor interpolation detection" | |
val description = "A pass that highlights duplicate pixels in an image." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "fixedp.h" | |
#include <iostream> | |
int main(int, char **) | |
{ | |
fixedp<true, 16, 16> x(0); //32-bit signed 16.16 fixed-point number | |
fixedp<false, 8, 8> y(10); //16-bit unsigned 8.8 fixed-point number | |
std::cout << (fixedp<false, 4, 4>(3.5) + fixedp<false, 4, 4>(4.5)).toFloat() << std::endl; | |
//prints "8" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "example.h" | |
Example::Example(int someInt, const std::string &someString) | |
: _someInt(someInt), //Assign _someInt | |
_someString(someString) //Copy the whole string to _someString | |
{ | |
} | |
const std::string &Example::someString() const | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Linear interpolation of a 2D double array | |
private double[,] Interpolate(double[,] matrix, int dim) | |
{ | |
double[,] result = new double[dim, dim]; | |
double sf = (double)(matrix.GetLength(0) - 1) / (double)(dim - 1d); | |
for (int x = 0; x < dim; x++) | |
{ | |
for (int y = 0; y < dim; y++) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Card { | |
private int number, colors; | |
private static String[] Colors = { "Hearts", "Spades", "Diamonds", "Clubs" }; | |
private static String[] Number = { "Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Knave", "Queen", "King" }; | |
Card(int Cardcolors, int Cardnumber){ | |
this.number=Cardnumber; | |
this.colors=Cardcolors; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- This is an example PXML file for an application named "Exaile", to | |
demonstrate how a PXML file is supposed to be structured. Feel free to | |
replace all of the field contents with your own data, and to remove these | |
comments afterwards, in order to get a working and valid PXML file. | |
Note that this file is MINIMAL aka. this is the information you SHOULD | |
specify if you're well-behaved (all of it isn't NEEDED per-se, though)--> | |
<!-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Select | |
items1.id as items1_id, | |
localizations3.itemId as localizations3_itemId, | |
localizations3.languageName as localizations3_languageName, | |
items1.id as items1_id, | |
localizations2.string as localizations2_string, | |
localizations2.itemId as localizations2_itemId, | |
localizations2.languageName as localizations2_languageName, | |
localizations3.string as localizations3_string, | |
localizations3.itemId as localizations3_itemId, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This doesn't actually work, since function application has the highest precedence in Scala. | |
def repeat(self: String, times: Int) = self * times | |
val x = "ABC" | |
x~repeat(5) |
OlderNewer