C++ :: Yahoo Finance API Design Code
Apr 22, 2014
I get a bunch of broken links and nearly nothing when I search for how to hook up Yahoo Finance with C++ api.
Is there code for Yahoo Api or a search feature?
I need to look up stock tickers, volume, and closing price.
View 17 Replies
ADVERTISEMENT
Oct 26, 2014
Design an algorithm using flowchart or pseudo-code to prompt the user for a series of positive integer values. Calculate the average of these values and display the average at the end of the program. Assume that the user types the sentinel value -1 to indicate end of data entry.
Sample input-output:
Enter a positive integer (-1 to end) : 5
Enter a positive integer (-1 to end) : 7
Enter a positive integer (-1 to end) : 6
Enter a positive integer (-1 to end) : -1
The average value is: 6
I searched online and found out this solution however it is only for three numbers.Is there any way of modifying this to include the sum of x numbers / number of x(integers) to find the average?
View 5 Replies
View Related
Aug 6, 2014
I am trying to send yahoo mail using socket program.
Using the commands like ehlo, starttls, auth login, data,.,quit.
but starttls is error. yahoo close itself. one more thing i use this same method for gmail is working.
The problem is we must enable the ssl authentication. Like System.net mail in .net package smtp.enablessl=true. how i enable ssl authentication in starttls in c++ program
View 1 Replies
View Related
Jul 10, 2014
My need is that i need to design a program for a machine. The machine takes "x"qty of load, refines 30% of it and sends back the 70% to the initial position. after how many times, does the qty of the load refined will be equal to the initial load and how many times does it need tot be refined?
View 1 Replies
View Related
Nov 16, 2013
How to write Algorithm / Design
View 7 Replies
View Related
Feb 23, 2014
I have two Form Employee and Instructor, here Employee is super class of instructor.
public class Instructor: Employee
{
//Instructor class
}
I am able to access all property of Employee inside instructor class but with these some textbox and button design inside Employee design is also getting inherited inside Instructor design and i don want this and i want to maintain the parent-child relationship between Employee and Instructor.
View 11 Replies
View Related
Jun 8, 2014
I want to write a command line parsing library that is very flexible in terms of parsing style but I'm not able to design a mechanism that satisfies this requirements.
Generally i want to have a class that contains all the necessary information about how the command line has to be parsed.
Code:
// draft
class style {
public:
enum class type { // the basic style type
[Code] ....
Need completing the draft shown above, because for every basic style type there is an own set of extensions that applies only to this one specific style type.
Code:
// how a style object should be created
style parsing_style(style::type::posix, style::extension::gnu|style::extension::subcommand);
How to design the class. (using c++11 features like std::enable_if is fine)
View 10 Replies
View Related
Apr 24, 2013
The program is supposed to design a class that can be used that can represent a parabola.
Code:
#include <iostream>
#include <iomanip>
#include <cmath>
#include <fstream>
#include <cstdlib>
#include <cstring>
using namespace std;
class Parabola {
public:
Parabola( double, double, double );
[Code] .....
View 3 Replies
View Related
Jan 21, 2015
I am looking into some design pattern which works for validation.
I thought about using strategy but not sure whether its correct or not
View 3 Replies
View Related
Dec 11, 2014
Any design pattern allows to describe operation like the following.
MyFunctionObject f;
//Init f...
MyFunctionObject g;
//Init g...
MyFunctionObject h = f(g) + g;
[Code] .....
I'm interested in design pattern which permits to model this kind of structure, if there's of course...
View 7 Replies
View Related
Aug 26, 2013
I want to ask on how to put a layout design in the program when it is being ran. It should look like these: [URL] ....
This is a sample code:
#include<iostream>
using namespace std;
main() {
int m, n, c, d, first[10][10], second[10][10], sum[10][10],
minus[10][10], times[10][10];
char ans;
[Code] ....
View 2 Replies
View Related
Jan 6, 2014
I have two designs for reading/writing my classes to XML. Which do you think is better:
This is my structure (Attributes are single class members, Elements are std::vector< T > members
Structure:
+ Calibrator
+ Attrib: readLabel (string)
+ Attrib: saveLabel (string)
+ Element: Device
+ Attrib: sourceLabel (string)
+ Attrib: destLabel (string)
+ Element: CalPoint
+ Attrib: sourceVal (double)
+ Attrib: destVal (double)
1. Design 1: Have an independent class to handle everything and "friend" it with the users.
Pro: Only 1 interface needed and we can switch interface easily.
Con: There is a lot of inter-class data which destroys encapsulation
class CalibratorXML;
class Device{
string sourceLabel;
string destLabel;
vector<CalPoint> calPoints;
friend class CalibratorXML;
[Code] .....
View 1 Replies
View Related
Nov 11, 2014
smart pointer class is the one that take in charge of release allocated resource when itself destroyed.
recently,i want design a smart pointer class, it take in charge of release resource allocated by new or new[].
my problem how to design destructor, you should determine the pointer ptr is pointer an array or a single object.
the structure of this smart point class may be:
template<class T>;
class smart_pointer{
public:
smart_pointer(T* p):ptr(p){};
~smart_pointer(){
[Code] ......
View 6 Replies
View Related
Aug 7, 2014
I have a Class called 'DataManager' which contains a list of my 'DataItem' objects (this are created by an XML file).
I have also created some custom controls which, among other things, has a property to link it to a "DataItem" object.
My question is, is it possible to create an instance of my DataManager class at design time (which runs all the code as it would at run time to create all the DataItems from the XML)?
I want to do this so that I can update my DataItem property in my custom controls to use a UITypeEditor which then allows me to link to a DataItem at design time.
View 4 Replies
View Related
Mar 3, 2012
Let's say we have entities like lines and circles. And each entity can have a pen attached. And a pen is a color and line width. All entities needs to be manipulated through a operations interface. All entities added to the program needs to be added through using a factory pattern.
So we end up something like (pseudo code)
class Line // for immutable objects {
..
..
} class MutableLine extends Line //for mutable lines {
} MutableLine line=factory->newLine(20,20,50,50); // Create a new line entity
[code]....
So, essentially I want no code to be able to operate directory on entities, unless during creation of the object (color, layer, line width etc...) so I am planning to create Mutable versions of all entities besides the immutable versions.
When requested for selected entities or all entities, I am planning to return a list of immutable objects and in fact I am planning to return a new copy so it's not possible to operate on anything directly.
The reason is that I am planning to create different storage backends swell, so I can operate on entities in a database, or shared memory... stuff like that. At least to hide the internals and provide a stable API.
My questions are:
How can I make sure that people don't do 'tricks' casts for example to a mutable version to change objects directly?
View 2 Replies
View Related
Apr 15, 2013
I have assignment which requires me to print out and array code and a pseudo code. I dont no what a pseudo code is,.
View 2 Replies
View Related
Mar 6, 2015
Consider the situation where you're writing a cross-platform library that has functions for creating and manipulating windows. To create a window suitable for OpenGL rendering on Windows you need to call a bunch of different functions such as GetModuleHandle, RegisterClass, CreateWindow, SetPixelFormat, GetDC, wglCreateContextGetDC and so on. All of these functions can potentially fail in one way or another and the Windows documentation doesn't even attempt to list all the different error codes that these functions return.
Let's say your function for creating a window is called create_window(). What kind of error message should you return if any of these platform specific functions fail? It could be something as simple as MultiByteToWideChar failing for some reason when you convert the UTF-8 string your API uses internally to the UTF-16 string that the Windows API expects. I've read that you're not supposed to leak implementation details from your API but what are you suppose to return when an encoding conversion fails that is supposed to be completely transparent to the user of your library?
I've decided to simply return an error code indicating a platform specific error in those cases because there's no way I can anticipate all the different errors that the Windows API might return. The problem with that is that almost all the errors end up being platform errors and without a way to actually tell what the error is then you're basically saying that some unknown error happened. That's not very useful. You could have a function called get_platform_error() that you call to obtain the exact platform error that occurred, but I'm not a fan of such a design and I've had enough trouble with GetLastError() style error handling as it is.
An alternative to that is to create a struct that represents errors and have a field in it where you can store platform specific errors. I believe this is what Apple do with their NSError error object but I'm not sure how I feel about that approach.
Assuming you implement a way to return the platform specific error code then the next part is obtaining a string that describes the error. Your library can obviously not implement error strings for every single error code that Windows might return so you're forced to use FormatMessage. The problem with that function is that you can't force it to return error messages in a specific language and it's not even guaranteed that you can get an English translation of the error string. I don't want to display error messages that mixes English with the current language the operating system uses so how do I solve this problem?
Are there any good open source libraries I could study? The ones I've looked at so far have subpar error handling at best. Many of them don't even check the return values from platform specific functions.
View 8 Replies
View Related
Apr 12, 2014
I am building a semi-complicated program and the focus of it will be on the search engine. The current plan is for it to search an online database after keywords and receive a list of responses organized by relevance.
I want to minimize the stress on the server by handling as much of the process on the client side as possible so I wonder how best to split up the tasks.
So far my idea is to have the client send the search term to the server who then compare it with its registry. Collecting the 30 or so most relevant hits it sends it back along with additional information from each entry. Requesting additional hits will be decided by sending a simple int value telling which page its filling up.
Simple example:
"Search word" gets processed by the client to account for spelling errors, context etc (based on what I can implement by myself). An Int value gets added (0 for page 1, 1 for page 2 etc...). The request gets sent to the server who can immediately run the search without processing the search word since that was handled in the client. It locates hits and order them by relevance then send out the information batch decided by the Int.
View 2 Replies
View Related
Oct 26, 2014
I need to design an interface(a function prototype) that takes an argument which is used to pass information.
The information can be passed by independent modules and third party softwares and hence can vary today and in future.
Basically, the function interface(arg1, info)caters a niche service to many independent applications and needs to process based on requirements passed by applications in the argument(info, in example).
I am looking for a design pattern for the function parameter - info.
Should I use a void pointer that can be casted to respective application specific class in the function ? will this be a good C++ design ?
or should I take this parameter to be a pointer to a generic abstract class that points to the respective application specific specialization ?
Do we have some design pattern to address this so as to handle other unforeseen challenges ?
View 1 Replies
View Related
Dec 14, 2014
How can I write my own container which has properties of both vector and list.
E.g. I can access elements directly using [] operator like vector and behave like list in terms of memory (means we don't have to shift elements if we want to insert in between like list)....
View 1 Replies
View Related
Feb 2, 2013
Code for virtual topology design in optical networks...i have tried but it is not working
View 2 Replies
View Related
Sep 30, 2013
I have a simple game loop.
while(true) {
//round initialization stuff
while(true) {
//capture input, make pieces move,
}
}
I am faced with the decision of what is the best way of restarting the game. The problem is, the condition for restarting a game is very, very deep inside the game's logic. So returning returning... is not an option, or at least, it ain't gonna be pretty.
So one of my considerations is to use a goto label, like so:
while(true) {
//round initialization stuff
while(true) {
//capture input, make pieces move,
} restart_round:
}
This seems to be the cleanest solution, since it allows me to fully reset the 'state' of the round, by first having all the destructors(pertaining to the round's objects) called, and then the constructors and other initialisation stuff.
Are there any subtleties that I am missing regarding this solution?
View 10 Replies
View Related
Oct 26, 2014
I need to design an interface(a function prototype) that takes an argument which is used to pass information.
The information can be passed by independent modules and third party softwares and hence can vary today and in future.
Basically, the function interface(arg1, info) caters a niche service to many independent applications and needs to process based on requirements passed by applications in the argument(info, in example).
I am looking for a design pattern for the function parameter - info.
Should I use a void pointer that can be casted to respective application specific class in the function ? will this be a good C++ design ?
or should I take this parameter to be a pointer to a generic abstract class that points to the respective application specific specialization ?
Do we have some design pattern to address this so as to handle other unforeseen challenges ?
View 3 Replies
View Related
Feb 24, 2014
I am looking a good design pattern that takes a combination of a Observer Design Pattern and Command Design Pattern.
Observer Design Pattern:
Subject - ISystem
ConcreteSubject - "Different Types of Systems"
Observer - INotifier
ConcreteObserver - "Different Types of Notifier's"
Command Design Pattern: Used to create a task. "Different Types of Task" ....
View 4 Replies
View Related
May 15, 2013
I am trying to design and implement a program that consists of two classes. The Base class A is purely for supporting class B. I do not want to be able to create an object of class A. When object B is created it inherits from class A.
What is the best way to achieve this?
View 8 Replies
View Related
Mar 15, 2015
i want to design a custom control (Ui widget library) , this library can be used by any IDe developer to develop his UI.
how to design a custom control library and plug in.
View 11 Replies
View Related