Thursday, March 31, 2011

I finished moving to Tokyo! (sakura house)

After living in Gunma for all my college years, I moved to Tokyo in order to work for the only company that hired me, Rakuten Inc.
I really had no money to move, so I came again to a sakura house, sakura houses are cheap places for foreigners exclusively. There are dormitories, shared rooms, single rooms, and even hotel-like places for very short term staying.
When I first came to Japan, I also had no (very few) money. And I stayed in a dormitory in Shim-Bashi (close to Tokyo station). That totally sucked. 8 people!! living in the same small room...
There was like only one table in the whole room, to eat obviously. So if you wanted to use a computer, you had to do it in bed... Which is mostly OK, but the power cables were really set in a dangerous manner^^.
Not just that, every one had different lifestyles, and it was very hard to sleep/concentrate/watch porn...

Anyway, I had a bit more money than I had when I first came to Japan^^. So I could afford something better. Still, it's a shared room, but the last guy just moved, and I have the whole room to myself!!


It's not that bad. But certainly not meant for staying long...

They give you a list with things that if you break, you have to pay for.
The list looks something like this:
  • mirror = 4000y
  • lamp = 5000y
  • table = 7000y
Which is ridiculous being that you can obviously see they are mostly 100y stuff (there are special stores which sell all their products for one 100y coin). The lamp is probably 1000y, and so is the table...
I guess most foreigners wouldn't know so they put those crazy prices.

The worst thing so far, was actually signing the lease contract. The guy who attended me wasn't exactly 'polite'. And I really hate that, especially in Japanese people, being that they know good manners and how people is usually treated as a customer.
But there are some assholes everywhere I guess.

At least the place is close to my work. And I can probably like go walking everyday. Which is great being that as I said, I have like no money left.

sakura house's toilet:
In the censured part, it says "26cm"... eeeeeewwwww


After living a few days...
The room is like very warm, a very good quality I didn't expect. But there's a catch! The walls are like very thin, and next to the window there's like a hole that connects the rooms (it probably was a huge room, and they just put some reforming walls, you can see like tons of screws in the wall, and a very long tape!!), so you can hear everything the next room's people are doing...
This morning (April 2), the guy next room brought his foreign girlfriend, and you could totally hear them having sex...
I was doing my homework then, so you can guess how distracting that was! (I couldn't keep my ear from the wall...)

And the staff doing the cleaning were also talking in a very loud voice right in front of the room, so that was just plain annoying.

Still, it's probably just a weekend thing, being that weekdays were very quiet.

updated on 07/25

These pictures are from when they "painted" the walls. They moved me temporarily to another room, and this is how they gave it back to me...
I'm never living in a sakura house again...
How can they treat people like this.

Tuesday, March 29, 2011

converting all png files in a directory to eps

I took some screenshots of a web interface I did (screenshots of my browser's window), and in order to attach them into my latex report, I did this code to convert all the files from png to eps.

for FILE in *png ; do
  BASENAME=`basename $FILE .png` ;
  pngtopnm $FILE |pnmtops|ps2eps >$BASENAME.eps ;
done

Sunday, March 27, 2011

going to Takasaki from Kiryu by bicycle to change my visa

It was one of the most tiring things I've ever done.


View Larger Map

A distance of about 21 miles (33kms), by bicicle, because the trains are either too few, or not running at all, because of the earthquake.

I had to go because the company I'm going to work for (Rakuten) told me if I didn't apply to change my visa about that day, I'd probably not be able to get it in time to work for them... So I was obviously desperate.
I had to change my visa from "student", to "Engineer/Technician".

These are some pictures I took while going from Kiryu To Takasaki (both cities in Gunma prefecture, Japan).

From the juku I was working part-time while in college. I used to teach elementary, junior high, and high school students English. The girl in the flag is so cute^^.
You can see the mountains, which really made me feel I was in Gunma (it's known for being the country side...)


 The you are entering Takasaki sign.


 Takasaki's roads are so much better than Kiryu's... My bike just keep breaking (getting flat tires mostly) because of them.
 Some bike road
 Some bridge being cloned.



 Another juku of the same chain I was working for. It was the first time I saw another of them...

Some cute Japanese girls

 The JR Maebashi train station. Empty because now that we have almost no electricity (after the earthquake) trains are going like once every 3,4 hours... if you're lucky and your local station wasn't too damaged.


As you can see, I was going pretty easy. I had no idea what kind of a horrible day it was soon going to become...

I arrived to Takasaki in about 2 hours 40 mins. A lot sooner than what I expected, taking into account the convenience store breaks, and the time it took me fixing my bike.

I got in line in the immigration office (Takasaki Regional Immigration Bureau) like more than 1 hour before they even opened (they open at 9am).
And that's when the nightmare began...

They called my number.
I tell the lady something like "I'd like to change my visa.", gave her the documents.
And out of nowhere, she answered me in a very rude way "You can't apply with these documents! There's nothing to prove you have graduated from this college!" (it doesn't sound too bad in English, but in Japanese you have to refer to people you don't know well in a polite form she wasn't using)

Still, I took it easy. Being that I'm foreign, and many foreigners don't even understand basic Japanese, I thought she was just trying to sound clear to me.
And I went along: "I really need to get these papers done by today. Would it be possible to call the University or hand over a copy of my college ID for the time being? I assure you I'll bring the papers I don't have right now by tomorrow... "
Ugly woman from immigration goes: "No! Not possible! Bring papers from your college... where is it?... Oh Kiryu, go back to Kiryu and bring them over"
Me: "I'd really much like to do that, however due to the earthquake's impact, as you know, trains have been stopped, I came here by bicycle running over 20miles, and taking over 3 hours just because of this. "
Ugly damn woman: "Then good luck going back to Kiryu by bicycle! It should take you 6 hours so you can still do it, we'll be open till 4pm"

I repeat, I can't really express in English how rude she sounded, but believe me, she was!
I've lived in Japan for about 6 years. And I've never been treated in such a displeasing/rude/bitchy way. I was about to kill her with my bare hands.
I'm so going to send a complain letter.

Anyway, I just gave her a homicidal look, and hurried back to Kiryu.

This woman had no idea who she was talking with.
I came to Japan just to get a cute Japanese girlfriend for god's sake.
Telling me to run 40miles just to get some documents was like the easiest thing for me.
The things, her attitude is not fit as someone who has to talk to people all day long. Hell with those manners, I don't think she's even fit to live in a society (in a Japanese society at least, she'd be in home in China probably).

Going back to Kiryu, I was so pissed off and not concentrating in the way, I got the wrong way and arrived to Ota. And by then, it was like really windy, so I really lost some valuable time.

I was "lucky", my graduation ceremony was cancelled as a sign of respect to all the people who died in the earthquake. And the needed documents were the graduation certificate, and my grades certificate, which were both going to be given to me that day together with my bachelor's degree!

I arrived at about 1pm to Kiryu. Got the documents, and headed back to Takasaki...
With that wind and being that tired I probably wouldn't be able to arrive in time, so I called a friend to give me ride.
Again, because of the earthquake, gasoline stands have very few or no gas, so it was a hard thing to ask. But he did^^. We reached Takasaki in time, and finished the damn thing.
Now I just have to wait till they send me a post card telling me to go get my new Visa (if I pass the screening, which I likely will).

Anyway, that was a horrible day.

Tuesday, March 22, 2011

My thesis

I have to hand in my thesis by tomorrow...
So far, I have like 7 pages of only results (tables and graphs). And I'm writing the abstract right now.
I don't know why, but I really don't feel like writing it. This is a problem all right><.

Besides really have to renew my visa (from exchange student to working visa), and get a place to live in Tokyo... I should have done all of these things already but I didn't have the money.
Damn, having to do stuffs you don't want to can be stressful. Even more when you have mostly no idea what the heck you did and they tell you to write about it!!

I understand what I did from a programmer point of view... I wrote some shell scripts that used some programs to calculate some scores on some files my professor gave me (DNA sequences for benchmark), and repeated using lots of different models. I also wrote some scripts to make nice graphs and a table with all the results put nicely. Now, apparently I want to say using codon to process stuffs is better than using amino acid sequences/proteins, but I really can't explain why (being that I know shit about biology...).
I guess I'm gonna have a very short introduction and mostly write in the "method" part, and a bit on the result and conclusion parts.
I had to do three tasks, one which is the thing I have no idea of (above), and the other two were web interfaces of programs called phyml and clustalw2, edited to process codon sequences.
At least the part about the web interfaces should be easy... it just has to be><.

I wanted to do anything but writing my thesis so I was like even looking for my rubik's cube... can't find it>< damn.
I'm going to restrain myself from writing other programs and playing quakelive at least till I finished this.

hate those mommy's boys

At the train (again), I saw a kid looking like very scared of his dad. But that was talking and really seemed to like her mom...
I guess they had like family troubles, because the father was like sitting as far as possible from them and didn't see very pleased about being with them.
The kid was like showing her mom his hand, and telling her like that it hurt or something.
The thing is, she was like holding that kid's hand and kinda touching him in a weird way and really gave me the creeps.

omg, I hate those pussies who like their mom so much they never get away from her, and even get to speak/act like chicks.
I would love to kick to all of their little pussy asses!

But again, I'm pretty sure my testosterone levels are above normal so it might be just me^^.

I have nothing against gay people, but damn I hate pussies.

Monday, March 21, 2011

In the train, my blood pressure goes through the roof whenever I see a cute Japanese girl with HUGE legs and a mini-skirt, and she sits in front of me><...
Getting one of them is like my dream...

moving to Tokyo

Yesterday I went to see some places to move to in Tokyo.
The real estate company guys had kind of a "loose" office, and the guy attending me kept sneezing (he had a cold) right next to me... In Japan you usually wear a mask when you have a cold, so that was rather impolite. Besides the fact that they kept shouting when someone had a call...
After just looking the database and doing lots of phone calls to see if they were still available (3hrs in that...), "we" were going to actually see the places. Then "we" became "I" as that guy had to do some contract, and promised to meet me at one of the places after that was over.
He ended up just telling me where the keys were, and the combination for some number locks and didn't come.

The name of the company was Etown, it's in Gotanda, Tokyo. Don't go there!

Anyway, the places were all too expensive. I needed like 180.000 minimal in order to move to any of them, and they're the cheapest the could come up to.
The thing is, in Japan you have to pay for "Reikin" and "Shikikin", some stupid fee that originally was meant to thank the landlord for letting you move in + some deposit kinda thing.  They usually cost from 1 to 3 months of your rent... So you end up paying like 5 times your rent just to move in.
Places without Reikin and Shikikin are getting more available, but most places still have them.
I was obviously looking for places that don't need them (being that I have like no money at all right now...), but the real estate company's commission is still one month. So I need like 2-3 times a month's rent in order to move in to any of their cheap places ( which is about 180,000yen).


I don't like it, but after the paying the tuition fee for college, I really have no money!
If I could at least pay after I get my first payment for working in Rakuten that would be great!

I guess I'll be staying in sakura house again...
They give cheap rooms for foreigners in Japan. And have dormitories, shared rooms, single apartments, etc.
You still need like 30,000yen for deposit + your rent before hand, but that sums up to like 75,000yen for a 2 people shared room very close to my company, which is like less than half of which would take me to move to any other place.
The thing is... sakura house is not such a nice place^^. The place I lived in when I first moved to Tokyo a few years ago, was a dormitory of 8 people! (in one room!) So it was dirty as hell, stinky, you have no space to even change your clothes, no closet, and obviously with 8 people living together, different lifestyles that really end up getting on your nerve...
Some guy from Europe came to Japan just to party and went to like discos  in Roppongi (where all the cheap/easy chicks in Japan are) every day, coming back very drunk. Which would be just OK if he didn't keep waking me up.
And forget about watching porn, with 8 people, there's always someone in the room...

At least, apparently the maximum people in the room they have is like 6. Which is an improvement. And they have a lot more cheap, shared (2people) rooms. I'll give sakura house another change, just till they pay me enough to move to a decent place (maybe about 3 months...).

Saturday, March 19, 2011

stuff I want for my new place

A new chair...
I want it to be very comfortable, but still let me work when I have to... especially in front of my computer. But I also want to be able to read books on it... And obviously rest when I'm tired so it has to be able to recline.
I saw these two (in Rakuten):
And this one.

Besides the fact that the model is extremely cute... (I love Japanese girls)

And, although expensive as shit, I'd love an electric fireplace too.

Saturday, March 12, 2011

emacs un-declaring/removing function or variable

Every time I forget this and look it on the reference I can never find again, or takes me so damn long.

How to unbound/undeclare/remove/unset a function:
(fmakunbound symbol)
Where symbol is a function name.

There's also a version for unsetting variables:
(makunbound symbol)
Where symbol is obviously a variable.

Friday, March 11, 2011

Earthquake

Damn, there just was a huge earthquake.
My bookshelf would have fell down if I hadn't held it. I live in the 8th floor, and I really thought this building was going down!
Good thing it didn't><.
My microwave and lots of stuffs fell to the floor though, and some electronic devices lost their power cable... Besides my computer desk looks like crap.
But still, as long as I have a change to get a cute Japanese lady, I'm all for it!!

Tuesday, March 8, 2011

auto-window opener (download helper for free users in download sites)

Being totally sick of my thesis and my slides for the presentation I gotta do tomorrow, I wrote some greasemonkey scripts to help me automate as much as possible (and remove those annoying Ads...) downloading as a free user.
I wrote three scripts; for filefactory.com, filesonic.com, and for uploaded.to.
You can see them in here.

The thing is, you'd still have to click on the links after a period of time (the download site usually prevents you to download files continually without waiting, just to annoy you).
So I also made a little page that does that for me, and added the ability to read links in html source code, so you can just a page with lots of hotfile.com's links, and copy them right away.
I put it in my webiste.

Ah, I'm so sick of college.

I love awk, grep, and sort

Not to say the obvious (which is I like linux a lot!), awk really comes handy so often...
I have some files of my research (I'm a senior at college), which have like 9 columns of rather big numbers, representing some benchmark results.

Having to put them in an openoffice spreadsheet after sorting them, my friends grep, awk , and sort really helped me out:

blosum 0.824/0.735 0.894/0.432 0.694/0.349 0.728/0.364 0.832/0.595 0.817/0.610 0.794/0.495
gonnet 0.865/0.781 0.934/0.596 0.756/0.447 0.822/0.543 0.876/0.661 0.864/0.692 0.851/0.606
pam 0.764/0.639 0.851/0.321 0.582/0.175 0.672/0.161 0.666/0.388 0.746/0.485 0.707/0.337
jtt_aa_codon 0.840/0.747 0.927/0.562 0.769/0.494 0.798/0.439 0.809/0.555 0.842/0.653 0.829/0.559

I have a file with data like this (a lot more though...), and I want to sort those three fields by the 7th column's left value, and also separate the values divided by "/" and obviously print the first field...

$grep -E "pam|blosum|gonnet" whole_hyou.txt |awk '{print $1, $7}'|awk '{split($2, second, "/"); print $1, second[1], second[2]}'|sort -k 2 -r

gonnet 0.864 0.692
blosum 0.817 0.610
pam 0.746 0.485

Ah, and then I just select and press the mid button in openoffice, click on "space" as a separator, and I get right done what I wanted to do in almost no time...
I've seen my friends trying to do the same thing in windows...
I would kill myself/or die of boring if I had to waste my time like that!

Wednesday, March 2, 2011

php doing multiple commands without hanging

For some reason, running multiple commands (for programs that take long) while redirecting one of their outputs to a file, in the background, hanged my browser in php. My command was something like this:

command.sh somefile.txt &> output.txt && some_other_command.sh somefile2.txt &
And my php code looked like this:
exec($command); //$command being the above string in single quotes


If run in the shell (command line) though, it works without any problem, correctly being run in the background.

I have no idea what the reasons are, but there are three points that you have to be careful with when running multiple commands like this:

  1. The exec() function. Even after correcting the code (no. 2 and 3), it would still hang when using it.
    The solution is to use popen()/pclose(), and fread().
    E.g. instead of:
    exec($command)
    do something like:
    $handle = popen($command, "r");
    fread($handle, 4);
    pclose($handle);

  2. The "&&" string. The program correctly returned status 0 (you can check that with "echo $?" in your shell). But this makes it hang too.
    The solution is to use ";" instead.
  3. The output redirection... have no idea why.
    The solution is to use the "tee" command to output to a file better.
So, the above code corrected would look like this:

command.sh somefile.txt |tee output.txt ; some_other_command.sh somefile2.txt &

And the php code would look something like:
$command = 'command.sh somefile.txt |tee output.txt ; some_other_command.sh somefile2.txt &'
$handle = popen($command, "r");
fread($handle, 4);
pclose($handle);


Although running the command in a sub-shell environment makes it easier to read (and maybe necessary).
I mean, instead of running it like:
command.sh somefile.txt |tee output.txt ; some_other_command.sh somefile2.txt &
You run it like:
(command.sh somefile.txt |tee output.txt ; some_other_command.sh somefile2.txt) &
So you can clearly see what the expression is like, and that it will be run as a background process.




My real command, included sending an e-mail, whose contents were also made with php.
Just in case anyone is interested...
$command = "(nohub nice -n 15 command.sh somefile.txt |tee output_log.txt ; mail -a $mail_header -s $mail_subject $mail_address <<EOF
$mail_contents
EOF

) &";
$handle = popen($command, "r");
fread($handle, 4);
pclose($handle);


Remember to use double quotation ("") in strings where you want php variables replaced ('$stuff' will return just the string '$stuff', while "$stuff" will return the actual contents of that string). It makes the code easier to read.
The beauty of this, is that sends you an e-mail after the program is done! And, as running in the background, it allows the user to just close the browser window without interrupting the program.

ももいろクローバー

ももいろクローバー(Momoiro clover)
They are the new idol group in Japan. Man they are cute!
I didn't like AKB48, and these girls are cute and very funny (they appeared in a comedy TV show and were funny as hell).

Some of their music vids:





automatic log out

I was answering a form for a bit over one hour, and when I finally finished and pressed the submit button, I got a made-by-php-like page saying I was logged out because of no activity for too long...
All that text...
gone.

I can't believe such damn pages still exist!! I was so gonna kick my computer!
The page was in a site that my company (the one I'm gonna work for from next month) is running, and was about what kind of job I wanted to do! So as you can guess I had to write lots and lots about my experience and stuffs...
I had to write it all over, and was terribly sleepy.
Damn those stupidly made pages, at least put a javascript timer telling you when you are going to be automatically logged out, or let me copy what I wrote by letting my go back the previous page!!

Sociable