Showing posts from December 15, 2013

Wilt Thou Gallantly Tilt at Windmills

Tilting at windmills is an English idiom which means attacking imaginary enemies. The word “tilt”, in this context, comes from jousting.The phrase is sometimes used to describe confrontations where adversaries are incorrectly perceived, or to courses of action that are based on misinterpreted or misapplied heroic, romantic, or idealistic justifications. It may also connote an importune, unfounded and vain effort against confabulated adversaries for a vain goal.Wilt Thou Gallantly Tilt at Windmills?

Writing Programing Tutorial vs Coding a Project

writing programing language tutorial isn't easy, and is extremely time consuming. Suppose you are reading a book or a doc. In few minutes, or even after a hour with coding, you understood it, and can employ it right away in your project or job. But, if you want to write a tutorial of what you just learned, it'll take 10 folds more time. Because, first of all you have to give context of why, and this aspect often takes some research by itself. Then, you have to have a good understanding of the whole instead of just the parts you just understood, because otherwise its like the blind men feeling the elephant and you can't say to readers that a elephant is pillar-like and period (this happens to haskell monad blogs). Then, you need to give good examples. Proper ones, and ones that are idiomatic, industrial accepted. So, it's like you have to have a survey of sorts, either from experience or have read tons about it. And, if you are like me, have idiosyncratic bent on things…

JavaScript Unicode Search box

major update on unicode search. You can search by name, codepoint (decimal or hexadecimal) or paste in Unicode characters. Search is now real-time. Result shows as you type. For example, try to find unicode related to christmas. 🎄🎅.Use the search box at Unicode Symbology ☢ ☯ ☭ ∑ ∞ ♀ ♂ ♥Unicode search screenshot

JavaScript Name Hosting and One-Liner Functional Style

JavaScript has name hosting. 〔☛ JavaScript: Variable & Function Declaration Order: Name Hoisting〕 and i think Douglas Crockford recommends to move all vars to the top, to reflect reality.but look at the following code. Moving all var to the top would be silly.functiondisplaySearchResult (charArray, anchorNode) { // clear the result first while (anchorNode.hasChildNodes()) { anchorNode.removeChild(anchorNode.lastChild); } if ( charArray.length === 0 && searchBox.value.length !== 0) { varnoResult = document.createElement("span"); noResult.innerHTML = "none found. Try type more characters, or try “star”, decimal search “#97”, hexadecimal search “#x61”, or enter a Unicode “♥”";"red"; anchorNode.appendChild(noResult); } else { for (varii = 0; ii < charArray.length ; ii++) { varuNum = charArray[ii]; varuHex = uNum.toString(16);������������…