5,331 Posted Topics
Re: Ok. That would be helpful. Writing operators can sometimes be confusing for the new C++ developer. The signature is critical. If you are using a non-const signature and are (probably) applying it to a const object, reference, or pointer, then you will have a problem. Likewise, the arguments passed and … | |
| |
Re: Using [icode](int)sqrt(n);[/icode] as a divisor (for your modulus operation) is not a good idea, since it will cast away the fractional part, resulting in an invalid result. There are other issues as well, but this is a start. Myself, I do some short-cuts (anything ending in even number -> reject, … | |
Re: A couple of (or a few) questions: 1. What video hardware (video board) are you using? 2. What kind of display? 3. How are you trying to program the display? Modern cards are 24-bit or 32-bit color capable. There is a standard api interface that most all modern cards support … | |
Re: The problem isn't with OpenGL - it is just an interface to display stuff on the screen. Calculating the vector is the main problem. That is simple calculus or vector algebra. Refresh your math and go from there! | |
Re: [url]http://en.wikipedia.org/wiki/Quicksort[/url] | |
Re: There are at least 2 you can get. One is for the Cygwin Unix/Linux environment and requires the Cygwin runtime support. The other is MinGW. Below are their web sites where you can freely download them and get appropriate documentation. Cygwin: [url]www.cygwin.com[/url] MinGW: [url]www.mingw.org[/url] They both work well. I used … | |
Re: You expect people in their spare time to analyze this much MIPS assembler code? Wishful thinking, I do believe... :-) Try to be more direct as to where you are experiencing a problem. In any case, since you are experiencing a word alignment error/exception, look at where you are placing … | |
Re: Aren't you commenting out initialization of the DS register? As far as I remember (from my last x86 assembler coding work around 1990), if you don't initialize DS, then it is set to CS. Sorry that my memory is so spotty about this. I was just looking at my old … | |
Re: Somewhere on my bookshelf, gathering dust, is an original Intel x86 manual. Back then, they didn't have the 32-bit and 64-bit instructions. 16-bit only... :-) Anyway, it was compliments of my college buddy, Bruce Ravenel, who was one of the principal architects of the x86 processor at Intel back in … | |
Re: ASCII digits can simply be converted to integer binary numbers by subtracting the character '0' from them. | |
Re: This appears to be, at first blush, a simple xor substitution/rotation algorithm. Simple stuff. You solve it... If this is from commercial software, I have to think there is more to it than this, unless they are trying for "security by obscurity" - the key is in the "key". If … | |
Re: Showing the output of your code isn't particularly helpful. Please state the algorithms you are using, in detail (functionally). You mention stuff like "revised simplex method with LU decomposition", but you don't show specifically how your are applying these abstractions. Show the math... | |
Re: What venomxxl said. Adding to that, in the days before C++ (some of use were doing complex C software development in those dark years), we still understood abstractions, and keeping the association of processing functions close to the data they were intended to process - sort of the antecedent of … | |
Re: School problems/exercises don't get simple answers - you have to make an effort to solve the problem first yourself before we will chime in with corrections, hints, etc. Please read the terms of use for the forums. It explains this clearly. | |
Re: Please post the compiler/linker output here, at the very least. | |
Re: Normally you would put the input device (stdin for C or cin for C++), and preferably use the POSIX termios functions to set the device into raw (unbuffered, unmapped) mode. That would normally be the tcsetattr() function. On Windows, if you don't have the POSIX libraries and headers installed, there … | |
Re: DO NOT ASSIGN VALUES to the vector argv[] (lines 27, 77, etc). Those are set by the system when the program runs. You have probably munged program memory as a result. | |
Re: Here is a link to a page with a list of OpenSuse mirror sites. One may work better for you. [url]http://mirrors.opensuse.org/list/all.html[/url] | |
Re: Not too helpful. Please post the error messages here. | |
Re: Look at line 19. Do you see the problem? [icode] numb = num[g]; [/icode] | |
Re: I think your surmise about a short circuit is likely correct. Check the cabling and connectors first, but it may well be that either the backlight is bad, or the display itself is fubar. My guess would be the backlight, but that is just a SWAG. | |
Re: You analyze it and tell us... No help on school work from us until you have made a reasonable effort to solve the problem yourself. Also, please post code inside of code blocks. See the "[CODE]" button at the top of the message editor. | |
Re: Sorry, but we aren't going to do your homework for you. Please make an effort to solve this problem first, even if it is only a text description of what you think you should do. There are a lot of texts on this subject, and plenty of those to be … | |
Re: That probably means that there are no available partitions left. The standard partition table only has room for 4 primary partitions. Windows and the recovery partition take two of those. Please boot into the LiveUSB device, log into the GUI as root, start up a terminal/console window, and execute this … | |
Re: The Linux kernel is written in C, and mostly does even handling (hardware and software interrupts, I/O events, CPU traps, etc). What precisely do [B][I]you[/I][/B] mean by "event handling"? | |
Re: You have a long way to go... There a a number of graphical tools and API's available, many of which can run on most operating systems (Windows, Linux, Unix, Apple, etc). OpenGL is quite low-level and requires a great deal of detailed knowledge of the windowing environment (different on each … | |
Re: This should probably be moved to the Java forum. | |
Re: Read up on the file seeking functions. You can position your current read/write position at a specific place in a file, either offset from the beginning, end, or your current location (backward or forward) in the file. From the Linux fseek() man pages: [code] FSEEK(3) Linux Programmer’s Manual FSEEK(3) NAME … | |
![]() | Re: What dviddoria said, but also the GPU stuff requires 1) an nvidia card w/ CUDA capabilities, and 2) the nvidia CUDA development tools and libraries. This second issue is what may be causing your link failure. Anyway, here is the OpenCV GPU FAQ page which talks about what you need … |
Re: You still are not being very clear in what you are trying to do, so let me put on my pointy, star-covered wizard hat and see if I can read your mind... You have been able to output random times and/or values to a string, but you want to do … | |
Re: You can boot a Linux rescue CD/DVD and see if the drive is accessible or not. If not, then either the drive or the controller are fubar. If it is visible with the "fdisk -l" command, then it may be than something has munged the boot loader. There are several … | |
Re: Some people here have actually earned their knowledge, positions, and degrees the hard way, by doing the work. I'm happy to see that you are not so inclined. After all that takes time and effort! | |
Re: So, what does this code have to do with class diagrams (the subject of the post)? | |
Re: Post the contents of your .cvsrc file here. From the Linux CVS man page: [code] -f Do not read the ~/.cvsrc file. This option is most often used because of the non-orthogonality of the cvs option set. For example, the cvs log option -N (turn off display of tag names) … | |
Re: I used to teach relational algebra and calculus, but this was before Tutorial D came along (mid 1980's). What system are you using, D4? | |
Re: You make an effort to solve your class problems, and then we will consider helping you through some of the rough spots. Don't expect us to do your work for you. It isn't fair to you (you learn nothing), and it isn't fair to the others in the class who … | |
Re: What version of RHEL are you running? 4, 5, 6? In any case, the process is this. 1. Login as root 2. cd to /etc/yum.repos.d 3. Remove red hat specific .repo files. 4. Copy CentOS or Scientific Linux repo files to /etc/yum.repos.d 5. You should be done, except to install/update … | |
Re: Also, coding first then writing the specs and other documentation is bass-ackward! Gather requirements, write specifications (use-cases), design the system (class model, relationship diagrams, pseudo-code, scenarios, state machines, etc), write user document, develop test plan, write code, execute test plan, update documentation for changes made while coding/testing, and track the … | |
Re: Consider this an exercise in parsing, more than anything else. Also, write out the process to use with pseudo code before you start to write any C code. So, here is a brief p-code version of what a shell does [code] const char* progname = 0; while not done read … | |
Re: Monte Carlo methods are used for complex simulations. It is widely used in particle physics for designing experiments. Here is a link to a web site at Oak Ridge National Lab on numeric algorithms and monte carlo methods that may be of help: [url]http://www.phy.ornl.gov/csep/CSEP/BMAP.html[/url] | |
Re: The implementation of printStock() and Sales() differ from their declaration at the top of the file. The declaration for printStock() is [icode]void printStock(int, int)[/icode] whereas the implementation is [icode]void printStock(int[], int)[/icode]. Ditto for Sales(). | |
Re: What OS and compiler are you using? And what command(s) did you use to build your code? Finally, please post the error output you got, as well as the code if possible. | |
Re: There are a number of functions in the atoi() family, some of which can be used for floating point values. These functions are strtof(), strtod(), and strtold(). Don't use atoi() or atof() functions - it is better to use strtol() and strtof() type functions instead as they give you better … | |
Re: Classes are to be preferred if you may want to subtype them and their behavior. Example for your logging functionality. You might a logging class to log to a file, rotating the files when they get to a certain size, and another one to send log messages to a remote … | |
Re: Are you talking about running an OS in a virtual machine? If so, then read this first: [url]http://en.wikipedia.org/wiki/Virtual_machine[/url] | |
Re: Actually, your constructor is very badly written - I give it an 'F'. More properly it should be like this: [code] myclass::myclass(const myclass &obj) : p(new int) { *p = *(obj.p); // copy value cout << "Copy constructor called.\n"; } [/code] Note the instantiation of the pointer member in the … | |
Re: Do you mean Ubuntu 10.10? Also, are you running the 64-bit, or 32-bit version? Post output of the command [B][I]uname -a[/I][/B] here. | |
Re: Have you done a thorough virus/malware/trojan scan of your system? It could be hardware (something as simple as a loose/bad cable), or it may be something more serious. If it is the drive, they aren't very expensive to replace ($30USD about). If you have been pwnd, then you may have … | |
Re: UDP - more efficient TCP - more reliable A number of applications use UDP because of its efficiency, such as (optionally) NFS. Example, One end sends sends 100 packets, each associated with one block of a file. It will sequence them, and include a checksum. These are validated by the … |
The End.