Understanding Go panic output - <AUTHOR> https://joeshaw.org/understanding-go-panic-output/ <comment><USER2> Nice article, thanks for publishing this. However:

>This panic is caused by dereferencing a nil pointer, as indicated by the first line of the output. These types of errors are much less common in Go than in other languages like C or Java thanks to Go's idioms around error handling.

I often see assertions made like this about Go. My experience at companies which use Go as their primary development language with reasonably-sized teams (30-50 people working on hundreds/thousands of Go programs) does not agree with this. I would say nil pointer dereference errors are just as common as if they were writing code in C or Java. I don't have hard data to back this up though; perhaps you do.

<comment><USER3> My explanation for why is the following sentence:

> If a function could fail, the function must return an error as its last > return value. The caller should immediately check for errors from that > function.

In practice, in idiomatic code it is quite rare for a function that returns a `(* Something, error)` to return `(nil, nil)`, which are the cases where a nil pointer dereference would most often happen. The other case is not _immediately_ checking errors. I would say both of these cases are not idiomatic Go. (Yes, there are exceptions.)

The other cases where I've seen nil dereferences pop up most often:

(1) the zero value for maps is nil, and a nil map is mostly not usable. `m[50] = "foo"` will panic with a nil dereference if you've not initialized `m`. This is one of the most annoying things about Go.

(2) not checking for presence when pulling out of a map. If you have `map[string]* Something` and do `x := m["nonexistent"]` and try to use `x`, it'll blow up. Always use the `x, ok := m["nonexistent"]` form instead, and deal with stuff when `ok == false`.

(3) nil receivers. `var x *Something`, then `x.Method()` -- the `Method()` method _can_ deal when `x == nil`, but most code does not.

My reasons for citing C and Java:

C doesn't have multiple return values, and kinds of C code deals with errors differently. Lots of stuff just returns `NULL` and all too often things don't check for it. (`malloc()` is a perfect example of this -- it rarely fails but a _lot_ of code doesn't check for errors. Now extrapolate that to everything :)

For Java, it's because the try-catch control structure complicates program flow. If you have a large block of code in a try-catch, it is very easy for a different line of code to throw an exception than you expected, and as a result an object you attempt to dereference later is null and you get an NPE. There are ways to deal with this, of course, but in my experience most people are pretty lazy about the non-happy path.

EDIT: formatting. how can a site about programming have such terrible support for typing in code

<comment><USER4> My 7 years of C++ and 7 yesterday of C# and 5 years of go agree with you. Many more nil pointer exceptions in the former and almost none in the later in similar size (large) codebases.

<comment><USER5> Most of my experience is in C#, and NullReferenceException is, by far, the most frequent exception that ever happens. Curious about if your experience with it is different, and if it is, how.

<comment><USER4> Not sure if you're talking to me. I was saying that NullReferenceExceptions happen a lot more in C# than nil pointer panics in Go.

</comment></comment></comment></comment></comment><comment><USER6> As a not-yet-experienced Go programmer, I have to say it'd make it way more palatable if the reference to the error in _my_ code could be somehow extracted and displayed in a more obvious fashion. I've had panic happen in Go code before (most of the time when trying to read the body of a http response that happened to be nil for whatever reason) and I was kind of lost in a trace of errors happening deeper in the standard library that I mostly didn't care about at first sight (until a few lines down, I could find a reference to my own program).

That being said, Go is still a pretty good language when it comes to tooling and error handling / reporting.

<comment><USER7> To offer a counterargument, I've always considered Go's panics to be pretty readable because you can read the top line to get the error and then one of the next lines down (I forget which but after a while it tends to stand out) to see the line where the error was raised. The rest of the stack is if you need to trace the error back through the calling routines (I rarely need to do this but it's useful if the panic isn't being raised by your own code).

Granted things get a little more tricky when you start multiplying the number of concurrent goroutines. I've sometimes ended up with several terminal screens full text. But so long as you can find the start of the panic output then you can generally find what you want without too much difficulty.

</comment></comment><comment><USER8> Or, you could use panicparse: [https://github.com/maruel/panicparse](https://github.com/maruel/panicparse)

</comment><comment><USER9> Maybe the go panic output could be a little bit more helpful.

</comment><comment><USER10> Sorry for this unrelated question. I am not very familiar with Go ecosystems. I have one question why there is not _official_ debugger for Go?

P.S. I am familiar with delve. I am looking for official debugger support.

<comment><USER11> Part of the reason has to do with Go's original primary use case: a server handling thousands of requests. In that environment a traditional debugger, at least in my experience, isn't super useful, because it models a single-stepped workflow but the program is massively concurrent. (also pausing a production app is probably a bad idea)

The kinds of bugs you run into are different and harder to track down, so Go has invested resources into some of those problems (for example the race detector, and automatic detection of concurrent map misuse) and you tend to rely on logging, profiling, tracing and stats to solve bugs.

I think there are plans to make an official debugger it just hasn't been prioritized.

<comment><USER3> > I think there are plans to make an official debugger it just hasn't been > prioritized.

There was a nascent project inside the Go team a couple of years ago (called ergo I think?) but I believe it was shelved in favor of Delve, which was much further along.

It's probably safe at this point to consider Delve the _de facto_ standard Go debugger.

</comment></comment></comment><comment><USER12> Not a gopher, and wondering why there are no proper exceptions.

"Panic" sounds like there's no way out other than aborting the process.

<comment><USER7> Panics can be caught and handled by parent callers and thus behave a little bit like exceptions (not as pretty I'll grant you, but still better than the "no way out other than aborting the process" approach it seems at first glance). However you generally you don't want to catch panics except under rare conditions because panics are intended to be used in "the world is ending" kind of scenarios (it doesn't always work out this way but that is the theory).

For general error handling there is an error object that gets returned by functions. It leads to the often moaned about syntax below:

        if err != nil {
            return err
        }

Yeah it's ugly. Yeah other languages have try / etc. But for all of it's sins I've found it still gets the job done.

<comment><USER12> Thanks for the explanation.

Writing that if-construct after every function call doesn't sound like a lot of fun. In fact it sounds like work!

Honestly, I think I'll wait until Go has matured a bit, before I try it for a side-project.

<comment><USER7> It's easy to criticise this from a visual glance but you have to remember that proper error handling in any language is hard work and often produces ugly code where you need to account for multiple edge cases - many of which aren't serious enough to cause an exception but would still break the program's logic. All Go does is group these conditions into a standard interface.

Furthermore, because Go does unify these conditions, I've found it effective for handling a whole array of differing edge cases that I might have otherwise overlooked. In that regard I've anecdotally found it more effective than most of the habits you see in other languages (I can't say _all_ languages because I haven't used every language out there, but I have developed in excess of a dozen different programming languages over the last 30 years).

In short, in Go error handling becomes a first class citizen rather than a byproduct you begrudgingly need to check for.

Also while it might not be to everyone's tastes, adding "if err != nil {" really does add practically nothing to your overall dev time in real terms.

But I'm not here to advocate one method of error handling over another, nor to try and convince anyone to use Go who might not have otherwise. Obviously you can see I get a little frustrated when people judge it purely on face value but that's because I have spent some time with the language and found it to be surprisingly effective at delivering a stable product.

<comment><USER12> > Also while it might not be to everyone's tastes, adding "if err != nil {" > really does add practically nothing to your overall dev time in real terms.

But how do you compose functions then. You can't write:

        f(g(h(...)))

> when people judge it purely on face value

Yes, I can see that is frustrating. But I already know the style of programming that requires if-statements instead of exceptions, as I have been programming in C a lot, and I don't want to go back to that style because I'm lazy and I'm sure I will forget to handle some errors. I want my language to deal with this. Honestly, is that really too much to ask? Even javascript has exceptions.

<comment><USER13> > because I'm lazy and I'm sure I will forget to handle some errors

I really think you should try Go before being so convinced about your assertions.

It's not easy to forget error handling in Go.

And letting exceptions bubble up all the way will improve things how?

<comment><USER14> A stack of ten functions doesn't need to explicitly catch and re-raise the exception ten times to get it to where it can be handled.

<comment><USER4> Sure, and then you have no idea what was executed and what failed. Did you run 9 functions or 1? What do you need to roll back? How do you handle the error?

This is the problem with exceptions. They make it too easy to be lazy with your error handling.... Most of the time it's just catch and log, because the code itself has no way of knowing what failed and what succeeded. This is how you get your program in a bad state.... Because maybe you uploaded the file but didn't set the metadata in the API, because the connection broke between those steps.

With go's error handling it forces you to think about "what happens if the code fails _here_ ". Its always obvious what code had been executed and what has not.

To get that behavior in exception oriented languages, you'd have to wrap every call in try/catch, which ends up just as verbose as go, if not worse.

<comment><USER15> > Sure, and then you have no idea what was executed and what failed. Did you > run 9 functions or 1? What do you need to roll back? How do you handle the > error?

> […]

> With go's error handling it forces you to think about "what happens if the > code fails here".

Did it run 9 functions or just 1? What do you need to roll back? How do you handle the error?

The inner code could have just bubbled an error by hand from a deeper call (or the library could even have used panic/recover internally to do so, the stdlib used to do that). You have no more idea than in the exceptions-based code unless you have the source available right there, which you'd then also have in an exceptions-based language.

> To get that behavior in exception oriented languages, you'd have to wrap > every call in try/catch, which ends up just as verbose as go, if not worse.

So your argument in support of Go's error handling is that the _very worst case_ of exceptions-based error handling you can imagine is about as bad as the _baseline case_ of Go's?</comment></comment></comment></comment></comment></comment></comment></comment></comment>


The Megaprocessor is a micro-processor built large. Very large - <AUTHOR> http://www.megaprocessor.com/ <comment><USER2> Significant discussion, including comments and replies from the man himself: [https://news.ycombinator.com/item?id=9755742](https://news.ycombinator.com/item?id=9755742)

A few extra comments: [https://news.ycombinator.com/item?id=11459225](https://news.ycombinator.com/item?id=11459225)

There have been other submissions:

[https://hn.algolia.com/?query=megaprocessor&sort=byDate&date...](https://hn.algolia.com/?query=megaprocessor&sort=byDate&dateRange=all&type=story&storyText=false&prefix&page=0)</comment>


Leaving services' ports at their default values: convenience VS security - <AUTHOR> https://nmaggioni.xyz/2016/06/24/On-default-ports/ <comment><USER2> Security by obscurity is not security.

Use fail2ban or similar to ip-block brute force attempts, and minimise public services like MySQL, etc by requiring a vpn/ssh tunnel to connect.

How is this idea of using random ports for "security" still a thing?

Do the same people suggest md5 for passwords too?

<comment><AUTHOR> I wan't focusing on hardening a server, my point was avoiding simple random scans for the sake of log management. Maybe I've used the word "security" too lightheartedly?

<comment><USER2> Fail2ban still solves that problem. A few entries with failed auth, and hey presto no more log entries because it's rejected by the firewall.

It's a well established pattern for brute force tools to not just try the default port, but perform a port scan to detect listening ports, and then try those.

Putting your services on other ports just makes things inconvenient for the user, nothing more.</comment></comment></comment>


Trends Shaping the Future of HR in 2017 - <AUTHOR> http://cactushr.com/blog/2016/12/26/hr-trends-shaping-the-future-of-hr-in-2017/ <comment><USER2> >we are seeing an increasingly damaging trend – people are still "chasing" more money.

that viewpoint basically summarizes all this HR development.

</comment><comment><USER3> I fear for the folks coming into the workplace who think that HR exists to be their advocate.

<comment><USER4> Agreed. For people who don't know, HR is't like "Internal Affairs" like you see in movies, they are employed by the company to do a few things:

1\. Create benefit plans. 2\. Keep the employer from getting sued.

#2 is particularly important. They are very risk averse, so they will take the quickest path to safety. Post something on social media that someone could take out of context or misinterpret? Fired. Shortest path. Criticize the company or your boss in some way? Fired. Shortest path. Say something overheard by someone else that might offend them? Fired. Shortest path. A potential hire says something odd to the HR manager during an interview? Denied, to risky.

Something funny, at a company I worked for years ago, HR created a questionnaire to gauge morale in the company compared to other software companies. Every department was well below the average (meaning low morale) except the HR department which was well above.

Beware.

<comment><USER5> I couldn't agree more with your comment. I've seen too many people fall into the trap of believing that the HR department is there to protect them, only to find out much too late that the reality is as you described.

</comment></comment></comment><comment><USER6> Ctrl-F "team"...

Actually, fewer matches than I might have guessed, but even so there seems to be a great deal here about teams and interactions and very little about letting smart individuals get on with things in private spaces.

<comment><USER2> we've just seen it in the hardware - horizontal scaling, a huge number of well connected commodity elements beat standalone super-servers for most practical purposes and metrics. So, now we going to do that with human "wetware" too, and HR glamorizes itself as Kubernetes (with original system suitably called Borg at Google) in that brave new world.

<comment><USER7> > So, now we suppose that would work for human "wetware" too

Why do you think it wouldn't?

<comment><USER6> It's not out of the question that they might. Although there's a countervailing view that humans motivated by passion perform better -- perhaps dramatically better -- than those who feel like cogs in a machine.

Either way, it's an important issue for people who hope to find a working environment where they feel satisfied (which, to be clear, might for different people mean a preference for teamwork, solo-work, or perhaps some of each).

<comment><USER7> > Although there's a countervailing view that humans motivated by passion > perform better -- perhaps dramatically better -- than those who feel like > cogs in a machine.

I'm not sure that matters much. If it delivers more to the bottom line to treat people like cogs so that the org is more scalable, then that's probably what will happen.

In modern distributed systems, we've de-emphasized vertical scalability (in our analogy, an individual's motivation and performance) to improve horizontal scalability, fault tolerance, flexibility, etc. It sucks to admit, but if your organization needs those kind of scaling characteristics, then treating your employees like cogs may be the most profitable organizational structure.

</comment></comment></comment></comment></comment><comment><USER8> Interesting. Most of the "trends" have made similar lists for years (e.g., teams). However, #8 on working together with a greater sense of purpose seems to capture the current zeitgeist pretty well.</comment>


Ricardo's Difficult Idea (1998) - <AUTHOR> http://web.mit.edu/krugman/www/ricardo.htm <comment><USER2> Specialization is centralizing. Centralized systems are arguably more fragile (a negative, when reliability is a goal) and easier to actively leverage for something I might not like (absolute power corrupts...). There is also a patronizing aspect to 'free trade' that implies monopolies are the just outcomes of meritocracies, which I consider patently false. Quite the opposite: we constantly have to fight centralization of power, and 'free trade' (a misnomer, IHMO), is a dangerous centralizing force at a global level, which we have basically never had to reign in.

I find it amusing how often people who consider themselves libertarian, etc, argue for some of the most fascist regimes imaginable.

<comment><USER3> I think that part of the disconnect is that economists look on a much longer term policy wise than non economists. There will be an affect on jobs, trade deficits, &ct. of any free-trade act for at least a decade, and it's not unreasonable to look at history and argue a time frame of ~50 years for markets to approach an equilibrium.

If you reframe it the discussion as "lots of you will lose your jobs over the next 50 years, but your grandchildren will have about the same employment rate as you, and higher quality of living" then you can start to have a more meaningful argument about how to manage the short-term side effects and the long term benefits.

Similarly there's debate as to the long-term viability of monopolies, as well as government regulation. If in the long term monopolies fall apart on their own and government regulation turns to regulatory capture, then you can see the economist's opposition to trust-busting.

</comment></comment><comment><USER4> There is such thing as current relative advantage; and to change what your relative advantage is, it may be useful to restrict some of the trade.

Also, having ten inefficient suppliers is often better than having one very efficient monopoly — because it is usually also efficient at overcharging.

If the incentives are perfectly aligned and there is a medium term success or failure to consider, relative advantage works as advertised; but this will be closer to three equal startup co-founders dividing the work in the early stages than to international trade.</comment>


Ask HN: What is your Personal/private server setup? - <AUTHOR> There seems to be a trend to personal/private clouds, especially with YC comapnies like Protonet. VPS are nice, but are fully accessible by the owners of the server and offer little in way of physical protection.
I've been doing research into server setups, especially with boards that are libreboot compatible but many are above my needs or too costly. Moreover, component and energy cost are factors to consider for personal users more than for businesses, and yet don't seem to be very talked about.
What are you personal server setups? Do you use a special OS, BIOS etc? <comment><USER2> I've got an Intel NUC with Ubuntu 14.04 on it. That probably doesn't get me too much nerd cred, but you know what? It works and that's all I really care about.

Currently I use it as a seed box, media center (xbmc), and Syncthing host.

I intend to do more with it in the future, things like hosting a personal email server, but at least for that, I'm assuming that I need to figure out a reverse proxy for SMTP so that I can actually send email without it getting marked as spam. (I don't want an SMTP relay server because the point is that I want the plain text of my emails to only exist within my network and devices.)

I also need to figure out how to only VPN my torrent traffic and not the rest of the traffic.

<comment><USER3> Mail-in-a-Box is a wonderfully easy to setup (self-hosted) email server that I've been using for the past year.

</comment></comment><comment><USER4> I've got a Drobo 5N for storage. Works great.

</comment><comment><USER5> nice try nsa</comment>


Ask HN: Git workflow in local? - <AUTHOR> Anyone collobarate on the same server with multiple devlopers?
I have this restricted server where I cannot run a daemon or a simple http server. So, We will have work on the same repo.
Is there any established workflow for this? I'm a git beginner. <comment><USER2> Git can work fine with a simple SSH or file location/share remote.

Even (especially) if everyone is on the same machine you would want each developer to have their own clone of the repository and push/pull between each other and/or a central clone to exchange commits.

</comment><comment><USER3> I'm not sure I understand what you mean.

Do you mean there are multiple developers working in the same local repository on a server you SSH into?

Or do you mean multiple devs working in the same codebase?

<comment><AUTHOR> We have an application code (<50 files for now. can grow) that multiple devs work with. I maintain the master copy of it in a server where git available. I'm thinking of having version control with git for this codebase.

The other devs should be able to pull and push changes to it. I'm looking for an optimal workflow that'll save us some headaches later.</comment></comment>


Asciinema – Record and share terminal sessions - <AUTHOR> https://asciinema.org/ <comment><USER3> 'script' also does something similar, and is one of the lesser known commands.

from the man page:

           script  makes a typescript of everything displayed on your ter‐
           minal.  It is useful for students who need a hardcopy record of
           an  interactive session as proof of an assignment, as the type‐
           script file can be printed out later with lpr(1).

<comment><USER4> script unfortunately messes with SIGWINCH for terminal resizes - <USER2> seems to work better in that case.

<comment><USER5> can script record vim editing session?

<comment><USER6> Not well, but asciinema does it wonderfully.

e.g.: [https://asciinema.org/a/188770](https://asciinema.org/a/188770)

</comment></comment></comment></comment><comment><USER7> Pretty favorable experience with working with this tool at $dayjob, all but the compiling of it. Luckily they release precompiled js/css files that are fairly straightforward to consume.

The downside is that the recording format is a bit of a mess and that you end up having to hand tweak things a lot in order to make the recordings pretty. I wish the tool had more in the way of cleaning up its own recordings so that wasn't necessary. There's a small cottage industry of tools on github around this, but none of them were exceptional enough to warrant a note here.

</comment><comment><USER8> Don't know if I want to a script that records my terminal session and upload the recording to an external server. Is there a way to keep the recording local?

<comment><USER9> asciinema is open-source and the file format is publicly documented (asciicast)[1]. You can run `asciinema rec filename.json` to save the file locally and self-host it with asciinema-player[2]. Alternatively, there's also asciicast2gif[3] that converts asciicast json to GIF image.

[1]: [https://github.com/asciinema/asciinema/blob/master/doc/ascii...](https://github.com/asciinema/asciinema/blob/master/doc/asciicast-v2.md)

[2]: [https://github.com/asciinema/asciinema- player](https://github.com/asciinema/asciinema-player)

[3]: [https://github.com/asciinema/asciicast2gif](https://github.com/asciinema/asciicast2gif)

<comment><USER10> Has anyone experiences with asciicast2gif?

On the surface this looks just like what's needed to make this work for me: I like the recording tools, but don't want to be forced to embed a player from a third party service.

Looks like asciinema2gif relies on PhantomJs which brings withit an entire browser and is also no longer maintained. This looks very bloaty for a tool that should convert terminal input to a gif file.

Is it working relieably and reasonably fast?

<comment><USER11> I've written an incomplete ad-hoc renderer in Go: [https://github.com/akavel/asciinema2gif](https://github.com/akavel/asciinema2gif) — it worked in one case where I needed it personally, but it's missing support for _a lot_ of escape sequences, so it most probably Won't Work For You As Is. But you're free (as in AGPL) and welcome to play with it if you like!

</comment></comment></comment></comment><comment><USER12> Asciinema is great and a joy to use, but one of the coolest things about how Asciinema is made is that the web player implements a virtual terminal emulator in Clojure:

[https://github.com/asciinema/vt/blob/master/src/asciinema/vt...](https://github.com/asciinema/vt/blob/master/src/asciinema/vt.cljc)

It's cljc, which means it runs on both JVM and in JS. I have no idea if they actually use the JVM bit.

<comment><USER13> The JVM part is not in practical use, but it was just to easy to use cljc to not do it this way

</comment></comment><comment><USER14> I have automated a few installations of historical operating systems in qemu/bochs with the help of travis-ci. Due to all the ANSI output the job logs are unreadable. To see what's going on in the emulator I use an asciinema rec/asciinema upload in the build scripts. This helped me out a lot.

</comment><comment><USER15> There are only 2 ways of pronouncing that, "Ascii enema" or "Ass cinema", both butt related... bit unfortunate.

<comment><USER16> It's "ask-inema" in my head.

<comment><USER17> That's the obvious answer. This is a name that looks great when reading, but sounds awful when spoken.

</comment></comment></comment><comment><USER18> Two threads from 2018: [https://news.ycombinator.com/item?id=17048922](https://news.ycombinator.com/item?id=17048922)

[https://news.ycombinator.com/item?id=16409429](https://news.ycombinator.com/item?id=16409429)

Related from 2016: [https://news.ycombinator.com/item?id=12090020](https://news.ycombinator.com/item?id=12090020)

Three from 2015: [https://news.ycombinator.com/item?id=10398635](https://news.ycombinator.com/item?id=10398635)

[https://news.ycombinator.com/item?id=9753537](https://news.ycombinator.com/item?id=9753537)

[https://news.ycombinator.com/item?id=9072218](https://news.ycombinator.com/item?id=9072218)

First posted in 2013, getting a single dismissive response: [https://news.ycombinator.com/item?id=6556106](https://news.ycombinator.com/item?id=6556106)

Lots more with few comments: [https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...](https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=Asciinema%20comments%3E0&sort=byDate&type=story)

</comment><comment><USER19> If you feel like using asciinema or similar on your readme - _please_ consider using plain text instead.

This fancy players:

\- are unfriendly to visually impaired people

\- are unfriendly to the many people with low bandwith in the global south

\- require you to watch the play instead of scanning through text with your eyes

\- cannot be searched for text strings easily

\- cannot be easily used in a terminal or without a browser

<comment><USER7> > please consider using plain text instead

You do understand this is a false dichotomy? You can have both. Some people would rather watch a video and follow along, whereas others get more out of reading text... and both fit neatly on a page right next to one another.

<comment><USER20> For double the effort, which not many people go to.

<comment><USER21> sure, if you're going to be lazy and only do one do text. HOWEVER advocating for the lazy path amongst fellow practitioners is not a great strategy to promote quality output.

Documentation is hard. Good documentation is harder. There are many occasions where video and video-like things are good for getting a feel for something and just plain text is good for reference. We shouldn't be saying "just use text because you probably won't bother doing everything you should". We should be saying "Hey, video, still images, and text all combine to make great documentation and help people to understand and use your tool / product." They take time, but we should care about our users, and thus we should take the time to support them.

</comment></comment></comment></comment><comment><USER22> Love the tool there are a couple of downsides:

1) Doesn't work with powerpoint if you have to use that

2) There's no "pause" point. A lot of time you want to have the command play to a certain point but then cause until you click "next" so that you can explain things to the audience before continuing on.

3) End up having to fiddle a lot with the JSON so the timing feels decent vs me copy/pasting into it and hitting enter.

<comment><USER23> I have used ascii2gif to use asciinema in powerpoints, documents etc, successfully. Would this be helpful to you?

</comment></comment><comment><USER24> Are there any alternatives (just want to see alternatives to find which is best for my use).

Either way, looks nice!

Although a bit irrelevant, like the gradient!

<comment><USER25> I wrote termtosvg as an alternative [1]. It's a python program that records a shell session as a standalone SVG animation. Animations produced by termtosvg can be embedded in Markdown files or HTML pages.

[1] [https://github.com/nbedos/termtosvg](https://github.com/nbedos/termtosvg)

<comment><USER26> That's great! I love the approach: a standalone ouput in a standard format.

Do you think you could also add support for ttyrec input?

This would allow converting existing ttyrecs and have a a full suite of tools creating all the options ready to upload between 1) standard text format record, 2) regular animated gif, 3) svg when saving space is important (while gaining zoom abilities as well!)

<comment><USER25> It's a good idea. I don't have much time for termtosvg these days so I can't promise it'll get implemented but I've opened an issue to remember it [1].

[1] [https://github.com/nbedos/termtosvg/issues/108](https://github.com/nbedos/termtosvg/issues/108)

</comment></comment></comment></comment><comment><USER27> I've been using this for years and have been really happy with it. IMO it beats other video/gif recordings because of the way it stores the data files. It records all input and output individually, so you can copy-paste from the recordings. I think it would be invaluable in a classroom setting.

</comment><comment><USER28> if you're looking for something interesting to record, try notcurses, 0.4.0 released last week. [https://www.youtube.com/watch?v=eEv2YRyiEVM](https://www.youtube.com/watch?v=eEv2YRyiEVM)

</comment><comment><USER29> I tried using asciienema for a blog post. I forget exactly why I gave up on it. Something about it frustrated me and didn't work right.

I ended up using OBS to make a screen capture. Now I have an MP4 that plays in a vanilla html5 video tag and will work forever.

<comment><USER30> One killer feature you get with asciinema & not with an MP4 is that people watching it can copy & paste from your recording. So they don't have to type out the same command you typed, they can just copy it into their terminal directly

<comment><USER7> Not what I'd consider a killer feature, but it's definitely one of the advantages.

Now, what is killer is that the recording is just a text file, so I can edit it and check it in to my source control system, rather than having to mangle some screen recording environment and check in a binary blob that's hard/impossible to edit in the future.

It's also pretty universally guaranteed to work since it doesn't demand much of the browser as far as weird javascript features go, and means I can deliver a whole screen recording in the fraction of the size of an MP4 file. It's screen resolution agnostic, making it more functional for a wider class of users than a video. I also don't have to ship a different version of the recording if I want a high contrast version for accessibility reasons.

So, yeah, plenty of reasons to use asciinema over a conventional screen recording.

</comment></comment></comment><comment><USER31> My team wrote our own implementation with a similar API to get around Asciinema's weird support for React [0]. We've been using it in our web application to play back historic terminal sessions recorded by our agent. Unfortunately it hasn't been split out from the main application code yet. Open sourcing it is on the list.

[0] [https://github.com/asciinema/asciinema- player/issues/72](https://github.com/asciinema/asciinema-player/issues/72)

<comment><USER32> How do you mean with the "weird support"? I could read the code of course, but essentially, what do you mean? :)

<comment><USER33> The first two posts of the linked issue should satisfy your curiousity.

</comment></comment></comment><comment><USER34> I love this tool.

For people who want to render asciicast to SVG, I can highly recommend svg- term-cli[1].

[1] [https://github.com/marionebl/svg-term- cli/](https://github.com/marionebl/svg-term-cli/)

</comment><comment><USER35> When I saw the name I thought of towel.blinkenlights.nl

</comment><comment><USER36> And the site is down.

</comment><comment><USER37> I've used IT few times, it's cool.

</comment><comment><USER38> Welcome to the internet, but thanks!

</comment><comment><USER26> Let me be the devil advocate: why not use ttyrec + seq2gif instead? Or check [https://intoli.com/blog/terminal- recorders/](https://intoli.com/blog/terminal-recorders/) if you don't like my recommendation

ttyrec is a standard format that most people and tools understand.

And if you want something fancy that asciinema output, you can use seq2gif which support all the bells n whistles asciinema does, while allowing you to also upload the ttyrec file.

However, I would suggest not using unicode or Ansi color in your recordings.

You want to demo a feature, not show your cool terminal or the amazing gif you made. The gif is just a byproduct. Keeping to plain text as much as possible makes your recording available to people using text terminals and Braille screen readers.

My most recent example: [https://github.com/csdvrx/pg_csdvrx/raw/master/pg_csdvrx.tty...](https://github.com/csdvrx/pg_csdvrx/raw/master/pg_csdvrx.ttyrecord) and [https://github.com/csdvrx/pg_csdvrx/raw/master/pg_csdvrx.gif](https://github.com/csdvrx/pg_csdvrx/raw/master/pg_csdvrx.gif)

(in case you wonder why I'm doing a cat /dev/random into a live postgres database block file, this is to show how I can recover the database content from the raw directory. Kids, don't try this at home. Don't try it at your parents work on their production database either. In fact, just don't do that, it is only for when your database ends up in /lost+found)

<comment><USER39> >Let me be the devil advocate: why not use ttyrec + seq2gif instead?

GIFs look poor - they don't capture colours well. They're not accessible. They don't zoom. Copy and paste doesn't work.

>And if you want something fancy that asciinema output, you can use seq2gif which support all the bell n whites asciinema does, while allowing you to also upload the ttyrec file.

Unless I'm missing something obvious (possible!), seq2gif makes a GIF file. How does this "support all the bell n whites asciinema does"?

>However, I would suggest not using unicode or Ansi color in your recordings.

It's 2019, there's no excuse for these (and emoji!) not working fine.

>You want to demo a feature, not show your cool terminal or the amazing gif you made. The gif is just a byproduct. Keeping to plain text as much as possible makes your recording available to people using text terminals and Braille screen readers.

Agreed - how does seq2gif fit in with this? Or are you saying the ttyrecord files are more accessible?

It looks like a binary format, I have nothing on my system that can read it. I _do_ have a web browser, though.

<comment><USER26> > Or are you saying the ttyrecord files are more accessible?

I do. You can edit them like if you made a typo. They are common, so there's an ecosystem of tools if you don't like raw edits.

Next to that, asciinema looks like reeinventing the wheel, except it's no longer round, so it requires special tools and roads now. But what's a few extra dependencies? It looks better and it's new!

> I have nothing on my system that can read it. I do have a web browser, > though.

In general, I prefer a standard format supported by many free software tools that lets me create a file in another standard format that I can put on my website without requiring various other dependencies, like javascripts. Especially if I can pacman / apt-get install the tools.

> seq2gif makes a GIF file. How does this "support all

asciinema #1 use case is to show a recording with color, unicode, etc. I think that's a bad idea for accessibility. You want to show features, not look cool. Still seq2gif gives you that, and the output in a standard format. You can replay the original in a normal term, copy paste etc.

If you think copy & paste from the browser showing an animated replay of the terminal is an important use case #2, huh, we have different use cases, but I don't see how it couldn't be done as another target (seq2something_else, maybe seq2svg?) from a well known and accessible format like ttyrec

<comment><USER40> >In general, I prefer a standard format supported by many free software tools

Which are? This is the first I'm hearing of ttyrecord in the first place.

> Especially if I can pacman / apt-get install the tools.

asciinema is in the arch repos, "ttyrec" is in the AUR. Both are in the debian repos.

> You want to show features, not look cool

The use you're talking about is in marketing material. Looking cool _is_ a feature!</comment></comment></comment></comment>


Ask HN: How do I promote my teaser page? - <AUTHOR>

I am working on a site that showcases works of mobile app developers (plug: tinkerwave.com).  Currently I have a teaser page up, but I am wondering how I should promote it.
I have read some HN threads on promoting a functional site.  What about a teaser page that only collects emails?  I am a bit concerned about coming off as spammy.
Any advise is appreciated. :) <comment><USER2> Put content on it which is interesting to your intended audience. Promote content. P.S. mail to mailing list, too.

<comment><USER3> Yeah, you don't want to make it look like spam! Put some 'teasers' on the page like you said. How else do you plan to tease it if your not really teasing? If you don't want to give away your idea, try to be as vague as possible with the content on the site.

How about making a survey to see if you can see if users are interested in your product/service and the same time your offering some idea of what your product is (or so they think). This is a great way to kill two birds with one stone.

Tip: Change up the survey every so often to see if you're still consistently getting similar responses.

<comment><AUTHOR> Thanks for the tip, sounds like a good idea, I'm on it.</comment></comment></comment>


Safari now supports Service Workers: What this means - <AUTHOR> https://dev.to/ben/safari-now-supports-service-workers-and-what-that-means-to-me-at-least-3oi7 <comment><USER2> Just to be clear, Safari 11.1 will support Service Workers, which is available in the currently beta versions of iOS 11.3 and macOS 10.13.4.

Safari Technology Preview has had Service Worker support for a few versions now, which doesn't require a beta version of macOS: [https://webkit.org/blog/8084/release-notes-for-safari- techno...](https://webkit.org/blog/8084/release-notes-for-safari-technology- preview-48/)

</comment><comment><USER3> Hopefully the age of web apps and the demise of frivolous and expensive marketing apps for the sake of having an app.</comment>


Ask HN: What Sass blogs do you follow? - <AUTHOR>

I'm currently following:<p>- http://nex-3.com/ - creator of Sass and Haml<p>- http://chriseppstein.github.com/blog/ - creator of Compass<p>-http://blog.derekperez.com/<p>- http://wiseheartdesign.com/weblog/<p>Are there any other good blogs that regularly post about Sass techniques? <comment><USER2> Not exactly a blog (though it does have a feed) but <http://coder.io/tag/sass> has a regularly updated list of Sass related articles and projects.

</comment><comment><AUTHOR> Also, if willing, share your delicious links if you have any.

<http://www.delicious.com/csmeder/sass>

</comment><comment><USER3> From the Saas startup Apprenda: <http://www.saasblogs.com></comment>


Many Bones Would You Break to Get Laid - <AUTHOR> https://www.thecut.com/2019/05/incel-plastic-surgery.html <comment><USER2> Given today's demographics, not being overweight and being _slightly_ toned, already will put you in the top 10%. This doesn't take much. And if you want a little silicone chin implant that can be inserted in a few minutes, it can make most of the difference without all the other corrections that people are getting.

Men who want to look good shouldn't feel ashamed, or be label with "body dysmorphic" unless there's a real issue. Frankly, there's no reason men shouldn't try to look their best, as women have been pressured to for years!

</comment><comment><AUTHOR> Surprising and in-depth look at the lengths to which incels are willing to go to improve their dating prospects.

</comment><comment><USER3> Actual title is "How Many Bones Would You Break to Get Laid?" Why was it changed?

</comment><comment><USER4> I made the mistake to read the comments on the article, and am shocked of some people's comments (who are obviously not only incels but mentally disturbed). The incels community is a hate breeding ground that can cause real violence in the real world. Some guy aspires to the success of what he calls the dark triad traits: psychopathic, Machiavellian and narcissistic gives examples of such men who had success with women: Ted Bundy, Hitler, etc.. Mind boggling.

<comment><USER5> It's kind of fascinating when you put on a neutral anthropologist sort of hat and look at this stuff. Things like the incel phenomenon are basically cults, but they're a new kind of cult for the Internet age. They're like amorphous cults where the charismatic leader is a Borg-like hive-mind that exists in online forums.

There are lots of weird variations on the theme too. Look into the Slenderman phenomenon. It was something invented on a forum that ended up turning into a weird urban legend and then causing a few murders.

<comment><USER4> Yes, your're right, they're a new kind of cult facilitated by internet and anonymity which functions similarly to old cults, a charismatic leader brainwashes a mass of people.

Their outreach is far greater, anyone who has internet connection can basically partake. Traditional cults have a much smaller footprint.

I think other types of internet cults are yet to come, and we should brace for it somehow. One big factor that pushes people towards internet cults is the fact that society is becoming increasingly connected and yet people are more and more physically isolated from one another

<comment><USER6> The fact that these folks are actually striving to get things like plastic surgeries so that they can achieve their goal of overcoming lookism and achieving social success, would seem to argue _against_ it being like a cult - they're putting their ideas to the test, one way or the other. I see pure "blackpill", nihilistic thinking as quite a bit more cult-like.

<comment><USER4> They are cult like but not like a classic cult, but not like a community either. The difference being that these people are isolated from the world and physically isolated from other members like themselves. The more toxic ones feed the others poison. The ones who manage to get out are called fake-in cells. If they got to hang out physically they'd probably detest each other.</comment></comment></comment></comment></comment>


The Case Against Reality - <AUTHOR> https://www.theatlantic.com/science/archive/2016/04/the-illusion-of-reality/479559/?single_page=true <comment><AUTHOR> The full paper is here - [http://www.cogsci.uci.edu/~ddhoff/ConsciousRealism2.pdf](http://www.cogsci.uci.edu/~ddhoff/ConsciousRealism2.pdf)

I particularly like his thinking around the section titled "3\. User Interfaces". I'm new to this area, so would be curious if there are any good rebuttals (or if this in general is not falsifiable)

</comment><comment><USER2> "It's not that there's a classical brain that does some quantum magic. It's that there's no brain! "

Who can take this stuff seriously?</comment>


Understanding machine learning from theory to algorithms - <AUTHOR> http://www.techleer.com/articles/230-understanding-machine-learning-from-theory-to-algorithms/ <comment><USER2> This is an amazing book. Not sure why it's free</comment>


The Tau Manifesto video - <AUTHOR> http://youtu.be/H69YH5TnNXI

<comment><USER2> In a nutshell: <http://vihart.com/blog/pi-is-still-wrong/>

</comment><comment><AUTHOR> This video is from a talk I gave on Tau Day last year. I released it today in honor of Half Tau Day.

 _The Tau Manifesto_ has also been considerably revised. See especially the updated Section 4 (<http://tauday.com/tau- manifesto#sec:conflict_and_resistance>).</comment>


PaperBack: Back up your code to paper (seriously) - <AUTHOR> http://www.ollydbg.de/Paperbak/index.html

<comment><USER2> Has anyone printed it (I think you need Windows)? I'd love to see what it looks like.. I'm wondering what kind of a coding scheme it uses. I've seen one scheme that was created by some company few years back and you could restore it even if you teared off a corner of the page. It had enough redundancy to fix the loss of data.

<comment><USER3> from: <http://programming.reddit.com/info/5zikd/comments/>

<http://a1k0n.net/temp/paperback_sample.png>

a more robust implementation:

<http://ronja.twibright.com/optar/>

<comment><USER2> Thanks!

</comment></comment></comment><comment><USER4> "Seriously"? It says "joke" at the top of the page.

<comment><USER5> I haven't run the .exe, but the source code looks pretty non-jokish to me.

<comment><USER4> Like the guy says, just because it works doesn't mean it's not a joke.

More telling, there's absolutely no data on reliability presented. If it was meant to seriously be used, that would be the first thing you'd want.</comment></comment></comment>


Bypassing anti-incognito detection in Google Chrome - <AUTHOR> http://mishravikas.com/articles/2019-07/bypassing-anti-incognito-detection-google-chrome.html <comment><USER2> Am I the only one that wants their browser to be 100% stateless? I always run in incognito mode, and I have an external password manager. I have no problems with this setup except sites that detect and block incognito mode.

Other than caching, there is no legitimate benefit to allow pages to store local state beyond a session, and I can forgo caching at this point in the game. (I don't care about offline web apps, to be clear)

Maintaining a whitelist of sites that can have session state would be trivial (the sites in my password manager are a great first cut). I don't want to restart my browser periodically to clear everything else's session state.

How hard would it be to build something like this?

<comment><USER3> On HackerNews? You're probably not the only one.

In the world of real users? You're probably the extreme minority.

Most people want convenience, and will trade almost anything for it. Especially if they don't realize they are trading something like "privacy" or "trackability" for convenience.

<comment><USER4> Why do you try to imply that a Web browser experience not built around making the user trackable most effectively, like it is by default with the big browsers, has to be inconvenient?

The way I use Chromium [0], is very convenient to me. The downsides are almost nonexistent, and the upsides are not just in privacy: it is convenient (albeit perhaps of questionable morality?) to not have to worry about newspaper article quotas; likewise with having more control over cookies and other browser data in the "simultaneous multiple sessions" model. For example having more than one user logged in to some Web site does not take any extra effort compared to just one user being logged in.

On the other hand there is a difference between "real users" and those willing to exploit the Unix programming environment/interface to its full potential, and that is required knowledge, or the willingness to get it. For example to use my script _tb_ effectively one has to understand that "being logged in with a Web site" means temporarily storing appropriate data chunks gotten from the Web site (cookies) so that they are accessible to the browser and it could send them back to the server to authenticate.

[0] [https://news.ycombinator.com/item?id=20484845](https://news.ycombinator.com/item?id=20484845)

<comment><USER5> You answered your own question. The vast majority of users are not "willing to exploit the Unix programming environment."

For the vast majority of people who do not already have Unix skills (or whatever), it is convenient not to have to learn them.

</comment></comment></comment></comment><comment><USER4> I run Chromium with _\--user-data-dir_ , the _current directory_ , and the environment variables _HOME_ and _XDG_CACHE_HOME_ all set to directories within a tmpfs (/tmp).

It is better than "Incognito mode".

[https://bbs.archlinux.org/viewtopic.php?pid=1733332](https://bbs.archlinux.org/viewtopic.php?pid=1733332)

<comment><USER6> Wonder if it's possible to make something like that on Windows

<comment><USER7> Chrome does have guest profiles: Click your user icon, and there'll be an "Open Guest Window" button.

> "You're browsing as a Guest"

> "Pages you view in this window won't appear in the browser history and they > won't leave other traces, like cookies, on the computer after you close all > open Guest windows. Any files you download will be preserved, however."

It's kind of like Incognito, except none of your preferences or extensions are there, either, it's just an entirely new profile that self-destructs when you close it.

The OP's detector considers a guest profile not to be Incognito mode.

</comment></comment></comment><comment> em-bee there is only one way to get around this. incognito mode needs to emulate all system resources without actually making them available.

even without that consideration, for things like disk storage, there is no reason[1] why incognito mode should have less access than normal mode. all websites should function as normal. the only difference is that in incognito mode everything is wiped once it is closed, and nothing is written to disk.

[1] ok, so the reason for the limitation is that the disk has to be emulated in memory because incognito mode must not write to the disk which could leave artifacts behind.

this makes me wonder if it is possible to detect a difference in timing for example when writing lots of data with an emulated disk vs a real one.

<comment><USER8> I think there are two use cases for incognito mode:

1\. I don't want others who have access to my client machine to be able to see a history of what I did online.

2\. I don't want servers to be able to know anything about me except maybe my IP address.

It feels like tying these two together under one setting makes them both fragile. E.g. for scenario 2, I don't care whether a web page can use local storage as long as they don't have access to the data between sessions.

I'd much rather have two options - hide from the server and hide from your boss (or whoever). And maybe some UI to help me always hide from specific servers or delete all the artifacts from a specific session after the fact.

<comment><USER9> I want #1 for all machines, almost 100% of the time. Maybe 99%.

I try to wipe my drives and repartition every 30 to 60 days, with a full OS reinstall. The Virtual Machines I run with VirtualBox are even _less_ persistent than the bare metal, often stateful for mere hours. I do not retain browser history, and I have only about 5 bookmarks, and trash my cookies and cache at least every day, multiple times usually.

But I want #2 for like 75% of the time. The other 25% of the time, that state almost never lasts 48 hours. When I go to bed, the current browser state dies forever. I usually have a hard time staying awake for 48 hours straight.

This means #2 will become 100% every 48 hours, with 48 hours being an extreme _maximum_ lifetime for session data, and the true norm being 8 hours (9 to 5, each work day).

Considering that #1 & #2 are sure to intersect every 48 hours, dividing attention between them seems burdensome.

<comment><USER8> I'm going to go out on a limb and say you're not the typical user. Besides, in your case it would be a matter of selecting "hide from everyone" in the drop- down.

</comment></comment></comment></comment><comment><USER10> Why is incognito mode so difficult for browsers to implement? If the browser already comes with support for profiles, then isn't switching to incognito mode the same as running from the empty profile?

In particular, why do particular APIs need to be shimmed or disabled? In my empty-profile based proto-proposal, even if a website writes to disk, wouldn't closing the session cause any data written to be rolled back?

<comment><USER11> Not accidently unintentionally saving state is in fact hard.

</comment></comment><comment><USER12> See the result your browser [https://luke.lol/check-fs- quota.php](https://luke.lol/check-fs-quota.php)

<comment> em-bee nice. can't see any difference in firefox. however, it is still possible to detect incognite mode in firefox as i have just been to a site that did so. (they didn't detect reader-mode however, so i was able to read the article after all)

<comment><USER13> For Firefox it's simple enough - can you open indexedDB? That goes the same for IE 10+. If instead it's Safari, can you successfully modify localStorage?

Unfortunately, every browser seems to change it's behaviour as soon as you try not to store your history.

Some browsers do try and stop these detection methods... And by the time they've patched them out new methods have emerged.

<comment> em-bee wait what? safari blocks access to localStorage in incognito mode? that ought to break some sites functionality.

<comment><USER14> yes that does break a lot of websites, the Safari team hasn't made the best choices on this one.

</comment></comment></comment></comment></comment><comment><USER15> Why not let incognito mode write to disk, but entirely encrypted and randomly padded (to avoid size memorization attacks), with keys only stored in memory? That way you can use practically the entire storage space and avoid quota mismatches, as well as service attempts to fill the storage for detection. And in the event of a crash or power outage, no data is recoverable.

<comment><USER16> I wonder if encryption is even necessary.

Isn't the purpose of Incognito mode to protect against tracking _inside the browser_? At least I haven't heard so far that its also supposed to shield data from access outside the browser.

So, wouldn't be enough to simply delete the space after closing the tab? (Or use a new, empty storage location for each newly opened tab)

<comment><USER17> Deletion doesn't mean the data is actually _gone_ from disk though, so it would basically leave unencrypted evidence of incognito browsing history. There are multiple use cases for incognito, and tracking inside the browser is only one of them.

</comment></comment></comment><comment><USER18> How is an additional chrome user profile that removes all history/cookies/ local storage on close different tracing-wise from an incognito session?

<comment> em-bee a profile that removes all history still writes to disk, and potentially leaves traces behind. (a backup could be running while the session is open, or a data could be left behind on a disk block because the files are deleted but not wiped)

incognite mode is useful for two situations:

A: you want to hide the fact that you visited a site.

B: you want to hide from the site that you have visited before.

the incognito-detection is largely against the second case (B), so your suggested workaround would work. what would also work is firefox tab groups. since each tab-group starts off empty.

the problem is that both ways are cumbersome. you have to open a new browser with that profile or you have to create a new tab-group and remove it after each use.

in firefox the problem could be solved by adding a "wipe, but don't delete tab group" feature. for the profile method you'd need a feature to "open link in new profile" to make that convenient.

<comment><USER19> A lot of people will be trackable still under B by IP address (yes, I know it's not identifying in general).

I get arbitrary IP addresses from my ISP but if my router isn't reset then it can be the same for weeks; Brave solves this with incognito+tor.

<comment> em-bee tracking by ip address is for the lazy, and it doesn't work with dynamic IPs. at least not if the goal is to eg limit your access to how many articles you read per month. you'd not be happy if you go to a site for the first time but are blocked because you got a new IP that has already been to that site 5 times this month.

i'd use full browser/device fingerprinting to achieve the same effect. much more reliable.

</comment></comment></comment></comment><comment><USER20> This could also be solved by having any FileSystem API be unaccessible until a User Permission request is accepted. Both in incognito and normal mode.

<comment><USER21> You might solve the incognito detection problem but you open up the opportunity for notification-fatigue if users end up getting lots of these permission requests.

<comment><USER22> Plus it wouldnt get around the root problem, which I assume to believe is

"you have reached your monthly limit of articles, please pay"

opens private tab to read article

"we see you are in a private window, please load our site in a normal window"

browser perfectly mimics regular mode but now you need to grant permission

"we see you havent granted permission, please allow access to read our article"

</comment></comment></comment><comment><USER23> Is there any legitimate reason to allow arbitrary web apps to use gigabytes of space on my precious SSD, especially on mobile devices?

I'm becoming increasingly wary of web apps having all sorts of access to things outside of the browser, sometimes without explicit permission. Browsers should limit every app to the same amount, perhaps 100MB, or maybe even 10MB. Apps that need more should ask for permission.

<comment><USER24> I believe the "Quota Management API" [1] the author is using is an experimental API for the browser to request more space, beyond the default maximum of 5MB.

[1] [https://developer.chrome.com/apps/offline_storage](https://developer.chrome.com/apps/offline_storage)

<comment><USER25> On the contrary its on active development, The one you are referring to "Quota Management API" [1] is not what's being used in the article. It's the "Storage" API's Estimate method [2] which is in active development. [1][https://w3c.github.io/quota-api/](https://w3c.github.io/quota-api/) [2][https://storage.spec.whatwg.org](https://storage.spec.whatwg.org)

</comment></comment></comment><comment><USER26> Tracked by [https://crbug.com/959839](https://crbug.com/959839)

</comment><comment><AUTHOR> Reddit discussion: [https://www.reddit.com/r/javascript/comments/cetrkq/private_...](https://www.reddit.com/r/javascript/comments/cetrkq/private_browsing_still_detectable_in_chrome_76/)

</comment><comment><USER27> From the title I was expecting the opposite.

Surely websites are using anti incognito tactics, and users would want to bypass those detection schemes.

<comment><USER28> That's exactly what I felt! Many websites are using anti-incognito tactics

</comment></comment><comment><USER29> I have to say I have been avoiding the Oath family of sites (on mobile) because of their cookie wall that doesn't allow declining, and really I don't feel like I've been missing out.

</comment><comment><USER30> What sites worry about incognito mode and why?

<comment><USER31> Buying airplane tickets.

<comment><USER32> For those who don't understand this one, airlines will sometimes artificially inflate tickets faster for people who visit their site multiple times to create a sense of urgency. I always shop for airline tickets in incognito and only log in at checkout.

</comment></comment></comment><comment><USER33> The easy solution for sites that need revenue is to abandon this stupid arms race and do two things:

1\. Force their ad networks to police ads for malware, movies, tracking code, and slow-loading crap.

2\. Stop sharing private user data with others.

I would turn off my ad blocker and incognito mode tomorrow if e.g. the Washington Post would take these steps.

<comment><USER34> Regarding 2: Probably impossible. Regarding 1: hold websites and ad networks legally culpable for delivering malware from ads. Probably also not possible.

Keep blocking ads.

<comment><USER35> I agree with you on 2 most likely not being possible (or reasonable) given that the revenue model is based in sharing user data, but I'm not so sure that 1 is completely out of the question.

I don't necessarily think that it's reasonable to have a zero tolerance policy for ad networks or the sites serving them regarding malware (cuz perfect security doesn't exist), but what about requiring some basic standard of due diligence for the ad networks themselves?

<comment><USER34> Zero tolerance, maybe maybe not. But if I ran a restaurant and kept ordering from a supplier that kept giving me deliberately poisoned meat, I should be held responsible.

And there's a reason ads are slow, easily blocked, client-side javascript. Site operators know they serve malware and don't want it on their own servers.

</comment></comment></comment></comment><comment><USER36> Great, now we're going to discriminate on the web because people don't have a lot of hard drive space free.</comment>


I learned Rust by trading Cryptocurrencies - <AUTHOR> https://ajpierce.com/2020-08-08_crypto-in-rust/ <comment><AUTHOR> Hi HN, thanks for taking the time to come chat! I'm still learning Rust, so if you have suggestions for how to improve hodl, I'd really appreciate issues or pull requests :)

[https://github.com/ajpierce/hodl](https://github.com/ajpierce/hodl)</comment>


Amazon is developing the Kindle Paperwhite 5 with Glowlight - <AUTHOR> https://goodereader.com/blog/electronic-readers/amazon-is-developing-the-kindle-paperwhite-5-with-glowlight <comment><USER2> This is great, my main use case for my Paperwhite is to read in bed with the other lights off. A warmer yellow light would make it a lot nicer for that.</comment>


Rockstar: 'GTA 5' Cops Not Racist - <AUTHOR> http://www.forbes.com/sites/davidthier/2013/09/27/rockstar-gta-5-cops-not-racist/?utm_campaign=techtwittersf&utm_source=twitter&utm_medium=social <comment><USER2> If they are, then it makes GTA5 all the more realistic.

<comment><USER3> Yeah, this is a great problem for Rockstar to have. People are starting to take games seriously as social commentary. Oh how far we've come from the days of Mortal Kombat.</comment></comment>


Facts About Covid: Swiss Propaganda Research - <AUTHOR> https://swprs.org/a-swiss-doctor-on-covid-19/ <comment><USER2> I'm not too familiar with SWPRS, could anyone provide some detail on them?</comment>


Survival tips if you find yourself in the Middle Ages? - <AUTHOR> http://www.kottke.org/08/06/survival-tips-for-the-middle-ages <comment><USER3> 1000 plus or minus 200 years covers a huge range. 1000 was just about the fulcrum of the medieval period: life in 800 would have been a complete disaster, whereas life in 1200 was in some places a mini-Renaissance.

<http://en.wikipedia.org/wiki/Renaissance_of_the_12th_century>

If you really got dropped at a random place, it would probably be grazing land or forest, especially in 800. You'd have to find the nearest tiny village and convince them you weren't dangerous. The stuff you had on you would seem miraculously fine, so could be valuable in trade if it wasn't stolen from you first. But the best way to extract value from your stuff would be to give it as a gift to some powerful protector; money wouldn't be any use unless you could protect yourself against robbers. So it would be all about finding a powerful protector.

In 800 you'd want to find the most enlightened bishop nearby, present yourself as a traveller from some obscure pocket of Nestorian Christians in the far east (drop hints about Prester John), and get work helping to administer his estates. This wouldn't work everywhere, though: a lot of Europe was still pagan in 800. If you landed in the north or the east, you'd have to try to find some enlightened local warlord instead. Hard to say what use you could be to him, though; probably your only hope would be that he'd keep you around as an adornment to his court.

In 1200 you might still want to find a bishop, but if there was a town nearby (especially a great one like Florence or Venice) you could also find work in a bank or for one of the great wool merchants.

Generally: Be compulsively clean, and keep your opinions to yourself.

<comment><AUTHOR> What one invention would you introduce ahead of its time?

<comment><USER3> Hygiene.

<comment><AUTHOR> How can you make money with that? Purveyor of scented soaps? ;)

<comment><USER3> You could not die, which would be pretty valuable.

But come to think of it, you could also make tons of money. An ordinary educated person today knows way more about medicine than medieval doctors did. So your optimal career goal should probably be to become a court physician. You could become as rich as minor nobility doing this, and (most importantly) without having to take sides in power struggles.

<comment><AUTHOR> SaS = Soaps and Sterilization. Hmmm, interesting, but seems like you'd have to violate your second rule ("no opinions"). Maybe if you could manage to out live most other folks into your late thirties and forties (steering clear of all sorts of bugs - water, food, and transmission-based) the marketing would be your very aliveness. People would have to solicit your counsel rather than you having to actively sell it.

</comment></comment></comment></comment></comment></comment><comment><USER4> "Alright you Primitive Screwheads, listen up! You see this? This... is my boomstick! The twelve-gauge double-barreled Remington. S-Mart's top of the line. You can find this in the sporting goods department. That's right, this sweet baby was made in Grand Rapids, Michigan. Retails for about a hundred and nine, ninety five. It's got a walnut stock, cobalt blue steel, and a hair trigger. That's right. Shop smart. Shop S-Mart. You got that?"

<comment><USER5> How much ammo would you carry?

It'd be nice to have enough to make an impression on anyone who threatened you. Aside from that, you'd probably never have to use it.

<comment><USER4> It's just a quote from "Army of Darkness".

</comment></comment></comment><comment><USER6> _Prediction is impossible, we all know that. What we don't know is that retrodiction is also impossible. History is a form of science fiction. The future is history that hasn't happened yet. History is the sensibility of one time, assessing another time, that it cannot possibly know._

\-- Bruce Sterling, <http://www.viridiandesign.org/notes/1-25/Note%2000001.txt>

<comment><USER7> Superman can't really fly, but he's still fun to watch.

<comment><USER6> I'm sure Sterling, who has made his living writing SF, would never wish to suggest otherwise.

</comment></comment></comment><comment> daniel-cussen How to make gunpowder, from Wikipedia. Warning, gross.

"Historically, nitre-beds were prepared by mixing manure with either mortar or wood ashes, common earth and organic materials such as straw to give porosity to a compost pile typically 1.5 meters high by 2 meters wide by 5 metres long.[3] The heap was usually under a cover from the rain, kept moist with urine, turned often to accelerate the decomposition and leached with water after approximately one year. The liquid containing various nitrates was then converted with wood ashes to potassium nitrates, crystallized and refined for use in gunpowder.

Urine has also been used in the manufacture of saltpeter for gunpowder. In this process, stale urine placed in a container of straw hay is allowed to sour for many months, after which water is used to wash the resulting chemical salts from the straw. The process is completed by filtering the liquid through wood ashes and air-drying in the sun. Saltpeter crystals can then be collected and added to brimstone and charcoal to create black powder.[4][5][6][7][8]"

[http://en.wikipedia.org/wiki/Potassium_nitrate#History_of_pr...](http://en.wikipedia.org/wiki/Potassium_nitrate#History_of_production)

<comment><USER8> "Government officials had the power to scrape up dried urine from beneath the boarded floors of Stuart stables because it contained saltpetre, a vital ingredient of gunpowder."

<http://findarticles.com/p/articles/mi_m0PAL/is_/ai_n15630934>

</comment></comment><comment><USER9> Hope for 1200. 800 wasn't that great.

Be humble, mute, and helpful. If you know latin, work on learning the current dialect/script -- you'll have a shot at declaring yourself a "wise man from the east" and go for the job of physician. I would be careful with the Prester John references, your mileage may vary. As one commenter pointed out, you should be able to make aspirin from willow bark and penicillin from mold. These two alone, plus hygiene, should make you a miracle-worker. Be prepared to saw a lot of limbs off. You could also be the first to use opiates in medicine, which could alleviate a lot of suffering in that time.

After 1100 or so, the crusades are well under way. Most of the nobles will be coming and going to the various crusades. They started in the Levant and ended up being next door as crusades were eventually preached against heretics. As physician, try to attach to the church -- they're on the ascent. Perhaps with some luck you can get noticed by the pope and end up with a (relatively) cushy job in Rome.

 _Don't_ do the man-at-arms thing. You'll suck at it. _Don't_ try for any kind of social revolution -- people were pretty tolerant during that time, but by 1200 the church was getting very sensitive about outliers. You don't want to show up on their radar. Stay away from southern France -- the Cathars were nice folks but trouble is on the way for them.

If I had the choice of picking a city (besides the Rome-physician thing), I'd go for Genova, Pisa, or Venice. Great cities with fast growth and more of an open culture. They made out like bandits transporting nobles and supplies during the crusades.

<comment><USER10> As to the "man-at-arms thing": if you could bring with you to the past a suitcase or so of initial supplies, what would be the best investment in the long term to become a unopposable warlord (or just an arms dealer with a technological monopoly?) Just "a bunch of guns" wouldn't help once you had given them away, and even specifications wouldn't help because no one could engineer to the required tolerances at the time. I'd think the best investment would be body armor, walkee-talkie radios, and surveillance equipment, personally.

<comment><USER11> The big question is how to stop worrying about the need to personally fetch water and make clothes, and how to start worrying about implementing your overall plans. That is, how to get enough production going where you wouldn't be screwed when the solar cells powering your electronics (you didn't seriously consider bringing batteries, did you?) wear out.

My basic plan would be: Convince a small village I'm God and chose them to build my kingdom, improve their farming and sanitation enough to produce some labor surpluses, and then work my way up the tech tree.

The basic sketch of that would involve fireworks, a single assault rifle, and a low-power device storing lots of specifications.

</comment></comment></comment><comment><USER12> there are a few series that cover that area.(not exact mind you, but close enough)

First you have the Assati Shards series(1632, 1633, 1634)...basically a town in Virginia get transferred to Germany in 1632.

And then you have the Conrad the Engineer series, where you have a guy transported to 13th century Poland, just before the Mongol invasion.

But chances are, no matter where you wind up...you'll be dead within a week. Why? Simple...language barrier. You won't be able to understand a thing....even if you wind up in the most civilized English speaking country. So you'll probably wind up getting burned as a demon who is speaking in tongues

For example...this is what Beowulf's first few lines look like in original english.

      Hwæt! We Gardena         in geardagum,
      þeodcyninga,         þrym gefrunon,
      hu ða æþelingas         ellen fremedon.
      Oft Scyld Scefing         sceaþena þreatum,

<comment><USER13> The language barrier is an interesting point.

I wonder if there are any places with languages that haven't changed that much?

Do you think I might be able to get along in the Middle East in 1000 AD if I knew modern Hebrew?

<comment><USER14> I don't know about Hebrew but I bet Arabic would be the language to know in 1000 AD if you were in Spain or Persia or many points in between.

<comment><USER15> Arabic's a good bet because the Qu'ran is still written in the original Mediaeval Arabic and people learn it in order to read it in its original form. The accent might have changed over time but Arabic's going to be good for any time in the last 1300 years.

<comment><USER16> Modern Standard Arabic (The generalized approximation of what college-educated people speak nowadays) is fairly different from Koranic Arabic, but it'd still probably be at least somewhat mutually intelligible, so you could pass as being from some other part of the Arab world I suppose.

Spain would've probably been the best possible place to land during the Ummayad/Abbasid Caliphates (before about 1085 or so), but it was a very rough place afterward (the Almoravid/Almohad Caliphates were not known for tolerance, and the reconquest was even worse)

</comment></comment></comment></comment></comment><comment><USER17> Teeth. I would show off my teeth as a start to my entrepreneurial apothecary business. Our average dental hygiene is way way better than what they had then, and consequently our teeth look like divine pearls in comparison. Hopefully, their amazement will allow a perceived transference of my expertise to other medicinal areas.

Also, knowing more math might help me make coinage with some simple engraved code that needs to be combined with the name of the bearer in order to be verified (only feasible for inter-medieval banks). This would be impetus for trade across greater distances.

<comment><USER18> knowing some modern first aid would probably be your most valuable asset. you might be able to position yourself as doctor to some powerful noble.

</comment></comment><comment><USER19> Funny, I've been daydreaming a lot recently about scenarios such as this. At first I thought it might be a sign of mental illness, but everyone had so much fun thinking up answers I'm pretty sure it's everyone else that is crazy :)

</comment><comment><USER20> What would you do to prepare if you knew the journey back in time would start in one hour?

<comment><USER12> Backpack full of seeds. Potatoes, corn, etc etc. The agriculture of that time was pretty much non-existent. You'd get something like 20x the output from your seeds.

<comment><USER21> Most modern crops have been bred or genetically engineered so that they physically cannot survive on their own. They need petrochemical fertilizers to grow, pesticides to fend off insects & fungi & disease, mechanized tilling to penetrate the ground, and artificial supports so they can stand up and avoid keeling over.

In my sustainable agriculture course, I read that modern grain varieties put 60% of their photosynthesized energy into growing the fruit (the edible portion of the grain). Wild varieties put more like 3% into the fruit. There's your 20x difference in yield. But it comes at the expense of every other survival mechanism of the plant: modern grain varieties yield so much grain because they don't have working systems for _anything_ , be it support, storm resistance, disease resistance, or general hardiness. They give us food because we supply them with a good amount of fossil-fuel derived work.

<comment><USER22> Thanks for the insight. It's interesting why the external work supplied to the plants still costs less than growing plants that can do these things itself. I suppose chemistry and mechanization in agriculture are just much more efficient than their biological counterparts.

<comment><USER23> Almost certainly not more efficient, but growing plants can't use oil directly, and since we can supply enormous amounts of external energy by the standards of a crop plant, engineering them to be able to use it more effectively is useful even if the plant itself is less efficient overall.

<comment><USER21> Almost any sort of mechanical or chemical process is more efficient than plants. Photosynthesis is only 3% efficient; by the time the energy enters the plant, you've lost 97% of it. Then you figure various biological pathways, and you're down to maybe 1-2% efficiency for _the best_ plants.

This, among other reasons, is why grain ethanol was such a scam.

The worst mechanical processes, by contrast, usually get at least 10-15% efficiency. That's what photovoltaics can do, for example. Gasoline engines have a thermal efficiency of about 30%, diesel about 45%. Granted, you lose energy in the extraction/refining/transportation steps, but it's still an order of magnitude more efficient than photosynthesis.

<comment><USER23> I did not know that. Thanks.

</comment></comment></comment></comment></comment></comment></comment><comment><USER24> Have you read Mark Twain's "A Connecticut Yankee in King Arthur's Court"?

<http://bulfinch.englishatheist.org/yank/86-h.htm>

Audio book: [http://librivox.org/a-connecticut-yankee-in-king-arthurs- cou...](http://librivox.org/a-connecticut-yankee-in-king-arthurs-court-by- mark-twain/)

<comment><USER18> read _Lest Darkness Fall_ for a MUCH more interesting account.

<comment><USER24> Thanks.

</comment></comment></comment><comment><USER25> I'd find a bookie and make a bet on the Battle of Hastings.

The Normans are my lock of the week.

</comment><comment><USER26> See <http://en.wikipedia.org/wiki/Lest_Darkness_Fall>

<comment><USER27> I like(and hate) the author so I try to see if I can get a preview online before I buy and sure enough [http://www.scribd.com/doc/8651639/LSprague-de- Camp-Lest-Dark...](http://www.scribd.com/doc/8651639/LSprague-de-Camp-Lest- Darkness-Fall)

</comment></comment><comment><USER28> Fascinating to think about. I did some fencing in college, and some archery and horseback riding when I was younger. I think I'd try to survive and move over land until I got to a coastal trading city, and then convince the nearest Lord that I was shipwrecked from a distant, mystical land and try to enter into military or guard service. Then catch up on the local language and customs, do what I can to get land or a title, then try to figure out what modern process improvements I could invent to build a lot of wealth. If I was in a rigid caste system type place, I'd definitely recruit potential great men from non-aristocratic classes and get them working for me. Depending on which invention path I went down, take over in terms of commerce of have myself a mini-revolution displacing the aristocracy and becoming ruler and protector of the land. It probably wouldn't be a party, but it wouldn't be so bad either.

</comment><comment><USER29> If you're interested in this highly unlikely scenario, I highly recommend the Dies the Fire books by S.M. Stirling. I actually got a good education in feudal economics and have a much better appreciation for the concept of food as wealth.

</comment><comment><USER30> _"... how many people living in the US know how to make gunpowder from scratch? Given enough time, I guess I could build a ... How would you survive if suddenly transported back to 1000 AD? ..."_

Well I'd hope I'd be pushed forward a few hundred years into the late 12'th - early 13th century and dropped into Western Europe. The UK or France.

Why late 12th/early 13th century France or UK?

Well for one thing the _"Hundred Years' War"_ is just starting and it probably is the most turbulent time in UK/French history and with this comes warfare and opportunity. It turns out this period of history is where the linage of the French House of Capet was broken and King of England (John - Henry III) had gone from owning more land than the King of France to loosing almost the lot.

        The consequences of these new weapons meant
        that the nobility was no longer the deciding
        factor in battle; peasants armed with longbows
        or firearms could gain access to the power,
        rewards, and prestige once reserved only for
        knights who bore arms.

But these were heady days for the English this is the time of the Longbow ( _and by the way the 2 fingered salute favoured by those of English descent and a token to their weapons superiority_ ), the introduction of the cannon and the end of the era of chivalry, the introduction of Modern army, the introduction of the Magna Carta some 50-100 years prior, centralised government that had the authority to raise taxes & armies. So in terms of making your mark this was the era.

The first problem you'd have is language. I'd either have to bring a book (latin) or wing it on my language skills but where to learn latin? Anything but a classical education makes me stand out as an uneducated heathen. As for a job if you are fit enough you could either join up as a foot soldier but a more lucrative path might be to hack the warfare technology of the time and work on improving them. One problem at the time was training enough archers to use the longbow efficiently. It took a lot of training from an early age - <USER2> English boys from the age of 12 years had to train to use the longbow & all men from the ages of 15-60 carried such weapons.

I'd be looking out for Yeoman ~ <http://en.wikipedia.org/wiki/Yeoman#Middle_Ages>

<comment><USER30> The idea for this btw is not a new one. I remember this reading Micheal Crichton book called Timeline ~ <http://www.crichton-official.com/books- timeline.html> which in itself is based on an idea by Leo A. Frankowski who wrote a book called Cross-Time Engineer ~ [http://www.amazon.com/Cross-Time- Engineer-Adventures-Conrad-...](http://www.amazon.com/Cross-Time-Engineer- Adventures-Conrad-Stargard/dp/0345914392)

</comment></comment><comment><USER31> Let's flip this around a bit. Who would have a better chance of survival, one of us transported back to the Middle Ages, or a person in the Middle Ages transported to 2009?

I'd say we have a better shot at living a longer period of time (over a year) since we could take basic precautions against disease and germs. The Middle Ages guy/gal would probably die of our modern germs within a few days (similar to the Indians when they met European explorers).

<comment><USER32> As I recall, most of the Native deaths were from smallpox, measles, typhoid, diphtheria, and the bubonic plague. Not exactly common diseases these days. I don't think that the Middle Ages person would do too badly, though we would definitely do better as we have MMR and other mandatory vaccinations.

</comment></comment><comment><USER33> "I'm skeptical of this approach...how many people living in the US know how to make gunpowder from scratch?"

What did this guy do for fun in high school? Saltpeter, charcoal, sulfur in a 75-15-10 ratio.

Saltpeter + sugar in a 6-4 mix and then caramelized is more fun though. It would also aid your getaway when the angry knights came to hunt the heretic who just invented gunpowder.

</comment><comment><USER34> The most obvious and easy thing I can think of is Penicillin. If you can somehow identify which moldy bread is it, that with the basic knowledge of human health any modern person should have, will make a great healer.

This is a time when people were still sealing wounds with boiling oil.

So yes, even if you have no formal first aid training you can be a great healer.

</comment><comment><USER18> you'll die of infectious disease. I'm almost 100% sure of this.

<comment><USER35> Would it be much worse than traveling to a 3rd world country today, though? Granted, typically travelers get some vaccination, but overall, not that many (mostly Hepatitis?).

<comment><USER36> Yaws and Smallpox, just to name two, are practically extinct today. You will have NO immunity.

Rubella, mumps, chicken pox, lockjaw etc were all common diseases then. Today, we vaccinate against them, even in the third world. You, like all adults, have probably relied on herd immunity to compensate for your fading resistance.

Intestinal disease was common in this era. It's very rare today. You would suffer from it for the same reason that modern tourists suffer in the third world. Tourists, soldiers, and aid workers grin and bear it in comfortable quarters with plenty of clean water. You would be bearing it... elsewhere.

Disease might not take you out, but it would certainly be more of a problem for you than for the natives.

</comment></comment></comment><comment><USER37> No need for the time travel. Try to survive nowadays within an isolated tribe in the amazonian forest.

</comment><comment><USER38> Sit still, breath and wait for the LSD to wear off (:

</comment><comment><USER39> Step back into the time machine and poke the _Back to the Future_ button until your finger bleeds.

</comment><comment><USER35> Maybe one could start a lottery.

</comment><comment><USER40> i'll invent a search engine startup and conquer the wo ... wa ... wait a minute

</comment><comment><USER41> > Survival tips if you find yourself in the Middle Ages?

It's simple. Go to China & learn KungFu!

</comment><comment><USER5> Two chicks (Marle and Lucca) at the same time.

<comment><USER42> Congratulations, you made a top Google search result for "Marle and Lucca":

[http://www.google.com/search?hl=en&q=Marle+and+Lucca](http://www.google.com/search?hl=en&q=Marle+and+Lucca)

<comment><USER5> I was standing on the shoulders of giants.</comment></comment></comment>