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
| import java.util.* | |
| fun print(message : String) { | |
| System.out?.println(message) | |
| } | |
| fun <T> List<T>.filter( | |
| body : (T) -> Boolean | |
| ) : List<T> { | |
| val l = ArrayList<T>() |
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
| # Objective-C | |
| @interface Anonymous : NSObject { | |
| NSString* name; | |
| } | |
| - (NSString*) name; | |
| @synthesize name; | |
| # Java |
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
| WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE); | |
| WifiInfo wifiInfo = wifiManager.getConnectionInfo(); | |
| int ipAddress = wifiInfo.getIpAddress(); | |
| String ipString = String.format(“%d.%d.%d.%d”, (ip & 0xff), (ip >> 8 & 0xff), (ip >> 16 & 0xff), (ip >> 24 & 0xff)); |
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 String getLocalIpAddress() { | |
| try { | |
| for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { | |
| NetworkInterface intf = en.nextElement(); | |
| for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) { | |
| InetAddress inetAddress = enumIpAddr.nextElement(); | |
| if (!inetAddress.isLoopbackAddress()) { | |
| return inetAddress.getHostAddress().toString(); | |
| } | |
| } |
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
| import flash.html.HTMLLoader; | |
| var content : String = '<!DOCTYPE html>\ | |
| <head>\ | |
| <style>\ | |
| @-webkit-keyframes pulse {\ | |
| 0% {\ | |
| background-color: red;\ | |
| opacity: 1.0;\ | |
| -webkit-transform: scale(1.0) rotate(0deg);\ |
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
| function RGBtoRGBA(r, g, b){ | |
| (g==void 0) && (typeof r == 'string') && | |
| (r = r.replace(/^\s*#|\s*$/g, ''), | |
| (r.length == 3) && (r = r.replace(/(.)/g, '$1$1')), | |
| g = parseInt(r.substr(2, 2), 16), | |
| b = parseInt(r.substr(4, 2), 16), | |
| r = parseInt(r.substr(0, 2), 16)); | |
| var min, a = ( 255 - (min = Math.min(r, g, b)) ) / 255; |
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 | |
| { | |
| public class AsciiTable | |
| { | |
| public static const table : Vector.<String> = Vector.<String>([ | |
| 'NUL', | |
| 'SOH', | |
| 'STX', |
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 utils | |
| { | |
| import flash.display.DisplayObject; | |
| import flash.display.DisplayObjectContainer; | |
| import flash.utils.getQualifiedClassName; | |
| /** | |
| * | |
| */ | |
| public function describeDisplayList(displayObject : DisplayObject) : XML |
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 org.osflash.signals | |
| { | |
| /** | |
| * The SignalBindingList class represents an immutable list of SignalBinding objects. | |
| * | |
| * @author Joa Ebert | |
| * @private | |
| */ | |
| public final class SignalBindingList | |
| { |
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
| /** | |
| * | |
| * | |
| * ScaleBitmap | |
| * | |
| * @author Didier Brun | |
| * @author Jerôme Decoster | |
| * @author Simon Richardson | |
| * @version 1.2 | |
| * |