Threads for amir

  1. 2

    some call it RPC, some RCE

    1. 1

      true. in this case the name of the procedure call is bash.

    1. 2

      I’ve never used TypeScript but am I correct in assuming that this package has translated:

      Parameter ‘onCancel’ implicitly has an ‘any’ type.

      to:

      I don’t know what type onCancel is supposed to be, so I’ve defaulted it to any.

      ?

      The TL;DR isn’t shorter, nor more clear. Probably a bad example for a prominent show case.

      1. 6

        There’s a better (in my opinion) example on the demo website:

        Conversion of type 'string' to type 'string[]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.

        is translated to

        You can’t use ‘as’ to convert string into a string[] - they don’t share enough in common.

        1. 4

          You’re correct that it has translated it that way (and accurately). If you’re used to doing the work of translating type errors into what they mean in your head from working in other typed languages, it may not be more clear… but it is, in my experience, much clearer and easier for someone reading along who is learning the language. Also: brevity is not always better for clarity (some opinionated manuals of style notwithstanding), and tone can go a long way to making the language feel more approachable to folks who are new to types—which is many, perhaps most TypeScript developers when they first start, given they’re coming from JavaScript.

          1. 4

            Just to clarify I was not criticizing the goal of the project. I was only suggesting that perhaps another example would be more enticing given that’s the first thing a prospective user will see.

            1. 1

              Ah, I see – I agree that @cherryblossom’s sibling comment would indeed be a better motivating example!

          1. 8

            I’d love to work with this guy

            1. 7

              I’ve been lucky enough to have and highly recommend it if you get the chance!

            1. 4

              I like the name!

              I’ve often resorted to self-learned breathing exercises to calm my mind to the point where there’s not much else floating around in there. I wish I’d learned it sooner, back when I was studying. I think this tool might actually be very helpful to others who want to experience the difference that simply breathing can make in your day-to-day life.

              Nafase Amigh! :P

              1. 3

                Beautiful name! It’s not everyday that you get to see projects named like this in the front page :)

                I’ll go a step further. Zharf-dam (ژرف‌دم) or Dam-e-Zharf (دم ژرف) :P

              1. 1

                https://i.imgur.com/hgscg9W.jpg

                • Phanteks P500 (x570, R9 3900x, RX 5700 XT, 32G 3600C18) running Debian testing and i3-gaps
                • Samsung U32J590
                • Kinesis Advantage
                • Logitech G603
                • Schiit Asgard 2
                • M-Audio AV 40
                • Sennheiser Momentum M2
                • Mac mini (2018)
                • Lenovo ThinkPad E470 running Debian testing and i3-gaps

                And Work MacBook Pro

                1. 1

                  Does the “and” in “Web assembly and eBPF” in 5 technologies to watch in 2021 mean that there are efforts to leverage WASM in eBPF or is it that here are 5 technologies to watch in 2021, but they’re actually six?

                  Or is it meant to capture the broader concept of VMs and limited binary instruction formats that are gaining traction?

                  1. 2

                    I’d say you’re right, it probably represents “Emerging binary instruction format standards”. Despite one being in the “web” space and the other in systems, they have a lot of parallels.

                  1. 1

                    Why are the timestamps wrapped in Option<>?

                    1. 6

                      it’s common to disable atime etc… I can’t count how many bugs I’ve had to deal with over time due to misunderstandings of mtime, ctime, atime etc… Making the ones other than creation time optional is a nice technique for reducing bugs due to representing a type that might not actually be present by some placeholder value that only those who have already been burned enough times might remember to properly handle next time.

                      Translating many types of common gotchas into compile-time constraints through types like this is one of the biggest timesaving features of Rust as I use it.

                      1. 2

                        But as soon as anyone stats it you’re going to have to make up values for them anyway. I’m not aware of any “real” filesystems (*nix ones, anyway) that have any analogous notion (however encoded) of a timestamp that might be missing, and I’m having trouble thinking of a case in which a filesystem-internal operation would be doing anything with the semantic value of a timestamp other than reporting it to a running process (via an API that doesn’t support Option<>), so I still don’t really see the point.

                        And just to be clear: I’m not an anti-rust partisan or anything (in fact I’ve been introducing bits of it at my current job) – this particular pattern just seems like additional complexity for no discernible benefit.

                        1. 2

                          Making the ones other than creation time optional

                          Creation time is mostly useless. Hell, Linux didn’t even have an API to read the file creation time until recently.

                          Modify time on the other hand is how things like make work.

                          1. 7

                            It doesn’t matter if it’s useful to you or not. If a file has been created, then it has a creation time. It will not have a modified time until it is modified. The purpose of the Option is to signify when something does not exist, without resorting to error-prone magic values.

                            1. 5

                              Huh? Creation time is super useful for end users. I often sort Finder windows by creation time, especially of documents I’ve created.

                          2. 1

                            Disclaimer: not the author.

                            created_at is not an option but accessed_at, modified_at, and changed_at are which makes sense in the way that a file may not have been accessed, modified or its properties changed since its creation time. It could also be there for ease of implementation of features like noatime mount option. However, currently code is initializing all of them to the same value when instantiating an Inode so not sure whether that argument holds water.

                            1. 1

                              Yes, that is exactly the reason. And right now I’m initialising the values to mimic the behaviour from my local machine (APFS).

                          1. 5

                            I’ve a somewhat similar setup but have been looking for something like redshift/f.lux without all of the dependencies. It should automatically transition between temperatures, gradually, based on time of the day (not a sharp transition at a set start and end time) and should do this throughout the year without requiring to be told that sunrise/sunset times have changed. So I wrote this: https://github.com/amir/sctd

                            And I simply put the following in my .xinitrc:

                            sctd --latitude 53.3498 --longitude -6.2603 &
                            
                            1. 1

                              I am going to try this out. Thanks!

                              1. 1

                                The is the simple sct command from Ted Unangst. I use that as a cronjob every 30 minutes to change the color, using a ratio based on the current time offset compared to 2:00 pm (value randomly chisen by me). The closer I get to 2 pm, the closer the color is to 6500 (no red). The minimum value is set to 3500, which can be seen at 2:00 am. I can get you the script if needed.

                              1. 4

                                I’d love to post a LogicT implementation using Haskell but normal sudoku using LogicT is the final assignment for the “Functional & Logic Programming” class I’m teaching. Will have to wait a month or so, sadly!

                                1. 2

                                  I presume this is the course? https://course-profiles.uq.edu.au/student_section_loader/section_1/106673 I’m definitely pushing my luck but is any of the material open to the general public?

                                  1. 2

                                    Lectures and pracs are public:

                                    https://gitlab.com/comp3400

                                    Assessment isn’t public. We’ll see if we can make it public after the course is finished. Maybe, maybe not.

                                1. 2

                                  I’ve been working on a simple redshift/f.lux replacement for Linux based on Ted Unangst’s sct. You can give it your location’s latitude and longitude and leave it running and it’ll transition between suitable temps: https://github.com/amir/sctd/

                                  1. 15

                                    FWIW GitHub is not being blocked in those regions, GitHub is blocking users from those countries.

                                    1. 3

                                      Author here. Good point. Corrected.

                                    1. 3

                                      Being an Iranian and all decided to migrate everything from https://github.com/amir to self-hosted https://git.gluegadget.com/. I gave sourcehut serious thoughts and happy to pay for and support it but don’t want to put @sircmpwn in a difficult situation where he has to terminate a customer’s account to comply with regulations. I’ll keep my github account for the social-networking aspects of it though, but will be making all repos mirrors.

                                      1. 2

                                        Erica Klarreich is a very good author. I’m unfamiliar with most of the maths subjects she covers but she does an impressive job explaining the concepts to the uninitiated in an easy-to-read narration. Not only I get to read a good story, but I also learn something.

                                        1. 3
                                          • Miniflux (RSS)
                                          • Jira (Kanban style project management (side projects, house renovation, etc.))
                                          • Gitea (Git)
                                          • Drone (CI)
                                          • NetData (System monitoring)
                                          • OpenVPN
                                          1. 6

                                            Jira, as in Atlassian’s?

                                            1. 5

                                              Yeah, you can buy a license for $10 and self-host it. it’s a bit of a memory hog running on the JVM though. Unfortunately the alternatives I tried didn’t quite fit my use-case for house renovation project management.

                                          1. 3

                                            Although it’s simple enough to be added as an alias, I’d recommend using the function. The function re-evaluates date each time its run, while the alias only evaluates it when your bashrc or zshrc is evaluated.

                                            You can define your alias using single quotes and it’d have the same effect.

                                            alias lb='vim ~/logbook/$(date "+%Y-%m-%d").md'
                                            
                                            1. 27

                                              I was accepted to the Recurse Center and am arranging the logistics of moving to NYC from mid-September to mid-December. If anyone in NYC would like to meet up, message me. I plan to study category theory, dependent types, and, if I can find a study buddy, tools like Coq and TLA+.

                                              Codewise, I’m tinkering ahead on my current Haskell practice program, a solitaire solver. I’m also making demo Rails apps for my two factor authentication Rails gem.

                                              1. 4

                                                Check out @hwayne’s tutorial on learntla.com since it’s on a practical subset. Also, Alloy Analyzer has long been used to do something similar for structural analysis of programs with ease of use vs Coq etc.

                                                http://learntla.com/

                                                http://alloy.mit.edu/alloy/

                                                Hopefully, you master it all. TLA+ and Alloy just knock out lots of low-hanging fruit with relatively few people quiting due to difficulty like what happens with big-time provers.

                                                1. 3

                                                  Great news, looking forward to the blog posts! Is there something similar to Recurse Center in Europe?

                                                  1. 2

                                                    There was “Hacker Retreat” in Berlin that was explicitly inspired by Recurse Center, but it disappeared in October or November 2015. I’m not aware of others, but I haven’t looked.

                                                  2. 3

                                                    Glad to have more RC people here. Enjoy!

                                                    1. 2

                                                      This is wonderful news! Looking forward to hearing all about it :).

                                                      1. 2

                                                        Congrats again, we’re looking forward to having you :)

                                                      1. 1

                                                        Takes a while to get used to but this has helped me several times: https://github.com/adrieng/xrandr-nightmode I’m not running it every night though.

                                                        1. 8
                                                          • Learning Japanese
                                                          • Running (goal is to be able to run 100k races one day)
                                                          • Bouldering
                                                          • Reading (When In French at the moment)
                                                          • Code a bit, here and there
                                                          1. 2

                                                            At first I thought it’s a typo, 100k instead of 10k then I Googled and it seems to be a thing, and an impressive one on that.

                                                            1. 2

                                                              It is definitely a thing and I’m still as impressed as you! I’m sure it’s terrible for your body, but damn… It’s an amazing feat.

                                                              1. 2

                                                                I’d think it’s probably not all that terrible if you can do it with great form and/or minimal footwear. It definitely wears you out for a matter of weeks, but I’d guess it doesn’t have to be too damaging in the long run.

                                                          1. 8

                                                            Tehran, Iran.

                                                            1. 3

                                                              Elsewhere in this thread I was talking about how having Iranian internet probably blocked you off from many parts of the rest of the internet. I have also heard that a lot of Iranians know how to use proxies and VPNs. What is your experience?

                                                              1. 6

                                                                Yes, we’re well versed in bypassing them, mostly just an inconvenience. The real problem is limited bandwidth, which has been partly due to—recently lifted—sanctions.

                                                                1. 3

                                                                  I worked on a project a few years ago, creating a system to organize artifacts and articles from the Qajar period. It was fascinating working with the clients (a Professor and her grad students) as they would go back and forth from Boston to Tehran, and how much more complicated it was working on the site w/ them while they were there. In Boston – skype calls, screenshares, they whole nine yards, in Tehran, I’d be lucky to get an email.

                                                                  Not to mention the complicated an disheartening process of making sure all the icons on the site didn’t come across as too politically subversive.

                                                                  All this to say, even my secondhand experience with the level of crap you have to deal with tells me “inconvenience” is an understatement. Here’s hoping the lift those restrictions someday soon.

                                                                  1. 2

                                                                    You’re right, but as I said the real problem is the capped bandwidth and the added latency—to an already slow connection—of solutions used to bypass the restrictions. Bypassing restrictions is the easy part, but actually using the produce, not so much: a very slow with high latency Internet connection. You should get used to waiting several minutes for GMail or Twitter’s web interfaces to become responsive.

                                                                  2. 2

                                                                    Is this every Iranian? It’s an open secret how to get around internet restrictions? Or just a few technically savvy people? Do grandpa and grandma know how to bypass internet blocks?

                                                                    1. 2

                                                                      You’re right and my judgment is, probably, clouded with selection bias; but I think most of the young generation know how to bypass it because the censorship has been part of the Internet since the day they’ve started using it. And they usually take care of their grandpa and grandmas.