Latest Entries »

How software piracy can actually be a boon

Most statistics against software piracy assumes that each pirated software equals one lost sale, and goes on to further “estimate” the total number of illegal duplicates. The total lost is often cited as 200 billion per year at least. But this methodology is questionable.

1. There are many copies of illegal software used by people who can do without them. In other words, they would never spend money to purchase them.
2. If piracy were not possible, sofware companies could potentially lose the same 200 billion per year worth of users who are interested in the product and may make a purchase decision thereafter.
3. Software piracy allows people to work more efficiently at infitnite gains (per dollar spent for the sofware) and generates additional disposable income (from the savings) that can and will be injected back into the economy.

Epic MSVS template class compiler bug

// singleton template test

#include

template class Singleton
{
private:
Singleton(const Singleton&){};
Singleton& operator=(const Singleton&){};

protected:
static T* _mInstance;
Singleton()
{
This is crazy! This is not a comment
but it just gets away from the compiler!

OMG, what is this?!
};

public:
static T& getSingleton()
{
return *_mInstance;
}
static T* getSingletonPtr()
{
return _mInstance;
}
};
template T* Singleton::_mInstance;

class Apple : public Singleton
{
public:
void cut()
{
std::cout << "cut" << std::endl;
}
};

int main()
{
Apple::getSingletonPtr()->cut();

return 0;
}

Theory of Special Relativity

After the series of very interesting lectures on Nueral Networks, I just suddenly revived my interests in physics.

Just a few years back, probably during army days, I was reading on all these things about relativity and seriously, I could hardly understand any of it all. Somehow, after going through university, everything seems crystal clear this time around. Much to my own surprise, I realised the first time I ever spontaneously thought about relativity on my own was during my secondary school days about the “A housefly in a bus” problem, I still recall relating the problem to friends who probably only took slight interest in the topic.

Basically, I was kind of intrigued by the observation that houseflies seems to fly at their normal speeds in a moving bus. A search in google tells you housefly fly at 2m/s, that’s defnitely slower than the bus! I had always wondered why they do not get hit by the rear of the bus, which is moving much faster in the forward direction. Furthermore, there are other problems:

  1. If we assume that the bus and housefly travel at the same forward speed of 60km/h, which is approx 17m/s, how did the housefly manage to accelerate so fast to maintain that speed?.
  2. If now the houselfy is flying in an arbitary circular path, how does the fly so amazingly manage the precise flight control system, accounting for the difference in “relative” (secondary school physics sense)velocity?
  3. If the bus comes to an emergency stop, how does the fly even know to detected and react to the suddenly change in relative velocity when it is in mid air, particularly, how it decelerates so fast?

Although Theory of Special Relativity may seem like an easy way out, actually, even now it still feels weird and I don’t really understand how. It may well be that my observations are wrong and housefly really just stick to the windows. Anyhow, I won’t do an experiement on that.

XHTML gives way for HTML 5

When XHTML finally begins to unify the browsers and internet experience, the WC3 decides to kill it. The official annoucement as qouted here:

XHTML 2 Working Group Expected to Stop Work End of 2009, W3C to Increase Resources on HTML 5
2009-07-02: Today the Director announces that when the XHTML 2 Working Group charter expires as scheduled at the end of 2009, the charter will not be renewed. By doing so, and by increasing resources in the HTML Working Group, W3C hopes to accelerate the progress of HTML 5 and clarify W3C’s position regarding the future of HTML.

Early adopters are already eargerly testing the new capabilities on Opera browsers. When IE8 decided to implement parts of HTML5, I didn’t actually put much thoguht to it except for the fact that it will take a couple more years before it becomes widespread like XHTML is now (actually, different browser still behave slightly differently under XHTML). But back tracking abit, Google is already very excited about their “Unbelievable product”, Google Wave, being an HTML5 app.

Now, all these early hype is getting me more and more excited about the new offerings, pakaged as HTML 5 APIs that are coming our way. We have some cool Drag and Drop, Geolocation stuff which could bring about even more inventive applications, and finally <video> and <audio> tags that I always wanted.

IE8 sure knows how to push the blame

I was watching some Adobe Acrobat videos over the internet when suddenly IE8 crashed and the tabbed window just closed. Immediately after, a yellow speech bubble (or tooltip box) pops up, pointing at that tab with the following text (roughly).

This tab has been recovered (yes we are the hero)
A problem with the web page CAUSED Internet Explorer to crash!”

Then I switched over to FireFox. The same error happened, but at least FF3 is more modest.

We’re Sorry (don’t worry, it’s ok, foxy)
Firefox had a problem and crashed (not blaming the web page, Adobe, at all). We’ll try to restore your tabs and windows when it restarts.
To help us diagnose and fix the problem, you can send us a crash report.”

So at least FireFox is going to fix the problem for us. Nice work.

AS3 passing argument list to functions

It appears that argument list passing is not very well documented in the flash docs for whatever reason. But we know it is possible because the trace() funcion is one such function that accepts an argument list.

the syntax for such a function is acheived by using the tripledot keyword as such

function ExampleConcatString(... str:String):String
{
        var newStr:String = "";

        for(var i = 0; i < str.length; i++)
        {
                newStr+= str[i];
        }

        return newStr;
}

Also, intuitively, argument list should come after default arguments which are before required arguments as such:

function SomeFunc(required:String, optional:Object = null, ... arglist:*)

Thought is a creative process

I was trying to impress a not-so-clever person with a riddle like this:

Rob has a secret letter for Sally. In order not to give the suspicious delivery man, Tory, any chance at reading its content, Rob puts the letter in a specially created rigid steel box and locks it with an unbreakable lock. How can Sally get the secret letter without using Rob’s key or damaging the steel box or the lock?

Now, you try it!

— SPOILER BEYON THIS LINE —

Obviously, she could not get it so I explained:

After Sally recieves the box, she also locks the box with her own lock. Now locked with 2 locks, Tory delivers the steel box back to Rob who will unlock his own lock and then send it back to Sally again to uncover the secret letter.

But she still cannot get what I said. I even had to demostrate physically to let her see. Before I finally conclude that she really is no-so-clever, she turned to me with an extremely puzzled look and said, why all the trouble? Sally can just give Rob her own box and lock, and we can save Tory 1 trip!

— SPOILER ENDS —-

I was actually trying to impart some knowledge on crpytography, starting from the old theories. The riddle is an analogy of shift transformation used ages ago. But she manage to gave an analogy of the modern crytogrphy is the RSA, public key method. In the end, I was the one getting super impressed.

It goes on to show that being able to think or generate new ideas does not necessarily depend on intelligence, past experience or knowledge on the subject. A creative mind may be all you need

Sleep versus Work

At 1.31am, a friend said to me, “okok, tml i need to work, have to sleep now” and I said to him, “okok, tml i need to sleep, have to work now”.

That was the message I posted to my facebook status soon after my MSN conversation with my friend when he finally decided to go rest for the day.

And at 4.34am, I am still awake, entering this story on my blog so as to fullfill what I wanted to do for the past 3 hours but cannot because I am still working.

Even now, I must go back to work if not I really cannot sleep tomorrow… or today, for the matter.

As much as some FF fanboy is going to defend and deny, and putting the blame on the coder, this is still going to be a BUG!

When an HTML document includes the doctype declaration at the top of the page, the swf embeded in the document will not render properly when the its height is set to 100%. The result is an swf rendered beyond the top border of the window as though the CSS top attribute has been set to a negative value. However, when the doctype is removed, the swf will render correctly just as IE does.

I only realised this issue after serveral hours of debugging and totally hate it when its not my fault. So I went ahead to search online to confirm if it is a bug indeed. I came across a forum (which I will not point out) where another poor victim posted this same issue. One guy came along, whom I presume is an FF fanboy, and replied along the lines of “its your own fault” without proposing any solutions! I totally hate this kind of posters who just come along to insult you on something irrelevant to the issue at hand.

After the poor guy replied, the FF fanboy went on to argue that without specifying the container’s width and height, firefox (or the swf) is not going to know how big is 100%. So you need to set the width and height for all the parent and grandparent containers including the body and html tag!

Well, so that is the solution in overcoming the BUG! And yes, it’s a bug because if you just removed the doctype, everything renders fine.

Entering Web 2.0 world

So much for recommending web2.0 technologies to all my clients but not having the chance to seriously look into building my business around it.

By chance, I just did an in depth review on the latest applications that the web 2.0 community has been developing and realized how much it has evolve since its coming not many years ago. I must say I am totally amazed at the rate things are developing and the ever increasing ways implemented to keep people networked together to create a uniform marketplace.

The result is a whole new paradigm shift in the marketing perspective. Everything we do now is highly customer oriented and marketing needs to be focused on answering the wants of these feature-hungering people. Businesses can no longer hide negative comments from the community, instead, must learn to embrace them gracefully and work towards appeasing the users.

Gaining and an internet presence is much more easier today, the real challenge is whether or not businesses can stand up to the scrutiny of the vast community, not forgetting that it is also a breeding ground for competition.

Powered by WordPress | Theme: Motion by 85ideas.