Loading...
Remove Windows Vista needs your permission to continue Dialog Box

1. Control Panel
2. User Accounts and Family Safety
3. User Accounts
4. Click turn User Account Control On or Off
5. Untick Use User Account Control (UAC) to help protect your computer
6. Ok
7. Restart

Good luck! ;)

Handle ENTER key on WINFORM
Add this method on your Form:

protected override bool ProcessCmdKey(ref System.Windows.Forms.Message m, System.Windows.Forms.Keys k)
{
   // detect the pushing (Msg) of Enter Key (k)

   if(m.Msg == 256 && k == System.Windows.Forms.Keys.Enter)
   {
        // Execute an alternative action: here we

        // tabulate in order to focus

        // on the next control in the formular

        System.Windows.Forms.SendKeys.Send("\t");
        
        // return true to stop any further

        // interpretation of this key action

        return true;
    }

    // if not pushing Enter Key,

    // then process the signal as usual

    eturn base.ProcessCmdKey(ref m,k);
}
Mathematics in C#: Arithmetic

1. ABSOLUTE VALUES

To get the absolute value of a number, the Math class is equipped with a method named Abs, which is overloaded in various versions. Their syntaxes are:

public static sbyte   Abs(sbyte   value);
public static short   Abs(short   value);
public static int     Abs(int     value);
public static float   Abs(float   value);
public static double  Abs(double  value);
public static long    Abs(long    value);
public static decimal Abs(decimal value);

This method takes the argument whose absolute value must be fond. Here is an example:

using System;

class Program
{
    static int Main()
    {
        int number   = -6844;

        Console.WriteLine("Original Value = {0}", number);
        Console.WriteLine("Absolute Value = {0}\n", Math.Abs(number));
        return 0;
    }
}

This would produce:

Original Value = -6844
Absolute Value = 6844

Press any key to continue . . .

2. THE CEILING OF A NUMBER

Consider a floating-point number such as 12.155. This number is between integer 12 and integer 13.

In the same way, consider a number such as –24.06. As this number is negative, it is between –24 and –25, with –24 being greater.

In arithmetic, the ceiling of a number is the closest integer that is greater or higher than the number considered. In the first case, the ceiling of 12.155 is 13 because 13 is the closest integer greater than or equal to 12.155. The ceiling of –24.06 is –24.

To support the finding of a ceiling, the Math class is equipped with a method named Ceiling that is overloaded with two versions whose syntaxes are:

public static double Ceiling(double a);
public static decimal Ceiling(decimal d);

This method takes as argument a floating-point number of variable whose ceiling needs to be found. Here is an example:

using System;

class Program
{
    static int Main()
    {
        double value1 = 155.55; double value2 = -24.06;

        Console.WriteLine("The ceiling of {0} is {1}",
            value1, Math.Ceiling(value1));
        Console.WriteLine("The ceiling of {0} is {1}\n",
            value2, Math.Ceiling(value2));
        return 0;
    }
}

This would produce:

The ceiling of 155.55 is 156
The ceiling of -24.06 is -24

Press any key to continue . . .

Besides the Math class, the Double structure provides its own implementation of this method using the following syntax:

public static decimal Ceiling(decimal d);

3. THE FLOOR OF A NUMBER

Instead of using the Math class, the Double structurealso has a method to find the floor of a decimal number. Its syntax is:
Consider two floating numbers such as 128.44 and -36.72. The number
128.44 is between 128 and 129 with 128 being the lower. The number
–36.72 is between –37 and –36 with –37 being the lower. The lowest but
closest integer value of a number is referred to as its floor.

To assist you with finding the floor of a number, the Math class provides the Floor()
method. It is overloaded in two versions whose syntaxes are:


public static double Floor(double d);
public static decimal Floor(decimal d);

The floor() method takes the considered
value as the argument and returns the integer that is less than or
equal to Value. Here is an example:

using System;

class Program
{
    static int Main()
    {
        double value1 = 1540.25;
        double value2 = -360.04;

        Console.WriteLine("The floor of {0} is {1}",
            value1, Math.Floor(value1));
        Console.WriteLine("The floor of {0} is {1}\n",
            value2, Math.Floor(value2));
        return 0;
    }
}

This would produce:

The floor of 1540.25 is 1540
The floor of -360.04 is -361

Press any key to continue...
public static decimal Ceiling(decimal d);

4. THE POWER OF A NUMBER

The power is the value of one number or expression raised to another number. This follows the formula:

ReturnValue = xy

To support this operation, the Math class is equipped with a method named Pow whose syntax is

public static double Pow(double x, double y);

This method takes two arguments. The first argument, x, is used as the base number to be evaluated. The second argument, y, also called the exponent, will raise x to this value. Here is an example:

using System;

class Program
{
    static int Main()
    {
        const double source = 25.38;
        const double exp = 3.12;

        double result = Math.Pow(source, exp);

        Console.WriteLine("Pow({0}, {1}) = {2}\n",
            source, exp, result);
        return 0;
    }
}

This would produce:

Pow(25.38, 3.12) = 24099.8226934415

Press any key to continue . . .

5. THE EXPONENTIAL

You can calculate the exponential value of a number. To support this, the Math class provides the Exp() method. Its syntax is:

public static double Exp(double d);

Here is an example of calling this method:

using System;

class Program
{
    static int Main()
    {
        Console.WriteLine("The exponential of {0} is {1}",
            709.78222656, Math.Exp(709.78222656));

        return 0;
    }
}

This would produce:

The exponential of 709.78222656 is 1.79681906923757E+308
Press any key to continue . . .

If the value of x is less than -708.395996093 (approximately), the result is reset to 0 and qualifies as underflow. If the value of the argument x is greater than 709.78222656 (approximately), the result qualifies as overflow. 

6. THE NATURAL LOGARITHM

To calculate the natural logarithm of a number, you can call the Math.Log() method. It is provides in two versions. The syntax of one is:

public static double Log(double d);

Here is an example:

using System;

class Program
{
    static int Main()
    {
        double log = 12.48D;

        Console.WriteLine("Log of {0} is {1}", log, Math.Log(log));

        return 0;
    }
}

This would produce:

Log of 12.48 is 2.52412736294128
Press any key to continue . . .

7. THE BASE 10 LOGARITHM

The Math.Log10() method calculates the base 10 logarithm of a number. The syntax of this method is:

public static double Log10(double d);

The number to be evaluated is passed as the argument. The method returns the logarithm on base 10 using the formula:

y = log10x

which is equivalent to

x = 10y

Here is an example:

using System;

class Program
{
    static int Main()
    {
        double log10 = 12.48D;

        Console.WriteLine("Log of {0} is {1}", log10, Math.Log10(log10));

        return 0;
    }
}

This would produce:

Log of 12.48 is 1.09621458534641
Press any key to continue . . .

8. THE LOGARITHM OF ANY BASE

The Math.Log() method provides another version whose syntax is:

public static double Log(double a, double newBase);

The variable whose logarithmic value will be calculated is passed as the first argument to the method. The second argument allows you to specify a base of your choice. The method uses the formula:

Y = logNewBasex

This is the same as

x = NewBasey

Here is an example of calling this method:

using System; class Program { static int Main() { double logN = 12.48D; Console.WriteLine(”Log of {0} is {1}”, logN, Math.Log(logN, 4)); return 0; } }

This would produce:

Log of 12.48 is 1.82077301454376 Press any key to continue . . .


9. THE SQUARE ROOT

You can calculate the square root of a decimal positive number. To support this, the Math class is equipped with a method named Sqrt whose syntax is:

public static double Sqrt(double d);

This method takes one argument as a positive floating-point number. After the calculation, the method returns the square root of x:

using System;

class Program
{
    static int Main()
    {
        double sqrt = 8025.73D;

        Console.WriteLine("The square root of {0} is {1}", sqrt, Math.Sqrt(sqrt));

        return 0;
    }
}

This would produce:

The square root of 8025.73 is 89.5864387058666
Press any key to continue . . .

Reference: http://www.functionx.com/csharp2/topics/math3.htm

Matlab Hints

A short list of Matlab functions

Function / token Purpose
% Comment
; Stops echoing to screen
clc Clear screen
clear Clears allocated variables
whos shows information about allocated variables
close Closes the latest open plots or figure
close(x) Closes the plot or figure #x
close all Closes all open plots & figures
figure creates a new figure (graph window)
figure(x) creates a new figure (graph window) and assigns it id #x
unit8(x) explicitly casts x to the uint8 type
double(x) explicitly casts x to the double type
[m n] = size(x) retrieves the matrix / image dimensions of x
zeros(m,n) creates a matrix if dimension m x n filled with zeros
ones(m,n) creates a matrix if dimension m x n filled with ones
imread(filename) reads an image from disc
imwrite(x,filename) writes image x to disc
help x displays matlabs help for function x
ind2gray converts an index based image to grayscale
rgb2gray converts an RGB image to grayscale
subplot(m,n,nr) creates a subplot in a figure
conv2(x,y) 2D convolution of x & y
medfilt2(x) 2D median filtering of x
hist(x) computes the histogram of x
histeq computes the histogram equalization of x
imcrop(x,[]) crops an image to specified dimensions
x = [... ; ... ; ...]; create matrix x
m(y,x) access element x,y in matrix m
for a : b for-loop, loops from a to b
for a : stepSize : b for-loop, loops from a to b with specified step size
end end loop
fft2 computes the 2D Fourier transform using FFT (also pads image)
ifft2 computes the inverse 2D Fourier transform using FFT (does not crop the resulting image)
fftshift shifts the Fourier spectrum
abs(x) returns the absolute value of a x (can be used for Fourier spectras)
angle(x) computes the phase angle of x

Some helpful (tutorial) links:

Common Errors in Compiling Visual Studio Projects

1.Unable to find manifest signing certificate in the certificate store.

=> Solution: You should be able to disable the “Sign the ClickOnce manifests” option by editing the project file (.csproj) in Notepad, locating the <SignManifests> element and setting its value to false if this tag is there, or adding: <SignManifests>false</SignManifests>

This post will be updated regularly…

Number 1 IT site www1IT.com