Archive for commentary

PHP5 OOP must haves

We’re always taught when learning OOP to be a strict as possible when declaring methods/members as public, private and protected. For some reason though, when programming PHP we’re in this mode that since it’s a scripting language “let’s not adhere to better practice”. Well, atleast I kind of fall for this and going by all of the other peoples code that I’ve read it’s not too uncommon. The project I’m working on has reaffirmed that there is no excuse for sloppy programming.

When writing OO PHP5, always start by making all properties private or protected. Declare the overloading/accessor methods for __set, __get, and __unset. Throw as many exceptions as possible and things will debug themselves with little or not effort on the programmer.

Asside from protecting your privates, this method aids in profiling your code too. Since by moving your assignments and gets into a function call, they can now be counted by a PHP profiler such as apd.

 

WordPresses Letdown

WordPress quickly became the blogging software of choice for bloggers everywhere, unseating MoveableType the previous title holder. It did this much because MT was too difficult for most to use. It’s templating system and class structure was much more elaborate and thus complicated. It didn’t help too that it was written in Perl, a programming language with very concise sytanx like $foo =~ /[Ff]uck[!].Off?/ able to scare off all but the most bold programmers. WordPress on the other hand, can be picked up by anyone with limited programming experience in an afternoon’s time. The problem is, however, that the developers of WordPress are unfortunately amatures themselves, with little or no concept of object oriented (“OO”) design. WordPress 2 is technically OO, but the class structure is a joke and essentially one big container. There are a handful of mega-classes like WP and WP_Query, which drive the entire application. All do a fine line of bluring the difference between function and object oriented code. Everything else is functional and relies on a global variables such as $wp, $wpdb, and $wp_query, which if anything should be a singleton instances, local in scope. Trying to extend anything is impossible without modifying their code. Their idea of templating is doing “includes” on different php files with formatting and additional logic. There’s no seperation between the presentation layer and the data layer.

Bluring the line b/w OO and functional programming, look at WP::query_posts

function query_posts() {

$this->build_query_string();
query_posts($this->query_string);

}

and the global function query_posts

function &query_posts($query) {

global $wp_query;
return $wp_query->query($query);

}

I don’t mean to lambast the WordPress developers personally, but this is just humorous. It doesn’t utilize any constructs of PHP designed to handle this kind of thing (E.g. statics and singletons) — and that’s only if you support their overall flow/execution. Granted static methods were introduced in PHP5, but static variables have been around since PHP4.

Santa Monica BMW Service Center Warning

Santa Monica BMW Service Center Warning

RATED F BY Better Business Bureau

santa monica bmw Santa Monica BMW Service Center Warning

Read more Santa Monica BMW

To anyone considering using Santa Monica BMW (1127 Santa Monica Blvd) I strongly advise you to go elsewhere.

My Complaints:

  1. They charge an exorbitant amount for repairs. I had a brake job (4 pads/rotors) done on my 2000 328i that cost $990.31. icon sad Santa Monica BMW Service Center Warning The same brake job at Center BMW (5201 Van Nuys Blvd, Sherman Oaks) is $501.54. Both are certified BMW repair centers. The invoice price per part is essentially doubled at Santa Monica BMW.
  2. The courtesy car wash left the car in worse appearance than I left it. 4 days prior to servicing it, I had the car detailed, but when it was returned it had calcification marks all over the car including the windows. I had to get another car wash.
  3. The gas tank was 1/4 full when I dropped off the car. Upon picking up the car, it was empty — orange indicator light lit.

let the battle begin

CNN: Record labels seek OK for P2P sabotage
Sunday September 29, 2002 at 10:08 PM

(Original link expired:

http://www.cnn.com/2002/TECH/internet/09/27/media.piracy.reut/index.html)

Here’s another copy http://vancouver.indymedia.org/news/2002/09/17874.php

Original article is at http://vancouver.indymedia.org/news/2002/09/17874.php
cnn: Record labels seek OK for P2P sabotage
by linkkkbot Sunday September 29, 2002 at 10:08 PM
linkbotproject@hushmail.com

WASHINGTON (Reuters) — Frustrated by the continuing presence of free music on the Internet, the recording industry asked for Congress’ blessing on Thursday to gum up the online networks they blame for slowing their sales.

Congress is considering expanded legal protection for record labels who resort to sabotage in their ongoing battle with “peer to peer” networks that allow users to freely trade music, movies and other copyrighted material.

The recording industry offered a glimpse into its tactics, which include blocking transfers and flooding the network with dummy songs, and promised a House of Representatives subcommittee that they would not disrupt the Internet or reach into individuals’ computers.

“I can’t foresee any scenario where it would be in our interest to go into anybody’s computer and delete a file,” said Hilary Rosen, chairman of the Recording Industry Association of America.

But some lawmakers worried that overzealous copyright enforcement measures could end up targeting innocent computer users, and said they did not want to encourage a high-tech game of cat and mouse that could easily get out of hand.

“What are the implications for the Internet’s functionality when the inevitable arms race develops?” asked Virginia Democratic Rep. Rick Boucher.

Boucher noted that overzealous copyright enforcers have already mistaken a photo entitled “Portrait of mrs harrison williams 1943″ for a song by former Beatle George Harrison, and demanded that Internet provider UUNet terminate the account of a customer who posted a book report on Harry Potter.
Changing tactics

The recording industry has aggressively fought peer-to-peer services since Napster gained widespread popularity more than two years ago.

While the recording industry was able to persuade a California court to shut Napster down, it has so far been less successful against next-generation services that are based overseas or operate in a decentralized manner.

The industry has tried different tactics recently, targeting individual users with automated tracking software and launching an advertising campaign to discourage illegal downloads.

Record labels have also turned to Los Angeles technology firm MediaDefender Inc., which floods peer-to-peer services with decoy songs in an attempt to crowd out copyrighted material.

MediaDefender president Randy Saaf said the company can also block downloads through a technique called “interdiction,” which closes off a user’s hard drive to others on the network.

The industry has used the decoy service heavily, to the point where nine out of ten versions on a peer-to-peer network may be empty shells, he said. Interdiction has been less popular, he said, as it may run afoul of anti-hacking laws.

KaZaA and Morpheus said after the hearing that they have seen few effects from record-company sabotage, even as KaZaA released a new version that allows users to screen out unreliable files.

“We haven’t had a plethora of complaints about dummy files … It would be misguided to imagine that’s the only reason” for the upgrade, said KaZaA spokeswoman Kelly Larabee.

Steve Griffin, who watched from the audience as lawmakers and witnesses castigated his Morpheus peer-to-peer service, said Congress would do better to establish a per-song royalty rate to compensate copyright holders, rather than endorsing high-tech warfare between record labels and peer-to-peer networks.

“It’s impractical and unfeasible to simply wipe out all the hard drives of America,” Griffin said.

edition.cnn.com/2002/TECH/internet/09/27/media.piracy.reut/index.html

A land of extremes

The first thing anyone will notice coming to Korea is that it is a land marked by extremes. Extreme beauty and extreme dedication. Extreme competition and extreme image.

Where to begin in describing this to someone who has never been here is difficult, but maybe I can start by giving some examples.

In Korea, the first extreme is the number of people densely packed into this small pennisula, less than a third of the size of California. California has some 30 million people–so does Korea. By the sheer number of people always shoulder to shouler, elbow to elbow walking down the streets, it’s hard not to be come more aware of the differences between life in California.. or rather, Los Angeles and Seoul. They are smack in front of your face. About as densely pack as the people are the stores. There are 3 types of shops in Seoul. KTF — the Verizon of Korea; the Hofs — the life of every college town; the Coffee shops — always busy — all 6 floors of them. Now, I’d like to say that there are tons of restaurants.. and there are. But their numbers are really dwarfed by the top three.

So.. KTF is the largest mobile phone company here in Korea. In a busy city like Sinchon, you will find 1 store within eye site of another store — either just a few doors down or across the street.

The Hoffs are stacked back to back, all on top of eachother. Their signs are obnoxious and usually blare beeps and bleeps techno music, or one of TWO groups: Cool or G.O.D. The outside of almost every place is quite trashy, but once you enter you will very often find an interior decor that would be found only in the most trendy of Hollywood or Sunset night clubs. They are very big on taking English words as names, and it’s not uncommon to find a place called the “Roxy” or a mispelled “House of Blue”. There’s this once place I went to called “Oh’charlies..” Sounded like a nice Irsih pub or something. But once you enter, you find something of a more Eastern European decor. It gave me quite the laugh.

The coffee shops are as slick as the bars, often with wonderfully comfortable sofas and modern-classical furnature. The exceptions are the very boring American coffee chain stores like Coffee Bean, Seatle’s Best Coffee, and Starbucks. They are very boring inside and usually offer nice hard wooden chairs to sit on, not much to compare against the personal lounge chair all the other places offer. Starbucks can sometimes have some big locations in the states, but nothing in comparison to what you will find here. Imagine the largest Starbucks you have ever been to. Now, multiply that by 5 floors and you have one Starbucks. Coffee Bean has the same arrangement, along with many other local coffee shop chains or novelties.

Posted by e at 2002-09-23 05:38:00

Surviving…

One fascinating point for me has been the fact I’ve not felt homesick one day ever since I came to Korea. I’m not quite yet sure what to make of it. Is it that it’s still to early to tell? Is it that I’m having too much fun to realize? Or is it that I’m just playing the psychological game of sucessfully managing my happiness?

It’s probably a little bit of everything, but especially the later. Being happy is imo is 80% self-control. So many of the foreigners that I’ve met here in Korea are unhappy with somepart of their stay and often seem to take it out on their surroundings or fellow friends. Their unhappiness in my mind is closely linked to their unwillingness to accept that Korea is and will always be counter to the Western world. Rather than try to fit in and accept the East as East, they keep looking to find the West somewhere cloaked among the homegenous society! The result is isolation, which leads to loneliness — the death of any traveler.

To avoid this pitfall, the easiest trick that I learned was just to make as many friends as you can so that you don’t have enough time to think about all the pet-peves to manufacture. Church has been a wonderful entry point into the culture; it acts not only as a guiding religious institution, but a lax social insitution, where the people I’ve met are more than willing to lend a helping hand. There are many ways to meet people, but meeting the right people is essential. In a country where foreigners are accepted more as a fact of life than a welcomed inhabitor of this densely populated pensiula, you are often taken more for a tool than an individual. That is… a tool to learn English, a tool to emigrate to a foreign country, a tool for international business — and overall just a tool be used. Initially, it’s not a problem and goes by hardly without notice. After the induction period, it begins to feed at the problem of loneliness — as these meaningless relationships are of no deeper value.

The friends that I’ve met through IWE (http://iwe.youngnak.net) have been a relief. Everyone is so genuinely concerned with your wellbeing; you feel truely as though you are watched out for. If you need help with money, they help find you a job. If you need help in lodging, they find someone with a spare room. If you need good old-fashioned advice, they can help with that too. icon smile  Surviving...

Hrm… I guess another not-so-insignificant part of surviving without homesickness has been the fact that as a child I’d spent so many summers in Sweden alone. I never realized it until I came here how much that much have trained me mentally to survive alone. Living at home my entire life I thought would have a more dominating effect on my emotional dependence on family, but it hasn’t… and that is interesting.

So.. next week school starts. I wonder how that will be.

Hong-de Club Day

The Hong-de area (Hong-ik University) is one happening place, where on the last friday of every month you can purchase a 10,000 Won ticket (about $10) that get’s you into 10 clubs. It’s the perfect license for bar hopping. So, 2 weeks ago or so, I checked it out with my friend Jenna and Sheryl. Aside from the packs of U.S. military men swarming around the Western bars, everything seemed to be on the upside. Drinks are affordable, especially without tips — something that’s not really expected here in Korea. The style of music was rather limited, but atleast it was limited to what I prefer to go out dancing too. Mostly the clubs played recent singles by popular R&B artists or some Mellow Rap; one or two clubs had Western style alternative or grunge music, swaped in and out with dance classics or beeps and bleeps techno… I’m not a fan of bouncing up and down. The crowd’s dress was varied, I guess it was split between the gangster wanna-be’s in their baggies and the black clad, movie-star imposters. I went for the movie-star look. icon smile Hong de Club Day