1,359 Posted Topics
Re: First off, you aren't going to be writing hard [real-time](https://en.wikipedia.org/wiki/Real-time_computing) applications on Windows, or on any other operating system that uses virtual memory without specific support for unswappable pages. That's the first thing to understand: if there is a possibility of a delay in response time due to paging or … | |
Re: Well, to answer the question, the usual solution to having a multidimensional `ArrayList` is to declare an `ArrayList` of `ArrayList` of the type being stored: ArrayList<ArrayList<String> > data = new ArrayList<ArrayList<String> >(); data.add(new ArrayList<String>()); data.add(new ArrayList<String>()); data.get(0).add("Alex"); data.get(0).add("31"); data.get(1).add("Burren"); data.get(1).add("Java"); However, no experienced Java developer would ever do this. The … | |
Re: > (most IDE's refer to "intellisense" as "Code Completion", especially for linux) That's because the term 'Intellisense' is a trademark of Microsoft. Other developers can't use that name. In any case, 'auto-completion' was the term used long before Microsoft introduced their version of it. As for IDEs, I think both … | |
Re: You would need to call `isPrime()` with two numbers, one the number you are checking and the other a number smaller than that but larger than it's square root. I would reccomend changing the name of `isPrime()` to `primeTest()` and having a second function called `isPrime()`, which takes only one … | |
Re: A few questions and suggestions: * Why did you include a null constructor? You generally only want a default c'tor if there is a reasonable default to provide, which in this case there really isn't. A null c'tor is generally a Bad Thing, as it looks like a proper default … | |
Re: First off, you'll want to use the tab escape sequence, `"\t"`, rather than the tab character itself in your string replace. Second, your are returning the function at the end of the first pass of the loop; you seem confused as to how you want the function to work, whether … | |
Re: OK, I see a few things you didn't mention, such as a) the particular emulator you are using, and b) whether you are running in realistic mode, with load and branch delays. I also see a major flaw in your algorithm. As it is now, you are stacking the original … | |
Re: In order to create a sub-class of an existing class, you need to use the `extends` keyword and the name of the class being extended in the declaration of the new class. class UsedCar extends Car { // ... } Furthermore, the parent class would have to have the methods … | |
Re: No, please, don't. That book is a terrible introduction to C++, and does not really cover data structures to any real degree in any case. Fardous: what do you already know of programming in general, and of C++ in specific? What do you know of data structures in any other … | |
Re: The problem is not in the numbers used, but in the size of the memnory being allocated. The type `N` is a pointer type, which means that it is likely to be one system word long (probably either 32 or 64 bits, assuming a common Intel or AMD CPU, though … | |
Re: > How exactly do structs in structs work? Do you need to do anything special with them? What do you mean by 'special'? What you would do woith them would depend on what you intentions are. I know that sounds evasive, but it really is as much of an answer … | |
Re: Your casts are fine; the problem is that you haven't initialized the values of `start.x` and `edges.x1[0]` yet, so they have whatever garbage was in them before the program was run (or zeroes, at best, if the memory is getting cleared by the system before use). BTW, did you see … | |
Re: I am afraid you will wait indefinitely if you expect us to do the work for you. While we are here to help you learn, doing your work for you doesn't actually accomplish that. As a matter of policy for both Daniweb in general and most members in particular, we … | |
Re: Most likely, these are just the values that happen to be in those memory addresses when the prgoram starts. | |
Re: It is quite simple: first, you need an `unsigned int` variable as a counter, which should be initialized to zero. Alter your `printf()` statement to print this counter as a four-digit hex value followed by a a semi-colon and a space, followed by the string you are now printing. Finally, … | |
Re: You can't be serious. You expect us to help you cheat in an exam? Forget it. | |
Re: The thing is, when computing a series like this, you can't simply jump to the *n*th iteration and get the right answer; you need to sum all the iterations before it to get the approximation. You want your `for()` loop to start at 1 and iterate by one, and have … | |
Re: > I would probably need to add a case for it in the switch in LexicalAnalysis.cpp, right? And add it to the state diagram? If you want them as separate token types, then yes to both, though most languages treat all whitespace as a single token type. The answer to … | |
Re: You will want: * a variable that holds the character currently being printed * an outer `for()` loop to count the number of lines to print * an `if()` statement that flips the character being printed (hint: use the modulo (`%`) operator) * two inner `for()` loops, one that prints … | |
Re: First off, this is the C++ forum, not the C forum; you'll want to ask questions about C programming there. Second, all you've done is post your assignment; you haven't asked a question, or shown any indication of having done any of the work on the project yet. [Daniweb rules](https://www.daniweb.com/community/rules) … | |
Re: First off, I would recommend that, rather than having individual named structures as one-off types, that you define a POINT struct type and use that as the basis of your larger data structures: struct POINT { double x; double y; }; /* a vector represents a directional line segment, that … | |
Re: OK, you have some of the idea, but you seem confused about some aspects, such as parameteters and return values. Let me give some suggestions. First off, your goal is to get the number of vowels in the function parameter, `test`. The parameter of a function is a value passed … | |
Re: I assume that the OP is referring to [XMBC Media Center](http://xbmc.org/), but I don't know enough about it myself to make sense out of the question, either. I would suggest that the OP seek help on the [XMBC forums](http://forum.xbmc.org/) directly, as there presumably would be people familiar with the program … | |
Re: Where you have it now (lines 21-34) is actually workable. The implementation has several problems with it as it stands, but you could leave it right where it is. However, that's not what you would usually do. Has your instructor (or textbook) explained about writing separate methods other than `Main()` … | |
Re: Actually, reliability is not the real issue with analog computers; indeed, they can be much more reliable at times, as they don't have issues of round-off errors and so forth that are inherent in digital computers. Analog devices have the advantage of being continous rather than discrete, and thus are … | |
Re: Then that would be your first step, wouldn't it? Writing out even a basic skeleton on a class and a `main()` function would at least give us code to discuss. We will not write your program for you. Not only does it do you no good for us to simply … | |
Re: I will give one piece of advice, but I don't know if it will make sense to you yet. Anyway, here it goes: When getting numbers from standard input, the natural inclination is to use `scanf()` directly. I don't recommend that, as it can have unforeseen issues with the newline … | |
Re: First off, you should know before anything else that no one here is going to do the work for you. It is Daniweb policy that we assist you in solving your problem, but that we not solve the problem directly by providing code. It doesn't sound like that is what … | |
Re: While Deceptikon's answer is excellent, I would want to ask if you understood what an array really is, in the assembly language you are using. The algorithm won't help you if you don't know how to declare an array in the first place. Which processor are you targeting, and what … | |
Re: I am no expert at Java threading, but I believe the main issue is that you aren't synchronizing on a single object, but rather you have three separate objects of the same type, which happen to be synchronized, but *not with each other*. You would need a single object which … | |
Re: The first thing I would recommend in starting out with Python is finding a good Integrated Development Environment, oe IDE; while IDLE, the one that comes with Python, is passable, it is not really new-user friendly and takes a bit of getting used to. Unfortunately, 'good' is very subjective when … | |
Re: Keep in mind that there is difference between the general algorithms, and the [archive file formats](https://en.wikipedia.org/wiki/List_of_archive_formats) which are their concrete realization. For any given algorithm, there are more than one possible representation of the compressed data. It is only when you have a specific format that you can meaningfully talk … | |
Re: Simple: func(); If you have ever used `printf()` or any other standard library calls, you have made a function call. These functions are *not* part of the language; they are part of the library, which is something completely different. Just because they are *standard* does not mean they are part … | |
I am currently making out the plans for the milestones for the rest of this year in my long-term projects (Thelema, Assiah, and Alfheim). I was hoping that someone would be able to review these plans and help me determine which are feasible in the next four months. The overall … | |
Re: Good to meet you, though I should point out that such introductions really ought to be posted to the 'Community Introductions' forum, rather than one of the language fora. Since you are new, I don't think anyone will fault you for it, but it is something to be aware of … | |
Re: What have you tried so far, and what problems are you having with it? Please include at least enough of your source code to explain any difficulties you are experiencing. Keep in mind the following DaniWeb community rule: > Do provide evidence of having done some work yourself if posting … | |
Re: First off, which version of Dev-C++ do you have? The original Bloodshed Dev-C++ has not been maintained for nearly ten years, and is badly out of date. We recommend the [Orwell fork](http://sourceforge.net/projects/orwelldevcpp/) as the most up to date version available. | |
Re: That, plus you may want to have a little patience. Fora like this aren't IM or Twitter; they are more like email, where you might have to wait hours or even days before a response. OTOH, it also means that you aren't limited to 140 characters, so posts can be … | |
Re: My optimism in others' good intentions is battling with my pessimism about [help vampires](http://www.skidmore.edu/~pdwyer/e/eoc/help_vampire.htm) (which the OP is quickly proving herself to be). Still, in the hope of giving her at least a leg up, I'll try to give what advice I may. >a) Explain how the computer passes control … | |
Re: Also, which compiler are you using? If it is Turbo C, then you are limited to a `long` of 16 bits, which gives an `unsigned` maximum value of 65535. | |
Re: How are you running the script, and what command line arguments are you invoking the script with? If you are running the script from the command line, you would have arguments as part of the invocation, like so: python test_argv.py arg1 arg2 arg3 OTOH, if you are using an IDE … | |
Re: First off, as JamesCherrill states, there is a vast amount of tutorials and other resources covering the subject of compiler development around, and while much of it is of questionable value, it should be possible to find something you can use to begin your work. [This forum reference](http://forums.devshed.com/programming-languages-139/compiler-writing-language-design-634985.html), while dated, … | |
Re: Could you please give more details about what you need? First off, I expect most of the people here are unfamiliar with the game you refer to, and we'd need to know what operating system you are running on (Windows, Linux, MacOS, etc.) and what compiler you are using. I've … | |
Re: **Nicolae_1**: First off, this is an English language forum, and giving an answer in another language (especially one poorly known outside of its home country such as Romanian) is extremely rude and unlikely to be helpful. Even if the OP were a native speaker - which is not the case … | |
Re: OK, I trust that this is indeed urgent *for you*, but you should be aware that it isn't necessarily going to get us moving faster. The forum moves at its own pace; you might get an answer right away, or the next day, or next week, or never. I wouldn't … | |
Re: OK, I've finally got Netbeans running and connecting to a local (embedded) database that I created manually with IJ, so I've got a handle on what you are talking about. As it happens, there is a way to add a foreign key to a table in Netbeans, but it isn't … | |
Re: The purpose of the d'tor is not to free the object itself; that is done by `delete`, which should only be applied to dynamically allocated memory (that is, values allocated using `new`) in any case. Also, freeing the object does not *overwrite* the object; the memory itself is is still … | |
Re: If you have a question like this, please start a new thread rather than resurrecting a long-dead one like this. As for why `printf()` and `scanf()` aren't used in Java very often, well, to begin with, ther *is* no `scanf()` method in the standard Java library. Rather, the `Scanner` class … | |
Re: While Slavi's answer is indeed a good starting point, I think we could help some more as well if you could give us some more information. Let's start with a few pertinent questions: * What operating system is this going to run on? * What [database engine](https://en.wikipedia.org/wiki/Relational_database_management_system) are you using … | |
Re: I would prompt you to consider a shorter if somewhat more complex solution, one which works by *sorting* the three values. While a full sorting function is a bit heavyweight for this purpose, consider using three temporary values, `min`, `mid`, and `max`, and then testing the three input values in … |
The End.