Saturday, September 29, 2012

Pause Console Application in the End

If you want to pause your Visual Studio console application in the end, there is no need to insert something like Console.ReadKey(). If you run your application with Ctrl-F5 (Run without Debug) then Visual Studio creates and runs a batch file that look something like that:
your_program.exe
@pause
So, command line will pause with "Press any key to continue..." message when your program is done and you will be able to examine the output.

Input Arguments for Console Application in VS

If you want to run your console application from Visual Studio (Ctrl-F5) and you need some input arguments that you need to specify them in Project -> Properties -> Debug -> Start Options -> Command line arguments.

Friday, September 28, 2012

Why science TV programs suck

We, all saw a lot of popular science programs on TV. BBC, Discovery and others show them all the time. And somehow all the programs about nature are interesting and amazing and all the science programs suck. They try to explain very interesting things but immediately fail because of stupid effects or science guys who look ridiculous trying to explain the universe looking at the spider web or playing a piano and saying: "OK, this has nothing to do with this web/piano, but I will still proceed." I understand that networks just need ratings and it causes weird decisions. But are there a lot of guys who would love to watch something solid and serious, who would love not to be treated like all they want is entertainment. I would totally pay extra for that.

Windows Command Prompt Tips

1. Copy/Past to the Command Prompt
Not very convenient but still easy. You can Right-click on top of the command prompt window (top window bar) and choose Edit menu. There you can copy text from the command prompt and past into it.

2. Open Command Prompt in Current Directory
Discovered this feature only recently. It made my life much easier. Right-click somewhere in directory (not on the file or menu) with the Shift button down. You will see a new option "Open command windows here" that will open Command Prompt in the current directory. This feature does not work inside Libraries (Documents, Pictures, etc.) in Windows 7. Don't really know why. May be path to the directory is ambiguous because you can add a lot of directories to your library. Although, paths in sub directories are well defined but this feature still does not work.

DELTA Statistics

I really want to write about my new Android applications that collects statistics for my DELTA research project at the USF. It is my first serious experience with Android (before I worked more with JNI and native code) and especially with Beta testing. What I want to do is to cover some Android features that I used and also to talk about my application's design.

So, that what comes to mind:
  1. Alarms in Android (how to schedule alarms and do something when you receive them).
  2. Background services and WakeLocks.
  3. Alerts in Android.
  4. Text file handling (saving, etc.).
  5. Sending data with HTTP post request.
  6. Custom notifications.
  7. How to catch when device goes asleep (doesn't look very big but I am really exited about this because I did not find any information on in).
I think I will just divide everything in 8 posts (don't know how I will write all this...): these seven above and one about general design ideas I had in mind when I wrote the application.

Tuesday, September 4, 2012

Get Cause of Exception

Got a weird InvocationTargetException in Android. Why nobody told me to call getCause() method first and not to google it for half an hour? Happened to be a security violation (did not have a required permission) and a simple fix.