Category Archives: Samples

Sample Projects in C#: Consecutive Numbers in Gray Code Sequence

Consecutive Numbers in Gray Code Sequence

  • The reflected binary code (RBC), also known as Gray code after Frank Gray, is a binary numeral system where two successive values differ in only one bit (binary digit). The reflected binary code was originally designed to prevent spurious output from electromechanical switches. Today, Gray codes are widely used to facilitate error correction in digital communications such as digital terrestrial television and some cable TV systems. (en.wikipedia.org, 2002)

Continue reading

GLSL Shader Examples: Blue Color Screen

GLSL TASK:

Create a shader which fills the screen with blue color. For the space occupied by right half of screen, introduce a vertical green bar located in the middle of it, with its width being equal to one-third of it. This should result in right half of screen being divided into three equal parts (blue-green-blue). As for the left half of screen, introduce a pair of vertical red bars, with width of each being equal to one-fourth of it, resulting in left half of screen being divided into four equal parts (blue-red-blue-red). Continue reading

IT Sample: Constructing a Frequency Distribution

Task:

Construct a frequency distribution with suitable class interval size of marks obtained by 50 students of a class are given below:

22, 51, 34, 39, 68, 69, 9, 37, 16, 48, 36, 27, 55, 59, 60, 59, 74, 80, 19, 29, 31, 69, 62, 60, 28, 67, 51, 73, 17, 24, 44, 45, 51, 66, 68, 72, 74, 41, 57, 41, 67, 51, 53, 23, 58, 34, 39, 48, 36, 79

Solution:

Arrange the marks in ascending order as Continue reading

C# Programming Code Examples: Finding a Palindrome

In this guide I will show you how to create a program on Windows Forms which will help us to determine if the symbols that we input constitute a palindrome.

Let’s create a simple user interface:

finding-a-palindrome-using-c-1

Here we have a TextBox, Label, and Button. The message with the result of checking will be shown using MessageBox.

Double click the button “Check it” and go to the part of the code where we will perform the checking. Continue reading

Samples of Assignments: Drawing in Xamarin Using Ncontrol

In the process of development, sometimes there’s a need to draw some interface elements manually. The Ncontrol component was created exactly for these purposes.

The library uses the NGraphics library to perform custom drawings to make it easy to build complex controls. The project is hosted on Github and is distributed under the MIT license. NControlView can be used both to do custom drawings and to create complex custom controls.

To make a long story short, it’s a rendering visualization mechanism on top of the standard mechanisms in iOS, Android, and Windows Phone. Continue reading