2,898 Posted Topics

Member Avatar for simbamadah

You have two equations: C * 10^2 = 1 C * N^2 = 25 You can solve that for your two unknowns C and N. If you cannot figure out how to solve that, go back to high-school.

Member Avatar for mike_2000_17
0
98
Member Avatar for mike_2000_17

Hi all, I was just playing around with some ideas about optimizing a core piece of my library: the run-time type identification system (RTTI). What does that have to do with compile-time string concatenation? Well, the whole point of the RTTI is to provide information on the type of objects, …

Member Avatar for mike_2000_17
6
13K
Member Avatar for tapananand

> What does the warning integer overflow in expression mean? It means that the operation goes outside of the valid range of the particular type of integer. For example, if you have an integer of type `unsigned char`, then the range is `0..255` which means that doing `2 - 4` …

Member Avatar for vijayan121
0
839
Member Avatar for MasterHacker110

I would say C++ and Python. I guess Java could be an option, and I remember seeing some half-serious Java code in robotics. As for C# in robotics, that must be a joke, right? By far, the most widespread languages for robotics are C, C++ and Python, depending on what …

Member Avatar for MasterHacker110
0
619
Member Avatar for furalise

You can use the tellg and seekg functions to re-establish the cursor (get pointer). As so: std::streampos p = filestream.tellg(); stringstrm << filestream.rdbuf(); filestream.seekg(p);

Member Avatar for furalise
0
5K
Member Avatar for cambalinho

The default constructor is ambiguous with this constructor: property(std::function<void(void)> GetFunction=NULL,std::function<T(void)> SetFunction=NULL) because both can be called without any parameters. You should just remove the default constructor because that constructor with default parameters achieves the same result (setting both functions to null) when called without parameters. The `property<int> Age(&getage,&setage);` line gives …

Member Avatar for cambalinho
0
402
Member Avatar for nathan.pavlovsky

The preOrderHelper function should take a TreeNode pointer, not a Tree pointer. It's probably a simple typo (by you or the author). It should be: void preOrderHelper( TreeNode<NODETYPE> *ptr) const Just like it is for the other helper functions. If you read the errors, they give you a pretty clear …

Member Avatar for nathan.pavlovsky
0
379
Member Avatar for nathan.pavlovsky

> Does this mean that ListNode can access Lists's private members No, it's the other way around. By declaring List as a friend, the ListNode class gives access to its private members to the List class. It's like an invitation, ListNode invites List into its access-space. Just think about it …

Member Avatar for nathan.pavlovsky
0
214
Member Avatar for Jjajangmyeon

The .find() function (in string class) is perfectly fine. I've never heard anybody say that there was anything wrong with it. It's a simple function to find a matching character or string within a string, what could go wrong with that? In general, the only standard functions that one could …

Member Avatar for rubberman
0
342
Member Avatar for Slavi

Are you talking about [Cygwin](https://www.cygwin.com/)? The Unix emulator for windows, which has, like Linux, all the unix commands plus most of the GNU programs (and others) that can be installed via its package manager. Cygwin is one of the first program I install on any Windows machine that I'm gonna …

Member Avatar for Slavi
0
244
Member Avatar for nancy10001

> C++ uses pointers and have memory leaks , where java doesn't have pointers I've been writing C++ code for years, and I don't remember the last time I had a real memory leak problem. The idea that C++ code has memory leak is a complete myth. Beginners might have …

Member Avatar for ~s.o.s~
-1
385
Member Avatar for Vasthor

> is adding m_y, m_m, m_d, considered as cheating? Nothing is considered "cheating", but there are trade-offs. Keeping the year / month / day values within the class will add to the memory used by the objects (instead of just one number for the days since some fixed date in …

Member Avatar for Vasthor
0
147
Member Avatar for nathan.pavlovsky

I tried the actual code, and there are some "real" errors like in the `!=` operator, where you have `!(this == right)` instead of `!(*this == right)`, because `this` is a pointer, so it needs to be dereferenced to get a reference that can be compared with `right`. In the …

Member Avatar for mike_2000_17
0
8K
Member Avatar for Sarkurd

MACROs are a kind of find-and-replace feature with some additional useful benefits. First, they can take parameters which will be replaced inside the MACRO's body. But be warned, they should not be used as substitute for functions, i.e., if you can do it with a function, use a function because …

Member Avatar for Sarkurd
0
177
Member Avatar for Deep Modi

Generally, before being a great reverse engineer you have to be a great engineer. So, I would advise that you start by trying to become a good programmer before you even consider going down this road, which is the wrong road, btw. For any experienced programmer, there is no real …

Member Avatar for Deep Modi
0
272
Member Avatar for mechbas

I think that most false advertising laws do allow for some level of approximation, even if it favors the advertiser. Also, if I had a dime for every time I bought some tech that didn't live up to specs, I would be a rich man. I have quite a bit …

Member Avatar for mechbas
0
235
Member Avatar for Dani

Awww.... sounds painful. I hope it gets better soon, hang in there Dani. Kram. (N.B. "Kram." is swedish for "I wish I could give you a hug." or "I send you a hug.")

Member Avatar for <M/>
0
367
Member Avatar for Sarkurd

From what the guys over at Clang and GCC have said, the constexpr feature is actually one of the hardest features to implement from C++11. I think it's because it actually constitutes (another) compile-time Turing complete language on top of C++.

Member Avatar for Sarkurd
0
1K
Member Avatar for Dani

Just posting this through my phone and it seems to be working quite alright. I find the mobile interface nice and clean but it can be a bit difficult to navigate. Using chrome on Android phone.

Member Avatar for Dani
0
502
Member Avatar for napninjanx

Most game engines that commercial games use are proprietary, meaning that they were developed by a game company who now owns it and licenses it to other companies (or just uses it for its own in-house games). If company A wants to use a game engine developed by company B, …

Member Avatar for AceStryker
0
253
Member Avatar for iamthwee

> Learning occurs by adjusting the weight matrix in a neuron Care to explain how? The logic required to update the weights is generally-speaking exponentially higher in computational cost than the actual neuron firing logic / dynamics, which is quite trivial to compute, even on an ordinary PC. One of …

Member Avatar for mike_2000_17
1
412
Member Avatar for Slavi

The problem is that your new user is not a "sudoer", which means a user that can run commands as super-user. To grant that user the right to run such commands, you have to add it to the "sudo" group. To do this, you must login as a sudoer account …

Member Avatar for Slavi
0
192
Member Avatar for christinetom

The reason for the limited amount of "peeking" is because certain types of streams cannot accomodate more than a single character peeking (and no seeking). But for the streams that can easily support moving back-and-forth (seeking) in the underlying data, there is no reason to use peek() instead of the …

Member Avatar for christinetom
0
2K
Member Avatar for Alxprog

A deduced type traditionally means a template argument type. Like this: template <typename T> void foo(T&& t) { /* .. */ }; int i = 0; foo(i); // type T will be deduced from this call, from the type of 'i' However, with the new standard also comes the keyword …

Member Avatar for mike_2000_17
0
328
Member Avatar for Dani

Whatever happened to just failing those cheaters? If the prof has found out that one of his student took an answer from here or elsewhere, that's plagarism, that's an automatic zero on the assignment / exam. That's how it is here (if not worse). If the prof does not have …

Member Avatar for iConqueror
5
567
Member Avatar for sbesch

> master.cpp includes advanced.cpp and simplified.cpp. I would not recommend doing that. There is really no reason to create a "master" cpp file that includes a bunch of other cpp files. You should compile them separately and link them together (either as a static or dynamic library). I generally find …

Member Avatar for mike_2000_17
0
278
Member Avatar for myk45

For help viewers, you should use Qt Assistant help-files, which are the Qt equivalent of Windows help files / menus. The Qt Assistant framework has all the features you are describing, and the help files are easily generated from html pages. With that, it's just a matter of launching it …

Member Avatar for mike_2000_17
0
174
Member Avatar for daniela.valkanova

This isn't really a problem of templates, it's just the problem that you don't have a function named `maximum` that could take 3 values. Your maximum function template can only take a single value (not to mention that that function is not going to work at anything, because it has …

Member Avatar for Sarkurd
0
6K
Member Avatar for Jack_9

The fact that most Python libraries are written either in C or C++ (or Fortran for NumPy / SciPy / ..) should tell you something about the limitations of Python as a system language. Thinking that Python is appropriate as a system programming language is missing the point of Python …

Member Avatar for mike_2000_17
0
264
Member Avatar for Sh4dowz

As an online resource, [this site](http://www.cplusplus.com/doc/tutorial/) is pretty much unbeatable.

Member Avatar for mudasar44
0
381
Member Avatar for rela

This code looks very odd. I've been trying to figure out what language it is, but I can't. It has the hallmarks of a Pascal-style language, i.e., the `:=` assigments and the `for r:= 1 to p do` syntax, which are both definitely Pascal. However, the use of `{ }` …

Member Avatar for rubberman
0
800
Member Avatar for Jjajangmyeon

The safer way to input an integer from cin is to use the following: if(!(cin >> choice)) cin.clear(); cin.ignore(); What it does is this. If the input operation failed (e.g., you did not enter a valid integer value), then it will put the stream in a failed state, which is …

Member Avatar for Jjajangmyeon
0
175
Member Avatar for furalise
Member Avatar for mike_2000_17
0
103
Member Avatar for Yogesh_9

Just so you know, the proper C++ version of that (mostly C-style) code is this: #include<iostream> using namespace std; int main(void) { int p = 0; cin >> p; cout << p << endl; return 0; } That readInt function just reads an integer for the standard input stream, and …

Member Avatar for mike_2000_17
0
193
Member Avatar for Dani

Great job Dani! Staying on top of your game! I remember when I became a moderator. I think it was right in the thick of it, and I remember that the listing of "unresolved reported posts" (for non-mods: this is where "flag as bad post" reports go) was usually full …

Member Avatar for happygeek
4
211
Member Avatar for Sarkurd

Well, the `size_type` of any container (or `std::string`) is just the preferred type for indices and sizes related to that container. It is usually fine to use another integer type, such as `int`. There are a few dangers associated with not using `size_type` but they are very unlikely to happen …

Member Avatar for Sarkurd
0
762
Member Avatar for cambalinho

Why do you need to put it in the header? Ok, let's just assume this example: // my_foo.hpp: #ifndef MY_FOO_HEADER #define MY_FOO_HEADER void foo_impl(); // <-- this is the function you want to "hide" class bar { public: void foo(); // <-- this is the function that uses the foo_impl …

Member Avatar for mike_2000_17
0
340
Member Avatar for iamthwee

The process is that once you create a tutorial draft, it will be in this anti-chamber where you can edit it, save, edit, save, etc.. until you are happy with it. At that point, you should send a PM to one of the editorial members (happygeek, Dani, ..?) to get …

Member Avatar for mike_2000_17
0
201
Member Avatar for nathan.pavlovsky

I would also add that it really doesn't matter that much. If you have to support older compilers, then you don't have a choice, of course, since `std::array` is only for C++11. Otherwise, you can use whichever you like, but unless you make only trivial use of the array, you …

Member Avatar for mike_2000_17
0
1K
Member Avatar for iConqueror

> What is the difference betwen high level languages and low level languages? Here is a bash script to answer your question: #!/bin/bash echo "high level languages" | sed -e 's/\ /\n/g' > hl.txt echo "low level languages" | sed -e 's/\ /\n/g' > ll.txt diff hl.txt ll.txt rm hl.txt …

Member Avatar for iConqueror
0
449
Member Avatar for glen.persson

Hi Glen, and welcome to Daniweb! I'm also from Canada (Quebec). And we have the same last name (Persson), I presume you have some Swedish ancestry too? My father is Swedish.

Member Avatar for Hiroshe
0
194
Member Avatar for iConqueror

Problem solving skills is a combination of many things, and that's why it's difficult to pin down as one particular thing you need to learn. There is definitely an analytical aspect to problem solving, which is sort of what Hiroshe is hinting at. This is the ability to extract, from …

Member Avatar for jwenting
0
224
Member Avatar for zhoudavid

These code-completion or introspection tools that most IDEs have are essentially implementing the first half of a complete compiler (which we would call the "front-end" of the compiler). Think about it, a compiler needs to look at all your code and understand every piece of it, i.e., what every identifier …

Member Avatar for mike_2000_17
0
262
Member Avatar for iConqueror

> 1. Is there any advantage using procedural than oo? Advantages of procedural programming mostly boil down to *simplicity*. For one, a typical procedural program is just a straight-forward sequence of function calls and statements, which, if done well, are very clear and with no hidden behaviors like constructors, stateful …

Member Avatar for Hiroshe
0
305
Member Avatar for iConqueror

1. When I was about 14, I think. Started in Visual Basic, but quickly moved on to Delphi, and to C++ a few years later. But used many other languages too along the way (C, Fortran, Python, Java, SQL, html/js/php, Matlab, etc.). 2. C++ because of the endless possibilities from …

Member Avatar for almostbob
0
195
Member Avatar for kamilacbe

It declares a function called `myFunc` which returns an `int` and takes two `int` parameters. This function has to also be a virtual member function of some class, because the `=0` part at the end is the "pure-specifier" which means that the function does not have a definition (implementation) which …

Member Avatar for sepp2k
0
132
Member Avatar for RikTelner

Well, from the world-bank census's, the empirical number today seems to put most "normal" countries (i.e., excluding island states and really large countries like Canada, Russia, etc.) between 0.1 and 0.5 hectares per capita, which is about 0.001 to 0.005 km2 or 1 to 5 thousand square meters. So, that's …

Member Avatar for jwenting
0
246
Member Avatar for RikTelner

If you are talking about internet ports, then you can just refer to the first sentence of the [wiki page](http://en.wikipedia.org/wiki/Port_(computer_networking)): "In computer networking, a port is an application-specific or process-specific **software construct**". The important words are in bold. Internet ports are purely a matter of software, not hardware. Modems, network …

Member Avatar for mike_2000_17
0
187
Member Avatar for myk45

Planes are represented in the [general linear form](http://en.wikipedia.org/wiki/Plane_(geometry)#Point-normal_form_and_general_form_of_the_equation_of_a_plane). This form can be understood as a normal vector `n = (a,b,c)` and a distance `d` between the plane and the origin, along the normal vector. So, for any point `(x,y,z)`, you can compute the following: a*x + b*y + c*z + …

Member Avatar for myk45
0
426
Member Avatar for Mr.UNOwen

If you are computing Vs from Vm, and then computing Vm back from Vs, and the two don't match, then it means that your matrix inversions are not correct. Regardless of whether you defined your matrices correctly with regard to getting a correct modelview + projection transformation, the transformation back …

Member Avatar for Jean_4
0
358

The End.