1. 3

    Fun idea! I think it says more about wine culture than any amazing capability of Markov Chains.

    1. 3

      The descriptions are really just strings of adjectives, which is why this is a simple task for markov chains (having no real knowledge of sentence structure).

      If you used contradictory adjectives to describe a wine, you’d probably get called out.

      1. 3

        The flavour juxtaposition simply makes the wine better, not the reviewer worse!

    1. 8

      I’ve been using Nginx for years. I really like it, mostly because it is so much more resource efficient than Apache.

      1. 15

        Not to mention the configuration is way easier to manage and write.

        1. 8

          Agree 100%. It was a total breath of fresh air after years of accumulating Apache pain.

          Building on nginx, if anyone hasn’t come across OpenResty it’s well worth looking into - it embeds LuaJIT into nginx and exposes loads of nginx API to Lua so that you can basically script the web server & proxy/balancer functionality, but also write complete applications in it. Lets you do complex stuff simply, neatly, precisely and at a high level of performance. Comes as a bundle of nginx modules that you can use and then pull in Lua libraries using luarocks or its own package manager. One of the best web server/application models I’ve had the pleasure of using - and wouldn’t be possible without nginx.

          1. 2

            +1 for OpenResty. I’m currently experimenting with that and HHVM to replace our NGINX+PHP-FPM stack at work. What I love is that you can write dynamic configuration files (like having a generic logging block with a hostname variable appended to the file names).

          2. 3

            But it’s getting harder and harder to write as more features are added, more defaults become out of date, and so on.

            1. 1

              For the same reason I’ve been moving to using the golang stdlib to write custom load balancing behaviour. Having a real language is a real boon.

            2. 3

              I don’t actually care about the resource efficiency. I use it because the configuration makes sense.

            1. 4

              This is a pretty fun read, but wow, the author has an astonishing lack of self control. Surely it’d be more productive to work on that issue directly.

              I’d heard of browser plugins to limit your time on certain sites, but I always thought they were more just reminders so you don’t accidentally waste too much time. The author here has taken it to a whole different level. His successful password cracking actually represents another failure of his self control.

              1. 1

                As soon as I saw that gif which showed the search results could be used as an oracle for the password, I knew exactly what he was going to do.

                He employs a little theater, but make no mistake, his post is a cry for help. ;) Or “hire me”, though he did mention that he’s gainfully employed.

              1. 7

                I used to do a lot of C++ programming. A few years back I got fed up and switched to C for the projects that used to be C++. I’ve been a lot happier and more productive. In C, you always know what’s going on. In C, third-party libraries have a sane interface. IMO, any C++ project would be better written in C or a dynamic language, often both.

                One thing I love about C, is that it mixes with other languages easily. C++, not so much.

                1. 3

                  I’m not a C expert or a C++ expert, so this question may be noobish.

                  One place where I’ve heard C++ shines is a specific case of generic programming, e.g. when you want to be able to code an algorithm for float or for double only once, and not have to have multiple instances kicking around.

                  If you’re writing C and therefore presumably don’t have templates, what would you use in this case?

                  1. 3

                    If the only thing your code is doing is abstracting over floats and doubles, copy and paste.

                    1. 2

                      No, actually that’s a good point, and I’d argue one of the actual features C++ provides over C (where I consider OOP to be more of an anti-feature, but that’s another issue entirely).

                      In C, your only choice to do that is to use macros. However, I think code where it must do exactly the same thing to a float or double to be quite rare. In practice, I think the code may allow one or the other, but not both. In that case you just use a typedef or #define MY_REAL float or something like that.

                      C++ templates are nice for data structures, in theory, but since the code doesn’t actually do anything with the data, C’s void pointers work fine in those cases.

                      1. 3

                        However, I think code where it must do exactly the same thing to a float or double to be quite rare. In practice, I think the code may allow one or the other, but not both. In that case you just use a typedef or #define MY_REAL float or something like that.

                        The best cases I have found for templates are “x to string” and “string to x”, you can do stuff like this: template <class T> std::string to_string(const T& value) { std::ostringstream o; o<<value; return o.str(); }

                        You can now call tostring with any type that is valid for ostringstream. You can combine this with variadic templates to create a printf replacement that is typesafe at compile time, called with something like: myprintf(“int: ”, x, “, float::”, y, “, string:”, z, “\n”);

                        C++ templates are nice for data structures, in theory, but since the code doesn’t actually do anything with the data, C’s void pointers work fine in those cases.

                        Type safety! With the STL data structures if you mismatch the types you get an error at compile time instead of crashing at run time.

                      2. 2

                        Some code bases have macros to define a_function_##T for whatever T. You can also do #define T float #include "impl.h" #undef T if you have lots of code to specialise.

                      3. 2

                        I have just been reviewing a bunch of C++ code…

                        Smart pointers everywhere.

                        From a C programmers perspective it seems like a failure to think through ownership and lifecycle issues.

                        From a C programmers perspective shared_ptr<> seems like “I’m not using globals ‘cause globals are Bad, but I’m going to share and mutate this resource from everywhere but it’s not a global it’s A Smart Pointer.”

                        I’m sure there are legitimate reasons for smart pointers, but boy are they a slippery slope to perdition!

                      1. 3

                        “The company has not been able to identify the intrusion associated with this theft,”

                        Amazing. They don’t even know how the data got out. The same gaping hole may still be wide open.

                        1. [Comment removed by author]

                          1. 3

                            And the exclamation mark in their brand name! makes sentences hard to read.

                          2. 5

                            In general, the vast majority of intrusions go this way - detected after the fact but without a good way to figure out what happened.

                            EG: In a quite unsophisticated attack at $work, attackers launched a DDOS at 2am our time, then used stolen user credentials (eg by spearphishing our users) to post fraudulent listings on the site.

                            Trying to dig through logs to figure out where they were and what they did / didn’t do was made more difficult by:

                            • Tired operations staff the next day
                            • Logs full of messages resulting from the DDOS
                            • Logs full of ops changes fighting the DDOS

                            Note that all this required on the attackers part was some cleverly worded emails, paying a DDOS provider and running a wordpress site. Imagine facing someone with real technical skill on top of that.