2,898 Posted Topics
Re: > First impression, it seems right to me I beg to differ. > Computer Systems Technology – Networking You should write "Computer Systems Technology and Networking" (without quote marks), the dash is confusing, it looks like a separation between propositions (in the grammatical sense) and breaks the flow of the … | |
Re: It should have come with your compiler. What compiler are you using? If your compiler doesn't find it, maybe the include-paths are not set correctly. Have you done a file-search for "windows.h"? With MinGW, you can download and extract the win32 API headers and libraries from [this page](http://sourceforge.net/projects/mingw/files/MinGW/Base/w32api/). But, normally, … | |
Re: The dynamic allocation is unnecessary (and leaking), you could simply do this: int i = 0; for (i; i < n; i++) { Neutron neutron; initNeutron(&neutron); int steps = 0; do { fprintf(file, "%f\t%f\n", neutron.r[0], neutron.r[1]); ++steps; } while (step_succeeded(&neutron)); fprintf(file,"\n"); step_sum += steps; if (neutron.absorbed) ++absorbed; if (neutron.escaped) ++escaped; … | |
Re: As Jim said, you must see the CPU as an interpreter of machine instructions. It takes in instructions and executes the required actions. In order to have stability over time, it is most practical to have a standard set of instructions that all CPUs (or a class of CPUs) can … | |
Re: > As the titles says I wanna know what are versions of C++ other than Standard C++ and what are the differents between those version if any! The first "version" has to be the ARM (around 1990-1991). This wasn't an official, formal standard document, but the later editions were essentially … | |
Re: There are a few observations that I must make before saying anything else. First of all, your `Control` class is a resource-holding class, and [should be designed as such](http://www.daniweb.com/software-development/cpp/tutorials/373787/beginning-c0x-making-a-raii-class). So far, your class is ill-conceived if it is to be holding a resource (i.e., tied to an active window). You … | |
Re: > I have some idea on the member and would like to get some suggestion to add / optimize the data structure : One thing certainly pops to mind, include a pointer to the next error log. The reason for this is not for a linked-list linking, but that it … | |
Re: Partitioning / sorting algorithms generally require a [*strict* weak ordering](http://en.wikipedia.org/wiki/Strict_weak_ordering). Meaning that it cannot be symmetric in the sense of less-or-equal on one side and greater-or-equal on the other side, as it is in your pseudo-code, because it would mean that there are "equal" elements that could go on either … | |
Re: UNiplexed Information and Computing Service (Unix) Disk Operating System (DOS) Berkeley Software Distribution (BSD) GNU's Not Unix / Linux (GNU/Linux) Free Real-Time Operating System (FreeRTOS) General Motors and North American Aviation Input / Output system (GM-NAA-IO) University of Michigan Executive System (UMES) Dartmouth Time Sharing System (DTSS) Эльбрус-1 Keyboard Entry … | |
Re: Do you have a specific question? Otherwise, here are a few remarks on your code: - You are using pre-standard headers like `<iostream.h>` and `<math.h>`. These shouldn't be used today (as in, not since 15 years ago). You should use `<iostream>` and `<cmath>` (all C++ standard headers don't have the … | |
Re: The problem here is that you cannot separate the definition and declaration of templates (class or functions). You have to understand that template code is not "real" code, it is a set of precise instructions for the compiler about what code to generate once the template argument(s) have been provided. … | |
Re: If you read the [community rules](http://www.daniweb.com/community/rules), you will see the following: - **Do** post in full-sentence English - **Do** use clear and relevant titles for new articles - **Do not** write in all uppercase or use "leet", "txt" or "chatroom" speak - **Do** read the forum description to ensure it … | |
Re: The viewport is the rectangular area on which pixels can be drawn. This is usually defined as a corner offset (position of the lower-left corner, i.e., the origin) and a width and height (watch out: some GUI systems or libraries will use the *upper-left* corner as the origin instead, meaning … | |
Re: Well, there is a typo on this line: vidfeat: libopensift.a videofeatures.cpp $(CCP) $(CFLAGS) $(INCL) videofeatures.cpp -o $(BIN_DIR)/$@ $(LIBS) where it should read as: vidfeat: libopensift.a videofeatures.cpp $(CPP) $(CFLAGS) $(INCL) videofeatures.cpp -o $(BIN_DIR)/$@ $(LIBS) i.e., `$(CPP)`, not `$(CCP)`. | |
Re: What about a filtered iterator? Here is what I mean: template <typename BaseIterator, typename OutputType> struct ActorIteratorImpl { public: // the set of required typedefs: typedef ActorIteratorImpl<BaseIterator,OutputType> self; typedef OutputType* value_type; typedef OutputType* const & reference; typedef typename std::iterator_traits<BaseIterator>::difference_type difference_type; typedef OutputType* const * pointer; typedef input_iterator_tag iterator_category; private: ActorFlag … | |
Re: > Cold in home with a sick bed. Sorry to hear that. Hope you get well soon! @otengkwaku: I agree, Dani and Daniweb both rock! | |
Re: This sounds like a space partitioning tree. I'm guessing it has something to do with collision detection. In any case, as rubberman said, this is far from being a trivial problem in which picking an STL container is not sufficient (you need something much more elaborate than what the STL … | |
Re: If the main problem is that you don't like the interface (unity), then just use a different flavor of Ubuntu. I recommend Kubuntu (12.04 LTS). Mint or Fedora are also good options. | |
Re: I guess it could make sense. I would certainly like that, as I can provide some help in that domain, and am interested in that in general. I don't have the patience to watch the C forum anymore, just on the off chance that an interesting embedded systems question comes … | |
Re: > describe algorithm how can you do so, while ensuring that no STD is passed around? The more appropriate version of the exact same question is this: You have three very dirty surfaces to clean but only two handkerchiefs. Assuming you cannot fold the handkerchiefs, how would you go about … | |
Re: > > 1500+ lines in a few (2) days... > > Either that includes a hell of lot of blank lines, copying and pasting, or there was no testing because that's just daft! First, it certainly doesn't include blank lines or comment lines, nobody includes those in code-line counts. Second, … | |
Re: > However, I'm wondering if this type of response is actually counter productive with regard to the ultimate goal of this site which is to generate revenue. It definitely is counter productive. I don't know much about search engine algorithms but I would certainly imagine that they try very actively … | |
Re: You are already using the function that you are looking for. The function `system()` executes a command. In this case, you are executing the "pause" command. You can use the same function to execute other commands, including your own program. It's as simple as that: system("InputProgram.exe myargument"); There are also … | |
Re: Definitely, I have to say it was an internship some years back. I worked in a lab (at Uni Duisburg-Essen) where they had a roller-coaster seat mounted to the end of a Kuka KR560 industrial robotic manipulator (about 600kg payload capacity), similar to the [robocoaster systems](http://www.robocoaster.com/gallery/g1-robot-systems). My job was to … | |
Re: Is there any reason at all for using a `shared_ptr<node>` for your links? Why not use a `unique_ptr<node>`? Why incur the extra memory payload and overhead. It seems to me that the following would be a bit simpler (and smaller, and faster): #include <map> #include <memory> #include <stack> #include <limits> … | |
Re: The default package manager for the 12.04 version of Ubuntu is called "Software Center". You should be able to find it in the main menu (with all the other apps). In the software center, you can search for anything that you want to install (games, applications, libraries, etc.) and install … | |
Re: Try to install `build-essential` (at least, in Ubuntu repos, I don't know if other debian distros have it too), it will install everything you need. $ sudo apt-get install build-essential Also, if you get the message "unable to locate package ..", then you should try to do a search for … | |
Re: Here are a few facts that you need to know: 1. Floating-point numbers are fixed by IEEE standards and do not differ between platform (except for extremely archaic ones). This means you don't need endianness conversions for `float` or `double`. 2. Endianness conversions (e.g., `htonl` / `ntohl`) work on fixed-size … | |
Re: My native languages are **French** (born in Québec, French-speaking part of Canada) and **Swedish** (from my father, I also spent part of my childhood there). I speak **English** just as if it was my native language too. I'm functional / conversational in **German** because I've lived there for about a … | |
Re: For a very technical answer: > which one should be preferable from the following two nested for loops: The one that results in the most predictable and contiguous memory accessing pattern, to minimize cache misses and maximize pre-fetching. | |
Re: > One, I need a simple way of rendering a GUI with minimal headache. I highly recommend [Qt](http://qt.digia.com/Product/Developer-Tools/). It is in C++ (so, familiar territory for you, and no need to have an elaborate front-end / back-end design), and it is cross-platform (works anywhere, include mobiles). It is pretty much … | |
Re: In C++, every cpp file is compiled separately, and then linked together. When the functions appear in the same cpp file as the `main()` function, then it is compiled together and doesn't need linking. When the functions appear in a different cpp file, then all the compiled cpp files (compiles … | |
Re: Here's a little house, a Sun, and a mid-day drunk: \ | / ( -- O -- ) / | \ ( ) |__|____ / \ /__________\ o | _ | --|-- | |_| || | |\ | || | | |
Re: > the words will be stored in the order they are added to the unordered set unlike a set where they are put in order of thier key value. That's not true. Not at all. The values stored in an unordered_set will appear in whatever order they map to through … | |
Re: > could I do something like this Yes. The mechanism to do this is called "templates". Your function would look like this: template <typename T> T* createEmployee() { return new T(); }; And it would be called as so: Employee* p = createEmployee< Manager >(); For a more complete tutorial … | |
Re: > Can we install .deb format on ubuntu 11.10 or 12.10 using sudo apt-get install??? In Linux, most software is installed through the package manager. This is an application that connects to a bunch of software repositories on the internet that host databases of .deb files (or .rpm in Red … | |
Re: From my teenage years (cerka 5 years): VisualBasic and Delphi. From work experience / thesis-work (cerka 8-10 years): C, C++, Matlab/Simulink, Fortran, LabVIEW, Assembly (reading only), KRC-RSI (Kuka Robot Controller - Remote Sensor Interface language), Bash, and Python. From course-works (which is rather insignificant): Java, MySQL, HTML, and XQuery. | |
![]() | Re: I have a tentalizing scenario for the whole "holding the door" conundrum: double doors. Walk into a restaurant, mall, or building with double doors, whoever gets to walk through the first door held open for them is going to reach the second door before the other. And there comes the … |
Re: Of course, for such a project, you will have to do significant changes to the OS anyways, and in that sense, will end up developing a new derivative or variant of an existing OS. One good option seems to be [MeeGo](http://en.wikipedia.org/wiki/MeeGo) or one of its derivatives. There are a number … | |
Re: To do this properly, you need to do a lot of work, and it will become a full-blown class (with private members, non-trivial constructor / destructor / copy-constructor / copy-assignment operator, etc.). [Here is a good tutorial about this](http://www.daniweb.com/software-development/cpp/tutorials/373787/beginning-c0x-making-a-raii-class). > Objective: students could have taken different number of subjects. Now … | |
Re: This error message means that you are accessing an address of memory that is not reserved for your program. This usually occurs when you read or write at a location pointed to by an invalid pointer or beyond the valid memory that the pointer points to. For example, these are … | |
Re: > I can see methods in stdio.h, iostream, etc in Turbo C++. Please define the term "see". Do you mean that you are opening those header files and looking at their implementation? Do you mean that Turbo C++ has some help menus that list the standard functions? Do you mean … | |
Re: 32-bit binaries cannot be mixed with 64-bit binaries, period. There is no (easy) way to create an application that would link to some 32-bit libraries and some 64-bit libraries at the same time. Basically, if the program is 32-bit, then all its libraries (include shared-objects (.so files)) must also be … | |
Re: > I have been told that in C++ the concept of a string does not exist. A string is just an array of type char. Yes and no. At the fundamental level, a string is just a sequence of characters, and in that sense, an array of characters. This is … | |
Re: I don't think you can ask for anything more than all the resources already listed on cmake's [wiki page](http://www.cmake.org/Wiki/CMake). | |
Re: Have you defined a copy-constructor? One that performs a deep-copy? You need to obey the [rule of three](http://en.wikipedia.org/wiki/Rule_of_three_(C%2B%2B_programming)) when you write a class that holds a resource. You can also read [this tutorial](http://www.daniweb.com/software-development/cpp/tutorials/373787/beginning-c0x-making-a-raii-class). The double-destruction comes from the fact the your object must be getting copied, and when copied, it … | |
Re: That's a nice question. Code readability is really important. Here are a few tips: 1) Leave the explanation of *what* a function does *outside* the function, and the comments about *how* it is done *inside* the function, near the code that does it. 2) Use meaningful and complete names for … | |
Re: This looks like a classic case of [heap fragmentation](http://en.wikipedia.org/wiki/Fragmentation_(computing)). This is a rather classic problem which will cause the memory consumption to grow larger and larger even when the memory that you actually use is not increasing (no leaks). Normally, this will stabilize to a fixed amount of memory consumption … | |
Re: > what is the best way to pass these variables as a group while using classes? By make the function a member function of the class. In the case of a function like: void view(Shoes *Shoe); The easiest way to do this in object-oriented code, is just as so: class … |
The End.