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

Introducing temporary interaction limits

$
0
0

When issue or pull request discussions get heated, sometimes a solution can't be reached until everyone has had time to cool down. Now, with interaction limits, maintainers can temporarily limit who can comment, create pull requests, and create issues among existing users, collaborators, and prior contributors. After 24 hours, limits expire and allow users to go back to participating in the conversation.

The new temporary interaction limits in repo settings

You'll find interaction limits if you click on the Settings tab on any repository you own.

This is just one tool you can use to promote healthy, level-headed collaboration on your team.

Learn more about interaction limits


The Addicts Next Door

$
0
0

Michael Barrett and Jenna Mulligan, emergency paramedics in Berkeley County, West Virginia, recently got a call that sent them to the youth softball field in a tiny town called Hedgesville. It was the first practice of the season for the girls’ Little League team, and dusk was descending. Barrett and Mulligan drove past a clubhouse with a blue-and-yellow sign that read “Home of the Lady Eagles,” and stopped near a scrubby set of bleachers, where parents had gathered to watch their daughters bat and field.

Two of the parents were lying on the ground, unconscious, several yards apart. As Barrett later recalled, the couple’s thirteen-year-old daughter was sitting behind a chain-link backstop with her teammates, who were hugging her and comforting her. The couple’s younger children, aged ten and seven, were running back and forth between their parents, screaming, “Wake up! Wake up!” When Barrett and Mulligan knelt down to administer Narcan, a drug that reverses heroin overdoses, some of the other parents got angry. “You know, saying, ‘This is bullcrap,’ ” Barrett told me. “ ‘Why’s my kid gotta see this? Just let ’em lay there.’ ” After a few minutes, the couple began to groan as they revived. Adults ushered the younger kids away. From the other side of the backstop, the older kids asked Barrett if the parents had overdosed. “I was, like, ‘I’m not gonna say.’ The kids aren’t stupid. They know people don’t just pass out for no reason.” During the chaos, someone made a call to Child Protective Services.

At this stage of the American opioid epidemic, many addicts are collapsing in public—in gas stations, in restaurant bathrooms, in the aisles of big-box stores. Brian Costello, a former Army medic who is the director of the Berkeley County Emergency Medical Services, believes that more overdoses are occurring in this way because users figure that somebody will find them before they die. “To people who don’t have that addiction, that sounds crazy,” he said. “But, from a health-care provider’s standpoint, you say to yourself, ‘No, this is survival to them.’ They’re struggling with using but not wanting to die.”

A month after the incident, the couple from the softball field, Angel Dawn Holt, who is thirty-five, and her boyfriend, Christopher Schildt, who is thirty-three, were arraigned on felony charges of child neglect. (Schildt is not the biological father of Holt’s kids.) A local newspaper, the Martinsburg Journal, ran an article about the charges, noting that the couple’s children, who had been “crying when law enforcement arrived,” had been “turned over to their grandfather.”

West Virginia has the highest overdose death rate in the country, and heroin has devastated the state’s Eastern Panhandle, which includes Hedgesville and the larger town of Martinsburg. Like the vast majority of residents there, nearly all the addicts are white, were born in the area, and have modest incomes. Because they can’t be dismissed as outsiders, some locals view them with empathy. Other residents regard addicts as community embarrassments. Many people in the Panhandle have embraced the idea of addiction as a disease, but a vocal cohort dismisses this as a fantasy disseminated by urban liberals.

These tensions were aired in online comments that amassed beneath the Journal article. A waitress named Sandy wrote, “Omgsh, How sad!! Shouldnt be able to have there kids back! Seems the heroin was more important to them, than watchn there kids have fun play ball, and have there parents proud of them!!” A poster named Valerie wrote, “Stop giving them Narcan! At the tax payers expense.” Such views were countered by a reader named Diana: “I’m sure the parents didn’t get up that morning and say hey let’s scar the kids for life. I’m sure they wished they could sit through the kids practice without having to get high. The only way to understand it is to have lived it. The children need to be in a safe home and the adults need help. They are sick, i know from the outside it looks like a choice but its not. Shaming and judging will not help anyone.”

One day, Angel Holt started posting comments. “I don’t neglect,” she wrote. “Had a bad judgment I love my kids and my kids love me there honor roll students my oldest son is about to graduate they play sports and have a ruff over there head that I own and food, and things they just want I messed up give me a chance to prove my self I don’t have to prove shit to none of u just my children n they know who I am and who I’m not.”

A few weeks later, I spoke to Holt on the phone. “Where it happened was really horrible,” she said. “I can’t sit here and say different.” But, she said, it had been almost impossible to find help for her addiction. On the day of the softball practice, she ingested a small portion of a package of heroin that she and Schildt had just bought, figuring that she’d be able to keep it together at the field; she had promised her daughter that she’d be there. But the heroin had a strange purple tint—it must have been cut with something nasty. She started feeling weird, and passed out. She knew that she shouldn’t have touched heroin that was so obviously adulterated. But, she added, “if you’re an addict, and if you have the stuff, you do it.”

Cartoon
“Just imagine the hole is world peace and the sand traps are nuclear Armageddon and the club is your ability to deal calmly and rationally with complex situations.”

In Berkeley County, which has a population of a hundred and fourteen thousand, when someone under sixty dies, and the cause of death isn’t mentioned in the paper, locals assume that it was an overdose. It’s becoming the default explanation when an ambulance stops outside a neighbor’s house, and the best guess for why someone is sitting in his car on the side of the road in the middle of the afternoon. On January 18th, county officials started using a new app to record overdoses. According to this data, during the next two and a half months emergency medical personnel responded to a hundred and forty-five overdoses, eighteen of which were fatal. This underestimates the scale of the epidemic, because many overdoses do not prompt 911 calls. Last year, the county’s annual budget for emergency medication was twenty-seven thousand dollars. Narcan, which costs fifty dollars a dose, consumed two-thirds of that allotment. The medication was administered two hundred and twenty-three times in 2014, and four hundred and three times in 2016.

One Thursday in March, a few weeks before Michael Barrett responded to Angel Holt’s overdose, I rode with him in his paramedic vehicle, a specially equipped S.U.V. He started his day as he often does, with bacon and eggs at the Olde Country Diner, in Martinsburg. Barrett, who is thirty-three, with a russet-colored beard and mustache, works two twenty-four-hour shifts a week, starting at 7 a.m. The diner shares a strip mall with the E.M.T. station, and, if he has to leave on a call before he can finish eating, the servers will box up his food in a hurry. Barrett’s father and his uncles were volunteer firemen in the area, and, growing up, he often accompanied them in the fire truck. As they’d pull people from crumpled cars or burning buildings, he’d say to himself, “Man, they doing stuff—they’re awesome.” When Barrett became a paramedic, in his twenties, he knew that he could make a lot more money “going down the road,” as people around here say, referring to Baltimore or Washington, D.C. But he liked it when older colleagues told him, “I used to hold you at the fire department when you were a baby.”

Barrett’s first overdose call of the day came at 8 a.m., for a twenty-year-old woman. Several family members were present at the home, and while Barrett and his colleagues worked on her they cried and blamed one another, and themselves, for not watching her more closely. The woman was given Narcan, but she was too far gone; she died after arriving at the hospital.

We stopped by a local fire station, where the men and women on duty talked about all the O.D. calls they took each week. Sometimes they knew the person from high school, or were related to the person. Barrett said that in such cases you tended “to get more angry at them—you’re, like, ‘Man, you got a kid, what the hell’s wrong with you?’ ”

Barrett sometimes had to return several times in one day to the same house—once, a father, a mother, and a teen-age daughter overdosed on heroin in succession. Such stories seemed like twisted variations on the small-town generational solidarity he admired; as Barrett put it, even if one family member wanted to get clean, it would be next to impossible unless the others did, too. He was used to O.D. calls by now, except for the ones in which kids were around. He once arrived at a home to find a seven-year-old and a five-year-old following the instructions of a 911 operator and performing C.P.R. on their parents. (They survived.)

Around three o’clock, the dispatcher reported that a man in Hedgesville was slumped over the steering wheel of a jeep. By the time we got there, the man, who appeared to be in his early thirties, had been helped out of his vehicle and into an ambulance. A skinny young sheriff’s deputy on the scene showed us a half-filled syringe: the contents resembled clean sand, which suggested pure heroin. That was a good thing—these days, the narcotic is often cut with synthetic painkillers such as fentanyl, which is fifty times as powerful as heroin.

The man had floppy brown hair and a handsome face; he was wearing jeans, work boots, and a black windbreaker. He’d been revived with oxygen—he hadn’t needed Narcan—but as he sat in the ambulance his eyes were only partly opened, and his pupils, when I could catch a glimpse of them, were constricted to pinpoints. Barrett asked him, “Did you take a half syringe? ’Cause there’s half a syringe left.” The man looked up briefly and said, “Yeah? I was trying to take it all.” He said that he was sorry—he’d been clean for a month. Then he mumbled something about having a headache. “Well, sure you do,” another paramedic said. “You weren’t breathing there for a while. Your brain didn’t have any oxygen.”

The man’s jeep sat, dead still, in the middle of a street that sloped sharply downhill. A woman introduced herself to me as Ethel. She had been driving behind the man when he lost consciousness. “I just rolled up, saw he was slumped over the wheel,” she said. “I knew what it was right away.” She beeped her horn, but he didn’t move. She called 911 and stayed until the first responders showed up, “in case he started to roll forward, and maybe I could stop traffic—and to make sure he was O.K.” I asked if the man’s jeep had been running during this time. “Oh, yeah,” she said. “He just happened to stop with his foot on the brake.” Barrett shared some protocol: whenever he came across people passed out in a car, he put the transmission in park and took their keys, in case they abruptly revived. He’d heard of people driving off with E.M.T. personnel halfway inside.

The sky was a dazzling blue, with fluffy white clouds scudding overhead. The man took a sobriety test, wobbling across the neat lawn of a Methodist church. “That guy’s still high as a kite,” somebody said.

Tara Mayson, Tina Stride, and Lisa Melcher run the Hope Dealer Project, which helps addicts find a spot in rehab.
Tara Mayson, Tina Stride, and Lisa Melcher run the Hope Dealer Project, which helps addicts find a spot in rehab.Photograph by Eugene Richards for The New Yorker

We were driving away from Hedgesville when the third overdose call of the day came, for a twenty-nine-year-old male. Inside a nicely kept house in a modern subdivision, the man was lying unconscious on the bathroom floor, taking intermittent gasps. He was pale, though not yet the blue-tinged gray that people turn when they’ve been breathing poorly for a while. Opioid overdoses usually kill people by inhibiting respiration: breathing slows and starts to sound labored, then stops altogether. Barrett began preparing a Narcan dose. Generally, the goal was to get people breathing well again, not necessarily to wake them completely. A full dose of Narcan is two milligrams, and in Berkeley County the medics administer 0.4 milligrams at a time, so as not to snatch patients’ high away too abruptly: you didn’t want them to go into instant withdrawal, feel terribly sick, and become belligerent. Barrett crouched next to the man and started an I.V. A minute later, the man sat up, looking bewildered and resentful. He threw up. Barrett said, “Couple more minutes and you would have died, buddy.”

“Thank you,” the man said.

“You’re welcome—but now you need to go to the hospital.”

The man’s girlfriend was standing nearby, her hair in a loose bun. She responded calmly to questions: “Yeah, he does heroin”; “Yeah, he just ate.” The family dog was snuffling at the front door, and one of the sheriff’s deputies asked if he could let it outside. The girlfriend said, “Sure.” Brian Costello had told me that family members had grown oddly comfortable with E.M.T. visits: “That’s the scary part—that it’s becoming the norm.” The man stood up, and then, swaying in the doorway, vomited a second time.

“We’re gonna take him to the hospital,” Barrett told the girlfriend. “He could stop breathing again.”

As we drove away, Barrett predicted that the man would check himself out of the hospital as soon as he could; most O.D. patients refused further treatment. Even a brush with death was rarely a turning point for an addict. “It’s kind of hard to feel good about it,” Barrett said of the intervention. “Though he did say, ‘Thanks for waking me up.’ Well, that’s our job. But do you feel like you’re really making a difference? Ninety-nine per cent of the time, no.” The next week, Barrett’s crew was called back to the same house repeatedly. The man overdosed three times; his girlfriend, once.

It was getting dark, and Barrett stopped at a convenience store for a snack—chocolate milk and a beef stick. That evening, he dealt with one more O.D. A young woman had passed out in her car in the parking lot of a 7-Eleven, with her little girl squirming in a car seat. An older woman who happened on the scene had taken the girl, a four-year-old, into the store and bought her some hot chocolate and Skittles. After the young woman received Narcan, Barrett told her that she could have killed her daughter, and she started sobbing hysterically. Meanwhile, several guys in the parking lot were becoming agitated. They had given the woman C.P.R., but someone had called 911 and suggested that they had supplied her with the heroin. The men were black and everybody else—the overdosing woman, the older woman, the cops, the ambulance crew—was white. The men were told to remain at the scene while the cops did background checks. Barrett attempted to defuse the tension by saying, “Hey, you guys gave her C.P.R.? Thanks. We really appreciate that.” The criminal checks turned up nothing; there was no reason to suspect that the men were anything but Good Samaritans. The cops let the men go, the young woman went to the E.R., and the little girl was retrieved by her father.

Heroin is an alluringly cheap alternative to prescription pain medication. In 1996, Purdue Pharma introduced OxyContin, marketing it as a safer form of opiate—the class of painkillers derived from the poppy plant. (The term “opioids” encompasses synthetic versions of opiates as well.) Opiates such as morphine block pain but also produce a dreamy euphoria, and over time they cause physical cravings. OxyContin was sold in time-release capsules that levelled out the high and, supposedly, diminished the risk of addiction, but people soon discovered that the capsules could be crushed into powder and then injected or snorted. Between 2000 and 2014, the number of overdose deaths in the United States jumped by a hundred and thirty-seven per cent.

Some states became inundated with opiates. According to the Charleston Gazette-Mail, between 2007 and 2012 drug wholesalers shipped to West Virginia seven hundred and eighty million pills of hydrocodone (the generic name for Vicodin) and oxycodone (the generic name for OxyContin). That was enough to give each resident four hundred and thirty-three pills. The state has a disproportionate number of people who have jobs that cause physical pain, such as coal mining. It also has high levels of poverty and joblessness, which cause psychic pain. Mental-health services, meanwhile, are scant. Chess Yellott, a retired family practitioner in Martinsburg, told me that many West Virginians self-medicate to mute depression, anxiety, and post-traumatic stress from sexual assault or childhood abuse. “Those things are treatable, and upper-middle-class parents generally get their kids treated,” he said. “But, in families with a lot of chaos and money problems, kids don’t get help.”

In 2010, Purdue introduced a reformulated capsule that is harder to crush or dissolve. The Centers for Disease Control subsequently issued new guidelines stipulating that doctors should not routinely treat chronic pain with opioids, and instead should try approaches such as exercise and behavioral therapy. The number of prescriptions for opioids began to drop.

But when prescription opioids became scarcer their street price went up. Drug cartels sensed an opportunity, and began flooding rural America with heroin. Daniel Ciccarone, a professor at the U.C.-San Francisco School of Medicine, studies the heroin market. He said of the cartels, “They’re multinational, savvy, borderless entities. They worked very hard to move high-quality heroin into places like rural Vermont.” They also kept the price low. In West Virginia, many addicts told me, an oxycodone pill now sells for about eighty dollars; a dose of heroin can be bought for about ten.

A recent paper from the National Bureau of Economic Research concludes, “Following the OxyContin reformulation in 2010, abuse of prescription opioid medications and overdose deaths decreased for the first time since 1990. However, this drop coincided with an unprecedented rise in heroin overdoses.” According to the Centers for Disease Control, three out of four new heroin users report having first abused opioids.

Cartoon

“The Changing Face of Heroin Use in the United States,” a 2014 study led by Theodore Cicero, of Washington University in St. Louis, looked at some three thousand heroin addicts in substance-abuse programs. Half of those who began using heroin before 1980 were white; nearly ninety per cent of those who began using in the past decade were white. This demographic shift may be connected to prescribing patterns. A 2012 study by a University of Pennsylvania researcher found that black patients were thirty-four per cent less likely than white patients to be prescribed opioids for such chronic conditions as back pain and migraines, and fourteen per cent less likely to receive such prescriptions after surgery or traumatic injury.

But a larger factor, it seems, was the despair of white people in struggling small towns. Judith Feinberg, a professor at West Virginia University who studies drug addiction, described opioids as “the ultimate escape drugs.” She told me, “Boredom and a sense of uselessness and inadequacy—these are human failings that lead you to just want to withdraw. On heroin, you curl up in a corner and blank out the world. It’s an extremely seductive drug for dead-end towns, because it makes the world’s problems go away. Much more so than coke or meth, where you want to run around and do things—you get aggressive, razzed and jazzed.”

Peter Callahan, a psychotherapist in Martinsburg, said that heroin “is a very tough drug to get off of, because, while it was meant to numb physical pain, it numbs emotional pain as well—quickly and intensely.” In tight-knit Appalachian towns, heroin has become a social contagion. Nearly everyone I met in Martinsburg has ties to someone—a child, a sibling, a girlfriend, an in-law, an old high-school coach—who has struggled with opioids. As Callahan put it, “If the lady next door is using, and so are other neighbors, and people in your family are, too, the odds are good that you’re going to join in.”

In 2015, Berkeley County created a new position, recovery-services coördinator, to connect residents with rehab. Yet there is a chronic shortage of beds in the state for addicts who want help. Kevin Knowles, who was appointed to the job, told me, “If they have private insurance, I can hook them right up. If they’re on Medicaid—and ninety-five per cent of the people I work with are—it’s going to be a long wait for them. Weeks, months.” He said, “The number of beds would have to increase by a factor of three or four to make any impact.”

West Virginia has an overdose death rate of 41.5 per hundred thousand people. (New Hampshire has the second-highest rate: 34.3 per hundred thousand.) This year, for the sixth straight year, West Virginia’s indigent burial fund, which helps families who can’t afford a funeral pay for one, ran out of money. Fred Kitchen, the president of the West Virginia Funeral Directors Association, told me that, in the funeral business, “we know the reason for that was the increase in overdose deaths.” He added, “Families take out second mortgages, cash in 401(k)s, and go broke to try and save a son or daughter, who then overdoses and dies.” Without the help of the burial fund, funeral directors must either give away caskets, plots, and cremation services—and risk going out of business—or, Kitchen said, look “mothers, fathers, husbands, wives, and children in the eye while they’re saying, ‘You have nothing to help us?’ ”

Martinsburg, which has a population of seventeen thousand, is a hilly town filled with brick and clapboard row houses. It was founded in 1778, by Adam Stephen, a Revolutionary War general. The town became a depot for the B. & O. Railroad and grew into an industrial center dominated by woollen mills. Interwoven, established in the eighteen-nineties, was the first electric-powered textile plant in the U.S. The company became the largest men’s-sock manufacturer in the world, and at its height, in the nineteen-fifties, it employed three thousand people in Martinsburg. The Interwoven factory whistle could be heard all over town, summoning workers every morning at a quarter to seven. In 1971, when the mill closed, an editorial in the Martinsburg Journal mourned the passing of “what was once this community’s greatest pride.” In 2004, the last woollen mill in town, Royce Hosiery, ceased operations.

It’s simplistic to trace the town’s opioid epidemic directly to the loss of industrial jobs. Nevertheless, many residents I met brought up this history, as part of a larger story of lost purpose that has made the town vulnerable to the opioid onslaught. In 2012, Macy’s opened a distribution center in the Martinsburg area, but, Knowles said, the company has found it difficult to hire longtime residents, because so many fail the required drug test. (The void has been filled, only partially, by people from neighboring states.) Knowles wonders if Procter & Gamble, which is opening a manufacturing plant in the area this fall, will have a similar problem.

The Eastern Panhandle is one of the wealthier parts of a poor state. (The most destitute counties depend on coal mining.) Berkeley County is close enough to D.C. and Baltimore that many residents commute for work. Nevertheless, Martinsburg feels isolated. Several people I met there expressed surprise, or sympathy, when I told them that I live in D.C., or politely said that they’d like to visit the capital one of these days. Like every other county in West Virginia, Berkeley County voted for Donald Trump.

The Interwoven mill, derelict and grand, dominates the center of Martinsburg. A local police officer has proposed turning most of the mill into a rehab facility.
The Interwoven mill, derelict and grand, dominates the center of Martinsburg. A local police officer has proposed turning most of the mill into a rehab facility.Photograph by Eugene Richards for The New Yorker

Michael Chalmers is the publisher of an Eastern Panhandle newspaper, the Observer. It is based in Shepherdstown, a picturesque college town near the Maryland border which has not succumbed to heroin. Chalmers, who is forty-two, grew up in Martinsburg, and in 2014 he lost his younger brother, Jason, to an overdose. I asked him why he thought that Martinsburg was struggling so much with drugs. “In my opinion, the desperation in the Panhandle, and places like it, is a social vacancy,” he said. “People don’t feel they have a purpose.” There was a “shame element in small-town culture.” Many drug addicts, he explained, are “trying to escape the reality that this place doesn’t give them anything.” He added, “That’s really hard to live with—when you look around and you see that seven out of ten of your friends from high school are still here, and nobody makes more than thirty-six thousand a year, and everybody’s just bitching about bills and watching these crazy shows on reality TV and not doing anything.”

The Interwoven mill, derelict and grand, still dominates the center of Martinsburg. One corner of it has been turned into a restaurant, but the rest sits empty. Lately, there’s been talk of an ambitious renovation. A police officer named Andrew Garcia has a plan, called Martinsburg Renew, which would turn most of the mill into a rehab facility. Todd Funkhouser, who runs the Berkeley County Historical Society, showed me around one day. “Martinsburg is an industrial town,” he said. “That’s its identity. But what’s the industry now? Maybe it will be drug rehab.”

In the past several months, I have returned to Martinsburg many times, and spoken with many addicts there. I learned the most about the crisis, however, from residents who weren’t drug users, but whose lives had been irrevocably altered by others’ addiction.

Lori Swadley is a portrait and wedding photographer in Martinsburg. When I looked at her Web site, she seemed to be in demand all over the area, and her photographs were lovely: her brides glowed in afternoon light, her high-school seniors looked polished and confident. But what drew me to her was a side project she had been pursuing, called 52 Addicts—a series of portraits that called attention to the drug epidemic in and around Martinsburg. It was clear that Swadley had a full life: her husband, Jon, worked with her in the photography business, and they had three small children, Juniper, Bastian, and Bodhi. Her Web site noted that she loved fashion and gardening, and included this declaration: “I’m happy that you’ve stumbled upon our little slice of heaven!” The 52 Addicts series seemed like a surprising project for someone so busy and cheerful.

We met one day at Mugs & Muffins, a cozy coffee shop on Queen Street. Swadley is thirty-nine, tall and slender, and she looked elegant in jeans, a charcoal-colored turtleneck, and high boots. She and her husband had moved to Martinsburg in 2010, she told me, looking for an affordable place to raise children close to where she had grown up, in the Shenandoah Valley. Soon after they arrived, they settled into a subdivision outside town, and Swadley started reading the Martinsburg Journal online. She told me, “I’d see these stories about addiction—whether it was somebody who’d passed away, and the family wanted to tell their story, or it was the overdose statistics, or whatever.” Many of the stories were written by the same reporter, Jenni Vincent. “She was very persistent, and—I don’t know what the word for it is—very in your face,” Swadley said. “You could tell she wanted the problem to be known. Because at that time it seemed like everybody else wanted to hide it. And, to me, that seemed like the worst thing you could do.”

It turned out that thirteen of Swadley’s friends had died of opioid overdoses. I said that it seemed like an extraordinarily high number, especially for someone who was not an addict. She agreed, but there it was. All thirteen were young men—Swadley had met most of them when she was in her early twenties, and she had been a tomboy back then. The first time she heard that a friend had died, she had been photographing a wedding for some mutual friends. They were sitting around a bonfire at the end of the day. When Swadley spoke of a crazy horror film that she and a guy named Jeremy had made in high school, somebody mentioned that he had recently died, from a heroin overdose. Swadley felt like she’d been punched in the gut. She threw up, and wrecked her car on the way home.

At the time, Swadley was hanging out with her old crowd in bars and restaurants every weekend. One by one, the group dwindled. Many of them—“the preppy boys, the hippie boys”—got into heroin eventually, she said. They tried to help one another, but “we were in our twenties—we had no clue.” She’d call rehab places on friends’ behalf and have to tell them that the price was staggering, and that in any case it might be six months before they could be admitted. As the overdoses piled up, she was appalled to find that sometimes she had trouble keeping track of which friends were dead.

The funerals had a peculiar aspect. “The parents didn’t want anyone to know how it had happened, and they tried to keep the friends out,” she said. At the services for one friend—a sweet, goofy guy with shaggy blond hair—Swadley and her friends got close enough to the casket to see that his hair had been shorn, so that “he looked clean-cut.” She went on, “It was clear that his mother didn’t want us there. It was understandable—she didn’t know if any of us had been supplying him.”

One day, Swadley decided that she needed to write down all thirteen names, before she forgot one. In January, 2016, she started photographing addicts in recovery. In her introduction to the series, on Instagram, she wrote about her friends who had died and about Martinsburg’s lack of rehab centers. She found the town’s culture of denial enraging.

For the first few portraits, Swadley reached out to her subjects, but soon people started coming to her. She took their pictures, asked them about their lives, and told their stories in a paragraph or so. There are now two dozen images in the series.

Cartoon
“You’re the first person I’ve met who didn’t become a pastry chef after suffering a nervous breakdown working in a corporate job.”

In one of the portraits, an E.R. nurse hugs her daughter, Hope, from whom she’d been estranged. They had reconnected at the hospital, when the nurse saw Hope’s name listed as a patient in the emergency room. Swadley photographed a Martinsburg woman named Crystal, who’d been hit by a car one night when she was walking to her dealer’s house; Crystal was now clean, but she was confined to a wheelchair. A woman named Tiffany posed holding a snapshot of her younger sister, Tabby. Both women had started off on pills—Tabby had developed a problem after a gallbladder operation left her with a thirty-day supply of meds—and then became heroin addicts. Tiffany had received treatment, but Tabby had fatally overdosed while she was waiting for a rehab bed. Swadley took the portrait in a park where Tiffany had once begged Tabby to stop using. When I called Tiffany, she told me that she had recently lost a second sister to heroin.

Swadley hopes that her photographs will someday be displayed all around town—in coffee shops, restaurants, perhaps the library. She wants a public reckoning with the stories she’s collected. “The whole point of this project is to show naysayers out there that people do recover,” she said. “They are good people. I want to show people they deserve a chance. I want it in people’s faces, so they see that it could be their neighbor, or their best friend.”

One day, Swadley told me about a local effort against heroin addiction, called the Hope Dealer Project. It was run by three women: Tina Stride, who had a twenty-six-year-old son in recovery; Tara Mayson, whose close friend had gone through periods of addiction; and Lisa Melcher, whose son-in-law had died of an overdose, and whose thirty-two-year-old daughter, Christina, was struggling to overcome heroin addiction. All three had known addicts who wanted to get clean but had no place to go. Last fall, like car-pool moms with a harrowing new mission, they had begun driving people to detox facilities all over the state—any place that could take them, sometimes as far as five hours away. The few with private insurance could get rehab anywhere in the country, and the Hope Dealer women were prepared to suggest options. But most people in town had Medicaid or no insurance at all, and such addicts had to receive treatment somewhere in the state. Currently, the detox facility closest to Martinsburg is about two hours away.

Stride works full time at the General Services Administration, in Washington, but spends up to twenty-four hours a week giving rides to drug users. The other two focus on reaching out to addicts and families. Stride noted, “I have to talk to the addict, or the client—that’s what we try to call them—all the way to that detox center. Because they’re sick. And we pass hospitals all the way, and they’re begging, ‘Just take me there—they can help me!’ But they really can’t, the hospitals.”

When Stride and her client arrive at a detox facility, nurses are waiting at the door. At that point, Stride said, “they’re, like, ‘What do you mean, you’re leaving me?’ ” She went on, “They’re scared, because now it’s reality. They know they’re not going to get their dope or their pills. For them to walk in those doors, that takes a lot. They’re heroes to me.”

After five to ten days in detox, patients are released. “When our clients get clean and the drugs are out of their system, they believe they’re O.K.,” Stride said. “And they’re not. That’s just getting the poison out of their bodies. So we try to explain to them, ‘No, you need to go through rehab, and learn why you are using, and learn how to fight it.’ Some will do it. Some won’t. And then our issue becomes how we’re going to find them a bed in rehab. If beds are all full, a lot of times they come back here to Martinsburg, because they have nowhere else to go.” Stride tries to keep those clients under constant watch. “That addict brain is telling them, ‘You know what you need, and it’s right here—go get it.’ ”

Stride usually drives clients to a detox center immediately after picking them up. But once she had to keep a woman overnight at her home, because a bed wasn’t available until the morning. She told me, “All I said was ‘Please, don’t rob me. I’m here to help you. But I guess if you are gonna rob me there’s not a whole lot I can do about it.’ This young lady had to go through the night—she was so sick, she didn’t sleep. I tried to stay up, but I knew I had to drive four hours to the detox place, and four hours back. So I slept some. We were up at 4 a.m., and at the detox place at eight. And she’s doing good now—she calls me to touch base sometimes.”

The Hope Dealer women and I met near an apartment complex that Melcher manages, and drank mochas that she had bought at McDonald’s. Melcher, who is fifty-three, with abundant blond ringlets and a warm, husky voice, told me that she loved flower arranging and refinishing old furniture—activities that would be occupying her days more often if there weren’t a heroin crisis. Stride, who is forty-seven, wore her hair in a ponytail and had curly bangs; Mayson, who is forty-six, had long, sparkly nails.

At one point, Stride said, “Please don’t think I’m rude,” as she picked up her phone to read a text.

“He’s in!” she cried. “He made it!”

The women cheered.

They had spent the previous day working on behalf of a woman and her twenty-one-year-old son, a heroin addict. He had private insurance, so they had signed him up for rehab in New Hampshire. “We had a plane ticket ready, and they were ready to go to the airport,” Stride said. “I left them, and then the mother called me and said, ‘My son’s lips are blue—he’s overdosed. What do I do?’ ” Stride became teary. “And I said, ‘Call 911. I’m coming right back over.’ ”

Samantha Engelhardt (right), a recovering addict, shows her newborn baby to the photographer Lori Swadley, who has been documenting the opioid epidemic in the Martinsburg area.
Samantha Engelhardt (right), a recovering addict, shows her newborn baby to the photographer Lori Swadley, who has been documenting the opioid epidemic in the Martinsburg area.Photograph by Eugene Richards for The New Yorker

Stride went on, “So he was in the hospital, and then his mom reached out to me late last night and said, ‘He’s been released.’ First question I asked is ‘Where is he?,’ because we’re afraid he’s going to run. And she said, ‘Instead of putting him on a plane, can we drive him? Because I want to know he makes it.’ And I said, ‘Yes, you can.’ So they are driving eight hours to take him to his detox. Detox was good to go—so we know for the next seven to ten days he’s safe.” After that, the man was set to go to Florida, to attend a thirty-day program that Stride respected.

Melcher said, “Praise God, he made it,” and the women all nodded.

Mayson, who works at the Department of Veterans Affairs and has two adult children, said that the Hope Dealer women had become like sisters. When one of them has a hard day, she can count on one of the others to tell her to rest and recharge—or, as Melcher often says, to “breeeathe.”

As mothers, they felt that they had a particular ability to communicate with women who needed help with their addicted children. Stride said, “I remember when I first found out my son was an addict. I was devastated. I didn’t know who to turn to, who I could trust. And I worked and worked to find my son a place, and that’s rough. Hearing ‘No’ or ‘We can’t take him today, but we can take him a week from today.’ ‘No, you need to take him now. My son’s gonna die.’ So now, when moms reach out to us, we’re, like, ‘We’ve got this.’ ”

Melcher said, “When you’re in that space? Oh, my gosh, you can hardly breathe, you’re a cryin’ mess.”

Stride nodded and said, “So when we come in and say, ‘Mom, we’re gonna take care of your child,’ I don’t care if that child is fifty years old—you see a relief.”

On May 21st, I received an e-mail from Melcher, informing me that Christina, her daughter, had fatally overdosed on heroin. Christina, she said, had completed rehab several times, and had been clean for ninety days before relapsing. Melcher refused to hide the fact that Christina had “lost her battle with addiction,” but added, “When a child passes away, the last thing a mother wants to say is that the child was an addict.” Melcher plans to continue her volunteer work, in honor of Christina’s “beautiful but tortured life.”

John Aldis doesn’t look like a maverick. He’s seventy-one, white-haired and pink-cheeked, with a neat mustache, half-rimmed spectacles, and a penchant for sweater vests and bow ties. You could imagine him being cast as the Stage Manager in a production of “Our Town.” But two years ago Aldis became the first doctor in West Virginia to offer free public classes to teach anybody—not just first responders and health professionals—how to reverse overdoses with Narcan.

Aldis is a family practitioner with a background in public health and tropical medicine. His mother taught nursing, and his father was an obstetrician. “We never made it through the second feature at the drive-in,” Aldis recalled. “He would always be summoned over the loudspeaker to attend a birth.” There was no question in Aldis’s mind that he would become a doctor, too. He spent most of his career in Asia and Africa, as a U.S. Navy physician and as a medical officer with the State Department. He retired in 2001. He and his wife, Pheny, a medical technologist, bought the house where he’d lived as a small child, in Shepherdstown. They filled it with art and antiques, acquired two Jack Russell terriers, and prepared for a quiet life filled with visits from their two daughters and the grandkids.

But Aldis soon became aware of the opioid epidemic in the Eastern Panhandle—several people he’d hired to work on his house were “good fellows” who were also addicts. “When I started to see it, I could not look away,” he told me. He took a job at the New Life Clinic, in Martinsburg, where he could prescribe Suboxone, one of the long-term treatments for opioid addiction. He found it enormously frustrating that addicts were often urged to quit heroin cold turkey or to stop taking Suboxone (or methadone or naltrexone, the other drugs used to treat addiction and counteract withdrawal symptoms). In his view, this was wholly unrealistic. Most addicts needed what is known as medication-assisted treatment for a long time, if not the rest of their lives. He found the work at the clinic the most satisfying he’d done since graduating from medical school, forty-six years earlier. Patients struggled, and many of them failed, but when one of them told him, “Doc, I talked to my mom for the first time in three years yesterday,” that was, Aldis said, “just the greatest thing.”

Aldis is generally a forbearing man, but he can be dismissive of people who don’t share his sense of urgency. As he wrote to me in an e-mail, “The lack of understanding of medication-assisted treatment among otherwise reasonably intelligent people at all levels of our community is astounding and (for me) completely unacceptable.”

In 2015, West Virginia University’s Injury Control Research Center, along with several state and county agencies, started investigating ways to make naloxone—the generic name for Narcan—more widely available, in the hope of saving people in the throes of an overdose. Aldis attended a talk on the subject by the center’s deputy director, Herb Linn, and afterward he told him, “Let’s not study this anymore. Let’s just start a program.” Linn recalls, “I told him, ‘Just do it! You could actually prescribe it to your patients.’ ”

Aldis taught his first class on administering Narcan on September 3, 2015, at the New Life Clinic. Nine days later, a woman who’d attended the class used Narcan to revive a pregnant woman who had overdosed at a motel where they were both staying. During the next few weeks, Aldis heard of five more lives saved by people who’d attended the class.

Cartoon
“Before you say anything, let me tell you which TV shows I don’t want spoilers on.”

In his seminars, Aldis addresses why addicts’ lives are worth saving. That might seem self-evident, but at this point in the opioid epidemic many West Virginians feel too exhausted and resentful to help. People like Lori Swadley and the Hope Dealer women and John Aldis must combat a widespread attitude of “Leave ’em lie, let ’em die.” A community sucked dry by addiction becomes understandably wary of coddling users, and some locals worry that making Narcan easily available could foster complacency about overdoses.

William Poe, a paramedic, told me, “The thing about Narcan is that it kind of makes it O.K. to overdose, because then you can keep it in your house and keep it private. And a lot of times we’re the wake-up call. I remember one time, we had a kid who had O.D.’d, and we had him in the ambulance. A call came over the radio—someone about his age had just died from an overdose. And the kid was, like, ‘I’m so glad you guys brought me back.’ ” It was humiliating when an ambulance showed up at your house and carted you out, pale and retching, but it also might push you to change. Then again, Poe mused, when most of your neighbors—not to mention your mom and your grandma—already knew that you used heroin, shaming might have little effect.

This past winter, I watched Aldis teach two classes in Berkeley Springs, an Eastern Panhandle town, at a storefront church between a convenience store and a pawnshop. The bare trees on the ridge above us were outlined like black lace against the twilight. Inside, a few dozen people, mostly women, sipped coffee from Styrofoam cups in an unadorned room with a low ceiling, tan carpeting, and rows of tan chairs.

Aldis touched briefly on what an overdose looks like, but acknowledged that the attendees probably already knew. (“Oh, Lord, yes,” a woman behind me said.) He demonstrated how to spray Narcan up a patient’s nose—take-home kits come in atomizer form—and announced that at the end of class he’d be writing prescriptions, which those in attendance could get filled at a pharmacy. If they had Medicaid or private insurance, the kit would cost only a few dollars; if they didn’t, it could cost anywhere from a hundred and twenty-five to three hundred dollars. At the first meeting I attended, in November, a few women began to cry when they heard that. At the second, in January, Aldis had some good news: the state had agreed to provide a hundred and eighty free kits.

Aldis told me that he’d like to see Narcan “inundating the community.” It carried no potential for abuse, and couldn’t harm you if someone gave it to you mistaking some other medical emergency for an overdose. “They ought to be selling this stuff next to the peanut butter in the Walmart,” he liked to say. And free supplies of Narcan should be everywhere, like fire extinguishers: “kitchen cabinets, your purse, schools, gyms, shopping malls, motels.”

Aldis had been invited to Berkeley Springs by Melody Stotler, who ran a local organization for recovering addicts. She said to the class, “Unfortunately, there are people in this community who don’t understand addiction, who don’t think Narcan should be out there.”

“They say we’re enablers,” Aldis put in. “Somebody who has a heart attack—are we enabling them by giving them C.P.R.? ‘But their cholesterol’s too high! We shouldn’t have saved his life!’ ” People laughed ruefully.

Aldis introduced Kathy Williams, a former patient of his and the mother of two little girls. She had twice saved people with Narcan. One time, while she was driving, she spotted a car on the side of the road, and a man lying on his back next to it. The other time, a neighbor in her apartment complex knocked on her door and said that a guy was overdosing in the parking lot. “So I grabbed my Narcan kit, and I ran out there,” she recalled. She saw a woman tending to a man. “What had happened was that these two had stopped at Kmart. She went in to pick up her layaways, and when she came out he had just done shooting up, and said, ‘Please take me home.’ Well, he was overdosing from Kmart all the way. By the time I got there, he was in the back of the car, completely blue, and I had another guy help me pull him out—a neighbor, ’cause where I live, I been there almost thirty years now, and I know everybody. A couple people saw me running, and they started running, too, because they said, ‘Kathy’s running—something must be going on.’ We gave him two doses of Narcan, and by the time the E.M.T. got there his eyes were just starting to flicker, and I really thought we were too late.” The man began to stir.

A woman named Tara, who was at the January meeting with her teen-age stepdaughter, told me that she had revived a guy who lived in the trailer park where she did some babysitting. He’d refused to go to the hospital, even though he was “puking like he was possessed.” I asked Tara—who was thirty, and had a soft, kind face—if the man had said anything to her after she saved him. “Every day, the next four days after that, he thanked me every time,” she told me. “He also said it was stupid and he’d never do that again, which wasn’t true, because he was arrested for driving under the influence of heroin a few weeks ago. Nodded out in the McDonald’s parking lot. Someone called the police.”

Tara wasn’t judging. She was a recovering addict herself—seven years now. She was studying to be a medical assistant.

Dr. John Aldis, at his home office in Shepherdstown. In 2015, he became the first doctor in West Virginia to offer free public classes to teach anybody—not just first responders and health professionals—how to reverse opioid overdoses with the drug Narcan.
Dr. John Aldis, at his home office in Shepherdstown. In 2015, he became the first doctor in West Virginia to offer free public classes to teach anybody—not just first responders and health professionals—how to reverse opioid overdoses with the drug Narcan.Photograph by Eugene Richards for The New Yorker

Jason Chalmers loved his children, that was for sure. He crawled around on all fours, pretending to be a pony, to amuse his daughter, Jacey, and her younger brother, Liam. He submitted to Jacey whenever she wanted to cover his face with makeup. When Jacey was six months old, Jason wrote a letter to his grandparents in which he described the “absolute, overwhelming” love that he felt for his daughter. “It’s not for or about me any more,” he wrote. “That’s probably for the best because I never did well with myself. She deserves a father who’s going to love her unconditionally and so help me God, I’m going to do it. Maybe she’s the answer to why I’m still here.”

Liam was born in 2009. His mother, Angie, had struggled with an opioid problem, and had taken Suboxone to combat it during her pregnancy. She told me that she also “might have used” heroin “a couple of times.” At the hospital, Jason felt that something was amiss with his son. His mother, Christine Chalmers, recalled, “He says, ‘Mom, this baby is in withdrawal. They can’t release him—he’s in terrible pain. If we take him home, he’s going to scream and scream and scream, and we won’t have anything to help him.’ ” (Suboxone can cause withdrawal.) “So we called the doctor and, by golly, they checked him over, and he was in total withdrawal. He was on morphine for two solid weeks in the hospital.”

Jason, who grew up in Martinsburg, was a heroin addict for most of his life, a fact that puzzled his family almost as deeply as it saddened them. He grew up in an attractive, wooded development on a country road, with horses and dogs, and a kindhearted mother. His grandparents lived in the development, too, and Jason and his two siblings waited for the school bus together on a wooden bench that a neighbor had carved for them.

There were glimmers of an explanation here and there. Jason’s parents had divorced when he was eight, and he was a shy, anxious kid; when he was twenty-five, he was given a diagnosis of obsessive-compulsive disorder. His older brother, Michael—the publisher of the Shepherdstown Observer—told me, “If you gave us a bag of Reese’s peanut-butter cups when we were kids, Jason would eat fifty of them. I’d eat five. I would’ve liked to eat fifty, but I was, like, ‘Nah, I’ll eat five.’ ” Maybe, Michael suggested, this was evidence that Jason had a genetic predisposition for addiction. But who knew, really?

In high school, Jason was “smart, good-looking, and athletic,” Michael recalled, but he became the “king of the stoners.” He barely got his diploma. It was the beginning of a self-destructive pattern. Jason did things while he was on drugs, or trying to get drugs, that filled him with shame; to blot out those feelings, he’d get high again. He got into using heroin, then into selling it. A friend’s father was a dealer, and Jason went to work for him, driving up to New York to procure drugs and driving back to Martinsburg to sell them. He introduced heroin to a girlfriend—a good student who had a scholarship to an excellent university. She dropped out, overdosed, and died. He got a tattoo of the girlfriend’s initials next to a dove, and a tattoo of Jesus, and a tattoo that represented his addiction: a desperate-looking demon with a gaping mouth. He went to jail dozens of times (drug possession, credit-card theft) and had a series of nearly fatal overdoses. In 2002, he stole his grandfather’s checkbook and emptied his bank account. Christine urged her father to press charges, both because she felt that Jason had to be held responsible and because she felt safest—and could actually sleep at night—when he was behind bars. He lied to her, and stole from her, and after using heroin he would pass out on her deck, in her garage, at the end of her driveway.

Jason did not go to college, and he could not keep a job for long; he worked for a few weeks at a mini-mart, but got fired when his background check came in. He’d get clean in jail, and write contrite letters to his family. Then he’d return to Martinsburg and start hanging out again with his addict friends. Michael moved to Chicago to start a career as an advertising copywriter, and their sister, Antonia, went to work for the school system. Jason, now in his thirties, was stuck—walking everywhere because he couldn’t get a driver’s license, and showing up at his mother’s house in the middle of the night to beg for milk and cereal.

In 2008, Jason wrote to his grandparents, “If I was a gambling man, which if you look at my track record my whole life has been a gamble, I’d have to say there’s not enough time left in the world to make good on the pain I’ve caused.” He observed, “Damaged people can be dangerous because they know they can survive, but for some reason they don’t know quite how to live.”

Christine Chalmers had struggled financially to raise three children as a single mother. But in 2002, when Jason was twenty-six, she was doing well as a real-estate agent, and she sent Jason to a monthlong rehab program in Colorado that cost ten thousand dollars. She recalled, “I went after a couple of weeks, for parents’ weekend, and you know what? It was so worth it. He’d been on heroin for ten years at this point, and it was the first time in all that time I saw him like my boy. He says, ‘It’s like a new world, Mom—I can see things, I can smell things, I can feel things.’ ” She paused. “I thought, You know what? If I never have anything else, he had a month, and I had a weekend, and he was my boy.”

On April 28, 2014, Jason fatally overdosed. He was thirty-seven. His death did not come as a surprise: he had started telling Christine that the worst part of overdosing was waking up.

Cartoon
“Take heed! For your journey is filled with long delays and unexpected service changes!”

After an overdose death, an autopsy is usually performed. Because of the epidemic, coroners in West Virginia are often backed up. It took two weeks before Jason’s body was returned to the Chalmers family. Afterward, Christine thought about how consumed she had been by her attempts to save Jason and, later, to protect his children from him. One day, Michael and Antonia had been cleaning up Jason’s apartment, and they brought over to Christine the contents of his kitchen cabinet. Christine told me, “There were a couple of cans of peas, and I had never served peas—I didn’t like them. And I said, ‘I didn’t know Jason liked peas!’ There’s your boy, your baby, and you never knew he liked peas. Such a simple thing. But I started crying, because I thought, What did we know about him as a person?”

When the man who sold Jason his final dose of heroin went on trial, Christine testified. “But, you know, from that point on I have felt terrible about it,” she said. “The guy got ten years. And in some sense his life was saved, because he would have ended up the same as Jase. But when I look at him I know he’d just done the same things Jason did. I mean, who knows who Jase sold to? Who knows who lived or died because he sold to them?”

Christine, who is now sixty-four, and works full time as a secretary in the Berkeley County government, has found herself raising Jacey, who is in the third grade. (Liam lives with his mother, in another state.) One of the biggest collateral effects of the opioid crisis is the growing number of children being raised by people other than their parents, or being placed in foster care. In West Virginia, the number of children removed from parental care because of drug abuse rose from nine hundred and seventy in 2006 to two thousand one hundred and seventy-one in 2016. Shawn Valentine, a foster-care coördinator in the Martinsburg area, says that although the goal is to reunite children with their parents, this happens in “less than twenty-five per cent of the cases we are involved in.” A major reason is that parents often can’t get access to recovery programs or medication-assisted treatment, because of waiting lists and financial obstacles.

Valentine said, “I had a six-year-old once tell me that he had to hold the stretchy thing on his mom’s arm. What would happen if he just didn’t want to do that? He told me, ‘Well, she would smack my head down, so that powdery stuff got all over my face.’ ”

Christine and Jacey live in Martinsburg, in a pretty bungalow with a porch swing and a glider, and a front door with bright-yellow trim. Down the street, there’s a couple with five adopted children whose parents were addicts. Across the street, a woman named Melissa lives with her elderly father and her youngest sister’s two little boys. Their mother was a heroin addict, and lost custody of the kids two years ago. At the time, Melissa, who is a medical technician at a nursing home, was working and living in Maryland—she is divorced, and her own children are grown. She rushed home to Martinsburg to care for her nephews, whom I’ll call Cody and Aiden.

One afternoon, I sat talking with Melissa and Christine on Christine’s front porch, while Jacey and the boys ran around in a ragged, laughing pack. Christine served some brownies that she had baked. Melissa recalled that, when her sister lost custody, her nephews’ caseworker told her that Aiden, who was then a toddler, would be quickly adopted, but that eight-year-old Cody, who bore more obvious signs of trauma, would probably languish in foster care. Melissa said that she couldn’t stand to see them separated. “I was, like, ‘What choice do I have?’ ” she said.

Christine patted her on the knee. “Good girl,” she said.

Jacey kept a close eye on Aiden, who kept wandering over to the neighbor’s yard, where there was a new Chihuahua puppy.

Christine said, “The sad thing about it is there are so many of these kids.”

“Yes!” Melissa said. “Aiden’s pre-K teacher told me forty per cent of the kids in her class are being raised by somebody other than a parent.”

“That means forty per cent have been found out,” Christine said. “Who knows what’s going on with the other parents?”

Jacey is a bright, curious kid, with pearly pink glasses and a sprinkling of freckles. The first time I met her, she catalogued her accomplishments in gymnastics. “I can do a handstand, a round-off, I’m working on my back handspring,” she said. “I can do a front flip. I want to try a back flip, but it’s kinda hard. I still have a lot more ahead of me.”

Christine has been honest with Jacey about Jason’s addiction, in the hope that it will keep her from ending up on a similar path. But it would be hard to keep the truth from Jacey: she remembers finding her father’s needles, and she remembers him getting high. He often dropped into a state of suspended animation—still standing, bent over at the waist, head dangling near his knees. Jacey told me that she and Liam used to think it was a game: “It was, like, he’s dead, but he’s also alive. You could tap on him and talk to him—he’d just be snoring there. But you could also feel that he was breathing. We would put our hands up to his nose and we could feel the air coming in and out.”

Last fall, Jacey won a statewide poster-making contest, called “Kids Kick Opioids,” that was sponsored by the West Virginia attorney general’s office. Jacey’s poster—one of two thousand entries—included a photograph of Jason, in a backward baseball cap and baggy shorts, holding a grinning Liam on one hip and Jacey on the other. She had written a little passage about how much she missed him after he’d “died from taking drugs,” and how she wanted to “hug and kiss him every day.” She wrote, “It is very sad when kids don’t have their daddy to play with.”

Christine said of the poster, “I think Jason would have wanted it. Jason wanted so badly for people not to follow him.”

Cartoon

At one point, Jacey was lying on the porch floor, drawing a rainbow with some colored pencils, when Christine said she thought that it was wrong to send opioid addicts to prison.

Jacey piped up. “Yeah, but they should take them away from their home town. Also, get them help.”

“Yes,” Christine said. “Long-term help. A month is not enough.”

“But take them away from, say, Martinsburg,” Jacey said, looking down at her rainbow. “Maybe take them across the world.”

Recently, Martinsburg has begun to treat the heroin crisis more openly as a public-health problem. The police chief, a Chicago transplant named Maurice Richards, had devised a progressive-sounding plan called the Martinsburg Initiative, which would direct support services toward children who appeared to be at risk for addiction, because their families were struggling socially or emotionally. In December, Tina Stride and several other local citizens stood up at a zoning meeting to proclaim the need for a detox center. They countered several residents who testified that such a center would bring more addicts, and more heroin, to their neighborhoods. “I’m here to say that’s already here,” a woman in favor of the proposal said. “It’s in your neighbor’s house, in the bathroom at Wendy’s, in our schools.” She added, “We’re talking about making America great again? Well, it starts here.”

That night, the Board of Zoning Appeals voted to allow a detox center, run by Peter Callahan, the psychotherapist, to occupy an unused commercial building in town. People in the hearing room cheered and cried and hugged one another. The facility will have only sixteen beds and won’t be ready for patients until December, but the Hope Dealer women were thrilled about it. Now they wouldn’t have to drive halfway across the state every time an addict called them up.

John Aldis, who was sitting next to me during the vote, breathed a sigh of relief. He said later, “It’s like that Winston Churchill quote: ‘This is not the end. It is not even the beginning of the end. But it is, perhaps, the end of the beginning.’ ”

This spring, Berkeley County started its first needle-exchange program, and other efforts are being made to help addicts survive. The new app that first responders are using to document overdoses allows them to input how many times a patient is given Narcan; when multiple doses are required, the heroin tends to be adulterated with strong synthetics. Such data can help the health department and law enforcement track dangerous batches of drugs, and help warn addicts.

Some Martinsburg residents who had been skeptical of medication-assisted treatment told me that they were coming around to the idea. A few cited the Surgeon General’s report on substance abuse, released in November, which encouraged the expansion of such treatment, noting that studies have repeatedly demonstrated its efficacy in “reducing illicit drug use and overdose deaths.” In Berkeley County, it felt like a turning point, though the Trump Administration was likely to resist such approaches. Tom Price, the new Secretary of Health and Human Services, has dismissed medication-assisted treatment as “substituting one opioid for another.” It was also unclear how most addicts would pay for treatment if the Affordable Care Act was repealed.

Martinsburg residents, meanwhile, tried to take heart from small breakthroughs. Angel Holt, the mother who’d overdosed at the softball practice, told me that she and her boyfriend had stayed clean since that day, and she was hoping to regain custody of her children. She’d been helped by the kindness of an older couple, Karen and Ed Schildt, who lived in Thurmont, Maryland. A year earlier, the Schildts had lost their twenty-five-year-old son, Chris, to a heroin overdose. They were deeply religious, and when they heard what happened to Angel Holt and Christopher Schildt they decided to reach out to them. The fact that their son had the same name as Holt’s boyfriend surely meant that God had put the couple in their path. Karen texted Holt words of encouragement almost daily.

In February, I spent an afternoon with Shawn Valentine, the foster-care coördinator, who introduced me to Shelby, her twenty-five-year-old daughter. Shelby had become addicted to opioids at twenty-one, when she was depressed and waitressing at a Waffle House. Her co-workers always seemed to know how to get their hands on pills. When the meds got too expensive, Shelby turned to heroin.

Shelby, Valentine, and I were sitting in Valentine’s kitchen, along with Shelby’s sweet fifteen-year-old brother, Patrick. Shelby said, “People don’t realize what the brain goes through when you’re addicted—it’s like a mental shutdown. Everything is gray. You have these blinders on.” As she described it, the constant hunt for heroin imposed a kind of order on life’s confounding open-endedness. Addiction told you what every day was for, when otherwise you might not have known.

For close to a year, Shelby had been in a program in which she put a dissolvable strip of Suboxone on her tongue every day, and attended group and individual therapy. (The word “assisted” in “medication-assisted treatment” indicates the primacy of the need for recovering addicts to figure out why they are drawn to opioids.) Shelby said that Suboxone helped curb her craving for heroin, without sedating her. “There are triggers,” she said. “But the urge to run a hundred yards down the street and try to find my ex-dealer and pay him, then shove a used rig in my arm real quick? That’s gone.”

She can now be trusted not to sell treasured things for drug money: her little brother’s video-game console, her mom’s four-leaf-clover necklace. Her long auburn hair, which she used to wash and comb so seldom that her mother once spent four hours trying to untangle it, is now silky and soft.

In tight-knit Appalachian towns, heroin has become a social contagion. Peter Callahan, a psychotherapist in Martinsburg, said, “If the lady next door is using, and so are other neighbors, and people in your family are, too, the odds are good that you’re going to join in.”
In tight-knit Appalachian towns, heroin has become a social contagion. Peter Callahan, a psychotherapist in Martinsburg, said, “If the lady next door is using, and so are other neighbors, and people in your family are, too, the odds are good that you’re going to join in.”Photograph by Eugene Richards for The New Yorker

Valentine told me that, if Shelby had to be on Suboxone all her life, “I’m absolutely on board with that.” She turned to Shelby. “Whatever it takes for you to be a healthy, productive human being.”

Recently, Shelby’s mother told her, “O.K., I’ll let you take the truck without me, to take your brother to the movies.” Shelby recalled, “I was almost, like, ‘Pinch me, wake me up—this can’t be true.’ Because without her truck there’s no working. That’s how she makes her living. She said, ‘Here’s a piece of trust. Don’t throw it away.’ ”

Shelby and her brother drove to the mall and saw a horror movie. It was not a very good one, they agreed, but it didn’t matter. They headed home in the dark, and the moment they got there Shelby placed the keys to the truck in her mother’s hand. 

Show HN: Pinecone – Build your own genetically-encoded tools

$
0
0

By focusing on the protein domain as the basic unit, Pinecone enables straight-forward, plain language design. We abstract the complexity of long strings of nucleotides, into higher-level functional units. Find useful proteins that are “green” and “localize to the nucleus”.

Show HN: Upstart – Find newsletters to promote your business or side projects

$
0
0
Join now & support influencers by advertising in their newsletters. Get your product in front of their thousands of targeted and engaged subscribers. We want to help makers like you launch sideprojects and startups to hungry audiences, so you can focus on building awesome products.Submit your newsletter for Free and have awesome companies and makers support your newsletter. Introduce your audience to products & services they'll love to hear about. Allow us to help you monetize your newsletter.We'll soon be launching a searchable and ever growing database of newsletters that you can sponsor. Never worry again about where to find users for your startup or sideprojects. Simply find the perfect audience that's already been vetted and have influencers refer you to them.

Yandex’s on-demand taxi service debuts its self-driving car project

$
0
0

Russia search and internet technology giant Yandex is showing off the self-driving vehicle prototype developed by its Yandex.Taxi on-demand ride service for the first time, and the video above is the first footage of the car in action. The prototype is meant to help Yandex test its software, which the company thinks it’s uniquely well-positioned to develop for this emerging space.

Yandex notes that it has navigation, geolocation, computer vision, and machine learning expertise from other ongoing products and services, including Yandex.Navigator and Yandex.Maps.

“We use anonymised data that we receive from Yandex.Navigator users, which allows us to understand how to drive in a city with its traffic congestion, accidents, speed limits, road closures and other traffic events,” Yandex.Taxi Head of PR Vladimir Isaev explained via email. “We have been using computer vision technologies in a number of our services for quite a while. We use them to find vacant parking spaces or read road signs, for instance, in our geolocation services.”

Expertise with computer vision use at Yandex comes from matching similar images for search results, and for translating text within a photo through its language service offerings. As a result of its combined software development efforts, as well as recent work on applying said tech to the automotive space, Yandex’s self-driving software for its prototype vehicle is developed completely in house, the company tells me.

Also, you may have noticed the lingering shot on that Nvidia GTX GPU in the car, as well as that Velodyne LiDAR unit up top: Yandex says it’s using its own “custom-built” hardware as well as mass market, generally available components for now, but it’s in talks with partners regarding the creation of fit-for-purpose automotive grade hardware down the road.

The vehicle in the video isn’t yet navigating real city streets, but Yandex says that testing is coming on public roads within a year, if all goes as planned. It’s too early yet for any projections regarding commercial service availability, however, Isaev tells me. Eventually, the company hopes to partner with car manufacturers and others looking to bring autonomous vehicles to market.

The First Time America Freaked Out Over Automation

$
0
0

In 1958, America found itself in the midst of its worst economic slump since the Great Depression. There had been other recessions, from 1948 to 1949 and from 1953 to 1954, but they were less severe. The latest downturn, which began in the summer of 1957, turned serious by winter. In January 1958, Life magazine visited Peoria, Illinois, and found the mood there to be gloomy. Caterpillar, the heavy equipment maker and the big provider of jobs in town, had already laid off 6,000 workers and cut back to a 4-day week. “Trouble is already here for some people,” said one Caterpillar worker. “But it’s under the surface for everybody.”

In Peoria and across the nation, things got steadily worse. By July, the national unemployment rate hit 7.5 percent. General Electric alone had sent home some 25,000 production workers by the summer of ’58; General Motors, 28,000. Things got so bad for Studebaker-Packard, the automaker, that it made a shocking announcement: It would no longer honor its pension obligations for more than 3,000 workers, handing an “I told you so” moment to those who’d been warning about the fragility of retirement promises.

Story Continued Below

As painful as the recession was, to many it was all part of the natural business cycle: a chance for manufacturers to pare down inventories that had become bloated earlier in the decade, to pull back on investments that had gotten overbuilt and to adapt to a shrinking export market. The Committee for Economic Development, a liberal-leaning business group that had been started toward the end of World War II to promote job creation, called it “one of the long series in the wave-like movement that has been characteristic of our economic growth.” Kenneth McFarland, a consultant for General Motors, agreed. “What we have now is normalcy,” he said. “The law of supply and demand—the free enterprise system—is working now as it was supposed to work.”

But some suspected that something else was going on, something structural and not just cyclical. The Nation termed it an “Automation Depression.” “We are stumbling blindly into the automation era with no concept or plan to reconcile the need of workers for income and the need of business for cost-cutting and worker-displacing innovations,” the magazine said in November 1958. “A part of the current unemployment … is due to the automation component of the capital-goods’ boom which preceded the recession. The boom gave work while it lasted, but the improved machinery requires fewer man-hours per unit of output.” This conundrum, moreover, would outlast present conditions and become even more apparent in an economy that was supposed to accommodate 1 million new job seekers every year. “The problem we shall have to face some time,” the Nation concluded, “is that the working force is expansive, while latter-day industrial technology is contractive of man-hours.”

Decades later, many of the same concerns have resurfaced. The impact of automation on jobs has become one of America’s most pressing economic issues. In industry after industry—food services, retail, transportation—the robots are coming or already have arrived. Most factory floors, once crowded with blue-collar laborers, emptied out long ago because of technology; what once took 1,000 people to manufacture can be cranked out these days by less than 200.

Many economists remain confident that a sufficient number of new jobs will emerge, lots of them in fields we can’t yet imagine, to replace all of those positions that automation will kill off. But even so, this much is certain: Many Americans, especially people with limited education and skills, are going to be displaced by machines over the next 10 to 20 years. And as a country, we’re not very good at training and retraining and preparing the most vulnerable for a new future. In the meantime, our national politics have been totally upended, with Donald Trump having played on people’s anxieties and swept into office on the pledge of bringing back millions of those same lost jobs.

Whether Trump’s rhetoric is grounded in reality is a different matter. Consider, for instance, the Carrier factory in Indiana, where Trump boasted in November he had saved 1,100 jobs. The CEO of the heating and air-conditioning manufacturer later admitted that many of those positions would ultimately be replaced by automation anyway. (The kicker: The company recently announced that it was moving 632 of those jobs to Monterrey, Mexico.)

That we are still trying to figure out how to cope with the ramifications of technology on employment is, at least in part, a function of how the government, business and labor unions dealt with the crisis back in the 1950s—or didn’t, as history would have it. Instead, the public and private sectors were reassured by the return of the booming economy less than a year later. And so a longer, more structural solution to the cracks that had just begun showing never materialized, leaving the question for another day. Our day.

***

Even in the 1950s, angst about what automation would mean for employment was not new. Economists started to explore the issue in the early 1800s, during the Industrial Revolution. Most classical theorists of the time—including J. B. Say, David Ricardo and John Ramsey McCulloch—held that introducing new machines would, save perhaps for a brief period of adjustment, produce more jobs than they’d destroy. By the end of the century, concern had faded nearly altogether. “Because the general upward trends in investment, production, employment and living standards were supported by evidence that could not be denied,” the economic historian Gregory Woirol has written, “technological change ceased to be seen as a relevant problem.” But fears reappeared in the mid-to-late 1920s, as America experienced two mild recessions and newly published productivity data indicated that machines were perhaps eating more jobs than was first believed. “This country has upon its hands a problem of chronic unemployment, likely to grow worse rather than better,” the Journal ofCommerce, a trade and shipping industry publication, opined in 1928. “Business prosperity, far from curing it, may tend to aggravate it by stimulating invention and encouraging all sorts of industrial rationalization schemes.”

The key word was “may.” Economists continued to investigate the matter, but reliable statistics were scarce, and no firm conclusion was reached. Through the late 1930s, scholarly opinions about technology’s net effect on employment were as divergent as ever. World War II then put the entire debate on hold. But by the 1950s, it was revived again with the stakes seemingly higher than ever, thanks to all the technological advances that had been made by the military and industry during the conflict.

The world was in the throes of what MIT mathematician Norbert Wiener called “the second industrial revolution.” And to many, the outlook for employment was suddenly forbidding. “With automatic machines taking over so many jobs,” the wife of an unemployed textile worker in Roanoke, Virginia, told a reporter, “it looks like the men may have finally outsmarted themselves.” Said the Nation: “Automation … is a ghost which frightens every worker in every plant, the more so because he sees no immediate chance of exorcising it.” Science Service, a nonprofit institution, remarked: “With the advent of the thinking machine, people are beginning to understand how horses felt when Ford invented the Model T.”

Corporate executives largely dismissed these worries, maintaining through the 1950s and 60s that for every worker cast aside by a machine, more jobs were being generated. Sometimes, whole new enterprises sprang to life. “The automatic-control industry is young and incredibly vigorous,” John Diebold, dubbed “the prophet of information technology,” told business leaders in 1954. Mostly, the argument went, job gains were being realized at the very same companies where new technology was being deployed, as huge increases in output led to the need for more workers overall—office personnel, engineers, maintenance staff, factory hands—to keep up with rising consumer demand. General Motors, for example, added more than 287,000 people to its payroll between 1940 and the mid-1950s. “There is widespread fear that technological progress … is a Grim Reaper of jobs,” GM vice president Louis Seaton told lawmakers. “Our experience and record completely refutes this view.”

No company, however, pressed this point harder than did General Electric, which was at the fore of automating both its factories and offices: In 1952, it installed an IBM 701 to make engineering calculations at its Evendale, Ohio, jet engine operation. And in 1954 GE became the first company to use an electronic computer for regular data processing, when it bought a UNIVAC I to handle accounting, manufacturing control and planning at its appliance division in Louisville, Kentucky. “Machines that can read, write, do arithmetic, measure, feel, remember, now make it possible to take the load off men’s minds, just as machines have eased the burden on our backs,” GE said in one ad. “But these fantastic machines still depend on people to design and build and guide and use them. What they replace is drudgery—not people.”

By the late 1950s, GE was offering another justification for its rush to automate: Its overseas rivals, having pulled themselves out of the rubble of World War II, were on the rise. “We have strong competition from highly automated foreign plants paying wages that are only a fraction of ours,” said Charlie Scheer, the manager of GE’s lamp-equipment unit. “It’s a case here of automate or die on the competitive vine.” To illustrate the peril, GE showed a film called Toshiba to its factory workers in New Jersey, highlighting the Japanese company’s inroads into the lamp market. The move backfired, however, when the International Union of Electrical Workers discovered that GE had been investing in Toshiba since 1953, amassing a nearly 6 percent stake in the company. “The purpose of this film is obviously to brainwash you into believing that low-wage competition … is a threat to your job security,” the IUE told employees. “What GE failed to tell you is that it likes to play both sides of the street at the same time.” The union labeled GE’s warnings “phony propaganda.”

GE wouldn’t back down, however. “Automation is urgently needed,” Ralph Cordiner, the company’s CEO, testified to Congress, “to help individual companies, and the nation as a whole, try to be able to meet the new competition from abroad.” More generally, he added, the claim that automation strangled job growth was patently false. “The installation of labor-saving machinery may—and should—reduce the number of persons required to produce a given amount of goods and services,” Cordiner said, “but this increase in efficiency is precisely what creates both the attractive values and additional ability to support expanded output, new industries and new services for an ever more diverse economy.”

In the broadest sense, he was right. A study by University of Chicago economist Yale Brozen would find that while 13 million jobs had been destroyed during the 1950s, the adoption of new technology was among the ingredients that led to the creation of more than 20 million other positions. “Instead of being alarmed about growing automation, we ought to be cheering it on,” he wrote. “The catastrophe that doom criers constantly threaten us with has retreated into such a dim future that we simply cannot take their pronouncements seriously.”

But Brozen was too blithe. While automation may have added jobs in the aggregate, certain sectors were hit hard, playing havoc with untold numbers of individual lives. Technological upheaval caused both steelmakers and rail companies, for instance, to suffer drops in employment in the late 1950s.

“In converting to more automated processes, many industries found it less costly to build a new plant in another area rather than converting their older factories, thus leaving whole communities of employees stranded,” the Labor Department said in one study of the period. In the mid-1960s, the federal Commission on Technology, Automation and Economic Progress would recognize technological change as “a major factor in the displacement and temporary unemployment of particular workers.”

Labor leaders like Walter Reuther of the United Auto Workers and James Carey of the Electrical Workers, cognizant that they couldn’t afford to be seen as Luddites, went out of their way to praise the manifold benefits brought by machines. “You can’t stop technological progress, and it would be silly to try it if you could,” Reuther said. The UAW had already conceded the point in 1950 when, as part of its landmark five-year contract with General Motors, known as the Treaty of Detroit, it had formally agreed to take a “cooperative attitude” regarding the forward march of technology. Carey likewise said that automation, along with atomic energy, “can do more than anything in mankind’s long history to end poverty, to abolish hunger and deprivation. More than any other creation of man’s hand and brain, this combination can create a near-paradise on earth, a world of plenty and equal opportunity, a world in which the pursuit of happiness has become reality rather than a hope and a dream.”

Then, in their very next breaths, both Reuther and Carey would condemn business for not doing enough to temper automation’s ill effects. “More and more,” said Reuther, “we are witnessing the often frightening results of the widespread introduction of increasingly efficient methods of production without the leavening influence of moral or social responsibility.” With industry having failed, according to Reuther and Carey, it was up to Washington to become much more active in assisting workers idled by machines. They called, among other things, for federal officials to develop more effective retraining programs and relocation services for displaced workers, beef up unemployment insurance and establish early retirement funds, and create an information clearinghouse on technological change to help steer national policy.

For all of the union men’s denunciation of corporate America, many companies did try to help workers whose jobs were taken out by technology. The integrity of the social contract at the time demanded as much. Kodak, for instance, left millions of dollars on the table in the late 1950s by holding off on installing more efficient film emulsion–coating machines; by waiting five or so years to make the complete upgrade, the most senior workers who would have been forced out were allowed to reach retirement age. “In this case,” Kodak reported, “substantial dollar savings were delayed in order to cushion the effect of mechanization on some of the company’s most skilled, experienced and loyal technicians.” Other corporations focused on improving their workers’ skills. Some 30,000 General Motors employees were enrolled in various training programs in the late 50s, for example. At General Electric, veteran workers laid off because of automation were guaranteed during a retraining period at least 95 percent of their pay for as many weeks as they had years of service. “This was an effort to stabilize income while the employee prepared for the next job,” said GE’s Earl Willis. “Maximizing employment security is a prime company goal.”

Still, given the pace of change, it didn’t take a lot to imagine a day when it wouldn’t really matter what companies did to soften the blow of automation. This would become all the more true in the aftermath of the greatest invention of 1958 (and one of the most significant of all time): the computer chip. Then again, having a vivid imagination didn’t hurt, either. Kurt Vonnegut tapped his to write his first novel, Player Piano, published in 1952. In it, he renders a future society that is run by machines; there is no more need for human labor. Early on in the book, the main character, an engineer named Paul Proteus, is chatting with his secretary, Katharine:

“Do you suppose there’ll be a Third Industrial Revolution?”

Paul paused in his office doorway. “A third one? What would that be like?”

“I don’t know exactly. The first and second ones must have been sort of inconceivable at one time.”

“To the people who were going to be replaced by machines, maybe. A third one, eh? In a way, I guess the third one’s been going on for some time, if you mean thinking machines. That would be the third revolution, I guess—machines that devaluate human thinking. Some of the big companies like EPICAC do that all right, in specialized fields.”

“Uh-huh,” said Katharine thoughtfully. She rattled a pencil between her teeth. “First the muscle work, then the routine work, then, maybe, the real brainwork.”

“I hope I’m not around long enough to see that final step.”

Vonnegut, who worked at GE in public relations from 1947 through 1950, had found his muse in building 49 at the company’s Schenectady Works. There one day he saw a milling machine for cutting the rotors on jet engines. Usually, this was a task performed by a master machinist. But now, a computer-guided contraption was doing the work. The men at the plant “were foreseeing all sorts of machines being run by little boxes and punched cards,” Vonnegut said later. “The idea of doing that, you know, made sense, perfect sense. To have a little clicking box make all the decisions wasn’t a vicious thing to do. But it was too bad for the human beings who got their dignity from their jobs.”

***

As the recession of 1958 deepened, the Eisenhower administration undertook a series of actions to stimulate the economy: It quickened the rate of procurement by the Defense Department, stepped up the pace of urban-renewal projects on the books, cut loose hundreds of millions of dollars of funds for the Army Corps of Engineers to build roads and other infrastructure, and ordered Fannie Mae to add extra grease to the housing market. The Federal Reserve did its part, too, cutting interest rates four times from November 1957 to April 1958.

Some wanted the government to do even more; the Committee for Economic Development, for instance, called for a temporary 20 percent cut in personal income taxes. But President Dwight Eisenhower was reluctant to go that far. Instead, he publicly endorsed efforts by business to jumpstart things on its own. “What we need now,” the president quoted a Cadillac dealer in Cleveland as saying, “is more and better salesmanship and more and better advertising of our goods.”

Many apparently agreed. In Grosse Ile, Michigan, a supermarket owner offered any customer who spent five bucks or more in his store a chance to win a sack of 500 silver dollars. In Hampton, Iowa, seven firms gave their employees surprise bonuses on the condition that they spend the money on nonessential items. Some sought to shake up consumer psychology. A Cleveland realtor hoped to revitalize home sales by accentuating the positive on new signage: “Thanks to you our business is terrific.” In Kankakee, Illinois, local businessmen tried to turn residents from economic pessimists to optimists by staging a mock hanging of “Mr. Gloom.” The epitaph on his tombstone read: “Here Lies Mr. Gloom Killed By the Boom.”

General Electric also tried to change the national mindset. “A swift and sure recovery cannot be attained by sitting back and relying on government stimulants, deficit spending, meaningless tax cuts, deliberate inflation, or any other economic sleight of hand,” Ralph Cordiner told GE shareholders at the company’s annual meeting in April 1958. “The solutions to the present difficulties will be found in a common effort by all citizens to work more purposefully, buy and sell more confidently and build up a higher level of solid, useful economic activity.” GE called its slay-the-recession initiative Operation Upturn, and the idea was to get every company in America to focus harder than ever on providing its customers with just what they were looking for. “I am not speaking only of sales campaigns or promotional stunts, although they will be important ingredients in the whole picture,” Cordiner said. “Nor do I mean a transparent attempt to persuade people to buy things they don’t want simply because it is supposed to be the ‘patriotic’ thing to do so. I am proposing a total effort, by every man and woman who has a job, to concentrate on giving customers the best service and the best reasons to buy they ever had.”

At GE, Cordiner worked to turn the pep talk into policy. General Electric held down prices and extended new terms of credit in order to help consumers who’d been laid off from their jobs. GE’s marketers kicked into overdrive, too. “They are reviving the old-fashioned shoe-leather selling that creates business where it does not now exist,” Cordiner said. “They are pointing out extra value and features in our products. They are selling hard.”

It’s impossible to know just how big a difference was made by GE’s Operation Upturn and the other efforts by business to resuscitate the economy, but this much is undeniable: the recession of 1957–1958 didn’t last long. The decline was sharper than the recessions of 1948–1949 and 1953–1954, but so was the rebound. The downturn was officially over in just eight months, compared with 10 months and 11 months for the other two postwar contractions. The stock market also soared in 1958—proof, said Time magazine, that “the US was blessed with a new kind of economy, different from any ever seen on the face of the earth.” It was one that “could take a hard knock and come bouncing quickly back,” where businessmen could face the “inevitable williwaws of economic life but continue to plan and expand for the long term,” while workers found “overall employment more stable.”

But this business-led crusade to avert a bigger economic crisis meant that Washington failed to seize on a bold course to counter the forces behind the “Automation Depression” of the 1950s. In the coming decades, federal officials would implement a host of measures aimed at giving workers supplanted by technology new skills: the Manpower Development and Training Act, the Economically Displaced Worker Adjustment Act, amendments to the Job Training Partnership Act and more. But most experts agree that this legislation has not been very effective. Nor are most job programs geared to help people enhance the essential human qualities—such as empathy and creativity—that they’ll need to work side by side with smart machines.

“The United States does not have a good record of constructive policy response to technological unemployment,” Alice Rivlin, a senior fellow at the Brookings Institution and former director of the Office of Management and Budget, wrote in a recent article. “America’s failure to pay serious attention to those left behind by technological change,” she added, “is arguably responsible for much of the public outrage on both right and left that erupted in the 2016 election.”

With half of the nation’s adult population lacking any kind of education beyond high school, not even so much as a post-secondary certificate, it is tough to envision that this outrage will subside anytime soon. After all, these folks, in particular, face a stark truth: that most any job that can be given to a machine will be, and that machines’ capabilities are improving by the day.

Adapted from THE END OF LOYALTY, by Rick Wartzman, to be published by PublicAffairs in May 2017. Copyright 2017 by Rick Wartzman.

MySQL 8.0: Retiring Support for the Query Cache

$
0
0

As Rene wrote on the ProxySQL blog yesterday:

Although MySQL Query Cache was meant to improve performance, it has serious scalability issues and it can easily become a severe bottleneck.

This is indeed something we have observed in the MySQL team for a while. Before we get to the subject of today’s post, let me start with an introduction.

Introduction to Query Cache

The MySQL query cache is a query results cache. It compares incoming queries that start with SEL to a hash table, and if there is a match returns the results from the previous execution of the query. There are some restrictions:

  • The query must match byte-for-byte (the query cache avoids parsing)
  • Use of non-deterministic features will result in the query not being cached (including temporary tables, user variables, RAND(), NOW() and UDFs.)
  • The query cache was designed to not serve stale results.  Any modification to the underlying table(s) results in all cache being invalidated for those tables.
  • There are some restrictions on if the cache can be used for InnoDB (to respect MVCC; as you have a transaction open, the ‘cache’ might not represent the data in your expected view.)

The Best Case Scenario

As I wrote on my personal blog some years ago:

The ideal scenario for the query cache tends to be largely read-only, where there are a number of very expensive queries which examine millions of rows only to return a few. A hypothetical example might be a complex query to build a list of values for a drop-down list that always appears on a webpage form. In a situation like this, the query cache can mask performance problems caused by missing indexes, which makes it helpful for novice users.

This comment still yields true today, but I think it is important to also point out that DBA tools for poor-application-intervention have also improved:

  • In the MySQL server, we now have the ability to rewrite queries to insert hints (or other modifications to improve performance)
  • We have third-party tools like ProxySQL, which can act as a man-in-the-middle query cache. ProxySQL also supports a TTL for cache, which works fine in the example I provided earlier (build a list of values for a drop-down list).

Limitations of the Query Cache

The query cache has been disabled-by-default since MySQL 5.6 (2013) as it is known to not scale with high-throughput workloads on multi-core machines. Rene confirmed this in his post yesterday, but it has also previously been mentioned by Stewart Smith and Domas Mituzas.

Assuming that scalability could be improved, the limiting factor of the query cache is that since only queries that hit the cache will see improvement; it is unlikely to improve predictability of performance.  For user facing systems, reducing the variability of performance is often more important than improving peak throughput:

Slide 2/47 from A Top-Down Approach to Achieving Performance Predictability in Database Systems.
Slide 3/47 from A Top-Down Approach to Achieving Performance Predictability in Database Systems.

Decision to Remove Support for the Query Cache

We concur with the research performed by Jiamin Huang, Barzan Mozafari, Grant Schoenebeck, Thomas F. Wenisch at the University of Michigan, Ann Arbor.  We considered what improvements we could make to query cache versus optimizations that we could make which provide improvements to all workloads.

While these choices themselves are orthogonal, engineering resources are finite.  That is to say that we are shifting strategy to invest in improvements that are more generally applicable to all workloads.

We also agree with Rene’s conclusion, that caching provides the greatest benefit when it is moved closer to the client:

The “Client + 2x ProxySQL” results showing a 5.2x performance improvement when moving the cache to the client.

Upgrade Path for Existing Users

With the current limitations noted, the query cache will continue to be supported for the life time of MySQL 5.7.  MySQL 8.0 will not support query cache, and users upgrading will be encouraged to use either Server-side Query Rewrite or ProxySQL as a man-in-the-middle cache.

We expect this change to only affect a small number of users, but if this concerns you, please reach out and get in touch!

Thank you for using MySQL!

Counting Clojure Code

$
0
0

For better or worse, we count lines of code. We (hopefully) feel a little dirty when we do it, because it's a flawed metric. But we do it. We do it on large codebases and small code snippets. Even badass hacker David Nolan does it.

I count lines because I try to write elegant code. To me, elegance is not merely a fun puzzle-solving indulgence. Rather, it's the most practical way to reduce complexity and reason about correctness.

A concise line count is not exactly the same as elegance, but it's correlated enough to make it tempting to count lines.

For a single function, it's intuitive when it becomes more concise. No need to count lines. But recently I completed a 3-month refactor that touched hundreds of files. I was curious: did I net add or remove code? I wanted to count lines to know the answer.

I also count lines when choosing libraries. When you depend on a library, the library code becomes your code in a way. You might need to read it, fix it, or add to it. And I want as little code as possible. If two libraries do roughly the same thing, but one has far fewer lines, I will usually prefer the smaller library.

So if we're going to count lines, we might as well do it accurately.

Counting Lines Accurately

The cloc unix tool is the obvious first thing to try, but it miscounts Clojure lines because of the different ways to write comments:

  • Multi-line (comment ...) forms.
  • Namespace and function docstrings.
  • "Ignore next form" reader macro #_.
  • Semicolons.

cloc detects Clojure comments only by checking for semicolons.

To accurately count lines of Clojure, we should just parse the source files and look at what is actually code. I wrote a tool to do this:

lein-count (sic)

This lein plugin counts lines in your own project, or in any Clojure artifact.

For example, lein-count counting its own lines:

$ lein count :artifact lein-count 1.0.2
Found 3 source files.

|------+-------+---------------+-------|
| Ext  | Files | Lines of Code | Nodes |
|------+-------+---------------+-------|
| clj  |     3 |          1053 | 15705 |
| ____ | _____ | _____________ | _____ |
| SUM: |     3 |          1053 | 15705 |
|------+-------+---------------+-------|

Syntax Nodes

Even when counted accurately, lines are a crude metric for complexity. Obviously

(f a
   b
   c)

is the same "amount" of code as

(f a b c)

In Succinctness is Power, Paul Graham discusses another metric, the number of nodes in the syntax tree. I think this is a better metric, and for Clojure code it's easy to measure. So lein-count does it too.

When Paul discusses this metric, he is using it to compare the relative succinctness of different languages, not the relative succinctness of different programs written in the same language.

Nevertheless, I think node count is reasonable for comparing the succinctness of Clojure programs. Especially when the author is not trying to game the system.

I spend most of my programming time trying to write as little code as possible. I hope lein-count will be useful in measuring progress toward that end.

Reader Comments


Early Linux filesystem reliability

$
0
0
[TUHS] The evolution of Unix facilities and architectureTheodore Ts'otytso at mit.edu
Sun May 14 14:30:24 AEST 2017
On Thu, May 11, 2017 at 03:25:47PM -0700, Larry McVoy wrote:> This is one place where I think Linux kicked Unix's ass.  And I am not> really sure how they did it, I have an idea but am not positive.  Unix> file systems up through UFS as shipped by Sun, were all vulnerable to> what I call the power out test.  Untar some big tarball and power off> the machine in the middle of it.  Reboot.  Hilarity ensues (not).>> You were dropped into some stand alone shell after fsck threw up its> hands and it was up to you to fix it.  Dozens and dozens of errors.> It was almost always faster to go to backups because figuring that > stuff out, file by file (which I have done more than once), gets you> to the point that your run "fsck -y" and go poke at lost+found when> fsck is done, realize that there is no hope, and reach for backups.>> Try the same thing with Linux.  The file system will come back, starting> with, I believe, ext2.>> My belief is that Linux orders writes such that while you may lose data> (as in, a process created a file, the OS said it was OK, but that file > will not be in the file system after a crash), but the rest of the file > system will be consistent.  I think it's as if you powered off the> machine a few seconds earlier than you actually did, some stuff is in> flight and until they can write stuff out in the proper order you may> lose data on a hard reset.
So the story is a bit complicated here, and may be an example of
"worse is better" --- which is ironically one of those things which is
used as an explanation for why BSD/Unix won ever though the Lisp was
technically superior[1] --- but in this case, it's Linux that did
something "dirty", and BSD that did something that was supposed to be
the "better" solution.

[1] https://www.jwz.org/doc/worse-is-better.html

So first let's talk about ext2 (which indeed, does not have file
system journalling; that came in ext3).  The BSD Fast File System goes
to a huge amount of effort to make sure that writes are sent to the
disk in exactly the right order so that fsck can actually fix things.
This requires that the disk not reorder writes (e.g., write caching is
disabled or in write-through mode).  Linux, in ext2, didn't bother
with trying to get the write order correct at all.  None.  Nada.  Zip.
Writes would go out in whatever order dictated by the elevator
scheduler, and so on a power failure or a kernel crash, the order in
which metadata writes would be sent to the disk was completely
unconstrained.

Sounds horrible, right?  In many ways, it was.  And I lost count of
how often NetBSD and FreeBSD users would talk about how primitive and
horrible ext2 was in comparison to FFS, which had all of this
excellent engineering work to make sure writes happened in the correct
order such that fsck was guaranteed to always be able to fix things.

So why did Linux get away with it?  When I wrote the fsck for ext2, I
knew that anything can and would happen, so it was implemented so that
it was extremely paranoid about not ever losing any data.  And if
there was a chance that an expert could recover the data, e2fsck would
stop and ask the system administrator to take a look.  In the case
that the user ran with fsck -y, the default was drop files into
lost+found, where as in some cases with the FFS fsck, it "knew" that
in a particular case, the order in which writes were staged out the
right thing to do was to let the unlink complete, so it would let the
refcount go to zero, or stay at zero.

The other thing that we did in Linux is that I made sure we had a
highly functional "debugfs" tool.  This tool served two purposes.  The
first was it made it very easy for me to creat a regression test suite
for fsck.  As far as I know, none of the other major file systems at
the time had an fsck with a regression test suite --- and I was
religious about adding tests as I added functionality, and as I fixed
bugs.  The debugfs tool made it easy for me to create test case file
systems that was corrupted in various interesting ways.  The other use
of debugfs was that it made it easy for experts to do file system
recovery after a crash, if there was some really precious file that
they needed to try to recover.

So this is why this is a great example of "worse is better".  In Linux,
ext2 was ***incredibly*** sloppy about how it handled write ordering
--- it didn't do anything at all.  But as a consequence we developed
tools that were extremely good to compensate, and in practice, it was
extremely rare (although it did happen on occasion) that files would
get lost or the file systme could end up in a state where fsck would
not be able to recover without manual intervention by a system
administrator using debugfs.

But the other thing to note here is that in the PC era, most disk
drives ran with write caching enabled, with writeback caching so that
the hard drive could do its own elevator shceduling.  So having a file
system that very carefully scheduled writes to make sure they happened
in the write order didn't help you a *bit* unless you configured your
hard drive to disable writeback caching --- at which point you would
take a massive speed hit.

This is ultimately also one weaknesses of Soft Updates --- it requires
that you disable writeback caching, since it works by letting the OS
control the order in which writes hit stable storage.  With
journalling you don't have to do that; but the tradeoff is that when
you do a journal commit, you need typically two cache flush
operations.  (Or a cache flush followed by a FUA write of the commit
block, if the disk supports FUA.)



There is another example of how Linux embraced the "worse is better"
philosophy in ext3, and that has to do with how we do journalling.
The sophisticated way to do journalling is to do logical journalling.
This is where what you write in the in journal is "set bit XXX in the
allocation bitmap", or "update the mtime to YYYY".  And in this way,
you can batch multiple file system operations into a single block
written to the journal.  Solaris/UFS and Irix uses this much more
sophisticated form of journalling.  (Actually, older versions of
Solaris did use volume-level journalling, which is basically what
ext3/ext4 uses, but they upgraded to the much more "right", more
advanced thing, which is logical journalling.)

Ext3 uses phyiscal, or volume-level journalling.  This journalling
works on the block level --- so if we flip a bit in an allocation
bitmap, we log the entire 4k block to the journal.  By default, we
only do a journal commit every five seconds (unless an fsync happens
first), so there could be multiple changes to a single inode table
blocks that can be batched together, but it's still true that for a
given metadata-heavy workload, a file system which uses logical
journalling will tend require many fewer blocks written to the journal
than a file system such as ext3/ext4 which uses physical block
journalling.

Why did Linux get away with it?  Number one, most workloads aren't
really modify metadata all _that_ intensively, and 12k of sequential
writes versus 32k of sequential writes doesn't actually take that much
more time.  Secondly, Ted's law of PC-class hardware ("most PC-class
hardware is crap") comes into play, and turns physical journalling
into an advantage.  PC class hardware tends not to have power fail
interrupts, and when power drops, and the voltage levels on the power
rails start drooping, DRAM tends to go insane and starts returning
garbage long before the DMA engine and the hard drive stops
functioning.

So if your system is doing logical journalling, after the file system
commits a transaction, it will start writing the inode table block to
the permanent location on disk.  If at that point you get a power
drop, garbage can get written to the inode table block, and if the
file system is using logical journalling, on reboot the mtime field
can get updated from the logical journal --- but the rest of the inode
table block is still garbage.

In contrast, since ext3 was using physical block journalling, even if
various metadata blocks get corrupted due to writes from failing DRAM
during a power drop, when we replay the journal, this will restore the
entire metadata block, and Things Just Worse.

I have talked to an XFS engineer from SGI, and this was definitely a
thing which SGI discovered the hard way.  After they discovered this
problem, they added extra capacitors to the power supply, added a
power fail interrupt, and taught Irix so that when the power fail
interrupt was triggered, it would frantically cancel DMA transfers in
order to avoid this problem.  I do not know how many of the other
Legacy Unix systems figured out this failure mode --- and I can't
claim that we were brilliant enough to design a system to avoid this
problem.  It just so happened that the brute-force design that we
chose was very well suited for crappy (but way cheaper than a Sun Fire
E10k :-) PC-class hardware.

> I copied Ted, who had his fingers deep in that code, maybe he can correct> me where I got it wrong.  Details aside, I think this is a place where> Linux moved the state of the art significantly forward.  There are other> places but this one is a big deal IMHO, maybe the biggest deal.
So I'm not really sure we can claim to have "moved the state of the
art".  There certainly wasn't any brilliant computer science
innovations here.  That sort of thing is more like Soft Updates, of
which Valerie Aurora (formerly Henson) once wrote,

   "I've read this paper at least 15 times, and each time I when get
   to page 7, I'm feeling pretty good and thinking, "Yeah, okay, I
   must be smarter now than the last time I read this because I'm
   getting it this time," - and then I turn to page 8 and my head
   explodes." --- https://lwn.net/Articles/339337/

I will be the first to admit that with ext2/ext3/ext4, especially in
the early days, it was much more about brute force engineering, and
regression testing, and much less about "moving the state of the art".
Certainly those of us who were working on Linux weren't trying to get
papers published in peer reviewed journals or conferences!  (And I've
always thought that Greg Ganger was _way_ smarter than I.  :-)

And if the Lisp Machine hackers looked down on BSD, and complained
that BSD adopted the "Worse is Better" philosophy, while Lisp strived
for the true, elegant, Correct technical solution, it's perhaps
especially interesting to consider that if anything, Linux was an even
more radical example of the "Worse is Better" philosophy.

Cheers,

					- Ted

P.S.  There is yet another example of "Worse is Better" in how Linux
had PCMCIA support several years before FreeBSD/NetBSD.  However, if
you ejected a PCMCiA card in a Linux system, there was a chance (in
practice it worked out to be about in 1 in 5 times for a WiFI card, in
my experience) that the system would crash.  The *BSD's took a good
2-3 years longer to get PCMCIA support, but when they did, it was rock
solid.  Of course, if you are a laptop user, and are happy to keep
your 802.11 PCMCIA card permanently installed, guess which OS you were
likely to prefer --- "sloppy but works, mostly", or "it'll get there
eventually, and will be rock solid when it does, but zip, nada, right now"?


>> --lm>> On Thu, May 11, 2017 at 04:37:29PM -0400, Ron Natalie wrote:>> I remember the pre-fsck days.   It was part of my test to become an operator at the UNIX site at JHU that I could run the various manual checks.>> >> The V6 file system wasn???t exactly stable during crashes (lousy database behavior), so there was almost certainly something to clean up.>> >>  >> >> The first thing we???d run was icheck.   This runs down the superblock freelist and all the allocated blocks in the inodes.     If there were missing blocks (not in a file or the free list), you could use icheck ???s>> >> to rebuild it.    Similarly, if you had duplicated allocations in the freelist or between the freelist and a single file.   Anything more complicated required some clever patching (typically, we???d just mount readonly, copy the files, and then blow them away with clri).>> >>  >> >> Then you???d run dcheck.   As mentioned dcheck walks the directory path from the top of the disk counting inode references that it reconciles with the link count in the inode.   Occasionally we???d end up with a 0-0 inode (no directory entires, but allocated???typically this is caused by people removing a file while it is still open, a regular practice of some programs for their /tmp files.).    clri again blew these away.>> >>  >> >> Clri wrote zeros all over the inode.   This had the effect of wiping out the file, but it was dangerous if you got the i-number wrong.    We replaced it with ???clrm??? which just cleared the allocated bit, a lot easy to reverse.>> >>  >> >> If you really had a mess of a file system, you might get a piece of the directory tree broken off from a path to the root.   Or you???d have an inode that icheck reported dups.   ncheck would try to reconcile an inumber into an absolute path.>> >>  >> >> After a while a program called fsdb came around that allowed you to poke at the various file system structures.    We didn???t use it much because by the time we had it, fsck was fast on its heals.>> >> -- > ---> Larry McVoy            	     lm at mcvoy.com             http://www.mcvoy.com/lm


More information about the TUHS mailing list

How to Improve a Legacy Codebase

$
0
0

It happens at least once in the lifetime of every programmer, project manager or teamleader. You get handed a steaming pile of manure, if you’re lucky only a few million lines worth, the original programmers have long ago left for sunnier places and the documentation - if there is any to begin with - is hopelessly out of sync with what is presently keeping the company afloat.

Your job: get us out of this mess.

After your first instinctive response (run for the hills) has passed you start on the project knowing full well that the eyes of the company senior leadership are on you. Failure is not an option. And yet, by the looks of what you’ve been given failure is very much in the cards. So what to do?

I’ve been (un)fortunate enough to be in this situation several times and me and a small band of friends have found that it is a lucrative business to be able to take these steaming piles of misery and to turn them into healthy maintainable projects. Here are some of the tricks that we employ:

Backup

Before you start to do anything at all make a backup of everything that might be relevant. This to make sure that no information is lost that might be of crucial importance somewhere down the line. All it takes is a silly question that you can’t answer to eat up a day or more once the change has been made. Especially configuration data is susceptible to this kind of problem, it is usually not versioned and you’re lucky if it is taken along in the periodic back-up scheme. So better safe than sorry, copy everything to a very safe place and never ever touch that unless it is in read-only mode.

Important pre-requisite, make sure you have a build process and that it actually produces what runs in production

I totally missed this step on the assumption that it is obvious and likely already in place but many HN commenters pointed this out and they are absolutely right: step one is to make sure that you know what is running in production right now and that means that you need to be able to build a version of the software that is - if your platform works that way - byte-for-byte identical with the current production build. If you can’t find a way to achieve this then likely you will be in for some unpleasant surprises once you commit something to production. Make sure you test this to the best of your ability to make sure that you have all the pieces in place and then, after you’ve gained sufficient confidence that it will work move it to production. Be prepared to switch back immediately to whatever was running before and make sure that you log everything and anything that might come in handy during the - inevitable - post mortem.

Freeze the DB

If at all possible freeze the database schema until you are done with the first level of improvements, by the time you have a solid understanding of the codebase and the legacy code has been fully left behind you are ready to modify the database schema. Change it any earlier than that and you may have a real problem on your hand, now you’ve lost the ability to run an old and a new codebase side-by-side with the database as the steady foundation to build on. Keeping the DB totally unchanged allows you to compare the effect your new business logic code has compared to the old business logic code, if it all works as advertised there should be no differences.

Write your tests

Before you make any changes at all write as many end-to-end and integration tests as you can. Make sure these tests produce the right output and test any and all assumptions that you can come up with about how you think the old stuff works (be prepared for surprises here). These tests will have two important functions: they will help to clear up any misconceptions at a very early stage and they will function as guardrails once you start writing new code to replace old code.

Automate all your testing, if you’re already experienced with CI then use it and make sure your tests run fast enough to run the full set of tests after every commit.

Instrumentation and logging

If the old platform is still available for development add instrumentation. Do this in a completely new database table, add a simple counter for every event that you can think of and add a single function to increment these counters based on the name of the event. That way you can implement a time-stamped event log with a few extra lines of code and you’ll get a good idea of how many events of one kind lead to events of another kind. One example: User opens app, User closes app. If two events should result in some back-end calls those two counters should over the long term remain at a constant difference, the difference is the number of apps currently open. If you see many more app opens than app closes you know there has to be a way in which apps end (for instance a crash). For each and every event you’ll find there is some kind of relationship to other events, usually you will strive for constant relationships unless there is an obvious error somewhere in the system. You’ll aim to reduce those counters that indicate errors and you’ll aim to maximize counters further down in the chain to the level indicated by the counters at the beginning. (For instance: customers attempting to pay should result in an equal number of actual payments received).

This very simple trick turns every backend application into a bookkeeping system of sorts and just like with a real bookkeeping system the numbers have to match, as long as they don’t you have a problem somewhere.

This system will over time become invaluable in establishing the health of the system and will be a great companion next to the source code control system revision log where you can determine the point in time that a bug was introduced and what the effect was on the various counters.

I usually keep these counters at a 5 minute resolution (so 12 buckets for an hour), but if you have an application that generates fewer or more events then you might decide to change the interval at which new buckets are created. All counters share the same database table and so each counter is simply a column in that table.

Change only one thing at the time

Do not fall into the trap of improving both the maintainability of the code or the platform it runs on at the same time as adding new features or fixing bugs. This will cause you huge headaches because you now have to ask yourself every step of the way what the desired outcome is of an action and will invalidate some of the tests you made earlier.

Platform changes

If you’ve decided to migrate the application to another platform then do this first but keep everything else exactly the same. If you want you can add more documentation or tests, but no more than that, all business logic and interdependencies should remain as before.

Architecture changes

The next thing to tackle is to change the architecture of the application (if desired). At this point in time you are free to change the higher level structure of the code, usually by reducing the number of horizontal links between modules, and thus reducing the scope of the code active during any one interaction with the end-user. If the old code was monolithic in nature now would be a good time to make it more modular, break up large functions into smaller ones but leave names of variables and data-structures as they were.

HN user mannykannot points - rightfully - out that this is not always an option, if you’re particularly unlucky then you may have to dig in deep in order to be able to make any architecture changes. I agree with that and I should have included it here so hence this little update. What I would further like to add is if you do both do high level changes and low level changes at least try to limit them to one file or worst case one subsystem so that you limit the scope of your changes as much as possible. Otherwise you might have a very hard time debugging the change you just made.

Low level refactoring

By now you should have a very good understanding of what each module does and you are ready for the real work: refactoring the code to improve maintainability and to make the code ready for new functionality. This will likely be the part of the project that consumes the most time, document as you go, do not make changes to a module until you have thoroughly documented it and feel you understand it. Feel free to rename variables and functions as well as datastructures to improve clarity and consistency, add tests (also unit tests, if the situation warrants them).

Fix bugs

Now you’re ready to take on actual end-user visible changes, the first order of battle will be the long list of bugs that have accumulated over the years in the ticket queue. As usual, first confirm the problem still exists, write a test to that effect and then fix the bug, your CI and the end-to-end tests written should keep you safe from any mistakes you make due to a lack of understanding or some peripheral issue.

Database Upgrade

If required after all this is done and you are on a solid and maintainable codebase again you have the option to change the database schema or to replace the database with a different make/model altogether if that is what you had planned to do. All the work you’ve done up to this point will help to assist you in making that change in a responsible manner without any surprises, you can completely test the new DB with the new code and all the tests in place to make sure your migration goes off without a hitch.

Execute on the roadmap

Congratulations, you are out of the woods and are now ready to implement new functionality.

Do not ever even attempt a big-bang rewrite

A big-bang rewrite is the kind of project that is pretty much guaranteed to fail. For one, you are in uncharted territory to begin with so how would you even know what to build, for another, you are pushing all the problems to the very last day, the day just before you go ‘live’ with your new system. And that’s when you’ll fail, miserably. Business logic assumptions will turn out to be faulty, suddenly you’ll gain insight into why that old system did certain things the way it did and in general you’ll end up realizing that the guys that put the old system together weren’t maybe idiots after all. If you really do want to wreck the company (and your own reputation to boot) by all means, do a big-bang rewrite, but if you’re smart about it this is not even on the table as an option.

So, the alternative, work incrementally

To untangle one of these hairballs the quickest path to safety is to take any element of the code that you do understand (it could be a peripheral bit, but it might also be some core module) and try to incrementally improve it still within the old context. If the old build tools are no longer available you will have to use some tricks (see below) but at least try to leave as much of what is known to work alive while you start with your changes. That way as the codebase improves so does your understanding of what it actually does. A typical commit should be at most a couple of lines.

Release!

Every change along the way gets released into production, even if the changes are not end-user visible it is important to make the smallest possible steps because as long as you lack understanding of the system there is a fair chance that only the production environment will tell you there is a problem. If that problem arises right after you make a small change you will gain several advantages:

  • it will probably be trivial to figure out what went wrong
  • you will be in an excellent position to improve the process
  • and you should immediately update the documentation to show the new insights gained

Use proxies to your advantage

If you are doing web development praise the gods and insert a proxy between the end-users and the old system. Now you have per-url control over which requests go to the old system and which you will re-route to the new system allowing much easier and more granular control over what is run and who gets to see it. If your proxy is clever enough you could probably use it to send a percentage of the traffic to the new system for an individual URL until you are satisfied that things work the way they should. If your integration tests also connect to this interface it is even better.

Yes, but all this will take too much time!

Well, that depends on how you look at it. It’s true there is a bit of re-work involved in following these steps. But it does work, and any kind of optimization of this process makes the assumption that you know more about the system than you probably do. I’ve got a reputation to maintain and I really do not like negative surprises during work like this. With some luck the company is already on the skids, or maybe there is a real danger of messing things up for the customers. In a situation like that I prefer total control and an iron clad process over saving a couple of days or weeks if that imperils a good outcome. If you’re more into cowboy stuff - and your bosses agree - then maybe it would be acceptable to take more risk, but most companies would rather take the slightly slower but much more sure road to victory.

The Judy Malware: Possibly the largest malware campaign found on Google Play

$
0
0

Check Point researchers discovered another widespread malware campaign on Google Play, Google’s official app store. The malware, dubbed “Judy”, is an auto-clicking adware which was found on 41 apps developed by a Korean company. The malware uses infected devices to generate large amounts of fraudulent clicks on advertisements, generating revenues for the perpetrators behind it. The malicious apps reached an astonishing spread between 4.5 million and 18.5 million downloads. Some of the apps we discovered resided on Google Play for several years, but all were recently updated. It is unclear how long the malicious code existed inside the apps, hence the actual spread of the malware remains unknown.

We also found several apps containing the malware, which were developed by other developers on Google Play. The connection between the two campaigns remains unclear, and it is possible that one borrowed code from the other, knowingly or unknowingly. The oldest app of the second campaign was last updated in April 2016, meaning that the malicious code hid for a long time on the Play store undetected. These apps also had a large amount of downloads between 4 and 18 million, meaning the total spread of the malware may have reached between 8.5 and 36.5 million users. Similar to previous malware which infiltrated Google Play, such as FalseGuide and Skinner, Judy relies on the communication with its Command and Control server (C&C) for its operation. After Check Point notified Google about this threat, the apps were swiftly removed from the Play store.

Figure 1: A malicious Judy app on Google Play

How Judy operates:

To bypass Bouncer, Google Play’s protection, the hackers create a seemingly benign bridgehead app, meant to establish connection to the victim’s device, and insert it into the app store. Once a user downloads a malicious app, it silently registers receivers which establish a connection with the C&C server. The server replies with the actual malicious payload, which includes JavaScript code, a user-agent string and URLs controlled by the malware author. The malware opens the URLs using the user agent that imitates a PC browser in a hidden webpage and receives a redirection to another website. Once the targeted website is launched, the malware uses the JavaScript code to locate and click on banners from the Google ads infrastructure.

Upon clicking the ads, the malware author receives payment from the website developer, which pays for the illegitimate clicks and traffic.

The JavaScript code locates the targeted ads by searching for iframes which contain ads from Google ads infrastructure, as shown in the image below:

Figure 2: Searching for iframes containing Google ads

The fraudulent clicks generate a large revenue for the perpetrators, especially since the malware reached a presumably wide spread.

Who is behind Judy?

The malicious apps are all developed by a Korean company named Kiniwini, registered on Google Play as ENISTUDIO corp. The company develops mobile apps for both Android and iOS platforms. It is quite unusual to find an actual organization behind mobile malware, as most of them are developed by purely malicious actors. It is important to note that the activity conducted by the malware is not borderline advertising, but definitely an illegitimate use of the users’ mobile devices for generating fraudulent clicks, benefiting the attackers.

In addition to the clicking activity, Judy displays a large amount of advertisements, which in some cases leave users with no option but clicking on the ad itself. Although most apps have positive ratings, some of the users have noticed and reported Judy’s suspicious activities, as seen in the images below:

Figure 3: Comments made by suspicious users

As seen in previous malware, such as DressCode, a high reputation does not necessarily indicate that the app is safe for use. Hackers can hide their apps’ real intentions or even manipulate users into leaving positive ratings, in some cases unknowingly. Users cannot rely on the official app stores for their safety, and should implement advanced security protections capable of detecting and blocking zero-day mobile malware.

Appendix 1 – list of malicious apps developed by Kiniwini

Package nameApp nameDateMinMax
air.com.eni.FashionJudy061Fashion Judy: Snow Queen style24.3.17100,000500,000
air.com.eni.AnimalJudy013Animal Judy: Persian cat care14.4.17100,000500,000
air.com.eni.FashionJudy056Fashion Judy: Pretty rapper24.3.1750,000100,000
air.com.eni.FashionJudy057Fashion Judy: Teacher style24.3.1750,000100,000
air.com.eni.AnimalJudy009Animal Judy: Dragon care14.4.17100,000500,000
air.com.eni.ChefJudy058Chef Judy: Halloween Cookies10.4.17100,000500,000
air.com.eni.FashionJudy074Fashion Judy: Wedding Party7.4.1750,000100,000
air.com.eni.AnimalJudy036Animal Judy: Teddy Bear care16.4.175,00010,000
air.com.eni.FashionJudy062Fashion Judy: Bunny Girl Style24.3.1750,000100,000
air.com.eni.FashionJudy009Fashion Judy: Frozen Princess7.4.1750,000100,000
air.com.eni.ChefJudy055Chef Judy: Triangular Kimbap10.4.1750,000100,000
air.com.eni.ChefJudy062Chef Judy: Udong Maker – Cook10.4.1710,00050,000
air.com.eni.FashionJudy067Fashion Judy: Uniform style24.3.1710,00050,000
air.com.eni.AnimalJudy006Animal Judy: Rabbit care14.4.17100,000500,000
air.com.eni.FashionJudy052Fashion Judy: Vampire style24.3.17100,000500,000
air.com.eni.AnimalJudy033Animal Judy: Nine-Tailed Fox18.4.17100,000500,000
air.com.eni.ChefJudy059Chef Judy: Jelly Maker – Cook10.4.1750,000100,000
air.com.eni.ChefJudy056Chef Judy: Chicken Maker10.4.1750,000100,000
air.com.eni.AnimalJudy018Animal Judy: Sea otter care14.4.17100,000500,000
air.com.eni.AnimalJudy035Animal Judy: Elephant care16.4.175,00010,000
air.com.eni.JudyHappyHouseJudy’s Happy House10.4.17100,000500,000
air.com.eni.ChefJudy036Chef Judy: Hotdog Maker – Cook29.3.1750,000100,000
air.com.eni.ChefJudy063Chef Judy: Birthday Food Maker10.4.1750,000100,000
air.com.eni.FashionJudy051Fashion Judy: Wedding day20.4.17100,000500,000
air.com.eni.FashionJudy058Fashion Judy: Waitress style24.3.1710,00050,000
air.com.eni.ChefJudy057Chef Judy: Character Lunch10.4.17100,000500,000
air.com.eni.ChefJudy030Chef Judy: Picnic Lunch Maker10.4.175000001000000
air.com.eni.AnimalJudy005Animal Judy: Rudolph care14.4.17100,000500,000
air.com.eni.JudyHospitalBabyJudy’s Hospital:pediatrics10.4.17100,000500,000
air.com.eni.FashionJudy068Fashion Judy: Country style24.3.1710,00050,000
air.com.eni.AnimalJudy034Animal Judy: Feral Cat care16.4.1710,00050,000
air.com.eni.FashionJudy076Fashion Judy: Twice Style20.4.17100,000500,000
air.com.eni.FashionJudy072Fashion Judy: Myth Style20.4.1750,000100,000
air.com.eni.AnimalJudy022Animal Judy: Fennec Fox care14.4.17100,000500,000
air.com.eni.AnimalJudy002Animal Judy: Dog care14.4.17100,000500,000
air.com.eni.FashionJudy049Fashion Judy: Couple Style24.3.17100,000500,000
air.com.eni.AnimalJudy001Animal Judy: Cat care14.4.17100,000500,000
air.com.eni.FashionJudy053Fashion Judy: Halloween style7.4.17100,000500,000
air.com.eni.FashionJudy075Fashion Judy: EXO Style7.4.1750,000100,000
air.com.eni.ChefJudy038Chef Judy: Dalgona Maker28.3.17100,000500,000
air.com.eni.ChefJudy064Chef Judy: ServiceStation Food10.4.171000050000
air.eni.JudySpaSalonJudy’s Spa Salon10.4.171,000,0005,000,000
Total  4,620,00018,420,000

Appendix 2 – list of apps developed by other developers

Package nameApp nameDateMinMaxDeveloper
com.CoupleDday커플디데이 (커플기념일, 위젯)2-Apr-17100,000500,000Neoroid
com.DogSoundDog Music (Relax)29-Jun-1610,00050,000Neoroid
com.kakaotalkchatanalyst.ks카카오톡 대화분석기25-Feb-161,000,0005,000,000DeepEnjoy
com.PeriodCalendar황금기 알리미 (여성달력)20-Apr-16100,000500,000Neoroid
com.MoneyBook100억 가계부2-Apr-17100,000500,000그린 스튜디오
com.lee.katocpicKatocPic(카톡픽) – 카톡프로필23-Aug-165,00010,000Wontime
com.appnapps.app77필수추천 무료어플 775-Feb-171,000,0005,000,000App&Apps
com.sundaybugs.spring.freeSpring-It’s stylish, it’s sexy30-Sep-161,000,0005,000,000Sundaybugs
com.lx5475.craftingbox2Crafting Guide for Minecraft4-May-17500,0001,000,000JIZARD
Total  4,215,00018,060,000 

Appendix 3 – list of SHA256

 

a7e2030649cca0651730d4bea6f9c03200aaa3a0da56f112bf7c5691c172fcde

a649293a9420afdd9c034f74bc501eef645af1ca940346a59d0fc7aef9028dc9

407e92a8c83a1fc9797c7047a5084ffc3ca8616779bd7eb829c1a0210a731356

3803ca279b007f10b9ca1eb5fa329bd87e5b40670805d57031971d7bd6d5fb77

0aba0b966df39f8e0bf5f93955827ea223c1bda4c167232f9805958aa6e66ec0

0f883861ce387f2e6336f68f040a6bb635fe8358b9eb6efe1398f887000a9351

11dc1c54f1c0f08bbc335c22e43f1d27e6ed05261c98facffd0a1c084021caf4

15d34a094515d7044194762650c0b0f77ec546025d555b09dd03c9e2d67532fd

1a652e3d37e6d5a67efff547de111d161c396a5619136244d7f0846558037674

1cd233cfedd87e15953138f82d78140ca4890161271542627e033f11225df181

1db8c76ead84322407d4d112c8ab855f4b4ea414c6e7379fcd1ad03e56fa975c

2117a776609b249436e448def0e6e0bfc5a6b3c176f101ff3f4411f4e2e14584

28785f3acd5f3b75ce9b919cb0549b41e24cf38f729b60f720d989f83406bcc0

37ae2e88dee816d7ed4036dced7b404c98d321de89faaedbbabd00fadfde65fa

3e96f9ff46708e5a70977dfbcfb5e90d3c5b1b6caeee36303c179b724c708be5

4d1503ef789d31047d39efe28e7abae3104e0b7d0ded9bf899fd92f814246718

5e086c84836ed931dd2650f29f27e8b43eaef67bf29b63d0c508fee04e4c339d

5fc2853fc986b1d6c41a99238ada777c188a1f204720760441f577a19d9030b6

71196796b8cc06d1fe563b18d94043905db92bf87309bc2690522198a7795203

744b6d454f70524b0962843551fb05bed8926fcb7e59e19b23fe63cdaf39b78f

79f43d95e7b90b21b6d00ed942327493c54d492103dcb815979d73593c14d14d

92965cb6e0ea88db6603f485dfdfe454ace7e23beda8e598f60b42179e12a926

97b82001836238d74505b83dac900029338ecc66008827ec62de18f6912e0007

99fb35fdcce4f4834780e29196df6e7d27cfa5d5a2d03ea16a4aae6aaec3541c

9c6ca77794bdd03a9ba76cbe8418a83c50261063b47fbd2d51e7c777f74492f1

9e8b51a18c0032fbb2ff84056dc353cafb03335253cf3864735f2b6231f9bcf9

b1629184416c15e00b446a533b552901a871ef923427042f6aa7f5509579c1a8

b8f3493cb2f37d7dca678e675edca280aac388baad8407b596202b2cdfb7d0f2

c2217f8324394c28b49a34f5012e59a6bd2f98c2d036678692c0d12c418ff593

c23cccc0e5b92c0a0971e6e93ee0652e4cc49996d08f9a389090a43620b2d529

d4d5ad8e8457b006c624f1163cd9a6839ff033ee05722eb2fa4693f6ea20ce1b

dcc4d9a47b9a09c705aed50062f99d0a498e62f10a7e615f9c541383bae72515

e2950cee820ee6fe3d879c0d3dfa43fa803475056e09f27f351713bb1630412b

e992e87b56b088a5d3a594388eada8c2573c974c85412bbf863e45027156fe0a

f3cca64c3c38307c013758a764e1001065dbd1a75e0b3b36f4997556740c1303

faedac8eb47265709f58cc6c91e939d149512fbf81f5eddd618dd9a9351d4e8f

4517d503c3d86e3fd25a929c7af705ed729981b900cd96603a36bb1e20abee3f

4c5f2897403fc3e4d2e0028e9becfece17b2613c8a0ec6b84c56ac2bf6baf0b4

d08dd9fd31862fad3e2a19333f74e9bc8dbc5eac0714f3a32c575329c82e3e4b

459e5fdef42d7007524d1ff2856ea5f218303c88d1cd83d00d38f5cf9645ba0f

5258f84d9f8cc4c1dc018e0ea4fbc8a56c1ec49eb934347b76f8d7bbe91f29cc

040e6d65749ab02446bbd012419cb6e00427201b261128df313daa87cea64abb

d5640bb77ed417bbfcd9e409b8653cac29eb78b0f86981fe4662893fd7b4be7c

32262e708e0467f91bbb86ee3c5955a04b942be4fb5561ea1d92332adc0cb79c

210f88eeb00fd3437cbb6de8da01ed6a027bcd5a4cd8865760baf65d4083f252

4d307d5e2783131eae8c8fba619054cdbe683c5cb6cc3401bf04b08d5b68e036

d08f63456fdd97e3b025bd9d0f41a2369fccc8303f3011d86aadde3d38a7caf8

a52a11928075e12de58794e05fd8d6ecafe49358f74b0734d2f1bb214125493f

a6e2e92d02572698b83f083d6b2c9d22073659644b91ca825b5c95cb3a3b892f

90b1ab2cce2cccd1a65b8242c39f778f723adf632122e26a0c10a970cffc73c3

dbb976d4880010e2d267cccda6d3ed745c35ce1c3310d65fe4cc5dab830fe03b

e9c22cfee3b9161c8677fc5f3e4808af845a7251c340ae226057d070551902e1

7968d34cd539d7e947315da9f39f42ccbfb782498a7362346ce83d5e9cacd374

dca641a91aa5600752c2d8f6cd8b751e655e714cd6ea0c8b247cf23bb9e671de

c70f268d549be552832722824c8150b62e0c9f32e08d11442a2c061a97bda131

b6e745d2f947ce521b425047739ecf206be862f5b8cef6118024084996c1ff38

79c574c4a628b8be8f29fd41f76007e303bbf02d609d1e3a62ca6c2ae7083e1d

564fe11fad80ef31ef067f02904d8db8afe636160fb00803537b275eea15bb67

35888a5fc383316c7ad504bf49653d18965aec49eb7cb8dcf2c27a52d4b0e292

f6628943a994b3a654cc2c04dce979a772c312d30cc9b57e7e87ebe355d88d47

2d78f8bc7a3fcf3f45efe96ca136e33ec74678da80d716e3c2c0c5e9fe61219f

24c96ae798113b454b352e672fd3188361edeecde0bdd78ec69abbfe2510c543

c350a7a3d3c9d142fa0f2f7ef7e8a0aeeb937ba684e2c4a14b363b4e3fb2dc44

406469b7d7c061a14dd3ee959d27ff2de7609ffee27556614f9ada55c9b4c105

887da9c7e2a2c5a86f531e8bb3a0a10d77829c6321ba26ab89398212e0516517

82b0441b97597cee80dcdf373bc77f7dd0ea51aca8268135baf31aef83ede4a9

42f03ce06e47ee7562707b666e3780fc260b211bf4b23021761f54598d731fff

4293c15a61b194cbf98c2cbb413e514931ada1a3b241a34e4cfda1b30c191c8a

37a7e7b390014fa314533cff462e733d2491ef50c18834e06ce8df0a2e7cf354

42e2f82baa67172643a0e285eaddc61e0190bee98cb6d11dfa6dc93ad4780d29

d5c0911a90ce75378065af7790ae94a49462b55c57ae71f49b3d1b3ec4a46bed

3974f21d025ff41edc5161b6b115a389509a607a51d47867d7f4bd8eb16a0506

45f3fbc9dea31761d3b0a7ceae28e1858495f5e0f2dd5fef3c1ab9954f2cbc5d

48b36f59091697e8053ec2b7a1b7e1d8ae41a1cd8fe0ebb30ef4cb32aa64cdd6

496445f3b2966b01edfd40458d27e6ecb85737aa035552958d83188069fc6533

3fa06d06ae072af0877bb8f52ff80d26e74153d1cd1b96b0bc0a428491af59d8

30b201ac258b70b9facd77f565c6704c8b99cee000afd2877ac88ffb8e424094

1fad3833e49aee029fad5089deb28301fbf8640fa97fa58452716bdab4f8c610

cd68e747b5f0c143ee006dbd4e545bd80540cfac03290d46416acb756ba2d986

c9aaefb6b3fb1c03b3a41afccc37561537146eefb51f7d498fbdad55bf2a8ff1

d180f55c5f9f8b6557d485ae8d09a31a52a6f827e8b41551fea9d07ff6b17739

6a26e97cf849e8631e2f6cf92f1c8839755a213cdd2b6ee500b640e38d73fc5c

434382ae159c0080dbd7dbb8c20a1ad842ab127c3f09f58bf6ef5547497dbca7

a76633d89e8dd4833c12be91175ee4af5744e9a4edc873a1349dd5be39bbac2d

83d97489848532aaad58df7d74a5ffc36ae0aad89196be99c4d6b0dcb350ed1a

bd45a96672a5dbd35a99ee3c9e12bacb99715771c59dc7071a0eaa1fcbdb379f

f9f1fbe3b68c1c465c781c33dd7b155f491444cdfa337b7f472bc03b86878361

b7121de02f2a5fe031988382ccad0a277f50fac7e27c006f1ca15e91973f6a78

39d54257f158b9b47f6d82e9e6f2427cfa4b629f355623930fa0627f59409ca3

501e81f133aedd99a8499182b5823efbbc3d5865f83c4c1de4fdbfa085924fc6

adca05fded0f8203fb79a3aaf7d33b6dbf80936f32c676f8f8bfef55103f6d6c

3c8caaee546077f1f477caa4492dd136c4c7b1884903a2065406b39877617689

f94022043e53ae7f89294a572fb66fe11ede2327547e5bcfdbec776e96fbef89

0cd304c9ff806002d9a763e0351e37e81493e723166e471c6bb8ff2acde29f43

4e62e6a4193ab91ce6630307fb62dd5d021251d206f09138aef4cb028b5aa0c8

adfc6449c4b7035b0a22d92d21dbdffde70b1eda0bf04b755a84ec47bc3965b7

fe571038b3457bc79669b5ade54223a03ab8bc85380f18f162f8df2ba83d08b2

fcbcfb6b2c31062008f7ec5efd363b532295790aa2c22220dfb21ab1e1db32f7

5600a01296c01d0059bc2db6eccf7b0079fdfb094cd8b1065d261f7a67e51b78

1f3a6a5e2a56ec8ad1afe22b5909e052b6085084b0a97076cf0697b9f854459b

5bf386540b73f41b76e68058f410094a7721d4cb1012cbeff0a49d96907a2c8f

f60eea8b71c6d95488b1a7ae93524471b7f8d5eeb7f14431be42d1956cd3338c

205ec303d5c7b2377ebef257cbfc0f21c8066e6b789f4cdf5eb3a97021586d5d

841a1950bea9acad0a6871026fb8e003b7eeecd3a8b73f2ca1e51aaec814fb2d

9488ea858098e67f7a70afca4c0aeb68e165f3db5fe1431bfd14cdd943620899

ce890aa7ff83d3b05ccb2b4cfc411d73fad7552d616d5ed950bb53072a7a4e62

1a8814ab87718639dd6603795b0155132e4b60117a9b310c1b85a548116ff446

51b650cb4160bf78637acc6b22c0996bbe1068688f20994bb8a9c7e1c4462a37

037bbd9f907338e0db3872a8ea5ba79b900368790b92885ddd8a350cc2b275a9

be7759dcb501880c63b45c61578dfd67d4014589581f2f43d1666ba38c1e63dd

92a72f36c1fce30fcf1b14e14ba868c4848b9f78d68c33ff8033f32f5f5f96fc

bcc39545c42276594a78c517e452befc5438ec93c92abc568c426677da0c684a

0b07e6dc9b5855833630bf45533320c8a2a8fdd685e9f3e0ebe62d502a391980

4ded00a4d12c4a045b681823182274a93b706b3c72f9905716b94cf03e954d02

ad56d33051d3ed4068c95e2033a3630504f3feb8bf96d3424785e697e57c0eb5

959b8403e989cd0a6d994906a09d9d210914c46d9ee10c8ee03c1fc2c6657e06

26f4ff8969543cac41b0c9a63c15f90fd4697a1f110a8df90c5f1fd9d1860d0e

0efd2d97dbe61bd9b5951180ae8979c01ef2e3bd0184dcdf850e11781531e5a4

15e5bf87fe854b3a1ecf0e8446cd39ceda429d6b6e7d78f2f78fbfea7eb5959c

Damn Cool Algorithms: Log structured storage (2009)

$
0
0

Typically, if you're designing a storage system - such as a filesystem, or a database - one of your major concerns is how to store the data on disk. You have to take care of allocating space for the objects to be stored, as well as storing the indexing data; you have to worry about what happens when you want to extend an existing object (eg, appending to a file), and you have to take care of fragmentation, which happens when old objects are deleted, and new ones take their place. All of this adds up to a lot of complexity, and the solutions are often buggy or inefficient.

Log structured storage is a technique that takes care of all of these issues. It originated as Log Structured File Systems in the 1980s, but more recently it's seeing increasing use as a way to structure storage in database engines. In its original filesystem application, it suffers from some shortcomings that have precluded widespread adoption, but as we'll see, these are less of an issue for database engines, and Log Structured storage brings additional advantages for a database engine over and above easier storage management.

The basic organization of a log structured storage system is, as the name implies, a log - that is, an append-only sequence of data entries. Whenever you have new data to write, instead of finding a location for it on disk, you simply append it to the end of the log. Indexing the data is accomplished by treating the metadata the same way: Metadata updates are also appended to the log. This may seem inefficient, but disk-based index structures such as B-Trees are typically very broad, so the number of index nodes we need to update with each write is generally very small. Let's look at a simple example. We'll start off with a log containing only a single item of data, and an index node that references it:

So far so good. Now, suppose we want to add a second element. We append the new element to the end of the log, then we update the index entry, and append the updated version of that to the log, too:

The original index entry (A) is still in the logfile, but it's no longer used: It's been replaced by the new entry, A', which refers to the original, unmodified copy of Foo, as well as the new entry, Bar. When something wants to read our filesystem, it finds the root node of the index, and uses it as it would in any other system using disk-based indexing.

Finding the root of the index warrants a quick aside. The naive approach would simply be to look at the last block in the log, since the last thing we write is always the root of the index. However, this isn't ideal, as it's possible that at the time you try to read the index, another process is halfway through appending to the log. We can avoid this by having a single block - say, at the start of the logfile - that contains a pointer to the current root node. Whenever we update the log, we rewrite this first entry to ensure it points to the new root node. For brevity, we haven't shown this in the diagrams.

Next, let's examine what happens when we update an element. Say we modify Foo:

We started by writing an entirely new copy of Foo to the end of the log. Then, we again updated the index nodes (only A' in this example) and wrote them to the end of the log as well. Once again, the old copy of Foo remains in the log; it's just no longer referenced by the updated index.

You've probably realised that this system isn't sustainable indefinitely. At some point, we are going to run out of storage space, with all this old data sitting around taking up space. In a filesystem, this is dealt with by treating the disk as a circular buffer, and overwriting old log data. When this happens, data that is still valid simply gets appended to the log again as if it was freshly written, which frees up the old copy to be overwritten.

In a regular filesystem, this is where one of the shortcomings I mentioned earlier rears its ugly head. As the disk gets fuller, the filesystem needs to spend more and more of its time doing garbage collection, and writing data back to the head of the log. By the time you reach 80% full, your filesystem practically grinds to a halt.

If you're using log structured storage for a database engine, however, this isn't a problem! We're implementing this on top of a regular filesystem, so we can make use of it to make our life easier. If we split the database into multiple fixed-length chunks, then when we need to reclaim some space, we can pick a chunk, rewrite any still active data, and delete the chunk. The first segment in our example above is beginning to look a bit sparse, so let's do that:

All we did here was to take the existing copy of 'Bar' and write it to the end of the log, followed by the updated index node(s), as described above. Now that we've done that, the first log segment is entirely empty, and can be deleted.

This approach has several advantages over the filesystem's approach. For a start, we're not restricted to deleting the oldest segment first: If an intermediate segment is nearly empty, we can choose to garbage collect that, instead. This is particularly useful for databases that have some data that stays around for an extended time, and some data that gets overwritten repeatedly: We don't want to waste too much time rewriting the same unmodified data. We also have some more flexibility about when to garbage collect: we can usually wait until a segment is mostly obsolete before garbage collecting it, further minimising the amount of extra work we have to do.

The advantages of this approach for a database don't end there, though. In order to maintain transactional consistency, databases typically use a "Write Ahead Log", or WAL. When a database wants to persist a transaction to disk, it first writes all the changes to the WAL, flushes those to disk, then updates the actual database files. This allows it to recover from a crash by 'replaying the changes recorded in the WAL. If we use log structured storage, however, the Write Ahead Log is the database file, so we only need to write data once. In a recovery situation, we simply open the database, start at the last recorded index header, and search forward linearly, reconstructing any missing index updates from the data as we go.

Taking advantage of our recovery scheme from above, we can further optimise our writes, too. Instead of writing the updated index nodes with every write, we can cache them in memory, and only write them out to disk periodically. Our recovery mechanism will take care of reconstructing things in a crash, as long as we provide it some way to distinguish completed transactions from incomplete ones.

Backups are also easier with this approach: We can continuously, incrementally back up our database by copying each new log segment to backup media as it is completed. To restore, we just run the recovery process again.

One final major advantage to this system relates to concurrency and transactional semantics in databases. In order to provide transactional consistency, most databases use complex systems of locks to control which processes can update data at what times. Depending on the level of consistency required, this can involve readers taking out locks to make sure data is not modified while they are reading it, as well as writers locking data for write, and can cause significant performance degradation even with relatively low write rates, if enough concurrent reads are occurring.

We can beat this with Multiversion Concurrency Control, or MVCC. Whenever a node wants to read from the database, it looks up the current root index node, and uses that node for the remainder of its transaction. Because existing data is never modified in a log-based storage system, the process now has a snapshot of the database at the time it grabbed the handle: Nothing a concurrent transaction can do will affect its view of the database. Just like that, we have lock-free reads!

When it comes to writing data back, we can make use of Optimistic concurrency. In a typical read-modify-write cycle, we first perform our read operations, as described above. Then, to write our changes, we take the write lock for the database, and verify that none of the data we read in the first phase has been modified. We can do this quickly, by looking at the index, and checking if the address for the data we care about is the same as when we last looked. If it's the same, no writes have occurred, and we can proceed with modifying it ourselves. If it's different, a conflicting transaction occurred, and we simply roll back and start again with the read phase.

With me singing its praises so loudly, you may be wondering what systems already use this algorithm. There are surprisingly few that I'm aware of, but here's a few notable ones:

  • Although the original Berkeley DB uses a fairly standard architecture, the Java port, BDB-JE uses all of the components we just described.
  • CouchDB uses the system just described, except that instead of dividing logs into segments and garbage collecting them, it rewrites its entire database when enough stale data accumulates.
  • PostgreSQL uses MVCC, and its writeahead logs are structured so as to permit the incremental backup approach we described.
  • The App Engine datastore is based on Bigtable, which takes a different approach to on-disk storage, but the transactional layer uses optimistic concurrency.

If you know of other database systems that use the ideas detailed in this post, let us know in the comments!

blog comments powered by

Node v8.0.0 Released

$
0
0

The next major release of Node.js brings a range of significant changes and additions, far too many for us to cover adequately in a blog post such as this. This article contains a summary of the most significant changes and features.

npm, Inc. recentlyannounced the release of version 5.0.0 of the npm client and we are happy to include this significant new version within Node.js 8.0.0.

Node.js 8.0.0 ships with V8 5.8, a significant update to the JavaScript runtime that includes major improvements in performance and developer facing APIs. Most significant for Node.js developers is the fact that V8 5.8 is guaranteed to have forwards ABI compatibility with V8 5.9 and the upcoming V8 6.0, which will help to ensure stability of the Node.js native addon ecosystem. During Node.js 8's lifetime, we plan to move to 5.9 and possibly even 6.0.

The V8 5.8 engine also helps set up a pending transition to the newTurboFan + Ignition compiler pipeline, which promises to provide significant new performance optimizations for all Node.js applications. Although they have existed in previous versions of V8, TurboFan and Ignition will be enabled by default for the first time in V8 5.9. The new compiler pipeline represents such a significant change that the Node.js Core Technical Committee (CTC) chose to postpone the Node.js 8 release, originally scheduled for April, in order to better accommodate it.

For Node.js developers who use or create native addons, the new experimental Node.js API (N-API) is a significant advancement over the existingNative Abstractions for Node.js (nan) that will allow native addons to be compiled once on a system and used across multiple versions of Node.js.

By providing a new virtual machine agnostic Application Binary Interface (ABI), it becomes possible for native addons to work not only against multiple versions of the V8 JavaScript runtime, but Microsoft's Chakra-Core runtime as well.

The N-API is experimental in Node.js 8.0.0, so significant changes in the implementation and API should be expected. Native addon developers areencouraged to begin working with the API as soon as possible and to provide feedback that will be necessary to ensure that the new API meets the needs of the ecosystem.

The experimental async_hooks module (formerly async_wrap) has received a major upgrade in 8.0.0. This diagnostics API allows developers a means of monitoring the operation of the Node.js event loop, tracking asynchronous requests and handles through their complete lifecycle.Complete documentation for the new module is still incomplete and users should take great care when using the experimental new module.

An experimental URL API implemented around theWHATWG URL Standard was added to Node.js 7.x last year and has been under active development ever since. We are excited to announce that as of 8.0.0, the new URL implementation is now a fully supported, non-experimental API within Node.js. An example usage is shown below, with more details available in theofficial documentation.

const URL =require('url').URL;const myUrl =newURL('/a/path','https://example.org/');

This new URL implementation is most significant in that it matches the URL implementation and API available in modern Web Browsers like Chrome, Firefox, Edge, and Safari, allowing code using URLs to be shared across environments.

A number of important changes have been made to the Buffer API within Node.js. Most significant is the fact that calling the deprecated Buffer(num) constructor (with or without the new keyword) will return a zero-filledBuffer instance. Prior versions of Node.js would return uninitialized memory, which could contain potentially sensitive data.

In Node.js 6.0.0, a new set of Buffer construction methodswere introduced as an alternative to calling the Buffer(num) constructor in order to address a number of security and usability concerns. The existing constructor, however, is used extensively throughout the Node.js ecosystem, making it infeasible for us to fully deprecate or disable it without causing significant breakage.

Zero-filling new instances of Buffer(num) by default will have a significant impact on performance. Developers should move to the newBuffer.allocUnsafe(num) API if they wish to allocate Buffer instances with uninitialized memory. Examples of zero-filled and uninitialized Buffer creation in Node.js 8 are shown below.

const safeBuffer1 = Buffer.alloc(10);const safeBuffer2 =newBuffer(10);const unsafeBuffer = Buffer.allocUnsafe(10);

Note that while there are no current plans to remove the Buffer(num) constructor from Node.js, its continued use is deprecated.

To make it easier to catch uses of Buffer(num) within an application at development time or within CI testing environments, a new--pending-deprecation command-line flag and matchingNODE_PENDING_DEPRECATION=1 environment variable have been added that will cause Node.js to emit DeprecationWarning process warnings when Buffer(num) (and other potential pending deprecations) are used. These are off by default in order to keep such deprecations from impacting production applications. An example which enables pending deprecations is shown below.

$ ./node --pending-deprecation> Buffer(num)<Buffer 00>> (node:2896) [DEP0005] DeprecationWarning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead.

Node.js 8.0.0 includes a new util.promisify() API that allows standard Node.js callback style APIs to be wrapped in a function that returns a Promise. An example use of util.promisify() is shown below.

const fs =require('fs');const util =require('util');const readfile = util.promisify(fs.readFile);readfile('/some/file').then((data)=>{}).catch((err)=>{});

console.log(), console.error() and other methods available through theconsole module in Node.js allow application output to be directed either tostdout, stderr or pipes. Previously, errors that occurred while attempting to write console output to the underlying stream would cause the Node.js application to crash. Starting with 8.0.0 such errors will be silently ignored, making use of console.log() and the other APIs safer. It will be possible to maintain legacy behavior related to errors via an ignoreErrors option passed to the Console constructor.

We have started the process of assigning static error codes to all errors generated by Node.js. While it will take some time for every error to be assigned a code, a handful have been updated within 8.0.0. These error codes are guaranteed not to change even if the error type or message changes.

Codes are manifest to the user in two ways:

  • Using the code property on Error object instances
  • Printing the [ERR_CODE] in the stack trace of an Error

For instance, calling assert(false) will generate the followingAssertionError:

>assert(false)
AssertionError [ERR_ASSERTION]:false==true
    at repl:1:1
    at ContextifyScript.Script.runInThisContext (vm.js:44:33)
    at REPLServer.defaultEval (repl.js:239:29)
    at bound (domain.js:301:14)
    at REPLServer.runBound [as eval](domain.js:314:12)
    at REPLServer.onLine (repl.js:433:10)
    at emitOne (events.js:120:20)
    at REPLServer.emit (events.js:210:7)
    at REPLServer.Interface._onLine (readline.js:278:10)
    at REPLServer.Interface._line (readline.js:625:8)

Information for static error codes can be queried quickly by referencing the Node.js documentation. For instance, the URL to lookup information about theERR_ASSERTION error code ishttps://nodejs.org/dist/latest-v7.x/docs/api/errors.html#ERR_ASSERTION.

Processing warnings such as deprecations may now to redirected to a file by using either the --redirect-warnings={file} command line argument or matchingNODE_REDIRECT_WARNINGS={file} environment variable. Rather than printing warnings out to stderr by default, warnings will be written out to the specified file, allowing those to be analyzed separately from an application's primary output.

For users of the Stream API, new standard mechanisms for destroying and finalizing Stream instances have been added. Every Stream instance will now inherit a destroy() method, the implementation of which can be customized and extended by providing a custom implementation of the _destroy() method.

The legacy command line debugger is being removed in Node.js 8. As a command line replacement, node-inspect has been integrated directly into the Node.js runtime. Additionally, the V8 Inspector debugger, which arrived previously as an experimental feature in Node.js 6, is being upgraded to a fully supported feature.

A new experimental JavaScript API for the Inspector protocol has been introduced enabling developers new ways of leveraging the debug protocol to inspect running Node.js processes.

const inspector =require('inspector');const session =newinspector.Session();
session.connect();


session.on('inspectorNotification',(message)=>{});


session.post(message);

session.disconnect();

Note that the inspector API is experimental and may change significantly.

Node.js 8 is the next release line to enter Long Term Support (LTS). This is scheduled to happen in October 2017. Once Node.js 8 transitions to LTS, it will receive the code name Carbon.

Node.js Long Term Support Schedule

Note that, when referring to Node.js release versions, we have dropped the "v" in Node.js 8. Previous versions were commonly referred to as v0.10, v0.12, v4, v6, etc. In order to avoid confusion with V8, the underlying JavaScript engine, we've dropped the "v" and call it Node.js 8.

  • Async Hooks

  • Buffer

    • Using the --pending-deprecation flag will cause Node.js to emit a deprecation warning when using new Buffer(num) or Buffer(num). [d2d32ea5a2]#11968.
    • new Buffer(num) and Buffer(num) will zero-fill new Buffer instances [7eb1b4658e]#12141.
    • Many Buffer methods now accept Uint8Array as input [beca3244e2]#10236.
  • Child Process

  • Console

    • Error events emitted when using console methods are now supressed. [f18e08d820]#9744.
  • Dependencies

  • Domains

  • Errors

    • We have started assigning static error codes to errors generated by Node.js. This has been done through multiple commits and is still a work in progress.
  • File System

  • HTTP

  • Lib

  • N-API

  • Process

    • Process warning output can be redirected to a file using the--redirect-warnings command-line argument [03e89b3ff2]#10116.
    • Process warnings may now include additional detail [dd20e68b0f]#12725.
  • REPL

  • Src

    • NODE_MODULE_VERSION has been updated to 57 (https://github.com/nodejs/node/commit/ec7cbaf266)]#12995.
    • Add --pending-deprecation command-line argument andNODE_PENDING_DEPRECATION environment variable [a16b570f8c]#11968.
    • The --debug command-line argument has been deprecated. Note that using --debug will enable the new Inspector-based debug protocol as the legacy Debugger protocol previously used by Node.js has been removed. [010f864426]#12949.
    • Throw when the -c and -e command-line arguments are used at the same time [a5f91ab230]#11689.
    • Throw when the --use-bundled-ca and --use-openssl-ca command-line arguments are used at the same time. [8a7db9d4b5]#12087.
  • Stream

  • TLS

    • The rejectUnauthorized option now defaults to true [348cc80a3c]#5923.
    • The tls.createSecurePair() API now emits a runtime deprecation [a2ae08999b]#11349.
    • A runtime deprecation will now be emitted when dhparam is less than 2048 bits [d523eb9c40]#11447.
  • URL

    • The WHATWG URL implementation is now a fully-supported Node.js API [d080ead0f9]#12710.
  • Util

  • Zlib

  • [e48d58b8b2] - (SEMVER-MAJOR)assert: fix AssertionError, assign error code (James M Snell) #12651
  • [758b8b6e5d] - (SEMVER-MAJOR)assert: improve assert.fail() API (Rich Trott) #12293
  • [6481c93aef] - (SEMVER-MAJOR)assert: add support for Map and Set in deepEqual (Joseph Gentle) #12142
  • [efec14a7d1] - (SEMVER-MAJOR)assert: enforce type check in deepStrictEqual (Joyee Cheung) #10282
  • [562cf5a81c] - (SEMVER-MAJOR)assert: fix premature deep strict comparison (Joyee Cheung) #11128
  • [0af41834f1] - (SEMVER-MAJOR)assert: fix misformatted error message (Rich Trott) #11254
  • [190dc69c89] - (SEMVER-MAJOR)benchmark: add parameter for module benchmark (Brian White) #10789
  • [b888bfe81d] - (SEMVER-MAJOR)benchmark: allow zero when parsing http req/s (Brian White) #10558
  • [f53a6fb48b] - (SEMVER-MAJOR)benchmark: add http header setting scenarios (Brian White) #10558
  • [d2d32ea5a2] - (SEMVER-MAJOR)buffer: add pending deprecation warning (James M Snell) #11968
  • [7eb1b4658e] - (SEMVER-MAJOR)buffer: zero fill Buffer(num) by default (James M Snell) #12141
  • [682573c11d] - (SEMVER-MAJOR)buffer: remove error for malformatted hex string (Rich Trott) #12012
  • [9a0829d728] - (SEMVER-MAJOR)buffer: stricter argument checking in toString (Nikolai Vavilov) #11120
  • [beca3244e2] - (SEMVER-MAJOR)buffer: allow Uint8Array input to methods (Anna Henningsen) #10236
  • [3d353c749c] - (SEMVER-MAJOR)buffer: consistent error for length > kMaxLength (Joyee Cheung) #10152
  • [bf5c309b5e] - (SEMVER-MAJOR)build: fix V8 build on FreeBSD (Michaël Zasso) #12784
  • [a1028d5e3e] - (SEMVER-MAJOR)build: remove cares headers from tarball (Gibson Fahnestock) #10283
  • [d08836003c] - (SEMVER-MAJOR)build: build an x64 build by default on Windows (Nikolai Vavilov) #11537
  • [92ed1ab450] - (SEMVER-MAJOR)build: change nosign flag to sign and flips logic (Joe Doyle) #10156
  • [97a77288ce] - (SEMVER-MAJOR)child_process: improve ChildProcess validation (cjihrig) #12348
  • [a9111f9738] - (SEMVER-MAJOR)child_process: minor cleanup of internals (cjihrig) #12348
  • [d75fdd96aa] - (SEMVER-MAJOR)child_process: improve killSignal validations (Sakthipriyan Vairamani (thefourtheye)) #10423
  • [4cafa60c99] - (SEMVER-MAJOR)child_process: align fork/spawn stdio error msg (Sam Roberts) #11044
  • [3268863ebc] - (SEMVER-MAJOR)child_process: add string shortcut for fork stdio (Javis Sullivan) #10866
  • [8f3ff98f0e] - (SEMVER-MAJOR)child_process: allow Infinity as maxBuffer value (cjihrig) #10769
  • [627ecee9ed] - (SEMVER-MAJOR)child_process: support Uint8Array input to methods (Anna Henningsen) #10653
  • [fc7b0dda85] - (SEMVER-MAJOR)child_process: improve input validation (cjihrig) #8312
  • [49d1c366d8] - (SEMVER-MAJOR)child_process: remove extra newline in errors (cjihrig) #9343
  • [f18e08d820] - (SEMVER-MAJOR)console: do not emit error events (Anna Henningsen) #9744
  • [a8f460f12d] - (SEMVER-MAJOR)crypto: support all ArrayBufferView types (Timothy Gu) #12223
  • [0db49fef41] - (SEMVER-MAJOR)crypto: support Uint8Array prime in createDH (Anna Henningsen) #11983
  • [443691a5ae] - (SEMVER-MAJOR)crypto: fix default encoding of LazyTransform (Lukas Möller) #8611
  • [9f74184e98] - (SEMVER-MAJOR)crypto: upgrade pbkdf2 without digest to an error (James M Snell) #11305
  • [e90f38270c] - (SEMVER-MAJOR)crypto: throw error in CipherBase::SetAutoPadding (Kirill Fomichev) #9405
  • [1ef401ce92] - (SEMVER-MAJOR)crypto: use check macros in CipherBase::SetAuthTag (Kirill Fomichev) #9395
  • [7599b0ef9d] - (SEMVER-MAJOR)debug: activate inspector with _debugProcess (Eugene Ostroukhov) #11431
  • [549e81bfa1] - (SEMVER-MAJOR)debugger: remove obsolete _debug_agent.js (Rich Trott) #12582
  • [3c3b36af0f] - (SEMVER-MAJOR)deps: upgrade npm beta to 5.0.0-beta.56 (Kat Marchán) #12936
  • [6690415696] - (SEMVER-MAJOR)deps: cherry-pick a927f81c7 from V8 upstream (Anna Henningsen) #11752
  • [60d1aac8d2] - (SEMVER-MAJOR)deps: update V8 to 5.8.283.38 (Michaël Zasso) #12784
  • [b7608ac707] - (SEMVER-MAJOR)deps: cherry-pick node-inspect#43 (Ali Ijaz Sheikh) #11441
  • [9c9e2d7f4a] - (SEMVER-MAJOR)deps: backport 3297130 from upstream V8 (Michaël Zasso) #11752
  • [07088e6fc1] - (SEMVER-MAJOR)deps: backport 39642fa from upstream V8 (Michaël Zasso) #11752
  • [8394b05e20] - (SEMVER-MAJOR)deps: cherry-pick c5c570f from upstream V8 (Michaël Zasso) #11752
  • [fcc58bf0da] - (SEMVER-MAJOR)deps: cherry-pick a927f81c7 from V8 upstream (Anna Henningsen) #11752
  • [83bf2975ec] - (SEMVER-MAJOR)deps: cherry-pick V8 ValueSerializer changes (Anna Henningsen) #11752
  • [c459d8ea5d] - (SEMVER-MAJOR)deps: update V8 to 5.7.492.69 (Michaël Zasso) #11752
  • [7c0c7baff3] - (SEMVER-MAJOR)deps: fix gyp configuration for v8-inspector (Michaël Zasso) #10992
  • [00a2aa0af5] - (SEMVER-MAJOR)deps: fix gyp build configuration for Windows (Michaël Zasso) #10992
  • [b30ec59855] - (SEMVER-MAJOR)deps: switch to v8_inspector in V8 (Ali Ijaz Sheikh) #10992
  • [7a77daf243] - (SEMVER-MAJOR)deps: update V8 to 5.6.326.55 (Michaël Zasso) #10992
  • [c9e5178f3c] - (SEMVER-MAJOR)deps: hide zlib internal symbols (Sam Roberts) #11082
  • [2739185b79] - (SEMVER-MAJOR)deps: update V8 to 5.5.372.40 (Michaël Zasso) #9618
  • [f2e3a670af] - (SEMVER-MAJOR)dgram: convert to using internal/errors (Michael Dawson) #12926
  • [2dc1053b0a] - (SEMVER-MAJOR)dgram: support Uint8Array input to send() (Anna Henningsen) #11985
  • [32679c73c1] - (SEMVER-MAJOR)dgram: improve signature of Socket.prototype.send (Christopher Hiller) #10473
  • [5587ff1ccd] - (SEMVER-MAJOR)dns: handle implicit bind DNS errors (cjihrig) #11036
  • [eb535c5154] - (SEMVER-MAJOR)doc: deprecate vm.runInDebugContext (Josh Gavant) #12243
  • [75c471a026] - (SEMVER-MAJOR)doc: drop PPC BE from supported platforms (Michael Dawson) #12309
  • [86996c5838] - (SEMVER-MAJOR)doc: deprecate private http properties (Brian White) #10941
  • [3d8379ae60] - (SEMVER-MAJOR)doc: improve assert.md regarding ECMAScript terms (Joyee Cheung) #11128
  • [d708700c68] - (SEMVER-MAJOR)doc: deprecate buffer's parent property (Sakthipriyan Vairamani (thefourtheye)) #8332
  • [03d440e3ce] - (SEMVER-MAJOR)doc: document buffer.buffer property (Sakthipriyan Vairamani (thefourtheye)) #8332
  • [f0b702555a] - (SEMVER-MAJOR)errors: use lazy assert to avoid issues on startup (James M Snell) #11300
  • [251e5ed8ee] - (SEMVER-MAJOR)errors: assign error code to bootstrap_node created error (James M Snell) #11298
  • [e75bc87d22] - (SEMVER-MAJOR)errors: port internal/process errors to internal/errors (James M Snell) #11294
  • [76327613af] - (SEMVER-MAJOR)errors, child_process: migrate to using internal/errors (James M Snell) #11300
  • [1c834e78ff] - (SEMVER-MAJOR)errors,test: migrating error to internal/errors (larissayvette) #11505
  • [2141d37452] - (SEMVER-MAJOR)events: update and clarify error message (Chris Burkhart) #10387
  • [221b03ad20] - (SEMVER-MAJOR)events, doc: check input in defaultMaxListeners (DavidCai) #11938
  • [eed87b1637] - (SEMVER-MAJOR)fs: (+/-)Infinity and NaN invalid unixtimestamp (Luca Maraschi) #11919
  • [71097744b2] - (SEMVER-MAJOR)fs: more realpath*() optimizations (Brian White) #11665
  • [6a5ab5d550] - (SEMVER-MAJOR)fs: include more fs.stat*() optimizations (Brian White) #11665
  • [1c3df96570] - (SEMVER-MAJOR)fs: replace regexp with function (Brian White) #10789
  • [34c9fc2e4e] - (SEMVER-MAJOR)fs: avoid multiple conversions to string (Brian White) #10789
  • [21b2440176] - (SEMVER-MAJOR)fs: avoid recompilation of closure (Brian White) #10789
  • [7a55e34ef4] - (SEMVER-MAJOR)fs: runtime deprecation for fs.SyncWriteStream (James M Snell) #10467
  • [b1fc7745f2] - (SEMVER-MAJOR)fs: avoid emitting error EBADF for double close (Matteo Collina) #11225
  • [3c2a9361ff] - (SEMVER-MAJOR)fs: remove fs.read's string interface (Nikolai Vavilov) #9683
  • [f3cf8e9808] - (SEMVER-MAJOR)fs: do not pass Buffer when toString() fails (Brian White) #9670
  • [85a4e25775] - (SEMVER-MAJOR)http: add type checking for hostname (James M Snell) #12494
  • [90403dd1d0] - (SEMVER-MAJOR)http: should support userland Agent (fengmk2) #11567
  • [d3480776c7] - (SEMVER-MAJOR)http: concatenate outgoing Cookie headers (Brian White) #11259
  • [6b2cef65c9] - (SEMVER-MAJOR)http: append Cookie header values with semicolon (Brian White) #11259
  • [8243ca0e0e] - (SEMVER-MAJOR)http: reuse existing StorageObject (Brian White) #10941
  • [b377034359] - (SEMVER-MAJOR)http: support old private properties and function (Brian White) #10941
  • [940b5303be] - (SEMVER-MAJOR)http: use Symbol for outgoing headers (Brian White) #10941
  • [fb71ba4921] - (SEMVER-MAJOR)http: docs-only deprecation of res.writeHeader() (James M Snell) #11355
  • [a4bb9fdb89] - (SEMVER-MAJOR)http: include provided status code in range error (cjihrig) #11221
  • [fc7025c9c0] - (SEMVER-MAJOR)http: throw an error for unexpected agent values (brad-decker) #10053
  • [176cdc2823] - (SEMVER-MAJOR)http: misc optimizations and style fixes (Brian White) #10558
  • [73d9445782] - (SEMVER-MAJOR)http: try to avoid lowercasing incoming headers (Brian White) #10558
  • [c77ed327d9] - (SEMVER-MAJOR)http: avoid using object for removed header status (Brian White) #10558
  • [c00e4adbb4] - (SEMVER-MAJOR)http: optimize header storage and matching (Brian White) #10558
  • [ec8910bcea] - (SEMVER-MAJOR)http: check statusCode early (Brian White) #10558
  • [a73ab9de0d] - (SEMVER-MAJOR)http: remove pointless use of arguments (cjihrig) #10664
  • [df3978421b] - (SEMVER-MAJOR)http: verify client method is a string (Luca Maraschi) #10111
  • [90476ac6ee] - (SEMVER-MAJOR)lib: remove _debugger.js (Ben Noordhuis) #12495
  • [3209a8ebf3] - (SEMVER-MAJOR)lib: ensure --check flag works for piped-in code (Teddy Katz) #11689
  • [c67207731f] - (SEMVER-MAJOR)lib: simplify Module._resolveLookupPaths (Brian White) #10789
  • [28dc848e70] - (SEMVER-MAJOR)lib: improve method of function calling (Brian White) #10789
  • [a851b868c0] - (SEMVER-MAJOR)lib: remove sources of permanent deopts (Brian White) #10789
  • [62e96096fa] - (SEMVER-MAJOR)lib: more consistent use of module.exports = {} model (James M Snell) #11406
  • [88c3f57cc3] - (SEMVER-MAJOR)lib: refactor internal/socket_list (James M Snell) #11406
  • [f04387e9f2] - (SEMVER-MAJOR)lib: refactor internal/freelist (James M Snell) #11406
  • [d61a511728] - (SEMVER-MAJOR)lib: refactor internal/linkedlist (James M Snell) #11406
  • [2ba4eeadbb] - (SEMVER-MAJOR)lib: remove simd support from util.format() (Ben Noordhuis) #11346
  • [dfdd911e17] - (SEMVER-MAJOR)lib: deprecate node --debug at runtime (Josh Gavant) #10970
  • [5de3cf099c] - (SEMVER-MAJOR)lib: add static identifier codes for all deprecations (James M Snell) #10116
  • [4775942957] - (SEMVER-MAJOR)lib, test: fix server.listen error message (Joyee Cheung) #11693
  • [caf9ae748b] - (SEMVER-MAJOR)lib,src: make constants not inherit from Object (Sakthipriyan Vairamani (thefourtheye)) #10458
  • [e0b076a949] - (SEMVER-MAJOR)lib,src,test: update --debug/debug-brk comments (Ben Noordhuis) #12495
  • [b40dab553f] - (SEMVER-MAJOR)linkedlist: remove unused methods (Brian White) #11726
  • [84a23391f6] - (SEMVER-MAJOR)linkedlist: remove public module (Brian White) #12113
  • [e32425bfcd] - (SEMVER-MAJOR)module: avoid JSON.stringify() for cache key (Brian White) #10789
  • [403b89e72b] - (SEMVER-MAJOR)module: avoid hasOwnProperty() (Brian White) #10789
  • [298a40e04e] - (SEMVER-MAJOR)module: use "clean" objects (Brian White) #10789
  • [cf980b0311] - (SEMVER-MAJOR)net: check and throw on error for getsockname (Daniel Bevenius) #12871
  • [473572ea25] - (SEMVER-MAJOR)os: refactor os structure, add Symbol.toPrimitive (James M Snell) #12654
  • [03e89b3ff2] - (SEMVER-MAJOR)process: add --redirect-warnings command line argument (James M Snell) #10116
  • [5e1f32fd94] - (SEMVER-MAJOR)process: add optional code to warnings + type checking (James M Snell) #10116
  • [a647d82f83] - (SEMVER-MAJOR)process: improve process.hrtime (Joyee Cheung) #10764
  • [4e259b21a3] - (SEMVER-MAJOR)querystring, url: handle repeated sep in search (Daijiro Wachi) #10967
  • [39d9afe279] - (SEMVER-MAJOR)repl: refactor LineParser implementation (Blake Embrey) #6171
  • [3f27f02da0] - (SEMVER-MAJOR)repl: docs-only deprecation of magic mode (Timothy Gu) #11599
  • [b77c89022b] - (SEMVER-MAJOR)repl: remove magic mode semantics (Timothy Gu) #11599
  • [007386ee81] - (SEMVER-MAJOR)repl: remove workaround for function redefinition (Michaël Zasso) #9618
  • [5b63fabfd8] - (SEMVER-MAJOR)src: update NODE_MODULE_VERSION to 55 (Michaël Zasso) #12784
  • [a16b570f8c] - (SEMVER-MAJOR)src: add --pending-deprecation and NODE_PENDING_DEPRECATION (James M Snell) #11968
  • [faa447b256] - (SEMVER-MAJOR)src: allow ArrayBufferView as instance of Buffer (Timothy Gu) #12223
  • [47f8f7462f] - (SEMVER-MAJOR)src: remove support for --debug (Jan Krems) #12197
  • [a5f91ab230] - (SEMVER-MAJOR)src: throw when -c and -e are used simultaneously (Teddy Katz) #11689
  • [8a7db9d4b5] - (SEMVER-MAJOR)src: add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius) #12087
  • [ed12ea371c] - (SEMVER-MAJOR)src: update inspector code to match upstream API (Michaël Zasso) #11752
  • [89d8dc9afd] - (SEMVER-MAJOR)src: update NODE_MODULE_VERSION to 54 (Michaël Zasso) #11752
  • [1125c8a814] - (SEMVER-MAJOR)src: fix typos in node_lttng_provider.h (Benjamin Fleischer) #11723
  • [aae8f683b4] - (SEMVER-MAJOR)src: update NODE_MODULE_VERSION to 53 (Michaël Zasso) #10992
  • [91ab09fe2a] - (SEMVER-MAJOR)src: update NODE_MODULE_VERSION to 52 (Michaël Zasso) #9618
  • [334be0feba] - (SEMVER-MAJOR)src: fix space for module version mismatch error (Yann Pringault) #10606
  • [45c9ca7fd4] - (SEMVER-MAJOR)src: remove redundant spawn/spawnSync type checks (cjihrig) #8312
  • [b374ee8c3d] - (SEMVER-MAJOR)src: add handle check to spawn_sync (cjihrig) #8312
  • [3295a7feba] - (SEMVER-MAJOR)src: allow getting Symbols on process.env (Anna Henningsen) #9631
  • [1aa595e5bd] - (SEMVER-MAJOR)src: throw on process.env symbol usage (cjihrig) #9446
  • [a235ccd168] - (SEMVER-MAJOR)src,test: debug is now an alias for inspect (Ali Ijaz Sheikh) #11441
  • [b6e1d22fa6] - (SEMVER-MAJOR)stream: add destroy and _destroy methods. (Matteo Collina) #12925
  • [f36c970cf3] - (SEMVER-MAJOR)stream: improve multiple callback error message (cjihrig) #12520
  • [202b07f414] - (SEMVER-MAJOR)stream: fix comment for sync flag of ReadableState (Wang Xinyong) #11139
  • [1004b9b4ad] - (SEMVER-MAJOR)stream: remove unused ranOut from ReadableState (Wang Xinyong) #11139
  • [03b9f6fe26] - (SEMVER-MAJOR)stream: avoid instanceof (Brian White) #10558
  • [a3539ae3be] - (SEMVER-MAJOR)stream: use plain objects for write/corked reqs (Brian White) #10558
  • [24ef1e6775] - (SEMVER-MAJOR)string_decoder: align UTF-8 handling with V8 (Brian White) #9618
  • [23fc082409] - (SEMVER-MAJOR)test: remove extra console output from test-os.js (James M Snell) #12654
  • [59c6230861] - (SEMVER-MAJOR)test: cleanup test-child-process-constructor.js (cjihrig) #12348
  • [06c29a66d4] - (SEMVER-MAJOR)test: remove common.fail() (Rich Trott) #12293
  • [0c539faac3] - (SEMVER-MAJOR)test: add common.getArrayBufferViews(buf) (Timothy Gu) #12223
  • [c5d1851ac4] - (SEMVER-MAJOR)test: drop v5.x-specific code path from simd test (Ben Noordhuis) #11346
  • [c2c6ae52ea] - (SEMVER-MAJOR)test: move test-vm-function-redefinition to parallel (Franziska Hinkelmann) #9618
  • [5b30c4f24d] - (SEMVER-MAJOR)test: refactor test-child-process-spawnsync-maxbuf (cjihrig) #10769
  • [348cc80a3c] - (SEMVER-MAJOR)tls: make rejectUnauthorized default to true (ghaiklor) #5923
  • [a2ae08999b] - (SEMVER-MAJOR)tls: runtime deprecation for tls.createSecurePair() (James M Snell) #11349
  • [d523eb9c40] - (SEMVER-MAJOR)tls: use emitWarning() for dhparam \< 2048 bits (James M Snell) #11447
  • [e03a929648] - (SEMVER-MAJOR)tools: update test-npm.sh paths (Kat Marchán) #12936
  • [6f202ef857] - (SEMVER-MAJOR)tools: remove assert.fail() lint rule (Rich Trott) #12293
  • [615789b723] - (SEMVER-MAJOR)tools: enable ES2017 syntax support in ESLint (Michaël Zasso) #11210
  • [1b63fa1096] - (SEMVER-MAJOR)tty: remove NODE_TTY_UNSAFE_ASYNC (Jeremiah Senkpiel) #12057
  • [78182458e6] - (SEMVER-MAJOR)url: fix error message of url.format (DavidCai) #11162
  • [c65d55f087] - (SEMVER-MAJOR)url: do not truncate long hostnames (Junshu Okamoto) #9292
  • [3cc3e099be] - (SEMVER-MAJOR)util: show External values explicitly in inspect (Anna Henningsen) #12151
  • [4a5a9445b5] - (SEMVER-MAJOR)util: use \[Array\] for deeply nested arrays (Anna Henningsen) #12046
  • [5bfd13b81e] - (SEMVER-MAJOR)util: display Symbol keys in inspect by default (Shahar Or) #9726
  • [455e6f1dd8] - (SEMVER-MAJOR)util: throw toJSON errors when formatting %j (Timothy Gu) #11708
  • [ec2f098156] - (SEMVER-MAJOR)util: change sparse arrays inspection format (Alexey Orlenko) #11576
  • [aab0d202f8] - (SEMVER-MAJOR)util: convert inspect.styles and inspect.colors to prototype-less objects (Nemanja Stojanovic) #11624
  • [4151ab398b] - (SEMVER-MAJOR)util: add createClassWrapper to internal/util (James M Snell) #11391
  • [f65aa08b52] - (SEMVER-MAJOR)util: improve inspect for (Async|Generator)Function (Michaël Zasso) #11210
  • [efae43f0ee] - (SEMVER-MAJOR)zlib: fix node crashing on invalid options (Alexey Orlenko) #13098
  • [2ced07ccaf] - (SEMVER-MAJOR)zlib: support all ArrayBufferView types (Timothy Gu) #12223
  • [91383e47fd] - (SEMVER-MAJOR)zlib: support Uint8Array in convenience methods (Timothy Gu) #12001
  • [b514bd231e] - (SEMVER-MAJOR)zlib: use RangeError/TypeError consistently (James M Snell) #11391
  • [8e69f7e385] - (SEMVER-MAJOR)zlib: refactor zlib module (James M Snell) #11391
  • [dd928b04fc] - (SEMVER-MAJOR)zlib: be strict about what strategies are accepted (Rich Trott) #10934
  • [7e3a3c962f] - (SEMVER-MINOR)async_hooks: initial async_hooks implementation (Trevor Norris) #12892
  • [60a2fe7d47] - (SEMVER-MINOR)async_hooks: implement C++ embedder API (Anna Henningsen) #13142
  • [f1ed19d98f] - (SEMVER-MINOR)async_wrap: use more specific providers (Trevor Norris) #12892
  • [0432c6e91e] - (SEMVER-MINOR)async_wrap: use double, not int64_t, for async id (Trevor Norris) #12892
  • [fe2df3b842] - (SEMVER-MINOR)async_wrap,src: add GetAsyncId() method (Trevor Norris) #12892
  • [6d93508369] - (SEMVER-MINOR)buffer: expose FastBuffer on internal/buffer (Anna Henningsen) #11048
  • [fe5ca3ff27] - (SEMVER-MINOR)child_process: support promisified exec(File) (Anna Henningsen) #12442
  • [f146fe4ed4] - (SEMVER-MINOR)cmd: support dash as stdin alias (Ebrahim Byagowi) #13012
  • [d9f3ec8e09] - (SEMVER-MINOR)crypto: use named FunctionTemplate (Trevor Norris) #12892
  • [0e710aada4] - (SEMVER-MINOR)crypto: add sign/verify support for RSASSA-PSS (Tobias Nießen) #11705
  • [faf6654ff7] - (SEMVER-MINOR)dns: support promisified lookup(Service) (Anna Henningsen) #12442
  • [5077cde71f] - (SEMVER-MINOR)doc: restructure url.md (James M Snell) #12710
  • [d080ead0f9] - (SEMVER-MINOR)doc: graduate WHATWG URL from Experimental (James M Snell) #12710
  • [c505b8109e] - (SEMVER-MINOR)doc: document URLSearchParams constructor (Timothy Gu) #11060
  • [84dabe8373] - (SEMVER-MINOR)domain: support promises (Anna Henningsen) #12489
  • [fbcb4f50b8] - (SEMVER-MINOR)fs: support util.promisify for fs.read/fs.write (Anna Henningsen) #12442
  • [a7f5c9cb7d] - (SEMVER-MINOR)http: destroy sockets after keepAliveTimeout (Timur Shemsedinov) #2534
  • [3e6f1032a4] - (SEMVER-MINOR)http: add new functions to OutgoingMessage (Brian White) #10805
  • [c7182b9d9c] - (SEMVER-MINOR)inspector: JavaScript bindings for the inspector (Eugene Ostroukhov) #12263
  • [4a7233c178] - (SEMVER-MINOR)lib: implement async_hooks API in core (Trevor Norris) #12892
  • [c68ebe8436] - (SEMVER-MINOR)makefile: add async-hooks to test and test-ci (Trevor Norris) #12892
  • [45139e59f3] - (SEMVER-MINOR)n-api: add napi_get_version (Michael Dawson) #13207
  • [56e881d0b0] - (SEMVER-MINOR)n-api: add support for abi stable module API (Jason Ginchereau) #11975
  • [dd20e68b0f] - (SEMVER-MINOR)process: add optional detail to process emitWarning (James M Snell) #12725
  • [c0bde73f1b] - (SEMVER-MINOR)src: implement native changes for async_hooks (Trevor Norris) #12892
  • [e5a25cbc85] - (SEMVER-MINOR)src: expose node::AddPromiseHook (Anna Henningsen) #12489
  • [ec53921d2e] - (SEMVER-MINOR)src: make AtExit callback's per Environment (Daniel Bevenius) #9163
  • [ba4847e879] - (SEMVER-MINOR)src: Node Tracing Controller (misterpoe) #9304
  • [6ff3b03240] - (SEMVER-MINOR)src, inspector: add --inspect-brk option (Josh Gavant) #8979
  • [220186c4a8] - (SEMVER-MINOR)stream: support Uint8Array input to methods (Anna Henningsen) #11608
  • [07c7f198db] - (SEMVER-MINOR)stream: add final method (Calvin Metcalf) #12828
  • [11918c4aed] - (SEMVER-MINOR)stream: fix highWaterMark integer overflow (Tobias Nießen) #12593
  • [c56d6046ec] - (SEMVER-MINOR)test: add AsyncResource addon test (Anna Henningsen) #13142
  • [e3e56f1d71] - (SEMVER-MINOR)test: adding tests for initHooks API (Thorsten Lorenz) #12892
  • [732620cfe9] - (SEMVER-MINOR)test: remove unneeded tests (Trevor Norris) #12892
  • [e965ed16c1] - (SEMVER-MINOR)test: add test for promisify customPromisifyArgs (Gil Tayar) #12442
  • [3ea2301e38] - (SEMVER-MINOR)test: add a bunch of tests from bluebird (Madara Uchiha) #12442
  • [dca08152cb] - (SEMVER-MINOR)test: introduce common.crashOnUnhandledRejection (Anna Henningsen) #12489
  • [e7c51454b0] - (SEMVER-MINOR)timers: add promisify support (Anna Henningsen) #12442
  • [e600fbe576] - (SEMVER-MINOR)tls: accept lookup option for tls.connect() (Fedor Indutny) #12839
  • [c3efe72669] - (SEMVER-MINOR)tls: support Uint8Arrays for protocol list buffers (Anna Henningsen) #11984
  • [29f758731f] - (SEMVER-MINOR)tools: add MDN link for Iterable (Timothy Gu) #11060
  • [4b9d84df51] - (SEMVER-MINOR)tty_wrap: throw when uv_tty_init() returns error (Trevor Norris) #12892
  • [cc48f21c83] - (SEMVER-MINOR)url: extend URLSearchParams constructor (Timothy Gu) #11060
  • [99da8e8e02] - (SEMVER-MINOR)util: add util.promisify() (Anna Henningsen) #12442
  • [059f296050] - (SEMVER-MINOR)util: add internal bindings for promise handling (Anna Henningsen) #12442
  • [1fde98bb4f] - (SEMVER-MINOR)v8: expose new V8 serialization API (Anna Henningsen) #11048
  • [70beef97bd] - (SEMVER-MINOR)v8: add cachedDataVersionTag (Andres Suarez) #11515

Windows 32-bit Installer: https://nodejs.org/dist/v8.0.0/node-v8.0.0-x86.msi
Windows 64-bit Installer: https://nodejs.org/dist/v8.0.0/node-v8.0.0-x64.msi
Windows 32-bit Binary: https://nodejs.org/dist/v8.0.0/win-x86/node.exe
Windows 64-bit Binary: https://nodejs.org/dist/v8.0.0/win-x64/node.exe
macOS 64-bit Installer: https://nodejs.org/dist/v8.0.0/node-v8.0.0.pkg
macOS 64-bit Binary: https://nodejs.org/dist/v8.0.0/node-v8.0.0-darwin-x64.tar.gz
Linux 32-bit Binary: https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x86.tar.xz
Linux 64-bit Binary: https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz
Linux PPC LE 64-bit Binary: https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-ppc64le.tar.xz
Linux PPC BE 64-bit Binary: https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-ppc64.tar.xz
Linux s390x 64-bit Binary: https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-s390x.tar.xz
AIX 64-bit Binary: https://nodejs.org/dist/v8.0.0/node-v8.0.0-aix-ppc64.tar.gz
SunOS 32-bit Binary: https://nodejs.org/dist/v8.0.0/node-v8.0.0-sunos-x86.tar.xz
SunOS 64-bit Binary: https://nodejs.org/dist/v8.0.0/node-v8.0.0-sunos-x64.tar.xz
ARMv6 32-bit Binary: https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-armv6l.tar.xz
ARMv7 32-bit Binary: https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-armv7l.tar.xz
ARMv8 64-bit Binary: https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-arm64.tar.xz
Source Code: https://nodejs.org/dist/v8.0.0/node-v8.0.0.tar.gz
Other release files: https://nodejs.org/dist/v8.0.0/
Documentation: https://nodejs.org/docs/v8.0.0/api/

SHASUMS

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

e71f14f58d1251932d537af3c47213d2cf3774f031bc7e26b81f69b24688ed84  node-v8.0.0-aix-ppc64.tar.gz
6e4a66917e2c11d5adc537c899941c973ae586293352b8172a4f32be0b7f0300  node-v8.0.0-darwin-x64.tar.gz
5ac8b0b6b5c12e1b9c62fb78dd194819a83b940a7407ef0c58fa7bf009918593  node-v8.0.0-darwin-x64.tar.xz
3a8cdc9a7d6c32d8c38af1f95e1f9402b75482ad362a24a420296dc8fe0c04a6  node-v8.0.0-headers.tar.gz
d6061c9bf085ee7e42dff5472ee933283a9ac65ea0dc2211d0ffe301cbddacbd  node-v8.0.0-headers.tar.xz
ee10913aa14e1c22fe3567b957d1e77a47905f78812976a7b4199d33984e871b  node-v8.0.0-linux-arm64.tar.gz
8d6eaefcc252055de54a666d4e00eec78caf2143cd7a13b63f109e9eb78a795e  node-v8.0.0-linux-arm64.tar.xz
46a46f0c9be5b9a87b0836b31c97ea080283f575c04ab77a270c9cc40d4add19  node-v8.0.0-linux-armv6l.tar.gz
0fd0d8a47ceebff21b3ceeeee90f4c7564ce7ba0dce372e60aa5869fcfba3268  node-v8.0.0-linux-armv6l.tar.xz
aa72e471eec056d4da60a2eb0861ca93a1c444e920c1a1864f955a757531fd6f  node-v8.0.0-linux-armv7l.tar.gz
70ea0a5cd685a06ece15ab0cebb641d87eb52abb0fdc75264f73a0dbfe7a1769  node-v8.0.0-linux-armv7l.tar.xz
553d3db6356d95c04d903182b8867ab83d13a6a05b45c7361be503cb20d1ae5a  node-v8.0.0-linux-ppc64le.tar.gz
9e83115ebe08850f41e1f36dcbf822ad9be979970dd890de7ee46f2a472de29d  node-v8.0.0-linux-ppc64le.tar.xz
f2d7927a1d8e2e86e01cdd31a3e38bd8c7faa6fa95cc896897549cad6b5648dc  node-v8.0.0-linux-ppc64.tar.gz
d5db1f5120b454761ac60ecb0b0940698f8f4d508bbdd97d07aa5e8914e7064b  node-v8.0.0-linux-ppc64.tar.xz
8ebe155b5ebff75c292d759bc6256567078a175fcfda93e7e45d97371504fb8c  node-v8.0.0-linux-s390x.tar.gz
feb15265c8d8887f267dedbe2d84a80a60f3680e6424cc49d67bcca60bb66794  node-v8.0.0-linux-s390x.tar.xz
1944f0ead4c9dbdf92a97041cb2ec34cc08ea873958c7009befaa56a7ccea4c2  node-v8.0.0-linux-x64.tar.gz
0a536bb83eeccca23626e5e5ead52563a641e4331c35e367662892921dc7e8a4  node-v8.0.0-linux-x64.tar.xz
e012b41f021cb0ff691d40085884623a82a5e79d4763ca3739487d3ba160a79d  node-v8.0.0-linux-x86.tar.gz
6d99916494a7e0110cbfe7ae79de4d553347763140bddeab4259a998e47d8ccc  node-v8.0.0-linux-x86.tar.xz
e197ed371eafe71635c84fb7d283d40167786fbf3e9148ec2e747d5ddca27a28  node-v8.0.0.pkg
4dafd35ec1a79ce6f5cbd883a62da05eaf5b9057f374aeae67af9b205ffa281c  node-v8.0.0-sunos-x64.tar.gz
d89c9415f9c61713865f49974298afeb8baee0f1d06e5e7f9e4e309126663154  node-v8.0.0-sunos-x64.tar.xz
0f635a9c074525b42bc3c60cb86a728bba63e30080ef90f9820b717bf42019c5  node-v8.0.0-sunos-x86.tar.gz
c5e1f31bb46c887dbe9e4a655ceed798f3ef291b348065bc2fae9bcd0d48ebde  node-v8.0.0-sunos-x86.tar.xz
28f2e0bd5f80ff83b244df670d577fe36c1e0f11561deee7d8bbdcbd4ead8fb2  node-v8.0.0.tar.gz
258d3aa3632bbbf2a447c5d524bd7074e23aa26e2b698774ff452954f6174f1c  node-v8.0.0.tar.xz
9bc84644228ab1e96dfb78eea4144c7c9732ccd33b44a4b8994fd232fafa19b5  node-v8.0.0-win-x64.7z
84410377118857674e0fb6e7bc7627ffb8cc67a72f162a050276b076e328a9bb  node-v8.0.0-win-x64.zip
4c4d1c21a56ab4da6a24543ee27bd2d22fbbf5fcae9ccc3422869ad45754809c  node-v8.0.0-win-x86.7z
87542a872cdf806456bfff5df003e98d8e4b96172e95552d4a2212e7887f0d32  node-v8.0.0-win-x86.zip
a6b7306302ce23b232467f19f766dda8b9684168976b24c8e6c55ea92d085176  node-v8.0.0-x64.msi
715d1834a7b2741ae0a4401902ef91cc9f95dfe04c4a100bd3490e95ad5bf449  node-v8.0.0-x86.msi
cf01892d191316d2aa643fb2020846ac23d6f1abcceec81850efad3e7ca496b8  win-x64/node.exe
f1d7eda300875ac0f028465f62be20ebce15736e6adf71d43e65812f36c06fb6  win-x64/node.lib
06a8ca6334347a1141f6e442310f6a814f2d8fbecd8120b50cec7450e7de7565  win-x64/node_pdb.7z
276823cc8ab672045c7f422a06fb814249f904b90379cc1260df90cb89226416  win-x64/node_pdb.zip
ec86a350f5451c534413caab90c5a825c94c6630aa7eb68a4cd607e2deac6096  win-x86/node.exe
b57826d249da402ddb79e0923b7aaea07577d926a32e025577cefd0b9e9ba814  win-x86/node.lib
88f566489a5aaeed787bbe52c80ecd4c8bc4c31d7333bfdbbded35b4287aae47  win-x86/node_pdb.7z
d83a9dfd290509f4a5846fd714c1496965cec6e8c5f58a59564f44e6530099f5  win-x86/node_pdb.zip
-----BEGIN PGP SIGNATURE-----

iQEcBAEBCAAGBQJZLb34AAoJEHNBsVwHCHesLrwIALZ0RAE9tKrZqTOfMdnZOLxg
Q50gNNxLfQVlhPpyezEFZrWhGyPK2FCRXwpGb7Kf1QMTn3DPvsRB6h2+McNp7TDh
QHVnjj8LR08pWJpR0bYsfwzoVYb3tc8//DUgdFx0d7BZviqE7NUyQIbtwmUYqEGU
hQVt0L7ns0CPu0v4NhXyuDrSli86bK/XmtjC3IyZMbxOW0ViB2OsGl8ngSKAHOYw
FGUCrLK00uGPWRtO2oLWG7TXvhU4dMwHDTxDFRfP17w50XZyfrOlCriQQBjyv2wj
zH5snnMl+P0RZmYwbQPd5E+JXJhKZpfnTP+XDZuwEqQhdqyjTYn2pVTf3/Rtpto=
=EbZq
-----END PGP SIGNATURE-----

Uber Fires Anthony Levandowski

$
0
0
Photo
Travis Kalanick, the chief executive of Uber, left, with Anthony Levandowski, a vice president of technology at Uber, whose firing was announced to staff members on Tuesday.Credit Tony Avelar/Associated Press

SAN FRANCISCO — Uber has fired Anthony Levandowski, a vice president of technology and the star engineer leading the company’s self-driving automobile efforts, according to an internal email sent to employees on Tuesday.

Mr. Levandowski’s termination, effective immediately, comes as a result of his involvement in a legal battle between Uber and Waymo, the self-driving technology unit spun out of Google last year. Waymo claims that Uber is using trade secrets stolen from Google to develop Uber’s self-driving vehicles, a plan aided by Mr. Levandowski, a former longtime Google employee.

Uber has long denied the accusations. But when Mr. Levandowski was ordered by a federal judge to hand over evidence and testimony to that end, he asserted his Fifth Amendment rights, seeking to avoid possible criminal charges, according to his lawyers. Uber has been unable to convince Mr. Levandowski to cooperate.

“Over the last few months Uber has provided significant evidence to the court to demonstrate that our self-driving technology has been built independently,” Angela Padilla, Uber’s associate general counsel for employment and litigation, wrote in an email to employees. “Over that same period, Uber has urged Anthony to fully cooperate in helping the court get to the facts and ultimately helping to prove our case.”

Continue reading the main story

SCOTUS: Patent Rights Over a Printer Cartridge Are Exhausted When It Is Sold

$
0
0

Syllabus

IMPRESSION PRODUCTS, INC. v. LEXMARK INT’L, INC. ( )
816 F. 3d 721, reversed and remanded.

NOTE: Where it is feasible, a syllabus (headnote) will be released, as is being done in connection with this case, at the time the opinion is issued.The syllabus constitutes no part of the opinion of the Court but has been prepared by the Reporter of Decisions for the convenience of the reader.See United States v. Detroit Timber & Lumber Co.,200 U. S. 321.

SUPREME COURT OF THE UNITED STATES

Syllabus

IMPRESSION PRODUCTS, INC. v. LEXMARK INTERNATIONAL, INC.

certiorari to the united states court of appeals for the federal circuit


No. 15–1189. Argued March 21, 2017—Decided May 30, 2017


A United States patent entitles the patent holder to “exclude others from making, using, offering for sale, or selling [its] invention throughout the United States or importing the invention into the United States.” 35 U. S. C. §154(a). Whoever engages in one of these acts “without authority” from the patentee may face liability for patent infringement. §271(a). When a patentee sells one of its products, however, the patentee can no longer control that item through the patent laws—its patent rights are said to “exhaust.”

Respondent Lexmark International, Inc. designs, manufactures, and sells toner cartridges to consumers in the United States and abroad. It owns a number of patents that cover components of those cartridges and the manner in which they are used. When Lexmark sells toner cartridges, it gives consumers two options: One option is to buy a toner cartridge at full price, with no restrictions. The other option is to buy a cartridge at a discount through Lexmark’s “Return Program.” In exchange for the lower price, customers who buy through the Return Program must sign a contract agreeing to use the cartridge only once and to refrain from transferring the cartridge to anyone but Lexmark.

Companies known as remanufacturers acquire empty Lexmark toner cartridges—including Return Program cartridges—from purchasers in the United States, refill them with toner, and then resell them. They do the same with Lexmark cartridges that they acquire from purchasers overseas and import into the United States. Lexmark sued a number of these remanufacturers, including petitioner Impression Products, Inc., for patent infringement with respect to two groups of cartridges. The first group consists of Return Program cartridges that Lexmark had sold within the United States. Lexmark argued that, because it expressly prohibited reuse and resale of these cartridges, Impression Products infringed the Lexmark patents when it refurbished and resold them. The second group consists of all toner cartridges that Lexmark had sold abroad and that Impression Products imported into the country. Lexmark claimed that it never gave anyone authority to import these cartridges, so Impression Products infringed its patent rights by doing just that.

Impression Products moved to dismiss on the grounds that Lexmark’s sales, both in the United States and abroad, exhausted its patent rights in the cartridges, so Impression Products was free to refurbish and resell them, and to import them if acquired overseas. The District Court granted the motion to dismiss as to the domestic Return Program cartridges, but denied the motion as to the cartridges sold abroad. The Federal Circuit then ruled for Lexmark with respect to both groups of cartridges. Beginning with the Return Program cartridges that Lexmark sold domestically, the Federal Circuit held that a patentee may sell an item and retain the right to enforce, through patent infringement lawsuits, clearly communicated, lawful restrictions on post-sale use or resale. Because Impression Products knew about Lexmark’s restrictions and those restrictions did not violate any laws, Lexmark’s sales did not exhaust its patent rights, and it could sue Impression Products for infringement. As for the cartridges that Lexmark sold abroad, the Federal Circuit held that, when a patentee sells a product overseas, it does not exhaust its patent rights over that item. Lexmark was therefore free to sue for infringement when Impression Products imported cartridges that Lexmark had sold abroad. Judge Dyk, joined by Judge Hughes, dissented.

Held:

1. Lexmark exhausted its patent rights in the Return Program cartridges that it sold in the United States. A patentee’s decision to sell a product exhausts all of its patent rights in that item, regardless of any restrictions the patentee purports to impose. As a result, even if the restrictions in Lexmark’s contracts with its customers were clear and enforceable under contract law, they do not entitle Lexmark to retain patent rights in an item that it has elected to sell. Pp. 5–13.

(a) The Patent Act grants patentees the “right to exclude others from making, using, offering for sale, or selling [their] invention[s].” 35 U. S. C. §154(a). For over 160 years, the doctrine of patent exhaustion has imposed a limit on that right to exclude: When a patentee sells an item, that product “is no longer within the limits of the [patent] monopoly” and instead becomes the “private, individual property” of the purchaser. Bloomer v. McQuewan, 14 How. 539, 549–550. If the patentee negotiates a contract restricting the purchaser’s right to use or resell the item, it may be able to enforce that restriction as a matter of contract law, but may not do so through a patent infringement lawsuit.

The exhaustion rule marks the point where patent rights yield to the common law principle against restraints on alienation. The Patent Act promotes innovation by allowing inventors to secure the financial rewards for their inventions. Once a patentee sells an item, it has secured that reward, and the patent laws provide no basis for restraining the use and enjoyment of the product. Allowing further restrictions would run afoul of the “common law’s refusal to permit restraints on the alienation of chattels.” Kirtsaeng v. John Wiley & Sons, Inc.,568 U. S. 519. As Lord Coke put it in the 17th century, if an owner restricts the resale or use of an item after selling it, that restriction “is voide, because . . . it is against Trade and Traffique, and bargaining and contracting betweene man and man.” 1 E. Coke, Institutes of the Laws of England §360, p. 223 (1628). Congress enacted and has repeatedly revised the Patent Act against the backdrop of this hostility toward restraints on alienation, which is reflected in the exhaustion doctrine.

This Court accordingly has long held that, even when a patentee sells an item under an express, otherwise lawful restriction, the patentee does not retain patent rights in that product. See, e.g.,Quanta Computer, Inc. v. LG Electronics, Inc.,553 U. S. 617. And that well-settled line of precedent allows for only one answer in this case: Lexmark cannot bring a patent infringement suit against Impression Products with respect to the Return Program cartridges sold in the United States because, once Lexmark sold those cartridges, it exhausted its right to control them through the patent laws. Pp. 5–9.

(b) The Federal Circuit reached a different result because it started from the premise that the exhaustion doctrine is an interpretation of the patent infringement statute, which prohibits anyone from using or selling a patented article “without authority” from the patentee. According to the Federal Circuit, exhaustion reflects a default rule that selling an item “presumptively grant[s] ‘authority’ for the purchaser to use it and resell it.” 816 F. 3d 721, 742. But if a patentee withholds some authority by expressly limiting the purchaser’s rights, the patentee may enforce that restriction through patent infringement lawsuits. See id., at 741.

The problem with the Federal Circuit’s logic is that the exhaustion doctrine is not a presumption about the authority that comes along with a sale; it is a limit on the scope of the patentee’s rights. The Patent Act gives patentees a limited exclusionary power, and exhaustion extinguishes that power. A purchaser has the right to use, sell, or import an item because those are the rights that come along with ownership, not because it purchased authority to engage in those practices from the patentee. Pp. 9–13.

2. Lexmark also sold toner cartridges abroad, which Impression Products acquired from purchasers and imported into the United States. Lexmark cannot sue Impression Products for infringement with respect to these cartridges. An authorized sale outside the United States, just as one within the United States, exhausts all rights under the Patent Act.

The question about international exhaustion of intellectual property rights has arisen in the context of copyright law. Under the first sale doctrine, when a copyright owner sells a lawfully made copy of its work, it loses the power to restrict the purchaser’s right “to sell or otherwise dispose of . . . that copy.” 17 U. S. C. §109(a). In Kirtsaeng v. John Wiley & Sons, Inc.,568 U. S. 519, this Court held that the first sale doctrine applies to copies of works made and sold abroad. Central to that decision was the fact that the first sale doctrine has its roots in the common law principle against restraints on alienation. Because that principle makes no geographical distinctions and the text of the Copyright Act did not provide such a distinction, a straightforward application of the first sale doctrine required concluding that it applies overseas.

Applying patent exhaustion to foreign sales is just as straightforward. Patent exhaustion, too, has its roots in the antipathy toward restraints on alienation, and nothing in the Patent Act shows that Congress intended to confine that principle to domestic sales. Differentiating between the patent exhaustion and copyright first sale doctrines would also make little theoretical or practical sense: The two share a “strong similarity . . . and identity of purpose,” Bauer & Cie v. O’Donnell,229 U. S. 1, and many everyday products are subject to both patent and copyright protections.

Lexmark contends that a foreign sale does not exhaust patent rights because the Patent Act limits a patentee’s power to exclude others from making, using, selling, or importing its products to acts that occur in the United States. Because those exclusionary powers do not apply abroad, the patentee may not be able to sell its products overseas for the same price as it could in the United States, and therefore is not sure to receive the reward guaranteed by American patent laws. Without that reward, says Lexmark, there should be no exhaustion.

The territorial limit on patent rights is no basis for distinguishing copyright protections; those do not have extraterritorial effect either. Nor does the territorial limit support Lexmark’s argument. Exhaustion is a distinct limit on the patent grant, which is triggered by the patentee’s decision to give a patented item up for whatever fee it decides is appropriate. The patentee may not be able to command the same amount for its products abroad as it does in the United States. But the Patent Act does not guarantee a particular price. Instead, the Patent Act just ensures that the patentee receives one reward—of whatever it deems to be satisfactory compensation—for every item that passes outside the scope of its patent monopoly.

This Court’s decision in Boesch v. Gräff,133 U. S. 697, is not to the contrary. That decision did not, as Lexmark contends, exempt all foreign sales from patent exhaustion. Instead, it held that a sale abroad does not exhaust a patentee’s rights when the patentee had nothing to do with the transaction. That just reaffirms the basic premise that only the patentee can decide whether to make a sale that exhausts its patent rights in an item.

Finally, the United States advocates what it views as a middle-ground position: that a foreign sale exhausts patent rights unless the patentee expressly reserves those rights. This express-reservation rule is based on the idea that overseas buyers expect to be able to use and resell items freely, so exhaustion should be the presumption. But, at the same time, lower courts have long allowed patentees to expressly reserve their rights, so that option should remain open to patentees. The sparse and inconsistent decisions the Government cites, however, provide no basis for any expectation, let alone a settled one, that patentees can reserve rights when they sell abroad. The theory behind the express-reservation rule also wrongly focuses on the expectations of the patentee and purchaser during a sale. More is at stake when it comes to patent exhaustion than the dealings between the parties, which can be addressed through contracts. Instead, exhaustion occurs because allowing patent rights to stick to an already-sold item as it travels through the market would violate the principle against restraints on alienation. As a result, restrictions and location are irrelevant for patent exhaustion; what matters is the patentee’s decision to make a sale. Pp. 13–18.

816 F. 3d 721, reversed and remanded.

Roberts, C. J., delivered the opinion of the Court, in which Kennedy, Thomas, Breyer, Alito, Sotomayor, and Kagan,JJ., joined. Ginsburg, J., filed an opinion concurring in part and dissenting in part. Gorsuch, J., took no part in the consideration or decision of the case.


TOP

Opinion

NOTICE: This opinion is subject to formal revision before publication in the preliminary print of the United States Reports. Readers are requested to notify the Reporter of Decisions, Supreme Court of the United States, Washington, D. C. 20543, of any typographical or other formal errors, in order that corrections may be made before the preliminary print goes to press.

SUPREME COURT OF THE UNITED STATES

_________________

No. 15–1189

_________________

IMPRESSION PRODUCTS, INC., PETITIONER v. LEXMARK INTERNATIONAL, INC.

on writ of certiorari to the united states court of appeals for the federal circuit


[May 30, 2017]


Chief Justice Roberts delivered the opinion of the Court.

A United States patent entitles the patent holder (the “patentee”), for a period of 20 years, to “exclude others from making, using, offering for sale, or selling [its] invention throughout the United States or importing the invention into the United States.” 35 U. S. C. §154(a). Whoever engages in one of these acts “without authority” from the patentee may face liability for patent infringement. §271(a).

When a patentee sells one of its products, however, the patentee can no longer control that item through the patent laws—its patent rights are said to “exhaust.” The purchaser and all subsequent owners are free to use or resell the product just like any other item of personal property, without fear of an infringement lawsuit.

This case presents two questions about the scope of the patent exhaustion doctrine: First, whether a patentee that sells an item under an express restriction on the purchaser’s right to reuse or resell the product may enforce that restriction through an infringement lawsuit. And second, whether a patentee exhausts its patent rights by selling its product outside the United States, where American patent laws do not apply. We conclude that a patentee’s decision to sell a product exhausts all of its patent rights in that item, regardless of any restrictions the patentee purports to impose or the location of the sale.

I

The underlying dispute in this case is about laser printers—or, more specifically, the cartridges that contain the powdery substance, known as toner, that laser printers use to make an image appear on paper. Respondent Lexmark International, Inc. designs, manufactures, and sells toner cartridges to consumers in the United States and around the globe. It owns a number of patents that cover components of those cartridges and the manner in which they are used.

When toner cartridges run out of toner they can be refilled and used again. This creates an opportunity for other companies—known as remanufacturers—to acquire empty Lexmark cartridges from purchasers in the United States and abroad, refill them with toner, and then resell them at a lower price than the new ones Lexmark puts on the shelves.

Not blind to this business problem, Lexmark structures its sales in a way that encourages customers to return spent cartridges. It gives purchasers two options: One is to buy a toner cartridge at full price, with no strings attached. The other is to buy a cartridge at roughly 20-percent off through Lexmark’s “Return Program.” A customer who buys through the Return Program still owns the cartridge but, in exchange for the lower price, signs a contract agreeing to use it only once and to refrain from transferring the empty cartridge to anyone but Lexmark. To enforce this single-use/no-resale restriction, Lexmark installs a microchip on each Return Program cartridge that prevents reuse once the toner in the cartridge runs out.

Lexmark’s strategy just spurred remanufacturers toget more creative. Many kept acquiring empty Return Program cartridges and developed methods to counteract the effect of the microchips. With that technologicalobstacle out of the way, there was little to prevent the re-manufacturers from using the Return Program cartridges in their resale business. After all, Lexmark’s contractual single-use/no-resale agreements were with the initial customers, not with downstream purchasers like the remanufacturers.

Lexmark, however, was not so ready to concede that its plan had been foiled. In 2010, it sued a number of remanufacturers, including petitioner Impression Products, Inc., for patent infringement with respect to two groups of cartridges. One group consists of Return Program cartridges that Lexmark sold within the United States. Lexmark argued that, because it expressly prohibited reuse and resale of these cartridges, the remanufacturers infringed the Lexmark patents when they refurbished and resold them. The other group consists of all toner cartridges that Lexmark sold abroad and that remanufacturers imported into the country. Lexmark claimed that it never gave anyone authority to import these cartridges, so the remanufacturers ran afoul of its patent rights by doing just that.

Eventually, the lawsuit was whittled down to one defendant, Impression Products, and one defense: that Lexmark’s sales, both in the United States and abroad, exhausted its patent rights in the cartridges, so Impression Products was free to refurbish and resell them, and to import them if acquired abroad. Impression Products filed separate motions to dismiss with respect to both groups of cartridges. The District Court granted the motion as to the domestic Return Program cartridges, but denied the motion as to the cartridges Lexmark sold abroad. Both parties appealed.

The Federal Circuit considered the appeals en banc and ruled for Lexmark with respect to both groups of cartridges. The court began with the Return Program cartridgesthat Lexmark sold in the United States. Relying on its decision in Mallinckrodt, Inc. v. Medipart, Inc., 976 F. 2d 700 (1992), the Federal Circuit held that a patentee may sell an item and retain the right to enforce, through patent infringement lawsuits, “clearly communicated, . . . lawful restriction[s] as to post-sale use or resale.” 816 F. 3d 721, 735 (2016). The exhaustion doctrine, the court reasoned, derives from the prohibition on making, using, selling, or importing items “without authority.” Id., at 734 (quoting35 U. S. C. §271(a)). When you purchase an item you presumptively also acquire the authority to use or resell the item freely, but that is just a presumption; the same authority does not run with the item when the seller restricts post-sale use or resale. 816 F. 3d, at 742. Because the parties agreed that Impression Products knew about Lexmark’s restrictions and that those restrictions did not violate any laws, the Federal Circuit concluded that Lexmark’s sales had not exhausted all of its patent rights, and that the company could sue for infringement when Impression Products refurbished and resold Return Program cartridges.

As for the cartridges that Lexmark sold abroad, the Federal Circuit once again looked to its precedent. In Jazz Photo Corp. v. International Trade Commission, 264 F. 3d 1094 (2001), the court had held that a patentee’s decision to sell a product abroad did not terminate its ability to bring an infringement suit against a buyer that “import[ed] the article and [sold] . . . it in the United States.” 816 F. 3d, at 726–727. That rule, the court concluded, makes good sense: Exhaustion is justified when a patentee receives “the reward available from [selling in] American markets,” which does not occur when the patentee sells overseas, where the American patent offers no protection and therefore cannot bolster the price of the patentee’s goods. Id., at 760–761. As a result, Lexmark was free to exercise its patent rights to sue Impression Products for bringing the foreign-sold cartridges to market in the United States.

Judge Dyk, joined by Judge Hughes, dissented. In their view, selling the Return Program cartridges in the United States exhausted Lexmark’s patent rights in those items because any “authorized sale of a patented article . . . free[s] the article from any restrictions on use or sale based on the patent laws.” Id., at 775–776. As for the foreign cartridges, the dissenters would have held that a sale abroad also results in exhaustion, unless the seller “explicitly reserve[s] [its] United States patent rights” at the time of sale. Id., at 774, 788. Because Lexmark failed to make such an express reservation, its foreign sales exhausted its patent rights.

We granted certiorari to consider the Federal Circuit’s decisions with respect to both domestic and international exhaustion, 580 U. S. ___ (2016), and now reverse.

II

A

First up are the Return Program cartridges that Lexmark sold in the United States. We conclude that Lexmark exhausted its patent rights in these cartridges the moment it sold them. The single-use/no-resale restrictions in Lexmark’s contracts with customers may have been clear and enforceable under contract law, but they do not entitle Lexmark to retain patent rights in an item that it has elected to sell.

The Patent Act grants patentees the “right to exclude others from making, using, offering for sale, or selling [their] invention[s].” 35 U. S. C. §154(a). For over 160 years, the doctrine of patent exhaustion has imposed a limit on that right to exclude. See Bloomer v. McQuewan, 14 How. 539 (1853). The limit functions automatically: When a patentee chooses to sell an item, that product “is no longer within the limits of the monopoly” and instead becomes the “private, individual property” of the purchaser, with the rights and benefits that come along with ownership. Id., at 549–550. A patentee is free to set the price and negotiate contracts with purchasers, but may not, “by virtue of his patent, control the use or disposition” of the product after ownership passes to the purchaser. United States v. Univis Lens Co.,316 U. S. 241,250 (1942) (emphasis added). The sale “terminates all patent rights to that item.” Quanta Computer, Inc. v. LG Electronics, Inc.,553 U. S. 617,625 (2008) .

This well-established exhaustion rule marks the point where patent rights yield to the common law principle against restraints on alienation. The Patent Act “promote[s] the progress of science and the useful arts by granting to [inventors] a limited monopoly” that allows them to “secure the financial rewards” for their inventions. Univis, 316 U. S., at 250. But once a patentee sells an item, it has “enjoyed all the rights secured” by that limited monopoly. Keeler v. Standard Folding Bed Co.,157 U. S. 659,661 (1895) . Because “the purpose of the patent law is fulfilled . . . when the patentee has received his reward for the use of his invention,” that law furnishes “no basis for restraining the use and enjoyment of the thing sold.” Univis, 316 U. S., at 251.

We have explained in the context of copyright law that exhaustion has “an impeccable historic pedigree,” tracing its lineage back to the “common law’s refusal to permit restraints on the alienation of chattels.” Kirtsaeng v. John Wiley & Sons, Inc.,568 U. S. 519,538 (2013) . As Lord Coke put it in the 17th century, if an owner restricts the resale or use of an item after selling it, that restriction “is voide, because . . . it is against Trade and Traffique, and bargaining and contracting betweene man and man.” 1 E. Coke, Institutes of the Laws of England §360, p. 223 (1628); see J. Gray, Restraints on the Alienation of Prop-erty §27, p. 18 (2d ed. 1895) (“A condition or conditional limitation on alienation attached to a transfer of the entire interest in personalty is as void as if attached to a fee simple in land”).

This venerable principle is not, as the Federal Circuit dismissively viewed it, merely “one common-law jurisdiction’s general judicial policy at one time toward anti-alienation restrictions.” 816 F. 3d, at 750. Congress enacted and has repeatedly revised the Patent Act against the backdrop of the hostility toward restraints on alienation. That enmity is reflected in the exhaustion doctrine. The patent laws do not include the right to “restrain[ ] . . . further alienation” after an initial sale; such conditions have been “hateful to the law from Lord Coke’s day to ours” and are “obnoxious to the public interest.” Straus v. Victor Talking Machine Co.,243 U. S. 490,501 (1917) . “The inconvenience and annoyance to the public that an opposite conclusion would occasion are too obvious to require illustration.” Keeler, 157 U. S., at 667.

But an illustration never hurts. Take a shop that restores and sells used cars. The business works because the shop can rest assured that, so long as those bringing in the cars own them, the shop is free to repair and resell those vehicles. That smooth flow of commerce would sputter if companies that make the thousands of parts that go into a vehicle could keep their patent rights after the first sale. Those companies might, for instance, restrict resale rights and sue the shop owner for patent infringement. And even if they refrained from imposing such restrictions, the very threat of patent liability would force the shop to invest in efforts to protect itself from hidden lawsuits. Either way, extending the patent rights beyond the first sale would clog the channels of commerce, with little benefit from the extra control that the patentees retain. And advances in technology, along with increasingly complex supply chains, magnify the problem. See Brief for Costco Wholesale Corp. et al. as Amici Curiae 7–9; Brief for Intel Corp. et al. as Amici Curiae 17, n. 5 (“A generic smartphone assembled from various high-tech components could practice an estimated 250,000 patents”).

This Court accordingly has long held that, even when a patentee sells an item under an express restriction, the patentee does not retain patent rights in that product. In Boston Store of Chicago v. American Graphophone Co., for example, a manufacturer sold graphophones—one of the earliest devices for recording and reproducing sounds—to retailers under contracts requiring those stores to resell at a specific price. 246 U. S. 8–18 (1918). When the manufacturer brought a patent infringement suit against a retailer who sold for less, we concluded that there was “no room for controversy” about the result: By selling the item, the manufacturer placed it “beyond the confines of the patent law, [and] could not, by qualifying restrictions as to use, keep [it] under the patent monopoly.” Id., at 20, 25.

Two decades later, we confronted a similar arrangement in United States v. Univis Lens Co. There, a company that made eyeglass lenses authorized an agent to sell its products to wholesalers and retailers only if they promised to market the lenses at fixed prices. The Government filed an antitrust lawsuit, and the company defended its arrangement on the ground that it was exercising authority under the Patent Act. We held that the initial sales “relinquish[ed] . . . the patent monopoly with respect to the article[s] sold,” so the “stipulation . . . fixing resale prices derive[d] no support from the patent and must stand on the same footing” as restrictions on unpatented goods. 316 U. S., at 249–251.

It is true that Boston Store and Univis involved resale price restrictions that, at the time of those decisions, violated the antitrust laws. But in both cases it was the sale of the items, rather than the illegality of the restrictions, that prevented the patentees from enforcing those resale price agreements through patent infringement suits. And if there were any lingering doubt that patent exhaustion applies even when a sale is subject to an express, otherwise lawful restriction, our recent decision in Quanta Computer, Inc. v. LG Electronics, Inc. settled the matter. In that case, a technology company—with authorization from the patentee—sold microprocessors under contracts requiring purchasers to use those processors with other parts that the company manufactured. One buyer disregarded the restriction, and the patentee sued for infringement. Without so much as mentioning the lawfulness of the contract, we held that the patentee could not bring an infringement suit because the “authorized sale . . . took its products outside the scope of the patent monopoly.” 553 U. S., at 638.

Turning to the case at hand, we conclude that this well-settled line of precedent allows for only one answer: Lexmark cannot bring a patent infringement suit against Impression Products to enforce the single-use/no-resale provision accompanying its Return Program cartridges. Once sold, the Return Program cartridges passed outside of the patent monopoly, and whatever rights Lexmark retained are a matter of the contracts with its purchasers, not the patent law.

B

The Federal Circuit reached a different result largely because it got off on the wrong foot. The “exhaustion doctrine,” the court believed, “must be understood as an interpretation of” the infringement statute, which prohibits anyone from using or selling a patented article “without authority” from the patentee. 816 F. 3d, at 734 (quoting 35 U. S. C. §271(a)). Exhaustion reflects a default rule that a patentee’s decision to sell an item “presumptively grant[s] ‘authority’ to the purchaser to use it and resell it.” 816 F. 3d, at 742. But, the Federal Circuit explained, the patentee does not have to hand over the full “bundle of rights” every time. Id., at 741 (internal quotation marks omitted). If the patentee expressly withholds a stick from the bundle—perhaps by restricting the purchaser’s resale rights—the buyer never acquires that withheld authority, and the patentee may continue to enforce its right to exclude that practice under the patent laws.

The misstep in this logic is that the exhaustion doctrine is not a presumption about the authority that comes along with a sale; it is instead a limit on “the scope of the patentee’s rights.” United States v. General Elec. Co.,272 U. S. 476,489 (1926) (emphasis added). The right to use, sell, or import an item exists independently of the Patent Act. What a patent adds—and grants exclusively to the pat-entee—is a limited right to prevent others from engaging in those practices. See Crown Die & Tool Co. v. Nye Tool & Machine Works,261 U. S. 24,35 (1923) . Exhaustion extinguishes that exclusionary power. See Bloomer, 14 How., at 549 (the purchaser “exercises no rights created by the act of Congress, nor does he derive title to [the item] by virtue of the . . . exclusive privilege granted to the patentee”). As a result, the sale transfers the right to use, sell, or import because those are the rights that come along with ownership, and the buyer is free and clear of an infringement lawsuit because there is no exclusionary right left to enforce.

The Federal Circuit also expressed concern that preventing patentees from reserving patent rights when they sell goods would create an artificial distinction between such sales and sales by licensees. Patentees, the court explained, often license others to make and sell their products, and may place restrictions on those licenses. A computer developer could, for instance, license a manufacturer to make its patented devices and sell them only for non-commercial use by individuals. If a licensee breaches the license by selling a computer for commercial use, the patentee can sue the licensee for infringement. And, in the Federal Circuit’s view, our decision in General Talking PicturesCorp. v. Western Elec. Co.,304 U. S. 175, aff’d on reh’g, 305 U. S. 124 (1938) , established that—when a patentee grants a license “under clearly stated restrictions on post-sale activities” of those who purchase products from the licensee—the patentee can also sue for infringement those purchasers who knowingly violate the restrictions. 816 F. 3d, at 743–744. If patentees can employ licenses to impose post-sale restrictions on purchasers that are enforceable through infringement suits, the court concluded, it would make little sense to prevent patentees from doing so when they sell directly to consumers.

The Federal Circuit’s concern is misplaced. A patentee can impose restrictions on licensees because a license does not implicate the same concerns about restraints on alienation as a sale. Patent exhaustion reflects the principle that, when an item passes into commerce, it should not be shaded by a legal cloud on title as it moves through the marketplace. But a license is not about passing title to a product, it is about changing the contours of the patentee’s monopoly: The patentee agrees not to exclude a licensee from making or selling the patented invention, expanding the club of authorized producers and sellers. See General Elec. Co., 272 U. S., at 489–490. Because the patentee is exchanging rights, not goods, it is free to relinquish only a portion of its bundle of patent protections.

A patentee’s authority to limit licensees does not, as the Federal Circuit thought, mean that patentees can use licenses to impose post-sale restrictions on purchasers that are enforceable through the patent laws. So long as a licensee complies with the license when selling an item, the patentee has, in effect, authorized the sale. That licensee’s sale is treated, for purposes of patent exhaustion, as if the patentee made the sale itself. The result: The sale exhausts the patentee’s rights in that item. See Hobbie v. Jennison,149 U. S. 355–363 (1893). A license may require the licensee to impose a restriction on purchasers, like the license limiting the computer manufacturer to selling for non-commercial use by individuals. But if the licensee does so—by, perhaps, having each customer sign a contract promising not to use the computers in business—the sale nonetheless exhausts all patent rights in the item sold. See Motion Picture Patents Co. v. Universal Film Mfg. Co.,243 U. S. 502–507, 516 (1917). The purchasers might not comply with the restriction, but the only recourse for the licensee is through contract law, just as if the patentee itself sold the item with a restriction.

General Talking Pictures involved a fundamentally different situation: There, a licensee “knowingly ma[de] . . . sales . . . outside the scope of its license.” 304 U. S., at 181–182 (emphasis added). We treated the sale “as if no license whatsoever had been granted” by the patentee, which meant that the patentee could sue both the licensee and the purchaser—who knew about the breach—for infringement. General Talking Pictures Corp. v. Western Elec. Co.,305 U. S. 124,127 (1938) . This does not mean that patentees can use licenses to impose post-sale restraints on purchasers. Quite the contrary: The licensee infringed the patentee’s rights because it did not comply with the terms of its license, and the patentee could bring a patent suit against the purchaser only because the purchaser participated in the licensee’s infringement. General Talking Pictures, then, stands for the modest principle that, if a patentee has not given authority for a licensee to make a sale, that sale cannot exhaust the patentee’s rights.

In sum, patent exhaustion is uniform and automatic. Once a patentee decides to sell—whether on its own or through a licensee—that sale exhausts its patent rights, regardless of any post-sale restrictions the patentee purports to impose, either directly or through a license.

III

Our conclusion that Lexmark exhausted its patent rights when it sold the domestic Return Program cartridges goes only halfway to resolving this case. Lexmark also sold toner cartridges abroad and sued Impression Products for patent infringement for “importing [Lexmark’s] invention into the United States.” 35 U. S. C. §154(a). Lexmark contends that it may sue for infringement with respect to all of the imported cartridges—not just those in the Return Program—because a foreign sale does not trigger patent exhaustion unless the patentee “expressly or implicitly transfer[s] or license[s]” its rights. Brief for Respondent 36–37. The Federal Circuit agreed, but we do not. An authorized sale outside the United States, just as one within the United States, exhausts all rights under the Patent Act.

This question about international exhaustion of intellectual property rights has also arisen in the context of copyright law. Under the “first sale doctrine,” which is codified at 17 U. S. C. §109(a), when a copyright owner sells a lawfully made copy of its work, it loses the power to restrict the purchaser’s freedom “to sell or otherwise dispose of . . . that copy.” In Kirtsaeng v. John Wiley & Sons, Inc., we held that this “ ‘first sale’ [rule] applies to copies of a copyrighted work lawfully made [and sold] abroad.” 568 U. S., at 525. We began with the text of §109(a), but it was not decisive: The language neither “restrict[s] the scope of [the] ‘first sale’ doctrine geographically,” nor clearly embraces international exhaustion. Id., at 528–533. What helped tip the scales for global exhaustion was the fact that the first sale doctrine originated in “the common law’s refusal to permit restraints on the alienation of chattels.” Id., at 538. That “common-law doctrine makes no geographical distinctions.” Id., at 539. The lack of any textual basis for distinguishing between domestic and international sales meant that “a straightforward application” of the first sale doctrine required the conclusion that it applies overseas. Id., at 540 (internal quotation marks omitted).

Applying patent exhaustion to foreign sales is just as straightforward. Patent exhaustion, too, has its roots in the antipathy toward restraints on alienation, see supra, at 6–8, and nothing in the text or history of the Patent Act shows that Congress intended to confine that borderless common law principle to domestic sales. In fact, Congress has not altered patent exhaustion at all; it remains an unwritten limit on the scope of the patentee’s monopoly. See Astoria Fed. Sav. & Loan Assn. v. Solimino,501 U. S. 104,108 (1991) (“[W]here a common-law principle is well established, . . . courts may take it as given that Congress has legislated with an expectation that the principle will apply except when a statutory purpose to the contrary is evident” (internal quotation marks omitted)). And differentiating the patent exhaustion and copyright first sale doctrines would make little theoretical or practical sense: The two share a “strong similarity . . . and identity of purpose,” Bauer & Cie v. O’Donnell,229 U. S. 1,13 (1913) , and many everyday products—“automobiles, microwaves, calculators, mobile phones, tablets, and personal computers”—are subject to both patent and copyright protections, see Kirtsaeng, 568 U. S., at 545; Brief for Costco Wholesale Corp. et al. as Amici Curiae 14–15. There is a “historic kinship between patent law and copyright law,” Sony Corp. of America v. Universal City Studios, Inc.,464 U. S. 417,439 (1984) , and the bond between the two leaves no room for a rift on the question of international exhaustion.

Lexmark sees the matter differently. The Patent Act, it points out, limits the patentee’s “right to exclude others” from making, using, selling, or importing its products to acts that occur in the United States. 35 U. S. C. §154(a). A domestic sale, it argues, triggers exhaustion because the sale compensates the patentee for “surrendering [those] U. S. rights.” Brief for Respondent 38. A foreign sale is different: The Patent Act does not give patentees exclusionary powers abroad. Without those powers, a patentee selling in a foreign market may not be able to sell its product for the same price that it could in the United States, and therefore is not sure to receive “the reward guaranteed by U. S. patent law.” Id., at 39 (internal quotation marks omitted). Absent that reward, says Lexmark, there should be no exhaustion. In short, there is no patent exhaustion from sales abroad because there are no patent rights abroad to exhaust.

The territorial limit on patent rights is, however, no basis for distinguishing copyright protections; those protections “do not have any extraterritorial operation” either. 5 M. Nimmer & D. Nimmer, Copyright §17.02, p. 17–26 (2017). Nor does the territorial limit support the premise of Lexmark’s argument. Exhaustion is a separate limit on the patent grant, and does not depend on the patentee receiving some undefined premium for selling the right to access the American market. A purchaser buys an item, not patent rights. And exhaustion is triggered by the patentee’s decision to give that item up and receive whatever fee it decides is appropriate “for the article and the invention which it embodies.” Univis, 316 U. S., at 251. The patentee may not be able to command the same amount for its products abroad as it does in the United States. But the Patent Act does not guarantee a particular price, much less the price from selling to American consumers. Instead, the right to exclude just ensures that the patentee receives one reward—of whatever amount the patentee deems to be “satisfactory compensation,” Keeler, 157 U. S., at 661—for every item that passes outside the scope of the patent monopoly.

This Court has addressed international patent exhaustion in only one case, Boesch v. Gräff, decided over 125 years ago. All that case illustrates is that a sale abroad does not exhaust a patentee’s rights when the patentee had nothing to do with the transaction. Boesch—from the days before the widespread adoption of electrical lighting—involved a retailer who purchased lamp burners from a manufacturer in Germany, with plans to sell them in the United States. The manufacturer had authority to make the burners under German law, but there was a hitch: Two individuals with no ties to the German manufacturer held the American patent to that invention. These patentees sued the retailer for infringement when the retailer imported the lamp burners into the United States, and we rejected the argument that the German manufacturer’s sale had exhausted the American patentees’ rights. The German manufacturer had no permission to sell in the United States from the American patentees, and the American patentees had not exhausted their patent rights in the products because they had not sold them to anyone, so “purchasers from [the German manufacturer] could not be thereby authorized to sell the articles in the United States.” 133 U. S. 697,703 (1890) .

Our decision did not, as Lexmark contends, exempt all foreign sales from patent exhaustion. See Brief for Respondent 44–45. Rather, it reaffirmed the basic premise that only the patentee can decide whether to make a sale that exhausts its patent rights in an item. The American patentees did not do so with respect to the German products, so the German sales did not exhaust their rights.

Finally, the United States, as an amicus, advocates what it views as a middle-ground position: that “a foreign sale authorized by the U. S. patentee exhausts U. S. pat-ent rights unless those rights are expressly reserved.” Brief for United States 7–8. Its position is largely based on policy rather than principle. The Government thinks that an overseas “buyer’s legitimate expectation” is that a “sale conveys all of the seller’s interest in the patented article,” so the presumption should be that a foreign sale triggers exhaustion. Id., at 32–33. But, at the same time, “lower courts long ago coalesced around” the rule that “a patentee’s express reservation of U. S. patent rights at the time of a foreign sale will be given effect,” so that option should remain open to the patentee. Id., at 22 (emphasis deleted).

The Government has little more than “long ago” on its side. In the 1890s, two circuit courts—in cases involving the same company—did hold that patentees may use express restrictions to reserve their patent rights in connection with foreign sales. See Dickerson v. Tinling, 84 F. 192, 194–195 (CA8 1897); Dickerson v. Matheson, 57 F. 524, 527 (CA2 1893). But no “coalesc[ing]” ever took place: Over the following hundred-plus years, only a smattering of lower court decisions mentioned this express-reservation rule for foreign sales. See, e.g., Sanofi, S. A. v. Med-Tech Veterinarian Prods., Inc., 565 F. Supp. 931, 938 (NJ 1983). And in 2001, the Federal Circuit adopted its blanket rule that foreign sales do not trigger exhaustion, even if the patentee fails to expressly reserve its rights. Jazz Photo, 264 F. 3d, at 1105. These sparse and inconsistent decisions provide no basis for any expectation, let alone a settled one, that patentees can reserve patent rights when they sell abroad.

The theory behind the Government’s express-reservation rule also wrongly focuses on the likely expectations of the patentee and purchaser during a sale. Exhaustion does not arise because of the parties’ expectations about how sales transfer patent rights. More is at stake when it comes to patents than simply the dealings between the parties, which can be addressed through contract law. Instead, exhaustion occurs because, in a sale, the patentee elects to give up title to an item in exchange for payment. Allowing patent rights to stick remora-like to that item as it flows through the market would violate the principle against restraints on alienation. Exhaustion does not depend on whether the patentee receives a premium for selling in the United States, orthe type of rights that buyers expect to receive. As a result, restrictions and location are irrelevant; what matters is the patentee’s decision to make a sale.

*  *  *

The judgment of the United States Court of Appeals for the Federal Circuit is reversed, and the case is remanded for further proceedings consistent with this opinion.

It is so ordered.

Justice Gorsuch took no part in the consideration or decision of this case.


TOP

Opinion

SUPREME COURT OF THE UNITED STATES

_________________

No. 15–1189

_________________

IMPRESSION PRODUCTS, INC., PETITIONER v. LEXMARK INTERNATIONAL, INC.

on writ of certiorari to the united states court of appeals for the federal circuit


[May 30, 2017]


Justice Ginsburg, concurring in part and dissenting in part.

I concur in the Court’s holding regarding domestic exhaustion—a patentee who sells a product with an express restriction on reuse or resale may not enforce that restriction through an infringement lawsuit, because the U. S. sale exhausts the U. S. patent rights in the product sold. See ante, at 5–13. I dissent, however, from the Court’s holding on international exhaustion. A foreign sale, I would hold, does not exhaust a U. S. inventor’s U. S. patent rights.

Patent law is territorial. When an inventor receives a U. S. patent, that patent provides no protection abroad. See Deepsouth Packing Co. v. Laitram Corp.,406 U. S. 518,531 (1972) (“Our patent system makes no claim to extraterritorial effect.”). See also 35 U. S. C. §271(a) (establishing liability for acts of patent infringement “within the United States” and for “import[ation] into the United States [of] any patented invention”). A U. S. pat-entee must apply to each country in which she seeks the exclusive right to sell her invention. Microsoft Corp. v. AT&T Corp.,550 U. S. 437,456 (2007) (“[F]oreign law alone, not United States law, currently governs the manufacture and sale of components of patented inventions in foreign countries.”). See also Convention at Brussels, An Additional Act Modifying the Paris Convention for the Protection of Industrial Property of Mar. 20, 1883, Dec. 14, 1900, Art. I, 32Stat. 1940 (“Patents applied for in the different contracting States . . . shall be independent of the patents obtained for the same invention in the other States.”). And patent laws vary by country; each country’s laws “may embody different policy judgments about the relative rights of inventors, competitors, and the public in patented inventions.” Microsoft, 550 U. S., at 455 (internal quotation marks omitted).

Because a sale abroad operates independently of the U. S. patent system, it makes little sense to say that such a sale exhausts an inventor’s U. S. patent rights. U. S. patent protection accompanies none of a U. S. patentee’s sales abroad—a competitor could sell the same patented product abroad with no U. S.-patent-law consequence. Accordingly, the foreign sale should not diminish the protections of U. S. law in the United States.

The majority disagrees, in part because this Court decided, in Kirtsaeng v. John Wiley & Sons, Inc.,568 U. S. 519,525 (2013) , that a foreign sale exhausts U. S. copyright protections. Copyright and patent exhaustion, the majority states, “share a strong similarity.” Ante, at 14 (internal quotation marks omitted). I dissented from our decision in Kirtsaeng and adhere to the view that a foreign sale should not exhaust U. S. copyright protections. See 568 U. S., at 557.

But even if I subscribed to Kirtsaeng’s reasoning with respect to copyright, that decision should bear little weight in the patent context. Although there may be a “historical kinship” between patent law and copyright law, Sony Corp. of America v. Universal City Studios, Inc.,464 U. S. 417,439 (1984) , the two “are not identical twins,” id, at 439, n. 19. The Patent Act contains no analogue to 17 U. S. C. §109(a), the Copyright Act first-sale provision analyzed in Kirtsaeng. See ante, at 13–14. More importantly, copyright protections, unlike patent protections, are harmonized across countries. Under the Berne Convention, which 174 countries have joined,1 members “agree to treat authors from other member countries as well as they treat their own.” Golan v. Holder,565 U. S. 302,308 (2012) (citing Berne Convention for the Protection of Literary and Artistic Works, Sept. 9, 1886, as revised at Stockholm on July 14, 1967, Arts. 1, 5(1), 828 U. N. T. S. 225, 231–233). The copyright protections one receives abroad are thus likely to be similar to those received at home, even if provided under each country’s separate copyright regime.

For these reasons, I would affirm the Federal Circuit’s judgment with respect to foreign exhaustion.



Maybe Skip SHA-3

$
0
0

In 2005 and 2006, a series of significant results were published against SHA-1 [1][2][3]. These repeated break-throughs caused something of a crisis of faith as cryptographers questioned whether we knew how to build hash functions at all. After all, many hash functions from the 1990's had not aged well.

In the wake of this, NIST announced (PDF) a competition to develop SHA-3 in order to hedge the risk of SHA-2 falling. In 2012, Keccak (pronounced “ket-chak”, I believe) won (PDF) and became SHA-3. But the competition itself proved that we do know how to build hash functions: the series of results in 2005 didn't extend to SHA-2 and the SHA-3 process produced a number of hash functions, all of which are secure as far as we can tell. Thus, by the time it existed, it was no longer clear that SHA-3 was needed. Yet there is a natural tendency to assume that SHA-3 must be better than SHA-2 because the number is bigger.

As I've mentioned before, diversity of cryptographic primitives is expensive. It contributes to the exponential number of combinations that need to be tested and hardened; it draws on limited developer resources as multiple platforms typically need separate, optimised code; and it contributes to code-size, which is a worry again in the mobile age. SHA-3 is also slow, and is even slower than SHA-2 which is already a comparative laggard amongst crypto primitives.

SHA-3 did introduce something useful: extendable output functions (XOFs), in the form of the SHAKE algorithms. In an XOF, input is hashed and then an (effectively) unlimited amount of output can be produced from it. It's convenient, although the same effect can be produced for a limited amount of output using HKDF, or by hashing to a key and running ChaCha20 or AES-CTR.

Thus I believe that SHA-3 should probably not be used. It offers no compelling advantage over SHA-2 and brings many costs. The only argument that I can credit is that it's nice to have a backup hash function, but both SHA-256 and SHA-512 are commonly supported and have different cores. So we already have two secure hash functions deployed and I don't think we need another.

BLAKE2 is another new, secure hash function, but it at least offers much improved speed over SHA-2. Speed is important. Not only does it mean less CPU time spent on cryptography, it means that cryptography can be economically deployed in places where it couldn't be before. BLAKE2, however, has too many versions: eight at the current count (BLAKE2(X)?[sb](p)?). In response to complaints about speed, the Keccak team now have KangarooTwelve and MarsupilamiFourteen, which have a vector-based design for better performance. (Although a vector-based design can also be used to speed up SHA-2.)

So there are some interesting prospects for a future, faster replacement for SHA-2. But SHA-3 itself isn't one of them.

Real-Time Music Visualization on the iPhone GPU

$
0
0

Earlier this year we organized an in-house hackathon at Deezer. One of the themes was “More Emotional Engagement”. We decided to get together and work on a real-time music visualizer (think Winamp). The idea was to display an animation that would react to the music currently playing in the Deezer app.

We required a very flexible framework and playground in order to make original animations, so we resolved to create a visualization directly on the GPU using shaders. We also included a bonus: they could run on Android, in web browsers with WebGL or any platform compatible with OpenGL.

Flow for a real-time music visualization on the GPU

Extracting useful information from the audio

The first thing was to identify the information that needed to be extracted from the track. There were several options: we could obtain the current power/volume from the audio signal (think RMS) or provoke a reaction if a high-pitched sound was emitted. The main tool used to work on frequencies using a signal is called a Fourier transform. The method is to apply a FFT (Fast Fourier Transform) algorithm on the audio signal.

There are a few ways to do that on iOS. We chose to use AVAudioEngine, then tapped on the output buffer and finally applied the FFT with the help of the Accelerate framework.

But before that we needed to initialize an instance of AVAudioEngine with an AVAudioPlayerNode. You can see the process in the following code extract.

Following that step we needed to get the audio buffer (an array of float) to perform the FFT. In order to do so, we used the method installTap to observe the output of the player node.

Now the fun part: performing the FFT on iOS. As I said earlier, in order to succeed we recommend you use the Accelerate framework. You can see a Swift implementation below.

Transferring the FFT to the GPU

Now that we had the FFT output we wanted to explore what we could do achieve.

The idea is to create the visualization with a shader firstly, because it’s fast and secondly because it’s fun. You can look at what people are doing on Shadertoy. It’s inspiring.

Creating the OpenGL view

We decided to go with OpenGL as it’s supported by almost every mobile platform. We could have attempted the same thing with Metal but we would have lost the cross-platform ability that OpenGL shaders offer.

We needed to show GLKViewController and then display a rectangle with a GLSL shader program attached to it.

So the idea is to display two triangles. Here is the data we sent to the GPU below:

We then created the buffer objects to display everything we needed. You can check out the process here. It’s still a bit cumbersome to work with C methods in swift — especially when there are pointers involved, but all in all we still managed to get the desired result.

Passing the data to the GPU

The tricky part is generally to transfer the FFT output data to the GPU as a GPU is mainly used to handle graphics. The way to do it is to transfer a texture but instead of receiving an image you obtain the FFT data stored in the pixels. You can see how we store the float array into a texture below:

The visualizations

Now that we had everything sorted on the GPU side, we needed to create the visualization. If you’re familiar with GLSL, it’s quite a simple task: you just write a fragment shader that uses the FFT output data as a texture as well as a few uniforms (elapsed time, mean value of the audio signal, etc.)

FFT Output Texture

For a quick introduction to GLSL shader programming you can read the very good Book of Shaders.

Here is a simple shader that only displays the FFT data as a texture in grayscale.

This was all great but we needed to go a step further. We could compute the RMS (Root Mean Square) of the audio signal to have one single value representing the current audio level. In our case we turned it into a uniform variable for the fragment shader. We call it u_rms (cf. the code snippet below).

A simple circle whose size depends on the mean audio signal value

Just for fun we did a few more…

More colors by Adrien Coye
Trippy visualization adapted by Nicolas Le Breton

Next steps for this hackathon project?

We’re always exploring new ways to improve your listening experience. We believe a clever visualization is a good way to accomplish this. This experiment will be integrated into the app one way or another, whether it’s in the Deezer mobile app ‘Labs’ or in the actual player.

By the way

You can follow some of the tech events we host on our dedicated DeezerTech meet up group and discover our latest career opportunities on jobs.deezer.com. We’re currently looking for several Senior and Lead iOS engineers to join our team.

The Exquisitely English (and Lucrative) World of London Clerks

$
0
0

At Fountain Court Chambers in central London, the senior clerk is called Alex Taylor. A trim, bald 54-year-old who favors Italian suiting, Taylor isn’t actually named Alex. Traditionally in English law, should a newly hired clerk have the same Christian name as an existing member of the staff, he’s given a new one, allegedly to avoid confusion on the telephone. During his career, Taylor has been through no fewer than three names. His birth certificate reads “Mark.” When he first got to Fountain Court in 1979, the presence of another Mark saw him renamed John. Taylor remained a John through moves to two other chambers. Upon returning to Fountain Court, in 2008, he became Alex. At home his wife still calls him Mark.

Alex/John/Mark Taylor belongs to one of the last surviving professions of Dickensian London. Clerks have co-existed with chimney sweeps and gene splicers. It’s a trade that one can enter as a teenager, with no formal qualifications, and that’s astonishingly well-paid. A senior clerk can earn a half-million pounds per year, or more than $650,000, and some who are especially entrenched make far more.

Clerks—pronounced “clarks”—have no equivalent in the U.S. legal system, and have nothing in common with the Ivy League–trained Supreme Court aides of the same spelling. They exist because in England and Wales, to simplify a bit, the role of lawyer is divided in two: There are solicitors, who provide legal advice from their offices, and there are barristers, who argue in court. Barristers get the majority of their business via solicitors, and clerks act as the crucial middlemen between the tribes—they work for and sell the services of their barristers, steering inquiring solicitors to the right man or woman.

Clerks are by their own cheerful admission “wheeler-dealers,” what Americans might call hustlers. They take a certain pride in managing the careers of their bosses, the barristers—a breed that often combines academic brilliance with emotional fragility. Many barristers regard clerks as their pimps. Some, particularly at the junior end of the profession, live in terror of clerks. The power dynamic is baroque and deeply English, with a naked class divide seen in few other places on the planet. Barristers employ clerks, but a bad relationship can strangle their supply of cases. In his 1861 novel Orley Farm, Anthony Trollope described a barrister’s clerk as a man who “looked down from a considerable altitude on some men who from their professional rank might have been considered as his superiors.”

Fountain Court is among the most prestigious groups in London practicing commercial law, the branch that deals with business disputes. One day last summer, Taylor gave a tour of the premises, just north of the River Thames. The waiting room had been recently remodeled, with upholstered sofas, low tables, and asymmetrically hung pictures that called to mind an upmarket hotel. Taylor explained that the barristers had tried to walk an aesthetic line between modernity and the heritage that clients expect of people who are sometimes still required to wear a horsehair wig to court. Barristers are self-employed; chambers are a traditional way for them to band together to share expenses, though not profits. The highest-ranking members, barristers who’ve achieved the rank of Queen’s Counsel, are nicknamed silks, after the plush material used to make their robes. But even the silks cannot practice without the services of clerks, who operate from a designated room in each chambers, matching the ability and availability of barristers to solicitors in need.

In the Fountain Court clerks room, Taylor sat at the head of a long table, flanked by subordinates wearing telephone headsets. Clerking has historically been a dynastic profession monopolized by white working-class families from the East End of London; Taylor’s son is a clerk. Predominantly, clerks hail from Hertfordshire, Kent, and above all Essex, a county that’s ubiquitously compared to New Jersey in the U.S. Many clerks rooms in London remain male-dominated, but several women work for Taylor, including two team leaders.

Each morning, a platoon of Taylor’s junior clerks sets forth into London pushing special German-manufactured two-wheeled trolleys, equipped with chunky tires for navigating the city’s streets and stairs. They’re laden with hundreds of pounds of legal documents that must be delivered to Fountain Court barristers at various courtrooms, from the nearby Royal Courts of Justice to the Supreme Court, more than a mile away. Hard physical labor doesn’t really correspond to the more senior work of clerking, which is phone- and email-based, and trolley-pushing is often pointed to as a reason for the relative dearth of female clerks higher up the career ladder. One junior Fountain Court clerk, Amber Field, 19, described how on one occasion, when she took hold of a trolley’s handlebars and tried to muscle it into a rolling position, it didn’t budge—she lifted herself up instead, like a gymnast on the parallel bars.

But the idea that time “on the trolleys” is necessary persists. British commercial courtrooms have been slow to adopt technology; barristers at Fountain Court and elsewhere remain adamant that they can only advocate properly with stacks of paper on hand, rather than off a screen. Some clerks argue that the trolleys help juniors absorb skills, learn the city’s legal sites, and meet important people. But additionally, the trolley work serves as an unglamorous rite of passage, guarding the gilded summit of clerking from interlopers. Trolleys keep a closed shop closed, well into the 21st century. In the era of Brexit, as Britons turn inward, few professions better embody their abiding interest in keeping things as they are.

Clerks at work: Fountain Court’s Maisie Taylor (no relation to Alex).

Photographer: Nick Ballon for Bloomberg Businessweek

London’s barrister population is getting more diverse, but it’s still disproportionately made up of men who attended the best private secondary schools, and then Oxford and Cambridge, before joining one of four legal associations, known as Inns of Court—a cosseted progression known as moving “quad to quad to quad.” In short, barristers tend to be posh. Being a successful clerk, therefore, allows working-class men and, increasingly, women to exert power over their social superiors. It’s an enduring example of a classic British phenomenon: professional interaction across a chasmic class divide.

One of the most peculiar aspects of the clerk-barrister relationship is that clerks handle money negotiations with clients. Barristers argue that avoiding fee discussions keeps their own interactions with clients clean and uncomplicated, but as a consequence, they’re sometimes unaware of how much they actually charge. The practice also insulates and coddles them. Clerks become enablers of all sorts of curious, and in some cases self-destructive, behavior.

At Fountain Court, I spent an afternoon with Paul Gott, one of the chambers’ star barristers. He stood surrounded by packing cases—he was in the process of moving his office from an annex across the street, where it had become a small tourist attraction. Visitors would stop outside to stare through a window at Gott’s extraordinary collection of objects: antique barristers’ wig tins, an original wax-cylinder Dictaphone, a deactivated Kalashnikov assault rifle and hand grenades, stamps, and an assortment of vintage medical instruments of alarming purpose.

Like many top barristers, Gott had effectively won the English educational system: He has a double-first-class degree (top marks in preliminary as well as final exams) from Cambridge. As he spoke about his work—Gott specializes in securing injunctions against striking workers—he cut open a packing case with a metal device that he identified as a fleam, an obsolete surgical implement used for bloodletting. Outside of work, Gott divides his time between two homes: one in a Martello tower—a kind of defensive fort built to fend off Napoleon—and another in a converted military landing craft moored on the Thames that he calls the “Houseboat Potemkin.” The Chambers and Partners legal directory describes Gott as “phenomenally intelligent,” but his eccentric professional demeanor is only possible because he has a hardheaded Alex Taylor to intercede between him and the world, wrangling with clients and handling payments. Taylor creates the space for Gott’s personality even as he’s employed by him.

A more unsavory side of this coddling relationship is apparent elsewhere. At a chambers called 4 Stone Buildings, a clerk called Chris O’Brien, 28, told me he was once asked to dress a boil on a barrister’s back. Among clerks, tales of buying gifts for their barristers’ mistresses are legion. But they maintain a level of sympathy for their employers, whose work is competitive and often profoundly isolating. Clerks speak of how their masters, no matter how successful, live in perpetual fear that their current case will be their last. Counsel, the English bar’s monthly journal, recently ran a major spread on mental health. John Jones, a prominent silk at Doughty Street Chambers who’d represented Julian Assange, died last year when he jumped in front of a train.

Richard Evans at Fountain Court.

Photographer: Nick Ballon for Bloomberg Businessweek

John Flood, a legal sociologist who in 1983 published the only book-length study of barristers’ clerks, subtitled The Law’s Middlemen, uses an anthropological lens to explain the relationship. He suggests that barristers, as the de facto priests of English law—with special clothes and beautiful workplaces—require a separate tribe to keep the temple flames alight and press money from their congregation. Clerks keep barristers’ hands clean; in so doing they accrue power, and they’re paid accordingly.

I asked more than a dozen clerks and barristers, as well as a professional recruiter, what the field pays. Junior clerks, traditionally recruited straight after leaving school at 16 and potentially with no formal academic qualifications, start at £15,000 to £22,000 ($19,500 to $28,600); after 10 years they can make £85,000. Pay for senior clerks ranges from £120,000 to £500,000, and a distinct subset can earn £750,000. The Institute of Barristers’ Clerks disputed these figures, saying the lows were too low and the highs too high. But there’s no doubt that the best clerks are well-rewarded. David Grief, 63, a senior clerk at the esteemed Essex Court Chambers, spoke to me enthusiastically about his personal light airplane, a TB20 Trinidad.

Money is tightest in criminal law. One chambers, 3 Temple Gardens, lies 200 yards from Fountain Court but might as well inhabit a different dimension. Access is via a plunging staircase lined with green tiles similar to those in a Victorian prison. The clerks room, in the basement, is stacked with battered files detailing promising murders, rapes, and frauds. The senior clerk is Gary Brown, 53, who once played professional soccer. Even the barristers appear harried and ashen in comparison with their better-fed commercial-law counterparts.

The mean income of a criminal barrister working with legal-aid clients is £90,000, meaning even a successful criminal barrister likely makes less than a top commercial clerk. At Fountain Court, once described as a place so prestigious that “you could get silk just by sitting on the toilet,” I watched Taylor casually negotiate a fee above £20,000; at 3 Temple Gardens, the clerks wrangled deals for a few hundred pounds. The best-paid criminal clerks make perhaps £250,000 per year—and yet there’s an excitement and pressure to a criminal clerks room that’s absent in the commercial field.

One day I sat next to Brown’s deputy, Glenn Matthews, 41, as he worked out the running order for the courts the next day. For several sultry hours, Matthews juggled the availability of his barristers with the new cases coming in from solicitors and more that moved off a wait list. Some barristers only work as defense counsel, some only prosecute, and some alternate roles, depending on the case; Matthews balanced all this and also made elaborate plans to match barristers who’d already be in a certain provincial town with other cases nearby, to save on travel. It was complex, skilled work done with panache.

Many in the criminal field are motivated by a belief that they’re a crucial part of the British judicial machinery, and their work closely corresponds with the public’s imagination of what it is to work in the law. Silk, the preeminent British legal TV show of the past few years, focuses on a criminal chambers. It features a lupine senior clerk, Billy Lamb, who bullies, cajoles, bribes, and often appears to have the most fun.

Brown of 3 Temple Gardens; in criminal law, money is tight, but the work can be electric.

Photographer: Nick Ballon for Bloomberg Businessweek

As a chancery chambers, dealing with wills, trusts, banking, and other matters, 4 Stone Buildings is an establishment from the old school, with a facade still pockmarked by World War I bombs. Guests stride down a corridor with deep red wallpaper to a waiting room equipped with a fireplace and shelved with aged lawbooks. The best of the silks’ rooms face out across a low dry moat to the gardens of Lincoln’s Inn—one of the four Inns of Court, along with Gray’s Inn, Inner Temple, and Middle Temple, all less than a mile apart.

There are 34 barristers at 4 Stone, including Jonathan Crow, whose office features a stuffed crow on the mantelpiece. The clerks room is downstairs and furnished significantly less smartly, with desks set behind a shoplike wooden counter. When I visited, the clerks were exclusively white and male, and five of the six were from Essex. At the helm was David Goddard, 64, in charge since 1983. One legal handbook notes that his nickname is “God,” for his grip on the chambers.

I sat for two days in God’s room, observing clerks’ interactions with barristers across the wooden transom that were redolent of the upstairs-downstairs dynamic of Downton Abbey. The barristers spoke with “received pronunciation”—the polished accent traditionally spoken by the social elite and which, unlike lower-class accents, doesn’t vary by region; the clerks, fluent Essex—a nasal accent, with elements of cockney. One vital function clerks play is finessing a “cab rank” rule, set by the Bar Standards Board, that states a barrister must take the first case that comes, regardless of their interest. Clerks can invent or manipulate commitments to allow their barristers to turn down work that doesn’t appeal. (I didn’t witness this at 4 Stone.)

Taylor performs a clerking rite of passage: trolley-hauling.

Photographer: Nick Ballon for Bloomberg Businessweek

Before the U.K. decimalized its currency in 1971, clerks received “shillings on the guinea” for each case fee. Under the new money system, the senior clerks’ take was standardized at 10 percent of their chambers’ gross revenue. Sometimes, but not always, they paid their junior staff and expenses out of this tithe. Chambers at the time were typically small, four to six barristers strong, but in the 1980s, they grew. As they added barristers and collected more money, each chambers maintained just one chief clerk, whose income soared. The system was opaque: The self-employed barristers didn’t know what their peers within their own chambers were paid, and in a precomputer age, with all transactions recorded in a byzantine paper system, barristers sometimes didn’t know what their clerks earned, either. Jason Housden, a longtime clerk who now works at Matrix Chambers, told me that, when he started out in the 1980s at another office, his senior clerk routinely earned as much as the top barristers and on occasion was the best-paid man in the building.

One anecdote from around the same time, possibly apocryphal, is widely shared. At a chambers that had expanded and was bringing in more money, three silks decided their chief clerk’s compensation, at 10 percent, had gotten out of hand. They summoned him for a meeting and told him so. In a tactical response that highlights all the class baggage of the clerk-barrister relationship, as well as the acute British phobia of discussing money, the clerk surprised the barristers by agreeing with them. “I’m not going to take a penny more from you,” he concluded. The barristers, gobsmacked and paralyzed by manners, never raised the pay issue again, and the clerk remained on at 10 percent until retirement.

Since the 1980s, fee structures have often been renegotiated when a senior clerk retires. Purely commission-based arrangements are now rare—combinations of salary and incentive are the rule, though some holdouts remain. Goddard told me last summer that he receives 3 percent of the entire take of the barristers at 4 Stone; later he said this was inaccurate, and that his pay was determined by a “complicated formula.” (Pupil barristers, as trainees are known, start there at £65,000 per year, and the top silks each make several million pounds.)

The huge sums that clerks earn, at least relative to their formal qualifications, both sit at odds with the feudal nature of their employment and underpin it. In some chambers, clerks still refer to even junior barristers as “sir” or “miss.” Housden remembers discussing this issue early in his career with a senior clerk. He asked the man whether he found calling people half his age “sir” demeaning. The reply was straightforward: “For three-quarters of a million pounds per year, I’ll call anyone sir.”

Most chambers have become less formal, even as the class distinctions between barrister and clerk are in many ways intact. At 4 Stone, Goddard refers to the heads of chambers, John Brisby and George Bompas, as “Brizz” and “Bumps.” The traditional generic term used by clerks for a barrister is “guvnor,” though this appears to be fading. The intimacy of the long-term clerk-barrister relationship is nuanced. Goddard once walked into the room of a senior member of chambers who was proving particularly truculent. Goddard asked, “Why are you being such a c---?”

The barrister’s eyes lit up. “I love it when you talk to me like that,” he replied.

Ryan Tunkel of 4 Stone Buildings.

Photographer: Nick Ballon for Bloomberg Businessweek

The origins of clerking, like much of English law, run to the medieval period. In the 14th century, a lawyer would employ an individual known as a “manciple” to look after his house, in return for “a bed and a reasonable dinner,” the legal historian Samuel Thorne once wrote. Clerks as we might recognize them today existed by the 1666 Great Fire of London and were firmly established by the Victorian era. Efforts to modernize the clerking system have flickered in recent decades, with some success and a lot of rancor.

Around 1989 a former peace activist named Christine Kings attended a dinner party in East London where a group of barristers were complaining about their clerks, who they said terrorized them, ran their lives, and also earned much more than they did. The barristers had an idea: to set up a new sort of practice unfettered by ancient quirks of the bar, including the power of those uppity middlemen. They asked Kings, who had no legal background, to join them, taking on many of the duties typically performed by a senior clerk, but for much reduced pay.

Doughty Street Chambers, as they named their new association, controversially set up its operations outside the footprint of the four Inns of Court. As an interloper, Kings wasn’t popular with clerks. When she was a few months into the job, standing at the top of Chancery Lane, one tried to spit in her face. As others began to take on similar roles at various chambers—ex-military men at first, who met with little success, and then women—Kings organized informal gatherings to promote solidarity. One attendee said she’d found rat poison in her desk drawer.

Kings became the first professional chief executive officer of a barristers’ chambers in London. At a mass meeting of some 300 barristers and other personnel in the early 1990s, she spoke about her new role and the ways it broke from traditional clerking. When someone asked what she was paid, she replied that the Bar Council suggested £44,000. The barristers gaped—it was a fraction of what they paid their chief clerks to run their establishments. Since then, several chambers have experimented with professional heads from nonclerking backgrounds, under titles ranging from CEO to director, with varying responsibilities. At Fountain Court, an administrator deals with logistics, while the core part of clerking—the routing of incoming cases to barristers and fee negotiations—remains in traditional hands. (Kings, 59, now works at Outer Temple Chambers.)

Doughty Street Chambers has thrived. It’s best known as the professional home of the accomplished human-rights lawyer Amal Clooney. Another outfit that eschews the more suffocating traditions of the English bar is Matrix Chambers, which sits in a former police station at the northern fringe of Gray’s Inn. Matrix emerged in 2000 when a group of mostly human-rights barristers, including Cherie Blair, the wife of then-Prime Minister Tony Blair, splintered off from seven other chambers. Together, they aimed for a funky, fresh aesthetic, installing a DayGlo-illuminated reception desk inherited from an ad agency and refusing to pose for the traditional portraits of staff standing in front of lawbooks. Those who resented such modernizations referred to Matrix as Ratmix.

3 Temple Gardens’ Sam Edwards.

Photographer: Nick Ballon for Bloomberg Businessweek

Seventeen years after its founding, Matrix is an established part of the London legal landscape, with a particularly strong reputation in public, media, and employment law. (Matrix has represented Bloomberg LP, the owner of Bloomberg Businessweek.) Matrix doesn’t use the term “clerk.” Instead, there are three teams, called “practice managers,” that each deal with solicitors in different areas of the law. At the top is a chief executive, Lindsay Scott, a former solicitor who takes on many of the strategic duties of a senior clerk.

On a Friday morning, I watched as Hugh Southey, one of Matrix’s silks and a descendant of the Romantic poet Robert Southey, gave a presentation to the practice management team on “terrorism prevention and investigation measures.” The British government introduced these controversial legal maneuvers in 2011 to manage potential terrorists who can’t be charged or deported. Most chambers pay limited attention to the legal education of their clerks, who as a consequence sell a product they don’t understand. Matrix’s crew, with more women and nonwhite faces than most clerking staffs, are routinely given opportunities to learn.

Some in London legal circles regard Matrix’s reforms as semantic, noting the staff is thick with men from classic clerking backgrounds. Housden, Matrix’s practice director, started work as a teenage clerk, and one of his colleagues has been a clerk for 25 years. As different as Matrix or other reformers might want to be, they’re in the same marketplace as more orthodox chambers, and they play by a common set of rules and expectations that goes back centuries. One prevailing understanding of last year’s Brexit vote is that it signaled a desire to be more British, less beholden to outsiders’ notions of progress. Essex, the spiritual home of the clerk, had two of the five districts that voted the most overwhelmingly to leave the European Union.

As I spent time with London’s clerks, I had the impression of a group of people who’d learned some of the language of modernity, but weren’t themselves fully of the modern world—their boozy pub lunches attested to that. Some of the staff at Matrix have newfangled titles, it’s true. But as Taylor might observe, all that’s really changed is the name.

(Corrects the photo captions identifying Richard Evans and Sam Edwards.)

Career Monogamy: The Awkward Tech Sin of Longevity

$
0
0

The Slack message was genuine and brief, “congrats on 20 years!” My name had apparently been listed on a slide during the quarterly all-hands meeting of our business unit, along with roughly a dozen other employees who had spent 20 years of their lives working at Adobe. In the interest of time, only the 25 year anniversary recipients were mentioned out loud. Most folks did not notice my name, as I heard from only one person. Heck, I didn’t even notice since I was busy and unable to attend. One vice president noticed. He saw me from a distance a couple of days later as we approached each other down a long Seattle hallway.

“Congrats on 20 years,” he started as we reached shouting distance. “Too bad you couldn’t find the time to make the meeting,” he said as we closed to within a few feet. “Twenty years is a long time. Sounds like a rut. You should get that looked at,” he finished as he walked by.

Welcome to the tech sector, where longevity has become some combination of freakish curiosity and career sin. These companies are fighting battles against high turnover, and exorbitant replacement costs of somewhere between 1–4X the salary of an experienced senior manager [1][2][3]. Yet, their cultures often work against their better interests by discouraging stability.

I know this VP well. He was at least partially joking. One of the things I enjoy about working with him is he is not afraid to say what other’s are thinking. A slap to the face is always preferable to a knife in the back. His sentiment was not new to me. Somewhere around the ten year mark, my Adobe work anniversaries morphed from a badge of honor into something more like a scarlet letter.

Fighting stagnation

Our Senior Vice President back then was David Wadhwani (of AppDynamics fame). It was 2012, and he was overseeing a reboot of our multi-billion dollar Creative Suite product line into what would become a massively successful cloud-based subscription business now known as Creative Cloud. I was a Director of Product Management, working on Creative Cloud, and also a member of the Adobe Seattle Site Council. That led to a number of conversations between Wadhwani and I.

He told me he was taking aim not only at our aging boxed software business, but at our too-comfortable culture. He identified a prevalent mindset with employees who were working more to secure their jobs than to take the risks necessary to forge a bright future.

These were the folks who would listen intently at employee meetings for the names of the projects or products that executives mentioned, and then eagerly try to find safe passage aboard what they now perceived to be safe areas of the company. These were the folks who were experts at knowing how to run the business exactly as it was, and fought change like antibodies repelling a toxic substance. They would use their longevity to shout down new ideas because they had already been attempted and failed, even if the attempts had come years earlier with different people and circumstances.

Wadhwani knew the culture had to change in order to create a fertile environment for innovation. A long tenure at the company now meant more scrutiny, not less. People needed to prove they were ready to embrace new and different, instead of fighting to preserve status quo. Fresh faces and perspectives were often valued over experience. This was not unique to Adobe.

“It used to be that when you were looking at someone’s resume and they changed jobs more frequently than every five to seven years, they’d be labeled as a job hopper, unstable, greedy or selfish, unable to hold a job. Whatever it was, it usually flagged them and pulled them out of the stack.
Now, in some regards, I think it has flipped. Now when recruiters look at someone who has stayed in a role for more than three years, the question is why? What have they been doing? …
The world is changing really fast. There’s this intuition that if you’re doing the same job for more than three years and your job didn’t change, that means either your company’s not that dynamic or you are not that dynamic. I’m not saying that’s always the case, I’m just saying there’s this increasing perception” — Jobvite CEO Dan Finnigan, in a 2011 interview

The dynamic agitated many vets. No longer could they count on past victories to propel them forward. Like bees whose hive had been disturbed, they became hyperactive. Some would commute from San Jose to San Francisco just to sit near Wadhwani and his staff. Some paid more attention to how they dressed to project a younger, hipper, image. Others were unmoved, staying their course. Nobody was entirely free of the disarray caused by the transformation.

I loved it. As someone who cared deeply about Adobe, it was clear we were at risk of allowing innovator’s dilemma to slowly asphyxiate our business. I saw Wadhwani as the catalyst the company needed. Change was not something I embraced when my career started, but adaptation and anticipation quickly became second nature. My appetite for change did not come from lack of attachment to Adobe history. To the contrary, it was fueled by a deep loyalty and dedication to our mission built over many years.

Distilling wisdom from experience

We met in college. It was December, 1996. President Clinton had just been elected to his second term. Grunge was fading as the Spice Girls were rising. The Nintendo 64 had just been released in Japan to much acclaim, Microsoft had launched Windows 95 just over a year prior, and Netscape Navigator owned 85% of the browser market. The economy was booming, fueled by technology. My time at American University in Washington D.C. was coming to an end.

I was cocky in the way newly minted 21-year-olds often are, with all the answers to none of life’s difficult questions. My then-girlfriend-now-wife and I were visiting Seattle on our winter break looking for potential jobs as graduation loomed. Adobe was a tech tween. The dust was still settling from their acquisition of Seattle-based desktop publishing giant Aldus three years prior. I strode into their funky and spunky downtown Seattle office hoping to make an impression.

The beginning

Six months later, I was using a plastic packaging sheet as a shower curtain in my Fremont apartment, while getting ready for my first day as a Technical Support Engineer for Adobe PageMaker. The $30k salary they were going to pay me to answer calls about a product I barely knew felt extremely generous.

Even though school was now officially in my rearview mirror, it felt like my pace of learning had never been greater. Orientation introduced me to 401ks, compound interest, stock options, stock purchase, and healthcare. My job training required me to not only learn the features of the product, but the publishing industry problems they were meant to solve. Kerning, tracking, and CMYK separations, oh my!

I can still remember the sinking feeling when a call would come in and the pre-recorded voice would announce the caller was an Adobe Service Provider. Those were the people who worked at print shops and knew the product inside and out. They were calling me for help. Fake it until you make it was ingrained in me early on.

But I did not have to fake it for long. A reluctant student most of my life, I had a voracious appetite for learning what I needed to master my job. I pestered co-workers with questions, started an unsanctioned new hire training group where we taught each other new concepts we had been introduced to, and even read the dense 500-page PageMaker manual multiple times. An early career highlight was seeing “Adobe Certified Expert” printed on my business cards, even if I had no practical need for business cards at the time.

John and Chuck receiving the National Medal of Technology and Innovation

Adobe used to offer PostScript training to any employee who was interested. After a few dozen calls about PostScript errors, I decided I wanted to learn more about it. What came along with the technical tutelage was a history lesson of how our founders, John Warnock and Chuck Geschke, had built the entire business on this programming language.

They initially tried to sell it as part of a printer, but found that what their customers — including Steve Jobs at Apple —really wanted was the language driving the printer. Geschke and Warnock quickly changed their business plan to center on licensing PostScript, and ultimately sparked the desktop publishing revolution.

PostScript led to the development of Adobe Illustrator, and Aldus used it as the underpinning for PageMaker. Eventually, PDF was created as a derivative of PostScript. That innovation helped Adobe retain and even grow in relevance as the Internet brought the rise of email and electronic documents.

There were so many lessons to be learned about business, and innovation, and Adobe’s culture that proved invaluable for anticipating where the company might go next. But I was building more than knowledge. Deep and lasting personal relationships were forming with my fellow new hires and the standout veterans on my team.

The lightness of living through our 20s with a steady income was not lost on us. We would regularly go out for drinks and dinner after work, or stay late playing video games like Duke Nukem over the corporate network.

Some of happiest memories were spent laughing with friends at work staring at this screen

Everyone on our team became a character in a daily sitcom. There was the narcoleptic woman who would snore during team meetings, the gruff leather-wearing rebel who would ruffle feathers, and the manager who never actually said anything of substance who left us deciphering his manager-speak after each one-on-one. It would prove to be too good to last.

Do not gather moss

The layoffs started about a year after I arrived. The first round included the snorer and some other lesser performers. The next round started cutting more deeply. I distinctly remember going with some of my coworkers who survived the second round of layoffs to see Office Space, and laughing so hard at the perfect satire that I needed to watch it again because I missed so much. Tension had been building so much leading up to the moment we were each called into our manager’s office to receive the good or bad news, it was cathartic to find humor somewhere.

I was beginning to learn the lesson that stability and longevity were not necessarily symbiotic. The ground was shifting beneath my feet. Standing still was only going to mean I would eventually fall.

After almost two years of listening to customers complain about the shortcomings of the product they sometimes called, “RageMaker,” I decided to take a new role in quality engineering on a project codenamed Shuksan.

Shuksan was being built to supplant PageMaker. I spent my first six months exorcising my tech support demons by writing more bugs than any other tester. We would soon launch Shuksan under the name Adobe InDesign.

Just about that time, the rest of the level two tech support team I had worked on were let go or reassigned. It was easy to see it coming despite efforts to conceal the plan. A senior manager had gathered those of us still around after the second support layoff and said, “I know many of you are waiting for the other shoe to drop.” He then took off his shoe and dropped it. “There it is.” He was let go as part of this final reorganization as well.

I had managed to convince some of my closer friends to jump ship with me to quality engineering before the ax fell. We knew we had to pedal faster and keep our eyes open to stay afloat. Adobe was a great place to work, with super nice people, but it was no free ride.

Some of us decided to expand our skills. One of my best friends and I took a series of programming certifications (C and C++) at University of Washington, which allowed me to start automating some of my tests. InDesign was evolving as well.

Finding the impossible is possible

We were taking on an entrenched competitor in Quark XPress, but one with a rather terrible customer service reputation. There was an arrogance that came with their market position that would ultimately be their downfall. InDesign innovated at a pace that made Quark look like it was standing still. Throw in the fact that a customer could get InDesign and Photoshop for roughly the same price as Quark, and it becomes clearer how that industry titan could fall in just a couple of years.

Inertia often provides a false sense of security, as Quark found out. As the great John Wooden once said, “Never mistake activity for achievement.” To that end, I continued adding new programming skills. I started building relational databases and picked up some web development scripting languages like ASP.

I applied for two jobs, and got both of them. One was in developer support, where I would go more deeply into product engineering. The other was as a web developer for internal sites and systems. Both were at Adobe.

Right around this time, the dot com bubble was expanding rapidly. People were leaving the company left and right to chase IPO riches. Usedbooks.com was particularly aggressive at trying to poach people on the InDesign team. My manager was among the people who left. Almost none of them cashed in.

The bubble burst and many were left hoping they could boomerang back to Adobe. Unlike the startups of that era, Adobe had grown on real products being bought by real customers with real money. I would read the newspaper everyday trying to decipher why these companies without any profit or meaningful revenue could be valued so highly.

You can’t fake real value. At least, you can’t fake it for long. The market knows it. Your employer knows it.

Before making a decision between the two roles, my manager warned me to be careful. He said that the company would take everything I would give it and ask for more. His words struck a nerve as I had recently become a father and was committed to never letting work keep me from my family. Standing still, though, was not an option. I had already learned that lesson.

Lady luck plays her role

I wound up taking the web development job and loved it. I thought I had found my calling until another layoff came, and my position was eliminated. These layoffs had become an annual Fall occurrence to cull the herd. My manager walked in and told me a I was a program manager now…for Adobe PageMaker.

With the rise of InDesign, engineering for PageMaker had been moved to India, so most of my meetings were at 6AM or 9PM. Two of the smartest and most productive people I have ever worked with, Jo Ann Buckner and Laurel Hahn Zimmer, were my product management and product support partners, respectively.

They taught me about product development from a different lens. We needed to define roadmaps, plan major milestones, and communicate our plans effectively, both to the team and to the execs.

I was forced to learn about Gantt charts and Microsoft Project. I used some of my spare time to learn about Microsoft Project Server, mainly so I could store schedules there and then dynamically share the milestones through the internal website system I had built in my previous job. That was pretty novel in 2004.

As luck would have it, that side project wound up leading to the biggest break in my career. Adobe announced they were acquiring web giant Macromedia in a $3.4 billion dollar deal. A dorky looking guy in glasses — not exactly a rare breed in tech — named Hans Grande knocked on my office door and asked if I knew anything about Microsoft Project Server. I nodded. We spoke about it for some time, and then he said, “Come with me.”

We walked into my manager’s office and Grande explained to my manager that the acquisition team was going to need some of my time to help consult. Apparently, the corporate development group had spent some money on an acquisition management system built on top of Project Server, but nobody in the company had any experience with the technology, except me.

Down the rabbit hole

What started as a few weeks on loan, quickly became an offer/request/plea to remain on the project until the deal closed. Most of each week would need to be spent down in San Jose without a clear end date. I would need to enter the clean room, which meant that if the deal was dissolved for any reason, I would not be able to work for either Adobe or Macromedia because I would have been exposed to sensitive information from both companies. We had just had our second child as well.

It was a major decision. My wife and I took more than a few long walks discussing the implications. She was far more encouraging and bullish. I was more reticent, worried that this would be the moment the company took too much of me away from my family. The opportunity proved too unique to pass up. We decided to go for it.

The deal took seven months to close. During that time, I spent many of my days with the top executives from both companies. There was a dizzying amount of talent. Stephen Elop was the Macromedia CEO, before moving on to lead Nokia and then become an EVP at Microsoft. Kevin Lynch was being groomed as a CTO, before he moved to Apple to lead the Apple Watch. Tom Hale was leading a division, and would go on to run product for HomeAway, and now is a President at SurveyMonkey. Dave Mendels was leading a different division, and went on to become CEO for Brightcove. The list goes on. Wadhwani was more of a lieutenant than general at that time.

That experience opened my eyes to how the sausage gets made. All my naive conceptions of how executives always knew what to do were shattered. What I saw were incredibly smart people spending most of their time trying to do what they believed was right for the company, and the rest of their time engaged in political jousting with other executives who were fighting for investment and visibility.

Reconnecting with what matters most

All I knew was product development until that point. Now I was learning about sales, marketing, finance, human resources, and corporate strategy. It was an MBA-in-a-box. I was having the time of my life until I received a call from my wife about four months in, telling me that the doctors had found something wrong with our youngest son. He was developmentally delayed across the board. We would later find out he would have special needs the rest of his life.

A few months later, Grande, who had became one of my best friends over the course of the deal, told me he had been diagnosed with stage four cancer. He was set to be married right around when the deal closed. He went on his honeymoon. Not long after, he passed away.

I would go on to get promoted twice in short succession, becoming a Director of Program Management less than ten years after I started answering tech support calls, but I would never look at career growth the same way. I became wary of moving any higher up in the organization and losing touch with the people I loved.

Where I had once been seduced by the corporate climb, and the thrill of reaching my limits before pushing past them, I now saw it as a game that could not be won. It was a treadmill set at an ever-increasing speed. I chose to step off and run my own trail instead. Title, money, and visibility were the bait I no longer craved. I looked for big projects with great people where I could clearly see how I could make an impact while retaining control over my time.

When I was asked to run product integration for the $1.8 billion dollar Omniture acquisition in 2010, I agreed only after understanding there would be no clean room and more control over my travel schedule. When I was asked to take over product management for the design segment, our largest customer segment that included products like InDesign and Illustrator, I accepted only after knowing there would be opportunity to advance our strategy in the Seattle office so I could spend more time at home.

My misstep came when I violated this newfound principle. I was asked to lead product management for what would become Creative Cloud. I knew it would involve more travel. The responsibilities and team were not crisply outlined. Big mistake.

Only a few months in, it became clear I did not have the resources or authority required to execute on the strategy I knew we needed. I was miserable for the first time in my career. The two fabulous people I had hired to build the face of Adobe’s next-generation product line were helping to craft a terrific vision, but we had no engineers to build it out. Leading the team with dignity through that was excruciating. It felt sleazy to imply purpose where I knew there was none. I had tried to build my career on integrity and doing impactful work on impactful projects. Now, I felt like a phony collecting a paycheck.

Not only that, I felt like a hypocrite. That cultural change Wadhwani was championing, and I was cheering, was predicated on eliminating bloat. My job was safe. The reputation I had built in the years leading up to this point meant I had plenty of runway to work with, but coasting was not my thing.

I had just passed the 15 year mark at Adobe. As much as I supported what Wadhwani was trying to do, the company had over-rotated on valuing fresh faces over people with experience. It felt like it was finally time to move on.

I began aggressively interviewing outside the company. Two offers stood out from the rest. My old-fashioned dream of working for one company my entire career was not meant to be.

Prior to accepting one of the offers, a friend in HR got wind of what was happening and convinced me Wadhwani would want to know. I was skeptical, but I had a meeting already scheduled with him, and was willing to tell him. The moment of truth arrived:

“David, I wanted you to know I’m close to accepting a role outside the company,” I offered. He was surprised, but said without hesitation, “That’s not acceptable. Would you at least be willing to talk to a few people internally if I set up the meetings?”

I felt valued. Not because he offered me money or a new title, but because he demonstrated an understanding of what I brought to the company and was offering to spend his valuable time helping me find my place. I was ready to leave the company I loved and the colleagues who had become some of my closest friends because I could see the music stopping soon and there were no seats I wanted to sit in. Wadhwani stopped the music, knocked the chairs aside, and pointed me in the direction of some seats I had not noticed. I will forever be grateful.

One of those seats was with Paul Gubbay, a VP who had an engineering team developing a technology that was in need of some business focus. I shared a product pitch that aligned very closely with where they were hoping to take their project. Kismet.

I passed on the other jobs in favor of joining the Project Luca team. Luca was eventually released as Adobe Slate, and became just the second product in Adobe history to be named Editor’s Choice by the Apple App Store.

Slate was the second in a new breed of applications being developed by Adobe, meant to reach new customers who were not creative professionals, and did not have the time or desire to learn pro tools. The plan was to bring these applications together under a new brand, and give regular folks a creative system that would help them stand out. Adobe Spark was born.

Spark was everything Wadhwani had wanted when he imagined Creative Cloud. It was mission driven, and used enthusiastically by students and nonprofits alike. It was fresh and fun and built from the cloud up.

He never got to experience the launch of his favorite project, as he accepted his new role as CEO of AppDynamics, but that worked out pretty well for him.

I now run product management for Spark. Our ambitions are grand. The team is fantastic. We are just one year removed from our launch, and are driving product and cultural innovation within Adobe. This could very well be my last and best project at the company.

If this is a rut, I should have driven into a ditch years ago.

Patronizing pernicious perceptions

All told, I have had eleven jobs in my 20 years at Adobe. My experiences have given me a 360 degree view of the business. I was there when InDesign, Creative Suite, Creative Cloud, and Spark were born. I was in the middle of the two largest public-to-public acquisitions in the company’s history.

My regrets are minor, and none of them include my decision to stay at one company for my entire tenure.

Some folks are a little embarrassed to work at an older tech company like Adobe. Not me. That startup everyone is so excited about? Chances are they are using Adobe products to help build it and market it.

People wonder if I stick around because I have no other options. I could have jumped ship dozens of times over the years. Many of the interviews I turned down were for jobs that would have paid me much more than I make right now. Deciding to stay was not about inertia or fear of change. It has always been about the project, the people, and the potential for impact.

There are undoubtedly people who stick around their company for too long, and do it for unproductive reasons. There is good reason to till the fields now and then to allow fresh crops to grow. But consider the mighty oak or the towering redwood. They could never grow to great heights without establishing deep roots. Moving them could very well stunt their growth and destabilize the ground on which they stood.

Other fields, like academia, have learned the value of encouraging depth of study over a lifetime. The tech sector is based on the belief that tomorrow will be better than today. Anything that even resembles stagnation is antithetical to the core value system that fuels our industry.

Longevity, however, need not equal stagnation. It can mean wisdom, passion, dedication, and sustained peak performance. That is what I see when crossing paths with most of the other marathon runners at Adobe.

Wisdom is hard to come by. Companies should treasure it. They should encourage it. They should celebrate it. It just may keep them from getting stuck in a rut.

Mary Meeker’s 2017 internet trends report [pdf]

$
0
0

Kleiner Perkins Caufield & Byers (KPCB) partners with the brightest entrepreneurs to turn disruptive ideas into world-changing businesses. The firm has helped build and accelerate growth at pioneering companies like Amazon, Google, Nest, Twitter, Uber, and Mandiant. KPCB offers entrepreneurs years of operating experience, puts them at the center of an influential network, and accelerates their companies from success to significance.

Viewing all 25817 articles
Browse latest View live


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