Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /customers/c/9/b/feedsapi.com/httpd.www/advance/libraries/Zend/Cache/Backend.php on line 66 Warning: Cannot modify header information - headers already sent by (output started at /customers/c/9/b/feedsapi.com/httpd.www/advance/libraries/Zend/Cache/Backend.php:66) in /customers/c/9/b/feedsapi.com/httpd.www/advance/makefulltextfeed.php on line 316 Warning: Use of undefined constant SIMPLEPIE_FILE_SOURCE_NONE - assumed 'SIMPLEPIE_FILE_SOURCE_NONE' (this will throw an Error in a future version of PHP) in /customers/c/9/b/feedsapi.com/httpd.www/advance/libraries/humble-http-agent/SimplePie_HumbleHttpAgent.php on line 28 Warning: Use of undefined constant SIMPLEPIE_FILE_SOURCE_NONE - assumed 'SIMPLEPIE_FILE_SOURCE_NONE' (this will throw an Error in a future version of PHP) in /customers/c/9/b/feedsapi.com/httpd.www/advance/libraries/humble-http-agent/SimplePie_HumbleHttpAgent.php on line 28 Warning: Cannot modify header information - headers already sent by (output started at /customers/c/9/b/feedsapi.com/httpd.www/advance/libraries/Zend/Cache/Backend.php:66) in /customers/c/9/b/feedsapi.com/httpd.www/advance/libraries/feedwriter/FeedWriter.php on line 89 Hacker News https://news.ycombinator.com/ Links for the intellectually curious, ranked by readers. Mathigon – an interactive, personalized mathematics textbook https://mathigon.org/ https://mathigon.org/ <p>Our innovative new content format makes mathematics <strong class="m-red">more interactive</strong> than ever before. At every step students have to actively participate, explore, and discover new ideas.</p><p>Unlike videos and other textbooks, students don’t just <em>consume</em> information: they <em>engage</em> through <strong class="m-red">problem solving</strong>, reasoning and <strong class="m-red">creativity</strong>.</p> Sun, 24 Mar 2019 18:23:05 +0000 https://mathigon.org/ The cortex is a neural network of neural networks https://medium.com/the-spike/your-cortex-contains-17-billion-computers-9034e42d34f2 https://medium.com/the-spike/your-cortex-contains-17-billion-computers-9034e42d34f2 <p name="c883" id="c883" class="graf graf--p graf--leading">So they exist: but why does this local spike change the way we think about the brain as a computer? Because the dendrites of a pyramidal neuron contain<a href="https://www.ncbi.nlm.nih.gov/pubmed/20800473" data-href="https://www.ncbi.nlm.nih.gov/pubmed/20800473" class="markup--anchor markup--p-anchor" rel="nofollow noopener" target="_blank"> many separate</a> branches. And each can sum-up-and-spit-out-a-spike. Which means that each branch of a dendrite acts like a little nonlinear output device, summing up and outputting a local spike if that branch gets enough inputs at roughly the same time:</p><figure name="77a5" id="77a5" class="graf graf--figure graf-after--p"><figcaption class="imageCaption">Deja vu. A single dendritic branch acts as a little device for summing up inputs and giving an output if enough inputs were active at the same time. And the transformation from input to output (the grey circle) is just the graph we’ve already seen above, which gives the size of the response from the number of inputs.</figcaption></figure><p name="dbea" id="dbea" class="graf graf--p graf-after--figure">Wait. Wasn’t that our model of a neuron? Yes it was. Now if we replace each little branch of dendrite with one of our little “neuron” devices, then a pyramidal neuron looks something like this:</p><figure name="d37a" id="d37a" class="graf graf--figure graf-after--p"><figcaption class="imageCaption">Left: A single neuron has many dendritic branches (above and below its body). Right: so it is a collection of non-linear summation devices (yellow boxes, and nonlinear outputs), that all output to the body of the neuron (grey box), where they are summed together. Look familiar?</figcaption></figure><p name="a314" id="a314" class="graf graf--p graf-after--figure">Yes, each pyramidal neuron is a two layer neural network. All by itself.</p><p name="e7e0" id="e7e0" class="graf graf--p graf-after--p"><a href="http://www.sciencedirect.com/science/article/pii/S0896627303001491?via%3Dihub" data-href="http://www.sciencedirect.com/science/article/pii/S0896627303001491?via%3Dihub" class="markup--anchor markup--p-anchor" rel="nofollow noopener" target="_blank">Beautiful work</a> by Poirazi and Mel back in 2003 showed this explicitly. They built a complex computer model of a single neuron, simulating each little bit of dendrite, the local spikes within them, and how they sweep down to the body. They then directly compared the output of the neuron to the output of a two-layer neural network: and they were the same.</p><p name="85d9" id="85d9" class="graf graf--p graf-after--p">The extraordinary implication of these local spikes is that each neuron is a computer. By itself the neuron can compute a huge range of so-called nonlinear functions. Functions that a neuron which just sums-up-and-spits-out-a-spike cannot ever compute. For example, with four inputs (Blue, Sea, Yellow, and Sun) and two branches acting as little non-linear devices, we can set up a pyramidal neuron to compute the “feature-binding” function: we can ask it to respond to Blue and Sea together, or respond to Yellow and Sun together, but not to respond otherwise — not even to Blue and Sun together or Yellow and Sea together. Of course, neurons receive many more than four inputs, and have many more than two branches: so the range of logical functions they could compute is astronomical.</p><p name="2929" id="2929" class="graf graf--p graf-after--p graf--trailing">More recently,<a href="http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002867" data-href="http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002867" class="markup--anchor markup--p-anchor" rel="nofollow noopener" target="_blank"> Romain Caze and friends</a> (I am one of those friends) have shown that a single neuron can compute an amazing range of functions even if it cannot make a local, dendritic spike. Because dendrites are naturally not linear: in their normal state they actually sum up inputs to total less than the individual values. They are sub-linear. For them 2+2 = 3.5. And having many dendritic branches with sub-linear summation also lets the neuron act as two-layer neural network. A two-layer neural network that can compute a different set of non-linear functions to those computed by neurons with supra-linear dendrites. And pretty much every neuron in the brain has dendrites. So almost all neurons could, in principle, be a two-layer neural network.</p> Sun, 24 Mar 2019 23:46:33 +0000 Mark Humphries https://medium.com/the-spike/your-cortex-contains-17-billion-computers-9034e42d34f2 Integer multiplication in time O(n log n) [pdf] https://hal.archives-ouvertes.fr/hal-02070778/document https://hal.archives-ouvertes.fr/hal-02070778/document <a href="https://hal.archives-ouvertes.fr/hal-02070778/document">Download PDF</a> Sun, 24 Mar 2019 04:17:40 +0000 Mark Humphries application/pdf https://hal.archives-ouvertes.fr/hal-02070778/document The Elaborate, Dying Art of Hustling for Money at Dave and Buster's https://www.vice.com/en_us/article/pan43y/the-elaborate-dying-art-of-hustling-for-money-at-dave-and-busters-arcades https://www.vice.com/en_us/article/pan43y/the-elaborate-dying-art-of-hustling-for-money-at-dave-and-busters-arcades <p>Far away from the glitz and glamor the e-sports circuit, a different breed of semi-professional gamers is eking out an honest day’s work at arcades around the globe. If the Ninjas of the MLG, with their celebrity lifestyles and <a href="https://kotaku.com/report-ea-paid-ninja-1-million-to-stream-apex-legends-1833272982" target="_blank">lucrative promo deals</a>, are the World Series of Poker stars, these arcade hustlers—referred to within their community as “advantage players” (APs)—are more akin to legal card counters. These unassuming sharks will walk into a Dave &amp; Buster's (or any other entertainment center with an arcade awarding tickets that can be exchanged for prizes), hit their handful of preferred games, and quietly rack up thousands and thousands of tickets. Doing this just a few days a week can quickly amass enough of a ticket balance to trade for the top shelf prizes that casual players could only dream of redeeming, like game consoles and iPads, which APs often sell for profit.</p> <p>For the elites in this scene, advantage playing straddles the line between obsessive hobby and part-time job. They aren't scamming or stealing their way to big wins. They're just incredibly good at these games and much of their skill is learned, rather than innate. Though baseline speed and reflexes are pre-requisites for success, it's primarily repetition and a nerdy devotion to the scene that breeds top-tier APs who are able to quickly discern whether a game's jackpot is ripe and able to be won or if it needs more time to "refill" through casual play. At home, APs study PDFs of game manuals downloaded from manufacturer sites, discuss strategies on their <a href="https://www.reddit.com/r/DaveAndBusters/" target="_blank">subreddit</a>, track fluctuations in prize ticket value, and post YouTube videos <a href="https://www.youtube.com/watch?v=TEQM7c1xv18" target="_blank">showcasing their talents</a>. But despite the internet’s aid in connecting APs worldwide and revealing the tricks of their trade to new generations of players, their numbers are dwindling.</p> <p>Michael Lucas, an advantage player in Pittsburgh, said that less than a decade ago, $100-per-hour profits weren’t uncommon, and players, arcade management, and game manufacturers all operated with respect for one another, unspoken gentlemen’s agreements keeping the peace.</p> <p>“They tolerated what we did to a fair degree,” Lucas told me in a phone call. “We knew we were killing it. They knew that we were killing it. But they also knew that we were doing it by the book and not doing anything to cheat.”</p> <div class="article__media" readability="8"> <picture class="article__image"><source media="(max-width: 25em)" srcset="https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=160:*, https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=160:* 2x" data-srcset="https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=400:*, https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=600:* 2x"><source media="(max-width: 40.625em)" srcset="https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=160:*, https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=160:* 2x" data-srcset="https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=650:*, https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=975:* 2x"><source media="(max-width: 53.125em)" srcset="https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=160:*, https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=160:* 2x" data-srcset="https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=850:*, https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=1275:* 2x"><source media="(max-width: 65.625em)" srcset="https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=160:*, https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=160:* 2x" data-srcset="https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=1050:*, https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=1575:* 2x"><source media="(min-width: 65.625em)" srcset="https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=160:*, https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=160:* 2x" data-srcset="https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=1050:*, https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=1575:* 2x"><img src="https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg?resize=320:*" alt="The back of a man's head as he plays an arcade game called 'Pop the Lock'" class="col-12-xs" data-src="https://video-images.vice.com/_uncategorized/1553192665898-dave-and-busters-justin-wei.jpeg"/></source></source></source></source></source></picture><p>Advantage player Justin Wei winning the jackpot on the 'Pop the Lock' game at a Dave and Buster's in Los Angeles. Photo by Jamie Lee Curtis Taete</p> </div> <p><br/>For a time, Lucas said, the cycle would go as follows: advantage players would find a game to master and farm for infinite jackpots, management would catch wind and adjust the settings or download a software patch to nullify the exploit, forcing the players to rotate to other games while the jackpot gradually built back up past the threshold that allows it to be won again. Lucas pointed to <i>Tippin’ Bloks</i>, a game in which the player moves a paddle to try and catch falling blocks into a nine-high stack, as a case study in this sequence.<br/></p> <p>“On the old software back in 2011, [<i>Tippin' Bloks</i>'] 'impossible mode' wasn't very impossible, and people started to catch on,” he recalled. “Once the community figured that out, the average good <i>Tippin’ Bloks</i> player was winning four out of every five games. [Dave &amp; Buster's] phoned up the makers of the game, ICE, and said, ‘Hey, this game's getting killed here and we don't want to drop the jackpot. Can you make the software work so there’s the win/loss control that we initially wanted?’ About seven months later, the software update began to roll out to the stores and we immediately noticed the difference and we all kind of gave up on it. But, in that patch, [ICE] also added an obvious tell that shows when the game is ready to pay out, which I consider a blatant nod to the community.”</p><p>When asked to verify if a change had been made at the request of Dave &amp; Buster's or if their games were programmed with any nods to advantage players, an ICE representative said "no comment." Dave &amp; Buster's did not respond to multiple requests for comment on this article.<br/></p> <p>Justin Wei, an advantage player from Irvine, California, says he believes his local Dave &amp; Buster's "puts their machines on harder settings to discourage advantage players from coming." This has forced him and his friends to make one to two hour drives to the franchise's Hollywood location if he wants to earn serious tickets. He presumes that because that tourist-heavy Hollywood location "is so profitable and makes so much money, that they don't care if we come in and keep their games on normal settings."</p><p>Despite the frustration it causes some, Lucas considers settings adjustment and exploit patch responses to APs fair play, and understands the necessity to clamp down on free-for-alls. He's less amiable when corporate makes sweeping, company-wide changes to ticket valuation in the same way one might be upset if the Federal Reserve suddenly chose to double the amount of currency in circulation. To keep all parties satisfied and help prevent such drastic steps, Lucas claimed he cultivated a friendly relationship with the management at his neighborhood Dave &amp; Buster's, resulting in their being “very up-front” with him about their targets for a game’s take-to-payout ratio. </p><p>“If something's running a little high, they would actually tell me and I’ll back off a bit,” he explained.</p> <p>But not everyone is so tolerant of advantage players. Lucas’ tone hardened as he recalled a manager at a mom-and-pop local arcade who once changed the settings on all the games he’d been working when he stepped outside for a phone call.</p> <p>“He couldn’t even wait for me to get off the property,” he seethed. “I knew I was never going back there and they were just going to change everything when I left, so I had no qualms about killing him.”</p> <p>The “killing” here refers to Lucas going back in, redoubling his gameplay efforts, and cashing out for a Nintendo Switch plus four game package, taking a prize bundle that he presumed cost the house $600 or more for only $170 of his own. Not literal murder.</p> <p>When asked if he could understand why a non-franchise arcade might want to shoo his kind away, Lucas was unsympathetic. “If the absolute best player to ever walk through that door, gives it everything he has and demolishes every game you have and he still only comes out ahead enough money that once you have two families of four walk in, sit down, eat and—boom—you have all your money back, is that really that big of a problem?” he asked.</p> <p>The mix of hostile managers, apparently nerfed cash cow games, ever-increasing game prices, and changes in ticket-to-dollar exchange rates has gradually forced advantage players to become jacks of all trades rather than specialists. For many, the cost/benefit of this arrangement no longer makes sense, and the herd has thinned substantially.</p> <p>“I had a whole list of contacts in my phone for nothing but advantage play,” said Lucas of his local peers. “I had about 17 or 18 people I’d send out mass texts to like ‘Hey, this game’s broken’ or ‘This game’s fixed.’” He said he's now down to one remaining IRL comrade, a former pupil named Joe Minkel. Years back, Lucas helped Minkel hone his natural gaming skills for advantage play and educated him in the strategy and benefits of sharing arcades as a group.</p> <p>“Mike actually wanted to start a community of people that work together,” Minkel told me. “We're all in cahoots like, 'Okay, we're not going to kill a game. We're going to keep it profitable so that the jackpot doesn't get lowered.'”</p> <p>Minkel said he now sees an increasing number of lone wolves who’ve learned how to beat a few games coming in to wipe out an arcade with little regard for other players or the long-term impact their assaults may have on company policy.</p> <p>“I don't like calling them APs,” he said. “I call them ‘pirates’ because they're in it for the booty and themselves. They just swoop in and ruin things.”</p> <p>These days, Minkel is more focused on entertaining the audience for his popular arcade-centric <a href="https://www.youtube.com/channel/UC-jrJDE909guQH6PlBt6iyA" target="_blank">YouTube channel</a> than flipping prizes when he hits an arcade. Lucas, who says advantage play used to make him more money annually than his day job managing a liquor store, still earns from the endeavor, though it now makes up only a third of his income. Neither can imagine a time when they stop going to arcades, and are heartened by the few <a href="https://www.youtube.com/channel/UCBlQTrYOWMMVg9GZrZLgePw/featured" target="_blank">advantage players they know in younger generations</a>, but both seem to acknowledge their glory days are behind them.</p> <p>“I'm not asking to go back to the days where I was making beaucoup amounts of money in a short amount of time, because I know that's not sustainable,” reflected Lucas. “Just don't quit your day job, kids. This isn't something you're going to do and be able to quit your job and tell everyone to go bleep themselves and live the high life and roll around in a Ferrari. This is something that's basically going to be your beer money.”</p> <p><i> <a href="https://confirmsubscription.com/h/i/48178908AA2FD075" target="_blank">Sign up for our newsletter</a> to get the best of VICE delivered to your inbox daily.</i></p> <p><i>Follow Justin Caffier on <a href="http://twitter.com/justincaffier" target="_blank">Twitter</a>. </i></p> <p><i>Follow Jamie Lee Curtis Taete on <a href="http://instagram.com/jamieleecurtisofficial" target="_blank">Instagram</a>.</i></p> Sun, 24 Mar 2019 05:56:20 +0000 https://www.vice.com/en_us/article/pan43y/the-elaborate-dying-art-of-hustling-for-money-at-dave-and-busters-arcades Fyne: Cross Platform GUI in Go Based on Material Design https://github.com/fyne-io/fyne https://github.com/fyne-io/fyne <div class="Box-body"> <article class="markdown-body entry-content p-5" itemprop="text"><p align="center"> <a href="https://godoc.org/fyne.io/fyne" title="GoDoc Reference" rel="nofollow"><img src="https://camo.githubusercontent.com/42eb03af37dfb3411de02f9bd5af758be53ce2ed/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f676f2d646f63756d656e746174696f6e2d626c75652e7376673f7374796c653d666c6174" alt="GoDoc Reference" data-canonical-src="https://img.shields.io/badge/go-documentation-blue.svg?style=flat"/></a> <a href="https://github.com/fyne-io/fyne/releases/tag/v1.0.0" title="1.0.0 Release"><img src="https://camo.githubusercontent.com/d1a77bbe6c6f9ca4ffc9d2634c79cd4b66c27cad/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75652e7376673f7374796c653d666c6174" alt="1.0.0 release" data-canonical-src="https://img.shields.io/badge/version-1.0.0-blue.svg?style=flat"/></a> <a href="http://gophers.slack.com/messages/fyne" rel="nofollow"><img src="https://camo.githubusercontent.com/db3eb2708909edbcdedbc2c5e413efc66ae840fa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a6f696e2d75732532306f6e253230736c61636b2d677261792e7376673f6c6f6e6743616368653d74727565266c6f676f3d736c61636b26636f6c6f72423d626c7565" alt="Join us on Slack" data-canonical-src="https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&amp;logo=slack&amp;colorB=blue"/></a> <a href="https://fossfi.sh/support-fyneio" rel="nofollow"><img src="https://camo.githubusercontent.com/968a8c856cc232295b23c0bd2395ffb6aafff787/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f242d737570706f72745f75732d6f72616e67652e7376673f6c6162656c57696474683d3230266c6f676f3d646174613a696d6167652f706e673b6261736536342c6956424f5277304b47676f414141414e5355684555674141414441414141416b434159414141445052626b4b41414141426d4a4c523051413777417941442f4354766579414141414358424957584d4141413968414141505951476f50366470414141414233524a5455554834774d564351344c65755052654141414244464a52454655574d50566d58396f56575559787a2f337472356a6258396f59695a57536d4e676f59596c5556717261597649616d6c43673870715542545a723338714d685a5a3041386f49714b49694c4a6f4a74454973522b7a6b69316d477151775a54596b496d746c676b355779376a506e627639305850676344336e334c766479373331774f47632b37376e656337334f652f7a66702f6e4f546556792b576f6c70685a4333435648394e394f41734d417a75424c6b6b486b6d796b4b7532416d514773416a5941433470512b514a34574e4a673152307773337067493344544a465650414d38414779524e564d5542423938444c4376427a4c74416836515477554336676d477a755554774147754252384d44365170467a77504179706935763448586752584145672b764c516d326e6a537a43796f57516d6257415077417a4971592f676d3455644a41684e35716f41756f6a64436241443442566c566942646247674a3841326750775a745a735a76656132587741536431415a347a4e4e4841393046674a42397269364648537477372b5761415065413359625761427a6f764169462f6e664d55432b5144347352494f4c496b5a373348777334424851754f6e655937413261592f434864674c3341747342685944395456564d4342302b4f326835396e524a424a66656a36574f6a36426a384332566370466f7153432f3338506241726232347a514461624257684f734646624e41755a32557967785a6376634877507345505363494c6563614175596d6f55614a5230314d796d41553841467a6d3776437870334d786167573078707638457a696e6f674c5043343041376347704d4b485142367958394671452f4143794b4d6238565743307047364533442b67463573626f396b6d364d6c30412f4e3341643842744d654142424e7742394a725a37496a3550516d50754137595a575a586d466e616e316c6a5a726636357032626f4475516d496e4e72414e34493239444a556d543032432b624374694c2f51436f325932424977423777467a43756a3178475a694d3776636239674f54414d756e55545a4d5650536b5a43744a7542416d516e674948437570496d61435041706f42566f6b7653726a3755446d346f305067383445766f3937456b6f5655594858676a4b36704e5777423149356466645a7462746a556768575370705a306976447669726a41344d416f73436643654668615263507668514c56365162594768764c485a5a515276774f3168664a4e4a5a467539716b79534e79556479787537706b7a67633842446b6e5a5075534d7a733858413538415a4564506267545a4a59336c64324741424f69785758704830594d6b39735a6c4e39367a5a36686e32462b416459464d34495a6c5a4c66425251694d7a47586c61556d64466d6e705053433341383134616c434a6a7744704a472b4e7571436b4330487a674c692b4c3635315276675465417534454c6e48617a414a6e65646b7770777a766f682b3452644c5069642b464d706e4d44456c48593843764164344747694b6d523441314476777059486b5a61624c544f374b436b6759656977472f33497530686f5136667776776836515677464b6e3274457067423442506753614a53306f466e7977416e7542357952313562484e5636485066556e7971615356495630426c7745586535317a4e74415965684748674d4e4f79667539462b69584e4436563555706c4d706c58676675416a34485067495841506358736a3543634b656c774e627169564361544f642f6a7268525a4a756d62616a69516c725166364f5a2f4b6b4570735137347651513777315631514e4968344762672b42527339425869366b7173414a4b2b4271353268696857786f48372f77736846446978773738367646396b6d6d2b54744b2b6144735457516d6132454f6a673337392f7a674e4f38616b6837334e666b6e537732707634483341796730466d62544d524141414141456c46546b5375516d4343" alt="Support Fyne.io" data-canonical-src="https://img.shields.io/badge/$-support_us-orange.svg?labelWidth=20&amp;logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAkCAYAAADPRbkKAAAABmJLR0QA7wAyAD/CTveyAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAAB3RJTUUH4wMVCQ4LeuPReAAABDFJREFUWMPVmX9oVWUYxz/3tr5jbX9oYiZWSmNgoYYlUVqraYvIamlCg8pqUBTZr38qMhZZ0A8oIqKIiLJoJtEIsR+zki1mGqQwZTYkImtlgk5Wy7jPnbv90XPgcD3n3Lvdy731wOGc+77nec73Oe/zfp/nOTeVy+WolphZC3CVH9N9OAsMAzuBLkkHkmykKu2AmQGsAjYAC4pQ+QJ4WNJg1R0ws3pgI3DTJFVPAM8AGyRNVMUBB98DLCvBzLtAh6QTwUC6gmGzuUTwAGuBR8MD6QpFzwPAypi5v4HXgRXAEg+vLQm2njSzCyoWQmbWAPwAzIqY/gm4UdJAhN5qoAuojdCbAD4BVlViBdbGgJ8A2gPwZtZsZvea2XwASd1AZ4zNNHA90FgJB9ri6FHStw7+WaAPeA3YbWaBzovAiF/nfMUC+QD4sRIOLIkZ73Hws4BHQuOneY7A2aY/CHdgL3AtsBhYD9TVVMCB0+O2h59nRJBJfej6WOj6Bj8C2VcpFoqSC/38PbArb24zQDabBWhOsFFbNAuZ2UygxZcvcHwPsEPScILecaAuYmoUaJR01MymAU8AFzm7vCxp3MxagW0xpv8EzinogLPC40A7cGpMKHQB6yX9FqE/ACyKMb8VWC0pG6E3D+gF5sbo9km6Ml0A/N3Ad8BtMeABBNwB9JrZ7Ij5PQmPuA7YZWZXmFnan1ljZrf65p2boDuQmInNrAN4I29DJUmT02C+bCtiL/QCo2Y2BIwB7wFzCuj1xGZiM7vcb9gOTAMunUTZMVPSkZCtJuBAmQngIHCupImaCPApoBVokvSrj7UDm4o0Pg84Evo97EkoVUYHXgjK6pNWwB1I5dfdZtbtjUghWSppZ0ivDvirjA4MAosCfCeFhaRcPvhQLV6QbYGhvLHZZQRvwO1hfJNJZFu9qkySNyUdyxu7pkzgc8BDknZPuSMzs8XA58AZEdPbgTZJY3ld2GABOixWXpH0YMk9sZlN96zZ6hn2F+AdYFM4IZlZLfBRQiMzGXlaUmdFmnpPSC3A814alCJjwDpJG+NuqCkC0HzgLi+L651RvgTeAu4ELnHazAJnedkwpwzvoh+4RdLPid+FMpnMDElHY8CvAd4GGiKmR4A1DvwpYHkZabLTO7KCkgYeiwG/3Iu0hoQ6fwvwh6QVwFKn2tEpgB4BPgSaJS0oFnywAnuB5yR15bHNV6HPfUnyqaSVIV0BlwEXe51zNtAYehGHgMNOyfu9F+iXND6V5UplMplXgfuAj4HPgIXAPcXsj5CcKelwNbqiVCaTOd/jrhRZJumbajiQlrQf6OZ/KkEpsQ74vQQ7w1V1QNIh4Gbg+BRs9BXi6kqsAJK+Bq52hihWxoH7/wshFDixw786vF9kmm+TtK+aDsTWQma2EOjg379/zgNO8akh73NfknSw2pv4H3Ayg0FmbTMRAAAAAElFTkSuQmCC"/></a> <br/><a href="https://goreportcard.com/report/fyne.io/fyne" rel="nofollow"><img src="https://camo.githubusercontent.com/8d1c4087ed3648f0d06ab937488bc49ab0de1ce3/68747470733a2f2f676f7265706f7274636172642e636f6d2f62616467652f66796e652e696f2f66796e65" alt="Code Status" data-canonical-src="https://goreportcard.com/badge/fyne.io/fyne"/></a> <a href="https://travis-ci.org/fyne-io/fyne" rel="nofollow"><img src="https://camo.githubusercontent.com/4a51a2c251429dde0489153a3379b9c83b045712/68747470733a2f2f7472617669732d63692e6f72672f66796e652d696f2f66796e652e737667" alt="Build Status" data-canonical-src="https://travis-ci.org/fyne-io/fyne.svg"/></a> <a href="https://coveralls.io/github/fyne-io/fyne?branch=develop" rel="nofollow"><img src="https://camo.githubusercontent.com/c5bb721a783a45a49d334b3b03ef18b2b2814c2a/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f66796e652d696f2f66796e652f62616467652e7376673f6272616e63683d646576656c6f70" alt="Coverage Status" data-canonical-src="https://coveralls.io/repos/github/fyne-io/fyne/badge.svg?branch=develop"/></a> </p> <p><a href="http://fyne.io" rel="nofollow">Fyne</a> is an easy to use UI toolkit and app API written in Go. We use OpenGL (through the go-gl and go-glfw projects) to provide cross platform graphics.</p> <p>The 1.0 release is now out and we encourage feedback and requests for the next major release :).</p> <p>Fyne is designed to be really easy to code with. Here are the steps to your first app.</p> <h2><a id="user-content-prerequisites" class="anchor" aria-hidden="true" href="https://github.com/fyne-io/fyne#prerequisites"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"/></svg></a>Prerequisites</h2> <p>As Fyne uses CGo you will require a C compiler (typically gcc). If you don't have one set up the instructions at <a href="https://github.com/fyne-io/fyne/wiki/Compiling">Compiling</a> may help.</p> <p>By default Fyne uses the <a href="https://github.com/go-gl/gl">gl golang bindings</a> which means you need a working OpenGL configuration. Debian/Ubuntu based systems may also need to install the <code>libgl1-mesa-dev</code> and <code>xorg-dev</code> packages.</p> <p>Using the standard go tools you can install Fyne's core library using:</p> <pre><code>go get fyne.io/fyne </code></pre> <h2><a id="user-content-code" class="anchor" aria-hidden="true" href="https://github.com/fyne-io/fyne#code"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"/></svg></a>Code</h2> <p>And then you're ready to write your first app!</p> <div class="highlight highlight-source-go"><pre><span class="pl-k">package</span> main <span class="pl-k">import</span> ( <span class="pl-s"><span class="pl-pds">"</span>fyne.io/fyne/widget<span class="pl-pds">"</span></span> <span class="pl-s"><span class="pl-pds">"</span>fyne.io/fyne/app<span class="pl-pds">"</span></span> ) <span class="pl-k">func</span> <span class="pl-en">main</span>() { <span class="pl-smi">app</span> <span class="pl-k">:=</span> app.<span class="pl-c1">New</span>() <span class="pl-smi">w</span> <span class="pl-k">:=</span> app.<span class="pl-c1">NewWindow</span>(<span class="pl-s"><span class="pl-pds">"</span>Hello<span class="pl-pds">"</span></span>) w.<span class="pl-c1">SetContent</span>(widget.<span class="pl-c1">NewVBox</span>( widget.<span class="pl-c1">NewLabel</span>(<span class="pl-s"><span class="pl-pds">"</span>Hello Fyne!<span class="pl-pds">"</span></span>), widget.<span class="pl-c1">NewButton</span>(<span class="pl-s"><span class="pl-pds">"</span>Quit<span class="pl-pds">"</span></span>, <span class="pl-c1">func</span>() { app.<span class="pl-c1">Quit</span>() }), )) w.<span class="pl-c1">ShowAndRun</span>() }</pre></div> <p>And you can run that simply as:</p> <pre><code>go run main.go </code></pre> <p>It should look like this:</p> <p align="center"> <a target="_blank" rel="noopener noreferrer" href="https://github.com/fyne-io/fyne/blob/master/img/hello-normal.png"><img src="https://github.com/fyne-io/fyne/raw/master/img/hello-normal.png" width="207" height="204" alt="Fyne Hello Dark Theme"/></a> </p> <blockquote> <p>Note that Windows applications load from a command prompt by default, which means if you click an icon you may see a command window. To fix this add the parameters <code>-ldflags -H=windowsgui</code> to your run or build commands.</p> </blockquote> <p>Fyne is built entirely using vector graphics, which means applications written with Fyne will scale to any value beautifully (not just whole number values). The default scale value is calculated from your screen's DPI - and if you move a window to another screen it will re-scale and adjust the window size accordingly! We call this "auto scaling", and it is designed to keep an app GUI the same size as you change monitor. You can override this behaviour by setting a specific scale using the FYNE_SCALE environment variable.</p> <p>Fyne ships with two themes by default, "light" and "dark". You can choose which to use with the environment variable <code>FYNE_THEME</code>. The default is dark:</p> <p align="center"> <a target="_blank" rel="noopener noreferrer" href="https://github.com/fyne-io/fyne/blob/master/img/hello-normal.png"><img src="https://github.com/fyne-io/fyne/raw/master/img/hello-normal.png" width="207" height="204" alt="Fyne Hello Dark Theme"/></a> </p> <p>If you prefer a light theme then you could run:</p> <pre><code>FYNE_THEME=light go run main.go </code></pre> <p>It should then look like this:</p> <p align="center"> <a target="_blank" rel="noopener noreferrer" href="https://github.com/fyne-io/fyne/blob/master/img/hello-light.png"><img src="https://github.com/fyne-io/fyne/raw/master/img/hello-light.png" width="207" height="204" alt="Fyne Hello Light Theme"/></a> </p> <p>To run a showcase of the features of Fyne execute the following:</p> <pre><code>cd $GOPATH/src/fyne.io/fyne/cmd/fyne_demo/ go build ./fyne_demo </code></pre> <p>And you should see something like this (after you click a few buttons):</p> <p align="center"> <a target="_blank" rel="noopener noreferrer" href="https://github.com/fyne-io/fyne/blob/master/img/widgets-dark.png"><img src="https://github.com/fyne-io/fyne/raw/master/img/widgets-dark.png" alt="Fyne Hello Light Theme"/></a> </p> <p>Or if you are using the light theme:</p> <p align="center"> <a target="_blank" rel="noopener noreferrer" href="https://github.com/fyne-io/fyne/blob/master/img/widgets-light.png"><img src="https://github.com/fyne-io/fyne/raw/master/img/widgets-light.png" alt="Fyne Hello Light Theme"/></a> </p> <p>Fyne also provides a declarative API. The following is exactly the same as the code above but in a declarative style.</p> <div class="highlight highlight-source-go"><pre><span class="pl-k">package</span> main <span class="pl-k">import</span> ( <span class="pl-s"><span class="pl-pds">"</span>fyne.io/fyne<span class="pl-pds">"</span></span> <span class="pl-s"><span class="pl-pds">"</span>fyne.io/fyne/app<span class="pl-pds">"</span></span> <span class="pl-s"><span class="pl-pds">"</span>fyne.io/fyne/widget<span class="pl-pds">"</span></span> ) <span class="pl-k">func</span> <span class="pl-en">main</span>() { <span class="pl-smi">app</span> <span class="pl-k">:=</span> app.<span class="pl-c1">New</span>() <span class="pl-smi">w</span> <span class="pl-k">:=</span> app.<span class="pl-c1">NewWindow</span>(<span class="pl-s"><span class="pl-pds">"</span>Hello<span class="pl-pds">"</span></span>) w.<span class="pl-c1">SetContent</span>(&amp;widget.<span class="pl-smi">Box</span>{Children: []fyne.<span class="pl-smi">CanvasObject</span>{ &amp;widget.<span class="pl-smi">Label</span>{Text: <span class="pl-s"><span class="pl-pds">"</span>Hello Fyne!<span class="pl-pds">"</span></span>}, &amp;widget.<span class="pl-smi">Button</span>{Text: <span class="pl-s"><span class="pl-pds">"</span>Quit<span class="pl-pds">"</span></span>, OnTapped: <span class="pl-c1">func</span>() { app.<span class="pl-c1">Quit</span>() }}, }}) w.<span class="pl-c1">ShowAndRun</span>() }</pre></div> <p>The main examples have been moved - you can find them in their <a href="https://github.com/fyne-io/examples/">own repository</a>.</p> </article></div> Sun, 24 Mar 2019 19:02:10 +0000 https://github.com/fyne-io/fyne M-16: A Bureaucratic Horror Story (1981) https://www.theatlantic.com/magazine/archive/1981/06/m-16-a-bureaucratic-horror-story/545153/ https://www.theatlantic.com/magazine/archive/1981/06/m-16-a-bureaucratic-horror-story/545153/ <p class="dropcap"><span class="smallcaps">The technical data that came out of the</span> congressional inquiry persuaded the members of the committee to release an unusually sharp report, charging that the M-16 had been sabotaged by the ordnance corps. Yet the most striking aspect of the testimony was its humdrum, routine tone. When representatives of the ordnance corps were pressed to explain their decisions, they fell back on citations from the rule books, like characters in a parody of bureaucratic life. They seemed to have a hard time remembering who was responsible for crucial decisions; they tended to explain things by saying, “the feeling was,” or “the practice has been …” They could list with careful, bureaucratic logic the reasonableness of each step they had taken: if you didn’t have Arctic test requirements, you might not have adaptable rifles. If you didn’t change to ball powder, you would have had chamber pressures over the allowable limits—which might have been dangerous for the troops. They seemed not to see a connection between these choices and the soldiers who were dying with jammed rifles in their arms. They were certainly aware of the M-16’s troubles, and bowed to no one in their concern. What it proved, they said, was that the rifle had always been a risky experiment—especially (as they pointed out several times) when it was being used by the kind of soldiers the draft was scrounging up these days, who couldn’t understand the importance of keeping their weapons clean. Four years after the hearings, in 1971, an M-16 project manager, Col. Rex Wing, wrote a history of the rifle in <em>Ordnance </em>magazine. The headline on the story said, “Although the Viet Cong greatly feared the M-16 when our soldiers first were equipped with it in Vietnam, malfunctions caused by improper maintenance led to its being downgraded in the press.” The story contained no mention of the change in ammunition.</p><p>The committee could find no real evidence of corruption. Its report criticized one Nelson Lynde Jr., a general who was in charge of the Army Weapons Command between 1962 and 1964. He approved purchases of the M-16 from Colt, and then accepted a job shortly after retirement with the parent company of Colt. The committee reprimanded General Lynde for an apparent conflict of interests—even though, as Lynde pointed out, the Army’s counsel had not forbidden him to accept the job. The committee also urged an audit of the profits Colt had made on the rifle and of the “sole-source” relationship with Olin Mathieson. In 1980, I asked the committee’s investigator, Earl Morgan, whether actual corruption—bribes, kickbacks—had been involved. “Oh, I’d be amazed if there wasn’t some, knowing how that business is done,” he said. “But we never found anything we could prove.”</p><p>Perhaps the truest explanation of why things happened as they did is the most ordinary: that human beings could not foresee the way that chance and circumstance could magnify the consequences of their acts. The military supply organization, like most other organizations, is always full of power plays and bureaucratic games, which distract attention from the goals that in a rational world would always be pursued. Only occasionally does chance make the effects of these games catastrophic. Doubtless, thousands of military intelligence officers have lapsed in their attention to urgent dispatches; the handful who lapsed on December 6, 1941, were just unluckier than the rest. The ordnance corps was similarly unlucky. In late 1963 and early 1964, when the crucial decisions about the M-16 were being made, few people could have known that the U.S. would soon have half a million land troops in Asia, or that the soldiers would depend for their survival on a weapon that was the product of small-time bureaucratic squabbles. Most other squabbles had come and gone without costing soldiers’ lives. The forlorn tone of one of the Army’s last submissions to the congressional committee suggested the way in which the situation had gotten out of control:</p><blockquote readability="11">&#13; <p>From the vantage point of retrospect, it has sometimes been suggested that the peculiar behavior of ball propellant in the M-16 system should have been predicted. … Had the Army anticipated these developments, it is most unlikely that the course chosen in January 1964 would have been the same. A decision to reduce the velocity requirement, and continue loading IMR 4475 propellant would probably have been made instead.</p>&#13; </blockquote><p>The committee recommended that the Army immediately conduct a thorough, honest test of the two kinds of ammunition, with the strong suggestion that it should switch to IMR 4475. That never happened. Instead of going back to the original powder, the ordnance corps modified the ball powder and changed the mechanical “buffer” of the rifle, which slowed down the cyclic rate. That solved part of the jamming problem, but did not restore the rifle’s original reliability or “lethality.” (The change in the barrel “twist” was also never corrected.) Through every day of combat in Vietnam, American troops fired cartridges filled with the ball powder that was the legacy of the ordnance corps. And if American troops were sent into battle today, they would use the same kind of ammunition.</p> <section class="c-letters-cta" readability="2.6153846153846"><p class="c-letters-cta__text">We want to hear what you think about this article. <a href="https://www.theatlantic.com/contact/letters/" class="c-letters-cta__link">Submit a letter</a> to the editor or write to letters@theatlantic.com.</p></section> <address id="article-writer-0" class="c-article-writer lazyload" data-author-id="316" data-include="css:https://cdn.theatlantic.com/assets/static/b/frontend/dist/theatlantic/css/components/article-writer.ccce81ff6d92.css" itemprop="author" itemtype="https://schema.org/Person" itemscope=""><meta itemprop="name" content="James Fallows"/><meta itemprop="url" content="https://www.theatlantic.com/author/james-fallows/"/><meta itemprop="email" content="JamesFallows@theatlantic.com"/><div class="c-article-writer__image" itemprop="image" itemtype="http://schema.org/ImageObject" itemscope=""><meta itemprop="name" content="200"/><meta itemprop="representativeOfPage" content="false"/><figure class="o-media c-article-writer__media"><a class="o-media__object" href="https://www.theatlantic.com/author/james-fallows/" title="James Fallows's writer page"><picture class="c-article-writer__picture"><noscript><img class="c-article-writer__img o-media__img" src="https://cdn.theatlantic.com/assets/media/None/JFallowsHeadshotAtlanticSmall_grey/200.png?mod=1527623224" alt="" itemprop="contentUrl"/></noscript><img class="c-article-writer__img o-media__img lazyload" data-src="https://cdn.theatlantic.com/assets/media/None/JFallowsHeadshotAtlanticSmall_grey/200.png?mod=1527623224" alt=""/></picture></a></figure></div><div class="c-article-writer__content" readability="27.736842105263"><div class="c-article-writer__bio" itemprop="description" readability="31.809954751131"> <a href="https://www.theatlantic.com/author/james-fallows/" class="author-link" data-omni-click="inherit">James Fallows</a> is a staff writer for <em>The Atlantic</em> and has written for the magazine since the late 1970s. He has reported extensively from outside the United States and once worked as President Carter's chief speechwriter. He and his wife, Deborah Fallows, are the authors of the new book <em><a href="https://www.amazon.com/Our-Towns-000-Mile-Journey-America/dp/1101871849" target="_blank">Our Towns: A 100,000-Mile Journey Into the Heart of America</a>, </em>which has been a <em>New York Times</em> best seller and is the basis of a forthcoming HBO documentary. </div></div></address> Mon, 25 Mar 2019 00:56:30 +0000 https://www.theatlantic.com/magazine/archive/1981/06/m-16-a-bureaucratic-horror-story/545153/ Rotating Black Holes May Serve as Gentle Portals for Hyperspace Travel https://daily.jstor.org/rotating-black-holes-may-serve-as-gentle-portals-for-hyperspace-travel/ https://daily.jstor.org/rotating-black-holes-may-serve-as-gentle-portals-for-hyperspace-travel/ <p>One of the most cherished science fiction scenarios is using a black hole as a portal to another dimension or time or universe. That fantasy may be closer to reality than previously imagined.</p> <p>Black holes are perhaps the most mysterious objects in the universe. They are the consequence of <a href="https://www.jstor.org/stable/24536519?mag=rotating-black-holes-may-serve-as-gentle-portals-for-hyperspace-travel" class="jcitation">gravity crushing a dying star</a> without limit, leading to the formation of a true singularity – which happens when an entire star gets compressed down to a single point yielding an object with infinite density. This dense and hot singularity punches a hole in the fabric of spacetime itself, possibly opening up an opportunity for hyperspace travel. That is, a short cut through spacetime allowing for travel over cosmic scale distances in a short period.</p> <p>Researchers previously thought that any spacecraft attempting to use a black hole as a portal of this type would have to reckon with nature at its worst. The hot and dense singularity would cause the spacecraft to endure a sequence of increasingly uncomfortable tidal stretching and squeezing before being completely vaporized.</p> <h3>Flying through a Black Hole</h3> <p><a href="http://gravity.phy.umassd.edu/">My team</a> at the University of Massachusetts Dartmouth and a colleague at Georgia Gwinnett College have shown that all black holes are not created equal. If the black hole like Sagittarius A*, located at the center of our own galaxy, is large and rotating, then the outlook for a spacecraft changes dramatically. That’s because the singularity that a spacecraft would have to contend with is very gentle and could allow for a very peaceful passage.</p> <p>The reason that this is possible is that the relevant singularity inside a rotating black hole is technically “weak,” and thus does not damage objects that interact with it. At first, this fact may seem counter intuitive. But one can think of it as analogous to the common experience of quickly passing one’s finger through a candle’s near 2,000-degree flame, without getting burned.</p> <figure class="align-right zoomable"><figcaption><span class="caption">Hold your finger close to the flame and it will burn. Swipe it through quickly and you won’t feel much. Similarly, passing through a large rotating black hole, you are more likely to come out the other side unharmed.</span><span class="attribution"><a class="source" href="https://www.shutterstock.com/image-photo/person-takes-his-finger-very-close-1079996603">mirbasar/Shutterstock.com</a></span></figcaption></figure><p>My colleague <a href="https://scholar.google.com/citations?user=Zsn-SygAAAAJ&amp;hl=en">Lior Burko</a> and <a href="https://scholar.google.com/citations?user=382Ttr0AAAAJ&amp;hl=en">I</a> have been investigating the physics of black holes for over two decades. In 2016, my Ph.D. student, Caroline Mallary, inspired by Christopher Nolan’s blockbuster film <a href="https://www.imdb.com/title/tt0816692/">“Interstellar,”</a> set out to test if Cooper (Matthew McConaughey’s character), could survive his fall deep into Gargantua – a fictional, supermassive, rapidly rotating black hole some 100 million times the mass of our sun. “Interstellar” was based on a book written by Nobel Prize-winning astrophysicist <a href="https://www.nobelprize.org/prizes/physics/2017/thorne/facts/">Kip Thorne</a> and Gargantua’s physical properties are central to the plot of this Hollywood movie.</p> <p>Building on work done by physicist <a href="https://phys.technion.ac.il/en/people/faculty/person/44">Amos Ori</a> two decades prior, and armed with her strong computational skills, <a href="https://doi.org/10.1103/PhysRevD.98.104024">Mallary built a computer model</a> that would capture most of the essential physical effects on a spacecraft, or any large object, falling into a large, rotating black hole like Sagittarius A*.</p> <h3>Not Even a Bumpy Ride?</h3> <p>What she discovered is that under all conditions an object falling into a rotating black hole would not experience infinitely large effects upon passage through the hole’s so-called inner horizon singularity. This is the singularity that an object entering a rotating black hole cannot maneuver around or avoid. Not only that, under the right circumstances, these effects may be negligibly small, allowing for a rather comfortable passage through the singularity. In fact, there may no noticeable effects on the falling object at all. This increases the feasibility of using large, rotating black holes as portals for hyperspace travel.</p> <p>Mallary also discovered a feature that was not fully appreciated before: the fact that the effects of the singularity in the context of a rotating black hole would result in rapidly increasing cycles of stretching and squeezing on the spacecraft. But for very large black holes like Gargantua, the strength of this effect would be very small. So, the spacecraft and any individuals on board would not detect it.</p> <figure class="align-center "><img src="https://images.theconversation.com/files/252558/original/file-20190105-32154-ve1zfw.png?ixlib=rb-1.1.0&amp;q=45&amp;auto=format&amp;w=754&amp;fit=clip" sizes="(min-width: 1466px) 754px, (max-width: 599px) 100vw, (min-width: 600px) 600px, 237px" srcset="https://images.theconversation.com/files/252558/original/file-20190105-32154-ve1zfw.png?ixlib=rb-1.1.0&amp;q=45&amp;auto=format&amp;w=600&amp;h=266&amp;fit=crop&amp;dpr=1 600w, https://images.theconversation.com/files/252558/original/file-20190105-32154-ve1zfw.png?ixlib=rb-1.1.0&amp;q=30&amp;auto=format&amp;w=600&amp;h=266&amp;fit=crop&amp;dpr=2 1200w, https://images.theconversation.com/files/252558/original/file-20190105-32154-ve1zfw.png?ixlib=rb-1.1.0&amp;q=15&amp;auto=format&amp;w=600&amp;h=266&amp;fit=crop&amp;dpr=3 1800w, https://images.theconversation.com/files/252558/original/file-20190105-32154-ve1zfw.png?ixlib=rb-1.1.0&amp;q=45&amp;auto=format&amp;w=754&amp;h=334&amp;fit=crop&amp;dpr=1 754w, https://images.theconversation.com/files/252558/original/file-20190105-32154-ve1zfw.png?ixlib=rb-1.1.0&amp;q=30&amp;auto=format&amp;w=754&amp;h=334&amp;fit=crop&amp;dpr=2 1508w, https://images.theconversation.com/files/252558/original/file-20190105-32154-ve1zfw.png?ixlib=rb-1.1.0&amp;q=15&amp;auto=format&amp;w=754&amp;h=334&amp;fit=crop&amp;dpr=3 2262w" alt=""/><figcaption><span class="caption">This graph depicts the physical strain on the spacecraft’s steel frame as it plummets into a rotating black hole. The inset shows a detailed zoom-in for very late times. The important thing to note is that the strain increases dramatically close to the black hole, but does not grow indefinitely. Therefore, the spacecraft and its inhabitants may survive the journey.</span><span class="attribution"><span class="source">Khanna/UMassD</span></span></figcaption></figure><p>The crucial point is that these effects do not increase without bound; in fact, they stay finite, even though the stresses on the spacecraft tend to grow indefinitely as it approaches the black hole.</p> <p>There are a few important simplifying assumptions and resulting caveats in the context of Mallary’s model. The main assumption is that the black hole under consideration is completely isolated and thus not subject to constant disturbances by a source such as another star in its vicinity or even any falling radiation. While this assumption allows important simplifications, it is worth noting that most black holes are surrounded by cosmic material – dust, gas, radiation.</p> <p>Therefore, a natural extension of <a href="https://doi.org/10.1103/PhysRevD.98.104024">Mallary’s work</a> would be to perform a similar study in the context of a more realistic astrophysical black hole.</p> <p>Mallary’s approach of using a computer simulation to examine the effects of a black hole on an object is very common in the field of black hole physics. Needless to say, we do not have the capability of performing real experiments in or near black holes yet, so scientists resort to theory and simulations to develop an understanding, by making predictions and new discoveries.</p> <hr/><p><img src="https://counter.theconversation.com/content/107062/count.gif?distributor=republish-lightbox-advanced" alt="The Conversation" width="1" height="1"/></p> <p><span>This article is republished from</span> <a href="http://theconversation.com">The Conversation</a> <span>under a Creative Commons license. Read the</span> <a href="https://theconversation.com/rotating-black-holes-may-serve-as-gentle-portals-for-hyperspace-travel-107062">original article</a><span>.</span></p> Sun, 24 Mar 2019 23:28:28 +0000 https://daily.jstor.org/rotating-black-holes-may-serve-as-gentle-portals-for-hyperspace-travel/ Why I Switched from Python to Clojure (2016) https://www.bradcypert.com/why-i-switched-from-python-to-clojure/ https://www.bradcypert.com/why-i-switched-from-python-to-clojure/ <p>First – a bit of background. When I first started learning programming, I started with a course in high school that focused on Java. From there, I decided I wanted to work for a start-up and I had to learn python (I was naive). I started playing with Python and it just felt right – at first. I spent some more time with it and started to realize that I needed something more. Here’s a brief list of the reasons why I switched.</p> <h4 id="interpretedlanguage">Interpreted Language</h4> <p>Python is a dynamic language. There’s a massive list of Pros and Cons for this, but I’ll highlight a few of my concerns.</p> <ul><li>It’s easy to introduce bugs on uncommon code paths that would be much more obvious in a compiled language.</li> <li>The performance of an interpreted language is almost always slower than a compiled language.</li> </ul><p>Those things aside, I <strong>LOVED</strong> being able to quickly run code with a fast turn around time. When testing, I didn’t have to worry about compiling anything and, when I was developing with Flask, tools like Live-Reload were things I didn’t want to give up.</p> <p>With Clojure, I found that I could have the benefits of an Interpreted Language and the benefits of a compiled language, too! By leveraging Clojure’s REPL, I’m able to quickly test code before/while/after I write it. You’re able to switch into your Clojure codes namespace and test any functions you’ve written, as well as get the source code for any specific function, or check the docs for any function too! If you’re not using the REPL when you’re writing Clojure, you really should give it a try! If you’re using Leinengen, you can run <code>lein repl</code> from your project directory!</p> <p>With Clojure, you compile down to Java Byte Code when you run your application or library. You get the benefits and performance optimizations of a compiled language, but can treat it like an interpreted language when developing. It’s great!</p> <h4 id="classesvsdata">Classes Vs Data</h4> <p>When I moved from Java to Python, I fell in love with Mutable Dictionaries. I became very intimate with the dictionary API and defaulted to using them instead of classes because they often met my needs on their own and honestly, the “implied self parameter” on python methods turned me off. Dictionaries are basically just a map data structure. </p> <p>When I learned about Clojure, I was baffled by their lack of classes, but felt liberated by the thought of only writing functions in namespaces. I decided to give it a try and immediately started thinking of Dictionaries in Python and how I didn’t enjoy writing classes. With Clojure, I’m able to focus on what the data looks like, and not on how an object is expected to act (What’s an instance of a class but a hash-map with some namespaced functions anyways?).</p> <h4 id="immutabledatastatelesscode">Immutable Data &amp; Stateless Code</h4> <p>Like most now-functional programmers, I had <strong>THE</strong> incident. I had a class with several methods, but only two were particularly important. Both methods were getters, but the 1st method updated the value that was returned by the 2nd. This was extremely misleading when the code executed. In fact, almost all of the bugs with this code revolved around this theme. I didn’t know what to do and I thought this was the expected way to write code. I later read a great post on immutable data and tried writing my python code this way. This worked great – until I started working with other developers.</p> <p>With Clojure, you have to fight to use mutable data structures (that’s not to say it’s impossible, it’s just not the default). More importantly, if you’re working with Clojure developers, chances are they’re very familiar with the benefits of immutable data. I say “fight” because you do have to put forth some effort to do it, but you often don’t really want to. </p> <p><br/><ins class="adsbygoogle" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-8945603214034079" data-ad-slot="2376037128"/><br/></p> <h4 id="community">Community</h4> <p>Don’t get me wrong, the Python community is great. Probably one of the best ones out there, actually. By comparison, Clojure’s community is very small. As you know, the communities are the groups of people responsible for building libraries for the language to use and helping people who get stuck with strange error messages or confusing domain problems. In terms of libraries, Clojure has extremely nice Java Interoperability (Clojure can call Java code directly from itself). This means that Clojure has access to ALL Java libraries and any clojure libraries as well. That’s a vast amount of libraries!</p> <p>The support and documentation for most Clojure things pales in comparison to python, it’s true, but what I have noticed is that it matters where it counts. Clojure’s core API is relatively lean and extremely well documented. Additionally, the Clojure community didn’t experience the weird split that Pythonistas had with Python2 and Python3 (I’d imagine this is worked out by now, but I haven’t kept up with Python since I stopped writing it for anything more than scripts).</p> <h4 id="no__init__pyor__setup__py">No __init__.py or __setup__.py</h4> <p>A shitty reason to dislike python, but these both irritated me a LOT. <br/>For those who don’t know, and __init__.py file is used to declare a directory as a python module, while a __setup__.py is used to define how other scripts should interact with yours. That being said, neither of these have to do just that. In fact, I feel like the expectations for what each should do is extremely vague and troublesome. Some people prefer to import modules into their __init__.py or even add convenience functions there, too. It’s often easy to overlook these files, but if you can’t find the definition for a particular function or module, check the __init__.py</p> <p>As for __setup__.py, you should probably just call the <code>setup</code> function from <code>distutils.core</code>. But, you can do more in that file – so much more! In fact, the actual documentation on this is pretty vague on what all should exist in a setup file, and can be found <a href="https://docs.python.org/3/distutils/setupscript.html">here</a>.</p> <p>In Clojure, everything is handled in a nice <code>project.clj</code> file, if you’re using Leinengen. That being said, you can also use a nice, structured <code>.gradle</code> file, if that’s more your cup of tea. A <code>project.clj</code> file is defined similar to a <code>package.json</code> if you’ve ever used NPM for a JavaScript Project. </p> <h4 id="theswitch">The Switch</h4> <p>To sum everything up, I switched predominantly because I wanted to speed and comfort of the JVM, but wanted a language that supported functional programming paradigms. Which do you prefer – Python or Clojure or something else? Comment below and let me know!</p> Sun, 24 Mar 2019 18:43:17 +0000 https://www.bradcypert.com/why-i-switched-from-python-to-clojure/ Prince Of Persia Code Review (2013) http://fabiensanglard.net/prince_of_persia/index.php http://fabiensanglard.net/prince_of_persia/index.php <link rel="alternate" type="application/rss+xml" title="Fabien Sanglard » Feed" href="http://fabiensanglard.net/rss.xml"/><link rel="alternate" type="application/rss+xml" title="Fabien Sanglard » Comments Feed" href="http://fabiensanglard.net/rss.xml"/><p>June 14th, 2013</p> <p id="paperbox"> <a href="http://fabiensanglard.net/prince_of_persia/index.php"> <img class="shadowed" src="http://fabiensanglard.net/prince_of_persia/prince_of_persia.png"/></a> On Apr 17, 2012 Jordan Mechner <a href="http://jordanmechner.com/blog/2012/04/source/">released the source code</a> of Prince of Persia.</p><p>Even though it is the Apple II version written in 6502 assembly language, it was a pleasant experience to dive in the code of that mythical game: As usual there were many fascinating sofware wizardries to discover.</p><p>The Apple II apparent poor environment for game programming was actually ground to unmatched innovation and creativity : From self-modifying code, in-house bootloader, clever floppy disc format to skewing lookup tables: Prince Of Persia features engineering treasures in every modules.</p><p>Reading the source allowed me not only to learn about the game development process of the 80s but it also renewed my appreciation for things that we take for granted today.</p><p>As usual I took numerous notes that I have cleaned up on this page. I hope it will inspire others to read more source code and become better engineers.</p><p><u>Acknowledgment :</u> I would like to thank Miles.J from 6502.org and Roland Gustafsson (author of RWTS18) for patiently sharing their knowledge with me. </p><p><a href="http://fabiensanglard.net/prince_of_persia/index.php">Part I : Introduction</a><br/><a href="http://fabiensanglard.net/prince_of_persia/pop_boot.php">Part II : Bootloader</a><br/><a href="http://fabiensanglard.net/prince_of_persia/pop_boot2.php">Part III : Code explained</a></p><p><u>EDIT June 17th, 2013 :</u> Jordan Mechner commented on this article (#32).<br/><u>EDIT June 17th, 2013 :</u> Andreas Varga (whom reverse engineer POP before the source code release) also commentd (#41) !</p> <h3>Where to start ?</h3> <p id="paperbox"> The <a href="https://github.com/jmechner/Prince-of-Persia-Apple-II">source code</a> is available in a GitHub repository and can be downloaded with one command: <br/></p><pre class="long"> git clone git://github.com/jmechner/Prince-of-Persia-Apple-II.git </pre> <p> The interesting part is in <code>/Prince-of-Persia-Apple-II/01 POP Source/Source/</code> which contains the game engine made of numerous <code>.S</code> files.<br/>That is the first thing that programmers back then did not have: High level languages with high quality compilers. To achieve high performances developers had to work down to the metal using 6502 assembly. This is what those <code>.S</code> files are. <img src="http://fabiensanglard.net/fd_proxy/prince_of_persia/files_to_ram.png"/><br/>According to Jordan Mechner's book: <a href="http://www.amazon.com/The-Making-Prince-Persia-Journals/dp/1468093657/ref=sr_1_1?ie=UTF8&amp;qid=1370971768&amp;sr=8-1&amp;keywords=making+of+prince+of+persia">Making of Prince of Persia</a>, POP used Merlin assembler.</p><p>One of the good feature of Merlin is the <code>ORG</code> directive which allows to hint the assembler where the instructions will be loaded in RAM: In POP, there is a <code>ORG</code> directive at the top of every files.</p><p><u><b>Trivia :</b></u> <code>ORG</code> directives were really just hints. There was no operating system and no linker/loader on Apple II: The developer had to "somehow" manage to transfer the instructions from floppy disc to the intended location. <br/></p><div readability="39.197711471611"> <br/>The second important thing to understand to get POP big picture is how modules communicate together. Since there were no inter-file linker back then (and no final executable, only fragments) modules have to communicate by jumping into the void...where other modules are supposed to be.<p><img src="http://fabiensanglard.net/fd_proxy/prince_of_persia/intermod_jumps.png"/><br/>As an example we can see in the bootloader <code>BOOT.S</code> at <a href="https://github.com/fabiensanglard/Prince-of-Persia-Apple-II/blob/master/01%20POP%20Source/Source/BOOT.S#L138">line 138</a>: <br/></p><pre class="long"> jmp $ee00 </pre> <p> Which is a bit mysterious.</p><p>In order to follow the instruction stream we need to find out what is at <code>$ee00</code>. With a little grep command we can see <code>org = $ee00</code> in <code>HIRES.S</code> and carry on.</p><div readability="53.536916208791"> <p>Because there were no linkers, developers of the 80s had to know the memory layout of their engine and understand their RAM budget. It is a practice that is quite uncommon today since a lot of professionals rely on garbage collectors or use auto-resizing vectors. <br/></p> <br/><h3>6502 Assembly</h3> <p id="paperbox"> That is it for the big picture and how to navigate sub-systems. Now to understand the content of each module, you must know a bit about the CPU. Luckily, the 6502 is a simple 16 bits processor with only three registers that can address 64K of RAM (bank switching extended that to 128K), no floating-point capabilities and no segmentation for a total of only 56 instructions.</p><p><img class="shadowed" src="http://fabiensanglard.net/lazy_load/grey.gif" data-original="/fd_proxy/prince_of_persia/6502_instructions.png"/></p><div readability="12"> The drawing on the left shows how simple everything is:<br/><ul><li>Grey: 64KB of RAM, including 256 bytes reserved for the stack.</li> <li>Blue: 3 registers X,A,Y (8bits).</li> <li>Green: One 16 bits Program Counter.</li> <li>Red: One 8 bits Stack Pointer.</li> <li>Yello: A few STATUS flags.</li> </ul> Most operation are for loading and storing the register, X and Y register have simple instructions while the Accumulator is a little bit more fancy but overall it is straightforward and well documented. </div> <p> Two great books that are unfortunately out of print today : <a href="http://fabiensanglard.net/fd_proxy/prince_of_persia/a2rm.pdf">Apple II Reference Manual</a> and <a href="http://fabiensanglard.net/fd_proxy/prince_of_persia/Inside%20the%20Apple%20IIe.pdf">Inside the Apple IIe</a>.</p><p><img class="shadowed" src="http://fabiensanglard.net/lazy_load/grey.gif" data-original="/fd_proxy/prince_of_persia/books.JPG"/></p> <br/><h3>Starting point</h3> <p id="paperbox"> There were no IDEs in the 80s and there are no C source files with a <code>main</code> method today so we cannot really tell where the program starts. In order to know where to read first we have to know how the Apple II booted:<br/></p><ol><li>Read the first byte X of sector 0 on track 0 from the floppy disk.</li> <li>Load X sector(s) from track 0 to RAM at address <code>$800</code>.</li> <li>Start executing code at <code>$800</code>.</li> </ol><p> In order to find the starting point we can look what module was hinted to run at <code>$800</code> by searching for <code>ORG</code> directive: </p><pre class="long"> fabiensanglard$ find . -name "*.S" -exec grep -H "org = \$800" {} \; ./01 POP Source/Source/BOOT.S:org = $800 ./02 POP Disk Routines/CP.525/POPBOOT0.S:org = $800 ./03 Disk Protection/POPBOOT0.S:org = $800 ./04 Support/MakeDisk/DRAZ/DRAZ.S:org = $800 ./04 Support/MakeDisk/S/BOOT.S:org = $800 </pre> <p> So the starting point is in <code>BOOT.S</code>: a file that we will see it later contains POP bootloader. </p> <h3>Recommend readings</h3> <p id="paperbox"> Jordan Mechner published his journals (available as a book or a pdf). It is a very accurate description of what game developers have to go through during the development of a game: Doubt, pressure, despair hope and excitement to name only a few feelings.</p><p><a href="http://www.amazon.com/The-Making-Prince-Persia-Journals/dp/1468093657/ref=sr_1_1?ie=UTF8&amp;qid=1370971768&amp;sr=8-1&amp;keywords=making+of+prince+of+persia"><img src="http://fabiensanglard.net/fd_proxy/prince_of_persia/pop_book.jpg" class="shadowed-book"/></a> <a href="http://www.amazon.com/The-Making-Karateka-Journals-1982-1985/dp/1480297232/ref=sr_1_1?ie=UTF8&amp;qid=1370978099&amp;sr=8-1&amp;keywords=making+of+karateka"> <img src="http://fabiensanglard.net/fd_proxy/prince_of_persia/karateka_book.jpeg" class="shadowed-book"/></a> </p><p>For the more technically inclined, check out the developer notes that was intended to Atari/Amniga/PC developers (those ports did not go very well but I won't spoil the "Making Of" journal).</p><p><a href="http://fabiensanglard.net/fd_proxy/prince_of_persia/popsource009.pdf"><img src="http://fabiensanglard.net/fd_proxy/prince_of_persia/pop_tech_doc.png" class="shadowed-book"/></a> <a href="http://fabiensanglard.net/fd_proxy/prince_of_persia/Beneath%20Apple%20DOS.pdf"><img src="http://fabiensanglard.net/fd_proxy/prince_of_persia/beneath_apple_DOS.png" class="shadowed-book"/></a> <a href="http://fabiensanglard.net/fd_proxy/prince_of_persia/Inside%20the%20Apple%20IIe.pdf"><img src="http://fabiensanglard.net/fd_proxy/prince_of_persia/inside_apple_II.png" class="shadowed-book"/></a> <a href="http://fabiensanglard.net/fd_proxy/prince_of_persia/a2rm.pdf"><img src="http://fabiensanglard.net/fd_proxy/prince_of_persia/apple_reference_manual.png" class="shadowed-book"/></a> </p><p>A few videos from the legendary rotoscoping process and featuring "Tina LaDeau" (the Princess) that is mentioned in Jordan's diary ;) !</p><p><u><b>Note :</b></u> Jordan Mechner did an AMA on Reddit in January 2013, you can find it <a href="http://www.reddit.com/r/IAmA/comments/14e6p3/im_jordan_mechner_creator_of_prince_of_persia_and/">here</a>. </p> <h3>Next</h3> <p id="paperbox"> <a href="http://fabiensanglard.net/prince_of_persia/pop_boot.php">Prince Of Persia Bootloader</a> </p> <h2>Comments</h2> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <!--<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> --> <h2> </h2> <p>Fabien Sanglard @2013</p> </div> </div> Sun, 24 Mar 2019 20:15:11 +0000 http://fabiensanglard.net/prince_of_persia/index.php Power Circuit Teardown on Arduino Uno and Mega https://mindchasers.com/dev/hw-arduino-power https://mindchasers.com/dev/hw-arduino-power <div itemprop="text" readability="139.36915662651"> <h2>Overview</h2> <p> This article is a review of the power circuits on the Arduino <a href="https://store.arduino.cc/usa/arduino-uno-rev3" target="_blank"> Uno Rev3</a> and <a href="https://store.arduino.cc/usa/mega-2560-r3" target="_blank">Mega 2560 Rev3</a>. We're designing shields for both of these boards, so in addition to reading Arduino's user documentation, it's important for us to reverse engineer, understand, and document the capabilities and limitations of the power circuits and related connector I/O. </p> <p> The on-board power circuits are simple, low cost, and rely on <a href="https://en.wikipedia.org/wiki/Low-dropout_regulator" target="_blank">Low Drop Out</a> (LDO) linear regulators for power conversion. Also, it appears that the power circuits for UNO and MEGA are virtually identical. </p> <p>For the purpose of our analysis, we have downloaded the UNO and MEGA design files from the Arduino website (see references below) and imported them into Altium Designer. We also have an UNO and MEGA on our lab bench with a programable power supply &amp; scope. The circuit pack snippets shown in the figures below are taken from screen shots of the design files within Altium Designer.</p> <p> <b>Disclaimer: Our notes below are based on an informal study &amp; review. We are not the designer of these boards, and the information provided below may be inaccurate. Also, use caution when working with low voltage power circuitry as improper use may cause smoke, fire and / or skin burns.</b> </p><p> The notes below should be read along with Arduino's online power <a href="https://store.arduino.cc/usa/arduino-uno-rev3" target="_blank">documentation</a>. </p> <svg class="mc-graphics-line-divider "><line x1="0" y1="0" x2="2000" y2="0"/></svg><h2>Stack up and Ground</h2> <p>Both UNO and MEGA are two layer boards. There are no internal power or ground planes. Instead, copper ground pours have been liberally placed around the routing of signals and power traces (see figure below, ground is shown in red). The use of a two-layer board is consistent with low cost; however, the lack of a ground plane will lead to circuit loops and inconsistent characteristic impedance / signal reflections. This can make for a noisy board from the view of electromagnetic radiation, especially when the frequencies and currents increase.</p> <p>Also note in the figure below the lack of ground pins on the peripheral I/O connectors. This creates signal integrity challenges when designing a shield for an UNO (or MEGA) base.</p> <figure><img src="https://mindchasers.com/static/images/arduino/top_ground_pour.jpg" alt="Top Ground Pour"/><figcaption>Figure 1. Uno Digital Ground (GND) on Top Layer</figcaption></figure><svg class="mc-graphics-line-divider "><line x1="0" y1="0" x2="2000" y2="0"/></svg><h2>Power Rails</h2> <p>Arduino UNO and MEGA rely on LDO linear regulators for power conversion (e.g., 5V to 3.3V). If you're not familiar with a linear regulator, you can still move forward at this point by conceptualizing that it works like an adaptive resistor that provides a constant voltage to a load under varying current conditions. This adaptive resistance is provided by a transistor within the regulator, and the term "drop out" refers to the condition when the transistor / regulator can no longer regulate the voltage. Drop out occurs when the difference between the input and output voltages fall below a minimum threshold.</p> <p>As you probably already know, UNO and MEGA can be powered via either the USB jack or the barrel connector (see figures 2 and 3 below). If both voltage supplies are supplied simultaneously, the voltage on the barrel connector wins out as long as its slightly greater than twice 3.3V (our tests showed ~7.2V). At this voltage, the op amp in Figure 3 (U5A) drives high and turns off the P-channel FET (T1). Remember that P-channel FETs turn on when the gate voltage is low (GATE_CMD signal).</p> <p>Note that Arduino states 7V is within its recommended range for VIN. Our testing shows that VIN near 7V can lead to a situation where the system switches back and forth between being powered by USB and the barrel jack (VIN), depending on load and its regulation. We suspect the use of VIN @ 7V could create an unstable system and should be avoided. Also, when working with Arduino with USB and a VIN power supply below 8V, it is a good idea to monitor the FET's GATE_CMD signal to confirm that it is stable.</p> <p>As Figure 2 shows, the barrel jack voltage supply, which must be greater than 5V, is supplied to a 1.0 A OnSemi NCP1117 LDO fixed-volgate regulator. This is an extremely simple circuit, but keep in mind that it is very inefficient, especially when using a 12V wall wart (efficiency ~= 5/12 = 40%). If you're drawing near 1A, the power loss will be near 7W! Also, note that this input does not appear to be fused.</p> <p>Arduino tells it's users not to supply 5V on the 5V I/O connector, and the circuit in Figure 2 shows that driving 5V directly means driving the output of the LDO, and this is typically a bad idea. Figure 3 conveys the same concept for 3.3V (don't back drive the output of a regulator).</p> <figure><img src="https://mindchasers.com/static/images/arduino/uno_sch_pwr_to_5v.jpg" alt="VIN"/><figcaption>Figure 2. Uno Power In to +5V</figcaption></figure><p> Figure 3 shows how the aforementioned P-channel FET (T1) is used to either switch the USBVCC onto the 5V rail or isolate it, depending on the value of VIN (barrel jack supply). Either way, the 5V rail feeds into a Texas Instruments 150 mA 3.3V LP2985 LDO. Arduino recommends not drawing more than 50 mA<sup>1</sup> even though the regulator appears to be rated higher. We suspect this is due to managing the overall power / current on the board when using a USB supply, which is limited to 500 mA. Also, heat / power dissipation may be an issue. </p> <p>Regarding power dissipation and heat, this can be a substantial issue when using a shield and drawing a lot of current from the regulators. In these instances, it's probably a good idea to use inter-board connectors with long posts.</p> <figure><img src="https://mindchasers.com/static/images/arduino/uno_sch_vin_to_3v.jpg" alt="VIN"/><figcaption>Figure 3. Uno VIN to +3V3</figcaption></figure><svg class="mc-graphics-line-divider "><line x1="0" y1="0" x2="2000" y2="0"/></svg><h2>PCB Screen Shots</h2> <p>Figures 4 and 5 below show the routing of VIN and +5V respectively. Red is the top of the board, and blue is the bottom of the board. Note in Figure 5 that IOREF is tied directly to 5V.</p> <figure><img src="https://mindchasers.com/static/images/arduino/uno_vin.jpg" alt="VIN"/><figcaption>Figure 4. Uno VIN</figcaption></figure><figure><img src="https://mindchasers.com/static/images/arduino/uno_5v.jpg" alt="VIN"/><figcaption>Figure 5. Uno +5V (and IOREF)</figcaption></figure><svg class="mc-graphics-line-divider "><line x1="0" y1="0" x2="2000" y2="0"/></svg><h2>Summary</h2> <p>We'll continue to update this article as we develop &amp; improve our shields for the Arduino ecosystem.</p> <p>Our analysis has shown us the following regarding shield design: </p><ul><li>A shield with on-board, high efficiency switching regulators should power the base via VIN. This will save considerable power and heat.</li> <li>If the shield powers the base, leave the 3V and 5V pins disconnected.</li> </ul><p>Please let us know below if we have mis-stated something or you want us to add certain information.</p> <svg class="mc-graphics-line-divider "><line x1="0" y1="0" x2="2000" y2="0"/></svg><h2>References and Footnotes</h2> <ol><li>We're told by a member on Reddit that the 3.3V 50mA recommendation is a holdover from previous designs that relied on an FTDI device for 3V regulation.</li> </ol></div><p> Didn't find an answer to your question? Post your issue below or in our <span class="mc-highlight-green">new</span> <a href="https://mindchasers.com/forum" target="_blank">FORUM</a>, and we'll try our best to help you find a solution. </p><p> And please note that we update our site daily with new content related to our open source approach to network security and system design. If you would like to be notified about these changes, then please follow us on <a href="https://twitter.com/Mindchasers" target="_blank">Twitter</a> and join our <a class="mc-mail-list-focus" href="https://mindchasers.com/dev/hw-arduino-power#mc-mail-list">mailing list</a>. </p> Mon, 25 Mar 2019 05:18:56 +0000 https://mindchasers.com/dev/hw-arduino-power Pulling JPGs out of thin air (2014) http://lcamtuf.blogspot.com/2014/11/pulling-jpegs-out-of-thin-air.html http://lcamtuf.blogspot.com/2014/11/pulling-jpegs-out-of-thin-air.html This is an interesting demonstration of the capabilities of <a href="http://code.google.com/p/american-fuzzy-lop">afl</a>; I was actually pretty surprised that it worked! <p/> <pre>$ mkdir in_dir $ echo '<span>hello</span>' &gt;in_dir/hello $ ./afl-fuzz -i in_dir -o out_dir <span>./jpeg-9a/djpeg</span></pre> <p/> In essence, I created a text file containing just "hello" and asked the fuzzer to keep feeding it to a program that expects a JPEG image (<i>djpeg</i> is a simple utility bundled with the ubiquitous <i><a href="http://www.ijg.org/">IJG jpeg</a></i> image library; <a href="http://libjpeg-turbo.virtualgl.org/"><i>libjpeg-turbo</i></a> should also work). Of course, my input file does not resemble a valid picture, so it gets immediately rejected by the utility: <p/> <pre>$ ./djpeg '../out_dir/queue/id:000000,orig:hello' <span>Not a JPEG file: starts with 0x68 0x65</span></pre> <p/> Such a fuzzing run would be normally completely pointless: there is essentially no chance that a "hello" could be ever turned into a valid JPEG by a traditional, format-agnostic fuzzer, since the probability that dozens of random tweaks would align just right is astronomically low. <p/> Luckily, <i>afl-fuzz</i> can leverage lightweight assembly-level instrumentation to its advantage - and within a millisecond or so, it notices that although setting the first byte to <i>0xff</i> does not change the externally observable output, it triggers a slightly different internal code path in the tested app. Equipped with this information, it decides to use that test case as a seed for future fuzzing rounds: <p/> <pre>$ ./djpeg '../out_dir/queue/id:000001,src:000000,op:int8,pos:0,val:-1,+cov' <span>Not a JPEG file: starts with 0xff 0x65</span></pre> <p/> When later working with that second-generation test case, the fuzzer almost immediately notices that setting the second byte to <i>0xd8</i> does something even more interesting: <p/> <pre>$ ./djpeg '../out_dir/queue/id:000004,src:000001,op:havoc,rep:16,+cov' <span>Premature end of JPEG file JPEG datastream contains no image</span></pre> <p/> At this point, the fuzzer managed to synthesize the valid file header - and actually realized its significance. Using this output as the seed for the next round of fuzzing, it quickly starts getting deeper and deeper into the woods. Within several hundred generations and several hundred million <i>execve()</i> calls, it figures out more and more of the essential control structures that make a valid JPEG file - SOFs, Huffman tables, quantization tables, SOS markers, and so on: <pre>$ ./djpeg '../out_dir/queue/id:000008,src:000004,op:havoc,rep:2,+cov' <span>Invalid JPEG file structure: two SOI markers</span> <span>...</span> $ ./djpeg '../out_dir/queue/id:001005,src:000262+000979,op:splice,rep:2' <span>Quantization table 0x0e was not defined</span> <span>...</span> $ ./djpeg '../out_dir/queue/id:001282,src:001005+001270,op:splice,rep:2,+cov' &gt;.tmp; ls -l .tmp <span>-rw-r--r-- 1 lcamtuf lcamtuf 7069 Nov 7 09:29 .tmp</span></pre> <p/> The first image, hit after about six hours on an 8-core system, looks very unassuming: it's a blank grayscale image, 3 pixels wide and 784 pixels tall. But the moment it is discovered, the fuzzer starts using the image as a seed - rapidly producing a wide array of more interesting pics for every new execution path: <p/> <img height="341" src="http://lcamtuf.coredump.cx/afl_demo/first_jpegs.jpg" style="border: 1px solid teal" width="800"/><p/> Of course, synthesizing a complete image out of thin air is an extreme example, and not necessarily a very practical one. But more prosaically, fuzzers are meant to stress-test every feature of the targeted program. With instrumented, generational fuzzing, lesser-known features (e.g., progressive, black-and-white, or arithmetic-coded JPEGs) can be <a href="http://lcamtuf.coredump.cx/afl_demo/">discovered and locked onto</a> without requiring a giant, high-quality corpus of diverse test cases to seed the fuzzer with. <p/> The cool part of the <i>libjpeg</i> demo is that it works without any special preparation: there is nothing special about the "hello" string, the fuzzer knows nothing about image parsing, and is not designed or fine-tuned to work with this particular library. There aren't even any command-line knobs to turn. You can throw <i>afl-fuzz</i> at many other types of parsers with similar results: with bash, it will <a href="http://lcamtuf.blogspot.com/2014/10/bash-bug-how-we-finally-cracked.html">write valid scripts</a>; with <i>giflib</i>, it will make GIFs; with <i>fileutils</i>, it will create and flag ELF files, Atari 68xxx executables, x86 boot sectors, and UTF-8 with BOM. In almost all cases, the performance impact of instrumentation is minimal, too. <p/> Of course, not all is roses; at its core, <i>afl-fuzz</i> is still a brute-force tool. This makes it simple, fast, and robust, but also means that certain types of atomically executed checks with a large search space may pose an insurmountable obstacle to the fuzzer; a good example of this may be: <p/> <pre>if (strcmp(header.magic_password, <span>"h4ck3d by p1gZ"</span>)) goto terminate_now;</pre> <p/> In practical terms, this means that <i>afl-fuzz</i> won't have as much luck "inventing" PNG files or non-trivial HTML documents from scratch - and will need a starting point better than just "hello". To consistently deal with code constructs similar to the one shown above, a general-purpose fuzzer would need to understand the operation of the targeted binary on a wholly different level. There is some progress on this in the academia, but frameworks that can pull this off across diverse and complex codebases in a quick, easy, and reliable way are probably still years away. <p/> <span>PS. Several folks asked me about symbolic execution and other inspirations for <i>afl-fuzz</i>; I put together some notes in <a href="http://lcamtuf.coredump.cx/afl_demo/long_story.txt">this doc</a>.</span> <div style="clear: both;"/> Sat, 23 Mar 2019 15:44:02 +0000 http://lcamtuf.blogspot.com/2014/11/pulling-jpegs-out-of-thin-air.html Ask HN: Best way to test accessibility of a website? https://news.ycombinator.com/item?id=19473737 https://news.ycombinator.com/item?id=19473737 <tr class="athing comtr " id="19475842" readability="11.594174757282"><td> <table border="0" readability="5.7970873786408"><tr readability="11.594174757282"><td class="ind"><img src="https://news.ycombinator.com/s.gif" height="1" width="0"/></td><td valign="top" class="votelinks"><center><a id="up_19475842" href="https://news.ycombinator.com/vote?id=19475842&amp;how=up&amp;goto=item%3Fid%3D19473737"/></center></td><td class="default"><br/><div class="comment" readability="14.438123752495"> <span class="commtext c00" readability="20.383233532934">Pay me to do it...<p>But in all seriousness, I use aXe-Coconut[1], headingsMaper[2]. Then tab through the page and make sure you can get from top left to bottom right. The cursor[focus state /ouline] should be visible the whole time and you should never lose your place.</p><p>When you are done that, if you have a Mac turn on voiceover with Command+F5 and use Safari or Chrome (more aria-support). On Windows, download NVDA[3] and FireFox. Again use the keyboard to go through the page, but listen to the screen reader and make sure everything is spoken like it looks. So a button should say, "Submit Form Button" etc. Anything that doesn't say anything, ie, " button" or say something different from what you see needs work.</p><p>The general consense of the community is that automated testing only finds 30% of issues, so you've got to test manually.</p><p>[1] <a href="https://chrome.google.com/webstore/detail/axe-coconut/iobddmbdndbbbfjopjdgadphaoihpojp?hl=en" rel="nofollow">https://chrome.google.com/webstore/detail/axe-coconut/iobddm...</a> [2] <a href="https://chrome.google.com/webstore/detail/headingsmap/flbjommegcjonpdmenkdiocclhjacmbi?hl=en" rel="nofollow">https://chrome.google.com/webstore/detail/headingsmap/flbjom...</a> [3] <a href="https://www.nvaccess.org/" rel="nofollow">https://www.nvaccess.org/</a></p></span> </div></td></tr></table></td></tr><tr class="athing comtr " id="19480452" readability="1.4769230769231"><td> </td></tr><tr class="athing comtr " id="19478481" readability="9.5053435114504"><td> <table border="0" readability="4.7526717557252"><tr readability="9.5053435114504"><td class="ind"><img src="https://news.ycombinator.com/s.gif" height="1" width="0"/></td><td valign="top" class="votelinks"><center><a id="up_19478481" href="https://news.ycombinator.com/vote?id=19478481&amp;how=up&amp;goto=item%3Fid%3D19473737"/></center></td><td class="default"><br/><div class="comment" readability="14.891472868217"> <span class="commtext c00" readability="21.023255813953">Microsoft recently open sourced[1] one of the main tools they use for web accessibility testing.<p>Accessibility Insights for Web (<a href="https://accessibilityinsights.io" rel="nofollow">https://accessibilityinsights.io</a>) is a Chrome extension that guides you through doing an accessibility assessment of a website. It includes a combination of automated checks (using aXe[2]) and assisted/guided manual checks. Its rules are based on the W3C Web Content Accessibility Guidelines[3]; passing a full assessment in the tool amounts to meeting all the "A" and "AA" WCAG 2.0 requirements.</p><p>Like other commenters have mentioned, automated checks (like aXe) are a great start, but aren't really sufficient on their own. Accessibility Insights will lead you through how to test different aspects of screen reader usage (and other types of accessibility issues, too!). It will also help you track issues as you go, and produce a pretty report at the end that you can attach to a bug.</p><p>As with most types of UI testing, no matter what tools you're using, there's really no substitute for watching a real user try to use your product.</p><p>Disclaimer: I am an engineer that works for Microsoft on the Accessibilty Insights team.</p><p>[1] <a href="https://cloudblogs.microsoft.com/opensource/2019/03/12/microsoft-open-sources-accessibility-insights/" rel="nofollow">https://cloudblogs.microsoft.com/opensource/2019/03/12/micro...</a> [2] <a href="https://www.deque.com/axe/" rel="nofollow">https://www.deque.com/axe/</a> [3] <a href="https://www.w3.org/WAI/WCAG21/quickref/" rel="nofollow">https://www.w3.org/WAI/WCAG21/quickref/</a></p></span> </div></td></tr></table></td></tr><tr class="athing comtr " id="19480189" readability="12.711111111111"><td> </td></tr><tr class="athing comtr " id="19480134" readability="8.9359391965255"><td> <table border="0" readability="4.4679695982628"><tr readability="8.9359391965255"><td class="ind"><img src="https://news.ycombinator.com/s.gif" height="1" width="0"/></td><td valign="top" class="votelinks"><center><a id="up_19480134" href="https://news.ycombinator.com/vote?id=19480134&amp;how=up&amp;goto=item%3Fid%3D19473737"/></center></td><td class="default"><br/><div class="comment" readability="11.39012208657"> <span class="commtext c00" readability="13.668146503885">There is a great Chrome extension called aXe[1], as well as tools like Tenon[2] which also has a rest API so you can potentially set it up as part of a CI workflow.<p>It's worth remembering that "accessibility" is a broad term. If you want a tool which can identify some common antipatterns and the WCAG guideline(s) they violate, the tools I've mentioned are a good place to start. But if you want to create a truly accessible website which is also usable by people with special needs, you'll need experts to come in to carry out audits and specialised user testing.</p><p>Please feel free to drop me an email using the address in my HN profile. I'm a usability and accessibility professional, and disabled to boot. Happy to answer any questions you might have and connect you with other great resources, tools and people.</p><p>[1] <a href="https://chrome.google.com/webstore/detail/axe/lhdoppojpmngadmnindnejefpokejbdd" rel="nofollow">https://chrome.google.com/webstore/detail/axe/lhdoppojpmngad...</a></p><p>[2] <a href="https://tenon.io/" rel="nofollow">https://tenon.io/</a></p></span> </div></td></tr></table></td></tr><tr class="athing comtr " id="19480353" readability="5.5687732342007"><td> </td></tr><tr class="athing comtr " id="19480259" readability="9.6238938053097"><td> <table border="0" readability="4.8119469026549"><tr readability="9.6238938053097"><td class="ind"><img src="https://news.ycombinator.com/s.gif" height="1" width="0"/></td><td valign="top" class="votelinks"><center><a id="up_19480259" href="https://news.ycombinator.com/vote?id=19480259&amp;how=up&amp;goto=item%3Fid%3D19473737"/></center></td><td class="default"><br/><div class="comment" readability="7.5"> <span class="commtext c00" readability="5">Hire an engineer who needs accommodation. I mean that in jest of course, but only sort of. For a while I had an engineer on my team who was dyslexic and while not color blind themselves, were very in tune with the color blind community. They made huge improvements on not only our front end UX, but also on our codebase.<p>For example, apparently camelCase is really bad for dyslexics, and interstitial underscores are always_preferred.</p></span> </div></td></tr></table></td></tr><tr class="athing comtr " id="19480284" readability="6.5870206489676"><td> <table border="0" readability="3.2935103244838"><tr readability="6.5870206489676"><td class="ind"><img src="https://news.ycombinator.com/s.gif" height="1" width="40"/></td><td valign="top" class="votelinks"><center><a id="up_19480284" href="https://news.ycombinator.com/vote?id=19480284&amp;how=up&amp;goto=item%3Fid%3D19473737"/></center></td><td class="default"><br/><div class="comment" readability="6"> <span class="commtext c00" readability="2">There are multiple forms of dyslexia. For instance, I have one form and I have a daughter with a completely different variety. I have no problems with camelCase, but I am very particular about my fonts (Consolas for life).<p>I don’t like _ because of the keyboard placement. I don’t trust my pinkies at those angles.</p></span> </div></td></tr></table></td></tr><tr class="athing comtr " id="19480301" readability="5.6304347826087"><td> </td></tr><tr class="athing comtr " id="19475597" readability="6.8814616755793"><td> <table border="0" readability="3.4407308377897"><tr readability="6.8814616755793"><td class="ind"><img src="https://news.ycombinator.com/s.gif" height="1" width="0"/></td><td valign="top" class="votelinks"><center><a id="up_19475597" href="https://news.ycombinator.com/vote?id=19475597&amp;how=up&amp;goto=item%3Fid%3D19473737"/></center></td><td class="default"><br/><div class="comment" readability="11"> <span class="commtext c00" readability="12">We had to do this a few years ago for a major bank. Automated tools like a11y will only get you a certain amount of the way. Your tests will say 100% but your app may still be completely useless to blind people especially if you’re using an SPA as all screen readers perform differently.<p>Having a partially sighted consultant come in and point out the deficiencies and how they use devices was extremely helpful. A lot of sight impaired people use Apple devices as their voiceover support is excellent, Android is getting better but you will find a lot of differences between their implementations in versions which is extremely frustrating. For desktop on windows JAWS seems to be the most used which again has its own way of parsing.</p><p>I don’t know if it’s changed but my advice would be plenty of manual testing, there’s really not much else than actually using the devices with voiceover enabled to test if things actually work properly. And it’s also a case of compromise and picking what devices to support as fixing something on one reader will inevitably break another.</p><p>Hope that helps :)</p></span> </div></td></tr></table></td></tr><tr class="athing comtr " id="19475890" readability="5.68125"><td> <table border="0" readability="2.840625"><tr readability="5.68125"><td class="ind"><img src="https://news.ycombinator.com/s.gif" height="1" width="0"/></td><td valign="top" class="votelinks"><center><a id="up_19475890" href="https://news.ycombinator.com/vote?id=19475890&amp;how=up&amp;goto=item%3Fid%3D19473737"/></center></td><td class="default"><br/><div class="comment" readability="7"> <span class="commtext c00" readability="4">Use aXe for automated tests and test everything manually with JAWS + Firefox (most popular screen reader Desktop combination) and iOS VoiceOver (most troubling mobile issues in my experience).<p>If you can afford in your project, use a external service that tests with people with different disabilities.</p></span> </div></td></tr></table></td></tr><tr class="athing comtr " id="19476164" readability="1.0928571428571"><td> </td></tr><tr class="athing comtr " id="19480166" readability="9.7852028639618"><td> <table border="0" readability="4.8926014319809"><tr readability="9.7852028639618"><td class="ind"><img src="https://news.ycombinator.com/s.gif" height="1" width="80"/></td><td valign="top" class="votelinks"><center><a id="up_19480166" href="https://news.ycombinator.com/vote?id=19480166&amp;how=up&amp;goto=item%3Fid%3D19473737"/></center></td><td class="default"><br/><div class="comment" readability="14.5"> <span class="commtext c00" readability="19">&gt; JAWS + IE is the most popular combination<p>It's worth keeping a few points in mind when reading these results:</p><p>1. The survey was carried out in October 2017. Things can and do move quite rapidly in this area, especially given the increased number of users who will be running Windows 10 now who may not have been back then.</p><p>2. IE won't be around forever, and once the accessibility of Microsoft Edge improves (which is likely to happen pretty soon when they adopt Chromium), IE will become less and less relevant.</p><p>3. NVDA with Firefox is a much more common combination than JAWS with Firefox, primarily because the NVDA developers recommend it. Freedom Scientific (makers of JAWS) have historically pushed IE perhaps more than other browsers, so it will be interesting to see how that changes as Edge becomes more usable.</p></span> </div></td></tr></table></td></tr><tr class="athing comtr " id="19480359" readability="2.3839285714286"><td> </td></tr><tr class="athing comtr " id="19480267" readability="1.4242424242424"><td> </td></tr><tr class="athing comtr " id="19474556" readability="4.3145161290323"><td> </td></tr><tr class="athing comtr " id="19474873" readability="2.7272727272727"><td> <table border="0" readability="1.3636363636364"><tr readability="2.7272727272727"><td class="ind"><img src="https://news.ycombinator.com/s.gif" height="1" width="0"/></td><td valign="top" class="votelinks"><center><a id="up_19474873" href="https://news.ycombinator.com/vote?id=19474873&amp;how=up&amp;goto=item%3Fid%3D19473737"/></center></td><td class="default"><br/><div class="comment" readability="6"> <span class="commtext c00" readability="2">I'm also looking for something similar: you give it a list of routes and it will score each of them.<p>Doing this manually with Chrome's Audit tool for each route is time consuming.</p></span> </div></td></tr></table></td></tr><tr class="athing comtr " id="19474820" readability="3.5668789808917"><td> <table border="0" readability="1.7834394904459"><tr readability="3.5668789808917"><td class="ind"><img src="https://news.ycombinator.com/s.gif" height="1" width="0"/></td><td valign="top" class="votelinks"><center><a id="up_19474820" href="https://news.ycombinator.com/vote?id=19474820&amp;how=up&amp;goto=item%3Fid%3D19473737"/></center></td><td class="default"><br/><div class="comment" readability="6.5"> <span class="commtext c00" readability="3">I've used the Wave extension for Chrome.<p>Also, being able to use the website with a screen reader (with your eyes closed) is a good metric.</p></span> </div></td></tr></table></td></tr><tr class="athing comtr " id="19475627" readability="0.53846153846154"><td> </td></tr><tr class="athing comtr " id="19480160" readability="5.3714285714286"><td> <table border="0" readability="2.6857142857143"><tr readability="5.3714285714286"><td class="ind"><img src="https://news.ycombinator.com/s.gif" height="1" width="0"/></td><td valign="top" class="votelinks"><center><a id="up_19480160" href="https://news.ycombinator.com/vote?id=19480160&amp;how=up&amp;goto=item%3Fid%3D19473737"/></center></td><td class="default"><br/><div class="comment" readability="7"> <span class="commtext c00" readability="4">Don't forget to check your website with a colorblindness simulator. This is a manual process unfortunately<p>Also with things like high contrast, high zoom level or increased font size, etc</p></span> </div></td></tr></table></td></tr><tr class="athing comtr " id="19474779" readability="1.258064516129"><td> </td></tr> Sun, 24 Mar 2019 02:17:44 +0000 https://news.ycombinator.com/item?id=19473737 The Vannoken Tribe https://www.vannokenculture.org/about/ https://www.vannokenculture.org/about/ <p>The Vannokens are a post-American Indo-European ethnic group, native to Alaska.</p> <h2>Our History</h2> <p>Vannoken culture started as a series of social experiments conducted over social media to test left-wing political theories in 2015. Mike Norton wanted to know, considering the difference between culture and race, if cultural independence could be declared from African-Americans with the invention of a new language. </p> <figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"/><p>When the idea was positively received on social media by conservatives and libertarians, he ran with it. He got the support of Senator candidate Bob McNeil in a digitally written declaration of <g class="gr_ gr_19 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep" id="19" data-gr-id="19">independence,</g> and bought land in Alaska to make it official.</p> <p>It was also digitally signed by several other military veterans Mike served with. The Vannoken Declaration of Cultural Independence is published on this website.</p> <p>Mike, as well as a few others, disagreed with mainstream African-American politics. He was never given the choice to elect the African-American leaders who claimed to represent him in the media. He believed that the majority of left-leaning African-Americans are repulsed by the idea of taking personal responsibility for their history, while surrendering to a mentality of victimization. </p> <p>Meanwhile, right-leaning African-Americans (like <g class="gr_ gr_3 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="3" data-gr-id="3">Hoteps</g>) tend to be black identitarians who hold grudges against whites and revise history.</p> <p>At the same time, both groups tend to think in terms of Jim Crow laws, particularly the 1-Drop Rule. This is a cultural belief in mainstream black cultures that prevents/makes it uncool for Mike to embrace his European heritage as a mixed-race person. </p> <p>While agreeing with none of the major black groups, he also didn’t support segregating himself from whites <g class="gr_ gr_15 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" id="15" data-gr-id="15">like</g> the right-leaning blacks do. As a mixed-race person, he wanted to embrace all sides of his <g class="gr_ gr_13 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" id="13" data-gr-id="13">heritages</g> (European, African, and/or whatever else) while not subscribing to a globalist NWO mentality. </p> <p>This would require him to develop his own language, and have his own official land. Without that kind of cultural individuality, he would be no different than anyone else. </p> <p>American culture allows for different kinds of cultural individuality. He liked none of the major African-American cultures; thus, he took it upon himself to lay the foundations of his own, for all cultures start somewhere. </p> <p>The Vannokens started with five families, including his wife and children. The point is to simply prove that it can be <g class="gr_ gr_87 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep" id="87" data-gr-id="87">done,</g> since African-American slavery destroyed what would have been his original language and culture. </p> <p>It’s a herculean task, but one believed worthy of devoting his life to. To be consistent with the declaration, Mike and the Vannoken tribe have protested African-American benefits by <em>relinquishing</em> any and all African-American benefits, or any governmental benefits at all, that are not equally available to whites. To aid this, Mike checks “white” or “other” whenever required to clarify his ethnicity for job, college, or other institutional applications. This is not because he thinks he is white; it is to legally relieve employers of the legal pressure to hire him on the basis of his skin color alone.</p> <figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"/><h2>Who Are We?</h2> <p>Basically, we started as a small motley crew with similar backgrounds. Most of the original members come from broken homes with tragic pasts. Many of us are the children of R-selection non-strategies, born out of wedlock. We started our lives without fathers and mothers. Some of us experienced heavy abuse. </p> <p>Yet, we were lucky enough to have been born as outliers. Perhaps, some of us had an abnormally high IQ, or some innate talent that led to us having a different fate than ruin. These made us misfits in our original cultures. Meanwhile, we are not <em>victims</em> of our misfortune. Our cultural journey of self-actualization is about developing a sense of personal responsibility and developing the strength necessary to master our lives’ tragedies.</p> <p>The core, original members met as military veterans in the Navy. While on deployment, we bonded as brothers before going our separate ways. Though, we stayed in contact throughout the years and watched ourselves start families.</p> <p>Meanwhile, we realized that it’s entirely possible to rebuild one’s own culture. To press our own reset button. Simply because we suffered, doesn’t mean that our children have to in the same way. We don’t have to follow the same behavior of our parents and theirs before them. We realized that we could switch from R- to K-reproductive strategies by self-actualizing, and thus reset our cycle of familial destruction with courage and sheer willpower.</p> <p>English colonials once declared cultural independence from England. Vannoken culture started with an African-American declaring cultural independence from African-Americans.</p> <p>We decided to rebuild our culture, from the ground up. We’ve pressed the reset button. From a tribal philosophy, to our own language and land, we’ve declared ourselves our own people.</p> <h2>What Are We?</h2> <p>We’re a small, growing ethnic group with our own developing traditions and language. We consider ourselves Indo-European, because most of our maternal chromosomes are European. This holds true, even if some of the tribe members are not white-dominant in physical appearance. Many are, though. Meanwhile, the 1-Drop Rule of the Jim Crow laws has been rendered long defunct.</p> <p>Because of this, there is no distinct look to the first-generation Vannokens. However, most (though, not all) of the <em>second</em> generation is turning out to look akin to Icelanders. Many of our children have blonde or auburn hair, light skin, and high cheek bones. Following this pattern, the Vannokens are likely to continue evolving into being white-dominant in the future, with a distinct bone structure. Though, it’s important to reinforce that a physical look is not the focus of what makes a Vannoken a Vannoken.</p> <p>Thus, we’ve sought to rebuild our culture on principles inspired by Martin Luther King’s legendary speech about judging people by the content of their character, rather than the color of their skin. All <em>original</em> members of the tribe are genomic hybrids; however, <g class="gr_ gr_317 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="317" data-gr-id="317">race</g> is not the point. Non-interracial Vannoken families are absolutely fine; one does not have to be mixed to be a part of the tribe, either. That wouldn’t be a tribe based on the content of people’s character, otherwise. </p> <p>We consider ourselves one of the first “post-American” Native American tribes. The term “post-American” refers to an ethnic group forming as native to North American soil <em>after</em> the founding of the United States. This is to present a clear technical designation between us and the “pre-American” Native American tribes, such as the Cherokee, or Mohicans. We call ourselves a tribe because the “tribe” is the first form of any civilization. Perhaps, many generations in the future, it would be appropriate to call us something else.</p> <p>Most of us so happen to be libertarian, capitalistic thinkers. However, this is a byproduct of our personalities. There is no actual, mandatory, restricted way of thinking that would prevent deviation. “Thought-crimes” do not exist in Vannoken culture. Individualistic freedom is paramount; the rights of the individual <g class="gr_ gr_44 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="44" data-gr-id="44">supercede</g> the rights of the collective. Traditional American constitutional values are at our cultural core.</p> <p>Our unifying philosophy is one of individualism, self-determinism, self-actualization, meritocracy, and personal responsibility. Self-reflection and critical thinking for one’s personal evolution <g class="gr_ gr_102 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" id="102" data-gr-id="102">is</g> cultural. </p> <p>Therein, two Vannokens may have completely different personalities, religions, and life directions. They may agree on some things, while disagreeing on others. There is also a sense of traditional and liberal Vannoken culture. The leader has the power to say what is traditional and what is not. But, in the event that any member wants to deviate from traditional Vannoken culture (such as in parenting style), that’s fine. The difference in opinion doesn’t make the non-traditional Vannoken any less Vannoken; they are just considered non-traditional.</p> <p>What unifies us as a people are our traditions, values, language, food, and land. Though, not every Vannoken speaks the language fluently. Not everyone follows every tradition. Meanwhile, there is no punishment system for not adhering to values in a perfect manner. Conduct is laissez-faire; actions punish or reward themselves without cultural leadership interference. </p> <p>American laws and its judicial system govern the tribe and all its members equally. There is no special exalted status for the leader. The leader’s role is only to use his or her skills to benefit the tribe. This includes, but isn’t limited to, business consulting, hosting fundraisers, and public relations. Meanwhile, there is no monetary requirement to be a part of the tribe. <g class="gr_ gr_171 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="171" data-gr-id="171">Most</g> tribal property, such as this website, is paid for out of the leader’s own pocket, without any financial strain on the members.</p> <p>Our traditions are for preserving methods of solving family problems. After solving a family challenge, we reflect on the experience. A tradition then forms to preserve the solution and pass it on to future generations. Our leadership may never initiate any kind of force upon its members for any cultural reason. Meanwhile, all Vannoken traditions are optional, and religion-neutral.</p> <p>The name of our language is “Vanno.” It’s a constructed language (“conlang” for short). We engineered Vanno from the mechanics of all the major business languages of the world. English, Russian, Spanish, Mandarin Chinese, and Japanese are <g class="gr_ gr_30 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="30" data-gr-id="30">primary</g> ingredients of the language. Though, there are also tiny elements of Icelandic and Ancient Norse within it. For instance, such as with “æ” and “ð” characters, we use the Icelandic digital keyboard to type Vanno, until we develop our own.</p> <p>We’ve declared Alaska our native land. This occurred by purchasing private property used for our declaration of cultural independence. Though, there is no requirement for any individual member of the tribe to live on the land at any one time. There is also no requirement for any tribe members to visit the land at any particular time.<br/>Some members of the tribe are serving in the military, overseas. Others already have land and homes of their own in different parts of America. Some are civilian expats living outside of America. We made the initial purchase of land for the sake of political solidification. However, tribe members are free to come and go as they please and live anywhere they wish.</p> <p>We are free from Jim Crow laws. Therein, we acknowledge all genetic and cultural ancestors. Children of biracial families within the tribe are free to honor any ancestors they wish. This holds true, regardless of genetic percentages of the child’s makeup. We consider all other racial groups in America our cousins because of genetic connection, yet cultural separation.</p> <p>Traditional Vannoken food is eclectic, reflecting mixed experiences and cultures we’ve come in contact with while traveling the world. Our diet is ketogenic, for the most part; this means it’s high in proteins and fats, while low in sugars. Though, this does not mean that we don’t eat sugary foods <em>at all</em>.</p> <p>Vannoken culture is the result of the melting pot theory. Though, it’s not a culture derived from post-modernistic thinking. This is part of why we declared cultural independence. It is the result of cultural and racial intermixing; yet, it is its own entity with a solid value system. </p> <p>There are no mind-altering practices within Vannoken culture. There are no cultural requirements for meditation or rationalizations for drugs. For instance, an individual Vannoken may be a Buddhist or practice Yoga. As a part of these, they may meditate. But their decision to meditate is individualistic as a part of studying Buddhism or Yoga. That is not Vannoken culture, itself. </p> <p>Our concept of merit pertains to how one benefits society. This includes our usefulness to people outside of the ethnic group. How we serve our country, build helpful technology, and accomplish good things in the economy. This ethnic group formed in large part because we disagreed with the current African-American leaders and public figures. We didn’t elect them to represent us in the media. They do not speak for us. This website serves as a means for full transparency of every element of the culture. Only three aspects of information are withheld:</p> <ul><li>How to speak Vanno, itself</li><li>The personal information (eg. names and locations) of each tribe member</li><li>The precise number of the tribe’s population</li></ul><p>Meanwhile, we are not very concerned with growing our population. Most of us would like to have as many children as possible. There are also opportunities for other people to join on a case-by-case scenario. However, there is no major push for any kind of recruitment. </p> <p>Learning Vanno is withheld from the public for national security reasons. During WWII, the United States military used Navajo to help gain an advantage over foreign enemies with encoded messages. In the event that the US military would need another language to use for the same purpose, it’s better if the language is kept exclusive. Threats to national security could use Vanno against America, otherwise.</p> <p>The individual locations of the tribe members, as well as the exact number of how many Vannokens there are, are kept secret. This is for our personal safety.</p> <p>There <em>is</em> a sense of an in- and out-group, but this is not deliberate. It’s merely the natural <em>byproduct</em> of the following:</p> <ul><li>Not everyone in the world speaks our language.</li><li>We keep our own family records of who’s in the tribe for genealogical purposes (such as <g class="gr_ gr_23 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" id="23" data-gr-id="23">childbirths</g>). <g class="gr_ gr_29 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep" id="29" data-gr-id="29">Though,</g> this is to develop our own sense of history, and nothing more.</li></ul><p>So, if you’re not a child of a Vannoken family, and/or you don’t speak the language, it’s natural to feel on the outside. But it’s the same context as who is a <g class="gr_ gr_4 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="4" data-gr-id="4">legal</g> American immigrant, and who is not.</p> <p>People can still benefit from Vannoken ideas, inventions, etc. even if they’re not members of the tribe. Many people outside of the tribe may read the content of this site and benefit their own lives. We fully encourage <g class="gr_ gr_6 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep" id="6" data-gr-id="6">this,</g> and specifically ask that you “appropriate” our culture, if you want. We stand against post-modern SJW politics.</p> <p>This is because we don’t believe in cultural appropriation, to begin with. Which is one of the many things we disagree with the current minority leaders in America <g class="gr_ gr_16 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation multiReplace" id="16" data-gr-id="16">about.</g></p> <h2>How Are We?</h2> <p>We are <em>not</em> oppressed. We are <em>already</em> free (with the exception of taxes). The age of African-American slavery is long over, and the Jim Crow laws are long gone. No one owes us anything. We would just like to move on and become our fullest, best selves. Our narrative struggle is the resistance against bygone thinking, and that is all.</p> <p>For us, it’s a matter of maintaining and maximizing the freedom <em>we already have</em> as we <g class="gr_ gr_47 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep" id="47" data-gr-id="47">self-actualize,</g> while forging our own path <em>away</em> from the majority of African-American voters in America.</p> <p>We fund the development of Vannoken culture in two ways:</p> <p>That’s all. There is <em>no</em> monetary requirement to be a part of the tribe, nor will there ever be. Vannoken economics is ultra-capitalistic. We build companies, large and small, to fund the purchasing of land and <g class="gr_ gr_562 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="562" data-gr-id="562">other</g> assets. This fulfills our mission to earn our way in life, our right to exist. Our companies would not function if we were not providing genuine value in the market, earning us our income to do with whatever we please to advance our culture.</p> <p>We <em>do not</em> want any kind of government assistance. The only government assistance we support are programs like the GI Bill, which first require the Vannoken to earn it by serving in the American military<g class="gr_ gr_442 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep" id="442" data-gr-id="442">.</g></p> <p>Our fundraisers are in the realm of selling t-shirts, books, etc. We <em>want</em> the challenge of building ourselves with the might of our character and the value of our skills. No more, no less. If we fail to provide the value to the international economy that earns us the revenue we need to advance ourselves, then we do not deserve to exist. </p> <p>We can also stop existing at any <g class="gr_ gr_5 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep" id="5" data-gr-id="5">time,</g> if we stop willing ourselves to by funding the development of our culture. We have a “Those who don’t work don’t eat” shared cultural attitude. May we evolve with the pressures of the closest we can get to a free-market, or perish with honor in the trying.</p> Mon, 25 Mar 2019 05:10:33 +0000 https://www.vannokenculture.org/about/ Our Chess Champion Has a Home https://www.nytimes.com/2019/03/23/opinion/sunday/homeless-chess-champion-tani.html https://www.nytimes.com/2019/03/23/opinion/sunday/homeless-chess-champion-tani.html <div readability="48.135698610095"><div class="css-53u6y8" readability="43.846378931968"><p class="css-1ygdjhk evys1bk0">Tanitoluwa Adewumi, age 8, skidded around the empty apartment, laughing excitedly, then leapt onto his dad’s back. “I have a home!” he said in wonderment. “I have a home!”</p><p class="css-1ygdjhk evys1bk0">A week ago, the boy was homeless, studying chess moves while lying on the floor of a shelter in Manhattan. Now Tani, as he is known, has a home, a six-figure bank account, scholarship offers from three elite private schools and <a class="css-1g7m0tk" href="https://twitter.com/BillClinton/status/1108099328718057473" title="" rel="noopener noreferrer" target="_blank">an invitation to meet</a> President Bill Clinton.</p><p class="css-1ygdjhk evys1bk0">“I think I am still dreaming,” said Tani’s dad, <!-- -->Kayode Adewumi.<!-- --> “I hope I don’t wake up.”</p><p class="css-1ygdjhk evys1bk0"><a class="css-1g7m0tk" href="https://www.nytimes.com/2019/03/16/opinion/sunday/chess-champion-8-year-old-homeless-refugee-.html?module=inline" title="">I wrote in my column</a> last weekend about Tani as a reminder of the principle that talent is universal, even if opportunity is not. A Nigerian refugee who had learned chess only a bit more than a year earlier, he had just defeated kids from elite private schools to win the New York state chess championship for his age group. He lugged a trophy nearly as big as he is back to the homeless shelter.</p><p class="css-1ygdjhk evys1bk0">Now the story gets even better.</p><p class="css-1ygdjhk evys1bk0">After my column about this hard-working family, <a class="css-1g7m0tk" href="https://www.gofundme.com/just-tani" title="" rel="noopener noreferrer" target="_blank">a GoFundMe drive raised</a> more than $200,000 for Tani, his parents and his brother. A half-dozen readers offered housing — in a couple of cases, palatial quarters. Immigration lawyers offered <!-- -->pro bono assistance<!-- --> to the Adewumis, who are in the country legally and seeking asylum. Three film companies are vying to make movies about Tani.</p></div><aside class="css-o6xoe7"/></div><div readability="34.5"><div class="css-53u6y8" readability="14"><p class="css-1ygdjhk evys1bk0">“I want my mom’s cooking again!” Tani mused as he explored the apartment. It was bare, but another donor had offered furniture, sheets and towels. Someone else was sending 100 chess books.</p><p class="css-1ygdjhk evys1bk0">Heartfelt thanks to all my readers for this generosity: I truly have the best readers.</p><p class="css-1ygdjhk evys1bk0">And now the story gets <em class="css-2fg4z9 e1gzwzxm0">even </em>better.</p></div><aside class="css-o6xoe7"/></div><div readability="43.841601392515"><div class="css-53u6y8" readability="33.496953872933"><p class="css-1ygdjhk evys1bk0">The Adewumis have decided that they will not spend a cent of the $200,000 GoFundMe money on themselves. They will take out a 10 percent tithe and donate it to their church, which helped them while they were homeless, and the rest will be channeled through a new Tanitoluwa Adewumi Foundation to help African immigrants who are struggling in the United States the way they were a week ago.</p><p class="css-1ygdjhk evys1bk0">“Anybody who is coming from Africa who is in the position we were in, we will help them,” Mr. Adewumi said, acknowledging that details need to be worked out.</p><p class="css-1ygdjhk evys1bk0">I asked them how they could turn down every penny of such a huge sum. Didn’t they want a celebration dinner? New iPhones? A vacation?</p><p class="css-1ygdjhk evys1bk0">“I’m a hardworking guy,” <!-- -->Mr. Adewumi explained<!-- -->. He has two jobs: He drives for Uber with a rented car and <a class="css-1g7m0tk" href="https://www.brickandmortar.com/thecompany#last-name" title="" rel="noopener noreferrer" target="_blank">sells real estate</a> through Brick &amp; Mortar. Someone has now offered him a free car so that he can keep more of the money he makes driving, and Tani’s mom was just offered a job as a health care aide at a hospital.</p><p class="css-1ygdjhk evys1bk0">I asked Tani if he was O.K. with seeing the $200,000 disappear. He <!-- -->shrugged.<!-- --> “I want to help other kids,” he said. “I don’t mind.”</p></div><aside class="css-o6xoe7"/></div><div readability="33"><div class="css-53u6y8" readability="11"><p class="css-1ygdjhk evys1bk0">Surely, I pressed him, there was some material object he coveted. There was a long silence. “Maybe a computer,” he acknowledged.</p></div><aside class="css-o6xoe7"/></div><div readability="50.5"><div class="css-53u6y8" readability="46"><p class="css-1ygdjhk evys1bk0">The family was tempted by the offers of full scholarships at top private schools. But Tani and his parents decided that while he might accept such a scholarship for middle school, he would be loyal and stick with the public elementary school, P.S. 116, that taught him chess and waived his fees for the chess club.</p><p class="css-1ygdjhk evys1bk0">“This school showed confidence in Tanitoluwa,” his mom, Oluwatoyin Adewumi, told the P.S. 116 principal, Jane Hsu. “So we return the confidence.” And then, overcome with emotion, the mom and the principal hugged.</p><p class="css-1ygdjhk evys1bk0">There’s a risk that a triumph like this leaves the impression that charity is the solution rather than a way to fill gaps: Fundamentally we need comprehensive systems in place to support needy kids. We would never build a bridge or subway with volunteers and donations, so why entrust an even more urgent cause — homeless children — to charity?</p><p class="css-1ygdjhk evys1bk0">Tani thrived because everything fell into place: a good school, a dedicated chess teacher and devoted parents committed to taking their son to every chess practice. The challenge is to replicate that supportive environment for all the other Tanis out there with public services and private philanthropy alike.</p><p class="css-1ygdjhk evys1bk0">One challenge I face is that readers often want to donate just to a particular individual I write about, without addressing the larger social problem. So it’s thrilling to see Tani and his parents use their good fortune to help other anonymous kids in need. In that, there’s a lesson for all of us.</p><p class="css-1ygdjhk evys1bk0">“God has already blessed me,” Mr. Adewumi told me. “I want to release my blessing to others.”</p></div><aside class="css-o6xoe7"/></div> Sun, 24 Mar 2019 19:53:40 +0000 https://www.nytimes.com/2019/03/23/opinion/sunday/homeless-chess-champion-tani.html A guide to threads in Node.js https://blog.logrocket.com/a-complete-guide-to-threads-in-node-js-4fa3898fe74f https://blog.logrocket.com/a-complete-guide-to-threads-in-node-js-4fa3898fe74f <div readability="88.627506354137"><figure name="e105" id="e105" class="graf graf--figure graf-after--h3"/><p name="d718" id="d718" class="graf graf--p graf-after--figure">Many people wonder how a single-threaded <a href="https://nodejs.org/en/" data-href="https://nodejs.org/en/" class="markup--anchor markup--p-anchor" rel="noopener" target="_blank">Node.js</a> can compete with multithreaded back ends. As such, it may seem counterintuitive that so many huge companies pick Node as their back end, given its supposed single-threaded nature. To know why,<strong class="markup--strong markup--p-strong"> </strong>we have to understand what we really mean when we say that Node is single-threaded.</p><p name="5aa1" id="5aa1" class="graf graf--p graf-after--p">JavaScript was created to be just good enough to do simple things on the web, like validate a form or, say, create a rainbow-colored mouse trail. It was <a href="https://www.youtube.com/watch?v=ztspvPYybIY" data-href="https://www.youtube.com/watch?v=ztspvPYybIY" class="markup--anchor markup--p-anchor" rel="noopener" target="_blank">only in 2009 that Ryan Dahl</a>, creator of Node.js, made it possible for developers to use the language to write back-end code.</p><p name="5fd4" id="5fd4" class="graf graf--p graf-after--p">Back-end languages, which generally support multithreading, have all kinds of mechanisms for syncing values between threads and other thread-oriented features. To add support for such things to JavaScript would require changing the entire language, which wasn’t really Dahl’s goal. For plain JavaScript to support multithreading, he had to create a workaround. Let’s explore …</p><h3 name="2c98" id="2c98" class="graf graf--h3 graf-after--p">How Node.js really works</h3><p name="88e6" id="88e6" class="graf graf--p graf-after--h3">Node.js uses two kinds of threads: a main thread handled by<em class="markup--em markup--p-em"> event loop</em> and several auxiliary threads in the <em class="markup--em markup--p-em">worker pool</em>.</p><p name="e49f" id="e49f" class="graf graf--p graf-after--p">Event loop is the mechanism that takes callbacks (functions) and registers them to be executed at some point in the future. It operates in the same thread as the proper JavaScript code. When a JavaScript operation blocks the thread, the event loop is blocked as well.</p><p name="bcab" id="bcab" class="graf graf--p graf-after--p">Worker pool is an execution model that spawns and handles separate threads, which then synchronously perform the task and return the result to the event loop. The event loop then executes the provided callback with said result.</p><p name="5d0b" id="5d0b" class="graf graf--p graf-after--p">In short, it takes care of asynchronous I/O operations — primarily, interactions with the system’s disk and network. It is mainly used by modules such as <code class="markup--code markup--p-code">fs</code> (I/O-heavy) or <code class="markup--code markup--p-code">crypto</code> (CPU-heavy). Worker pool is implemented in <a href="http://docs.libuv.org/en/v1.x/" data-href="http://docs.libuv.org/en/v1.x/" class="markup--anchor markup--p-anchor" rel="noopener" target="_blank">libuv</a>, which results in a slight delay whenever Node needs to communicate internally between JavaScript and C++, but this is hardly noticeable.</p><p name="3dec" id="3dec" class="graf graf--p graf-after--p">With both of these mechanisms, we are able to write code like this:</p><pre name="f63f" id="f63f" class="graf graf--pre graf-after--p" readability="5">fs.readFile(path.join(__dirname, './package.json'), (err, content) =&gt; {<br/>if (err) {<br/>return null;<br/>}<p>console.log(content.toString());<br/>});</p></pre><p name="4d9d" id="4d9d" class="graf graf--p graf-after--pre">The aforementioned <code class="markup--code markup--p-code">fs</code> module tells the worker pool to use one of its threads to read the contents of a file and notify the event loop when it is done. The event loop then takes the provided callback function and executes it with the content of the file.</p><p name="f17e" id="f17e" class="graf graf--p graf-after--p">Above is an example of a non-blocking code; as such, we don’t have to wait synchronously for something to happen. We tell the worker pool to read the file and call the provided function with the result. Since worker pool has its own threads, the event loop can continue executing normally while the file is being read.</p><p name="a39f" id="a39f" class="graf graf--p graf-after--p">It’s all good until there’s a need to synchronously execute some complex operation: any function that takes too long to run will block the thread. If an application has many such functions, it could significantly decrease the throughput of the server or freeze it altogether. In this case, there’s no way of delegating the work to the worker pool.</p><p name="0574" id="0574" class="graf graf--p graf-after--p">Fields that require complex calculations — such as AI, machine learning, or big data — couldn’t really use Node.js efficiently due to the operations blocking the main (and only) thread, making the server unresponsive. That was the case up until Node.js v10.5.0 came about, which added support for multiple threads.</p></div><div readability="346.26389491026"><h3 name="d0e4" id="d0e4" class="graf graf--h3 graf-after--figure">Introducing: <em class="markup--em markup--h3-em">worker_threads</em></h3><p name="5a11" id="5a11" class="graf graf--p graf-after--h3">The <code class="markup--code markup--p-code">worker_threads</code> module is a package that allows us to create fully functional multithreaded Node.js applications.</p><p name="da03" id="da03" class="graf graf--p graf-after--p">A thread worker is a piece of code (usually taken out of a file) spawned in a separate thread.</p><p name="1fed" id="1fed" class="graf graf--p graf-after--p">Note that the terms <em class="markup--em markup--p-em">thread worker</em>, <em class="markup--em markup--p-em">worker</em>, and <em class="markup--em markup--p-em">thread</em> are often used interchangeably; they all refer to the same thing.</p><p name="38a0" id="38a0" class="graf graf--p graf-after--p">To start using thread workers, we have to import the <code class="markup--code markup--p-code">worker_threads</code> module. Let’s start by creating a function to help us spawn these thread workers, and then we’ll talk a little bit about their properties.</p><pre name="ac22" id="ac22" class="graf graf--pre graf-after--p" readability="19">type WorkerCallback = (err: any, result?: any) =&gt; any;<p>export function runWorker(path: string, cb: WorkerCallback, workerData: object | null = null) {<br/>const worker = new Worker(path, { workerData });</p><p>worker.on('message', cb.bind(null, null));<br/>worker.on('error', cb);</p><p>worker.on('exit', (exitCode) =&gt; {<br/>if (exitCode === 0) {<br/>return null;<br/>}</p><p>return cb(new Error(`Worker has stopped with code ${exitCode}`));<br/>});</p><p>return worker;<br/>}</p></pre><p name="22a6" id="22a6" class="graf graf--p graf-after--pre">To create a worker, we have to create an instance of the <code class="markup--code markup--p-code">Worker</code> class. In the first argument, we provide a path to the file that contains the worker’s code; in the second, we provide an object containing a property called <code class="markup--code markup--p-code">workerData</code>. This is the data we’d like the thread to have access to when it starts running.</p><p name="e28a" id="e28a" class="graf graf--p graf-after--p">Note that whether you use JavaScript itself or something that transpiles to JavaScript (e.g., TypeScript), the path should always refer to files with either <code class="markup--code markup--p-code">.js</code> or <code class="markup--code markup--p-code">.mjs</code> extensions.</p><p name="7d40" id="7d40" class="graf graf--p graf-after--p">I would also like to point out why we used the callback approach as opposed to returning a promise that would be resolved when the <code class="markup--code markup--p-code">message</code> event is fired. This is because workers can dispatch many <code class="markup--code markup--p-code">message</code> events, not just one.</p><p name="af34" id="af34" class="graf graf--p graf-after--p">As you can see in the example above, the communication between threads is event-based, which means we are setting up listeners to be called once a given event is sent by the worker.</p><p name="af13" id="af13" class="graf graf--p graf-after--p">Here are the most common events:</p><pre name="39c1" id="39c1" class="graf graf--pre graf-after--p">worker.on('error', (error) =&gt; {});</pre><p name="5b05" id="5b05" class="graf graf--p graf-after--pre">The <code class="markup--code markup--p-code">error</code> event is emitted whenever there’s an uncaught exception inside the worker. The worker is then terminated, and the error is available as the first argument in the provided callback.</p><pre name="1e9a" id="1e9a" class="graf graf--pre graf-after--p">worker.on('exit', (exitCode) =&gt; {});</pre><p name="516c" id="516c" class="graf graf--p graf-after--pre"><code class="markup--code markup--p-code">exit</code> is emitted whenever a worker exits. If <code class="markup--code markup--p-code">process.exit()</code> was called inside the worker, <code class="markup--code markup--p-code">exitCode</code> would be provided to the callback. If the worker was terminated with <code class="markup--code markup--p-code">worker.terminate()</code>, the code would be 1.</p><pre name="72fe" id="72fe" class="graf graf--pre graf-after--p">worker.on('online', () =&gt; {});</pre><p name="6b32" id="6b32" class="graf graf--p graf-after--pre"><code class="markup--code markup--p-code">online</code> is emitted whenever a worker stops parsing the JavaScript code and starts the execution. It’s not used very often, but it can be informative in specific cases.</p><pre name="2ee4" id="2ee4" class="graf graf--pre graf-after--p">worker.on('message', (data) =&gt; {});</pre><p name="8c40" id="8c40" class="graf graf--p graf-after--pre"><code class="markup--code markup--p-code">message</code> is emitted whenever a worker sends data to the parent thread.</p><p name="b2a8" id="b2a8" class="graf graf--p graf-after--p">Now let’s take a look at how the data is being shared between threads.</p><h3 name="e433" id="e433" class="graf graf--h3 graf-after--p">Exchanging data between threads</h3><p name="bf44" id="bf44" class="graf graf--p graf-after--h3">To send the data to the other thread, we use the <code class="markup--code markup--p-code">port.postMessage()</code> method. It has the following signature:</p><pre name="5794" id="5794" class="graf graf--pre graf-after--p">port.postMessage(data[, transferList])</pre><p name="7304" id="7304" class="graf graf--p graf-after--pre">The port object can be either <code class="markup--code markup--p-code">parentPort</code> or an instance of <code class="markup--code markup--p-code">MessagePort</code> — more on that later.</p><h4 name="ec2c" id="ec2c" class="graf graf--h4 graf-after--p">The data argument</h4><p name="e7e2" id="e7e2" class="graf graf--p graf-after--h4">The first argument — here called <code class="markup--code markup--p-code">data</code> — is an object that is copied to the other thread. It can contain anything the copying algorithm supports.</p><p name="25f1" id="25f1" class="graf graf--p graf-after--p">The data is copied by the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm" data-href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm" class="markup--anchor markup--p-anchor" rel="noopener" target="_blank">structured clone algorithm</a>. Per Mozilla:</p><blockquote name="22b7" id="22b7" class="graf graf--blockquote graf-after--p">It builds up a clone by recursing through the input object while maintaining a map of previously visited references in order to avoid infinitely traversing cycles.</blockquote><p name="5bb9" id="5bb9" class="graf graf--p graf-after--blockquote">The algorithm doesn’t copy functions, errors, property descriptors, or prototype chains. It should also be noted that copying objects in this way is different than with JSON because it can contain circular references and typed arrays, for example, whereas JSON cannot.</p><p name="7599" id="7599" class="graf graf--p graf-after--p">By supporting the copying of typed arrays, the algorithm makes it possible to share memory between threads.</p><h4 name="05b5" id="05b5" class="graf graf--h4 graf-after--p">Sharing memory between threads</h4><p name="e332" id="e332" class="graf graf--p graf-after--h4">People may argue that modules like <code class="markup--code markup--p-code">cluster</code> or<em class="markup--em markup--p-em"> </em><code class="markup--code markup--p-code">child_process</code> enabled the use of threads a long time ago. Well, yes and no.</p><p name="8b4c" id="8b4c" class="graf graf--p graf-after--p">The <code class="markup--code markup--p-code">cluster</code> module can create multiple node instances with one master process routing incoming requests between them. Clustering an application allows us to effectively multiply the server’s throughput; however, we can’t spawn a separate thread with the <code class="markup--code markup--p-code">cluster</code> module.</p><p name="766f" id="766f" class="graf graf--p graf-after--p">People tend to use tools like PM2 to cluster their applications as opposed to doing it manually inside their own code, but if you’re interested, you can <a href="https://medium.freecodecamp.org/how-to-add-socket-io-to-multi-threaded-node-js-df404b424276" data-href="https://medium.freecodecamp.org/how-to-add-socket-io-to-multi-threaded-node-js-df404b424276" class="markup--anchor markup--p-anchor" rel="noopener" target="_blank">read my post</a> on how to use the <code class="markup--code markup--p-code">cluster</code> module.</p><p name="9ac8" id="9ac8" class="graf graf--p graf-after--p">The <code class="markup--code markup--p-code">child_process</code> module can spawn any executable regardless of whether it’s JavaScript. It is pretty similar, but it lacks several important features that <code class="markup--code markup--p-code">worker_threads</code> has.</p><p name="badb" id="badb" class="graf graf--p graf-after--p">Specifically, thread workers are more lightweight and share the same process ID as their parent threads. They can also share memory with their parent threads, which allows them to avoid serializing big payloads of data and, as a result, send the data back and forth much more efficiently.</p><p name="5bfc" id="5bfc" class="graf graf--p graf-after--p">Now let’s take a look at an example of how to share memory between threads. In order for the memory to be shared, an instance of <code class="markup--code markup--p-code">ArrayBuffer</code> or <code class="markup--code markup--p-code">SharedArrayBuffer</code> must be sent to the other thread as the data argument or inside the data argument.</p><p name="6816" id="6816" class="graf graf--p graf-after--p">Here’s a worker that shares memory with its parent thread:</p><pre name="65f4" id="65f4" class="graf graf--pre graf-after--p" readability="11">import { parentPort } from 'worker_threads';<p>parentPort.on('message', () =&gt; {<br/>const numberOfElements = 100;<br/>const sharedBuffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * numberOfElements);<br/>const arr = new Int32Array(sharedBuffer);</p><p>for (let i = 0; i &lt; numberOfElements; i += 1) {<br/>arr[i] = Math.round(Math.random() * 30);<br/>}</p><p>parentPort.postMessage({ arr });<br/>});</p></pre><p name="fc6d" id="fc6d" class="graf graf--p graf-after--pre">First, we create a <code class="markup--code markup--p-code">SharedArrayBuffer</code> with the memory needed to contain 100 32-bit integers. Next, we create an instance of <code class="markup--code markup--p-code">Int32Array</code>, which will use the buffer to save its structure, then we just fill the array with some random numbers and send it to the parent thread.</p><p name="6a5b" id="6a5b" class="graf graf--p graf-after--p">In the parent thread:</p><pre name="5c0b" id="5c0b" class="graf graf--pre graf-after--p" readability="11">import path from 'path';<p>import { runWorker } from '../run-worker';</p><p>const worker = runWorker(path.join(__dirname, 'worker.js'), (err, { arr }) =&gt; {<br/>if (err) {<br/>return null;<br/>}</p><p>arr[0] = 5;<br/>});</p><p>worker.postMessage({});</p></pre><p name="c8e0" id="c8e0" class="graf graf--p graf-after--pre">By changing <code class="markup--code markup--p-code">arr[0]</code> to <code class="markup--code markup--p-code">5</code>, we actually change it in both threads.</p><p name="9e6f" id="9e6f" class="graf graf--p graf-after--p">Of course, by sharing memory, we risk changing a value in one thread and having it changed in the other. But we also gain a very nice feature along the way: the value doesn’t need to be serialized to be available in another thread, which greatly increases efficiency. Simply remember to manage references to the data properly in order for it to be garbage-collected once you finish working with it.</p><p name="cfa7" id="cfa7" class="graf graf--p graf-after--p">Sharing an array of integers is fine, but what we’re really interested in is sharing objects — the default way of storing information. Unfortunately, there is no <code class="markup--code markup--p-code">SharedObjectBuffer</code><em class="markup--em markup--p-em"> </em>or similar, but we can <a href="https://stackoverflow.com/questions/51053222/nodejs-worker-threads-shared-object-store" data-href="https://stackoverflow.com/questions/51053222/nodejs-worker-threads-shared-object-store" class="markup--anchor markup--p-anchor" rel="noopener" target="_blank">create a similar structure ourselves</a>.</p><h4 name="3671" id="3671" class="graf graf--h4 graf-after--p">The transferList argument</h4><p name="b347" id="b347" class="graf graf--p graf-after--h4"><code class="markup--code markup--p-code">transferList</code> can only contain <code class="markup--code markup--p-code">ArrayBuffer</code> and <code class="markup--code markup--p-code">MessagePort</code>. Once they are transferred to the other thread, they can no longer be used in the sending thread; the memory is moved to the other thread and, thus, is unavailable in the sending one.</p><p name="b375" id="b375" class="graf graf--p graf-after--p">For the time being, we can’t transfer network sockets by including them in the <code class="markup--code markup--p-code">transferList</code> (which we can do with the <code class="markup--code markup--p-code">child_process</code> module).</p><h4 name="5ee7" id="5ee7" class="graf graf--h4 graf-after--p">Creating a channel for communications</h4><p name="e569" id="e569" class="graf graf--p graf-after--h4">Communication between threads is made through ports, which are instances of the <code class="markup--code markup--p-code">MessagePort</code> class and enable event-based communication.</p><p name="adc1" id="adc1" class="graf graf--p graf-after--p">There are two ways of using ports to communicate between threads. The first is the default and the easier of the two. Within the worker’s code, we import an object called <code class="markup--code markup--p-code">parentPort</code> from the <code class="markup--code markup--p-code">worker_threads</code> module and use the object’s <code class="markup--code markup--p-code">.postMessage()</code> method to send messages to the parent thread.</p><p name="9e85" id="9e85" class="graf graf--p graf-after--p">Here’s an example:</p><pre name="b3a7" id="b3a7" class="graf graf--pre graf-after--p">import { parentPort } from 'worker_threads';</pre><pre name="7089" id="7089" class="graf graf--pre graf-after--pre" readability="5">const data = {<br/><em class="markup--em markup--pre-em">// ...</em><br/>};<p>parentPort.postMessage(data);</p></pre><p name="bcb6" id="bcb6" class="graf graf--p graf-after--pre"><code class="markup--code markup--p-code">parentPort</code> is an instance of <code class="markup--code markup--p-code">MessagePort</code> that Node.js created for us behind the scenes to enable communication with the parent thread. This way, we can communicate between threads by using <code class="markup--code markup--p-code">parentPort</code> and <code class="markup--code markup--p-code">worker</code> objects.</p><p name="666c" id="666c" class="graf graf--p graf-after--p">The second way of communicating between threads is to actually create a <code class="markup--code markup--p-code">MessageChannel</code> on our own and send it to the worker. Here’s how we could create a new <code class="markup--code markup--p-code">MessagePort</code> and share it with our worker:</p><pre name="9155" id="9155" class="graf graf--pre graf-after--p" readability="16">import path from 'path';<br/>import { Worker, MessageChannel } from 'worker_threads';<p>const worker = new Worker(path.join(__dirname, 'worker.js'));</p><p>const { port1, port2 } = new MessageChannel();</p><p>port1.on('message', (message) =&gt; {<br/>console.log('message from worker:', message);<br/>});</p><p>worker.postMessage({ port: port2 }, [port2]);</p></pre><p name="6945" id="6945" class="graf graf--p graf-after--pre">After creating <code class="markup--code markup--p-code">port1</code> and <code class="markup--code markup--p-code">port2</code>, we set up event listeners on <code class="markup--code markup--p-code">port1</code> and send <code class="markup--code markup--p-code">port2</code> to the worker. We have to include it in the <code class="markup--code markup--p-code">transferList</code> for it to be transferred to the worker side.</p><p name="10d7" id="10d7" class="graf graf--p graf-after--p">And now, inside the worker:</p><pre name="cc80" id="cc80" class="graf graf--pre graf-after--p" readability="8">import { parentPort, MessagePort } from 'worker_threads';<p>parentPort.on('message', (data) =&gt; {<br/>const { port }: { port: MessagePort } = data;</p><p>port.postMessage('heres your message!');<br/>});</p></pre><p name="6d30" id="6d30" class="graf graf--p graf-after--pre">This way, we use the port that was sent by the parent thread.</p><p name="758f" id="758f" class="graf graf--p graf-after--p">Using <code class="markup--code markup--p-code">parentPort</code> is not necessarily a wrong approach, but it’s better to create a new <code class="markup--code markup--p-code">MessagePort</code> with an instance of <code class="markup--code markup--p-code">MessageChannel</code> and then share it with the spawned worker (read: separation of concerns).</p><p name="ab84" id="ab84" class="graf graf--p graf-after--p">Note that in the examples below, I use <code class="markup--code markup--p-code">parentPort</code> to keep things simple.</p><h3 name="664c" id="664c" class="graf graf--h3 graf-after--p">Two ways of using workers</h3><p name="2089" id="2089" class="graf graf--p graf-after--h3">There are two ways we can use workers. The first is to spawn a worker, execute its code, and send the result to the parent thread. With this approach, each time a new task comes up, we have to create a worker all over again.</p><p name="427b" id="427b" class="graf graf--p graf-after--p">The second way is to spawn a worker and set up listeners for the <code class="markup--code markup--p-code">message</code> event. Each time the <code class="markup--code markup--p-code">message</code> is fired, it does the work and sends the result back to the parent thread, which keeps the worker alive for later usage.</p><p name="b65e" id="b65e" class="graf graf--p graf-after--p">Node.js documentation recommends the second approach because of how much effort it takes to actually create a thread worker, which requires creating a virtual machine and parsing and executing the code. This method is also much more efficient than constantly spawning workers.</p><p name="20c4" id="20c4" class="graf graf--p graf-after--p">This approach is called worker pool because we create a pool of workers and keep them waiting, dispatching the <code class="markup--code markup--p-code">message</code> event to do the work when needed.</p><p name="150a" id="150a" class="graf graf--p graf-after--p">Here’s an example of a file that contains a worker that is spawned, executed, and then closed:</p><pre name="8998" id="8998" class="graf graf--pre graf-after--p" readability="7">import { parentPort } from 'worker_threads';<p>const collection = [];</p><p>for (let i = 0; i &lt; 10; i += 1) {<br/>collection[i] = i;<br/>}</p><p>parentPort.postMessage(collection);</p></pre><p name="9f09" id="9f09" class="graf graf--p graf-after--pre">After sending the collection to the parent thread, it simply exits.</p><p name="3a1e" id="3a1e" class="graf graf--p graf-after--p">And here’s an example of a worker that can wait for a long period of time before it is given a task:</p><pre name="8fe8" id="8fe8" class="graf graf--pre graf-after--p" readability="8">import { parentPort } from 'worker_threads';<p>parentPort.on('message', (data: any) =&gt; {<br/>const result = doSomething(data);</p><p>parentPort.postMessage(result);<br/>});</p></pre><h3 name="c69b" id="c69b" class="graf graf--h3 graf-after--pre">Useful properties available in the worker_threads module</h3><p name="4241" id="4241" class="graf graf--p graf-after--h3">There are a few properties available inside the <code class="markup--code markup--p-code">worker_threads</code> module:</p><h4 name="e414" id="e414" class="graf graf--h4 graf-after--p">isMainThread</h4><p name="614e" id="614e" class="graf graf--p graf-after--h4">The property is <code class="markup--code markup--p-code">true</code> when not operating inside a worker thread. If you feel the need, you can include a simple <code class="markup--code markup--p-code">if</code> statement at the start of a worker file to make sure it is only run as a worker.</p><pre name="d1cd" id="d1cd" class="graf graf--pre graf-after--p" readability="5">import { isMainThread } from 'worker_threads';<p>if (isMainThread) {<br/>throw new Error('Its not a worker');<br/>}</p></pre><h4 name="dd8e" id="dd8e" class="graf graf--h4 graf-after--pre">workerData</h4><p name="ae3b" id="ae3b" class="graf graf--p graf-after--h4">Data included in the worker’s constructor by the spawning thread.</p><pre name="9df0" id="9df0" class="graf graf--pre graf-after--p">const worker = new Worker(path, { workerData });</pre><p name="b9de" id="b9de" class="graf graf--p graf-after--pre">In the worker thread:</p><pre name="ce69" id="ce69" class="graf graf--pre graf-after--p" readability="5">import { workerData } from 'worker_threads';<p>console.log(workerData.property);</p></pre><h4 name="05ec" id="05ec" class="graf graf--h4 graf-after--pre">parentPort</h4><p name="87e4" id="87e4" class="graf graf--p graf-after--h4">The aforementioned instance of <code class="markup--code markup--p-code">MessagePort</code> used to communicate with the parent thread.</p><h4 name="f4e4" id="f4e4" class="graf graf--h4 graf-after--p">threadId</h4><p name="53e2" id="53e2" class="graf graf--p graf-after--h4 graf--trailing">A unique identifier assigned to the worker.</p></div> Sun, 24 Mar 2019 16:54:21 +0000 Maciej Cieślar https://blog.logrocket.com/a-complete-guide-to-threads-in-node-js-4fa3898fe74f?gi=66ae574fea3a How did two groups of fish separately evolve genes for making antifreeze? https://www.theatlantic.com/science/archive/2019/03/how-fish-evolved-antifreeze-junk/585226/ https://www.theatlantic.com/science/archive/2019/03/how-fish-evolved-antifreeze-junk/585226/ <p class="c-recirculation-link" data-id="injected-recirculation-link" id="injected-recirculation-link-0"><a href="https://www.theatlantic.com/science/archive/2019/01/unprecedentedly-thorough-evolution-experiment/581521/" data-omni-click="r'article',r'',d,r'intext',r'3',r'None'">Read: </a><a href="https://www.theatlantic.com/science/archive/2019/01/unprecedentedly-thorough-evolution-experiment/581521/" data-omni-click="r'article',r'',d,r'intext',r'4',r'None'">The wild experiment that showed evolution in real time</a></p><p>While discovering all this, Cheng and DeVries learned that at the other end of the world, <a href="https://www.pnas.org/content/pnas/94/8/3817.full.pdf" data-omni-click="r'article',r'',d,r'intext',r'5',r'None'">Arctic cod <em>also</em> make antifreeze proteins</a>, and their versions are built from exactly the same thralala units as the notothens’. The two groups had evolved almost identical antifreezes independently—a stunning example of convergent evolution, where two organisms turn up to life’s party in the same outfit. But there <em>was</em> a big difference between them: The cod antifreeze gene did <em>not </em>arise from a digestive one, and for the longest time Cheng couldn’t find its ancestor. “The gene had to have come from somewhere,” she says.</p><p>“These 1997 papers are classics,” says<a href="http://www.gen.tcd.ie/molevol/" data-omni-click="r'article',r'',d,r'intext',r'6',r'None'"> Aoife McLysaght</a> from Trinity College Dublin, who studies the evolution of new genes. “The case for the Antarctic one was very clear, but all they could say was that the Arctic one wasn’t the same. It was also a new gene, doing the same thing. But it had a different origin, and what that origin was wasn’t clear.”</p><p>Now, after 22 years, <a href="https://www.pnas.org/content/116/10/4400" data-omni-click="r'article',r'',d,r'intext',r'7',r'None'">Cheng has finally solved the mystery</a>, and the answer is stranger and more convoluted than she imagined. Her team, which includes her colleagues Xuan Zhuang, Chun Yang, and Katherine Murphy, compared three species of cod that make antifreeze with four that do not. They compared pieces of antifreeze genes from the former against the DNA of the latter, in the hope of finding sequences that shared a vague resemblance. They found a hit—but in a functionless stretch of cod DNA that doesn’t include any genes at all. Somehow, this region of useless junk gave rise to a new and <em>very </em>useful gene. And Cheng’s team has deduced how this happened, step-by-step.</p><p>First, through random chance, a short stretch of junk DNA was duplicated twice, creating four identical segments in a row. The stretches between these segments were <em>very close </em>to the code for the thralala unit, and through a single mutation, one of them turned into <em>exactly </em>the right code. This snippet then duplicated, over and over, creating the core of a new antifreeze gene.</p><p>But for genes to be useful, they need more than the right sequence. They also need to be next to switches that allow them to be activated in the right time and place. In this case, the newborn antifreeze gene was serendipitously reshuffled to a different spot in the cod genome, where it landed next to one such switch.</p><p>At this point, the ancestral cods had a gene for antifreeze and could switch that gene on. But they needed one last tweak: a small signal sequence that acts like a shipping label, allowing the antifreeze proteins to be exported from the cells that make them and into the rest of the animal’s body. Fortunately, that signal was already almost in place: It took just one mutation—the loss of a single DNA letter—to create it.</p> Sun, 24 Mar 2019 07:41:01 +0000 https://www.theatlantic.com/science/archive/2019/03/how-fish-evolved-antifreeze-junk/585226/ A Twist on the Spoon Theory https://streetlifesolutions.blogspot.com/2019/03/a-twist-on-spoon-theory.html https://streetlifesolutions.blogspot.com/2019/03/a-twist-on-spoon-theory.html "It's like 10,000 spoons when all you need is a knife." -- Ironic, by Alanis Morissette. <br/><iframe width="560" height="315" src="https://www.youtube.com/embed/Jne9t8sHpUc" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""/> <br/> You might already be familiar with <a href="https://butyoudontlooksick.com/articles/written-by-christine/the-spoon-theory/">The Spoon Theory</a>, especially if you are living with a disability. It's about the need to pick and choose how much you can do in a given day when living with a serious medical condition. <p>A lot of homeless people are on the street in part because they have a serious medical or mental health issue. Plus, being homeless comes with other built in challenges to activities of daily living. </p><p>You may not have access to a shower. You may need to stand in line for an hour or more at a soup kitchen to get a free meal. You routinely face prejudice and may get thrown out of places simply for being homeless, sometimes while they claim you trashed the bathroom when it was really someone else who did so. </p><p>Just getting through the day -- keeping yourself fed, attending to essential hygiene needs and other basic survival needs -- can take all your time, energy and wherewithal. It can be nearly impossible to carve out some time and energy for actually accomplishing anything, problem solving and moving your life forward. </p><p>I spent nearly six years homeless. I was very ill during that time. </p><p>My highest priority was getting myself healthier. It was my only hope of ever getting my life back. It also meant that just getting through the day in a way that moved that goal forward -- or at least didn't result in my condition getting worse -- often took all my time and energy. </p><p>My second highest goal was developing some kind of income from the street that had some hope of a future. Something that could potentially grow to a middle class lifestyle. </p><p>It's part of why I blog. Blogging is something I can futz around with when I feel like I have 10,000 chop sticks and zero spoons. </p><p>The Spoon Theory is about portioning out your energy for activities of daily living. When I was homeless, I often didn't feel like I could address activities of daily living at all. I often wanted to be doing paid work, and couldn't pull it off. I often found ways to get through the day doing the absolute minimum so I could slowly heal and grow stronger. </p><p>I sometimes felt like I had no spoons for putting towards things I "should" be doing. Yet I was usually able to do things like surf the internet. </p><p>I often wished I could be doing freelance writing on <a href="https://www.textbroker.com/">Textbroker</a> (<a href="https://writepay.blogspot.com/search/label/QuickStart">quick start guide</a>) in order to put cash in my pocket that week. But I quickly learned that pushing myself to work when I was too sick harmed my rating, got me blacklisted by clients, etc. </p><p>It was not a way to build a future. It was counterproductive and put me at risk of losing my ability to work for them at all. </p><p>So I learned to do what I reasonably could do, even though it often wasn't what I wanted to be doing. I did my best to fill that time with activities that had some hope of helping me create a future. </p><p>So I blogged. I made stubs for drafts of posts that might not be written for months. I played with the blogger template to improve the designs of my various blogs. </p><p>I spent time on forums, reading books and articles, and even playing games to at least keep myself mentally engaged in a manner that couldn't harm me. Mental engagement helps keep you functional in important ways. </p><p>I also did things like watched videos to try to figure out how to <a href="https://sandiegohomelesssurvivalguide.blogspot.com/2016/11/half-baked-idea-panning-for-gold.html">pan for gold</a>. We bought a gold pan and my son tried his hand at it, though we never found any gold. </p><p>I run this site, plus the <a href="https://sandiegohomelesssurvivalguide.blogspot.com/">San Diego Homeless Survival Guide</a>, <a href="https://writepay.blogspot.com/">Write Pay</a> and <a href="https://www.pocketputer.com/">Pocket Puter</a> in hopes of helping other people who are currently homeless to successfully do what I did: Take care of themselves while homeless and somehow make forward progress under very difficult circumstances when that often seems impossible. </p><p>Doing what I could do, even when it sometimes made me feel like a slacker who wasn't trying hard enough, was a foundational tenet of doing that. I did my best to make those metaphorical chop sticks count for something and help me build towards something better, even on days when I felt like there were no spoons to be found. </p><p>So, figure out how to keep yourself adequately fed, clean and safe and get enough sleep. Then spend any remaining time finding ways to pursue your interests and develop an income on terms that make sense to you. </p> Sun, 24 Mar 2019 20:14:41 +0000 https://streetlifesolutions.blogspot.com/2019/03/a-twist-on-spoon-theory.html Rusty Navy: The Bay Area's 'Mothball Fleet' Enters a New Era (2017) https://www.kqed.org/news/11612408/rusty-navy-the-bay-areas-mothball-fleet-enters-a-new-era https://www.kqed.org/news/11612408/rusty-navy-the-bay-areas-mothball-fleet-enters-a-new-era <p>Bay Curious listener Steve Yeager has been wondering about the fleet since he was a kid. He still passes the ships on his weekly commute.</p> <p>"Why are they there? And what is it doing to the environment?" he wants to know.</p> <figure id="attachment_11612545" class="wp-caption aligncenter"><img class="wp-image-11612545 size-medium" src="https://ww2.kqed.org/news/wp-content/uploads/sites/10/2017/08/IMG_0665-800x600.jpg" alt="The Suisun Bay Reserve Fleet in 2005, when there were more than 70 ships anchored there, including the legendary WWII battleship Iowa (foreground), now a floating museum in San Pedro." width="800" height="600" srcset="https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0665-800x600.jpg 800w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0665-160x120.jpg 160w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0665-1020x765.jpg 1020w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0665-1180x885.jpg 1180w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0665-960x720.jpg 960w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0665-240x180.jpg 240w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0665-375x281.jpg 375w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0665-520x390.jpg 520w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0665.jpg 1600w" sizes="(max-width: 800px) 100vw, 800px"/><figcaption class="wp-caption-text">The Suisun Bay Reserve Fleet in 2005, when there were more than 70 ships anchored there, including the legendary WWII battleship Iowa (foreground), now a floating museum in San Pedro. <cite>(Craig Miller)</cite></figcaption></figure><h3>A Wartime Surplus</h3> <p>The Suisun Bay Reserve Fleet is a place for the Navy, Coast Guard and Merchant Marine to park ships that are taken out of service, but <em>might</em> one day be needed again -- kind of like putting those sweaters into the cedar chest every spring. Hence the name “Mothball Fleet.”</p> <p>Suisun Bay was first used for this purpose in 1946. World War II had just ended and the Navy had a huge surplus of vessels. Benicia was one of eight places around the country where rows of mothballed ships were anchored. At its peak, Suisun Bay had 340 ships lined up in neat rows. It was a forest of steel and wires.</p> <figure id="attachment_11612437" class="wp-caption aligncenter"><img class="wp-image-11612437 size-medium" src="https://ww2.kqed.org/news/wp-content/uploads/sites/10/2017/08/IMG_7800-800x600.jpg" alt="A view of the Suisun Bay Reserve Fleet in 1962. At its peak, the “ghost fleet” had 340 vessels at anchor. Ten remain, including the barge used as the fleet's offices and maintenance base." width="800" height="600" srcset="https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7800-800x600.jpg 800w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7800-160x120.jpg 160w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7800-1020x765.jpg 1020w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7800-1180x885.jpg 1180w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7800-960x720.jpg 960w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7800-240x180.jpg 240w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7800-375x281.jpg 375w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7800-520x390.jpg 520w" sizes="(max-width: 800px) 100vw, 800px"/><figcaption class="wp-caption-text">A view of the Suisun Bay Reserve Fleet in 1962. At its peak, the “ghost fleet” had 340 vessels at anchor. Ten remain, including the barge used as the fleet's offices and maintenance base. <cite>(MARAD)</cite></figcaption></figure><p>Joe Pecoraro has been managing the Mothball Fleet for nearly 30 years.</p> <p>"We had just about every kind of Navy ship here except for an aircraft carrier," Pecoraro says. "We had guided-missile cruisers, frigates. We had a battleship for 10 years."</p> <p>The WWII battleship Iowa was a favorite of Pecoraro's, before it was renovated into a floating museum and moved down to Los Angeles.</p> <figure id="attachment_11612493" class="wp-caption aligncenter"><img class="size-medium wp-image-11612493" src="https://ww2.kqed.org/news/wp-content/uploads/sites/10/2017/08/IMG_7783-1-800x600.jpg" alt="" width="800" height="600" srcset="https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7783-1-800x600.jpg 800w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7783-1-160x120.jpg 160w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7783-1-1020x765.jpg 1020w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7783-1-1180x885.jpg 1180w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7783-1-960x720.jpg 960w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7783-1-240x180.jpg 240w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7783-1-375x281.jpg 375w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7783-1-520x390.jpg 520w" sizes="(max-width: 800px) 100vw, 800px"/><figcaption class="wp-caption-text">Joe Pecoraro manages the reserve fleet. He’s been tending the ships since 1991. <cite>(Craig Miller/KQED)</cite></figcaption></figure><p>Not all ships have such a glamorous afterlife as the Iowa. Many of them once anchored there were beyond redemption, and were stripped of their parts. Few were ever put back into action.</p> <p>"My dad used to call it Joe’s rusty navy," says Pecoraro. "We had a lotta rust."</p> <figure id="attachment_11612485" class="wp-caption aligncenter"><img class="wp-image-11612485 size-medium" src="https://ww2.kqed.org/news/wp-content/uploads/sites/10/2017/08/IMG_0662-800x600.jpg" alt="A 2009 study found that 20 tons of contaminants had drained or sloughed off of vessels in the &quot;mothball fleet&quot; anchored in Suisun Bay. Measures have since been put in place to protect the bay. " width="800" height="600" srcset="https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0662-800x600.jpg 800w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0662-160x120.jpg 160w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0662-1020x765.jpg 1020w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0662-1180x885.jpg 1180w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0662-960x720.jpg 960w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0662-240x180.jpg 240w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0662-375x281.jpg 375w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0662-520x390.jpg 520w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0662.jpg 1600w" sizes="(max-width: 800px) 100vw, 800px"/><figcaption class="wp-caption-text">A 2009 study found that 20 tons of contaminants had drained or sloughed off of vessels in the "mothball fleet" anchored in Suisun Bay. Measures have since been put in place to protect the bay. <cite>(Craig Miller)</cite></figcaption></figure><h3>Environmental Concerns Surface</h3> <p>Some ships in the fleet fell into such disrepair that environmentalists took notice.</p> <p>"You could hear the crunch of the paint chips or the metal under your feet as you were walking across the decks of the ships," says Sejal Choksi-Chugh, executive director of San Francisco Baykeeper. "That was just really horrifying because the minute it rained or the minute it got windy, all of that pollution just went right into the bay."</p> <p>And it wasn't just rust. Harmful chemicals, lead, hazardous paint and asbestos were all coming off the vessels. Researchers found 20 tons of it had washed off the ships and into the water over the years. It's an especially big problem because just next to the fleet sits Suisun Marsh -- the largest salt marsh in the western United States, and an environmentally sensitive area.</p> <figure id="attachment_11612499" class="wp-caption aligncenter"><img class="size-medium wp-image-11612499" src="https://ww2.kqed.org/news/wp-content/uploads/sites/10/2017/08/IMG_0693-800x600.jpg" alt="This 2005 photo shows the proximity of the reserve fleet to environmentally-sensitive Suisun Marsh." width="800" height="600" srcset="https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0693-800x600.jpg 800w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0693-160x120.jpg 160w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0693-1020x765.jpg 1020w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0693-1180x885.jpg 1180w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0693-960x720.jpg 960w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0693-240x180.jpg 240w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0693-375x281.jpg 375w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0693-520x390.jpg 520w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_0693.jpg 1600w" sizes="(max-width: 800px) 100vw, 800px"/><figcaption class="wp-caption-text">This 2005 photo shows the proximity of the reserve fleet to environmentally sensitive Suisun Marsh. <cite>(Craig Miller)</cite></figcaption></figure><p>In 2009, <a href="https://baykeeper.org/" target="_blank" rel="noopener noreferrer">Baykeeper</a>, along with other environmental groups and local water quality regulators, sued in federal court under various environmental laws. They won a settlement to get 57 creaky old ships out of Suisun and off to the scrapyard.</p> <p>Moving each ship cost about $1 million and involved a 45-day trip behind a seagoing tug. In August, the last of the scrapped ships were hauled away to Brownsville, Texas, where they are broken down and recycled.</p> <p>Even the top brass at the U.S. Maritime Administration, known as MARAD, which manages the fleet, agrees it was overdue.</p> <p>"The first ships that left, the first two dozen — someone said we should’ve put them out of their misery years ago. We couldn’t have reactivated them ever if we needed to," says MARAD executive director Joel Szabat. "We needed to find a way to get rid of them."</p> <p>The whole project cost about $57 million, but a MARAD official says they recouped about $30 million by selling the scrap metal.</p> <figure id="attachment_11632569" class="wp-caption aligncenter"><a href="https://ww2.kqed.org/news/wp-content/uploads/sites/10/2017/08/IMG_7787-1.jpg"><img class="size-full wp-image-11632569" src="https://ww2.kqed.org/news/wp-content/uploads/sites/10/2017/08/IMG_7787-1.jpg" alt="The Petersburg (foreground) is the newest addition to the Suisun Bay Reserve Fleet. The Navy tanker is part of the &quot;Ready Reserve,&quot; meaning it can deploy quickly if needed." width="2000" height="1396" srcset="https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7787-1.jpg 2000w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7787-1-160x112.jpg 160w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7787-1-800x558.jpg 800w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7787-1-1020x712.jpg 1020w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7787-1-1180x824.jpg 1180w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7787-1-960x670.jpg 960w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7787-1-240x168.jpg 240w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7787-1-375x262.jpg 375w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/IMG_7787-1-520x363.jpg 520w" sizes="(max-width: 2000px) 100vw, 2000px"/></a><figcaption class="wp-caption-text">The Petersburg (foreground) is the newest addition to the Suisun Bay Reserve Fleet. The Navy tanker is part of the "Ready Reserve," meaning it can deploy quickly if needed. <cite>(Craig Miller/KQED)</cite></figcaption></figure><h3>Today's Fleet</h3> <p>Though much smaller than it once was, the Ghost Fleet isn’t going away entirely. Today, only nine ships remain, plus the barge used as an office and maintenance base.</p> <p>While it seems highly unlikely that we’ll ever see hundreds — or even the dozens of ships that reposed here less than 10 years ago -- new ships can be added to the fleet. MARAD recently added a Navy tanker that’s part of the “Ready Reserve." The Petersburg could be turned around in a few days if called back to duty, and a skeleton crew lives on board.</p> <p>The remaining ships are outfitted with screens and filters to keep pollutants out of the bay, and MARAD now regularly tests the water quality.</p> <figure id="attachment_11612543" class="wp-caption aligncenter"><img class="size-medium wp-image-11612543" src="https://ww2.kqed.org/news/wp-content/uploads/sites/10/2017/08/compare-800x450.jpeg" alt="A satellite view of the fleet in 2009 (left) and 2017." width="800" height="450" srcset="https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/compare-800x450.jpeg 800w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/compare-160x90.jpeg 160w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/compare-1020x574.jpeg 1020w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/compare-1180x664.jpeg 1180w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/compare-960x540.jpeg 960w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/compare-240x135.jpeg 240w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/compare-375x211.jpeg 375w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/compare-520x293.jpeg 520w, https://ww2.kqed.org/wp-content/uploads/sites/10/2017/08/compare.jpeg 1280w" sizes="(max-width: 800px) 100vw, 800px"/><figcaption class="wp-caption-text">A satellite view of the fleet in 2009 (left) and 2017. <cite>(<a href="https://www.planet.com" target="_blank">Planet</a>)</cite></figcaption></figure><p>So what did Steve Yeager, the listener who asked us about the fleet, think of our answer? He's glad the environmental issues have been addressed, and doesn't mind that a few ships are hanging around for the next generation to see out of the car window on trips up Interstate 680.</p> <p>"My kids will ask me the same questions, but I’ll have a little more information now that I can tell them," he says.</p> <p><em>Watch this KQED video segment from 2008, when there were still more than 70 ships in Suisun Bay:</em></p> Sun, 24 Mar 2019 04:07:20 +0000 https://www.kqed.org/news/11612408/rusty-navy-the-bay-areas-mothball-fleet-enters-a-new-era