HN user

CarolineW

6,352 karma
Posts731
Comments779
View on HN
en.wikipedia.org 6y ago

Blinkenlights

CarolineW
1pts0
www.bbc.co.uk 7y ago

Why the age of electric flight is finally upon us

CarolineW
1pts0
en.wikipedia.org 7y ago

Why we have “little old men” but no “old little men”

CarolineW
2pts0
graphics.thomsonreuters.com 7y ago

Misleading charts 101 – how to lie with diagrams, exhibit A

CarolineW
2pts0
www.bbc.co.uk 8y ago

YouTuber in row over copyright infringement of his own song

CarolineW
1pts0
www.bbc.co.uk 8y ago

Steve Ditko: Spider-Man co-creator found dead at 90

CarolineW
1pts0
www.youtube.com 8y ago

Calculating Pi with Real Pies – Numberphile

CarolineW
1pts0
en.wikipedia.org 8y ago

Spaghetti sort – an O(N) sorting algorithm

CarolineW
1pts0
time.com 8y ago

More than ever we need people to be guided by their own senses of principle

CarolineW
2pts0
www.i-programmer.info 8y ago

The Reason for the Weird PHP Function Names

CarolineW
1pts0
www.technologyreview.com 8y ago

Mathematical Model Reveals the Patterns of How Innovations Arise

CarolineW
1pts0
blog.invisiblethings.org 8y ago

How is Qubes OS different from

CarolineW
1pts0
www.bbc.co.uk 8y ago

Cambridge Analytica taken to court over data storage

CarolineW
2pts0
www.bbc.co.uk 8y ago

3D-printed homes turn sludge into shelter

CarolineW
2pts0
www.theverge.com 8y ago

Space did not permanently alter former NASA astronaut’s DNA

CarolineW
3pts0
www.learnmorsecode.com 8y ago

Learn morse code

CarolineW
2pts0
plus.maths.org 8y ago

Celebrating Stephen Hawking

CarolineW
119pts7
www.youtube.com 8y ago

Calculating Pi with Real Pies

CarolineW
1pts0
twitter.com 8y ago

Hiveway changes direction with respect to funding ... is it dead already?

CarolineW
1pts0
www.quantamagazine.org 8y ago

Mathematicians Crack the Cursed Curve

CarolineW
242pts33
www.johndcook.com 8y ago

Squaring uncertain numbers

CarolineW
1pts0
www.thisiscolossal.com 8y ago

Manually Cranked Wood Toy Performs Sleight-Of-hand Magic

CarolineW
1pts0
www.wired.com 8y ago

Tencent Software Beats Go Champ, Showing China's AI Gains

CarolineW
1pts0
boingboing.net 8y ago

Scientists warned Zuck the FB theory of interaction would make people miserable

CarolineW
27pts8
buildingreputation.com 8y ago

Building Web Reputation Systems: Top-Line Lessons on User Reputation Design

CarolineW
2pts0
aerospaceamerica.aiaa.org 8y ago

Their mission became our mission

CarolineW
1pts0
policeviolencereport.org 8y ago

USA Police Violence Report for 2017

CarolineW
2pts0
jeffkreeftmeijer.com 8y ago

Using git-flow to automate your Git branching workflow

CarolineW
25pts25
www.bbc.co.uk 8y ago

North Korea 'hacked crypto-currency exchange in South'

CarolineW
1pts0
www.youtube.com 8y ago

Time Travel in Fiction Rundown

CarolineW
1pts0

Actually, we are pretty marginal on sed, but point taken. It feels like there's a difference between "stream mode" and "program mode".

I remember when awk was first implemented. sed was already standard, and awk was this new thing. I love it, and for some things it's my "go to" language. That colors how I think of it - I think of it as a language.

But this has been done to death, everyone is jumping on me, so there seems little to add.

OK, so as kazinator has pointed out, awk is now a mandatory part of Posix, and so is genuinely a part of "shell". My reply there says that I and my colleagues still think of awk as fundamentally different from other pipeline facilities such as tr, sed, sort, uniq, and so on, but I can see why it could, perhaps should, be though of as being "shell".

So it's shell. I might, however, given my background, and remembering as I do its first introduction, always have trouble thinking of it as such.

That I did not know - thank you. We here still think of awk as fundamentally different from other pipeline facilities such as tr, sed, sort, uniq, and so on, but I can see why it could, perhaps should, be though of as being "shell".

I guess I was triggered by the fact that the proposed shell solution is:

* not on a command line (although it could be),

* is significantly longer than the original command line solution, and

* gives a different result.

But you're right, it's shell. I might, however, given my background, and remembering as I do its first introduction, always have trouble thinking of it as such.

It's not a cop-out, we disagree.

Nor is finding "common ground" the goal (this is not some sort of compromise between political parties, it's a technical argument).

We disagree. When there is a disagreement, finding what you agree with the the first step in finding where the lines of reasoning diverge. Finding common ground is the first step in resolving differences.

Getting things right is the goal.

Sometimes in software there are judgement calls. Maybe this is one of them, maybe our definitions differ. Sometimes definitions differ because of context or experience. In each case, the terms used are not right or wrong, they are definitions that are useful in the context.

For which, sometimes one party or the other may have to admit they are wrong - including me.

This is not an "I'm right, you're wrong" situation. By my experience, in my context, what you wrote would be called a "shell solution" in the same sense as the original command-line solution would be called a "shell solution."

You think that invoking AWK from the command line means that it's still a command-line script. Your definition of the terms means that you accept that invoking AWK still lets you call it a "shell solution."

I think that is fundamentally and structurally different from using command line utilities such as tr, sed, sort, and uniq.

So my position is clear - your solution that you call "shell" is not, in my opinion, just "shell". To me, your solution is an AWK solution, and you feed the output from your AWK program through shell utilities.

You are using the terms in a manner that is different from how I'm using them, that much is now clear.

Do you agree that you have written a shell script that invokes a program written in AWK?

Would it be different if you wrote a shell script that invoked a C program by calling a C interpreter? Would you still call it a "shell solution to the problem?"

Does it matter? Really? I've made clear why I've said that I don't class your solution as being shell, why do you care?

Then we'll agree to disagree. I think you are wrong on so many points here, it's clear we're not going to agree, and probably won't find common ground.

Thank you, by the way, for your references to various published material. FWIW, I've worked with BCPL, C, AWK, C++, Unix, Linux, GNU, and much, much more, for the last four decades or so, so I'm not inexperienced, and I have read most of the classics. That also doesn't mean I'm right, but it does mean that I have a basis for my opinions.

So thank you for your offer to school me, but I'll decline, and, as I say, accept that we disagree.

I read your entire post, and I didn't miss any of the points you make. I simply disagree with you.

Quoting from your post:

    And here is my initial solution in UNIX shell:

    # bentley_knuth.sh

    # Usage:
    # ./bentley_knuth.sh n file
    # where "n" is the number of most frequent words 
    # you want to find in "file".
    
    awk '
        {
            for (i = 1; i <= NF; i++)
                word_freq[$i]++
        }
    END     {
                for (i in word_freq)
                    print i, word_freq[i]
            }
    ' < $2 | sort -nr +1 | sed $1q
So you invoke awk, and then run the output of awk through sort and sed.

You're doing all the word counting in awk.

Yes, you're invoking awk from a shell script, but that's really not the same thing as "using shell." McIlroy’s solution is genuinely shell:

    tr -cs A-Za-z '
    ' |
    tr A-Z a-z |
    sort |
    uniq -c |
    sort -rn |
    sed ${1}q
"awk" is generally accepted as a full programming language, whereas "tr", "sort", "uniq", and "sed" are command line utilities. I don't think "awk" classes as a command line utility, so I don't class your solution as "shell".

Perhaps you don't agree, perhaps you think "awk" is a command line utility. If so, then we'll agree to disagree.

Not a true statement. Where are you searching?

At the bottom of this page is a search box. Into it type "black bar" (without the quotation marks). It takes you to this link:

https://hn.algolia.com/?query=black%20bar&sort=byPopularity&...

Have you not seen the search box at the bottom of nearly every HN page? Perhaps that question sounds a bit brusque, but in effect, whether you meant it or not, you called me a liar, and I rather take exception to that.

You say: IPFS promises nothing, nor tries to, in the way of permanent archiving.

From the IPFS web site[0]:

Humanity's history is deleted daily

...

IPFS keeps every version of your files and makes it simple to set up resilient networks for mirroring of data.

This is clearly stating that the system keeps every version of your files, and it says nothing about "pinning", or the fact that the files will, in fact, not be kept. At best the web site is misleading, at worst it is simply lying.

I don't yet know with the IPFS really is, nor what it really does, but it's statements like that on the IPFS web site that makes me distrustful of the hype.

[0] https://ipfs.io/#why

But you wrote it, so of course it's clear to you. To me, when someone says "the longest part of the program" I immediately think of the routine that stretches over the most lines. That's the longest part of the code.

So when you say "longest" you don't mean "longest section of code", I'm guessing you mean "section of code in which execution spends the longest time".

If so, good, but it wasn't clear to me that that's what you meant. If you mean something else then I don't know what you mean at all.

I've only briefly skimmed the paper, but here's something I've come up with, based on what I read, that might or might not be the same as what they've said, but I think "has legs":

* Randomly choose some fixed sized subset of the data and sort it;

* Based on that, deduce the distribution of the data;

* Based on that, create a destination array, and copy things from the input to roughly the expected right place in the output;

* Run around and fix things.

When sorting numbers, that feels like it has a chance of running quite quickly. For other objects with some other comparison function, not sure how it would work.

I have a hotch-potch of tools and then glue the results together by hand. It doesn't take me long, but I vet all the results to make sure it's all valid.

It's pretty trivial stuff - a GET on hn.algolia.com and a simply python script to pull just the bits that matter.

[dead] 8 years ago

Do you think this will be particularly common over the next three days? We see this submitted irregularly, fairly constantly, and I've not seen it being especially "clumpy".

Most of them have been flagged and thus deleted, but you can see that it's just constant, although infrequent:

https://hn.algolia.com/?query=Y%20Combinator:%20Bookmarklet&...

Just flag it and move on.

Bitcoin is a public ledger of agreed transactions. I give you some goods, it's registerd in the ledger that you owe me some number of "thingies". Later someone gives me some goods, and on the ledger I transfer your debt to them, and so it goes round.

At some point, someone offers to give me cash for the thingies registered against my name, I agree and thus they have the thingies, and I have cash.

The clever technical parts are how the public ledger is maintained without there being a central authority, and without having to publicly name the individuals who hold the assets.

I've used that explanation several times to good effect so far.

Forgive me, but you have me slightly confused. You say:

As usual, somebody undereducated mistakes notation ("0.9999...") for the real thing (a number).

To whom are you referring?

I've been using this technique for several years now, making sure that my honey-pot addresses are widely available. Any email that matches a whitelist gets through immediately. Anything that matches my blacklist goes straight to spam.

Everything else is put through a comparison filter that looks to see if it's similar to something that's been blacklisted. If so, to goes in the spam folder.

If something is then still unclassified it goes through a Bayesian filter trained on the explicitly black/white messages, and prioritised accordingly. Anything that's closer to black than white gets delayed a day or two, anything that's nearly white goes in my inbox.

Works a treat, and in my experience, even with only a comparatively small amount of email, it beats the gmail filters, because it's trained on my data.

It's easy - there's a search link at the bottom of most pages, and I just put in "doctor die" to see what other people have said before.

But submitting is easy, especially with the bookmarklet, and when something looks good the temptation is just to submit without worrying whether it's been seen before.

Certainly I do it.

But thank you for the compliment.