Insight: How to undo a lifetime of training in verbal harm.

4 comments:
I've trained my entire life in how to harm others with words. For years, starting at a very early age, I've watched those around me fire barbs at each other, often growing more and more extreme. I paid close attention, and unwittingly learned important lessons when it comes to harming others vocally.

And so I've become very good at it.

Not only have I learned to harm, but, on occasion, it's become almost a reflex. Especially when I myself have been feeling bad, my finely honed reflex is to strike, and strike hard.

As I walk down the delicate path of non-reaction, I find too that a more subtle error has crept in: sometimes I will convince myself that my words are designed to help, not harm. There are times when strong words are necessary to help another. But I have very little practice there, and more often than not my intention was not positive.

It is good that I'm aware of this, because that's the seed of change. But it will be a long struggle before I can fully unlearn this terrible habit. How can I do that? Well, the tool of detachment and observation comes in rather handy: the barbs will arise, unbidden, and one can observe them. If one senses even a trace of negativity, one can stop and ask the question: would speaking these words help or harm the listener? One can resolve that, if it would harm the listener, that one would remain silent.

How does one know if the words would cause harm? Well, strictly speaking you can't know. But I've found, more and more, it's really useful to just ask the question. It's often the first step in seeing things from the other persons perspective, and indeed, from your own. In any given moment in the mundane world, it is possible to ask, "what do I want out of this situation?" One's actions either contributes to, detracts from, or is neutral for achieving that goal.

Is there a bright side? Absolutely. As a keen verbal warrior, I've noticed that the most painful barbs are those with the most truth to them. That means that these mean and hateful things actually have a core of legitamate insight into the mind of another. If the negativity can be stripped away, what's left is just Insight. Devoid of connotation, the qualities of another are simply qualities - neither weakness nor strength. Cast in the harsh light of a verbal arrow, qualities become only weakness, which is a narrowing of perspective which is a key aspect of a hateful mind. Moving in such a fog, is it any wonder that hateful minds are so miserable?

Of course, this process occurs very quickly - there is pain, the words form mentally, and then are spoken. How can such a fast process be suspended and observed? First, by practicing observation itself. Vipassana is good for that. The other is to accept that, as part of the observation of those acid words, this implies that there is something wrong inside. There is some internal weakness which is showing itself. That understanding gives a boost to one's motivation, "Not only am I avoiding harm for others, but I'm learning about myself which will help me to grow stronger."

Last but not least, how can the Barb, now stripped of hate and turned into Insight, be used? I think the answer is "It can't." The reason is that it's just too risky. Anger leaves a residue that can be difficult to remove completely, and usually silence is the way. Even if the anger is totally gone, the Insight is not likely to be useful as words: most people don't like to hear themselves described in anything less than a flattering light. It can be interesting, however, to remain silent and hold onto that insight to see if it's true, and to see if maybe you can get the person to see it themselves. This is much harder than it sounds, because my training has been to share thoughts immediately. And too it can take a measure of creativity - a lot depends on the situation. Action can be anything from telling a story, to touching the person, to remaining silent, to buying them something. But it's fiercely effective if you can hold your tongue and take rational action designed to help someone else. (It also feels really really good. The mind, now consciously acting for the benefit of another and in a very concrete way, relaxes in some strange way and really starts to enjoy itself. I know, it's totally counter-intuitive. But hey, I didn't design the mind so don't blame me! :)

Eclipse Monkey - Scripting for eclipse

No comments:
It's not ready for prime-time - not even close. But it's a neat project.

The documentation is all over the place. It's super pre-alpha, but there is some working code which is nice. Here are some of the links.

Note that Buckminster is broken, so I'm not sure how to get the source. Everything points to this project being abandonded - inaccuracies in the docs, and the fact that it's most definitely NOT in the Europa release of Eclipse don't bode well.

That's too bad, because Eclipse has needed something like this for a long time (and this actually looks pretty nice.)

There don't seem to be any doms floating around. This is a bad link:

http://download.eclipse.org/technology/dash/update/org.eclipse.dash.doms

Gotta Love David Lynch

No comments:


Bravo!

Get a model of your WoW character

No comments:

Ed Fries gets back into business with one-of-a-kind World of Warcraft 3-D character model printing
In partnership with WoW publisher Blizzard Entertainment, FigurePrints will take orders from consumers at its web site, www.figureprints.com, and then go through an elaborate process before shipping the figures a month later. The models cost $99.95, but Fries thinks that World of Warcraft fans who have played with their characters for years won’t mind paying that price to get a model of their exact in-game character.


That's pretty sweet!

The beauty of news

No comments:
TechCrunch has a story about "the podcasting geek chicks". I have to admit being a bit taken with all of them. I think perhaps I'm intrigued by a girl who's heart may go pitter patter at the sight of a geeky guy. Olivia FTW on Mobuzz.tv..

Blog as Backup - A 21st century invention

No comments:
Dear blog readers,

Some of you may have noticed a huge slew of posts yesterday, and may be wondering "wassup".

Basically in preperation for a full system restore on my tablet (I was fairly convinced it was rootkitted), I published a bunch of blog posts yesterday that had been stored in draft.

"Blog as Backup" is a dangerous approach to publishing. These posts need even more editing than my posts usually do, which is saying an awful lot. I'm not sure if I'll every get around to it.

Why is the blog backup useful? It's useful when publishing is the easiest way to save something on a remote machine. I could have copied the contents of these posts into a draft email message, or even published them as "drafts". But I've learned that my blogger drafts may as well be "extended trash can". And I can't search them. So, as embarrassing as it is, these posts are here for me. It's also useful because now those posts are searchable by me.

More and more I find myself referring to my blog as a reminder of interesting things. It's actually really really useful for that purpose, because I find I can search over my own writing much more effectively than the generic internet. I suspect I'm not alone in sometimes indexing useful ideas against meaningless but memorable phrases like "you heard a shit sandwich". (Snopes says this to Paypal when Paypal claims aspartame causes cancer in a hilarious "cracked.com" video.)

The rise of Domestic Cyberviolence

No comments:
Keyloggers. Deleted file sniffers. Breaking into accounts. It seems to happen to people who used to love each other more than it happens to those who want to steal from each other.

I know one person (who shall remain nameless) who's ex-boyfriend broke into her cell phone records and started harrassing her coworkers and friends. I know another man who's ex-wife got caught installing a keylogger on his PC - she had left the disk in the driver after installing it.

Anecdotally, it turns out that PCs, like guns, are mostly used against the people you love. It's not the anonymous corportation, or a brilliant Ukranian hacker, who's going to steal your data - it's your significant other.


Another way to leverage monopoly

No comments:
I was on apple's site, looking for visual voicemail screenshots, and in order to see them I needed quicktime. Apple does not have a quicktime plugin - you must install it with itunes.

So they've managed to get people to install itunes even for the act of shopping for and iPhone.

Wow. I mean, wow.

Bush's broadband report is bogus

No comments:
Disclaimer: I haven't read the whole thing. I just read the Ars Technica commentary and the executive summary.

Perhaps I don't fully appreciate my options, but it seems like broadband is broken in the US. Current services use either telephone or cable wires, which are almost always owned by a single company. The barrier-to-entry is too high because of government regulation.

Consider what it would take me to start a traditional broadband company. I would have to do the work to lay new cables to homes. This is not economical to do for 1 or 2 homes at a time. You have to get permission from the city to dig up the street - permission they're not likely to provide to a startup.

What about non-traditional broadband, say over a WiFi mesh network? That's great, but such a network still needs gateways to the broader internet - it's the whole peripheral vs. central nervous system thing.

gwt live examples

No comments:
GWT live examples on the "unofficial google wiki". I was particularly fond of "gwt-voices". And the hornet game.

Konfabulator vs. Google Gadgets vs...JavaME?

No comments:
You know, I think Java may have a chance on the desktop. Konfabulator is a very nice development model. But it's a resource hog (10-20MB per widget). And I don't think people really know how to use these widget systems, yet.

the information flow into the major pieces (e.g. summaries), and Let me comment on that second part first. Widget systems should help people shrink downshrink down the type of interaction you have with programs (constrain the interface). And when you do this you also get an opportunity to make it pretty. Widgets should reduce clutter, not add to it. Widgets should always elide information. And yet, it seems like people think that widgets are for gathering even more information onto their desktop, usually crap they don't need. Indeed, even Yahoo seems to promote that idea by distributing all manner of useless widgets (who needs a weather widget?!) I actually believe that widgets would be hugely appealing to developers looking to control and manage their running services (think a Tomcat widget that allows for graphical start, stop, monitor of the server and all contexts, with pretty lights and sound effects.)

Widgets are small in every way. They are tiny programs that offer a subset of the functionality of their larger cousins. They have graphics, and maybe some vague interaction with the local system. What does that sound like? Sounds like JavaME to me.

So this hypothetical "Sun Widgets" (or how about "Solar Flares") product would be a JavaME VM - basically a Smart Phone on your desktop. On first principles, the overhead would be very small. I don't know much about JavaME development, but it seems to fit. I heard that Sun is working with OpenLaszlo on making a JavaME renderer - if that's true then OL would be the natural way to write graphically intense widgets.

Google's Android would also be a good fit for a widget host, come to think of it. I haven't looked at their Desktop SDK but I bet there are likenesses to Android.

Well, if Sun wants to make a play for mobile and the desktop at the same time, I think this is a way to do it.

Using Shared Copy

No comments:
These are some notes about Shared Copy, a newish Web 2.0 annotation tool. Overall, I didn't find it particularly usable - or at least, I couldn't figure out a good way to plug it into my existing workflow.

So I was using SharedCopy for an article on CIO. First, wow, I didn't realize a javascript bookmark could do that! Could be a very handy thing for WeBrowser. Induce people to upgrade when they try to navigate - or intercept the navigation and do it through the overlay. Also have some thoughts on browser/desktop integration.

http://r3.sharedcopy.com/737cug

http://r4.sharedcopy.com/1db6qa

You can't navigate in shared copy - you can't annotate a collection of pages. (In fact navigation is disabled!)

So this means you have to annotate, save, get a URL. Particularly annoying when an article has many pages. (one workaround in that case is to annotate the print page)

"One way to address this under consideration uses peer-to-peer knowledge
or collaborative history of a site—but that raises new problems." - huge value add.

"Sure, we can put in things to put into browsers and frameworks to
make it possible to persist offline. But the larger, harder challenge"
is making the software know what to do. Does the person writing the app
do all that intelligence on both the client and the server—in ASP or
Perl or whatever? "Yes, we provided the tech capability to store data
offline," he says, but it leaves a lot of hard work for the developer
to connect those dots and to answer difficult questions. Do I need to
set policy? As an end user, do I want to do that? Should a Web
application be able to share bank info with Facebook? "That's why we're
engaging with the community of developers the way we are," says
Hachamovitch.

Developers should be part of the discussion.
"Developers need to participate in the evolution of their platform
proactively," Schroepfer says. They can participate in helping the
process, he says, and they have an important stake in doing so.


Ok - apache dirt would be an eclipse wrapped browser over resin and maybe a database. not sure what to do with IIS. eclipse provides the browser (well, the javascript runtime) with some special objects to do desktop integration. packages could be simple or complex - simple would just be a set of files and the server points to the root. complex (java or cgi or) would require some specialized layout; e.g. cgi-bin or WEB-INF. some apps require special server parms, so that should be taken care of, too.


Doug Crockford: Advanced JavaScript

No comments:
Douglas Crockford: "Advanced JavaScript" (1 of 3)
Douglas Crockford: "Advanced JavaScript" (2 of 3)
Douglas Crockford: "Advanced JavaScript" (3 of 3)

Classical vs. prototypal inheritance. JS is about the only example of the latter. It does this with a "secret link" over which names can be resolved.

Augmentation affects objects created prior to the augmentation.

psuedo classical inheritance - looks classical but it isn't: introduce a new operator; constructor fuctions, new operator, prototype member of functions.

if you omit the new keyword, the global variable is clobbered by the constructor (passed in as this). A serious design error with JavaScript.

all function objects get a prototype member object containing a constructor

use the object function to produce new objects that have same state and behavior as existing objects. then augment them by assigning new members.

some functions that don't use 'this 'are "priveledged" and can't be reused. They get secret info from closures.

doug likes parasitic inheritance

be shallow and avoid deep hierarchies. js pays a high performance cost for deep hierarchies.

debugging tools:
  1. IE: ms script debugger (office 2003, visual studio /express)
  2. mozilla: venkman (doesn't work that well in firefox; good on moz), firebug (good but not complete)
  3. safari: drasara
Cool a new tool (and it's free!). He likes watches, call stack, and locals. Has a bug - can't set a breakpoint on first line of a function! Create a stupid first line to workaround.

Venkman: really needs Mozilla. Comes with Mozilla already. tools|web development|turn on debugger.

You can use a 'debugger' statement for programmatic breakpoint. You can wrap a breakpoint around it. helpful for onload bugs.

Video 3 - performance

Hoare's dictum: premature optimization is the root of all evil.

first priority correctness, then optimize.
look for algorithmic solution
common subexpression removal -
loop invariant removal

variables are very cheap - use to cache values.
string concat with + allocates memory (use for small set of things)
[a,b].join(''); doesn't, and it's faster (building a lot of text)

minification vs obfuscation (whitespace and comments vs changing names of thing)
crockford.com/javascript/jsmin.html and then gzipping.

JSON - used for data interchange; easy to parse. uses object literal.
to make json safe, there's a regex that checks before eval.


The Theory of The DOM with Doug Crockford

No comments:
Lecture from http://video.yahoo.com/video/play?vid=111582
http://yuiblog.com/assets/crockford/theory.zip

Browser is source of pain and misery. Can't talk about all the quirks. Talk about the theory of the DOM.
  • Rule breaking
  • Corporate warfare
  • Extreme Time pressure
Started in 1995. Frontline of browser war. MS and NS attacked each other through API incompatibility. Server traps evaded, browser traps remained.

Jesse James Garrett named DHTML AJAX during Pax Microsoft. The browser became stable enough to think of it as a application platform.

URL Flow Paint. FF 1.5 2.0, safari 2.0, IE 5.5, 6, 7, NS 8, Opera 9 "The A List" browsers.

hack for mosaic and navigator 1.0, so it's not needed anymore. Not necessary for 10 years. language=javascript is deprecated. type=text/javascript ignored (problem: MIME type wasn't issued till this year, ignored when loading from source URL). src=URL is very good, added in Navigator 3.

Put script src tags as low in the body of the page as possible. Put CSS as high in head as possible.

Gzip javascript. take advantage of cache headers. For a while, put javascript in one file until widely deployed.

Document.write not recommended. Better alternatives. Sensitive to when you call it. If you call before onload, it's fine, calling after it destroys document.

Lots of collections defined; don't use them either. document.anchors, .applets, .embeds, .forms, .frames, .images, .plugins, .scripts, .stylesheets.

name vs id: used be interchangable, but now use name for form data. used to correlate radio buttons, name window or frame. id uniquely identifies elements to get access.

avoid document.all. Introduced by Microsoft; rejected by W3C.

use document.getElementById(id), .getElementsByName(name), .getElementsByTagName(tag) [can call on any node]

Node or tag names retrieved may be in upper case. Browser will add document and head nodes even if not present. IE and Firefox create a different tree because W3C requires whitespace to be captured. (Which sucks but it's a standard, except for IE).

You have complex pointers, but you only need a subset. You can get by with firstChild, nextSibling:

function walkTheDOM(node, func){
func(node);
while(node){
walkTheDOM(node, func);
node = node.nextSibling
}
}

w3c forgot getElementsByClassName - you can use the above for that. To access class attribute, use .className because class is a reserved word.


Part 2

manipulating elements
  1. old school: img.src = 'someurl'; - smaller and faster, probably preferred.
  2. new school img.setAttribute('src', 'someurl'); - recommended by w3c; set has side effect, so that's nice.
Changing style
  1. node.className = 'myClass'; //note can have multiple classes with space between.
  2. node.style.mystyle
  3. to get css style: IE only: node.currentStyle. w3c: document.defaultView().getComputedStyle(mynode, "").getPropertyValue('mystyle');
  4. to read style info you have to do it both ways. Ugh.
  5. unfortunate naming conventions: css properties are camel case. "should have been designed better."
Making elements (2 6:15)
  1. document.createElement(tagName)
  2. document.createTextNode(text)
  3. node.cloneNode()
  4. node.cloneNode(true) - include all descendants (Q: is there ever a time that you can't do this?)
  5. new nodes aren't connected to the document yet.
Linking Elements
  1. node.appendChild(newNode)
  2. node.insertBefore(newNode, sibling)
  3. node.replaceChild(newNode, oldNode)
  4. old.parentNode.replaceChild(new, old) - weird that you have to specify old twice! w3c screwup - or at least doug doesn't agree with it. :)
removing elements
  1. old.parentnode.removeChild(old) - returns the old node
  2. make sure you remove all event handlers from the oldfirst.
HTML parsing
  1. w3c doesn't provide access to html parser [q: what does this mean? they wanted you to write an html parser and manipulate the dom directly]
  2. Microsoft defined the de facto standard, innerHTML property that all browsers support. Set html here and the parser will insert it into the tree.
Which way is better? Create nodes or pass HTML? A: do what makes your code cleaner and easier to maintain.

Event Model

events single threaded async
always targeted to a node (the top most node containing the cursor)
  1. click
  2. dblclick
  3. mousedown
  4. mousemove
  5. mouseout
  6. mouseover
  7. mouseup
Input events
  1. blur
  2. change
  3. focus
  4. keydown
  5. keypress
  6. keyup
  7. reset
  8. submit
Three ways to attach handlers
  1. node.["on" + type] = f; works on all browsers
  2. node.attachEvent("on" + type, f); MS only
  3. node.addEventListener(type, f, false); w3c - note that type doesn't have "on" in front. last parm is always false
Handlers
take an optional event object. MS puts the event in the global namespace. Use this boilerplate to deal with it:
handler(e){
e= e || event; //if e is falsy, get it from global namespace
var target = e.target || e.srcElement;
}

Trickling and Bubbling - how events propogate
  • trickle: events go from the top node and go down, letting nodes respond
  • bubble: events go from bottom and up to the top.
  • w3c does both - first trickle down, then bubble up. that's what the 3rd parm defines.
  • why bubble? you can attach event listener to parent!!! vs attaching to a bunch of elts.
  • it doesn't stop bubbling - the handler has to be explicit
    • e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation();
    • or use a platform library
  • after the handler finishes the browser takes default action unless you tell it otherwise
    • e.returnValue = false; if (e.preventDefault) e.preventDefault();
    • or use a platform library
Video 3

memory management
  • auto garbage collected
  • possible to hold onto too much state - programmatic error. set to null to let it release.
  • biggest leak in IE6: explicitly remove event handlers before remove them from the DOM. IE6 uses reference counting GC. (that doesn't work with cycles). Didn't show up for a long time because not much script was running and long running pages on the screen. Fixed in IE7. do before removeChild or removeChildren and innerHTML
function purgeEventHandlers(node){
walkTheDOM(node, function(e) {
for (var n in e) {
if (typeof e[n] === 'function') {
e[n] = null;
}
}
)};
}(walk the dom defined elsewhere)

JavaScript features
  1. alert - don't use in ajax - it blocks the browser thread. use platform library instead
  2. confirm -
  3. prompt
  4. setTimeout, set interval
Window
  1. window object is the JavaScript global object
  2. every window, frame, iframe has unique window object.
  3. aka self, parent, top.
Inter-window communication
  1. frames[] - child frames and iframes
  2. name - text name of a window
  3. opener - reference to open
  4. parent
  5. self - reference to this window [what does that mean? from the perspective of the script?]
  6. top - reference to outermost window
  7. window - reference to this window
  8. open() - open a new window - sometimes work but sometimes doesn't. this is what popup blockers block
Interwindow security - 2 rules
  1. can access another window if it can get a reference to it e.g. document.domain === otherwindow.document.domain (won't work with subdomains, unless both scripts shorten their domain to the TLD only)
  2. same origin policy
Cross Browser - shouldn't be an issue, but is. (is that naive?)
  1. Browser detection - not recommended because browsers lie; brittle. (see PPK)
  2. Feature detection - use reflection capabilities
  3. Platform libraries - YAHOO.util.Event developer.yahoo.com/yui
    1. 200 ajax libraries or so, comprehensive minimal, small large team
    2. Doug guesses there will be two winners: MS Atlas (strongest toolset, documentation, support), YUI could be the other winner (minimal, but extensible, best documented, free).
    3. why? real need for api for applications, fun to make
The Cracks of DOM
  • Writing to multiple buglists
  • DOM isn't described fully anywhere - w3c specs aren't complete
  • "skating across 5 layers of cracked ice"
Do what works.
Do what is common.
Do what is standard.

The wall
  1. browsers getting pushed ot limit: memory, balance of client and server. Photo3d hit the wall.
The hole
  1. not designed to be app platform:
  2. lacks compositing model;
  3. accessibility suffers;
  4. lacks support for cooperation under mutual suspicion. Cannot protect mashup components from each other. Be careful about mixing private data.
The peace is ending. MS disbanded the IE team after winning. Firefox made the IE team get back together. 4 major browser makers.

Notes about JavaScript with Doug Crockford

No comments:
My notes while watching...

History of JavaScript with Doug Crockford JavaScript architect
  1. Part 1: 31 minutes
  2. Part 2: 31 minutes
  3. Part 3: 29 minutes
  4. Part 4: 20 minutes
  1. Eich wanted to do Scheme; told no by Netscape
  2. Netscape and Sun alliance - but Sun wanted Java to be in the browser
  3. ECMA language
JavaScript's key ideas
  1. load and go delivery - delivered as source (not binaries).
  2. loose typing - benefit in expressiveness, easier to write.
  3. objects are general containers (objects are hashtables - "brilliant")
  4. prototypal inheritance (objects inherit from objects without classes)
  5. lambda
  6. Linkage through global variables - a really bad idea (security, reliability issues)
Values
  1. number -
    1. internally 64 bit floating iee-754 "double"; only approximation (do arithmetic in whole numbers to avoid problems).
    2. NaN is a special number that's "toxic"; NaN != NaN. typeof NaN is number!
    3. Number() function produces NaN if has a problem; similar to + prefix operator
    4. parseInt(value, radix) - first digit 0 makes it think it's octal, so always include radix.
    5. Math object a mistake, but has useful functions on it.
  2. string -
    1. sequence of 0 or more 16 bit characters
    2. Encoded in UCS-2 not UTF-8. (no awareness of surrogate pairs)
    3. immutable - must make new strings
    4. no separate character time.
    5. can test with == (yay!)
    6. single and double quotes ' or "
    7. has a .length property - not the same as unicode character
    8. defines lots of useful methods
  3. booleans
    1. true and false
    2. Boolean function
    3. false: false, null, NaN, 0, "" [empty string]
    4. string 0 is true, string
  4. null
  5. undefined
    1. default value of parms and values
    2. confusing if a variable has
    3. extract a member that doesn't exist.
Dynamic Objects
  1. new Object() produces empty container of name value pairs.
  2. can access with dot or bracket
  3. no visible hash nature (JScript implemented with linked lists)
Loosely typed
  1. Not untyped - it's just loose.
  2. Syntacticly C, but it allows functions to be values.
  3. start with a letter or _ or $
  4. convention, vars, parms, members, functions start with lower case by convention
  5. initial underscore
  6. recommended to avoid $ for machine; _ for
  7. huge reserved words; also apply to member names
  8. // /**/ for comments
  9. + used for addition and concat (a mistake because loosely typed languages shouldn't have operator overloads
  10. == and != can do type conversion --- recommend that you do === and !== instead to avoid coercion; will run faster and more reliable. (Microsoft caused the reversal of this convention)
  11. && works oddly - if first operand is truthy, result is second operand else result is first operand. Common idiom for nullity check: return a && a.member;
  12. || can be used to set a default value - var foo = input || my_default;
  13. ! does what you expect
  14. !! produces a boolean :)
  15. bitwise & | >> <<- take floating point, turn into 32 bit integer, then turn it back into fp. Note that shifting in Javascript is slower than multiplying by 2.
Statements
  1. labeled breaks for loops
  2. for statemant
    1. special version for objects - for (var name in object){if object.hasOwnProperty(name){} //do something}. otherwise will go through all parent's keys as well.
  3. switch statment; switch value can be a number or a string; case values can be expressions. switch (express){case ';':case',";punctuation(); break;default:somethingElse();}
  4. exceptions: throw new Error(reason); or throw { name: exceptionName, message: reason} (that's an object literal)
  5. try/catch - only ever one catch clause, switch on name. Some built in exception names.
  6. with statement - ambiguous with global variables, don't use it. (5.20 into video 2)
  7. function name(parms){statments;}
  8. var name; var stuff = 0; if no initialization value, undefined.
  9. blocks don't have scope! different from C languages! only function scope! variable in a function visible everywhere in function. declaring a variable twice only makes it get created once.
  10. return. return expression; or return; if no expression, return value is undefined, except for constructors that return "this".
Objects
  1. Unordered collection of name/value pairs
  2. names are strings
  3. values can be any time incl other objects
  4. good for records and trees
  5. like a little database.
  6. object literal notation -
    1. can be used anywhere a value might appear
    2. : seperate name value, , seperates pairs. Note, don't leave trailing comma.
    3. names can be names or strings (optional quotes)
    4. myObject.name is the same as myObject['name']; (not quite the same 'cause you can have a reserved word in the second form!!! Ugh!)
    5. make a new empty object with var myObj = {};
    6. factory methods (makers) common idiom.
    7. tip: can use object parameters for "named parameters" including suitable defaults - think about replacing long list of parms with an object
  7. augmentation - can add new members by assignment.
  8. Linkage- objects can be created with a "secret link" to other objects - member search will fall back to the secret link. object(o) functions makes a new empty object with a link to object o. not used for storing - new members only add to primary member.
    1. var myNewObject(myOldObject); creates a "subclass". Note that assignment or "overriding" doesn't change the parent object - you create a copy of the member in the child class with a different value.
    2. simple: any object can inherit from older objects
  9. Prototypal inheritance
    1. js functions take the place of classes, methods, constructors, and modules!
    2. greater expressive power.
    3. sometimes deleting things makes them mutate (lets the parent object "shine through")
    4. only single inheritance
    5. all objects linked back to Object.prototype. but doesn't have any useful methods. no equals (contains the same stuff), or copy. but does have "hasOwnProperty".
  10. mark and sweep garbage collection
3 ways to create an object
  1. new Object()
  2. {} <-- preferred. (smallest most expressive)
  3. object(Object.prototype)
Objects passed by reference not by value. === compares references not object
delete statment.

Arrays
  1. Unusual because they inherit from Object
  2. indexes converted to strings and used as names for retrieving values
  3. efficient for sparse arrays (e.g. 1% population)
  4. not efficient for other cases
  5. good thing: no need to provide length or type on creation :)
  6. have length member - one higher than highest integer subscript (allows traditional for loop)
  7. literals [] myList =['ad','sdf','sf']; can append to it.
  8. dot notation cannot be used. use [] not new Array() to create a new array.
  9. inherits the array methods: concat, join, push, pop, slice, sort, splice
  10. delete array[number] removed item but leaves a hole. to remove hole use splice
    1. myArray = ['a','b','c','d']; delete myArray[1]; myArray.splice(1,1)
  11. linked to Array.prototype
How to decide between arrays and objects? use objects when names arb strings; arrays when seq integers.

How to decide if a value is an array or object? Two ways
  1. value.constructor === Array
  2. value instanceof Array
  3. niether work if value came from another frame. (omission in the language)
Cannot inherit from an Array - won't inherit length. You can still augment arrays. You can augment all arrays in the system by adding things to array.prototype.


Functions are first class objects.
  1. functions can be passed, returned stored as a value
  2. functions can inherit from Object (it can have methods!)
Function operator takes an optional name, parm list, block of stmts, and returns a func object. Can appear anywhere an expression can appear. Also call lambda.

function statement is shorthand for function assigned to a new var. e.g.
function foo{} is the same is var foo = function foo() {};
function names don't exist in a separate namespace.
can be defined inside of other functions.
inner function has access to the variables and parms of functions it's contained within (Static Scoping or Lexical Scoping) - got this right
  1. scope continues after the parent function returns.
  2. multiple calls to same function won't interact because local variables are renewed (see fade() example 3 - 5:30)
  3. first lambda language to go mainstream.
function in an object called "method".
function invocation

  1. called with too many objects, ignored
  2. too few objects, missing vals are undefined
  3. no type checking



  1. method form: myObject.methodName(args);
    1. get an extra parm called "this" set to myObject
    2. allows us to reuse functions on different objects - relies on invocation to know what object it's linked to.
  2. function form: functionObject(args)
    1. this is set to the global object -
    2. not useful because helper functions don't get to access the outer "this".
  3. Constructor form: new functionObject(args)
    1. new object created and assigned to "this"
    2. this will be returned if no explicit return value.
  4. functions get a special parm called "arguments" when invoked
    1. an array-like object (no array methods) containing all arguments
    2. has a length member
    3. good for functions that take variable number of parameters
Augmenting built-in types (append ".prototype" for the actual object name)
  1. Object
  2. Array
  3. Function
  4. Number
  5. String
  6. Boolean
typeof is broken: array returns it, so does null.

eval is the most misused feature of the language. don't use it. takes a string and compiles it. wastes time. reason they use it: don't know how to do subscript notation; . can use it with JSON - only when you can trust your server. use parseJSON method instead of eval. (The browser uses eval which is why it's there.)

Function function takes a string and compiles it - shouldn't be used in the same way eval shouldn't be used.

avoid new Boolean, new String, new Number because it's a vestigial remnant from Java. Particularly confusing with booleans - a new boolean is true.

3 - 19:45.

Make another object based on another object:
function object(o){
function F() {}
F.prototype = o;
return new F();
}

The global object is always there, but you can't name it or get to it. In browsers, window is the global object. (Browsers create a new object "window" and assign global to it.) Contains all global variables and prototypes.

Global variables are evil
  1. functions in an app can clobber
  2. cooperating apps clobber
  3. minimize it - mashups are going to fail.
  4. made much worse by the implied global - any var not declared is assumed to be global.
  5. jslint.com helps identify that sort of stuff. (doug wrote it)
Every object is a seperate namespace - declare a Yahoo object where everything else is contained within it. Have confidence that we reduce collisions with other scripts. Recommend all uppercase name. they have a registry to make sure no internal collisions occur.

Recommendation: use an anonymous function to wrap your application. take advantage of function scope to encapsulate state. Like this:

JAVAJOSH.WeBrowser = function() {
// define common vars
// define common funcs
return {
getNextPoser: function(cat, diff) {

},
showPoser: function () {
// I guess this is the entry point
}
};
}

} (); // the parens actually invoke this function

This is a "powerful platform on which to make our applications much more reliable".


Video 4
Type system -

Style
  • style isn't about personal taste
  • it's about rigor in expression
  • clearness in presentation
  • product adaptability & longevity
  • good rules keep quality high
  • critically important for JavaScript
  • the language is considered by some to be too soft - requires discipline for balance.
  • most JavaScript is crap
Conventions developed by Doug: http://javascript.crockford.com/code.html

Recommend: always use full forms including semi-colons. Why? Because when compiler sees an error it attempts to replace a nearby linefeed with a semicolon and try again, which can mask errors. Intentional error to make it easier for beginners.

Recommend: break line only after punctuation; don't break after name, string number, ) ] ++ --. Will help detect errors and avoid copy paste errors.

Recommend: avoid tricky expressions with comma operator ?. Avoid extra commas in array literals. It's bad because netscape and IE will report different lengths.

Always use blocks (e.g. in if statments). Only use blocks with structured statments. Define all variables at the top of the function (no advantage to defining at place of first use).

avoid falltrough switch

don't use assignment in condition of if and while. more likely you meant if (a == b)

be aware that == does type coercion. avoid if (a == null) but use if (!a) or if (a === null) [where else does this have an impact?]

never used javascript: as a label, or javascript in urls.

12 Simple Programmer Lessons

No comments:
  1. Stick to one computer as your workstation. If you use multiple computers they will tend to get out of sync WRT setup fairly quickly, especially if you are evaluating a lot of new technologies. Small niggling differences really slow you down. Using SCM will help, but it only goes so far.
  2. The computer you like to work on may surprise you. But when you discover it, go with it. (I found that I like to work on my ultra-portable more than my more powerful PC.)
  3. I think one of the reasons I like Quirky better is that, from the beginning, I treated it as a kind of "disposable PC" - as thin client as possible. Of course, I ended up installing things like Eclipse. But that attitude really helped me keep things simple. I was never tempted to tweak anything or add anything "risky" to the machine, or do any major surgery on it. Because of that, it's stayed very nimble. Another reason I like it is because the keyboard is clickier. :) Of course, I really don't like the fact that the hard drive is clicky! Perhaps when the price of solid state hard drives come down...
  4. Have a work computer, and a play computer. Another reason Quirky is better for me is that I don't use it for playing around. Sumi has some games, and it also has peripherals attached which have associated TSRs. (I do have some some simple games to show off the tablet, though!)
  5. Know what's important in an operating system. First and foremost is stability. It just can't crash. You need a wide selection of software, and if you have peripherals that are important to you, use them. Aesthetics are important, too. Macs are a bit too feminine for my tastes - I like the angular, black look of the Thinkpads. The iPhone "slab" look is pretty good, too, which probably means I'll get the Apple tablet when it comes out.
  6. Programming is different than thinking about programming better, or ways to make a team work better together. It's easy to get distracted by new tools, libraries, processes etc. Every tool will have deficiencies, and the perfect tool just doesn't exist.
  7. NIH 'syndrome' is a double-edged sword - sometimes it's actually appropriate to re-invent something before adopting a 3rd party solution; it's an (expensive, but necessary) learning process. Corallary: you don't really understand something until you've built it.)
  8. Dynamic programming is a different ball of wax - you often don't get code completion. Bad habits like misspellings will kill you. You must know the object model really well.
  9. Recognize when you're in new cognitive territory, and don't start from the middle. Sha hu ri, baby. You may be an accomplished programmer, but learning a new language and new libraries is a big deal. It takes time. It's an especially big deal moving from different kinds of languages - e.g. from Java to JavaScript (which, despite the similar names, are worlds apart). If there is truly reason to make such a huge addition to your toolkit, take the time to learn the technology properly. For JavaScript, that means reading some good books all the way through, doing exercises, writing "bare metal" code first - forget about using all the abstractions (libraries and tools) that exist out there. If you can afford it, hire a teacher.
  10. Don't add new tools until you need them. This requires that you be aware of your needs.The drawback is that you may get stuck in a situation where the thing you needed just doesn't exist. But you'll only do that once, and you'll know why your going down the path that you're now on. So, don't pull in libraries that you don't need - they are complexity barnacles that just slow you down. Don't get too caught up with new technologies, and take hot new tools with a huge grain of salt.
  11. Pay attention to the people behind technologies that you like. Sometimes they want to hide (probably from demanding users) but someone who makes something good is likely to make something else that's good. Send a thank you note or a word of encouragement - don't be shy with praise for open source stuff. People like PPK, like Oliver Steal, like....
  12. Internet researcher is a full time job. Maybe even more than a full-time job. There's a lot of stuff out there, and researching is a different skill set than programming, and like anything, over time you get better at it. But it's still another job. Researching new technologies is not an easy thing, especially when you're "not in the space".

Recordings of the Dead

No comments:
As time goes on, and more and more of our lives are observed by and mediated by technology, the data about us will pile up. The data will be sorted - by others, by us. But these recordings have another purpose: they can bring back memories of the dead.

I don't have a recording of my father's voice. I don't have video of him. I have photographs, and some cherished examples of his handwriting. But, more than anything, I wish I had a recording of his voice. Perhaps it's because the ears truly are the window to the soul.

TV: Who knew post-apocolyptic America would be Boring?

No comments:
If the TV show Jericho is to be believed, post-nuclear-war America is pretty darn boring. No mutants, no extended stays in bomb shelters, or ethical quandaries over whether to resort to cannabalism. Cell phones work, people are generally well fed, and it's business as usual in the world of Jericho.

Someone please tell me: what's the point?

(Another huge problem is the writing. The two episodes that I've seen, some bad guy named Getz was killed despite the warnings from some military colonel that "revenge killings will not be tolerated". It was an act of passion of some guy who's sister Getz killed - that made dramatic sense. What did not make sense was how the "rebels" strung Getz up on a tree on a major road. Why didn't they disappear Getz's body? He had just been fired from his job,and there was bound to be uncertainty over his whereabouts, and they could have, at least, gained time with the colonel, and at best avoided the complication entirely. Then, when the sheriff offers himself the colonel with "terms" that if he surrender he lets the rest of the rangers go...and duh, the colonel just took the sheriff, without the terms. That was just half-bad writing - the colonels reaction was right, but the sheriff's action was just silly. And that's inconsistent with the rest of the sheriff's character.)

Idea: Bio solar power

No comments:
Trees use solar power to grow, and to create fruits and leaves which eventually fall. These items can be a considerable distance from the ground, and the fruit (as in the case of coconut) can be quite massive. Rather than cutting down the tree and burning it (called "hog fuel" for some strange reason) is there a way to recover the potential energy in the elevated fruit? For example, if a coconut were to fall on a water-wheel like device, a small amount of useful work could be recovered. The fruit could be left to rot and feed the tree the mass needed to make more fruit.

Genetic engineering might be used to improve the height of the tree, the side and density (and simplicity of structure) of the fruit, and perhaps the regularity with which the fruit would grow and be positioned on the tree (so as to make positioning of the water wheel more static). (Denser, bigger fruit is useful to avoid certain resistances. However, depending on the contraption, small round fruit like from certain palm trees would be useful. You could put a toroidal basin around several trunks and feed them into a shared water wheel between the trees. The trickle of fruit would be almost constant in some seasons.)

Another variation on this idea would be to attach a strong spring to a growing plant, and use the plant's growth to compress the spring, which could then be used for useful work. Again, the plant would be selected for certain useful qualities, like it's speed and straightness of growth. A sub variation of this (which I'm sure has actually been used) is to use a plant to push the spring apart - for example by burrowing it's roots into a crack. But this might be too slow acting to be useful.

Of course, with any such contraption one must consider the energy cost of construction and maintenance of supporting apparatus. Besides, there is a certain inelegance to the idea when the system isn't "self-contained". How could the tree, without resorting to combustion, produce electricity? Could the water wheel, or it's equivalent, actually be part of the tree? Could batteries grow on trees? (A clever person may note that fruit can be eaten, and work performed from that energy - e.g. you could feed a horse to run on a treadmill that produced electricity. But I would remind that clever person that the citric acid cycle is, in fact, a form of combustion!)


test

No comments:

Test email with png attachment.

Dreading St. Patrick's Day Evening in Seal Beach

No comments:
I like my town, but I don't like how rowdy it gets today. People come from all around to go to the 4 Irish bars on Main Street, and they drink a lot. Even when I used to drink, I never partied here on St. Paddy's day - it's just way too crazy.

It would be nice to spend the night in another town tonight!

Subprime mortgages and the American Honesty Index (AHI)

No comments:
The failure of Bear Stearns in the sub-prime mortgage fiasco has the press all aflutter, predicting that this is the beginning of a long, painful downturn of the economy. (Well, Bear didn't really fail, it just got acquired by JPMorgan for about 10% of it's Friday value, rather than filling Ch. 11).

I am not an economist, nor do I watch the markets very closely. Not a whole lot of my money is in stocks, actually. But, when I look around, I don't see a whole lot of problems, contrary to doom and gloom stories like this one.

Actually, I think this is what will happen: people will get foreclosed on and will move to cheaper rental housing, or move in with the folks. Housing prices will continue to drop, and construction will slow tremendously. Lot's of people's credit will be ruined (well, it was already bad to only qualify for a sub-prime, so really it will just get worse). Some of the lenders (like Bear Stearns) will go out of business, or at least get gobbled up for nothing as with the JPMorgan buyout for 10% of it's worth. And the economy will keep chugging along.

This was a badly needed correction that anyone could see coming *years* ago. Housing prices were (and are) way too high. People started overextending themselves to get in on the action, and lenders were all too happy to play along. Both parties were acting unwisely, and now they're paying the price.

The people who bought that debt were also being unwise. Hopefully investors who buy debt will pay closer attention to what they're really buying. Indeed, I think a lasting effect of this fiasco is a critical blow to the American financial sector's credibility with foreign investors: apparently our institutions cannot be trusted to sell viable debt.

Many economists have said (but please don't ask me to list them!) that one reason the American economy has been so strong for so long is the fundamental honesty of the American businessman. Honesty yields huge efficiencies in deal-making because much less effort need be expended on fact checking and contract enforcement. Ever since Enron, I believe that the American Honesty Index (AHI) has been on the decline, and this mortgage crisis is just the latest big datapoint.

Institutions like Countrywide and Bear Stearns deserve to go out of business. Their investors deserve to lose money. Borrowers deserve to lose their homes. Home prices should come back down to earth. Yes, it hurts. But when you do wrong, pain is the inevitable result. The key is to take it, learn from it, and not let it get you down. It's just life, man.

With any luck, another long term effect will be a simplification of the home loan process. "Mortgage" is just a fancy name for a loan used to buy a home, and they can be fiercely complicated. There is an obvious market need for mortgages with simpler terms. Dare I say it, but there is also a need for mortgages with better terms, too. But you can't really get better until things get simpler first: markets don't work when the consumer is systematically kept ignorant. (This is also the problem with the healthcare industry.)


What direction are those Match.com ad girls getting?

3 comments:
Have you seen those kinda creepy voyeristic match.com ads? They are flash box ads that simulate you watching a web cam feed of a nice looking, young woman using her computer. She plays with her hair, bites her lip, and smiles. She is usually happy about something.

The ads imply that these young women are man-shopping on match.com, and very happy with the selection.

So the question is, what direction are these girls getting?






Announcing my new band: Anatano!

No comments:
I was supposed to be in Mexico building a house for some poor people. But at the last minute I discovered that my Passport expired, which left me with some free time. But it left me feeling a bit restless, and I needed a todo list. Here is part of it:
  1. Send in those warranties
  2. File 2007 taxes
  3. Do the laundry
  4. Clean the kitchen
  5. Make a grilled cheese sandwich
  6. Put some original music on the web.
The last one is rather important, because apart from a (rather lame) video of me playing piano with terrible audio, I've put nothing of my work on the web. I think that's too bad.

But that has now changed.

Please do not have high expectations. This was strictly an exercise in getting the sounds from point a to point b. I expect that my process will change, and so will the music once I get used to my cool new tools (well, kinda new). [Basically I played into Ableton which recorded both MIDI and audio, then added some warmth to the whole track with an effect, exported as WAV, opened with Audacity to snip out the piece I wanted, add the fade out, and save as mp3. I then uploaded to googleapps, and linked to it from this blog post. Easy as pie! :P]

The track is titled "piano doodle" because it's typical of what happens when I sit at the piano. I pick a theme and start playing with it, experimenting as I go. Eventually the idea is to extract the goodness(es), add some layers, and actually make a song. But for now, this is it. I think there are pieces which are quite good, some which are quite bad, and some of it's just boring. But it's online. Yay!

Feedback is appreciated (both on sound quality and composition).

(The next step is to figure out how to embed a Flash mp3 player. I tried to embed XSPF, but the instructions are broken, and strictly speaking this wasn't on my todo list. However, I've created a new "band" on myspace, and uploaded there. :)

Wanted: Firefox Session Manager

No comments:
Let's say you have 2 (or even 3) accounts on the same website, and you need to do something with both. How can this work?
  1. You can login to account 1, get some info, login to account 2, do something; repeat as necessary.
  2. You can use two different kinds of browsers; e.g. Firefox and Safari, and login to account 1 on Firefox and account 2 on Safari.
  3. You can tell your browser, on a per-tab basis, which credentials to use for the site.
#1 is what I observe most people to do, and I've even done it when working on machines that only had one browser type installed. #2 is the workaround that I use. It's actually quite a fine workaround because in this scenario, it's usually about moving information from one account to another, so the lack of a "comfy" UI in the "off browser" isn't critical. #3, though, is ideal. One small problem: it doesn't exist.

Sure, there are plenty of password managers and macro recorders for Firefox. But these only make #1 a bit easier by storing and automatically entering user credentials. But most websites will first check a digest authentication token and only prompt for a username/password pair if that token is missing or invalid.

A (site, username, password) triple isn't enough. We need (site, username, password, token(s)). (Note that (username, password) pair is strictly optional, but username is very useful for identifying the cookies you want to use.)


Since I have to put the kabosh on my iPhone Meditation Timer (I tried to score a Powerbook from work, but it didn't happen), I suppose this is a good alternative.

Zotero Firefox extention for tracking and attributing research

No comments:
I think this is a neat idea. It looks like it's oriented toward academics, but I think it could be handy for anyone doing lots of research on the net (which includes most web developers). And for web developers it may have the happy side-effect of making them more aware of the people behind the tools and technologies they are researching. Perhaps future generations of developers won't suffer from this ailment, but 20- 30-something developers seem to want to treat software as "nameless faceless products". In reality, every piece of software, especially in open source, has a personality behind it. Well, at least all the successful ones. :)

Zotero :: Firefox Add-ons
Zotero [zoh-TAIR-oh] is a free, easy-to-use Firefox extension to help you collect, manage, and cite your research sources...

Online Video Editing: Jumpcut

No comments:
Who would have guessed that something like video could be usefully edited online? And yet, it has happened. Jumpcut.com (apparently owned by Yahoo!) is doing it. No doubt there are several competitors in the space already.

It's not easy, but you can trim, truncate, add transitions. I get the feeling that it will be very easy to outgrow the tool; but for simple things, it is just the trick. Here's a video my mom took during her trip to Hawaii of some sea turtles:



I've added a title and little else. But still, pretty neat.

The Wire: American TV at it's best

No comments:
I saw the last episode of this amazing series just now. Creator David Simon wrote a touching letter about it, and I thought I'd say a few words, too.

There was always something about the HBO series "The Wire". It was often brutal, intense, profane, and violent. It always had an air of honesty, and of introspection, and more than a hint of authenticity. It was an enthralling, extended essay about urban reality at many levels: the personal, the political, the psychological, the social, and the economic. For one born and raised in relative quiet of affluent suburbia, The Wire was a peak into a world only a few miles away. A world you normally only see at the edges.

I always felt that The Wire used violence correctly in that it almost always made you feel sick, or sad. There was never a vicarious thrill to it; it was never portrayed as righteous, with the possible exception of some of Omar's scenes. Violence is unremittingly shown as senseless, evil, and pointless. The same could be said of political maneuvering: no time (or credibility) is wasted defending corruption. It is depicted as the almost reflexive instinct to survive. The view is left to make their own moral pronouncements, and I for one enjoy having my judgment respected.

If anything, The Wire makes the point strongly that "success" on the streets is ultra-violent and short-lived, and that "success" in society requires expert play of the game of manipulation, where a conscience is a sure way to lose. It is an extremely cynical thesis, and I for one truly hope that it's wrong, but I'm grateful for the all-too-believable glimpse into a pathology of American urban culture.

Clever Animation by Alan Becker

No comments:
http://alanbecker.deviantart.com/art/Animator-vs-Animation-34244097

(Basically, an artists Flash animation takes on a life of it's own and seeks to escape the Flash interface itself!)

Geometric Shapes in Photoshop; Interesting CSS things

No comments:
Geometric Shapes in Photoshop

Let's say you want to create something that looks like this:
http://www.fishbydesign.com/3x3-aquarium-grid-413px.png

Creating geometric shapes laid out in a grid is surprisingly tricky in Photoshop. The natural place to start is with the Shape Tool. I think this was actually a bad place to start. (It would have been better to start where I ended up: with the pen tool, paths, and stroke options.)

http://www.javajosh.com-a.googlepages.com/shape-behavior.jpgBy default, the Shape Tool does four things at once:
  1. it creates a new layer,
  2. creates a path,
  3. makes a vector mask out of that path,
  4. then fills the layer with the current foreground color.
This works because the clipping mask only allows the correct shape of the layer contents to shine through. (Interestingly, this is one of the few times in which layer contents don't affect inferior layers).

If you don't want your shape to be filled, you are out of luck because it is not possible to select a "transparent" fill color with the default shape tool.

Of course, true Photoshop users know that the default is only the beginning of the story. In particular, you have some handy options for the shape tool, that look like http://www.javajosh.com-a.googlepages.com/pen-options.gif . Unfortunately, changing options to "Paths" (the middle option) doesn't really fix things, but it does obliquely point in the right direction: we need to be thinking about paths. Needless to say, messing around with canned paths wasted a lot of time (for example, you can kind of composite shapes, and even edit anchor points, but it never worked well), before I started seriously working with the pen tools, and the paths palette.

Basically, all of the above can be drawn with the pen tool using a minimum of fuss, once you've turned on the Grid. The grid is one of Photoshops handiest and most hidden features. It's basically a grid of guides that your tools will snap to, including the pen tool. This makes perfect horizontal and vertical lines easy to make.

You'll be drawing a relatively abstract thing called a "path". This path must then be stroked using a brush. Paths in Photoshop consist of anchor points and guide lines - some anchor points do not have guide lines. I'm not going to go into detail on how to use the pen tools, because it's pretty easy: all of the above were first made as polygons, then using the convert pointhttp://www.javajosh.com-a.googlepages.com/convert-ppoint.gif tool you can turn the corner into a curve, and adjust the guides (along the grid!) to get nice even curves.

Some gotchas: the fill option will be disabled if you have a "bad" layer selected. I'm not sure what makes a layer "bad" - a shape layer with a vector mask certainly is. The easiest thing is to make a new layer and stroke onto it. Once stroked, those pixels are rasterized, and can no longer be edited like a vector.

My understanding of this aspect of photoshop is incomplete. For example, if I attempt to create a shape "by hand" (make a path, create a vector mask, then style the layer with an outside stroke) nothing appears. This is too bad, because it would be nice to be able to keep the vector representation of these shapes around, and just just the rasterized "stamp" when they are stroked.

(Interesting, I found it a lot easier to create these shapes with Sketchup, and they were in 3-D to boot! But Sketchup costs $500 for non-commercial use, and I wanted to know how to do this in Photoshop anyway! Here's the Sketchup output:


http://www.javajosh.com-a.googlepages.com/9-aqauriums-iso-grid.png
I think the reason Sketchup was easier was that I was never mislead into thinking I could use a tool that I really couldn't.)

2 interesting CSS Things

  1. Absolute positioning is relative to the parent element, not the page.
  2. background-repeat: repeat-x; is a very handy trick when you have a one pixel gradient background that needs to terminate into a specific color. (BY default, it will repeat on both the x- and y- axes, which is often ugly on longer pages).

The Satipatthana Sutta

No comments:
I found a good resource for the Satipatthana sutta (as well as other suttas), which are freely available both as text and audio. The recording of Sally Clough reading the Sutta is excellent - she has a strong voice. (I have to admit it sounds a bit odd hearing the Buddha's words being read by a woman :)

Meditation in an isolation tank?

2 comments:
The thought occurred to me that meditation in an isolation tank would be an excellent opportunity for the mind to focus on the subtlest of sensations, and on the mind itself. In the next few weeks I plan on hiring a tank for 90 minutes (there's a location in Venice that offers this servuce), and see what it's like. I'll be sure to report back my findings. (it's heartening to me that people like Richard Feynman found the experience useful).

More Firefox crashing woes

No comments:
It's happening now in other places, not just Gmail. It's particularly painful when I loose a ScribeFire blog post (which happened just now as I was noticing the similarities between traditional ISPs and the central nervous system, and newfangled wifi networks and the peripheral nervous system).

At this point I'm going to disable some of my plugins and see if that helps at all. I'll keep just firebug and scribefire and see if that helps.


iPhone SDk released - let the fun begin!

No comments:
You can go here or here to get the ball rolling. The site is experiencing heavy traffic, needless to say, so there may be delays. But the process is simple:
  1. Get an apple id (you should already have one if you have an iPhone - it's usually your email address)
  2. Sign up as an iPhone developer.
  3. Click on the link in the signup confirmation email
  4. Wait patiently for Apple's servers to unmelt.
(I wonder if they considered going with Akamai for this rollout?)

The first thing I will write for the iPhone is a meditation timer. It will have the following features:
  1. Gong or chant alarm sound
  2. No repeat option. (e.g. just sound once)
  3. Volume selection. (e.g. sound quietly)
  4. Brightness option.
  5. "Don't turn off the display" option. (sometimes it's nice to peak)
  6. "touch anywhere on the screen to shut off" option
  7. Multi-alarms (such as 60 then 5 minutes - useful for some kinds of meditations).
Meditation timers should be quiet, shouldn't repeat, and should be easy to turn off. The default timer is none of these things. It should also support custom sounds.

The next thing I'd like to write is an interface to the MINI's navigation system. :)

Vipassanā 2008

No comments:
Vipassanā means "insight" in Pali, the language the Buddha Gotema spoke in India some 2500 years ago. There are many kinds of Vipassanā extant today; the type which I enjoy practicing is quite minimalist, and depends purely on one's powers of concentration and observation. Without mantras, visualizations, commentary or vocalizations one simply observes physical sensation in a concentrated, systematic fashion.

It is not an easy technique because you are never shielded from these sensations, and they may be quite painful (they may also be quite blissful, which is far, far worse believe me!). But somehow, if one perseveres and is patient, these various pains dissolve seemingly on their own, and it's quite interesting to watch it happen.

Another great difficultly with something this minimal is that it's quite tempting to add to the technique. I believe that one continues to add subtle things to the technique until one gets very far along the path. I think that "noticing the things that you're adding" is actually an important part of the path. These additions tend to sneak up on you!

Of course, this is all well and good, but the "proof is in the pudding", so to speak. When considering any practice, the key question is: Does this make life better for you and those around you? Unequivocally the answer is yes, at least in my case.

Use a laptop as a keyboard, monitor, and mouse - finally!

No comments:
When I used to fix people's computers, it seems like a lot of the time I couldn't rely on their KVM working, and had to lug around my own. It occured to me at the time that it would be really cool to use a laptop for the purpose: after all, it has all the necessary components in a nice, easy to carry package. And now Epiphan has done it:

http://www.epiphan.com/products/product.php?pid=27

It's a small $400 USB 2.0 box that does frame capture and sends keyboard and mouse signals (which are also recorded, hopefully). What a great way to audit PC repairs!