1. 16

This is the weekly thread to discuss what you have done recently and are working on this week.

Be descriptive, and don’t hesitate to ask for help!

  1.  

  2. 12

    I finally published the code for C coroutines I mentioned last week (works for 32-bit Linux, 64-bit Linux and 64-bit Mac OS-X) and just finished a writeup of how it works. The code itself is simple, but it wasn’t simple to write. And it’s a bit tricky in how it works.

    1. 9

      $WORK:

      New job! Currently am helping to agitate the dev team into closing out the accumulated backlog of PRs and branches. For a team of 4.5, we had something like >50 branches open for no reason, so got that sorted, and a whole bunch of outstanding PRs which is down to a more managable 2:1 ratio. I usually like having about 2 per dev, one showing the main task and one as a sanity break project.

      I’m also fixing some rendering glitches and finishing up a feature that a contractor left, so that’s fun. Aaaaand they’re thinking about embracing the AGILE because we’re not AGILE enough to AGILE. :-(

      $NOT_WORK:

      Turning two RPi2s into door counters, probably with OpenCV. There’s an excellent project that already does this, but I may have to write a simpler version to solve a couple weird things at the place I’m installing it. In exchange, though, I may get a discount for some services, so that’d be nice.

      $LOBSTERS:

      This is the important one, honestly, and I need your help!

      I’ve had a nagging feeling that something is off in the way that flags are being used on comments and stories–especially looking at incorrect use of tags like troll and incorrect, but sometimes others. If anybody sees a comment or story that they think is being flagged incorrectly, please message me a link to it so that we can keep track. Don’t waste time on doing that for my comments, obviously–I’m only curious about other data points. Thank you!

      1. 5

        Hey angersock,

        I’m happy to provide feedback as you request.

        As I’ve said in the past, and IIRC I’m not the only one to speak up, the flags are not sufficient to cover all the use cases. The most important one missing is “snarky” / “smartass” (or some agreeable definition).

        There are a lot of spectacular egos around here, and speaking to each other in a condescending tone is way too common. In the past I’ve been told that “that comes under troll”, or words to that effect. It would be much nicer if it was easy to flag something as “not strictly trolling but you’re being needlessly unpleasant, condescending, or inflammatory”.

        I think snarky would nail this. :-)

        Just my 2¢.

        David

      2. 9

        I’m taking the entire week off work to finish my TLA+ Manual. Most of the remaining stuff is polish and cleanup, but I also want to add more examples of real-world use. I’ve been writing this since November and am really excited for v1!

        1. 1

          Is your manual intended to be an easier to grok intro than Lamport’s books on the subject? (This is awesome, btw)

          1. 3

            Yeah! I’m aiming to make this as beginner friendly as possible. For example, it assumes you’re going to be writing your specification proper in PlusCal, so it completely skips over primed notation. The examples are also a lot simpler, like instead of memory caches it’s things like “not going over your API’s rate limit.” I think one of the biggest challenges to teaching formal methods is convincing people that it’s learnable and useful to them. Like I’m a web dev and TLA+ has saved our company several engineering-weeks, but there isn’t anything out there that suggests it’s useful for our kind of work. That’s what I want to change.

            1. 2

              This is amazing! I once tried to convince my manager to let me spend a portion of time studying this topic, but it was really hard to explain the justification for it, especially when we were in a very maintenance focused time. (Though, honestly, that seems like the best time to invest in learning, but I digress)

              Anyway, thanks for taking this on! I can’t wait to hear that manager (not mine anymore) suggest to his reports that they invest in this new thing called “Formal Methods” that helps you ensure rate limiting, and things like it are correct. I’m sure he’ll also say it’s a game changer, like TDD. :)

          2. 1

            TLA+ definitely has my interest, thanks for providing this resource!

          3. 8

            $work looking for a new sysadmin / devops role - the ongoing job hunt…

            ! $work moving house so networking all the rooms with wired / wireless access points - and seeing if I can build a music streaming service around the house using VoCore’s

            1. 4

              VoCores look interersting. Do you have any experience using them? I’m surprised that I’ve never heard of them.

              1. 5

                I’ve been playing with mine on and off for the last month - they run OpenWRT, thus it can act as a wireless access point, it’s a fun little system. I’m going to see if I can make a homebrew cable to provide 5v over POE but to break it out of the ethernet cable to plug it into the micro usb power socket so that it can be on the end of just an ethernet cable.

            2. 6

              I almost finished with design of my text editor’s event loop and then I thought to myself that it’s too complicated. I will do something more in line with the “Write code that is easy to delete, not easy to extend.” quote. All this got me into thinking.

              Everything would be simpler if poll on file fds would work as one expects. Also I would like to have simplified /dev/poll-like interface. I’m sure that I miss something. But at least it could be simpler/nicer epoll (it could still have something like EPOLLONESHOT and EPOLLEXCLUSIVE).

              I checked a bit how emacs and vim save files. It seems that emacs will always do something like this (from my memory):

              open(path)
              open(path~, creat|wronly|trunc)
              fchown(path~, same as path)
              loop { read(path, buf); write(path~, buf) } # manual copy of path to path~
              # no fsync here
              
              open(path, creat|wronly|trunc)
              write(path, the file)
              fsync(path)
              unlink(path~)
              

              I forgo all the stats and additional fchowns/fchmods. Vim will do something similar while editing user file as root (with additional nofollow in creat case) and simple rename(path, path~) open(path, creat|wronly|trunc) write(path, the file) unlink(path~) otherwise. I will probably go only with the first. Although I have to think how to deal with running as root as people usually don’t like to run X11 programs as root (not that terminal with su/sudo in it is much more secure from X11 shortcomings). I could probably fork for running of external commands and i/o and then drop privileges.

              Having said all that the baby takes most of the time outside of work, but I have some time to think.

              1. 2

                Don’t bother with polling regular files, they are always ready to read and/or write, so it’s a waste of time (most Unix systems today aggressively cache files anyway). select() (and kin) are really meant for I/O devices like network connections and TTYs.

                1. 2

                  I know, but there are slow filesystems and large files. It always infuriated me that programs hang on loading or hang indefinitely when sshfs connection dies. That’s why poll would be useful. Without it I have to do this in separate thread.

                  However open, fchown and other syscalls touching filesystem can also hang. And they can’t possibly be polled so maybe it’s really waste of time anyway.

              2. 6
                • Toying around with os development using the Little OS Book.
                • Some rails dev for a CS project at school
                • A bunch of CS and math tests (yay.)
                • Got an FPGA development board yesterday so I’ll try to fiddle with that and hopefully build a Lisp processor - no idea what I’m doing yet, but I’m excited to see how that goes. Anyone have tips/resources for a hardware noob designing FPGAs?
                1. 3

                  What kind of FPGA? I had to use a Nexys 4 for my project, so that meant using Vivado, which I really disliked. In general I’m not sure if hardware development is my cup of tea, so maybe you don’t find it as terrible. But I don’t like the tooling in general.

                  A small tip, if you use Emacs: Emacs is not too bad for vhdl and has a major mode for that already. I mostly used that instead of the built-in editor for writing the code.

                  1. 2

                    I bought the Altera Cyclone II off Amazon ‘cause it was cheap. I’m probably going to use Verilog, since I’ve seen lots of examples on github with that, but I haven’t done anything with a hardware description language, so I’m not sure yet.

                  2. 1

                    How do you like the Little OS Book? This is my first time hearing about it!

                    1. 1

                      It’s OK at giving a high level overview of a simple OS, but I’ve had to supplement many details with this tutorial and the osdev wiki. It’s definitely worth having open as a reference, though.

                  3. 5

                    Making slow progress on the Mono port to Haiku. I’m dealing with some very strange issues with the runtime, and I’m documenting it as I see it for upstream or someone else to notice.

                    Perhaps I should have picked something easier to port…

                    1. 3

                      Godspeed! That kumpera fellow doesn’t give much detailed feedback, does he?

                      1. 4

                        I suppose it’s a combination of CoreCLR taking attention away from Mono when it comes to libre .NET, and the paid employees working on it mostly care about the mobile targets Microsoft uses it for.

                        Still, it would be nice to have some help. Someone in #haiku is trying to help, at least, and upstream Haiku did fix some pthread bugs, so…

                    2. 5

                      I previously posted here about the hardware point multiplier that I had to program in VHDL for a class/project. And I finally managed to make it work! It was pretty interesting to do hardware development and doing basic cryptographic work. The implementation is nothing fancy; it currently works on the NIST p192 curve, but the construction is generic enough that different curves could be supported, too (if the modulus algorithm was implemented for those). Now all I have to do is a write up. If someone knows good papers/online books and wants to share them, please send them my way!

                      On another note, this is the last week of my exams and my birthday is also on the very same date as the last exam.

                      1. 5

                        Trying to get the last few bugs out of F5Bot, my free social network monitoring service. I think I’m going to rewrite a lot of the parser code today.

                        1. 4

                          I have stood up a Ubuntu VM to do my work in, and, sigh. I’d really prefer NixOS but the amount of fiddling necessary to get our strangeish environment up and running cut into my actual time to do work. So, Ubuntu. Ugh. Anyway, this week I’m working on embiggening our ability to parse the metadata of PyPi packages.

                          Otherwise, we’re moved in, and my wife has two weeks to go before her mat leave starts. Getting things ready for Baby #2 (March 29th), enjoying the early spring weather here in Toronto. Recovering from yesterday spent at urgent care after I dropped Number One Daughter and she hit her head on a cabinet before I caught her. That wasn’t fun.

                          1. 4

                            Scaling a DNA analysis pipeline, which seems like it’ll be fun.

                            Got a replacement laptop, and put linux on my mid-2012 11" Mac Air. Linux with good hardware sucks much less!

                            1. 4

                              This is my last week at a job I’ve been at for 6 years. I don’t have plans for what’s next beyond getting into shape, doing some traveling, and maybe finding an open source project to work on.

                              1. 4

                                Implementing tar create, list, and extract in rust.

                                1. 4

                                  I finally finished replacing the six 40mm fans in my Sun T5220 with three (quiet!) 60mm Noctua fans, and I can now tolerate sitting next to this beast while it’s running (although the PSU fans are still moderately noisy). I think I installed the fans correctly, although I do get a few warning messages about voltage readings dropping below a critical level. I’ll need to investigate those messages in greater detail.

                                  My remaining concern was cooling efficacy. Will these quieter fans move enough air to keep the system comfortable? I booted the server while observing temperatures from the environment monitor, and WOWZA it quickly peaked at 90C, at which point I think the CPU got downclocked to prevent overheating. Documentation seems to indicate there is a soft limit at 95C and a hard limit at 100C.

                                  As you can see from a photo of the motherboard, the top of the heatsink is rather flat. I decided to run with the crazy idea of mounting a second heatsink on top. I happened to have a spare hunk of aluminum lying around, so I applied some thermal paste, mounted it on top, and repositioned a fan for active cooling. This dropped CPU temperatures to 64C, which I think is a great improvement. However the case no longer fits on the server.

                                  1. 4

                                    $WORK:

                                    Very possibly resurrecting an old distributed load balancing project of mine, except with less Node.

                                    non-$WORK:

                                    Someone on StackOverflow was dismayed when I answered their question about a raw-quote operator in Perl by telling them that there isn’t really one. (Even single quotes and q{} allow backslashing the closing delimiter, and require backslashing backslash. The only exception is single-quoted here-docs, which are cumbersome). So, just because I could, I wrote one. Part of me hopes that no one ever uses this module, but I still enjoyed creating it.

                                    I also got my hands on a TAPR TICC time interval counter with sub-nanosecond resolution, and am using it to characterize my “atomic” clock/NTP server. The encouraging news is that it says that for many timescales, my clock is more accurate than any of the standards I have to compare it to. The discouraging news is that characterizing an unknown oscillator using only less-stable references has a few problems with numerical stability. Which means I have to spend more money on this silly hobby :)

                                    1. 4

                                      I worked on elm-fuse and got some core features working, like if..else branches. I’ve had to implement them slightly differently to standard Elm, but it actually ends up following the same patterns as production Elm. I’m pretty happy with were it is - I need to do some big refactors still in order to handle events in a better way, but it’s looking good. My next plan is an alpha release so people can play with it.

                                      I improved elm-xml quite a bit by adding converters to and from JSON, which I needed for elm-fuse.

                                      elm-ffi has been getting some attention and usage, so I’ve been thinking about making it work as a post-compile step. Should be pretty easy to do.

                                      I’m also going through and reviewing a few community packages by request. Mostly just giving feedback on API design, bugs, etc.

                                      1. 4

                                        For anyone else simultaneously confused and excited, it’s Fuse the iOS/Android app framework, not fuse the userspace filesystem interface.

                                        1. 1

                                          Would it be more exciting if it was? I can make that happen too, I’m sure

                                          1. 1

                                            Honestly, I’m already excited about Fuse-the-app-framework!

                                            This is the first time I’ve heard of this Fuse, though. How does it compare to React-Native?

                                            1. 3

                                              Disclaimer: I currently work at Fuse.

                                              There’s actually a blog post about it here, though it’s slightly out of date. It discusses a lot about the design philosophy behind Fuse.

                                              Without going into too much detail though, Fuse works by having a markup language which is designed to be declarative. React Native is designed so that you can write React but compile it to native components, which means that you can end up with some rather scary code. One of the problems that elm-native-ui[1] had was dealing with generating all this React Native code. Fuse, on the other hand, is really really easy to target from Elm. The model of using a UX markup language that is statically designed works really well with Elm, since it’s also declarative. Fuse has built in observables, which are trivial to map Elm’s ports to. I’ll have a full blog post on this at some point

                                      2. 3

                                        Integrating amazon sales into our workflow. They’re going to be doing the hardware fulfillment on smaller orders, so I have to work on all the patching up between our existing self-contained system and this new world where amazon already took their money. Normally we get payment as the last step of the process, but this will be reversed now for those customers.

                                        1. 2

                                          This week, I’ll be digging.

                                          Last week, I dropped some flags to mark out the grade for a set of swales (using my slapped-together magic level checker 9000 (looks like a level on stilts)).