1,359 Posted Topics
Re: No, Rubberman has a point (pun intended). While the client-programmer cannot use pointers in Java itself, the language does use references, and most if not all of the various implementations do use pointers internally to implement references. The Oracle reference implementation (which is closed-source, but known to be written in … | |
Re: As Rubberman alluded to, on modern processors, memory is not unitary. Most CPUs today break memory up into pages - blocks that can be manipulated my the hardware memory mangaement system - and mark the individual pages as to whether their contents can be modifed or not, and whether they … | |
Re: According to your personal profile, you are runing Windows 7, which means you are running an x86 processor, either a 32-bit system or (more likely, if it is running 7) a 64-bit 'long' mode system. There are several assemblers for Windows - Macro Assembler (MASM), Gnu Assembler (GAS), and Netwide … | |
Re: The first one is simply a misspelling in the definition of the `showKilometers()` method. The second is that you declared `showFeet()` ad type `void`, when it should in fact return a `double`. On a related not, you need to have the actual `return` statements in the three 'show' functions: public … | |
Re: Unfortunately, there is no real answer other than to read the file contents after the point of insertion, and re-write them with an offset equal to the size of the text you are inserting (one byte, in this case). Given the size of the file, it may be easier to … | |
Re: Sorry for the delay in getting to this, I missed it when it was on the front page earlier in the week. For the first case (line 7), I am guessing that the problem is that the MARS assembler doesn't support adding two immediate sub-values. The simple solution is to … | |
Re: The code as given won't work; the indentation is all off. Here is the program with what I presume is the correct indentation:` import getopt import sys import hmac import hashlib import base64 import urllib def formattedCmd(api, cmd): s = 'apiKey=' + api + '&' + cmd return s def … | |
Re: There is also an Objective-C front-end for GCC that is available on any platform that support GCC, so it is certainly available for Windows. The interesting thing is, Objective-C actually predates C++ by about a year, at least as a publicly available language ('C with Classes' was in development as … | |
Re: A few questions: * Is this a Point of Sale system for an actual shop, or a school project? * When you say that you need to input a barcode, do you mean you would type in an SKU number by hand, or do you actually need to scan barcodes? … | |
![]() | Re: **Captain119**: Actually, in C++ you *can* overload the names of functions; the issue is that you have to give each of the different functions sharing their name a different *signature*. The real issue is that the OP made a mistake in the second function's declaration; it should be something like … |
Re: It goes without saying that *some* sort of software is needed for programming; at minimum, you need an editor and a program trnaslator of some type. As Matt1998x points out, there is some software for programming installed already on just about any computer you might have. Windows includes Notepad and … | |
Re: Assuming that you are running the Javascript in a browser rather than as a stand-alone program, then the answer is 'no'. The example code above reads a set of arguments from the shell, something which Javascript cannot do - the closest equivalent would be reading data from the web page's … | |
Re: I know that you are only a beginner and may not be comfortable with such things, but I would recommend that you a) come up with a class that holds the area descriptions, rather than hard-coding each one in, and b) storing the data for each of the areas in … | |
Re: First off, The reason that it is showing the title bar of the window is because you *asked* for the title bar of the window. If you are opening a MS Word window, and haven't saved the document yet, then it will show the default document name - which in … | |
Re: Let's not drag up old, dead threads, shall we? Please, check the dates on the threads before you post. | |
Re: You might want to look into using the PyGame [Sprite class](http://www.pygame.org/docs/ref/sprite.html) for the bullets, as it includes built-in colission detection. For that matter the regular [Rect class](http://www.pygame.org/docs/ref/rect.html) has several collision detection methods which could be of use, though they aren't as fine-grained as the Sprite methods are. | |
Re: Actually, the way you accept the input should be seperate from the way you add the user record, if only for modularity's sake. You want to break adding a user record down into five steps: * input - get the username and password. * encryption - converting the password into … | |
Re: As for your question about heap memory, [this post](http://www.daniweb.com/software-development/cpp/threads/425578/only-delete-pointers-declared-with-new-operator#post1819772) should help clarify how memory is allocated and used. It is written from a C/C++ perspective, however, so there is more to be added about it. The first thing you need to know is that objects in C# are always in … | |
Re: Simple: use the function `localtime()` instead of `gmtime()`. | |
Re: Can you gives us at least some idea of what you need? Aside from code, that is - no one here is going to give you a working program, gratis, without you providing the majority of the work. DaniWeb is not a homework-completion service, and if that is what you … | |
Re: OK, sounds fine. What problems are you having with it? Can you show us what you've done so far, if anything? | |
Re: COuld you please give us some more information about the way the program is failing, e.g., error messages, the stack trace, and similar information? Also, what version of Python are you using? The code you posted is for Python 2.x; if you are running Python 3.x, it would fail, because … | |
Re: I'll assume from [a previous related thread](http://www.daniweb.com/software-development/c/threads/451955/hookes-pattern-search-optimisaton) that you are using Turbo C++, which is unfortunate but I know there's nothing to be done about it (except protest to the government University Standards board, which I understand is probably futile). Therefore I'll limit my comments about the headers to a … | |
Re: I know it doesn't address the problem you are having (directly, anyway), but I would recommend creating an auxiliary class `GradeBookEntry`, which would hold the actual details of the student records, rather than having a series of parallel arrays which need to be synchronized manually. class GradeBookEntry { final static … | |
Re: Actually, the problem statement very clearly says to use C and assembly, not C++. I think you are confused about what language you are supposed to be using. | |
Re: Basically, what it comes down to is that you have both of the return clauses inside of an if/else statement, and the compiler does not have the ability to determine for certain that at least one of the options is guaranteed to run. The solution in this case is simple: … | |
Re: First off, we don't do other people's homework for them. Second, we *don't* do other people's homework for them. And third, ***we don't do other people's homework for them***. Sensing a pattern here yet? No one here will simply hand you a solution on a silver platter. If you show … | |
Re: In the first set of declarations, the variables are *local* to `main()`; they only exist inside `main()`, and only for the time that the program is running. You can print the variables from `main()` just as you have them now. In the second set of declarations, the variables are *instance … | |
Re: Not such that you could use them by that name, no. In C, all variables must be declared at compile time. You *can* allocate memory at runtime, using `malloc()`, but you would still need a declared pointer to refer to such memory. Could you give more detalis as to why … | |
Re: BTW, where is the `BinaryNode` generic class defined? This seems to be a crucial omission. I think that the crux of the matter is that you have misunderstood what the`String` class's `getBytes()` method does. What it returns is an array of bytes containing the raw representation of the chracters themselves … | |
Re: There really isn't any formal definition of the format, unfortunately, at least not one that Microsoft has seen fit to share with anyone. Their own recommendation is to always use their library functions to manipulate BMPs, and any other approach is likely to be incomplete, as they deliberately keep the … | |
Re: * Develop an extension of the ELF object format and the Unix `ld` linker that allows for C++ template functions to be separately compiled. Kudos if you can fit the extension into the existing format without changing the underlying structures, such that existing linkers can still use the extended format … | |
Re: **veducator**: Please use the modern C++ headers in the future. The C++98 standard removed the `.h` extensions from all standard headers, such that `<iostream.h>` (for example) is now just `<iostream>`. Similarly, the standard headers for the C standard libraries to be prepended with a `c`, for example, `<stdio.h>` is now … | |
Re: OK, first off, you are making one of the classic mistakes mew C++ programmers make: putting the implementation of non-template classes inside the header file. Header files ought to have only global declarations, class and struct definitions, and preprocessor directives (templates are an exception to this, because of the limitations … | |
Re: Try [this tutorial](http://eternallyconfuzzled.com/tuts/languages/jsw_tut_pointers.aspx) on the subject; while the references to specific architectures is a bit dated, it is nonetheless generally accurate. | |
Re: While I doubt that HappyGeek's answer is quite what you were looking for, the truth is that we can't give much more of an answer without a lot more information from you. What, if anything, do you already know? WHat would you like to learn about? Computer programming is a … | |
Re: OK, this is a very peculiar way to do this, but if that's the assignment, there's nothing to be done for it. I take that back. It's a *ridiculous* way to do it. Are you certain that you're supposed to have three different matrices in a single object? Normally, I … | |
Re: The main issue is actually with your format string; for month, you should use capitalized letter M. Similarly, for 24-hour time going from 00 to 23, you need to use capital H. To get the time zone in the format you want, use the capital letter Z twice. "MM.dd.yyyy HH:mm:ss … | |
Re: Could you explain a bit more about what you need? It isn't enitrely clear what sort of help you are looking for. | |
Re: You will need to you double indirection, i.e., a pointer to a pointer. #include<stdio.h> void swap(char **a,char **b); int main() { char *p[2]={"hello","good morning"}; swap(&p[0],&p[1]); printf("%s %s",p[0],p[1]); return 0; } void swap(char **a,char **b) { char *t; t = *a; *a = *b; *b = t; } Not entirely obvious, … | |
Re: Test what, our patience? Seriously, even if anyone here were inclined to simply provide code to you - which we are not - you would need to give a lot more detail about what you need. One of the forum rules states that, when posting for help with a program, … | |
Re: First off, you should know general Java programming, as Android is based on Java. I would start with [Oracle's Java Documentation](http://docs.oracle.com/javase/7/docs/), and a good book on the topic such as *[Thinking In Java](http://mindview.net/Books/TIJ4)* (if you can't afford the e-book, the [previous edition](http://www.mindview.net/Books/TIJ/) is available for free). You will also want … | |
Re: By weird, what exactly do you mean? The backgrounds on both appear to be gray, is that what you are referring to? If I were you, I would reconsider my design, and specifically, I would want to have some sort of parent `GameObject` class which the other elements could inherit … | |
Re: Rather than the standard Python time methods, I would recommend using a PyGame Clock object, as the Clock.tick() method is specifically designed for this sort of thing. I would also take the time out to re-write the code with classes. My own version of this now has a `GameObject` class … | |
Re: More importantly, **what** `newline()` function? Python doesn't have one, AFAIK. To print a newline, you use `print()` with no arguments. | |
Re: Just as an aside, you can remove the `#include`s for `<stdio.h>` and `<stdlib.h>`; you never use `<stdio.h>`, and `<stdlib.h>` is the C version of `<cstdlib>`. Just something I figured I would point out. Given the number of places where you are writing out a series of characters on a given … | |
Re: > Thank you pyTony , but i can't use Classes , i try to define a cliquable area in my close to my label. If you don't mind me asking, why can't you use a class? Is it a case where you can't (i.e., you aren't familiar with developing them), … | |
Re: First off, we don't do other people's homework for them. Second, we don't do other people's homework for them. And third, we don't do other people's homework for them. Sensing a pattern here yet? No one here will simply hand you a solution on a silver platter. If you show … | |
Re: What sepp2k says is correct, but I suspect that there is more to this that may be relevant. What is the script supposed to do, and how many different codes are there? If there are more than two or three different ones, you may want to use a dictionary to … |
The End.