The Marriage Contract

Read an article from slashdot about some predictions for the next 100 years. Notably #17 states that marriage will be come a contract that renews annually. I had thought of a similar idea in a previous post requiring renwal of the marriage license. The importent thing to notice is that this idea’s main proponent wants it to become socially aceptable for two people to say “we think we can live happy lives for the next 5 years, but not sure about after that”.  The annual contract may be far more practical than a 5-year term that I was envisioning.

The idea breaks with all thoughts of traditional marriage institution. It also makes it insanely difficult to rear children. If one would dare to imagine, socialized child-care. People are free to procede as they like with their marriage life. A part of their taxes goes toward a stable environment where children are cared for professionally. In such a system, one would never fear making a mistake in one’s relationship, to impact children, who are the future of society. Such a system also promotes the healthy mixing of genetic material among all races, increasing human rate of evolution.
Additional benefits include accounting. It is far more difficult to enumerate the shared/non-shared properties in a 10-yr marriage that went sour in it’s second year than to look at 2 years of income and purchases, and split the properties from only those two years. The renewal process requires an audit of all properties, tedious, I know, but still better than to do it at end of 10 years.
Child rearing is one issue that needs to be addressed more carefully…

Pancakes Sorting Algorithm

There is a recent Slashdot article about pancake sorting. Somebody seem to have proved that optimal sorting of pancakes is NP-hard. If you look at the citations in the paper[arxiv], you’ll notice the mentioning of a paper by a certain “W. Gates”… the by the very same Bill Gates that everybody knows about.

I mentioned the problem to my father, and he, having a Ph.D. in mathematics came up with the operational gadgetry to perform comparison on any two pancakes, and declared the problem done. Later on he called me and told me to use this problem to attract a date to bed…. sigh…. Btw, his gadget for comparing two pancakes uses only two flips, mine used three. sigh….


So during our latter discussion, as he gave me this great idea, we also chance upon another interesting solution to the sorting problem, which has complexity
O(hλ)

where h is the height of the stack and λ condition number:the ratio of the largest pancake to the smallest pancake in the stack. How? Consider this algorithm:

* Flip the stack side ways so one side of all pancakes are flush
* Flip back upright.
* Cut from flush side λ cuts starting from the flush side towards the non-flush side. The widths of all cut is to be equal. That width can be any width smaller than the width of the smallest pancake. To achieve fewest cut we use the width of the smallest pancake.
* The pieces of pancakes will fall, producing a stack of pancakes including all sizes of original sizes with the largest at the bottom and the smallest at the top.

It takes a small bit of animation skill, which the blogger does not have, to illustrate it. Or if you can just imagine for me.  The rate at which object fall is roughly proportional to the height from which it falls. Since we are on earth, and there is a terminal velocity, the time it will take for all pieces of pancake to fall into place after each cut is height divided by terminal velocity–so linear in height of the stack. since there are λ cuts, the algorithm takes O(hλ) to run. The proof will be in the pudding after breakfast by induction:

Base case: We start with one pancake. Slice laser down at any width less than this pancake’s width.The pieces fall to no where and the pancake is now sorted.

Induction Hypothesis: suppose we can sort in n-1 pancakes using the above algorithm using λ laser slices,


Induction Step: W.L.O.G. add one pancake on top of the n-1 stack to create a stack of size n: Suppose the newly added pancake is smaller than the smallest pancake in the existing stack of size n-1. then the problem is solved: Slicing from it’s right side keeps it on top, and since new slicing width is same as lower stack’s slicing width, using this width to continue slicing will sort the stack of n-1 pancakes below as well.

Suppose the top nth pancake is not the smallest slice in the n-1 stack, let us use the smallest slice width from n-1 stack. By slicing the top pancake by that width creates a new pancake of the smallest size. The remaining portion of the top pancake in the n stack falls down and becomes part of a pancake in an n stack. Note that this operation has swapped the position of the lowest pancake in n-1 stack taking on the smallest size with the top pancake from n stack. Smallest pancake is on top, and we have a stack of n-1 unsorted pancakes. We can proceed using the current width and sort the remaining n-1 pancakes by I.H. in O((h-1)
λn) time. Adding the one cut from this step yields a total of O(hλn) running time.

Q.E.D!

Rule of physics challenge: okay, so the pancake may fall out of order from the torque exerted by gravity as it receives support from only one side. This issue may be mitigated if we set up λ lasers in λ time and perform all of the the slicing simultaneously, thus all pieces fall vertically, solving the torque problem.

Btw, if we do not know lambda, then clearly it takes O(n) time to compute it using the comparison gadget. in that case we have  

O(hλ+2n)

 running time. Linear time is still superior to  O(nlg(n)) using only pair-wise comparisons and swaps.

J. Edgar

I am trying very hard to keep the image of Robert Ebert after his throat cancer surgery out of my head as I sit down and type my thoughts on this movie. I have been having a throat pain on and off for several months now and it is scaring the shit out of me. And why do I taste salt every time I drink water?

Anyway, another image that I have trouble keeping out of my head is Clint Eastwood, the director of this film, chewing the words: “He is a fucking cock sucker!!!”

The simple days… The really simple days when FBI originally started, in the first decade of the 20th century, things seem so simple then. The cars had simple engines… the liquor was hard, and the vegies all organic. And you could meet women in a club and they would offer to warm your bed for ya.

It makes me reflect on today, we are into second decade of the 21st century, at the end of which, will I look back and think, “wow… those were the simple days, they measured computer performance in peta-flops.”, and they didn’t even have to sign a pre-date to go on a date.

Anyway, snap back to reality, wow! I thought half way into this movie, this whole country is created not by white men, it was created by homosexual men! The film portrays J. Edgar Hoover, founding director of the FBI and Clyde Tolson, founding Associate director of the same TLA as homosexual couples. Various reports (wiki) quotes Clint Eastwood saying that he chose the script because it was not homosexual! But that was clearly a statement of the opposite, that the script did not focus on his homosexuality.

Was the script a PSA (public service announcement) for personal fitness? Because Clyde got a stroke for saying that he doesn’t like to exercise and Hoover dies hours after revealing that he wasn’t working out either to Clyde.

Because it wasn’t a promo piece for the FBI either. Though it did show that the underlines, the nameless agents do do good work that hoover takes credit for.

I don’t know why, but I have a fairly positive impression of the FBI, despite my deep seeded hatred for spying of all form be it organized or disorganized, effective or ineffective, and government sanctioned or not. So the movie is a slight understatement there for me too.

Perhaps it is for the best that the movie does not go into great detail about the things that we find lacking. The details of his extortions, the details of his relationship with Clyde, the details of all the political struggles that he won.

Btw, did Rober Ebert get throat cancer from HPV when he had oral sex with his black wife or through his promiscuous Hollywood lifestyle?… sorry, my most feared thoughts escape my skull some times…

The movie overall felt like it fits the demographics–most of the people in the audience, me excluded, were older couples same age as the dying Hoover. People from a simpler times… like when in a hundred years they’ll complain about lack of details: “oh man, that old geezer is posting into a blog about his java code about such a simple system called Hadoop. That’s soooo simple and unscalable.”

Email Fraud

I recently received a bounced email on my gmail account. It would appear some body at this IP-address (192.83.180.224) attempted to send an email as me to jobs@selabs.com. that IP-address is in the range 192.83.180.* registered to “Ministry of Education Computer Center, Taipei Taiwan” There is a middle man (87.98.235.52) which is ovh.net a polish web hosting company located in France.

I’m actually kind of flattered that somebody from taiwan’s ministry of education wanted to send email as me. But I do not appear to have any apparent relevant skills for the company selabs.com. This is very odd. I should ask my taiwaneese roommate if he’s playing a prank on me, or if I should ask friends at gmail how serious this is to my online identity?


from:  Mail Delivery Subsystem mailer-daemon@googlemail.com
to:  huan.chang@gmail.com
date:  Wed, Nov 16, 2011 at 12:45 PM
subject:  Delivery Status Notification (Failure)
mailed-by:  googlemail.com
:  Important mainly because of the people in the conversation.

Delivery to the following recipient failed permanently:


    jobs@206.65.164.155


Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 550 550 5.1.1 Mail Refused – Address <jobs@selabs.com> Recipient Unknown (state 14).


—– Original message —–


Received: by 10.52.23.242 with SMTP id p18mr49440063vdf.79.1321476306469;
       Wed, 16 Nov 2011 12:45:06 -0800 (PST)
Received: by 10.52.23.242 with SMTP id p18mr49440062vdf.79.1321476306426;
       Wed, 16 Nov 2011 12:45:06 -0800 (PST)
Return-Path: <huan.chang@gmail.com>
Received: from 87-98-235-52.ovh.net (lolth.cyber-host.pl. [46.105.112.83])
       by mx.google.com with SMTP id cg1si2765747vdc.124.2011.11.16.12.45.04;
       Wed, 16 Nov 2011 12:45:06 -0800 (PST)
Received-SPF: neutral (google.com: 46.105.112.83 is neither permitted nor denied by domain ofhuan.chang@gmail.com) client-ip=46.105.112.83;
Authentication-Results: mx.google.com; spf=neutral (google.com: 46.105.112.83 is neither permitted nor denied by domain of huan.chang@gmail.com) smtp.mail=huan.chang@gmail.com
Received: from 192.83.180.224 by 87.98.235.52; Wed, 23 Nov 2011 23:05:15 +0200
Message-ID: <IYVOSPVZJDKZIRWTTWKMCBH.OCIJODhuan.chang@gmail.com>
From: “�u�{�N�ԴڡC” <huan.chang@gmail.com>
To: jobs@selabs.com
Subject: �U�ؿĸ�CThu, 24 Nov 2011 03:02:15 +0600
Date: Wed, 23 Nov 2011 15:07:15 -0600
X-Mailer: eGroups Message Poster
MIME-Version: 1.0
Content-Type: multipart/alternative;
       boundary=”–4382705805593925″
X-Priority: 1
X-MSMail-Priority: High


—– End of message —–


sales tax

Are some restaurants out there in California still charging 9.4% tax because they haven’t reprogrammed their cash registers?

I found at least one.

The sales tax in Menlo Park should be 8.25%. The new rates effective Oct. 1 2011 are listed can be found on this page.

Atlas Shrugged – The Movie

Is it my impression or is it that Dagny’s “Galt” Sounds like “gout” ??! sigh… what pain to have a name like that…

So… I guess Objectivism, (third time is the charm for me I suppose), is about heros and their individual achievement; It is about not supporting universal health care; It is about small government; It is about ruggedly handsome super-wasp having a great time with another quite stunning super-wasp while saving the world from complete chaos.

The blue Rearden Steal tracks! wow. I literally felt the smoothness of that train ride at 250 mph! Yeeeeeeeeaaaaaaaaaah!!!! take that China and Germany and Japan! and France, and .. and.. the falling mid-east… We have American Steal!! and American Engines!!!

wohooo!!!!! I feel so high right now! I am tempted to look up the objectivist group here and …

er….

wait…. (hmm, as I type this… my high is interrupted 😦

What should I, a non-wasp, fat, underachieving, poor, single, (and single child), immigrant do? I’ll probably be the scum that broke the union lines and drove for those who “carry the rest”…

This is such a dilemma for me. I want to be a hero! I want to be that ruggedly handsome guy that makes the world work, and I want to attract a matching beauty who also makes her world work, AND GET THIS, she is a engineering major!!

(And I have to admit, quite bashfully that I “read” this book for extra credit in high school but don’t actually know what the outcome is… sigh, bad memory is such blessing curse)

so… I’m sure in due time, I will find out that feminine beauty, masculine forms, individual achievements and hot sex, may not be the central theme of objectivism. But, for now, and ignoring racial issues, I am liking Rand’s portrayal of not only a world falling apart, but also a world containing elements (individuals, heros, in this case) that can bring positive change, elements that are succeeding despite mounting adversity from commoners whom these elements are here to save.

Btw, who is John Galt?

Ohh, and Happy Easter, and Mazel tov about passover. Is it normal for these two holidays to overlap?

wixel? waxel? or woxel?

Hrm, so I read that blog entry of mine from that lonesome friday night. It seems the word “voxel” comes from combination of volume and pi-xel. If I followed this convention, then we should be using the word “waxel” for wa-ll+pi-xel, pronounced wax-sel.

So regarding the output of waxels, I realized a bit later into that night that it’s a little bit more complicated than that. In computer CG ray tracing, typically we trace a single beam of light that does not increase in width as it travels. It’s like a laser beam. Now, we can make a naive assumption that our waxel projectors swiveling around on a universal joint (or some other mechanism for achieving the same effect) emits light that does not diffuse, OR we could just call it a laser beam.
The slight problem with laser beam is that it may harm eyes, and the color is difficult to control. (I think the lasers today are fixed color… so we’d have to have three lasers (RGB) on each projector, projecting from the same point vertically outward.
Well, alternatively, the user of this immersive visualization and entertainment system can simply wear a polarized contact lens. In fact, even today’s movie theaters can hand out polarized lens for 3d viewers who can tolerate contact lenses.
Next problem will be an averaging algorithm to generate an image in the person’s eye when there are more than one object in the sphere.

肉麻博客 and fertility test

I recently had a physical that involves me spilling some man juice and having my sperms counted and tested… So on a subsequent date I bragged to a girl:

化验表明我的精子很多而且很有活力!

and she response:

好巧,我正好在找精子多而有活力的人.

😀 😉

Some Viz Ideas and revival of the lonely-friday-night-typo’s

I had attended Bittorrent reunion recently at Ashwin Navin’s restaurant at The Summit in SF. Ran into some old friends, and had an interesting discussion with David Harrison and Jens, and Arvid. So here’s the idea that I pitched and we discussed:

Say I have a room, well, say I’m on the inside of a sphere, and say there’s a glass floor that I am standing on and that all of the interior of the sphere are covered with little projection devices that can very quickly beam a light at any direction inside the sphere. Individually, these are miniature projectors rotating on two axes.
Now, each of these pivoting projectors pivots very fast, and is able to scan through the entire space in front of it and alter color as it does so, if one puts a piece of paper in front of one of this device, one would find that its able to project any image like a typical projector.
The spherical room’s wall are completely covered with these micro projection systems, each the size of a TV screen pixel, or smaller. Each of these wall-pixels are connected to a central computer system.
The goal is to render a 3-D image for a person standing on the glass floor anywhere in the room, simultaneously.
This means, the computer system computing the output for each of these woxel (wall-pixel instead of voxel or pixel), does not have to take into account where the person is in the room or what he is doing. All view points/angles are simultaneously rendered correctly.
The room will be able to accommodate two or more persons and still produce faithful images on/behind or in front of real objects–again without respect to where each person is. Think simply, each woxel is producing rays that a ray-tracing program would produce using parallel projection.
The genius of this discussion is not necessarily the concept of a woxel, which I just named but my friend David Garmire told me about some years ago, but the fact that the computer behind this system is a massively interesting CG problem that has not been worked. The optimizations there-in has not been written yet. AFAIK.
A second related thought is one of specular reflection. So one of the things that current cellphone manufacturers does not allow us to do, actually also screen/TV, is that it does not allow us to set the apparent reflective property of the glass infront of each pixel. I can set RGB, but I can’t make that point more glossy by increasing the specular reflection.
It would be very cool for CG effects if we could set these properties of the material on top. It would look and reflect like paper when it’s displaying a book, and the iPhone 16 could turn into a mirror, and there’d be an app for that.
Anyways, some ideas and description of systems/implementation/algorithms for posterity to snicker about… poor old Huan, didn’t even think of the possibility that the iPhone 11 render mirrors completely useless (obviously not by having pixels that can turn into reflective mirror as I’ve discussed here)….
sigh…… talk about a set of lonely-friday-night-typo’s.

Sadness upon unhappiness

Okay, so I’m in a rough patch in my life called the 30’s. And David Rumelhart, inventor of backprop for fitting xor using ANN just passed away. Sigh, how can this get any worse.

Oh God! Please don’t answer that question!!

Anyways, one minute of silence on this blog to remember Rumelhart.