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 4 years ago.
The community reviewed whether to reopen this question 17 days ago and left it closed:
Original close reason(s) were not resolved
Improve this question
Are there any good webservices out there that provide good lookup information for Countries and States/Provinces?
If so what ones do you use?
http://www.geonames.org/
That's the best one I've found. They let you download and host the web service yourself, which is also nice.
If you only need US information, the US Postal Service provides a set of web services it calls WebTools for this exact thing. https://www.usps.com/business/web-tools-apis/welcome.htm. You will need to register to be able to use them but once you're registered they are really simple to use. You just send an XML request over HTTP and the server sends an XML response back and you just have to unpack it.
Sample request:
http://SERVERNAME/ShippingAPITest.dll?API=Verify&XML=<AddressValidateRequest%20USERID="xxxxxxx"><Address ID="0"><Address1></Address1><Address2>6406 Ivy Lane</Address2><City>Greenbelt</City><State>MD</State><Zip5></Zip5><Zip4></Zip4></Address></AddressValidateRequest>
Sample response:
<?xml version="1.0"?>
<AddressValidateResponse>
<Address ID="0">
<Address2>6406 IVY LN</Address2>
<City>GREENBELT</City>
<State>MD</State>
<Zip5>20770</Zip5>
<Zip4>1441</Zip4>
</Address>
</AddressValidateResponse>
Here's a link to the technical documentation:
https://www.usps.com/business/web-tools-apis/documentation-updates.htm
A services that works well with .Net (because it leverages WSDL) is http://www.webservicex.net. They have a service for US ZIP codes available at http://www.webservicex.net/uszip.asmx. You can just add it as a service and Visual Studio will take care of the rest. The response comes as an XML response, so you'll have to parse it, but you can use something simple like USZIP.GetInfoByZIP(ZIP).SelectSingleNode("//STATE").InnerText.
For my application I then built an in-memory cache of the data using XML following these directions: http://www.15seconds.com/issue/010410.htm. I used XML instead of a HashTable or Dictionary(TKey, TValue) because I wanted to be able to serialize it to a string so I could save the 'database' as a user setting.
A good source of geographic data, including lookups and mapping data for the USA is the US Census Bureau's TIGER Data set. They no longer actively track Zip code data, but they do have a 1999 vintage file still available.
For countries, the ISO country code list is publicly available.
I'm not aware of resources for information outside the US.
Related
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 8 months ago.
This post was edited and submitted for review 8 months ago and failed to reopen the post:
Opinion-based Update the question so it can be answered with facts and citations by editing this post.
Improve this question
Reference: Getting started with JSON schema
I have been reading about JSON schema. I understand that
When you’re talking about a data format, you want to have metadata
about what keys mean, including the valid inputs for those keys. JSON
Schema is a proposed IETF standard how to answer those questions for
data.
Alright, so these schemas define what is and what is not permitted in the JSON structure I am building.
My question is, how are these schemas practically used? For example if I am using a JSON file in a C++ program (or a python script), I can use the json file as it is (of course without any validation). But if I want to validate it, how can I use the json schemas to do that? Are there any recommended libraries for that? (I am interested in C++ but additional info on python would be welcomed too)
EDIT: I would like to emphasize that the main purpose of this question is to understand how are these schemas practically used?
Are schemas used only for validation? or are there other uses? (I am new to the concept of schemas)
The implementations page on the JSON Schema website lists several usecases.
https://json-schema.org/implementations.html
validation
Code generation
UI generation
Sample data generation
JSON Schema is only designed for validation, however other use cases are possible, and we are trying to formalise semantics and additional keywords to make other usecases work interoperably.
Further, if you'd like to hear about real world use cases, there's a series on the official YouTube channel: https://youtube.com/playlist?list=PLHVhS4Tj1YZOrrvl7_a9LaBAtst7BWH8a
There are also some case studies found on the blog: https://json-schema.org/blog
One use is validation. More than pass/fail you get a meaningful error message like e.g. "unexpected value W for field A.B.C, allowed values are X, Y, Z" or "invalid type for field A.B.C, expected date, found int", "missing field A.B.C" etc.
They can also serve as self documentation.
They are also used for autocomplete. For instance a json setting file for a program like VS Code. When you edit the settings.json or c_cpp_properties.json from within VS Code you get autocomplete for that particular json file. That is built in. But you can also define your own schemas with file pattern match and and you can get autocomplete in the editor for your own json files.
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 1 year ago.
Improve this question
I am working remotely with some colleagues on a Rmarkdown document, and I would like to make a simple review of the file (especially the comment part and not the code), and then send it back to others with my reviews embeded in the document, like a word document review or a kind of Overleaf review. I have made some research on the topic, but I didn't find something that feet my needs as explained. Please, Is there a way to add some review in a Rmakdown document and sent it back (either online or not)?
Take a look at Etherpad
Etherpad is a highly customizable Open Source online editor providing collaborative editing in really real-time.
Or, better: StackEdit
With StackEdit, you can share collaborative workspaces, thanks to the Google Drive synchronization mechanism. If two collaborators are working on the same file at the same time, StackEdit takes care of merging the changes.
Or, even better: HackMD
HackMD is a realtime, multiplatform collaborative markdown note editor.
This means that you can write notes with other people on your desktop, tablet or even on the phone.
I suggest you considering trackdown https://claudiozandonella.github.io/trackdown/
trackdown is an R package that offers a simple answer to collaborative writing and editing of R Markdown (or Sweave) documents. With trackdown, the local .Rmd (or .Rnw) file is uploaded as plain-text in Google Drive where, thanks to the easily readable Markdown (or LaTeX) syntax and the well-known online interface offered by Google Docs, collaborators can easily contribute to the writing and editing of the narrative part of the document. After integrating all authors’ contributions, the final document can be downloaded and rendered locally.
You can find more details at this answer https://stackoverflow.com/a/68014082/12481476 or in the package documentation https://claudiozandonella.github.io/trackdown/
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 4 years ago.
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.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
Is there any way I can get the printer status, like paper jam or out of paper, from a Network Printer?
I'm working on a project to print from a Point of Sales into a A4 Network Printer, I'm planning to use the LPR native application but I can't get the paper jam or out of paper errors using that application.
Is possible to get those status from a Lexmark Network Printer?
Does exist any C/C++ Open Source library that allow me to get those status?
Thank you in advance
It depends on the printer. Most of the LAN enabled boxes do have a web-interface which is an easy catch. I did the same for some ricoh printers using curl to download status pages and parsed those...
Another possibility would be using snmp traps as printers tend to have events for 'paper jam' or 'low on ink/toner'...
The only solution possible for something like that is a protocol that the printer uses that allows you to connect to it and request data. If, for example, it is an IPDS capable printer, you will have to find out what port it uses and connect to it using TCP/IP sockets, request the Sense Data, then decipher it. That's about all you can do.
You can do this if the printer you have supports the UPnP Device Control Protocol PrinterBasic and/or PrinterEnhanced. Typically a DLNA-certified printer has this.
You can check out the specs sheet is here:
http://upnp.org/sdcps-and-certification/standards/sdcps/
Basically, the interface between your device and your controller app will be SOAP-based.
There are UPnP SDKs available, but you will need to study the rigorous UPnP architecture to implement it.
Good luck!
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 5 years ago.
Improve this question
I have an address database and I tried to find latitude and longitude using google geocoding and yahoo API. Is there any other popular API's or programs are there. I'm using ubuntu platform.
I was usually using Google Maps geocoding service over HTTP which returns you Json or XML as you like. Browse around here for more information about this.
Another option may be GeoNames.org. It also provides some interesting services and client libraries.
I'm aware of at least one other geocoding system, OpenStreetMap. The only major differences I've found with any of these API's is the level of detail in each. OpenStreetMap has significantly less data, but is much easier to integrate with custom data. Also, I think the maps produced by google are the most beatiful of the three.
With both of those that you mention, if you're mass-processing them or not showing a map to the user at the time of querying the API, you're violating TOS.
A better solution to meet your needs would be something like LiveAddress. I actually work at SmartyStreets where we develop it ourselves -- there's no license restrictions such as would prevent you from running even millions of addresses. In addition to returning coordinates, LiveAddress will also verify the existence of addresses and standardize them for you. This is helpful in removing duplicates and has a lot of business advantages.
If you have any further address-related questions I'll be happy to personally assist.
You might also find geocoder.us useful.
Using YQL, u can obtain a list of possible forecast
First step:
Reverse geocoding
SELECT woeid
FROM geo.places
WHERE text="##LATITUDE##, ##LONGITUDE##"
then apply a filter to order results by placeType. This help U to order forecast by map level accuracy (town, city, postal code, region, ....)
SELECT woeid
FROM geo.places
WHERE text="##LATITUDE##, ##LONGITUDE##" |
SORT(field="placeTypeName.code")
Now use simile join to get all forecasts by woeid resulted by last query and filter null results
SELECT channel
FROM weather.woeid
WHERE w in (
SELECT woeid
FROM geo.places
WHERE text="##LATITUDE##, ##LONGITUDE##" |
SORT(field="placeTypeName.code"))
AND channel.
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 7 years ago.
Improve this question
I would like to make a free open-source C++ application for both Linux and Windows which will create live stock market charts (i.e. they're refreshed frequently).
Please could you give me some pointers on these issues:
What should I use as the data source? Are there free services I can implement? I would like to use the same or similar information as companies like Google.
I'm not sure what GUI toolkit would be best to use, is there one which has charting built in, or would I need to use a specialized library for this?
Some things to note:
This is my first attempt at both cross-platform C++ development, and a GUI application for Linux.
I'm based in the UK, so I'd like to use data sources that provide information for the London stock exchange (LON) as well as NASDAQ, etc.
As of Nov 2014, these links are dead.
Google Finance API: http://code.google.com/apis/finance/
Yahoo! Finance API: http://developer.yahoo.com/finance/
Cross-platform C++ charts w/ Qt: http://www.int.com/products/2d/carnac/chart_component.htm
Assuming the rules in the UK are the same as in the US, you basically have 3-tiered choices.
You can hack together a lame feed from things like Google or Yahoo but you absolutely are not getting every tick, if that is what you are after.
A step up from the obvious internet sources are some of the online brokers. Their data is more reliable and timely but obviously you need an account and they have to offer some kind of API. Check into something like InteractiveBrokers.com. They are mostly java centric but offer a Window's based C++ DLL as well. Several other brokers offer similar APIs but IB is excellent in that it covers a multitude of exchanges including, I believe, London. They also make it relatively easy to transfer currencies if that is a concern.
Lastly you have to go to commercial brokers. You can find them easily enough with a search but be prepared to pay a couple of hundred dollars per month minimum.
I think Mark's suggestion of QT is a good way to go for a GUI. Java tends to be adequate for putting up a grid of running quotes but tends to fail in the charting area, IMO.
You said you wanted "live" market charts. If you mean real-time, you will never get that for free. All the data you see on google etc is delayed, usually at least 15 minutes, and they don't get every tick.
If a delay is not a problem and if you are only interested in daily data, you can easily get historical data for free via simple HTTP request using this historical data API.