Posts
 
Reputation
Joined
Last Seen
Ranked #503
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
92% Quality Score
Upvotes Received
40
Posts with Upvotes
38
Upvoting Members
37
Downvotes Received
5
Posts with Downvotes
5
Downvoting Members
2
14 Commented Posts
~134.60K People Reached
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
Favorite Tags
c++ x 263
c x 194
c# x 25

257 Posted Topics

Member Avatar for myk45

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 …

Member Avatar for mapsonyllaer
0
273
Member Avatar for myk45

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 …

Member Avatar for iš_iš_iš
0
240
Member Avatar for myk45

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 …

Member Avatar for myk45
0
5K
Member Avatar for myk45

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(); …

Member Avatar for myk45
0
1K
Member Avatar for myk45

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 …

Member Avatar for myk45
0
484
Member Avatar for myk45

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 …

Member Avatar for Banfa
0
454
Member Avatar for myk45

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 …

Member Avatar for L7Sqr
0
152
Member Avatar for myk45

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 …

0
151
Member Avatar for myk45

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 …

Member Avatar for NathanOliver
0
2K
Member Avatar for myk45

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 …

Member Avatar for pritaeas
0
212
Member Avatar for myk45

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 …

Member Avatar for myk45
0
5K
Member Avatar for myk45

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 …

Member Avatar for jwenting
0
269
Member Avatar for myk45

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 …

Member Avatar for naaz.kaushik.3
0
878
Member Avatar for myk45

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 …

Member Avatar for mike_2000_17
0
174
Member Avatar for myk45

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 …

Member Avatar for myk45
0
426
Member Avatar for hassai

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.

Member Avatar for Schol-R-LEA
0
273
Member Avatar for Azmah

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.

Member Avatar for Labdabeta
-1
473
Member Avatar for Navlag

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, …

Member Avatar for myk45
0
273
Member Avatar for Renesme-LuCiFeR

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. …

Member Avatar for Ramesh.YoTLC
0
238
Member Avatar for varun51

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); } …

Member Avatar for Amangpt01
0
2K
Member Avatar for Labdabeta

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 …

Member Avatar for Ketsuekiame
0
271
Member Avatar for dospy

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.

Member Avatar for dospy
0
134
Member Avatar for vasuv

> 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 …

Member Avatar for myk45
0
174
Member Avatar for myk45

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; …

Member Avatar for myk45
0
611
Member Avatar for on93

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.

Member Avatar for Lucaci Andrew
0
128
Member Avatar for myk45

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 …

Member Avatar for jjl.
0
220
Member Avatar for moroccanplaya

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 …

Member Avatar for Dolby779
0
220
Member Avatar for myk45

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 …

Member Avatar for myk45
0
314
Member Avatar for myk45

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 …

Member Avatar for mike_2000_17
0
232
Member Avatar for myk45

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 :(

Member Avatar for Dani
0
79
Member Avatar for myk45

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) …

Member Avatar for myk45
0
740
Member Avatar for myk45

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 …

Member Avatar for myk45
0
192
Member Avatar for myk45

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 …

Member Avatar for myk45
0
183
Member Avatar for nathaniscool99
Member Avatar for deceptikon
0
269
Member Avatar for myk45

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 …

Member Avatar for myk45
0
188
Member Avatar for gman1991

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.

Member Avatar for myk45
0
68
Member Avatar for Tsaou

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)

Member Avatar for Gonbe
0
319
Member Avatar for hexes

> 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 …

Member Avatar for deceptikon
0
236
Member Avatar for الوليد

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 ;)

Member Avatar for Ancient Dragon
0
134
Member Avatar for Enders_Game

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'**

Member Avatar for Enders_Game
0
290
Member Avatar for sabrimev

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?

Member Avatar for myk45
0
105
Member Avatar for mickael.reinman

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 …

Member Avatar for mickael.reinman
0
4K
Member Avatar for Vaspar

> 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?

Member Avatar for Vaspar
0
791
Member Avatar for Redhaze46

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

Member Avatar for mrnutty
1
230
Member Avatar for k-nat
Member Avatar for triumphost
0
173
Member Avatar for myk45

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. …

Member Avatar for myk45
0
138
Member Avatar for glenndr_15

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> …

Member Avatar for glenndr_15
0
353
Member Avatar for deceptikon

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 …

Member Avatar for myk45
0
251
Member Avatar for myk45

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 …

Member Avatar for deceptikon
0
493
Member Avatar for vaishvik.nakhashi

> 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?

Member Avatar for vaishvik.nakhashi
0
2K

The End.