Skip to main content

Posts

Showing posts from August, 2013

Getting started with Raspberry Pi

Raspberry Pi is a small, low powered motherboard contains 512 RAM, combined CPU and GPU. It has LAN, 2 USB, HDMI input, Audio Out, SD Card reader and S-Video connectors.

We can have many Linux distribution OS on it. To configure, we just need to attach SD Card to it. SD Card could range from class 4 to class 10. In some cases Raspberry Pi could support less then class 4 cards too. It could be powered through mini USB mobile charger.

Let's get started with installing OS on SD Card. There are various ways to install OS. Like we can download OSes through http://www.raspberrypi.org/downloads and follow the instructions given on it. There is something BerryBoot multi-boot loader through which we can have more then one OS on Raspberry Pi and boot OS according to our need. http://www.berryterminal.com/doku.php/berryboot instructions could be followed to install OS with very simple steps. You need to have internet connection on Raspberry Pi to install OS. It could be done by connecting t…

C# Response files

Response files are similar to batch files, having some specific instruction. On execution they perform some predefined task based on instruction. Response file contains instruction to compile programs.

If we have to build complex program through command line then response files are really helpful in development process. rsp is an extension for response files. By default, csc.rsp file exists under "Framework" folder Ex: C:\Windows\Microsoft.NET\Framework\v4.0.30319. csc.rsp contains long list of system references (dlls).
Some contents under csc.rsp
# Reference the common Framework libraries
/r:Accessibility.dll
/r:Microsoft.CSharp.dll
/r:System.Configuration.dll
/r:System.Configuration.Install.dll
/r:System.Core.dll
/r:System.Data.dll
/r:System.Data.DataSetExtensions.dll
/r:System.Data.Linq.dll
..........

In same way we can have our own response file defined which might include some third party dll. Let's see an example.

Suppose we have to create an application which use…

main method return value

Mainly we used to write "static void main" for entry point in console application. Placement of void denotes return type. In main function we could have "int" too but what does it really mean. "int main" signifies return type as integer.

The return type of main function tells about execution status of application. Even if we have specified void as return type then it would be marked as successful program execution. If we mark int as return type then we are able to control the execution status.

Now, what is the benefit of making main function as int. Windows OS saves result in  %ERRORLEVEL% environment variable of OS. If we create batch file and execute application through it then we will able to get status and based on result we can trigger something else through batch file.

Let's suppose we have created program called TEST.EXE.
Batch file script:

@echo off

REM Execute main program

REM TEST.EXE

@if  "%ERRORLEVEL%" == "0" goto suc…