answersLogoWhite

0

C Sharp

C Sharp is a programming language developed by Microsoft Corporation. It is designed to be a simple, general-purpose, modern, object-oriented programming language. The latest version is C# 4.0. It is designed for developing applications for both embedded and hosted systems.

343 Questions

Is the CLR manages the execution of code and provides services to simplify the development process?

The CLR, or Common Language Runtime, is part of the compilation process of .NET (including C# and VB.NET) applications. It runs on top of your .NET application to take care of the managed features of those languages, such as garbage collection, memory management, and exception handling.

As far as simplifying the development process, it does in respect to not having to deal with garbage collection, memory management, etc. as you do in some other languages like C or C++

Other than that however, it does not directly simplify the development process in terms of providing you built in methods and objects. For that, you probably are referring to the .NET Framework.

What kind of database exist?

The two major commercial classes of database are; relational and non-relational.

Example of non-relational databases include Informix c-isam and dbisam.

The main relational databases are; MS SQL Server, Sybase, Oracle, Progress, mySQL.

What are the applications of chemotaxonomy?

Applications of chemotaxonomy include separation of higher systemic categories, and related genera having similar enzyme system producing analogous metabolites. It also includes complex metabolic products are good chemotaxonomic marker.

What is the meaning of net effect?

The final result when all the pluses and minuses, all the gains and losses, have been taken into account. "Net" in this case means a calculated total after deductions, like your net pay.

Example: When Bob had dieted and exercised vigorously all week, and then pigged out at the barbecue, the net effect was a gain of one pound.

How do you get value of a string in reverse order in c?

Assume C#, not C:

Traditional way:

public string Reverse(string s)

{

if (string.IsNullOrEmpty(s)) return s; // "" or null

char[] characters = s.ToCharArray();

Array.Reverse(characters);

return new string(characters);

}

or as an extension method:

public static string Reverse(this string s) {

if (s == "") return "";

char[] characters = s.ToCharArray();

Array.Reverse(characters);

return new string(characters);

}

The differences of the 2 methods above is on the caller (how to use Reverse()), and they may co-exist:

For example:

string test = "abc";

string result1 = Reverse(test); // traditional way

string result2 = test.Reverse(); // call the extension

Write a program that displays information about methods along with the parameters excluding the set and get method defined for implementing the properties in c sharp?

Not sure if the constructors should be counted as methods, thus, there are 2 methods below:

  • GetMethodsOf() returns all methods, excluding the properties but including the constructors
  • GetRoutinesOf() similar to GetMethodsOf(), but also excluding the constructors

using System.Reflection;

///

/// generates a sequence of methodInfo of a type t, excluding the getters and the setters

/// constructors are included

///

///

///

static IEnumerable GetMethodsOf(Type t)

{

foreach (MethodInfo info in t.GetMethods())

{

if (!info.Name.StartsWith("get_") && !info.Name.StartsWith("set_"))

{ // properties are filtered

yield return info;

}

}

}

///

/// Similar to GetMethodsof(), but also excluding the constructors

///

///

///

static IEnumerable GetRoutinesOf(Type t)

{

foreach (MethodInfo info in GetMethodsOf(t))

{

if (!info.IsConstructor) // constructors are filtered

yield return info;

}

}

How anchoring is different from docking in c sharp?

Both properties specify what to do with the position of a control when a form being re-sized.

Anchor property allows you to specify the position of the control within the Form, the main/root container of any given windows form.

Dock property allows you to specify the position of the control relatively to the edge of the container. The container, could be a panel (for radio group), or a form itself.

Another way to understand the difference is to look the similarity first:

When a boat is docked in a harbor, e.g at ABC, the position of the boat is fixed. Another boat, right next to the docked boat, uses its anchor to have the position fixed, the observers will see no difference, except the way how the boat are "tied" to the position at ABC.

Now just picture that "harbor" is another a Floating dock, that by itself may shift position over time. Let's moved it from ABC to XYZ, somewhere in the middle of south Pacific.

The Docked boat, always has the same relative position to the dock, hence it will be moved along with the dock from ABC to XYZ.

The one Anchored, well, it is fixed to the earth (the form), so, when the dock float to XYZ, the boat is still at ABC. The relative positions between the floating dock and the boat would change (and to its sister boat)

How to make progress bar in C sharp?

Using visual studio, First you have to drag a progress bar from the toolbox into your application design view, in the properties panel you can see the name of the progress bar it could be "progressBar1"

choose a function of your application where you want to put it, you can type.

progressBar1.Minimum = 0;

progressBar1.Maximum = 100;

progressBar1.Step = 100;

progressBar1.PerformStep();

So it could look like this, the progress bar will load when you run the application

private void Form1_Load(object sender, EventArgs e)

{

progressBar1.Minimum = 0;

progressBar1.Maximum = 100;

progressBar1.Step = 100;

progressBar1.PerformStep();

}

Where to download free visual studio dot net 2003 setup?

Microsoft offers Visual Studio Express Editions for free. Checkout the link provided below.

Write a calendar program to find out the day of a given date in a particular year?

Here is the complete program. Mind you, the code doesn't mind if you input invalid dates like 29th February 1981 or 42 March 1983, etc. So if you input such stupid dates, you will get stupid answers. Adding further code to take care of such childish inputs would only convolute it, right?

#include

#include

main()

{

long int t=0,id=15,im=10,iy=1582,iy1=1582,id1,im2=9,im1=9,dr,dc=0,td,tm,ty;

long int smc[12];

smc[0]=smc[2]=smc[4]=smc[6]=smc[7]=smc[9]=smc[11]=31,smc[3]=smc[5]=smc[8]=smc[10]=30;

printf("Enter the date (Date Month Year): ");

scanf("%ld %ld %ld",&td,&tm,&ty);

id1=td;

while (iy

{

if (((((iy)%4)==0) && (((iy)%100)!=0)) ((((iy)%100)==0) && (((iy)%400)==0)))

smc[1]=29;

else

smc[1]=28;

while (im1<=11)

{

if (t==0)

dr=smc[im-1]-id,++t;

else

dr=smc[im1];

while (dr>0)

++dc,--dr;

++im1;

}

im1-=12,++iy;

}

if (((((iy)%4)==0) && (((iy)%100)!=0)) ((((iy)%100)==0) && (((iy)%400)==0)))

smc[1]=29;

else

smc[1]=28;

while (im1

{

dr=smc[im1];

while (dr>0)

++dc,--dr;

++im1;

}

if ((iy1==ty) && (im2=(tm-1)))

id1=td-id;

while (id1>0)

++dc,--id1;

if ((dc%7)==0)

printf("\nFriday.");

if ((dc%7)==1)

printf("\nSaturday.");

if ((dc%7)==2)

printf("\nSunday.");

if ((dc%7)==3)

printf("\nMonday.");

if ((dc%7)==4)

printf("\nTuesday.");

if ((dc%7)==5)

printf("\nWednesday.");

if ((dc%7)==6)

printf("\nThursday.");

}

What are PDB Where must they be located for debugging to work?

PDBA program database (PDB) file holds debugging and project state information that allows incremental linking of a Debug configuration of your program. A PDB file is created when you build your dotnet programme or c/c++. It is located in the same location where application exe is present.

C sharp program on abstract class and abstract method?

public abstract class Person {

// derived classes must provide the implementation

public abstract string getTitle();

}

public class Female : Person { public override string getTitle() { return "Ms"; } }

public class Male : Person { public override string getTitle() { return "Mr"; }}

Person boy = new Male();

Person girl = new Female();

Console.Write(" {0} vs {1}", boy.getTitle(), girl.getTitle());

Can you have an interface without any abstract method?

My answer to "Can an interface without any abstract method?" is YES.

If abstract methods do not include the properties, then this interface should have at least 1 property (get or set) defined. It makes sense to have at least one of the abstract method or property/mutator/getter-setter.

If the interface contains no properties, no methods, I cannot think of a reason to create such an interface, meaning - it is useless.

What is diff between Assembly and class library?

Number of dll files between the 2 terms.

Class library is an abstraction or general term to describe the assemblies that are common used by applications. It is consisted of many assemblies, not just one.

An assembly is a dll with manifest. It may be specialized, and may not be a "library" assembly. However, any assembly can be one of the library assemblies (like you can have any book as a part of your private library collection), if you want to do so. For example, I have created some library assemblies that maybe useless outside of my work area, yet they have been very powerful and handy within my team.

C program to implement transposition cipher using key?

/*

* Transposition cipher cracker

*

* Algorithm used to find keys:

*

* n = keylength

* t = textlength

* a = t / n

* b = t % n

* d = accumulated rest terms

* k = wanted plain text position

* loc(k) = a * perm(k % n) + d(perm(k % n)) + k/n

*

* By Ben Ruijl, 2009

*

* compile: g++ -O2 col.cpp

*/

#include <iostream>

#include <cstring>

#define MAXKEY 20

const char* buffer = "irtyhockeibtdaamoelatcnsronhoniirttcacdeiunsihaioarnndgpruphahirgtoarnmclspstwe";

int buflength;

const char* crib = "computer";

int criblength;

void print(int* perm, int n)

{

int a = buflength / n;

int b = buflength % n;

//invert perm

int invperm[MAXKEY];

for (int i = 0; i < n; i++)

invperm[perm[i]] = i;

int d[MAXKEY] = {0};

for (int i = 1; i < n; i++)

{

d[i] = d[i -1];

if (invperm[i - 1] < b)

d[i]++;

}

std::cout << "Found: ";

for (int i = 0; i < buflength; i++)

std::cout << buffer[a * perm[i % n] + d[perm[i % n]] + i / n];

std::cout << std::endl;

}

bool checkperm(int* perm, int n)

{

int cribpos = 0;

int a = buflength / n;

int b = buflength % n;

//invert perm

int invperm[MAXKEY];

for (int i = 0; i < n; i++)

invperm[perm[i]] = i;

int d[MAXKEY] = {0};

for (int i = 1; i < n; i++)

{

d[i] = d[i -1];

if (invperm[i - 1] < b)

d[i]++;

}

for (int i = 0; i < buflength; i++)

{

if (buffer[a * perm[i % n] + d[perm[i % n]] + i / n] n - 1)

checkperm(v, n);

else

{

for (int i = start; i < n; i++)

{

int tmp = v[i];

v[i] = v[start];

v[start] = tmp;

permute(v, start + 1, n);

v[start] = v[i];

v[i] = tmp;

}

}

}

int main(int argv, char** argc)

{

int perm[MAXKEY];

for (int i = 0; i < MAXKEY; i++)

perm[i] = i;

buflength = strlen(buffer);

criblength = strlen(crib);

int curkey = 2; // start key

while (curkey < MAXKEY)

{

std::cout << "Testing key " << curkey << std::endl;

permute(perm, 0, curkey); // permutate keys

curkey++;

}

return 0;

}

What type of applications can be developed using C-sharp?

C# is a general-purpose language, so essentially anything that can run on the CLR (Common Language Runtime) can be written in C#. Examples that are not ideal include priviledged device drivers, high-performance game or simulations.

How do you login from one website to another website with same login Information it UserName and Password?

I don't register i do not have time for it now soon passably I type each time Tika if i do not forgot it or if i want to change the name another but i let it show in this thing before the message (This is no spam)

Tika

________________________________________________________________________

You cannot do that.

Why not and how can i do anything that is not precise but not bad?

But if you have a new enough browser you can save your username and password on a site that if you type 1 or more letters or numbers of your username you see your username in a box click on it and you the browser enters your username and password. Do it on both sites because you view on the site where you don't saved it still the username and you can click on it but there is no password viewed.

How do i save it?

If you enter your username and password on a site log in and you view a box that ask if you want to save your username and password. Select yes. Do it with both sites with the same password and username.

This is not precise but it can too.

Not correct?

If this is not good for what you want to do i don't know anything else sorry.

______________________________________________________________________

Count characters in an input string using c sharp?

Console.WriteLine("Please input a string:");

string str = Console.ReadLine();

Console.WriteLine("Number of characters: " + str.Length);

How do you create log in form in GUI with coad?

How to make login form in gul ?

user name

password

and write the coad.