1. 7

    Bret Victor’s website is all sorts of fun.


      1. 3

        Absolutely! reStructuredText, MediaWiki, and org-mode are also possibilities. Since pandoc can convert between various lightweight markup, the input source document format is not of huge importance. I’ve found it handy to pass along Markdown documents to people because Markdown is a little less imposing for the uninitiated than AsciiDoc or reStructuredText.

        1. 1

          incidentally, there was just a new entry posted on front page


          This book looks good, really good, on the web.

          It is written in reStructuredText (although I do not know how exactly math formulas are done) But the source code for the book and commands to generate html from it are also available (so good to learn from) https://www.labri.fr/perso/nrougier/from-python-to-numpy/#about-this-book

          1. 1

            Ive used Markdown for many years and I really think AsciiDoc is better, even for beginners. Markdown, if you look hard at it, I think isnt really good for anything save the most basic of READMEs or comment formatting. With any sort of proper typesetting Markdown fails horribly. AsciiDoc is not a perfect solution but its certainly closer.

            1. 1

              To be clear, I use Pandoc-flavoured Markdown, which offers a lot more functionality than what’s specified at https://daringfireball.net/projects/markdown/. I agree that AsciiDoc is superior in many ways to Markdown.

              Do you have some examples where Pandoc’s Markdown cannot be typeset as nicely as AsciiDoc?

              1. 2

                I cant speak to Pandoc. I avoid it as GitHub doesnt use Pandoc, and I prefer a portable solution. GitHub uses CommonMark and AsciiDoc among others. CommonMark is crippled as I think you would agree.

        1. 2

          This seems really good! I am as it happens in the process of writing a book using markdown and these examples looked way beyond what I thought possible!

          1. 2

            Thank you for the encouragement! Typesetting Markdown into four unevenly split columns took a fair amount of effort, as did finding a way to distinguish between page-spanning illustrations versus inline vector graphics. It is nice being able to share with people the wide variety of possibilities that a little elbow grease can produce.

            1. 1

              it’s partly due to me having practical use for things like this, which i guess would be encoruging in a sense. I’m trying to compile a book of sorts. Simultanously as writing the book I will compose algorithms. One piece of code will send data from various datasets and run it through the algorithms. Then it should spit out forms of data.

              So what I am gunning for here is a make based system. Where I could do a make web, for a online demo or make book for pdf files with graphs run with the latest versions and so forth.

              I was expecting to get very rudimentary results, but what you have produced looks really slick! Now it’s a quesstion of finnishing all the ideas on schedule.

              https://github.com/TBF-RnD/alpha (sort of a mess, check out the cleanup branch for a better organized version)

          1. 2

            It’s interesting you’re using Context. Here’s is my typesetting script—also based on pandoc—with which I typeset from plain documents, to academic papers with bibliography, to letters. I can also call it from within Vim without leaving it and render a preview. For blogging, I’ve built athena around the same pandoc setup.

            1. 1

              Looks like your script gets the job done! There are some minor improvements that could be made (such as changing #!/bin/bash to the more portable #!/usr/bin/env bash and eliminating some of the duplication), but probably not worth the effort. Good to see crossref being used. Athena’s really cool–have you considered adding an RSS feed to it?

              1. 1

                Thanks! WRT bin/env bash and the blatant duplication you’re correct; I’ve thought about both but I also don’t think they’re worth the effort. athena does indeed generate an RSS ATOM feed!

            1. 2

              The “Prolonged Bombardment” image shows some typographic lapses: A widow at the top right. The top of the text does not align with the text of the title “Prolonged Bombardment”. The text does not align to a baseline grid.

              Ok, baseline grid is something neither TeX nor HTML can do. Scribus can and proprietary tools can.

              1. 2

                Thanks for pointing these out. The text itself is undergoing revisions, whereupon the widow and top alignment will be resolved. I thought that ConTeXt was capable of grid typesetting (https://wiki.contextgarden.net/Grid_typesetting)? That said, I’m forcing ConTeXt to typeset under rather strict constraints, which may be why the text isn’t aligning to the grid.

              1. 3

                This week, I finished the first draft of an idea for a proposal deliberation system that is unlike Loomio and many others in that it includes randomized moderator selection, testable hypotheses to ascertain achievement (i.e., Agile and Lean mechanics), and resource allocation.

                The documentation was written using ConTeXt. The project is hosted on BitBucket. The web pages in the document were developed using XML, browser-based client-side XSLT, and SVG elements.

                Would greatly appreciate your comments.

                1. 1

                  Here is another perspective (shared with me from someone at Google):

                  1. Presumably there was ample wage comparison and matching when the candidate initially interviewed.
                  2. In a world of increased poaching a sensible outcome is “we will pay you far less at first until you have integrated then we will start paying you more.” If true, there would not be much difference in the actual wages earned by company employees.
                  3. A company’s resources include time spent on employees to give them training on said company’s specialized tools systems and processes. Having this investment discarded before the return on investment is reaped makes the labor market inefficient, which might increase costs to end consumers.

                  I’m not saying it justifies “shady deals” (especially if ruled illegal), only that it would have been nice for the article to address the points above to provide a more comprehensive (less biased?) viewpoint.

                  1. 2

                    I haven’t played the original, but this one is obviously better because of the doubling.

                    On a serious note, this is incredibly fun, addicting and plays smoothly. Great work!

                    1. 1

                      Seconded. I only wish it would let me keep going after 2048…

                    1. 1

                      The underlying problem is due to predominately calling methods to obtain values, which violates encapsulation. This is also known as tight coupling. A much more robust solution to avoid the null pointer problem is to loosely couple the classes through well-defined interfaces using a mechanism called self-encapsulation. Consider:

                      In the tight coupling example above, each time the Blue Agent requests data from the Green Agent a null value could be returned, which must be checked. Regardless of the checking mechanism (assertions, conditionals, annotations, catching exceptions), the entire approach is incorrect.

                      Instead, the Blue Agent should query the Green Agent to determine the correct course for subsequent actions based on a boolean result, thereby maintaining encapsulation. Such loose coupling offers critical benefits. First, it eliminates null checks, as null cannot be returned. Second, it permits extending the class without imposing changes on client classes; e.g., if the Green Agent were to require middle names, the Blue Agent code should not have to change.

                      The tight coupling anti-pattern is everywhere. In my mind, the most prominent example is file handling, such as:

                      String extension = FileUtils.getExtension( file );
                      if( "JPG".equalsIgnoreCase( extension ) ) { ... handle JPEG file ... }
                      if( "PNG".equalsIgnoreCase( extension ) ) { ... handle PNG file ... }

                      Beyond terrible, this is abysmal code and all the null-checking in the world–automated or otherwise–won’t improve it. First, it uses a “utility” class, which isn’t a true class (see Bertrand Meyer’s book). Second, the series of if statements would be better as a dictionary (mapping values to methods). Third, it isn’t extensible. There are more issues, but the jist should be clear.

                      A flexible approach avoids the problem’s crux entirely: stop breaking encapsulation. I’ve drafted a presentation on this subject that includes source code examples.


                      Constructive critiques are most welcome.

                      1. 6

                        The practice you are criticizing has nothing to do with null pointers, it also doesn’t cause the other problem that you say it does (which is unrelated to null pointers), and your style of argument is profoundly unconvincing.

                        You’re arguing (maybe unintentionally?) for eliminating methods with return values, which is to say, all methods should be “commands” in Meyer’s sense. Meyer certainly doesn’t argue for eliminating queries (methods with return values), just separating them from commands. CPS-transforming buggy code doesn’t remove nulls; it just transforms them from return values to arguments. I’m not convinced that CPS-transforming tightly-coupled code makes it loosely-coupled, either.

                        Meyer’s Eiffel, which allows methods to have return values, is in fact free of null-pointer problems. So are ML and Haskell. In Haskell, in fact, functions that don’t have return values are useless, because there are no side effects. ML and Haskell don’t have encapsulation at all, but they still don’t have null pointer problems.

                        As for Blue Agent, I am deeply unconvinced by examples that rely on analogies to real-world objects:

                        I propose a new rule for discussions of object-oriented programming:

                        Anyone who brings up examples of Dog, Bike, Car, Person, or other real-world objects, unless they are talking about writing a clone of The Sims or something, is immediately shot.

                        I feel that this new policy will improve the quality of the discourse enormously.

                        If you want to find out if your ideas have merit, try them on some real code. Then you can show the “before” and “after” versions of the code, and show how the “after” version has some virtue that the “before” version lacks; for example, that some possible enhancement can be carried out by a local code change instead of a global one, or by adding code instead of changing it. Also, if you want to convince people who didn’t go to your talk, post an actual prose explanation of your argument, not just the bullet points, pull-quotes, and code samples in your slides. That way, people will be able to understand what you’re saying, instead of having to imagine it.

                        You may find it useful to use a more succinct language than Java for your code samples. Python or JS are much better at this.

                        Metaphors and similes are fine for helping people intuitively grasp your way of thinking. The problem is that they work equally well for learning ways of thinking that work and learning ways of thinking that don’t work. They are useful when you are trying to persuade someone who already trusts you to see things your way, but they do not help to persuade people to trust you or that you know what you are talking about.

                        I hope that is sufficiently constructive: I have given you specific step-by-step instructions for how to improve your presentation of your ideas, as well as, I think, identified some problems that you will have to address. I regret that you will probably have to do substantial background reading to understand what I have written above.

                        (And I don’t actually want to shoot you.)

                        1. 4

                          I’m working on a web app. that typesets beautifully designed recipe eBooks, automatically.

                          Imagine imgur + iPhoto + jsfiddle for recipes. The application uses a Natural Language Parser combined with a normalized and hierarchically categorized ingredient database to parse ingredient names, measures, and preconditions (e.g., chopped). The instructions are added using a custom enumerated list editor based on the contentEditable tag.

                          Unlike other recipe sites, mine allows people to find recipes using exact ingredient matches (e.g., “seven eggs”); the ingredient categories eliminates false positives (e.g., “chicken” will not match “chicken-of-the-woods”, which is a mushroom, but would match recipes that call for “rooster” as roosters are male chickens).

                          My first target market will likely be community farms.

                          1. 1

                            “Write getter and setter methods to hide internal representations.”

                            More often than not accessor methods violate encapsulation.