Threads for rafd

  1. 1

    Asking as someone with basically no mobile dev experience but with interest in development a mobile PWA (progressive web app), how useful does GeckoView seem for that? Or does it make more sense to focus exclusively on a PWA for the foreseeable future?

    This would be an authoring app where data preservation and state preservation would be paramount.)

    1. 3

      We made a PWA for one of our mobile games and then wrapped it in a native app package with Cordova (because most mobile users are used to downloading apps).

      On iOS, using the WebView was fine. On Android, it was a giant pain, as several things don’t quite work in WebViews as they do in Chrome. Not to mention the version differences. There are several bugs, annoyances, and inaccurate or incomplete docs related to Android WebView and related APIs (for example, not being able to intercept the body of POST requests). Our PWA worked seamlessly in the mobile browser, but we ended up having to make several changes to make it work in the WebView.

      Super glad to see this posted today. It might save us from further hackery.

      1. 1

        Thanks! I don’t recall hearding about Cordova before and that looks helpful. Particularly grateful for the heads-up on your Android experience because that would be my primary target.

      2. 1

        This is an interesting question, I’m not sure which API are exposed to JS running in a webview. Having a full fledged browser embedded in your app can be a boon for modern API that are not available otherwise. I think workers might not be available in a common webview so a PWA re-packaged as an app might have some difficult times. You would have easier life on bundling your assets in the app but all the networking would be quite different, e.g. services workers might be gone.

        1. 1

          Thanks for the heads up!

      1. 3

        Simulated annealing, or even simpler greedy versions, are a great pragmatic solution for fuzzy problems like this, where the optimal solution is very hard to find (and/or theres no clear definition of optimality), and where any somewhat optimized solution is practically “good enough”. Especially since the objective function is typically made up by the human and minor variations have a bigger effect in the result than a poor implementation of the annealing. Even if it gets caught in a local maximum - the result is still leagues better than a human doing it.

        I’ve used a similar approach to: create teams for an incubator; set a team schedule given several constraints for each member (ex. “Alice wants to work 5 - 10 hours, prefer Tuesdays, but can do Wednesdays”); and match alumni in a pool of 600 for monthly 1-on-1s.

        1. 5

          My daily driver is a Keyboardio Model01, the best keyboard I ever owned. The camera mount is amazing for tenting, and the palm keys are incredible. The custom keycaps - while they do limit your options - are a joy to type on.

          I also have a number of other keyboards for different purposes. For gaming, I use a Dygma Raise and an Azeron Classic. I usually use the Azeron (though I still need to port my firmware of choice to it, it’s default one is meh), but when I need more keys, I fall back to the Raise.

          (I also have a few ErgoDox EZs, an original Atreus, a Keyboardio Atreus, a Planck EZ, Splitography, Ginni, and a KBD4x, off the top of my head. The Planck EZ is my wife’s, Splitography is for Steno, the rest are currently unused.)

          1. 2

            Thank you, Algernon, for all the work you’ve put in on the software for the Model01 and Dygma Raise.

            As for OPs question, on my own keyboard journey, after years of using stock keyboards, then an entry level keyboard with cherry mx browns (to try mechanical switches), then a Mistel Barocco (to experience split layout — which I now can’t live without). I was given a Keyboardio Model01, but had a hard time with the ortholinear key layout and I didn’t have the time to relearn. I was going to get a Kinesis Edge Gaming, but preordered the Dygma Raise instead because of its full programmability.

            The Dygma Raise checks all the boxes for me:

            • mechanical switches
            • split
            • fully programmable (Sticky Keys!)
            • normal key layout (nothing to relearn)

            Plus it has:

            • thumb buttons
            • built in wrist rests
            • so many LEDs (useful to know which later you’re on)
            • can be used with only one side plugged in (for gaming mostly)
            • a WIP tenting solution

            I recommend checking out the Dygma Raise (even if you don’t play games, I bought it primarily for programming).

            And if not the Raise, in general, I very strongly recommend a split keyboard… your wrists and shoulders will thank you.

          1. 13

            If your needs can be served by data that can be captured in server-side logs, then I recommend https://goaccess.io/

            1. 1

              I tried to make goaccess work for me, but I am still not satisfied.

              Maybe I just use it wrong: I have a cronjob that generates html reports for different logs in /var/log/nginx. It produces a lot of information that I cannot drill down into. The time intervals for different websites are uneven: some nginx logs span a long time, some just one day.

              Another consideration is that it’s written in C (unlike its name might suggest), and I am a little concerned about munging strings from the internet in a C program.

              1. 1

                They have an official docker container if you run to run it in isolation. You can mount your logs as read-only into the container.

                I’ve only run the console program, and really just to see live traffic. For long term stats, I use awstats.

            1. 4

              There is no book that I know of that teaches Clojure to new programmers. As OP notes, all assume that the reader knows how to program, and focus on the language features. Most don’t cover “big idioms” like functional programming (FP) or data oriented(/driven?) programming. I had to figure these out through practice and being inspired by other people’s code (caveat: there is no authority on Clojure style, just a continually evolving zeitgeist).

              But… there have been past initiatives at teaching new programmers using lisps: SICP, HTDP, The Little Schemer (and conversions of these to Clojure can be found).

              …but, these books tend to diverge quite quickly from Clojure style and approaches (FP, DDP) and sometimes focus on (IMO) academic esoterica of some of the languages involved and not practical matters. (My bias is showing; I care mostly about “programming as engineering” rather that “programming as computer science”).

              In the Clojure community, the ClojureBridge effort has produced some good intro material. As has the work on Maria (search Maria Clojure).

              I teach new programmers at a bootcamp and I have to use JS (which is particularly bad for newcomers IMO) and it’s wild-west “style” of programming. But I’ve also started newcomers on Clojure, FP and DDP with Clojure, and I’ve found that it is very accessible. Many think that Clojure, Lisps, or FP are harder (than C-style syntax, imperative programming, or OOP), but my anecdotal observation is that lisp + FP are much easier to learn (I think that for typical experienced programmers, Clojure and FP require a lot of “unlearning”, which makes it seem hard. My father, who used to sling assembly and later C, back in the day, recently got curious about my use of Clojure, perused the syntax and asked me: “OK… Easy enoug. But… How do I make a loop that changes a variable?”… and was dumbfounded when I answered “Well… You can, but you almost never do that”).

              Clojure’s barebones syntax reduces initial barriers incredibly (compared to even python). Literal data structures are easily grokked too (I usually spend a lot of my early teaching time on representing various situations as data). Pure functions are pretty easy to grasp too. Sure there are a bunch of functions to learn and gradually add to your toolbox, but really, the key thing is learning “computational thinking”, and Clojure and FP tend to get out of the way. Overall, I think the “notional machine” (mental model of the machine that your code is controlling) that new programmers must learn for Clojure+FP is much simpler than almost all other alternatives. It’s also why I think many of us like using it professionally (it’s easier to “think in” and gets out of the way when trying to solve problems).

              Anyway… If you’ve read this far… I’m curious if you think there’s value in a Clojure + FP + DDP for New Programmers book (/ or other style resource), in the scope of something like HowToDesignPrograms? Would you buy it for a friend or son/daughter?

              It’s an idea I’ve been tinkering with… I have some initial scribbles at https://www.github.com/cognitory/introduction-to-programming . Would also love to collaborate with others.

              1. 1

                I also think that clojure (lisps in general) are “easier” to learn than C-style, imperative or OOP, and also you’re right IMO about the “unlearning” part. That’s why I chose Clojure: It’s a modern lisp, powerful, can get all the benefits from running on JVM, and last but not least: it seems that Clojure grows every year in usage in implementations, so that means more job opportunities.

                I would definitely be interested in a book that teaches you programming and also clojure in a way that you build something useful (app, game, web application etc.)

                Also, when writing such a book, one shouldn’t compare clojure/lisps/FP with other more popular styles/languages (JS/C++/Java/Python, OOP and so on) because that is not relevant for beginners IMO. It should be “this is Clojure, this is how you make stuff/solve problems with it”, using functional approach and style.

                Can you please elaborate on what do you mean by “programming as engineering” and “programming as computer science” because I’m not sure I understand the difference.

                1. 4

                  I don’t have rigorous definition for “programming as engineering” and “programming as computer science” but I’ll give it a shot:

                  “Programming as Computer Science”

                  • how you’d be taught programming as part of a comp sci degree program
                  • “programs are written for the compiler to read”
                  • focus on “theory”, compilers, programming-language-features (type systems, tail-order-optimization, monads)
                  • explaining FP as an “applied version of the lambda-calculus”

                  “Programming as Engineering”

                  • how you’d be taught programming as part of a bootcamp, college degree
                  • “programs are written for other programmers to read”
                  • focus on “practice”, getting-things-done
                  • explaining FP as “use pure-functions, avoid state; think about programs differently than OOP”
                  • how do we programs so that we can work on large projects with many people over time

                  Related: https://josephg.com/blog/3-tribes/

                  1. 1

                    Thanks for clarification. I now understand what you meant

              1. 11

                Xahlee runs a pretty good site about ergo keyboards.

                Switching to a mechanical keyboard felt great, but the switch to split was even better. I very highly recommend it. It feels much less tension on my wrists and shoulders.

                I’m currently using the Mistel Barocco which is not too expensive and very portable, but, I do miss dedicated arrow keys sometimes and would prefer full programmability (vs. the self-programmability of the Mistel).

                Also worth mentioning is the (recentish) Kinesis Freestyle Edge, which is targeted at gamers, but, from the looks of it is a great programming keyboard (like the Kinesis Advantage but with mechanical keys).

                Personally, I’m looking forward to see how the Dygma Raise will turn out (they’re about to start production on their preorders). Also targeted at gamers but looks like a very nice programming keyboard, and it is fully programmable (runs on the same stack as the keyboardio).

                1. 2

                  I have a freestyle edge. I like it a lot, but there are some weird key placement decisions on the rightmost edge. I also wish that the split cable was larger or replaceable, but I am pretty wide across the shoulders, it should be plenty for most.

                  1. 1

                    That site is amazing. Lots of info on trackballs as well. Thanks!

                    The freestyle edge looks like it is more than double the price of the normal one and it still has the huge function row on the left which I dislike. It does have programabillity