1. 1

    Depends on what you want to analyze. I found sentry to be very useful as it gives me insights into Performance and Issues.

    1. 1

      Interesting, hadn’t thought about that one. I’m thinking about web specific values, for example: which api endpoints are used most by which user-agent. Would that be possible?

      1. 1

        Probably not easily. Sentry is more focussed on catching errors and providing stats about performance. If your use cases are more like the one described, I’d go with a simple access log parser (as suggested by @acatton)

    1. 2

      Anybody have ideas why IPv6 adoption is consistently higher on the weekends?

      1. 8

        It’s almost certainly personal use. This is due to many company networks not having DSlite, but also due to people being on mobile data plans on phones and tablets, which are a big driver for IPv6 usage as well.

        1. 0

          Exactly. It’s the time when folks have the leisure time to take advantage of Comcrap offering a fully native IPV6 experience to consumers (like I did).

          1. 1

            To the person who marked this comment a troll: Was it my use of “Comcrap” which I’ll admit could be seen as inflammatory? Because I was dead serious. Most of us working stiffs don’t have time to embark on a project like IPV6-ifying our home network except on the weekends when we can afford to screw it up and be down for an hour or two while we google solutions on our phones :)

            1. 2

              Was it my use of “Comcrap” which I’ll admit could be seen as inflammatory?

              Yes.

              1. 1

                Thank you for your candor.

                I of all people should be more sensitive about tarring employees of large corps with one brush, working for AWS myself and cringing on a regular basis when every Tom, Dick & Harry in the known universe blames me for every bad experience they ever had when the UPS guy spat on their package.

                Similarly, you (whoever you are, and assuming you’re a Comcast employee) aren’t responsible for the numerous install and provisioning experiences that left my wife & I ready the climb the walls.

                I will sincerely try to be better about this.

                For what it’s worth I really appreciate Comcast’s consumer IPV6 rollout. I was able to flip a switch and convert my entire LAN, and everything worked like a charm.

        2. 3

          A simple guess based on my observations in Germany right now: Many people have IPv6 connectivity at home, but not at work. Even many (most?) universites don’t provide IPv6 in their networks, especially on wireless. However, my private ISP does, and so do many others. The situation is similar in Austria, and (to my knowledge in France), so I’d expect it to hold in other places too and probably account much of this difference.

          1. 1

            I can confirm that the situation is similar in France. IPv4 at work, IPv6 at home and on my phone over LTE.

          2. 3

            There’s more IPv6 at home than at work.

            Why, I hear you ask. I don’t really know. My theory is that home users tend to get v6 when an ISP decides to upgrades everyone’s DSL/fiber middleboxes, while companies often have more hardware. If any of the hops from my desk to the network is v4-only, then so I am I. Home users wait for an ISP to enable v6, business users wait for all of n hops to enable v6, where n≥1. Even if n is only slightly greater than 1 on average, that will introduce some random lag compared to home users.

            1. 1

              In the US, at least one major cell carrier (T-Mobile) uses IPv6 for their mobile data network, so all handsets connect with IPv6.

              1. 1

                Oddly enough, I’ve heard an anecdote involving that that selfsame name. As you may know, the IPv4 allocation rules were tightened several times at predefined points in time as the End grew near. One of the 2-3 relevant Deutsche Telekom companies was a bit late with requesting more address space from RIPE a while ago, and was one of the first ISPs to have a big address space application rejected.

                All of its competitors had enough address space to grow for a while without any v6 deployment hurry, having gotten allocations in just before the rule change, but not Deutsche Telekom.

            2. 1

              Maybe personal ISP plans are more likely to use DSlite or similar technologies? They can adapt faster while company plans still “need” fixed IPv4 addresses for VPN and other services

              1. 1

                My cable provider is dual stack, but by default the IPv4 is carrier grade NAT and the v6 is native. Modern OS prefer v6 over v4, but there is more v6 in customer network than in offices.

              1. 1

                Signed up. Nitpick, but it says Verification successfully instead of Verified successfully.

                1. 1

                  Thank you for signing up. Fixed the typo as well!

                1. 6

                  Cool! Nice to have a Python-specific site that isn’t a sub-Reddit.

                  @sebst I tried to verify my email and got a 500 error, BTW, so might want to check the logs…

                  1. 2

                    Thanks for the hint! I’ll have to investigate! Your account works fine without verification, though

                    1. 2

                      Should be fixed.

                      1. 2

                        I’m working on feeds! Hope to provide an update soon!

                      1. 10

                        Arc - Bel - what’s next, Cex?

                        1. 7

                          Arc was released 11 years ago says Wikipedia. So Cex is due in 2030.

                          1. 2

                            I don’t get this…

                          1. 1

                            Congratulations! What is your caching story right now–it seems a little slow to revisit some pages?

                            1. 1

                              At the moment there is no caching. However, it’s slower than it should be. Need to tweak some elastic beanstalk settings, I guess

                            1. 3

                              Congrats, but I have to ask: why such a tiny default font? To be able to comfortably read the contents, I need to have 140% zoom.

                              1. 1

                                It’s designed as a clone of Hacker News. To evolve from this, also from a frontend point of view, is on my list ;-)

                                1. 2

                                  Too bad you didn’t use lobsters to do that! We would have had another sister site!

                                  Anyway good job and good luck with this project!

                                  1. 6

                                    I considered this. But I thought a python site cannot be done in Ruby ;)

                              1. 1

                                Nice work on the site, I’ve signed up and will tell some friends.

                                The programmer in me has to ask: why the restrictions on symbol input for the password field?

                                Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

                                1. 2

                                  I’ve used the standard django auth module which puts these restrictions.

                                  It’s mainly to have some compliance in how usernames look. While it’s certainly technically possible to have white spaces or emojis in usernames, things will get weird when you want to attach other systems (e.g. an email address for each user etc.)

                                  1. 1

                                    Oh, it’s the help text for the username field! Yes, that makes perfect sense. The layout of the register form on mobile made me think it was referring to the password field (the input gets bumped up), that’s why I asked. Anyway, nice work.

                                    1. 1

                                      Thank you!

                                1. 4

                                  I keep working on my news aggregator. https://news.python.sc

                                  1. 8

                                    Now someone can make an npm adblock in JavaScript.

                                    1. 12

                                      Which is what has happened

                                      https://github.com/kethinov/no-cli-ads

                                    1. 1

                                      Can someone maybe explain when one should use an API framework and when something like a micro framework such as flask or django?

                                      1. 6

                                        I wouldn’t call Django a micro framework. It is more a full featured web frameworks which works well for building web applications. However, it is not intentionally designed for building small footprint APIs (although it is perfectly possible, e.g. together with django-rest-framework). Flask is a general purpose framework but with a smaller footprint. This is a real micro framework imho. Molten looks much like flask but it adds some interesting aspects like type hinting, dependency injection and is primarily designed for building APIs.

                                        So, in general the more your use case leans towards a full blown (multi page) web app, the more likely Django might be a good candidate to look at, the more you’re just building APIs, the more something like Molten could be a thing to look at. Flask is somewhere in between.

                                        However, as all three of those frameworks would certainly be able to fit nearly more or less any web based use case, remember there are some other things to consider when choosing a framework, such as developer’s knowledge or preference, availability of third party libs, popularity/community etc.

                                        1. 2

                                          Yeah Django is optimized for making it incredibly easy to create server side database driven applications. It’s also great for creating APIs, but it’s still optimized for the use case of “define your data model and we’ll take care of the rest”.

                                          For some people like myself who are web dev newbies, that can be a huge bonus, but lots of folks want more flexibility and less overhead, so packages like this come in.

                                      1. 2

                                        I played around with it and molten is awesome. Still not sure, whether type hints are pythonic or not, but this gave me another tilt towards finding it perfectly suitable, especially for the web dev use case.

                                        1. 1

                                          This specific usage of the type annotations is nice in terms of visual clutter, but I think that it will require extra cognitive work to understand and write the code.

                                          1. 4

                                            I disagree, type hints are awesome especially for things like this.

                                            Usually, when your route takes e.g. a user_id you either have to use the right regex (in Django’s urls.py) or remember to validate it yourself in every route. Screw up once -> boom.

                                            Molten, similar to Rocket for Rust, makes sure that you’re handler is only called when the passed user_id is a valid integer (assuming user_id: int).

                                            This becomes even more valuable with more complex types.

                                            1. 1

                                              I agree that type hints can be useful to make sure that these kinds of bugs are taken care of easily. But the way it is used in the Todo example is that the TodoManager class is passed as an annotation in the methods “list_todos” and “get_todos” . Why not just use a keyword argument for this?

                                              1. 1

                                                Why not just use a keyword argument for this?

                                                That “just” makes the problem seem less complicated than it really is! :D

                                                Let’s say you’re using a framework like falcon that doesn’t provide DI support out of the box. Assuming you wanted to

                                                1. be able to swap out the implementation of todo manager easily in your tests and
                                                2. avoid global state and mocking,

                                                then your API might look something like this:

                                                from falcon import API
                                                
                                                # Define Database and TodoManager here...
                                                
                                                class TodosResource:
                                                  def __init__(self, todo_manager):
                                                    self.todo_manager = todo_manager
                                                
                                                  def on_get(self, req, resp):
                                                    resp.media = self.todo_manager.get_all()
                                                
                                                
                                                def setup_app(db_impl=Database, todo_manager_impl=TodoManager):
                                                    db = db_impl()
                                                    todo_manager = todo_manager_impl(db)
                                                
                                                    app = API()
                                                    app.add_route("/todos", TodosResource(todo_manager))
                                                    return app
                                                
                                                # In your entrypoint:
                                                app = setup_app()
                                                
                                                # In your tests:
                                                app = setup_app(db_impl=StubDatabase)
                                                

                                                This isn’t bad and it’s explicit, but manually configuring the dependency tree can get quite hairy over time and when a particular component’s dependencies change, rather than only changing that component’s code to depend on different deps, you’ll have to also change all of the places where the dependency tree is constructed (not a huge deal if you have this sort of setup_app function like I’ve got above, but not a particularly fun thing to do either way). Another downside here is that it’s not immediately clear what components the TodosResource.get method relies on from its header.

                                                If, instead, you use type annotations to do the wiring for you then you get the best of all worlds in exchange for a little bit of magic (that, in my experience, people get used to fairly quickly).

                                                I hope that makes sense!

                                              2. 1

                                                Yeah, I was reminded a lot of Rocket when I was reading the examples. Which is a good thing. There are a lot of things in Rocket I wish I was able to do more transparently in Django.

                                          1. 5

                                            Over here in US, that usually means someone’s election was financed by industry players who make billions on copywritten material. Are the people pushing this law similarly taking bribes from industry? Or do they have their own motivations for it?

                                            1. 8

                                              The newspaper and printing industry in germany is pushing this hard, notably Axel Springer Media (also known for such genius ideas as “Suing Adblock Plus for unfair comeptition”, “Suing Adblock Plus for preventing Free Speech”, “Refusing to adopt the New German Grammar Rules” and “Suing other newspapers for buying the same article from a newsagency but offering it for free instead of behind a paywall”).

                                              For some bizarre reason the utter failure of similar laws in germany and spain seems to have left no visible trace, it’s like the only lesson they learned is “when you fail small you fail big next”.

                                              1. 11

                                                Technically, a law like this is prone to be abused for censorship purposes. Whether this “dual use” is intended or not by parliamentarian voters, is obviously unclear.

                                                However, always bear in mind Ayn Rand:

                                                “Did you really think we want those laws observed?” said Dr. Ferris. “We want them to be broken. You’d better get it straight that it’s not a bunch of boy scouts you’re up against… We’re after power and we mean it… There’s no way to rule innocent men. The only power any government has is the power to crack down on criminals. Well, when there aren’t enough criminals one makes them. One declares so many things to be a crime that it becomes impossible for men to live without breaking laws. Who wants a nation of law-abiding citizens? What’s there in that for anyone? But just pass the kind of laws that can neither be observed nor enforced or objectively interpreted – and you create a nation of law-breakers – and then you cash in on guilt. Now that’s the system, Mr. Reardon, that’s the game, and once you understand it, you’ll be much easier to deal with.”

                                                To make it even worse, such laws don’t “outlaw” some behaviour, but put a high risk on it through civil law. So, it helps multinationals (and a possible malevolent regime) and hurts small companies as well as citizens. To me, it’s hard to believe this is not intended (like so many other (mostly) EU laws.

                                              1. 4

                                                A fun intro to Church Numerals by a charasmatic speaker:

                                                LAMBDA Functions: Powerful And Elegant Abstractions

                                                1. 1

                                                  The Youtube channel that talk is from looks chock full of interesting talks. Thanks for posting!

                                                1. 2

                                                  I particularly miss Yahoo Directories as its categories and curation helped me discover a lot of good content. I think there’s definitely a place for such directories. Wikipedia seems to have substituted a bit with all its lists of related topics, terms, and tech. Still not ideal for this job, though.

                                                  1. 2

                                                    I agree. And I would love to see you on curlz.org – a discussion on the goals and expectations is currently started…

                                                    https://curlz.org/forums/forum/project-goals-guidelines-and-social-contract-3/topic/expectations-of-ourselves-5/

                                                  1. 1

                                                    As someone who’s working to launch my first “real” project, this was a really good read. I never thought to check if PH penalizes for external referrer’s (like HN). Although, I don’t have much of a twitter following, looks like I’ll have to change that soon :)

                                                    Anyway this gives some good tips, thanks for sharing :)

                                                    1. 1

                                                      Thank you for your feedback. What project are you going to launch? Let me know if I can help.

                                                      1. 1

                                                        I’m working on a Co-Founder matching website. Similar to other cofounder dating sites, but more data-driven and the applicants will be screened more heavily (to filter for quality people). My goal is to connect all kinds of like-minded entrepreneurs together by project interest.

                                                        My beta registration is here - falgo.io

                                                        If you’d like to help, I could use some good feedback once I go live with the MVP :) Hope to have it up within the next few weeks.