So, I have created a text file containing the following: 10001 General Electronics 500 20001 fACEBOOK 700 10002 Twitter 400 The records are stored in a struct containing an integer id, string company and integer number of shares variables. I want the user to enter a Id, say 20001, and the output should display the details of only that particular user and not of anyone else. Also, I want to change number of shares of user 20001 from 700 to 600.

Member Avatar
+0 forum 0

Hi I am trying to get windows positioned in specific order as show below ![desired.PNG](/attachments/large/3/6447240b1491d04046fa904f31659f9b.PNG) but I am unable to get and get always this ![wrong.PNG](/attachments/large/3/71f4b92c4f40a6afeeab7e3c2f136526.PNG) the code below is shown HDWP cmdWnds; cmdWnds = BeginDeferWindowPos(col.size()); for (int i = 0; i < col.size(); i++) { if (i == 0) { if (DeferWindowPos(cmdWnds, col[i], HWND_NOTOPMOST, x_pos_start_pr + i * x_offset_pr, y_pos_start_pr + i * y_offset_pr, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW) == NULL) return ERROR; } else { if (DeferWindowPos(cmdWnds, col[i], col[i - 1], x_pos_start_pr + i * x_offset_pr, y_pos_start_pr + i * y_offset_pr, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW) == NULL) …

Member Avatar
+0 forum 0

# An orders class def __init__(self, order): # Initialise self.ID = order.order_id self.kits = [] kit = {} for x in order.kits: # Add kit kit['Type'] = x.kit_type kit['Objects'] = x.objects self.kits.append(kit)

Member Avatar
+0 forum 0

I am trying to create a header file that contains several global variables. At the moment, the Globals header file looks like this: This is Globals.h #ifndef GLOBALS_INCLUDED #define GLOBALS_INCLUDED #include <string> std::string DRIVE="HELLO!!!!!"; #endif To go along with this, I have a cpp and h file the contain a single function, as follows: This is Bull.h ifndef BULL_H #define BULL_H #include "Globals.h" #include <iostream> int po(int x); #endif and This is Bull.cpp #include "bull.h" int po(int x) { extern std::string DRIVE; std::cout << DRIVE << "\nBULL\n"; DRIVE="BULL\n"; return 1; } Finally, the main execution program, main.cpp: #include <iostream> #include …

Member Avatar
+0 forum 0

((a+b)-(c+d))^2

Member Avatar
-1 forum 0

``

Member Avatar
+0 forum 0

/* #include<iostream> #include <iomanip> using namespace std; int main() { int r=12,i,j,k; cout<<setfill(' ')<<setw(18); for(i=1;i<=r;i++) { j=r-0; if(i==12) { cout<<j; } } for(i=1;i<=r;i++) { j=r-11; k=r-1; if(i==1) { cout<<endl<<endl<<setfill(' ')<<setw(10); cout<<k; } if(i==2) { cout<<setfill(' ')<<setw(15); cout<<j; } } for(i=1;i<=r;i++) { j=r-10; k=r-2; if(i==3) { cout<<endl<<endl<<endl<<setfill(' ')<<setw(6); cout<<k; } if(i==4) { cout<<setfill(' ')<<setw(24); cout<<j; } } for(i=1;i<=r;i++) { j=r-9; k=r-3; if(i==5) { cout<<endl<<endl<<endl<<setfill(' ')<<setw(4); cout<<k<<"."; } if(i==6) { cout<<setfill(' ')<<setw(26); cout<<j; } } for(i=1;i<=r;i++) { j=r-8; k=r-4; if(i==7) { cout<<endl<<endl<<endl<<setfill(' ')<<setw(5); cout<<k; } if(i==8) { cout<<setfill(' ')<<setw(23); cout<<"#"<<j; } } for(i=1;i<=r;i++) { j=r-7; k=r-5; if(i==9) { cout<<endl<<endl<<endl<<setfill(' ')<<setw(9); cout<<k; } …

Member Avatar
+0 forum 0

I already have a save function in my tool as like a normal tools. Now I would like to add auto save function , that has to save all the operation that made in the tool(we called that overlays). I need to write an auotsave function and I have to pass as command line arguments. Could some one will help you out. More detail: When I right to open my tool in Linux, mostly we used to pass like cd home/...../ and ToolName. I need to use the autosave function as command line arguments. for eg: I pass the argument …

Member Avatar
+0 forum 0

Amazon is Hiring! A job at Amazon is unlike any other you have had. You will be inspired, you will be challenged, and you will impact the future of the technology. This is for some very unique technical projects for Amazon technical development teams (eCSG & Retail systems) in Canada (Vancouver), Berlin and London. We will be hosting a private hiring event in Zurich (Switzerland) starting from 10th to 12th of April 2017 (You will only need to attend a 1 day session) If you’re interested in being considered for this opportunity, please reply with your updated resume to hasenali@amazon.com. …

Member Avatar
+0 forum 0

Hi All, In below code i am getting ouput of process (based on name) memory and cpu utilization % using command "ps -C gnome-terminal -o %cpu,%mem | tail -n +2" .Here gnome-terminal is name of process for that i am printing these values. Now i want to implement the same by reading all the process name dynamically and passing to input to my function GetStdoutFromCommand instead of hardcoding in command. Can somebody throw some light on this , how to achieve the same by referring below code. so basicallly in my command instead of giving hardcoded process name [i.e. gnome-terminal] …

Member Avatar
+0 forum 0

Currently writing a program for an OOP course on encapsulation. The program is required to instantiate **only one object in main**, but then instantiate multiple objects, within the first object, to perform calculations on arrays (`Values`)held within each object. I have been taught that I should ensure that objects are responsible for performing calculations on their own data. But.. I am currently using an approach of overloading the subscript operator, in order to perform the `add()` function and assign the result equal to `obj1` of class `foo`. My question is: As `obj1` is a member of class `foo` and the …

Member Avatar
+1 forum 0

Hi, I am writing a library that does some heavy computation, and so I have been trying to speed things up with some low level parallelism. My machine runs Ubuntu 16.04, and is an old i7, but has four virtual cores. I tried to use openMP, and while it runs error free, and appears to be creating the threads, I don't ever see any speedup. I cut my code down drastically, to this test code: #include "timer.h" #include <iostream> #include <math.h> void testPlusEQ(double* summand1,double* summand2,unsigned int size_) {// omp simd for (unsigned int i=0;i<size_;i++) { summand1[i] += summand2[i]; } //sqrt(summand1[i]/summand2[i]); …

Member Avatar
+0 forum 0

Hello there ! I wrote a dll( using MINGW and Codeblocks ) that should do the "background work" of my app. I have an interface build in Microsoft Visual C++ 2015. Is posible to control some TextBoxes, or Buttons( enable/disable ) or ProgressBars, or opening a new Form from the DLL ? Any code snippet would be really apreciated.

Member Avatar
+0 forum 0

Hi guys, want to convert PYTHON to C and RUBY anyone can help me with this? I have tried to find some online services, but can't find.. if someone can recommend free service, i'll be happy. I want to convert this simple code to C, RUBY,NODE JS http://hastebin.com/kibaraganu.pl Someone can help me?

Member Avatar
-1 forum 0

I'm trying to store some information in a binary file. However, i met with a problem that i can't rectify. For example, if the first order comes in, there is a struct of information that includes orderNo 1, which will be stored into the binary file. When there's a second order comes in, the information will be stored along with orderNo 2 into the binary file. Firstly, i'll create a binary file. afile.open(fileName, ios::out | ios::app | ios::binary); Next, I have a while loop that inputs whatever information placeOrder(fstream& afile, const char fileName[]) { while(condition = true) { .... //whatever …

Member Avatar
+0 forum 0

i know save the Image on IStream. but what isn't saved like the original: the backcolor goes to black instead stays white. i belive that the problem is the transparent color, because isn't saved on IStream. i had tryied use the ColorPalette(Image.GetPalette() and Image.SetPalette(), but the ColorPalette.Count it's zero), but i get an error: '2 - Invalid Parameter'. can anyone advice me for save the gif frames correctly on IStream or just change the transparent color to false?

Member Avatar
+0 forum 0

Hello guys, I found this C# article in daniweb forum and now I want rewrite the class described on the below link in C++ using WinSock64 lib but I'm newer in C++ programming and would like to have any idea to initiate the task. follows the link: https://www.daniweb.com/programming/software-development/code/422291/user-friendly-asynchronous-event-driven-tcp-client Best regards.

Member Avatar
+0 forum 0

Hello, this question is related to an older post of mine ([Click Here](https://www.daniweb.com/programming/software-development/threads/505499/getopenfilename-freezes-at-second-execution)). In this question i stated that my program freezes at the execution of GetOpenFileName. After struggeling a while with that problem and doing other more important stuff first, i came back to the original problem and found some details which caused me to open up a new thread for this problem: It's not longer about GetOpenFileName which freezes, it is more of a general problem the GUI has to open up any additional window. So whats the situation? Im working on older code so not anything can …

Member Avatar
+0 forum 0

Hi every one, I had implemented Karatsuba algorithm in C++, but I have been stuck for 2 days. First problem is the function give incorrect answer, second problem is it oftens crash when run (runtime error). I try to debug but cannot understand how it's not work. I hope someone will help me out. I test all related functions of this function, everything work fine except Karatsuba function (I call it *kmulrun*). I implement big integers in base 10^4 (so the product of to digits will fit well in *int* type, for maximum performance), I implement all core functions by …

Member Avatar
+0 forum 0

hi guys could anyone help me with binary tree tying to write functions to check if a binary tree is complete or full or none this is all i did help please #include <iostream> using namespace std; struct bTree { int info; bTree *left; bTree *right; }; bTree *root=NULL, *leaf; void insert(int num, bTree *root); void postprint(bTree *root); void preprint(bTree *root); void reorderprint(bTree *root); void delbtreeelem(int num); bool iscomp(bTree* root); int main() { int num; cin>>num; while(num!=-1) { if(root==NULL) { root=new bTree; root->left=NULL; root->right=NULL; root->info=num; } else insert(num, root); cin>>num; } cout<<"left-right-root"<<endl; postprint(root); cout<<"\nroot-left-right"<<endl; preprint(root); cout<<"\nleft-root-right"<<endl; reorderprint(root); cout<<endl; cout<<"is complete: …

Member Avatar
+0 forum 0

class CIMSSubscription : public CBaseRecClass { public: CIMSSubscription() : CBaseRecClass(ClassRecSubsIMS) {} CIMSSubscription(const string & sIMSI, const string & sPubId); ~CIMSSubscription() { m_mPrivateId2SubsIMS.erase(m_sPrivateId); } struct PublicIdInfo { hssCx::ns1__tServiceProfile * pServiceProfile; // 23.228 5.2.1a Public user Ids belong to registration set // *may* point to different or the same service profiles string sRecName; PublicIdInfo() : bBarringIndication(false), eIdType(DISTINCT_PUBLIC_USER_IDENTITY), pServiceProfile(0) {} PublicIdInfo(soap * pSoap, const string & sPubId, const string & _sRecName, const bool bBarred = false, const IdentityType eType = DISTINCT_PUBLIC_USER_IDENTITY) : sIdentity(sPubId), bBarringIndication(bBarred), eIdType(eType), pServiceProfile(0), sRecName(_sRecName) { pServiceProfile = hssCx::soap_new_ns1__tServiceProfile(pSoap, -1); } // REF LINE #2 ~PublicIdInfo() { if (pServiceProfile) { soap_delete_ns1__tServiceProfile(pServiceProfile->soap, …

Member Avatar
+0 forum 0

i did a class for the timer precision using the timeSetEvent(). of course i can have more than 7 instances from the Timer class(with 200ms or something so small). is these a limitation or what? class Timer { private: static unsigned int TimerCount; UINT_PTR timerid; UINT m_uResolution=0; unsigned int TimerID=0; unsigned int intInterval=0; static void CALLBACK _TimerProc(UINT wTimerID, UINT msg, DWORD dwUser, DWORD dw1, DWORD dw2) { Timer* obj=reinterpret_cast<Timer*>(dwUser); if(obj->timerprocedure!=nullptr) obj->timerprocedure(); } public: std::function<void()> timerprocedure=EmptyEvent; Timer(std::function<void()> tmrprocedure=EmptyEvent) { TimerCount++; TimerID=TimerCount-1; timerprocedure=tmrprocedure; } void Stop() { if(timerid!=0) { timeKillEvent(timerid); timeEndPeriod (m_uResolution); } } unsigned int GetInterval() { return intInterval; } void …

Member Avatar
+0 forum 0

Here is a small e-Book for your attention: [The Ultimate Question of Programming, Refactoring, and Everything](http://www.viva64.com/en/b/0391/). This book is intended for C/C++ programmers, but it could be of interest for developers using other languages as well. What makes the book peculiar is the descriptions of real, not theoretical cases at the base of it. Each chapter starts with a code fragment taken from a real application, and then the author gives various tips of how this bug could be avoided. The questions touched upon in this book can help the readers improve the personal coding style and the coding standards …

Member Avatar
+0 forum 0

I have a Health based .Net (C#) project that needs to import a huge chunk of medical records from an old database that were used in a different application. The database has been successfully migrated to the version compatible with our application. The problem is the contents in one of its table. It contains binary data, that we have concluded so far is in a 'compressed' form. The compression method used is an algo found here: Simple Compression Zip - https://sourceforge.net/projects/scz-compress/ In order to view (the binary are compressed form of PDFs and Images) the compressed files, we need to …

Member Avatar
+0 forum 0

I am not going to lie, this is for a class project but I am lost and can't figure out where things are going wrong. We were tasked with coding an RSA algorithim based off a lab we previously did in class. The lab and project description can be found in the attached files. Now we need to use very large prime numbers 100+ digits long large. To get around c++ data size limit of long long I am using a third party library called BigInteger. The program already has 2 primes put into for use to calculte the modulus …

Member Avatar
+0 forum 0

cout <<"a="; cin >> a; cout >> "b="; cin >> b; cout << c=a+b; goto a; error:undefined label 'a'. how to solve it?

Member Avatar
-1 forum 0

i'm getting problems, again, on how i get the frame delay on gif files using Image class: UINT TotalBuffer = img2.GetPropertyItemSize(PropertyTagFrameDelay); //img2 = (PropertyItem*)malloc(TotalBuffer);//my compiler gives an error img2.GetPropertyItem(PropertyTagFrameDelay,TotalBuffer,&img2); framedelay=TotalBuffer; seems that the GDIPLUS can be a litte diferent from compiler to compiler :( so how can i get the frame delay?

Member Avatar
+0 forum 0

I'm developing a game that has a word falling to the bottom of the screen and the user typing that word before it hits the bottom. So you'll be able to type input while the word is falling. Right now I have a timer that waits 5 seconds, prints the word, runs timer again, clears the screen, and prints the word down 10 units. int main() { for (int i = 0; i < 6; i++) { movexy(x, y); cout << "hello\n"; y = y + 10; wordTimer(); } } Very basic I know. Which is why I thought multithreading …

Member Avatar
+0 forum 0

I am creating multiple C++ DLLs which have a C wrapper around them for use by an external application. I wanted to have a single error handling library that each DLL has access to. If I created the error library as a static library and then include it in the DLLs I get an issue saying that the library header file could not be found when testing it in a dummy c++ app by including the wrapper header. If I call the DLL in a C or C# app then it works fine. Is this just down to how the …

Member Avatar
+0 forum 0

Hello, I use the webkitbrowser which is simular to the webbrowser. Now on a website, I want to programatically insert a string into a textBox. This I have succeeded to do like this: webKitBrowser1.Document.GetElementById("txtbox1").SetAttribute("value", "hello"); After this I will need to programatically click a button that will check that "hello" is correct. I have succeeded to click the button like this: webKitBrowser1.Document.InvokeScriptMethod("execFunction", new object[] { }); Now comes the problem. When "execFunction" is activated which is a <a></a> tag in HTML, I get the message that the "hello" string is not correct. Now I know why that is the problem. …

Member Avatar
+0 forum 0

The End.