Search
Searches topics and replies. Every word has to appear in the post.
50 posts found.
| Post | Posted |
|---|---|
Report after the first two lessons: going well. Two kids are already ahead of me, which I'm told is the goal. "Draw your name" with the turtle was the best bit. Typing is exactly the problem teo said it'd be. | by bea |
Don't. Your office proxy is re-signing TLS with its own CA. Get the CA certificate from IT and point at it: export REQUESTS_CA_BUNDLE=/path/to/corp-ca.pem. That's the same bug class as the curl thread, sort of the reverse. | by rproxy |
requests.get gives CERTIFICATE_VERIFY_FAILED on the office network. fine at home. someone said just use verify=False | by pbj |
Map's fine. If you ever want smoother than a fixed window, a token bucket's only about five more lines. Probably don't need it. | by nils !PxNS1ZCy |
Postgres people: timestamptz doesn't store a time zone, it stores UTC and converts on the way out. That confuses somebody on every team I've ever worked on. | by nils !PxNS1ZCy |
Rowid is still insertion order for me, so that works. Did the conversion with a script that walks in rowid order, and I've kept the old column around in case. | by dan_r |
You know the answer. Store UTC. In Python that's datetime.now(timezone.utc), or use integer epoch. Convert when you display. For the old rows, you can't tell the two 01:30s apart from the text alone, but the rows are ordered by rowid, and r… | by marta_k !izYA-5cv |
Export has two sets of readings for 01:00-02:00 on the night the clocks went back. The script writes datetime.now() into the db as text. Pretty sure I know the answer, but what's the right fix for the data that's already there? | by dan_r |
Also count failed writes, otherwise a client can hammer you with bad requests for free. | by Anonymous |
A Map is fine for a single process. Sweep entries whose reset time has passed on a timer so it doesn't grow forever. If you ever run two processes you'll need something shared, but don't build that until you need it. | by dan_r |
Single node process, small API. I want to allow ~20 writes a minute per client and reject the rest. Everything I find assumes redis or a gateway. Is a Map of counters with a reset timestamp good enough? What happens to memory if a lot of di… | by sam |
Note exif_transpose doesn't touch the file on disk, only your image object. Bit me when I assumed the originals got fixed. | by lena_w |
Worth knowing that exif_transpose returns a new image and strips the orientation tag, so if you save it again it won't get rotated twice. | by Anonymous |
Thonny as the editor, turtle for the first few weeks, micro:bits at the end if the budget allows. Thanks everyone. I'll report back. | by bea |
Follow-up to my gallery notes. Phone photos were coming out sideways in thumbnails. from PIL import Image, ImageOps img = ImageOps.exif_transpose(Image.open(path)) One line. The orientation tag is in the file, Pillow just doesn't apply it b… | by mo |
I ran a club for this age group some years back. Scratch for the ones who haven't, Python for the ones who are bored by Scratch, and let them see each other's work. Micro:bits went down extremely well, because a physical thing lights up. | by Gregor |
Python with the turtle module, or pygame zero if you're brave. Typing's the real barrier at that age, not the concepts. | by teo |
Do they want to make something or learn to program? For an hour a week I'd want them to have made a thing that moves by the end of week one. | by kettle |
I've somehow become the coding person at school now. Have about 25 kids, an hour a week, one term. Half have used Scratch. Any experience with this? | by bea |
Most INI implementations only treat ; as a comment at the start of a line or after whitespace. Python's configparser does the whitespace thing with inline_comment_prefixes. | by Anonymous |
Basic sections and key=value pairs work. Not handling inline comments yet. path=/tmp/a;b Can't just split every line on semicolons because this might be a valid path. Probably only treat it as a comment when preceded by whitespace? Need to … | by Anonymous |
"Identifiers aren't numbers" should go on a wall somewhere. Leading zeros have ruined more imports than bad encodings. | by marta_k !izYA-5cv |
For the CSV pile-up, logrotate with a copytruncate config works fine on plain files even though it's meant for logs. Or just date the filename in export.py and delete anything older than 30 days. | by Anonymous |
DtypeWarning: Columns (3) have mixed types. Specify dtype option on import or set low_memory=False. Most of us ignore this. Don't. With low_memory on (the default), read_csv infers types chunk by chunk, so column 3 can be ints for the first… | by lena_w |
Thumbnail generation is working. Notes for when I get back to this: - portrait images get stretched in the index - filenames with spaces break the next link - don't regenerate thumbnails if the original hasn't changed - remove the hardcoded… | by mo |