HackerLangs
TopNewTrendsCommentsPastAskShowJobs

susam

no profile record

Submissions

In Mizoram, India, the Shops Have No Shopkeepers (2020)

matadornetwork.com
5 points·by susam·il y a 19 jours·0 comments

Why Mizoram has shops without shopkeepers (2024)

timesofindia.indiatimes.com
2 points·by susam·il y a 20 jours·0 comments

Byte, Vol. 7, No. 8 (1982) [pdf]

archive.org
3 points·by susam·le mois dernier·0 comments

New York City-style air conditioning rules for London rejected by City Hall

mylondon.news
2 points·by susam·le mois dernier·0 comments

New charter gives River Wye the right to be free from pollution

bbc.co.uk
8 points·by susam·le mois dernier·0 comments

Linux Startup and Shutdown Sounds [video]

youtube.com
2 points·by susam·le mois dernier·0 comments

HN Skins – Read Hacker News in Style

codeberg.org
2 points·by susam·il y a 2 mois·1 comments

gopher://gopher.floodgap.com/

gopher.floodgap.com
4 points·by susam·il y a 2 mois·0 comments

The Forgotten Art of the LAN Party (2023)

superjumpmagazine.com
160 points·by susam·il y a 2 mois·87 comments

Couple of Emacs Hacks (2003)

web.archive.org
2 points·by susam·il y a 2 mois·0 comments

Ask HN: Do you have a colophon for your personal website?

13 points·by susam·il y a 2 mois·7 comments

How Was This Allowed to Happen? – 2025 Washington National Crash [video]

youtube.com
3 points·by susam·il y a 2 mois·0 comments

Sequence Points (2010)

susam.net
1 points·by susam·il y a 2 mois·0 comments

List of known personal websites that host Wander, a tool to wander the small web

susam.codeberg.page
3 points·by susam·il y a 2 mois·0 comments

Why is it called Kent House?

diamondgeezer.blogspot.com
45 points·by susam·il y a 2 mois·9 comments

Why Is Debian Called the Universal Operating System?

itsfoss.com
2 points·by susam·il y a 2 mois·0 comments

A Good Lemma Is Worth a Thousand Theorems (2007)

sites.math.rutgers.edu
91 points·by susam·il y a 2 mois·21 comments

Moving from lsp-mode in GNU Emacs to Eglot

utcc.utoronto.ca
2 points·by susam·il y a 2 mois·0 comments

London's Smallest Public Sculptures

lookup.london
40 points·by susam·il y a 2 mois·6 comments

The greatest shot in television: James Burke had one chance to nail this scene (2024)

openculture.com
364 points·by susam·il y a 2 mois·193 comments

comments

susam
·il y a 23 jours·discuss
I have been maintaining my own metalist of directories where one can submit their indie/personal websites to. In alphabetical order, here is what it looks like right now:

https://blogroll.org/

https://blogs.hn/ (by @surprisetalk)

https://hnpwd.github.io/ (I am one of the maintainers)

https://iii.social/ (by @freshman_dev)

https://indieblog.page/ (by @splitbrain)

https://kagi.com/smallweb/ (by @freediver)

https://marginalia-search.com/ (by @marginalia_nu)

https://minifeed.net/ (by @freetonik)

https://susam.net/wander/ (I developed this)

https://text.blogosphere.app/ (by @ramkarthikk)

https://wiby.me/

A clarification: The Wander link above (which I developed) is not something where you list your website. It is a tool you host on your website to become part of a decentralised network of personal websites (much like in a webring, except that the network is shaped like a graph rather than a ring): https://susam.codeberg.page/wcn/. More details here: https://codeberg.org/susam/wander
susam
·il y a 2 mois·discuss
One of my favourite Grothendieck stories from <https://www.ams.org/notices/200410/fea-grothendieck-part2.pd...>:

> One striking characteristic of Grothendieck's mode of thinking is that it seemed to rely so little on examples. This can be seen in the legend of the so-called "Grothendieck prime". In a mathematical conversation, someone suggested to Grothendieck that they should consider a particular prime number. "You mean an actual number?" Grothendieck asked. The other person replied, yes, an actual prime number. Grothendieck suggested, "All right, take 57."
susam
·il y a 2 mois·discuss
I attended a talk by Rasmus Lerdorf at a FOSS conference in 2006. It has been a long time, so I remember only a few things from the talk, but one thing I remember him talking about is how people love to complain about PHP, often on forums that are themselves written in PHP.
susam
·il y a 2 mois·discuss
Also, here is a list of all known personal websites participating in the Wander network: https://susam.codeberg.page/wcn/
susam
·il y a 2 mois·discuss
I have normally found any sort of timed technical competition intimidating. Even so, about 6 or 7 years ago, after being persuaded by a colleague, I participated in a few CTFs. I am glad I did, back when this type of thing still meant something. I have kept a screenshot from one of the CTFs that I am quite fond of: https://susam.net/files/blog/ctf-2019.png
susam
·il y a 2 mois·discuss
This is fantastic! The voting statistics of the community would have been very interesting. I have emailed the moderators to see if they would consider giving this post a second chance at /pool.
susam
·il y a 2 mois·discuss
I meant the latter. I think the question is fine. It can lead to a good discussion, similar to what we are having in this thread. It has been a long time (almost 20 years), but I remember that most interviewers who asked this seemed to be convinced that the output they had seen with their compiler version was the correct answer. What could be a nice and relevant discussion, especially considering that some classes of bugs and security issues result from it, was seen only as a trivia quiz by the interviewers, with the expectation of an answer that was incorrect, no less.

Your phone screen story is quite nice. When I read your question, I would have answered with successive doubling as well. In fact, I faced the same question at an AWS interview a long time ago. The question was mathematically the same question but formulated differently. I answered with the doubling solution too, which leads to an O(log n) time solution, asymptotically. Your interviewer's immediate objection to your squaring solution seems like a major failure in their intuition. When I read your solution, purely by intuition, that is, without resorting to any rigorous reasoning, I felt: wow, that's interesting, your solution would land on the zero region in merely O(log log n) time. Why didn't I think of it? I think your solution should spark interest rather than dismissal in a curious person. Of course, the binary search after that to find the exact transition point blows up the time consumed back to O(log n).

Once again, thanks for these really interesting comments!
susam
·il y a 2 mois·discuss
I believe they were referring to thaumasiotes's thread here: https://news.ycombinator.com/item?id=48141294

I think the objection thaumasiotes has raised there is valid and I have made an attempt to answer it as well in the same thread.
susam
·il y a 2 mois·discuss
I searched K&R to see if there is any language that implies a += a++ + a++ to be undefined. I couldn't find anything. I found the following excerpt which is closest to what I claim, in spirit. But still, it does not explicitly spell out that an object must not be modified more than once between sequence points. From § A.7 Expressions:

> The precedence and associativity of operators is fully specified, but the order of evaluation of expressions is, with certain exceptions, undefined, even if the subexpressions involve side effects. That is, unless the definition of the operator guarantees that its operands are evaluated in a particular order, the implementation is free to evaluate operands in any order, or even to interleave their evaluation. However, each operator combines the values produced by its operands in a way compatible with the parsing of the expression in which it appears. This rule revokes the previous freedom to reorder expressions with operators that are mathematically commutative and associative, but can fail to be computationally associative. The change affects only floating-point computations near the limits of their accuracy, and situations where overflow is possible.

So I think, the text in K&R serves as warning against writing such code, at best. The C99 draft has more relevant language. From § 4. Conformance:

> If a "shall" or "shall not" requirement that appears outside of a constraint is violated, the behavior is undefined. Undefined behavior is otherwise indicated in this International Standard by the words "undefined behavior" or by the omission of any explicit definition of behavior. There is no difference in emphasis among these three; they all describe "behavior that is undefined".

This along with the § 6.5 excerpt already mentioned in my post implies a += a++ + a++ to be undefined. When I get some more time later, I'll make an update to my post to include the § 4. Conformance language too for completeness.

Thank you for the nice comment!
susam
·il y a 2 mois·discuss
The code in the post seems very similar to the one in my own post from 2010: https://susam.net/sequence-points.html

  int a = 5;
  a += a++ + a++;
I do remember that this particular code snippet (with a = 5, even) used to be popular as an interview question. I found such questions quite annoying because most interviewers who posed them seemed to believe that whatever output they saw with their compiler version was the correct answer. If you tried explaining that the code has undefined behaviour, the reactions generally ranged from mild disagreement to serious confusion. Most of them neither cared about nor understood 'undefined behaviour' or 'sequence points'.

I remember one particular interviewer who, after I explained that this was undefined behaviour and why, listened patiently to me and then explained to me that the correct answer was 17, because the two post-increments leave the variable as 6, so adding 6 twice to the original 5 gives 17.

I am very glad these types of interview questions have become less prevalent these days. They have, right? Right?
susam
·il y a 2 mois·discuss
I remember dBASE IV from my childhood days when my father, who had no computer background, was required to take computer training by his workplace. My father and his colleagues were given free evening computer lessons by their company, taught by the same teachers who used to teach us, the kids, computers in our school.

After their first class, he brought home a fat dBASE IV manual. Since I was very interested in computer books, I read a good portion of it even though I had never touched dBASE in my life. I would daydream of all the little forms, queries, reports and labels I could make with dBASE. But I never got to touch dBASE in my life. We kids used to get LOGO lessons instead in school.

One day my father came back from his evening lesson mildly distressed about something he had learnt. He said they were being taught loops but in the loop there was an equation that seemed just plain wrong. It was:

  i = i + 1
How could that be a valid equation? How could i ever equal i + 1? He mentioned that he had asked the teacher about it and from what I could gather, my teacher and my father were talking past each other. The teacher probably tried explaining that it was not an equation but an instruction instead, whereas my father continued to interpret i = i + 1 as an equation due to the algebra he was so familiar with. It sort of held up the class for a while.

The teacher asked my father's name, perhaps so that he could talk to him separately later. But when he learnt my father's name, he realised that his son, me, went to the same school where he taught. So he told my father, 'When you get back home, ask your son about i = i + 1. He will explain it to you better than I am able to.'

And indeed I was able to explain it to him pretty well. I was eight or nine years old back then. And that was probably the first thing I taught my father!
susam
·il y a 2 mois·discuss
It's not mathematics that you need to contribute to (2010) - https://news.ycombinator.com/item?id=36744690 - July 2023 (65 comments)
susam
·il y a 2 mois·discuss
> From one of the answers [...]

Thank you for highlighting that answer. It is one of my favourite pieces of writing about the culture of mathematics. I just want to add that that particular answer is now affectionately known as Thurston's Paean.
susam
·il y a 2 mois·discuss
Good pedagogy is a problem even for graduate-level mathematics students and professional mathematicians. The proofs in many graduate-level mathematics textbooks are, in my humble opinion, not really proofs at all. They are closer to high-level outlines of proofs. The authors simply do not show their work. The student then has to put in an extraordinary amount of effort to understand and justify each line. Sometimes a 10-line argument in a textbook might expand into a 10-page proof if the student really wants to convince themselves that the argument works.

I am not a mathematician, but out of personal interest, I have worked with professional mathematicians in the past to help refine notes that explain certain intermediate steps in textbooks (for example, Galois Theory, by Stewart, in a specific case). I was surprised to find that it was not just me who found the intermediate steps of certain proofs obscure. Even professional mathematicians who had studied the subject for much of their lives found them obscure. It took us two days of working together to untangle a complicated argument and present it in a way that satisfied three properties: (1) correctness, (2) completeness, and (3) accessibility to a reasonably motivated student.

And I don't mean that the books merely omit basic results from elementary topics like group theory or field theory, which students typically learn in their undergraduate courses. Even if we take all the elementary results from undergraduate courses for granted, the proofs presented in graduate-level textbooks are often nowhere near a complete explanation of why the arguments work. They are high-level outlines at best. I find this hugely problematic, especially because students often learn a topic under difficult deadlines. If the exposition does not include sufficient detail, some students might never learn exactly why the proof works, because not everyone has the time to work out a 10-page proof for every 10 lines in the book.

Many good universities provide accompanying notes that expand the difficult arguments by giving rigorous proofs and adding commentary to aid intuition. I think that is a great practice. I have studied several graduate-level textbooks in the last few years and while these textbooks are a boon to the world, because textbooks that expose the subject are better than no textbooks at all, I am also disappointed by how inaccessible such material often is. If I had unlimited time, I would write accompaniments to those textbooks that provide a detailed exposition of all the arguments. But of course, I don't have unlimited time. Even so, I am thinking of at least making a start by writing accompaniment notes for some topics whose exposition quality I feel strongly about, such as s-arc transitivity of graphs, field extensions and so on.
susam
·il y a 2 mois·discuss
Yes, that's fair. Indeed my so called improvement requires continual maintenance to add new parameters to the blocklist, which somewhat defeats what is perhaps the main purpose: convenience.

While it is clear that your solution works well for you and would probably work for me too for most types of 'bad' URLs, I am noting down an allowlist based solution for my own satisfaction and future reference:

  javascript:(()=>{const u=new URL(location.href);[...u.searchParams.keys()].forEach(k=>{if(!['p','q'].includes(k)){u.searchParams.delete(k)}});navigator.clipboard.writeText(u.href)})();
Tested with the following URL:

  https://duckduckgo.com/?ia=web&origin=funnel_home_website&t=h_&q=hello+world&chip-select=search
The bookmarklet copies this cleaned version of the URL:

  https://duckduckgo.com/?q=hello+world
susam
·il y a 2 mois·discuss
This corrupts a URL like:

  https://example.com/?p=20&utm_source=spam
to:

  https://example.com/
when in fact we want the following:

  https://example.com/?p=20
A possible improvement can be:

  javascript:(()=>{const u=new URL(location.href);[...u.searchParams.keys()].forEach(k=>{if(k.startsWith('utm_')){u.searchParams.delete(k)}});navigator.clipboard.writeText(u.href)})();
susam
·il y a 2 mois·discuss
From Debian 13.2 (Trixie) + Bash + curl 8.14.1:

  $ curl -s 'https://httpbingo.org/get?' | jq .url
  "https://httpbingo.org/get"
But on macOS + Bash/Zsh + curl 8.7.1:

  $ curl -s 'https://httpbingo.org/get?' | jq .url
  "https://httpbingo.org/get?"
I see some related changes here: https://github.com/curl/curl/commit/3eac21d
susam
·il y a 2 mois·discuss
Independence tells us how to compute the probability of a sequence like HT or TH:

  P(HT) = P(H)P(T) = p(1 - p)
But the question I am addressing is not just "what is the probability of HT?" It is "given that the two flips are different, what is the probability that the order was HT rather than TH?"

That is a conditional probability:

  P(HT | HT or TH)
susam
·il y a 2 mois·discuss
I'll start with the clarification that the moderators have changed the URL of the original post from <https://susam.net/no-query-strings.html> to <https://chrismorgan.info/no-query-strings>. Hopefully, this will prevent any confusion about why we are discussing random walks in a post about query strings. Now let me answer your question.

> Is it not a random walk? Might sound pedantic but if there is graph structure I am interested.

The network is a directed graph. Every Wander Console declares a few other consoles as its neighbours. The person setting up the console decides who they want to list as their neighbours. So if we call the network graph X, then the set of vertices is:

  V(X) = the set of all URLs that point to Wander Consoles
and the set of directed edges is:

  E(X) = {(u, v) in V(X) : u declares v as its neighbour}
The traversal between consoles is not strictly a random walk. If I could call it something, I would call it randomised graph exploration with frontier expansion. On each click of the 'Wander' button, the tool picks one console at random from the set of discovered consoles and visits that console. It then fetches the neighbours declared by that console and adds any newly discovered consoles to the set.

The difference from a random walk is that the next console is not chosen from the neighbours of the last visited console. It is chosen from the whole set of consoles discovered so far. In other words, each click expands the known part of the graph, but the console used for that expansion is selected randomly from all discovered consoles, not just from the last console visited.
susam
·il y a 2 mois·discuss
And for people who like equations, here is my attempt at explaining it.

Assume each flip is independent and the bias remains same in each flip.

Let

  P(H) = p,
  P(T) = 1 - p.
Then

  P(HH) = p^2,
  P(HT) = p(1 - p),
  P(TH) = (1 - p)p,
  P(TT) = (1 - p)^2.
Therefore

  P(HT or TH) = 2p(1 - p).
Now calculate

  P(HT | HT or TH) = p(1 - p) / (2p(1 - p)) = 1/2,
  P(TH | HT or TH) = (1 - p)p / (2p(1 - p)) = 1/2.