5
votes
Accepted
Work order spatial query (Part 1)
Functions are your friend
Even in Jython, functions are a valid construct. They allow for scope, so that you can better reason about temporary variables; give better stack traces when things go wrong;...
5
votes
Accepted
Part 1: Create or update record via HTTP request
Can the script be improved?
Jython is somewhat of a horror show, so improvements are limited but still possible.
List comprehensions
...
2
votes
Accepted
Parse backslash-delimited hierarchy path into separate columns
Normalization
A fully-normalized schema would not have four path component columns in a table; it would have one table with a string column for the path component, and a foreign key to its parent (and/...
2
votes
Determine if points are within a rotated rectangle
Code Review
Main guard
When running code outside a function / class, it is a good practice to put the code inside the main guard. See here for more explanation.
Docstrings
It is a good practice to ...
2
votes
Accepted
Part 2: Create or update record via HTTP request
You haven't used this:
IGNORE_RULES
in your call to setValue.
Also, you have a double call to ...
1
vote
Accepted
Work order spatial query (Part 2)
The code has certainly improved since I last saw it. There's only one thing that stands out to me, and it's the URL construction. The 'simple' way to make it more legible is to split it up onto ...
1
vote
Jython using JDBC
The translation is very faithful, testament to how similar language
constructs really are ... in any case there are a lot of ways that this
would probably be better in production code.
Foremost, take ...
1
vote
Jython using JDBC
It's fine for a single script. Python has first class functions so you can create a decorator or a some utility code to abstract out the try catch finally.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
jython × 10python × 7
python-2.x × 4
json × 2
http × 2
geospatial × 2
jdbc × 2
javascript × 1
image × 1
csv × 1
mathematics × 1