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
infix fun String.dupa(dupa:String) = dupa | |
fun main(dupargs:Array<String>) { | |
var dupa = "dupa"; | |
dupa = dupa dupa dupa | |
println("dupa: $dupa") // output: dupa: dupa | |
} |
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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class LinqListShuffler { | |
public List<string> Shuffle(List<string> list) { | |
Random random = new Random(); | |
return list.OrderBy(x => random.Next()).ToList(); |
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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class ListToDictionary { | |
// Dictionary with subsequent letters as keys (A, B, C, etc.). Count should be less than or equal 24 | |
// to get reasonable results. | |
public Dictionary<string, string> ToDictionary(List<string> list) { | |
Dictionary<string, string> dictionary = new Dictionary<string, string>(list.Count); |
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
package org.flixel; | |
import nme.Assets; | |
import nme.events.Event; | |
import nme.media.Sound; | |
import nme.media.SoundChannel; | |
import nme.media.SoundTransform; | |
import nme.net.URLRequest; | |
/** |
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
package { | |
import flash.text.TextField; | |
import flash.utils.ByteArray; | |
import flash.display.Sprite; | |
import flash.net.registerClassAlias; | |
public class MultiNestedVectorsSerializationTest extends Sprite { | |
public function FlashTest() { | |
registerClassAlias( "String", String ); | |
registerClassAlias( "XML", XML ); |
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
package { | |
public static function argbDecombine( ARGB:uint ):Array { | |
return [ ARGB >> 24, ( ARGB >> 16 ) & 0xFF, ( ARGB >> 8 ) & 0xFF, ARGB & 0xFF ]; | |
} | |
public static function argbCombine( ARGB:Array ):uint { | |
return argbCombine( ARGB[0], ARGB[1], ARGB[2], ARGB[3] ); | |
} |
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
package { | |
import flash.utils.getTimer; | |
import net.flashpunk.*; | |
import net.flashpunk.utils.*; | |
/** | |
* <p> | |
* The reason to use such test is that under Linux holding a key triggers a key-repeat functionality after | |
* a moment and so, key-press events are generated. Therefore the Input.pressed() method will periodically |
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
# Automatically generate Java app classpath based on jars in 'lib' folder | |
javac -cp `echo lib/*jar | tr ' ' :` App.java |
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
/** | |
* <p> | |
* What's the point (if there is any) and logic behind using/non-using "final" keyword for parameters in interface method and/or | |
* its implementation? | |
*/ | |
public class Test { | |
// Example 1: | |
public static interface I { | |
void perform( final Boolean b ); // final on b |
NewerOlder