I have a pile of data, which i need to access frequently and fast. One entry consists of two unsigned ints, let`s call them source and destination.
One source can have several destinations, but this rarely ever happens. Several sources can have the same destination - this happens more frequently, but still scarcely.
Once the data is set up, it rarely ever changes - yet it should be possible to add or remove entries.
I now need to find all sources for a given destination, or all destinations for a given source.
The question: which stl container to choose?
I have tried a multimap, using the source as key. This works good for finding all d for a given s, but is inefficient in the other direction.
Do you think it would be more efficient to have two multimaps, sorted respectively by source and destination?
I'm using waveinOpen to capture sound from my microphone. I know how to set how many channels to use, but how do you tell it what channel to use - left or right?
I've read that we can write a program that displays a menu of commands for the user to choose from.We can write some functions that implement these commands, then store pointers to the functions in the array :
We can get a similar effect with a switch statement but using an array of function pointers gives us more flexibility since the elements of the array can be changed as the programm is running.
I decided to write an example about this in order to understand better the context, I am facing some problems though :
Code: TEST2.c:9: warning: initialization from incompatible pointer type TEST2.c:9: warning: initialization from incompatible pointer type TEST2.c:25: error: too few arguments to function "*(arr + (long unsigned int)((long unsigned int)i * 8ul))"
I am doing my assignment that will calculate total tax amount per day and per week and finally sum those up.
One of the requirement is to filter out any number in the array that is less than 1000 to be assigned a value of zero instead of the stored value so as not to add it in the calculation. How to fulfill this requirement.
Dynamic memory allocation in array in c programming. I am trying to make the user to choose the size of array they want to engage in the game.
However, i have remove the global variable which contribute the error to my code previously. Now I assigned all the arr individually but not using the global variable. However, i still not get the desired board i want. i still keep getting 9x9 array board.
And i also need limit the board size only from 4 to 9. And how do i do that.
I am currently having problems creating a loop that will allow my user to choose to return to the beginning of the program or quit.
#include <iostream> using namespace std; int main() { int j; do {float a; cout << "+----Welcome to Basic Operations----+ | Select Your Operation |
[Code] .....
I have not yet finished designing the interface for a couple of the operations, but right now i am hung up on trying to return to the beginning. I believe it is because the j was defined inside do and isn't carried out of the do statement for while.
I'm have a bitmap that's about 4000x2000. But I want to put it all into a picture control. I attempted to use stretchBlt() to shrink it. But it did not work.
Code:
HBITMAP originalImage = CreateDIBitmap(m_picture1.GetDC()->m_hDC, m_bmiHeader, CBM_INIT, (unsigned short *)m_OriginalBits,
Here's what i'm searching for: I have a form with 3 pictureBoxes (pictureBox1,2,3). The form also contains one button.
What I want is that when the user clicks the button (so button_click event) that the 3 pictureBoxes each show a different picture. And when I click the button again again 3 different pictures will load.
I already found out that I need to make an arraylist for the pictures (there are about 100 pictures). A System.Random to select random images. But I have absolutely no clue on how to write this code.
I have a c# form that has two pictureboxes on it. I use two webcams I want the first webcam to allways show it's image in picturebox 1 and the second webcam to allways show it's image in picturebox 2.
How can I write this and stop that annoying popup dialog asking me to select a webcam each time it runs.
My goal is to have couple of items in the listbox and when highlighting one item a image in the picturebox should appear, and so on for each item in the listbox.I just don't know how to change image depending on selected item in the listbox instantly.Also when i highlight item a text in label should be like in highlighted item in listbox.
I am working on a MFC application that I used for Image Analysis. I have a FrameWnd called MillChart that I use to generate an Image. This window is displayed at the run time in the application and not a part of the GUI dialog. It automatically resizes according to the different monitor resolutions and because of this there is a lot of empty space to the right of the MillChart. I was planning to add a picture control in the GUI dialog and redirect whatever is displayed in the MillChart to the Picture Control so that I can place my other elements (checkboxes, scrollbars etc) that I use in my app close to this MillChart and also set the size of the MillChart to a constant size.
Here is the code for positioning the elements (Note: I have only shown the MillChart position)
I create the dialog based application and draw the line inside the picture box. if line is drawn then display the msgbox, if not close the msg box and resize the window then the line is disappear and blank area is shown in picturbox.blem
Ok, this thing works as far as the getting the image and drawing the rectangle but for the life of me I cannot figure out why it is causing an in the program.cs.
public partial class Crop : Form { public Crop(Image BaseImage) { InitializeComponent(); if ((Bitmap)BaseImage != null) { pbOriginal.Image = BaseImage; }
[Code] ....
BaseImage is pulled in from the main form's picture box.
I've been reading about libraries; How to make them, how to use them, the different types of libraries, etc..
When using a shared library, does the program require that library to be installed on the computer after the program has been compiled into an .exe?
Ie.. if somebody downloaded a "Helloworld.exe" that I had compiled on my computer using a shared library (that wasn't part of a standard operating system), would they also need that shared library on their computer for the program to run without errors?
and for Static Libraries, when I compile a program using a static library, does it include in the final binary only the functions of the library that are actually used, or does the compiler add in the entire library?
I am developing an app that shows a pixelated picture in a window. I am trying to capture the image, which is composed of a number of tiles processed from a mother image, but I am having difficulty since I can't reference the image on the screen. I have placed a rectangle around the image and my understanding is that I have get the window handle for the rectangle in order to save the Image as a jpg file. In the literature there is something about a Device Context and a window handle but my compiler throws out HWND and I don't really understand the device context. I am using Windows Forms, not native code.
Let's say I create a small program or just want to open any kind of file on my computer, but I want to run a program that forces the user to enter a password or something (I already know this part). How does one create the code that would open the file?