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
//Jared Davidson's swift sort demo | |
//run in xcode 7.1 and swift 2.1 | |
var ary = [0, 10, 8, 2] | |
ary = ary.sort({ $0 < $1 }) | |
print(ary) | |
//[0, 2, 8, 10] | |
var strs = ["objectivec", "swift", "js", "as"] | |
strs.sortInPlace({$0 < $1}) | |
print(strs) |
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
// | |
// TransitionManager.swift | |
// SwiftScreenMotionTips | |
// | |
//@see http://mathewsanders.com/animated-transitions-in-swift/ | |
import UIKit | |
import Darwin //contain pi's constant | |
class TransitionManager: NSObject, UIViewControllerAnimatedTransitioning, UIViewControllerTransitioningDelegate { |
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
// | |
// ViewController.swift | |
// SwiftMotionPrototypeTips | |
// | |
// @see http://mathewsanders.com/prototyping-iOS-iPhone-iPad-animations-in-swift/ | |
import UIKit | |
class ViewController: UIViewController { |
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 Foundation | |
"use xcode's playground" | |
/** | |
* port as3 to swift | |
* http://www.anotherearlymorning.com/2009/06/trie-data-structure-in-actionscript-3/ | |
* http://www.emanueleferonato.com/2009/07/13/trie-data-structure-in-actionscript-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
var doc = fl.getDocumentDOM(); | |
//symbol type constant | |
var movieclipType = "movie clip"; | |
var folderType = "folder"; | |
var bitmapType = "bitmap"; | |
var soundType = "sound"; | |
//prefix | |
var mcPrefix = "ui"; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
char* concatstr(char*, char*); | |
int strlen(char*); | |
int strend(char*, char*); | |
//K&R的c语言指针章节练习题 | |
int main(void) | |
{ |
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 doc = null; | |
var flaPath = null; | |
var outputPath = null; | |
var recursiveSearch = true; | |
var suffix = "fla"; | |
run(); | |
function run() | |
{ |
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 doc = fl.getDocumentDOM(); | |
var library = null; | |
var items = null; | |
var itemLen = null; | |
var item = null; | |
run(); | |
function run() | |
{ |
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
//@see http://keith-hair.net/blog/2010/03/21/resizing-flash-documents-to-fit-contents-in-jsfl/ | |
//@see http://stackoverflow.com/questions/8056990/how-does-one-get-the-stroked-bounds-of-a-symbol-in-jsfl | |
var doc = fl.getDocumentDOM(); | |
var timeline = doc.getTimeline(); | |
var layer = null; | |
var frame = null; | |
var element = null; | |
run(); |
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.Dictionary; | |
import starling.animation.IAnimatable; | |
import starling.core.Starling; | |
/** | |
* 方法队列调用 | |
* | |
* @example |