|
Hey, I'm sorry, that code was a Copy Paste mistake. Since it was HTML it didn't understand the code in less than and Greater than signs. It took it as an HTML tag! Here's the rectified one.
private void Swap(int arr[], int pos1, int pos2)<br />
{<br />
int tmp = arr[pos1];<br />
arr[pos1] = arr[pos2];<br />
arr[pos2] = tmp;<br />
}<br />
<br />
public void BubbleSort(int arr[])<br />
{<br />
int ctr = 0;<br />
while(ctr<arr.GetLength(0)-1)<br />
{<br />
if(arr[ctr1] > arr[ctr1+1])<br />
{<br />
Swap(arr, ctr, ctr+1);<br />
ctr=0;<br />
continue;<br />
}<br />
ctr++;<br />
}<br />
}
Atul Kale
MCSD, MCT
Sr. Software Engineer
XcelVision Technologies Ltd.
|
|
|
|
|
oh, allright sometimes Copy&Paste can cause problems . I understood the while loop here now. Thanks again for your help.
-
kromozom@msn.com for MSN Messenger
-
|
|
|
|
|
I have a string.I want to store it in my database as BINARY,and then get it from database and convert it to string.So how can I convert string to binary and convert binary to string?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
have tried it out.. ;P;) ~
|
|
|
|
|
System.Text.Encoding
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
Thanks.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Hi all:
I hav problems when I try to connect to a Exchange Server with MAPI. The situation is as follows:
I have Exchnage Server in one machine and the ASP.NET application that access it in another machine. In order to logon I use this:
oSession.Logon(strUser, strPassword, False, True, 0, True, strProfileInfo)
and it connects. But when I try to access to any resource in the exchange (the inbox, for example) the next error appears:
"The information store could not be opened. [MAPI 1.0 - [MAPI_E_LOGON_FAILED(80040111)]]"
I think this is because access restrictions or something like that. Anyone has an idea of what is happening?
What is the best way to work against Exchange with this architecture (Exchange Server in one machine and ASP.NET application in another?
Any help will be apreciated.
Cheers,
Ivan
|
|
|
|
|
Hi,
I have have a form that is a child control in a panel. I would like to prevent anyone from moving this form. I have already set the form so it's not resizable.
Is there any way to lock the form to prevent it being moved.
Thanks!!
Stefan
|
|
|
|
|
You could fire the LocationChanged event and place the form back to orginal location.
Point OriginalLocation;<br />
private void Form1_Load(object sender, System.EventArgs e) {<br />
OriginalLocation = new Point(this.Left,this.Top);<br />
}<br />
<br />
private void Form1_LocationChanged(object sender, System.EventArgs e) {<br />
this.Location = OriginalLocation;<br />
}<br />
|
|
|
|
|
i have already draw many rectangle inside a form how can i move the rectangular form one position to another after i have selected the rectangular to move.
|
|
|
|
|
You can do this by changing the Rectangle Draw points and then redraw the object.
<br />
Rectangle DrawRectangle = new Rectangle(4,4,50,50);<br />
private void panel1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) {<br />
e.Graphics.DrawRectangle(System.Drawing.Pens.Beige, DrawRectangle);<br />
}<br />
<br />
private void button1_Click(object sender, System.EventArgs e) {<br />
DrawRectangle = new Rectangle(20,20,50,50);<br />
panel1.Invalidate();<br />
}<br />
|
|
|
|
|
thanx for your tips.i want to ask i have a lot of rectangle in the form how can i know which rectangle i have select to move and can i remain the size of the rectangle when i move and can i see the effect of the move when i move the rectangle.thank you for help me answer the question.
|
|
|
|
|
Hello All,
I get this warning:
The keyword new is required on 'MyNamespace.MyClass.Client' because it hides inherited member 'System.Net.Sockets.TcpClient.Client'
On this piece of code:
public TcpClient Client {
get { return Client; }
set { Client = value; }
} I'm not really sure what it means though. The public TcpClient Client is where the error occurs, but this is a property and I don't want it to return a new TcpClient everytime someone gets this property. The public TcpClient Client is initialized in the constructor for the class.
public MyClass ()
{
Client = new TcpClient ();
} I don't really want to just leave the warning so any ideas on what to do would be very much appreciated.
On a separate note is there any way to make the compiler treat warnings as errors?
Many thanks in advance.
- monrobot13
|
|
|
|
|
I had a thought after I posted this message. Could the source of the problem simply be that I have a property named Client and so does the base class TcpClient ?
- monrobot13
|
|
|
|
|
You are absolutely right about your new property Client hiding the base class' Client identifier. Either change your property name, or place the new keyword in the property definition.
public new TcpClient Client{... Here[^] is some more info on the subject.
Jim Stewartα:geek Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
monrobot13 wrote:
public TcpClient Client {
get { return Client; }
set { Client = value; }
}
You are going to have another problem here.
The property Client, is calling itself for the get/set methods, so you will wind up getting a StackOverflow from all of the recursion that takes place.
If you want your new Client property to return the value from the base class, then you need to specify, base.Client otherwise you need to rename the variable Client so you don't get this infinite recursion.
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
Thanks for the response James.
James T. Johnson wrote:
The property Client, is calling itself for the get/set methods, so you will wind up getting a StackOverflow from all of the recursion that takes place.
I took your adivce and renamed the property to something else, but I'm still getting a StackOverflow. Any ideas as to why?
If I step through the code it keeps executing the set method, but I have no idea why, would it be possible for you to explain.
Thanks again.
- monrobot13
|
|
|
|
|
Is CSharp similar to C like in variables, conditions, pointers, etc.
Can you tell me what is diferent that way i can learn more faster.
Thanks.
|
|
|
|
|
Here[^] is the "Getting Started" section in MSDN. It has several links to the introductory material for C#.
Jim Stewartα:geek Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
I can't find it
|
|
|
|
|
I want to build a C# app that wraps other executables. Any suggestions?
|
|
|
|
|
If you are trying to run an external process you need to look at the System.Diagnostics.Process class and use the Process.Start() method.
quorum pars magna fui
|
|
|
|
|
Thanks, Chris,
This is what I was hoping for. I want to build a service that monitors an application, detects problems, shuts it down, cleans things up, and then re-starts the application. At first I was wondering why this capability was under System.Diagnostics - but in the context of what I want to use it for, it makes perfect sense.
Sean Onion
|
|
|
|
|
Glad to help. There may be a similar app here on CP. Try searching the site using the google advanced search pointed here.
quorum pars magna fui
|
|
|
|
|
Hey i was wondering if anyone could give me a link or book name that has C#/DirectX 9.0 tutorials.
Yes, Shock I know you are doing them here but I have already done them and figured out DirectInput and was hoping for a more fast paced tutorial. I can help wiht DInput if you like.
|
|
|
|