1,684 Posted Topics
Re: What do you mean 'retrieve' the data? You have the data. If you want to use the data, put it in an array and iterate over it. | |
Re: By doing just what you described. What knowledge are you lacking that is preventing you from implementing this behavior? (Bringing up a message? Something else?) | |
Re: They mean errors that occurred while processing, converting, or programming, respectively. | |
Re: Define 'provider' and define 'consumer'. What do you mean by 'putting a car in a garage'? That analogy can mean different things. (Maybe just tell us what you're doing.) | |
Re: The compiler doesn't recognize the type Color. How about Marble::Color? I don't know my C++ anymore... | |
| |
Re: If you want a job in America, they'll have heard of Oxford but not Imperial. (And that's just my mindframe because all my british coworkers are working in America :)) | |
Re: It is always okay to expose public fields when the purpose of a class is to contain said field. For a tiny private data struct? Okay. For a public use-everywhere data structure? Okay. For example, it's okay for a binary tree datatype (not a binary search tree, just a plain … | |
Re: [code]int main()[color=red];[/color][/code] | |
Re: Your question makes no sense -- ArrayList is already in .NET 1.1. | |
Re: I suggest you call Partition on the tail _before_ you examine the first element of the list. Then update the array that Partition returns appropriately to account for the first element of the list. Only construct the array when Partition receives an empty list. | |
Re: Probably because you're assigning an element past the end of the array, and there's a variable there that throws off your code unpredictably. Also, you've already showed a way to change that range; I don't see what the problem is. But generally speaking the code can be slightly improved. Some … | |
I see that the folder icons are using solid white backgrounds rather than transparent backgrounds. The white stands out when the icons are used on a non-white background, as seen at <http://www.daniweb.com/category2.html>. This unacceptable, and I demand that this be fixed! How can I give information when these unkempt forum … | |
Re: It would be a cool forum; I think it would be somewhat outside the scope of Daniweb. If you find such a forum that you like, please tell me about it in this thread. | |
Re: Please edit your post to put your code in [[b][/b]code][[b][/b]/code] tags. | |
Re: [QUOTE=sknake;804923]I have gotten the sense of a lot of users on this forum sharing the same mindset? Why is that :([/QUOTE] I agree, it seems like somehow the mindset of figuring out how to write code on your own has been transformed in this thread into the mindset of knowing … | |
Re: You can unzip an array like that using the Where extension method (in .NET 3.5). [code] int[] evenPositioned = numbers.Where((x, i) => i % 2 == 0).ToArray(); int[] oddPositioned = numbers.Where((x, i) => i % 2 == 1).ToArray(); [/code] So input them into one array and then do the disentangling. | |
Re: Your first loop seemed broken, since you had the loop condition backwards. This second version seems like it should work, but it is a mystery to me. What happens when you debug your code? | |
Re: The most obvious direct answer is to make a quadtree that keeps track of which quadrants contain 3s and which don't. Then zoom in on a given point from above, continuing to enter regions that contain 3s and are still candidates for the closest 3 to your given point. You … | |
Re: Start with making or using a parser, then... finish with making an algorithm that analyzes. | |
Re: You have syntax errors. Read through the code character by character and get rid of the syntax errors. | |
Re: There's no "**" operator in Java. Either use Math.pow or write your own squaring function. | |
Re: var is a C# 3.0 feature; it can't possibly work with a C# 2 compiler. | |
Re: It's the same thing -- once the code has been compiled -- and used for the same purpose. It's better to use the second way, passing "by reference," because the first desensitizes you toward pointers. (Your spidey sense should tingle when you see a pointer -- it means danger lurks.) … | |
Re: Nobody could help you unless you listed specific books for which you wanted solutions manuals. And since nobody here would know how to find them off the top of their heads, you might as well do the googling yourself. | |
Re: [QUOTE=tksrules;797204]I need assistance with the following excercise: [/QUOTE] Why do you need assistance? | |
Re: The trigonometric functions expect their arguments to be in radians. Your input expects values in degrees. [icode](PI/2)*(180/PI)[/icode] is kind of funny; it simplifies to 90... | |
Re: [QUOTE=serkan sendur;797003]is there any c++ equivalent of doing that?[/QUOTE] Nope :) | |
Re: There's a DateTime constructor that takes year, month, day, hour, minute, second. | |
Re: [QUOTE=JackDurden;796952]Trying to make a circular queue, but its not working right. Enqueue is just adding things to the end, every time. my output is: Numbers in Queue: 1 2 3 Numbers in Queue: 2 3 Numbers in Queue: 2 3 6 it should be: Numbers in Queue: 1 2 3 … | |
| |
Re: Write it in C. Edit: Well, for starters, [code] g = (pixel >> 8) & 255; [/code] | |
Re: A struct defines a value type; a class defines a reference type. A value type is one whose values cannot be separated from the variable. If you try copying it to a different variable, you'll make a complete copy. You don't really modify value types -- you modify the variables … | |
Re: [quote][code]enter region = O; enter commodities = 2; enter saler = 1; prise = 500$;[/code][/quote] What does this code even mean? It is not C#. | |
Re: I think we can safely conclude that MosaicFuneral has no idea what he's talking about. | |
Re: The code you're showing here won't even compile -- in the function main, aFirst and aSecond are not in scope. | |
Re: [QUOTE=mattaseymour;795833]Is it to use sockets, or to use something more TCP based?[/QUOTE] Something "TCP-based" does use sockets. Take a look at System.Net.Sockets, you probably just want to use TcpClient and TcpListener, and maybe you'll get better advice regarding a secure connection, but that probably involves using something in [url=http://msdn.microsoft.com/en-us/library/system.net.security.aspx]System.Net.Security[/url] | |
Re: What the fuck? You asked this in the C++ forum and didn't even need to write it in C++, and got answers. Why are you asking it in the Java forum? | |
Re: You have a variable there that keeps track of the sum of the numbers. Using the same pattern, make another variable that keeps track of the largest number seen so far. Initialize it with the value Integer.MIN_VALUE. | |
Re: [QUOTE=javaAddict;795082][CODE] for (int i=0;i<list.size();i++) { String s = list.get(i); //you do not need to cast it to String like the previous example because of the way you defined the list above System.out.println(s); } [/CODE][/QUOTE] Leave it to a Javacoder to write code in the most obtuse manner possible. (Yes, I'm … | |
Re: d2b2 evaluates to something of type [icode][Int][/icode], right? Which means the expression [icode](d2b2(n / 2):1)[/icode] is trying to pass an [icode][Int][/icode] as the left-hand argument of the [icode](:)[/icode] function. Since the [icode](:)[/icode] function is of type [icode]a -> [a] -> [a][/icode], that means it expects on the right-hand side a … | |
Re: It makes a copy of the string. For it not to do so would be counter-intuitive -- if it wanted a pointer to a string, it would ask for one. In particular, you'll note that the constructor takes a const string. Which means that there's no way in heck that … | |
Re: [QUOTE=david.1982;791527]In PHP, I would have just set up parentID as a foreign key referencing the CatID on delete cascade; however I've found that in C#, I'm not allowed to set up a foreign key constraint that self-references a column in the same table (lame!).[/QUOTE] This doesn't make any sense. Constraints … | |
Re: Use an IDE. They have features like automatic method renaming. | |
Re: Pretty much, yes. Well, the exception could also be thrown in a method called by the called method, or in a method called by the method called by the called method, or.... Or the exception could be thrown directly from the try block itself. Also, finally blocks exist too. | |
Re: Your view of delegates and the mechanics of using them is very accurate. [QUOTE=BobLewiston;794544] Steps to create and prepare to use a delegate reference: 1 Define a delegate type: specify the signature (including return type) of methods that delegates of this type can point to. This is called "declaring" the … | |
Re: Looks like somebody clicked on the wrong forum. And it would be a nonsensical, wrong answer even if it was in the right forum. | |
Re: I would recommend the book "Accelerated C++", by Koenig & Moo. You'll note that the Daniweb rules state some prohibitions, including "do not post anything warez related or related to other illegal acts." This means that, for example, if there existed tools out in the world that made it trivial … |
The End.