發表文章

[MySQL] update inner join

UPDATE [table1_name] AS t1 INNER JOIN [table2_name] AS t2 ON t1.[column1_name] = t2.[column1_name] SET t1.[column2_name] = t2.[column2_name]; 更新t1.column2_name = tb.column2_name的用法 參考連結  http://www.voidtricks.com/mysql-inner-join-update/

[前端] 現代化網站技術分享日重點整理含hackpad

圖片
課程分為 hackPad :  https://hackpad.com/ZWVGk6BFDfn 現代化網頁開發技術三要素 SASS & RWD 前端版型架構規劃 Modern FrontEnd Devops - 104兒童美術館 (cicisasa.com)自動部署上線分享 前端網頁資料視覺化 網頁設計效能優化 現代網頁設計趨勢觀察

[Javascript] Javascript 物件與基本型態運算相關小知識

圖片
這篇是在Javascript.tw社團上有人發問的問題 原理可以參考保哥的 文章 簡單來說就是 保哥 : 任何物件無論做數值運算或字串相加,所有物件都會先執行 valueOf(),物件如果沒有實作 valueOf() 就會跑去執行 toString() 有更詳細的範例可以直接參考保哥的文章囉

[ AngularJS ] 上課筆記 20160131

AngularJS 純前端的Framework 適合 UI CRUD SPA (Single Page Application like Shoppingcarts...) 不適合 大量操縱DOM like CKEditor Webgame Why AngularJS? 如果用innerHtml的話瀏覽器還需要重新編譯 關注點分離,單純只看MVC Angular是直接修改DOM 免除大量的callback 特色 filter是可以一直串下去的,一樣用 | 串起來 Reference http://ngmodules.org/ https://docs.angularjs.org/api http://www.nganimate.org/ model 存在記憶體的某個變數 從頭到尾掃整個view有套用他的地方,並將改變的值寫回去 dirty check - 頻繁的全部掃描 假設輸入匡內輸入12345,但是可能會觸發controller,所以 至少 會掃5*2次 controller 控制所在宣告的DOM的範圍 初始化會先跑一次,透過scope,scope就是model form 內建的FormController DI 相依性注入 JS的數值運算都是用浮點數運算 (0.1 + 0.2) === 0.3 ---->false //2015-12-17 ng-bind-html="item.Description_L" --> 把model的值變成html 不然預設都會做escape ng-change="function/expression" --> 當input值改變時去呼叫function或是expression 感覺好像只有$scope的function才可以被執行(? 用1.4.X版的是這樣 angularJS內建jQuery angular.element('#element').css('height', '100px');

[Javascript] 從陣列中移除物件

原文引用 http://stackoverflow.com/questions/10024866/remove-object-from-array-using-javascript splice https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice Array.splice(index, delete_count);  //1 someArray . shift (); // first element removed //2 someArray = someArray . slice ( 1 ); // first element removed //3 someArray . splice ( 0 , 1 ); // first element removed //4 someArray . pop (); // last element removed someArray = [{ name : "Kristian" , lines : "2,5,10" }, { name : "John" , lines : "1,19,26,96" }, { name : "Brian" , lines : "3,9,62,36" }] johnRemoved = someArray . filter ( function ( el ) { return el . name !== "John" ; }); // johnRemoved = [{name:"Kristian", lines:"2,5,10"},{name:"Brian",lines:"3,9,62,36" }]

[Facebook API] graph api - search 簡單筆記

最近因專案需求需要某些資料 但那些資料如果都讓人為來做實在是太可憐了

[Javascript] convert-object-array-to-hash-map-indexed-by-an-attribute-value-of-the-object

var arr = [ { key : 'foo' , val : 'bar' }, { key : 'hello' , val : 'world' } ]; var result = arr . reduce ( function ( map , obj ) { map [ obj . key ] = obj . val ; return map ; }, {}); console . log ( result ); // { foo: 'bar', hello: 'world' } Note:   Array.prototype.reduce()  is IE9+, so if you need to support older browsers you will need to polyfill it. from  http://stackoverflow.com/questions/26264956/convert-object-array-to-hash-map-indexed-by-an-attribute-value-of-the-object from  https://lodash.com/docs#indexBy var keyData = [   { 'dir' : 'left' , 'code' : 97 } ,   { 'dir' : 'right' , 'code' : 100 } ] ; _. indexBy ( keyData , 'dir' ) ; // → { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } _. ind...