13
Nov 13

desperate move by yahoo?

Yahoo hosts domain name auction

I see that as a desperate move to generate revenues for some reasons…

12
Nov 13

Summary of migration to nodejs at paypal

  • Focus on re-use
  • Utilize an Open Source Stack
  • Bootstrap with Bootstrap
  • Use JavaScript Templating
  • Make UI Bits portable to legacy
  • Make it easy to understand and easy to experiment
  • Bring Node to Production
  • . . .

Read details here

04
Nov 13

Late inheritance with __proto__ in javascript

In JavaScript there are so many different ways to inherit a super class. For example, Object.create, jQuery.extend, Child.prototype = new Parent(), and so on.

However, it’s not common to use __proto__ to create inheritance chain in javascript. Let me get to it right now.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var Person = function(name) {
    this.name = name;
}
Person.prototype.sayMyName = function() {
    console.log('My name is ' + this.name);
}
// So we have Person class in javascript.
 
// I want to create a Child class that inherits Person class using __proto__, so show me now!
var Child = function() {
    // calling super class's constructor
    Person.apply(this, arguments);
}
// this is it.
Child.prototype.__proto__ = Person.prototype;
 
var child1 = new Child('Joshua');
child1.sayMyName();
// My name is Joshua

So that does not look quite impressive. One cool thing about __proto__ is that any instance gets it when created. In javascript pretty much anything can be overwritten, which means after you create a regular object you can still make the instance inherit from a particular Class. Here’s a good example of late inheritance.

1
2
3
4
5
6
7
var child2 = {};
 
// oops I forgot to make that as Child's instance. However, __proto__ can help with the situation.
child2.__proto__ = Child.prototype;
child2.sayMyName();
 
// My name is undefined

It sorta worked, but how about parent Class’ constructor execution? Unfortunately you will have to run one line of code as a late inheritance penalty.

1
2
3
Child.call(child2, 'Jesse');
child2.sayMyName();
// My name is Jesse

That was a technique used by many old actionscript developers back in the days to create inheritance chain… We were cautious about its usage since it was undocumented feature and it could have been changed without telling anyone. I’m not sure if all browsers support that syntax, but that’s something good to know and understand how javascript works in my opinion anyways.

29
Oct 13

js features in js engine

Wikipedia has listed them well enough.

25
Oct 13
21
Oct 13

News Ticker (HTML5 : canvas)

I used to make news ticker in flash very long time ago. Today I wanted to make a very simple javascript news ticker using canvas. It took about 15 mins for me to make this basic structure. If I want to make it dynamic like loading external rss-feed or something like that it can be done too, but for now I’m too lazy to add them… maybe later…

source code

19
Oct 13

nodejs applet. please not.

I heard a group of people calls nodejs module as applet. Maybe I’m an old school, but in my book applet is Java Applet ‘water ripple effect over an image’.

I think node module sounds good and people should leave java applet as applet.

15
Oct 13

How to develop unmaintainable software

I’m more interested in the business model this author runs to be honest… ’cause there are so many web applications that need *maintenance*. How do I sign up for the job?

By the way this is the post.

12
Oct 13

Samsung Galaxy Clip

The video clip appeared on my facebook feed. Thought it was a very cleaver idea, which was created by Moonjong Hun (I’m pretty sure that’s the guy ’cause the video clip was embedded to fb by that person). It appears to be a school project.

Some companies already send the university student a job offer already???

08
Oct 13

chickfila coffee

20131008-191421.jpg

did not know it has existed until today.

UPDATE: taste’s bad…

« Older Entries
Newer Entries »

Copyright © 2014 web technologist
Proudly powered by WordPress, Free WordPress Themes