1. 14

What are you doing this week? Feel free to share!

Keep in mind it’s OK to do nothing at all, too.

  1. 13

    Looking after my newborn son on paternity leave :)

    A little light coding + writing. I’m also continuing to live stream my coding. I’m looking to take on larger projects on stream soon.

    1. 5

      Rewriting my neovim configs in Lua — and I’m having a blast! It’s still somewhat rough around the edges (like the inevitable api.nvim_exec calls for Vim stuff that don’t have Lua interfaces yet) but gosh it’s so much better — and faster! — than Vimscript.

      1. 1

        faster to write, or faster to execute? I’ve been tempted to migrate mine but wasn’t sure if the benefit outweighed the costs yet.

        1. 1

          Both, really. Lua is a lot more performant than Vimscript, and syntactically a lot less mentally demanding. At the moment, it’s still quite “beta” — you need neovim-HEAD for this, and the Lua API isn’t fully done yet. I guess you could wait until Neovim 0.5 comes out and init.lua is a valid entrypoint. That should help you kickstart your Vimscript to Lua migration.

        2. 1

          having to modify my config using vimscript was the main gripe that made me eventually switch to emacs. It’s good to see that there’s work being done on replacing the abomination with something more usable.

        3. 4

          As regular readers with a good memory will know, I compile java and sometimes I post about progress, such as it is.

          Last week’s pain was a refactoring that I need for reification. Reification might be viewed as type improvement — the compiler (or someone else) learning things about the types of… anything, really, and making explicit what it has learned. Learning that an integer is necessarily 0<x<12 can help with performance, and also with correctness, if the compiler has to insert extra code and the decision of what to insert depends on fine-grained types.

          The big goal for my compiler is having GC that’s at as fast and memory-efficient as manual malloc(). That works for some programs, but coping with lambdas and some other things requires much hard work, including some degree of reification, because the compiler-generated code depends very much on the details of what the source code is doing, and getting that coherent is an awful strain. This week I’ll spend whatever time I can on compiling code to see what broke last week and what needs fixing, which isn’t such a chore as it sounds. Most things are quickly remedied, and that always feels like quick progress.

          Or I might read something instead of progressing: This weekend my youngest child and I built a bookshelf for my office. Couldn’t find anything readymade that would fit the space, then recently I saw something made from waxed beech and thought same wood and treatment would be just right, so I decided to leverage the power of child labour. The new shelf looks and feels great. Finally Knuth watches over my work.

          With Knuth looking over my shoulder I shall never again procrastinate.

          1. 3

            $searching-work

            • Back to applying after a few days off.
            • Will try a different approach on my LI profile and current cover letter too.

            $life

            • Piano
            • Lurking more on Raku, HTMX and Tailwind CSS
            • Watching the GeoRacer talk about Elixir/Phoenix/Liveview
            • Prepping for the FOSDEM week-end coming up :D Like every year, my bookmarked talks clashs with each other but due to the online nature of this year, I am less feeling obligated to choose between them. On the other side, the nice parts of FOSDEM will be missed : Stickers, random stand talks, beers with friends and stranger.
            1. 1

              What are you practicing on piano?

              1. 2

                I am an early beginner so I split my learning session in two :

                • 2/3 of the time following Alfred Adult Piano book 1 with whatever piece I have trouble. A lot of metronome practice (my weak spot)
                • 1/3 messing around with scales and constructing chords with them to internalize the “how”. I rediscovered the double harmonic scale like that and for the last days I play with C D# F F# G A C and C D# F G# A# C that I really like.

                I have been inspired to due those when I discovered the theory about tetrachords to construct scales.

            2. 2

              Continuing work on version of my Python memory profiler for batch jobs that is fast enough to run in production. As a side-effect rewriting some C code with PyO3 (the core of the project is in Rust, but open source version had some C). PyO3 is quite nice, they give you not just a high-level API but also the full low-level Python C API, autowrapped.

              1. 2

                $work

                • transcribing an interview and writing an article about it for my library’s Small Business Person of the Month series

                $home

                • trying to move my blog over to my other host and rewriting the engine
                1. 2

                  Somehow corona has got me stranded as a stowaway in my friends huge house. I don’t feel comfortable renting since I need student loans to make rent and the student loans are predicated on passing courses, but I feel the remote university experience is a waste of time tbh.

                  To illustrate what I mean; last semester I had one 5 minute presentation and said something a couple of the other students thought was interesting. They wanted to contact me but could not find my email or any means of contact until 3 months later they found that one teacher had accidentally(?) emailed everyone as CC so they were able to find me. This was my first semester and now I’ve gotten to know these guys (through a couple of video calls) but the level of engagement that the school sets as the baseline is abysmal (probably because before this was a natural effect of showing up in school, they don’t know how to create an online community).

                  For me the whole learning experience revolves around discussing with fellow students and finding the gaps in my thinking - and with the situation as it is I am getting better use of my bandwidth just studying as I used to when I had a day job.

                  Anyway, the alternative, which is to get a job, is not so appealing since that would mean I’d give up my commitment (the masters degree). I’ve looked a bit for something part time but I eventually settled on trying to write some solidity and making money by creating some simple services. The cryptocurrency world was quite welcoming and before I got around to building anything I got to know people who are willing to fund me a bit to work on some ideas I have for how to structure the next generation internet.

                  So this week I am working on a canonical S-expression parser/emitter and then I will build some “node types” for a fledgling propogator network. This is really exciting for me because I went to the university to study these structures with the goal of making my masters thesis this project. Now I have somehow secured funding to work on this project and I’m thinking that if I manage to make good use of this opportunity I may be able to graduate into working for myself.

                  Exciting times.

                  1. 1

                    $work

                    • Fighting with signing things correctly so that systems which required signed information can trust my payloads
                    • Waiting for a (metaphorical) storm to finally land
                    • Thinking about system design, deployment, infrastructure evolution and a useful first step to take

                    ! $work

                    • Being impatient for deliveries. Desk controller coming from Canada and Smart Thermostats (Tado) likely won’t arrive this week, but one might!
                    • Got a couple of websites to archive. One is taking a static snapshot and hosting that, the other is redirecting pages through to useful places on the replacement website.
                    • Starting a new month of exercise, hit most of my challenges/goals last month. Need to pick some more for this month, and then stick with them. I fit in more clothes than I did in December, but I’m not convinced I’ve lost much weight. (Not unhappy with this, slow and steady.)
                    1. 1

                      learning some more banjo, trudging my way through two books for classes (Trouble In Paradise by Zizek and Blood Rites by Ehrenreich). trying to read more category theory stuff, but I’ll only get to it if I finish those two.

                      1. 1

                        Outside work, I’m trying to reverse-engineer the IR protocol for an AC. Y’all are welcome to help!

                        Hitting “power” on the remote yields a message like this:

                        110000010110000000100000000000000000000000000000101110011100100000000000000000000000000000000000000000000110000111000000001000000000000000000000000100000000000010010000 
                        

                        I’ve recorded one message for each temperature level the remote can set, the bits that change are, oddly(?) spread out across the message. H,M and ? changes with the clock in the remote. T changes with temperature. _ indicates the bit is the same in value in all messages so far.

                        ____________________________TTTT_________________HHHHH___MMMMMM__________________________________________??????TT______________________________T_______________________T
                        110000010110000000100000000000000000000000000000101110011100100000000000000000000000000000000000000000000110000111000000001000000000000000000000000100000000000010010000
                        

                        If you collapse the message and just look at the bits that change with temperature setting changes, these are the bits for each temp level (in F, on the remote anyway):

                        61 00001100
                        62 00001111
                        63 10001100
                        64 01001100
                        65 01001111
                        66 11001100
                        67 11001111
                        68 00100100
                        69 00100111
                        70 10100100
                        71 10100111
                        72 01100100
                        73 11100100
                        74 11100111
                        75 00011000
                        76 00011011
                        77 10011000
                        78 10011011
                        79 01011000
                        80 01011011
                        

                        If anyone has IR experience and/or likes puzzles, let me know if you see the pattern. I may just end up encoding these in a table, though that feels like cheating :p

                        1. 6

                          I can help with the first four bits: It adds 0.5°F, then converts it to °C, subtracts 16°C, and the bits are in reverse order.

                          In Python:

                          def bits(temp_F):
                              return bin(int( (temp_F + 0.5 - 32)*5/9 ))[3:].zfill(4)[::-1]
                          
                          1. 1

                            Oof! Awesome.

                            The last four are interesting.. there’s definitely a grouping. A list of temp in C, minus 16, vs bit pattern seems to say they group incrementallyish. Wonder if it’s some sort of checksum or mask. As I’ve understood it IR protocols are prone to include redundancy or similar, given the shoddy transfer medium.

                            bits temp_c_minus_16
                            1100 [0.39, 1.5, 2.06, 3.17]
                            1111 [0.94, 2.61, 3.72]
                            0100 [4.28, 5.39, 6.5, 7.06]
                            0111 [4.83, 5.94, 7.61]
                            1000 [8.17, 9.28, 10.39]
                            1011 [8.72, 9.83, 10.94]
                            

                            edit: staring at this, definitely something about the fraction right, it splits cleanly around .5; all the ones that are >.5 end in 11, and the ones that are <.5 end 00

                            1. 4

                              The next two bits seem to be the bitwise not of the {uppermost bits, division by 4} of (°C - 16). You noticed that the last two bits follow (°C - ⌊°C⌋) > ½, but they also correspond to the 4th bit to the right of the decimal point.

                              All together in Python:

                              for f in range(61, 81):
                                  print(f, end=' ')
                                  c = (f + 0.5 - 32)*5/9
                                  c = 0xff & int(c * 2**4)
                                  c = list(map(int, bin(c)[2:].zfill(8)))
                                  c[0:4] = c[0:4][::-1]
                                  c[4:6] = [1 - b for b in c[2:4]]
                                  c[6] = c[7]
                                  print(''.join(map(str, c)))
                              

                              I’m not entirely satisfied with this explanation, but it’s the best I can think of.
                              To know for certain you could always dump the code off of the remote and reverse engineer it. :P

                          2. 3

                            Checkout the content at analysir. They sell a product but Chris is also an expert and his blog posts may be helpful.

                            https://www.analysir.com/blog/tag/decoding/

                            1. 1

                              Oh wow, that’s super in depth, thanks for this!

                          3. 1

                            Somehow corona has got me stranded as a stowaway in my friends huge house. I don’t feel comfortable renting since I need student loans to make rent and the student loans are predicated on passing courses, but I feel the remote university experience is a waste of time tbh.

                            To illustrate what I mean; last semester I had one 5 minute presentation and said something a couple of the other students thought was interesting. They wanted to contact me but could not find my email or any means of contact until 3 months later they found that one teacher had accidentally(?) emailed everyone as CC so they were able to find me. This was my first semester and now I’ve gotten to know these guys (through a couple of video calls) but the level of engagement that the school sets as the baseline is abysmal (probably because before this was a natural effect of showing up in school, they don’t know how to create an online community).

                            For me the whole learning experience revolves around discussing with fellow students and finding the gaps in your thinking - and with the situation as it is I am getting better use of my bandwidth just studying as I used to when I had a day job.

                            Anyway, the alternative, which is to get a job, is not so appealing since that would mean I’d give up my commitment (the masters degree). I’ve looked a bit for something part time but I eventually settled on trying to write some solidity and making money by creating some simple services. The cryptocurrency world was quite welcoming and before I got around to building anything I got to know people who are willing to fund me a bit to work on some ideas I have for how to structure the next generation internet.

                            So this week I am working on a canonical S-expression parser/emitter and then I will build some “node types” for a fledgling propogator network. This is really exciting for me because I went to the university to study these structures with the goal of making my masters thesis this project. Now I have somehow secured funding to work on this project and I’m thinking that if I manage to make good use of this opportunity I may be able to graduate into working for myself.

                            Exciting times.

                            1. 1

                              work:

                              • I’m preparing documentation in anticipation of $newjob

                              non-work:

                              • I’ll probably start working towards a FIDO2 token implementation for fidati
                              • more bike riding!
                              1. 1

                                Hope to finish first draft of my Python intro book (https://learnbyexample.github.io/100_page_python_intro/). One chapter and a few todo items left. Would appreciate feedback if someone’s interested in going through the content written so far. I’ve learnt a lot writing the book - took up this project mainly to improve my understanding of Python (and catch up to some of the latest features). If all goes well, looking to publish it next week.

                                Will likely read Heart of Ice and/or Half a Soul - both feature fairy/faerie.