I've been trying to use QT4 with a QTableWidget to store data. I seem to be unable to select a cell and get the text out of it and wanted to see why it won't retrieve it.
ui->QTableWidget->item(ui->QTableWidget->rowCount(),0)->setText("");
...
Background:
I am writing a GLFW app on MacOSX. When I call glfwCreateWindow, the MacBundle stuff is called. Right now, in my program execution, I ahve the following:
// getcwd() = /Users/me/code
glfwCreateWindow(...); // some MacBundle stuff happens
// getcwd() = /Users/me/code/prog.app/Contents/Resources
I would like to control this...
Hello. I have this structure of classes.
class Interface{
...
}
class Foo : public Interface{
...
}
template <class T>
class Container{
...
}
And I have this constructor of some other class Bar.
Bar(const Container<Interface> & bar){
...
}
When I call the constructor this way I get "no matching function" error.
Container<Foo> c...
Using VC8, I create two modules similar to the following:
Header
class IFoo
{
virtual void Bar() = 0;
};
Module A
extern IFoo& Foo;
void DoStuff()
{
Foo.Bar();
}
Module B
IFoo& Foo = ConcreteFoo();
VC8 handles this by essentially treating 'Foo' as a pointer to an IFoo. Wherever it sees Foo.Bar() (even in module B), it...
Hi,
I am trying to use g++ to compile a .cc file, and I need it to link a .o file.
So I tried:
$g++ -o client -I../ipc -L../messages.o client.cc
/usr/bin/ld: error: ../messages.o: can not read directory: Not a directory
And I have tried:
$g++ -o client -I../ipc -l../messages.o client.cc
/usr/bin/ld: error: cannot find -l../messages...
I mistakenly took the address of the reference returned by the back() operator in an empty container and was surprised to see that the address wasn't zero.
If a container e.g. std::deque is empty, what does back() return?
...
Where can you download the HipHop Code? I would really like to test it.
Interestingly enough if you go here:
http://github.com/facebook/hiphop-php/wikis
It must not exist or private because it redirects to github.com index.php page
So you can not even see the wiki or anything
...
Hello!
I'm trying to install Code::Blocks from source. There is an `anarchy' folder on my university's CS department's mainframe, where anyone can install anything, basically.
wxwidgets is a dependency of Code::Blocks, and I'm trying to put wxGTK, as it's called, into my own folder on `anarchy', which works fine.
I then compile Code::...
Hi,
I am running some calculations in an external machine and at the end I get X, Y pairs. I want to apply linear regression and obtain A, B, and R2. In this machine I can not install anything (it runs Linux) and has basic stuff installed on it, python, bash (of course), etc.
I wonder what would be the best approach to use a script(pyt...
I'm just beginning to get into C++ and I want to pick up some good habits. If I have just allocated an array of type int with the new operator, how can I initialise them all to 0 without looping through them all myself? Should I just use memset? Is there a C++ way to do it?
...
My company's main product is a large monolithic C++ application, used for scientific data processing and visualisation. Its codebase goes back maybe 12 or 13 years, and while we have put work into upgrading and maintaining it (use of STL and Boost - when I joined most containers were custom, for example - fully upgraded to Unicode and t...
c++
#define BUF_LEN 1024
the below code only receives one byte when its called then immediately moves on.
output = new char[BUF_LEN];
bytes_recv = recv(cli, output, BUF_LEN, 0);
output[bytes_recv] = '\0';
Any idea how to make it receive more bytes?
EDIT: the client connecting is Telnet.
...
Hi,
I am using Xcode in order to debug C++ programs. The main problem for me is that it takes around 10 munutes till the program gets to the point of the program that I need to debug. Then I realize about something inspecting the variables and some other stuff, and modify the code. Then 15 minutes again and so ...
I wonder if there is ...
I have been using this code to display IMAP4 messages:
void DisplayMessageL( const TMsvId &aId )
{
// 1. construct the client MTM
TMsvEntry indexEntry;
TMsvId serviceId;
User::LeaveIfError( iMsvSession->GetEntry(aId, serviceId, indexEntry));
CBaseMtm* mtm = iClientReg->NewMtmL(indexEntry....
I got an interview for a DB2 C++ developer internship at IBM. I have the option of doing it over the phone or in person. Which would you recommend? Is it appropriate to say in my reply email "What will be the nature of the interview so I can best prepare for it?" so I can found out just how technical and code-based it will be.
But in ge...
I installed a global hook using win32 but I need to communicate with my main application. How should I do this? I guess the dll can have a function where I set my apps HWND and then the hook can sendmessage it? or should I search the window titles to find my application from the hook and sendmessage that way? What's the best strategy and...
Using a WSDL that requires a SOAP HEADER for Authentication (fragment below) code that gets generated when creating a web service client via the "WSDL Importer" has no concept of the Authentication Headers and there are no examples in BCB6 C++ Examples/WebServices directories that show how, and nothing on Web that I can find.
Anyone wit...
Hi,
In C++, if I have a socket, how can I create an ostream object from it?
I have googled some example:
http://members.aon.at/hstraub/linux/socket++/docu/socket++_10.html
And i have tried:
sockbuf sb(sockfd);
std::ostream outputStream(&sb);
But I can't find the .h file and the library to link with for 'sockbuf'. Is that part of a ...
My primary area is HW/Software interaction & Robotics, but we're running into situations where having a few database tables would be handy. I've got almost no knowledge on DBs.
What is a good primer on Database programming that would quickly get me up to speed on create/add entries/delete entries/query. Prefer either a basic Flat-file...
From my example program, it looks like it does call the destructors in both the cases. At what point does it call the destructors for global and class-static variables since they should be allocated in the data section of the program stack?
...