The Evolution of Adobe Flash: From 1996 to 2010
瓒婃潵瓒婃噿锛屽暐閮戒笉鎯冲啓鈥︹︽妱琚竴涓狥lash鐨勮繘鍖栧彶~~
From http://www.pxleyes.com/blog/2010/07/evolution-of-flash-from-1996-to-2010/
Adobe Flash is arguably the most popular multimedia platform today. Users can watch videos, chat, and play games thanks to the capabilities of the Flash player. Content creators are afforded almost unlimited power due to ActionScript 3鈥瞫 powerful features.
Flash wasn鈥檛 always the rich and advanced platform it is today, however. It started as a vector animation package named FutureSplash Animator in 1996 and 14 years later, it鈥檚 going strong, with a desktop, mobile, and server-side presence.
FutureSplash Animator 鈥 1996

The first version of Flash, called FutureSplash Animator, was created by Jon Gay and Charlie Jackson, co-founders of FutureWave software. It was the animation extension of FutureWave鈥檚 SmartSketch, a vector drawing application. The first version of FutureSplash Animator was shipped in 1996 and a mere 7 months later, Macromedia bought FutureWave and renamed FutureSplash to simply Flash.

銆婄▼搴忓憳銆嬬簿褰╂帹鑽愶細Android绋嬪簭鍒涙剰杩囨护涓庡け璐ョ粡楠岃皥
via www.programmer.com.cn on 7/21/10 鏂/聽鍒橀搧閿
浠2008骞村簳寮濮嬶紝鎴戝氨鍦ˋndroid涓婅繘琛岀▼搴忓紑鍙戞帰绱€傞殢鐫鏃堕棿鐨勬帹绉伙紝鎴戣秺鏉ヨ秺涓嶆暍濡勮嚜棰勬祴鎴栬呭亣璁剧▼搴忓垱鎰忎竴瀹氫細鎴愬姛锛屾洿澶氬湴鍙戠幇鐢ㄦ埛鐨勬湡鏈涗互鍙婇渶姹傚拰浜嬪厛棰勬兂寰堥毦涓鑷淬傚湪涓骞村崐鐨勫紑鍙戣繃绋嬩腑锛屽皾璇曚簡鍚勭涓嶅悓鐨勬柟娉曞拰鎬濊矾鏉ヨ繘琛岀▼搴忓垱鎰忚鍒掑拰璇曢敊銆傝嚦浠婏紝渚濈劧澶辫触鐨勬暀璁眳澶氾紝渚ュ垢鎴愬姛鐨勫緢灏戙傚洜姝わ紝鎴戝皢鍦ㄦ湰鏂囦腑鍒嗕韩鎵缁忓巻鐨勫垱鎰忚繃婊ょ粡楠屼互鍙婂け璐ユ暀璁
鎬濊矾杞崲鐨勫け璐
鍦ㄨ浆鍏ndroid寮鍙戞椂锛屾垜鐨勭浉鍏冲伐浣滅粡楠岄兘鏄湪澶у瀷鍩虹骞冲彴涓婂仛绋嬪簭寮鍙戙傞拡瀵圭殑鐢ㄦ埛缇や綋鍔ㄨ緞灏辨槸鍏ㄧ悆鐩爣鐢ㄦ埛锛屽湪鍟嗕笟鍒ゆ柇鍜屽垎鏋愪笂锛屾渶鍩虹鐨勪竴涓冮噺灏辨槸鐢ㄦ埛缇や綋鍜屼笟鍔℃ā寮忕殑鎬婚噺鐨勬敹鐩婃槸鍚﹁冻澶熷ぇ锛屽鐢ㄦ埛缇や綋鐨勭爺绌跺拰鍟嗕笟鍒ゆ柇鍒嗘瀽瀹屽叏鏍规嵁甯傚満鍒嗘瀽鎶ュ憡鍜屾暟鎹潵鍋氬垽鏂傚洜姝わ紝涓嶅彲閬垮厤鍦板湪绋嬪簭鍒涙剰鎬濊矾涓婁細娌跨敤浠ュ墠鐨勫伐浣滄濊矾鍜屽垎鏋愭柟娉曘
鍦ㄨ冭檻Android涓婄殑鍒涙剰鐨勫悓鏃讹紝涓嶈嚜瑙夊湴灏辫冭檻鍜屽垎鏋愪簡濡備笅鍑犱釜鏂归潰鐨勯棶棰橈細
1.聽鏄惁涓虹敤鎴锋墍蹇呴渶锛
2.聽鎶鏈笂鏄惁棰嗗厛锛
3.聽绋嬪簭鐨勭矘鎬ф槸鍚﹁冻澶燂紵
4.聽鐢ㄦ埛缇や綋鏄惁瓒冲澶э紵
鍥犳锛屾部鐢ㄨ繖涓濊矾锛屼笉鍙伩鍏嶅湴灏变細寰澶х殑搴旂敤鍜屽ぇ鐨勬湇鍔′笂鍘绘濊冨拰鍋氬嚭鍒ゆ柇銆
缁忚繃澶氭柟鐨勮璁猴紝鎵惧埌浜嗕竴涓垏鍏ョ偣锛氬湪鐢ㄦ埛鑱旂郴浜轰俊鎭笂鍚屾椂鏄剧ず鍑虹敤鎴峰湪绀句細缃戠粶锛堟瘮濡侳acebook/Twitter锛変笂鐨勫悓姝ユ洿鏂帮紝骞跺姞涓婄浉鍏崇殑鎿嶄綔鏄笉閿欑殑鎯虫硶銆
鐞嗙敱濡備笅锛
1.聽鑱旂郴浜烘槸鎵嬫満鐢ㄦ埛闇瑕佺殑蹇呬笉鍙皯鐨勫姛鑳斤紝缁濆蹇呴』浣跨敤銆
2.聽鎶鏈笂鐢变簬闇瑕佸疄鐜板拰绯荤粺鑱旂郴浜虹被浼肩殑鍔熻兘锛屽伐浣滈噺涓嶄細灏忋傚鏋滃姞涓婃湭鏉ュ湪浜戠鐨勫浠斤紝鎶鏈棬妲涗篃涓嶄細澶綆銆
3.聽缁戝畾鐢ㄦ埛鐨勭ぞ浼氱綉缁滀俊鎭紝杩欎釜绮樻х悊璁轰笂鍜岀敤鎴蜂娇鐢ㄧぞ浼氱綉缁滅殑绮樻т竴鏍枫
4.聽鐢ㄦ埛缇や綋涓烘墍鏈夌ぞ浜ょ綉缁滅殑鐢ㄦ埛锛岃冭檻鍒癎oogle鎵嬫満鐨勭敤鎴烽兘鏄妧鏈殑鐖卞ソ鑰呭拰鏃╂湡鎶鏈帹骞胯咃紝閭d箞锛屽熀鏈笂澶ч儴鍒咥ndroid鐢ㄦ埛閮戒細浣跨敤銆
鎸夌収杩欎釜鎬濊冩柟寮忓垎鏋愪笅鏉ワ紝姣棤鐤戦棶锛岃繖涓兂娉曚竴鐐逛篃涓嶅樊锛岃兘澶熺浉褰撳畬缇庡湴杈惧埌棰勬湡鐨勮鍒掋
鍥犳锛屾垜浠姇鍏ヤ簡3浣嶅紑鍙戝伐绋嬪笀鍜1浣嶄骇鍝佺粡鐞嗭紝涓鍏卞伐浣滀簡3涓湀鐨勬椂闂达紝浜у搧鎵嶅垵姝ユ垚鍨嬶紝浜у搧鐨勬簮浠g爜鎺ヨ繎2MB锛屾渶鍚庣紪璇戝嚭鏉ョ殑绋嬪簭鎺ヨ繎4MB銆
缁忚繃浜嗙棝鑻︾殑鐮斿彂杩囩▼锛屼骇鍝佸嚭鏉ヤ箣鍚庯紝缁撴灉鍗翠护浜哄ぇ璺岀溂闀滐細
1.聽绋嬪簭鍖呰繃澶с傜敤鎴锋牴鏈笉鎰挎剰涓嬭浇锛屼笅杞介噺闈炲父鎯ㄦ贰銆
2.聽鐢ㄦ埛瀹屽叏鎼炰笉鎳傝繖涓▼搴忕殑鐩殑鍜岀敤娉曘傜▼搴忕殑鍛戒护浠ュ強鎻忚堪闈炲父闅捐〃杈撅紝骞朵笖绋嬪簭闇瑕佺粦瀹氱敤鎴风殑绀句氦缃戠粶璐﹀彿锛屾墠鍙互鏄剧ず淇℃伅銆傛病鏈夌粦瀹氫箣鍓嶏紝鐪嬩笉鍒颁换浣曠壒鍒俊鎭紝涔熶綋浼氫笉鍒扮▼搴忕殑浣滅敤銆傚緢澶氱敤鎴峰湪涓婃墜鏃剁湅鍒伴渶瑕佺粦瀹氾紝渚垮紑濮嬬枒鎯戜簡銆
3.聽鏈缁堟湁鐢ㄦ埛鎼炴槑鐧戒簡绋嬪簭鐨勭敤娉曪紝瑙夊緱鎯虫硶涓嶉敊銆備絾绋嬪簭鐨勭ǔ瀹氭у拰鎬ц兘閬囧埌鐨勪簡涓ラ噸鐨勭摱棰堛傚敖绠″湪鍏朵粬骞冲彴寮鍙戠粡楠屼笉閿欙紝浣嗘槸姣曠珶杩欐槸涓涓柊鐨勫钩鍙帮紝骞朵笖绋嬪簭鎿嶄綔鐩稿綋澶嶆潅锛岀敤鎴蜂緷鐒堕夋嫨浜嗘斁寮冧娇鐢ㄣ
4.聽涓嬭浇閲忎笉楂橈紝璇勫垎鍙堥愭笎闄嶄綆锛岀▼搴忓氨鍦ㄦ帓琛屾鐨勬鍗曚笂娓愭笎娑堝け浜嗐
5.聽鎯ㄦ贰鐨勭粨鏋滐紝璁╂墍鏈夊弬涓庝汉鍛橀兘寮濮嬫伯涓э紝瑙夊緱杩欏苟涓嶆槸涓涓ソ鐨勬兂娉曘傚悗鏉ュ湪iPhone涓婂彂鐜颁簡绫讳技鐨勭▼搴忥紝浠庨攢鍞儏鍐垫潵鐪嬶紝琛ㄧ幇鍚屾牱涓嶅濂姐傚啀鍚庢潵锛孧oto鐨凜liq鍩烘湰涓婂畬鏁村湴鎶婅繖涓兂娉曞疄鐜颁簡锛屽苟浣滀负涓閲嶅ぇ鍒涙柊鍜屽崠鐐硅繘琛屾帹鍑恒
缁忚繃鍙嶅鍦板弽鐪佸拰瀵规瘮锛屽垵姝ュ緱鍑轰簡杩欐牱鐨勫け璐ユ暀璁細
1.聽瀵逛簬涓汉寮鍙戣呭拰灏忓瀷鍥㈤槦鏉ヨ锛屼笉閫傚悎鍋氳繃浜庡熀纭鐨勭▼搴忋傛搷浣滅殑妯″紡鍜岀悊蹇典笂鐨勫垱鏂颁笌鐢ㄦ埛鐨勬帴鍙楀害鏈夌浉褰撶殑璺濈銆傝繖鏍风殑浜嬫儏鍙湁澶у叕鍙告墠鏈夎储鍔涘拰鍙兘杩涜鎺ㄥ箍銆傛瘮濡傝鎵嬫満鐢熶骇鍟嗭紝浠栦滑鍙互閫氳繃棰勭疆鐨勬柟寮忚繘琛屾帹骞裤傝屽涓汉寮鍙戣呮潵璇达紝寰楀厛璇佹槑浣犵殑鎯虫硶鏄垚鍔熺殑锛屼笉鑳藉亣璁句竴涓細鎴愬姛鐨勯渶姹傚拰搴旂敤锛岀劧鍚庡崠缁欒澶囧巶鍟嗐
2.聽涓汉寮鍙戣呭拰灏忓瀷鍥㈤槦涓嶉傚悎鍋氬ぇ鐨勭▼搴忥紝灏ゅ叾鏄紑鍙戞椂闂翠笉瑕佽秴杩2涓湀銆4涓汉锛3涓湀鐨勬椂闂达紝瀵逛簬涓涓皬鍥㈤槦鏉ヨ聽锛屾槸鐩稿綋瀹濊吹鐨勩傝繖涓嶄粎浠呮槸鏃堕棿鍜岄噾閽辩殑闂锛屾洿澶氱殑鏄俊蹇冮棶棰樸
3.聽鐢ㄦ埛鑳藉惁鐪熸鎺ュ彈浣犵殑鎯虫硶锛屾槸涓涓叧閿х殑闂銆傝鎯冲拰鎺ㄥ閮藉緢瀹岀編锛屽敮鐙己浜嗙敤鎴锋槸鍚︾湡姝e枩娆㈠拰鎺ュ彈杩欎竴鏉★紝鍙堟病鏈夋柟娉曡繘琛屽揩閫熷湴楠岃瘉鍜岃瘯閿欙紝鍩烘湰涓婁笉鑳芥垚鍔熴
鍥犳锛屽湪寮鍙戣呭ご鑴戦鏆翠骇鐢熶竴涓垱鎰忎箣鍚庯紝瑕佸仛鐨勫嚑涓渶涓昏鐨勮繃婊ゅ湪浜庯細
1.聽寮鍙戞椂闂存槸鍚﹀お闀匡紵
2.聽寮鍙戠殑鎶鏈毦搴︽槸鍚︿細杩囬珮锛岃屽鑷翠笉鑳藉疄鐜版垨鑰呰川閲忎笉鍙潬锛
3.聽鏈夋庢牱鐨勫姙娉曟潵鍒ゆ柇鐢ㄦ埛鏄惁浼氬枩娆紵
鏈変簡杩欏嚑涓繃婊ゆ潯浠讹紝鐩镐俊鑳藉鍑忓皯澶辫触鐨勫嚑鐜囷紝鎴栬呰鑳藉Fail聽Fast锛堝敖蹇け璐ワ級锛屼粠鑰屽噺灏戞崯澶便
鎶鏈棬妲涚殑澶辫触
鍦ˋndroid寮鍙戠殑杩囩▼涓紝闄や簡澶у瀷鐨勭▼搴忔帰绱紝鎴戜滑涔熺爺绌朵簡浜涘皬绋嬪簭鏉ョ粌鎵嬨傛湁涓悓浜嬫彁鍑篈ndroid涓婂垹闄ょ▼搴忎笉鏂逛究锛屼簬鏄紝鎵句汉鑺变竴澶╁乏鍙崇殑鏃堕棿鍋氫簡涓涓彨Quick聽Uninstaller鐨勭▼搴忋傜▼搴忛潪甯哥畝鍗曪紝鍚姩涔嬪悗鏄剧ず鎵鏈夌▼搴忓浘鏍囷紝鍙屽嚮绋嬪簭鍥炬爣锛屽嵆鍙垹闄よ绋嬪簭銆傛兂娉曚互鍙婇毦搴︼紝閮戒笉寰堢嫭鐗广
浣嗘槸锛屾晥鏋滃嵈鍑轰箮澶у鐨勬剰鏂欍傜敤鎴峰ソ璇勫娼紝鐢变簬鍔熻兘姣旇緝绠鍗曪紝鐢ㄦ埛鍩烘湰涓婃棤闇瀛︿範锛屽姞涓婂張鏄厛琛岃咃紝浜у搧璐ㄩ噺闈炲父绋冲畾锛屾病鏈変换浣曗渇orce聽close鈥(Android绋嬪簭鍑虹幇寮傚父鎴栬呯瓑寰呮椂闂磋繃闀匡紝浼氬脊鍑衡渇orce聽close鈥濈殑瀵硅瘽妗)銆傜敤鎴锋涓嶇姽璞湴鐩存帴鎵撳嚭5鍒嗭紝骞朵笖鍩烘湰涓婃病鏈変换浣曚綆鍒嗗嚭鐜拌繃銆
浣嗘槸锛屽ソ鏅笉闀裤傚湪涓娆oogle娓呮礂鐨勮繃绋嬩腑锛屽洜涓轰竴浜涚増鏉冮棶棰橈紝璐﹀彿琚獹oogle灏佹帀浜嗐傛墍鏈夌▼搴忚寮鸿涓嬫灦銆傝繖涓椂鍊欙紝绔炰簤瀵规墜杩呴熶笂浣嶏紝灏辨槸鐩墠鍦ㄦ帓琛屾鍓嶅垪鐨刄ninstaller锛岃屾垜浠殑绋嬪簭鍒欎竴钀藉崈涓堬紝灏界鐜板湪鍦ㄦ煇涓粏鍒嗗垎绫讳腑杩樻湁涓瀹氱殑浣嶇疆锛屼絾鏄浉姣旀帓鍚嶆渶楂樼殑绋嬪簭锛屽凡缁忕浉宸緢杩滀簡銆
杩欎篃璁╂垜浠浜嗕竴涓け璐ョ殑鏁欒锛
1.聽鎶鏈棬妲涗笉楂橈紝涓嶈兘淇濊瘉浣犱竴鐩翠繚鎸佷紭鍔裤傚浣犳潵璇寸畝鍗曠殑绋嬪簭锛屽绔炰簤瀵规墜鏉ヨ锛岀▼搴忓悓鏍风殑绠鍗曘傚洜姝わ紝浣犺兘鍋氾紝鍒汉涔熻兘鍋氥傚湪杩欎竴鐐逛笂锛屽叾瀹炵珵浜夊悓鏍锋縺鐑堛
2.聽灏佽处鍙风殑浠d环鐩稿綋涔嬪ぇ锛屽熀鏈笂绛変簬浣犵殑鍔姏鎮夋暟灏芥瘉銆侱on鈥檛聽do聽evil銆
鍥犳锛屽湪杩欎釜妗堜緥涓紝澧炲姞浜嗕竴涓柊鐨勫垱鎰忚繃婊ゆ潯浠讹細
绋嬪簭鐨勫垱鎰忔槸鍚﹁繃浜庣畝鍗曪紵濡傛灉杩囦簬绠鍗曪紝閭d箞鍒涙剰鑳藉濮嬬粓淇濇寔鎴愬姛鐨勬満浼氫笉浼氬お楂樸
渚濊禆绗笁鏂硅祫婧愮殑澶辫触
鍦ㄧ粡鍘嗕簡鍓嶉潰鐨勫薄娆″け璐ヤ箣鍚庯紝鎴戜滑寮濮嬪仛浜涚爺绌剁殑宸ヤ綔銆傚彂鐜拌佸鍏跺疄涔熷緢鍏崷锛屼粈涔堢瑧璇濄佸ū涔愭柊闂荤瓑锛屾帴鍙楃▼搴﹀緢楂樸傚洜姝わ紝鎴戜滑灏辨兂鍒颁簡FML锛團uck聽My聽Life锛夌殑缃戠珯锛屼篃灏辨槸鑰佸姣旇緝鐑》鐨勭硹浜嬪垎浜綉绔欙紝姣忓ぉ鏈夊緢澶氫汉浼氬彂甯冨悇绉嶅悇鏍风殑绯椾簨锛屾枃瀛楁渶鍚庡潎浼氫互Fuck聽My聽Life缁撳熬銆
浜庢槸锛屾兂鍒板鏋滃湪鎵嬫満涓婃湁杩欐牱鐨勫鎴风锛岀敤鎴峰彲鑳戒細鏇村姞鎰挎剰鐢紝灏ゅ叾鏄湪鍙戠敓绯椾簨鐨勬椂鍊欙紝蹇嶄笉浣忓氨鎯冲垎浜嚭鏉ワ紝绮樻т篃浼氳冻澶熴
鍩轰簬浠ヤ笂鑰冭檻锛屾垜浠姇鍏ュ姏閲忥紝瀹炵幇浜嗕竴涓姛鑳芥瘮杈冨畬鍠勭殑鐗堟湰锛屼笉浠呰瀺鍚堜簡姝ゆ湇鍔℃墍搴旀湁鐨勭浉鍏冲姛鑳斤紝鍚屾椂杩樿姳浜嗕笉灏戝伐澶紝鍔犱笂浜嗗ソ澶氳嚜瀹氫箟鐨勫姛鑳姐
缁忚繃涓娈垫椂闂寸殑鍔姏锛屽湪Entertainment鍒嗙被涓婏紝鎺掑悕杩涗簡鍓10鍚嶏紝鍗拌薄涓▼搴忔渶濂芥帓鍒颁簡绗3鍚嶃
濂芥櫙涓嶉暱鍦紝澶辫触鎬讳細鏈夈
杩欎釜鏃跺欙紝FML鐨勫畼缃戝彂鐜颁簡杩欎釜鏈轰細銆備粬浠寰楄繖鏄竴涓緢濂界殑鎯虫硶锛屽簲璇ヨ嚜宸卞湪Market涓婂彂甯冭嚜宸辩殑瀹樻柟绋嬪簭銆備簬鏄紝浠栦滑骞蹭簡杩欐牱鐨勪簨鎯呮潵娓呴櫎绔炰簤瀵规墜銆備粬浠洿鎺ュ悜Google涓炬姤锛岃鍏跺畠绋嬪簭娌℃湁寰楀埌浠栦滑鐨勬巿鏉冦備竴娆′妇鎶ワ紝绔炰簤瀵规墜鍏ㄩ儴娓呭共鍑浜嗭紝浜庢槸浠栦滑鐨勫畼鏂圭▼搴忎笂绾夸簡銆
杩欎竴娆★紝寰楀埌浜嗕竴涓洿鍔犳繁鍒荤殑鏁欒锛
1.聽涓嶈杩囦簬渚濊禆绗笁鏂硅祫婧愩備緷璧栫涓夋柟璧勬簮鎴栬呯綉绔欑殑鍚嶆皵锛岀殑纭彲鑳藉府鍔╀綘鐨勭▼搴忓彈鍒板緢澶氬叧娉紝浠d环涔熷悓鏍峰瓨鍦紝涓鏃︿汉瀹跺紑濮嬪姩鎵嬩妇鎶ワ紝浣犺繛杩樻墜鐨勬満浼氶兘娌℃湁銆
2.聽涓嶈閫夐敊绗笁鏂硅祫婧愩傚緢澶氱殑鏈嶅姟鎻愪緵鍟嗘槸涓嶅紑鏀剧殑锛屽敖绠′粬浠病鏈夋槑纭鏄庛傚悓鏃惰繕鏈夊緢澶氭湇鍔℃彁渚涘晢鏄厖鍒嗗紑鏀剧殑锛屾瘮濡俆witter灏辨槸涓涓潪甯稿紑鏀剧殑渚嬪瓙銆傞夐敊浜嗙涓夋柟璧勬簮锛岀粨鏋滀竴鏍蜂細澶辫触銆
鍥犳锛岃繖閲屽張澶氫簡涓涓垱鎰忚繃婊ょ殑鏉′欢锛
鏄惁渚濊禆浜庣涓夋柟璧勬簮锛熉犲鏋滄槸锛岃灏藉揩缁曢亾绂诲紑锛屽洜涓哄緢闅鹃潬杩欎釜鎯虫硶璧板お杩溿
鑳′贡妯′豢鐨勫け璐
鐢变簬鎵嶇枏瀛︽祬鍜屽叧娉ㄩ潰鍗曚竴锛屾兂娉曟讳細鏈夌敤瀹岀殑鏃跺欍傚湪灏濊瘯浜嗗緢澶氳嚜宸辩殑鎯虫硶涔嬪悗锛屽緢澶氫汉閮戒細鏈夋兂娉曟潵鍊熼壌鎴栬呰鎶勮App聽Store涓婃帓鍚嶉潬鍓嶇殑绋嬪簭銆
浣嗘槸锛屼互鎴戠殑缁忛獙鍜屽垎鏋愭潵鐪嬶紝杩欐潯璺熀鏈笂涓嶅彲琛屻
鏈変互涓嬪嚑涓柟闈㈢殑鍘熷洜锛
1.聽鐢昏檸涓嶆垚鍙嶇被鐘傚鏋滄槸鍦ㄤ汉瀹跺垱鎰忎笂杩涜鐨勫姛鑳芥敼杩涳紝浣犺繕鍙兘鏈変竴瀹氱殑绐佺牬鍜屾満浼氥傚鏋滀粎浠呮槸鎶勮锛岀敱浜庡钩鍙扮殑涓嶅悓锛孉ndroid鐨勬帶浠跺拰iPhone鐨勭▼搴忔帶浠剁浉宸お杩滐紝鍝曞仛鍑烘潵绋嬪簭绫讳技锛屾搷浣滀綋楠屽拰绋嬪簭鐨勭簿鑷寸▼搴︿篃鍜宨Phone涓婄▼搴忕浉宸敋杩滐紝寰寰灏辨垚涓虹敾铏庝笉鎴愬弽绫荤姮銆
2.聽鐗堟潈闂銆傝佸鐨勭増鏉冩剰璇嗛潪甯稿己锛屼笉浠呬粎鏄師浣滆呴潪甯稿叧蹇冿紝鐢ㄦ埛涔熷緢鏁忔劅銆傚鏋滀茎骞哥▼搴忔帓鍒颁簡鍓嶅垪锛屼笉浠呬細鎶婂師浣滆呮嫑鎯硅繃鏉ワ紝鐢ㄦ埛杩樹細鍑烘潵涓炬姤銆備竴鏃oogle鏀跺埌浜嗕妇鎶ラ偖浠讹紝鍩烘湰涓婃槸鏉鏃犺郸銆傚弽鍊掓槸鍋烽浮涓嶆垚铓鎶婄背銆
鍥犳锛屽垱鎰忚繃婊や腑鍙堝浜嗕竴涓潯浠讹細
鍒涙剰鏄惁鏈夌増鏉冧簤璁紵濡傛灉鏄紝灏藉揩鍋滄銆傚け璐ュ彧鏄椂闂寸殑闂銆
鍏朵粬
鎬荤殑鏉ヨ锛屽湪鎴戠殑鎺㈢储杩囩▼涓紝鎴愬姛鐨勫皯锛岃屽け璐ョ殑澶澶銆傚湪涓嶨oogle鎵撲氦閬撶殑杩囩▼涓紝渚濈劧鏈夊緢澶氬け璐ョ殑鏁欒鍙緵鍒嗕韩銆
1.聽Don鈥檛聽do聽evil銆傜編鍥戒汉鍋氫簨鐨勬柟寮忛潪甯哥洿鎺ワ紝鍚屾椂浼氶粯璁や綘鏄杽鎰忕殑銆傚浜嶨oogle鏉ヨ锛屽挨鍏跺姝ゃ傚洜姝わ紝鍦ㄦ垜灏濊瘯杩囩殑绋嬪簭涓紝浣犲彲浠ヤ换鎰忓彂甯冧綘鐨勭▼搴忓埌Google聽Market銆備絾鏄紝濡傛灉娑夊強鍒扮増鏉冪籂绾凤紝涓嶇鏄綉绔欑殑鎵鏈夎呫佸師绋嬪簭鐨勫紑鍙戣呰繕鏄叾瀹冧换浣曚竴绉嶇被鍨嬬殑鐗堟潈绾犵悍锛屼竴鏃︿妇鎶ュ埌Google锛岃交鑰呬笅鏋跺崟涓▼搴忥紝閲嶈呭皝绂佹暣涓处鍙凤紝骞朵笖涓嬫灦鎵鏈夌▼搴忋備篃灏辨槸璇达紝涓鏃﹀彈鍒板缃氾紝浣犲氨鍒兂缈昏韩浜嗐傚洜姝わ紝Don鈥檛聽do聽evil銆
2.聽Google鐨勫鏌ュ簳绾裤傚敖绠oogle涓嶅仛瀹℃煡锛屼絾闄や簡鍜岀増鏉冧簤璁浉鍏崇殑绋嬪簭涔嬪锛屽摢鎬曟槸浣犺嚜宸辩殑绋嬪簭锛屼緷鐒舵湁濡備笅鐨勭鍖烘槸涓嶈兘纰扮殑锛
a.聽涓嶈浣跨敤浠讳綍Google鐩稿叧鐨勫悕涔夈傜▼搴忓悕銆佸紑鍙戣呭悕閮戒笉鑳芥秹鍙婂埌Google鎴栬呯湅璧锋潵绫讳技Google鐨勫悕绉帮紝鍚﹀垯Google涓嶄細浜堜互閫氳繃銆
b.聽涓嶈杩濆弽浠讳綍Google鐨勫紑鍙戣呭崗璁傞渶瑕佷粩缁嗛槄璇籊oogle鐨勫紑鍙戣呭崗璁紝鍦ㄤ笉鍚屾椂鍊橤oogle鐨勫紑鍙戣呭崗璁細缁忓父鏇存柊銆傚洜姝わ紝鍙杩濆弽浜嗕换浣旼oogle寮鍙戣呭崗璁紝褰揋oogle澶勭綒鍒颁綘鐨勬椂鍊欙紝鍩烘湰涓婃病鏈夌敵杈╂満浼氥傚洜姝わ紝鍔″繀瑕佸皬蹇冦
鎬荤粨
鍦ㄦ垜寮鍙戠殑缁忛獙杩囩▼涓紝鎴愬姛鐨勭粡楠屼笉澶氾紝鑰屽け璐ョ殑鏁欒鏃犳暟銆傚摢鎬曞姝わ紝鎴戝潥淇″湪绉诲姩浜掕仈缃戦鍩燂紝渚濈劧瀛樺湪杩欐牱鎴栬呴偅鏍风殑鏈轰細銆備篃璁镐笉缁忔剰闂翠綘鐨勪竴涓垱鎰忓氨寰楀埌浜嗙敤鎴风殑鐑崸锛屾湁骞歌窇鍒版帓琛屾鐨勫墠鍒楋紝浣嗘槸杩欓渶瑕佽冻澶熷鐨勭簿鍔涘拰鑰愭ф潵鎵撶(浣犵殑浜у搧锛屾墠涓嶈嚦浜庢槞鑺变竴鐜般傚悓鏃讹紝涔熶笉鑳藉緱鎰忓繕褰紝璇翠笉濂斤紝灏变細鏈夊悇绉嶅悇鏍风殑鍙兘瀵艰嚧浣犲け鍘讳紭鍔裤傚洜姝わ紝绉诲姩棰嗗煙鐨勭‘鏄竴涓柊鐨勬満浼氾紝浣嗙粷瀵逛笉鏄竴涓兘澶熼殢闅忎究渚挎姄浣忕殑鏈轰細銆傚笇鏈涙垜鐨勫け璐ユ暀璁兘澶熷府鍔╁埌寮鍙戣咃紝浠ユ涓洪壌銆
浣滆呯畝浠嬶細鍒橀搧閿嬶紝鏇句緵鑱屼簬寰蒋浜氭床鐮旂┒闄㈡悳绱㈡妧鏈腑蹇冿紝鐩墠浠庝簨绉诲姩璁惧杞欢鐩稿叧寮鍙戝伐浣滐紝鍏虫敞Android銆乮Phone绛夌浉鍏冲紑鍙戞妧鏈互鍙夾pp聽Store銆丄ndroid聽Market绛変笟鐣屽簲鐢ㄥ晢搴楄繘灞曘
锛堟湰鏂囨潵鑷婄▼搴忓憳銆嬫潅蹇10骞05鏈燂級
銆婄▼搴忓憳銆10骞7鏈堝垔绮惧僵鍐呭棰勫憡锛http://www.programmer.com.cn/3484/
銆婄▼搴忓憳銆嬭闃咃細http://book.csdn.net/programmer/
-------------------------------------------------------------------------------------------------
鏈鏂版湁鐐瑰繖锛屽厛杞浇浜唦~
16 Useful Mathematical Formulas In ActionScript 3
From http://ntt.cc/2010/07/06/16-useful-mathematical-formulas-in-actionscript-3.html
1. Distance Between Two Points
dx = x2 鈥 x1; dy = y2 鈥 y1; dist = Math.sqrt(dx*dx + dy*dy);
2. Inching Formulas
sprite.x += (targetX - sprite.x) * easing;//easing: inching coefficient sprite.y += (targetY - sprite.y) * easing;
3. Elastic Formulas
聽vx += (targetX - sprite.x) * spring; //spring: elastic coefficient vy += (targetY - sprite.y) * spring; sprite.x += (vx *= friction); //friction: friction force sprite.y += (vy *= friction);
4. Flexible Partial Shifts Formulas
var dx:Number = sprite.x - fixedX; var dy:Number = sprite.y - fixedY; var angle:Number = Math.atan2(dy, dx); var targetX:Number = fixedX + Math.cos(angle) * springLength; var targetY:Number = fixedX + Math.sin(angle) * springLength;
5. Rotation With Mouse Formulas
dx = mouseX - sprite.x; dy = mouseY - sprite.y; sprite.rotation = Math.atan2(dy, dx) * 180 / Math.PI;
6. Waveform Formulas
public function onEnterFrame1(event:Event):void {
ball.y=centerScale+Math.sin(angle)*range;
angle+=speed;
}
7. Heartthrob Formulas
public function onEnterFrame1(event:Event):void {
ball.scaleX=centerScale+Math.sin(angle)*range;
ball.scaleY=centerScale+Math.sin(angle)*range;
angle+=speed;
}
8. Circle Rotation Formulas
public function onEnterFrame(event:Event):void {
ball.x=centerX+Math.cos(angle)*radius;
ball.y=centerY+Math.sin(angle)*radius;
angle+=speed;
}
9. Get Circle Area
public function getArea():Number
{
// The formula is Pi times the radius squared.
return Math.PI * Math.pow((width / 2), 2);
}
10. Get Circumference Ratio
public function getCircumference():Number
{
// The formula is Pi times the diameter.
return Math.PI * width;
}
11. Elliptic Rotation Formulas
public function onEnterFrame(event:Event):void {
ball.x=centerX+Math.cos(angle)*radiusX;
ball.y=centerY+Math.sin(angle)*radiusY;
angle+=speed;
}
12. Color operations
var t:uint=0脳77ff8877 var s:uint=0xff000000 var h:uint=t&s var m:uint=h>>>24 trace(m);
13. Hex to Decimal
trace(hexValue);
14. Decimal to Hex
decimalValue.toString(16);
15. Pick Up Color
red = color24 >> 16; green = color24 >> 8 & 0xFF; blue = color24 & 0xFF; alpha = color32 >> 24; red = color32 >> 16 & 0xFF; green = color32 >> 8 & 0xFF; blue = color232 & 0xFF;
16. Color Bit Arithmetic
color24 = red << 16 | green << 8 | blue; color32 = alpha << 24 | red << 16 | green << 8 | blue;
Admob-Mobile advertising and the iPhone
From http://blog.admob.com/2010/06/09/mobile-advertising-and-the-iphone/
Apple proposed new developer terms on Monday that, if enforced as written, would prohibit app developers from using AdMob and Google鈥檚 advertising solutions on the iPhone. These advertising related terms both target companies with competitive mobile technologies (such as Google), as well as any company whose primary business is not serving mobile ads. This change threatens to decrease 鈥 or even eliminate 鈥 revenue that helps to support tens of thousands of developers. The terms hurt both large and small developers by severely limiting their choice of how best to make money. And because advertising funds a huge number of free and low cost apps, these terms are bad for consumers as well.
Let鈥檚 be clear. This change is not in the best interests of users or developers. In the history of technology and innovation, it鈥檚 clear that competition delivers the best outcome. Artificial barriers to competition hurt users and developers and, in the long run, stall technological progress.
Since I started AdMob in 2006, I have watched competition in mobile advertising help drive incredible growth and innovation in the overall ecosystem. We鈥檝e worked to help developers make money, regardless of platform 鈥 iPhone, Android, Palm Pre, Blackberry, Windows, and others. In the past four years, AdMob has helped tens of thousands of developers make money and build real businesses across multiple operating systems.
I鈥檝e personally worked with many iPhone app developers around the world, including one who created a fun and simple game in the early days of the App Store. He built the app because he was interested in the challenge. He built this single app into a multi-million dollar advertising revenue stream with AdMob, hired a whole team, and turned a hobby into a real business.
We see these stories all the time. We want to help make more of them, so we鈥檒l be speaking to Apple to express our concerns about the impact of these terms.
Omar
-----------------------------------------------------------------------------
搴旇瑕佽鍛婂瀯鏂簡鍚э紝姘存灉锛岃秺鏉ヨ秺涓撳埗浜嗐
Security Advisory for Flash Player, Adobe Reader and Acrobat
From Security Advisory for Flash Player, Adobe Reader and Acrobat
Release date: June 4, 2010
Last updated: June 8, 2010
Vulnerability identifier: APSA10-01
CVE number: CVE-2010-1297
Platform: All
Summary
A critical vulnerability exists in Adobe Flash Player 10.0.45.2 and earlier versions for Windows, Macintosh, Linux and Solaris operating systems, and the authplay.dll component that ships with Adobe Reader and Acrobat 9.x for Windows, Macintosh and UNIX operating systems. This vulnerability (CVE-2010-1297) could cause a crash and potentially allow an attacker to take control of the affected system. There are reports that this vulnerability is being actively exploited in the wild against both Adobe Flash Player, and Adobe Reader and Acrobat.
We are in the process of finalizing a fix for the issue, and expect to provide an update for Flash Player 10.x for Windows, Macintosh, and Linux by June 10, 2010. The patch date for Flash Player 10.x for Solaris is still to be determined. We expect to provide an update for Adobe Reader and Acrobat 9.3.2 for Windows, Macintosh and UNIX by June 29, 2010. Please note that the Acrobat and Reader update represents an accelerated release of the next quarterly security update originally scheduled for July 13, 2010. With this accelerated scheduled we do not plan to release any new updates for Adobe Reader and Acrobat on July 13, 2010.
Affected software versions
Adobe Flash Player 10.0.45.2, 9.0.262, and earlier 10.0.x and 9.0.x versions for Windows, Macintosh, Linux and Solaris
Adobe Reader and Acrobat 9.3.2 and earlier 9.x versions for Windows, Macintosh and UNIX
Note:
The Flash Player 10.1 Release Candidate available at http://labs.adobe.com/technologies/flashplayer10/ is confirmed not vulnerable.
Adobe Reader and Acrobat 8.x are confirmed not vulnerable.
MItigations
Adobe Flash Player
The Flash Player 10.1 Release Candidate available at http://labs.adobe.com/technologies/flashplayer10/ is confirmed not vulnerable.
Adobe Reader and Acrobat - Windows
Deleting, renaming, or removing access to the authplay.dll file that ships with Adobe Reader 9.x and Acrobat 9.x mitigates the threat for those products, but users will experience a non-exploitable crash or error message when opening a PDF file that contains SWF content.
The authplay.dll that ships with Adobe Reader 9.x and Acrobat 9.x for Windows is typically located at C:\Program Files\Adobe\Reader 9.0\Reader\authplay.dll for Adobe Reader or C:\Program Files\Adobe\Acrobat 9.0\Acrobat\authplay.dll for Acrobat.
AS3-Water ripples
杩欐槸鍥藉鏌愬弸浜哄湪08骞村紕鐨勪竴涓笢瑗匡紝浠婂ぉ鍒氬ソ鍦╮eader閲岀湅鍒帮紝鍒嗕韩涓嬪惂锛http://www.derschmale.com/2008/08/03/water-ripples-revisited-as3-only-version/
Demo:
Rippler.as:
/*
Copyright (c) 2008 NascomASLib Contributors. See:
http://code.google.com/p/nascomaslib
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
package be.nascom.flash.graphics
{
import flash.display.BitmapData;
import flash.display.BitmapDataChannel;
import flash.display.BlendMode;
import flash.display.DisplayObject;
import flash.events.Event;
import flash.filters.ConvolutionFilter;
import flash.filters.DisplacementMapFilter;
import flash.geom.ColorTransform;
import flash.geom.Matrix;
import flash.geom.Point;
import flash.geom.Rectangle;
/**
*
* The Rippler class creates an effect of rippling water on a source DisplayObject.
*
* @example The following code takes a DisplayObject on the stage and adds a ripple to it, assuming source is a DisplayObject already on the stage.
*
* <listing version="3.0">
* import be.nascom.flash.graphics.Rippler;
*
* // create a Rippler instance to impact source, with a strength of 60 and a scale of 6.
* // The source can be any DisplayObject on the stage, such as a Bitmap or MovieClip object.
* var rippler : Rippler = new Rippler(source, 60, 6);
*
* // create a ripple with size 20 and alpha 1 with origin on position (200, 50)
* rippler.drawRipple(100, 50, 20, 1);
* </listing>
*
* @author David Lenaerts
* @mail david.lenaerts@nascom.be
*
*/
public class Rippler
{
// The DisplayObject which the ripples will affect.
private var _source : DisplayObject;
// Two buffers on which the ripple displacement image will be created, and swapped.
// Depending on the scale parameter, this will be smaller than the source
private var _buffer1 : BitmapData;
private var _buffer2 : BitmapData;
// The final bitmapdata containing the upscaled ripple image, to match the source DisplayObject
private var _defData : BitmapData;
// Rectangle and Point objects created once and reused for performance
private var _fullRect : Rectangle; // A buffer-sized Rectangle used to apply filters to the buffer
private var _drawRect : Rectangle; // A Rectangle used when drawing a ripple
private var _origin : Point = new Point(); // A Point object to (0, 0) used for the DisplacementMapFilter as well as for filters on the buffer
// The DisplacementMapFilter applied to the source DisplayObject
private var _filter : DisplacementMapFilter;
// A filter causing the ripples to grow
private var _expandFilter : ConvolutionFilter;
// Creates a colour offset to 0x7f7f7f so there is no image offset due to the DisplacementMapFilter
private var _colourTransform : ColorTransform;
// Used to scale up the buffer to the final source DisplayObject's scale
private var _matrix : Matrix;
// We only need 1/scale, so we keep it here
private var _scaleInv : Number;
/**
* Creates a Rippler instance.
*
* @param source The DisplayObject which the ripples will affect.
* @param strength The strength of the ripple displacements.
* @param scale The size of the ripples. In reality, the scale defines the size of the ripple displacement map (map.width = source.width/scale). Higher values are therefor also potentially faster.
*
*/
public function Rippler(source : DisplayObject, strength : Number, scale : Number = 2)
{
var correctedScaleX : Number;
var correctedScaleY : Number;
_source = source;
_scaleInv = 1/scale;
// create the (downscaled) buffers and final (upscaled) image data, sizes depend on scale
_buffer1 = new BitmapData(source.width*_scaleInv, source.height*_scaleInv, false, 0x000000);
_buffer2 = new BitmapData(_buffer1.width, _buffer1.height, false, 0x000000);
_defData = new BitmapData(source.width, source.height, false, 0x7f7f7f);
// Recalculate scale between the buffers and the final upscaled image to prevent roundoff errors.
correctedScaleX = _defData.width/_buffer1.width;
correctedScaleY = _defData.height/_buffer1.height;
// Create reusable objects
_fullRect = new Rectangle(0, 0, _buffer1.width, _buffer1.height);
_drawRect = new Rectangle();
// Create the DisplacementMapFilter and assign it to the source
_filter = new DisplacementMapFilter(_defData, _origin, BitmapDataChannel.BLUE, BitmapDataChannel.BLUE, strength, strength, "wrap");
_source.filters = [_filter];
// Create a frame-based loop to update the ripples
_source.addEventListener(Event.ENTER_FRAME, handleEnterFrame);
// Create the filter that causes the ripples to grow.
// Depending on the colour of its neighbours, the pixel will be turned white
_expandFilter = new ConvolutionFilter(3, 3, [0.5, 1, 0.5, 1, 0, 1, 0.5, 1, 0.5], 3);
// Create the colour transformation based on
_colourTransform = new ColorTransform(1, 1, 1, 1, 128, 128, 128);
// Create the Matrix object
_matrix = new Matrix(correctedScaleX, 0, 0, correctedScaleY);
}
/**
* Initiates a ripple at a position of the source DisplayObject.
*
* @param x The horizontal coordinate of the ripple origin.
* @param y The vertical coordinate of the ripple origin.
* @param size The size of the ripple diameter on first impact.
* @param alpha The alpha value of the ripple on first impact.
*/
public function drawRipple(x : int, y : int, size : int, alpha : Number) : void
{
var half : int = size >> 1; // We need half the size of the ripple
var intensity : int = (alpha*0xff & 0xff)*alpha; // The colour which will be drawn in the currently active buffer
// calculate and draw the rectangle, having (x, y) in its centre
_drawRect.x = (-half+x)*_scaleInv;
_drawRect.y = (-half+y)*_scaleInv;
_drawRect.width = _drawRect.height = size*_scaleInv;
_buffer1.fillRect(_drawRect, intensity);
}
/**
* Returns the actual ripple image.
*/
public function getRippleImage() : BitmapData
{
return _defData;
}
/**
* Removes all memory occupied by this instance. This method must be called before discarding an instance.
*/
public function destroy() : void
{
_source.removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
_buffer1.dispose();
_buffer2.dispose();
_defData.dispose();
}
// the actual loop where the ripples are animated
private function handleEnterFrame(event : Event) : void
{
// a temporary clone of buffer 2
var temp : BitmapData = _buffer2.clone();
// buffer2 will contain an expanded version of buffer1
_buffer2.applyFilter(_buffer1, _fullRect, _origin, _expandFilter);
// by substracting buffer2's old image, buffer2 will now be a ring
_buffer2.draw(temp, null, null, BlendMode.SUBTRACT, null, false);
// scale up and draw to the final displacement map, and apply it to the filter
_defData.draw(_buffer2, _matrix, _colourTransform, null, null, true);
_filter.mapBitmap = _defData;
_source.filters = [_filter];
temp.dispose();
// switch buffers 1 and 2
switchBuffers();
}
// switch buffer 1 and 2, so that
private function switchBuffers() : void
{
var temp : BitmapData;
temp = _buffer1;
_buffer1 = _buffer2;
_buffer2 = temp;
}
}
}
PHP-DOMDocument璇诲彇XML
鍞夛紝鍟ラ兘涓嶈浜嗭紝锛岋紝灏濊瘯鏉ュ皾璇曞幓锛屽彂鐜癙HP杩樼湡鏄釜绾犵粨鐨勪笢瑗裤
绀轰緥浠g爜锛寈ml鍦板潃鐢ㄧ殑douban鐨勫紑鏀綼pi锛屽摝锛岃佸埛鏂颁笉鍒扮殑锛屽緢涓嶉潬璋憋綖
< ?php
$xml ="http://api.douban.com/people/letusrock/events/initiate";
$dom = new DOMDocument();
$dom->load($xml);
$xml_value = $dom->getElementsByTagName('entry');
$total = $xml_value->length;
for($i=0;$i< $total;$i++){
echo "娲诲姩鏍囬锛",$xml_value->item($i)->getElementsByTagName("title")->item(0)->nodeValue,"<br />";
}
echo "鎬绘椿鍔ㄦ暟锛",$total;
?>
The Google Font Directory & Google Font API
The Google Font Directory lets you browse all the fonts available via the Google Font API. All fonts in the directory are available for use on your website under an open source license and served by Google servers. You can use them on any non-commercial or commercial project.
You don鈥檛 need to do any programming; all you have to do is add a special stylesheet link to your HTML document, then refer to the font in a CSS style. The Google Font API is compatible with Google Chrome 4.249.4+, Firefox 3.5+, Safari 3.1+ andIE 6+. However, The Google Font API is not currently supported on iPhone, iPad, iPod, or Android.
鍟ラ兘涓嶈浜嗭紝涓嶇煡閬撲腑鏂囧瓧浣撳簱鏈夋病鏈轰細鍋氬埌閲岃竟鈥︹
AS3-LightOut
鏉ヤ釜LightOut灏忔父鎴忥紝鑷充簬LightOut鏄暐锛屽彲浠ョ湅杩欓噷:http://en.wikipedia.org/wiki/Lights_Out_%28game%29
濡傛灉璇ラ〉闈㈣鍜岃皭锛岄偅鍙互鐪嬩笅@dfdou鐨勭畝鍗曚粙缁嶏紝LightOut鏄竴涓紑/鍏虫父鎴忥紝娓告垙鐨勭洰鐨勫緢绠鍗曪紝鍦5x5鐨勭殑鏂归樀閲岋紝鎶婂叏閮ㄧ殑鍥炬崲鎴愪寒鐫鐨勭姸鎬佸氨杩囧叧浜嗭紝Demo閲屾槸鐧借壊鏂瑰潡浠h〃浜捣鐘舵併
瑙勫垯鏄偣鍑讳竴涓柟鍧楋紝鍦ㄦ柟鍧4鍛ㄧ殑4涓柟鍧楀拰鏂瑰潡鏈韩鐨勭姸鎬佷細鍙戠敓鏀瑰彉锛屾槸浜捣灏卞彉鎴愬叧鎺夛紝鏄叧鎺夊氨鍙樻垚浜捣锝
Demo鍦ㄨ繖閲岋細
涓嬭竟鏉ヨ涓嬩唬鐮侀儴鍒嗭紝姣旇緝绠鍗曪紝3涓被鎼炲畾銆
AS3-Key Control Codes Define Class
鍏堟潵鐪嬩笅杩欎釜锛http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/ui/Keyboard.html
杩欓噷杈规槸AIR閲岀殑閿洏瀵瑰簲绫伙紝涓嶈繃寰堝鎬殑鏄湁浜汼TRING_F32 : String = "?"鐨勬牸寮
F32绠楁槸淇濈暀閿紝涓嶈繃STRING_DOWNARROW : String = "?"杩欎釜灏卞緢濂囨簡锛岃繖涓槸鍟ラ敭锛屼笉鏄皬閿洏鐨勫悜涓嬮敭锛
Flash灏辨病杩欎箞濂藉懡浜嗭紝浣犲彧鑳借嚜宸卞啓閿洏瀵瑰簲鐨勯敭鍊硷紝涓嶈繃鏈夊ソ浜烘妸瀵瑰簲閿暣鐞嗕簡鍑烘潵锛屽師鍦板潃鏄湪杩欓噷锛http://ntt.cc/2010/05/03/flash-key-control-codes-define-class.html
Copy涓嬶細
package {
public class KeyControlCode {
public static var KEY_BACKSPACE:uint=8;
public static var KEY_TAB:uint=9;
public static var KEY_ENTER:uint=13;
public static var KEY_SHIFT:uint=16;
public static var KEY_CONTROL:uint=17;
public static var KEY_PAUSE:uint=19;
public static var KEY_CAPSLOCK:uint=20;
public static var KEY_ESC:uint=27;
public static var KEY_SPACEBAR:uint=32;
public static var KEY_PAGEUP:uint=33;
public static var KEY_PAGEDOWN:uint=34;
public static var KEY_END:uint=35;
public static var KEY_HOME:uint=36;
public static var KEY_LEFT:uint=37;
public static var KEY_UP:uint=38;
public static var KEY_RIGHT:uint=39;
public static var KEY_DOWN:uint=40;
public static var KEY_INSERT:uint=45;
public static var KEY_DELETE:uint=46;
public static var KEY_0:uint=48;
public static var KEY_1:uint=49;
public static var KEY_2:uint=50;
public static var KEY_3:uint=51;
public static var KEY_4:uint=52;
public static var KEY_5:uint=53;
public static var KEY_6:uint=54;
public static var KEY_7:uint=55;
public static var KEY_8:uint=56;
public static var KEY_9:uint=57;
public static var KEY_A:uint=65;
public static var KEY_B:uint=66;
public static var KEY_C:uint=67;
public static var KEY_D:uint=68;
public static var KEY_E:uint=69;
public static var KEY_F:uint=70;
public static var KEY_G:uint=71;
public static var KEY_H:uint=72;
public static var KEY_I:uint=73;
public static var KEY_J:uint=74;
public static var KEY_K:uint=75;
public static var KEY_L:uint=76;
public static var KEY_M:uint=77;
public static var KEY_N:uint=78;
public static var KEY_O:uint=79;
public static var KEY_P:uint=80;
public static var KEY_Q:uint=81;
public static var KEY_R:uint=82;
public static var KEY_S:uint=83;
public static var KEY_T:uint=84;
public static var KEY_U:uint=85;
public static var KEY_V:uint=86;
public static var KEY_W:uint=87;
public static var KEY_X:uint=88;
public static var KEY_Y:uint=89;
public static var KEY_Z:uint=90;
public static var KEY_NUMPAD_0:uint=96;
public static var KEY_NUMPAD_1:uint=97;
public static var KEY_NUMPAD_2:uint=98;
public static var KEY_NUMPAD_3:uint=99;
public static var KEY_NUMPAD_4:uint=100;
public static var KEY_NUMPAD_5:uint=101;
public static var KEY_NUMPAD_6:uint=102;
public static var KEY_NUMPAD_7:uint=103;
public static var KEY_NUMPAD_8:uint=104;
public static var KEY_NUMPAD_9:uint=105;
public static var KEY_NUMPAD_MULTIPLY:uint=106;
public static var KEY_PLUS:uint=107;
public static var KEY_SUBTRACT:uint=109;
public static var KEY_DOT:uint=110;
public static var KEY_DIVISION:uint=111;
public static var KEY_F1:uint=112;
public static var KEY_F2:uint=113;
public static var KEY_F3:uint=114;
public static var KEY_F4:uint=115;
public static var KEY_F5:uint=116;
public static var KEY_F6:uint=117;
public static var KEY_F7:uint=118;
public static var KEY_F8:uint=119;
public static var KEY_F9:uint=120;
public static var KEY_F11:uint=122;
public static var KEY_F12:uint=123;
public static var KEY_F13:uint=124;
public static var KEY_F14:uint=125;
public static var KEY_F15:uint=126;
public static var KEY_NUMLOCK:uint=144;
public static var KEY_SCROLLLOCK:uint=145;
public static var KEY_SEMICOLON:uint=186;
public static var KEY_EQUAL:uint=187;
public static var KEY_COMMA:uint=188;
public static var KEY_MINUS:uint=189;
public static var KEY_PERIOD:uint=190;
public static var KEY_SLASH:uint=191;
public static var KEY_BACKQUOTE:uint=192;
public static var KEY_LEFTBRACKET:uint=219;
public static var KEY_BACKSLASH:uint=220;
public static var KEY_RIGHTBRACKET:uint=221;
public static var KEY_QUOTE:uint=222;
}
}
鐢ㄦ硶寰堢畝鍗曪紝浠ュ墠闇瑕佽閿硷紝鐜板湪灏辩敤杩欓噷鐨勯敭鍚嶅氨濂戒簡锝炴劅璋㈡暣鐞嗗嚭鏉ョ殑閭e摜浠
Android-AS3鐨凙Star澶嶅埢鐗
鍥犱负闇瑕侊紝鎵浠ョ洿鎺ユ妸AS3鐗堟湰鐨凙Star澶嶅埢鎴愪簡Java鐗堬紝鍩烘湰涓婁粈涔堥兘娌℃敼銆
鍞夛紝璁╀汉姣旇緝鏃犺鐨勬槸Java閲岀殑ArrayList鍜孉rray鍜╂湁shift鍜寀nshift涔嬬被鐨勫父鐢ㄥ嚱鏁扮殑锛
闂簡鐝噷鍑犱釜浼间箮鍦ㄥ仛Java鐨勪汉锛屽緱鍒扮殑绛旀=娌℃湁绛旀銆
涓嬭竟鏄鍒讳箣鍚庣殑浠g爜锛
AStar.java:
/**
*
*/
package util;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import android.util.Log;
/**
* @author DFdou
*
*/
public class AStar {
// 寰呰冨療琛
private ArrayList<node> _open = new ArrayList</node><node>();
// 宸茶冨療琛
private ArrayList</node><node> _closed = new ArrayList</node><node>();
// 缃戞牸
private Grid _grid;
// 寮濮嬭妭鐐
private Node _startNode;
// 缁撴潫鑺傜偣
private Node _endNode;
// 缁堢偣鑺傜偣鐨勬暟缁
private ArrayList</node><node> _path = new ArrayList</node><node>();
// 鏇煎搱椤夸及浠峰嚱鏁,绠楁í绔栬窛绂诲拰
//private Function _heuristic = manhattan;
// 鍑犱綍浼颁环娉,绠楃洿绾胯窛绂
// private var _heuristic:Function = euclidian;
// 瀵硅绾夸及浠锋硶
// private var _heuristic:Function=diagonal;
// 鐩寸嚎鍓嶈繘浠d环
private float _straightCost = 1.0f;
// 瀵硅绾垮墠杩涗唬浠
private float _diagCost = 1.414f;
public AStar() {
}
// 8鏂瑰悜
public boolean findPath(Grid grid) {
_grid = grid;
// 鍒涘缓寰呰冨療鍒楄〃
_open.clear();
// 鍒涘缓宸茶冨療鍒楄〃
_closed.clear();
// 璧风偣
_startNode = _grid.getStartNode();
// 缁堢偣
_endNode = _grid.getEndNode();
_startNode.g = 0;
// 閫変竴涓及浠峰嚱鏁,浼犲叆璧风偣
_startNode.h = manhattan(_startNode);
_startNode.f = _startNode.g + _startNode.h;
// 杩斿洖瀵昏矾缁撴灉
return search();
}
public boolean search() {
// 灏嗚捣鐐硅妭鐐硅涓哄綋鍓嶈妭鐐
Node node = _startNode;
// 濡傛灉鏈ㄦ湁鍒拌揪鐩爣鑺傜偣
while (node != _endNode) {
// 寰幆鐨勮妭鐐硅寖鍥,涓嶉渶瑕佹娴媑rid鑼冨洿浠ュ鐨勮妭鐐
int startX = Math.max(0, node.x - 1);
int endX = Math.min(_grid.getNumCols() - 1, node.x + 1);
int startY = Math.max(0, node.y - 1);
int endY = Math.min(_grid.getNumRows() - 1, node.y + 1);
for (int i = startX; i < = endX; i++) {
for (int j = startY; j <= endY; j++) {
// 灏濊瘯鑺傜偣
Node test = _grid.getNode(i, j);
// 灏濊瘯鑺傜偣涓哄綋鍓嶈妭鐐,鎴栬呬负涓嶅彲閫氳繃鐨勮妭鐐,鎴栬呬复鎺ヨ妭鐐归兘涓嶈兘閫氳繃閭d箞灏辫烦杩囪鑺傜偣
if (test == node || !test.walkable
|| !_grid.getNode(node.x, test.y).walkable
|| !_grid.getNode(test.x, node.y).walkable) {
continue;
}
float cost = _straightCost;
// 濡傛灉涓嶅湪鍚岀洿绾胯窛绂讳笂,灏辨槸瀵硅绾夸簡锝
if (!((node.x == test.x) || (node.y == test.y))) {
cost = _diagCost;
}
// 璁$畻g鍊
double g = node.g + cost * test.costMultiplier;
// 璁$畻h鍊
double h = manhattan(test);
// 鐩稿姞寰楀埌f
double f = g + h;
// 濡傛灉娴嬭瘯鐐瑰凡缁忓湪寰呰冨療鍒楄〃鎴栬呭凡鑰冨療鍒楄〃閲,灏辨瘮杈冨凡鑰冨療鐨勭粨鏋滄槸鍚︽瘮褰撳墠缁撴灉澶,鏄殑璇濆氨閲嶆柊璧嬪,涔熷氨鏄鎵惧埌浜嗘洿浼樼殑鐐
if (isOpen(test) || isClosed(test)) {
if (test.f > f) {
test.f = f;
test.g = g;
test.h = h;
test.parent = node;
}
// 娴嬭瘯鐐逛笉鍐嶅緟鑰冨療鍒楄〃涓,璧嬪,璁剧疆鐖惰妭鐐,鍔犲叆寰呰冨療鍒楄〃
} else {
test.f = f;
test.g = g;
test.h = h;
test.parent = node;
_open.add(test);
}
}
}
// 鏍规嵁f杩涜鎺掑簭,鏈鍚庝竴涓槸f鍊兼渶灏忕殑
// _open.sortOn("f", Array.NUMERIC);
Comparator comp = new NodeFComparator();
Collections.sort(_open, comp);
// 浣滀负褰撳墠鑺傜偣
// node = _open.shift();
node = _open.get(0);
_open.remove(0);
_open.trimToSize();
}
buildPath();
return true;
}
// 4鏂瑰悜
public boolean findPath4(Grid grid) {
_grid = grid;
// 鍒涘缓寰呰冨療鍒楄〃
_open.clear();
// 鍒涘缓宸茶冨療鍒楄〃
_closed.clear();
// 璧风偣
_startNode = _grid.getStartNode();
// 缁堢偣
_endNode = _grid.getEndNode();
_startNode.g = 0;
// 閫変竴涓及浠峰嚱鏁,浼犲叆璧风偣
_startNode.h = manhattan(_startNode);
_startNode.f = _startNode.g + _startNode.h;
// 杩斿洖瀵昏矾缁撴灉
return search4();
}
public boolean search4() {
// 灏嗚捣鐐硅妭鐐硅涓哄綋鍓嶈妭鐐
Node node = _startNode;
// 濡傛灉鏈ㄦ湁鍒拌揪鐩爣鑺傜偣
while (node != _endNode) {
// 寰幆鐨勮妭鐐硅寖鍥,涓嶉渶瑕佹娴媑rid鑼冨洿浠ュ鐨勮妭鐐
int startX = Math.max(0, node.x - 1);
int endX = Math.min(_grid.getNumCols() - 1, node.x + 1);
int startY = Math.max(0, node.y - 1);
int endY = Math.min(_grid.getNumRows() - 1, node.y + 1);
for (int i = startX; i < = endX; i++) {
for (int j = startY; j <= endY; j++) {
// 灏濊瘯鑺傜偣
Node test = _grid.getNode(i, j);
// 灏濊瘯鑺傜偣涓哄綋鍓嶈妭鐐,鎴栬呬负涓嶅彲閫氳繃鐨勮妭鐐,鎴栬呬复鎺ヨ妭鐐归兘涓嶈兘閫氳繃閭d箞灏辫烦杩囪鑺傜偣
// PS:鍦ㄥ洓鏂瑰悜瀵昏矾鎯呭喌涓嬭烦杩囧瑙掔嚎鐐
if (test == node || !test.walkable
|| !_grid.getNode(node.x, test.y).walkable
|| !_grid.getNode(test.x, node.y).walkable
|| Math.abs(i - node.x) + Math.abs(j - node.y) > 1) {
continue;
}
float cost = _straightCost;
// 濡傛灉涓嶅湪鍚岀洿绾胯窛绂讳笂,灏辨槸瀵硅绾夸簡锝
if (!((node.x == test.x) || (node.y == test.y))) {
cost = _diagCost;
}
// 璁$畻g鍊
double g = node.g + cost * test.costMultiplier;
// 璁$畻h鍊
double h = manhattan(test);
// 鐩稿姞寰楀埌f
double f = g + h;
// 濡傛灉娴嬭瘯鐐瑰凡缁忓湪寰呰冨療鍒楄〃鎴栬呭凡鑰冨療鍒楄〃閲,灏辨瘮杈冨凡鑰冨療鐨勭粨鏋滄槸鍚︽瘮褰撳墠缁撴灉澶,鏄殑璇濆氨閲嶆柊璧嬪,涔熷氨鏄鎵惧埌浜嗘洿浼樼殑鐐
if (isOpen(test) || isClosed(test)) {
if (test.f > f) {
test.f = f;
test.g = g;
test.h = h;
test.parent = node;
}
// 娴嬭瘯鐐逛笉鍐嶅緟鑰冨療鍒楄〃涓,璧嬪,璁剧疆鐖惰妭鐐,鍔犲叆寰呰冨療鍒楄〃
} else {
test.f = f;
test.g = g;
test.h = h;
test.parent = node;
_open.add(test);
}
}
}
// 褰撳墠鑺傜偣宸茬粡鑰冨療杩囦簡,鎵浠ュ氨鍔犲叆宸茶冨療鍒楄〃
_closed.add(node);
// 妫鏌ュ緟鑰冨療琛ㄩ噷闈㈡湁娌℃湁鑺傜偣,娌℃湁灏辨剰鍛崇潃娌℃湁鍙鐨勮矾寰
if (_open.size() == 0) {
return false;
}
// 鏍规嵁f杩涜鎺掑簭,鏈鍚庝竴涓槸f鍊兼渶灏忕殑
// _open.sortOn("f", Array.NUMERIC);
Comparator comp = new NodeFComparator();
Collections.sort(_open, comp);
// 浣滀负褰撳墠鑺傜偣
// node = _open.shift();
node = _open.get(0);
_open.remove(0);
_open.trimToSize();
}
buildPath();
return true;
}
// 寤虹珛璺緞
private void buildPath() {
_path.clear();
Node node = _endNode;
_path.add(node);
while (node != _startNode) {
node = node.parent;
// _path.unshift(node);
_path.add(0, node);
}
}
public ArrayList</node><node> getPath() {
return _path;
}
private boolean isOpen(Node node) {
int len = _open.size();
for (int i = 0; i < len; i++) {
if (_open.get(i) == node) {
return true;
}
}
return false;
}
private boolean isClosed(Node node) {
int len = _closed.size();
for (int i = 0; i < len; i++) {
if (_closed.get(i) == node) {
return true;
}
}
return false;
}
private double manhattan(Node node) {
return Math.abs(node.x - _endNode.x) * _straightCost
+ Math.abs(node.y + _endNode.y) * _straightCost;
}
private double euclidian(Node node) {
float dx = node.x - _endNode.x;
float dy = node.y - _endNode.y;
return Math.sqrt(dx * dx + dy * dy) * _straightCost;
}
private double diagonal(Node node) {
float dx = Math.abs(node.x - _endNode.x);
float dy = Math.abs(node.y - _endNode.y);
float diag = Math.min(dx, dy);
float straight = dx + dy;
return _diagCost * diag + _straightCost * (straight - 2 * diag);
}
// public float getVisited() {
// return ArrayUtils.addAll(_closed, _open);
// }
}
AS3-Sokoban鎺ㄧ瀛-瀵昏矾鎵╁睍
鎭╋紝鏄璺墿灞曪紝鑰屼笉鏄嚜鍔ㄦ眰瑙o綖鑷姩姹傝В閭d釜瀹炲湪杩囦簬澶嶆潅锛屼笉鑰冭檻鍛涔堜笉鑰冭檻銆
鍏堢湅demo锛
渚濈劧鏄墠鍑犲ぉ鐨凷okoban锛屽彧涓嶈繃淇敼浜嗕笅鍦板浘鏁版嵁锛屽彟澶栧姞浜嗕釜鐐瑰嚮瀵昏矾鍔熻兘銆
鍦ㄨ鍘荤殑鐐逛笂鐐逛竴涓嬮紶鏍囷紝灏变細鑷姩绉昏繃鍘讳簡銆
涓嬭竟鏉ヨ涓嬪叿浣撳疄鐜般
AS3-Sokoban鎺ㄧ瀛
鍏堟槸Demo锛
鏂瑰悜閿帶鍒剁Щ鍔紝绾㈣壊鐨勬柟鍧楁槸浣狅綖
UI鍢涳紝灏变笉璇翠簡锛岀綉涓婂伔浜嗙偣鍥撅紝灏辫繖涔堟斁鐫浜嗭紝鏈夊叴瓒g殑鍙互寮勫紕鍛椼
Source code:https://dl.dropbox.com/u/477487/flash/game/sokoban.rar
PS锛氬鏋滆鍦板潃琚拰璋愶紝鑰屼綘鍙堟兂瑕佹簮浠g爜锛岃仈绯绘垜锛屾湇鍔″緢鍛ㄥ埌鐨勶綖
鎺ㄧ瀛愮殑瀹炵幇鏂规硶寰堝锛屽悇鏈夊悇鐨勫仛娉曪紝涓嬭竟鏄垜鐨勫疄鐜版柟寮忥細
Sokoban.as:
package {
import flash.display.Sprite;
import flash.events.Event;
/**
* ...
* @author DFdou
*/
public class Sokoban extends Sprite {
private var _lv = 0;
private var _map:Map;
public function Sokoban() {
init();
}
private function init() {
_map = new Map(_lv);
addChild(_map);
var role:Role = new Role(stage,_map,_lv);
addChild(role);
}
}
}
鏂囨。绫昏骞茬殑浜嬪効灏辨槸鐢熸垚涓涓猰ap锛屼竴涓猺ole銆
Flash – Demo41
Demo锛
閮ㄥ垎Code:
AUIS.as
package org.nwhy.auis {
import flash.display.Sprite;
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.MouseEvent;
public class AUIS extends Sprite {
private var itemHolder:Sprite;
public function AUIS() {
init();
}
private function init() {
initStage();
initListeners();
initItems();
}
private function initStage() {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.frameRate = 55;
}
private function initListeners() {
stage.addEventListener(MouseEvent.MOUSE_DOWN, mClick);
}
private function initItems() {
itemHolder = new Sprite();
addChild(itemHolder);
itemHolder.x = 150;
itemHolder.y = 80;
ItemFactory.createRandomItems(itemHolder,150);
}
private function mClick(e:MouseEvent) {
var sp:Sprite = new Sprite();
addChild(sp);
sp.x = mouseX;
sp.y = mouseY;
//鐢熸垚14涓猧tem
ItemFactory.createClickEffectItems(sp);
}
}
}
Android-涓浜涘叧浜庝唬鐮佷紭鍖栫殑浜嬪効
鍐呭鏉ヨ嚜杩欓噷锛http://www.madhome.org/read.php?tid=1769
鐩存帴寮曠敤浜嗭紝鍞夛紝鐪嬫潵鏈変笉灏戠粏鑺傝娉ㄦ剰銆
绠浠
瀵逛簬鍗犵敤璧勬簮鐨勭郴缁燂紝鏈変袱鏉″熀鏈師鍒欙細涓嶈鍋氫笉蹇呰鐨勪簨 涓嶈鍒嗛厤涓嶅繀瑕佺殑鍐呭瓨
鎵鏈変笅闈㈢殑鍐呭閮介伒鐓ц繖涓や釜鍘熷垯銆
鏈変簺浜哄彲鑳介┈涓婁細璺冲嚭鏉ワ紝鎶婃湰鑺傜殑澶ч儴鍒嗗唴瀹瑰綊浜庘滆崏鐜囩殑浼樺寲鈥濓紙鍙傝[The Root of All Evil]锛夛紝涓嶅彲鍚﹁寰紭鍖栵紙micro-optimization锛屼唬鐮佷紭鍖栵紝鐩稿浜庣粨鏋勪紭鍖栵級鐨勭‘浼氬甫鏉ュ緢澶氶棶棰橈紝璇稿鏃犳硶浣跨敤鏇存湁鏁堢殑鏁版嵁缁撴瀯鍜岀畻娉曘備絾鏄湪鎵嬫寔璁惧涓婏紝浣犲埆鏃犻夋嫨銆傚亣濡備綘璁や负Android铏氭嫙鏈虹殑鎬ц兘涓庡彴寮忔満鐩稿綋锛屼綘鐨勭▼搴忓緢鏈夊彲鑳戒竴寮濮嬪氨鍗犵敤浜嗙郴缁熺殑鍏ㄩ儴鍐呭瓨锛堝唴瀛樺緢灏忥級锛岃繖浼氳浣犵殑绋嬪簭鎱㈠緱鍍忚湕鐗涗竴鏍凤紝鏇撮亼璁哄仛鍏朵粬鐨勬搷浣滀簡銆
Android鐨勬垚鍔熶緷璧栦簬浣犵殑绋嬪簭鎻愪緵鐨勭敤鎴蜂綋楠屻傝岃繖绉嶇敤鎴蜂綋楠岋紝閮ㄥ垎渚濊禆浜庝綘鐨勭▼搴忔槸鍝嶅簲蹇熻岀伒娲荤殑锛岃繕鏄搷搴旂紦鎱㈣屽兊鍖栫殑銆傚洜涓烘墍鏈夌殑绋嬪簭閮借繍琛屽湪鍚屼竴涓澶囦箣涓婏紝閮藉湪涓璧凤紝杩欏氨濡傛灉鍦ㄥ悓涓鏉¤矾涓婅椹剁殑姹借溅銆傝岃繖绡囨枃妗e氨鐩稿綋浜庝綘鍦ㄥ彇寰楅┚鐓т箣鍓嶅繀椤昏瀛︿範鐨勪氦閫氳鍒欍傚鏋滃ぇ瀹堕兘鎸夌収杩欎簺瑙勫垯鍘诲仛锛岄┚椹跺氨浼氬緢椤虹晠锛屼絾鏄鏋滀綘涓嶈繖鏍峰仛锛屼綘鍙兘浼氳溅姣佷汉浜°傝繖灏辨槸涓轰粈涔堣繖浜涘師鍒欏崄鍒嗛噸瑕併
褰撴垜浠紑闂ㄨ灞便佺洿鍑讳富棰樹箣鍓嶏紝杩樺繀椤昏鎻愰啋澶у涓鐐癸細涓嶇VM鏄惁鏀寔瀹炴椂锛圝IT锛夌紪璇戝櫒锛堝畠鍏佽瀹炴椂鍦板皢Java瑙i噴鍨嬬▼搴忚嚜鍔ㄧ紪璇戞垚鏈満鏈哄櫒璇█锛屼互浣跨▼搴忔墽琛岀殑閫熷害鏇村揩銆傛湁浜 JVM鍖呭惈JIT缂栬瘧鍣ㄣ傦級锛屼笅闈㈡彁鍒扮殑杩欎簺鍘熷垯閮芥槸鎴愮珛鐨勩傚亣濡傛垜浠湁鐩爣瀹屽叏鐩稿悓鐨勪袱涓柟娉曪紝鍦ㄨВ閲婃墽琛屾椂foo()姣攂ar()蹇紝閭d箞缂栬瘧涔嬪悗锛宖oo()渚濈劧浼氭瘮bar()蹇傛墍浠ヤ笉瑕佸瘎甯屾湜浜庣紪璇戝櫒鍙互鎷晳浣犵殑绋嬪簭銆
閬垮厤寤虹珛瀵硅薄
涓栫晫涓婃病鏈夊厤璐圭殑瀵硅薄銆傝櫧鐒禛C涓烘瘡涓嚎绋嬮兘寤虹珛浜嗕复鏃跺璞℃睜锛屽彲浠ヤ娇鍒涘缓瀵硅薄鐨勪唬浠峰彉寰楀皬涓浜涳紝浣嗘槸鍒嗛厤鍐呭瓨姘歌繙閮芥瘮涓嶅垎閰嶅唴瀛樼殑浠d环澶с
濡傛灉浣犲湪鐢ㄦ埛鐣岄潰寰幆涓垎閰嶅璞″唴瀛橈紝灏变細寮曞彂鍛ㄦ湡鎬х殑鍨冨溇鍥炴敹锛岀敤鎴峰氨浼氳寰楃晫闈㈠儚鎵撳棟涓鏍蜂竴椤夸竴椤跨殑銆
鎵浠ワ紝闄ら潪蹇呰锛屽簲灏介噺閬垮厤灏藉姏瀵硅薄鐨勫疄渚嬨備笅闈㈢殑渚嬪瓙灏嗗府鍔╀綘鐞嗚В杩欐潯鍘熷垯锛
褰撲綘浠庣敤鎴疯緭鍏ョ殑鏁版嵁涓埅鍙栦竴娈靛瓧绗︿覆鏃讹紝灏介噺浣跨敤substring鍑芥暟鍙栧緱鍘熷鏁版嵁鐨勪竴涓瓙涓诧紝鑰屼笉鏄负瀛愪覆鍙﹀寤虹珛涓浠芥嫹璐濄傝繖鏍蜂綘灏辨湁涓涓柊鐨凷tring瀵硅薄锛屽畠涓庡師濮嬫暟鎹叡浜竴涓猚har鏁扮粍銆 濡傛灉浣犳湁涓涓嚱鏁拌繑鍥炰竴涓猄tring瀵硅薄锛岃屼綘纭垏鐨勭煡閬撹繖涓瓧绗︿覆浼氳闄勫姞鍒颁竴涓猄tringBuffer锛岄偅涔堬紝璇锋敼鍙樿繖涓嚱鏁扮殑鍙傛暟鍜屽疄鐜版柟寮忥紝鐩存帴鎶婄粨鏋滈檮鍔犲埌StringBuffer涓紝鑰屼笉瑕佸啀寤虹珛涓涓煭鍛界殑涓存椂瀵硅薄銆
涓涓洿鏋佺鐨勪緥瀛愭槸锛屾妸澶氱淮鏁扮粍鍒嗘垚澶氫釜涓缁存暟缁勩
int鏁扮粍姣擨nteger鏁扮粍濂斤紝杩欎篃姒傛嫭浜嗕竴涓熀鏈簨瀹烇紝涓や釜骞宠鐨刬nt鏁扮粍姣 (int,int)瀵硅薄鏁扮粍鎬ц兘瑕佸ソ寰堝銆傚悓鐞嗭紝杩欒瘯鐢ㄤ簬鎵鏈夊熀鏈被鍨嬬殑缁勫悎銆 濡傛灉浣犳兂鐢ㄤ竴绉嶅鍣ㄥ瓨鍌(Foo,Bar)鍏冪粍锛屽皾璇曚娇鐢ㄤ袱涓崟鐙殑Foo[]鏁扮粍鍜孊ar[]鏁扮粍锛屼竴瀹氭瘮(Foo,Bar)鏁扮粍鏁堢巼鏇撮珮銆傦紙涔熸湁渚嬪鐨勬儏鍐碉紝灏辨槸褰撲綘寤虹珛涓涓狝PI锛岃鍒汉璋冪敤瀹冪殑鏃跺欍傝繖鏃跺欎綘瑕佹敞閲嶅API鎺ュ彛鐨勮璁¤岀壓鐗蹭竴鐐瑰効閫熷害銆傚綋鐒跺湪API鐨勫唴閮紝浣犱粛瑕佸敖鍙兘鐨勬彁楂樹唬鐮佺殑鏁堢巼锛
鎬讳綋鏉ヨ锛屽氨鏄伩鍏嶅垱寤虹煭鍛界殑涓存椂瀵硅薄銆傚噺灏戝璞$殑鍒涘缓灏辫兘鍑忓皯鍨冨溇鏀堕泦锛岃繘鑰屽噺灏戝鐢ㄦ埛浣撻獙鐨勫奖鍝嶃
浣跨敤鏈湴鏂规硶
褰撲綘鍦ㄥ鐞嗗瓧涓茬殑鏃跺欙紝涓嶈鍚濇儨浣跨敤String.indexOf(), String.lastIndexOf()绛夌壒娈婂疄鐜扮殑鏂规硶锛坰pecialty methods锛夈傝繖浜涙柟娉曢兘鏄娇鐢–/C++瀹炵幇鐨勶紝姣旇捣Java寰幆蹇10鍒100鍊嶃
浣跨敤瀹炵被姣旀帴鍙eソ
鍋囪浣犳湁涓涓狧ashMap瀵硅薄锛屼綘鍙互灏嗗畠澹版槑涓篐ashMap鎴栬匨ap:
Map myMap1 = new HashMap();
HashMap myMap2 = new HashMap();
鍝釜鏇村ソ鍛紵
鎸夌収浼犵粺鐨勮鐐筂ap浼氭洿濂戒簺锛屽洜涓鸿繖鏍蜂綘鍙互鏀瑰彉浠栫殑鍏蜂綋瀹炵幇绫伙紝鍙杩欎釜绫荤户鎵胯嚜Map鎺ュ彛銆備紶缁熺殑瑙傜偣瀵逛簬浼犵粺鐨勭▼搴忔槸姝g‘鐨勶紝浣嗘槸瀹冨苟涓嶉傚悎宓屽叆寮忕郴缁熴傝皟鐢ㄤ竴涓帴鍙g殑寮曠敤浼氭瘮璋冪敤瀹炰綋绫荤殑寮曠敤澶氳姳璐逛竴鍊嶇殑鏃堕棿銆
濡傛灉HashMap瀹屽叏閫傚悎浣犵殑绋嬪簭锛岄偅涔堜娇鐢∕ap灏辨病鏈変粈涔堜环鍊笺傚鏋滄湁浜涘湴鏂逛綘涓嶈兘纭畾锛屽厛閬垮厤浣跨敤 Map锛屽墿涓嬬殑浜ょ粰IDE鎻愪緵鐨勯噸鏋勫姛鑳藉ソ浜嗐(褰撶劧鍏叡API鏄竴涓緥澶栵細涓涓ソ鐨凙PI甯稿父浼氱壓鐗蹭竴浜涙ц兘锛
鐢ㄩ潤鎬佹柟娉曟瘮铏氭柟娉曞ソ
濡傛灉浣犱笉闇瑕佽闂竴涓璞$殑鎴愬憳鍙橀噺锛岄偅涔堣鎶婃柟娉曞0鏄庢垚static銆傞潤鎬佹柟娉曟墽琛岀殑鏇村揩锛屽洜涓哄畠鍙互琚洿鎺ヨ皟鐢ㄨ屼笉闇瑕佷竴涓櫄鍑芥暟琛ㄣ傚彟澶栦綘涔熷彲浠ラ氳繃澹版槑浣撶幇鍑鸿繖涓嚱鏁扮殑璋冪敤涓嶄細鏀瑰彉瀵硅薄鐨勭姸鎬併
涓嶇敤getter鍜宻etter
鍦ㄥ緢澶氭湰鍦拌瑷濡侰++涓紝閮戒細浣跨敤getter锛堟瘮濡傦細i = getCount()锛夋潵閬垮厤鐩存帴璁块棶鎴愬憳鍙橀噺锛坕 = mCount锛夈傚湪C++涓繖鏄竴涓潪甯稿ソ鐨勪範鎯紝鍥犱负缂栬瘧鍣ㄨ兘澶熷唴鑱旇闂紝濡傛灉浣犻渶瑕佺害鏉熸垨璋冭瘯鍙橀噺锛屼綘鍙互鍦ㄤ换浣曟椂鍊欐坊鍔犱唬鐮併
鍦ˋndroid涓婏紝杩欏氨涓嶆槸涓ソ涓绘剰浜嗐傝櫄鏂规硶鐨勫紑閿姣旂洿鎺ヨ闂垚鍛樺彉閲忓ぇ寰楀銆傚湪閫氱敤鐨勬帴鍙e畾涔変腑锛屽彲浠ヤ緷鐓O鐨勬柟寮忓畾涔塯etters鍜宻etters锛屼絾鏄湪涓鑸殑绫讳腑锛屼綘搴旇鐩存帴璁块棶鍙橀噺銆
灏嗘垚鍛樺彉閲忕紦瀛樺埌鏈湴
璁块棶鎴愬憳鍙橀噺姣旇闂湰鍦板彉閲忔參寰楀锛屼笅闈竴娈典唬鐮侊細
for (int i = 0; i < this.mCount; i++) dumpItem(this.mItems);
鏈濂芥敼鎴愯繖鏍凤細
int count = this.mCount; Item[] items = this.mItems; for (int i = 0; i < count; i++) dumpItems(items);
锛堜娇鐢ㄢ漷his鈥濇槸涓轰簡琛ㄦ槑杩欎簺鏄垚鍛樺彉閲忥級
鍙︿竴涓浉浼肩殑鍘熷垯鏄細姘歌繙涓嶈鍦╢or鐨勭浜屼釜鏉′欢涓皟鐢ㄤ换浣曟柟娉曘傚涓嬮潰鏂规硶鎵绀猴紝鍦ㄦ瘡娆″惊鐜殑鏃跺欓兘浼氳皟鐢╣etCount()鏂规硶锛岃繖鏍峰仛姣斾綘鍦ㄤ竴涓猧nt鍏堟妸缁撴灉淇濆瓨璧锋潵寮閿澶у緢澶氥
for (int i = 0; i < this.getCount(); i++) dumpItems(this.getItem(i));
鍚屾牱濡傛灉浣犺澶氭璁块棶涓涓彉閲忥紝涔熸渶濂藉厛涓哄畠寤虹珛涓涓湰鍦板彉閲忥紝渚嬪锛
protected void drawHorizontalScrollBar(Canvas canvas, int width, int height) {
if (isHorizontalScrollBarEnabled()) {
int size = mScrollBar.getSize(false);
if (size <= 0) {
size = mScrollBarSize;
}
mScrollBar.setBounds(0, height - size, width, height);
mScrollBar.setParams(
computeHorizontalScrollRange(),
computeHorizontalScrollOffset(),
computeHorizontalScrollExtent(), false);
mScrollBar.draw(canvas);
}
}
杩欓噷鏈4娆¤闂垚鍛樺彉閲弇ScrollBar锛屽鏋滃皢瀹冪紦瀛樺埌鏈湴锛4娆℃垚鍛樺彉閲忚闂氨浼氬彉鎴4娆℃晥鐜囨洿楂樼殑鏍堝彉閲忚闂
鍙﹀灏辨槸鏂规硶鐨勫弬鏁颁笌鏈湴鍙橀噺鐨勬晥鐜囩浉鍚屻