2,157 Posted Topics
Re: The garbage collector runs when the system decides that it needs to do so, usualy when you have a lot of fragmented memory that it wants to clean up. An object is unused if it goes out of scope and no variable in scope retains a reference to the object. … | |
Re: Well, the ball position Y can't be both greater than man position Y and less than man position Y, which is what your if statement requires. I think you are trying to check if the ball is in the mans 'space', so you'd want to do something like if (ball_position.Y … | |
Quite commonly I see people using one of the Parse routines then catching the exception thrown if the parse fails. This is, in general, a bad practice as throwing an exception is slower than using the corresponding TryParse method. This short snippet shows the routines that I used to measure … | |
Re: OleDB uses the '?' character for parameters, not the SQL Server '@ID' type parameters and assigns them in order from left to right. So your SQL statement should be "DELETE FROM [Record] WHERE [ID] = ?" Check out the example on [this](http://msdn.microsoft.com/en-us/library/50xtbfet.aspx) page. There is also no reason for line … | |
Re: You have declared your methods static, which makes them class methods. In your code you create an instance of the Accounts class (line 78) then attempt to call these class methods like they are instance methods. Remove the keyword 'static' from the method declarations. | |
Re: Unfortunately only Ultimate has what he's looking for. There are plenty of tools out there that do what he wants, they all just cost. | |
Re: No example input so no idea if you are even getting a match. | |
Re: get and set are used with properties. return is used with methods that want to pass a value back to the calling code. public int Age {get; set;} // Automatic property, don't have to worry // about where it stores the value private int weight; public int Weight { // … | |
Re: Shouldn't be any need for the Select statement as you don't use it at all. | |
Re: I don't see how you get anything other than 'A', there is no loop and you only look at the first match. | |
Re: In your second block of code, line 32 you create a new Connect object, but then in line 35 you open the connection with that object. But now in line 36 you try to create a SqlCommand object, but you use the connection in the *con* variable rather than the … | |
Re: Where is 'newval' set prior to line 16? And line 26 isn't doing anything as you don't have any parameters in your SQL statement. | |
Re: No, the output is a DateTime structure. How it stores the information internally isn't important, how you display it is up to you. | |
Re: You most assuredly can use string in case statements. The restriction is that the values must be constants at compile time. Your problem is that the \ character is an escape character and it thinks you are looking for 000" and there is no closing quote for the string so … | |
Re: Run in debug mode and monitor CPU usage. When it jumps up, use the debug menu to 'break' the code and see where it is. | |
Re: I'm going to create a new language and call it "Best" making it the Best programming language! | |
![]() | Re: I'm not sure what you want. Is it the hex representation of the bits used to represent the float value? If so, you can use something like this: [code]using System; using System.Text; namespace Text { class Program { static void Main() { float f = -2.07217f; byte[] b = BitConverter.GetBytes(f); … |
Re: Line 42 you return a value. The method stops then, the lines after it never get executed, they are unreachable code. You do this in several places. Once you fix that, you'll get a "not all paths return a value". | |
| |
For a bit there, DaniWeb had icons and other graphic elements everywhere! Testing something new? | |
Re: [HTML Agility Pack](http://htmlagilitypack.codeplex.com/), examples and everything all there. | |
Re: First, you couldn't create a new thread for this, you had to find a six year old post to reply to? Second, what value is returned when CartTable.Rows.Count == 0? | |
Re: There are three timers in .NET and depending on what you want to do tells which one you want. All support single or repeated events on a schedule. [System.Timers](http://msdn.microsoft.com/en-us/library/system.timers.timer.aspx) [System.Threading.Timer](http://msdn.microsoft.com/en-us/library/system.threading.timer.aspx) [System.Windows.Forms.Timer](http://msdn.microsoft.com/en-us/library/system.windows.forms.timer.aspx) | |
Re: Are you running this in debug mode using a file based DB system? If so, Visual Studio makes a copy of the database so you don't mess up the original while debugging. | |
Re: > I really don't know why this thing is so slow, when I do the exact same thing in Cheat Engine, it does it immediantly, since I'm targeting notepad, and it scans addresses from 0 to the max value of a long, but mine only goes from 0 to the … | |
Re: Yes, create a structure to hold your doubles; public struct MyDoubles { public double one; public double two; public double three; publid MyDoubles(double o, double t, double h) { one = o; two = t; three = h; } } Then you'd call your method MyDoubles senddoubles = new MyDoubles(one, … | |
Re: One of the things about C# and .NET is that you can only update controls on what is known as the UI (User Interface) thread. If you are using multi-threading you might want to change a control from another thread and this is where *Invoke* and *InvokeRequired* come in handy. … | |
Re: Just open the file in exclusive mode. If it fails, do a SpinWait then try again. | |
Re: Catch the exception try { File.Delete(dir + "\\" + Files[j].ToString()); } catch (Exception e) { } As for why it's saying that something is accessing it, that's because it is. Just because you close a file doesn't mean the system releases the handle on it (and MS recomends that you … | |
Re: Not sure what you are asking here. ILMerge lets you package all your assemblies into one assembly. Did you mean you want to package the .NET assemblies too so that the end user doesn't need .NET installed? It would probably work but would be very large, and duplicate assemblies that … | |
Re: This is what you are getting: Before = "Details: Time Deleted = 01:16:30, Time Left = 00:00:00," After = "Details:,Time,Deleted,,,01:16:30,,Time,Left,,,00:00:00," strValues1[0] = "Details:" strValues1[1] = "Time" strValues1[2] = "Deleted" strValues1[3] = "" strValues1[4] = "" strValues1[5] = "01:16:30" strValues1[6] = "" strValues1[7] = "Time" strValues1[8] = "Left" strValues1[9] = "" … | |
Re: In lines 20, 22, 24, 26 and 30 you want to use 'file' and not 'filename' as 'file' is the name of the loop variable defined in line 15 | |
Re: Internal is not the default access modifier. See [this](http://msdn.microsoft.com/en-us/library/ba0a1yw2%28v=vs.80%29.aspx) for more information | |
Re: Or you could do it with one line myIntArray = myIntArray.Distinct().ToArray(); If you want to tell them as they enter, you'd do something like int position = 0; while (position < myIntArray.Length) { int value; String input = Console.ReadLine(); if (Int32.TryParse(input, out value) { if (myIntArray.Contains(value)) { Console.WriteLine("You already entered … | |
Re: Since the system doesn't know how to compare Ages, you need to implement the IComparable interface on your ages class. Alternitivly you could implement some IComparers to pass to Array.Sort. | |
Re: Did you put a copy of your code into the GAC? | |
Re: Classes are passed by reference, value types and structs are passed by value. You have a class, so it's passed by reference. Just because it contains a value type doesn't make it one. | |
Re: Add a timer to your form, set the interval to 5 minutes and in the Tick event set the box to red. When you update the value, stop and start the timer to reset the 5 minute interval. | |
Re: I think you are in the wrong section. C# code wouldn't use those functions, C++ would. | |
Re: Don't put ' marks around @val1, etc in your SQL statement, the system will handle that for you. | |
Re: 4 year old post. I'm guessing he's already had the interview. | |
Re: You bother to visit the Ghostscript web page? "The leading edge of Ghostscript development is under the GNU Affero GPL license. " | |
Re: Sure it is. There are plenty of examples of LZW compression if you just search for them. Decompress it, then compress it with CCITT T.6 Search engines are your friend. | |
Re: It sounds like you are defining the structure twice, which makes them different structures (even though they have the same internal data). | |
Re: If you are running in debug mode, Visual Studio makes a copy of the database for you to 'experiment' on, so you don't lose your original database. | |
Re: Try learning one of the functional languages. Since 'variables' are immutable, you'll learn recursion fast. | |
Re: All the `using` statement does is allow you to use the classes in that namespace without having to give the fully qualified name. So, for example, the `using System.Runtime` lets you used the class GCSettings (again, for example) without having to type `System.Runtime.GCSettings` | |
Re: The main thing to remember is that when perm is called inside your loop, all new variables are created for the method. | |
Re: You'd need ildasm to see what the manifest says the required version, or you can run it and see what it says :) | |
Re: I'd take a look at [URL="http://www.mathworks.com/matlabcentral/fileexchange/12987"]this[/URL]. |
The End.