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.
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 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 is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
During the development of my projects I find myself producing some large documents with slight variations on only a few paragraphs. For instance, the same configuration plan will be used throughout different projects but each document has to be tailored with specific data and to comply with some specific requirements.
Being a lazy person and a fan of model-driven development, I have been looking for ways to optimize this process and I got these options:
Document templates - Using master document templates (the presentation) with forms (the model) or restricting the edition of a document to only a few key fields, and then cross-referencing the inputted data all over the document would do the trick... but I still feel that I could de-couple both layers a bit more.
UML modeling - Using CASE tools with UML support, I thought I could model my documents as packages and classes with annotations, change the model for each project and generate a report using a document template. The problem is that those tools are not designed for treating large chunks of text and I am having some difficulties to progress.
Process modeling - Using Eclipse EPF https://www.eclipse.org/epf/ seems a bit overkilling for what I want to accomplish. Remember: I´m a lazy person.
I would like to ask the community on their experiences with model-based documentation or their ways to optimize the generation of documents throughout the software development cycle.
I'm not sure I fully understand, so apologies if this misses the mark.
I've faced (I think) a similar problem, where there's a many:many relationship between content and the documents it needs to be presented in. For example, a 'project overview' that needs to be included in a requirements document, project plan, etc.
Thus far the best solution I've found is:
Write each section in Markdown format. There are some nice editors that make writing Markdown easy and efficient (e.g. Mou on OSX).
Use Pandoc to convert Markdown into Restructured Text (RST).
Use Sphinx to generate documents from the RST files.
I have multiple Sphinx doc templates, each of which combines some of the common sections with others specific to that doc. If one of the common sections gets updated it's easy to re-generate all docs to incorporate. Version Control is pretty straightforward as the source files are all simple text. Sphinx can also generate multiple formats easily: for example html to put online, or pdf for printing/distribution.
You could remove the need for step 2 by writing in RST natively. For me the extra step is worth it as I haven't found an RST editor that's as comfortable or efficient as Mou. YMMV of course.
It's not a perfect solution: for example, creating links across sections isn't that easy. But in general it works well for my needs.
hth.
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
While googling for it.I've stumbled upon html2wiki that seems to do the job(will try after done posting the Q up). But, other than that, there are many other choices popped out during the query session.
An word on which app to choose would be appreciated!
Thanks
I'm quite a fan of pandoc. The advantage is you learn one tool and then you can do lots of different kinds of conversions, fast.
This is the only one that has worked for me:
https://foliovision.com/seo-tools/pandoc-online
My use case was an HTML exported from EverNote which I needed to transfer into MediaWiki engine.
You could try HTML-WikiConverter
It can be done with marksy.arc90.com
Marksy is an online (or a Chrome Extension) that converts one markup
language to another in your browser.
Currently:
Input types supported
Markdown
Rst
Textile
Html
Mediawiki
Jira (confluence)
Github (gfm)
Outputs
Markdown
Rst
Textile
Html
Jira (confluence)
Googlecode
Jspwiki
Moinmoin
Trac
Mediawiki
Marksy even has an API available.
The best of three test was achieved by Seapine {Labs} HTML to Wiki Converter.
It uses AJAX to convert HTML source code to MediaWiki syntax.
The project documentation can be found here.
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'm a really tight schedule to code up a prototype for a website. I'm working with Django and am just starting out. Can you suggest open source Django snippets for the following:
1) A User Registration system (Registration/Authentication/Sessions)
2) A Rating System (Preferably a x/10 or 5 stars rating system)
3) A tags based search system
I'm really a noob and I need to get the version 1 out in 4 hours. So I'll just use open source code and modify it. I will make sure to keep the final version open sourced as well.
Check out the Pinax Project. That should cover #1 (OpenID) and #3 (tagging).
Your basic Django installation will provide users, authentication, and session handling right out of the box. For your user registration needs, you might consider django-registration. It's written by James Bennett, a well-respected Django contributor. For tagging, I've always used django-tagging.
I've never used a rating system in a Django application, but you might consider using django-ratings.
Good luck!
I never searched for your exact two examples, but django snippets is usually a really good place to start when looking for django code examples.
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.