2,157 Posted Topics
![]() | Re: How about the [URL="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"]HTTP standard definition?[/URL] ![]() |
Re: DateTime.Now().AddDays(15) assuming today is the issue date. Take a look at [URL="http://msdn.microsoft.com/en-us/library/system.datetime.aspx"]DateTime[/URL] to see all the fun things you can do with it. | |
Re: [code]area = ((4/3)*Math.PI)*Math.Pow(this.data,3);[/code] In C#, unless you tell it, numbers without decimal points are treated as integers. So when it evaluates this statement it goes "hmm, integer 4 divided by integer 3. That gives 1". So change that to [code]area = ((4.0/3.0)*Math.PI)*Math.Pow(this.data,3);[/code] | |
Re: I once worked at a place where we were told we'd have to go back and flowchart all our old software. Over 100 applications and 10's of millions of lines of code. Most of the flowcharts ended up looking like this: Start -> Read Input Data -> Process Data -> … | |
Re: This method[code]public void _UpdateLabel(string text) { if (label1.InvokeRequired) { UpdateLabel updt = new UpdateLabel(_UpdateLabel); Invoke(updt, new object[] { text }); } else { label1.Text = text; label1.Refresh(); } }[/code] Is calling itself to update the label. You need to call a different method:[code] public void _UpdateLabel(string text) { if (label1.InvokeRequired) … | |
Re: Create two data adapters, one for each table. Set the CommandText to the appropriate command, call the Fill method on each DA, passing the DataSet and table name. You could do it with one data adapter, but you still have to make two fill calls. | |
Re: Someone has to build the tools that 'every tom, dick and harry' use to make their applications. The first time I used VB I thought "This is too easy to make GUI applications". Then I looked at the applications non-programmers make and decided my job was secure for the forseeable … | |
Re: It's an novelty item. For the same price I could get a more powerful laptop, which actually has a screen. I won't be able to play C64 games on it since it doesn't have the emulator, but I can download one of those. | |
Re: It tells you the problem: [I]The directory or file specified does not exist on the Web server.[/I] Use the trace rule to figure out what is going on. It also tells you how to do that. | |
| |
Re: Line 32 is modifying the list which you aren't allowed to do inside of an IEnumerable loop on that list (the foreach is an IEnumerable loop). Your second method is what you need to do, not sure why you got an error you'll have to post your code. | |
I posted a code snippet ([URL="http://www.daniweb.com/software-development/csharp/code/355645"]Optimizing Matrix Multiplication[/URL]) and when I check the stats on it and click the [URL="http://www.daniweb.com/forums/linkbacks.php?t=355645"]linkbacks[/URL] I get a page of "Incompatible Browser | Facebook" links. What's up with that?! | |
Re: Because assigning a value to a textbox replaces the old value. You probably want to append the string[code]TextBox1.Text = TextBox1.Text & "123456789"[/code] ![]() | |
Re: Even though you may open, close, and create new SQL connections, behind the scene the system is maintaining multiple connections to your database just waiting for you to need one. This helps optimize your database code. So the answer is: Do what you feel makes your code more readable and … | |
Re: [QUOTE=CsharpChico;1533020]First of all, I would suggest using double instead of float because double can easily accept decimal point and when getting and Average it's not likely that the average will not have a decimal.[/QUOTE] What? [B]float[/B] type has a decimal point, as does [B]decimal[/B] type. I don't understand what you … | |
Re: [code]using System; using System.Collections.Generic; using System.Text; namespace TestBed { class TestBed { static void Main() { Stack<int> myStack = new Stack<int>(); decimal d = 4234234234234; decimal t = d; while (t > 0) { int r = (int)(t % 2); myStack.Push(r); t = Math.Floor(t/2); } StringBuilder sb = new StringBuilder(); … | |
Re: Your inner loops run 205,891,132,094,649 iterations per outer loop. It's not infinite, but it might as well be. You need to reconsider what you are doing as you won't live long enough to generate all possible values for just one iteration of your outer loop. | |
Re: [code]using System; using System.IO; namespace TestBed { class TestBed { static void Main() { StreamReader sr = new StreamReader("Test.txt"); String currentLine = null; String startLine = null; String lastGoodLine = null; Boolean lookingForStart = true; while (sr.EndOfStream == false) { if (lookingForStart) { currentLine = sr.ReadLine(); if (currentLine.StartsWith(">")) { startLine … | |
Re: [LIST=1] [*]Create Windows form application. [*]Add webbrowser to form [*]Add timer to form [*]Set timer interval to 10000 [*]Set timer enabled to true [*]Add event handler for tick event [*]In tick event, add the line [icode]webBrowser1.Navigate("http://mywebsite.com");[/icode] [*]Run code [/LIST] | |
Re: SELECT *, Rnd(serialNumber) FROM dell ORDER BY Rnd(serialNumber) | |
Re: Read [URL="http://en.wikipedia.org/wiki/Floating_point"]this[/URL], particularly the section on Representable numbers, conversion and rounding. | |
Re: If you are given two DateTimes you might need to adjust one (or both) if it is Daylight savings time if you wish to accurately calculate the TimeSpan between them. All the rules for daylight savings time are contained within the libraries that are used to figure out what time … | |
Re: You need to install the Oracle client software on your machine, and configure the TNSNames file to properly reference your database. | |
Re: What Oracle data provider have you installed? What error are you getting? | |
Re: First, you put [noparse][code] before your first line of code, then you put [/code][/noparse] after the last line of your code. That way it will format it in a way that is easy to read (since you want to make things easy for the people who are going to help … | |
Re: It looks like there is a problem with one of the internal values. I say this because of the AIMLbot.Bot.get_TimeOut() line. It looks like it's trying to parse some text into a double and it fails. Are you sure the line [icode]myBot.loadSettings();[/icode] is actually loading the settings? | |
Re: [LIST=1] [*]Use File.Copy to copy the XML file you just created. [*]Open two XmlWriter in your Using block and duplicate the part where you actually write. [*]Make your code a method taking a path/filename and call it twice. [/LIST] | |
Re: change line 9 (the blank one) to [code]int[] myIntArray = list.ToArray();[/code] | |
Re: Use a FileStream instead of a StreamReader as it has a Seek method. And no, Read will stop at the end of the file. It also has a return value that tells the number of characters read. | |
Re: How can CurrHour = 6 AND = 7 (line 8)? How can CurrHour = 4 AND = 6 (line 10)? These lines will always be false since you require mutually exclusive conditions to both be true for the if to be true. Can you explain (in words) what the conditions … | |
Re: Viewstate is used to persist values of controls across postbacks. For example, say you had a form where you fill out name, address, etc. but you forgot your email address. When you submit it the code behind says "need email address" and returns the page so you can fill out … | |
Re: Unless it's in an infinite loop, it ends when the method you used to start the thread is done. | |
Re: Handle the DoubelClick method and open your form. | |
Re: Sounds like there is an issue with the win32 library probably manipulating the stack. Since the debugger makes changes to the stack (it's how it tracks things) anything else doing so can cause problems. When you run without the debugger you don't have this issue since only one process is … | |
| |
Re: What you do is go up to your instructor and say "Excuse me, but I don't understand this assignment. While I understand quicksort, I don't understand what you mean when you say 'a partition of 3, 5, 7 or 11 elements'. Would you please help me to understand what it … | |
![]() | Re: [code]Random r = new Random(); // CardArray is an array of type Card (or List<T>, etc. as long as it's indexable) for (int i = 51; i > 0; i--) { int s = r.Next(i); Card temp = CardArray[i]; CardArray[i] = CardArray[s]; CardArray[s] = temp; }[/code] ![]() |
Re: [QUOTE=ashley11;1530854]i have a sortedLIst.[/quote]No you don't. Stop using the name sortedlist and use meaningful variable names. And if you don't show the declaration of the variable tell us what it really is. | |
Re: Just FYI, if you don't want it short-circuited, use the single character versions of the operands: [code]if (test1() | test2()) { Console.WriteLine("Complete"); } static bool test1() { Console.WriteLine("test1"); return true; } static bool test2() { Console.WriteLine("test2"); return false; }[/code] Prints both test1 and test2 regardless of the return values. | |
Re: You've been here long enough to know how to use [noparse][code] [/code][/noparse] tags. | |
Re: Use [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.savefiledialog.aspx"]SaveFileDialog[/URL] to select a location and [URL="http://msdn.microsoft.com/en-us/library/system.io.file.copy.aspx"]File.Copy[/URL] to copy the mdb file. | |
Anyone else having issues with the javascript on Daniweb crashing Firefox 4? It doesn't happen all the time so I'm guessing it's some advertisement that is doing it. Just FYI I have no plug-ins, add-ons, whatever. Just the browser. It rarely happens in the programming forums, mostly in the Community … | |
Re: 1) Create a class named "Game" 2) Add two auto-implemented properties "Name" and "MaxPlayers" 3) Override the ToString() method. Make it return the class name (from GetType()), the game name (from the property above), and maximum number of players (from the other property above). 4) Create a child class of … | |
Re: Since you didn't provide what the method _kbhit() does how could anyone answer you? | |
Re: [QUOTE=abelLazm;1529988]The most suitable dataType for these type of comparisons is string as the retrieved data is in String form. [/QUOTE] This is contrary to what Microsoft says. According to the [URL="http://msdn.microsoft.com/en-us/library/ms131092.aspx"]SQL data types to CLR data mapping[/URL] money is a decimal type. Also using strings to compare numbers is a … | |
Re: 1) Get the site URI 2) Start a [URL="http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx"]Stopwatch[/URL] 3) Get site using [URL="http://msdn.microsoft.com/en-us/library/system.web.httprequest.aspx"]HttpRequest[/URL] 4) Stop Stopwatch 5) Profit! |
The End.