C++/CLI: Get Stock Price [closed] - winforms

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I'm currently working on a C++ project to get the price of my stocks, and display it in cells on my computer screen. However, my Googling is NOT working for any of this. I also searched for libraries, but to no avail. Can anyone please tell me how I can do this? I don't know how to use the Google and Yahoo APIs, so maybe they could use some help. I need something so I can put in my code, like:
this->label1->Text = stockPrice;
The main thing about this is to get the live prices of my stocks and display it on my computer in cells or graphs.
So, thanks!

I suspect questions like this get voted down because they're rather repetitious. Still, for someone new to C++/CLI it's helpful to see working example code. In the example below we're using the Yahoo service--look at the URL closely and figure it out, otherwise search the web for further fun an profit to learn how to use their API:)
#include "stdafx.h"
using namespace System;
using namespace System::IO;
using namespace System::Net;
using namespace System::Text;
int main(array<System::String ^> ^args)
{
HttpWebRequest^ myRequest = dynamic_cast<HttpWebRequest^>(WebRequest::Create( "http://ichart.finance.yahoo.com/table.csv?s=MSFT&a=1&b=1&c=2011&d=1&e=1&f=2011&g=d&ignore=.csv" ));
myRequest->Method = "GET";
WebResponse^ myResponse = myRequest->GetResponse();
Stream^ receiveStream = myResponse->GetResponseStream();
StreamReader^ sr = gcnew StreamReader( receiveStream,Encoding::UTF8 );
Console::WriteLine(sr->ReadToEnd());
sr->Close();
myResponse->Close();
return 0;
}

Related

ITextsharp to edit existing pdf

I downloaded the pdf from the below link
http://ap.meeseva.gov.in/DeptPortal/Application%20Forms%20New/Revenue-pdf/Income%20General%20Application%20Form.pdf
What I need is I would like to fill out the blanks with the given text, I tried with the following code
using (FileStream outFile = new FileStream(#"E:\\residence(VRO)1.pdf", FileMode.Create))
{
PdfReader pdfReader = new PdfReader(#"E:\\residence(VRO).pdf");
PdfStamper pdfStamper = new PdfStamper(pdfReader, outFile);
pdfStamper.FormFlattening = true;
AcroFields af = pdfReader.AcroFields;
string[] fields = pdfStamper.AcroFields.Fields.Select(x => x.Key).ToArray();
for (int key = 0; key <= fields.Count() - 1; key++)
{
}
}
But I am not getting the fields so can some one help me
The so-called form you refer to, isn't a form. That is: it's not an interactive form. I took that PDF and I added interactive fields. Please download adapted.pdf and examine it to discover the differences.
Now when you run your code on it, you'll see the fields, and you will be able to fill out the form with Western text. You are currently using iTextSharp 5 or earlier. That version of iText doesn't support Hindi. Hindi wasn't introduced up until iText 7. Hence if you want to fill out the form using an Indic writing system (Devanagari, Tamil,...), you need iText 7 for C# and the pdfCalligraph add-on. Note that the pdfCalligraph add-on is kept closed source. You need a commercial license to use it.
We kept that part closed source because:
Too many companies are using iText without respecting the AGPL license and without purchasing a license,
As far as I know, no other free software supports Indic writing systems. We'd be giving away too much value if we released pdfCalligraph as open source software.
Summarized:
your form is not a form. Make it a form.
use software that can fill out such a form using an Indic writing system (e.g. iText 7 + the pdfCalligraph add-on).

bibTeX citation for stackoverflow

(I am not sure if this question belongs to the meta website or not, but here we go)
I want to add stackoverflow to the bibliography of a research paper I am writing, and wonder if there is any bibTeX code to do so. I already did that for gnuplot
I searched online, but in most cases the citation goes to a specific thread. In this case, I want to acknowledge SO as a whole, and add a proper citation, probably to the website itself. Hopefully somebody already did this in the past?
As an example, below are the codes I use for R and gnuplot:
#Manual{rproject,
title = {R: A Language and Environment for Statistical Computing},
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2015},
url = {https://www.R-project.org/},
}
#MISC{gnuplot,
author = {Thomas Williams and Colin Kelley and {many others}},
title = {Gnuplot 5.0: an interactive plotting program},
month = {June},
year = {2015},
howpublished = {\href{http://www.gnuplot.info/}{http://www.gnuplot.info/}}
}
I know that both are software, not website resources, but maybe something along those lines would work. Any feedback is appreciated!
Thanks!
I did not realize this question never got answered. The solution I found was to acknowledge the SO website in the LaTeX code with the following:
This research has made use of the online Q\&A platform {\texttt{stackoverflow}}
(\href{http://stackoverflow.com/}{http://stackoverflow.com/}).
Hope it helps somebody in the future!
Actually, for my paper I am using the following citation:
#misc{stackoverflow,
url={https://stackoverflow.com/},
title={Stack overflow},
year={2008}
}
I hope it helps!

Changing Legend in the Future of Dynamic Data Display wpf

I have been using the Future d3 but can not figure out how to change the series legend. In the older builds the legend could be changed like:
graf = plotter.AddLineGraph(new CompositeDataSource(xSrc, plot),
new Pen(brush, 4),
new PenDescription("myText" ));
but here the function call to AddLineGraph takes an object as argument and hence one can not specify the pendescription... Please does anyone know how to do this? This question was asked before here but did not get any answers. Any help would be highly appreciated. I have spend a lot of time on this and dont want to change to any other library just because of this small issue...
The above doesn't work with recent (2016) v0.4.0.
v0.4.0 uses the following syntax:
// For access to the Legend class
using Microsoft.Research.DynamicDataDisplay.Charts;
... snip ...
LineGraph lineGraph = new LineGraph(dataSource);
lineGraph.LinePen = new Pen(Brushed.Green, 1.0);
Legend.SetDescription(lineGraph, "The line label");
plotter.Children.Add(lineGraph);
... snip ...
v0.3.0 used the following syntax:
plotter.AddLineGraph(dataSource, pen, marker, new PenDescription("The line label"));
Ref: Changing and setting the Legend (LineGraph) Future of DynamicDataDisplay
Post http://d3future.codeplex.com/discussions/635917 provided the core fix.

Manual change orientation in iOS 6 [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I manual change orientation in iOS 5,everything is ok.But in iOS 6,keyboard is not change orientation.UIApplication statusBarOrientation is not work.
Try this:
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;
}
Instead of this:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
UPDATE:
In iOS 7 SDK & Xcode 5:
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;
}
The method statusBarOrientation works only when supportedInterfaceOrientations callback returns 0. To make your previous code work, you can set a flag to true before calling statusBarOrientation method. This flag can be reset once statusBarOrientation has been invoked.
You can return 0 from supportedInterfaceOrientations when you find this flag to be true.

Stop word removal in Javascript [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
HI I am looking for a library that'll remove stop words from text in Javascript, my end goal is to calculate tf-idf and then convert the given document into vector space, and all of this is Javascript.
Can anyone point me to a library that'll help me do that.Just a library to remove the stop words would also be great.
Use the stopwords provided by the NLTK library:
stopwords = ['i','me','my','myself','we','our','ours','ourselves','you','your','yours','yourself','yourselves','he','him','his','himself','she','her','hers','herself','it','its','itself','they','them','their','theirs','themselves','what','which','who','whom','this','that','these','those','am','is','are','was','were','be','been','being','have','has','had','having','do','does','did','doing','a','an','the','and','but','if','or','because','as','until','while','of','at','by','for','with','about','against','between','into','through','during','before','after','above','below','to','from','up','down','in','out','on','off','over','under','again','further','then','once','here','there','when','where','why','how','all','any','both','each','few','more','most','other','some','such','no','nor','not','only','own','same','so','than','too','very','s','t','can','will','just','don','should','now']
Then simply pass your string into the following function:
function remove_stopwords(str) {
res = []
words = str.split(' ')
for(i=0;i<words.length;i++) {
word_clean = words[i].split(".").join("")
if(!stopwords.includes(word_clean)) {
res.push(word_clean)
}
}
return(res.join(' '))
}
Example:
remove_stopwords("I will go to the place where there are things for me.")
Result:
I go place things
Just add any words to your NLTK array that aren't covered already.
I think there are no libraries for such thing, you need to download those words from https://www.ranks.nl/stopwords.
And then do replace the words as follows:
text = text.replace(stopword, "")
Here's an array with english stopwords. Hope it helps. From http://www.ranks.nl/stopwords (mentioned in previous answer).
Also, this could be a helpful resource for you.
https://github.com/shiffman/A2Z-F16/tree/gh-pages/week5-analysis
http://shiffman.net/a2z/text-analysis/
var stopwords = ["a", "about", "above", "after", "again", "against", "all", "am", "an", "and", "any","are","aren't","as","at","be","because","been","before","being","below","between","both","but","by","can't","cannot","could","couldn't","did","didn't","do","does","doesn't","doing","don't","down","during","each","few","for","from","further","had","hadn't","has","hasn't","have","haven't","having","he","he'd","he'll","he's","her","here","here's","hers","herself","him","himself","his","how","how's","i","i'd","i'll","i'm","i've","if","in","into","is","isn't","it","it's","its","itself","let's","me","more","most","mustn't","my","myself","no","nor","not","of","off","on","once","only","or","other","ought","our","ours","ourselves","out","over","own","same","shan't","she","she'd","she'll","she's","should","shouldn't","so","some","such","than","that","that's","the","their","theirs","them","themselves","then","there","there's","these","they","they'd","they'll","they're","they've","this","those","through","to","too","under","until","up","very","was","wasn't","we","we'd","we'll","we're","we've","were","weren't","what","what's","when","when's","where","where's","which","while","who","who's","whom","why","why's","with","won't","would","wouldn't","you","you'd","you'll","you're","you've","your","yours","yourself","yourselves"];
There's a Javascript Library for removing stopwords here: http://geeklad.com/remove-stop-words-in-javascript

Resources