2,898 Posted Topics

Member Avatar for mrnutty

First part is simple, my name is mike. The second part is an enigma for you guys. 2000 taken to the power 17 is about the total mass of the observable universe measured in grams. No, actually 2000 bitshifted 17 times writes `FA00000` in hex which is cool. I'm kidding, …

Member Avatar for Reverend Jim
0
687
Member Avatar for mixelplik

Here are some "safer" alternatives: 1) use the namespace only within a function body: #include <iostream> int main() { using namespace std; cout << "Blah, blah, blah"; return 0; } This limits the scope of the namespace usage, reducing the scope at which names could clash. 2) use the individual …

Member Avatar for mixelplik
0
280
Member Avatar for Jiggle

Wow, LazyFoo seems to be quite an idiot when it comes to licensing issues. So, he basically says: 1) Closed-source, commercial or not: OK to use his code. 2) Open-source, commercial: OK to use his code (with credits given). 3) Open-source, free: Not ok to use his code. 4) Tutorial …

Member Avatar for Gabriel_2
0
335
Member Avatar for Dani

It's my impression that viruses are not nearly as much of a problem as they used to be. Maybe it's because anti-virus software have "won" the fight. I think it also has to do with the history of it all. In the early days of PCs (win95 - winXP), a …

Member Avatar for mike_2000_17
0
203
Member Avatar for <M/>

You should notice this line: Line 3 Right: The total is 10123607318 That is one **big** number. In fact, it is larger than what you can represent with a 32bit integer type, which is what `int` is in Java (the number is about 10 billion, and the max for an …

Member Avatar for <M/>
0
448
Member Avatar for Jed_1

As I gave you the method to walk along the solution path on the other thread, here is the complete code (also removed some unnecessary junk, it is generally not a good idea to put together random pieces of code, you have to understand what you are doing): #include <iostream> …

Member Avatar for Jed_1
0
845
Member Avatar for Hinata_Dev

What code do you have so far? We don't just do people's homeworks, you have to show that your are trying to solve the problem, and ask about specific problems that you are having with your code.

Member Avatar for Mouche
0
219
Member Avatar for Jed_1

To input all the vertices, you should do it in two steps. First, you input the entire line into a string (using `std::getline`). Then, you put that string into a `std::stringstream` and you input each individual name using `std::getline` with the delimiter as `','` character. Like this: std::string temp_str; std::getline(std::cin, …

Member Avatar for mike_2000_17
0
919
Member Avatar for spawn2004

Knowing how the Dijkstra algorithm operates, I would assume that your "Compare" function relies on a "distance" values associated to the nodes, and that these distance values change during the iterations of the algorithm. As the distance values change, the priority-queue (which is just a "heap") becomes corrupt, or out …

Member Avatar for samer.aboufakher.3
0
430
Member Avatar for cb.home

**Please use English in this forum.** (Du bist glücklich dass ich Deutsch verstehen kann) All seems correct. However, because your KalmanFilter.cpp file is a C++ file, and most other source files (especially Car.c) are C files, it might just be a problem with name-mangling. Your C files expect a C …

Member Avatar for cb.home
0
383
Member Avatar for mike_2000_17

I'm wondering if it is possible at all to disable the CTRL-S action when writing stuff on the editor. This is just because I am a frenetic hitter of the CTRL-S key combination, which comes from years of just writing lots of stuff (code or text) and constantly hitting that …

Member Avatar for mike_2000_17
0
308
Member Avatar for edrianhadinata

Your problem is a linking problem. To use openGL you must not just include the header files, but also link to the OpenGL libraries. If your installation managed to find the OpenGL headers (as it did, since it compiled correctly, just didn't link correctly), then it almost certainly means that …

Member Avatar for edrianhadinata
0
3K
Member Avatar for spawn2004

The typical way to solve the "reset" and "store path" problem for a shortest-path algorithm on a graph is that you do indeed store a "cost" in each node, but you also store a "predecessor" ID in each node. The "predecessor" acts as a back-tracing record of the optimal path. …

Member Avatar for spawn2004
0
170
Member Avatar for mixelplik

The error in your code is that in lines 46 to 50, you redeclare a new set of variables (gross, state, federal...) which are **local to the inside of the while loop**. The while loop condition, however, is outside of that scope, meaning that it is referring to the variables …

Member Avatar for mike_2000_17
0
149
Member Avatar for mmcdonald

> "country of citizenship" was the term I couldn't grasp! I don't know what the legal team will say, but I don't think that the country of citizenship really matters in this case. I think that the country in which the material is produced (where the photo-shoot happens) and where …

Member Avatar for G_Waddell
0
337
Member Avatar for cambalinho

Overloading (of function or operators) is done only with the parameters, not the return type. If you have two function with the same name (or operator), same parameters and a different return type, the compiler is going to say that the call is ambiguous (it cannot choose between the two …

Member Avatar for cambalinho
0
209
Member Avatar for Artyom_1

You made a typo on line 61: glBindBuffer(GL_ARRAY_BUFFER, vertexId); It should be: glBindBuffer(GL_ARRAY_BUFFER, colorId); Also, I think you should be using `GL_TRIANGLE_STRIP` instead of `GL_TRIANGLES`. See [explanation](http://en.wikipedia.org/wiki/Triangle_strip) or [this page](http://www.lighthouse3d.com/tutorials/glsl-core-tutorial/primitive-assembly/). You simply cannot have 8 vertices representing triangles (2 triangles = 6 points, 3 triangles = 9 points). You might …

Member Avatar for Artyom_1
0
598
Member Avatar for Neuman

> Is It possible to work with GUI(Graphical User Interface) in C++? Certainly. It's all pretty much dead on the "Microsoft" side of things (Win32 and MFC are pretty much deprecated now, and all alternatives are .NET, which isn't very C++-friendly). But that does not really matter (who would use …

Member Avatar for kal_crazy
0
486
Member Avatar for osagie.odigie.77

Anyone that is concerned enough about security to commission a pentester would probably not make the blatant mistake of keeping flash players installed on their network's computers. Sounds more like you're trying to write a hack, and it seems you have a long way to go, so I won't be …

Member Avatar for mike_2000_17
-1
225
Member Avatar for Slavi
Member Avatar for KrazyCod3r
Member Avatar for user4678

I would also point out that you don't need to calculate the factorial from scratch at every iteration and the same for the pow(x) calls, you can just calculate them as you go along with the main loop: #define MAX_ITERATIONS 100 double cos(double x) { // Set the total sum …

Member Avatar for Labdabeta
0
634
Member Avatar for Chinney

Just to add a few remarks. The [Visual Studio Express](http://www.visualstudio.com/products/visual-studio-express-vs) edition is free and completely sufficient. You only really need to pay money for development tools if you are running a mid-to-large software company, below that (small company, personal/school projects, open-source projects, etc.) you will find the free tools to …

Member Avatar for Chinney
0
317
Member Avatar for vaishali.k

What have you tried so far? We don't do homeworks for people here. You have to show some efforts and ask about some specific problems that you are having with your own code.

Member Avatar for yazan.quraan.39
0
157
Member Avatar for Dani

Sorry to hear that. My condolences. I remember when my dog died, it had quite an effect on me. Mine was a golden retriever. I think I was about 7 years old when we got him, so I grew up with him. He was very old, and died in his …

Member Avatar for Warrens80
0
243
Member Avatar for Labdabeta

The piece of magic code needed is [glReadPixels()](http://www.opengl.org/sdk/docs/man/xhtml/glReadPixels.xml). Like this: int width=500; int height=500; uint32_t *colours=new uint32_t[width*height]; glBegin(GL_TRIANGLES); //other drawing stuff, preferably no magic here? glEnd(); glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, colours); uint32_t c = *colours; // c should be the top-left pixel rendered by opengl I don't know …

Member Avatar for Labdabeta
0
5K
Member Avatar for Rohan_1

There are a few legitimate uses of goto, but it's not that it should ever be used carelessly. The main legitimate uses I can think of are: the "multi-break" and the "C-style cleaning". The "multi-break" refers to the problem of breaking out of a more than one nested loop at …

Member Avatar for Ancient Dragon
0
204
Member Avatar for chubbyy.putto

Well, you have a few typos in your code, and then, you forgot the end the lines with a semi-colon `;` almost everywhere. With those small corrections, we get: const double NUM = 10; double a[NUM]; double b[NUM]; bool c; for (int d = 0; d < 10; d++) { …

Member Avatar for chubbyy.putto
0
210
Member Avatar for Jamblaster

> First you get a self proclaimed expert who says it is absolutely wrong to ask for other people to write code for you It is absolutely wrong to ask for other people to write code for you. That is stated in the [Rules of Daniweb](http://www.daniweb.com/community/rules): "**Do** provide evidence of …

Member Avatar for diafol
1
376
Member Avatar for jaymista

> If you want to dedicate your website to someone, dedicate it to Mother Teresa, someone who is worthy of it. That's a pretty bad example. [Mother Teresa is far from being praise-worthy](http://www.youtube.com/watch?v=oR9T9oTqsXs).

Member Avatar for mike_2000_17
-1
257
Member Avatar for cambalinho

The problems with your code are not about having template members inside a class, but they are about pretty much everything else. I understand you "get several errors", but I can tell you that you are probably getting far too few errors, because there are many errors your compiler cannot …

Member Avatar for mike_2000_17
0
157
Member Avatar for Tyler_1

I don't agree that "the title says it all". I have no idea what your question is. Programming involves creating and using functions and classes, how could it possibly be not "ok", if you can't create / use functions and classes, you can't do anything. It's like asking "is using …

Member Avatar for Tumlee
0
318
Member Avatar for NathanOliver

The core issue is that the `std::thread` cannot guess whether you want to pass things by reference or by value, and it would not be safe or possible to assume that you want to pass things by reference, it must assume that all parameters are passed by value. The `std::ref()` …

Member Avatar for NathanOliver
0
338
Member Avatar for olabamiji14

I think the OP is talking about plagarism detection software. This is software that can take a given document (text, code, video, etc.) and any other meta-data (title, assignment problem statement, etc.), and then scan the world (i.e., the internet) for any document that is suspiciously similar to it. This …

Member Avatar for mike_2000_17
0
133
Member Avatar for Qutbuddin

As Moschops said, and also there are other extensions that are typical for header files, especially `.hpp` (the `.h` is conventionally reserved for C headers). For the rest, header files are just plain text files, like all other types of C++ source files too (cpp files are also just text …

Member Avatar for mike_2000_17
0
4K
Member Avatar for beastie805

Your functions modify the elements of the array (i.e., swaps them during the sorting). There is no way that you can declare that as `const`, because that implies a promise never to modify the contents, but your functions require that you do so.

Member Avatar for richieking
0
185
Member Avatar for deceptikon

> Can you find a safe way to execute an external program? What about checking a checksum on the executable before executing it? Something like this: int secure_system_call(char* app_name, char* app_md5, char* app_args) { char* test_md5 = compute_md5(app_name); int cmp_result = strcmp(test_md5, app_md5); free(test_md5); if( cmp_result == 0 ) { …

Member Avatar for Assembly Guy
0
305
Member Avatar for Ghayth_1

The problem is that your reverse function takes its parameters by value, causing a (shallow) copy of the stacks: void Stack::Reverc(Stack s,Stack d,Stack c) This is wrong, for a few reasons. First of all, the stack that you seem to be reversing within that function is the `s` stack, but …

Member Avatar for Ghayth_1
0
262
Member Avatar for booicu

I'm not sure that I see the Matrix-style plug-and-play memory system as being that great. I don't think that human memory is really infinite. It compresses and loses over time. What is much more appealing to me, with the same kind of tech described in that video, is the prospect …

Member Avatar for G_Waddell
0
463
Member Avatar for Learner010

The saying I came up with about pointers is this: "Pointers: Beginners hate them; experts hide them." The thing that makes pointers "hard" for some is that they are too simple, ironically. A pointer is nothing more than a number (integer) that uniquely identifies a location in memory (an address). …

Member Avatar for Learner010
0
311
Member Avatar for NardCake

First, you should use `i<101` instead of `i<=100`. Also, your for-loop could be like this `for(int i=0;++i<101;)`. That's two characters saved. However, D allows for range-based for-loops too, so you could write `foreach(i;1..101)`, that is 4 more characters saved. Then, you can, in general, replace almost any sequence of if-statements …

Member Avatar for NardCake
0
622
Member Avatar for maryamalik

> I can do it with a pencil Well, if the "completely filled square" is already done, then the hollow square could be done with an eraser!

Member Avatar for gerard4143
0
128
Member Avatar for Ancient Dragon

There used to be TeX/LaTeX support, which is what you would use to create such equations. Support for it got taken out with the move to the new system. I agreed that it was not the most commonly used feature, but when you need it, it is certainly very nice …

Member Avatar for JorgeM
0
301
Member Avatar for Learningvinit

I quick google search reveals that `counted_ptr` is a pre-historic version of `shared_ptr`. Unless you are using a specific (old) library that requires the use of `counted_ptr`, I must say that you should prefer using the standard `std::shared_ptr` pointer, or it's equivalent in [Boost](http://www.boost.org/) `boost::shared_ptr`.

Member Avatar for Learningvinit
0
525
Member Avatar for cambalinho

If you want to use a fixed selection of types, then you should use [Boost.Variant](http://www.boost.org/doc/libs/1_55_0/doc/html/variant.html) (discriminated union type, similar to that old C-style variant type in windows.h). If you want to use any types, then you should use [Boost.Any](http://www.boost.org/doc/libs/1_55_0/doc/html/any.html), which is a kind of ultimate type-erasure device. And if you …

Member Avatar for cambalinho
0
236
Member Avatar for jackmaverick1

As far as I know, Vim or emacs or nano or any other in-terminal text editor are all implemented just using the [curses.h](http://pubs.opengroup.org/onlinepubs/007908775/xcurses/curses.h.html) library. There are ports of curses for Windows too, and I believe the Windows ports of Vim/emacs are based on that. > I've got unbuffered input, and …

Member Avatar for mike_2000_17
0
263
Member Avatar for <M/>

Ketsuekiame: **K**entucky's **E**tiquette and **T**raditions **S**pecialist **U**nit for **E**migrants of **K**azakhstan with **I**nsufficient **A**merican **M**anner's **E**ducation Here's the next challenge: Abracadabra

Member Avatar for <M/>
0
1K
Member Avatar for prashantsharmazz

"There are only two kinds of languages: the ones people complain about and the ones nobody uses." -- Bjarne Stroustrup

Member Avatar for CodingCabbage
0
242
Member Avatar for daniel1977

I suspect this is not a problem related to Visual C++ but about your code. Please provide the code and the error messages that you get.

Member Avatar for mike_2000_17
0
153
Member Avatar for inspire_all

> Non deterministic methods: present many choice and one must choose the suitable one among others(e.g. Genetic algorithms), in such case we talk about a pseudo-algorithm. We generally call that a probabilistic method, or probabilistic algorithms. This is quite different from the concepts of deterministic / non-deterministic Turing machines. A …

Member Avatar for amina.bm
0
242

The End.