Xah Web Dev Blog Archive 2013-08

HTML “q” Tag (updated)

Array.prototype Now, the list of methods is complete, with examples.

Random Integer Function 🚀

Array.prototype

Google's Deceptive Ad: Google Puts Ad in Email Under Promotion Tab

CSS Selector Syntax (updated)

HTML: Ruby Tag (updated)

Xah's note extempore #13232, info source of the future

the web is becoming such that sites are dispersed out…

it used to be, there are just few popular sites. For example, for programing, there's slashdot, for open source software, there's soureforge and freshmeat.

today, there are still big sites, such as reddit, hacker news, and the common twitter facebook etc.

however, it seems that, things are getting quite dispersed. often, you get links to a site you never heard of. And some of the sites that was the number one site for a field, but is almost never heard anymore.

i tend to think this is a inevitability. As new sites come in the number of thousands a day, info gets copied, most trying to make money…

my context of this post is that of futurism. That is, what happens to info in a decade or two. For example, will it be from a few sites, or at the opposite extreme where most info you get are from sources you never heard of.

so far, i tend to think it's going to tend to the latter. We'll have a society where info is kinda diverse and incoherent. Kinda like some dystopian dilapidated future in some scifi genre (e.g. 12 Monkeys, Blade Runner). You'll have millions of disparate communities.

as i mentioned before, programing field, web dev, is becoming so incomprehensible. For example, let's say Ruby. Many probably never touched it. But, once you decided to go into it (or JavaScript or other new tech), you realized the space there is huge, and one wonders omg how come i never heard of this…

it's going to be that way, and worse.

in a similar way is gaming communities. For example, you probably never played Second Life. But once you are in for a few months, you realize, there are hundred thousand people in it, and within many different type of communities. They have their own jargons, understanding… quite amazing. Same with say other games such as WarCraft.

so, as a philosopher, or someone who observes society, it's becoming a incredible hard job. This makes sense too, as there are 7 billion people on this earth, and growing, and different countries, cultures. one cannot know, and know relatively less and less of humanity.

this is not surprising actually. Since, for example, if you are American, and never lived in China, India, Arabic countries, you are pretty much ignorant of humanity. Likewise for someone in other country.

and to trace this thought, we have few thousand years of history. Who actually have a basic understanding of it? The language, the culture, the arts, the science, in the past in different regions? that rules out 99.9999% of population. Even professional historian, can only know perhaps less than 0.1% of it.

but the thing is, most of us are not aware of this fact. We go on about our lives, concerned with whatever that's of immediate interest such as current government, smart phones, cars, health. Occasionally reading some link from social network of something from the past and we go wow i learned something today yet never realize that you know shit.

there's superheros with imagined power, such as knowing anyone's thoughts, or knowing everyone's secrets, or vampire that lives thousands of years. And in quite a few scifi. The bottom line of these is knowledge. That's quite interest a topic by itself. For example, from science aspect, is there a limit in our brain to know, the mechanism… then there's philosophy aspect of what will happen if we suddenly know that much? will it change our thinking completely? (and there's the borg of Star Trek, where everyone knows every other's thoughts and entire collective's knowledge. And there's highlander, where you chop off another's head and you immediately obtain all he knows) And also, if say you suddenly know let's just say just Chinese and Spanish and have “read” entirely of these 2 lang's literature in existence, what happens?

there's a lot to say… will stop typing now.

Create Object

Minecraft 3D Demo

Canvas Tutorial: Halma Board Game

Failure of Firefox and Google Chrome's Web Developer Inspector

If you haven't heard, Firefox just killed the venerable “blink” tag. JWZ's blogging about it [http://www.jwz.org/blog/2013/08/a-light-has-gone-out-on-the-web/ ]

Note that blink also doesn't work in latest Google Chrome.

however, jwz's site still have blink. How did he do it?

When you use inspector, you'll see that it doesn't show as CSS. Is it JavaScript? Is it animated gif? Is it Adobe Flash (gasp)?

After going thru the ordeal, i'll let you do the discovery.

Answer (rot13):

it was CSS, animation using @keyframe. Somehow, both Firefox and Google Chrome's inspector failed to show it.

Moral of the day: browser's inspector cannot be trusted 100%. Back to trusty emacs with raw source code.

Get URL (window.location) (for JavaScript beginners.)

JavaScript toy. Tilings and Patterns

CSS: Animation

How to get random element from a array?

// get random item from list
var aa = [1,2,3];
var ii = aa[Math.floor(Math.random() * aa.length)];
console.log(ii);

Firefox kills JavaScript Option

Firefox latest version (version 23, ) killed the preference option to disable JavaScript. Now, it's official, that website is not supposed to work without JavaScript.

in JavaScript, How to determine if a URL is local?

document.location.protocol === "file:"

Learn Canvas in 10 Minutes

Canvas vs SVG (updated)

Scripting SVG

Chinese Font

JavaScript D3 Rotating Voronoi Demo