New answers tagged json
1
Some quicky remarks:
a well-behaved API should return specific HTTP codes depending on the outcome, that is:
200 for success, or 201 for resource created. 204 is a possibility for an empty but successful response too but I would not advise using the full panoply available. Just be aware of what codes exist and when to use them.
likewise, use 401/403 for ...
0
Maybe the image is in question is a little bit large or the internet connection used is a little bit slow.
I personally would go about it differently.
For UIKit
import UIKit
import Foundation
extension UIImageView {
func load(url: URL) {
DispatchQueue.global().async { [weak self] in
if let data = try? Data(contentsOf: url) {
...
1
Looks like you are trying to get rid of the Unicode non-breaking space:
record['Procedure'] = column[3].replace('\u00a0/\u00a0', '/').replace('\u00a0', '/')
Dealing with Unicode or character set conversions can be a headache, so I would suggest that you have a look at existing libraries to "normalize" the data. For example: unicodedata.normalize
...
2
PEP8 names
All of these variables:
def __init__(self, Date, DocumentType, Procedure, NoOfPages):
self.Date = Date
self.DocumentType = DocumentType
self.Procedure = Procedure
self.NoOfPages = NoOfPages
should be lower_snake_case.
Data classes
Replace JsonClass with a @dataclass that uses an implicit __init__.
Connection
First note that there'...
3
Some quick remarks:
Properly name things. avail_recordings and fpcalc_output do not follow the Microsoft guidelines (e.g. don't use "snake case", don't needlessly abbreviate,...).
request = (HttpWebRequest)HttpWebRequest.Create("http://api.acoustid.org/v2/lookup?client="+API_KEY+"&duration="+fpcalc_output[0].Replace("...
3
Here are my observations:
There are couple of unused namespaces
right click on the namespaces then select the Remove and Sort Usings
menuitem
acoustid_mbids \ recording: The general guideline is to prefer Pascal Case for class names.
So, AcoustidMbids and Recording would be the suggested names.
Please applies these naming for the sub-classes as well.
...
Top 50 recent answers are included
Related Tags
json × 805javascript × 220
python × 192
java × 87
c# × 78
beginner × 69
jquery × 64
python-3.x × 61
php × 61
performance × 56
api × 56
parsing × 55
c++ × 34
http × 28
csv × 27
html × 26
object-oriented × 25
node.js × 25
array × 22
swift × 22
ajax × 22
python-2.x × 19
ecmascript-6 × 16
serialization × 16
ruby × 15