my life

day to day

Archive for the 'journal' Category

Snow in LA?

Wednesday, January 17th, 2007
The weather in LA has been wack for the past few days. Subzero nights and freezing days. It hit an all time extreme this afternoon, when it started snowing (hailing).

* WPG2 Plugin Not Validated *

 

add to del.icio.us    add to technorati favs   email this

Hollywood Sign

Sunday, August 6th, 2006

Decided on Saturday to go on a little adventure exploring the Hollywood Hills. Our first stop was the scenic outlook spot on Mulholland Drive, just off the 101 FWY. Reading signs posted, we learned that the sign originally read “Hollywood Land” and was installed simply as massive billboard for land spectulation in the area. At some point, a land slide took out the last four letters, which is how the sign reads today.

After digging up the start of the Hollyridge Trail, I decided we’d explore the mountain route from Mulholland to the top of Beachwood Dr. Doing so brought us to Hollywood Lake. This was another first for me. There are a lot of resouvoirs up here, but unlike the one by my house, this one is totally fenced off. Absolutely no access to the shore. Just past the lake is another scenic lookout spot for the sign. We’d kept on thinking we found the best spot to view the sign, only to keep driving and get closer and closer.

Ultimately, we’d decided we had enough and headed over to the Hollyridge trail. From there we hiked about 2 miles up to the very top of Mt. Lee where the big antenna stands behind the sign. There is another trail apparently that takes you right up below the sign, but we couldn’t find it from below. Camera’s surround the sign with warnings everywhere. Nonetheless, there’s a rope conveniently placed, which will take you down directly to the sign itself. We opted to go each Sushi instead of getting arrested.

add to del.icio.us    add to technorati favs   email this

Wildlife in LA

Tuesday, August 1st, 2006

Outside my bedroom window ontop Mulholland Drive. 

add to del.icio.us    add to technorati favs   email this

PHP5.1.4 Segfault Woes

Saturday, July 15th, 2006

For the last few days I’ve been battling a nasty bug that remains elusive. What makes it so difficult to track down is that it crashes at totally random spots on a vanilla PHP setup (no special PECLs). With more than 10,000 lines of highly objectified code and no decent debuggers, this is a real challenge that I’d be glad if it just solved itself.

 

add to del.icio.us    add to technorati favs   email this

Finger Me

Wednesday, June 21st, 2006

Remember the good ‘ol days of ASCII art? The competitions to have the coolest .plan? This about tops them all.

add to del.icio.us    add to technorati favs   email this

Cubic Splines Revealed

Wednesday, June 21st, 2006

There are many forms of numerical approximation, and even more names for the different methods. Depending on how they are used, they are often called by a different name if certain parameters are different. For a recent implementation in a network game, I’ve had to become very familiar with these concepts.

For example a Parametric Free (or Natural) Cubic Spline,  is in fact, the Cubic Bézier Curve when defined in terms of Parametric coordinates ( e.g. where you interpolate the dependent variables x, y on t.)

Generally, a free cubic spline is defined as
y = S(x) = ax3 + bx2 + cx + d

However, when you parameterize S(x) with respect to [wrt] time, x = x(t), y = y(t), you get the Cubic Bézier curve.

x(t) = at3 + bt2 + ct + d
y(t) = et3 + ft2 + gt + h
(let t = 0, and then d,h simply become d = x0 and h = y0 )

A really nice explanation of the derivation of a-f is presented at:
http://www.tinaja.com/glib/fastbez.pdf   

Since general cubic splines always go through their end-points, the Cubic Bézier curve must also go through all of the end-points wrt to time t. This is where in the confusion lies as to whether or not the spline goes through all the points. It definately goes through all the end-points, but whether or not you define your “control points” to equal your end-points is up to you.

Since you generally use cubic splines to piece-wise approximate an extended curve between multiple fixed/known/measured points, I call all these piece-wise fixed end-points the control points. However, when defining the Cubic Bézier, you must approximate (or choose from your control points) two inner points between each of the end-points. The Cubic Bézier curve will not pass through these inner points. Some people call these inner points also “control points”, in which case the curve will not pass through all the control points. Thus, it’s a matter of perspective.

I personally believe that if the two inner points are an approximation (e.g. non-end-points), it’s unfair to call them control points because they are not guaranteed accurate (e.g. not measured). But if you select some of your end-points as your inner points (e.g now guaranteed accurate), beware the curve will not pass through them, even though you know it should! A real catch-22.

A little bit more explanation can be found at http://groups.google.com/group/comp.graphics.algorithms/msg/7276de840df9614c?hl=en&fwc=1

A sample implementation in C is on Wikipedia: http://en.wikipedia.org/wiki/B%C3%A9zier_curve

An alternate approach is to use the standard 2D Cubic Spline interpolation on an XY plane, fixing x and y wrt to t. If you do this, you can use the example in “Numerical recipies in C” at http://www.library.cornell.edu/nr/bookcpdf/c3-3.pdf to create a Cubic Spline in each dimension (x(t), y(t)). E.g. Instead of fixing x and interpolating for y, fix t and interpolate for x, then keeping the same fixed t interpolate for y.

add to del.icio.us    add to technorati favs   email this

Illegal Workers’ Rights

Wednesday, June 21st, 2006

Living in California has imbred a kind of presumption in me and probably most people that illegal workers are the “Mexicans” . As with all blanket statements, they’re usually wrong and the same is true for this assumption. One group of these illegal workers are international students who come here and are expected to pay a tuition 2-3x a US Citizen would pay, probably even more once exchange rates (relatively speaking) are figured into the equation. On top of that, they are only allowed to work on campus and part-time, which is probably only at minimum wage. With such limited legal options, many work under the table performing jobs paid by the hour.

My girlfriend is in this situation, unable to work legally and not fortunate enough to have parents that can support her. She’s managed to keep a steady job, but not without incident. Her last job was at one of the hundred mobile phone shops in K-Town. Her employer, a first generation Korean guy had generally always respected his employees, but was uniformly late in paying them. It got to a point when she couldn’t pay her bills on time and risked hurting her credit. She made the decision to leave and hope to get paid the $1,800 owed to her later when her employer had the money. But when her boss found out, he lost it. He said “If you ever come around  here again, I’ll call the INS! You can forget about your pay check.” He seemed to think it was his right to pay her and not his obligation. I am sure the threat is an idle one, but it drives home the point. What rights does she have?

Turns out, there are many organizations representing illegal workers. For that, I am grateful. One in particular, respresents Korean laborers and has been very helpful to my girlfriend. By advising her of her rights, informing her how little legal power he has over her, she was able to get paid in the end… albiet 3 weeks later. She had kept insisting that he give her some money. He wrote her a bad check, that when she cashed, bounced twice. But that was his fatal mistake. It gave her all the bargaining power she needed to take him to small claims court. He conceeded he was a jerk and gave her cash! The funny thing is, he wanted the bounced check back. As if that would protect her? Bank records are immutable and photocopies hold up well enough in court.

 

 

add to del.icio.us    add to technorati favs   email this