2013-12-28

♥ JavaScript, Node.js, socket.io ♥

thanks to friends on g+, discovered Socket.io

Socket.IO is a JavaScript library for realtime web applications. It has two parts: a client-side library that runs in the browser, and a server-side library for node.js. Both components have a nearly identical API. Like node.js, it is event-driven.

Socket.IO primarily uses the WebSocket protocol, but if needed can fallback on multiple other methods, such as Adobe Flash sockets, JSONP polling, and AJAX long polling,[2] while providing the same interface. Although it can be used as simply a wrapper for WebSocket, it provides many more features, including broadcasting to multiple sockets, storing data associated with each client, and asynchronous I/O.

It can be installed with the npm (node packaged modules) tool.[3]

if you have Node.js's npm installed, npm install socket.io

JavaScript, Node.js, am in heaven. Screw perl, python.

2013-12-26

♥ Ryan Dahl, mathematician turned programer ♥

been wanting to write this for a while. The node.js creator, Ryan Dahl, i really like. He's a mathematician originally, doing his phd. (i forgot exactly what topic, anyone? algebraic topology or something)

Anyway, i've watched about 5 of his video presentations over the past year year, and read several of his article, opinions on languages and software, and studied his creation node.js.

i really like this guy. This guy, his opinions, are somewhat controversial. But, i find that, his thinking, and views on software, is quite in sync with mine.

i think possibly this is because we are both math guys first. He's never took any computer course. Nor i.

i don't speak for all math guys, but, for me, coming to programing, most of it is pure complex garbage. The coders, in particular unix, perl, python, they don't know what they are talking about. Different ideas are extremely hard to get to them, as i've written few thousand articles on various aspects. 〔☛ Computing & its People

also, note that, mathematicians don't think alive themselves. In fact, there are also camps of extreme opposite styles who don't like the other.

Python creator, Guido, is also a mathematician (don't know exactly to what extent. If he simply has a math digree, that kinda doesn't count.). But, i think he may be a coder before he is a mathematician. His thoughts on computing, stabs mine in every way.

Knuth is a mathematician. Though, i didn't like his thoughts much.

discuss

2013-12-23

beauty and the beast: what's the evolutionary psychology's reason for men preferring beautiful women?

saw a tweet on Chinese weibo, saying that the worst is for you (men) to worry about your looks, because, women don't care. They care about your ability, personality, your commitment to her.

true enough. (is this critically true? well, i think so, but not gonna worry about that now) What got me thinking, is what's the reason that men care about women's looks, but in particular, she be beautiful, not just young.

men like young, and that's because only young ones have more chance of reproduction. But why beautiful? well, youth and beauty are connected, but, the thing is, say there are 5 college teens walking on a street, and say one has the looks of models, but the others are rather ugly. The most beautiful one will be our focus. What's the evolutionary psychology's explanation for this?

O, btw, have you heard of “beauty and the beast”? It's a perennial tale, in fairy tales, folk lores, or today, in movies, novels, posters, comics. (⁖ phamtom of the opera) Male, can be extremely ugly, even a monster, and there can be love between him and a most beautiful girl. However, you never hear a story of a hero loving a ugly or old woman. This reflects our behavior.

#feminism

Xah's Sex Blog

JavaScript declaration and assignment

JavaScript. Multiple variables can be declared on the same line, separated by comma var name1, name2, name3 …;

// declare variable, use 「var」
var x;
var y;

// multiple variables can be declared on the same line, separated by comma
var a, b, c;

Multiple variables can be declared and assigned at the same time.

// declare variable and assign
var x = 4;

// declare variable and assign multiple variables
var a = 1, b = 2, c = 3;

When a variable is declared but not assigned, the default value is undefined.

When a variable is not declared nor assigned, and you try to access it, you get ReferenceError.

var x;
console.log(x); // prints 「undefined」
console.log(y); // ReferenceError: y is not defined

2013-12-22

Teary Eyes, a Need for Intimacy

the primary purpose of tears in weeping is to signify a need for intimacy.

for adults, typically, it's attractive when done by female.

you can see, in media, for example Miley Cyrus's 〈Wrecking Ball〉 featuring big blue eyes with tears. And also, in Lady Gaga's 〈Bad Romance〉

see also Reading Notes on 《Intimate Behavior》

#feminism