- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 40
- Posts with Upvotes
- 38
- Upvoting Members
- 37
- Downvotes Received
- 5
- Posts with Downvotes
- 5
- Downvoting Members
- 2
- Interests
- Programming, Football, Music, Physics, Maths, Philosophy, Movies
- PC Specs
- Intel i5-2300 @2.80 GHz4 Gig RAM500 Gig HDDNvidia GT 430 Linux Ubuntu 11.04Windows XP
257 Posted Topics
Hi all, I am developing a Qt Gui application. Here I have a Qtreeewidget that has a list of Qtreeewidgetitems. I also have a qtablewidget beside it which displays some information when any item present in the list is clicked/selected.When the content of any of the cell in the tablewidget … | |
Hi All, I am trying some experiments with pthread scheduling policies. I have a couple of apps and within all these apps, I set the thread policy to SCHED_RR and I set the priority to MAX - 1. Now, I see that the CPU utilization as reported by top for … | |
Hi All, I saw some code where a `sem_init` was called with a value of 0. I didn't quite understand what this meant. I understand that semaphores can be used to protect shared data, in that we allow just one thread to access the data. And, the way to do … | |
Hi All, I'm trying to use bools to sync between two threads. I cant' use C++11 and I thought mutexes would be slightly heavy for this. So, I do something like this: // ================================== // Thread A .. do some stuff .. // wait for signal. while (!signalFromThreadB) { pthread_yield(); … | |
Hi all I have a qt application in which I have a QTreewidget that displays some content in the QTextBrowser. I set the contents for the html document in the textbrowser using the setHtml() function. All I want now is to fetch the url of this html document so that … | |
I have a horizontal layout inside which i have added a group box. The group box is split using a QSplitter and contain a QListWidget and a QTextBrowser. I want to add two push buttons at the bottom right corner of the window to navigate inside the QTextBrowser. I'm adding … | |
Hi all, I have a problem where i need to find to what library my code links to. Here is the scenario: a) I have two executables. Both link to pthread. But pthread seems to behave differently. b) I am not sure that they are linking to the same version … | |
Hi All, I run gdb server on a remote linux target and debug with the client. Are there some gui front-ends that might come in handy? I use gdb with --tui, but still sometimes find difficulty in "watch"ing variables. Is there some way i can perhaps use a gui based … | |
Hi All, I´m using a QTextBrowser to display an external html document (and its image resources) which is placed in the same directory as the application. Everything works fine except that images are not displayed properly. Instead of the actual picture there is a "missing image" icon. I tried different … | |
Hello All, I want to convert a markdown file to its equivalent HTML programatically and Iam looking for a way to do this properly. I would need a script that converts the markdown file into proper html.I'am aware of Doxygen which generates these .md files to hmtl just with a … | |
Hi All, 1)It's easy to create a window in QT that the user can resize, but when they make the window bigger, all the contents stay where they were in the top left hand corner. They don't grow with the window. 2)Also when the window is launched the size of … | |
Hi all, I have an xml file with some information inside it. I want to load this xml during runtime and generate an equivalent HTML document for this xml file. All this needs to be done programatically and on the fly during runtime. How could i do this? I'm using … | |
Hello. Well, im a little confused as to what exactly the terms Data Abstraction and Data Encapsulation mean: This is what i read: [B]Data Abstraction[/B]:data abstraction is a process of representing the essential features without including implementation details. [B]Data Encapsulation:[/B]: Data encapsulation, also known as data hiding, is the mechanism … | |
Hi, I have a Qt based tool and I want to add a QtWidget(button) in the gui which will act as a help button for my tool just like the windows help button for any application. The help button when pressed should display some text information in the form of … | |
Hello All, Well this is not exactly a C++ question. More of a math one. But I've seen many guys work on GameDev in this forum. So, posting it here. Here it goes: I was reading an article to check if a point in view frustum and i read some … | |
Re: You could try an algorithm as follows: Create a new list that has your sorted list. input_list -> initially has unsorted lines. while ( !input_list.empty() ) { search smallest element, add this to a new list. // this is a O(n) operation. delete this entry from input_list. } HTH. | |
Re: Personally, i feel there are no substitutes for books. A good book can never be replaced by any tutorials online. Well this is my opinion. | |
Re: Hi, What you need is an [idle callback](http://www.opengl.org/resources/libraries/glut/spec3/node63.html). inside the idle callback, you basically draw the frame again. This lets you decide the contents of the frame. The idea is like this: void idleFunc() { // You could add some code here, based on which you can change rotation angle, … | |
Re: Hello! >>If Someone Can Help Please Explain A Bit More About The Loops Take a good book and read. I'm not trying to be rude, but you can learn something only when you try to. Install a good compiler, or use an online compiler and try to start simple examples. … | |
Re: Here is another version: You could also pass the array to the function instead of making it global. [CODE] char arr[100] = "madam"; int reverse(int start, int last) { if (arr[start] != arr[last]) return 0; if (start >= last) return 1; else return reverse(start + 1, last - 1); } … | |
Re: My first guess would be that your generated mesh might be going out of your view frustum. It would be best to go incrementally. Using an ortho projection is simpler. So, i would suggest the following: 1) Get the mesh to render in ortho, without any transforms(or minimal), just to … | |
Re: Maybe [this](http://stackoverflow.com/questions/12113400/compiling-qt-4-8-x-for-visual-studio-2012) works: I have got the setup working on MSVC 2005, but never tried with 2012. So, i hope the above link helps. | |
Re: > I am planning to design mibile app using c,c++ if possible.can any one please suggest me how to design it if possible. Mobile app for which platform?(Android or iOS)? For Android, there is support for using C/C++ via the NDK. There are several tutorials on it. I had tried … | |
Hello All, i have a small question regarding casts in C++. 1) Now, dynamic_casts ensure safety with casts. ie. for example: for the below polymorphic class: class Base { public: virtual void foo() {} }; class Derived : public Base { }; int main() { Base *bPtr = new Base; … | |
Re: The "head" is not null. So, the check in line 76 fails. call `L.linklist_1();` You are setting the head as null there. PS: you can the above in the constructor. Also, next time, mention what problem you face. This time it is a runtime exception due to illegal memory access. | |
Hello All, I am reading the Effective C++ book by Scott Meyers. Regarding new, he mentions the following: > this additional bookkeeping data can more than double the amount > of memory needed for each dynamically allocated object (especially if the class contains no virtual functions). This is in reference … | |
Re: Okay, so you basically need to read filenames from the command line, then copy those contents into an archive file. Here is a small piece of code that might help: [CODE]int main(int argc, char *argv[]) { FILE *file_archive, *fp; /* let "archive" be the archive file */ if ( (file_archive … | |
Hi all, I am reading about non-copyable objects from this source: [Link](http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Non-copyable_Mixin) I am not able to understand how making the "=" operator for the base class as private is preventing the derived class to make copies. We could just have a public "operator =" in the derived class that … | |
Hello All, I was doing some multi-threaded programming using the new C++11. This thought came across my mind: Is there any problem if some shared data is accessed by multiple cores on a CPU? Even if it is just a read. Does this lead to some problem? Could anyone please … | |
http://www.technologyreview.com/news/406923/the-problem-with-programming/ A very good article. I myself am guilty of sometimes "just getting the work done" in a hurry :( | |
Hello All, I was experimenting with creating a large number of threads and checking how fast it runs on my machine.(details provided later) This is the code i'm using: #include <iostream> #include <thread> #include <ctime> #define THREADED 1 static const int num_threads = 100; static int mult_array[100][1000000]; void multResult(int *arr) … | |
Hello All, i am trying to tidy-up some code and i'm not completely sure how this can be done. What i have is this: (This is some sort of psuedocode that i just wrote to explain the problem, not proper code) void foo1(typeofList1 list1) { for (i = 0; i … | |
Hello All, I needed some clarifications w.r.t making functions thread safe. Now, i understand that irregularities can occur in results when not making functions thread safe. But could this somehow lead to a crash? (say some illegal access of memory) Could anyone please give an example of this(something that you … | |
Re: You could write a get method(a public interface method) to obtain the private member perhaps? | |
Hello All, I have a small doubt w.r.t using mutex locks. Say we have a thread-safe function: int counter; void foo() { LOCK_MUTEX(); // say by pthread_mutex_lock ++counter; UNLOCK_MUTEX(); } Now, i understand that this is thread safe because only one thread can "own" a mutex at a time and … | |
Re: Yes, you can do it using [Command Line Arguments](http://www.cprogramming.com/tutorial/lesson14.html) Syntax would be like: your_executable <arg1> <arg2> ... for eg: ls -l here, ls is the program. "-l" is the argument to it. | |
Re: You cannot have an else if() after an else. it needs to be something like: if (condition1) { // code } else if (condition2) { // code } else { // code } You can read a little more on this here:[if else if](http://www.cprogramming.com/tutorial/lesson2.html) | |
Re: > So I am very much confused. I simply want to figure it out now so I will not be stuck on such a newbie problem in the future. What exactly is the confusion? If you are able to extract lines, use strcmp() to compare strings. Is this what you … | |
Re: Hi, We can only help when you have already tried to do something. There are a lot of books on this subject, and online material as well. In case you have problems with that, we can help. No spoonfeeding here ;) | |
Re: i doubt if this is valid: `__asm__("number dw 0");` I just tried compiling this and got this error: I don't know much of assembly language myself, maybe you could post in the Assembly Language forum. **Error: no such instruction: 'number dw 0'** | |
Re: Could you explain on what basis these need to be separated? i mean from your example, i didn't understand how you need to separate the word. is it based on an indices? | |
Re: Adding to what Ancient Dragon has already mentioned, in case you need to use fscanf(), you would have to match the entire line. So, for eg: Say the text file has: rows: 5 this would be matched by `fscanf(<file>, "%s: %d", <var1>, <var2>);` @Ancient Dragon: Wouldn't this above approach work … | |
Re: > can you give me a lil guidence about OpenGL modelview stack?? What guidance do you need w.r.t that? Also, it would be much better if you post the entire code here. Also, regarding the code you have posted, have you done a: `glMatrixMode(GL_MODELVIEW);` before it? | |
Re: For a start, try reading about Lexers, Parsers. Lex and Yacc by John R Levine. Also, since you are planning on building a compiler too, try reading this book: Compiler Design by Aho, Ullman, Sethi | |
Re: Draw what? Please be more specific when you ask questions. | |
Hello All! i just created an executable in Windows(xp) and opened it up on Notepad++ and saw some strange comments: > Stack memory around _alloca was corrupted > A local variable was used before it was initialized > cast to a smaller data type has caused a loss of data. … | |
Re: An IDE generally consists of an editor, compiler, debugging tools, etc. You seem to need just the editor part. What you can do is, use a GUI famework for making the editor. Then, invoke the compiler(In case of VC++, i think it is cl.exe). So, invoke it as <compiler> <options> … | |
Re: Hi deceptikon, Awesome idea! I actually created a new Github account just for this(and maybe more in future). I hope this will be more fun for everyone :) I have checked in a VS2010 project into it. 1) For those who haven't used Git before, i plan on writing a … | |
Hi All! This article is mainly focused at someone who is completely new to Software versioning. In this article, we see how Git can be used as a tool for versioning software. Please note that this is very brief. There are many videos/articles that deal in detail. 1) **What is … | |
Re: > Mouse events in opengl Should've been "mouse events in GLUT". OpenGL does not deal with Window management. Anyway, coming back to your question, the logic seems to be fine. What exactly is the problem? |
The End.