Did a bit more work porting rply to #go this afternoon. Now I’m into building the parser things are getting tricky. #Rply is also barely commented at all so it’s often hard to follow. Also because #python is dynamic, there are no types for anything! So I have to be the human type inferrer. It’s been a bit frustrating working out what type a variable is (or what a dictionary holds) when I can’t see the raw values going in.
Well, my #exist upgrade is complete. The site was offline for a little over an hour, a bit longer than I intended thanks to some things I missed in my pre-flight checklist and which subsequently made things very confusing, but not too bad really. I had a few little bugs to fix afterwards that I’d missed earlier, but it all seems good now. Onward to new event streams and #manualtracking!
Sort of related, I’d definitely have fewer issues in a scenario like this with a strongly typed language. I think upgrading to #python 3 would be at least as stressful as this upgrade has been, but it would mean I could take advantage of type hinting. Something to ponder.
- Added a message to the settings screen that asks the user not to force quit, as that stops background refresh from running
- Added support for a food group and all its attributes, which will be launched soon
- Submitted nutrition update to App Store for review
- Put back the #location code I was working on months ago and started testing it
I also started working on a just-for-fun app to send my Wunderlist tasks to Exist. It would make much more sense as a #python script or something, but iOS is all I know 😏
I had some application code from a number of years ago to use as example code, but it was seriously out of date. Nothing like starting from scratch and having to give in and read the docs.
This weekend I’ve been tinkering with #braid some more. I found a very useful implementation of the Hindley-Milner algorithm in #python so I’ve taken that and built on it, incorporating it into my compilation as a new type-checking stage. It’s been mostly successful so far! I can remove all type annotations and let the compiler infer function and variable types, and then use those types in the #llvm IR-generation stage. Pretty happy with that.
The last few days I’ve been trialling various #python IDEs. I use Komodo at the moment, which I quite like, but I’m tiring of it telling me “error occurred, no completions found” maybe half the time I try to use the code completions. I’ve crossed Visual Studio and Eclipse off the list of other options. PyCharm is a contender, except it’s a massive CPU and disk hog, and there are some other little niggles. Not sure what I’ll ultimately choose.
In more constructive news I’ve been writing a small update to #exist for #android to show the user’s mood note from this day last year, if they have one. I’ve missed that feature from the nightly email.
Today and yesterday I spent a little time getting #llvm working with #python, and (sort of) revived #braid, my toy language project. My new goal is to compile my AST into LLVM IR which can then be compiled into a binary. Today this meant adding some type annotations because LLVM IR is strongly typed and I’d like Braid to be also.
I’ve given up using #rpython this time, which is such a relief, but obviously Python is not the best language to write a language in, speed-wise if nothing else… however, it is just for fun and to learn, so it doesn’t really matter, I think. If I really do keep at it, I can always rewrite it in something else, or use the first Braid compiler to write a new Braid compiler in Braid (bootstrapping!). We’ll see.
Spent the afternoon setting up #exist’s new attributes and some basic insights for each. Just need to add the insight templates to the database and I can deploy this lot of changes and tick this card off on our Trello roadmap. I probably would’ve got it all done today, but I went for a long walk down along the creek after the rain stopped, and various things stopped me from getting back into it when I got home.
Later after dinner I worked on #larder for a break and tweaked some onboarding stuff, set up the Campaign Monitor integration (some kind soul has made a #Python-3-compatible API client fork), and started thinking about the #Chrome extension.
Also had a look at some Larder user stats. Disappointed to see a bunch of beta testers never added a single bookmark and still had the gall to fill in the survey! 😒
#RaspberryPi #python The Raspberry Pi challenge project is all coming together the code work and the electronics pick up the sensor changes. Whats next is to get the kids identifying how to change assets in the game and how they are linked to files on the filesystem. I think this might need some video tutorials we can link to or at least something where the kids can spend longer and arrive with an actual structured lesson to work against. now.
So Pygame Zero exists to redress the imbalance in teaching python at school level and allowing code clubs to accelerate access to game coding ideas in classes. So what do I want to do when working through pygame zero documentation and not wanting to be out in my cold office. I forward Xwindows to my OSX machine and keep a terminal open for coding in python. I wonder if there are any nice shell IDEs for Python … who am I kidding its VIm or nothing for me.
I guess that prep yesterday paid off, because today was very productive.
For work, I spent a while writing an extension for Sphinx, the documentation generator I use. Ironically, Sphinx is somewhat poorly documented itself, like the proverbial cobbler’s children. The last few times I’ve worked on this extension, I ended up only reading Sphinx and docutils source to figure out what it was doing. Today, I finally had a breakthrough and started generating the output I wanted to see in the first place.
In the evening, I submitted my first conference talk proposal. I’m fully prepared for my proposal to be rejected, but I’m glad I’m making some concrete progress on my goal to eventually speak at a conference.
Still finding things that need setting up on my new computer. Today it was #pelican, which I use for my blog. Turns out it wasn’t simple at all, so I had to ask @josh to help me figure out the #python issues, which eventually meant we had to set up a virtual environment for it. Also had some issues with the pelican settings, which didn’t like the way I was doing things (even though it worked fine on my old computer with the same pelican version).
Anyway. It’s up and running, and I have a link to my Productive Habits course in the sidebar now.
For work, I did some tidying up of a script that helps me manage some contextual help text. Previously, the script verified the appearance of certain notices based on other UI strings—a fragile, “stringly typed” situation. Today, I updated the script to check on proper database fields. Not a lot of writing today, but it was nice to exercise my programming skills a little.
Today I also did my first review of a contribution from a Python Packaging User Guide volunteer. It’s been a while since I’ve been an editor, so I had to be very careful to distinguish, for myself and for the contributor, between how I would write something and how the writing can be improved. They’re not the same thing! Lousy editors don’t know the difference—even if their own writing is excellent—and I don’t want to be a lousy editor.
Today, I wrapped up a draft of a #blog post announcing the availability of #PHP 7 (I don’t think it’s been published yet, however). Aside from the voice issues I wrote about yesterday, it’s also hard to write about changes to a language I don’t actually use. I did learn a lot about PHP though. Ultimately, I wasn’t super satisfied with I wrote, but it’s not worth spending tons of time on on something that’s ultimately ephemeral.
In other news, I recently wrote a contributor guide for the #Python Packaging User Guide. Today, I notified some volunteers about ways to start contributing. I’m excited to start doing editing work with the volunteers!
Left this draft sitting here from last night. Whoops!
One of the things I did for work was to update some #docs that mentioned a configuration values for third-party service. The configuration values were out of date. It’s one of those things where those semantic web ideas would be nice to have in reality: instead of manually copying and pasting values from one doc into another, it’d be nice to just reference a portion of a page and have the tools take care of the rest.
After work, I went to my first Cambridge #Python meetup. It was a fun activity night, where we worked on the puzzles of the Python Challenge. People were quiet at first, but as we made progress it got livelier. I’m looking forward to the next one.
Today I'm starting to look at how I can bring the current #exist codebase in line with the functionality I wanted out of the planned exist-core v2, rather than rewriting and being susceptible to the Second System Effect. This involves:
- Migrating from #mysql to to #postgres
- Adding the new event stream table with #json-b metadata field
- Potentially migrating to #python 3 (perhaps relying on
- Pruning away a lot of accumulated cruft that wouldn't have appeared in v2
- Potentially open-sourcing the result
Right now I'm on the first step. I'm looking at using pgloader to migrate data into postgres. In the past I've run into issues migrating to postgres (and so quickly gave up) but I'm hoping pgloader will be my shining light.
I finally finished writing the first of my two blog posts on my #interpreter project! Hoping it's a good mix of example code and explanation, and is easy enough to follow with a Python background but no experience writing a language.
In the meantime I've been researching game engines, because I have a small game idea I've been itching to prototype. Given I'm pretty comfortable with #python, I wanted to be able to use that. But most python game engines seem pretty outdated, or badly documented. I think I'll settle for PyGame, which doesn't seem very modern, but at least should be quick to get up to scratch with. I've also been looking at Kivy which is nice and modern, and well-documented, but more oriented towards general multimedia apps — I'm sure I could make it do game things, but I'd rather get up to speed more quickly with something more specific for now. Premature optimisation and all that.
Stayed up a little late last night researching into how to schedule jobs using #Python. Definitely going with a #Cron api. The inbuilt sched module looks nice but I can't deal with the headache of reproducing the monitoring functionality and stuff to ensure that threads that crash get restarted etc. That wheel's already been invented at an OS level.
Just did some #exist #support that had me scratching my head — requests failing because the function didn't exist. Worked on dev, worked in command line on production. I'm still not even sure how it could've got out of sync, but it turns out deleting the #python .pyc file for the offending code fixed it. Grrrrr at you python.
Having a huge week so far. Started out horribly unproductive. Got an amazing contract Monday evening. Data scraping etc. Getting paid really well hopefully. Created a multi threaded #Python #Script running with #BeautifulSoup4 to start it up. Discovered that hosting it on Digital Ocean is a terrible idea (100% CPU usage the whole time). Spun up AWS EC2 instance for the first time in my life. Took 15 minutes and boom! Script was running 10k items every 10 minutes. What a great week so far :)
Having issues with #littlelogs private groups and dynamic databases. Basically I can't dynamically route queries to databases that haven't been predefined in settings, because django-dynamic-router seems to have threading issues (at least in my setup) and the selected database doesn't stick. A pretty fruitless day of work. Going to look at django-tenant-schemas and weigh up switching to #postgres versus some other alternative (maybe generating new DB setting files and restarting django to include them). Still very leery of keeping everyone in the one database (or schema).
Got back into the guts of #curo's task and notifications systems, and worked on some changes to make the Activity feeds more useful and understandable for Carers. Grateful to #past #me that I bothered to write decent #tests for that section. Made troubleshooting so much easier as I broke things along the way.