Skip to main content
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;...
Reinderien's user avatar
  • 71.1k
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 ...
Reinderien's user avatar
  • 71.1k
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/...
Reinderien's user avatar
  • 71.1k
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 ...
GZ0's user avatar
  • 2,361
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 ...
Reinderien's user avatar
  • 71.1k
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 ...
Reinderien's user avatar
  • 71.1k
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 ...
ferada's user avatar
  • 11.4k
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.
Steven Lewis's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible