This file contains 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 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 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 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 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) |
This file contains 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
; Produces the fibonacci series in memory. | |
;.rodata | |
word count 11 | |
;.data | |
word result0 1 | |
word result1 1 | |
word result 0 | |
;let: |
This file contains 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
@import url("test.css");@import url("test2.css");@import url("test3.css");@import url("te st4.css");@media print,screen{a{}}@font-face{bla:"foo";}@media all and (min-width:500px){}@page {}@page :right{margin-left:4cm;margin-right:3cm;}*{margin:1em;}a{}a,li,em{border-radius:1px/2px;}a[rel]{}a[rel="youtube"]{}a[lang~="en"]{}a[b^="c"]{}a[b$="c"]{}a[b|="en"]{}.codesample[data-summary="helloWorld(){}"]{}svg|circle{}svg|circle[svg|class="bla"]{}a:root{}a:nth-child(12){}a:nth-child(2n + 3){}::f{}*::e(2){}a.bla{}a#b{}a:not(.b){}a:not(c.d > e[f|='g']){a:b;}a b c{}a.b c[d="e"] f#g .h>i~j.k+l [m="n"]{}.cl{i:url("../../images/close-map.png");j:no-repeat;k:0px 0px;}*{bla:gradient(more-gradient(3px solid red #000),rgb(122,233,355),"something with a } in it;");} |
This file contains 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
% Byt pappersstorlek och fontstorlek | |
\documentclass[a4paper,10pt]{article} | |
% Så att man kan skriva ä istället för typ \"a | |
\usepackage{xunicode} | |
% Bra grejer | |
\usepackage{xltxtra} | |
% Gör så att automatiska ordbrytningar blir svenska istället för engelska, t.ex. "mo-rot" istället för "mor-ot" |
This file contains 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
module Main (main) where | |
import System.Environment (getArgs) | |
-- | Matrix multiplication | |
(×) :: Num a => (a, a, a, a) -> (a, a, a, a) -> (a, a, a, a) | |
(a11, a12, a21, a22) × (b11, b12, b21, b22) = | |
(a11 * b11 + a12 * b21, a11 * b12 + a12 * b22, | |
a21 * b11 + a22 * b21, a21 * b12 + a22 * b22) |
This file contains 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
#[macro_use] | |
extern crate error_chain; | |
#[macro_use] | |
extern crate quick_error; | |
quick_error! { | |
#[derive(Debug)] | |
pub enum ForeignA { | |
Foo { | |
description("foo") |