April 30, 2004

Mario Brothers Part IV

Here it is.

The first three parts, I mentioned about and linked to in February.

Posted by Ivan at 08:23 PM | Comments (2) | TrackBack

Free iTunes Music

Many folks know that iTunes is bumped to version 4.5 now, breaking backward compatibility with network shares.

That aside, I've discovered free music on iTunes (without Pepsi deal, which I can't get in Japan, dammit!). Every Tuesday, Apple is making a track on iTunes free. For the one year anniversary, it seems there'll be a new song each day.

Yesterday was a very bad Avril Lavigne song called Take Me Away, and today is Courtney Love's Hold On To Me (three stars).

Credit Card required to get an iTunes account even though they're free tracks.

Posted by Ivan at 04:48 PM | Comments (0) | TrackBack

April 26, 2004

It's Not Really Illegal (Yet)

He's at it again. From the man who brought you DeCSS, comes DeDRMS. My copy below.

via Slashdot.

/*****************************************************************************
 * DeDRMS.cs: DeDRMS 0.1
 *****************************************************************************
 * Copyright (C) 2004 Jon Lech Johansen <jon-vl@nanocrew.net>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
 *****************************************************************************/

using System;
using System.IO;
using System.Text;
using System.Security.Cryptography;

class M4PStream
{
    private Rijndael alg;

    private BinaryReader br;
    private BinaryWriter bw;
    private byte [] sbuffer;

    private string AtomDRMS = "drms";
    private string AtomMP4A = "mp4a";
    private string AtomSINF = "sinf";
    private string AtomUSER = "user";
    private string AtomKEY  = "key ";
    private string AtomIVIV = "iviv";
    private string AtomNAME = "name";
    private string AtomPRIV = "priv";
    private string AtomSTSZ = "stsz";
    private string AtomMDAT = "mdat";

    public M4PStream( FileStream fs )
    {
        br = new BinaryReader( fs );
        bw = new BinaryWriter( fs );
        sbuffer = br.ReadBytes( Convert.ToInt32( fs.Length ) );

        alg = Rijndael.Create();
        alg.Mode = CipherMode.CBC;
        alg.Padding = PaddingMode.None;
    }

    byte [] NetToHost( byte [] Input, int Pos, int Count )
    {
        if( BitConverter.IsLittleEndian )
        {
            for( int i = 0; i < Count; i++ )
            {
                Array.Reverse( Input, Pos + (i * 4), 4 );
            }
        }

        return Input;
    }

    int GetAtomPos( string Atom )
    {
        byte [] Bytes = Encoding.ASCII.GetBytes( Atom );

        for( int i = 0; i < (sbuffer.Length - 3); i++ )
        {
            if( sbuffer[ i + 0 ] == Bytes[ 0 ] &&
                sbuffer[ i + 1 ] == Bytes[ 1 ] &&
                sbuffer[ i + 2 ] == Bytes[ 2 ] &&
                sbuffer[ i + 3 ] == Bytes[ 3 ] )
            {
                return i;
            }
        }

        throw new Exception( String.Format( "Atom '{0}' not found", Atom ) );
    }

    uint GetAtomSize( int Pos )
    {
        byte [] Bytes = new byte[ 4 ];
        Buffer.BlockCopy( sbuffer, Pos - 4, Bytes, 0, 4 );
        return BitConverter.ToUInt32( NetToHost( Bytes, 0, 1 ), 0 );
    }

    byte [] GetAtomData( int Pos, bool bNetToHost )
    {
        uint Size;
        byte [] Bytes;

        Size = GetAtomSize( Pos );
        Bytes = new byte[ Size - 8 ];
        Buffer.BlockCopy( sbuffer, Pos + 4, Bytes, 0, Bytes.Length );

        return bNetToHost ? NetToHost( Bytes, 0, Bytes.Length / 4 ) : Bytes;
    }

    public void Decrypt( byte [] CipherText, int Offset, int Count,
                         byte [] Key, byte [] IV )
    {
        MemoryStream ms = new MemoryStream();

        ICryptoTransform ct = alg.CreateDecryptor( Key, IV );
        CryptoStream cs = new CryptoStream( ms, ct, CryptoStreamMode.Write );
        cs.Write( CipherText, Offset, (Count / 16) * 16 );
        cs.Close();

        ms.ToArray().CopyTo( CipherText, Offset );
    }

    public byte [] GetUserKey( uint UserID, uint KeyID )
    {
        byte [] UserKey;
        BinaryReader bruk;

        string strHome =
            Environment.GetFolderPath( Environment.SpecialFolder.ApplicationData );
        bool bUnix = Environment.OSVersion.ToString().IndexOf( "Unix" ) != -1;
        string strFile = String.Format( "{0}{1}{2}drms{3}{4:X8}.{5:D3}", strHome,
                                        Path.DirectorySeparatorChar, bUnix ? "." : "",
                                        Path.DirectorySeparatorChar, UserID, KeyID );

        bruk = new BinaryReader( File.OpenRead( strFile ) );
        UserKey = bruk.ReadBytes( Convert.ToInt32( bruk.BaseStream.Length ) );
        bruk.Close();

        return UserKey;
    }

    public int [] GetSampleTable()
    {
        byte [] adSTSZ = GetAtomData( GetAtomPos( AtomSTSZ ), true );
        int SampleCount = BitConverter.ToInt32( adSTSZ, 8 );
        int [] SampleTable = new int[ SampleCount ];

        for( int i = 0; i < SampleCount; i++ )
        {
            SampleTable[ i ] = BitConverter.ToInt32( adSTSZ, 12 + (i * 4) );
        }

        return SampleTable;
    }

    public void DeDRMS()
    {
        byte [] IV = new byte[ 16 ];
        byte [] Key = new byte[ 16 ];

        int apDRMS = GetAtomPos( AtomDRMS );
        int apSINF = GetAtomPos( AtomSINF );
        int apMDAT = GetAtomPos( AtomMDAT );

        int [] SampleTable = GetSampleTable();

        byte [] adUSER = GetAtomData( GetAtomPos( AtomUSER ), true );
        byte [] adKEY = GetAtomData( GetAtomPos( AtomKEY ), true );
        byte [] adIVIV = GetAtomData( GetAtomPos( AtomIVIV ), false );
        byte [] adNAME = GetAtomData( GetAtomPos( AtomNAME ), false );
        byte [] adPRIV = GetAtomData( GetAtomPos( AtomPRIV ), false );

        uint UserID = BitConverter.ToUInt32( adUSER, 0 );
        uint KeyID = BitConverter.ToUInt32( adKEY, 0 );
        string strName = Encoding.ASCII.GetString( adNAME );
        byte [] UserKey = GetUserKey( UserID, KeyID );

        MD5CryptoServiceProvider MD5 = new MD5CryptoServiceProvider();
        MD5.TransformBlock( adNAME, 0, strName.IndexOf( '\0' ), adNAME, 0 );
        MD5.TransformFinalBlock( adIVIV, 0, adIVIV.Length );

        Decrypt( adPRIV, 0, adPRIV.Length, UserKey, MD5.Hash );

        if( Encoding.ASCII.GetString( adPRIV, 0, 4 ) != "itun" )
        {
            throw new Exception( "Decryption of 'priv' atom failed" );
        }

        Buffer.BlockCopy( adPRIV, 24, Key, 0, Key.Length );
        Buffer.BlockCopy( adPRIV, 48, IV, 0, IV.Length );

        for( int i = 0, Pos = apMDAT + 4;
             i < SampleTable.Length;
             Pos += SampleTable[ i ], i++ )
        {
            Decrypt( sbuffer, Pos, SampleTable[ i ], Key, IV );
        }

        Encoding.ASCII.GetBytes( AtomMP4A ).CopyTo( sbuffer, apDRMS );
        Encoding.ASCII.GetBytes( AtomSINF.ToUpper() ).CopyTo( sbuffer, apSINF );

        bw.Seek( 0, SeekOrigin.Begin );
        bw.Write( sbuffer );
    }
}

class DeDRMS
{
    public static void Main( string [] Args )
    {
        FileStream fs;
        M4PStream m4p;

        if( Args.Length != 1 )
        {
            Console.WriteLine( "Usage: DeDRMS file.m4p" );
            return;
        }

        try
        {
            fs = new FileStream( Args[ 0 ], FileMode.Open,
                                 FileAccess.Read | FileAccess.Write );
            m4p = new M4PStream( fs );
            m4p.DeDRMS();
            fs.Close();
        }
        catch( Exception e )
        {
            Console.WriteLine( "Exception: {0}", e.Message );
            return;
        }
    }
}
Posted by Ivan at 07:57 AM | Comments (0) | TrackBack

April 25, 2004

Sorta Neighbor Stalking

Check out which presidential candidates that your neighbors support.

via Big Rick.

Posted by Ivan at 03:33 AM | Comments (1) | TrackBack

April 21, 2004

Rice Grower's Paradise

I learned in my Japanese class today that there's debate over the rice industry and its workings with the government in Japan. In 1942, during WWII, the government began buying rice from growers and selling at cheap prices through the Japanese Agriculture cooperative Association (JA). This helped keep prices low for consumers, and I believe it was with the goal of keeping the nation with enough food.

Zoom to today, after the war; the number of people buying and eating rice in Japan has been cut in half. The government continues to buy rice from growers, but fewer people are buying, so more and more rice is being stored up by the JA. Growers are lobbying to keep the status quo--after all, they have a guaranteed customer (the gov't) and are protected by the roil and toil of the economy and consumer demand. Rice fields fill up the countryside, and the government keeps buying. Who loses? The government, and subsequently, the Japanese people. Who do you think has to pay to store up all the unused and unbought rice?

Meanwhile, the growers are having a ball, sheltered from the reality of economic demand. Land is wasted, and resources are wasted; and the rice market is skewed.

Then there's the whole deal of imports of rice from abroad. Lunch boxes (erg, that is, boxed lunch sets with rice and meat, etc., called bentou) are imported from California with California rice. Rice growers in Japan ain't happy campers with that. Usually, plain uncooked imported rice would cost 490% more than Japanese-grown rice; however, these boxed lunches come in un-tariffed. The rice growing lobbyists urge the government to help protect them against these "evil" imports that are taking away Japanese jobs.

Adam Smith is doing somarsaults in his grave.

Enough of this silly hand-holding; wasn't that what broke the Japanese economic boom in the 90's?

Posted by Ivan at 07:43 PM | Comments (2) | TrackBack

Morals and Politicalisms

My Political Compass results:

Economic Left/Right: -3.00
Social Libertarian/Authoritarian: -4.46

My morality and how I compared to others:

Your Moralising Quotient is: 0.13.
Your Interference Factor is: 0.00.
Your Universalising Factor is: 0.00.

It seems that I'm quite a Permissive Left Libertarian.

Also, I'm quite far from most of the US Presidential Primary players.

Posted by Ivan at 07:07 PM | Comments (0) | TrackBack

April 20, 2004

On Dial-Up and Being Content

The dweebats posting on Slashdot think that dial-up users are ignorant twads; that is, judging from their responses to the recent reference to the NY Times survey. From the article:

In a survey taken in February, the Pew project found that 60 percent of dial-up users said they were not interested in switching to broadband, roughly the same result as in a February 2003 survey.

And Slashdot's comments are the typical bray and neighing of hoo-haa and penis warring about the virtues of broadband.

I use dial-up at home, and I'm fine with it. Here in Japan, I make use of WiFi, which is all neat and dandy but dial-up would be fine too.

I've been on DSL (ah, good ol' NorthPoint), and I've been on T1; and I don't must-needto-haveto have broadband. This is mighty similar to folks who tell you to buy the biggest baddest fastest computers. I don't need all that jazz; I wouldn't use it.

I consider myself a relatively tech-savvy fellow, and I'm not ignorant about the workings of these things; I just make a choice based on what I need. I didn't need anything faster than my Pentium 166 until sometime in 2001 (maybe I still don't, hmm). Linux was extremely effective and met all my needs perfectly without having to shell out extra money upgrading to the shiniest new toy.

I'm not a big-time gamer (well, just occasionally), I'm not a multimedia factory, and I sometimes just want an clean all-text console interface (dealing with windowed environments can slow me down, especially when coding).

Posted by Ivan at 01:15 PM | Comments (2) | TrackBack

Between Acquaintances and Friends

The gap between acquaintances and friends in Japan is emptier than the one that I know in the U.S. That is, you're either one or the other; this makes it difficult for Japanese to make friends, but once they make them they stick to each other like flies on sugar.

I think this has a large part to do with the in-group/out-group thinking, and the feeling of obligation/responsibility for each other.

I'll write more about this soon.

Posted by Ivan at 03:45 AM | Comments (1) | TrackBack

McDonald's (former) CEO's Happy Meals

Yahoo! News says:

McDonald's Corp. Chairman and Chief Executive Jim Cantalupo credited with turning around the American icon, died of an apparent heart attack.

Too many Big Macs?

Posted by Ivan at 03:26 AM | Comments (2) | TrackBack

More IrDA OS X Fun

I haven't re-put up my original post on how to sync the Palm Vx with an iBook from my old scribbles archives yet [UPDATE: nevermind, the original post is up now]; I'm getting there slowly but surely. Anyhow, I've wanted to use jpilot in place for Palm Desktop; I find the interface much fresher and the category organization completely natural--and similiar to the interface on Palm OS itself. Why Palm doesn't mimic the category display on Palm Desktop escapes me.

Also, jpilot has a plugin for KeyRing, which helps me organize passwords.

Anyhow, I was skeptical about getting it working under OS X, considering I've got a peculiar setup with the IrDA. I found jpilot in fink's unstable tree, so that was pretty straightforward. The next part was trying to figure out where jpilot was going to find the PDA.

Snooping around /dev while the IrDA was plugged in, I found:

/dev/tty.IrDA-IrCOMM191
/dev/cu.IrDA-IrCOMM191

"Well, that seems completely simple," I thought, and it was. I just made a symlink to /dev/pilot with the following command:

ln -s /dev/tty.IrDA-IrCOMM191 /dev/pilot

and voila! I can now sync jpilot with my Vx! Just press "Sync" on jpilot, run HotSync on the Vx, and things go smooth as a newborn baby's behind.

Posted by Ivan at 03:19 AM | Comments (0) | TrackBack

WiFi Accessorizing

I finally decided to purchase a Cantenna to get better WiFi leeching ability. Shipping and handling is a pain in the nether regions, but the bullet's getting bitten. All in the name of geekdom.

I'll have to find some way to stick that dongle through a hole (hmm, that sounds obscene) on my iBook.

Posted by Ivan at 03:03 AM | Comments (0) | TrackBack

April 15, 2004

Irasshaimase!

I found a part-time job (called arubaito--バイト) here at a local sushi restaurant. Well, more like sushi boat restaurant. Today, I learned how to roll rice--or rather, attempted how to learn how to roll it. I have to get 19 grams exactly when pulling out the rice and then roll it into a pretty shape.

There are also Chinese people who work there; two of them work in the back where they wash dishes. Kind of makes me think that the Chinese are to Japan's restaurants like Mexicans are to California's back kitchens. Hmm.

I smell like fish now.

Not time for any more talk; study and sleep time!

Posted by Ivan at 01:53 AM | Comments (2) | TrackBack

April 07, 2004

More and More Sakura

Posted by Ivan at 10:02 PM | Comments (5) | TrackBack

April 06, 2004

J-Pop English


Posted by Ivan at 10:00 PM | Comments (0) | TrackBack

April 02, 2004

Slowing Down the Blog

Alright, school stuff is starting up again; not to mention that I've been on information overload mode the past couple of weeks. So, I'm gonna be pulling away from the computer--or at least the WiFi--before I get stuck in this zone.

Have you noticed? I've been posting pretty much every day! I think I'm just addicted to people's comments. :)

Posted by Ivan at 08:44 PM | Comments (2) | TrackBack

Air America

Of course, I had to tune in to Air America's webcast stream--y'know, being that there aren't any affiliate stations around my area of Kyoto. It's refreshing to have some liberal talk radio to listen to; I'm a bit worried (from listening to what I have) that things may turn into a Republican bash-fest.

WiFi is bad today (my suspicion is that the rain is doing bad things), so I'm not able to listen to anything reasonably without constant hiccups. Instead, I'm listening to Beastie Boys now, yum!

Steal from the rich, and I'm out robbin' banks
Give it to the poor, and I always give thanks
Because I've got more stories than J.D.'s got Salinger
I hold the title, and you are the challenger

[update: link was pointed to airamericaradio.org instead of .com; oops!]

Posted by Ivan at 08:09 PM | Comments (5) | TrackBack

Ode To My Potato Gun

This is an old prose poem I wrote; man, that was kind of a long time ago.

Some parts are funky, I may have to re-master it to flow a little better at some parts.

Travelling about
This village of Pitzer,
I've seen many a joints
And many a beer.
I've seen Jack'o Daniels
Roam the halls of this land.

Thus I've found my good friends:
Boredom and Disgust,
And together we've conjured
And planned fun for us.

It began once a day
When the three of us sat,
And Disgust was struck
By a thought in his hat.

"We must do evil things!"
He shouted aloud.
"Yes!" followed Boredom,
"And do it with smarts
And the skill from our brow!"

I knew what I had to do.

I dialed to whom I could trust
To be my right-hand man
For my right is in pain.
T'was David the Great
Whom which I was seeking.

He knew of my plans,
And he knew of my ways.
"Hark! Let us go!
Let us go and be Great!"
Said he with a roar.

So us four,
We went out
To a land far away.
We went a great distance
To our companions' dismay.
We went to HomeBase
Without losing face,
And brought back some pipe,
Sending my checkbook to waste.

Now many go thinking
That we be like fools--
Buying ABS pipe
To be fresh and look cool.
But, hark!
For you've yet to know,
That this ABS makes potatoes go!

So I built this great gun
To shoot up some starch,
For folly and fun,
Then went on a march.

No potatoes would fly
For my gun would not shoot
Not one night nor second
What a waste of my loot.

But that second a time,
On that strange spring a night,
Camp. Sec. came a wheelin'
Much to our fright.

They looked at us strangely
And wondered perhaps
That we're Harvey Mudders
Being nerds such as that.

"Alo! We be nerds!
But we be not Mudders
And although we dost not look it
We're from Pitzer in fact."

So we talked for a bit
As I worried much so
About my tuition
And where my gun'd go.

They took her away,
My project--they did.
Those bastards be scand'lous
And ignorant of my science.

So I walked to the Dean
That very next day
And that bloody bastard
Wanted little of my ways.

"That thing there is scary
And cannot be good
I know not how it works
For I am a fool."

He said this to me
As I mumbled and groaned
For he'd not give me permission
To do this here at 'home.'

But he'd get back my gun
To shoot her abroad
But yet to this day
I've seen not my beauty
Of plastic that awed.

Posted by Ivan at 07:39 PM | Comments (2) | TrackBack

April 01, 2004

Stop Making Men Wusses

Women Lose When Feminists Bash says:

By the 1970s, feminists had lapsed into an orgy of male-bashing. Men were stereotyped as insensitive, controlling, sexual harassers, batterers, and rapists. Eventually the phrase "male-dominated" became a short-hand expression for anything that was wrong with society.

Crazy shit happens when PC stuff gets out of hand, and I'm not talkin' about WindowsXP crashing every 10 days.

via Metafilter.

The article goes on later:

Men generally don't like to complain. A man will endure ridicule and abuse, and then move on with his life. But abuse him once too often, and he will vote with his feet.

And one day, men woke up to the fact that marriage was a losing proposition. The math was hard to refute: Half of all marriages wind up in divorce. In 85% of cases, mothers gained custody of the children. And sometimes, bitter ex-wives would try to turn the children against their father, what psychologists call Parental Alienation Syndrome.

Reminds me of the rife amount of male bashing (or just general sheepingly over-liberal PC ideas) I experienced at Pitzer.

I really believe that America is turning its men into wusses. You're either a wuss or you're a woman-hating asshole jerk. It's a kind of identity crisis for men.

I think it's even worse in Japan where sons don't get a chance to see the work-12-hours-a-day father other than the few hours during the weekend. These dudes aren't gettin' the manly juices from their dads, and watching TV is probably gonna either make them cowardly pips or angry misguided thug boys.

As far as I know, Japan's never had a huge shift in thoughts about gender (there are feminists, and people who wish for change, but no real change has come). So I don't think there's ever been the whole male-bashing thing here. The wuss-boy phenomenon here's been more of an outcome of the work-your-ass-off dad salary-men that arose after WWII.

In America, though, I think it's more of the man-bashing feminism. The PC-ness of it all causes a chilling effect, and I truly believe that men are scared, whether they think they are or not.

OK, I'll stop there before this turns into something like what Kelly would be writing in his rants. :P

Posted by Ivan at 02:30 AM | Comments (3) | TrackBack

Superman vs. Seinfeld

I absolutely love Seinfeld. And you should too. So... you should watch the new Adventures of Seinfeld & Superman! [Flash required]

And if you've got time, click on the "Playbill" magazine and sing along for Oh Yes Wyoming!. Hilarious!

I've transcribed the lyrics to the song below.

via Metafilter.

Oh Yes Wyoming! With the trees and the horses and the rocks and the sheep

Oh Yes I'm Going!
Through the plains and the trails
and the streams and the hills

Oh No Nebraska!
Is there a plainer state I ask ya

Oh Yes Wyoming!
There's no place I'd rather be roaming
with the geysers and the canyons and the watering holes
with the geysers and the canyons and the watering holes

Oh Yes Wyoming!
With the mountains and the lakes
and the plentiful fish

Oh Yes I'm Knowing!
This land will fulfill my every wish

Oh No Dakota!
Doesn't interest me one i-ota

Oh Yes Wyoming!
There's no place I'd rather be roaming

Yada Yada Yada
(talking and such in the background)

Oh Yes Wyoming!
With the cabins and the camping and the bakin' beans

Oh Yes I'm Glowing!
With the bison and the banjos and the wily racoons

Oh No Ohio!
I can hardly wait to say goodbye-oh

Oh Yes Wyoming!
There's no place I'd rather be...
Ends with m-i-n-g...
Shout it out loud with me
W-Y-O-M-I-N-G

Oh Yes!

(c) 2004 American Express Travel Related Services Company, Inc.

Transcribed from the Flash animation at The Adventures of Seinfeld & Superman.

Posted by Ivan at 01:24 AM | Comments (0) | TrackBack

Sign Language Phones

Vodafone, one of the three leading mobile phone carrier in Japan recently announced the opening of a 5 story store in Shibuya, Tokyo. I don't get it; how the heck do you fill 5 floors of space with mobile phones? I know there's a menagerie of models, but.. c'mon, that's ridiculous.

Apparently, this new store is a kind of center for hearing disabilities. (OK, that's one floor taken care of; four more to go) What the heck does a deaf person need with help with using her phone? You can't talk, so you use the e-mail on it: simple as that! Sure, you could use a half-fortune sending live video over the camera while you sign language away with one hand while holding the phone in the other, but why not just send text? Pretty much everyone just sends text around here anyways.

Am I missing something here?! Maybe they just wanna help make more jobs.

On that note, vegetable prices at my local super have gone up; dammit!

Posted by Ivan at 12:29 AM | Comments (2) | TrackBack

Jason + Cinderella = ?

Joyce Fong has given me an opportunity to introduce myself to her blog. Her newest post inspired me:

i was watching one of those friday the 13th movies and i needed to watch something really happy after so i wouldnt' get nightmares. so i watched cinderella. that night, i had nightmares of cinderella wearing a hockey mask. it was kinda freaky.

No doubt, I just had to have a response to this!!! Look on for the monster I've created!

jason-cinderella.jpg

Oh, please make it all go away at midnight!!

Posted by Ivan at 12:02 AM | Comments (2) | TrackBack