11
votes
What programming/technical projects have you been working on?
This is a recurring post to discuss programming or other technical projects that we've been working on. Tell us about one of your recent projects, either at work or personal projects. What's interesting about it? Are you having trouble with anything?
I've been working on my bespoke IoT smart lighting system, based around the ESP32 microcontroller. I've been dabbling with it off and on for years, but I recently decided to start over from scratch, motivated by a desire to get rid of any and all dependency on the Arduino platform. I've been messing around with Arduinos for awhile, but my feelings toward it have really soured the past couple of years.
I wouldn't hesitate to say my project is over-engineered, but I'm really learning a fuck-ton about embedded development and C++ (I'm primarily a web dev). I designed my own RGB LED strip driver circuits and had the PCBs manufactured, and they work great. The firmware is built on the official ESP32 development framework. I've got it working nicely in my IDE of choice, including the JTAG/OCD debugger (truly a godsend). The code - mostly minimal abstractions over the ESP32 framework that are more comfortable for me, as someone used to higher level languages - is organized into decoupled components and unit tested (fuck yeah).
Even though I almost certainly won't ever utilize it as much to justify the work I'm putting into it, I've been working on a custom encoding scheme for the data communication that is (ideally) both fully featured and simple enough to decode and parse at as high a "frame" rate and as close to real-time as I can manage. There've been a dozen iterations, but the solution I'm at now I think is as good as I think it'll get. Basically, I make sure the the data is encoded exactly as the data structures are. The data is dumped into one of a rotating pool of buffers by the socket and it's queued for parsing on the ESP32's second core. I just cast the data inside the buffer as whatever structure the header byte determines. I don't have to do any manual arithmetic to decode or make intermediate copies of the data. I'm not experienced enough with C/C++ to say whether or not it's a clever or good solution, but I certainly feel clever for figuring out I could do it like that.
All in all, even if the project is really unnecessary, I'm glad to be expanding my boundaries into lower-level software and proud of myself for striving for more professional standards in my personal projects.
This sounds amazing! Do you have a repo somewhere I can refer?
Thanks! It's private for now, but I will work on changing that and will let you know when I do. In the meantime, if there are any specific ESP32 questions I can help you with, feel free to PM me!
dope. I’m definitely gonna look through the code for some inspiration when I get home!
by the way, at what point do you decide “okay, I got enough done to put this into a public Git repo.” ?
Nice job. I wonder if you could integrated memcached after you switch to Postgres. That'd make it snappy and not rely on database so much. Thoughts?
Waiting for my exams to be over, will finally be free on 4th September. Have been stuck in tutorial hell for Django for a quite a while now; need to better my SQL, Python is solid, and am learning Javascript more for some basic frontend design with React and learning MERN. Might be split out a bit too much since I'm not really a programmer, have a non-CS major and have to focus on Stats on the side as well, but eh its all good fun.
PS: I need to find a developer mentor from somewhere.. no idea where tho since all the good programmers in my country end up learning for better pay in Europe/America.
Continuing to futz around with this little project.
an early, naïve implementation of a polynomial data-structure.
printing a single-variable polynomial.
If I continue writing out a polynomial along those lines, I think I can store a vector of vectors for variables and their degrees. E.g.
((1, 2, 4), (1, 3, 5), (2, 3, 4))
where the first variable (say, "x") exists in the 1st, 2nd, and 4th degrees, etc. So... the solve function would have to accept a vector of values that correspond with the length of the first dimension of the vars+degs vector, check to see at which degree that variable exists, and calculate accordingly.My first thoughts on how to do this, anyway. I'm sure (hope) I'll think of a better way to structure the data. But, it seems to work as intended at the moment, which is nice.
I'll also think of a way to rewrite
fmt
in a more functional-style. But, again, works as intended.I am trying out simple video game design with pygame, but finding it hard to wrap my head around the domain and terminology. I am referring to a couple of tutorials on YouTube, but any suggestions welcome!
Thanks! I work with Java at $DAYJOB and have worked with Python before but it has been all abstract logic with minimal input. You are right that lower level of pygame is making a few things difficult, for example with significant boilerplate.
Would you recommend Godot? Does it provide higher level abstractions that can make initial liftoff a bit easier?
If you want to try MonoGame, it's really good to get started programming games. It's C# which is not too far from Java.
If you want to code in Java though, something really cool is libgdx.
Nothing super excited at the current moment. I've been kinda-sorta-half-assed learning Go for a while but with some recent changes in my current role I'm likely going to need to know it in the future so I'm building anything I can with Go. I'm not really good with hands-on learning from tutorials or examples, the practice problems never can hold my attention, so I've been re-writing some of my various code I've written at my job into Go. Re-writing scripts and then setting them up to be run using gorun, we have some super janky old webpages and api's in different languages that I'm building new versions of using buffalo (they really messed up calling it gobuffalo and not buffago in my opinion). All in all I'm having a hard time thinking of the last time I enjoyed programming this much. I spend a lot of time working in python2/3, bash, perl, and php, but I've found its been trivially easy to prove Go is as good if not better of a choice for all the situations, it has a low learning curve which is great because I'm going to have to teach it to all my team members eventually, and best of all is that IT ISN'T PYTHON!!!! :D nothing strictly against python, if you like the language and it works for you, keep using it. I personally find it to be one of the most frustrating languages to work with and every design decision is they made the opposite choice of what I would have chosen, whereas go is a lot more in line with me.
I used DarkSky for weather forecasts for quite a while, including the Android app. Apple has recently bought DarkSky, disabled the Android app and closed access to the API.
I figured this was a great opportunity to play with a Python web scraper. Then, once that is done, my original plan was to create an API based off of the web scraper for personal use.
Here is the output of the program, as it stands now:
Now: 88˚ Humid. It feels like 95˚.
High: 92˚
Low: 70˚
exec time 0.18 seconds