1. 3

    I agree with @sdhand but I do decry this compunction academics feel to click-bait all their work. I suppose we got here by having a dog-eat-dog grant, winner take all application process, instead of giving everyone a little bit of money so they could all just go and research something dear to their hearts.

    1. 8

      I agree. What we need is Universal Basic Grant.

    1. 8

      I went to the Links website with Chrome. I could only say “My eyes! My eyes!”. It took me back to the late 90s and not in a good way.

      My quibble with the modern web is the diarrhea of Javascript, not with good layout and images. Not everything has to be talking live to an artificially intelligent server.

      1. 2

        https://docs.python.org/3/library/__main__.html#module-__main__

        For a package, the same effect can be achieved by including a main.py module, the contents of which will be executed when the module is run with -m.

        I really don’t agree with the author. The convention they describe and dismiss is a convention used so widely that I except many Python programmers look for it when going over a code base.

        However, because Python has entry points the code that is invoked when you start a python program can be anything.

        So to find where a Python program starts you have to look at setup.py and then you might also have to note what individual scripts a user might invoke.

        1. 2

          Yeah. In this case I don’t care if it’s /technically/ correct - it’s the only way I’ve ever seen this done in one-file python scripts and I’ve never seen it in any bigger project, EXCEPT in the main .py file that was used as the entry point (if it was run via CLI and not via *WSGI), which makes it the de-facto way of running it if everyone uses it.

          The theoretical nitpicking that this is not an automatically executed main() function should be clear to everyone but a beginner, but the if __name__ statement provides the same auto-magic entry point for people who want it that way.

          And yes, I am 100% pro using this, just for the “I wrote this CLI script in python, but I have no global code in there, only classes and functions, and if I ever need it as a library, I can simply import from it.”

          1. 1

            At first I was also disagreeing. But when thinking about it, almost all files where I had the if __name__ == '__main__': eventually happened to be refactored into several modules: the main module, deprived of this line (since it is always executed) and auxiliary modules exposing the reusable parts, mainly the parts used by the main module.

          1. 4

            Folks, we can’t be putting a post up for every release of VS Code. VS Code anyway tells you when there’s a new version out, and there’s a detailed release notes page when you restart.

            1. 2

              After I joined my current job, I found out that the people who were involved in hiring me had been reading my blog. In another interview, I found out that one of the interviewers had delved into a project I had on github and I ended up explaining the architecture of that project to them. I actually didn’t hear back from them, so technically I don’t know what happened, but after all this time, I can guess :). Also, interestingly, at one interview they quizzed me on a technology I had not used at work, but had used in a hobby project, and perhaps the only reason I was interesting to them was because of this hobby project that used this technology.

              1. 2
                1. What is the largest integer you need to encode? Is it 256bits?
                2. Is this a scale issue? Are you anticipating that the size of the url sent in the request will significantly affect the processing time or resources?

                I didn’t understand why you needed this scheme.

                1. 8

                  It seems important to note that this project’s source has not been released. Even though the article explicitly tries to mask it stating that they can be reach on GitHub, the repository that they link to merely collects a brief README and a bunch of release notes - no actual code (there is actually one issue already asking about this). This means that other editors that suports LSP will not benefit from this server implementation.

                  1. 1

                    So I did this.

                    ls -al ~/.vscode/extensions/ms-python.vscode-pylance-2020.6.1/server/
                    total 34520
                    drwxr-xr-x   8 kghose  staff       256 Jul  1 07:59 .
                    drwxr-xr-x  12 kghose  staff       384 Jul  1 07:58 ..
                    drwxr-xr-x   7 kghose  staff       224 Jul  1 07:58 bundled-stubs
                    -rw-r--r--   1 kghose  staff  15714756 Jul  1 07:59 libonnxruntime.1.3.1.dylib
                    drwxr-xr-x   3 kghose  staff        96 Jul  1 07:58 native
                    -rw-r--r--   1 kghose  staff    164804 Jul  1 07:59 onnxruntime_binding.node
                    -rw-r--r--   1 kghose  staff   1757870 Jul  1 07:58 server.bundle.js
                    drwxr-xr-x   6 kghose  staff       192 Jul  1 07:58 typeshed-fallback
                    

                    That onnxruntime lead me to this: https://github.com/microsoft/onnxruntime

                    ONNX Runtime is a cross-platform inferencing and training accelerator compatible with many popular ML/DNN frameworks, including PyTorch, TensorFlow/Keras, scikit-learn, and more. aka.ms/onnxruntime
                    
                    Many users can benefit from ONNX Runtime, including those looking to:
                    
                    Improve inference performance for a wide variety of ML models
                    Reduce time and cost of training large models
                    Train in Python but deploy into a C#/C++/Java app
                    Run on different hardware and operating systems
                    Support models created in several different frameworks
                    

                    Not sure what to think of this all. It might be a very sophisticated language server, and they do point out that it is built on top of https://github.com/microsoft/pyright.

                    Anyhow. I might revert to the old server.

                  1. 1

                    I used Magnum for a while for one of my projects, now two years ago. I moved my visualization code to Python (via Matplotlib), but when I took a look again, the author had added Python bindings to it, which is amazing. I’ve had personal interactions with the author, and they are very responsive and polite. They are also very detail oriented: the code is a pleasure to read, and the author makes detailed documents and explanations.

                    I post this here because I feel this is a project everyone can learn from.

                    1. 1

                      Perhaps related, because my day job involves cloud computing: https://www.ga4gh.org/news/drs-api-enabling-cloud-based-data-access-and-retrieval/

                      1. 4

                        Docker on mac is a nightmare. It sits there and silently occupies more and more of your disk for no good reason (e.g. https://levelup.gitconnected.com/docker-for-mac-causing-disk-space-issues-7ff8b14d2c83).

                        I first thought I was going mad because I kept getting disk space issues. Now, even though my central work involves dockerized tools, I don’t have Docker running on my mac. I spin it up when needed, or test via github actions and then uninstall it immediately afterwards.

                        1. 8

                          There is an online Haskell conference https://zfoh.ch/zurihac2020/

                          There are workshops and a Discord channel. Talks have already started!

                          Featuring Gabriel Gonzalez, Phillip Wadler, Richard Eisenberg, Divesh Otwani, Nicolas Frisby, Rob Rix and many more.

                          1. 2

                            Would you recommend this for a Haskell curious person, who has no Haskell experience?

                            1. 3

                              Yes, there is even a beginners course and workshop.

                          1. 2

                            The massive refactor of my spacecraft trajectory simulator is done. For a while it fit all the stereotypes of that hobby project that was perpetually 80% done, but I made some good decisions on the refactor (basically a rewrite). The major thing was that I decided to not plot data from the C++ code (I wanted good looking pdf charts) and instead I am serializing the data out to file (something that I eventually would have to do) and am plotting from Python + Matplotlib. So, this weekend I will clean up the plotting and start adding little programs the spacecraft can execute as they fly around the solar system.

                            1. 9

                              First time c code has made me laugh out loud. I needed that today.

                              There are wonderful “answers” in the rest of the SO thread, I liked this one illustrating how you can change the speed of the decrement.

                              int x = 10;
                              
                              while( 0 <---- x )
                              {
                                 printf("%d ", x);
                              }
                              
                              1. 2

                                Won’t that fall afoul of the single-modification rule? After all, the result of

                                x += ++x;
                                

                                is famously undefined because x is modified twice without a sequence point in between. I’d also have to look up if --x is even an lvalue in C. It is in C++ I believe, but this is the sort of weird edge case where the two languages might actually disagree. (I believe the UB/sequence point issue applies to both.)

                                1. 3

                                  I don’t think --x is an lvalue. It is equivalent to x-=1, which is equivalent to x=x-1 except that the lvalue x is evaluated only once. An assignment expression has the value of the left operand after the assignment, but is not an lvalue.

                              1. 7

                                I clang-format and focus on programming.

                                1. 11

                                  Why is the wikipedia page linked when there is a fantastic project page?

                                  http://www.biofabric.org/

                                  https://github.com/wjrl/BioFabric/tree/V2.0Beta2

                                  1. 4

                                    I guess the “suggest” page should allow proposing a different URL, not only a different name/tag.

                                    1. 3

                                      That would also be useful for suggesting corrections to broken links.

                                  1. 2

                                    I tried a bunch of things. I ended up keeping a blog. What I would really like is digital medium that is like a pen and paper notebook.

                                    1. 2

                                      This so much this. I keep salivating over an iPad pro, but the truth is that I know it’s not there yet. I’d love a epaper display with a similar feel and notes going straight to org.

                                    1. 5

                                      OP talks about version control, but another great payoff of these systems is the ability to use their inputs as something else’s output.

                                      1. 3

                                        Yes, very good! They can be programmatically driven, though this can get a bit insane. Sometimes, the original application has been wrapped as a library in, say, Python, to make this meta-programming a little easier. Say like Python and GraphViz.

                                        1. 2

                                          Or like in… Bourne Shell ;)

                                      1. 6

                                        Another application like this is LilyPond for music engraving (typesetting).

                                        1. 2

                                          That’s cool! I see there are several VS Code plugins - might help in my quest to learn the piano!

                                        1. 10

                                          I love text-file-driven applications! I irrationally use them wherever I can, even if a GUI would be easier/quicker. In particularly intense cases this drives me to write my own utility that is in fact text-file based (so happening right now with an RSS reader) Perhaps it’s Stockholm syndrome, perhaps it’s my desire to do as much as possible with Emacs, I love them all the same.

                                          I think the strongest point in favour of text-file driven modality that you didn’t mention is statelessness - GUIs often have a lot of hidden state that is stored somewhere that influences what happens. In text-file driven applications, all of the state is right there in your editor, making it a lot easier to reproduce and change things, and have those things work across machines and users.

                                          1. 3

                                            Yes! statelessness is very important. Thank you for pointing that out. I feel this most when making figures etc. Early on I was using Matlab, and I had this very manual GUI based layout flow, because Matlab made it easy to edit figures, but it was super annoying when I had to remake the figures. Then I discovered how to do most things programmatically.