Search

8/28/2009

Ajaxian » Aristo and Ace; Good looking and open?

Ajaxian » Aristo and Ace; Good looking and open?
Antipode - Article - Web app theme showdown: Aristo and Ace
http://cappuccino.org/aristo/showcase/
http://demo.sproutcore.com/sample_controls/


Objective-J - Wikipedia, the free encyclopedia

Objective-J - Wikipedia, the free encyclopedia

Objective-J is a programming language developed as part of the Cappuccino web development framework. Its syntax is nearly identical to the Objective-C syntax and it shares with JavaScript the same relationship that Objective-C has with the C programming language: that of being a strict, but small, superset; adding traditional inheritance and Smalltalk/Objective-C style dynamic dispatch. Pure JavaScript, being a prototype-based language, already has a notion of object orientation and inheritance, but Objective-J adds the use of class-based programming to JavaScript.

Programs written in Objective-J need to be preprocessed before being run by a web browser's JavaScript virtual machine. This step can occur in the web browser at runtime or by a compiler which translates Objective-J programs into pure JavaScript code. The Objective-J compiler is written in JavaScript, consequently deploying Objective-J programs does not require a plugin attached to the web browser.

8/26/2009

AJAX APIs Playground

AJAX APIs Playground

http://www.free-ocr.com/

http://www.free-ocr.com/

For converting PDF, JPG, GIF, TIFF or BMP files to text (i.e., OCR)

Which OCR engine is tesseract using?
Tesseract


tesseract-ocr - Project Hosting on Google Code
An OCR Engine that was developed at HP Labs between 1985 and 1995... and now at Google.

Google Visualization API

Official Google Blog: Opening Google Docs to users and developers via Gadgets and Visualization API
Google 視覺化 API - Google Code
HTML Tables and the Data Web « OUseful.Info, the blog…
Google Code Blog: Table Formatters make Visualization tables even nicer

Data Scraping Wikipedia with Google Spreadsheets « OUseful.Info, the blog…

get IMDB rating: =importXml("http://www.imdb.com/title/tt0088247/", "//div[@class='meta']/b")
Data Scraping Wikipedia with Google Spreadsheets « OUseful.Info, the blog…

So to recap, we have scraped some data from a wikipedia page into a Google spreadsheet using the =importHTML formula, published a handful of rows from the table as CSV, consumed the CSV in a Yahoo pipe and created a geocoded KML feed from it, and then displayed it in a YahooGoogle map.

Functions : Functions for external data - Google Docs Help
Functions: Functions for external data

This new feature lets you get information from filetypes such as xml, html, csv, tsv, as well as RSS and Atom feeds that you might read today in Google Reader.

Additionally, the limit on functions per spreadsheet is 50.

=importXML("URL","query")
* URL - the URL of the XML or HTML file
* query - the XPath query to run on the data given at the URL. For example, "//a/@href" returns a list of the href attributes of all <a> tags in the document (i.e. all of the URLs the document links to). For more information about XPath, please visit http://www.w3schools.com/xpath/
* Example: =importXml("www.google.com", "//a/@href"). This returns all of the href attributes (the link URLs) in all the <a> tags on www.google.com home page

=ImportHtml(URL, "list" | "table", index). This imports the data in a particular table or list from an HTML page. The arguments to the function are as follows:

* URL - the url of the HTML page
* either "list" or "table" to indicate what type of structure to pull in from the webpage. If it's "list," the function looks for the contents of <UL>, <OL>, or <DL> tags; if it's "table," it just looks for <TABLE> tags.
* index - the 1-based index of the table or the list on the source web page. The indices are maintained separately so there might be both a list #1 and a table #1.
* Example: =ImportHtml("http://en.wikipedia.org/wiki/Demographics_of_India", "table",4). This function returns demographic information for the population of India.

Calling Amazon Associates/Ecommerce Web Services from a Google Spreadsheet « OUseful.Info, the blog…

Hack Day tools for non-developers

Hack Day tools for non-developers

Freebase
Dabble DB
Google Docs

8/25/2009

punypng - PNG Image Optimization and Compression - Gracepoint After Five

punypng - PNG Image Optimization and Compression - Gracepoint After Five
punypng Benchmarks | Gracepoint After Five

* punypng: the new kid of the block.
* smush.it: Uses pngcrush as the main PNG optimizer. Currently, available in Yahoo’s YSlow Firefox plug-in. I believe it uses the -brute option for pngcrush.
* OptiPNG: A slighlty better algorithm, compared to pngcrush. In case you’re wondering, Google’s PageSpeed plugin also uses OptiPNG for it’s compression library.
* ImageOptim: The heavyweight contender. Available for OS X, ImageOptim uses every major library out there: advdef, pngcrush, optipng, pngcrush, jpegoptim, jpegtran, and optionally pngout. I ran this the benchmarks with pngout enabled.

Ajaxian » punypng: crushing your images even more

8/23/2009

javascrip animation

Javascript Animation: Tutorial, Part 1 - Schillmania.com
Javascript Animation: Tutorial, Part 2 - Schillmania.com

From my experience and findings over the years, the primary source of CPU drain stems from the browser's reflow/redaw response to dynamic changes in the DOM.

var points = {
// moving a box "from" and "to", eg. on the X coordinate
'from': 200,
'to': 300
}
var frameCount = 20; // move from X to Y over 20 frames
var frames = []; // array of coordinates we'll compute

// "dumb" tween: "move X pixels every frame"
var tweenAmount = (points.to - points.from)/frameCount;
for (var i=0; i<frameCount; i++) {
// calculate the points to animate
frames[i] = points.from+(tweenAmount*i);
}
// frames[] now looks like [205,210,215,220, ... ,300]; etc.

A more realistic tweening effect (including acceleration and deceleration) is achieved by changing the amount of motion made with each frame.

var points = {
// moving a box "from" and "to", eg. on the X coordinate
'from': 200,
'to': 300
}
var animDelta = (points.to - points.from); // how far to move

// animation curve: "sum of numbers" (=100%), slow-fast-slow
var tweenAmount = [1,2,3,4,5,6,7,8,9,10,9,8,7,6,5,4,3,2,1];
// move from X to Y over frames as defined by tween curve
var frameCount = tweenAmount.length;
var frames = []; // array of coordinates we'll compute
var newFrame = points.from; // starting coordinate
for (var i=0; i<frameCount; i++) {
// calculate the points to animate
newFrame += (animDelta*tweenAmount[i]/100);
frames[i] = newFrame;
}
// frames[] now looks like [201,203,206, ... ,228,236,245, ... ,297,299,300]; etc.

A linear acceleration and deceleration motion as above produces a visual improvement over a straight, linear motion. Each loop iteration adds a percentage of the total distance to move according to the tween amount, which adds up to 100%. Full-featured Javascript animation libraries go far beyond this in using bezier curves and fancier math functions, which provide much smoother motion tweens.

Javascript Animation: Tutorial, Part 3
demo: http://www.schillmania.com/content/projects/javascript-animation-2/demo/
Bernie's Better Animation Class , animator.js

8/18/2009

how to foucs on a node

node-focusmanager
http://developer.yahoo.com/yui/3/api/plugin.NodeFocusManager.html#method_focus

CanvasPaint

CanvasPaint
http://canvaspaint.org/paint.js

看: _brushes

border radius for ie6/7 by VML

http://gist.github.com/77516


// border-radius
// Jonah Fox
// MIT Licensed
// Use like : $(".myClass").borderRadius() will attempt to apply curved corners as per the elements -moz-border-radius attribute
// Good:
// - supports textured forgrounds and backgrounds
// - maintains layouts
// - very easy to use
// - IE6 and IE7
// Bad:
// - not fluid. Reapply if the dimensions change
// - only supports rounding all corners
// - no hover
// - no Opera

;(function($){

if($.browser.msie && document.namespaces["v"] == null) {
document.namespaces.add("v", "urn:schemas-microsoft-com:vml");
var ss = document.createStyleSheet().owningElement;
ss.styleSheet.cssText = "v\\:*{behavior:url(#default#VML);}"
}

function RR(o) {
var html = '
'
html += '';
html += '';
html += '
';
html += "
"

return html;
}

$.fn.borderRadius = !$.browser.msie ? function() {} : function(options){

var options = options || {}

return this.each(function() {

var opts = {}

if(this._border_radius_opts) {
opts = this._border_radius_opts
$(this).find(".ie_border_radius").remove();
}
else
{
opts.strokeColor = this.currentStyle.borderColor;
opts.strokeWeight = this.currentStyle.borderWidth;

opts.fillColor = this.currentStyle.backgroundColor;
opts.fillSrc = this.currentStyle.backgroundImage.replace(/^url\("(.+)"\)$/, '$1');

this.style.border = 'none'; // perhaps add onto padding?
this.style.background = 'transparent';
this._border_radius_opts = opts
}

opts.width = $(this).outerWidth()
opts.height = $(this).outerHeight()

var r = options.radius || parseInt( this.currentStyle['-ie-border-radius'] || this.currentStyle['-moz-border-radius'] || this.currentStyle['moz-border-radius'] );

opts.arcSize = Math.min( r / Math.min(opts.width, opts.height), 1);

this.innerHTML += RR(opts);

if(this.currentStyle.position != "absolute")
this.style.position = "relative";


this.style.zoom = 1; // give it a layout
});
}
})(jQuery);

8/13/2009

yql and jsonp-x

http://github.com/yql/yql-tables/blob/65851b91ea92d22563f50c4c61ef5c9c934e1060/netflix/netflix.catalog.xml


// Include the OAuth libraries from oauth.net
y.include("http://oauth.googlecode.com/svn/code/javascript/oauth.js");
y.include("http://oauth.googlecode.com/svn/code/javascript/sha1.js");

// Collect all the parameters
var encodedurl = request.url;
var accessor = { consumerSecret: cks, tokenSecret: ""};
var message = { action: encodedurl, method: "GET", parameters: [["oauth_consumer_key",ck],["oauth_version","1.0"]]};
OAuth.setTimestampAndNonce(message);

// Sign the request
OAuth.SignatureMethod.sign(message, accessor);

try {
// get the content from service along with the OAuth header, and return the result back out
response.object = request.contentType('application/xml').header("Authorization", OAuth.getAuthorizationHeader("netflix.com", message.parameters)).get().response;
} catch(err) {
response.object = {'result':'failure', 'error': err};
}

Pimping JSON - YQL now offers JSONP-X!
Yesterday's announcement of Yahoo's YQL now supporting insert, update and delete overshadowed another interesting new feature: JSONP-X output.

8/12/2009

Bracket - Wikipedia, the free encyclopedia

Bracket - Wikipedia, the free encyclopedia

There are four main types of brackets:

* round brackets, open brackets or parentheses: ( )
* square brackets, closed brackets or box brackets: [ ]
* curly brackets, squiggly brackets, swirly brackets or braces: { }
* angle brackets, diamond brackets, cone brackets or chevrons: < > or ⟨ ⟩

8/10/2009

Keyboard events and key identifiers - Input Method Editors

http://www.w3.org/TR/DOM-Level-3-Events/keyset.html#IME

A.1.3 Input Method Editors

Also known as front end processor, an input method editor (IME) is an application that performs the conversion between keystrokes and ideographs or other characters, usually by user-guided dictionary lookup.

This specification does not provide a representation of the input method editor (IME) events, i.e. the IME's functions and the IME context are not represented in this set. As an example, receiving a keydown for the "Accept" key identifier does not necessarily imply that the text currently selected in the IME is being accepted. It only indicates that a keystroke happened, disconnected from the IME Accept functionality. Depending on the device in use, the IME Accept functionality can be obtain using the Accept key or the Return key. Keyboard events cannot be used to determine the current state of the input method editor.

Keyboard events correspond to the events generated by the input device after the keyboard layout mapping but before the processing of the input method editor.

The following example describes a possible sequence of keys to generate the Unicode character 市 (Kanji character, part of CJK Unified Ideographs) using Japanese input methods. This example assumes that the input method editor is activated and in the Japanese-Romaji input mode. The keys "Convert" and "Accept" may be replaced by others depending on the input device in use and the configuration of the IME, e.g. it could be respectively "U+0020" (Space key) and "Enter".

1. "keydown": "U+0053" (Latin Capital Letter S key)
2. "keyup": "U+0053" (Latin Capital Letter S key)
3. "keydown": "U+0049" (Latin Capital Letter I key)
4. "keyup": "U+0049" (Latin Capital Letter I key)
5. "keydown": "Convert"
6. "keyup": "Convert"
7. "keydown": "Accept"
8. "textInput": "市"
9. "keyup": "Accept"

8/04/2009

Cross-Browser Rich Text Editor (RTE)

Cross-Browser Rich Text Editor (RTE)
via: Rich-Text Editing in Mozilla - MDC

LABjs (Loading And Blocking JavaScript)

LABjs (Loading And Blocking JavaScript) - download
Ajaxian » LABjs: Simple abstraction for loading dependencies correctly
LABjs vs. Steve Souders' script loading methods


// That chain loads all 3 scripts in parallel, and then executes whatever code you want afterwards.
$LAB.script("script1.js").
script("script2.js").
script("script3.js").
block(function () {
// wait for all to load, then do something
script1Func();
script2Func();
script3Func();
});


// In this chain, 4 and 5 load in parallel, then 6 and 7 load in parallel, then functions from 4-7 get executed, then 8 loads by itself, then finally a function in 8 is called.
$LAB
.script("script4.js")
.script("script5.js")
.block()
.script("script6.js")
.script("script7.js")
.block(function(){
script4Func(); script5Func(); script6Func(); script7Func();
})
.script("script8.js")
.block(function(){
script8Func();
});

Best way to load your JavaScript

Best way to load your JavaScript

I’ve come to the conclusion that there’s just one best practice for loading JavaScript without blocking:

1. Create two JavaScript files. The first contains just the code necessary to load JavaScript dynamically, the second contains everything else that’s necessary for the initial level of interactivity on the page.
2. Include the first JavaScript file with a <script> tag at the bottom of the page, just inside the </body>.
3. Create a second <script> tag that calls the function to load the second JavaScript file and contains any additional initialization code.

function loadScript(url, callback) {
var script = document.createElement("script")
script.type = "text/javascript";
if (script.readyState) { //IE
script.onreadystatechange = function () {
if (script.readyState == "loaded" ||
script.readyState == "complete") {
script.onreadystatechange = null;
callback();
}
};
} else { //Others
script.onload = function () {
callback();
};

}
script.src = url;
document.getElementsByTagName("head")[0].appendChild(script);
}


<script type="text/javascript" src="http://your.cdn.com/first.js"></script>
<script type="text/javascript">
loadScript("http://your.cdn.com/second.js", function(){
//initialization code
});
</script>


What if your page requires more than two files? Then you should be concatenating your files together either at build time (using something like Sprockets) or at run time (using something like mod_concat or a combo handler).

getSelectedText

http://www.bloglines.com/js/r200702160/prototype/link_search.js


_getSelectedText: function(limit) {
var q = '';
var pos = [0, 0];
var limit = limit || 200;
var selectionRefNode = null;
try {
if(window.getSelection) {
var sel = window.getSelection();
if (sel) {
var r = null;
q = sel.toString();
if (!q) {
return {text:'', pos:null};
} else {
r = sel.getRangeAt(0).cloneRange();
}
r.collapse(false);
selectionRefNode = sel.anchorNode;
var newNode = document.createElement('span');
newNode.style.position = 'absolute';
newNode.style.display = 'inline';
newNode.style.visibility = 'hidden';
r.insertNode(newNode);
pos = Position.cumulativeOffset(newNode);
Element.extend(newNode).remove();
r.detach();
}
} else if(document.selection) {
var r = document.selection.createRange();
q = r.text;
if (q) {
selectionRefNode = r.parentElement();
pos = Position.cumulativeOffset(r);
pos[0] += document.documentElement.scrollLeft;
pos[1] += document.documentElement.scrollTop;
pos[0] += r.boundingWidth;
// adjust popup mark position
pos[1] -= 02;
}
} else {
q = '';
}
q = q.replace(/((^\s*)|([\n\t\r]+)|(\s*$))/g,'');
if(q.replace(/[^\x00-\xff]/g,"**").length > limit){
q = '';
}
} catch(e) {
alert(e);
q = '';
}
var blogIds = null;
if (selectionRefNode) {
blogIds = this._getBlogIdsBySelectionNode(selectionRefNode);
}
// adjust popup mark position
pos[0] -= 19;
pos[1] -= 20;
return {text:q, pos:pos, ids:blogIds};
},

8/03/2009

[整理] 景點總整理!? - Mobile01 討論群組

[整理] 景點總整理!? - Mobile01 討論群組


*全台固定式測速照相更新 GT整合版(2009.08.02) diomax_ker大大有不定時更新喔連結GT整合版
*國道與省道移動式測速照相警點-諸大更新至2009.07.30
*系統交流道.服務區休息站.收費站.交流道加強版 (anhorng)

*bspc大提供的tomtom己整理之景點 (景點很多,請下載後自行觀看﹗)
*Sam Chen 提供的TomTom景點POI (7-11,OK便利商店,全家便利商店, 萊爾富便利商店, 三商巧福,必勝客,肯得基, 拿坡里披薩,頂呱呱,麥當勞, 達美樂,漢堡王)
*~ kgt530p修改一些minghsieng大大~分享的景點 內含大圖BMP,小圖BMP,包含ov2(有台灣高鐵 中油 85度C 食尚玩家 聞名夜市 非凡美食)

美麗島景點 3854 個 (lisala)
美麗島景點01 好像在我的TAIWAN資料夾內的美麗島景點數量比較多!請大家參考一下!(諸大)
全國溫泉 (anhorng)
澎湖景點 (bspc)
綠島景點完整版 (suaaa)

非凡美食 (ca2002)
時尚玩家
食尚玩家-地方小吃
林龍 的"新美食任務" 景點檔 (徐徐的)
全國夜市 (anhorng)
100家牛肉麵 (anhorng)
全省麥當勞 (hawkchou)
全省肯得基 (WikiGPS轉出)
85度C咖啡蛋糕327筆 (WikiGPS轉出)
統一星巴克咖啡館218筆 (WikiGPS轉出)
清心福全908筆 (WikiGPS轉出)
50嵐259筆 (WikiGPS轉出)

qwertyuiaz同學提供生活量販景點 (家樂福、愛買、大潤發、CosTco好市多、台糖)
家樂福 (阿榮仔)
大潤發 (阿榮仔)
愛買 (exsior10)
全聯福利中心419筆 (WikiGPS轉出)
屈臣氏全省據點 bbsg0341還有各縣市的據點連結
全台寶雅 timber1205
B&Q特力屋共21處 (messageboxs)
全台便利商店 (WikiGPS轉出)
7-ELEVEN便利商店4799筆 (WikiGPS轉出)
全家便利商店2318筆 (samuel900001)
萊爾富便利商店1167筆 (WikiGPS轉出)
OK便利商店821筆 (WikiGPS轉出)

汽車旅館 (qwertyuiaz)
台灣中油公司自助加油站自訂景點 (zabolang)
台塑石油483筆 (suaaa)
台亞加油站 (suaaa)
福懋加油站 (suaaa)
全國加油站106筆 (WikiGPS轉出)
台灣本田服務廠 (steele)
豐田汽車 (exsior10)
太子汽車SUZUKI保養廠全省景點 (alex4531)
其實很多大大的整理已經夠完整了,只是好會沉喔!今天整理完所有網頁,如有遺珠,請告知﹗如有原PO文大大認為小弟未經您同意而連結您的文章,請告知我﹗我便會在最快時間將連結移除.

TomTom專用景點分享,自製景點LOGO讓同學們看的更明瞭唷! lilangwei
TomTom Point景點資訊 ca2002
【 如虎添翼傳說 】 諸大
給2009圖資更新失敗急救方式【有自己己整理之景點(中文檔名) bspc
自製景點操作大圖示 minghsieng
自製景點操作大小圖示包含ov2檔~ kgt530p修改一些minghsieng大大~分享的景點
利用TOMTOM內建景點資訊,快速建立"專用顯示景點資訊與圖示"的方法 netseeker_xp

家樂福與大潤發景點分享 阿榮仔
[分享]麗車坊全台景點 hbh608
2009 台亞.福懋.優力.永固24TPS停車場 (遠東.台塑聯名卡專用景點) suaaa
台灣中油公司自助加油站自訂景點 98/5/6 更新 zabolang
自製TomTom 全省麥當勞景點分享 hawkchou
景點 汽車旅館 qwertyuiaz
分享-TomTom"全台-全家景點資訊" samuel900001
給愛喝"西雅圖及星巴克"的Tom Tom愛用者 debagae
林龍 的"新美食任務" 景點檔 徐徐的
TomTom 景點檔分享-給有北鼻或即將有北鼻的爸爸媽媽 徐徐的
[更新分享景點+大圖示]高雄捷運-紅橘線-含各出入口 morsepig
給愛喝金礦咖啡的景點檔~ kgt530p
分享 - - 上新聯晴,順發 3c , NOVA , 台灣高鐵 , 豐田汽車 景點 exsior10
響應--小小的貢獻一下--PizzaHut必勝客的餐廳店景點檔 d89443005
TomTom 收費站景點補強... hotstuff
台鐵各鐵路站景點(已台鐵網站為主)及台北捷運站景點! Gison
屈臣氏全省據點! bbsg0341 全省據點
全台 寶雅 景點 timber1205
給喜歡大創50元百貨的使用者 (新增FRiDAY'S跟西堤) Alan28
格上租車景點~~~^^ 傲如風
給愛喝五十嵐、清心的TOMTOM愛用者..0610再更新.. (台北縣市為主) eddie104
綠島景點補充 suaaa
[分享] TOMTOM 專用太子汽車SUZUKI保養廠全省景點 alex4531

相關主題

TomTom中文地標轉換程式(OV2<=>TXT) hotsher
愛吃王美食地圖分享的POI如何轉入TomTom使用 techang.
tomtom要怎麼抓到garmin的POI景點? 馬賽克0445
PaPaGo R12的我的最愛景點如何轉給TomTom Go 720 dppman
關於自己更新景點資訊~ MrDolittle

SVG for all… with Flash? « Wikimedia Technical Blog

SVG for all… with Flash? « Wikimedia Technical Blog
svgweb - Project Hosting on Google Code

svgweb implements a highly capable SVG renderer in JavaScript and Flash, bringing high-quality, scriptable SVG support to the ~95% of web users who have either Flash or a naitvely SVG-capable browser.

8/01/2009

量產工具

1. 用 ChipGenius 判斷為何晶片, OCZ Rally 2 是 安國6983
2. 安國 6983 量產工具在 http://dl.mydigit.net/2009/0415/393.html , 或 http://www.xun6.com/file/6612073a9/AlcorMP+090227.rar.html
3. 量產 and 再次量產步驟按照 http://www.mobile01.com/topicdetail.php?f=297&t=879272&p=1 (刷成"本地盤")
update:

裝置名稱: [D:]USB Mass Storage Device(Generic USB Flash Disk USB Device)

PNP裝置ID: VID = 058F PID = 9380
裝置序號: 6&&3B54EA3A&&0&&2
裝置版本: 7.76

裝置類型: 標准USB裝置 - USB2.0高速

晶片製造商: Alcor(安?)
晶片型號: AU6983

產品製造商: Generic
產品型號: USB Flash Disk

資料下載:  http://bbs.mydigit.cn/read.php?tid=4345