Quantcast
Channel: Hacker News
Viewing all 25817 articles
Browse latest View live

Frighteningly Ambitious Startup Ideas (2012)

$
0
0
Frighteningly Ambitious Startup Ideas

March 2012

One of the more surprising things I've noticed while working on Y Combinator is how frightening the most ambitious startup ideas are. In this essay I'm going to demonstrate this phenomenon by describing some. Any one of them could make you a billionaire. That might sound like an attractive prospect, and yet when I describe these ideas you may notice you find yourself shrinking away from them.

Don't worry, it's not a sign of weakness. Arguably it's a sign of sanity. The biggest startup ideas are terrifying. And not just because they'd be a lot of work. The biggest ideas seem to threaten your identity: you wonder if you'd have enough ambition to carry them through.

There's a scene in Being John Malkovich where the nerdy hero encounters a very attractive, sophisticated woman. She says to him:

Here's the thing: If you ever got me, you wouldn't have a clue what to do with me.
That's what these ideas say to us.

This phenomenon is one of the most important things you can understand about startups. [1] You'd expect big startup ideas to be attractive, but actually they tend to repel you. And that has a bunch of consequences. It means these ideas are invisible to most people who try to think of startup ideas, because their subconscious filters them out. Even the most ambitious people are probably best off approaching them obliquely.

1. A New Search Engine

The best ideas are just on the right side of impossible. I don't know if this one is possible, but there are signs it might be. Making a new search engine means competing with Google, and recently I've noticed some cracks in their fortress.

The point when it became clear to me that Microsoft had lost their way was when they decided to get into the search business. That was not a natural move for Microsoft. They did it because they were afraid of Google, and Google was in the search business. But this meant (a) Google was now setting Microsoft's agenda, and (b) Microsoft's agenda consisted of stuff they weren't good at.

Microsoft : Google :: Google : Facebook.

That does not by itself mean there's room for a new search engine, but lately when using Google search I've found myself nostalgic for the old days, when Google was true to its own slightly aspy self. Google used to give me a page of the right answers, fast, with no clutter. Now the results seem inspired by the Scientologist principle that what's true is what's true for you. And the pages don't have the clean, sparse feel they used to. Google search results used to look like the output of a Unix utility. Now if I accidentally put the cursor in the wrong place, anything might happen.

The way to win here is to build the search engine all the hackers use. A search engine whose users consisted of the top 10,000 hackers and no one else would be in a very powerful position despite its small size, just as Google was when it was that search engine. And for the first time in over a decade the idea of switching seems thinkable to me.

Since anyone capable of starting this company is one of those 10,000 hackers, the route is at least straightforward: make the search engine you yourself want. Feel free to make it excessively hackerish. Make it really good for code search, for example. Would you like search queries to be Turing complete? Anything that gets you those 10,000 users is ipso facto good.

Don't worry if something you want to do will constrain you in the long term, because if you don't get that initial core of users, there won't be a long term. If you can just build something that you and your friends genuinely prefer to Google, you're already about 10% of the way to an IPO, just as Facebook was (though they probably didn't realize it) when they got all the Harvard undergrads.

2. Replace Email

Email was not designed to be used the way we use it now. Email is not a messaging protocol. It's a todo list. Or rather, my inbox is a todo list, and email is the way things get onto it. But it is a disastrously bad todo list.

I'm open to different types of solutions to this problem, but I suspect that tweaking the inbox is not enough, and that email has to be replaced with a new protocol. This new protocol should be a todo list protocol, not a messaging protocol, although there is a degenerate case where what someone wants you to do is: read the following text.

As a todo list protocol, the new protocol should give more power to the recipient than email does. I want there to be more restrictions on what someone can put on my todo list. And when someone can put something on my todo list, I want them to tell me more about what they want from me. Do they want me to do something beyond just reading some text? How important is it? (There obviously has to be some mechanism to prevent people from saying everything is important.) When does it have to be done?

This is one of those ideas that's like an irresistible force meeting an immovable object. On one hand, entrenched protocols are impossible to replace. On the other, it seems unlikely that people in 100 years will still be living in the same email hell we do now. And if email is going to get replaced eventually, why not now?

If you do it right, you may be able to avoid the usual chicken and egg problem new protocols face, because some of the most powerful people in the world will be among the first to switch to it. They're all at the mercy of email too.

Whatever you build, make it fast. GMail has become painfully slow.[2] If you made something no better than GMail, but fast, that alone would let you start to pull users away from GMail.

GMail is slow because Google can't afford to spend a lot on it. But people will pay for this. I'd have no problem paying $50 a month. Considering how much time I spend in email, it's kind of scary to think how much I'd be justified in paying. At least $1000 a month. If I spend several hours a day reading and writing email, that would be a cheap way to make my life better.

3. Replace Universities

People are all over this idea lately, and I think they're onto something. I'm reluctant to suggest that an institution that's been around for a millennium is finished just because of some mistakes they made in the last few decades, but certainly in the last few decades US universities seem to have been headed down the wrong path. One could do a lot better for a lot less money.

I don't think universities will disappear. They won't be replaced wholesale. They'll just lose the de facto monopoly on certain types of learning that they once had. There will be many different ways to learn different things, and some may look quite different from universities. Y Combinator itself is arguably one of them.

Learning is such a big problem that changing the way people do it will have a wave of secondary effects. For example, the name of the university one went to is treated by a lot of people (correctly or not) as a credential in its own right. If learning breaks up into many little pieces, credentialling may separate from it. There may even need to be replacements for campus social life (and oddly enough, YC even has aspects of that).

You could replace high schools too, but there you face bureaucratic obstacles that would slow down a startup. Universities seem the place to start.

4. Internet Drama

Hollywood has been slow to embrace the Internet. That was a mistake, because I think we can now call a winner in the race between delivery mechanisms, and it is the Internet, not cable.

A lot of the reason is the horribleness of cable clients, also known as TVs. Our family didn't wait for Apple TV. We hated our last TV so much that a few months ago we replaced it with an iMac bolted to the wall. It's a little inconvenient to control it with a wireless mouse, but the overall experience is much better than the nightmare UI we had to deal with before.

Some of the attention people currently devote to watching movies and TV can be stolen by things that seem completely unrelated, like social networking apps. More can be stolen by things that are a little more closely related, like games. But there will probably always remain some residual demand for conventional drama, where you sit passively and watch as a plot happens. So how do you deliver drama via the Internet? Whatever you make will have to be on a larger scale than Youtube clips. When people sit down to watch a show, they want to know what they're going to get: either part of a series with familiar characters, or a single longer "movie" whose basic premise they know in advance.

There are two ways delivery and payment could play out. Either some company like Netflix or Apple will be the app store for entertainment, and you'll reach audiences through them. Or the would-be app stores will be too overreaching, or too technically inflexible, and companies will arise to supply payment and streaming a la carte to the producers of drama. If that's the way things play out, there will also be a need for such infrastructure companies.

5. The Next Steve Jobs

I was talking recently to someone who knew Apple well, and I asked him if the people now running the company would be able to keep creating new things the way Apple had under Steve Jobs. His answer was simply "no." I already feared that would be the answer. I asked more to see how he'd qualify it. But he didn't qualify it at all. No, there will be no more great new stuff beyond whatever's currently in the pipeline. Apple's revenues may continue to rise for a long time, but as Microsoft shows, revenue is a lagging indicator in the technology business.

So if Apple's not going to make the next iPad, who is? None of the existing players. None of them are run by product visionaries, and empirically you can't seem to get those by hiring them. Empirically the way you get a product visionary as CEO is for him to found the company and not get fired. So the company that creates the next wave of hardware is probably going to have to be a startup.

I realize it sounds preposterously ambitious for a startup to try to become as big as Apple. But no more ambitious than it was for Apple to become as big as Apple, and they did it. Plus a startup taking on this problem now has an advantage the original Apple didn't: the example of Apple. Steve Jobs has shown us what's possible. That helps would-be successors both directly, as Roger Bannister did, by showing how much better you can do than people did before, and indirectly, as Augustus did, by lodging the idea in users' minds that a single person could unroll the future for them. [3]

Now Steve is gone there's a vacuum we can all feel. If a new company led boldly into the future of hardware, users would follow. The CEO of that company, the "next Steve Jobs," might not measure up to Steve Jobs. But he wouldn't have to. He'd just have to do a better job than Samsung and HP and Nokia, and that seems pretty doable.

6. Bring Back Moore's Law

The last 10 years have reminded us what Moore's Law actually says. Till about 2002 you could safely misinterpret it as promising that clock speeds would double every 18 months. Actually what it says is that circuit densities will double every 18 months. It used to seem pedantic to point that out. Not any more. Intel can no longer give us faster CPUs, just more of them.

This Moore's Law is not as good as the old one. Moore's Law used to mean that if your software was slow, all you had to do was wait, and the inexorable progress of hardware would solve your problems. Now if your software is slow you have to rewrite it to do more things in parallel, which is a lot more work than waiting.

It would be great if a startup could give us something of the old Moore's Law back, by writing software that could make a large number of CPUs look to the developer like one very fast CPU. There are several ways to approach this problem. The most ambitious is to try to do it automatically: to write a compiler that will parallelize our code for us. There's a name for this compiler, the sufficiently smart compiler, and it is a byword for impossibility. But is it really impossible? Is there no configuration of the bits in memory of a present day computer that is this compiler? If you really think so, you should try to prove it, because that would be an interesting result. And if it's not impossible but simply very hard, it might be worth trying to write it. The expected value would be high even if the chance of succeeding was low.

The reason the expected value is so high is web services. If you could write software that gave programmers the convenience of the way things were in the old days, you could offer it to them as a web service. And that would in turn mean that you got practically all the users.

Imagine there was another processor manufacturer that could still translate increased circuit densities into increased clock speeds. They'd take most of Intel's business. And since web services mean that no one sees their processors anymore, by writing the sufficiently smart compiler you could create a situation indistinguishable from you being that manufacturer, at least for the server market.

The least ambitious way of approaching the problem is to start from the other end, and offer programmers more parallelizable Lego blocks to build programs out of, like Hadoop and MapReduce. Then the programmer still does much of the work of optimization.

There's an intriguing middle ground where you build a semi-automatic weapon—where there's a human in the loop. You make something that looks to the user like the sufficiently smart compiler, but inside has people, using highly developed optimization tools to find and eliminate bottlenecks in users' programs. These people might be your employees, or you might create a marketplace for optimization.

An optimization marketplace would be a way to generate the sufficiently smart compiler piecemeal, because participants would immediately start writing bots. It would be a curious state of affairs if you could get to the point where everything could be done by bots, because then you'd have made the sufficiently smart compiler, but no one person would have a complete copy of it.

I realize how crazy all this sounds. In fact, what I like about this idea is all the different ways in which it's wrong. The whole idea of focusing on optimization is counter to the general trend in software development for the last several decades. Trying to write the sufficiently smart compiler is by definition a mistake. And even if it weren't, compilers are the sort of software that's supposed to be created by open source projects, not companies. Plus if this works it will deprive all the programmers who take pleasure in making multithreaded apps of so much amusing complexity. The forum troll I have by now internalized doesn't even know where to begin in raising objections to this project. Now that's what I call a startup idea.

7. Ongoing Diagnosis

But wait, here's another that could face even greater resistance: ongoing, automatic medical diagnosis.

One of my tricks for generating startup ideas is to imagine the ways in which we'll seem backward to future generations. And I'm pretty sure that to people 50 or 100 years in the future, it will seem barbaric that people in our era waited till they had symptoms to be diagnosed with conditions like heart disease and cancer.

For example, in 2004 Bill Clinton found he was feeling short of breath. Doctors discovered that several of his arteries were over 90% blocked and 3 days later he had a quadruple bypass. It seems reasonable to assume Bill Clinton has the best medical care available. And yet even he had to wait till his arteries were over 90% blocked to learn that the number was over 90%. Surely at some point in the future we'll know these numbers the way we now know something like our weight. Ditto for cancer. It will seem preposterous to future generations that we wait till patients have physical symptoms to be diagnosed with cancer. Cancer will show up on some sort of radar screen immediately.

(Of course, what shows up on the radar screen may be different from what we think of now as cancer. I wouldn't be surprised if at any given time we have ten or even hundreds of microcancers going at once, none of which normally amount to anything.)

A lot of the obstacles to ongoing diagnosis will come from the fact that it's going against the grain of the medical profession. The way medicine has always worked is that patients come to doctors with problems, and the doctors figure out what's wrong. A lot of doctors don't like the idea of going on the medical equivalent of what lawyers call a "fishing expedition," where you go looking for problems without knowing what you're looking for. They call the things that get discovered this way "incidentalomas," and they are something of a nuisance.

For example, a friend of mine once had her brain scanned as part of a study. She was horrified when the doctors running the study discovered what appeared to be a large tumor. After further testing, it turned out to be a harmless cyst. But it cost her a few days of terror. A lot of doctors worry that if you start scanning people with no symptoms, you'll get this on a giant scale: a huge number of false alarms that make patients panic and require expensive and perhaps even dangerous tests to resolve. But I think that's just an artifact of current limitations. If people were scanned all the time and we got better at deciding what was a real problem, my friend would have known about this cyst her whole life and known it was harmless, just as we do a birthmark.

There is room for a lot of startups here. In addition to the technical obstacles all startups face, and the bureaucratic obstacles all medical startups face, they'll be going against thousands of years of medical tradition. But it will happen, and it will be a great thing—so great that people in the future will feel as sorry for us as we do for the generations that lived before anaesthesia and antibiotics.

Tactics

Let me conclude with some tactical advice. If you want to take on a problem as big as the ones I've discussed, don't make a direct frontal attack on it. Don't say, for example, that you're going to replace email. If you do that you raise too many expectations. Your employees and investors will constantly be asking "are we there yet?" and you'll have an army of haters waiting to see you fail. Just say you're building todo-list software. That sounds harmless. People can notice you've replaced email when it's a fait accompli.[4]

Empirically, the way to do really big things seems to be to start with deceptively small things. Want to dominate microcomputer software? Start by writing a Basic interpreter for a machine with a few thousand users. Want to make the universal web site? Start by building a site for Harvard undergrads to stalk one another.

Empirically, it's not just for other people that you need to start small. You need to for your own sake. Neither Bill Gates nor Mark Zuckerberg knew at first how big their companies were going to get. All they knew was that they were onto something. Maybe it's a bad idea to have really big ambitions initially, because the bigger your ambition, the longer it's going to take, and the further you project into the future, the more likely you'll get it wrong.

I think the way to use these big ideas is not to try to identify a precise point in the future and then ask yourself how to get from here to there, like the popular image of a visionary. You'll be better off if you operate like Columbus and just head in a general westerly direction. Don't try to construct the future like a building, because your current blueprint is almost certainly mistaken. Start with something you know works, and when you expand, expand westward.

The popular image of the visionary is someone with a clear view of the future, but empirically it may be better to have a blurry one.

Notes

[1] It's also one of the most important things VCs fail to understand about startups. Most expect founders to walk in with a clear plan for the future, and judge them based on that. Few consciously realize that in the biggest successes there is the least correlation between the initial plan and what the startup eventually becomes.

[2] This sentence originally read "GMail is painfully slow." Thanks to Paul Buchheit for the correction.

[3] Roger Bannister is famous as the first person to run a mile in under 4 minutes. But his world record only lasted 46 days. Once he showed it could be done, lots of others followed. Ten years later Jim Ryun ran a 3:59 mile as a high school junior.

[4] If you want to be the next Apple, maybe you don't even want to start with consumer electronics. Maybe at first you make something hackers use. Or you make something popular but apparently unimportant, like a headset or router. All you need is a bridgehead.

Thanks to Sam Altman, Trevor Blackwell, Paul Buchheit, Patrick Collison, Aaron Iba, Jessica Livingston, Robert Morris, Harj Taggar and Garry Tan for reading drafts of this.


Beyond Streets and Avenues: Simple Visual Guide to Different Types of Roads

Show HN: Keypad Layout Window Manager for Mac

$
0
0

README.md

Control window layout using Ctrl + Numeric Keypad on macOS. Press two number keys in a row while holding down Ctrl to select the new window frame on a 3x3 grid.

ezgif-1-57056b486e

Installation

Homebrew users can simply brew cask install keypad-layout. Compiled versions are also available for download from releases.

Examples

Ctrl +Result
1 then 9Full Screen
7 then 9Top Row
1 then 3Bottom Row
3 then 1Bottom Row
8 then 3Right Two Thirds

Reference

If you use a MacBook and forgot the layout of the numeric keypad, refer to the table below for the grid layout.

╔═══╦═══╦═══╗
║ 7 ║ 8 ║ 9 ║
╠═══╬═══╬═══╣
║ 4 ║ 5 ║ 6 ║
╠═══╬═══╬═══╣
║ 1 ║ 2 ║ 3 ║
╚═══╩═══╩═══╝

Attributions

The application and menu bar icons are derived from numpad by Ján Slobodník from the Noun Project, available under the Creative Commons Attribution license.

Apple WWDC 2017 Conference Scholarship Recipient Denied Entry to the US

$
0
0

Velkommen hjem!

Denne tidslinje er der, hvor du vil bruge mest af din tid og konstant få opdateringer om det, der interesserer dig.

Fungerer Tweets ikke for dig?

Hold over profilbilledet og klik på Følger-knappen for at stoppe med at følge enhver konto.

Deltag i samtalen

Tilføj dine tanker om ethvert Tweet med et svar. Find et emne, du er passioneret omkring, og hop direkte ind i samtalen.

Få mere af det, du elsker

Følg flere konti for at få øjeblikkelige opdateringer om de emner, du er interesseret i.

Gå aldrig glip af et Øjeblik

Følg de bedste historier, mens de sker.

Who controls the Internet? Analyzing global threats

$
0
0

Who controls the Internet? Analyzing global threats using property traversal graphs Simeonovski et al., WWW’17

Who controls the Internet? How much influence do they have? And what would happen if one of those parties launched an attack or was compromised and used to launch an attack? Previous works have looked at the individual core services, but this paper focuses on their inter-dependencies along attack propagation paths.

An increasing number of reports and studies are showing that a limited number of players have an important influence on the overall security of the Internet infrastructure… we have a rather limited capability to assess the impact of attacks against, or performed by, core service providers.

What kind of attacks are we talking about? Three large-scale security incidents form the initial motivation:

  1. The Great Cannon DDoS Attack of March 16th 2015, a massive DDoS attack caused by malicious JavaScript code injected into TCP connections crossing Chinese network borders. The injected code aggressively requested resources from the DDoS targets.
  2. The PRISM program (2013), an NSA surveillance program with direct access to Internet communications and stored information. “While the direct involvement of popular tech providers is still unclear, in this paper we make the assumption that establishing the this type of collaboration is possible and can be voluntary, or coerced by authorities by means of law and court orders.”
  3. The DDoS attack against Dyn.com of October 21st 2016. The attack caused Dyn.com customers including Amazon, Netflix, Twitter, Reddit, and Spotify to experience outages on name resolution, affecting hundreds of millions of Internet users who could not access their services.

Four different attack vectors are analysed: email sniffing, redirection via malicious domain resolution, in-path content injection, and hosting malicious content.

Gathering information

The authors crawl the web starting from the top 100K Alexa domains, expanding to server and network information, and then adding in organisations and countries. This ultimately leads to a labeled graph containing 1.8M nodes, of which 350K are unique IP addresses. The nodes are connected by 4.7M relationships.

The following table shows labels (think node and edge types) in the graph:

When considering the impact of an attack nodes can be marked at one of three different compromise levels: comprised, partially compromised, and non-compromised. Taint-style propagation rules can then be written which capture how attacks can spread through the network. For example, if a node n is compromised and there is an edge from n to m labeled as A (name lookup) then m is marked as compromised.

Identifying the most promising attack targets

Before assessing attacks, we use our model to select entities that can be either attack victims or the attackers. The selection criteria are based on metrics that reflect the popularity and the influence of entities.

The most promising attack targets (or viewed from another perspective, the entities with the most power over Internet infrastructure) are identified via six metrics.

Who hosts the most Alexa domains?

The analysis is done by country (giving a lens into the power of nation-state attackers), and also by ‘Autonomous Systems’ (AS) – a collection of IP networks and routers under the control of a given network operator.

Under this metric, these are the most powerful countries:

And these are the most powerful network operators:

Who has the most JavaScript hosting servers?

By country:

And by network operator:

Who hosts the most email servers?

By country:

And by network operator:

Who hosts the most name servers?

By country:

And by network operator:

Who has the most power over JavaScript providers?

This metric measures the number of JS hosting servers whose authoritative name server is hosted in a given country or by a given network operator.

By country:

And by network operator:

Who controls the most email server name servers?

The number of domains of email servers hosted by a given country or network operator.

By country:

And by network operator:

Evaluating the impact of potential attacks

Now we’re in a position to evaluate the potential impact of three different attacks: distribution of malicious JavaScript content, email sniffing, and a DDoS attack against a core service provider. In each case a target can be selected by consulting the tables above.

Distributing malicious JavaScript content

The authors consider three ways to do this: – directly compromising (or colluding with) web servers hosting JS code; injecting malicious JavaScript when JS libraries are accessed over unprotected connections (HTTP instead of HTTPS); and redirecting requests for JS content via compromised name resolution.

Here we see the number of Alexa domains that can be reached via the first two of these:

The attack results show that countries can be very powerful attackers. For example, the United States hosts 47K JS hosting providers, which could distributed malicious code to about 16% of the top 100K Alexa domains. However, ASes are also very powerful and affect a fraction of websites that is even larger than than of individual countries, and even groups of countries. For example, the AS of Google can affect about 9% of Alexa domains.

When we look at JS inclusion over unprotected connections, 1,079 of them cross the Chinese network borders, but the United States, the Netherlands, Russia, Germany, and Japan all have even greater influence.

In malicious name resolution redirection the authoritative name server of a domain hosting JS redirects users to a malicious server. The attack result is the number of websites including a resource hosted on a server whose name server is colluding or compromised.

The United States, Google, and DynDNS stand out here.

Email sniffing

To acquire a large number of emails, an attacker can rely on various techniques. In this paper we consider two. The first one is by acquiring them directly from the email server. The second one is by redirecting an email client toward a malicious mail server, which will accept the email, keep a copy, and forward it to the intended recipient. This attack can be performed by a provider or by a country. Tables 3(c)and 3(d) show the attack results. All values are the number of Alexa domains that will be affected by this attack grouped by technique and attacker.

Email sniffing by a malicious email provider:

The United States alone can acquire emails for 25% of the most popular websites!

Malicious name resolution for email sniffing:

Note how Google has much less power in this attack vector – most websites that use Google’s email servers do so via name servers which are not hosted by Google.

DDoS against a core service provider

What happens if a service provider is the victim of an attack and is made unavailable? The data we already have can be used to figure this out. For example, consider the Dyn.com DoS attack from October 2016. DynDNS does not host a relevant number of mail servers and JS hosting providers, but it does host 364 domain servers.

These name servers are authoritative for 3,570 domains hosting JS that provide JS to 5,559 top 100K Alexa domains (not shown in Table 3), of which 4,331 are unprotected JS inclusion. Furthermore, the name servers hosted by DynDNS are authoritative for 1,523 domains running mail servers which are used by 1,178 top Alexa domains. If the Dyn.com DNS infrastructure is attacked, then a fraction that ranges from 1 to 5% of the top 100K Alexa domains would be affected.

So who controls the Internet?

Our results show that already just a few players may have an extensive power: 14 countries and 14 autonomous systems can, directly or indirectly, affect the security of about 23% of websites… In addition, our results show that little has been learned from past attacks. For example, 70% of JavaScript (JS) inclusion is still done over unprotected connections, i.e., via HTTP URLs, which can be used to mount the Great Cannon attack.

Mono 5.0 Ships with Concurrent Garbage Collector

$
0
0

In Mono 5.0 we are shipping a new operation mode for our Garbage Collector: Concurrent Garbage Collection.

Traditionally, when Mono’s memory manager determined that it should perform a garbage collection, the collector had to pause all Mono running threads, perform the garbage collection, and once it was done, it resumed the execution of those threads.

With concurrent garbage collection, we are able to perform collections on the old generation (what we call major collections) mostly concurrently with your application - it happens at the same time as your program is running. When the major collection is completed, the collector only needs to pause the Mono threads for a very brief period of time at the end.

This was an important feature for both our users of desktop workloads (like running Xamarin Studio, or Visual Studio for Mac) as well as game and mobile developers that did not want their application to exhibit large pauses when they had very large memory heaps to be collected.

The concurrent garbage collector is now enabled on Mono deployments by default, and we are making it available as an experimental option to all Xamarin platforms (Xamarin.Android, Xamarin.iOS, Xamarin.Mac, Xamarin.tvOS, Xamarin.watchOS).

We are rolling it out as the default on desktop first since it has more friendly hardware and it has received the most tuning. We are interested in hearing your experiences with the collector with your mobile applications to help us further tune the heuristics in the collector.

To get a sense of how this affect real world applications, let us examine Xamarin Studio.

Long GC latency can cause typing delays that are noticeable and lead to a bad typing experience. Pauses over 100-150ms are noticeable by most of us [1].

To give you a taste of how the concurrent collector improves things, I used it with Xamarin Studio to open itself, and build itself. This is one of the biggest solutions that I had around. As I open and build it, Xamarin Studio will be frantically allocating objects which, in turn, trigger the garbage collector - those GC pauses can be felt as hiccups when typing.

The experiment is to run this with and without the concurrent mode enabled. We measured the pause time of each GC run and grouped them in buckets by duration. For example, the 20ms bucket has all collections that paused between 10ms and 20ms. One thing to keep in mind is that the Y axis is in logarithmic scale, as the number of short pauses is significantly larger.

GC Pause Times

The result is that the long pauses, 200ms, 500ms and higher are now completely gone and even the worst case for concurrent GC shows that there are fewer 150ms pauses.

Even if those numbers are a significant quality of life improvement, there’s plenty of work left for us to get to no visible delays due to the garbage collector. We have already a solid pipeline of improvements coming on our next releases.

The concurrent collector work opens the door for many more improvements. This is just the beginning. What we plan on doing next is provide some defaults that are suitable for different workloads. On one end of the spectrum we have games that have very constrained timing budgets, and on the other hand we have applications that do not care about pauses, but would like to get more throughput.

Our focus for the next year is to leverage this work to satisfy the needs of both scenarios.

In the immediate roadmap, you can expect:

  • Mono 5.2 will introduce an optional parallel major collection mode to speed up the finishing pause for large heaps. This will help with some of the outliers we saw above.

  • Mono 5.4 will introduce and optional parallel minor collection mode that will help workloads with high activity on old objects. Roslyn falls into this category.

Using the Concurrent GC

On the desktop you enable the concurrent GC using the MONO_GC_PARAMS env var. Set it to major=marksweep-conc. Starting with mono 5.0 the concurrent collector is the default on desktop environments so you don’t need to use it.

On Xamarin.Android and Xamarin.iOS to enable it, go to project settings, under build options enable the “Use the experimental concurrent garbage collector” option.

Tuning the Nursery Size

The graph above shows the defaults for Mono.

In Mono, the Nursery is the name that we give to the youngest heap generation. When we talk about performing a minor collection, we talk about performing a collection that is limited to the nursery.

For games and other interactive applications that might create lots of small objects during their rendering cycle that are not long-lived, you might be able to take advantage of making the nursery size larger.

This reduces the chances that you will hit the limit that would trigger a major collection, and you can manually trigger a complete GC at a convenient time with GC.Collect() .

We hope to make this tuning a thing of the past when we introduce some of our new game and interactive features for this new mode.

[1] Typing with Pleasure

Language-agnostic schemas based on Haskell's type system

$
0
0

README.md

Plate

Language-agnostic schemas based on Haskell's type system.

Schema languages like JSON Schema let you to describe data in a way that can be understood by any programming language. They're one of the core components of API description tools like Swagger. Once you write schemas to describe the data your API deals with you can use them to automatically generate documentation, UIs, and client code. This avoids lots of manual, error-prone work at your application boundary.

Writing a schema language is trickier than it looks. You have to strike a careful balance between over and under-expressiveness.

If you make your schema under-expressive it becomes little better than no schema at all. For example JSchema allows all values described by the schema to be null. While it's easy to find nice things to say about JSchema (such as its simplicity), implicit nulls don't allow enough structure for many tasks.

On the other hand you can error by allowing too much expressiveness. For instance in JSON Schema a clever combination of the "anyOf", "allOf", and "not" keywords is enough to build if and case statements (discovered by Evgeny Poberezkin).

This allows schemas to describe enormously complex structures for which it's impossible to automatically generate clean UIs or client code. Once again this defeats the original purpose. One solution would be to ask schema writers to work in only some subset of the schema langauge, but which subset? We're back to the original problem.

The solution is to look for rescue from a related field. Language-specific type system writers have been feeling out the sweet spot of expressiveness longer than the other tools mentioned here have existed. Even better, many of them are battle-hardened and sit on a principled theoretical foundation.

And of course the most glorious, battle-hardened, and principled of these is Haskell (OCaml and PureScript aren't bad either). Plate is what you get when you steal the most basic, essential features of Haskell's type system and build a schema language from them. Hopefully this lets Plate strike the right level of expressiveness for many tasks.

Work-in-progress. Nothing is final or production ready. Everything is a mess. Documentation is wrong.

Say we have the following Haskell type:

dataAlbum=Album{title::Text
  , artist::Text
  , tracks:: [Text]}

We can also express it as a Plate schema using the plate library:

album::Schema
album =ProductType (HM.fromList
  [ ("title", BuiltinSString)
  , ("artist", BuiltinSString)
  , ("tracks", Builtin (SSequence (BuiltinSString)))
  ])

(It won't be hard to make this conversion automatic, though I haven't gotten around to it yet.)

We can then generate a JSON representation of the schema for other tools to use:

{"schema.product": {"title": {"type": {"schema.string": {}
      }
    },"artist": {"type": {"schema.string": {}
      }
    },"tracks": {"type": {"schema.sequence": {"type": {"schema.string": {}
          }
        }
      }
    }
  }
}

We can also generate UIs so users can conveniently create instances of our schema:

(Note: the editor isn't released yet)

Then say a user creates this piece of data:

{"title": "Interstellar: Original Motion Picture Soundtrack","artist": "Hans Zimmer","tracks": {"sequence": ["Dreaming of the Crash","Cornfield Chase","Dust","Day One","Stay","Message from Home","The Wormhole","Mountains","Afraid of Time","A Place Among the Stars","Running Out","I'm Going Home","Coward","Detach","S.T.A.Y.","Where We're Going"
    ]
  }
}

We can convert it to its Plate representation and then validate it:

λ>Plate.validate mempty albumSchema interstellarSountrackRight()

TJ Weigel created the logo.

Haret: A strongly consistent distributed coordination system implemented in Rust

$
0
0

README.md

haret provides a distributed service built on proven protocols that exposes strongly consistent coordination primitives via an easy to use API, in order to satisfy the essential dependencies of many distributed applications. You can read more about why we decided to build haret here.

This README contains quickstart instructions for both developers and users. More information about using haret can be found in the rough and incompleteUser Guide.

Start Here if you are an enduser of haret and not interested in building the code.

Running a replication group on a single node

Release binaries for Mac OSX and Linux can be downloadedhere.

Each release directory contains a config.toml file for running a single node of haret. From the release directory containing the config.toml and binaries, run haret in a terminal with the following command to start a node:

RUST_LOG=haret=info,rabble=info ./haret

While a haret replication group (namespace) is intended to run in a cluster across multiple physical machines for fault tolerance, it is capable of running in a single process for testing purposes. Each replica in the group is represented by a lightweight actor that can receive and respond to messages, so we can just designate a group of actors on the same node to be the replication group.

Open another terminal that we can use to communicate with this node.

Connect to the admin server of node1

./haret-admin 127.0.0.1:5001

Check the cluster status to verify only a single node exists

haret-admin> cluster status

Create a namespaces on node1

haret-admin> vr create namespace test-ns r1::node1@127.0.0.1:5000,r2::node1@127.0.0.1:5000,r3::node1@127.0.0.1:5000

List namespaces

haret-admin> vr namespaces

Get the state of r1::dev1 - It will show the primary of the test-ns namespace toward the top.

haret-admin> vr replica test-ns::r1::node1@127.0.0.1:2000`

Show Configuration

haret-admin> config

Now exit the admin CLI and connect to the API port on node1 using the CLI client

./haret-cli-client 127.0.0.1:5002

List namespaces

haret> list-namespaces

Enter the test-ns namespace so you can issue operations against the namespace's tree. This entails learning which replica is the primary for that namespace so it can be sent messages.

haret> enter test-ns

Now start issuing operations against the namespace. They can be discovered by typing help at the prompt. More examples are shown below.

If you'd like to build a multi-node cluster all on localhost, it's a simple matter of copying the release directory n times, where n is the size of the cluster, and then editing each config file to listen on different ports (This is exactly what make devrel does if you have the build dependencies). Each haret in each directory can then be started. From there the instructions below detail joining nodes together to form a cluster.

Start here if you are looking to hack on haret.

Setting up a development cluster

  • Install Rust. Haret builds on any stable version after rust 1.15
  • Install rlwrap so that you can have readline support on CLIs
  • Build a 3 node development cluster and launch 3 nodes on localhost
  • Note that all node configuration is stored in haret/dev/devN

Joining 3 nodes to create a cluster

  • Open a new terminal window (output from the launched nodes shows up in the original)
  • Connect to the admin server of node1
    • rlwrap cargo run --bin haret-admin 127.0.0.1:2001
  • Check the cluster status to verify only a single node (dev1) exists
    • haret-admin> cluster status
  • Join the nodes together using their cluster ports to form a cluster
    • haret-admin> cluster join dev2@127.0.0.1:3000
    • haret-admin> cluster join dev3@127.0.0.1:4000

Creating and operating on a namespace

  • Create a namespace
    • haret-admin> vr create namespace test-ns r1::dev1@127.0.0.1:2000,r2::dev2@127.0.0.1:3000,r3::dev3@127.0.0.1:4000
  • List namespaces
    • haret-admin> vr namespaces
  • Get the state of r1::dev1 - It should show the primary toward the top.
    • haret-admin> vr replica test-ns::r1::dev1@127.0.0.1:2000
  • Show Configuration
  • Exit the Admin client
  • Run the CLI client, giving the API address of any node. We chose to connect to dev1 here.
    • rlwrap target/debug/haret-cli-client 127.0.0.1:2002
  • List namespaces
  • Enter the test-ns namespace so you can issue operations against the namespace's tree

Issuing commands against a namespace

haret> create set /some/other/node
Ok
Epoch = 1, View = 6, Client Request Num = 3
haret> set insert /some/other/node hi
true
Version = 1 Epoch = 1, View = 6, Client Request Num = 4
haret> set contains /some/other/node hi
true
Version = 1 Epoch = 1, View = 6, Client Request Num = 5
haret> set contains /some/other/node h
false
Version = 1 Epoch = 1, View = 6, Client Request Num = 6
haret> create set /some/set
Ok
Epoch = 1, View = 6, Client Request Num = 7
haret> set insert /some/set blah
true
Version = 1 Epoch = 1, View = 6, Client Request Num = 8
haret> set intersection /some/set /some/other/node
Epoch = 1, View = 6, Client Request Num = 9
haret> set union /some/set /some/other/node
hi
blah
Epoch = 1, View = 6, Client Request Num = 10
haret>

Test failover

  • Note the haret state
    • haret-admin> vr replica test-ns::r1::dev1
  • Kill the primary (in this case dev2)
  • Wait a few seconds for re-election to occur and then re-enter the namespace from the client cli. to try to discover the new primary.
  • Issue new commands that show the state is preserved after crashing the master
haret> set union /some/set /some/other/node
hi
blah
Epoch = 1, View = 7, Client Request Num = 11

NIST Advises Against Periodically Changing Passwords

$
0
0

The National Institute of Standards and Technology (NIST) is no longer recommending people periodically change their passwords as part of the organization’s new draft of its Digital Identity Guidelines.

The draft order, Special Publication 800-63-3, makes several changes to what were once commonly believed to be best security practices for passwords—or “memorized secrets,” as the NIST refers to them—including encourages websites and services to no longer require users to arbitrarily change passwords.

Read: World Password Day: How To Create A Secure Password

Under the Authentication and Lifecycle portion of the NIST’s latest guidelines, it advises sites and services to “not require that memorized secrets be changed arbitrarily (e.g., periodically) unless there is a user request or evidence of authenticator compromise.”

This change runs contrary to what was once considered a necessary security option, especially for sites that hold sensitive information like financial institutions and hospitals.

In recent years, more security experts have come around on the idea that people shouldn’t be required to change their password unless there is clear reason to do, primarily because people just don’t put in the effort to create secure passwords when they know they will have to change it in a few months.

A study conducted by the University of North Carolina at Chapel Hill found that when people are required to change their password regularly, they often use the same pattern with minor transformations. Instead of creating an entirely new password, a person might change number or change a letter into a symbol or add or remove a special character but keep the same base of the password.

Read: Is My Password Secure? How To Change, Make Strong Passcode After A Hack

Even if users were to create unique passwords each and every time they were required to do so, odds are it wouldn’t help much. A study from Carleton University found that changing passwords had minimal effect on preventing hackers from accessing accounts through brute force attacks, meaning the changes inconvenience the user more than the attacker.

In addition to ditching the requirement for regular password changes, the NIST is also advising sites to allow users to create passwords that are at least 64 characters long and include spaces so people can create pass phrases that may be easier to remember and to ditch special character requirements.

This is an idea that many security experts have supported in favor of passwords with special characters that a person wouldn’t normally use. Phrases are more difficult to crack because of the sheer amount of characters and much easier to remember.

Should the draft from the NIST go forward, users should see the ability to use passphrases start to crop up and arbitrary password changes disappear from many sites and services. The NIST, a government organization, sets the standards and best practices used by many private sector entities.

Startup School 14: How to Think About PR

$
0
0

Sharon Pope, Head of Programs and Marketing at YC Continuity, walks through how to think about PR and the best practices for working with the press. Featuring Q&A with veteran journalist, Steven Levy, editor of Backchannel and alum of WIRED and Newsweek.

Resources
Lecture Slides

Some materials in this MOOC are derived from content of a course offered at Stanford University, and this MOOC does not reflect the complete course offering at Stanford. This MOOC is offered solely by Y Combinator, and your participation in this MOOC does not establish any relationship between you and Stanford University.

© 2017
Startup School by Y Combinator.
All rights reserved.

Privacy Policy

Startup School Logo

‘The Wire’ – Game Day

$
0
0

Editor’s note: This story contains explicit language. And some spoilers.

The goal was for the aggression to stay on the blacktop at Baltimore’s neighborhood-famous Cloverdale Courts. Proposition Joe’s Eastside squad was going up against Avon Barksdale’s Westside unit. The losing team would have to throw a party for both crews. And a six-figure dollar amount was on the line. Hell, ’hood reputation was on the line. Tension was high.

Avon clowned Prop Joe. “Ayo, wassup playboy? How come you wearing that suit, B? For real, it’s 85 fucking degrees … and you trying to be like Pat Riley!”

Joe’s retort: “Look the part, be the part, motherfucker!” Yet, the Eastside projects drug dealer hadn’t made any markings on his clipboard. Couldn’t read a playbook if he tried. This is a scene from “Game Day,” the ninth episode of the first season of David Simon’s and Ed Burns’ epic, intense and critically fantastic series The Wire.

In Episode 9, Baltimore detectives were finally able to identify notorious drug kingpin Avon Barksdale. The police knew he existed, but save for a childhood boxing photo, they had no idea what he looked like. Barksdale had evaded law enforcement for years, but they were able to identify him in this episode because he was coaching a neighborhood basketball game. “Game Day” is an essential chapter in The Wire. It sets the rest of the series in motion.

The Wire debuted on HBO on June 2, 2002. It was the same night of a gruff Western Conference finals Game 7 between the Los Angeles Lakers and the Sacramento Kings — the Lakers won in overtime, closing out perhaps the wildest series of the decade. A slow-moving, expository, 62-minute pilot episode was no match.

But The Wire ran for five seasons. It succeeded by giving us a deep, 360-degree view of life inside an urban American city — the politicians, the cops, the corner boys, drug kingpins, stickup men, addicts, families of the addicts, dock workers, the local media — and more. The Wire could have been Detroit. Or Oakland. Or Newark. But this series was set in Baltimore— and fans all over the country and around the world were rabid about it.

Baltimore’s illegal activity (for the afternoon of Episode 9) was on a kind of TV timeout. It was Game Day in a city that birthed real-life basketball stars such as Muggsy Bogues, Keith Booth, Reggie Williams and Carmelo Anthony. This is where a high school hoops legend like East Baltimore’s Aquille “The Crimestopper” Carr flourished — and slowed down crime for two hours in Baltimore every time he had a game. The Wire’s Eastside vs. Westside contest, and the drama around it, was one of the most authentic hours in one of the most authentic television series ever to hit the small screen.

Thing is, The Wire never got its propers while it was airing. It never won a single Emmy. And The Wire struggled to maintain an audience during the last three seasons. Yet, if you ask any true-blue fans, they’ll tell you the experience ended far too soon. One more season, they wanted. Just one more.

The show did, after all, introduce Idris Elba, whose sex appeal never overshadowed the treachery of Stringer Bell. The execution of Michael B. Jordan in season one remains one of the most gut-wrenching and heartbreaking scenes ever aired on television. And we got familiar with one of the most dynamic and complex characters ever written for TV, the Robin Hood of the ’hood, Omar, a role seemingly effortlessly executed by Michael K. Williams. Oh, indeed.

Those who wrote it, starred and co-starred in it, directed and produced it — and who love the episode — contribute to this play-by-play. This is the story of “Game Day.”

Everyone quoted is identified by the titles they held during The Wire era.

‘Look the part, be the part.’

Each season of The Wire focused “with sociological precision” on a different aspect of Baltimore’s state of affairs. Season one zeroed in on drug dealers and the police officers who were desperately trying to crack down on them. Consequent seasons centered on life on the docks of the Port of Baltimore, local politics, the local newspaper and the school system. This series didn’t feel fictional. “Game Day” felt like real life — language and all.

Shamit Choksey
Co-writer, “Game Day”

David Simon created a world. He [was] a beat reporter for TheBaltimore Sun … so the entire show, the crux of all of it, is so entrenched … in reality.

Sonja Sohn
Detective Kima Greggs

By the time we got to the ninth episode, we knew that this was an authentic show.

Ed Burns
Producer, writer and co-creator of The Wire

I spent 20 years on the police force. I was engaged in the drug world. I love that world. I love how brave people were. I love the integrity of the corners, and the streets. [On The Wire] we weren’t too keen about ad libbing.

Wood Harris
Avon Barksdale, Westside Baltimore drug dealer

Ninety percent of the time — when you see me, Hassan Johnson, Michael K. Williams — we’re speaking to the script. David is a very smart writer, a smart guy. He’s a pro-cultural person.

Seth Gilliam
Narcotics Detective Ellis Carver

Simon is the blackest Jewish man I know. … I also appreciated that he never wrote ‘niggers’ or ‘fucking niggers’ in his script.

David Simon
Creator, executive producer, head writer and showrunner, The Wire

The N-word was always written down. [But] sometimes it was thrown in by the actors. The actors felt the moment and did it without it being on the page, but sometimes it was very much on the page.

Seth Gilliam
Narcotics Detective Ellis Carver

[People] were ‘shitbirds’ or ‘hopheads.’ I changed them to ‘niggers’ and ‘fucking niggers’ as often as I could.

David Simon
Creator, executive producer, head writer and showrunner, The Wire

It was the necessary word. I’m not going to lie and pretend. Now, if it’s gratuitous, it’s gratuitous.

Seth Gilliam
Narcotics Detective Ellis Carver

I was like, ‘Well, David, I’m going to let you in on a little something: Black people who play by the rules and follow the guidelines really resent black people who don’t.’ So there’s a lot of anger there. A black cop is not going to call a black kid that he sees selling drugs a ‘shitbird.’ He’s going to call him something really personal, and ugly.

David Simon
Creator, executive producer, head writer and showrunner, The Wire

Maybe Ed knew better, or maybe just I’m not remembering right — but my sense of it was if there wasn’t an annual east-west basketball game sponsored by the pre-eminent drug crews, there ought to be.

Shamit Choksey
Co-writer, “Game Day”

[David] Melnick and I, we’re big sports fans. I don’t know if David assigned us this story because he knew that.

Members of the Barksdale Organization sit on the bench while intently watching a basketball game in HBO’s The Wire.

Courtesy of HBO

David Simon
Creator, executive producer, head writer and showrunner, The Wire

Basketball or boxing were the only two things that would have credibly created a moment for east to meet west. Baseball would have been absurd. Football would have been too complicated.

Shamit Choksey
Co-writer, “Game Day”

When we turned in our first draft, [Simon] really brought it more to life. We were just a couple young guys who were like, ‘Man, the basketball stuff is popping, and David’s loving it!’ We were excited.

Anthony Hemingway
First assistant director

I definitely praise David Simon … using [basketball] as the backdrop … [that] resonated globally.

Andre Royo
Reginald “Bubbles” Cousins, heroin addict and police informant

[In the episode], you got everybody breaking the drug game to watch this basketball game. I remember games [like that] in [New York]. Lots of people would come to those … on Fourth Street. It rang true.

Maurice Blanding
Actual professional player in European leagues, portrayed junior college ringer for the Barksdale Organization

I didn’t have the money for basketball camp back [in the day]. Camp was like 500 bucks. At the time, my coach was a gentleman who made good money in the streets. He said, ‘Look, Maurice, you want to go to this camp? Every dunk you make, I’ll give you $100.’ I finished the game with about eight dunks, and that’s how I had money for camp. Playing ball … it kept me off the streets, from trying to hustle. We needed something to eat? They’d go buy 20 french fries, 20 hamburgers, 20 chicken sandwiches and bring it back to the court. They’d buy us sneakers, uniforms, books. I’m not proud these guys had to hustle for a living and sell drugs, but I was impressed they didn’t want the same thing for us.

Wood Harris
Avon Barksdale, Westside Baltimore drug dealer

Basketball in the black culture is very important. It’s looked at almost as a refuge, as a way out. It gave us heroes.

‘Ain’t gon’ be no trouble over no ball.’

In “Game Day,” which originally aired on Aug. 4, 2002, Baltimore’s two biggest drug dealers have their annual streetball game. Simon and Burns say they weren’t aware whether such a game ever existed in Baltimore, but they wanted to have some sort of athletic competition. The rivalry basketball game is pivotal because it introduces new character Proposition Joe (Robert Chew, who died in 2013). Avon Barksdale (Harris) wants to beat Prop Joe’s team so badly that he and Stringer Bell (Elba) recruit a junior college player (Blanding) as a ringer. “Game Day” begins on the court, with Elba and Harris looking down on Blanding playing what looks to be pickup ball. The actual scene was shot at Baltimore’s historically black Coppin State University.

David Simon
Creator, executive producer, head writer and showrunner, The Wire

We needed, for purposes of plot, to show that rivalry. We needed it because we were introducing the element of Prop Joe and his crew on the Eastside. We needed to frame that in some intelligent way. And the idea of competition naturally led to, ‘Is there a social function? Or a moment where these different crews would cross-pollinate? We came up with the basketball game.

Shamit Choksey
Co-writer, “Game Day”

David Melnick, who wrote that episode [with me], are just a couple of guys from the ’burbs of Baltimore; there’s nothing hardcore about us at all.

David Simon
Creator, executive producer, head writer and showrunner, The Wire

It would be hard to avoid the extraordinary love affair that urban America has had with the game of basketball. Generations of it. You’d have to be willfully ignorant.

Show Creator David Simon on Capturing the essence of streetball

Footage courtesy of HBO

Ed Burns
Producer, writer and co-creator of The Wire

All the kids, that was their one ambition, even more so than football, was being a great basketball player. We had a couple guys come out of Baltimore, Skip Wise being one of them, who would have been a great basketball player if he didn’t succumb to drugs.

David Simon
Creator, executive producer, head writer and showrunner, The Wire

Everybody in Baltimore knows the painful story of Skip Wise. He didn’t quite escape the street culture.

Ed Burns
Producer, writer and co-creator of The Wire

There are moments when — in the first year of World War I, in the trench warfare — when Christmas rolled around, Germans and the French and the British went into no man’s land to celebrate that holiday. And then they went back to killing each other. There were moments when you could give me the ball, or the rock or whatever. And you could have that truce.

Wood Harris
Avon Barksdale, Westside Baltimore drug dealer

I’ve played on basketball courts where gangsters are on the side and got money on it. You just want to play good. I knew what that feeling was like.

Shamit Choksey
Co-writer, “Game Day”

That ringer thing was eye-opening for Melnick and I. We didn’t know that that would even be feasible in that world, that somebody with influence on the street level would connect with the university to try and get a ringer. That blew our minds. That was the first or second beat on that beat sheet. We saw that, and we were like, ‘Wow, that’s the way it works?’

Maurice Blanding
Actual professional player in European leagues, portrayed junior college ringer for the Barksdale Organization

I grew up in Baltimore City, played everywhere in Baltimore City. Grew up with the real Avon Barksdale’s nephew. He played on my football team in high school.

Shamit Choksey
Co-writer, “Game Day”

I remember that moment where we just sat down and started pounding keys and going, ‘OK, let’s, uh …’ [but] there is no research for that. First of all, the internet — we’re talking early 2000s — was not as far-reaching.

Seth Gilliam
Narcotics Detective Ellis Carver

It seemed kind of strange to me, but David Simon said he had heard about something like that before when he was [at] The Baltimore Sun. I mostly was excited that I was having an episode that I had more than two scenes in. Me and Domenick Lombardozzi referred to it as my Taxi Driver episode, because it’s my favorite movie.

Domenick Lombardozzi
Narcotics Detective Thomas “Herc” Hauk

We were heavy in that episode.

David Simon
Creator, executive producer, head writer and showrunner, The Wire

We were using it so that the detectives could naively try to get eyes on Avon Barksdale, and to try to follow him. We were doing it so we could also show Herc and Carver up on the roof, being forgotten about.

Seth Gilliam
Narcotics Detective Ellis Carver

A layer of the shade [was] pulled back on how these guys are human. These are people. We’re treating them like they’re scum of the earth and they don’t have any rights. But if there’s a common ground like basketball, where two opposing sides can come together and put their differences aside … they mostly want to unify, they don’t want to destroy.

Domenick Lombardozzi
Narcotics Detective Thomas “Herc” Hauk

It didn’t catch me by surprise because … it’s kind of tradition. It’s very similar to the Rucker, you know? In New York. It all made sense to me.

Seth Gilliam
Narcotics Detective Ellis Carver

[My character had] that revelation of, ‘Oh, these motherfuckers might have feelings.’ They care about shit.

Detectives Herc and Carver watch an annual neighborhood basketball game while they try to identify who Avon Barksdale is.

Courtesy of HBO

Maurice Blanding
Actual professional player in European leagues, portrayed junior college ringer for the Barksdale Organization

I was home on break from playing basketball overseas, and in South America. A buddy of mine was doing security for The Wire, and the director said, ‘Hey, do you know a guy that can play basketball, and can dunk?’ So I went up to Coppin … and I opened that episode up with Elba and Harris. Sometimes I look back and say, ‘Man, should I have started acting instead of continuing playing basketball in Europe?’ I made $2,500 in three days.

Wood Harris
Avon Barksdale, Westside Baltimore drug dealer

I love that episode. “Game Day” is one of my favorites. … That’s the one I had the most fun shooting.

Shamit Choksey
Co-writer, “Game Day”

The show was very urban, and gritty, but here we are shooting in a clean and pristine university gymnasium. That crossed grains with this show that we were getting to know. … It was outside of the element of the world that The Wire was [usually] taking place in.

Maurice Blanding
Actual professional player in European leagues, portrayed junior college ringer for the Barksdale Organization

I was overly impressed, even though Dunbar is Eastside and I [in real life] was Westside. So I had a little issue with that at first because, you know, the rivalry’s real!

Wood Harris
Avon Barksdale, Westside Baltimore drug dealer

Idris don’t really play basketball, but we still had a lot of fun.

Ed Burns
Producer, writer and co-creator of The Wire

He didn’t know anything about drug dealing, either, when he started out! Idris instinctively knew the value of a scene. You didn’t have to go to him and say, ‘This is the way things are done.’ There was no need for him to really love basketball.

‘The projects got a ball team?’

Baltimore basketball is serious business — in real life and on television. Detectives Herc and Carver finally figured out that everyone in the streets has suspended all drug trafficking to participate in or watch the basketball game. In a scene leading up to the end of the game, Lt. Cedric Daniels (Lance Reddick) announces that the drug dealer they’re looking for (Harris’ character) is over at the historic Cloverdale Courts.

Maurice Blanding
Actual professional player in European leagues, portrayed junior college ringer for the Barksdale Organization

They didn’t actually film that at Cloverdale. That was at Collington Square in East Baltimore.

Wood Harris
Avon Barksdale, Westside Baltimore drug dealer

There was one issue. That episode was being directed by this French director whose name I can’t remember.

Milcho Manchevski
Director

I was born in Macedonia. I came here for film school and then stayed.

David Simon
Creator, executive producer, head writer and showrunner, The Wire

Milcho turned out to be a very good director. He was a good friend of [former executive producer] Bob Colesberry’s. Bob brought him in, very much admired his work. And there’s a lot to admire.

Milcho Manchevski
Director

It’s the only piece of episodic television I’ve done. I directed five features and wrote all of them. But this one was just so attractive because the writing was great. Colesberry was producing … so I knew it was going to be a creative enterprise.

David Simon
Creator, executive producer, head writer and showrunner, The Wire

He was a feature director who had never done television. In features it’s, ‘Get the writer off the set. We have the script.’ But in television the writers are the producers, so we’re worried about continuity, we’re worried if it will make sense in all [of the] episodes. He wasn’t used to having a writer always on set. If not me, Ed or somebody. We struggled a little bit.

Anthony Hemingway
First assistant director

He was new to TV and just didn’t realize the concept of you can’t reinvent the wheel. You have to learn how to adapt and fall within a frame of what the show is … you have the ability to color it and put your name on it. You can’t come in and completely change it. It caused a lot of tension. Unfortunately, I was the middleman between him and our VP and also the actors.

Wood Harris
Avon Barksdale, Westside Baltimore drug dealer

After lunch — when you have lunch on the set or whatever, it’s like an hour long and you come back — no director. The director couldn’t be found. So what happened was … Anthony Hemingway … he was second A.D. for The Wire.

Tray Chaney
Malik “Poot” Carr, teen drug dealer

When everyone came back from lunch … Anthony was the man.

Anthony Hemingway
First assistant director

I had to rise to the occasion. It was very sensitive, only because the union obligations and all the legalities within that. I wasn’t technically directing, but … I was there for the show and had to step forward to protect the show.

David Simon
Creator, executive producer, head writer and showrunner, The Wire

The basketball thing is obviously an intensely choreographed dynamic. And the A.D. would be influential in terms of placing everybody and … you’re coordinating between the actual athletic narrative within the game, what’s happening, where we’re placing all the extras, where we’re placing our characters among the extras. That was Anthony. And I think, in some respects, it’s where he really began to shine.

Show Creator David Simon on Developing iconic characters

Footage courtesy of HBO

Ed Burns
Producer, writer and co-creator of The Wire

We had a lot of faith in Anthony. He had been with us, particularly with [co-executive producer] Nina Noble, from the early ’90s. And he was extremely confident.

Domenick Lombardozzi
Narcotics Detective Thomas “Herc” Hauk

Hemingway was a big part of the show even when he wasn’t directing as a first A.D. He was very influential.

Anthony Hemingway
First assistant director

That day in particular was challenging because we needed crowds. We had open calls on the radio, getting people to come out. We had the turnout that we needed.

Seth Gilliam
Narcotics Detective Ellis Carver

I think the extras were hired right from the neighborhood.

Maurice Blanding
Actual professional player in European leagues, portrayed junior college ringer for the Barksdale Organization

And it was about 85 degrees. The humidity in Baltimore is ridiculous.

Anthony Hemingway
First assistant director

Insane and intense and crazy. I didn’t technically direct that episode. I had to make it, I had to be the Band-Aid and make the day flow. I was still assistant director. … I had to step in and keep the day flowing … but I didn’t, and will not ever, call myself as the director.

J.D. Williams
Preston “Bodie” Broadus, teen drug dealer

Wood Harris is the star of Above the Rim. … It was a basketball film; it had Tupac [Shakur] in it. It just took me there, like, ‘Wow, now I’m doing a basketball scene with Wood Harris? I must be making some type of progress. …’

Maurice Blanding
Actual professional player in European leagues, portrayed junior college ringer for the Barksdale Organization

I didn’t even know Idris Elba was from England. He spoke the Baltimore slang and language so much. He was that good.

Tray Chaney
Malik “Poot” Carr, teen drug dealer

“We’re really part of something that was incredible and has become a part of the fabric of television.”Shamit Choksey

Maurice Blanding
Actual professional player in European leagues, portrayed junior college ringer for the Barksdale Organization

I’m a Tupac fan, and I’m also a Wood Harris fan. I asked while I was sitting there, ‘How was being around ’Pac?’ He said, ‘He’s the ultimate professional, he’s a perfectionist, but he’s a down-to-earth man, just like you and I.’ I was sitting here talking to Wood Harris about Tupac! This is crazy!

David Simon
Creator, executive producer, head writer and showrunner, The Wire

There was one cross, one vicious move that [Blanding] made from the top of the key. When we saw it we just fell down, we were laughing so hard. It was such a great inside move. You’ve got to remember, we’re only doing this with a few seconds of ball. We’re not filming the whole game … so whatever time we have to devote to actual basketball, you want the footage to feel real. You also want to get the in-your-face ballet of streetball.

Maurice Blanding
Actual professional player in European leagues, portrayed junior college ringer for the Barksdale Organization

That was scripted, but that’s how I play. The director was like, ‘Listen, don’t shoot the ball.’ [We] said, ‘Well, we just want to play!’ And that’s when we started playing a little bit more physical, and I played my real game and they stopped stripping the ball because they knew an elbow might come behind it. So the first part was scripted, the second part was like half-scripted, and then they made use of us really playing ball.

David Simon
Creator, executive producer, head writer and showrunner, The Wire

I remember seeing that on film and thinking, if you ever went to Collington Square, if you ever went to Cloverdale and watched the best players, that’s the kind of shit where you saw a move like that and it laid everybody out for 30 seconds. Like, ‘Oh shit! What just happened?’ We got one of those on film. I was very proud of us.

Wood Harris
Avon Barksdale, Westside Baltimore drug dealer

I didn’t have to give them any technical advice. Everyone knew basketball. Everybody who was there was black.

Maurice Blanding
Actual professional player in European leagues, portrayed junior college ringer for the Barksdale Organization

I thought it was authentic. When we play ball [in real life], you had guys who probably didn’t get along … on the street level, they’re enemies. But on the basketball level, they never brought it to the court. You’d have some shootings sometimes, people would get into a fight, but I’d say 95 percent of the time it was strictly about basketball. It did lower the crime rate in that area where we played — everybody just wanted to watch us play. Everybody wanted to see me dunk because I had like a 45-inch vertical back then.

Anthony Hemingway
First assistant director

I was out there trying to find moments … where especially black men can come together and support each other. And put behind us all the negative drama that has been perpetuated over the years, and support one another and love one another. And be able to be in the same place together.

Maurice Blanding
Actual professional player in European leagues, portrayed junior college ringer for the Barksdale Organization

It was as authentic as I have seen anybody portray the streetball of Baltimore City, where they gettin’ in the referee’s face.

Wood Harris
Avon Barksdale, Westside Baltimore drug dealer
David Simon
Creator, executive producer, head writer and showrunner, The Wire

We [wanted to] demonstrate something about Avon Barksdale’s personality when he intimidates the ref on a bad call and then, in the next moment, becomes frustrated that the ref is about to cave. He wants to yell at the ref. He doesn’t want the ref to treat him like the winner because he’s feared. He wants to be right on the merits, and he no longer can be because he’s Avon Barksdale. And he realizes that.

Maurice Blanding
Actual professional player in European leagues, portrayed junior college ringer for the Barksdale Organization

The crowd, that was normal. A summer league in Baltimore will generate a crowd of at least 500 people sometimes. It was just awesome.

David Simon
Creator, executive producer, head writer and showrunner, The Wire

We’re not thinking to ourselves, ‘We’re really making a statement here about basketball in the inner city.’ We were just using found material.

Maybe we won.

Fifteen years later, this series still resonates (and it’s available at HBO NOW). Major urban centers are still dealing with the problems that embattled fictional Baltimore for the duration of this series. The Wire, sadly, feels contemporary.

Anthony Hemingway
First assistant director

I actually get very giddy when I go on different jobs, and I smile real hard when so many people really praise the show. That makes me feel great to be a part of that. That was my start.

Shamit Choksey
Co-writer, “Game Day”

Five years out, when I started to hear, ‘Wait a second, he wrote for The Wire? I love that show.’ … I kind of scratched my head. It wasn’t those that are from that world. It was a white college girl who’d never spent any time in the city who was obsessed with the show.

Ed Burns
Producer, writer and co-creator of The Wire

I don’t think anything’s changed. Now the drugs embrace the white community, the working-class community, particularly. The language might change from rural America to city America, [but] it is the same. And the acting is so damn good.

“I have a problem with the glorification of a drug dealer and America is fascinated with that world. We’re celebrating the very … problem that America has in its ‘hood. But Stringer Bell was no role model. He ruled the people who worked for him through fear.”Idris Elba, 2009

Domenick Lombardozzi
Narcotics Detective Thomas “Herc” Hauk

Maybe people weren’t ready for a show like that, or maybe it was just kept in the shadows. It’s like a cult following now.

J.D. Williams
Preston “Bodie” Broadus, teen drug dealer

We blew everybody’s tops off, and they still didn’t give us whatever we deserved. That’s OK because that makes them look stupid. The most important thing is that the people who know, who love it, really love it.

Shamit Choksey
Co-writer, “Game Day”

I didn’t realize how big and iconic the show was when we were in the middle of it. We’re really part of something that was incredible and has become a part of the fabric of television.

Andre Royo
Reginald “Bubbles” Cousins, heroin addict and police informant

We knew what we were doing was real stuff. There was a certain pride and awe every time we got a script because we were like, ‘Are they telling our side or not?’ And we’re really telling this side of the story, and with such fairness, and in such a nonjudgmental way. It just kept us intrigued and happy to be a part of the show.

Sonja Sohn
Detective Kima Greggs

The Wire is timeless. We’ve been living in these conditions for decades now. It’s not a surprise to me that it resonates. Until we address the structural issues that exacerbate the criminal element that exists in underserved black communities, this story will always be relevant.

Tray Chaney
Malik “Poot” Carr, teen drug dealer

I think I can speak for all of us saying we didn’t know that the show was gonna be a part of history like it is now.

David Simon
Creator, executive producer, head writer and showrunner, The Wire

I would prefer to be living in [a] country where The Wire was less relevant 15 years later. I would have much preferred to think of the show as being anachronistic.

Seth Gilliam
Narcotics Detective Ellis Carver

I thought it was gold when we were doing it. I still get a little frothy when people are like, ‘Why did that show go off the air?’ And I’m like, ‘Did you watch it when it was on? Well, that’s why the shit went off the fucking air.’ They were] watching The Sopranos, which was old and tired by that point. The Wire is still the best show in the history of television. And if you reran it right now, it would be better than everything else on TV.

These interviews have been edited for clarity and length.

Where they are now:

Maurice Blanding: Works at Baltimore’s Department of Housing and Community Development.

Ed Burns: Lives in West Virginia and is working on several television projects.

Tray Chaney: Is a rapper and also stars in Bounce TV’s Saints & Sinners.

Shamit Choksey: Currently working in automotive sports marketing for Kia; also working on a new TV project with his brother.

Seth Gilliam: Co-stars on AMC’s The Walking Dead, is set to co-star in feature film Change in the Air.

Wood Harris: Is set to co-star in feature films Once Upon a Time in Venice (with Bruce Willis and John Goodman) and 9/11 (with Charlie Sheen and Whoopi Goldberg).

Anthony Hemingway: Is producing and directing television series including WGN’s Underground and is set to direct the indie film Bury the Lead. He also served as an executive producer and director on ABC’s American Crime and was nominated for an Emmy for his work on FX’s The People v. O.J. Simpson: American Crime Story.

Domenick Lombardozzi: Is part of the cast of Fox’s Rosewood and will next star in the feature films Frank and Ava (2017) and Hard Powder (2018).

Milcho Manchevski: Recently wrapped the feature film Bikini Moon, which stars Condola Rashad.

Andre Royo: Co-stars on Fox’s Empire and is set to co-star in Amazon Studios’ Beautiful Boy alongside Steve Carell, out in 2018.

David Simon: His next series, The Deuce, is set to premiere on HBO this fall; it features several The Wire alums.

Sonja Sohn: Is currently filming Showtime’s The Chi.

J.D. Williams: Stars in Bounce TV’s Saints & Sinners.

Illustration by Paul Lacolley.

Kelley L. Carter is a senior entertainment writer at The Undefeated. She can act out every episode of the U.S version of "The Office," she can and will sing the Michigan State University fight song on command and she is very much immune to Hollywood hotness.

Theresa May to create new internet controlled and regulated by government

$
0
0

The proposals come soon after the government won the right to collect everyone's browsing history

Theresa May is planning to introduce huge regulations on the way the internet works, allowing the government to decide what is said online.

Particular focus has been drawn to the end of the manifesto, which makes clear that the Tories want to introduce huge changes to the way the internet works.

"Some people say that it is not for government to regulate when it comes to technology and the internet," it states. "We disagree."

Senior Tories confirmed to BuzzFeed News that the phrasing indicates that the government intends to introduce huge restrictions on what people can post, share and publish online.

The plans will allow Britain to become "the global leader in the regulation of the use of personal data and the internet", the manifesto claims.

It comes just soon after the Investigatory Powers Act came into law. That legislation allowed the government to force internet companies to keep records on their customers' browsing histories, as well as giving ministers the power to break apps like WhatsApp so that messages can be read.

The manifesto makes reference to those increased powers, saying that the government will work even harder to ensure there is no "safe space for terrorists to be able to communicate online". That is apparently a reference in part to its work to encourage technology companies to build backdoors into their encrypted messaging services – which gives the government the ability to read terrorists' messages, but also weakens the security of everyone else's messages, technology companies have warned.

The government now appears to be launching a similarly radical change in the way that social networks and internet companies work. While much of the internet is currently controlled by private businesses like Google and Facebook, Theresa May intends to allow government to decide what is and isn't published, the manifesto suggests.

The new rules would include laws that make it harder than ever to access pornographic and other websites. The government will be able to place restrictions on seeing adult content and any exceptions would have to be justified to ministers, the manifesto suggests.

The manifesto even suggests that the government might stop search engines like Google from directing people to pornographic websites. "We will put a responsibility on industry not to direct users – even unintentionally – to hate speech, pornography, or other sources of harm," the Conservatives write.

The laws would also force technology companies to delete anything that a person posted when they were under 18.

But perhaps most unusually they would be forced to help controversial government schemes like its Prevent strategy, by promoting counter-extremist narratives.

"In harnessing the digital revolution, we must take steps to protect the vulnerable and give people confidence to use the internet without fear of abuse, criminality or exposure to horrific content", the manifesto claims in a section called 'the safest place to be online'.

The plans are in keeping with the Tories' commitment that the online world must be regulated as strongly as the offline one, and that the same rules should apply in both.

"Our starting point is that online rules should reflect those that govern our lives offline," the Conservatives' manifesto says, explaining this justification for a new level of regulation.

"It should be as unacceptable to bully online as it is in the playground, as difficult to groom a young child on the internet as it is in a community, as hard for children to access violent and degrading pornography online as it is in the high street, and as difficult to commit a crime digitally as it is physically."

Conservative manifesto launch: In 90 seconds

The manifesto also proposes that internet companies will have to pay a levy, like the one currently paid by gambling firms. Just like with gambling, that money will be used to pay for advertising schemes to tell people about the dangers of the internet, in particular being used to "support awareness and preventative activity to counter internet harms", according to the manifesto.

The Conservatives will also seek to regulate the kind of news that is posted online and how companies are paid for it. If elected, Theresa May will "take steps to protect the reliability and objectivity of information that is essential to our democracy" – and crack down on Facebook and Google to ensure that news companies get enough advertising money.

If internet companies refuse to comply with the rulings – a suggestion that some have already made about the powers in the Investigatory Powers Act – then there will be a strict and strong set of ways to punish them.

"We will introduce a sanctions regime to ensure compliance, giving regulators the ability to fine or prosecute those companies that fail in their legal duties, and to order the removal of content where it clearly breaches UK law," the manifesto reads.

In laying out its plan for increased regulation, the Tories anticipate and reject potential criticism that such rules could put people at risk.

"While we cannot create this framework alone, it is for government, not private companies, to protect the security of people and ensure the fairness of the rules by which people and businesses abide," the document reads. "Nor do we agree that the risks of such an approach outweigh the potential benefits."

LZ4_8088 – Extremely fast LZ4 decompression for the 8088/8086 CPU

$
0
0

LZ4_8088 is a chunk of assembly code that implements incredibly fast LZ4 decompression for 8088 and 8086 CPUs. It is specifically optimized for the 8088 and is intended for use in hobby or retrocomputing projects. Code is provided for most generic x86 assemblers, as well as an example of how to use it in Turbo Pascal.

LZ4 itself is a compresson format that is implemented as an open-source C library, with ports to other platforms. The goal of the library is speed, and it currently holds many top speed rankings in compression benchmarks. One variant of LZ4 called LZ4_HC implements optimal parsing, which creates the very best possible set of literal and match runs for a given input and coding set. This leads to compression ratios that are competitive with PKZIP/zlib, but unlike PKZIP, LZ4 doesn't implement order-0 coding (ie. bit twiddling which 8088/8086 is very bad at) so the end result decompresses at nearly memcpy() speeds.

Here are some statistics comparing LZ4 with PKWare's Data Compression Library (DCL). The DCL was chosen as a comparison because it uses an algorithm very similar to deflate (which was considered state of the art speed-wise for many years on DOS platforms), and also because the DCL could be measured with microsecond accuracy. To eliminate implementation bias, PKWare's retail DCL compiled assembly code was used.

Data TypeFilename Original sizeLZ4_HC compressed sizeLZ4_HC ratioDCL Implode sizeDCL Ratio memcpy() time in µs (REP MOVSW)LZ4 Decompression Speed (x slower than memcpy)DCL Decompression speed (x slower than memcpy)
Sparse bitmapshuttle.pic 16390329720%255216% 449891.9120.50
RLE bitmaprle.dmp 163844363%3872% 449770.765.79
Small text filetext.txt 4988303761%232347% 137163.1761.21
Large text filelargetxt.txt 568992689047%2564245% 1564573.1754.43
Sparse compiled binaryrobotron.com 407042104852%1817845% 1120362.7553.51
Dense compiled binarylinewars.exe 617444150067%3664159% 1699242.1670.08
Uncompressable datarandom.bin 6400064260100%71822112% 1761131.39116.14

Key takeaways from the above table:

  • For most sources, decompression is never slower than 3.2x memcpy.
  • For source material that contains long runs of sequences (RLE), decompression is faster than memcpy.
  • Compression ratios are competitive; they're mostly within a few percentage points of PKWare ratios.

For full documentation, please see the included LZ4_8088.TXT in the download distribution. It is highly recommended you read the documentation to avoid any pitfalls using the code.

LZ4_8088.ZIP contains the assembler routine, a Turbo Pascal test harness, documentation, compression samples, and compiled binaries for Win32 and DOS 16-bit.

Ever striving for maximum speed, Peter Ferrie was able to write a slightly faster version of the decompressor, but it relies on reversed match offsets. lz4_8088_reversed_match_offsets.zip contains a small program to convert .LZ4 data to this reversed format, and also includes two new decompression routines that use the format.

The LZ4 library is provided under the BSD License. However, my code was not derived from any of the original LZ4 code so I can provide it via any license I choose. So, I am providing my code under what I am calling the Demoscene License. The Demoscene License grants you the following rights:

  • You are free to use this code in any production, commercial or otherwise, without providing remuneration to the author.
  • If you use this code, you must greet "Trixter/Hornet" if used in a demoscene production, or "Jim Leonard" if used in a normal program. Also, you must send email to trixter@oldskool.org telling him you used the code so he can marvel at your result.

Q: Is there any way to speed this code up further? Yes, but there are a variety of tradeoffs involved that make further speedup less desirable. A list of these tradeoffs is in the included LZ4_8088.TXT file in the archive.

Q: Is this code faster than the LZ4 C source code? For 8088-80286 CPUs, yes. For 386+, no, because the 386 has 32-bit registers, additional segment registers, and additional instructions. Compiling the LZ4 C code with a suitable 32-bit compiler will produce code that definitely outperforms this 8088 assembly code.

Q: How is it possible to exceed the speed of a REP MOVSW? Because 1-byte and 2-byte runs in the compressed data are handled specially with REP STOSW. STOSW can set a fixed value in memory in half the time it takes to move a value from one memory location to another.

Q: Why did you bother doing this? Because I like impressing the 1980's me.

Currently this distribution only includes decompression code. It is possible to implement LZ4 "c0" compression on 8088 in as little as 16K memory and with reasonable speed, but until I (or anyone else) has an application for compression on the 8088, I don't plan on developing it.

Initial release -- no known bugs.

20130107: Initial release.

20130209: Now includes a size-optimized version of the code as well. The speed routine compiles to 446 bytes including the shift table; the size-optimized code is 30% slower but compiles to 79 bytes. Also, speed-optimized version of the code sped up an additional 1% by contributions from both Peter Ferrie and Terje Mathisen (thanks guys!)

20130210: Forgot an optimization; the size version now optimizes to 78 bytes.

20130213: Fixed a bug that could corrupt output if the matches overlapped.

When the Hindenburg Was the Height of Luxe In-Flight Dining

$
0
0

Before it became a byword for disaster, the Hindenburg heralded an era of fine dining in the skies. Passengers received seating assignments for specific meal times. After dinner, many gathered in the pressurized bar and smoking lounge. Courtesy of The Smithsonian National Postal Museumhide caption

toggle caption
Courtesy of The Smithsonian National Postal Museum

These days, in-flight meal service often consists of a packet of pretzels and a can of soda. It's a far cry from the days of the Hindenburg, where the sumptuous dining options included multi-course meals served in an opulent dining room.

Before it became a byword for disaster 80 years ago this month, the Hindenburg was the state-of-the-art in ultra-luxury flight: a giant passenger airship composed of durable aluminum alloy filled with highly flammable hydrogen. (That would prove its downfall.)

It was conceived as a swank transatlantic travel option for the well-heeled that was faster than the deluxe cruise liners of its day, making the journey in two and a half days ” twice as fast as the Queen Mary, the star of the Cunard line.

The German-made Hindenburg “ a point of pride and propaganda for the Nazi regime ” came with its own all-electric kitchen (run by a head chef, with several assistants), grand dining room and printed menus.

Courtesy Cheryl Ganz Collection/Eric Long/National Air and Space Museum

Passengers were treated to lavish meals served on fine china, like Beef Broth with Marrow Dumplings and Rhine Salmon a la Graf Zeppelin. Indeed, these were so rich that some American passengers, unused to the heavy German cuisine, were known to complain about the buttery sauces, creams and gravies that pervaded every dish.

The complaints were common enough that a representative of the company that manufactured the Hindenburg suggested staff start providing "a printed card in the morning detailing the day's menu, along with a line stating, 'we would be happy to prepare an omelette for you if there's nothing on the menu that appeals to you'," says Dan Grossman, who writes Airships.net, a website dedicated to the history of the Hindenburg and other dirigibles.

At the bar, guests were treated to cocktails like Sloe Gin Fizzes, Manhattans, martinis and sidecars, but also crafted signature drinks, such as the LZ-129 Frosted Cocktail, a combination of orange juice and gin, named after the airship's official moniker, the LZ-129 Hindenburg. Also available was a vast selection of more than 250 bottles of the finest German wines.

And after drinks? Head to the smoking lounge (many passengers lit up in those days). The pressurized, fire-proof lounge was the perfect place to relax with a Lucky Strike —- though you had to hand over your electric (no gas!) lighter to the attendant guarding the heavy door, as one former passenger recalled.

Hindenburg's passenger quarters featured observation windows on both the port and starboard sides that opened for fresh air and taking photographs. Courtesy of The Smithsonian National Postal Museumhide caption

toggle caption
Courtesy of The Smithsonian National Postal Museum

Other aspects of the Hindenburg's accommodations were decidedly less lavish. Grossman says American guests were horrified to find that there was only one small shared towel in the rest room. And perhaps even stranger to Hindenburg's elite clientele: Upon boarding the ship, passengers were given a sturdy envelope containing a single napkin to last them the entire journey. Odd as this seems, it was an attempt to conserve weight on a ship that needed to be lighter than air.

An envelope was given to passengers to store their one allotted napkin during their passage. Courtesy of Dan Grossmanhide caption

toggle caption
Courtesy of Dan Grossman

The Hindenburg was in commercial service for just one year. Its final flight ended on a stormy afternoon on May 6, 1937. The airship approached its destination, Lakehurst, N.J., with 36 passengers and 61 crew aboard. As the ship dropped down its mooring ropes in front of spectators, an explosion occurred off the tail, engulfing the entire ship in flames. Thirty-six people died (including one crew member on the ground) ” but amazingly, 62 people survived.

"The window of opportunity to escape was about 13-16 seconds," says Grossman. "It's amazing that two-thirds of the people survived. I think this is a testament to the fierce human desire to stay alive."

In the years immediately after Hindenburg, luxury air-travel would triumph as Lufthansa, and later, Pan Am staked their own claims to commercial transatlantic passenger flight. But the explosion of the Hindenburg still echoes loudly as a death of the era of the silver airship and pre-war innocence.

Design principle: IKEA effect

$
0
0

The IKEA effect is a cognitive bias that can influence the outcome and perceived value of products to a big degree. People tend to place high value on products they partially have created. Hence, the name IKEA effect. It is derived from the Swedish furniture retailer famous for products that require to be assembled by the customers.

Products designed by IKEA and LEGO are great examples of this psychological effect. Designers must have the IKEA effect in mind when designing solutions and use it when appropriate.

A bit about the IKEA effect

The more the needs for customization and co-production are present in your target audience the more the IKEA effect is relevant for you as a designer. The effect can help you instill feelings of competence in the user when the task is completed successfully.

The IKEA effect will create stronger bond between the user and the product. The effort that users will put into completing the product to a complete state will transform into love for that product. The subjective value will be higher in comparison to a product that hasn’t cost any effort.

For example, participants in on study constructed their own origami cranes. The participants valued them roughly five times as much as another group of participants who didn’t put effort into building them.

It is important to point out that the IKEA effect is not about putting the effort be it small or big, it is more about the completion of the task. The IKEA effect is present when the user can enjoy the completed task and the product. If the product is disassembled soon after the assembling the effect is lost.

Another example points out that it is also about hitting the sweet spot.

In the period of 1920–40 American food manufacturers wanted to reduce the time and effort required to make a cake. They simplified so much the process that the cooks needed to add only water and bake the cake. Unfortunately, the sales of the cake mix quickly stalled.
The manufacturers reached a psychologist named Ernest Dichter. He found out that the reason was the level of effort required. Making the cakes was too easy! It was so easy that people didn’t get satisfaction from baking the cake.
People were feeling the same way as buying a pre-made cakes from the store. The solution was to get out the egg of the dry mixture and allow people to add it themselves. Doing that made the sales go up again.

People had the need to be emotionally invested and get rewards from the process of making the cake not just the end result.

The journey is as important as the destination!

Making things too easy is not necessary providing better experience for the user. It is all about hitting the sweet spot where the user can enjoy breaking the egg, get a bit dirty, feel in control and eat the cake in the end.

IKEA effect in your design

The act of creating a thing with ones own hands increases the perceived value to the creator. As Designers we are familiar with that feeling.

Let’s look at some ideas how to utilize that in our designs so users can see bigger value in the products we make.

People are willing to pay more for products they create than equivalent pre-assembled products. The general rule is the higher the contribution the higher the valuation is. Yet, if the effort required is too big or the contribution too small, people won’t probably complete the task. The IKEA effect is possible only when the user actually completes the task.

To hit the sweet spot we need to aim at creating a product where the level of effort is low but the perceived contribution is high. This way the IKEA effect can be achieved.

Whenever possible let users have control over customization of the product and service. Design it to be easy to execute (as breaking an egg) and to have a high perceived contribution (as cooking a whole cake).

When you let the users feel in control and put a bit of effort into getting what they need from your product/service, they will form a stronger bond with the product/service.

Digital designers for example can use sample data and editable templates to achieve the IKEA effect. Make the first experience with your app feel dynamic and alive to the users. Prompt them to edit the templates and interact with the product.

For example, leading them through the process of setting up their profile to completion. Executing successfully a simple task as sending their first email or setting up a widget on their website.

Simple actions requiring low effort and making the user feel like having high contribution will lower the fear of dealing with a new product. If done properly and continuously for a period of time it even can lead to forming loyalty to the brand and product.

You might even gain a few ambassadors saying things like “It was so easy to setup and start using it! You should give it a try.” Or as the case of IKEA furniture “I saved some money on it and now it looks so good, even better than the fancy expensive furniture in the other shop.” :)

Final thoughts

Sometimes saving the users a bit of labor could deprive them from a bit more happiness if they were to make the small effort. Think if you should decrease the user effort to zero or close to zero.

To make use of the effect we should engage people in the design and increase their sense of product ownership and brand loyalty. This way our designs will be loved more.

Thanks for taking the time to read this post!

The article is inspired by the book “Universal Design principles” by William Lidwell.

Call to action

If you found it useful tap the 💚so others can enjoy it, too.

Follow me on Twitter and here on Medium.

More design principles:


Writing a lexer in Go with Lexmachine

$
0
0

This article is about lexmachine, a library I wrote to help you write great lexers in Go. If you are looking to write a golang lexer or a lexer in golang this article is for you.

A lexer is a software component that analyzes a string and breaks it up into its component parts. Each part is tagged with what type of thing it is. This is called lexical analysis. For natural languages (such as English) lexical analysis can be difficult to do automatically but is usually easy for a human to do. Let's look at an example of lexically analyzing the following English sentence often used in typing practice (because it uses every letter in the alphabet).

The quick brown fox jumped over the lazy dog.

The sentence breaks down into individual word each of which has a part of speech

<article>, "The"<adjective>, "quick"<adjective>, "brown"<noun>, "fox"<verb>, "jumped"<adverb>, "over"<article>, "the"<adjective>, "lazy"<noun>, "dog"

Note, the word "over" can actually be either a preposition or an adverb. In this case the context of the sentence (it modifies the verb) makes it an adverb. Many words in natural languages have this property where the context of the overall sentence or paragraph determines the role they play in the sentence.

Luckily, the situation is much simpler for computer languages. Most compilers, which are programs that translate computer languages into other computer languages, start by lexically analyzing their input. They can also be used in a number of other scenarios where a program needs to understand data in textual forms.

In this article, I am going to write and explain a lexer for thegraphvizdot language. graphviz is a tool to visualize graphs.graphviz takes a string such as:

digraph {
  rankdir=LR;
  a [label="a" shape=box];
  c [<label>=<<u>C</u>>];
  b [label="bb"];
  a -> c;
  c -> b;
  d -> c;
  b -> a;
  b -> e;
  e -> f;
}

And produces :

Dot Example

Lexing Graphviz's dot language

Before one can "lex" (short for lexically analyze) a language one needs to know what it is made up of. English is made up of punctuation marks, nouns, verbs and that sort of thing. Computer languages also have punctuation but also have keywords, strings, numbers, comments and so forth.

When a lexer splits up a string into parts the parts are called tokens. The process of splitting up is also called tokenizing. Let's take a look at how the previous example would get tokenized:

Type    | Lexeme
-------------------
DIGRAPH | "digraph"
LCURLY  | "{"
ID      | "rankdir"
EQUAL   | "="
ID      | "LR"
SEMI    | ";"
ID      | "\"a\""
LSQUARE | "["
ID      | "label"
EQUAL   | "="
ID      | "a"
ID      | "shape"
EQUAL   | "="
ID      | "box"
RSQUARE | "]"
SEMI    | ";"
ID      | "c"
LSQUARE | "["
ID      | "<label>"
EQUAL   | "="
ID      | "<<u>C</u>>"
RSQUARE | "]"
SEMI    | ";"
ID      | "b"
.
.
.
RCURLY  | "}"

Note, that like when the English sentence was analyzed, spaces, newlines, tabs and other extraneous characters were dropped. Only the syntactically important characters are output.

Each token has two parts: the type and the lexeme. The type indicates the role the token plays. The lexeme is the string the token was extracted from.

Specifying Tokens

To specify how a string should be tokenized a formalism called regular expressions is used. If you don't already know about regular expressions you could start with the Wikipedia page. For a more advanced introduction see Russ Cox's articles or Alex Aiken's video lectures on the subject.

To review, a regular expression is a way of specifying a "pattern" which matches certain strings. For instance, a+b*a matches aaa and abbbba but not aab. To see why, note that the pattern says a string must start with 1 or more a characters. So all three strings aaa, abbbba and aab satisfy the first requirement. Next, the pattern says a string can have 0 or more b characters. The first string, aaa has none (and that is ok). The second string, abbbba has 4 b characters. The third string, aab has 1 b. So all three strings satisfy the second requirement. Finally the pattern says a string must end in an a. The first and the second string both end in a. However, the third string, aab, does not. Therefore, the first and second strings match the pattern but the third string does not.

The Token's for the dot Language

The dot language has keywords, punctuation, comments, and a rather unusual definition for identifier (called ID). In the listing below, the token type is on the left side and the regular expression or literal (in quotation marks) is on the right.

NODE = "node"
EDGE = "edge"
GRAPH = "graph"
DIGRAPH = "digraph"
SUBGRAPH = "subgraph"
STRICT = "strict"
LSQUARE = "["
RSQUARE = "]"
LCURLY = "{"
RCURLY = "}"
EQUAL = "="
COMMA = ","
SEMI = ";"
COLON = ":"
ARROW = "->"
DDASH = "--"
COMMENT = (/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)|(//.*$)
ID = ([a-zA-Z_][a-zA-Z0-9_]*)|("([^\"]|(\\.))*")|ID-HTML

Every token type but ID and COMMENT are literals: either a keyword or a punctuation mark. A comment is defined by a complicated regular expression which defines "c-style" range comments or line comments. Since the comment expression is defined by a regular expression no nesting is allowed.

The ID token is more complicated. It consists of three parts:

  1. The "usual form" as a name [a-zA-Z_][a-zA-Z0-9_]*. The pattern means a letter (lower case or capital) or underscore followed by 0 or more letters, numbers, or under-scores.

  2. A string, "([^\"]|(\\.))*". Thus "\\\"" and "asdf\"" are valid but"\\"" is not.

  3. A HTML string, which is non-regular (specified here in BNF):

    CHAR = [^<>]
    ID-HTML = IdHTML
    
    IdHTML : Tag ;
    Tag : < Body > ;
    Body : CHAR Body ;
         | Tag Body
         | e                    // denotes epsilon, the empty string
         ;

    Thus <<xyz<xy>xyz><asdf>> is valid but <<> is not

The reason the HTML string is not-regular (and therefore cannot be matched by regular expressions) is the angle brackets, < and >, have to be properly matched. That is, every opening bracket < must be matched with a closing bracket >. This is not possible to specify regular expressions because they cannot "count." For a formal explanation see the Pumping Lemma.

Consequences of Non-Regular Tokens

If all tokens were regular (that is specifiable by a regular expression) then the full implementation of the lexer could be generated from the regular expressions for each of the tokens. Since the dot language contains at least one token which is non-regular, special consideration needs to be taken.

This turns out to be a fairly common situation in lexer implementation. For instance, if you want to support c-style comments such as /* comment */ which support properly nested comments /* asdf /* asdf */ asdf*/ then the comment token will no longer be regular. Furthermore, many languages (such as C) require collaboration between the parser and lexer to properly identify whether symbols should be variable names or type names. This can also introduce a degree of non-regularity.

Thus, to properly lexically analyze such languages our framework must have an "escape hatch" that allows the analysis of non-regular tokens on demand while still leveraging theory for most of the work.

The LexMachine

To create a lexer for the dot language I am going to uselexmachine a library I wrote for creating lexers. lexmachine handles all the tricky bits of converting regular expressions into Non-Deterministic Finite Automata (NFA) and using the the NFA to tokenize strings. It also provides the aformentioned "escape hatch" to deal with non-regular Token specifications.

Let's get started!

The Implementation

As a reminder, the implementation is written in Go. In your workspace, create a new package called dot:

Now create a file for the lexer:

All of the code for the lexer is going in lexer.go.

Preamble

To begin, put in the package directive and import the lexmachine andmachines packages. I also import the standard library packages fmt andstrings.

packagedotimport("fmt""strings")import(lex"github.com/timtadh/lexmachine""github.com/timtadh/lexmachine/machines")

Note how I group the imports. In general, have three groups of imports. The first group is for standard library packages, the second for third party, and the third group is for other packages in your code.

Defining the Tokens

Next, I create global variables and initialize them. They contain the literal tokens, the keywords, the token names, and a mapping from the names of the tokens to their type ids. Finally, there is a variable Lexer *lex.Lexer which will hold our Lexer object once constructed.

varLiterals[]string// The tokens representing literal stringsvarKeywords[]string// The keyword tokensvarTokens[]string// All of the tokens (including literals and keywords)varTokenIdsmap[string]int// A map from the token names to their int idsvarLexer*lex.Lexer// The lexer object. Use this to construct a Scanner

To initialize the lists of tokens we are going to need a function. The reason is although, Literals and Keywords could be defined in place the rest of the variables cannot be.

funcinitTokens(){Literals=[]string{"[","]","{","}","=",",",";",":","->","--",}Keywords=[]string{"NODE","EDGE","GRAPH","DIGRAPH","SUBGRAPH","STRICT",}Tokens=[]string{"COMMENT","ID",}Tokens=append(Tokens,Keywords...)Tokens=append(Tokens,Literals...)TokenIds=make(map[string]int)fori,tok:=rangeTokens{TokenIds[tok]=i}}

Right now, the initTokens() function is not being called. Later, I will show you how to call it on package initialization inside of an init function.

Defining the Lexer

Creating a new lexer object is straight forward.

The Lexer object has three methods:

func(self*Lexer)Add(regex[]byte,actionAction)func(self*Lexer)Compile()errorfunc(self*Lexer)Scanner(text[]byte)(*Scanner,error)

The Add method is what we are interested in right now. It adds a new token to the lexer. The token is defined by a pattern expressed as a regular expression and an Action function. When the pattern is matched the Action function gets called.

typeActionfunc(scan*Scanner,match*machines.Match)(tokeninterface{},errerror)

An Action takes a *Scanner (which is a object which is scanning a particular string using the *Lexer object), and a *Match (which represents the string that was matched by the Regular expression. It returns a token and an error.

If the token return value is nil, the *Match is skipped. This can be used to skip whitespace and other things you would rather ignore. Let's go head and code up the the skip Action:

funcskip(*lex.Scanner,*machines.Match)(interface{},error){returnnil,nil}

Super simple! It is a no op!

However, most of the time you will want to create a token. First, we need to have a *Token object to construct. Luckily, lexmachine defines one (although you don't have to use it). Let's take a look at the definition:

typeTokenstruct{Typeint// the token typeValueinterface{}// a value associate with the tokenLexeme[]byte// the string that was matchedTCint// the index (text counter) in the stringStartLineintStartColumnintEndLineintEndColumnint}func(self*Token)Equals(other*Token)boolfunc(self*Token)String()string

The *Scanner object provides a convience function Token which constructs a token for you. Here is the definition:

func(self*Scanner)Token(typint,valueinterface{},m*machines.Match)*Token

So, with this in mind, here is a simple Action which will construct a Token with a string version of the lexeme as the Value.

functoken(namestring)lex.Action{returnfunc(s*lex.Scanner,m*machines.Match)(interface{},error){returns.Token(TokenIds[name],string(m.Bytes),m),nil}}

The name paramter is the name of the token (eg. COMMENT, ID, STRICT,{, ...). The token function will constuct a *Token of correct type (eg. the one you specified with name) and return it.

Adding Patterns to the Lexer

Now that we have Action functions to work with (skip and token) we are ready to add patterns to the lexer. Since lexmachine is built on automata theory patterns are matched with these priorities:

  1. Patterns match prefixes of string being scanned. Normally, a regular expression matches the entire string or the first substring (depending on the mode). After a prefix is matched, the lexer is restarted at the end of the previously matched prefix and matches another prefix until the string is consumed.

  2. Through use of automata theory, all patterns are matched in parallel. Currently, lexmachine uses an Non-Deterministic Finite Automata (NFA) simulation "under-the-hood" to do the matching. NFA simulations take O(P*S) where S is the size of the string and P is the size of the pattern (or in the case of a lexer the sum of the sizes of all of the patterns). There is a Deterministic Finite Automata (DFA) code generator under development (but not ready at this time) which will be able to generate Go code to lex a string in linear time O(S).

  3. The pattern which matches the longest prefix is chosen as the "matching pattern". The matching pattern determines which lexing action gets run (and thus what kind of token gets created).

  4. In case of tie, the pattern which was defined first is chosen.

Since order that patterns are added to the lexer matters, literals and keywords should be added first. This is important as other token's patterns (such asID) could match them. Since, the literals and keywords are both stored in their own lists this is easy to do in a loop:

for_,lit:=rangeLiterals{r:="\\"+strings.Join(strings.Split(lit,""),"\\")lexer.Add([]byte(r),token(lit))}for_,name:=rangeKeywords{lexer.Add([]byte(strings.ToLower(name)),token(name))}

Note: I add escapes to every character in the literals. So that literals like[ have patterns such as \[. This ensures those characters (which have syntactic meaning in regular expressions) are interpreted as themselves. Otherwise, they would be parsed by the regular expression parser incorrectly.

Second Note: The patterns constructed for the keywords is the lower case version of the token name. I could have had the token names for the keywords be in lower case but it is tradition for token names to be capitalized. This helps distinguish token names from production names in context free grammar.

Adding More Complex Patterns

The simple patterns are now added to the lexer. For the COMMENT and ID tokens I will add a separate pattern for each of the alternative construction options:

lexer.Add([]byte(`//[^\n]*\n?`),token("COMMENT"))lexer.Add([]byte(`/\*([^*]|\r|\n|(\*+([^*/]|\r|\n)))*\*+/`),token("COMMENT"))lexer.Add([]byte(`([a-z]|[A-Z])([a-z]|[A-Z]|[0-9]|_)*`),token("ID"))lexer.Add([]byte(`"([^\\"]|(\\.))*"`),token("ID"))

Note: I left out the last form of ID the HTML string. We will get back to that in a second. The final pattern to add is for whitespace: spaces, tabs, newlines, and carriage returns. I don't want tokens produced for these characters to I will use the skip function as the lexer Action:

lexer.Add([]byte("( |\t|\n|\r)+"),skip)

Using the "Escape Hatch"

Now, to deal with the third form of the ID token: the HTML string. I need a pattern that fires when the beginning of the string is found. This is easy as the HTML strings always start with a < character and the < is not found elsewhere in the language. Then, I write a very special Action function. It turns out, that Actions are allowed to make modifications to the internal state of the *Scanner. In particular they are allowed to change where the index into the string being tokenized is located. That index is called the text counter and is stored in the TC variable. Let's take a look at what *Scanner exports:

typeScannerstruct{Text[]byteTCint// contains filtered or unexported fields}func(self*Scanner)Next()(tokinterface{},errerror,eofbool)func(self*Scanner)Token(typint,valueinterface{},m*machines.Match)*Token

The Text variable can be read but you should not modify it. Modifying it will have no effect on the tokenization as the NFA simulation keeps its own pointer to the text being scanned. The TC variable is the text counter and we can both read and write it inside of an Action. What this allows us to do is find the starting point of an HTML string with the pattern < and then scan along manually counting the opening and closing angle brackets. Once, the initial open bracket has been closed by a matching > the HTML string has been found.

The only trick is we need to keep track of the text counter and update it. We also have to update the *Match object to contain the correct values for the end lines and columns for our token.

Let's see how it works:

lexer.Add([]byte(`\<`),func(scan*lex.Scanner,match*machines.Match)(interface{},error){str:=make([]byte,0,10)str=append(str,match.Bytes...)brackets:=1match.EndLine=match.StartLinematch.EndColumn=match.StartColumnfortc:=scan.TC;tc<len(scan.Text);tc++{str=append(str,scan.Text[tc])match.EndColumn+=1ifscan.Text[tc]=='\n'{match.EndLine+=1}ifscan.Text[tc]=='<'{brackets+=1}elseifscan.Text[tc]=='>'{brackets-=1}ifbrackets==0{match.TC=scan.TCscan.TC=tc+1match.Bytes=strreturntoken("ID")(scan,match)}}returnnil,fmt.Errorf("unclosed HTML literal starting at %d, (%d, %d)",match.TC,match.StartLine,match.StartColumn)},)

Here, I defined the action in-line since it will not be reused using Go's support for anonymous functions. The text counter, scan.TC, is initially pointing at the character directly following the matched pattern. Thus, the bracket count in brackets is initialized to 1.

When brackets reaches 0 through incrementing and decrementing everytime a< or > is seen the match is found. When the match is found, the scan.TC variable must be updated to communicate back to the scanner where to look for the next token. The *Match is also updated to reflect the full lexeme that was found. Finally, an ID token is constructed using the token function.

If the function runs out of text before brackets reaches 0 an error is returned reporting an unclosed HTML literal.

Compiling the NFA

The last step in *Lexer construction is to compile the NFA. This will be done automatically when a *Scanner is constructed to tokenize the string. However, we can have the NFA precomputed by calling Compile. This is important so that we don't spend time parsing regular expressions every time we want to lex a string

err:=lexer.Compile()iferr!=nil{returnnil,err}returnlexer,n

Putting it all Together

// Creates the lexer object and compiles the NFA.funcinitLexer()(*lex.Lexer,error){lexer:=lex.NewLexer()for_,lit:=rangeLiterals{r:="\\"+strings.Join(strings.Split(lit,""),"\\")lexer.Add([]byte(r),token(lit))}for_,name:=rangeKeywords{lexer.Add([]byte(strings.ToLower(name)),token(name))}lexer.Add([]byte(`//[^\n]*\n?`),token("COMMENT"))lexer.Add([]byte(`/\*([^*]|\r|\n|(\*+([^*/]|\r|\n)))*\*+/`),token("COMMENT"))lexer.Add([]byte(`([a-z]|[A-Z])([a-z]|[A-Z]|[0-9]|_)*`),token("ID"))lexer.Add([]byte(`"([^\\"]|(\\.))*"`),token("ID"))lexer.Add([]byte("( |\t|\n|\r)+"),skip)lexer.Add([]byte(`\<`),func(scan*lex.Scanner,match*machines.Match)(interface{},error){str:=make([]byte,0,10)str=append(str,match.Bytes...)brackets:=1match.EndLine=match.StartLinematch.EndColumn=match.StartColumnfortc:=scan.TC;tc<len(scan.Text);tc++{str=append(str,scan.Text[tc])match.EndColumn+=1ifscan.Text[tc]=='\n'{match.EndLine+=1}ifscan.Text[tc]=='<'{brackets+=1}elseifscan.Text[tc]=='>'{brackets-=1}ifbrackets==0{match.TC=scan.TCscan.TC=tc+1match.Bytes=strreturntoken("ID")(scan,match)}}returnnil,fmt.Errorf("unclosed HTML literal starting at %d, (%d, %d)",match.TC,match.StartLine,match.StartColumn)},)err:=lexer.Compile()iferr!=nil{returnnil,err}returnlexer,nil}

Initializing the Package

To ensure that the regular expressions are only compiled once, we are going to call initLexer once at the start of the program. To do this we put the call inside an init function. Init functions get run once on program start up.

// Called at package initialization. Creates the lexer and populates token lists.funcinit(){initTokens()varerrerrorLexer,err=initLexer()iferr!=nil{panic(err)}}

And that is it. Here is the source code for the full lexer.

Using the Lexer

Let's put it all together. Here is a simple example which uses the lexer:

packagemainimport("fmt""log")import("github.com/timtadh/dot"lex"github.com/timtadh/lexmachine")funcmain(){s,err:=dot.Lexer.Scanner([]byte(`digraph {  rankdir=LR;  a [label="a" shape=box];  c [<label>=<<u>C</u>>];  b [label="bb"];  a -> c;  c -> b;  d -> c;  b -> a;  b -> e;  e -> f;}`))iferr!=nil{log.Fatal(err)}fmt.Println("Type    | Lexeme     | Position")fmt.Println("--------+------------+------------")fortok,err,eof:=s.Next();!eof;tok,err,eof=s.Next(){iferr!=nil{log.Fatal(err)}token:=tok.(*lex.Token)fmt.Printf("%-7v | %-10v | %v:%v-%v:%v\n",dot.Tokens[token.Type],string(token.Lexeme),token.StartLine,token.StartColumn,token.EndLine,token.EndColumn)}}

Output:

Type    | Lexeme     | Position
--------+------------+------------
DIGRAPH | digraph    | 1:1-1:7
{       | {          | 1:9-1:9
ID      | rankdir    | 2:3-2:9
=       | =          | 2:10-2:10
ID      | LR         | 2:11-2:12
;       | ;          | 2:13-2:13
ID      | a          | 3:3-3:3
[       | [          | 3:5-3:5
ID      | label      | 3:6-3:10
=       | =          | 3:11-3:11
ID      | "a"        | 3:12-3:14
ID      | shape      | 3:16-3:20
=       | =          | 3:21-3:21
ID      | box        | 3:22-3:24
]       | ]          | 3:25-3:25
;       | ;          | 3:26-3:26
ID      | c          | 4:3-4:3
[       | [          | 4:5-4:5
ID      | <label>    | 4:6-4:12
=       | =          | 4:13-4:13
ID      | <<u>C</u>> | 4:14-4:23
]       | ]          | 4:24-4:24
;       | ;          | 4:25-4:25
ID      | b          | 5:3-5:3
[       | [          | 5:5-5:5
ID      | label      | 5:6-5:10
=       | =          | 5:11-5:11
ID      | "bb"       | 5:12-5:15
]       | ]          | 5:16-5:16
;       | ;          | 5:17-5:17
ID      | a          | 6:3-6:3
->      | ->         | 6:5-6:6
ID      | c          | 6:8-6:8
;       | ;          | 6:9-6:9
ID      | c          | 7:3-7:3
->      | ->         | 7:5-7:6
ID      | b          | 7:8-7:8
;       | ;          | 7:9-7:9
ID      | d          | 8:3-8:3
->      | ->         | 8:5-8:6
ID      | c          | 8:8-8:8
;       | ;          | 8:9-8:9
ID      | b          | 9:3-9:3
->      | ->         | 9:5-9:6
ID      | a          | 9:8-9:8
;       | ;          | 9:9-9:9
ID      | b          | 10:3-10:3
->      | ->         | 10:5-10:6
ID      | e          | 10:8-10:8
;       | ;          | 10:9-10:9
ID      | e          | 11:3-11:3
->      | ->         | 11:5-11:6
ID      | f          | 11:8-11:8
;       | ;          | 11:9-11:9
}       | }          | 12:1-12:1

Believe it or not 3500 words later, we have only scratched the surface on this topic. Testing, custom token representations, automata construction, and more will have to wait for another post. While still in an early state I hope you find lexmachine useful and this article helpful for constructing lexers whatever language you are using.

Asm-Dom – WebAssembly Virtual DOM

$
0
0

README.md

experimentalBuild Statusnpm versionnpm downloadsJoin the chat at https://gitter.im/mbasso/asm-dom

A minimal WebAssembly virtual DOM focused on performance

Table of Contents

Installation

You can install asm-dom using npm:

npm install --save asm-dom

If you are using this library with webpack you also need to install arraybuffer-loader:

npm install --save-dev arraybuffer-loader

and add this object to your loaders:

{
  test:/\.wasm$/,
  loaders: ['arraybuffer-loader'],
}

also, if you have some problems with fs, you can add this to your webpack config:

Motivation

asm-dom is a minimal WebAssembly virtual DOM focused on performance. It is born from the idea to test the powerful of WebAssembly in a common use case that is not gaming, VR, AR or Image / video editing. Unfortunately, at the moment, GC / DOM / Web API Integration is a future feature 🦄, so, asm-dom isn't totally developed in wasm. All interactions with the DOM are written in Javascript. This is a big disadvantage because of the overhead of the binding between JS and WASM, in the future asm-dom will be even more powerful, anyway results are satisfying. Last but not least, this project aims to be an example for those who want to try WebAssembly and emscripten!

Inline Example

importinitfrom'asm-dom';constasmDom=awaitinit();// or init().then(asmDom => { ... });const { h, patch } = asmDom;constroot=document.getElementById('root');constvnode=h('div', {
  raw: { onclick: () =>console.log('clicked') }
}, [h('span', { style:'font-weight: bold' }, 'This is bold'),' and this is just normal text',h('a', { href:'/foo' }, 'I\'ll take you places!')
]);// Patch into empty DOM element – this modifies the DOM as a side effectpatch(root, vnode);constnewVnode=h('div', {
  raw: { onclick: () =>console.log('another click') }
}, [h('span', { style:'font-weight: normal; font-style: italic' }, 'This is now italic type'),' and this is just normal text',h('a', { href:'/bar' }, 'I\'ll take you places!')
]);// Second `patch` invocationpatch(vnode, newVnode); // asm-dom efficiently updates the old view to the new state

Examples

Examples are available in the examples folder.

Also, here is the list of the online Demos:

Documentation

init

By default asm-dom returns an init function that takes an optional configuration object. This represents the Module object passed to emscripten with 3 additional props:

  • useWasm: true if you want to force the usage of WebAssembly
  • useAsmJS: true if you want to force the usage of asm.js
  • clearMemory: true by default, set it to false if you want to free memory manually, for more information see deleteVNode.

By default asm-dom uses WebAssembly if supported, otherwise asm.js

Please note that this function creates the module only the first time that is called, the next times returns a Promise that resolve with the same, cached object.

importinitfrom'asm-dom';// init returns a PromiseconstasmDom=awaitinit();// const asmDom = await init({ useAsmJS: true });// init().then(asmDom => { ... });

h

You can create vnodes using h function. h accepts a tag/selector as a string, an optional data object and an optional string or array of children. The data object contains all attributes and a special raw prop that can contains callbacks and raw values applied to the DOM element with the dot notation. You should also put in raw properties like value or checked. This returns the memory address of your virtual node.

const { h } = asmDom;constvnode=h('div', { style:'color: #000' }, [h('h1', 'Headline'),h('p', 'A paragraph'),
]);constvnode2=h('div', {
  id:'an-id', // node.setAttribute('id', 'an-id')
  className:'foo', // className is a special attribute evaluated as 'class''data-foo':'bar', // a dataset attribute
  raw: {onclick: (e) =>console.log('clicked: ', e.target),
    foo:'bar', // raw value: node.foo = 'bar'
  },
});

patch

The patch takes two arguments, the first is a DOM element or a vnode representing the current view. The second is a vnode representing the new, updated view. If patch succedeed, the new vnode (the second parameter) is returned.

If a DOM element is passed, newVnode will be turned into a DOM node, and the passed element will be replaced by the created DOM node. If an oldVnode is passed, asm-dom will efficiently modify it to match the description in the new vnode.

Any old vnode passed must be the resulting vnode from the previous call to patch. Otherwise, no operation is performed and undefined is returned.

const { h, patch } = asmDom;constoldVnode=h('span', 'old node');constnewVnode=h('span', 'new node');patch(document.getElementById('root'), oldVnode);patch(oldVnode, newVnode);

deleteVNode

As we said before the h returns a memory address. This means that this memory have to be deleted manually, as we have to do in C++ for example. By default asm-dom automatically delete the old vnode from memory when patch is called. However, if you want to create a vnode that is not patched, or if you want to manually manage this aspect (setting clearMemory: false in the init function), you have to delete it manually. For this reason we have developed a function that allows you to delete a given vnode and all its children recursively:

constvnode1=h('div');constvnode2=h('div', [h('span',)
]);patch(vnode1, vnode2); // vnode1 automatically deletedconstchild1=h('span', 'child 1');constchild2=h('span', 'child 2');constvnode=h('span', [
  child1,
  child2,
]);deleteVNode(vnode); // manually delete vnode, child1 and child2 from memory

TODO

Here is a list of things that have to be done to complete this project:

  • use the closure compiler (cause problems with wasm, need to update emscripten)

Benchmarks

At the moment we haven't Benchmarks to show, but they'll come soon! Consider that benchmarking this library is not easy, we have to reproduce real world situations with big vnodes trees and frequent updates. Run a single patch or a sequence of patch in a for-loop might produce results that are not attributable to a real application.

Roadmap

asm-dom aims to be even more powerful with GC / DOM / Web API Integration. Unfortunately this is a future feature 🦄, so, we have to be patient and wait a bit.

Change Log

This project adheres to Semantic Versioning.
Every release, along with the migration instructions, is documented on the Github Releases page.

Authors

Matteo Basso

Copyright and License

Copyright (c) 2016, Matteo Basso.

asm-dom source code is licensed under the MIT License.

Show HN: Build live location sharing in your app with HyperTrack

$
0
0

README.md

Build StatusCodacy BadgeSlack StatusOpen Source LoveLicense: MIT

If you can track your Uber turn-by-turn with an accurate ETA, why not track friends, colleagues, buyers, and sellers similarly! Facebook Messenger and Google Maps recently added live location sharing to their apps. Now it’s your turn.

This open source repo uses HyperTrack to enable location sharing and real-time tracking of your friends and family. Scrape parts of this app to add live location sharing into your own app, or fork the repo and modify it to your own need to build your own brand new app.

Live Tracking Demo

Example App

If you want to experience the app or share live location amongst your friends & family, get HyperTrack Live from the Play Store.

Get it on Google Play

Usage

To build live location sharing within your own app

Follow this step-by-step tutorial that will walk you through how you can embed this code in your app.

To use this as your own app

  1. Clone the project.

  2. Get your HyperTrack API keys here, and add the publishable key to key.properties file.

  3. Get the Google Maps API key and add it to AndroidManifest.xml.

  4. To release the app on the Play Store, you will have to change the app's package name.

    • Change the package name in the AndroidManifest.xml file.
    • Refactor the name of your package with right click → Refactor → Rename in the tree view, then Android Studio will display a window, select "Rename package" option.
    • Change the application id in the build.gradle file. Once done, clean and rebuild the project.
  5. The HyperTrack SDK requires FCM/GCM for a battery efficient real-time tracking experience. Refer to the FCM Integration guide.

Documentation

For detailed documentation of the APIs, customizations and what all you can build using HyperTrack, please visit the official docs.

Contribute

Feel free to clone, use, and contribute back via pull requests. We'd love to see your pull requests - send them in! Please use the issues tracker to raise bug reports and feature requests.

We are excited to see what live location feature you build in your app using this project. Do ping us at help@hypertrack.io once you build one, and we would love to feature your app on our blog!

Support

Join our Slack community for instant responses, or interact with our growing community. You can also email us at help@hypertrack.com.

Dependencies

Poisoning Daddy (1996)

$
0
0

ByJuly 1996

A portrait of Marie Robards taken a few months before she killed her father.

Are you, like, serious?” exclaims the preppily dressed Stacey High. “Have you ever gotten a good look at her? Marie is, like, gorgeous! In high school she was one of the most mature girls I had ever met. I thought, ‘Wow, if I hang around her, she’ll keep me motivated, help me act a little more serious.’”

Stacey stares at a prom photograph of her and Marie Robards, her best friend during her senior year in high school. “We used to do everything together. I mean, everything. And then I find out that she has gone off and poisoned her dad for this totally crazy reason. I mean, how weird is that?”

It is the kind of murder story that fascinates people because it is filled with such familiar, seemingly innocent characters: teenage girls coming of age in the suburbs, their lives driven by adolescent insecurities, daydreams, and startlingly mercurial moods. In February 1993 Marie Robards, a tall, striking Fort Worth 16-year-old, pulled off what a prosecutor called the perfect crime, murdering her 38-year-old father, who was divorced from her mother, by slipping a spoonful of the poisonous chemical barium acetate into the refried beans of the take-out Mexican food he was eating one evening. The autopsy found nothing unusual. To detect certain poisons and less common chemicals such as barium acetate, a specialized $150,000 machine was required, which the Tarrant County medical examiner’s office did not own. The coroner attributed Robards’ death to a heart attack.

For nearly a year, Marie told no one about the crime. She was an excellent student, reserved but polite, the kind of girl who never acted impulsively, never stayed out too late or had too much to drink at parties. She didn’t date much, but the boys couldn’t take their eyes off her long legs and deep brown eyes.

Then, one night in January 1994, during her senior year of high school in the Fort Worth suburb of Mansfield, Marie was studying Shakespeare’s Hamlet with Stacey, one of the school’s most popular girls. According to Stacey’s version of events (which Marie has never denied), Stacey turned to her favorite part of the play: the soliloquy of Danish monarch Claudius, who poisoned his brother (Hamlet’s father) to gain the throne. In her most dramatic voice—which was only slightly affected by her Texas drawl—Stacey recited Claudius’ agonizing speech in which he wonders if he can ever repent: “My fault is past. But oh, what form of prayer/Can serve my turn? ‘Forgive me my foul murder?’/That cannot be, since I am still possessed/Of those effects for which I did the murder . . .”

“Isn’t that cool!” Stacey said. But when she looked across the table, Marie had turned pale and her hands were trembling.

“Stacey,” Marie asked, “Do you think people can go through life without a conscience?”

Stacey answered, “Well, how about the kind of person who can look somebody in the eye and kill him in cold blood?”

Staring at Stacey, Marie got out of her chair, backed up to the wall, then collapsed to the floor and began to weep. “Marie, what’s the matter?” asked Stacey.

“Guess,” Marie whispered.

Stacey thought of the worst predicament that she could imagine a fellow seventeen-year-old girl could be in. “Oh, my God, are you pregnant?”

“No.”

“You wrecked your grandparents’ car?”

Marie shook her head no.

Almost jokingly, Stacey asked, “Well, um, you didn’t kill somebody, did you?”

Marie’s body heaved with sobs. “My father,” she said. “I poisoned him.”

For weeks Stacey tried to keep Marie’s story a secret. “When you’re in high school, it’s, like, so important not to betray your best friends,” Stacey later told me. But tormented by guilt and bothered by the idea that Marie might be a far different girl from the one she knew, Stacey eventually contacted the police. Eight months later, after barium tests were run, Fort Worth police officers arrived in Austin, where Marie was a freshman at the University of Texas, still lovely, still studious, still seeming so harmless. At the Austin police station, she quickly admitted to the killing. As if hoping this pale, gentle teenager would explain away her crime, a detective asked her over and over if she had been abused by her father. “No, sir,” Marie said. The detective asked if Steven Robards had ever done anything to her that he shouldn’t have done. “No, sir,” Marie said.

Then why, asked the detective during the tape-recorded interview, did she put the barium acetate in the refried beans?

“Because it was the only way I could go back home,” Marie said.

“Who did you want to go back home to?” the detective asked.

“My mom,” Marie said in a soft, distraught voice. “I wanted to be with my mom.” Marie’s mother, Beth Burroughs, a woman as tall and beautiful as Marie, had remarried and was living in Granbury, outside Fort Worth. In a confession that Marie typed herself on a word processor at the police station (in her senior year of high school, Marie had won her district’s University Interscholastic League competition in keyboarding), she wrote, “I just wanted to be with my mom so bad that I would do anything to be with her.”

The reactions to Marie’s arrest in October 1994 ranged from sheer disgust to muddled sympathy. Mitch Poe, the young Tarrant County prosecutor who would try the murder case, called her “society’s worst nightmare: a girl who kills her dad.” Co-prosecutor Fred Rabalais, Jr., described her as “a remorseless predator,” another example of the growing number of teenagers who use violence to solve their problems. But others saw her as Texas’ Lizzie Borden, who despite her gruesome act seemed to be such a pleasant and proper girl. “I know this girl does not have a criminal mind,” said Steven Robards’ father, Jim, who was close to Marie. “For reasons only she will know, she committed this one-time act. But I know that’s all it was—a one-time act. I have to say, I don’t understand what good a penitentiary sentence will do for a girl like Marie.”

Before Marie’s trial, which began this past May in Fort Worth, her defense attorneys arranged for her to give an interview to the Associated Press, in which she said she never intended to kill her father but only wanted to make him sick so she could live with her mother. “I never thought anything through. I didn’t realize what I was doing,” she said. “I knew I had done something very, very wrong. But I did not think of myself as a criminal.” Her comments, of course, didn’t shed light on what made her suddenly careen out of control. It’s unlikely that Marie herself understood the forces at work then in her life. But for many who followed the story, the poisoning of Steven Robards was a twisted parable about the consequences of divorce, when children often must navigate their own way while parents are preoccupied with rebuilding their lives. “You know, there are times when we all say we hate our parents and wish we never had to see them again,” said Stacey, whose mother and father are also divorced. “But kill one of them? Until now I just never thought it was imaginable.”

Little Marie and Beth soon after Beth separated from Steven.

In Fort Worth during the seventies, Steven Robards and Beth Lohmer were high school sweethearts. Steven, whose father ran a small insurance agency, was one of the best-looking boys at school at six feet four inches tall with dark curly hair and a lean, muscular body. The statuesque Beth was the president of her school’s National Honor Society and a standout athlete on the track, volleyball, and basketball teams. In 1974, when she was eighteen, she married Steven just after he entered the Navy for a four-year tour of duty. Two years later, Beth gave birth to their only child, Dorothy Marie Robards. After Steven served at Navy bases in San Diego and Florida, the young family returned to Fort Worth. The relationship was a rocky one, and in 1980 Beth separated from Steven, taking Marie with her.

In the only interview she has given about the events surrounding Marie’s life, Beth told me that she became disillusioned with Steven when he began having episodes of depression soon after their wedding. “Steven’s behavior had always been a little erratic, but I was a naive Catholic girl, caught up in this whirlwind teenage romance with this suave guy,” said Beth, an outgoing and remarkably frank woman. “But there came a point when I didn’t know how to act around him anymore. He became jealous. He had temper tantrums. He couldn’t hold onto a job. And then there were times when he would get so tired and feel everything was so bleak and dark and that nothing was worthwhile.”

By 1981 Beth was already remarried to a man named Frank Burroughs, a former Navy petty officer she had met when Steven was stationed in Florida. “There was nothing between Frank and me back then,” Beth said. “We were just friends.” Burroughs eventually found a job as a police officer in Granbury. Recently divorced and the father of a young son, he was a strong-willed, protective figure who liked the idea of being a father to Marie, who was only four years old when her mother remarried. As Burroughs said proudly on the stand at Marie’s trial, she called him Dad and Robards Steven-Dad.

Marie saw Steven only once or twice a month in Fort Worth, where he lived in a one-bedroom apartment. Ironically, however, the problems that began to appear in Marie’s adolescence did not concern her father at all. They involved her stepfather. “When Marie has described those days, I have sensed there was some jealousy or possessiveness about her mother’s relationship to Frank,” said J. Randall Price, a well-regarded Dallas psychologist who was hired by the defense lawyers to question Marie to develop a psychological portrait of her. (Although Marie would not talk to me, she did give permission for Price to be interviewed.) “Marie might have seen the marriage as a way of taking her mother away. By the same token, Frank was probably jealous of the mother-daughter relationship.”

It was obvious to anyone who met Marie and Beth that the two maintained a particularly close relationship. “When I saw them, they were quite affectionate in an overt fashion, hugging one another, finishing each other’s sentences,” said Price. “It wasn’t anything pathological, anything dark or disturbing. But they acted more like contemporaries than mother and daughter. They were like sisters who had grown up together.” When I asked Beth to describe Marie, she used the most glowing terms, telling me that Marie was so intelligent as a little girl that she was already writing words in cursive by the time she reached the first grade. “Marie had strong values in every aspect of her life,” said Beth. “She insisted that she was going to remain a virgin until she got married.”

Although not as extroverted as her mother—she had only a couple of close friends—Marie had a reputation at Granbury High School as a good-natured girl who stayed out of trouble. She played the clarinet in the school band and took art classes and dance lessons in her spare time. But in the summer of 1992, before the start of her junior year, her mother and stepfather nearly split up. “At the time,” Frank Burroughs admitted at Marie’s trial—his only public statement about the matter—“I failed my family as a father and as a husband. I caused grief. Marie had lost respect for me because of what I had done.” What that meant, Beth flatly told me, was that Frank was having an affair—and it was Marie who found out about it. “On the weekend before Marie turned sixteen years old,” Beth said, “she came home and found Frank with another woman.”

Beth was devastated by her daughter’s revelation, but she told Marie that she was going to stay with her husband. “I loved Frank, and I knew that he just didn’t have his head on right,” said Beth. “He felt neglected because of all the time I was spending with my own job [Beth was working in the emergency room at the local hospital], and this was his way of reacting.” Marie, however, couldn’t tolerate her stepfather. She talked back to him. She wouldn’t clean her room when he asked her to. “She withdrew from all of us,” Beth said. “And then one day she came to me and said, ‘I can’t stand being in this house. I think you should divorce him.’ And I said, ‘But, Marie, I love Frank. I know him. I know he’ll change.’ Marie looked at me and said, ‘I have to leave.’”

Beth arranged for Marie to live with Beth’s parents in Fort Worth, where she enrolled in a new high school. But five days later, using all the money she had—about $50—Marie took a cab back to Granbury, 45 minutes away. Frank, however, was a strict disciplinarian, and he had long ago established some rules around the house, one of which was that if Marie or his own son should ever move out to live with another parent, then they couldn’t move back. To him, as he later explained in court, the rule was an important tool for two divorced parents trying to meld two families. He said he didn’t want the kids to think they could go back and forth between parents whenever they wanted to get their way. When Frank’s son, in an earlier period of rebellion, moved out to live with his mother, Frank did not let him return. Likewise, when Marie showed up, he said he would not let her back inside the house.

“It was this terrible scene, all of us outside screaming and crying at one another,” Beth said. “Marie was crying for me to take her back, and Frank was shouting at me, ‘You know the rule, and you can’t break it. The same thing that applied to my son should apply to her.’ He was making sense, I know, but I felt like he was making me choose between him and her.”

In a decision that would come back to haunt her, Beth chose her husband, and she called Steven to take Marie. “I never thought I was pushing Marie away. I thought that her move to Steven’s apartment would only be temporary and that Frank would soon change his mind,” she said. But according to Price, Marie saw her move to Steven’s as abandonment. “She thought that Frank was relieved to have her gone,” Price said. “Marie’s constant presence and her friendship with her mother were hindering him from putting his marriage back together with Beth.”

Marie in 1986 with her dog and her mother, with whom she was as close as a sister.

For his part, Steven Robards was excited about the turn of events. By 1992 medication had largely cured him of his bouts with depression. He had a budding romantic relationship with Sandra Hudgins, a single mother he had met at a Parents Without Partners meeting. Most important, he had found a steady job carrying mail for the U.S. Postal Service. “For Steven, Marie’s coming back to him was like icing on the cake,” recalled his sister, Stephanie Elder. To accommodate Marie, Robards applied for a two-bedroom apartment in his complex.

According to Beth, Marie sent her letters in which she described how she hated her new school, Eastern Hills High School, which was much larger than Granbury High. She also wrote that her father was devoid of most homemaking skills. He had few kitchen utensils. He didn’t clean the apartment. Marie had to sleep in a rollaway bed in the dining room while they waited for a larger apartment to open up. Steven did not frighten or hurt Marie. “He was very anxious about pleasing her, and he did everything he could to make her feel comfortable,” said Sandra Hudgins, who lived in the same apartment complex. “He took Marie out to restaurants and movies. But I know that those first few weeks, Marie was constantly on the phone calling her mother. She was pleading to get back home.”

Beth made no promises to Marie about coming back to Granbury, even when Marie wrote her another letter saying she was suicidal. “I immediately called Marie and told her life was too precious for her to say things like that,” Beth said. “I really thought Marie was only being overdramatic in the way teenagers can be.”

After a few months, it looked like Beth was right. Marie’s grades began improving at Eastern Hills. She was making a 98 in French, a 91 in English, and a 95 in chemistry. “She was in the top two to three percent of my students,” said Tracie Arnold, the school’s chemistry teacher. “I do remember hearing her say that she wanted to move back in with her mother, but she was always a nice, bubbly girl.” Hudgins said that by Christmas, Marie was far more relaxed with her surroundings. “She never talked back to Steven. She was always cooperative. She even asked me if she could help me wrap Christmas presents,” Hudgins said. “In all honesty, she was what you wanted a teenager to be.”

So why, in February 1993, while the teacher wasn’t looking, did Marie pour from a bottle marked with a skull and crossbones and the word “poisonous” in large red letters some barium acetate into a napkin, which she then hid in her knapsack? “It’s one of those mysteries—a teenager’s desperation,” said Price. “For whatever reason, Marie did feel permanently trapped. She told me that prior to the barium incident, she had been thinking that if she could burn down Steven’s apartment when he wasn’t there, she would be able to be reunited with her mother.”

But according to what Marie later told the police, she decided on the night of February 18 to put the barium acetate into his refried beans. After Steven ate his Mexican food, he went to a Wednesday night church service at a nearby Church of Christ. He returned less than an hour later, complaining of a stomachache. He began to vomit. Marie went to Hudgins’ apartment and told her that Steven wasn’t feeling well.

While Marie stayed in Hudgins’ apartment, listening to the radio with Hudgins’ young son, Hudgins rushed over to find Steven in bed, complaining that he was getting stiff in his arms and legs. “He said he couldn’t swallow well,” Hudgins recalled, “and I saw saliva coming up through his mouth. I went into the other room and called an ambulance. While I was on the phone, I heard Steven gurgling. His mouth was foaming. It was terrible. His eyes were open and he was just staring.”

Paramedics tried to get an oxygen tube down his throat to keep him alive, but his throat was completely closed. Marie came back to the apartment and stood in the doorway. “It was like she was in shock,” said Hudgins. “She didn’t tell the paramedics anything. She only stood there.” Finally, Hudgins hugged Marie and pushed Marie’s face into her shoulder so that Marie wouldn’t see her father die. Later that night, Beth and Frank came to the hospital to take Marie home to Granbury.

Mother and nineteen-year-old-daughter in the Tarrant County Courthouse, where prosecutors labeled Marie a “teenage narcissist” and said she deserved a life sentence.

Shortly after Steven’s funeral—during which Marie stood dazed beside the grave—Beth took Marie aside and told her that the two of them were soon moving to Florida. “I told her that Frank and I were still having problems, and so I was moving out,” Beth said. “Marie stared at me. ‘You had this plan all along to take me to Florida?’ she asked. I told her I had found a job there, and we were moving, and we were going to be together again, the two of us. Marie looked like she couldn’t breathe.” Beth paused. “If I had only told Marie one week earlier, none of this would ever have happened.”

Indeed, by the end of March, Marie and Beth were in Panama City, Florida, where Beth had found a job working as an administrative assistant for the state division of motor vehicles. Marie enrolled in the local high school. She was so depressed, however—some days she couldn’t even get out of bed—that Beth was worried that Marie too had become manic depressive. She sent Marie to a counseling center, which did little good. Then, in June, Frank Burroughs arrived in Florida to try to patch things up with Beth.

This time, Beth said, he promised to work harder on their marriage, and Marie was ready to accept him back. But in another almost unbelievable twist to the story, weeks after his arrival Marie found a note in his pillow case from the other woman. Beth recalled, “Marie said to me, ‘Mom, you can put up with him if you want to, but I don’t have to. I miss Texas, and I’m going home.’”

Once again, Beth chose her husband, staying with him in Florida. Marie called Steven’s father, Jim, asking if she could come to Mansfield to live with him and his wife (he too was divorced and remarried). Considering that she could have gone to Beth’s relatives, going to the Robardses seemed to be a bizarre choice. “I think Marie somehow wanted to make up to the Robards family and be the best granddaughter there was,” Beth said. “She was determined to start a new life.”

Robards family members later said that Marie never cracked. “We didn’t suspect a thing,” one told me. “The only thing we thought was a little strange was that she didn’t want to go to Steven’s grave. She told us she couldn’t emotionally handle it.” At Mansfield High School, Marie was known as a straight-A type. She joined the volleyball team and the yearbook staff. “She impressed all the teachers,” said Leonidas Patterson, the yearbook teacher, “because here she was, a brand-new student, and she had this hunger to get involved. When we had our University Interscholastic League competitions, Marie was interested in everything—drama, journalism, and keyboarding.”

Some of the students were mystified by the elegant Marie because she was so reserved and unwilling to talk about her past. Some girls swore that Marie had told them her father was living, and others thought they heard her say he had died. But the always perky Stacey High, who was voted most humorous in her senior class, wondered if the reason Marie came to school perfectly dressed each day was because she was trying to hide some flaw. “I had come from an abused background, and I had been to plenty of psychologists,” Stacey said. “I could tell that Marie had gone through something too. I thought I could help her come out of her shell, teach her to have a little more fun in life.”

Soon, the two fatherless girls were inseparable. (Stacey’s father, whom she almost never saw, lived in Mississippi.) One weekend night, using fake IDs, Stacey took Marie to the country-western bars on the north side of Fort Worth, dressing her in a pair of tight jeans. Patrons at one bar were so taken by Marie’s appearance that they called her the Cowboy Barbie Doll. At school, Marie and Stacey were writing partners on the yearbook staff. Stacey was good at asking the questions; Marie liked doing the writing. “I pride myself on asking really good questions,” Stacey said, “and sometimes when we were driving around town in her Honda, I tried to get Marie to talk about her past and her dad’s death, thinking it might help her. But it was, like, a dead-end street to get her to talk.”

Strangely enough, it was Shakespeare—the writer usually considered so boring by high school students—who got to Marie. If she had been reading her Cliffs Notes on Hamlet, which she had brought along with her the night she was studying with Stacey, Marie would have read that Claudius’ soliloquy in Act III, Scene III showed him to be “an erring human being, not an inhuman monster. Claudius clearly is not a born villain; nor, however much he has sought to conceal his real self from others, does he seek to avoid moral and religious truth. . . . At this particular moment in the action, it is possible to feel some pity for this tormented man despite his appalling crimes.”

After her confession, Marie begged Stacey to tell no one. “You’re the only person who knows,” she said. But that night, Stacey went home and told her mother, Libby High, who was as close to Stacey as Beth was to Marie. Libby, who worked in nursing education, initially thought that Marie, overcome with grief about her father, had made up the story. But when Libby called the poison center number to ask if barium acetate could kill a person by closing his throat, the person on the line said it certainly could and then asked suspiciously why Libby wanted to know.

Incredibly, Libby did not call the police. She told me that after her disastrous marriage, she felt an added responsibility as a single parent to prepare her daughter for the rigors of the real world. “I wanted Stacey to know that I trusted her to make her own decision about Marie,” Libby said. “I guess I knew that this was the moment in which Stacey was going to have to grow up.”

Instead, as Stacey agonized Hamlet-like over what she should do, she came close to what she said was “a complete mental breakdown.” She spoke several times about Marie with a high school counselor, never mentioning Marie by name but referring to her as a friend of a friend. She confided in a few friends who had already graduated from high school what Marie had told her. “They said, ‘Stacey, quit lying, you need a reality check, girl,’” Stacey told me. She had nightmares that Marie was chasing her through a forest. “I could hear Marie breathing real slowly, just like it was a horror movie,” Stacey said. “And then I’d come to school the next day and there she was, this very nice person. We’d sit and talk in this little office in the back of the yearbook class, and I would tell myself that Marie had only made a teenage mistake. I kept saying, ‘Marie, I really think you need some counseling.’” At her mother’s suggestion, Stacey lied to Marie, telling her she had confessed to a priest about Marie’s secret. “Maybe I overreacted,” Libby said later, “but I thought if Marie ever wanted to harm Stacey, she wouldn’t do it because she believed Stacey had told a priest.”

In February 1994, on the anniversary of Steven’s death, Marie’s grandfather took Marie and Stacey to the Macaroni Grill for dinner. Jim Robards tried to make a couple of toasts to Steven, but Marie wouldn’t listen. “I asked her if she wanted to put flowers on her daddy’s grave,” Stacey said, “but she said to me she didn’t even know where his grave site was. She told me she was over her father’s death and didn’t want to think about it.” Like Claudius, Marie could not repent.

A few weeks later, after having more nightmares, in which she heard Marie’s father calling to her from the grave to save him, Stacey went to her high school counselor’s office and asked the counselor to call the police about Steven’s death.

Marie (right) and Stacey High at the Mansfield High School prom—”She was so beautiful that night,” Stacey said, “I kept thinking, ‘Maybe we can all just forget this happened.'”

The investigation should have been simple enough. All the medical examiner’s office needed to do was retest Steven’s blood. (The office keeps blood samples from autopsies it has conducted.) A deputy chief examiner, however, later said that it took almost three months to find a laboratory with a machine that could run a test to check for barium acetate, and then another few months passed before the test results were sent back. A possible explanation was that the overworked Fort Worth homicide unit had more important things to do than investigate a preposterous-sounding story from an overwrought teenager about her best friend poisoning her father.

The longer the police took, the more Stacey second-guessed her decision. She and Marie never spoke about Steven’s death again. Eventually, Stacey dropped out of the yearbook class so she wouldn’t have to see Marie every day. She began missing school, staying out late, and as she put it, partying too much. In April Stacey checked in to an after-school program at a private psychiatric treatment center in Mansfield. “I walked in and told them my life was swirling down the toilet.” But at the prom, she did pose with Marie for a photograph. “She was so beautiful that night,” said Stacey, “that I couldn’t believe she had ever done anything wrong. I kept thinking, ‘Maybe we can all just forget this ever happened.’”

After graduation, Stacey went to Sam Houston State University in Huntsville, about a three-hour drive from the University of Texas at Austin, where Marie was. The two never spoke, and Stacey tried to concentrate on her education. But late one night in October, a detective called to tell her that he would be arriving the next morning to take her statement. The tests had shown that Steven Robards had 250 times the amount of barium acetate normally found in a person’s blood. Stacey was so panicked that she got out of bed, went to her dorm’s vending machine, and ate five Snickers bars.

Marie was let out on bond, and she went back to Granbury, where her mother and Frank, still together, had moved earlier that year. (Frank had been offered a job as a deputy sheriff for Hood County, and Beth worked as a clerk for the city.) While waiting for her trial, Marie got a job as a waitress at a TGI Friday’s in Fort Worth. A film director hired to shoot a Friday’s commercial was so impressed with Marie that he used her in a scene serving drinks to customers. “What’s so tragic is that total strangers could meet Marie and see something special in her,” said Beth, breaking into tears. “She felt trapped, and I let her feel that way. I didn’t give her any hope.”

Using the life insurance money that Marie had received after Steven’s death—more than $60,000—Beth hired two veteran Fort Worth defense attorneys, Bill Magnussen and Ward Casey, whose strategy was to convince the jury that Marie didn’t know that barium acetate could kill a person. If the jury believed that she had not intended to kill, then Marie had the chance of receiving a lighter sentence for manslaughter rather than murder. “She only wanted to make her daddy sick overnight,” Casey told the jury in his old-fashioned oratorical style. “She only wanted to go home to Mama.”

Each day of the trial, the courtroom was packed. (One high school civics teacher thought it would be educational for his class to sit through testimony. The students listened for a while and then began to write notes. One girl sitting beside me wrote her boyfriend a letter that began, “I am psycho in my love for you! Do you hear my heart pounding.”) Spectators craned their necks to get a look at Marie, who by then was nineteen years old. She had cut her hair in a short nunlike bob and wore sleeveless, flower-print blouses and loose-fitting pants. Throughout much of the testimony, she put her right hand on her cheek and sobbed silently. During breaks, her mother, who could not watch the proceedings because she was a potential witness, came into the courtroom and wrapped Marie in her arms. Frank sat outside on a bench, speaking to no one. Members of the Robards family sat stone-faced on the right side of the courtroom.

One of the more emotional moments in the trial came when Jim Robards took the stand and said that as upset as he was over the death of his son, Marie should be forgiven and offered a probationary sentence. Randall Price arrived to testify that Marie was not deranged but was so consumed with remorse over Steven’s death that she was experiencing a version of posttraumatic stress syndrome, unable to express her emotions. Price was also going to say that he believed Marie never wanted her father to die, but the defense attorneys, for reasons that remain unclear, did not call Price to the stand, which gave the prosecution an unhindered opportunity to rip into Marie, telling the jury that she cavalierly poisoned her father and never tried to help save him when the paramedics arrived.

Stacey High wants to get her college degree and get on with her life.

The prosecution’s most important witness, of course, was Stacey High. Wearing a green dress, brown loafers, and white socks, she came to the stand, nervously sucking on a breath mint, and said that Marie had told her during one of their conversations that she knew the barium acetate would be fatal. At one point, Stacey turned and looked at Marie. They locked eyes, then Marie dropped her head.

In the end, the jury was apparently swayed by prosecutor Mitch Poe when he said in his final argument, “Just one stomachache wasn’t going to get Marie back to her mama’s place . . . Steve Robards had to die.” The jurors convicted Marie of murder, which left them with the question of deciding her sentence. The defense attorneys felt they had no choice but to have Marie testify.

She nearly stumbled as she walked to the stand. In a squeaky, trembling voice, she told the jury she had never been convicted of a crime. She said that her only contact with the Robards family since her arrest was a birthday card she had sent her grandfather.

Then Casey asked, “Marie, did you love your dad?”

“Very much,” she said.

“Are you sorry you killed your dad?”

It was time for her to repent. Bursting into tears, she turned to the side of the courtroom where the Robardses were sitting and said, “I’m so sorry. I’m so sorry.”

Poe said Marie deserved a life sentence because she gave her father a death sentence. The defense attorneys begged for probation for a girl they said would have to live with the guilt of her father’s death for the rest of her life. The jury split the difference, giving Marie a 28-year sentence—she will have to spend at least seven years in state prison before being eligible for parole. (Claiming that the prosecution used improper testimony about Marie’s state of mind during the trial, her attorneys have filed a motion for a new trial. If that fails, they will appeal the verdict.) Outside, in the courthouse hallway, Poe told the local press that Marie was a “teenage narcissist.” Surrounded by television cameras, Stacey High dramatically said, “I’m ready to wrap up this phase of my life, hopefully major in neuropsychology in college, and be a wonderful citizen of the United States.” Beth and Frank were the last ones to leave the courtroom. For nearly an hour after the sentencing, they sat alone on the front row, holding hands. “Frank and I have made our mistakes,” Beth later told me, “but we’re going to be strong together. We’ve got to go on. Our marriage will survive this.”

For several days Marie remained on a suicide watch at the county jail. But a week after the verdict, Price went to see her. “Marie asked me if she could get her college degree while she was in prison. She told me she was anxious to start some kind of schooling, to improve herself, to accept her punishment and move on,” Price said. “She was wearing these paper clothes, which the jailers give prisoners on a suicide watch, and she was shivering in her cold jail cell. But she told me she had no right to complain about her own problems because she had already caused so much suffering. It was sort of amazing to listen to her.”

From jail, Marie also called her mother collect every night. In one of those phone calls, she told Beth that she hoped Stacey didn’t feel badly about going to the police. She still liked her, Marie said. After all, she added, the two of them had once been best friends.

1981 Nightline Interview with Steve Jobs

$
0
0

Offentliggjort den 3. okt. 2015

Ted Koppel, Bettina Gregory, and Ken Kashiwahara present news stories from 1981 on the relevancy of computers in every day life and how they will affect our future. Included are interviews with Apple Computer Chairman Steve Jobs and writer David Burnham.

Viewing all 25817 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>