Feed on
Posts
Comments

Skype International

In-laws… You gotta keep them entertained and occupied, right?  As we expect our first baby, in-laws are here to help with the preparation.   The premises is that we don’t have a landline phone,  my wife and I use our cellphones for all calls instead and that is the general trend.  What about the in-laws when they need to call their family and friends in China or in the U.S.?  So the first thing I did was opening a pay as you go account with t-mobile, 10 cents a minute, not bad.  Then I quickly learned that in-laws are very talkative, and the pay as your go balance was draining more quickly than I originally thought.  

One day I stumbled on the SkypeOut feature of Skype, and noticed that they charge you a mere $2.95 for unlimited U.S. and Canada calling per month!  What a deal…  Even better, for $9.95 a month, you can make unlimited calls to 24 countries, and that includes China, HongKong, Taiwan, Spain, etc.

The nuisance is that you have to be attached to your computer while calling, and it’s simply not as easy and user-friendly as a regular phone.  But several companies make devices that let you make Skype calls without using a computer!  Here is what I bought: Linksys CIT400 Dual-Mode Internet Telephony Kit with Integrated Skype 

The device might seem a little pricey at first.  But if you do the math for a year, it’s definitely worth it:

Cellphone & Calling Card

  1. cellphone bill per month: $50
  2. cellphone cost: $100
  3. calling card per month: $10 if you talked a lot with a cheap phone card.

Skype

  1. phone: $200
  2. bill per month: $10

Here are some cheaper alternative skype solutions:

Let’s say if you use the service for a year, with the cellphone + calling card route, your cost is $820, however with skype, your entire yearly cost with unlimited international calling is $320.  That’s an easy $500 saving!  In addition to the cost saving, it’s also much more convenient to use.  To call China, just dial +86 plus the local number on the phone, and you are set to go.  There is no more hassling with setting up pinless dialing and pressing extra keys just to enter the destination number.  The audio quality is also far more superior than the cheap phone cards out there.

This really makes me wish I had known about all this earlier.  I hope this is helpful to you!

Kylin TV / KylinTV

In-laws are in town for several months, to keep them occupied and entertained, I looked around for chinese tv services.  Eventually I got my father-in-law a kylin tv package for father’s day.  I chose kylin tv because it was the only practical live chinese tv option we have at our condo.  There are very few channels with RCN(our cable provider), and they charge a $10 premium for each channel… Not financially wise for consumers.  Considered satellite service, but our condo prohibits it.  Then I heard about this Kylin Tv service that gives you 20 channels for $29.99 a month.  So I decided to give it a try. I signed up online and paid $15 for the shipping of the set-top box.  Got it two days later.  Here is my review after a few days of usage:

  1. box — it’s a small yellow box, not the greatest looking device, but not hideous.
  2. setup — easy if you are using the ethernet port for internet connection, plug everything in, and you are ready to go.  it comes with a rca audio cable, a composite video cable, and a s-video cable.  you can buy a component cable and use it if that’s your preference.  WARNING: refrain yourself from trying to use the wireless connection in the box, it only supports old WEP key encryption, meaning you have to downgrade your entire wireless network from WPA and above, changing every wireless device you have to use the hexdecimal keys with the less secure WEP authentication & encryption.  Even after you set it up, it drops connections and freezes every once a while.  However my dilemma is that my broadband router is in my office and I do not want to move it to the living room or run a long ethernet cable throughout the condo.  So I bought a wireless bridge (Linksys Dual-Band Wireless-N Gaming Adapter) instead, and it proves to be much better than the built-in wireless chip in the kylin tv box.
  3. programming — plenty to choose from, kylin tv offers different packages ranging from $17.99 to $29.99.  Most are geared towards mainland audience, the rest vary.  Over 90% of the channels are in mandarin, so it’s probably not the best package for a cantonese audience.
  4. video quality — Ok.  Not bad on a standard definition tv, however if you have a HDTV and are spoiled by high definition content, this is not the greatest thing but it’s comparable to your standard channels.  Once a while kylin tv’s servers will become too busy, either start buffering or drop off and take you back to the channel guide.  Just be patient and check it again in 2-3 minutes, then you should be good.  It’s understandable as it’s IPTV, even youtube with all its money can become unstable once a while.  Of course I hope it can continue to improve its stability over time.
  5. audio quality — Subpar.  The audio quality is really dull to say the least.  While Kylin TV uses MPEG-4 for the video encoding, not much is to be complemented about its audio quality.  There is no power, no depth, not even much clarity in the audio from the service(or maybe it’s the box).  
Overall rating: C+
Kylin Tv may not be the best thing out there, but for anyone who is limited to cable at your location and want to get decent package of channels for your mandarin elders, it might as well be one of your top choices for watching live tv out there.  Or you can do what one of my friends did: set up a desktop to connect to your tv and watch ppstream(http://www.ppstream.com) on it.
Until next time, take care!

The Tibet Myth

Just happen to stumble upon this interesting article that comes from a author who seems to actually know about Tibet, unlike most mainstream media out there nowadays.

http://www.michaelparenti.org/Tibet.html

One 22-year old woman, herself a runaway serf, reports: “Pretty serf girls were usually taken by the owner as house servants and used as he wished”; they “were just slaves without rights.”18 Serfs needed permission to go anywhere. Landowners had legal authority to capture those who tried to flee. One 24-year old runaway welcomed the Chinese intervention as a “liberation.” He testified that under serfdom he was subjected to incessant toil, hunger, and cold. After his third failed escape, he was merciless beaten by the landlord’s men until blood poured from his nose and mouth. They then poured alcohol and caustic soda on his wounds to increase the pain, he claimed.19

The serfs were taxed upon getting married, taxed for the birth of each child and for every death in the family. They were taxed for planting a tree in their yard and for keeping animals. They were taxed for religious festivals and for public dancing and drumming, for being sent to prison and upon being released. Those who could not find work were taxed for being unemployed, and if they traveled to another village in search of work, they paid a passage tax. When people could not pay, the monasteries lent them money at 20 to 50 percent interest. Some debts were handed down from father to son to grandson. Debtors who could not meet their obligations risked being cast into slavery.20

The theocracy’s religious teachings buttressed its class order. The poor and afflicted were taught that they had brought their troubles upon themselves because of their wicked ways in previous lives. Hence they had to accept the misery of their present existence as a karmic atonement and in anticipation that their lot would improve in their next lifetime. The rich and powerful treated their good fortune as a reward for, and tangible evidence of, virtue in past and present lives.

The Tibetan serfs were something more than superstitious victims, blind to their own oppression. As we have seen, some ran away; others openly resisted, sometimes suffering dire consequences. In feudal Tibet, torture and mutilation–including eye gouging, the pulling out of tongues, hamstringing, and amputation–were favored punishments inflicted upon thieves, and runaway or resistant serfs. Journeying through Tibet in the 1960s, Stuart and Roma Gelder interviewed a former serf, Tsereh Wang Tuei, who had stolen two sheep belonging to a monastery. For this he had both his eyes gouged out and his hand mutilated beyond use. He explains that he no longer is a Buddhist: “When a holy lama told them to blind me I thought there was no good in religion.”21 Since it was against Buddhist teachings to take human life, some offenders were severely lashed and then “left to God” in the freezing night to die. “The parallels between Tibet and medieval Europe are striking,” concludes Tom Grunfeld in his book on Tibet. 22

Somebody responded with blocks of IRC chats, and it indeed provides better explanation of Registry’s benefits over global variable. Here it is:

<_elemental> JDempster: well I’ve been trying to find some sort of explanation for how Registry solves some of the issues with Globals and why its a preferred method of dealing with global scope variables/objects. Most of what I have found has discussed that globals are bad and cause issues with…
<_elemental> code reuse and the like, but I don’t see how the Registry solves this..

<JDempster> _elemental: variables made outside of functions and methods automatically use global space, sometimes there’s a need for something to be global, to actually put it there though Zend_Registry is probably a better idea

<_elemental> JDempster: but why is it better to use the registry?

<ue> _elemental, becouse global variables are harder to manage

<JDempster> _elemental: for me, it’s the actual action required to put it in the registry that makes it easier to use

<vi390> _elemental: clear, easy, objectorientated, getter setter, persistant namespace, and other Developer come around with it better

<_elemental> Ok I understand in theory how this helps. It makes the management and use easier to deal with in your head, but is there a code level reason? [I mean] how does using the registry to hold all of your globals help with reuse, debugging and understanding the code a year from now?

<_elemental> you still have to track down where the objects were set in the registry, like you have to track down where a global was declared…
you still have to ensure the object is in registry before you can grab it so reuse is still an issue

<JDempster> traking down where somthing is decleared globally is much harder todo than though a registry
you can implmenet lazy loading though the registry

<_elemental> so would it be against best practice to say load up a custom registry with default configurations for objects you tend to store there?
if you try to call something that isn’t there the registry makes the default object?

<vi390> _elemental: its ONE place instead of many, and its sort of “best practice”, If you need something you just get it from there, well its sort of a similar thing like Global, but you have better error management (IIRC is there an exeption thrown if you try to get an unset value, if you use global Variables it would just magicaly NOT WORK)

<JDempster> personally I think thats fine, extends the registry object, instance it, overload the __get to check that said object exists if not load default e.g. log or db connection what ever

<_elemental> I see to the whole point of the registry is just better management of the global space

<ue> _elemental, from a 2 year old php4 project (no oop) : global $_mysql,$_configs,$_module,$_tpl,$_var,$_tpl_index ,$_now,$_info,$_lang,$_lang_data, $_keywords, $_title; … you want your code look like this  ?

<Ezku_> _elemental: a registry + factory combination would be called a service locator, if i’m not mistaken

<vi390> ue: good point ;-)

<Ezku_> _elemental: and yes, it would indeed be good practice.

<_elemental> ue: ok, but how is that any better than $registry->set(…); $registry->set(..); …..

<vi390> or $_GLOBAL[][][][][][]

<ue> _elemental, the most simple is, you don’t need to redecalre this globals in every class, just call registery

<vi390> _elemental: it definately makes the code more readable

<ue> _elemental, there also many other “tasty” things that registery pattern gives you, some of them already pointed out

<vi390> _elemental: maybe you find the advantages of using a registry in suing it for a while

<_elemental> ok so Registry gives you better managment of the global space, more readable code, the option to add validation and factory patterns to the global space and enhanced maintainability, anything else?

<vi390> _elemental: registries are sexy 

* _elemental likes sexy
<JDempster> lol well theres the best reason then
<_elemental> :P

According to this article: http://www.phpit.net/article/using-globals-php/1/
Global variables have the following problems:

1. Reusing parts of the script is impossible
If a certain function relies on global variables, it becomes almost impossible to use that function in a different context. Another problem is that you can’t take that function, and use it in another script.

2. Solving bugs is much harder
Tracking a global variable is much harder than a non-global variable. A global variable could be declared in some obscure include file, which could take hours to find, although a good text editor / IDE could help with this.

3. Understanding the code in a year will be much more difficult
Globals make it difficult to see where a variable is coming from and what it does. You might know about every global during development, but after a year or so you’ll probably have forgotten at least half of them, and then you’ll be kicking yourself for using so many globals.

Then the author proposes Registry as the eventual solution to global variables…  But I really don’t see how the Registry pattern really solves the above 3 problems.  You still can’t reuse part of the code if the objects aren’t created and stored in the Registry first, just like the global variables have to be created first.  You still will run into bugs if you don’t take care of your Registry well.  You still will find the code difficult to understand if you don’t remember where you are processing your Registry.  None of the problems caused by global variables is really solved here, Registry Pattern is fundamentally identical to global variables, and it really seems the “improvement” is more so the mental perception than actuality.

So Zend Framework is great, for a lot of reasons.  It has a selection of very well organized components.  However Zend_Registry or perhaps the Registry pattern is rather baffling to me as I don’t see much benefits of using them.  It appears to be a rather futile and self deceiving attempt to deal with global variables.  Registry pattern as seen in many applications is just a global variable with a fancy wrap with 99% of global variable’s problems.

Using Registry pattern as an alternative to global variables — Okay, but isn’t it still global, just slightly more secure?  Based on what I’ve seen so far, maybe I’m missing something, but Zend_Registry in no way is better than using global variables inside of class methods(BTW I avoid global variables completely).  Just like using global variables, you still have to make sure somewhere in the code the objects have to be created and registered in the Registry before everything else.  There is no such thing as on-demand creation and true decoupling with the Registry pattern.

Using Registry pattern so supposedly you don’t have to use Singleton for the objects stored — This really doesn’t make too much sense.  I love Singleton because it alleviates the necessity to create the depended objects(such as a database connection object) in the global space and pass it around before you can do anything with it.  With Singleton all you need to do is to call getInstance inside of the dependent object before using the database connection, and this is it.  It will create the object if none exists, or retrieve the current one.  I just don’t see how Registry solves this problem.  Maybe somebody can point it out?

One solution is to combine Registry pattern with Singleton pattern, but not in the sense of using Singleton on the Registry object, but using Singleton on the objects being created in the Registry.