Why I Love Balanced - <AUTHOR> http://whit537.org/2012/12/why-i-love-balanced.html

<comment><USER2> Shameless plug for my friends: I got an advanced copy of some chapters from Traction Book (<http://tractionbook.com/>) which is where I read about the traction vertical 'Engineering as Marketing'. I think this is an awesome example of that.

I started using Balanced today, everyone is incredibly helpful in their IRC channel, and integration is a breeze. It's a solid service.

What's worth noting about Balanced, you can use them solely for payouts, while continuing to use some other gateway for processing. <https://balancedpayments.com/docs/overview#id2>

<comment><AUTHOR> I was wondering where you got that phrase. Too good to be true that you pulled it out of thin air on the spot. Sounds like Balanced should be a case study in your friends' book. ;)

</comment></comment><comment><USER3> If anyone's interested in contributing, one of the next things we've got lined up for Gittip is integrating an ORM (It looks like we're going with SqlAlchemy).

Join the discussion at <https://github.com/whit537/www.gittip.com/issues/129>

</comment><comment><USER4> They're Stripe for marketplaces, and they're great. (we've used them since Sept at <https://crunchbutton.com>)

Question though: why doesn't Stripe support marketplaces?

<comment><AUTHOR> Marketplaces are higher risk and don't fit the agreements that Stripe has with their bank partners. Deets:

<https://github.com/whit537/www.gittip.com/issues/67>

</comment></comment><comment><USER5> I've found that balanced is the best and easiest service to get payments to our clients at a very rapid pace, with no non-sense. Their support team is excellent as well!

</comment><comment><USER6> Having used Balanced for a couple months, I can attest to this, they are a fantastic bunch providing support wherever, whenever and in whatever way they can.

</comment><comment><USER7> We use Balanced as well, having migrated from PoundPay. Everyone in their team is attentive and pro-active. Support is fantastic.

</comment><comment><USER8> I love the look of this ( <https://www.balancedpayments.com/> ), is it just US only and requires US bank accounts?

I have customers and sellers in the UK and would love to be able to offer an escrow service and payment solution for them.

<comment><USER8> I'll reply to my own post as I've asked in the freenode #balanced room:

> 23:05 <mjallday> buro9: Balanced can debit cards from pretty much anywhere > in the world. Payouts currently require a US bank account

> 23:05 <mjallday> buro9: you can subscribe to > <https://github.com/balanced/balanced-api/issues/23> to get updates when > make we progress on the international payouts

</comment></comment><comment><USER9> One thing I'm a bit confused about is the assertion that Stripe doesn't support marketplaces. However, it would seem like it's more accurate to say that Stripe does support "Collecting Fees" via Stripe Connect:

<https://stripe.com/docs/connect/collecting-fees>

This might not be the full backend integration that some services require, but it does cover a lot of use cases and works in a growing list of countries outside of the US.

It also seems likely that Stripe could launch an ACH payout service of their own.

<comment><USER10> Stripe does support marketplaces (<https://stripe.com/connect>), but with a somewhat different model.

Stripe Connect works by having each of your users connect their existing Stripe accounts to your application, or having them create a new one on the spot. It allows you to distance yourself from the flow of funds: the money will automatically route to your users' bank accounts (you can take a cut of it, if you want) and you don't have to worry about any chargeback/fraud liability.

This obviously doesn't cover all cases — for example, if you want to manage the flow of money manually, or you want to escrow funds.

(Disclaimer: I work on Connect at Stripe.)

<comment><AUTHOR> Thanks, amfeng. Does the chargeback liability hit end merchants, or is that absorbed by Stripe? With Balanced, Gittip is responsible for it, and can choose whether to pass that along.

<comment><USER10> It hits the end merchants, since they're technically the merchant who is charging the credit card.

In cases where the marketplace wants to act purely as a platform (and not be involved in with the money in any way), this is perfect. You're exactly right that Stripe Connect isn't for the use case where you'd want to shield your users from that, though. (:

<comment><AUTHOR> Word. I've added an update to the blog post with a link to Stripe Connect. :)

<comment><USER10> Oh, thanks! You definitely didn't have to do that, but we appreciate the mention. (:

</comment></comment></comment></comment></comment></comment><comment><USER11> Did you look at Wepay or authorize.net? They both seem like they do money in and out as well. I'd love to see a neutral party summarize the field for payment processing as it's quite hard to see what the differences are without doing some digging.

<comment><AUTHOR> WePay: <https://github.com/whit537/www.gittip.com/issues/69>

Authorize.net is pretty old-school, aren't they? I think of them as complicated credit card payments. Do they also do payouts?

</comment></comment><comment><USER12> Balanced rocks. JW was super helpful and they are willing to work with us to fit our needs. Looking forward to launching with them....

</comment><comment><USER13> I agree, Balanced is a great service. Thank you!</comment>


Ask HN: Any resources on how to build a community online? - <AUTHOR> <comment><USER2> Interested in this.</comment>


Sniper attack on Utah substation highlights grid vulnerability - <AUTHOR> http://www.utilitydive.com/news/sniper-attack-on-utah-substation-highlights-grid-vulnerability/428202/ <comment><USER2> It will never be economically feasible to secure the grid from physical attack.

It is too expensive to bury the distribution network, and while isolated attacks like this are extremely unfortunate, the reality is that they are infrequent enough that physically securing the equipment will cost more than the economic losses to the energy company.

The state of industrial security is laughable, and electronic attacks are much easier to accomplish than physical attacks, simply because you can target geographically distributed locations simultaneously.

It's unfortunate that someone thought it was fun to shoot up some transformers, but just look at the article: up to $1 million in costs for the operator in this incident, versus an estimate of hundreds of billions in damages due to a cyber attack.

<comment><USER3> Preventative measures may be costly, but maybe we should have something like shotspotter + video drones deployed so that these people can at least be caught and hopefully it will act as a deterrent.

<comment><USER4> That would be ineffective for a number of reasons - chief among them being that shotspotter is largely ineffective, and that substations are often located in rural areas where gunshots are both common and expected occurrences.

<comment><USER3> I had a little bit of a google for shotspotter effectiveness info.

It seems like it has a false positive problem (which you allude to) and a response time problem.

The first problem seems almost irrelevant if the response cost is low (because you have drones), the latter problem may be more of an issue. Recent drones can get 45 mph, so depending on what kind of range you expect snipers to have, it's probably possible to have a ring of them around the area such that their 2 min range only just overlaps and be able to cover ~3-4 miles around an installation.

Is 2 minutes too slow of a response time for these facilities? I don't know.

Rural areas will be much easier to secure than urban areas though.

</comment></comment></comment></comment><comment><USER5> Direct link to the Energy Wire article which this post is largely based on:

[http://www.eenews.net/stories/1060043920](http://www.eenews.net/stories/1060043920)

</comment><comment><USER6> Here is a simpler attack vector.

Steal a garbage truck, ram a substation.

You can't protect the grid form physical attacks.

<comment><USER7> Actually a truck ramming would cause much less damage to most substations. Usually they have decent fences and a bunch of steel and concrete structures around the transformers which would make ramming pretty difficult.

The shooting attacks were so destructive because punching holes in transformers allowed coolant to leak out, forcing those transformers to shut down. Repairing such damage is a lengthy and expensive process. Substation transformers are large, heavy, and complex; you can't fix the damage just by slapping on a quick patch. And buying a replacement takes months.

<comment><USER4> A quick look through Google Maps leads me to believe that this is most likely the substation where it happened: [https://www.google.com/maps/place/Page,+firstname.lastname@example.com...](https://www.google.com/maps/place/Page,+firstname.lastname@example.com,-112.0661026,438m/data=!3m1!1e3!4m5!3m4!1s0x8734135bfdcd758f:0x6e982f5153384e39!8m2!3d36.9147222!4d-111.4558333?hl=en)

There's no perimeter security there to speak of - just a chain-link fence, and no bollards or anything else to keep someone from driving over it.

There are plenty of attack vectors available for this sort of thing, though. I'm not sure it's even possible to effectively protect something like this.</comment></comment></comment>


Real Time Bidding (RTB) – Demand Side Platform Framework - vanilla-rtb https://github.com/venediktov/vanilla-rtb <comment> vanilla-rtb We have released small under 10K lines of code framework. [https://github.com/venediktov/vanilla- rtb](https://github.com/venediktov/vanilla-rtb) The bidder can process up to 50K QPS while matching on every impression. The examples are automatically built with 1700-1800 campaigns and regenerated with every build and the framework is shipped with small UI widget to view campaigns loaded in the bidder. We use shared memory for storing campaigns and allow multiple bidders paring with nginx for load balancing. The docker image is also built and released automatically from github on every official release. Please support our project!</comment>


Hacker News comments are assigned reading for UC Berkeley CS 10 course - <AUTHOR> http://cs10.org/sp18/ <comment><USER2> In particular, the syllabus links to this HN discussion:

 _Algorithms Are Great and All, but They Can Also Ruin Lives (wired.com)_

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

<comment><USER3> ...that is thankfully three years ago, modest enough (compared to what HN has become in recent years _sigh_ ) and no longer open for further comments.

</comment></comment><comment><USER4> I am thoroughly impressed by the number of people involved in this class. I teach a class at a large European research university and it is the professor plus two TAs, nobody else. That is a difference tuition and funding can make. You get what you pay for.

Edit: forgot to mention that there are 460 students registered for the exam. They wonder why we don't have them write papers...

<comment><USER5> What's ironic about your statement is that there are many in the US that clamor for "free" university education for "everyone" \-- citing how it's done in Europe. However, like everything, there are tradeoffs and unintended consequences that go beyond the simplistic thoughts of the politically and economically naïve. The University of California system, in my amateur opinion is extremely good. In fact, the state university systems in most US states are all of pretty good quality. I spent a bit of time living near the University of Avignon (France) and, compared to a typical American community college, I was very suprised at how deficient the French university was. In France, university is "free" but as you said, you get what you pay for. Of course, there are exceptional European universities and there are terrible American universities, but overall, American university systems seem to be much better than the equivalent in "free" university countries.

<comment><USER6> > Of course, there are exceptional European universities and there are > terrible American universities, but overall, American university systems > seem to be much better than the equivalent in "free" university countries.

I personally think that the typical German university is better than the typical US one, but it is a very different system: In Germany you are very much on your own when you are studying. This teaches you a lot about self- discipline, which employers love. On the other hand, if you are a person who needs a lot of handholding, German universities are probably not for you. In my opinion being able to study mostly for free is more than worth the lack of handholding, but as I said: This system is not for everybody.

<comment><USER7> I agree 100%. The US university system treats the students as kindergarten.

</comment></comment></comment></comment><comment><USER8> I always like to joke to people that if they want to learn something, anything at all, all they have to do is take a free class at YouTube university. I'll have to add HN comments to my joke!

(And yes, as a former tech worker with no professional coding experience can vouch I've learned a TON here.)

<comment><USER9> Just make sure you don't mix them up, I don't wish learning from YouTube comments even on my worst enemies.

<comment><USER10> That'd have become the latest version Microsoft Tay!

</comment></comment></comment><comment><USER11> This getting upvoted and rising toward the top of HN reminds me of Hesse writing about academic/intellectual elites and winning the Nobel prize for it. Magister Ludi wasn't his best novel, but it was the one that felt most self- gratifying for the voting body.

Humans tend to regard as 'right'/of-value/impressive that which validates their own perspective, sometimes shamelessly.

<comment><USER12> You are right, yet, I believe there's a lot of wisdom and value in the comments here. Quite often I tend to read the commends before the articles/posts themselves.

<comment><USER13> reminds me of this: [http://danluu.com/hn-comments/](http://danluu.com/hn- comments/)

</comment></comment></comment><comment><USER14> Making HN comments assigned reading without also adding [http://n-gate.com](http://n-gate.com) would sound quite irresponsible, if it were more than the one specific thread the article refers to.

<comment><USER15> is it me or others also see that CAPTCHA and "loading" thing on main page?

<comment><USER16> You know there are people who don't like the HN hivemind, yes? "Hacker News is an echo chamber focusing on computer posturing and self-aggrandizement." and "Hacker News is the Slashdot for the smug classes".

For the most part I think they are right, though obviously I am still here. I think that says something about me.

Some of these people do things like do a redirect based on the referer.

Try following one of the links at [https://news.ycombinator.com/from?site=jwz.org](https://news.ycombinator.com/from?site=jwz.org) . Done because "Hacker News is a steaming cesspool and I don't have time or desire to deal with their bandwidth demands, so I just block them."

<comment><USER17> It's weird to call Hacker News a hive mind when all I see is people arguing with each other.

<comment><USER16> Have you ever watched US political shows? It seems like the inside-the-Beltway hivemind loves to argue with each other too.

Never known people who like to argue with each other for the sake of argument?

</comment></comment></comment></comment></comment><comment><USER18> They are using snap! an apparent derivative of Scratch. Seriously?

The course sounds exactly like my six graders middle school course. Well the six graders did read Hacker News, so I guess that is what makes it a College Level EE course (eyes roll).

<comment><USER19> Scratch is a good introduction to programming concepts, regardless of age. How fortunate for your sixth grader; if such courses were common in earlier grades, a course like this could start with more challenging material.

This is not an EE class, it's an intro CS class, one that's not for those with prior knowledge who know they'll choose CS as a major. This kind of course can get new people interested, those who didn't think they'd like or could do CS. Even if they don't major in it, by taking this one course, they know more about an important part of what makes our world work.

CS50 at Harvard College [0] is also a very large, popular course that gets more people interested in CS as a major but is also useful to those who don't take another class. It also starts with Scratch though it switches to other languages very quickly and appears more challenging overall than this course.

[0] [https://cs50.harvard.edu](https://cs50.harvard.edu)

</comment></comment><comment><USER20> This is an added responsibility for us. We will make it worth.</comment>


Hacking language learning - <AUTHOR> http://blog.rinik.net/hacking-language <comment><USER2> The idea of 'hacking language learning' puts me in mind of Kato Lomb [1] a hungarian linguist who worked for the UN as one of the world's first simultaneous translators and knew around a dozen languages fluently. One of the most interesting things about her is that she didn't take any interest in languages before her adult life had begun; before that she was a physicist.

In one of her books she advocates reading foreign language texts without using a dictionary at all, just trying to figure out the meaning from what little you already know (of course you have to be at a certain level to even try this, although you'd be surprised how little you need to know to start.)

This process forces you to think logically about who words are constructed, and to use your own current knowledge to e figure out meanings of words. For example, you might already know a small part of a compound word in german, and use this along with the context of the sentence to figure out the meaning of the whole word.

[1]<http://en.wikipedia.org/wiki/Kat%C3%B3_Lomb>

</comment><comment><USER3> This seems to be based on the idea that learning a language is mostly about learning words. That has not been my experience as a language learner. (As disclosed in my HN user profile, I am a native speaker of English who learned Chinese to the proficiency that I was able to work as a translator and as a Chinese-English interpreter.)

Words in one language do not have a one-to-one mapping with words in any other language. As the saying goes, "The map is not the territory." Each language has its own peculiarities of dividing up the Universe of experience into words, and especially each language has a different approach to arranging words into sentences and longer utterances with grammar and syntax.

I know of a Web page that lists some language-learning resources, especially useful for the case of learning one Indo-European language (like the blog post author's native langauge) while already knowing another.

<http://learninfreedom.org/languagebooks.html>

The best single bit of advice I can give for someone who wants to learn a language thoroughly is to do a lot of what the blog post author is doing: reading in the target language. The section "Suggestions for Study" in the front matter of John DeFrancis's book Beginning Chinese Reader, Part I, which I first used to learn Chinese back in 1975 has great advice: "Fluency in reading can only be achieved by extensive practice on all the interrelated aspects of the reading process. To accomplish this we must READ, READ, READ" (capitalization as in original).

祝你好運。(Good luck!)

AFTER EDIT: The comment posted by _feda_ before this comment was posted that it is important to read target language text for meaning beyond one's current reading level, using context rather than a dictionary to figure things out, is correct. That has much to do with improving understanding of the second language, just grappling with the language directly a lot, not always relying on bilingual reference books.

<comment><USER4> > This seems to be based on the idea that learning a language is mostly about > learning words. That has not been my experience as a language learner.

My experience, as a native English speaker who has learned German as an adult, is that different stages in language learning benefit from different kinds of study. There have been times where memorizing grammar rules have been enormously helpful to me, others where reading a lot is what I needed, and still others where holes in my vocabulary were holding me back. After a certain level of proficiency, the only new thing you encounter in the language is unknown words and phrases, so it makes sense to focus on learning them.

> Words in one language do not have a one-to-one mapping with words in any > other language.

As you have mainly studied non-European languages, this might be more true in your experience than for those who are focusing on European languages. There are certainly many words that map one-to-one between German and English, especially in common usage.

What I like about the author's technique is that it seems like a smart way of priming the pump for real and detailed learning: when he encounters a new word in the text, he has a general idea of what it means from the definition, but he can sharpen that meaning with the particulars of the context where he finds it. Otherwise, he might get only the vaguest sense of what a word means from context, or have no clue at all.

<comment><USER5> I want to add that vocab would have helped me much more than the hours and hours of French verb drills I did in high school and university. I wish they would thrown so much vocab at you in school that retaining even 70-80% would be considered top notch.

</comment></comment></comment><comment><USER6> In a similar vein, here's a Python script which someone wrote that does a word analysis on Chinese texts:

[http://www.chinese-forums.com/index.php?/topic/34994-new- too...](http://www.chinese-forums.com/index.php?/topic/34994-new-tool-for- vocabulary-extraction/)

It provides a breakdown of the words in the text, and even does lookups to supply definitions and frequency in an external corpus, so you know how common that word is in a broad range of texts. You can then take the output and paste it into a spreadsheet program, and from there import it into an SRS flashcard system like Anki for long-term memorization. Kind of a DIY solution but it's pretty handy for serious learners of Chinese.

It's also available as a web frontend here, under the "Wordlist" link:

<http://www.zhtoolkit.com/posts/tools/>

With full end-to-end integration with Anki and a mobile e-reader, it would be very powerful indeed.

(I should also mention that the mobile app Pleco has a reader component that allows directly adding words from an ebook into its flashcard system, along with high-quality definitions. Pleco's probably the fullest Chinese-learning suite available on smartphones.)

edit: For mouseover definitions of Chinese and Japanese words in your browser, there's the extremely useful Perapera-kun Firefox addon. It allows you to add words to a wordlist which you can then export as a text file along with definitions. Tada, more cards for your Anki deck.

<comment><USER7> Anki is awesome! I've been using it to learn Finnish (<http://ankisrs.net/>)

<comment><USER5> I like Anki as well but I had several issues running it on android. I got through the issues on my phone but I still can't use it on my Nexus 7. Also, I was looking at German vocab and some of the translations were in Spanish, while all the rest were English.

</comment></comment></comment><comment><USER8> This reminds me of an excellent article on Wired called 'Want to Remember Everything You'll Ever Learn? Surrender to This Algorithm' [1] in which Piotr Wozniak describes how he used the spacing effect to learn English, among other things.

In 1985 (!) he wrote SuperMemo, a piece of software that utilized this spacing effect:

"SuperMemo is based on the insight that there is an ideal moment to practice what you've learned. Practice too soon and you waste your time. Practice too late and you've forgotten the material and have to relearn it. The right time to practice is just at the moment you're about to forget. Unfortunately, this moment is different for every person and each bit of information."

The full article is a bit long but if you're interested in this stuff, it's well worth the read.

SuperMemo seems to have fallen behind as far as software goes, but there are great alternatives, like Anki [2] that use the same method.

1\. [http://www.wired.com/medtech/health/magazine/16-05/ff_woznia...](http://www.wired.com/medtech/health/magazine/16-05/ff_wozniak?currentPage=all)

2\. <http://ankisrs.net/>

<comment><USER9> I'm using Anki to learn Japanese, but since I started from scratch, I'm learning the words here first[0]. Start with a word from there, use an English-<Language> dictionary[1] and Google Translate together to disambiguate, then search on Google Images in <Language> to find an image of the term. Searching in the target language double checks that you have the correct term. After that, just practice in Anki.

The method I described is from a Lifehacker post earlier this year[2].

As an aside, Anki is excellent. In the past few months version 2.0, a new version deserving of a major version number, was released for Windows/Mac/Linux, and just recently for iOS. The corresponding Android version is a little behind but I imagine it will be out soon too.

[0] [http://www.towerofbabelfish.com/Tower_of_Babelfish/Base_Voca...](http://www.towerofbabelfish.com/Tower_of_Babelfish/Base_Vocabulary_List.html) [1] <http://www.csse.monash.edu.au/~jwb/cgi-bin/wwwjdic.cgi> [2] [http://lifehacker.com/5903288/i-learned-to-speak-four- langua...](http://lifehacker.com/5903288/i-learned-to-speak-four-languages-in- a-few-years-heres-how)

</comment></comment><comment><USER10> Neat! I sympathize, trying to read books in Russian. Tracking progress with individual words reminds me of some of Michael Walmsley's work at the University of Waikato: [http://www.cs.waikato.ac.nz/genquery.php?linklevel=4&lin...](http://www.cs.waikato.ac.nz/genquery.php?linklevel=4&linklist=CS&linkname=PhD_Theses-0&linktype=report&listby=Researcher&lwhere=unique_record_id=156&children=Research)

His software actually picks things for you to read based on words that it knows you still need to learn.

</comment><comment><USER11> Once you have a database of words that you know, you could use it to help select a next book to read (a book that does not have too large percentage of words that you don't know). Several times I bought a book only to find out that the language is way to advanced for my level. Very frustrating.

</comment><comment><USER12> Not to steal your thunder, but this is a pretty amazing story that may inspire your own tool creation:

[http://www.salon.com/2012/10/27/whats_the_secret_to_learning...](http://www.salon.com/2012/10/27/whats_the_secret_to_learning_a_second_lanuage/)

<comment><USER13> Spaced repetition seems pretty powerful. It seems like doing this while reading a book might be more repetitive than spaced repetition techniques recommend, but on the other hand you also have ongoing repetition of some of the more common words as you read the chapter. Thanks for the interesting article!

<comment><USER14> I think Spaced Repetition is precisely a tool, in the context of languages, for the words you don't get enough or constant enough contact through reading, writing, listening and speaking. For words that you do, you don't really need it since you'll memorize it from actual use/need.

</comment></comment></comment><comment><USER15> Very cool!

At <https://github.com/darius/spaced-out> I tried to do something vaguely similar: from an aligned parallel corpus, automatically make a prioritized spaced-repetition deck for language learning. (I think I used Europarl.) So you get examples of the words in context, plus they're sorted with the most frequent ones first.

(There's also an SM2-based flashcard reviewer in Python. It's all very crude; I decided I didn't want to learn Swedish enough.)

</comment><comment><USER16> This is being done, not with books, but with news stories, which for me is one step up from books-- I'm reading all this stuff anyways, may as well do it in Spanish... Only in Spanish-English right now, but the in-line translation is pretty good: <http://www.nulu.com/>

<comment><USER17> Thanks for the link, it's great! I see they are using the spacing algo in their flashcards...

</comment></comment><comment><USER2> I think the idea of the database that knows what words you know is kind of a fascinating idea in a way, in that it goes beyond personal information into personal knowledge, a digital reflection of your actual understanding which corrects itself continuously to reflect it more accurately.

Anyway, if this was a service I could actually use online, I most definitely would, and I might even pay for it (as I once did with smart.fm which became paid for a year or two ago). I'm currently learning german quite intensively, and anything that makes this highly laborious process (that of cramming new knowledge into my mind and trying to make it stick) more efficient is extremely useful to any language learner.

</comment><comment><USER18> Quick tip for anyone learning foreign words on memrise or anywhere you need to type with a different keyboard layout for OSX.

System Preferences -> Language and Text -> Input Sources. Select the languages you want in the list. click "Keyboard Shortcuts" and enable whatever keyboard shortcut you desire to swap layouts.

ex: now I can press CMD+Space to switch keyboard layouts between Russian, French and Spanish.

</comment><comment><USER19> memrise.com does this. at least for mandarin chinese. i've been enjoying it.

<comment><AUTHOR> Looks cool. I think also Quizlet.com deserves to be mentioned here -- helped me so much during high school.

<comment><USER20> Quizlet sucks. It's all fun and games until some assholes come along and start tagging their worthless sets with tags you're following. "The Trolls of Quizlet", really? This crap doesn't happen on Memrise, and the Memrise interface is not set up to make it terribly rewarding for people to try it.

</comment></comment></comment><comment><USER21> I would highly recommend [http://www.silinternational.com/lingualinks/LANGUAGELEARNING...](http://www.silinternational.com/lingualinks/LANGUAGELEARNING/BooksBackInPrint/SuccessWithForeignLanguages/success.pdf)

Interviews with successful language learners gives a great set of language learning techniques and methodologies.

</comment><comment><USER22> > The code is a mess, so I'll keep it to myself for now

:(.

It's not always about looking at code; some people could benefit from OP's solution right now.

<comment><USER23> I've been developing a similar system for accelerating my Japanese study, and I haven't been able to release it yet either. It has nothing to do with the quality of the code, it's that right now it's designed specifically for myself. It practically hardcodes my username and other details like that. Maybe other programmers could use it, but preparing such a package for general consumption takes lots more time and energy.

<comment><USER24> Same situation here as well. I started with eventual distribution in mind (yet another Japanese study app) but it's still a long way away from being what I'd consider releasable. Too many features coded in that I forced myself to try out and will eventually be modified, reconfigured, or whatever. I'll run out of excuses soon enough ;)

</comment></comment></comment><comment><USER25> Off-topic: It's interesting that word 'countenance' appeared at the top in his screenshoot. That's the only word I still remember from my word-memorization spree while prepping for the GRE.

For those wondering: It mean's face (as in a person's face or like the 'face' in facebook. Countenance-book anybody? :)

</comment><comment><USER26> I tried something similar with the text of classic video games (I speak English, learning French), since things like Zelda often use archaic terms. It worked quite well, even if you can only get text from other games in the series rather than the one you're playing.

</comment><comment><USER27> Nice work. For almost all learning, there is a better solution out there . . . it just takes individuals to go after a creative solution using their brain . . . which is really language/dialect independent! Bravo.

</comment><comment><USER28> nice app! I built myself a little cli program that would do some of the same things a while back, this definately has a much prettier interface though :) Also this has a learning adventure which is a good additional touch, I just used a feedback loop on my previous choices and what I had previously marked as "unsure".

I usually ended up being too lazy though to actually use it. I know exactly what your talking about though with conversation vs. literary I use german every day at work but still don't get half of what Thomas Mann or Goethe or trying to say.

<comment><USER29> It is funny that many people seem to have this idea at the same time. Must be that the time has come for this.

A while back I wrote a bunch of python scripts that do the same thing for subtitles for myself.

Regarding your problem with Goethe and Mann: Maybe you shouldn't try to start with "the masters". I read books in various languages and have come to the conclusion that after a hard day at work I just can't read a nobel prize winner in a foreign language. What I can read, however, is a crime novel, or something funny (Maybe even a comic book).

Here is a book that I would recommend for you to read if you want to read an important, well-known but easy german novel:

"Der Schatz im Silbersee" by Karl May: This is an escapist western written in the 19th century and actually one of the most read German novels of all times. Rest assured that every famous German you know (including Einstein and the bad one with the ridiculous beard) have read this in their youth.

<comment><USER28> you hit it right on the money with the nobel prize winners :) I have to (guiltily) admit reading a krimi or bestseller is fun, you know the words, you're done after a couple train rides, it was usually exiting - of course then you forget it, because the contents where basically nothing. I have liked max frisch though and Kafka is also surprisingly easy when you consider people study him, also thanks for karl may suggestion I'll put it on my to read list. The thing is sometimes you want something to think about and I know there's many great german authors and I'd like to be able to "get" them like I do Borges :)

</comment></comment></comment><comment><USER30> Here's a tool that I wrote for practising French verb conjugation that also uses Mac OS X speech synthesis. <https://github.com/euoia/ReVerb>

</comment><comment><USER31> This is great, because it integrates learning with something that you want to do anyway (reading), thus making it easier to come up with the motivation for learning.

</comment><comment><USER32> Just a quick hint for anyone learning French: The Kindle reader comes with an inbuilt French dictionary. Hovering over a word will show its definition (in French).

</comment><comment><USER33> Are there libraries that can turn voice into phonemes? It would be cool if I had to say a phrase and the computer scored me on how close I got to it.

</comment><comment> stream-media Inspired by your idea, I created this web page: <http://vocabulate.me>

<comment><USER34> Incredible. Thank you so much!

</comment></comment><comment><USER35> Any thoughts on non-spaced language such as Japanese (which I am learning) and Chinese (which I speak)?

</comment><comment><USER36> Brilliant! I believe this is how Rosetta Stone is teaching as well.

<comment><USER37> No, but this is how Rosetta _should_ be teaching language. Instead they hawk their "immersive" language learning. Immersion is great for children, but adults learn differently (I say this as someone who learned a foreign language as a child and two as an adult). It's not sexy, and it's not pretty, but to build a foundation for learning a language as an adult, rote memorization of vocabulary is by far the most effective route _in the beginning_. Once you have a good base (say 500 of the most common words), you can start learning grammar and then, slowly, starting to practice speaking, reading and writing. But continuing to build up a vocabulary is vital to continuing to learn the language. Once you reach about 1000 of the most common words, things will start falling into place _if_ you have adequate exposure to the language. In my opinion, it's only at this point that Rosetta Stone becomes worth using, and then only if you don't have access to friends, family, or tv channels in the language you're learning.

<comment><USER5> does anyone know the most common 500 words? Is it language neutral or does it vary from language to language? I definitely agree that learning the 500 or so most common words is a great start - even if some of the words are conjugated verbs and you don't have the background to understand the conjugation.

<comment><USER38> It varies from language to language, but those word lists are all around. <https://en.wiktionary.org/wiki/Wiktionary:Frequency_lists> is a good place to start.

I am not a believer in rote word memorization, but rather putting each word in a sentence and using the sentence as the memorization route. Rote memorization stores the word in a different part of the brain than the language center, and using the sentence as the unit of flash card seems to override this.

I still see use for flash cards to re-trigger words in memory, but not for actually learning new words. I can't tell you how much I struggled to de-link certain words because I "memorized" them at the same time and so mixed up the meanings of the two words.

</comment></comment></comment></comment><comment><USER39> You can use the Collins API instead of that crappy synthesizer! ;)

</comment><comment><USER40> well done, man, well done. It warms my heart to see people who understood what computers are for.

</comment><comment><USER41> it's a wonderfull idea to memorise some importants words</comment>


Thieves boosting signal from key fobs inside homes to steal vehicles - <AUTHOR> https://www.cbc.ca/news/canada/toronto/car-thefts-rising-1.4930890 <comment><USER2> I imagine improvements to the key fob could be made that would require a mechanical coupling with the car in order to start it. That would circumvent this attack.

<comment><USER3> I'm not sure if this is a joke about old keys being better, but I'd argue you could have the benefits of new keys and old keys combined if you just made it so that new keys _have_ to be inserted into some compartment inside of cars, where they are authenticated by those cars. You can imagine a fob with a USB that has a different authentication code than the wireless one it sends out, and unless the USB is plugged into the car, you can only start the car up but you can't drive it.

In addition, you can make it so that the car doesn't unlock due to proximity with the fob, but rather, it only unlocks if you push the unlock button on the fob.

<comment><USER4> I'm not sure why we can't have some sort of challenge response protocol to prevent MITM...

<comment><USER5> The key fob does use challenge-response, the thief just uses a glorified range-extender to get the car started with the key normally out of range. The car stays on once started. There's no MITM involved.

<comment><USER6> Huh? The diagram in the article shows two men ("Thief 1", "Thief 2") between the fob and the car, with arrows showing communications going from fob to thief to car. According to the first sentence of the Wikipedia MITM article, that's the very definition.

<comment><USER7> the relay is of the radio signal, there is no inspection or tampering of the relayed messages. basically, the extender tricks the car into thinking the fob is closer than it is.

<comment><USER8> In other words, there's identification, there's authentication, but authorization is replaced by "if in range, then authorized." Two out of three is still game over.

</comment></comment></comment></comment></comment></comment></comment><comment><USER9> This happened to a family member of mine, here in Toronto. Lost their gorgeous M5.

Their kid normally wakes up in the middle of the night, except this time, he freaked right out like he was scared. They were wondering what was going on with him, when one of the parents heard the M5 turn on (it's pretty distinct). "That's my car!" His wife said, "Naw, you're crazy, no way."

Sure enough, enough, key fob attack and theft. Caught on their video cameras. Filed the police report, claimed insurance, cried internally about the loss of a gorgeous vehicle. In all seriousness though, it's just a car, so no big deal, but nothing will fix the violation you feel, and the fact that you were being targeted.

If I were the insurance companies, I'd be putting pressure on the car companies, but hey, maybe it's just the cost of doing business for them. Better to pay out for a vehicle theft, vs. actual injuries from a collision. That's probably why there's little incentive to fix it, especially if fixing it makes your product less convenient.

<comment><USER10> What strange is, I can see unlocking the car and even starting it with this attack -- but do the cars not continually (or at least every minute or two) revalidate the presence of the key?

Once they got very far away from the house, the car should shut off. Or so I would think.

<comment><USER11> So if you accidentally drop your keys while entering, or your passenger departs with your key, the car should lock itself 2 minutes later while you are driving?

<comment><USER12> Yeah, sounds reasonable to me. Either of those situations should already be solved. My car at least yells if the key goes away when the car is on and if you're dumb enough to keep driving and that's kinda on you.

<comment><USER13> No, it is not reasonable for the car to stop suddenly without the key. Even if it stops by going into an emergency limp mode, this could seriously endanger the occupants by leaving them in a dangerous traffic situation, a dangerous location, or with other issues.

This is why every car company has examined it and chosen to not do it.

This feature actually saved huge inconvenience for us once. While visiting the other coast for wife's mom in the hospital, we used one of her parent's cars to drive to the airport with her brother to drive it back. We get out at the airport, get luggage, hugs, bye, head into terminal -- with the key still in her purse. Car running, doesn't notify him until too late to chase. If it stopped after 2min, he'd be stuck somewhere outside an airport 100mi away from anyone he knew. Instead, he just drove it home, got & used the other key for a few days, and we mailed back the first key when we arrived.

Things that seem reasonable at first....

<comment><USER14> As someone who turns their car on by inserting their key into a slot in it, all this seems quite convoluted just for the convenience of pushing a button. I don't understand why the car would even let you accelerate at all if the key isn't inside the actual car (even if it's just in your pocket, if you insist on pressing a button).

<comment><USER13> The key has to be in it to start it, but once started, the key can go away and it will continue to run.

(& yes, I still start my car with a key that is inserted, and mine also has a clutch & manual H-pattern 5-speed)

<comment><USER14> Sorry, perhaps I should've put my commment higher up. I was referring to the general problem of the article, which I understood to be enabled (among other things) by the possibility of unlocking, turning on, and driving a car without the car having a means of verifying the key is inside/very close to the car.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER15> Nothing new, has been going on for a while now. Market is already providing your own "cage of Faraday[0]" for your fob. [0][https://www.amazon.com/faraday-cage-key- fob/s?page=1&rh=i%3A...](https://www.amazon.com/faraday-cage-key- fob/s?page=1&rh=i%3Aaps%2Ck%3Afaraday%20cage%20key%20fob)

<comment><USER16> Since most car manufacturers seem to be vulnerable (to my knowledge), I assume all or most buy the same COTS keyfob + electronic lock product. Much like Takata airbags or Bosch ECUs.

Being a step away from the problem probably helps keep that OEM manufacturer from strapping in and solving it. They don't feel any pain from it.

<comment><USER17> The vulnerability is pretty much inherent to the idea. No amount of encryption can protect you from a relay attack. The only foolproof mitigation is to enforce a short round trip time to ensure the fob is actually close to the car, but with the short distances involved that means the fob has to generate and transmit a response within a few nanoseconds.

<comment><USER18> I disagree. A physical switch on the key itself which opened a circuit to the decryption key would mean the key would need to physically be in the possession of the driver.

<comment><USER19> This eliminates all of the convenience of keyless entry/start.

<comment><USER18> I suspect many people will happily give up such a convenience if it means they won't have their cars stolen so easily.

<comment><USER20> You suspect that the average person is going to give up a convenience that benefits them multiple times daily to ever so slightly mitigate the risk of an incredibly rare problem? I do not agree.

<comment><USER21> i'm a very technical person and I also wouldn't give up the convenience of keyless entry. that is what insurance is for.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER22> > Key fobs are constantly broadcasting a signal that communicates with a > specific vehicle, he said, and when it comes into a close enough range, the > vehicle will open and start.

Why is it transmitting without the user pressing a button? Is that a feature? As you walk up to the car it automatically starts like magic? I'm not familiar with these newer cars.

<comment><USER23> With my car, as soon as you touch the door handle (with the keyfob in your pocket, or within a couple feet of the door) it unlocks, and to start the car you push a button. It doesn't work from even 4' away (eg, someone else touches the door handle while you're close) and it doesn't work from the other side (eg, when the keyfob close enough to driver's side door, the passenger side won't unlock).

The really nice feature is when you walk away (a few seconds after you're out of range), the doors automatically lock. However, the downside of this feature is my wife's car does not have it -- and so at least half of the time when I am driving it I forget and leave it unlocked in parking lots.

<comment><USER24> >so at least half of the time when I am driving it I forget and leave it unlocked in parking lots

This is the problem with a lot of the newer tech in cars like backup alarms. You become used to various features in your own car and when you rent a car you need to consciously remember that the vehicle doesn't have $FEATURE. Effectively, cars are becoming a lot less standardized. A car I rented a few weeks ago beeped at me a couple times and it took a while before I realized it was the lane departure warning triggering on a couple turns.

<comment><USER25> It's a problem going the other way too. I drive an older vehicle and rented a car. I nearly had to ask the attendant how to start the car. Then I was entirely surprised when I stopped at a light and the engine turned off.

<comment><USER24> And don't get me started on center consoles. At least my last rental supported CarPlay and I was pleased to discover that it pretty much just worked. Other systems I've had seemed far more intent on downloading all my contacts rather than doing something useful from an entertainment or navigation perspective.

<comment><USER26> Heh, that reminds me of _my_ last rental, where, not half an hour off the lot, the touchscreen sound/navigation/??? system got stuck in some sort of reboot loop. Cursory online research suggested the problem was a known firmware bug that was unfixable without a service appointment.

A reasonable person would probably have turned around and exchanged the car with the rental company at this point.

I am not a reasonable person.

Instead, I headed directly to a truck stop and purchased a heavy-duty power inverter, dropped the back seat, and crammed my portable PA speaker into the trunk, connected to the car's trunk-mounted battery through the inverter and to my iPhone through a shielded audio cable run from the trunk to the front seat.

The result sounded far better than it should have, and what it lacked in convenience (I had to pop the trunk to power it down) and channel separation (one speaker = mono), it more than made up for in dB SPL.

(for the record, I've also repaired eBay purchases that arrived in worse-than- advertised condition rather than returning them, for no other reason than that learning how to fix things is more fun than going through the hassle of returning them)

<comment><USER27> This is also the kind of 'hacker' mindset that got me interested into technology. But instead of fixing to see how it worked, I broke it apart to see how it did.

</comment></comment></comment></comment></comment></comment></comment><comment><USER28> Ford is really bad with this. The Fiesta and Focus, you can program a new key with the ODB2 port in under 60 seconds. Blast the key with a booster, get inside the car, plug your laptop in, program a new key, drive off. People have had to lock the ODB2 port, disable it, put keys into aluminum foil (my method). [https://www.youtube.com/watch?v=dvmSOEKfkug](https://www.youtube.com/watch?v=dvmSOEKfkug)

</comment><comment><USER29> This seems like as good a HN thread as any to ask this, since I've been looking into it recently. What are some cars to look into if I'm interested in the following things? Or what are some cars that I should specifically avoid?

\- Low appeal to thieves interested in stealing the vehicle itself, due to the hardware (locks and whatever else) being exceptionally difficult to deal with

\- Some sort of secure/hidden compartment for concealing valuables (I know, I know, don't keep anything valuable in your car, but let's say it will still be more secure than keeping it outside of the car)

\- Following up to that, an especially secure trunk (if such a thing exists)

\- A wagon or smaller, so no minivans/crossovers or anything bigger

\- Under $25k used for something recent, maintainable (was looking at Audis but I don't want to risk maintenance issues), and with low mileage, which puts Teslas out of the picture (sadly)

<comment><USER30> Get a manual, nobody steals a manual.

<comment><USER31> See: [https://imgur.com/gallery/snhvea1](https://imgur.com/gallery/snhvea1)

</comment></comment></comment><comment><USER32> I think convenience here is fundamentally at odds with security.

The convenience here is that the system _requires no confirmation from the driver,_ no physical interaction with buttons, handles, keys, etc. The driver just opens the door and starts the engine. This allows for a trivial remote sniff-and-replay attack, not unlike copying a key temporarily.

I bet not having a lock on the door would be even more convenient. But for some reason it's not widely practiced.

<comment><USER33> Leaving a car unlocked is sometimes safer, while not foolproof it reduces the likelihood of getting your window smashed to loot the vehicle for valuables (and non valuable items)

<comment><USER34> Leaving car doors unlocked is SOP in urban corridors with high incidence of petty theft. I.e. don't leave attractive objects in your vehicle, and leave it unlocked so that would-be thieves can learn it themselves w/o smashing a window. The problem here being able to start the engine wirelessly, not simply getting in.

<comment><USER35> My neighborhood just got hit with a string of robberies from inside cars. Not one window was smashed; the thieves can simply use a thin piece of metal slid between the window and door to enter vehicles about as quick as someone with a key, just like what police do if you locked your key inside the car.

</comment></comment></comment></comment><comment><USER36> > _Key fobs are constantly broadcasting a signal that communicates with a > specific vehicle, he said, and when it comes into a close enough range, the > vehicle will open and start._

It's a poor design for the system to take any access-escalating action without an explicit command from the user that initiates a secured transaction that is resistant to MITM.

It's poor design to assume that the range is based on raw signal strength; it should use round-trip-time measurements (for packets exchanged with MITM resistance).

<comment><USER37> RTT measurements can give proof-of-proximity (due to relavity), but I think they're quite hard to get right (you'd need nanosecond RTT resolution in a cheap keyfob) -- I think analog signal repeaters would't add significant RTT. It's not impossible though, GPS decoders work in a similar fashion.

Requiring user iniciation seems like the adequate solution here...

<comment><USER38> The Apple Watch manages to handle RTT measurements to prevent exactly this attack.

You don't need complexity in the FOB; the car starts the clock, sends the signal, measures the time taken to reply. If it exceeds some threshold ignore the response.

There is no way to spoof this if the request/response itself is using proper cryptography.

</comment></comment></comment><comment><USER39> My car was recently "broken into", it's a Mercedes C400, i thought it to be fairly secure so my assumption has been that i forgot to lock the car. I just double checked, and the car has an "auto-lock" feature and it is already turned on...so...did this happen to me?

I just want an off switch in my fob, so i can disable it at night. More fancy solutions would be a motion sensor on the fob to only power it when had recently moved, or for retrofits, this technology in a battery?

<comment><USER40> You can turn off keyless-go by double pressing the close button. The LED on the key will light up (short - long) as a confirmation.

<comment><USER39> Ha, that's an interesting one! I am sure I've done that by accident given how unreliable i find pulling the handle to be.

<comment><USER40> Just to clarify: Double pressing the close button on the key, not the one on the door handle. I was a bit unclear, sorry!

And it's only disabled temporarily. As soon as you press any button on the key again (e.g. open the car), keyless-go will be activated again.

<comment><USER39> Hmm ok yeah, that wouldn't be it then. However it's still good to know! I'd love to be able to just disable the remote without taking out the battery or storing it in some faraday cage.

</comment></comment></comment></comment></comment><comment><USER41> I wonder how hard it is to measure the delay between challenge and response... Any distance extension would increase the signal flight time that should be measurable.

<comment><USER42> This has been proposed in the past yet I haven't seen any implementation of it - perhaps because of increased power consumption of accurate timing components needed? Any EEs able to comment on this?

</comment></comment><comment><USER43> There is a lot of great technical discussions here of ways to possibly solve the issue. The real problem points back to the lackluster security the auto industry is used to. Only if some sort of accountability or software security testing requirements are enforced this will get fixed.

They have to have a mandatory recall if your Audi accelerates quickly by itself (that was in the early 80's i think), but no recall for a possible vulnerability in a jeep where someone can hack into the machine and control the acceleration (and other items).

This would be worse with centrally controlled autonomous vehicles, they are always sending and receiving data. Image the firmware on your car not being updated after 2 years and being stuck with the still open vulnerabilities.

<comment><USER35> IIRC for the Audi 5000s it was because the brake and throttle were too close and your foot or floormat frequently got stuck on top of the throttle. People would shift out of park not realizing this and go flying, not any kind of software or security issue.

<comment><USER43> You are correct it was mechanical, I was just drawing a connection that mandatory recalls exist for issues the auto industry is use to (I.E. mechanical), but nothing exists to track and force updates to software issues (like a CVE database, Perhaps something does exist and I have not heard of it) and have not in the past been the best at software assurance.

It is kind of an apples to oranges comparison, but nonetheless it gets the point across.

<comment><USER35> They don't issue recalls for every mechanical catastrophe, and they don't ignore them for software issues either. When an automaker has a problem that merits a recall, it's because very careful accounting has indicated it is cheaper to roll out the recall than it would be to litigate or settle in court, not from any kind of good faith action. Even Audi would have never had that recall if only just a handful of people were injured or died from the issue.

</comment></comment></comment></comment><comment><USER44> "Greater Toronto Area" = GTA.

What a coincidence.

Jokes aside, this is bound to happen.

It's disturbing that a vulnerability like this isn't caught as a show-stopper before the technology is sold to consumers.

<comment><USER45> It's not a show-stopper. It's not even close to being a show-stopper any more than having keys is also a vulnerability to having a car stolen.

All you have to do is keep the fob inside a shielded case at home and you're fine.

<comment><USER46> > All you have to do is keep the fob inside a shielded case at home and you're > fine.

Because we all have Faraday cages in our homes, and I'm sure the salesman who sold the car also made the customer aware of this vulnerability. /sarcasm.

<comment><USER47> >Because we all have Faraday cages in our homes

Yes, most people who own cars new enough to have this vulnerability own microwave ovens.

<comment><USER35> So you have to pull your keys out of your pocket and stick them in your microwave every time you enter your house just to have the convenience of not needing to take them out of your pocket when you approach the car.

<comment><USER47> I know it's not a practical workaround. I'm just pointing out that most people do technically have a Faraday cage in their homes.

<comment><USER44> It's gonna be fun when somebody forgets to take the fob out of the microwave before warming their coffee.

</comment></comment></comment></comment></comment></comment></comment><comment><USER48> Tesla recently added a good workaround. They added a setting where you can turn auto unlock or auto start off, which blocks this remote access hack. You have to use your key fob button at least once, say to unlock the car and then it just works wirelessly without further action.

My car is unlocked at night but in my garage. If they got in my garage somehow and had the signal repeater they couldn't drive off unless I pushed the keyfob button. In the morning I just have to push it once to go. You can also en/disable auto door lock if you walk away.

Of course a general solution that blocks signal repeaters would be best. Tesla has so many fun tweaks it's truly the programmer's car.

<comment><USER49> A motion sensor in the remote would also work and maintain the convenience.

<comment><USER48> Unless it was in my pocket and I was walking around with it, which I do every day.

<comment><USER50> Why would a motion sensor not sense motion in your pocket?

<comment><USER51> I think they're saying the thieves could still execute the signal boosting attack while the car owner is walking around with their keys.

</comment></comment></comment></comment></comment><comment><USER52> It seems car manufacturers are eager to be "cool" but not thinking about the consequences of their actions

Center "touchscreen" consoles with awful usability, shifters that are not obvious (coupled with people that are too lazy to pull the parking brake) and now this

<comment><USER53> A touchscreen is a terrible interface for anything in a car, since you _must_ look at it to operate it. Tactile dials/knobs you can feel for—and ideally feel different to each other—are the best interface for anything in your car that you want to use while driving.

Voice can be sort of ok, as long as your speech models are locally stored (no internet blackspots), but deny access to those who cannot talk, or for whom you haven't bothered to build a speech model that matches their language/accent.

</comment></comment><comment><USER54> >"The vehicle will continue running in perpetuity until it runs out of gas or until you shut it down," he said.

>"They do that for safety so that if you lose the key fob or if it loses signal the vehicle doesn't shut down while you're driving, but that right there is part of the vulnerability."

Anecdata, a few years ago my wife had a Renault "Megane" that used a sort of "card" that worked with proximity. She opened and started/drove it without ever taking the card out of her bag.

A couple of times I was driving it with her in the passenger seat, we arrived to a shop, she got down in front of the door and went into the shop while I was going to park it when the car some 20-30 mt away "locked itself" (cannot remember if it stopped or just didn't allow more than - say - 5 km per hour) with the display saying it couldn't find the card.

When she changed cars, her new Renault (using the same kind of card, at least visually, but a different car model) had to be inserted in a slot to allow the Start/Run button to operate.

</comment><comment><USER55> This article gets written fairly often:

[https://www.nytimes.com/2015/04/16/style/keeping-your-car- sa...](https://www.nytimes.com/2015/04/16/style/keeping-your-car-safe-from- electronic-thieves.html)

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

[https://abc7news.com/archive/9079852/](https://abc7news.com/archive/9079852/)

[https://www.npr.org/sections/alltechconsidered/2018/02/23/58...](https://www.npr.org/sections/alltechconsidered/2018/02/23/583682220/this- gray-hat-hacker-breaks-into-your-car-to-prove-a-point)

</comment><comment><USER56> Two factor authentication for cars, here we come! Though, searching for this phenomenon shows articles at least 3 years old warning to get Faraday cages or otherwise wrap fobs in aluminum foil.

But do they really transmit all the time, or do they contain accelerometers or something to prevent battery from being wasted?

<comment><USER46> 2FA seems to make sense. Maybe a 4-6 digit pin that would be optional for those in high risk areas/situations.

> But do they really transmit all the time, or do they contain accelerators or > something to prevent battery from being wasted?

I'm curious about this as well. A family member has an older Nissan with a keyless fob and I don't recall them ever having to replace batteries/keyfobs.

<comment><USER57> Some fobs use an inductive coil to recharge a battery within the key while the key is in the ignition.

</comment></comment></comment><comment><USER49> A motion sensor in the remote could mitigate the issue and maintain convenience.

<comment><USER58> How battery intensive are accelerometers? The last fob I had required a battery change once every year or so already, increasing that frequency could be quite annoying. And I'd rather not have yet another device I need to regularly charge.

<comment><USER49> Anecdotaly, I have a remote that lights up everytime it's moved (to assist finding it at night as it's a remote for a bed). I've had it for well over a year and haven't changed the batteries yet. Granted, it runs on three AAA batteries. Not entirely sure what tech it uses, but it's not necessarily a full blown accelerometer.

Edit: some / all of the power drain would be offset because the RF transmitter would be off while the sensor is on.

</comment></comment></comment><comment><USER59> I wonder how difficult it is to add some clock syncing and time-of-flight measurements to ensure a certain distance.

If the speed of light is to fast, maybe using sound could work.

<comment><USER60> Apple claims that they use time-of-flight for their "Unlock with Apple Watch" feature on macOS, so it seems like something that a car maker/supplier could pull off, especially if they're willing to throw dedicated hardware at the problem.

That said, the fob is much more battery-constrained than a watch that you charge on a daily basis.

<comment><USER61> This is such an obvious solution that maybe some patents are the reason it's not implemented by every car manufacturer.

<comment><USER62> Indeed, the last time this attack vector came up on HN, it was pointed out that one company has patented using time of flight to validate keyless entry.

Here's the patent: [https://patents.google.com/patent/US8930045](https://patents.google.com/patent/US8930045)

<comment><USER63> `ping`. They were granted a patent for ping. That seems ridiculous.

<comment><USER62> It also describes RADAR, or even LIDAR for that matter. It doesn't seem like one should be able to patent something that is merely an application of a well known physical principal. Maybe I misunderstand what "novel" means.

</comment></comment></comment></comment></comment></comment><comment><USER64> The car manufacturers are going to need to incorporate a time of flight measurement into the key system. Obviously amplitude can be faked.

<comment><USER65> So the test for amplitude is aided by the fact that the signal strength received at the car increases by a factor of four if the distance is cut in half. Thus, you have a nice margin for setting your threshold.

With measuring the time, however, presuming that radio signal will travel on the order of one foot per nanosecond, you have much less of a threshold tolerance. If the unlock takes place within two feet of the car, that is two nanoseconds. If the key sits 20 feet away, that is a 20-nanosecond one-way travel. So this solution would need to be able to distinguish between a four nanosecond gap (round trip time) and a 40-nanosecond round-trip time.

Add to that the turnaround time in the car CPU which I would imagine to be some number of milliseconds, would 10 ms be reasonable?

Thus, the electronics in the car needs to distinguish between 10ms + 4 ns vs 10ms + 40ms. And given jitter in any modern CPU/memory/OS/electronics device, I would bet that the jitter totally swamps that.

(Keep in mind that this is a BOEC [https://en.wikipedia.org/wiki/Back-of-the- envelope_calculati...](https://en.wikipedia.org/wiki/Back-of-the- envelope_calculation))

</comment></comment><comment><USER66> This is of course not limited to cars or even this type of key fob, but instead, anything that uses transmitter power as a proxy for distance/proximity, and that transmitter power has any chance of being signal boosted within reasonable means.

The only true solution is to stop using transmitter power as a proxy for proximity when houses/etc are not opaque to that signal.

Instead, use something that the house is effectively opaque to for the distance part of it.

IE include an ultrasonic receiver in the keyfob, transmitter in the car and require it output the distance to the car.

(or something, i'm just spitballing)

The problem is almost certainly the power requirement.

</comment><comment><USER67> Looks like we have a new modern interpretation for 'boosting'

[https://www.urbandictionary.com/define.php?term=Boosting%20C...](https://www.urbandictionary.com/define.php?term=Boosting%20Cars)

</comment><comment><USER68> I work at very large OEM. We've run the numbers, and key fob exploits are _extremely_ rare. (most) Modern keys use rolling keys that are verified by the ECU, making cloning (let alone initial pairing) extremely time consuming. However, Keyless-go key fobs _can_ be captured and replayed (not necessarily exploited). 99.99% of the time that cars are stolen (which we find much more common in Europe due to small jurisdictions), someone will break a window, steal your keys, and drive your car away.

(wireless) Key fob capturing and replaying require far more equipment than NFC PVC card (credit card) cloning.

<comment><USER69> Why clone? Why replay? You just need signal boosters so the key and the car think they are next to each other.

<comment><USER68> Following around someone with a 'signal booster' could be very difficult. If you capture and reply, you afford yourself a lot of advantages.

<comment><USER70> it's not difficult when you steal it from their house. which is what happens.

<comment><USER68> See my original comment.

<comment><USER70> ?

Your original comment is that cloning is nearly if not entirely nonexistent. Of course it has advantages. But it's difficult and doesn't happen in the real world. What happens is replaying. Which isn't difficult.

</comment></comment></comment></comment></comment></comment><comment><USER71> Here's some security camera footage of a car in the UK being stolen using a relay attack:

[https://www.youtube.com/watch?v=odG2GX4_cUQ](https://www.youtube.com/watch?v=odG2GX4_cUQ)

</comment><comment><USER72> It's useful to note that less sophisticated methods still work as well.

I used to lease a 2015 Toyota Auris(facelift). One year into the lease someone broke into it smashing the rear-left window and just drove away.

<comment><USER73> Curious how they started it?

<comment><USER74> If it has an immobilizer? You can find immobilizer bypasses on sale online, who knows if they work, or you can create your own and disable it yourself: [https://www.youtube.com/watch?v=ispXq4EMrsY#t=24m45s](https://www.youtube.com/watch?v=ispXq4EMrsY#t=24m45s) [https://github.com/fjvva/ecu-tool/wiki](https://github.com/fjvva/ecu- tool/wiki) (see also [https://ioactive.com/pdfs/IOActive_Adventures_in_Automotive_...](https://ioactive.com/pdfs/IOActive_Adventures_in_Automotive_Networks_and_Control_Units.pdf) and [http://opengarages.org/handbook/ebook/](http://opengarages.org/handbook/ebook/))

So besides relaying the key, you can just hack via the CAN bus. There's also a trick to use a second ECU to bypass the immobilizer, but that's probably too time consuming.

Many manufacturers (inc. Toyota) also allow bypassing immobilizers and other features using TechStream and a maintenance tool. If they claim you have to buy a new ECU if you lose your master keys, call bullshit: [https://attachments.priuschat.com/attachment- files/2015/10/9...](https://attachments.priuschat.com/attachment- files/2015/10/96213_T-SB-0043-14.pdf)

</comment></comment></comment><comment><USER75> I already put mine in a metalic bag for the night, or just press the "lock" button twice which disables the keyless entry system entirely.

Manufacturers really need to hurry up and implement more accurate timing detection in the keys - it should be absolutely trivial to detect how far away the key is based on the response time, but for some reason manufacturers don't do this yet.

Edit: I also know people who take the exact opposite approach with their expensive vehicles - they leave the key in plain sight near the front door, so if someone wants to steal the car using this method they can do so without entering the house or if they do break in they will(hopefully) take the key and leave, without threatening and possibly harming their family. I'm not sure which way is better - preventing the thief from stealing your vehicle and risk that they will then decide to break in and get the key from you, or let them steal it and just deal with insurance later.

<comment><USER76> « _it should be absolutely trivial to detect how far away the key is based on the response time_ »

It's not possible. A keyfob has a relatively slow R/F communication channel, less than 1 Mbit/s (at best) because it's constrained by power. Thus the "length" of a bit transmitted over the air is 300 meters or more. The receiver needs to demodulate "300 meters" of R/F signal to recover a single bit. A difference of +/\- 10 meters when these thieves boost the signal across your front yard is therefore indistinguishable from R/F noise and not demodulable by the receiver. You can visualize this as a 300 meter bit that has a noisy beginning and a noisy end.

That's why the distance-bounding techniques (term we use in the field) used by car manufacturers are instead pretty primitive, such as measuring the strength of the R/F signal (which is easily defeated by a proper signal booster.)

<comment><USER77> It is absolutely possible. As I wrote elsewhere in the comments, you need to use radios with timestamping that can measure the distance (10cm accuracy is achievable). See for example Decawave DW1000 radios.

Use those and you can base your distance estimation on time measurement, rather than signal strength. Amplifiers won't help.

<comment><USER76> Nope, DW1000 can't work in an adversarial scenario.

Their ranging algorithm critically depends on the receiver time-stamping the "leading edge" of the first bit of the first byte of the PHY header. This bit is either always 0 or always 1 (it's part of the 802.15.4 data rate field), so an attacker can easily cheat by preemptively sending a 0 or a 1 just before the signal booster can relay the first legitimate bit from the keyfob. This legitimate bit will be received (by the booster) while the preemptive bit is still being transmitted, so the booster can smoothly transition to sending the subsequent legitimate bits, and the receiver will have been completely fooled that the keyfob is nearby.

DW1000 is nice but it only works in scenarios where both transmitters and receivers are being honest to each other.

</comment></comment></comment></comment><comment><USER78> It seems to me like there is often just as much creativity in thievery as there is in entrepreneurship.

<comment><USER79> It _is_ astonishing the lengths some people will go to _not_ earn a honest salary.

<comment><USER35> Everything is risk vs. reward in life.

</comment></comment></comment><comment><USER80> Another commentor describes the key handshake. The car emits a high frequency wake up signal, the key receives the signal and emits a low frequency unlock code. It is hard to restrict the time of the unlock code because it's low frequency limits the accuracy of your clock.

Could you Honeypot the cars wake up signal? If the car detects a delayed broadcast of it's wake up signal it could trigger an alarm or at disable keyless entry. The high frequency signal will have lower tolerances for a timing check.

Or car makers can provide Honeypot keys. If the key receives a wake up signal it can alert the owner and disable keyless entry. The owner would put the Honeypots where they don't want their keys to activate.

<comment><USER81> > Could you Honeypot the cars wake up signal? If the car detects a delayed > broadcast of it's wake up signal it could trigger an alarm or at disable > keyless entry. The high frequency signal will have lower tolerances for a > timing check.

If the repeater is directional / shielded on the side toward the car, I'd think it would be impossible to distinguish echoes of a repeated signal from normal echoes.

</comment></comment><comment><USER82> But people still blindly trust carmakers to make reliable and difficult to hack fully software-based and with always-on internet access self-driving vehicles.

They can't even secure the thing that directly unlocks your car and enables thieves to steal it.

<comment><USER83> It is a legitimate point to a degree, vehicle makers have a long track record of terrible software, and now they want to go headlong into one of the most complicated software projects ever attempted by man.

It will be interesting to see how legal liability shapes up with self-driving.

</comment></comment><comment><USER84> That this vulnerability is being exploited in the wild isn't particularly new news is it? Perhaps it is the fact that I live in the Bay Area but I was walking with a home made Yagi (directional) antenna that I normally keep in the camper for picking up distant WiFi signals and the police noticed enough to stop and ask what was up. It does make me wonder if carrying around and SDR will get you in trouble at some point :-)

</comment><comment><USER85> I believe the issue is that key fobs are too small and underpowered to have any real security.

Everything else in our lives we've automated using our cellphone and apps. So why not cars?

Bring back the old mechanical coupling method, upgraded for better security in close proximity, and provide a long range automation method via app.

Just like your standard light switch. We have the old mechcanical way of using it, and our new radio based way via app.

</comment><comment><USER86> Research in this type of attack was published in 2010 already [1]. A spin-off was created out of it [2] for those interested.

[1] [https://eprint.iacr.org/2010/332.pdf](https://eprint.iacr.org/2010/332.pdf)

[2] [https://www.3db-access.com/](https://www.3db-access.com/)

</comment><comment><USER87> Car makers should use frequency/channel hopping rather than time of flight until doing time of flight gets cheaper. The car and fob would also broadcast on frequencies/channels that are not in the preshared set to detect someone trying to amplify.

The hopping pattern should be derived from a good cryptographic protocol that also contains mutual attestation.

<comment><USER88> How would that affect battery life?

To you and me, changing the batteries in a key fob isn't a big deal. But more than once I've seen people walk into the auto dealer's repair center because their fob stopped working, and all the tech did to repair it is replace the battery.

(If you think that sounds stupid, I work in healthcare, and we have employees who spend a surprising amount of time teaching people how to put AA batteries in their blood pressure and other medical gadgets.)

<comment><USER87> Not much at all. You use the traditional system to wake up the more powerful radio/mcu.

</comment></comment></comment><comment><USER77> A good solution to that problem are UWB radios with timestamping (like the Decawave DW1000), which let you measure the time it takes for the signal to travel. You can then place physical limits on the proximity, rather than assuming that a strong radio signal means proximity.

Coupled with a cryptographic authentication protocol these solve the issue quite nicely.

<comment><USER24> It looks like the chips are about $10 each. That's quantity 1 but it's also just the radio IC. It's not immediately obvious what the power draw would look like in an application like this as the sleep mode draws far less power than when it's operating. There is an open source project based on the chip. [https://github.com/lab11/polypoint](https://github.com/lab11/polypoint)

What I'd really like to be able to do is to wirelessly tether a Tile-like small long battery life device to a band (or watch) I wear with user configurable distance settings but it doesn't look like the tech is quite there today. UWB does seem to be the current approach you'd take though.

</comment></comment><comment><USER89> Wouldn't the technology behind thwarting this essentially be a solution to the man in the middle attack?

<comment><USER90> Yup

<comment><USER70> no. it's a relay attack, not a mitm attack. mitm acts at layer 7, relay at layer 2.

</comment></comment></comment><comment><USER91> I've been surprised that no vendor has put a motion/vibration sensor in their keyfobs. I know they're pretty power constrained in keyfobs, but it seems like a pretty sensible protection to require the fob to be not sitting still on a table to do a proximity-only unlock.

</comment><comment><USER44> Shower thought: make a system where you unlock and start your car using your iPhone's Face ID or Touch ID, and you can drive the car via the phone, like in Golden Eye. That would be really cool. I don't care about security. It just sounds really cool.

</comment><comment><USER92> I'm convinced that time of flight analysis could solve this problem, and many others. If someone could beat that, then they deserve much more than just a new car.

I've currently got a blockchain "proof of proximity" idea on one of my back burners.

</comment><comment><USER93> Really good video of the attack in action here: [https://www.youtube.com/watch?v=bR8RrmEizVg](https://www.youtube.com/watch?v=bR8RrmEizVg)

</comment><comment><USER94> ive tested a couple of things to see if they would block the signal by putting the keys in the container and then standing next to the car and trying to open the door

kids Lunch box would not block, small metal garbage can, would not block, cookie tin would not block. All would block if you lined the edge with aluminum foil before putting the top on.

foil lined Potato chip bag would block.

Wrapping in enough aluminum foil will block the signal

Those faraday bags are convenient, but I park in the garage so Im not that worried. Garage door openers now have lock switches which prevent the door from being opened using any opener.

<comment><USER95> I just read "Garage opener" and automatically I have to think about Samy Kamkar's OpenSesame Hack [0].

Regarding the keyfobs, I've seen demonstrations on video where the RF signal was relayed. I can search for them, but they were in German.

[0]: [https://www.youtube.com/watch?v=iSSRaIU9_Vc](https://www.youtube.com/watch?v=iSSRaIU9_Vc)

</comment></comment><comment><USER96> Both my audi Q5 and my roommate's Q5 mysteriously opened their trunk for a few times when parked close to our home. now I dare not park it very close to our home, assuming the issue is from the key fob.

</comment><comment><USER97> Not to be pedantic, but wait, what about the security by design concept? It is at least astonishing that you implement a functionality without any thought to how to protect it ...

</comment><comment><USER98> I'm honestly more amazed that there is enough of an economy for someone to design such a device and market it (ditto skimmers). I wouldn't even know where to look for such a thing — alibaba?

</comment><comment><USER99> This is ridiculous. I never understood why it's THAT needed for a keyfob to open a car by merely being close to it. Whatever happened to key fobs you had to PRESS to open a car?

<comment><USER100> > I never understood why it's THAT needed for a keyfob to open a car by merely > being close to it.

It's convenience factor that makes a big difference for people that tend to get to their car with full hands.

> Whatever happened to key fobs you had to PRESS to open a car?

They still exist, handsfree entry is an upgrade (or an included feature but only on higher trim levels) on many models.

</comment></comment><comment><USER101> I think it's the fault of the municipal government of Toronto. I mean really, if you nickname your metropolitan area "the GTA", what do you think will happen?!!

</comment><comment><USER102> The article recommends putting your fob upstairs or as far away as possible, but that seems like false security.

What's considered a safe distance? How far away can they pick up the signal?

<comment><USER79> Measure how far away your car unlocks, then keep the keys as far from external walls as that.

But to be honest it's easier to keep them in a metal box that shuts properly. That's what i do (although my fob still needs interaction, so i should be a bit safer, in theory).

Also consider that keyless cars actually still have a way to enter, be it physical or remote: garage-supplied universal keys and software. VWs for example have an old-school keyhole under a thin plastic bit on the door, so that garages can access it when you lose the fob.

<comment><USER103> Thieves are boosting the fob's signal. So it's not practical for car owners to measure a safe distance.

</comment></comment></comment><comment><USER104> IoT security FTW!

Glad I have a key.

Easy fix: a thing called a "button" that you press before it broadcasts the private key. Even better, also broadcast a different key each minute, like GA

<comment><USER105> The S in IoT stands for security.

</comment></comment><comment><USER106> I'm confused. Are there cars where the fob can _automatically_ start the car, without any button presses, _just_ from proximity?

How did they not realize that was a bad idea?

<comment><USER91> Yes, the Tesla Model S and X keyfobs do not require any button presses.

<comment><USER107> Not even without pressing a button on the car to start it?

<comment><USER91> Just the brake pedal.

</comment></comment></comment></comment><comment> gray_-_wolf Well I'm not sure that recommended solutions are better than the one I use. Just turn this feature off and use my car keys as normal (lock/unlock button).

</comment><comment><USER108> My mother in law just got her car stolen 3 days ago in Nice, France, fob thingy as well. Police just called today they found it, apparently car is ok.

</comment><comment><USER109> This is really strange and shallow thinking of some manufacturers.

I have a 2009 car. It'd NOT start if I don't have my key fob inside the car.

<comment><USER110> I'm sure the car in these break-ins are like that too. The remote fob _is_ inside the car, but they have an RF relay outside the car which proxies the keycode to the one inside the car.

</comment></comment><comment><USER111> Why not triangulate the signal?

I don't hear much about the speed of light being used for security, but it's applications are innumerable.

<comment><USER112> The attack uses 2 antennas. One next to the keys and one next to the car. It transmits the signal from both sides. The car thinks the key is inside/near.

Triangulating it won't help. It thinks it's there.

</comment></comment><comment><USER113> Thieves have been using this method in the UK/Europe for a long time now.

</comment><comment><USER114> Why is this still news? Such relay attack has been there for years.

</comment><comment><USER115> Where's the public link to how to hack together one of these?

</comment><comment><USER116> Why are these fobs constantly sending a signal? Just make it so that the holder of the key has to push a button to open/start and this attack becomes much more difficult.

</comment><comment><USER117> Can someone explain to me how keeping your keyfob in a faraday bag is supposed to increase security?

<comment><USER118> From the linked article:

 _Relay thefts_

 _According to Bates, many of these thieves are using a method called "relay theft."_

 _Key fobs are constantly broadcasting a signal that communicates with a specific vehicle, he said, and when it comes into a close enough range, the vehicle will open and start._

 _" The way that the thieves are getting around this is they're essentially amplifying that low power signal coming off of the push start fob," he said._

 _" They will prey upon the general consensus that most people are leaving their key fobs close to the front door of their home and the vehicle will be in the driveway."_

 _The thief will bring a device close to the home 's door, close to where most keys are sitting, to boost the fob's signal._

 _They leave another device near the vehicle, which receives the signal and opens the car._

Storing the keyfob in a faraday bag blogs the signal and prevents the relay attack from working.

<comment><USER117> Have a link? I'm familiar with rolling code systems, but this continuous transmission is new to me

<comment><USER117> I can't find anything on continuous transmission, but it appears most of the keys use an rfid system, where the transmitter is powering the receiver.

</comment></comment></comment></comment><comment><USER119> I'm sure this problem can be solved with blockchains ;)

</comment><comment><USER120> It seems like this is easy to do with cryptography. Sounds like a gross negligence on the car makers part, similar to storing passwords in plain text.

<comment> crooked-v "Easy to do" how? Please give an example, not an analogy.

<comment><USER120> The same way as MFA works. Every time the key generates different token that can't be reused. This renders replay of signal useless.</comment></comment></comment>


Dev Bootcamp Is Dead, but It Didn't Fail - <AUTHOR> https://medium.com/@abinoda/dev-bootcamp-is-dead-but-it-didnt-fail-3a4e456899be <comment><USER2> DBC has, without a question, changed my life. I'm sad to hear that they will no longer be able to do the same for others</comment>


Is CGI Software Poised to Kill Photography? It's Close - <AUTHOR> http://motherboard.vice.com/2012/5/15/is-cgi-software-poised-to-kill-photography-it-s-close--2 <comment><USER2> Sure, renders could make for interesting product shots. But can they compete with a photographers' eye?</comment>


LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU - <AUTHOR> https://github.com/christinaa/LLVM-VideoCore4 <comment><USER2> It bugs me that LLVM targets are not properly 'plug in'.

LLVM backends can be in a plugin, but you have to tell the frontend which target to use (so it can use the correct data-layout etc). Its the frontends that don't support plug-in targets. Clang, for example, hardcodes the supported targets.

A combination of using enums as a 'target triple' and lack of dynamic target registration conspire against easy-to-use out-of-tree targets :(

<comment><USER3> "A combination of using enums as a 'target triple' and lack of dynamic target registration conspire against easy-to-use out-of-tree targets :(

Have you considered this is a deliberate decision, with a goal of having most targets in-tree? :)

<comment><USER4> Why is this beneficial? It means you need to change several repositories to add one target triple. This may be a win in terms of in-tree stability, but it reduces accessibility to everyone else.

<comment><USER5> It is beneficial in that it discourages proprietary backends to LLVM which are not contributed back to LLVM. It is the same benefit GCC enjoys by using GPL.

<comment><USER6> Does Apple have some proprietary backends? I guess they have the resources to maintain such.

<comment><USER4> Yes, they definitely do.

<comment><USER7> Like what, nowadays? I know their ARM64 backend _was_ , but what is now? Do they still maintain forks of them? (With more target data for their SoCs?)

<comment><USER2> Swift is still out-of-tree.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> What can you do with this?

<comment><USER9> To elaborate, I made this to develop an open source VPU side bootloader for Raspberry Pi because I was unhappy with the state of other C compilers targeting VC4 (I explained why in my blog). I haven't had the time to work on my firmware recently due to IRL events so I decided to publish the compiler.

Not publishing any of the firmware work yet since it can't boot ARM yet (but SDRAM init reliably works across all boards). Once I get ARM working to some extent, I'll probably clean the code up and publish it too.

<comment> david-given Thanks for making this work! I'd given up on the LLVM backend completely due to showstopping issues I couldn't resolve, and had assumed it had vanished into the aether. Glad to know you found it useful!

Regarding the boot loader, have you seen my piface boot loader? [http://cowlark.com/piface/](http://cowlark.com/piface/) It sounds like what you have is way more sophisticated, as I never got SDRAM init working properly, but you never know --- there might be something useful there.

I was actually considering having another go at a VC4 compiler, this time with pcc; there's an OS I want to port. I'm really happy to know that I no longer have to!

<comment><USER9> Yeah I looked at it, my firmware mostly just aims at bringing up enough stuff to be able to boot ARM, which is essentially just:

      - Setting up exception vectors and enabling exceptions
      - Reclocking VPU from PLLC
      - UART initialization
      - SDRAM initialization
      - Copying an ARM blinker stub to 0x0
      - ARM power domain initialization
      - PLLB initialization
      - Enabling passthrough mapping for ARM
      - ARM AXI interface initilaization

I'm still trying to figure out what I'm missing in order to get it to work but I suspect it's related to not properly setting up the ARM PLL. I was going to port the RPi clock management driver from Linux but I don't have the time at the moment.

As far as the compiler goes, I think it works reasonably well, though I only tested it by compiling my own code with it, there may be things that cause it to error out (anything that involves the frame pointer like VLAs/some C++ features). Also code quality is not ideal since it still doesn't make use of conditional instructions (aside from conditional branches) and doesn't implement AnalyzeBranch to eliminate redundant branches.

I started cleaning up TableGen to turn multi-instruction asm prints into glue DAG in SelDAGtoDAG but I still have to do it for like 4 instructions, which is pretty much a requirement to have MC code emission.

<comment> david-given It's been too long and I've forgotten too much about how LLVM works. The gcc port I linked to, BTW, claims to have VC4 binutils.

Random question: how did you do 64 bit arithmetic? I couldn't find any kind of add-with-carry or subtract-with-carry instruction. I was semi-resigning myself to have to do a compare-and-test as well as the add, which would have more than doubled the amount of work.

Also, nice work reverse engineering the ARM controller --- how did you get the info?

</comment></comment></comment></comment></comment><comment><USER10> VC4 is used in all the Raspberry Pi boards, not just the RPi 2.

</comment><comment><USER11> You can run C code on GPUs? I don't know anything about GPUs, but I thought they had a completely different programming model that requires different programming languages and paradigms.

<comment> TD-Linux Yup. Check out the VideoCore ISA:

[http://www.broadcom.com/docs/support/videocore/VideoCoreIV-A...](http://www.broadcom.com/docs/support/videocore/VideoCoreIV- AG100-R.pdf)

Note that in this case, the author is writing the bootloader firmware so performance isn't a major concern, though.

<comment><USER9> This isn't the same, the document in question relates to the QPU ISA. The VPU ISA hasn't been officially documented but there were many projects that involved reverse engineering it. The VC4 ISA is documented here:

[https://github.com/hermanhermitage/videocoreiv](https://github.com/hermanhermitage/videocoreiv)

The VPU is basically a general purpose RISC processor with some fancy vector instructions on top. In fact, most of the firmware that runs on it is written in C.

<comment> TD-Linux Ah okay, this explains a lot! I somehow thought that the initial boot happened on the QPU.

</comment></comment></comment></comment><comment><USER12> I did GCC too, [https://github.com/puppeh/vc4-toolchain](https://github.com/puppeh/vc4-toolchain).

<comment><USER9> Yeah, I saw, I haven't looked at it in detail but I think yours probably works better than mine since you did comprehensive testing. My only tests involved compiling my own firmware code, but from what I can tell, it works well, I haven't ran into any bugs yet aside from what I outlined in the README.

The assembler/linker I'm using is not ideal, I want to get MC code emission working eventually. I saw that you mentioned limitations on ld/st, why not use lea for data?

For example:

      BB1_12:                                 # %sdram_clkman_update_end.exit2
    	mov r0, 2114982312 # long
    	ld r2, (r0)
    	lea r0, .str8(pc) # PCrel load
    	lea r1, __FUNCTION__.sdram_init_late(pc) # PCrel load
    	bl xprintf

<comment><USER12> No reason I guess, except it means an extra instruction. I thought about adding a flag for "large model" compilation, but it's not been a priority so far.

</comment></comment></comment><comment><USER13> How is this different than using gcc like they describe in this book [https://jan.newmarch.name/RPi/](https://jan.newmarch.name/RPi/)?

<comment><USER14> The LLVM backend that has been written generates code that directly runs on the Videocore GPU, which also handles the early boot process. Your link is concerned with code that runs on the ARM core, and interfaces with the GPU via the existing code running on the GPU

</comment></comment><comment><USER15> Could this be used to give more direct access to the Raspberry Pi Camera subsystem?

Would appreciate any pointers, no pun intended initially.

</comment><comment><USER16> Outstanding!

Is it possible to use the LLVMLinux patches to run the kernel directly on the VC4?

<comment><USER9> VC4 itself doesn't have a MMU per se, it supports very limited memory remap (like PPC BATs) so running a conventional kernel on it is probably not possible. Best bet would be to port an RTOS to it, but my current plan for my firmware pretty much involves halting the VPU once the ARM is running.

</comment></comment><comment><USER17> does this have opencl support now?

<comment><USER10> No.</comment></comment>