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
/** | |
* ArrayUtil | |
* @author Jan Břečka | |
* @langversion 3.0 | |
*/ | |
/** | |
* Clones an array. | |
*/ |
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.geom.Matrix; | |
import flash.geom.Point; | |
import flash.geom.Rectangle; | |
/** | |
* RotationalRectangle | |
* | |
* @author Jan Břečka |
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
var f:String; | |
var a:String = "a"; | |
f = a || "b"; | |
trace(f); | |
trace(2.53433 >> 0); | |
for (var i:int = 0; i < 9; i++) | |
trace(int(i / 3), (i / 3) >> 0); |
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
1) /<(?!a |\/a).*?>/gi | |
2) /<a(.+?(href=["'](.+?)["'])?)?.*?>(.*?)<\/a>/gi | |
<a name="asdsad"></a>sad sa <a href="http://wdsad" name="sadasd">asd</a> <a href='sdfsdfdsf'>asdasd</a>sadsad<a>asdasd</a> | |
MATCH 1 | |
1. [2-3] ` ` | |
4. [17-17] `` | |
MATCH 2 | |
1. [30-50] ` href="http://wdsad"` |
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
stop(); | |
var loaderListener:Object = new Object(); | |
loaderListener.onLoadInit = function(swf:MovieClip):Void | |
{ | |
//for (var p in swf) trace(swf[p]); | |
channel.send("as3bridge", "loaded"); | |
}; | |
var loader:MovieClipLoader = new MovieClipLoader(); | |
loader.addListener(loaderListener); |
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
$a = ['item0', 'item1', 'item2', 'item3', 'item4', 'item5']; | |
$b = [2, 3]; | |
print_r($a); | |
$t = array_flip($b); | |
$r = array_filter($a, function($i) use ($t) { | |
return !isset($t[$i]); | |
}, ARRAY_FILTER_USE_KEY); |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script type="text/javascript"> | |
(function(factory){if(typeof exports==="object"){module.exports=factory()}else if(typeof define==="function"&&define.amd){define(factory)}else{var glob;try{glob=window}catch(e){glob=self}glob.SparkMD5=factory()}})(function(undefined){"use strict";var add32=function(a,b){return a+b&4294967295},cmn=function(q,a,b,x,s,t){a=add32(add32(a,q),add32(x,t));return add32(a<<s|a>>>32-s,b)},ff=function(a,b,c,d,x,s,t){return cmn(b&c|~b&d,a,b,x,s,t)},gg=function(a,b,c,d,x,s,t){return cmn(b&d|c&~d,a,b,x,s,t)},hh=function(a,b,c,d,x,s,t){return cmn(b^c^d,a,b,x,s,t)},ii=function(a,b,c,d,x,s,t){return cmn(c^(b|~d),a,b,x,s,t)},md5cycle=function(x,k){var a=x[0],b=x[1],c=x[2],d=x[3];a=ff(a,b,c,d,k[0],7,-680876936);d=ff(d,a,b,c,k[1],12,-389564586);c=ff(c,d,a,b,k[2],17,606105819);b=ff(b,c,d,a,k[3],22,-1044525330);a=ff(a,b,c,d,k[4],7,-176418897);d=ff(d,a,b,c,k[5],12,1200080426);c=ff(c,d,a,b,k[6],17,-1473231341);b=ff(b,c,d,a,k[7],22,-45705983 |
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 flash.events.Event; | |
import flash.geom.Point; | |
import flash.geom.Matrix; | |
var N:uint = 4; | |
var speed:uint = 1; | |
var marks:Vector.<Mark> = new Vector.<Mark>(N, true); | |
var vertices:Vector.<Point> = new Vector.<Point>(N, true); | |
var center:Point = new Point(rect.x, rect.y); | |
var matrix:Matrix = new Matrix(); |
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
;------------------------------------------------ | |
; bayesian | |
(def empty-training-set {:features {} :categories {}}) | |
(defn train | |
[features category] | |
(reduce #(assoc-in %1 [:features %2] {category 1}) | |
(assoc-in empty-training-set [:categories category] 1) | |
features)) |
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
const fs = require('fs') | |
const express = require('express') | |
const proxy = require("http-proxy").createProxyServer({"changeOrigin": true}) | |
const index = './src/index.html' | |
const port = 3000 | |
const proxyTarget = '...' | |
const app = express() |
OlderNewer