Tuesday, June 4, 2013

Windows Phone 8, WP8 - The 'await' operator can only be used within an async method.

Take this code for example: private void OnUnlockCommand(object parameter) { StorageFile file = await Windows.Storage.ApplicationData. Current.TemporaryFolder.CreateFileAsync("filename", CreationCollisionOption.ReplaceExisting); } The code above will fail with the error message: Error 2 The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'. To solve this you must add async to the method declaration like below: private async void OnUnlockCommand(object parameter) { StorageFile file = await Windows.Storage.ApplicationData. Current.TemporaryFolder.CreateFileAsync("filename", CreationCollisionOption.ReplaceExisting); }

Wednesday, July 18, 2012

Add SD card contents to Windows Library

1. Click start, type CMD and then CTRL+ALT+Enter. This will run the command prompt with adminstrator permissions, and you should receive a UAC popup. The resulting command prompt will be at c:\windows\system32 2. Type cd \ and hit Enter to get back to the root of the c: drive 3. Type mklink /D /J SDHC D:\ and hit Enter. 4. Now go into Windows Explorer and browse to the root of the C: drive. You should see what appears to be a folder shortcut icon next to SDHC, however if you open it you will see from the address bar that Windows still thinks you're inside the directory C:\SDHC\whatever while you're really browsing your own SD card. 5. Go to each of your libraries, click 2 locations at the top of the window, and add the appropriate folders on your memory card by browsing through C:\SDHC

Wednesday, April 25, 2012

Pass data between pages in Windows Phone

Here's some very useful code to pass data to the second page. I'll add something more about how to get data or selection back.

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
    if (this.NavigationContext.QueryString.ContainsKey("text"))
    {
        this.textBlox2.Text = this.NavigationContext.QueryString["text"];
    }

    base.OnNavigatedTo(e);
}

Friday, April 20, 2012

Create Default root password for Amazon EC2

When I want to change some files that are read-only to my account ec2-user, I will need to login to the root user so I can make change of them.

They way I create root password for Amazon EC2 is to use:

[ec2-user@AWS]#: sudo passwd root

Wednesday, April 13, 2011

CPU version of the Point Cloud Classification finished!

After 2 weeks of coding, the CPU version of PCC program is finally finished. It is now working correctly on CPU. What I'm going to do is to port some of the code into a video card version.

There are several things I need to add to the code:
1. To make sure change the code so that it uses the C++ code I already have.
2. To make sure the GPU version of the code can run in parallel.
3. Reduce the computation of finding neighbors.
4. Reduce the memory cost of the program.
*5. Finish it within two weeks.

頑張ります!!!

Thursday, March 24, 2011

The game "Ether Vapor"

Today I played the game Ether Vapor again. This is the 4th time I've cleared this game! (>_<)b

The game was released at 12/31/2007. Wow, that's 3 years ago... The group are still working on their latest game however still no update since January. I like Ether Vapor very much. As a computer science student, I always want to implement something that can inspire myself and also make profit. Ether Vapor was come from an idea of the administrator of the group, Nal. He started working on the game since 2005. He spent early 3 years to finish that game and release it for only 1500JPY each!

I saw this game first time when I was a junior undergraduate student. I don't have time to build a game at that time, also I don't have the skills to do so... But I think I can actually start to create something that I'm interested in. People always say that doing what you want is actually a kind of happiness. That's true!

Therefore, I'm going to first work on some books about computer graphics and try to figure out which kind of technologies I'm going to use. For now, I can build 3D models through 3ds max and code games through XNA... But that's not enough. The aim is to build tomorrow games today!

Finally, I want to express my thankfulness to the staff of Ether Vapor. You guys did a great job! And you have inspired a programmer to brave enough to build a better world!