skysight-inc/HackerNews huggingface dataset:
Hi Guys,

This is the fifth post I wrote about Learning Rust on Medium, https://medium.com/learning-rust. Now you can read the same content via https://learning-rust.github.io as well. In this post, I tried to summarize about,

- Smart Compiler
- Why Compiler?
- Explain Error Codes

- Panicking
- panic!()
- unimplemented!()
- unreachable!()
- assert!(), assert_eq!(), assert_ne!()
- debug_assert!(), debug_assert_eq!(), debug_assert_ne!()

- Option and Result
- Why Option and Result?
- Basic usages of Option
- Basic usages of Result
- is_some(), is_none(), is_ok(), is_err()
- ok(), err() for Result types

- Unwrap and Expect
- unwrap()
- expect()
- unwrap_err() and expect_err() for Result types
- unwrap_or(), unwrap_or_default() and unwrap_or_else()

- Error and None Propagation
- ? Operator
- try!()
- Error propagation from main()

- Combinators
- What is a combinator?
- or() and and()
- or_else()
- and_then()
- filter()
- map() and map_err()
- map_or() and map_or_else()
- ok_or() and ok_or_else()
- as_ref() and as_mut()

- Custom Error Types
- Error trait
- From trait

> I am a Sri Lankan🇱🇰 Web Developer who works in Vietnam🇻🇳. I am not a native English speaker and I am just practicing Rust in my very little leisure time, while learning more about Golang, Devops and so much in the workplace.
So, if you found any mistake or something I need to be changed, even a spelling or a grammar mistake, please let me know.

⭐ Hire me! - https://github.com/dumindu/hire-me/blob/master/resume_dumind...

⭐ Buy me a coffee! - https://www.buymeacoffee.com/dumindu

⭐ Contribute! - http://learning-rust.github.io

Thanks
Any self-respecting and experienced developer who is worth his salt writes his code towards the standards and not toward a browser. If one needs to adjust his code because it doesn't work in a particular browser, then he's adjusting for the browser, not the standard.
Does everything have to be done by the American version of something before it's legitimate?
>The whole situation seems like a melt-down ready to happen.

How will it melt down, won't they just become infirm or die?
There doesn't tend to be that much support for older compilers in the Rust community (upgrading is so easy...). So I'd expect pretty much every crate to upgrade over the next year or so.
$10,000 Fellowships for women working on open source
I assumed this was a deliberate joke about how there's always someone coming to r/rust to post about Rust the game!
This might seem silly but I'm struggling to get into rust because the vscode plugin for it is sometimes too buggy (but the progress on it is awesome and devs deserve a round of applause). I use vscode for 4 or 5 other languages every week and don't want to maintain multiple text editors/IDEs.

What do people usually do in these cases? Surely I'm not alone.
Notice of data breach at Teachable (formerly Fedora)
I just received this email (to an address I'd used to sign up to a course on https://bitfountain.teachable.com/):

Dear <chaghalibaghali>,

We are writing to inform you of a suspected data breach involving accounts created between September 17, 2013 and November 21, 2015. We have reason to suspect that personal information related to accounts on Bitfountain (joined 2014-08-19) may have been compromised. This includes the email addresses and passwords associated with the school's Teachable (formerly Fedora) account.

As a precaution we are enforcing password resets for potentially affected users.

You can reset your password here: https://sso.teachable.com/secure/teachable_accounts/password/new

If you happen to use this password with any other service, we highly recommend updating your password there as well.

We apologize for the inconvenience, and thank you for your understanding in helping us keep Teachable safe.

Team Teachable
The other thing is the difference between a metric and US ton is only 10%. So you don't lose any sense of scale if you confuse the two.
I think you're missing the point: it is a ban.

When poliicians pass laws though, there are often unintended consequences. Good politicians will intentionally create loopholes out of humility, realizing that they don't understand the entire issue and how it will affect everyone.

If the loopholes are too big, then thr policy will be ineffective and they will either need to tighten the loophole later, or scrap the whole policy as unworkable.

Do you think the ban is ineffective? Are there hordes of unhappy German citizens drawing 60% of their salary because they are unable to find better work without violating the non-compete? And tons of greedy companies making zillions of euros by paying people to not work?
Will Steam's Hardcore Gamers Try Playing Sansar Now That It's in the Store?
This summary of facts seems quite useless, presented as it is by county.

My guess is that it's by county because this is 2018. The full census is done every ten years. More granular information will come after the next full census.
Australia Encrypted Messaging Bill to Pass After Labor Strikes Deal with Govt
isn't this a little demanding and entitled? for example, the submitter of this post to hacker news may not be the creator of the language and repository. so the creator is off just having some fun creating a language, with more than minimal documentation, and uploads it to github to track changes and generally make it public. then someone thinks it's interesting and posts it here, and the top comment is someone with too aggressive of a tone, in my opinion.
I have some time off soon and there's a project I have planned that will use Scala. What LSP server do you recommend, and are you using it with lsp-mode or with eglot?
Static Linking for C++ with Docker and Alpine Linux
That's a great point! Helping devs get up to speed on the changes is definitely a significant concern for editions, which is, I'm sure, why they put so much effort into creating a dedicated edition guide: https://doc.rust-lang.org/edition-guide/
It's an "intentional radiator", in radio terms.[1]

It's very easy to build something that blithers all over the RF spectrum by connecting a digital signal to an antenna. Hook a square wave to an antenna and you're going to get lots of harmonics. This is generally considered a bad thing.

In the early days of digital electronics, a TRS-80 Model I home computer and a Milton Bradley Big Trak toy car would both crash if near each other. Strict regulation of RF emissions, and good protection on the input side, is why we can have so many digital devices without everything randomly crashing.

[1] https://www.ecfr.gov/cgi-bin/text-idx?SID=56381cb4f24a491e7d...
For roughly the same price there are some DVR boards that could be converted to SDR operation once they're hacked. They already use embedded Linux although no source is provided.

https://www.aliexpress.com/item/OUERTECH-5-in-1-AHD-CVI-TVI-...
I think this is just a matter of semantics. Are you saying we should call a black-car hailing service "ride sharing" simply because you booked it with a smart phone app rather than calling a number? (Remember that Uber didn't even use a novel business relationship; there have long been dispatchers with a single phone number that distribute the rides to multiple independent black car agencies.)

To me, the key change deserving a new term was allowing completely independent, non-professional drivers, and I think Lyft beat Uber to that. (Heck, some purists would say "ride sharing" should be reserved for cases where the driver doesn't make an wages, just reimbursement for costs.)
The external situation, and whether you agree or disagree about Iran, has no impact on whether or not it was illegal.

The company traded tech with the US under an agreement not to share said tech with sanctioned countries. They then proceeded in an apparent act of circumventing those trade agreements.

If they didn't like the sanctions against Iran then they shouldn't have been dealing with the US tech for which those sanctions applied in the first place.

Your argument is like saying "it's not theft because the person they were stealing from is a bad person" which isn't how the law works.
Stack Exchange advertises, but, to the best of my knowledge, they don't engage in any tracking-based advertising, so it doesn't really bother me.

I'll even click on those ads if I'm interested (crazy, right?), which is something I scrupulously avoid doing for ads that I suspect are fueled by tracking.
For anything you want other people to use really
> I assume most of the saving is from grid stabilisation, rather than supplying/storing energy but still.

Yes, the entire reported savings was by avoiding building a fast-response generator, which would cost tens of millions to maintain each year.

From the article:

> Has contributed to the removal of the requirement for a 35 MW local Frequency Control Ancillary Service (FCAS), saving nearly $40 million per year in typical annual costs

The article several includes other significant benefits as well that aren't even included in the $40 million.
Software Engineering is already "it's own major", just not one that's offered at very many universities. Well, at least compared to Computer Science anyway. Here's the list (for the US):

https://nces.ed.gov/collegenavigator/?s=all&p=14.0903
Agreed. On a standard 1080px tall monitor, that "Show results" button requires a scroll. I would make the 1,2,3 cards stack so you aren't wasting tons of screen real estate. Also showing the map at the location entry screen invites clicking on the map which doesn't seem supported.

Otherwise, a cool project! Hopefully it motivates someone to think about their travels and its impact on the environment.
Market Moves Suggest a Recession Is Unavoidable
What are the restrictions? Are you going to filter some words? Sex? Violence? Nazism?

What is the cost model?

DO you have some free samples?

(Also, if we can't try it, this is more an AskHN than a ShowHN https://news.ycombinator.com/showhn.html)
Libre RISC-V M-Class – Comments on Recent Phoronix Articles
Hum, have not tried that but I guess the robotic part and the computer vision would be pretty standard, so it would be feasible.

PS:They even have robots playing real Pong! https://www.youtube.com/watch?v=tIIJME8-au8
Check out Ontario from the map linked a few times in this thread.

https://www.electricitymap.org/?page=country&solar=false&rem...
Why investing in any company? Because you expect them to use your money to increase its total earnings so they'll gladly pay back (on dividends or stock evaluation) more than you paid to them.
> My car is almost four years old and its battery has lost about 1% capacity. These things don’t wear out that quickly.

Probably because Tesla undersells their batteries. During hurricanes or other disasters Tesla routinely unlocks the software limit, allowing customers more range (https://www.teslarati.com/tesla-unlocks-full-battery-capacit...).

It's the same with HDDs and SSDs, which always carry a decent safety margin to account for media wear.
Would You Go to China on Business Now?
> I am asking, where was the criticism early on? Why was Facebook a darling of the media for so long, before it all changed?

I don't think there is a big grand plan behind the arc in the coverage.

In the early days of these companies, the iconoclast story was simply easier to write.

Also, you have to know how journalists work. Outside of opinion pieces and editorials, a journalist needs preferably two sources to make a claim in a news piece.

In the early days, there simply were fewer critics of facebook or Uber, and certainly the critics were less organized, so they didn't get much coverage.

But, I bet if you look back to the first days of facebook, that you will find some negative coverage, but at that time it would have appeared speculative, and would have been a minority voice.

Also, it's right there in the word: "news". Somebody getting rich off a new idea is news. Just like cavemen would have considered it news that you can eat the orange berries if you cook them first.

Novel risks are also a staple of news. So perhaps the arc went from 'Man gets rich with crazy new idea', to 'People using new thing face a novel risk' (surveillance, loss of privacy).
Having the same content is not the same as being identical verbatim.
Sure, this strategy may work in China but Australia is a Western nation where freedom is taken seriously.

That’s the carefully cultivated reality distortion field at work.

It may look that way from the outside, but it’s a tightly controlled, aging and fearful society. Anyone who steps out of line is dealt with harshly and swiftly. The government may loosen the leash on those who align with their political philosophy (so figures who vilify vulnerable groups are given a bit of freedom under the current government) but the jackboot of the state isn’t far away.

Re your edit: there is compulsory voting, so the people obviously like it that way.
not opportunity cost, real dollar loss to inflation. the opportunity cost is even greater.

also I don't know why you are talking to me about 5%. $250k is not 5% of $8mm.
They state in the license that :

"You may opt-out of many of these scenarios, but not all, as described in the product documentation."

So it seems that not everything can be disabled in the settings ?

Maybe in practice they're not collecting too much sensitive data, but they could just distribute the FLOSS binary with a "Do you want to send telemetry data to Microsoft -Yes ? -No ?" at 1st lunch and if we say no then we have the guarantee nothing will be ever sent to them.

As far as I now this is what is done in Atom and I find it more clear and honest than a special license where "you can opt out but we still send data anyway".

I'm sure there no necessarily evil intentions, but still there this feeling that for once Microsoft is doing a great & successful Open Source software, they must find a way to put their own terms on it and collect user data.
IMO that's not an abuse of monopoly thing at all. It's not as if removing auto-play audio will push users towards some Google-only product, if anything it would mean fewer users choosing Chrome.
Boy you weren't kidding.
<some-sort-of-hash-looking-thing> is ZBase32(SHA1(localPart)) and the standard is described here: https://wiki.gnupg.org/WKD

If one controls a domain, has HTTPS set up and uses PGP this is the easiest and most secure way to host a key (`gpg --list-keys --with-wkd $KEY` shows the hash value).

Enigmail, Mailpile, Mailvelope will automatically discover the key when composing an e-mail. ProtonMail is also working on integration of WKD with their web mail.
> This is a fantastic demonstration of why i exclusively use git from a command prompt -- i know what will happen and nobody's going to reinvent terms to put on buttons that just confuse me.

This many times. I'll open SourceTree to view a large set of diffs or changes, but still drop back to the CLI to push/pull/rebase/commit/stash/etc... I know what git will do in those cases, and am a little wary of git UIs.
Amazon’s Alexa begins crowdsourcing answers to common questions
The raw materials are certainly valuable enough to be worth recycling, assuming it's not terribly hard to separate them back out from each other.

But suppose we never figure out a good way to recycle these batteries, and we just have to throw them all in a landfill and keep making new ones. Is that actually so terrible? There's nothing toxic in a typical li-ion battery, so basically we just have inert materials that were taken from the ground being put back in the ground. Mining for nickel/cobalt/lithium is not great for the environment, but the effect is pretty localized, so a "disposable battery future" is probably still highly preferable over the fossil fuel status quo where the entire planet is fucked.
Whilst this basically declares the Browser wars over and crystalizes Chromium as the Web's browser engine it's reassuring it's in the hands of the company with infinite resources, talent and a vested interest in seeing the web platform succeed with Google benefiting when more people spend more time on the Web (essentially the business case in starting Chrome to push the web forward, quicker). The only rendering engine that stands a chance at competing against Chrome is Safari/WebKit (thanks to iOS) and Apple would rather see native iOS Apps succeed to re-enforce their walled garden they have complete control over.

So whilst it's a dark day for browser engine diversity, I don't see it as a blow against the Web overall (i.e. as a popular platform to develop for) as Google/Chrome is the driving force behind making Chromium more powerful to close the experience vs native Apps with initiatives like PWAs of which a side-effect is we'll be able to use new APIs sooner and increase web developer velocity by having 1 less browser engine we need to test against.

A lot of people see browser wars as a gauge for the health of the Web but I consider the biggest threat to the "open web" is native mobile Apps which needs to become more capable in order to be able to deliver the same integrated experiences. In that light I don't see the competition of more browser engines making the Web better. Chrome wasn't created in reaction to competition, it was created because there was none left with MS leaving IE6 (and the main interface into the Web) to wither and die. IMO competing browser engines are holding the Web back with not being able to use new APIs as they're available, needing to cater for the lowest common denominator and having to test and support against a matrix of different browser engines and versions.

It would be a different story if I thought Google would pull back investment in Chrome after they achieve total dominance, but I don't see that, their current strategy is winning where they benefit in a faster, stronger more popular Web and have been lifting the state of the art browser development since Chrome/V8's inception. Of course we now have to worry about Google thwarting the direction of Chromium to their benefit to the detriment of their users, the best way to minimize that is to have multiple collaborators committing to the Chromium project like MS Announces suggests they're doing. IMO it would be in Firefox's best interest to also switch to and collaborate on Chromium as well. Their market share is fading into irrelevance and after Edge/Chromium I see less developers investing their time to test on FF. I believe their efforts would be best spent on innovating on the browser's UI and function as I don't see how maintaining an alternative browser engine is a competitive advantage, IMO it's one of the reasons for their decline in market share. They should still be able to achieve their objectives the same way Vivaldi and Brave are doing with their added privacy protections in their Blink forks.
Why get hung up on one tool? Just write Rust code as if it were plain text. It's a statically typed language, so the compiler will check your code before running it, and your can run rust fmt to fix formatting.

Maybe one day you can shun the darkness and embrace emacs ;) all your problems disappear on that day
You can use the Intellij plugin, which fares a little bit better in some cases, but also struggles with some scenarios.

All in all IDE support is a work-in-progress for Rust. It's definitely a lot better than 2 years ago, but still has a long way to go.

It's currently maybe the only thing which isn't that great regarding tooling in Rust. Other features, like cargo and crates.io, feel however miles ahead of C++.
I'm pretty sure that as far as lineage goes, Chrome was actually born more FOSS (KHtml) than Firefox was (Netscape). Firefox is certainly more FOSS in spirit now than Chrome has ever been, but Mozilla is certainly not immune from the kinds of shenanigans possible for any open source project that is entirely controlled by a single large organization.
It is now legally impossible for data to be private or secure. Your product is now dead by law.
Broadly speaking, yes they do. It is faster in the vast majority of cases, and non-techie friends of mine speak enthusiastically about the lightning bolt icon. Of course, they don't understand the implications of it.
Only certain models are software limited, and the 85 isn’t one of those. They actually substantially overstated the capacity: the 85 means 85kWh, but the actual usable capacity is only about 77.5kWh. (https://electrek.co/2016/12/14/tesla-battery-capacity/)
The U.S. has a history of regime change and subversive actions in every country that does not completely open its markets to it. Whatever you want to call it, it often punishes such countries by imposing sanctions, backing coups etc. because as the world's sole superpower it knows it can do so.

When a significantly more dominant part uses the power it knows it has over other parties to try to get its way, it is indeed buying, or any other synonym describing the same principle you may want to use.

Attempting to impose much greater intricacies to every single issue is rarely the right call.
I agree that most crates will upgrade, but there are some very prominent crates which maintain compatibility with old rust versions. An example is the regex crate which works on rust 1.20+.
I just converted one smaller crate and it was only about 5 minutes of work with cargo fix --edition. Especially because it does not matter that all the dependencies are still in Rust 2015.

Besides NLL, I really like the changes in the module system. Having to use extern crate was a drag, so it's nice that that isn't necessary anymore. Importing macros with use is both nicer and more intuitive than macro_use.

Very well done Rust team!
Top 5 Effective SEO Techniques That Work in 2018
Me too, the Spacemacs layers are really nice actually. Java and Scala ain't gonna keep me away from dired, macros, magit, org, nor my favorite shortcuts :D

Speaking of, I had a Spark lab for school and it was too powerful for my machine, so I ssh'ed into the school's computer and ran a spark-shell from there, in an emacs split. Then with a macro, it was easy to "send region" or "send buffer" to the ssh'ed spark-shell. I made a quick script for that actually, it was so convenient: https://github.com/tbinetruy/config/blob/master/spacemacs/sp...

And that's why I love my emacs, I can just do stuff like that so easily :D
I'm the same way. Firefox first, then Chrome. If it works on Firefox, it will work on Chrome (and least that has been my experience).
it'd be cool if there was a simple way to create typescript react-native app, similar to create-react-native-app[1] without a dependency on Babel[2]

[1] https://facebook.github.io/react-native/blog/2017/03/13/intr...

[2] https://facebook.github.io/react-native/blog/2018/05/07/usin...
On Linus' Return to Kernel Development
> The 90 minutes capacity at full output is pretty much an inherent property of lithium battery tech, as I understand it.

Even if that is true, that only means you need to expand your battery capacity and split into multiple banks.
There are many who would call unleashing React Native on the ecosystem anything but.

In fact I went to the trouble of writing a whole website on the subject: www.xn--ls8h.st.
A massively important tool I use for learning a language and libraries is autocomplete.

Emacs takes a day to master? Awesome!
I'm very sympathetic to creating a password change API, but having a button that takes me straight there would certainly save my time and make me dread the process a lot less.

Next on that list would be "update my payment methods". Of course websites love complicating our lives by hiding it in multiple different places, so that may be of limited utility.
Apparently https://github.com/.well-known/change-password also works.
I think is more cost efficient and scalable than having an EC2 instance being created and destroyed every time you run a test.