Sed - An Introduction and Tutorial - <AUTHOR> http://www.grymoire.com/Unix/Sed.html

<comment><USER2> Here is a command that really opened my eyes to how cool sed, grep and piping are:

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'

courtesy of this site: <http://www.centerkey.com/tree/>

<comment><AUTHOR> This ties in nicely to the threads about the necessity of comments. :)

As a bonus, most (all?) of the sed commands are also usable in vi's ex mode (the : prompt).

</comment></comment><comment><USER3> How much value is there in learning sed when you go to languages like Perl or Python for such tasks?

<comment><AUTHOR> Perl works as a hyper-sed, but I think sed and Python are apples and oranges.

<comment><USER3> Python gives me access to a complete regular expressions engine just as Perl does.

<comment><AUTHOR> I know. So does OCaml. Perl is a lot closer _in character_ to sed and awk than Python is, though. That's all. I really dislike Perl, but I'm quite happy with using Python for general scripting and using sed for quick regex piping tasks. If I used Perl instead of Python, I probably wouldn't bother using sed.

Perl has a lot of syntactic sugar for quick-and-dirty regex stuff, derived directly from sed and awk, while Python instead has sugar for list slicing, dictionaries, etc., but uses function syntax (e.g., re.search(pattern, string)) for regexes. I would rather have great syntax for lists and dicts, personally.</comment></comment></comment></comment>


State of PubSubHubbub (subscriber's edition) - <AUTHOR> http://blog.superfeedr.com/state-of-pubsubhubbub/

<comment><USER2> PubSubHubbub support was the first thing on my checklist[0] when I shopped for a Reader replacement.

[0][http://lee-phillips.org/newsblurred/](http://lee- phillips.org/newsblurred/)</comment>


Europe Proposes Cheap Quantum Optics Link to the International Space Station - <AUTHOR> http://www.technologyreview.com/view/507361/europe-proposes-cheap-quantum-optics-link-to-the-space-station/ <comment><USER2> Any idea what they would be testing for exactly? What behavior would they expect to be different in entangled photons at that distance?

<comment><USER3> Just testing a longer distance through the air, and testing how they pass the athmosphere.

</comment></comment><comment><USER4> Does this mean we will get internet on the moon, and consequentially interplanetary internet?

</comment><comment><USER5> >Such a camera would be straightforward to build at relatively low cost and could easily be chucked into the back of resupply ship for astronauts to set up when they have free moment.

Having worked in a space agency allow me to say "AHAHAHAHAHAHA". Nothing gets "chucked" into a resupply, the best they can probably do is try to schedule it in sometime in the next five years. This won't be happening tomorrow.

<comment><USER6> Perhaps ask SpaceX to do it - they shipped fresh ice cream in a refrigerator in their supply mission...

<comment><USER5> Which was undoubtedly planned for, weighed and included in the manifests several years before launch. Not to mention getting NASA approval for being in space (lot of crazy tests), NASA dietician approval (because it's a foodstuff), NASA chemist approval (make sure nothing bad will happen to the space station if it gets somewhere). Trust me there were way too many people involved in getting that ice cream up there.

<comment><USER7> I think you might be taking everything a bit too literally and you might be way too pedantic. What they meant is that the equipment is compact and that in principle it wouldn't be complicated or outside the capabilities of the current cargo vehicles (ATV, HTV, Dargon, Progress) to bring it to the ISS.

I also think that you can't really compare the ISS to anything else. The ISS is not some random satellite. It has many cargo ships bringing massive amounts of cargo to it all the time (thus allowing necessarily for much more flexibility – human lives are at stake, so your cargo capabilities better be more than ample for the job, allowing for contingency plans). There simply isn't anything like it in space.</comment></comment></comment></comment>


Why are some of the ugliest sites on the Web also the most popular? - <AUTHOR> https://thenextweb.com/dd/2017/06/29/why-are-some-of-the-ugliest-sites-on-the-web-also-the-most-popular/ <comment><USER2> My fat fingers don't like HN</comment>


Observations on what's getting downvoted, with some dissected specimens - <AUTHOR> http://arstechnica.com/staff/2012/10/observations-on-whats-getting-downvoted-with-some-dissected-specimens/ <comment><USER2> I'm closing in on that magical 500 karma number where I hear that I'll start to see downvote buttons. I'm almost hoping there is a way I can opt out of this and not have those buttons appear.

Why? The ridiculous system here that gives you one shot at hitting the right button with no chance to correct your mistake. I've seen too many comments saying, "Sorry, I was trying to upvote your comment and fat-fingered the downvote button by mistake." I often read HN on my phone or a tablet and it will be all too easy for me to do that.

Reddit, for all its flaws, gets this right. If you tap the wrong button or change your mind, perhaps after realizing that you misunderstood something, you can fix it.

<comment><USER3> I have experienced the same problem myself. An even simpler (partial) fix would be to just move the buttons further away from each other. They are so close at the moment that hitting the right one on a touch device is basically pure luck. You could also use JS to add an "are you sure?" popup upon hitting downvote.

OTOH HN actually has a fair number of usability issues, though it doesn't seem like there is much interest in fixing them (I'm sure PG has plenty of other things to do). I think this might be partly because this board is written in some form of LISP so less people will be comfortable tweaking the source.

Would it be heresy to suggest a re-implementation in something like rails, or _gasp_ even PHP?

</comment></comment><comment><USER4> The best moderation I've experienced is here on HN, and on Slashdot. I think this is for two reasons:

1\. The cultures of the communities are largely technical, which is a culture that tends to care more about accuracy and truth, rather than just how closely a comment hews to personal opinions. It's okay to disagree if you present reasonably worthwhile support in the post.

2\. The structure of the communities only allows highly valued members to down vote. On Slashdot all moderation (up or down) is controlled by the karma system, and metamoderation "watches the watchers". Here on HN, you must have quite a bit of karma (I think ~500 these days) before you can down vote.

Compare to Reddit, which in most subreddits probably the worst quality moderation I've ever seen in a community. Unpopular truths are downvoted to oblivion, and lies rise to the top if they validate popularly held beliefs. The only exception that comes to mind is /r/askscience, which sets a very high bar to comment at all--all answers must be presented by proven experts or contain references to scientific publications.

<comment><USER5> >>The cultures of the communities are largely technical, which is a culture that tends to care more about accuracy and truth, rather than just how closely a comment hews to personal opinions.

I think you're greatly exaggerating the tendency of technical people to value accuracy and truth over personal opinions. In my experience, people who are technical also tend to have _very_ strong opinions about everything, especially if the subject is technical in nature.

>>The structure of the communities only allows highly valued members to down vote... Here on HN, you must have quite a bit of karma (I think ~500 these days) before you can down vote.

500 karma is really easy to accumulate. All one has to do is conform with popular opinion, and for an active poster it would take a month or so. I was under 500 karma recently, and I kept thinking to myself how much easier it would have been if I had posted in threads about controversial topics and just agreed with everyone. If I had sided with Samsung for example, and spouted the popular (but wrong) opinion that the decision hurts innovation.

<comment><USER6> _I think you're greatly exaggerating the tendency of technical people to value accuracy and truth over personal opinions._

...

* If I had sided with Samsung for example, and spouted the popular (but wrong) opinion that the decision hurts innovation.*

Irony.

That aside, voting systems by design favor majority opinion. From the few stories that discuss it, the behind the scenes moderation that goes on here is likely the differentiating factor in comment quality from sites like reddit. The ability to down vote only after participating in the community for a while is just one of many heuristics for moderating the community.

<comment><USER7> > That aside, voting systems by design favor majority opinion.

It's more complicated than that. Different voting systems lead to different outcomes, even with the same voters. Just compare discussions on here or reddit with answers on stackexchange.

Though of course, you might chalk that up under the heading of moderation.

</comment></comment></comment></comment><comment><USER8> What I find interesting about this post above and beyond its content, is the signal it sends from moderators to the community. We have guidelines, but a post like this from time to time might help reinforce them.

</comment><comment><USER9> So if I comment that the behavior on Ars is surprisingly similar to HN, I should receive up votes from people who had the same thought, and down votes from those who think that's obvious and doesn't add to any new insight?

<comment><USER5> I think the behavior is the same on every site that has upvoting and downvoting functionality.

<comment><USER10> Nooooo. The community matters a lot. The way a conversation will shake out on HN or stackexchange or reddit (all of which have up and down voting) will be hugely different. Indeed, on reddit the particular sub-reddit that a thread is in will make a huge difference in voting patterns and comment behavior.

</comment></comment></comment><comment><USER11> I don't even use downvote buttons. They are the worst idea ever and anyone who uses them is an utterly insecure moron who downvotes to make themselves feel superior. This is one in a long line of downvoting articles on HN that are not even worth the time to click the link.

(EDIT: Apparently some commenters on my post did not read the article. Meta- trolling FTW.)

(I intend to harness the inevitable downvote singularity as a new form of clean energy.)

<comment><USER12> I think you may be ignoring the community moderation effect of downvotes. Try turning "show dead" on and see if your opinion changes. There is a surprising amount of spam, abuse, and downright awful content that is moderated through the downvotes. It's easy to decry the function as useless when its prime effect is invisible to you.

In a community like HN, I think it has a secondary value, as well, in that it provides well-intentioned posters with feedback that they are making a weak point, or doing it in a way that is not contributory to the community. There is (or was) a standard of discourse on HN that down votes help to reinforce by communicating to people that they need to improve their communication. Lack of positive signals is not the same thing as negative signals.

It certainly is abused by insecure morons, but I think it's a bit narrow to decry it as useless because it can be misused.

<comment><USER13> "In a community like HN, I think it has a secondary value, as well, in that it provides well-intentioned posters with feedback that they are making a weak point, or doing it in a way that is not contributory to the community."

Dream on. Whenever I try to troll a bit (or let's say be flamboyant) I get upvotes. Sometimes massively. Whenever I present "unpopular but sincere opinion" I get downvoted, usually massively.

<comment><USER5> Exactly. There is a huge gap between how the system was designed to work and how it actually works.

What upvoting is supposed to be: "Good post that adds a lot to the discussion." What it really is: "I agree with this guy."

What downvoting is supposed to be: "Person is spamming, making a weak point or arguing in an inflammatory manner." What it really is: "You're wrong shut the hell up."

This problem could be fixed if people were forced to give a reason for their upvotes and downvotes. Imagine if every time you click upvote, a small textbox appears that has a list of predefined options, such as "valid point" or "good contribution" or "i learned something". Similarly, every time you click downvote, it automatically takes you to the Reply page; if you don't reply, your downvote does not go through.

This kind of transparency would encourage people to be more thoughtful when they cast their votes.

<comment><USER14> I recall reading somewhere (from HN) that upvoting as an agreement was allowed. Can't find the source though..</comment></comment></comment></comment></comment>


Introducing the New Firefox: Firefox Quantum - <AUTHOR> https://blog.mozilla.org/blog/2017/11/14/introducing-firefox-quantum/ <comment><USER2> Installer stubs - a modern plight. God forbid anyone wan'ts to install it behind a proxy

</comment><comment><USER3> Perhaps the most significant news in this release.

"As part of our focus on user experience and performance in Firefox Quantum, Google will also become our new default search provider in the United States and Canada."

<comment><USER4> I was surprised by that too. Does that mean the deal with Yahoo! was finished? And is there a new deal with Google or no deal at all?

</comment></comment><comment><USER5> Nice to see Firefox competing in performance with Chrome again!

</comment><comment><USER6> Well, that's a good task for this morning : test it !

</comment><comment><USER7> Great !

I do like my rounded tabs though, hope someone ports the old theme.</comment>


The Great Republican Land Heist - <AUTHOR> http://harpers.org/archive/2015/02/the-great-republican-land-heist/?mod=e2this <comment><USER2> No better way to destroy an intellectual debate than prefacing your headline with Republican or Democrat: [http://lesswrong.com/lw/gw/politics_is_the_mindkiller/](http://lesswrong.com/lw/gw/politics_is_the_mindkiller/)

The fact the people involved in this are self described as "anti-government" and small-government, plus the entire issue is reducing federal control back into state law seems to only be an inconvenience... Trying to frame it outside of the scope of left vs right, rather than local vs federal control, doesn't seem to fit well into mainstream political discourse.

Side note: single page article [http://harpers.org/archive/2015/02/the-great- republican-land...](http://harpers.org/archive/2015/02/the-great-republican- land-heist/?single=1) (admins?)

<comment><USER3> The ranchers might be anti-government, but the legislators passing laws in their favor are Republican.

<comment><USER2> Yes one specific republican started an organization, the only bill which passed only affected Utah and was never actually enforced. As it was state- level and federal agencies threaten to sue if Utah did.

Bundy is from Oregon. Further more:

>> One of ALEC's model bills is the Eminent Domain Authority for Federal Lands Act, which, like Bundy, cites Article 1, Section 8, Clause 17 of the Constitution to justify state seizure of federal land. ( _A spokesperson for ALEC disavowed Bundy and his actions._ )

The laws they are fighting are federal and mostly from the 1930s, enacted under the Hoover government, which was republican.

This is about state vs federal rights, not left vs right. It should be framed as such.

<comment><USER3> Yes. Pro-rate destruction versus pro-environment is an issue that overwhelmingly falls along partisan lines. I dislike partisan bickering too, but on this issue it's clearly partisan.

<comment><USER2> Just because an issue was co-adopted by parties doesn't make it inherently a partisan political issue. Technically it opposes both parties in federal gov, as the representatives in question are state level and opposing any federal intervention.

<comment><USER3> It's not about federal intervention versus lack of. It's federal land. The issue is whether federal land should be used for conservation versus grazing.

<comment><USER2> > The issue is whether federal land should be used for conservation versus > grazing.

Correct, that's the issue and the proposed solution is _abolishing_ federal land control, transferring rights to state control, and therefore preventing federal intervention in grazing.

>> 'But the stockmen's ambition went further: they wanted the federal government to transfer control of all federal land, including the national parks, to the states.'

The state legislators would still be free to enforce their own laws in that respect - technically they could themselves limit externalities or even enhance conservation. The parties involved (ie, ranchers) believe that they would be better served at the state level, a belief which was also held by many of those who were behind the constitution - whom they spare no time trumpeting.

<comment><USER3> State versus federal regulation is the means, not the end. The end is cheap grazing land for ranchers at the cost of the environment.

<comment><USER2> Yes but do you see the fallacy in your comment? Whether state vs federal, conservation is similarly a problem that could technically be solved at both levels. Your comment:

> "The issue is whether federal land should be used for conservation versus > grazing."

The real problem IMO is whether states would be better at managing these laws than the federal level.

This is what they are proposing... even if they do achieve this, there is no guaruntee that it would instantly turn into a free-for-all for ranchers.

There is no clear answer to this question. What if Oregon green-activists acquire similar power, embraces this idea, and do a far better job than the feds at conservation? A model for other states to follow.

This is an interesting thought experiment, lost in hyper-political handwaving.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER4> What interest does a New Yorker or Californian have in owning 86% of Nevada? Why shouldn't the citizens of the state in question have the right to manage that land for the purposes they deem important?

<comment><USER5> The government owns all land until it is transferred/sold to a private owner. That's not a new thing: that precedent goes back to Day 1 of the United States, and maybe further.

I've never heard Ranchers request the opportunity to _purchase_ the land. They just want to use it as if they owned it.

<comment><USER6> > The government owns all land until it is transferred/sold to a private > owner.

But surely the state government, rather than the federal government?

<comment><USER7> Well, no. The federal government acquires a chunk of land (by conquest or purchase). It becomes a territory. Who owns the land ( _all_ of it)? The federal government.

Eventually the feds decide to organize a state in that area. The day Congress passes the bill of statehood, who owns the land? The new state? Only if the bill of statehood said that the land transferred.</comment></comment></comment></comment>


Google Voice Apps For Android And Blackberry Are Here - <AUTHOR> http://www.techcrunch.com/2009/07/14/google-voice-apps-for-android-and-blackberry-are-here/ <comment><USER2> It's not apparent to me from the writeup -- does the Google Voice client make its calls using the cellular phone / POTS network, or is it VOIP and just using the cell network to pass packets?

I'm assuming SIP is probably a non-starter with the US cell companies, although it doesn't stop it from working fine on the Nokia S60 platform using the built-in dialer and client.

<comment><USER3> It makes the calls using the cellular voice network but it uses the data connection for text messages. At least it did in before I'll check it out first thing tomorrow and report back.

<comment><USER3> Not sure if anyone is reading this but I said I'd report back so I am:

Google Voice installs easily

It integrates with voice dialing

It does send SMS but you need to use the Google Voice App instead of the standard Messaging App to send SMS

I got an error when I was on WiFi that prevented the dialer from working but I think that was due to a WiFi issue

Once I turned WiFi off it worked

If you look at incoming SMS in the standard Messaging App they all show as coming from a 406 number

But it does have the name of the person next to the number and they look better in the Google Voice App</comment></comment></comment>


UK's new Snoopers Charter just passed an encryption backdoor law by the backdoor - <AUTHOR> http://www.theregister.co.uk/2016/11/30/investigatory_powers_act_backdoors/ <comment><USER2> I live in the UK and the thing that's disturbed me most about all this is how little coverage there's been and how little outrage there is about the consequences of this law. I genuinely think as a country we've given up. There's no enthusiasm for any cause and no one has any will left to stand up for the things they ought to care about. It's a weird atmosphere here now.

<comment><USER3> What frighten me most is that Labour, supposedly the official opposition to the government, refused to try to stop or improve this bill. Instead they waved it through, abstaining on key votes, and not bothering to table amendments.

All of this is despite Labour being run by figures who have a long history of opposing government authoritarianism. For example, Jeremy Corbyn didn't vote against it. Shami Chakrabarti, who spent years running Liberty, an organisation dedicated to protecting individual liberties, abstained.

What the hell is going on behind the scenes when people like that have been successfully silenced?

When a law this far-reaching and repressive is passed with a conspiracy of silence and acquiescence from both the media and the political establishment, you have to conclude that UK democracy is basically non-functional. It's over.

<comment><USER2> I didn't know Shami Chakrabarti abstained. That's totally mad. If there's one thing I would have thought we could rely on her for it was to vote against things like this.

The Labour party have been completely neutered. The membership and the unions clearly want them to take a much more radical left wing approach but the party establishment still want them to be the party Blair built and it's caused this weird stalemate. I think Blair would have backed this bill.

An interesting point is that the bill has exceptions for journalists. I suspect that has encouraged the media to keep pretty quiet about it.

<comment><USER4> I think Blair almost certainly would have backed this. The other day I rediscovered this article from 2008 about councils using RIPA to catch people littering and flytipping:

[http://www.telegraph.co.uk/news/uknews/3333366/Half-of- counc...](http://www.telegraph.co.uk/news/uknews/3333366/Half-of-councils-use- anti-terror-laws-to-spy-on-bin-crimes.html)

> The Tories condemned the latest figures as further evidence that the law had > become a "snooper's charter". "Under Labour, the rights and liberties of > law-abiding citizens are being eroded through plans for ID cards, sinister > microchip spies in bins and abuse of anti-terror laws by councils," said > Eric Pickles, the party's communities spokesman.

Strange reading nowadays. I wonder what Eric Pickles makes of it all.

</comment></comment></comment></comment><comment><USER5> Having attempted to read the legislation passed, I actually have no idea in a lot of ways what this bill does and what this bill doesn't cover. (The main thread of what it covers seems terrible).

I consider myself a quite intelligent and logical person, but I get lost halfway through reading it. It seems full of contradictions and half vague statements that could or couldn't cover something.

Are these bills purposefully confusing by design? It seems like you can interpret it in a lot of ways. Why is it not clear, concise and understandable?

<comment><USER5> Here is the response from the Government to the petition posted:

[https://petition.parliament.uk/petitions/173199](https://petition.parliament.uk/petitions/173199)

"The Government is clear that, at a time of heightened security threat, it is essential our law enforcement, security and intelligence services have the powers they need to keep people safe.

The Investigatory Powers Act transforms the law relating to the use and oversight of Investigatory powers. It strengthens safeguards and introduces world-leading oversight arrangements.

The Act does three key things. First, it brings together powers already available to law enforcement and the security and intelligence agencies to obtain communications and data about communications. It makes these powers – and the safeguards that apply to them – clear and understandable.

Second, it radically overhauls the way these powers are authorised and overseen. It introduces a 'double-lock' for the most intrusive powers, including interception and all of the bulk capabilities, so warrants require the approval of a Judicial Commissioner. And it creates a powerful new Investigatory Powers Commissioner to oversee how these powers are used.

Third, it ensures powers are fit for the digital age. The Act makes a single new provision for the retention of internet connection records in order for law enforcement to identify the communications service to which a device has connected. This will restore capabilities that have been lost as a result of changes in the way people communicate.

Public scrutiny

The Bill was subject to unprecedented scrutiny prior to and during its passage. The Bill responded to three independent reports: by David Anderson QC, the Independent Reviewer of Terrorism Legislation; by the Royal United Services Institute's Independent Surveillance Review Panel; and by the Intelligence and Security Committee of Parliament. All three of those authoritative independent reports agreed a new law was needed.

The Government responded to the recommendations of those reports in the form of a draft Bill, published in November 2015. That draft Bill was submitted for pre-legislative scrutiny by a Joint Committee of both Houses of Parliament. The Intelligence and Security Committee and the House of Commons Science and Technology Committee conducted parallel scrutiny. Between them, those Committees received over 1,500 pages of written submissions and heard oral evidence from the Government, industry, civil liberties groups and many others. The recommendations made by those Committees informed changes to the Bill and the publication of further supporting material.

A revised Bill was introduced in the House of Commons on 1 March, and completed its passage on 16 November, meeting the timetable for legislation set by Parliament during the passage of the Data Retention and Investigatory Powers Act 2014. Over 1,700 amendments to the Bill were tabled and debated during this time.

The Government has adopted an open and consultative approach throughout the passage of this legislation, tabling or accepting a significant number of amendments in both Houses of Parliament in order to improve transparency and strengthen privacy protections. These included enhanced protections for trade unions and journalistic and legally privileged material, and the introduction of a threshold to ensure internet connection records cannot be used to investigate minor crimes.

Privacy and Oversight

The Government has placed privacy at the heart of the Investigatory Powers Act. The Act makes clear the extent to which investigatory powers may be used and the strict safeguards that apply in order to maintain privacy.

A new overarching 'privacy clause' was added to make absolutely clear that the protection of privacy is at the heart of this legislation. This privacy clause ensures that in each and every case a public authority must consider whether less intrusive means could be used, and must have regard to human rights and the particular sensitivity of certain information. The powers can only be exercised when it is necessary and proportionate to do so, and the Act includes tough sanctions – including the creation of new criminal offences – for those misusing the powers. The safeguards in this Act reflect the UK's international reputation for protecting human rights. The unprecedented transparency and the new safeguards – including the 'double lock' for the most sensitive powers – set an international benchmark for how the law can protect both privacy and security.

Home Office"

Again in their response, I have no idea what they really said. It's not clear other than some vague line on terrorism and safety. It's all a mixture of half speak and jargon.

<comment><USER6> And this is why people in the UK are apathetic. Civilized protest is greeted by official jargon that basically says 'we do what we want'. Just like when we objected to the original RIPA.

The agencies and authorities that pressurise and cajole Governments into these actions are unelected and play the long-game. They can wait and ride-out any Paliament that is insufficiently malleable.

Which reminds me to update my collection of encryption program source code whilst I still can.

</comment></comment></comment><comment> sir-alien I do find such a law quite strange though. The intention (at least for public consumption) was to help "prevent" terrorism. Not sure how the NHS or health services seeing your browser history will do that.

France already has a similar law in place so I wonder how that worked out for them by preventing the Bataclan massacre. (it didn't)

This law will probably not help in any shape or form to prevent terrorism but was merely implemented to provide some form of leverage over people.

"Do as we say or this lovely data becomes public, or you are denied healthcare because of a site you visited but never visited because it was a hidden iframe"

<comment><USER7> The truth is that authorities the world over have finally caught up with the internet. Look at it this way: they already had pretty extensive powers to monitor telephone calls and correspondence; then the internet came about, and slowly made them blind.

Until a few years ago, they compensated by treating the internet as a free- for-all where they could spy at will; as people fought back and started to demand accountability and limits, they responded with a legislative backlash that is slowly making gains everywhere. The most authoritarian-inclined states (UK, France, Italy) have passed the worst laws, but others are busy following suit.

It's an ideological battle, and they are winning it. One day we will look back at the Chinese firewall as a pioneering effort.

<comment><USER8> I've been wondering, do we have any idea on what type of data they'll be recording now?

\- Is it domain names, or subdomain names?

\- How do they get the domain names? Do they look at IP addresses I'm connected to and do a lookup?

\- If I use a VPN, will all my traffic come up as that VPN?

\- How will they link an internet connection to a person? Will it be done on the name they used when they signed up, their house address, or their billing details?

<comment> sir-alien When using a VPN (IPsec, OpenVPN, etc - something secure) then all the ISP will see is that you connected to your VPN IP and how much data volume was transferred.

Since the traffic exits at the VPN only the VPN endpoint would be able to read this meta data if they did such a thing which is not impossible but not normal. The worst case scenario is that your encrypted traffic is recorded for a while then they come knocking on the door for the encryption key. Alternatively if the international VPN provider is of the cooperating kind then they can log this data on behalf of your government. So use a foreign VPN provider that stands up for rights or use a dedicated server in a foreign country.

I have always wondered if this could be avoided though by using some form of rotating keys that you throw away or perfect-forward-secrecy if this works.

<comment><USER8> Do you have a suggestion for a paid VPN service?

<comment><USER9> [https://gist.github.com/joepie91/5a9909939e6ce7d09e29](https://gist.github.com/joepie91/5a9909939e6ce7d09e29)

But if you must: [https://thatoneprivacysite.net/](https://thatoneprivacysite.net/)

<comment><USER10> This article [1] is so stupid I want my seconds back.

The matter in question is: who do you trust more? Your ISP or the VPN provider? The default should be that you don't trust your ISP, especially if you are in the UK. Hence, trusting a VPN provider is the lesser of two evils.

Will that protect your child-pornography-viewing? If you use Qubes OS, where you have a VPN on the host, then you use Whonix in a VM, where you use tor, then you are probably safe.

Are you a terrorist planning to destroy America? You are probably our of luck, but for the truly paranoid it could be achieved.

My advice: it is better to trust VPN providers in other countries than your own, just select decently (aka, not Hide my Ass). NEVER trust your ISP!

[1] [https://gist.github.com/joepie91/5a9909939e6ce7d09e29](https://gist.github.com/joepie91/5a9909939e6ce7d09e29)

</comment></comment></comment></comment></comment></comment></comment><comment><USER11> It is curious to note that if you very slowly and gradually reduce the size of the sheep pen, as long as the sheep are still fed, they won't notice until they are driven down the tunnel to the slaughter house.

It is not until they hear the captive bolt being shot through the skull of the sheep in front of them, that they finally start to panic.

<comment><USER12> "Curious" is not the first word that I would think of to describe that situation.

Terrifying? Horrific? Insidious?

</comment></comment><comment><USER13> This is basically national security letters with oversight. Which is part of the problem. When any of the major democracies introduces a law like this, it normalises it for the rest. Which then gives encouragement to the more oppressive countries. The whole world seems to be in a race to the bottom.

</comment><comment><USER14> I would like the crypto-experts of HN to help understand what consequences this has. For example, I have whatsapp with E2E encryption. Can the government read my texts now?

<comment><USER15> _" Can the government read my texts now?"_

It is _impossible_ to read properly encrypted data. However, this law enables government to require tech firms to deliberately break cryptography in their products.

<comment><USER16> @grandparent: In other words, no, they can't read the texts you've sent up to this point. But they may be able to a month or year from now. Your texts up to the point the law passed are safe _, but you can 't be sure about the messages you send from now on.

(_well, as safe as they were prior to the Snooper's Charter).

<comment><USER14> So the question will come down to how much leverage the UK government has over which companies?

<comment><USER16> Essentially, yes -- it will be down to whether the company is willing to risk having to withdraw from UK market. And if a company does choose to cave in into UK government's demands for backdoors, you can't be sure whether or not they would inform you of this in a timely manner.

</comment></comment></comment></comment></comment><comment><USER17> OK, time to stop using any security software created by company under UK jurisdiction. Anyone want to help make a list?

</comment><comment><USER18> I would like to attain some decent level of privacy, but my searches on how to go about it yield a large amount of conflicting information (which I suspect is there on purpose.) Is there a sensible guide out there that some of the experts at HN would recommend?

<comment><USER15> It depends on your threat model: what do you want to hide and from who? If you simply want to avoid someone reading your messages (payload), using https everywhere, end-to-end encrypted chat clients (ie. Signal), encrypted mail (ie. PGP), maybe disk encryption (ie. VeraCrypt) should be enough to defend against non-targeted attacks and government dragnets. If you want to hide your "meta-data" from non-targeted government snooping (browsing history and who do you contact with) it gets more complicated -- in this case you also need VPN and/or Tor. Defending against targeted attacks is next to impossible, but you should not be worried about these anyway, unless you are on FBI's top list or smth. Using open-source tools and avoiding highly centralized services (Google, Facebook etc.) is generally a good idea for a privacy minded individual as well.

<comment><USER19> Simply using VPNs and Tor provided a signal, and is (per previously released documents) a great way to get on a short list of people to pay more attention to.

I almost think we'd be better off going the other direction and hiding our signal in a bunch of noise, or just grab everything and review it on an uncompromised network (such as "spider every top link from HN and store it locally, then browse only that local copy").

<comment><USER15> If enough people use secure communications, then it _becomes_ noise. Take an old, boring door lock analogy: _everyone_ locks their home door, but nobody thinks that they have something to hide or illegal in their home just because of that. Making privacy and encryption tools easily accessible and easy to use is our best best imho.

<comment><USER19> Given the breadth and intent of these laws, I'd expect a different response - requiring ISPs to block VPN traffic that isn't hitting a whitelisted (i.e. corporate) endpoint.

VPN traffic has a distinctive signature, and ISPs are already using deep packet inspection hardware already, so blocking VPN traffic seems like a natural evolution in this particular arms race.

</comment></comment></comment></comment></comment><comment><USER20> UK is going to get hacked into oblivion once the key gets leaked, and it will get leaked. "Hey lets cripple national security under a single point of failure in the name of security".

</comment><comment><USER21> So the UK just killed their ISP and hosting industry. Welcome in Germany

<comment><USER22> I don't think Germany is much better...

<comment><USER23> its written into the constitution that they don't do this, cause of their gestapo history. Ironically Germany are the safest bet because of their past.

<comment><USER22> Constitution means nothing. Check this one: [https://www.reddit.com/r/worldnews/comments/5fxy9s/whistlebl...](https://www.reddit.com/r/worldnews/comments/5fxy9s/whistleblowing_website_wikileaks_has_released_a/)

</comment></comment></comment></comment><comment><USER24> A petition can be signed here: [https://petition.parliament.uk/petitions/173199](https://petition.parliament.uk/petitions/173199)

<comment><USER14> That is the old petition, they have already responded. We need a new petition.

<comment><USER25> Not been considered for debate yet. The response was triggered by 10,000 votes.

<comment><USER26> (Is it not 100,000?)

Genuine question - has anything ever happened as a result of these petitions? When it has been debated, has there been a meaningful change afterwards?

<comment><AUTHOR> No, nothing has happened. 100,000 signatures means it's considered for debate, not guaranteed. The response is inevitably:

"We have considered debating this and decided actually we don't fancy it. Keep signing the petitions though, they definitely make a difference and don't think about taking direct action of any form."

</comment></comment></comment></comment></comment><comment><USER27> What technical solutions can be used to prevent this? As I understand, this mainly entails internet access logs? Would a secure, off-shore VPN defeat this?

<comment><USER23> yeah. They're just tracing what pages the ISP serves you. So if you encrypt and proxy your requests via something else they'll only know you're accessing some random server somewhere.

<comment><USER28> No they will see the VPN service endpoint - the next step of course would be to disallow those connections since you must be hiding something. Only VPN providers (like Corporate ones) that are verified by the state will be permitted. Since the external VPN providers could keep changing the endpoint they will respond with whitelists of acceptable domains. Eventually you will succumb and learn to love big brother.

<comment><USER23> We'll just compromise a whitelisted end point. The whitelisting would have to be pretty liberal because of corporate and many of us are corporate. This bill only empowers those with technological skills.

</comment></comment></comment></comment><comment><USER29> > "There may be not much point using a VPN to conceal your web activities if > it can be blown open by a technical capability notice."

If my computer makes a VPN connection with a machine outside of the UK, is the above claim still valid?

<comment><USER30> From the article:

> "The UK government can certainly insist that a company not based in the UK > carry out its orders – that situation is specifically included in the new > law – but as to whether it can realistically impose such a requirement, > well, that will come down to how far those companies are willing to push > back and how much they are willing to walk away from the UK market."

<comment><USER29> Missed that. Thanks.

But I cannot see why someone would comply with that. For example getting an AWS machine in Ireland, is that within the "UK market"? Does amazon have to comply just because many customers are in the UK? And will we ever know if they do comply? What a mess.

<comment><USER30> Exactly. And think about private keys for SSL certificates. I'm not even sure if those are covered by the legal wording, but I wouldn't be surprised if they were.

<comment><USER29> Still, I'm not sure how that will work. Say I spawn a VPS, and I start my VPN server in there. Can Amazon just go in there and snoop somehow? My keys are encrypted, even if they can see the disk they are on, and the traffic also. All it can do is see the network traffic that originates from that machine, and log that.

<comment><USER31> Assume that if someone has physical access, the machine is compromised.</comment></comment></comment></comment></comment></comment>


How does closecontact work? - <AUTHOR> https://closecontact.club/how-it-works <comment><AUTHOR> closecontact is a way for you to fulfill the contact sharing rules for clubs during COVID-19 while keeping your data as private as possible.</comment>


Why Twitter Turned Down Facebook  - <AUTHOR> http://bits.blogs.nytimes.com/2008/12/03/why-twitter-turned-down-facebook/ <comment><USER2> To boil it down, a generic answer: "The timing wasn't right."

I still think it was a very prudent decision. Gruber said it best: "I'm not sure I'd sell a sandwich in exchange for Facebook stock." (<http://daringfireball.net/linked/2008/11/24/twitter-facebook>)

<comment><USER3> Yeah, but with no business model to speak of, Twitter has yet to prove they are worth as much as a sandwich.

<comment><USER2> True, but Twitter isn't even trying yet. I think it would be easier to generate revenue with it than Facebook. I'd rather be in Twitter's position than Facebook's.

<comment><USER4> I don't know, at least as far as profits go. They've got significant SMS expenses to overcome. Facebook's per user cost of delivering service has to be much cheaper.

I think Facebook has a pretty solid path to revenue (re-legitimize apps and they provide a dead simple payments platform) though they don't seem like they're going to take it.

</comment></comment></comment></comment><comment><USER4> For those not in the Valley "it wasn't the right time" == "they didn't offer enough cash".

<comment><USER5> $500 million is a hell of a lot for something like Twitter, even if it is stock, not cash.

<comment><USER6> But it was $500 mill giving FB a $15B valuation.. If you assume FB is worth $3B - then it was only a $100 mil offer. (Still nothing to be sneezed at)

<comment><USER5> $100 million seems like a more fair valuation of Twitter to me. I feel like people around here ("here" meaning Silicon Valley, etc) overvalue Twitter.

<comment><USER4> $100 million in cash maybe, though that would allegedly be about their valuation as of last funding round.

$100m in Facebook stock I'd turn down too, if I were them.

</comment></comment></comment></comment></comment><comment><USER7> I think in this case twitter has a lot more leverage here. THey have a lot of traction, great reputation (especially after "fixing" their scalability issues) and no competitors (not talking about friendfeed yet). So they can afford to hold out to sweeten the deal a bit more.

<comment><USER8> I'll just refer to my previous comment about twitter.

<http://news.ycombinator.com/item?id=378541>

Outside hacker news and "Valley-oriented" news-sites I've hardly heard it mentioned.

Twitter may have potential, but it still has massive usability problems, and at large is one of the few services I've signed up for which has offered me absolutely nothing of value and no way to improve on that.

Saying twitter, a _bandwidth hole_ with no actual plan to monetize on its service, is worth millions is clearly overstating its value, even with its current user-base.

<comment><USER9> It was mentioned on the front page of The Guardian (national UK newspaper) of Nov 29th, here's the article:

[http://www.guardian.co.uk/world/2008/nov/29/mumbai-terror- at...](http://www.guardian.co.uk/world/2008/nov/29/mumbai-terror-attacks- terrorism1)

It is no where near as mainstream as Facebook, but it is starting to be mentioned in mainstream places, not just in the technology sections.

To be honest, I'm not sure Twitter will go mainstream like Facebook has. Most of the value I get from it is to be in touch with friends throughout the day. Not a lot of workplaces will let you do that (mine does, but that's a benefit to being self employed :-) ) From what I see, Facebook is more oriented around much more asynchronous usage, which is a lot easier for most people to use.</comment></comment></comment>


Can the Internet Survive Climate Change? - <AUTHOR> https://newrepublic.com/article/155993/can-internet-survive-climate-change <comment><USER2> The Internet was originally created by Darpa to survive a nuclear war.

I'm optimistic it will exist after climate disaster but we may be extinct then.

AI will probably use it then. Who knows, maybe that's even the plan? ;-></comment>


C++ is not a superset of C - <AUTHOR> https://mcla.ug/blog/cpp-is-not-a-superset-of-c.html <comment><USER2> Several of the examples shown as valid C are not.

For example, this:

        const int foo = 1;
        int* bar = &foo;
        *bar = 2;

is said to have undefined behavior, but in fact the initialization of `bar` is a constraint violation, requiring a diagnostic. (Some compilers will issue a non-fatal warning, which is allowed by the C standard but IMHO is unfortunate.)

Another example: it says that this:

        const size_t buffer_size = 5;
        int buffer[buffer_size];

will not compile in C, but it's valid at block scope in C99, which introduced variable-length arrays. (C11 made them optional.)

"In C, this would compile, albeit likely with warnings about implicit conversion:"

        int main() {
            auto x = "actually an int";
            return x;
        }

The "implicit int" rule was dropped in C99, and even before that the language did not define an implicit conversion from char* to int. Again, some compilers might support it with a warning, but it's a constraint violation.

<comment><AUTHOR> I haven't been able to find anything in the C11 standard about the initialisation of bar being a constraint violation. In 6.7.3, the only constraints for type qualifiers listed are for _Atomic and restrict. Could you let me know where you got the information you talk about here from? I could be missing part of the standard.

<comment><USER2> N1570 6.7.9p11 says that the constraints and conversions for simple assignment apply to scalar initializers.

184.108.40.206p1 says that, for pointers, "the type pointed to by the left has all the qualifiers of the type pointed to by the right".

In this case, the right operand is a pointer to a const-qualified type and the left operand is a pointer to a non-const-qualified type.

(Without this restriction, you could silently discard const qualification just by assigning or initializing a pointer, which would largely defeat the purpose of const.)

</comment></comment></comment><comment><USER3> The C++ specification has an entire appendix devoting to listing incompatibilities with C. Some features missing from this list:

* A char literal is an expression of type int in C, but type char in C++.

* String literals are const in C++ but non-const in C (although attempts to modify them are undefined behavior).

* This program is legal C but not C++:

       int i;
       int i;

* structs and unions occupy a different name space in C than they do in C++.

* main cannot be recursive in C++, but it can in C.

* C++ allows lvalues in a few more places. Usually, this amounts to a compiler error, but there are a few places where the additional lvalue-to-rvalue conversion is legal and produces a different result.

* There are some cases where C++ requires an explicit cast that C permits an implicit cast (void* being the most well-known)

</comment><comment><USER4> This is true, but C++ is _mostly_ a superset of C, which is "good enough" for the vast majority of developers. It's enough of a superset that we were able to seamlessly integrate our legacy C libraries with our modern C++ applications without hassle (and we didn't run into any of the corner cases listed in the article).

<comment><USER5> I am hoping this isn't an implication that C is legacy and C++ is the modern and the future. :-)

<comment><USER6> C isn't just legacy, it's fundamentally broken. Rust is the future. C++, while it mitigates some of the brokenness of C, favored backward compatibility with C over fixing the brokenness once and for all.

<comment><USER7> Does the RESF just browse C/C++ threads waiting for the right moment to jump in and proselytize? It is not even mentioned once in the article.

</comment></comment></comment></comment><comment><USER8> Nearly everything that is mentioned in this blog is a subject of change / addition to the latest C standard, code named C2x.

They are in discussions to introduce the following in C:

        * nullptr
        * auto
        * __has_include
        * make false and true first-class language features
        * constexpr

and lots of other goodies [1].

[https://gustedt.wordpress.com/2018/11/12/c2x/](https://gustedt.wordpress.com/2018/11/12/c2x/)

<comment><USER9> Are they trying to make C literally become the same as C++ except classes and templates?

<comment><USER10> > Are they trying to make C literally become the same as C++ except classes > and templates?

As a C programmer, aren't classes, templates, and exceptions the things that have classically differentiated C and C++?[0] I don't see anything obviously objectionable about nullptr[1], auto, __has_include, or constexpr. (I don't have a ton of experience with them, either.)

I'll admit I don't really grok what "make false and true first-class language features" means — maybe make them reserved keywords? (int)true must still evaluate to 1, in any event.

[0]: "C++ is C with classes!"

[1]: C's "NULL" has this obnoxious wart in that it is implementation-defined whether or not it is a pointer type. I.e., it can be "(void *)0" or just "0". This means that it cannot be used safely in portable incantations of variadic functions that expect pointer arguments.

<comment><USER11> > This means that it cannot be used safely in portable incantations of > variadic functions that expect pointer arguments.

Why only variadic functions? The answer to that may make my next question obsolete, namely: Wouldn't only C++ complain about this? In C, isn't the input to anything coerced to the data type it will represent, in actual complete disregard of the input type?

<comment><USER12> In a fixadic function the integer literal would be promoted to a pointer, because the caller knows that the argument should be a pointer. In a variadic function call, the caller guesses the type of each argument based on what is passed. A variadic function needs to know exactly the size of its arguments and sizeof(int) != sizeof(pointer) on many systems.

This works:

        void f(char *p);

             f(0); /* integer literal auto promoted to pointer */

This probably doesn't, at least not as the number of arguments to f is increased:

        void f(...);

             f(0); /* assume type of function is void f(int) */

</comment></comment></comment></comment></comment><comment><USER13> I love that roughly 35 years after its creation we're still arguing about what c++ is or is not in relation to C. I'm looking forward to the debates and blog posts of my grandchildren on Perl 6 vs Perl 5

<comment><USER14> Doubt either of our grandchildren will ever use Perl. It is truly an arcane language that has no niche and no new application written in it.

<comment><USER13> I'm still using perl scripts for log parsing and some general sys-admin type stuff, but yeah, it's way past its prime.

</comment></comment></comment><comment><USER15> > I'm suspicious of restrict. It seems like playing with fire, and anecdotally > it seems common to run into compiler optimisation bugs when using it because > it's exercised so little.

On the contrary, I wish C++ had restrict in the standard, for exactly the reasons mentioned: it can help the optimizer in certain cases.

<comment><USER16> Indeed, auto-vectorization usually won't work without it...

<comment><AUTHOR> This is all totally fair -- I've never used restrict, so it's hard for me to have a useful opinion on it.

I think it's easy to dismiss things that can help optimisation when you've never seen their effect first-hand. I imagine if I'd had an experience where I'd used it to great advantage I'd be wishing it was in the C++ standard too :)

</comment></comment></comment><comment><USER17> > The size of the array needs to be known at compile time. In C++, a const > variable can be a constant expression, meaning it can be evaluated at > compile time. In C, this is not the case, and we must instead use a pre- > processor macro:

Enums are also good here in C land for specifying compile time constants.

<comment><USER2> Yes, but only for constants of type int.

For example, this is valid:

        enum { ANSWER = 42 };

But C enumeration constants are always of type int, so you can't define a constant of some other integer type this way.

<comment><USER10> It's worse than that. The type of a C enumeration is implementation defined. It must cover the full range of defined values, but it definitely doesn't have to be 'int'. (§ 22.214.171.124 (4)):

> Each enumerated type shall be compatible with [ed: one of] char, a signed > integer type, or an unsigned integer type. The choice of type is > implementation-defined but shall be capable of representing the values of > all the members of the enumeration.

One possible source of confusion is that explicit values in an enum (i.e., '42' in your example) must have values representable as int. (§ 126.96.36.199, (2)).

<comment><USER2> I said _enumeration constants_ are of type int.

For example, given:

        enum foo { this, that, the_other };
        enum foo obj;

obj is of type "enum foo", which is compatible with some implementation- defined integer type, but the constants "this", "that", and "the_other" are of type int.

In C++, the constants are of type "enum foo", which can also be referred to as "foo".

</comment></comment></comment></comment><comment><USER18> The designated initializers example will actually compile in recent versions of GCC, Clang, and Visual C++, even if that's not part of the standard prior to C++20. A better example (i.e. one that doesn't compile in C++ but does in C) would be

      int arr[3] = { [1] = 5 }

or even

      struct A c = {.x = 1, 2}

or another example where the designators are not declared in order of the struct members, or where the designators are nested. The version of designated initializers standardized in C++20 only allows the simple case that's currently implemented in all the major compilers.

See [https://stackoverflow.com/a/29337570](https://stackoverflow.com/a/29337570) for more info and examples.

</comment><comment><USER19> To offer a different opinion, I love the design/images/color scheme. Feels fun and creative.

<comment><AUTHOR> Thank you so much! This is lovely to hear. ^_^ I like it too.

</comment></comment><comment><USER20> The code:

const size_t buffer_size = 5; int buffer[buffer_size];

compiles fine in c, but not for the same reason. C99/C11 has dynamic arrays

[https://en.wikipedia.org/wiki/Variable- length_array#C99](https://en.wikipedia.org/wiki/Variable-length_array#C99)

<comment><USER21> To be exact, it doesn't compile fine outside of functions (which the sample code didn't have) because file scope arrays can't be VLAs.

<comment><AUTHOR> This is what I was going for in the blog post, but I got confused after seeing these comments as Clang _does_ compile this when the buffer is of static storage class.

Which I don't think is standard -- but it's not using VLAs. I wondered if it just has constant expression semantics for const variables.

Weirdly, adding a _Static_assert to test this theory proves it for c99 but not c11 :/

[https://godbolt.org/z/q-bb-n](https://godbolt.org/z/q-bb-n) c99 with clang [https://godbolt.org/z/ad14Ah](https://godbolt.org/z/ad14Ah) c11 with clang [https://godbolt.org/z/xJSDQa](https://godbolt.org/z/xJSDQa) c11 with gcc (which is the only one giving the output I'd expect)

<comment><USER21> >I wondered if it just has constant expression semantics for const variables.

That would be my guess also, for applicable const variables. File scope const variables are quite constexpr-y in C anyway, since C requires all file scope variable initializers to be constant expressions (C++ only requires that for constexpr variables).

Toying around with clang in Godbolt, it seems that there are some quirks regarding this. The following is accepted:

      static const int n = 0;
      int buf[n]; // invalid zero-length array is accepted
                  // probably another non-standard extension

But the following is not, despite _n_ having the same zero value:

      static const int n;
      int buf[n]; // complains about a file scope VLA

</comment></comment></comment></comment><comment><USER22> Reminds me of a blog post of mine[1].

Funny that I say C is not a subset, while this says C++ not a superset.

But mine doesn't go too deep, don't reference any standards.

I love things that explore dark corners of languages like this, look forward to digging deeper.

Also, I like the web design, kinda cyberpunk.

1\. [http://faehnri.ch/how-c-is-not-a-subset-of-cpp/](http://faehnri.ch/how-c- is-not-a-subset-of-cpp/)

<comment><AUTHOR> Being told my web design is kinda cyberpunk is a great compliment, thank you ^_^ I like the banner image on yours.

</comment></comment><comment><USER23> C++ was once a near superset of C. However, due to language divergence, the situation is that both C and C++ are large supersets of an intersection.

What is in that intersection depends on which C and C++ dialect pair your intersect.

E.g. a newer C++11 dialect has "long long", so if intersected with C99, "long long" is in the dialect. If we intersect C++ older than C++11 with C, or C older than C99 with C++, then we don't have "long long".

(Except as a conforming extension from a compiler, which we could detect with a configure script and use anyway.)

The thing is that the intersection languages are basically fully fledged C: you can easily develop in them and do everything you'd want from C, if you're willing to live without a few frills here and there like C99 designated initializers, and variable length arrays (dropped from being required in C in C11) and whatnot.

If you require complex numbers, that could get hairy.

A long-time C90 programmer will not find anything amiss, though.

</comment><comment><USER24> > The size of the array needs to be known at compile time.

In C99 the example you give does indeed compile and silently get turned into a VLA.

<comment><AUTHOR> It would only be a VLA if defined in a block, I intended the code snippet to be at file-scope, giving the buffer size and array static storage duration.

But it does indeed compile in Clang, and I'm looking into why. I think this line in the C11 standard might be key: "An implementation may accept other forms of constant expressions."

</comment></comment><comment><USER25> The first example doesn't produce undefined behaviour as c++ - it just won't compile - you can't initialise that pointer to a non const int from a const int without doing something naughty like a const_cast.

</comment><comment><USER26> Which is part of the beauty of ObjC

<comment><USER27> As Stroustrup said, "Smalltalk is the best Smalltalk I know of."

</comment></comment><comment><USER28> Designated initializers were added in c++20, I was just looking at a recent change to clang's semantic analysis that warns on the differences between C99 and C++20 designated initializers (Todo: post link when not mobile.)

One recent difference I saw was valid in (via GNU C extension) but invalid in c++:

        struct foo my_foo = ({
          init(&my_foo);
          my_foo;
        });

<comment><USER10> GNU C extensions are well outside the scope of standard C (or C++).

</comment></comment><comment><USER29> That pink background to the left weighs 6 MB. Do you really think it's necessary?

<comment><AUTHOR> I should probably make it smaller! 6MB is pretty indulgent. But I do like how it looks and this is mostly just a fun blog for myself :)

<comment><USER30> I think your blog looks great. The color palette you are using for text is very pleasing.

<comment><AUTHOR> Thank you! ^_^

</comment></comment></comment></comment><comment><AUTHOR> I've made some updates to the blog post based on feedback -- thank you everyone who pointed out mistakes helpfully :)

I've made the updates clear, and linked to the archived version of the original post.

</comment><comment><USER31> Been saying this for years. The weird part is that it's a good thing. C++ redefined auto and it has never been the same.However it's clearly a better language than it was in 2010

</comment><comment><USER25> The first example won't compile in c++ (can't get a ptr to a non const from a const without something naughty like a const_cast) - that's not undefined behaviour is it?

<comment><AUTHOR> you're right, I messed up here. I'm working on some updates to the blog post based on feedback.

</comment></comment><comment><USER32> I never heard anyone say that C++ is a superset of C.

Sure, the first version was a preprocessor on top of C and certainly that is common knowledge. But a superset? Never heard it.

ObjC on the other hand...

<comment><USER33> You evidently haven't been looking at the stackoverflow questions coming in at the [c] and [c++] tags... ;)

A frightening amount of [c][c++] tagging is expunged there every day.

<comment><USER34> Which is often just meaningless pedanticism. There are a _lot_ of questions about C APIs where it's irrelevant whether the answer uses C or C++. The latter might not be an _exact_ superset, but in most cases it's easily close enough.

</comment></comment></comment><comment><USER35> Nit: memmove allows src and dst to overlap while memcpy does not.

<comment><AUTHOR> Ah yes, what I meant was that more optimisations can be made on memmove if we restrict src and dst, as the overlap case no longer needs to be considered.

I've never used restrict, so I could be missing something, but this is what I meant in the blog post by mentioning memmove.

</comment></comment><comment><USER36> I thought this was common knowledge? Pointer aliasing for example

<comment> mark-r Common knowledge is like common sense - not as common as you'd think.

</comment></comment><comment><USER37> Very 1995, no offense.

<comment><USER8> I hope you mean the website theme.

If yes, indeed.

I had to view in Reader mode via Firefox.

I could not read it, I got dizzy by its colors; my sensitive vision couldn't stand it -_-

</comment></comment><comment><USER38> In other news, 1+1=2; and two wrongs don't make a right (but three lefts do.)

<comment><USER39> And now it's time for the show!</comment></comment>


My oldest code still running - <AUTHOR> http://nedbatchelder.com/blog/200811/my_oldest_code_still_running.html <comment><USER2> This is neat/novel.

My oldest known running code is about 6 years old. A ticket system I wrote as a stop-gap solution for an ISP until they could "find something better" has been running since 2002. In that time, it's handled over 100,000 cases, provisioned thousands of IP addresses (based on order details finds the best subnet out of a /19), and handled various scheduler tasks (via group and personal cals).

A few thousand lines of perl on a decent server can quite amaze you at times :)</comment>


Show HN: Django Front End Validators – form input validation using transpiled JS - <AUTHOR> https://github.com/johnfraney/django-front-end-validators <comment><AUTHOR> Hello! This is a little plugin I threw together after wondering how I might be able to use Transcrypt[1] alongside Django. It's in its early stages (no tests) and has a limited feature set (no class-based validator support; only functions), but I think it's a neat proof-of-concept for a useful application of Python-to-JS transpiling.

Let me know what you think, and I'll try to keep an eye out today so I can respond.

[1] [http://www.transcrypt.org/](http://www.transcrypt.org/)</comment>


Using email aliasing to detect hacks and protect your privacy - <AUTHOR> https://jonpurdy.com/2020/06/using-email-aliasing-to-detect-hacks-and-protect-your-privacy/ <comment><USER2> The number of times I have to tell people that '+service' isn't enough would boggle your mind.

Regexing that away is a trivial task for spammers.

<comment><AUTHOR> And it's easier to delete aliases than create and maintain blocking rules.</comment></comment>


Nice Proof of a Geometric Progression Sum - <AUTHOR> http://sputsoft.com/archives/25 <comment><USER2> For this proof to be complete, it needs to be shown that the trapezoid sequence fills ABC triangle in its entirety. I.e. that for every point between A and C there is a trapezoid in the sequence that covers it. Not hard to do by any means, but the resulting proof is not going to be purely visual anymore.

<comment><USER3> Why is this completely necessary? What would be an acceptable proof to you of this statement?

</comment></comment><comment><USER4> Neat illustration, but I'd present the proof to kids in the usual manner:

(1 - r)(1 + r + r^2 + ... + r^n) = 1 - r^(n + 1), because all other terms cancel out.

If |r| < 1, the right part tends to 1, QED.

<comment><USER5> I can never be quite sure that I'm remembering the proper closed form expression, so I always rederive it in a way that's basically what you have here, but a little less dense:

Call the sum of the terms Sn, though we don't know what it is.

Sn = 1 + r +r^2 + . . . + r^n

Multiply each side by r

(Sn)(r) = r + r^2 + . . . + r^(n+1)

Subtract the former from the latter

Sn - (Sn)(r) = 1 - r^(n+1)

Sn(1 - r) = 1 - r^(n+1)

Sn = (1 - r^(n+1)) / (1 - r)

And there we have the closed form expression for Sn. As n goes to infinity, it approaches 1 / (1-r)

<comment><USER6> This is the correct way to prove the summation. Although, I would point out that for r > 1, it's probably better to phrase it as ( r^(n+1) - 1)/(r-1). However, it's important to note that this is only true from a series starting from zero. For a series starting from m it is:

      (r^(n+1)-r^m)/(r-1)

Which is trivially deducible from your method or the parent's method. For some reason I tend to dislike geometric proofs. This is probably because I find it very easy to make proof fallacies visually, more so than symbolically. However, this geometric proof is also less useful than the symbolic because it is much harder to use it to prove the summation at values smaller than infinity, whereas the symbolic works just as well for n.

</comment></comment></comment><comment><USER7> I find this kind of post on HN very enjoyable. Thanks for sharing.

</comment><comment><USER8> Is this the reason it is referred to as a Geometric progression?

<comment><USER3> Sort of. The way I was taught, a progression is called arithmetic because each term is the arithmetic mean of its predecessor and successor, i.e. if A comes before a term X and B comes after a term X in an arithmetic sequence, then X = (A+B)/2. Similarly, a geometric progression uses the geometric mean, i.e. X = (AB)^(1/2).</comment></comment>


Just how do The Nordics consistently produce so many great startups? - <AUTHOR> http://www.thenordicweb.com/2014/03/27/just-how-do-the-nordics-consistently-produce-so-many-great-startups/

<comment><USER2> Says the Nordics?</comment>


Forth in Lisp - <AUTHOR> https://formlis.wordpress.com/2010/06/30/forth-in-lisp/ <comment><USER2> Two fascinating languages in the same blog post. Excellent reading.</comment>