Posts

Showing posts from 2009

Changing Keyboard from Japanese->English on EeePC problem.(日本語キーボードを英語キーボードに変えたら、またハマった)

The English keyboard of my EeePC(Ubuntu installed)Japanese Key board which I changed when I bought a English keyboard. I get a new English keyboard today, everything seems OK except backslash(\) and back-quote(`) key was not working, once again. I tried combinations of keyboard layout on System > Setting > Keyboard > Layout, but this time, it didn't work. Finally, I noticed that keyboard layout is different from BIOS setting, and I removed battery and shut it down for a while, and it came back to normal. I write this note in case somebody get stuck same situation.(I couldn't googled this out.) EeePCの英語キーボードが壊れたので、一旦、最初について来た日本語キーボードに戻し、英語キーボードに戻したところ、(またも)バックスラッシュとバッククォートのキーが反応しません。 ubuntuのセッティング>システム設定>キーボードでレイアウトと型式を色々変えてみたものの動かないし、途方に暮れてしまいました。 最終的にはBIOSからキーボードレイアウトがおかしいことに気づき、バッテリーを抜いて、電源を落としてしばらくしてから起動したら、やっと動く様になりました。 いや〜あせった〜。

defining constant in .h file in Objective-C

I tried to import .h file defining constant in it, but could not compile, because of redundant defining. So I googled and found a solution. I should use "extern const" in header file and set value in .m file. (Don't say about precompiler. I don't like #define in religious reason.) I was thinking a 'const' value work just as a precomiled value and is not affected by linking, but it's not a case with Objective-C.  ... OR is this same to normal c comiler? I should see it.

Creating Virtual Controller in Cocos-2d

**ATTENTION** I am currently not so sure if there is a better way to do, but I found this way handy and good for now. I am currently creating an iPhone game using cocos-2d, iphone game library, and I wanted to create a overlay buttons. I found it's easy using 'Menu' of cocos-2d, because they have animation buttons and it's easy to adjust their positions, align and opacity. Problem is, they don't have "Button Down" event. So I create a child class of MenuItem to catch their button-down-event by overriding selected/unselected methods. Here is "VirtualButton.h". #import #import "cocos2d.h" @interface VirtualButton : MenuItemImage { id myTarget; SEL selectedCallback; BOOL pushed; } - (void) setOnClickCallback:(id)target selectedCallback:(SEL)selected_cb; - (void) selected; - (void) unselected; @end and here is "VirtualButton.m'. #import "VirtualButton.h" @implementation VirtualButton - (void) setOnClickCallback:(id)tar...

The MBA guy

Image
I read Dilbert comics every day. Lately, it has been about a MBA guy coming to the Dilbert's office (of course, because of the economic crisis). It's funny and I can understand the allergy of people to MBA graduates, but if so, why have they exclusively possessed important positions in the US? Or... Maybe, MBA employers employ MBA employees. Isn't that right?

extracting Jpegs from PDF and push them to iPhoto album

Image
When I try to read pdf over hundred pages on iPhone, it takes too much memory and hung up. So I've been trying to save a pdf file as jpegs to read it on iPhone. It was not a straight forward, but finally I think I got the best way (for me). This is what I wanted to do. 1) select pdf file 2) create a new album on iPhoto whose name is same as pdf (without an extension .pdf) 3) extract each page as jpeg 4) push jpeg files into the new album The most difficult part was (2), getting new album name. I tried to do it in automator way, but finally I came to create name using outer script (in this case, python). Sorry the picture of UI is in Japanese, but they are 1. Select Finder item 2. Set variable (to variable 'filename') 3. Execute Shell Script 4. Set variable (to variable 'albumname') 5. Get variable ('filename') 6. Render pdf pages into images 7. Change Finder item name (to add sequential numbers to the file names) 8. Load files onto iPhoto(usinge variable ...

Ughh.. Xcode!

I am not sure if it is missing or I don't see right place, but when iPhone program throws exception, the debugger shows it is stopped by UNCAUGHT EXCEPTION, but what kind of exception was that. It has been long since I used visual studio on Windows, but I think it could do that. I can't help thinking Visual Studio on Win is better than Xcode on Mac, or is it just matter of experience?

Kodansha, Shueisha and Shogakkan bought Book-off's stock.

According to this article(google translated) the three biggest Japanese book publishers (and Dai-Nippon insatsu, the biggest printing company) are trying to buy about 20% of BookOff, the the largest used book chain stores in Japan. This news sounds little bit odd if you know the Japanese book store system. Japanese book stores have the "reselling system"(I am not sure this translation is right. In Japanese, it's called Sai-Han-Sei), any book store, but Amazon, can send back left books and get paid without penalty, so book stores in Japan are actually not retailers but something like landowners. To protect this system, publishers have been very aggresive against used book stores, and what will happen if they get biggest used book chain is bought by them? Japanese book reselling system is a kind of cartel, and if the used book market is somehow involved in it, it's too bad.

Programing iPhone game using cocos-2d

I am trying to create an iPhone program, for the first time, and this is also my first time creating a program in Xcode, and one more thing, this is my first time to create a game with cocos-2d. So, you know, it is very confusing about everything. I followed this instruction(Whitepaper: Introduction to Cocos2d iPhone) to create a new project onece, and it worked OK. But it was necessary to use new feature on cocos-2d, so I downloaded source code by SVN. It was so annoying to create new project all over again, so I followed this instruction(Creating a new Target-cocos2d-iphone-discuss/Google Group) , and, Ooops! I got into a huge(?) mess. Whenenver I changed a project little bit(even its project name), debugger stops launching OR program crashes on the line [[Director sharedDirector] attachInWindow: window] with UNCAUGHT_EXCEPTION. I spent two annoying days to avoid this problem and I finally give up. My go-around is just create a sub folder inside the cocos-2d and follow the first di...

From today... I'm gonna write in English.

I heard that there are not many blogs from Japan in English, I am trying to start one. Hopefully, it will continue for a couple of years, or months, ... or days.