407 Posted Topics

Member Avatar for james6754

To reference the current Thread, you [b]could[/b] use [icode]Thread.CurrentThread.Suspend();[/icode]. The Suspend() method is obsolete however, what are you trying to achieve?

Member Avatar for skatamatic
0
212
Member Avatar for raghamayee

[URL="http://en.wikipedia.org/wiki/OSI_model"]http://en.wikipedia.org/wiki/OSI_model[/URL]

Member Avatar for Netcode
0
117
Member Avatar for Gaving30

That statement will not return true for 5, for two reasons. digit would not be greater than 5, it would be equal, and 5 mod 5 equals 0. Both would be false. I don't really understand why you are performing the checks: [code=c++]if((digit%2) !=0 && (digit%3) !=0){ if((digit > 5) …

Member Avatar for TrustyTony
0
444
Member Avatar for shadowscape

Probably not your issue, but why are you using double for [icode]ss[/icode]. You should never really be checking a double with the == operator (unless checking for 0 I suppose). Floating point numbers are prone to small rounding errors.

Member Avatar for nmaillet
0
128
Member Avatar for evilguyme

You started out right with [icode]if(bottomA < topB)[/icode]. The proceeding three if statements would not give you the desired result though. You need to compare left to right, and top to bottom. For instance: [code=C++] if(bottomA < topB) return false; if(bottomB < topA) return false; if(rightA < leftB) return false; …

Member Avatar for ChaseRLewis
0
126
Member Avatar for vishal1949

You need to go through a Java tutorial. Couple things from a glance: Each class/interface needs to defined in its own JAVA file, with the same name. For instance, SaturnSL1 must be in a file called SaturnSL1.java. You should be declaring the ParkingGarage class outside of the main method().

Member Avatar for raymagosi
1
272
Member Avatar for JamesW315

Both the 5 and 9 literals are integer, therefore the result will be an integer (not rounded; the decimal value is simply removed). You can explicitly declare them as double values by entering then as 5.0 and 9.0 respectively. You may want to have a look at "Section 7.3 Operators" …

Member Avatar for JamesW315
0
105
Member Avatar for Jazerix

while loops only loop as long as the expression evaluates to true. So once it checks the value, and its false it continues on. This would work if you wanted it to continuously show "TEST". [code=C#] while(true) if(timerdone) MessageBox.Show("TEST"); [/code] Or if you only wanted it to show once: [code=C#] …

Member Avatar for Jazerix
0
136
Member Avatar for jmurph333

You could use the SendInputs() function in the WinAPI. This function does not target particular windows however. First thing you'll need is structure definitions: [code=c#] struct INPUT { public uint type; public MOUSEINPUT mi; } struct MOUSEINPUT { public int dx; public int dy; public uint mouseData; public uint dwFlags; …

Member Avatar for nmaillet
0
639
Member Avatar for exicar

The only reason you are able to use the default .NET controls, is since [url]http://schemas.microsoft.com/winfx/2006/xaml/presentation[/url] is declared as the default namespace. Otherwise you have to explicitly state a namespace alias; for instance, x:Key. Since VisualStateManager is not included in .NET 3.5, you'll have to add a reference to it. I …

Member Avatar for nmaillet
0
352
Member Avatar for bhagawatshinde

What farooqaaa said is correct of course. But, if you want to call the Click event of a control, without knowing which method is handling the event (e.g. event handler was changed), you have to inherit the control and expose the OnClick() method. For example: [code=C#]public class MyButton : Button …

Member Avatar for bhagawatshinde
0
9K
Member Avatar for jasonmrc

[code=C#]txtBox.Text[6] == 'm';[/code] That should work for you. If you are checking for numbers as well, you can iterate through the characters in the string (returned by the TextBox.Text property) and use char.IsNumber().

Member Avatar for rikthefrog
0
111
Member Avatar for coroll

If your using Visual Studio, have you tried [B]Rebuild Solution[/B] in the [B]Build[/B] menu? It is possible that the IDE thinks the executable is newer than the source code. I know when building VC++ in Visual Studio, it gives you the option to run the previous successful build, if there …

Member Avatar for nmaillet
0
118
Member Avatar for Hendo

In the Main() method, put something like this: [code=C#]if (DateTime.Now >= new DateTime(2011, 8, 20) Environment.Exit(0);[/code] This says that, on or after August 8, 2011 it will just terminate the program. Note that this will, of course, be easy to bypass by changing the system time.

Member Avatar for Hendo
0
117
Member Avatar for srikanth2321

Does the x'd out user folder have any non-alphanumeric or non-whitespace characters?

Member Avatar for Ketsuekiame
0
705
Member Avatar for Muhasaresa

You need to Windows API to work with these functions, and #include "Windows.h". The reference for these functions is located [URL="http://msdn.microsoft.com/en-us/library/ff468802(v=VS.85).aspx"]here[/URL]. Be sure to check the return value of OpenClipboard(). If it returns a zero (false) it failed, otherwise, if it returns a non-zero (true) it succeeded. If it returns …

Member Avatar for nmaillet
0
390
Member Avatar for gogs85

Did you have a specific question? Or have you made an attempt and can't get something working right? People here will not do your homework for you.

Member Avatar for singh_soorma94
0
106
Member Avatar for gogs85

Your question is a little vague on details, but you could initialize a new TimeSpan: [code=C#]TimeSpan span = new TimeSpan();[/code] Then iterate through your list of hours and add them as a new TimeSpan: [code=C#]span += new TimeSpan(hours, minutes, seconds);[/code] I don't understand what to are trying to get at …

Member Avatar for ddanbe
0
95
Member Avatar for dotancohen

Note that you can use fall-through for empty case's: [code=C#]switch(i) { case 0: case 1: ... break; case 2: ... break; }[/code] This is occasionally useful.

Member Avatar for dotancohen
0
178
Member Avatar for thanatos1

You can define whatever you like. If you access the file as a binary file, you can use 256 values with a single byte. Or you can use two bytes, this would 65536 values. Some things you may want to consider though: - You'll need at least two layers for …

Member Avatar for NormR1
0
125
Member Avatar for cool_intentions

When working with Object properties, you can determine the type using something like: [code=C#]System.Diagnostics.Debug.WriteLine(comboBox1.SelectedItem.GetType());[/code] Assuming you are using an IDE. Otherwise you can just show it in a MessageBox. In this case it is returning a KeyValuePair<string, object>, so you can just cast it and check the Key property: [code=C#]KeyValuePair<string, …

Member Avatar for nmaillet
0
96
Member Avatar for becool007

Right-click on your project in solution explorer and click Properties. Under Configuration Properties --> Common Language Runtime Support, ensure it is set to [B]No Common Language Runtime Support[/B]. When creating a new project, under Visual C++, select Win32 and then select either [B]Win32 Console Application[/B] or [B]Win32 Project[/B]. Just to …

Member Avatar for Frederick2
0
307
Member Avatar for aldeene

Request to Send (RTS) is used to signal a devices intention to send data. Without it the connected device may refuse to receive data. For modems, Data Terminal Ready (DTR) is used to tell a modem that it wants to dial out, and drops the signal to low to drop …

Member Avatar for aldeene
0
322
Member Avatar for ZIA_JAPPA125

Your should add an initializer for base8; if x is < 10 then base8 is never assigned and will cause problems with the result. In addition, it looks like you can't go beyond certain number (i.e. 123 does not work). In either case, I think you're over complicating the issue. …

Member Avatar for Adak
0
140
Member Avatar for judithSampathwa

Could you post your code? I'm having trouble understanding what your question is.

Member Avatar for nick.crane
0
271
Member Avatar for Falcon143

When you compile the source code, everything gets translated to machine code, and everything ends up being referenced by a memory address. In addition, the compiler will likely optimize your code, and will not maintain any 1 to 1 relation to the source code. The idea of a line number …

Member Avatar for nmaillet
0
2K
Member Avatar for bigdan182

Assuming you are using an array of pointers (you could easily modify if you are storing the structures themselves): [code=C++]int count = 0; for(int i = 0; i < size; i++) if (teams[i]->progress) count++; Team **teamsSubset = new Team*[count]; for(int i = 0, i2 = 0; i < size; i++) …

Member Avatar for nmaillet
0
76
Member Avatar for Cainer

For [icode]b &= (byte) ~a;[/icode], the compiler will check this conversion since a is a constant, and it is certain what the value will be. Since bitwise operations return int's (doesn't seem right to me), it will evaluate ~a as an int, which would evaluate to -9. I don't think …

Member Avatar for Momerath
0
136
Member Avatar for nolife

Do you have Visual Studio 2010 installed? I don't believe any previous versions ever added support for 4.0. If so, just open the solution with VS2010, and use the conversion wizard.

Member Avatar for nmaillet
0
61
Member Avatar for coroll

Form has a public Dispose() method. Why are you trying to cast between the two types? Assuming that both classes derive from Form, HD.MainMenu and HD.NewBookEntry are both ancestors of Form, and have common variables/methods from Form. However, they define their own variables/methods, therefore they lack a commonality between them.

Member Avatar for coroll
0
113
Member Avatar for aiwasen

It is because of the [icode]while(y<=num)[/icode] statement. When your iteration, where x = 21 and y = 34, is complete: it checks if y is <= num (which it is), so it continues executing. If you changed it to [icode]while(y<num)[/icode] it would stop at 34.

Member Avatar for HASHMI007
0
186
Member Avatar for fashxfreak

You can download the express editions. It looks like Microsoft no longer directly links to any of the downloads on their site anymore, but you can still link to them directly. Note that I have [b]not[/b] tested any of these links: [URL="http://apdubey.blogspot.com/2009/04/microsoft-visual-studio-2005-express.html"]http://apdubey.blogspot.com/2009/04/microsoft-visual-studio-2005-express.html[/URL]

Member Avatar for fashxfreak
0
91
Member Avatar for Munnazz

The DataSet class does offer direct serialization to/from XML files, however I'm assuming your DataSet doesn't necessarily correlate to your XML schema. So, take a look at the [URL="http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx"]XmlDocument[/URL] class. Basically you can create XML elements and attributes using the XmlDocument's Create...() methods, than use AppendChild() on the appropriate object …

Member Avatar for Mitja Bonca
0
186
Member Avatar for complete

You shouldn't be converting the float variable to a string. This will not allow the proper formatting: [code=C#]double A = 0.532492829839; string.Format("{0:0.00}%", A * 100.0);[/code]

Member Avatar for nmaillet
0
354
Member Avatar for Farhad.idrees

I would recommend you use the [URL="http://download.oracle.com/javase/1.4.2/docs/api/java/util/Random.html"]Random[/URL] class in these exercises. Specifically, look at the [icode]nextInt(int n)[/icode] method when you require integers. Calling the default Random() constructor should generate a suitable seed value for your purposes. For your first question, Math.random() returns values in the range [0,1). This means that …

Member Avatar for nmaillet
0
134
Member Avatar for bhagawatshinde

Is the background image being covered by the highlighted border? If so, you'll probably have to override a Renderer class, and wrap the default ToolStripRenderer to achieve this. See [URL="http://social.msdn.microsoft.com/Forums/en/winforms/thread/bc5a2554-6b38-4f4a-bb9a-7fbf4011eef6"]this thread[/URL]. It's been a while since I've done much with WinForms, but I believe this is quite an involved process. …

Member Avatar for nmaillet
0
254
Member Avatar for danuz

You are adding the input value to num; then checking num. Therefore if you entered 5, 6, 7, 0. num would equal 18 when you checked it against 0. Try something like this: [code=C#]... int n = int.Parse(Console.ReadLine()); if(n == 0) break; num += n; ...[/code] Also, note that I …

Member Avatar for danuz
0
211
Member Avatar for Muralidharan.E

Arrays are initialized when they have a length of 0. They may not contain any values, however they do store the length and allow you to reference it. If you attempt to reference the length of a null reference, you will get an exception. It can be useful when you …

Member Avatar for Zetlin
0
191
Member Avatar for bill_kearns

[icode](a - (a * b))[/icode], where a = 19.99 and b = 0.2, equals 15.992. It you multiply it by 12, you get 191.904, which rounds to 191.90 on line 27. You would have to round the calculation [icode](a - (a * b))[/icode] before multiplying it by c to achieve …

Member Avatar for bill_kearns
0
221
Member Avatar for Roy Gourgi

You can never be certain of rounding errors. For instance try running the following code: [code=C#]Console.WriteLine("{0:G17}", 0.72 + 0.11 + 0.06 + 0.11);[/code] On my system, this returns 0.99999999999999989. Note that this may be different for your system, which leads to your second question. Consistency cannot be guaranteed across different …

Member Avatar for shams.expert
0
254
Member Avatar for IMJS

You should be able to do something like this: [code=C++]char **b_array; b_array = new char*[MAXPATHLEN]; for(int i = 0; i < MAXPATHLEN; i++) b_array[i] = new char[numFtrs]; char ***b_array_ptr; b_array_ptr = &b_array;[/code] I am certain there is some shortcut for this, but I don't have time to look around right …

Member Avatar for fruitymo
0
117
Member Avatar for tubby123

Does it need to be efficient? If O(n2) is acceptable, you could just initialize an int array of the same size, then store the number of following characters that are equal. Then use the index of the largest int value to locate your maximum occurring character.

Member Avatar for mrnutty
0
107
Member Avatar for DeathEater

Events can only be raised from the class that declared them (even derived class' cannot invoke them). Luckily WPF/Forms controls implement protected methods to allow derived classes to do this. Just derive from the Button class, and call OnClick(), for example: [code=C#]public MyButton : Button { public void SimulateClick() { …

Member Avatar for DeathEater
0
131
Member Avatar for Welsh_Wizard

I believe when you create the new Chart, it becomes the new ActiveSheet. Therefore you are trying to retrieve a Range from the Chart. Try creating the Chart after getting the Range.

Member Avatar for nmaillet
0
195
Member Avatar for shannonkr

For your first pattern, you would require something like: [icode]\{(\-?[0-9]+\.[0-9]+,)*(\-?[0-9]+\.[0-9]+)\}[/icode] Note that I made quite a few big assumptions for this: - Cannot be empty ("{}") - Cannot exclude the decimal or numbers before/after (".9", "9." or "9" would be invalid"). - Cannot start with a + sign. Take a …

Member Avatar for nmaillet
0
187
Member Avatar for yousafc#

Take a look at the [URL="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.aspx"]System.Data.SqlClient[/URL] namespace, and search for some tutorials on using SQL with C#. There are plenty around.

Member Avatar for yousafc#
-2
104
Member Avatar for c#dummie

You can also use the AcceptButton property of the Form. This will however, capture the Enter key from any control on the Form. But, this generates the button's Click event, a mouse click or enter key can be handled in the same method.

Member Avatar for nmaillet
0
139
Member Avatar for king03

Look at the [URL="http://msdn.microsoft.com/en-us/library/system.console.aspx"]Console[/URL] class. You can use a combination of the Write(), WriteLine(), Read(), ReadKey() and ReadLine() methods.

Member Avatar for ddanbe
0
162
Member Avatar for michael!

You'll want to take a look at the [URL="http://msdn.microsoft.com/en-us/library/y3y47afh.aspx"]System.Xml[/URL] namespace. As a starting point, you can call [icode]XmlDocument.Load(...)[/icode], and work from the XmlDocument object created.

Member Avatar for nmaillet
0
89
Member Avatar for orville

You could handle the [icode]RowsAdded[/icode] and [icode]RowsRemoved[/icode] events, then implement something like this: [code=C#]private void dataGridView_RowsAdded(object sender, DataGridViewRowsAddedEventArgs args) { textBox.Text = ((DataGridView)sender).Rows.Count; } private void dataGridView_RowsRemoved(object sender, DataGridViewRowsRemovedEventArgs args) { textBox.Text = ((DataGridView)sender).Rows.Count; }[/code]

Member Avatar for nmaillet
0
97

The End.