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

A billion reasons never to buy IBM services

$
0
0

Apparently IBM has made USD $780 million building a payroll system for the Canadian Government which does not work.

Potential Savings on Payroll

The idea was to save money by eliminating jobs. Canada has about 260,000 public servants. Over 1200 people were working on payroll (accountants, bookkeepers and managers mainly with some IT guys thrown in to make it work). This is about half of one percent on payroll. Payroll is about one third the cost of accounting in our company. I'm unable to bring our accounting costs much below 3% of turnover on a sub-million dollar turnover despite strong efforts and automated software like Freshbooks.

I'm using headcount as a symbol of dollar figures for the Canadian government as in a service business like government or a software/IT company salary makes up over 70% of costs. It's not exact, but it provides pretty good reference numbers. Projecting these ratios onto Canada's federal government this would mean it's about twice as efficient as we've been able to become as a small business paying attention (we'd be at 1%). This is a ludicrously high on this kind of economy of scale. So the idea to reduce the head count was a good one. The target was 500 staff instead of 1200.

The mistake which was made was to try to stuff all the very diverse payment systems into a single system. It would have made more sense to categorise the type of payment systems and put like together with like. There would be a master reporting system on top of all the modules to deliver combined reports. The reporting system would be relatively easy to write if the ten or fifteen payment systems were well and simply made and storing data in an accessible way. You'd start by categorising the kinds of payroll, choosing one category, building one good payment system and then clone it out to the others.

IBM instead sold the Canadian government someone else's software (Oracle's Peoplesoft) on a sweetheart contract which did not require delivery of a working solution. Then IBM failed to successfully implement while taking payment all the way along.

A History of Public Contract Fraud

Like a military contractor in the United States who is paying kickbacks (campaign contributions above board, foreign bank accounts below board) to the congressmen and women and senators who vote on their programs, IBM gets paid more for their failure.

It's not an accident or a one-off. IBM did something similar to Australia:

The Australian state of Queensland scrapped a similar project after an initial contract went off the rails and ended up costing the government around A$1 billion ($772 million) to fix. A public inquiry mostly blamed government officials, but determined IBM shouldn’t have been chosen for the job.

It shouldn't be this difficult for governments to resolve failed contracts. There is no reason for private enterprise to profit from failed public projects or inadequate estimates.

In cases like this in the past, the Canadian Government would just be able to tell IBM to deliver the goods as promised or IBM would be banned from doing business in Canada - effectively frozen. Under NAFTA and similar trade pacts, governments have lost all leverage and these sweetheart deals continue to be pushed through.

Why should the Canadian taxpayer foot the bills for corrupt contracts with devious suppliers? The answer is we should not. Companies should know that when they contract to provide public services they will be held accountable.

Some more history of IBM at home and abroad

IBM is a hollow shell of what it once was. IBM treated its own workers horribly, when they off-shored what was the best software and services team. One of IBM's major destinations after blowing up their US workforce was Bratislava. Some of IBM's business has moved on from Bratislava now as the environment is not sufficiently low cost any more. From insiders here, I had the chance to learn how IBM's service business really works.

An IBM team in Bratislava is an account manager who is an a group of ten with an account director above them. I.e. there are only two people with whom you would have contact. Slovaks are very talented at mid-level service jobs: responsible and polite if not particularly fast-moving. The general level of foreign language learning is high as as in addition to reasonable natural talent, Slovaks are forced to communicate with the outside world in any other language except their own. So far, so good.

The tech credentials of these software "experts" were pretty low. Language skills was the bigger issue along with basic computer literacy (ability to send emails and manage a CRM). An HR recruiter who worked for IBM and I had a running joke about what it took to get hired at IBM Slovakia. It was just three yeses to the following questions.

  1. "Can you speak English?"
  2. "Can you sit at a desk?"
  3. "Can you turn on a computer?"

Yet if these people or their friends were the only ones who had contact with your data, no issues at all. Slovaks, particularly in the service industry, are astonishingly honesty.1

Who really implements software at IBM

The technical work was not kept within Slovakia at all. It was sent out to boiler rooms in India with extremely low skilled specialists and very high turnover. Your little service job might have to be done three or four times before it passed quality control and your "team leader" reported back to you. The teams were always rotating and there was no continuity on the work on any given project. If I were an IBM customer, I'd be very worried about my data transferred between so many jurisdictions and experts. It only takes one weak in the chain for your private business data to leak into the wrong hands.

In exchange, companies were paying premium development rates - hundreds of dollars an hour. IBM were effectively selling you $4/hour developers at premium prices. A company could hire software customisation engineers on hourly remuneration with ten times the soft skills and five times the hard skills for one third the hourly rate IBM charges.


IBM Bangalore, where software is made © CC/Amol Gaitonde

Now Canada is paying for IBM's irresponsibility as an employer, a supplier and a corporate citizen.

IBM vs Local Developers or Local Experts 

Canada would have done far better to hire Canadian Mike McDerment to build their payroll system from scratch. Mike has built two accounting systems which work more or less flawlessly: Freshbooks One (what we use) and Freshbooks Two (what Freshbooks are selling now). Freshbooks practices accountability. Once when Freshbooks servers went down for about eight hours, Mike gave everyone affected (about half their customers) a free month of service. I thought that was crazy over-compensation (and that's from someone who refunded $6000 to a single client for a project which didn't go according to plan).

My only recommendation to someone thinking of buying the IBM brand. Just don't. IBM doesn't produce what they are selling, offer low quality services at high prices and seek to sign customers up to dishonest contracts. In addition, IBM treats its employees very poorly (as contractors where possible), has hollowed out its home economies (North America). As coup de grace, IBM has stolen nearly a billion dollars from both Canada and Australia on failed payroll projects.

If this is how IBM treats its staff and governments, why would IBM treat your small business any differently?

Alec Kinnear

Alec has been helping businesses succeed online since 2000. Alec is an SEM expert with a background in advertising, as a former Head of Television for Grey Moscow and Senior Television Producer for Bates, Saatchi and Saatchi Russia.


First Lightning mainnet release

$
0
0

Announcing our first Lightning mainnet release, lnd 0.4-beta!

Today we at Lightning Labs are announcing the release of lnd 0.4-beta! This release marks the 4th major release of lnd and the first Lightning mainnet beta, an important milestone. With this release, lnd has gained a considerable feature set, deeper cross-implementation compatibility, a new specialized wallet seed, comprehensive fault-tolerance logic, a multitude of bug fixes, and much more! This release is also the first release of lnd that has an option to run on Bitcoin’s mainnet, with the necessary safety, security, and fault-tolerance features required for real-world, real money usage.

Note that this release is intended for developers of future Lightning applications (Lapps) along with technical users and prospective routing node operators. In this early phase of Lightning, we’re focused on providing the software infrastructure (such as lnd!) necessary to bootstrap the network and serve as a platform for future applications, services, and businesses. As this is the first mainnet release of lnd, we recommend that users experiment with only small amounts (#craefulgang #craefulgang #craefulgang)!

If you’re interested in installing and testing the lnd 0.4-beta, please visit our release page.

The maintainers of lnd would like to thank all the dedicated testers, and60+ contributors who have helped make this release possible! We believe that lnd 0.4-beta is a big step in the development of the Lightning Network and will help make Bitcoin and other cryptocurrencies simpler, faster, safer, and more ubiquitous.

A few of the highlights (more detail can be found in the release notes):

  • Bitcoin Core support - previous versions of lnd required the use of btcd. Now, users who prefer to run lnd with bitcoind can do so using the instructions here.

  • New seed format, deterministic keys - a new and improved key creation and recovery system makes it much easier to backup lnd nodes and also makes recovery from data loss or corruption much simpler and more reliable. These improvements are also necessary for remote backup services, which will provide additional safety for Lightning users.

  • Vastly improved fault-tolerance - safety and security of user funds is of the utmost importance, and a great deal of effort has gone into makinglnd secure and stable in the event of power failures, network failures, hardware failures, or other unexpected or adversarial conditions. Ensuring that necessary recovery information is stored at all times and can be correctly reloaded upon restart and reconnection to the Lightning Network has been a major undertaking for 0.4-beta.

  • Smarter Path-Finding - introduces an improved management for constructing payment routes. The system, dubbed Mission Control, incorporates feedback from previous payment attempts, to update the view of the network in response to temporary bottlenecks or failures.

  • Automated Contract Resolution - sweeping funds back into a user’s wallet is now handled by a concert of subsystems, that together decide how and when to spend all output types generated by an operating channel. Making this process automated, fault-tolerant, and intelligent has demanded an immense amount of effort, but critical to the safety of funds managed by lnd. As an aside, you’ll be happy to know that lnd batches transactions wherever possible ;)

  • Segwit Only - lnd has removed support for now-obsolete P2PKH addresses, favoring both native Segwit and P2SH. As a result, all transactions, even regular on chain transactions, will benefit from lower fees and be healthier for the network.

  • Routing node metrics - lnd now provides tools to track fees and payments at high-volume, which is of particular interest to those operating transaction routing nodes. Tools such as these can be used to optimize revenue, throughput and reliability. Let the gamification begin!

NOTE: It is important to note that this release of lnd contains several breaking changes, in other words, any previous lnd mainnet usage is not compatible with the beta. As a result, users will either need to upgrade using a completely fresh installation, or remove their existing channel.db database file before upgrading. As a courtesy, we recommend that users close out their prior channels (cooperatively if the peer is online, or force close otherwise) before upgrading. A new utility command in the command-line interface, lncli closeallchannels has been added to streamline this process.

lnd-0.4 beta is a huge accomplishment by many engineers, testers, and users around the world, but it’s the very beginning for the Lightning Network. As users begin to experiment with Lightning and as the network begins to grow, we’ll be working on a number of key infrastructure components that will contribute to the instant, user-friendly experience Lightning can bring to Bitcoin and other cryptocurrencies.

  • Watchtowers and backups - In order to provide maximum safety for the funds of Lightning users, “watchtowers” will monitor the blockchain for invalid channel transactions. Typically Lightning nodes need to be online in order to protect against these events, however watchtowers relax this constraint by outsourcing the vigilance of nodes that may have intermittent connectivity, e.g. mobile phones. Even for nodes with adequate availability, watchtowers can serve as a secondary line of defense in the face of unplanned service outages.

  • Atomic Multipath Payments (AMP) - allows large Lightning transactions to be divided into a series of smaller transactions as they’re sent over the Lightning Network, but in such a way that they’re automatically joined back together. The user sees only the total amount of the transaction, without needing to be aware that AMP is being used behind the scenes. AMPs also ease the mental burden of using channels, allowing a user to interpret their balance readily as the simply the sum of their balance in the channels they own. This is made possible by the ability to send and receive an AMP-like payment over multiple channels, at both source or sink.

  • Desktop and Mobile Apps - lnd-0.4 beta is targeted at technical users, but we believe that Lightning Apps that are simple and intuitive for non-technical users will be essential to the growth of the network. To that end, we’ll be updating our alpha Lightning App to be compatible with lnd-0.4 beta over the coming weeks, and will follow with mobile versions as well.

  • Routing node tools and guides - more advanced Lightning users may want to support the network while earning fees with their bitcoin by running routing nodes. New tools and additions to lnd will help routing node operators optimize revenue, maximize uptime, and manage capital. A robust routing network is essential to the speed and privacy of Lightning, and we’ll be working with the community to facilitate the growth of the network.

  • Next-generation Autopilot and Mission Control - currently, lnd uses relatively simple heuristics for Autopilot (peer finding) and Mission Control (routing). These will be further optimized to provide a more reliable, faster user experience.

  • Cross-Chain Atomic Swaps - swaps enable instant, trustless exchange of assets residing on separate blockchains such as Bitcoin and Litecoin, without introducing the systemic risk introduced by custodial exchanges. Users will have access to more liquid network of Lightning-enabled exchanges, and be prepared for the coming of decentralized exchange infrastructures.

Open Location Code: Easier location encoding

$
0
0

Open Location Codes are a way of encoding location into a form that is easier to use than latitude and longitude. They are designed to be used like street addresses, especially in places where buildings aren't numbered or streets aren't named.

Stop giving directions

Instead of giving people complicated directions, just give them a short code that tells them exactly where you want them to go. They can enter it in their phone, laptop, computer, and get the exact location. They don't even need to be online!

Most places just need a six character code and a locality to get an accurate, unique reference. For example, this football pitch in Belo Horizonte, Brazil has the location "Belo Horizonte 22WM+PW". Try it on the demo site!

If you don't want to use the locality, you can use the full 10 character code. That same football pitch has the full reference 58GR22WM+PW. "58GR" is like an area code of a telephone number, and like an area code, if you're in the town (or even near it) you don't need it.

Who are these codes for?

Here are three examples of people who could use these codes.

People living in unmapped slum areas, such as Kibera in Nairobi, could use these codes as a home or business address. For example, the Adventure Crafts Glassmart in Kibera has the address "Stall No.164, Makina Stalls, Kibera Dr, Kibera, Located close to the Toi Market". That's not easy to find, and the glass they ordered might be delivered late if at all. But if they tell the delivery company that their address was "MQPQ+QG Kibera", they can look it up, get the exact location, and the glass will be delivered faster.

Small businesses rely on people being able to find them. This is especially true for guest houses, because they are mostly used by people who are not local to the area. If a guest house provides their location using these codes, a visitor is able to use that code to go directly to the location.

Crisis response organisations need accurate location information. These may be existing buildings (storage warehouses) or things such as wells that don't have addresses, or temporary camps that could be long distances from the nearest road. Latitude and longitude coordinates are long and prone to errors, leading to wasted time and resources. Using short codes that importantly, do not require expensive satellite communications, could provide such organisations with improved location information.

I'm a business, can I use the codes?

Of course. The codes are free to get and free to decode. We've got software libraries on our Github site, and example web pages. If you need help, you can contact the mailing list.

That's so cool! Can I help?

Yes! We are working on implementations in other languages, but if you'd like to do an implementation, contact the mailing list and see if anyone else is already working on the language.

Alternatively, if you know someone who would be interested, let them know.

Why didn't you just use X?

The first thing we did was to work out what attributes of addresses were useful. Once we had that list, we looked at a lot of existing location coding methods to see how well they matched our list. Once we'd done that, we decided that it was worth to at least define a new one, and then see if it was well received.

The other methods were mostly designed with different ideas in mind, and so this isn't a criticism of them.

What makes Open Location Codes different?

  • The codes aren't case sensitive and don't include easily confused characters. We've selected the characters to make it difficult to impossible to spell words in any language.
  • Codes are generated from latitude and longitude, so they already exist for everywhere. Nobody has to set them up or pay for them. Each place has only one code.
  • Codes that are similar are located closer together than codes that are different.
  • Open Location Codes represent an area, not a point.
  • The size of the area depends on the length of the code. Long codes are more accurate than short codes.
  • Dropping characters from the end of a code gives you a larger area that contained the original code.
  • Codes are 10 or 11 characters long (8FMGP9FW+6M), but if you're in the local area (within 50km), the leading four characters of the code can be omitted (P9FW+6M) making the codes even shorter.
  • The short code can be used together with a place name (like P9FW+6M Pisa, Italy).

Point me to the info!

Authors

Open Location Codes were developed at Google's Zurich engineering office, and then open sourced so that they can be freely used. The main author is Doug Rinckes (@drinckes), with the help of lots of colleagues including:

  • Philipp Bunge
  • Aner Ben-Artzi
  • Jarda Bengl
  • Prasenjit Phukan
  • Sacha van Ginhoven

This Is What Record-Low Unemployment Looks Like in America

$
0
0

What will happen when the U.S. unemployment rate falls below 4 percent, which is expected to occur by this summer? One way to tell is to look at cities where joblessness is already lower than that. Bloomberg News reporters traveled to Iowa, Georgia, and Maine. What they saw there is encouraging. They discovered that employers have found ways to cope with tight labor markets and still make money. Businesses have pulled in workers from the sidelines—including retirees, immigrants, and the homeless—and retooled processes to use less labor. Some have raised pay considerably for certain jobs, but so far there are no signs of an overall wage explosion. That should embolden those at the Federal Reserve who want to raise interest rates slowly to give growth a chance.

Portland, Maine: Making Do With Fewer Workers

From polished sea-salt caramel balls to truffles packaged with hand-tied bows, the treats on sale at Wilbur’s of Maine Chocolate Confections in Freeport exude artisanal charm. While that’s a source of pride for owner Andrew Wilbur, whose parents started the business, he’s staring down a dilemma. Manufacturing workers are hard to come by in Freeport, which is 15 miles north of Portland and part of its statistical area. At 1.8 percent, the unemployment rate is the third-lowest in the country. “It’s made me think, Do I go to more mechanization?” Wilbur says from inside his production plant, where three employees are making candy in what look like mini cement mixers.

Employees at Wilbur’s of Maine Chocolate Confections in Freeport.

Photographer: Gregory Halpern for Bloomberg Businessweek

Wilbur has raised wages for his 40 employees by more than 20 percent over the past three years, but he’s passed hardly any of his costs onto consumers. Business at his three brick-and-mortar outlets is already unchanged or down, and he would have lost online and wholesale customers if he’d raised prices substantially, he says.

It takes a full year for these employees to get up to speed and five for them to hit what Wilbur, without a hint of irony, calls “the sweet spot.” With inexperienced workers starting at $12 to $14 an hour, onboarding is becoming a major expense. Lowering his voice a little, Wilbur admits that he’s changed some of his packaging to make it less labor-intensive, including doing away with hand-applied labels.

Shipwreck & Cargo, a souvenir shop in downtown Portland that stocks items such as lobster-printed boxers and Maine blueberry tea, staffed its floor with only two sales assistants during the busy summer season instead of the usual three. The supply of workers has dried up just as the tourism industry is on an upswing, says store manager Jennifer Smith. “You want the right people, standing and smiling in front,” says Smith, who adds that the applicant pool has gotten smaller and less qualified in the five years she’s been running the shop.

The leisure and hospitality sector is the backbone of the local economy, but professional and business services have been engines of growth in recent years. Weekly wages in the Portland region have been moving up gradually, climbing in line with the national average through the first three quarters of 2017, the latest figures show. Inflation in the Northeast has been running below 2 percent.

One big reason employers are struggling to fill slots is that Maine’s population growth has leveled off. The state has the highest median age in the country at 44. “Last year, I was unable to get how many people I needed. I was probably short one and a half people,” says Tammara Croman, the manager of Portland’s Pomegranate Inn, whose eight guest rooms are outfitted with exuberant floral wallpapers and works by local artists. She says the operation ran at full capacity last summer, though with too-few housekeepers, it wasn’t able to accommodate as many early check-ins. “We end up having to hire people who we wouldn’t normally,” says Croman, who’s already put out feelers for the summer.

Applicants with no relevant experience are asked to come in for three-week trials, which gives Croman a chance to see if they’re cut out for the work—a mix of housekeeping and customer service. “It allows you to see the person’s work ethic, if they’re showing up on time, if they’re doing a good job,” she says.

The workforce challenges have been “top of mind for a while, and I don’t know if we see an end in sight,” says Quincy Hentzel, head of the Portland Regional Chamber of Commerce. That said, it isn’t all bad. “Businesses are extremely appreciative of their good employees and working really hard on retention,” she says. “That’s wonderful.”

A tight labor market also means that employees can afford to be picky. At Wilbur’s chocolate shop, two store managers left last year because they had better prospects in administrative work. While the business managed to hire replacements, mounting payroll costs are weighing on profit margins. Pointing to a large, hand-painted chocolate Easter bunny in his factory, Wilbur shakes his head. “We probably make a lot of people happy,” he says, “but I’m not sure that we cover the bills.” —Jeanna Smialek

Marietta, Georgia: Casting a Wider Net

Lanre Bakare, a 36-year-old Nigerian immigrant, was homeless and had little marketable work experience when he was accepted into a training program run by CobbWorks Inc., a federally funded nonprofit that matches workers and businesses in the construction, logistics, information technology, and health-care fields. Now he earns $40,000 annually as an analyst managing vendors and supplies at residential construction sites in Cobb County, Ga., and the surrounding area. Eleven months into the job, Bakare still marvels at his salaried status and is looking forward to that most dreaded of employment rituals: the performance review. “I’m really excited,” he says. “We’re going to talk about if they are going to increase my job, what are my possibilities.”

Lanre Bakare.

Photographer: Johnathon Kelso for Bloomberg Businessweek

CobbWorks has been around since 2000 but has recently expanded its outreach, training people with spotty work histories or criminal backgrounds who employers wouldn’t have considered a few years ago. Companies can no longer afford to be as picky. Unemployment in Cobb County, whose seat is Marietta, a city of 61,000 about 20 miles northwest of downtown Atlanta, was 3.7 percent in December. Weekly wages in the area rose more slowly than the national average through the first three quarters of 2017, the latest figures show. Inflation, meanwhile, has been moving up relatively quickly in the Atlanta area, climbing 3.3 percent in February compared with the nation’s 2.2 percent.

Marietta’s biggest employer, hospital network WellStar Health System, says it’s not feeling the labor crunch because of a decade-long campaign to ensure its pay and benefits are competitive. Attrition at WellStar is below the national average for the sector, according to spokesman Keith Bowermaster. The city’s No. 2 employer, Lockheed Martin Corp., is relatively insulated from local labor trends because the market for aerospace engineering work is national.

But some smaller businesses in the area are scrambling. That’s particularly true in the Cobb Galleria and adjacent Cumberland Mall areas, a few miles south on I-75, where office buildings, hotels, stores, restaurants, and a new ballpark for the Atlanta Braves compete for workers. “We’ve had fast-food restaurants offering bonuses,” says Roger Tutterow, an economist at Kennesaw State University. He’s also seen signs that labor shortages are constraining certain industries, noting that the number of building permits issued last year was half what it was during the boom that preceded the housing bust, even though demand for new homes is running high.

Several Marietta companies report they’re improving benefits to hang on to employees and attract new ones. InfoMart Inc., a 137-person operation that performs background screenings for companies, began paying 100 percent of its employees’ health insurance premiums this year, up from 75 percent. It also rehabbed its office space to make it more “collaborative-looking,” says Senior Vice President Tim Gordon, who’s especially keen to attract millennials. InfoMart also allows its tech employees to work from home four out of five days a week.

Paul Lubertazzi.

Photographer: Johnathon Kelso for Bloomberg Businessweek

Just outside the city limits, Gas South LLC, a natural gas retailer, raised its minimum wage to $15 an hour in late 2016 and now offers every employee—including those in its call center—a one-month paid sabbatical every five years on top of regular vacation time. It also pays its workers’ health insurance premiums and has equipped its call center employees so they can work from home. “We did some research into the cost of living and discovered that some of our people were really struggling,” says Chief Executive Officer Kevin Greiner. “With more money comes less stress. It helps us recruit and keep quality people.”

Paul’s Pot Pies is one of several storefronts lining Marietta’s well-appointed town square, which is outfitted with a gazebo, flowering trees, and boxes of blooming tulips, daffodils, and hyacinths. Its proprietor, Paul Lubertazzi, added $2 to the hourly pay of his minimum-wage workers eight months ago because he says he was afraid he’d lose them to other businesses. A pickup in sales of his frozen pastry pies, which cost $9 to $25, helped pay for the increase. But the cost of many of his ingredients, particularly vegetables, has risen too, which is why he plans to raise prices sometime this year: “I wanted to do it in January, but I’m holding off,” Lubertazzi says. “People do complain.” —Margaret Newkirk

Ames, Iowa: Building an Employee Pipeline

“Join our team,” beckons the chyron in foot-tall red lettering outside the Taco John’s in Ames, Iowa. Across the street, a cactus-shaped sign at TacoTime declares that it, too, is hiring.

“Help wanted” signs are a common sight in Ames, which boasts the lowest unemployment rate in the nation—1.5 percent. From behind the beige laminate cashier counter of the Taco John’s, manager Justin Cornelius says this outpost of the Tex-Mex chain raised pay by 50¢ an hour in the fall. Still, turnover has increased, because workers have more options than they did a few years ago. Cornelius himself is a fill-in; he’s been on loan from a Des Moines restaurant since December. Usually, it takes four to six weeks to find a permanent manager. In Ames it’s been 10 weeks and counting.

Two miles north, at O’Donnell Ace Hardware, manager Tausha Tjernagel says her store has lifted wages every six months for the past year and a half. She’s now starting full-time workers with no experience at $11 an hour, well above the state’s $7.25 minimum. Even so, Tjernagel has had to ask employees to be flexible to fill holes in the schedule. Older part-timers who’d prefer a weekday morning shift are spending their Saturdays ringing up lawn fertilizer or stocking shelves with hammers and nails. But that’s better than letting checkout lines get longer, which is what several town residents say is happening at other retailers. Says Tjernagel: “We make it so that it’s not noticeable to our customers.”

Tausha Tjernagel.

Photographer: Walker Pickering for Bloomberg Businessweek

Wait times aren’t the only pain a supercharged labor market is causing in this city of 66,000, home to the world’s largest gnome statue and Iowa State University. The school is Ames’s largest employer, as well as a magnet for companies across the Midwest that are fighting the region’s brain drain. Locals say prices haven’t been picking up rapidly, and inflation in the Midwest as a whole continues to run below 2 percent. Average weekly wages grew slightly faster than national wages through the first three quarters of 2017—though a separate data series on hourly earnings showed a pop in Ames in January, which is early evidence that faster gains may be materializing.

There are other signs the local economy is running hot. A home price index shot up 7 percent in the fourth quarter of 2017. Kellie Mullaney, a career development adviser at Iowa State, recalls that when she and her husband bought their home three years ago, listings sold in a day: “It seemed like the price range we were in, everyone else was in, too.”

Justin Cornelius.

Photographer: Walker Pickering for Bloomberg Businessweek

To get around the housing constraint, businesses are trying to make it easier for workers to commute in from elsewhere. Mary Greeley Medical Center—one of Ames’s largest employers—is working on setting up a ride-sharing program for employees who live in nearby Story City or Des Moines, where the unemployment rate is 2 percentage points higher.

The Ames Chamber of Commerce has been targeting the 6 percent of the local population that’s underemployed. It’s promoting a community college program in Des Moines that will train people, often at no charge, for jobs in advanced manufacturing. Staffers have been pushing it at local food banks and through local faith leaders, hoping to absorb any labor market slack.

Some companies are trying to snap up workers before they hit the job market. At Iowa State’s College of Engineering, internship postings by Ames companies rose 20 percent in 2017, far exceeding the 2 percent increase in postings overall, says Mullaney.

A collection of modern buildings perched in the middle of a former cornfield abutting the campus is a freshly built monument to employers’ growing desperation. Workiva Inc., a software company that’s referred to locally as the “Google of the Midwest,” expanded its presence in the research park in 2014, and John Deere & Co. opened a “strategic technology office” last year.

The lobby of Vermeer Corp.’s two-year-old office, where 3D-printed art displays hang on the wall opposite minimalist lounge chairs, looks more like a trendy hotel than the outpost of a manufacturer of heavy machinery for the agriculture, mining, and construction industries. Vermeer’s headquarters are more than an hour’s drive away, in Pella, Iowa, but the company enlarged its operation here in part because managers wanted to keep in touch with summer interns, who were getting recruited to other companies amid intense demand. “If we want the top talent, we have to be competitive,” says Sara Hunter, whose job is to build relationships between Vermeer and the university, while strolling through a massive warehouse where students can come to design test equipment. “That pipeline is key.” —Jeanna Smialek

Population figures as of July 1, 2016; Unemployment rates as of December 2017; Average wages as of 3Q 2017; Sources: Census Bureau, Bureau of Labor Statistics, Federal Reserve Bank of St. Louis

Celebrating Stephen Hawking

$
0
0

"Can you hear me?"

Hawking

Stephen Hawking experiencing zero gravity. Image courtesy of NASA.

This was how Stephen Hawking, the former Lucasian Professor of Mathematics, current Director of Research at the Centre for Theoretical Cosmology, best selling author and world famous science communicator, started his lectures. I first heard Hawking speak at his 60th Birthday Symposium on 11 January 2002, coincidentally my first day officially working for Plus. I was very sad to learn that Stephen Hawking died this morning at home in Cambridge at the age of 76.

In his tribute to Hawking astronomer Sir Martin Rees said that despite Hawking's increasing frailty in his early 30s, when he couldn't even turn the pages of a book without help, he came up with his "best ever idea — encapsulated in an equation that he said he wanted on his memorial stone."

That equation is

and is known as the formula for the Bekenstein-Hawking entropy.

Reading about its discovery, and the work of Hawking and Jacob Bekenstein, reminded me of the passion and excitement of science, the value of controversy and proving yourself wrong, and the importance of sharing ideas and building bridges between areas. I felt very sad when I heard the news of Hawking's death first thing this morning. Now, after a morning spent learning and about black hole entropy and Hawking radiation, I feel much more cheerful.

Jacob Bekenstein

Jacob Bekenstein (1947-2015).

One of the results to come out of the rush that was the "golden age of black hole theory" in the 1960s and 70s was Hawking's area theorem. It states that the horizon of a black hole, the surface area of no return, could never decrease. Whatever happens to the black hole, whatever is gobbled up by it, its surface area can only ever become bigger. (You can read more about black holes here.)

Jacob Bekenstein had just finished his PhD at Princeton University and was inspired by Hawking's area theorem. He explored the idea that the surface area of a black hole might be analogous to something called entropy. Entropy is a measure of disorder of a physical system and, according to the second law of thermodynamics, it never decreases. We're familiar with this fact from every day life: no system ever tidies itself up, instead things, when left alone, get messier over time (You can read more about entropy and the second law of thermodynamics here.)

Bekenstein conjectured what has become known as the generalised second law of thermodynamics: that the entropy of a system containing a black hole is equal to the entropy of the system outside the black hole plus a constant times the area of a black hole, and that this value never decreases. This meant that entropy of a black hole is

where $k$ is Boltzmann's constant from thermodynamics, and is the Planck length. (You can read more about Bekenstein's work here.)

Hawking disagreed with Bekenstein's ideas when they met at a conference in 1972, believing there were instances of black holes that would disprove Bekenstein's conjecture. He apparently went back to Cambridge intent on proving Bekenstein wrong. It was generally accepted that nothing should be able to escape from a black hole, but when Hawking applied quantum theory to black holes he realised that something could escape. Quantum physics predicts that even in a vacuum pairs of quantum particles pop in and out of existence, and that these particles have an energy. Their presence is usually fleeting and they annihilate each other. But when this happens near the horizon of a black hole one of a pair of virtual particles can be captured by the black hole while one escapes. The escaping quantum particles create what is known as Hawking radiation.

Hawking radiation means that black holes are not black – they constantly emit radiation and glow with a, admittedly very low, temperature. The radiation provided the missing piece of black hole thermodynamics. Hawking verified Bekenstein's conjectured generalised second law, provided a physical explanation of the temperature of black holes (their quantum radiation) and provided the missing constant, 1/4, in the entropy formula:

Or written in full, as Hawking preferred:

Hawking described this process of discovery in his 60th birthday lecture:

Hawking

Stephen Hawking in the 1980s

"...the obvious next step would be to combine general relativity, the theory of the very large, with quantum theory, the theory of the very small. I had no background in quantum theory... So as a warm-up exercise, I considered how particles and fields governed by quantum theory would behave near a black hole. ... To answer this, I studied how quantum fields would scatter off a black hole. I was expecting that part of an incident wave would be absorbed, and the remainder scattered. But to my great surprise, I found there seemed to be emission from the black hole. At first, I thought this must be a mistake in my calculation. But what persuaded me that it was real, was that the emission was exactly what was required to identify the area of the horizon with the entropy of a black hole. I would like this simple formula to be on my tombstone."

In his tribute Rees says that the equation encapsulates the notion of Hawking radiation, the contribution Hawking was most proud of, that brought together previously unlinked areas of gravity (signified by Newton's constant $G$ and the area of the black hole $A$), quantum physics (the Planck constant $h$) and thermodynamics (Boltzmann's constant $k$). Rees goes on to say that Hawking radiation had very deep implications for mathematical physics and is still a focus of theoretical interest, a topic of debate and controversy more than 40 years after his discovery.

The equation seems an apt inscription for Hawking's tombstone. Its discovery brought together disconnected fields, combining them into an elegant, surprising, and stimulating result. It came about through collaboration, communication and a healthy bit of competition between scientists. And most importantly, it is a human story of great triumph as Hawking himself said in his 70th birthday lecture: "The fact that we humans, who are ourselves mere collections of fundamental particles of nature, have been able to come this close to an understanding of the laws governing us and our Universe is a great triumph."

The answer to Hawking's question at the start of his lectures is yes, we can hear you. And your passion and enthusiasm for communicating with everyone from academic peers to the general public, in lectures, books, cartoons and TV shows, has meant you have had an impact on a great many of us indeed.

A Usable C++ Dialect That Is Safe Against Memory Corruption

$
0
0

We have this handy fusion reactor in the sky.
You don’t have to do anything, it just works.

— Elon Musk —

As we briefly discussed in Part I of this mini-series [NoBugs17], message-passing technologies such as (Re)Actors (a.k.a. Actors, Reactors, ad hoc FSMs, and event-driven programs) have numerous advantages, ranging from being debuggable (including post-factum production debugging), to providing better overall performance. In[NoBugs17], we discussed an approach to handling allocations for (Re)Actors – and were able to reach kinda-safety at least in what we named ‘kinda-safe’ and ‘safe with relocation’ mode. Unfortunately, kinda-safety didn’t really provide the Holy Grail™ of safety against memory corruptions. Now, we can extend our allocation model with a few additional guidelines, and as long as we’re following these rules/ guidelines, our C++ programs WILL become perfectly safe against memory corruptions.

#define (Re)Actors

To make this article self-contained and make sure that we’re all on the same page with terminology, let’s repeat the definition of what we’re considering: (Re)Actors [NoBugs17].

Let’s begin with a common denominator for all our (Re)Actors: a
GenericReactor. GenericReactor is just an abstract class – and
has a pure virtual function react():

class GenericReactor {
  virtual void react(const Event& ev) = 0;
}

Let’s define what we will refer to as ‘infrastructure code’: a piece of code
which calls GenericReactor’s react(). Quite often this call will be
within a so-called ‘event loop’ (Listing 1).

//Listing 1
std::unique_ptr r = reactorFactory.createReactor(...);
while(true) { //event loop
  Event ev = get_event();
  //from select(), libuv, ...
  r->react(ev);
}

Let’s note that the get_event() function can obtain events from wherever we want; anything from select() (which is quite typical for servers) to libraries such as libuv (which is common for clients). Also let’s note that an event loop, such as the one above, is certainly not the only way to call react(): I’ve seen implementations of infrastructure code ranging from one running multiple (Re)Actors within the same thread, to another which deserialized (Re)Actor from DB, then called react() and then serialized (Re)Actor back to a database. What’s important, though, is that even if react() can be called from different threads, it MUST be called as if it is one single thread (if necessary, all thread sync should be done OUTSIDE of our (Re)Actor, so react() doesn’t need to bother about thread sync regardless of the infrastructure
code in use).

Finally, let’s refer to any specific derivative from GenericReactor (which implements our react() function) as a SpecificReactor:

class SpecificReactor : public GenericReactor {
  void react(const Event& ev) override;
};

In addition, let’s observe that whenever (Re)Actor needs to communicate with another (Re)Actor – adhering to the ‘Do not communicate by sharing memory; instead, share memory by communicating’ principle – it merely sends a message, and it is only this message which will be shared between (Re)Actors. In turn, this means that we can (and should) use singlethreaded allocation for all (Re)Actor purposes – except for allocation of those messages intended for inter-(Re)Actor communications.

Rules to ensure memory safety

With (Re)Actors defined, we can formulate our rules to make our (Re)Actor code (Reactor::react() and all the stuff called from it) perfectly safe.

First, let’s postulate that there are three different types of pointers in our program: ‘owning’ pointers, ‘soft’ pointers, and ‘naked’ pointers. ‘Owning’ pointers delete their contents in destructors, and within our rules, should comply with the following:

  • an ‘owning’ pointer is a template, semantically similar to std::unique_ptr<>
  • ‘owning’ pointers are obtained only from operator new
  • copying ‘owning’ pointers is not possible, but moving them is perfectly fine
  • there is no explicit delete; however, there is a way to assign nullptr to the ‘owning’ pointer, effectively calling destructor and deleting the object. However, while the destructor will be called right away, implementation of our allocator will ensure that actual freeing of the memory will be postponed until the point when we’re out of Reactor::react(). As we’ll see below, it is important to ensure safety in cases when there is a ‘naked’ pointer to the object being deleted.

Inquisitive hare:Whenever we’re trying to access an already deleted object via a ‘soft’ pointer (or create a ‘naked’ pointer from a ‘soft’ pointer which points to an already deleted object) – we are guaranteed to get an exception.‘Soft’ pointers are obtained from ‘owning’ ones. Whenever we’re trying to access an already deleted object via a ‘soft’ pointer (or create a ‘naked’ pointer from a ‘soft’ pointer which points to an already deleted object) – we are guaranteed to get an exception. ‘Soft’ pointers should comply with the following:

  • a ‘soft’ pointer is also a template, somewhat similar to std::weak_ptr<>
  • ‘soft’ pointers are obtained from an ‘owning’ pointer, or as a copy of an existing ‘soft’ pointer
  • both copying and moving ‘soft’ pointers is ok
  • ‘soft’ pointers can be implemented either using tombstones (with reference counting for the tombstones), or using the ID-comparison-based technique described in [NoBugs17].

‘Naked’ pointers are our usual C-style pointers – and are inherently very dangerous as a result. Apparently, we can still handle them in a safe manner, as long as the following rules are followed:

  • our ‘naked’ pointers are obtained only from ‘owning’ pointers, from ‘soft’ pointers, or by taking an address of an existing on-stack object. This implies (a) that all pointer arithmetic is prohibited, and (b) that all casts which result in a pointer (except for dynamic_cast<>) are prohibited too.
  • We are allowed to copy our ‘naked’ pointers into another ‘naked’ pointer of the same type (or a parent type); however, whenever we’re copying a ‘naked’ pointer, we MUST ensure that the lifetime of the copy is not longer than the lifetime of the original pointer.

The most reliable way to enforce the ‘lifetime is never extended’ rule above is to say that all copying of ‘naked’ pointers is prohibited, except for a few well-defined cases:

  • Calling a function passing the pointer as a parameter, is ok. NB: double-naked-pointers and references to naked pointers effectively allow to us to return the pointer back (see on returning ‘naked’ pointer below) – so assigning to such *ptrs should be prohibited.
  • Creating an on-stack copy of a ‘naked’ pointer (initialized from another pointer: ‘owning’, ‘soft’, or ‘naked’) of is generally ok too.

On the other hand, the following constructs are known to violate the ‘lifetime is never extended’ rule, and are therefore prohibited:

Note that the respective lists of ways to create pointers are exhaustive; in other words: the ONLY way to create an ‘owning’ pointer is from operator new of the same type; the ONLY ways to create a ‘safe’ pointer is (a) from an ‘owning’ pointer of the same base type, or (b) as a copy of a ‘safe’ pointer of the same type; and the ONLY way to create a ‘naked’ pointer is from {‘owning’|‘soft’|‘naked’} pointer as long as the ‘naked’ pointer doesn’t extend the lifetime of the original pointer.

This implies prohibiting casting to pointers (and also prohibits C-style cast and static_cast with respect to pointers; however, implicit pointer casts and dynamic_cast are ok). Note that although casting from pointers won’t cause memory corruption, it is not a good idea in general.

This also implies that assigning the result of new to anything except an ‘owning’ pointer is prohibited.

Implementations for both ‘owning’ and ‘safe’ pointers should take into account that their methods may be invoked after their destructor is called (see discussion in (*) paragraph below); in this case, we’ll either guarantee that no pointer to a non-existing object will be returned, or (even better) will throw an exception.

Note that for the time being, we do NOT handle collections and arrays; in particular, we have to prohibit indexed dereferencing (a[i] is inherently dangerous unless we’re ensuring boundary checks). That’s it – we’ve got our perfectly safe dialect of C++, and while it doesn’t deal with arrays or collections, it is a very good foundation for further
refinements.

Proof sketch

The formal proof of the program under the rules above is going to be lengthy and, well, formal, but a sketch of such a proof is as follows.

Hare thumb up:our rules do NOT allow the creation of any pointers, unless it is a pointer to an existing on-heap object, or an on-stack object (the latter is for ‘naked’ pointers only).First, let’s note that our rules do NOT allow the creation of any pointers, unless it is a pointer to an existing on-heap object, or an on-stack object (the latter is for ‘naked’ pointers only). NB: if we also want to deal with globals, this is trivial too, but for the time being let’s prohibit globals within (Re)Actors, which is good practice anyway.

As a result, there is no risk of the pointer pointing somewhere where there was never an object, and the only risks we’re facing are about the pointers to objects which did exist but don’t exist anymore. We have two types of such objects: on-stack objects, and on-heap ones.

For on-stack objects which don’t exist anymore:

  • To start with, only ‘naked’ pointers can possibly point to on-stack objects
  • Due to our ‘the lifetime of a ‘naked’ pointer never extends’ rule, we’re guaranteed that a ‘naked’ pointer will be destroyed not later than the object it points to, which means that we cannot possibly corrupt memory using it.

For on-heap objects which don’t exist anymore:

  • ‘owning’ pointers are inherently safe (according to our rules, there is no way to delete an object while an ‘owning’ pointer still points there)
  • ‘soft’ pointers are safe because of the runtime checks we’re doing every time we’re dereferencing them or converting them into a ‘naked’ pointer (and throwing an exception if the object they’re pointing to doesn’t exist anymore).
  • ‘naked’ pointers to on-heap objects are safe because of the same ‘the lifetime never extends’ rule and because of the postponing the freeing of memory until we’re outside Reactor::react(). Elaborating on it a bit: as we know that at the moment of conversion from an ‘owning’ pointer or a ‘soft’ pointer to a ‘naked’ pointer, the object did exist, and the memory won’t be actually freed until we’re outside of Reactor::react(), this means that we’re fine until we’re outside of Reactor::react(); and as soon as we’re outside of Reactor::react(), as discussed above, there are no ‘naked’ pointers anymore, so there is no risk of them dereferencing the memory which we’re going to free.

(*) Note that via ‘naked’ pointers, we are still able to access objects which have already had their destructors called (but memory unreleased); this means that to ensure safety, those objects from supporting libraries which don’t follow the rules above themselves (in particular, collections) must ensure that their destructors leave the object in a ‘safe’ state (at least with no ‘dangling’ pointers left behind; more formally: there should be a firm guarantee that any operation over a destructed object cannot possibly cause memory corruption or return a pointer which is not a nullptr, though ideally it should cause an exception).

Phew. Unless I’m mistaken somewhere, it seems that we got our perfectly safe dialect of C++ (without collections, that is).

Enter collections

[Enter Romeo and Juliet]
Romeo: Speak your mind. You are as worried as the sum of yourself
and the difference between my small smooth hamster and my nose.
Speak your mind!
Juliet: Speak YOUR mind! You are as bad as Hamlet!
You are as small as the difference between the square of the difference
between my little pony and your big hairy hound
and the cube of your sorry little codpiece. Speak your mind!
[Exit Romeo]

— Program in The Shakespeare Programming Language —

As noted above, collections (including arrays) are not covered by our original rules above. However, it is relatively easy to add them, by adding a few additional rules with regards to collections. First, we will NOT use the usual iterators (including pointers within arrays); instead, we’re using ‘safe iterators’. A ‘safe iterator’ (or ‘safe range’) is a tuple/struct/class/… which contains:

  • An {‘owning’|’soft’|’naked’} pointer/reference to the collection
  • An iterator (or range) within the collection pointed out by the pointer above

The second rule about collections is that all the access to the collections (including iterator dereferencing) MUST be written in a way which guarantees safety.

For example, if we’re trying to access an element of the array via our ‘safe iterator’, it is the job of the operator* of our ‘safe iterator’ to ensure that it stays within the array (and to throw an exception otherwise).

This is certainly possible:

  • For arrays, we can always store the size of the array within our array collection, and check the validity of our ‘safe iterator’ before dereferencing/indexing.
  • Then, as all the std:: collections are implemented either on top of single objects or on top of arrays, rewriting them in a safe manner is always possible based on the techniques which we already discussed.
  • On the other hand, more optimal implementations seem to be possible for specific collections. As one example, deque<> can be implemented without following the rules discussed above within its implementation, and simply checking range of the iterator instead. In another example, tree-based collections can be optimized too.

This way, whenever we want to use such a ‘safe iterator’/‘safe range’, first we’ll reach the collection (relying on our usual safety guarantees for our {‘owning’|’soft’|’naked’} pointers), and then the collection itself will guarantee that its own iterator is valid before dereferencing it.

Different approaches to safety in infrastructure code
and Reactor code

20% of people consume 80% of beer

— Pareto principle as applied to beer consumption —

An observation (*) above, as well as the discussion about optimized collections, highlights one important property of our Perfectly Safe Reactors:

we can (and often SHOULD) have different approaches to safety of the Reactor::react() and the rest of the code.

This dichotomy between infrastructure code and Reactor code is actually very important in practice. Infrastructure code (including supporting libraries such as collections, etc.) is:

  • written once – and then stays pretty much unchanged
  • usually relatively small compared to the business-logic stuff
  • called over and over
  • often fits into the 5% of the code which takes 95% of the execution time

In contrast, (Re)Actor code:

  • contains business logic, which has a tendency to be changed several times a day
  • as with any business logic, its code base can be huuuuge
  • most of this code is called only occasionally compared to the Infrastructure Code
  • 90% of it is glue code, which very rarely causes any performance issues

Hare pointing out:in the case of our rules, the expected performance hit is pretty much negligibleAs a result, we can observe that for small, never-changing, and performance-critical Infrastructure Code, it is both feasible and desirable to provide safe highly-optimized versions (which may or may not follow our rules above in the name of performance). On the other hand, for (Re)Actor Code, formal safety is usually much more important than bare performance. This is especially so as, in the case of our rules, the expected performance hit is pretty much negligible: the only two runtime checks we’re doing happen at ‘safe’ pointer to ‘naked’ pointer conversion (or at ‘safe’ pointer dereferencing), and at collection accesses; neither of them is expected to be noticeable (except in some very performance-critical code).

Generalizing this point further, we can split our code base into a small performance critical part (which we’ll handle without our safety rules, but which is small enough to be scrutinized in a less formal manner), and a large performance-agnostic part (which we’ll handle according to the safety rules above); however, in practice, these lines will be usually very close to the lines between Infrastructure Code and (Re)Actor Code.

One important thing to keep in mind when writing those Infrastructure objects which are intended to be called from (Re)Actors is ensuring that they’re safe even after their destructor is called (as discussed in the (*) paragraph above). On the other hand, if our object follows our safety rules above, this will be achieved automagically.

All our rules are very local, which enables
automated checks

One further very important property of our safety rules is that

Indeed, all the rules above can be validated within the scope of one single function. In other words, it is possible to find whether our function f() is compliant with our safety rules using function f() and only function f().

Hare with smiley sign:This not only allows for simple code reviews, but also means that this process can be automated relatively easily. This not only allows for simple code reviews, but also means that this process can be automated relatively easily. Implementing such a tool is a different story (and it is still going to take a while) but is perfectly feasible (well, as long as we find a tool to parse C++ and get some kind of AST, but these days at least Clang does provide this kind of functionality).

As soon as such an automated check tool is implemented, development will become a breeze:

  • We separate our code into ‘safe’ code and ‘unsafe’ code (usually, though not strictly necessary, along the lines of the (Re)Actor::react()).
  • For ‘safe’ code, such an automated check tool becomes a part of the build
  • As a result, as long as ‘unsafe’ code is not changed (i.e. only ‘safe’ code is changed) there can be no possible regressions which can cause memory corruptions.

While this is not a real ‘silver bullet’ (nothing really is – in fact, the safety of theoretically safe languages also hinges on the safety of their compilers and standard libraries), this approach is expected to improve memory safety of the common business-level code by orders of magnitude (and even if your code is already perfectly safe, this approach will provide all the necessary peace of mind with regards to safety).

Conclusion

That’s pretty much it – we DID get a perfectly usable C++ dialect which is also 100% safe against memory corruption and against memory leaks. BTW, if necessary our approach can easily be extended to a more flexible model which relies on semantics similar to that of std:shared_ptr<> and std::weak_ptr<>; while I am not a fan of reference-counted semantics (from my experience, reference counting causes much more trouble than it is worth – and simplistic ‘owning’ pointers are more straightforward and are perfectly usable for millions of LOC projects) – it is perfectly feasible to implement shared ownership along the same lines as discussed above; the only substantial twist on this way is that as std::shared_ptr<> (unlike our model above) does allow for circular references and resulting memory leaks, we will probably need to detect them (which can be done, for example, by running some kind of incremental garbage collection at those points where we’re waiting for the input, sitting outside of Reactor::react()).

Phew. BTW, as the whole thing is quite complicated, please make sure to email me if you find any problem with the approach above (while I’m sure that it is possible to achieve safety along the lines discussed above, C++ is complicated enough we might need another restriction or two on this method).

[+]References

[+]Disclaimer

Acknowledgements

This article has been originally published in Overload Journal #140 in August 2017 and is also available separately on ACCU web site. Re-posted here with a kind permission of Overload. The article has been re-formatted to fit your screen.

Cartoons by Sergey GordeevIRL from Gordeev Animation Graphics, Prague.

Airtable gets $52M in funding

$
0
0
source
Airtable
  • Airtable has raised $52 million in Series B funding led by Caffeinated Capital and CRV.
  • Airtable's app uses a simple spreadsheet interface to make it easy to build custom apps. It also launched a new product, called Blocks, to make it easier to use Airtable to build an app.
  • Airtable has become a sleeper hit in Silicon Valley, earning love from both individual users and companies like Tesla, WeWork, Airbnb, and Time Magazine.
  • An IPO is the plan, because CEO Howie Liu sold his last company to Salesforce and doesn't want to go that route again.

Airtable, a spreadsheet app that's grown into one of Silicon Valley's sleeper hits, has raised $52 million in new funding. This deal was led by Caffeinated Capital and CRV. In total, the company has raised $62.6 million so far.

When it was founded in 2015, Airtable was a small business-focused spreadsheet program. Now, it's found new audiences, as companies like Tesla, Airbnb, and WeWork all sign on customers. And even smaller teams and invidual users have come to rely on Airtable to organize their data.

The secret to Airtable's success, according to CEO Howie Liu, is that it actually makes it super-easy to make a custom app of your own. Every cell of an Airtable spreadsheet can store anything, including photos or lists. And it makes it easy to put a simple interface on top of the spreadsheet, turning it into a simple, but powerful, app - without coding.

"We think we can be what Windows was for personal computing," he said. "We're confident we can be the Apple or Microsoft of the low-end app space."

For some real-world examples: Tesla uses Airtable to store information and keep track of every car that leaves its factory Fremont, California. The video and photo teams at Time Magazine and Fortune.com use Airtable to manage their entire production schedule, too. It's customizable, without requiring a lot of work.Airtable

caption
Airtable lets you build basic apps with no coding.
source
Airtable

"It really allows people with little or no technical knowledge to build high-level workflow systems," Liu said.

Liu's first company was acquired by Salesforce when he was 21 years old. A year later, he quit to start Airtable after realizing how Google Sheets and Microsoft Excel were limiting. Actor Ashton Kutcher, who had previously invested in Liu's first company, invested in Airtable after Liu pitched Kutcher in his trailer on the Two and a Half men set.

It worked out, says Liu, because Airtable is growing fast - while he didn't disclose specifics, revenue is up 500% from the year-ago period, he says. The app's users are in the seven digits, with "thousands" of signups every day, Liu says. And Tesla has become one of Airtable's biggest clients, with a deal size in the six figures.

Liu says that all of the interest caught him a little by surprise: "If you asked me on the day we launched if a few years later we would be signing six figure enterprise clients, I would have said no."Airtable mapping block

caption
Airtable's Mapping Block
source
Airtable

Liu also says that he's had good advice along the way: Former Slack CMO Bill Macaitis is an advisor to Airtable, as is Amanda Kleha, formerly the head of marketing at Zendesk. Both of them help assist with that enterprise marketing push. Box CFO Dylan Smith, a college friend of Liu's, has also acted as an advisor.

Airtable isn't yet profitable, Liu said, but can be "cash flow positive at a moments notice." And an IPO is the eventual goal, he says, because he doesn't want to sell his company again. The funding will go towards opening an office in New York City, hiring, and product development.

Airtable is also launching a new product called Blocks, which allows users to build more involved applications for businesses, sti lll without coding. TheMapping Block, for example, lets a film studio can track in real-time where all of their shoots are happening around the globe, from the status of equipment rentals to a production's status.

Liu attributes Airtable's fast growth to a change in marketing strategy. Recently, Liu and his team shifted focus to going after larger enterprise customers, rather than smaller businesses and startups. Once they made that decision - and they started blanketing San Francisco in billboards - word began to spread.

"It's crazy how Airtable kind of blew up," Patrick Perini, vice president of product at San Francisco-based startup Mira, told Business Insider. Perini is considering moving all of Mira's operations on to Airtable. "All of my developer friends are pretty excited about it," Perini said.

Show HN: Fossa-cli – Fast and reliable dependency analysis for any codebase

$
0
0

README.md

FOSSA

fossa-cli - Fast, portable and reliable dependency analysis for any codebase.

Background

fossa analyzes complex codebases to generate dependency reports and license notices. By leveraging existing build environments, it can generate fast and highly-accurate results.

Features:

  • Supports over 15+ languages & environments (JavaScript, Java, Ruby, Golang, PHP, etc...)
  • Auto-configures for monoliths; instantly handles multiple builds in large codebases
  • Fast & portable; a cross-platform binary you can drop into CI or dev machines
  • Generates offline documentation for license notices & third-party attributions
  • Tests dependencies against license violations, audits and vulnerabilities (coming soon!) by integrating with https://fossa.io

Click here to learn more about the reasons and technical details behind this project.

Installation

Install the latest Github Release using curl:

curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash

We support Windows, MacOS (Darwin), and Linux amd64 machines.

Quick Start

Run fossa -o in your repo directory to output a dependency report in JSON:

[
  {"Name": "fossa-cli","Type": "golang","Manifest": "github.com/fossas/fossa-cli/cmd/fossa","Build": {"Dependencies": [
        {"locator": "go+github.com/rhysd/go-github-selfupdate$d5c53b8d0552a7bf6b36457cd458d27c80e0210b","data": {"name": "github.com/rhysd/go-github-selfupdate","version": "d5c53b8d0552a7bf6b36457cd458d27c80e0210b"
          }
        },...
      ],...
    }
  },...
]

Run fossa and provide a FOSSA API Key to get a rich, hosted report:

export FOSSA_API_KEY="YOUR_API_KEY_HERE"# Now, you can just run `fossa`!
fossa# Output:# ==========================================================##    View FOSSA Report: https://app.fossa.io/{YOUR_LINK}## ==========================================================

Configuration

Initialize configuation and scan for supported modules:

fossa init # writes to `.fossa.yml`

This will initialize a .fossa.yml file that looks like this:

version: 1cli:server: https://app.fossa.ioproject: github.com/fossas/fossa-clianalyze:modules:
    - name: fossa-clipath: ./cmd/fossatype: go# ...

Check out our User Guide to learn about editing this file.

After configuration, you can now preview and upload new results:

# Run FOSSA analysis and preview the results we're going to upload
fossa -o# Run FOSSA and upload results# Going forward, you only need to run this one-liner
FOSSA_API_KEY=YOUR_API_KEY_HERE fossa

Integrating with CI

Testing for License Violations

If you've integrated with https://fossa.io, you can use fossa test to fail builds against your FOSSA scan status.

# Exit with a failing status and dump an issue report to stderr# if your project fails its license scan
FOSSA_API_KEY=YOUR_API_KEY_HERE fossa test# Output:# --------------------------# - exit status (1)## * FOSSA discovered 7 license issue(s) in your dependencies:## UNLICENSED_DEPENDENCY (3)# * pod+FBSnapshotTestCase$1.8.1# * pod+FBSnapshotTestCase$2.1.4# * pod+Then$2.1.0## POLICY_FLAG (4)# * mvn+com.fasterxml.jackson.core:jackson-core$2.2.3# * npm+xmldom$0.1.27# * pod+UICKeyChainStore$1.0.5# * gem+json$1.7.7##✖ FOSSA license scan failed: 7 issue(s) found.

Generating License Notices

To generate a license notice with each CI build, you can use the fossa report command:

# write a license notice to NOTICE.txt
fossa report --type licenses > NOTICE.txt

See this repo's NOTICE file for an example.

License data is provided by https://fossa.io's 500GB open source registry.

Reference

Check out the User Guide for more details.

Development

View our Contribution Guidelines to get started.

License

fossa is Open Source and licensed under the MPL-2.0.

You are free to use fossa for commercial or personal purposes. Enjoy!

FOSSA Status


Launch HN: Piccolo (YC W18) – Camera for controlling your home with gestures

$
0
0
Hi HN — we’re Marlon and Neil, founders of Piccolo (https://www.piccololabs.com/). Piccolo is a smart camera that lets you control your TV, lamps, fans, speakers, and other devices with simple gestures. For example, you can point at your lamps with your hand to turn them on or off.

The two of us have had an interest in computer vision for a long time and were in Udacity’s first self-driving car nanodegree cohort in 2016. We started this as a side project to control one lamp and soon had our entire house connected. For some actions, we found gestures to be much faster and more intuitive. For example, pointing at a lamp to turn it on is way more natural than saying “Hey Alexa, can you turn on my left living room lamp?”

To set up Piccolo, you can place it anywhere (near the TV is usually best), and then on the app you can indicate with bounding boxes where the devices are. After that, you connect those same devices (Chromecast, Hue lights, smart plugs, etc.), and you’re good to go. Some processing happens on-device, but the more complicated models are run in the cloud. Since we’re not a security camera, there’s no need to store video and so no image/video data is ever stored.

We’re excited about the experiences you can build when you have a camera and apply computer vision techniques. With recent progress in human pose estimation, object classification, and object tracking, there’s really a lot you can do. We’re starting out with gestures, but our goal is to build a platform that lets anyone create and deploy vision apps. Here's a few things we're excited about:

- New apps. For example an app that detects medical emergencies (like an elderly person falling). We'd also love an app that can tell you where you left your phone and keys.

- App integrations. For example, letting Netflix know which people are in the room to get tailored recommendations for everyone vs. just the person signed in.

- Smarter hardware. For example, an Espresso machine that, with one click, makes your favorite drink because it knows who pressed the button.

- Voice-vision fusion. You should be able to trigger Alexa just by gazing at the Alexa device instead of saying "Alexa". You should also be able to hold something and say "Order 5 more of these".

We're giving away 20 pre-release units next month to anyone that joins the waitlist. We’re happy to answer any questions and look forward to your feedback. If you want to follow up, our emails are marlon@piccololabs.com and neil@piccololabs.com.

How JavaScript works: the rendering engine and tips to optimize its performance

$
0
0

This is post # 11 of the series dedicated to exploring JavaScript and its building components. In the process of identifying and describing the core elements, we also share some rules of thumb we use when building SessionStack, a JavaScript application that needs to be robust and highly-performant to help users see and reproduce their web app defects real-time.

If you missed the previous chapters, you can find them here:

So far, in our previous blog posts of the “How JavaScript works” series we’ve been focusing on JavaScript as a language, its features, how it gets executed in the browser, how to optimize it, etc.

When you’re building web apps, however, you don’t just write isolated JavaScript code that runs on its own. The JavaScript you write is interacting with the environment. Understanding this environment, how it works and what it is composed of will allow you to build better apps and be well-prepared for potential issues that might arise once your apps are released into the wild.

So, let’s see what the browser main components are:

  • User interface: this includes the address bar, the back and forward buttons, bookmarking menu, etc. In essence, this is every part of the browser display except for the window where you see the web page itself.
  • Browser engine:ithandles the interactions between the user interface and the rendering engine
  • Rendering engine: it’s responsible for displaying the web page. The rendering engine parses the HTML and the CSS and displays the parsed content on the screen.
  • Networking: these are network calls such as XHR requests, made by using different implementations for the different platforms, which are behind a platform-independent interface. We talked about the networking layer in more detail in a previous post of this series.
  • UI backend: it’s used for drawing the core widgets such as checkboxes and windows. This backend exposes a generic interface that is not platform-specific. It uses operating system UI methods underneath.
  • JavaScript engine: We’ve covered this in great detail in a previous post from the series. Basically, this is where the JavaScript gets executed.
  • Data persistence: your app might need to store all data locally. The supported types of storage mechanisms include localStorage, indexDB, WebSQL and FileSystem.

In this post, we’re going to focus on the rendering engine, since it’s handling the parsing and the visualization of the HTML and the CSS, which is something that most JavaScript apps are constantly interacting with.

Overview of the rendering engine

The main responsibility of the rendering engine is to display the requested page on the browser screen.

Rendering engines can display HTML and XML documents and images. If you’re using additional plugins, the engines can also display different types of documents such as PDF.

Rendering engines

Similar to the JavaScript engines, different browsers use different rendering engines as well. These are some of the popular ones:

  • Gecko — Firefox
  • WebKit — Safari
  • Blink — Chrome, Opera (from version 15 onwards)

The process of rendering

The rendering engine receives the contents of the requested document from the networking layer.

Constructing the DOM tree

The first step of the rendering engine is parsing the HTML document and converting the parsed elements to actual DOM nodes in a DOM tree.

Imagine you have the following textual input:

The DOM tree for this HTML will look like this:

Basically, each element is represented as the parent node to all of the elements, which are directly contained inside of it. And this is applied recursively.

Constructing the CSSOM tree

CSSOM refers to the CSS Object Model. While the browser was constructing the DOM of the page, it encountered a link tag in the head section which was referencing the external theme.css CSS style sheet. Anticipating that it might need that resource to render the page, it immediately dispatched a request for it. Let’s imagine that the theme.css file has the following contents:

As with the HTML, the engine needs to convert the CSS into something that the browser can work with — the CSSOM. Here is how the CSSOM tree will look like:

Do you wonder why does the CSSOM have a tree structure? When computing the final set of styles for any object on the page, the browser starts with the most general rule applicable to that node (for example, if it is a child of a body element, then all body styles apply) and then recursively refines the computed styles by applying more specific rules.

Let’s work with the specific example that we gave. Any text contained within a span tag that is placed within the body element, has a font size of 16 pixels and has a red color. Those styles are inherited from the body element. If a span element is a child of a p element, then its contents are not displayed due to the more specific styles that are being applied to it.

Also, note that the above tree is not the complete CSSOM tree and only shows the styles we decided to override in our style sheet. Every browser provides a default set of styles also known as “user agent styles” — that’s what we see when we don’t explicitly provide any. Our styles simply override these defaults.

Constructing the render tree

The visual instructions in the HTML, combined with the styling data from the CSSOM tree, are being used to create a render tree.

What is a render tree you may ask? This is a tree of the visual elements constructed in the order in which they will be displayed on the screen. It is the visual representation of the HTML along with the corresponding CSS. The purpose of this tree is to enable painting the contents in their correct order.

Each node in the render tree is known as a renderer or a render object in Webkit.

This is how the renderer tree of the above DOM and CSSOM trees will look like:

To construct the render tree, the browser does roughly the following:

  • Starting at the root of the DOM tree, it traverses each visible node. Some nodes are not visible (for example, script tags, meta tags, and so on), and are omitted since they are not reflected in the rendered output. Some nodes are hidden via CSS and are also omitted from the render tree. For example, the span node — in the example above it’s not present in the render tree because we have an explicit rule that sets the display: none property on it.
  • For each visible node, the browser finds the appropriate matching CSSOM rules and applies them.
  • It emits visible nodes with content and their computed styles

You can take a look at the RenderObject’s source code (in WebKit) here: https://github.com/WebKit/webkit/blob/fde57e46b1f8d7dde4b2006aaf7ebe5a09a6984b/Source/WebCore/rendering/RenderObject.h

Let’s just look at some of the core things for this class:

Each renderer represents a rectangular area usually corresponding to a node’s CSS box. It includes geometric info such as width, height, and position.

Layout of the render tree

When the renderer is created and added to the tree, it does not have a position and size. Calculating these values is called layout.

HTML uses a flow-based layout model, meaning that most of the time it can compute the geometry in a single pass. The coordinate system is relative to the root renderer. Top and left coordinates are used.

Layout is a recursive process — it begins at the root renderer, which corresponds to the <html> element of the HTML document. Layout continues recursively through a part or the entire renderer hierarchy, computing geometric info for each renderer that requires it.

The position of the root renderer is 0,0 and its dimensions have the size of the visible part of the browser window (a.k.a. the viewport).

Starting the layout process means giving each node the exact coordinates where it should appear on the screen.

Painting the render tree

In this stage, the renderer tree is traversed and the renderer’s paint() method is called to display the content on the screen.

Painting can be global or incremental (similar to layout):

  • Global — the entire tree gets repainted.
  • Incremental — only some of the renderers change in a way that does not affect the entire tree. The renderer invalidates its rectangle on the screen. This causes the OS to see it as a region that needs repainting and to generate a paint event. The OS does it in a smart way by merging several regions into one.

In general, it’s important to understand that painting is a gradual process. For better UX, the rendering engine will try to display the contents on the screen as soon as possible. It will not wait until all the HTML is parsed to start building and laying out the render tree. Parts of the content will be parsed and displayed, while the process continues with the rest of the content items that keep coming from the network.

Order of processing scripts and style sheets

Scripts are parsed and executed immediately when the parser reaches a <script> tag. The parsing of the document halts until the script has been executed. This means that the process is synchronous.

If the script is external then it first has to be fetched from the network (also synchronously). All the parsing stops until the fetch completes.

HTML5 adds an option to mark the script as asynchronous so that it gets parsed and executed by a different thread.

Optimizing the rendering performance

If you’d like to optimize your app, there are five major areas that you need to focus on. These are the areas over which you have control:

  1. JavaScript — in previous posts we covered the topic of writing optimized code that doesn’t block the UI, is memory efficient, etc. When it comes to rendering, we need to think about the way your JavaScript code will interact with the DOM elements on the page. JavaScript can create lots of changes in the UI, especially in SPAs.
  2. Style calculations — this is the process of determining which CSS rule applies to which element based on matching selectors. Once the rules are defined, they are applied and the final styles for each element are calculated.
  3. Layout — once the browser knows which rules apply to an element, it can begin to calculate how much space the latter takes up and where it is located on the browser screen. The web’s layout model defines that one element can affect others. For example, the width of the <body> can affect the width of its children and so on. This all means that the layout process is computationally intensive. The drawing is done in multiple layers.
  4. Paint — this is where the actual pixels are being filled. The process includes drawing out text, colors, images, borders, shadows, etc. — every visual part of each element.
  5. Compositing — since the page parts were drawn into potentially multiple layers they need to be drawn onto the screen in the correct order so that the page renders properly. This is very important, especially for overlapping elements.

Optimizing your JavaScript

JavaScript often triggers visual changes in the browser. All the more so when building an SPA.

Here are a few tips on which parts of your JavaScript you can optimize to improve rendering:

  • Avoid setTimeout or setInterval for visual updates. These will invoke the callback at some point in the frame, possible right at the end. What we want to do is trigger the visual change right at the start of the frame not to miss it.
  • Move long-running JavaScript computations to Web Workers as we have previously discussed.
  • Use micro-tasks to introduce DOM changes over several frames. This is in case the tasks need access to the DOM, which is not accessible by Web Workers. This basically means that you’d break up a big task into smaller ones and run them inside requestAnimationFrame , setTimeout, setInterval depending on the nature of the task.

Optimize your CSS

Modifying the DOM through adding and removing elements, changing attributes, etc. will make the browser recalculate element styles and, in many cases, the layout of the entire page or at least parts of it.

To optimize the rendering, consider the following:

  • Reduce the complexity of your selectors. Selector complexity can take more than 50% of the time needed to calculate the styles for an element, compared to the rest of the work which is constructing the style itself.
  • Reduce the number of elements on which style calculation must happen. In essence, make style changes to a few elements directly rather than invalidating the page as a whole.

Optimize the layout

Layout re-calculations can be very heavy for the browser. Consider the following optimizations:

  • Reduce the number of layouts whenever possible. When you change styles the browser checks to see if any of the changes require the layout to be re-calculated. Changes to properties such as width, height, left, top, and in general, properties related to geometry, require layout. So, avoid changing them as much as possible.
  • Use flexbox over older layout models whenever possible. It works faster and can create a huge performance advantage for your app.
  • Avoid forced synchronous layouts. The thing to keep in mind is that while JavaScript runs, all the old layout values from the previous frame are known and available for you to query. If you access box.offsetHeight it won’t be an issue. If you, however, change the styles of the box before it’s accessed (e.g. by dynamically adding some CSS class to the element), the browser will have to first apply the style change and then run the layout. This can be very time-consuming and resource-intensive, so avoid it whenever possible.

Optimize the paint

This often is the longest-running of all the tasks so it’s important to avoid it as much as possible. Here is what we can do:

  • Changing any property other than transforms or opacity triggers a paint. Use it sparingly.
  • If you trigger a layout, you will also trigger a paint, since changing the geometry results in a visual change of the element.
  • Reduce paint areas through layer promotion and orchestration of animations.

Rendering is a vital aspect of how SessionStack functions. SessionStack has to recreate as a video everything that happened to your users at the time they experienced an issue while browsing your web app. To do this, SessionStack leverages only the data that was collected by our library: user events, DOM changes, network requests, exceptions, debug messages, etc. Our player is highly optimized to properly render and make use of all the collected data in order to offer a pixel-perfect simulation of your users’ browser and everything that happened in it, both visually and technically.

There is a free plan if you’d like to give SessionStack a try.

Resources

AI chip company SambaNova Systems raises $56M

$
0
0

Another massive financing round for an AI chip company is coming in today, this time for SambaNova Systems — a startup founded by a pair of Stanford professors and a longtime chip company executive — to build out the next generation of hardware to supercharge AI-centric operations.

SambaNova joins an already quite large class of startups looking to attack the problem of making AI operations much more efficient and faster by rethinking the actual substrate where the computations happen. The GPU has become increasingly popular among developers for its ability to handle the kinds of lightweight mathematics in very speedy fashion necessary for AI operations. Startups like SambaNova look to create a new platform from scratch, all the way down to the hardware, that is optimized exactly for those operations. The hope is that by doing that, it will be able to outclass a GPU in terms of speed, power usage, and even potentially the actual size of the chip. SambaNova today said it has raised a huge $56 million series A financing round was co-led by GV and Walden International, with participation from Redline Capital and Atlantic Bridge Ventures.

SambaNova is the product of technology from Kunle Olukotun and Chris Ré, two professors at Stanford, and led by former Oracle SVP of development Rodrigo Liang, who was also a VP at Sun for almost 8 years. When looking at the landscape, the team at SambaNova looked to work their way backwards, first identifying what operations need to happen more efficiently and then figuring out what kind of hardware needs to be in place in order to make that happen. That boils down to a lot of calculations stemming from a field of mathematics called linear algebra done very, very quickly, but it’s something that existing CPUs aren’t exactly tuned to do. And a common criticism from most of the founders in this space is that GPUs, while much more powerful than CPUs when it comes to these operations, are still ripe for disruption.

“You’ve got these huge [computational] demands, but you have the slowing down of Moore’s law,” Olukotun said. “The question is, how do you meet these demands while Moore’s law slows. Fundamentally you have to develop computing that’s more efficient. If you look at the current approaches to improve these applications based on multiple big cores or many small, or even FPGA or GPU, we fundamentally don’t think you can get to the efficiencies you need. You need an approach that’s different in the algorithms you use and the underlying hardware that’s also required. You need a combination of the two in order to achieve the performance and flexibility levels you need in order to move forward.”

While a $56 million funding round for a series A might sound colossal, it’s becoming a pretty standard number for startups looking to attack this space, which has an opportunity to beat the big chipmakers and create a new generation of hardware that will be omnipresent among any device that is built around artificial intelligence — whether that’s a chip sitting on an autonomous vehicle doing rapid image processing to potentially even a server within a healthcare organization training models for complex medical problems. another chip startup, got $50 million in funding from Sequoia Capital, while Cerebras Systems also received significant funding from Benchmark Capital. Yet amid this flurry of investment activity, nothing has really shipped yet, and you’d define these companies raising tens of millions of dollars as pre-market

Olukotun and Liang wouldn’t go into the specifics of the architecture, but they are looking to redo the operational hardware to optimize for the AI-centric frameworks that have become increasingly popular in fields like image and speech recognition. At its core, that involves a lot of rethinking of how interaction with memory occurs and what happens with heat dissipation for the hardware, among other complex problems. Apple, Google with its TPU, and reportedly Amazon have taken an intense interest in this space to design their own hardware that’s optimized for products like Siri or Alexa, which makes sense because dropping that latency to as close to zero as possible with as much accuracy as possible in the end improves the user experience. A great user experience leads to more lock-in for those platforms, and while the larger players may end up making their own hardware, GV’s Dave Munichiello — who is joining the company’s board — says this is basically a validation that everyone else is going to need the technology soon enough.

“Large companies see a need for specialized hardware and infrastructure,” he said. “AI and large-scale data analytics are so essential to providing services the largest companies provide that they’re willing to invest in their own infrastructure, and that tells us more investment is coming. What Amazon and Google and Microsoft and Apple are doing today will be what the rest of the Fortune 100 are investing in in 5 years. I think it just creates a really interesting market and an opportunity to sell a unique product. It just means the market is really large, if you believe in your company’s technical differentiation, you welcome competition.”

There is certainly going to be a lot of competition in this area, and not just from those startups. While SambaNova wants to create a true platform, there are a lot of different interpretations of where it should go — such as whether it should be two separate pieces of hardware that handle either inference or machine training. too, is betting on an array of products, as well as a technology called Field Programmable Gate Arrays (or FPGA), which would allow for a more modular approach in building hardware specified for AI and are designed to be flexible and change over time. Both Munichiello’s and Olukotun’s arguments are that these require developers who have a special expertise of FPGA, which is a sort of niche-within-a-niche that most organizations will probably not have readily available.

Nvidia has been a major benefactor in the explosion of AI systems, but it clearly exposed a ton of interest in investing in a new breed of silicon. There’s certainly an argument for developer lock-in on Nvidia’s platforms like Cuda. But there are a lot of new frameworks, like TensorFlow, that are creating a layer of abstraction that are increasingly popular with developers. That, too represents an opportunity for both SambaNova and other startups, who can just work to plug into those popular frameworks, Olukotun said. CEO Andrew Feldman actually also addressed some of this on stage at the Goldman Sachs Technology and Internet Conference last month.

“Nvidia has spent a long time building an ecosystem around their GPUs, and for the most part, with the combination of TensorFlow, Google has killed most of its value,” Feldman said at the conference. “What TensorFlow does is, it says to researchers and AI professionals, you don’t have to get into the guts of the hardware. You can write at the upper layers and you can write in Python, you can use scripts, you don’t have to worry about what’s happening underneath. Then you can compile it very simply and directly to a CPU, TPU, GPU, to many different hardwares, including ours. If in order to do that work, you have to be the type of engineer that can do hand-tuned assembly or can live deep in the guts of hardware, there will be no adoption… We’ll just take in their TensorFlow, we don’t have to worry about anything else.”

(As an aside, I was once told that Cuda and those other lower-level platforms are really used by AI wonks like Yann LeCun building weird AI stuff in the corners of the Internet.)

There are, also, two big question marks for SambaNova: first, it’s very new, having started in just November while many of these efforts for both startups and larger companies have been years in the making. Munichiello’s answer to this is that the development for those technologies did, indeed, begin a while ago — and that’s not a terrible thing as SambaNova just gets started in the current generation of AI needs. And the second, among some in the valley, is that most of the industry just might not need hardware that’s does these operations in a blazing fast manner. The latter, you might argue, could just be alleviated by the fact that so many of these companies are getting so much funding, with some already reaching close to billion-dollar valuations.

But, in the end, you can now add SambaNova to the list of AI startups that have raised enormous rounds of funding — one that stretches out to include a myriad of companies around the world like Graphcore and Cerebras Systems, as well as a lot of reported activity out of China with companies like Cambricon Technology and Horizon Robotics. This effort does, indeed, require significant investment not only because it’s hardware at its base, but it has to actually convince customers to deploy that hardware and start tapping the platforms it creates, which supporting existing frameworks hopefully alleviates.

“The challenge you see is that the industry, over the last ten years, has underinvested in semiconductor design,” Liang said. “If you look at the innovations at the startup level all the way through big companies, we really haven’t pushed the envelope on semiconductor design. It was very expensive and the returns were not quite as good. Here we are, suddenly you have a need for semiconductor design, and to do low-power design requires a different skillset. If you look at this transition to intelligent software, it’s one of the biggest transitions we’ve seen in this industry in a long time. You’re not accelerating old software, you want to create that platform that’s flexible enough [to optimize these operations] — and you want to think about all the pieces. It’s not just about machine learning.”

GEMM: From Pure C to SSE Optimized Micro Kernels (2014)

$
0
0
Note: Unfortunately on NA Digest I posted the https URL of this site. As our server uses only a self signed SSL certificate that is inconvenient, e.g. some browsers will not display formulas properly even if you trust the certificate. Use the http URL
http://apfel.mathematik.uni-ulm.de/~lehn/sghpc/gemm/index.html
instead. In the mean time I will order a proper signed certificate.

On the next pages we try to discover how BLIS can achieve such a great performance. For this journey we set up our own BLAS implementation!

In our ulmBLAS project we have implemented a simple matrix-matrix product that follows the ideas described in BLIS: A Framework for Rapidly Instantiating BLAS Functionality.

  • Page 1 How to obtain the ulmBLAS project.

  • Page 2 Pure C implementation

  • Page 3 Naive Use of SSE Intrinsics.

  • Page 4 Applying loop unrolling to the previous implementation.

  • Page 5 Another SSE Intrinsics Approach which is based on the BLIS micro kernel for SSE architectures.

  • Page 6 Improving pipelining by reordering SSE intrinsics.

  • Page 7 Limitations of SSE intrinsics.

  • Page 8 We go nuclear and translate the intrinsics to assember by ourself!

  • Page 9 Unrolling the nuke: demo-asm-unrolled.

  • Page 10 Fine-tuning the unrolled assembler kernel.

  • Page 11 More fine-tuning of the unrolled assembler kernel.

  • Page 12 Preparation for adding prefetching: Porting the rest of the micro kernel to assembler.

  • Page 13 Adding prefetching.

  • Page 14 Benchmarking! Comparing the performance with MKL, ATLAS, Eigen and the original BLIS micro kernel.

Note that all benchmarks on these pages were generated when doctool transformed the doc files to HTML. All this happened on my MacBook Pro which has a 2.4 GHz Intel Core 2 Duo (P8600, “Penryn”). The theoretical peak performance of one core is 9.6 GFLOPS.

Back to the main course

Rust-style resource management in OCaml

$
0
0

(Submitted on 7 Mar 2018)

Abstract: We present a resource-management model for ML-style programming languages, designed to be compatible with the OCaml philosophy and runtime model. This is a proposal to extend the OCaml language with destructors, move semantics, and resource polymorphism, to improve its safety, efficiency, interoperability, and expressiveness. It builds on the ownership-and-borrowing models of systems programming languages (Cyclone, C++11, Rust) and on linear types in functional programming (Linear Lisp, Clean, Alms). It continues a synthesis of resources from systems programming and resources in linear logic initiated by Baker.
It is a combination of many known and some new ideas. On the novel side, it highlights the good mathematical structure of Stroustrup's "Resource acquisition is initialisation" (RAII) idiom for resource management based on destructors, a notion sometimes confused with finalizers, and builds on it a notion of resource polymorphism, inspired by polarisation in proof theory, that mixes C++'s RAII and a tracing garbage collector (GC).
The proposal targets a new spot in the design space, with an automatic and predictable resource-management model, at the same time based on lightweight and expressive language abstractions. It is backwards-compatible: current code is expected to run with the same performance, the new abstractions fully combine with the current ones, and it supports a resource-polymorphic extension of libraries. It does so with only a few additions to the runtime, and it integrates with the current GC implementation. It is also compatible with the upcoming multicore extension, and suggests that the Rust model for eliminating data-races applies.
Interesting questions arise for a safe and practical type system, many of which have already been thoroughly investigated in the languages and prototypes Cyclone, Rust, and Alms.
Comments:62 pages
Subjects:Programming Languages (cs.PL); Logic in Computer Science (cs.LO)
Cite as: arXiv:1803.02796 [cs.PL]
 (or arXiv:1803.02796v1 [cs.PL] for this version)
From: Guillaume Munch-Maccagnoni [view email]
[v1] Wed, 7 Mar 2018 18:05:39 GMT (52kb,D)

Flight Recorder becomes part of OpenJDK

$
0
0

Summary

Provide a low-overhead data collection framework for troubleshooting Java applications and the HotSpot JVM.

Goals

  • Provide APIs for producing and consuming data as events
  • Provide a buffer mechanism and a binary data format
  • Allow the configuration and filtering of events
  • Provide events for the OS, the HotSpot JVM, and the JDK libraries

Non-Goals

  • Provide visualization or analysis of collected data
  • Enable data collection by default

Success Metrics

  • At most 1% performance overhead out-of-the-box on SPECjbb2015
  • No measurable performance overhead when not enabled

Motivation

Troubleshooting, monitoring and profiling are integral parts of the development lifecycle, but some problems occur only in production, under heavy load involving real data.

Flight Recorder records events originating from applications, the JVM and the OS. Events are stored in a single file that can be attached to bug reports and examined by support engineers, allowing after-the-fact analysis of issues in the period leading up to a problem. Tools can use an API to extract information from recording files.

Description

JEP 167: Event-Based JVM Tracing added an initial set of events to the HotSpot JVM. Flight Recorder will extend the ability to create events to Java.

JEP 167 also added a rudimentary backend, where data from events are printed to stdout. Flight Recorder will provide a single high-performance backend for writing events in a binary format.

Modules:

  • jdk.jfr
    • API and internals
    • Requires only java.base (suitable for resource constrained devices)
  • jdk.management.jfr
    • JMX capabilities
    • Requires jdk.jfr and jdk.management

Flight Recorder can be started on the command line:

$ java -XX:StartFlightRecording ...

Recordings may also be started and controlled using the bin/jcmd tool:

$ jcmd <pid> JFR.start
$ jcmd <pid> JFR.dump filename=recording.jfr
$ jcmd <pid> JFR.stop

This functionality is provided remotely over JMX, useful for tools such as Mission Control.

Producing and consuming events

There is an API for users to create their own events:

import jdk.jfr.*;

@Label("Hello World")
@Description("Helps the programmer getting started")
class HelloWorld extends Event {
   @Label("Message")
   String message;
}

public static void main(String... args) throws IOException {
    HelloWorld event = new HelloWorld();
    event.message = "hello, world!";
    event.commit();
}

Data can be extracted from recording files using classes available injdk.jfr.consumer:

import java.nio.file.*;
import jdk.jfr.consumer.*;

Path p = Paths.get("recording.jfr");
for (RecordedEvent e : RecordingFile.readAllEvents(p)) {
   System.out.println(e.getStartTime() + " : " + e.getValue("message"));
}

Buffer mechanism and binary data format

Threads write events, lock-free, to thread-local buffers. Once a thread-local buffer fills up, it is promoted to a global in-memory circular buffer system which maintains the most recent event data. Depending on configuration, the oldest data is either discarded or written to disk allowing the history to be continuously saved. Binary files on disk have the extension .jfr and are maintained and controlled using a retention policy.

The event model is implemented in a self-describing binary format, encoded in little endian base 128 (except for the file header and some additional sections). The binary data format is not to be used directly as it is subject to change. Instead, APIs will be provided for interacting with recording files.

As an illustrative example, the class load event contains a time stamp describing when it occurred, a duration describing the timespan, the thread, a stack trace as well as three event specific payload fields, the loaded class and the associated class loaders. The size of the event is 24 bytes in total.

<memory address>: 98 80 80 00 87 02 95 ae e4 b2 92 03 a2 f7 ae 9a 94 02 02 01 8d 11 00 00
  • Event size [98 80 80 00]
  • Event ID [87 02]
  • Timestamp [95 ae e4 b2 92 03]
  • Duration [a2 f7 ae 9a 94 02]
  • Thread ID [02]
  • Stack trace ID [01]
  • Payload [fields]
    • Loaded Class: [0x8d11]
    • Defining ClassLoader: [0]
    • Initiating ClassLoader: [0]

Configure and filter events

Events can be enabled, disabled, and filtered to reduce overhead and the amount of space needed for storage. This can be accomplished using the following settings:

  • enabled - should the event be recorded
  • threshold - the duration below which an event is not recorded
  • stackTrace - if the stack trace from the Event.commit() method should be recorded
  • period - the interval at which the event is emitted, if it is periodic

There are two configuration sets that are tailored to configure Flight Recorder for the low-overhead, out-of-the-box use case. A user can easily create their own specific event configuration.

OS, JVM and JDK library events

Events will be added covering the following areas:

  • OS
    • Memory, CPU Load and CPU information, native libraries, process information
  • JVM
    • Flags, GC configuration, compiler configuration
    • Method profiling event
    • Memory leak event
  • JDK libraries
    • Socket IO, File IO, Exceptions and Errors, modules

Alternatives

An alternative to Flight Recorder is logging. Although JEP 158: Unified JVM Logging provides some level of uniformity across subsystems in the HotSpot JVM, it does not extend to Java applications and the JDK libraries. Traditionally, logging usually lacks an explicit model and metadata making it free form with the consequence that consumers must be tightly coupled to internal formats. Without a relational model, it is difficult to keep data compact and normalized.

Flight Recorder maintains a typed event model where consumers are decoupled from internals by using an API.

Testing

Performance testing will be required to ensure acceptable levels of overhead.

Risks and Assumptions

Vendor-specific backends might have been developed on top of JEP 167; the working assumption is that the Flight Recorder infrastructure ought to cover most of the existing use cases. Vendors are encouraged to engage in discussion in the context of this JEP about the feasibility of moving to a single backend as suggested.

Flight Recorder has existed for many years and was previously a commercial feature of the Oracle JDK. This JEP moves the source code to the open repository to make the feature generally available. Hence, the risk to compatibility, performance, regressions and stability is low.

Monarch butterfly numbers keep declining

$
0
0

(Beyond Pesticides, March 14, 2018) The annual count of Monarch butterflies overwintering in Mexico shows declines from last year’s numbers—a 15 percent decrease –according to figures from an official Mexican government count in the winter of 2017. These numbers underscore how at risk the iconic animal is, with a possible collapse of migration if populations are critically low.

Monarch butterflies (also known as Eastern Monarchs) embark on an impressive migration every year. Roughly 99 percent of all North American monarchs migrate each winter to oyamel fir forests on 12 mountaintops in central Mexico. Scientists estimate the population size by measuring the area of trees turned orange by the clustering butterflies. But for the second year in a row, its numbers are declining — 2.48 hectares of occupied winter habitat is down from 2.91 hectares last winter. Apart from partial rebounds in the winters of 2001 and 2003, numbers have gone down steadily since 1996. Overall monarchs have declined by more than 80 percent over the past two decades.

Earlier this year, Western Monarchs – those found west of the Rocky Mountains – overwinter in coastal California forests, were also found to be declining at an alarming rate, with scientists and conservation groups pointing to man-made factors like logging, climate change, and herbicide use on genetically engineered (GE) crop fields as primary drivers. A study conducted by the U.S. Fish and Wildlife Service last year on the butterfly’s dwindling population indicates that western monarchs have an extinction risk of 86% within the next 50 years. Within only 20 years, the risk is still 72%.

This year’s drop in Monarch populations is attributed in part to unseasonal weather last year including late spring freezes that killed milkweed and caterpillars, and an unseasonably warm fall that kept late-season monarchs from migrating. A 2017 study by the World Wildlife Fund and other conservation groups determined that the population has decreased by 80% since the 1990s, further warning that within 20 years eastern monarch’s iconic migration route from Canada to Mexico could completely, and likely irreversibly, collapse.

A range of factors have been linked to monarch declines. Natural events such as extreme weather, wildfires and smoke have been discussed, but a greater emphasis has been placed on manmade impacts. Climate change can alter the migration patterns. Legal and illegal logging and development in Mexico and coastal California has eliminated significant habitat for monarch overwintering. And milkweed, the sole source for female monarchs to lay eggs and perpetuate the species, once abundant throughout the entirety of the United States, is now nearly eradicated around farmland through which the species makes its annual migration. An estimated 165 million acres of breeding habitat in the United States has been lost to herbicide spraying (particularly on GE cropland) and development.

In 2014, conservationists led by the Center for Biological Diversity and the Center for Food Safety petitioned the U.S. Fish and Wildlife Service to protect the butterfly under the Endangered Species Act. Monarchs are threatened by a host of sources destroying their habitat and food, but studies have shown that a main source of their catastrophic demise decline has been genetically engineered crops, engineered with resistance to Monsanto’s Roundup pesticide, which has dramatically increased the pesticide use on their habitat. The Fish and Wildlife Service’s initial decision was that endangered species protection may be warranted, and pursuant to a court victory the Service agreed to make a final decision by June 2019.

Later last year, over 100 conservation and environmental groups urged the federal government to increase funding to protect and conserve monarch butterflies. The groups  sent a letter to the U.S. Department of Agriculture (USDA) to do more to help the imperiled butterfly. The letter requests the agency increase the allotment of conservation funds from $4 million- spent last year- to $100 million. The increase in funds is needed for efforts to increase milkweed habitat. Currently, USDA has taken some steps to protect monarchs. These include the implementation of the Monarch Butterfly Habitat Development Project and support of the Monarch Butterfly Conservation Fund. But, according to the letter, “Restoring the monarch butterfly and its habitat will require a substantial contribution from the agricultural sector and strong leadership…”

Changing the way we farm can make an immense difference for the protection of monarchs and other pollinators. Help pollinators by only purchasing products that don’t allow GE crops or toxic systemic insecticides. Certified organic agricultural practices successfully produce profitable yields while managing to not poison the air, water, soil, vegetation, and other wildlife around their farm.

All unattributed positions and opinions in this piece are those of Beyond Pesticides.

Source: Center for Biological Diversity

Post Views: 7,796


ProtonMail is being blocked in Turkey

$
0
0

We have confirmed that Internet service providers in Turkey have been blocking ProtonMail this week. Here’s what we know so far, and some ways to bypass the block.

Our support team first became aware of connectivity problems for Turkish ProtonMail users starting on Tuesday. After further investigation, we determined that protonmail.com was unreachable for both Vodafone Turkey mobile and fixed line users. Since then, we have also received some sporadic reports from users of other Turkish ISPs. At one point, the issue was prevalent in every single major city in Turkey. After investigating the issue along with members of the ProtonMail community in Turkey, we have confirmed this is a government-ordered block rather than a technical glitch. Internet censorship in Turkey tends to be fluid so the situation is constantly evolving. Sometimes ProtonMail is accessible, and sometimes it is unreachable. For the first time ever though, we have confirmed that ProtonMail was subject to a block, and could face further issues in the future.

What Vodafone Turkey users saw when they tried to access ProtonMail on Wednesday, March 14th, 2018.

With the assistance of ProtonMail users within Turkey, we were able to do a deeper, technical analysis of the issue from within Turkey. First, we discovered that Proton IPs were in fact still reachable, and traceroutes were succeeding. Instead, it appears that ISP DNS servers have simply stopped resolving protonmail.com, or were in other cases returning incorrect results.

Traceroutes from Turkey to our IP addresses were succeeding, but protonmail.com could not be resolved by carrier DNS servers.

This is consistent with how internet censorship is typically performed in Turkey. As part of ProtonMail’s anti-censorship efforts (and as part of the work we do at ProtonVPN, our free VPN service), we actively perform research on the censorship techniques used by different regimes. In Turkey, DNS blocking is the predominant method of blocking. Turkish ISPs have even gone as far as to conduct local DNS poisoning, and to intercept requests going to well-known DNS servers, such as Google’s public DNS server. The type of DNS blocking that has been performed against ProtonMail very much fits the modus operandi of the Turkish government’s online censorship efforts.

We have contacted both Vodafone Group (the UK-based parent company) and Vodafone Turkey, but so far neither has commented on the incident. However, ProtonMail users are everywhere in Turkey— some even work for Vodafone Turkey or the Turkish government — and we are working to escalate this behind the scenes to get approval for ProtonMail to be unblocked. These same sources were also able to disclose that ProtonMail was swept up in a concerted action launched on March 12th, 2018 against a number of services, not just ProtonMail.

If this is indeed a case of government-ordered censorship, it would not be the first time this has happened in Turkey. In recent years, the Turkish government has ordered ISPs to block tens of thousands of websites, from news outlets to atheist sites and even Wikipedia, for content that contradicts government propaganda. Sometimes these blocks are temporary, such as its throttling of Facebook and Twitter, while others are long-lasting.

This has come as part of a broader government clampdown on politicians, journalists, and human rights activists. More journalists are imprisoned in Turkey than any other country, including much larger China. News media have been shut down and reopened under government control. In one noteworthy case, the director of Amnesty International Turkey was arrested last summer along with other activists and is still being held in pre-trial detention.

ProtonMail, of course, is widely known for being an obstacle for governments that wish to violate the privacy rights of their citizens. As the world’s largest encrypted email provider, ProtonMail’s mission is to protect the universal right to privacy that all citizens are entitled to. In this way, we also protect freedom of speech, which is essential for democracy to survive and thrive. One of the most effective ways to suppress freedom is to remove access to services such as ProtonMail.

Today, Vodafone Turkey controls 31.2% of the mobile internet market in Turkey and is a leading fixed-line ISP operating in 81 cities. The company is owned by Vodafone Group, a British multinational that provides telecommunications services in countries around the world. Unfortunately, Vodafone has a history of complying with the demands from authoritarian governments to shut down or block internet access. While for Vodafone this is merely a business decision, the consequences are far reaching. In this case, it is denying millions of people their right to online privacy, and helping to perpetuate the same system that made this possible in the first place.

Bypassing government censorship of ProtonMail

Because of ProtonMail’s unique mission to protect online freedom and ensure freedom of speech in the digital age, we have long anticipated that certain governments who act contrary to these values will be interested in denying access to ProtonMail and ProtonVPN. We view this as a serious threat, and we focus a lot of development effort on technologies to circumvent such blocks. Below is a list of techniques to circumvent online censorship if ProtonMail is blocked. Because the situation is constantly changing, some of these recommendations could stop working at any time.

Use a VPN service like ProtonVPN

VPNs remain one of the best ways to bypass censorship, and ProtonMail provides ProtonVPN for free in order to ensure people around the world can have access to an uncensored internet. When you use a VPN, all your internet traffic, including DNS requests, is routed through an encrypted tunnel to a VPN server, meaning that ISP IP and DNS blocks can be bypassed. You can get ProtonVPN for free here.

However, VPNs are not always effective and can be blocked. If ProtonVPN becomes blocked, we suggest trying the public servers at VPNGate. It is possible however, to block all VPN services (and Turkey is currently attempting to ban all VPN services), in which case, there are a few other circumvention techniques.

Switch DNS servers

ProtonMail is currently being blocked at the DNS level, which means the block can be circumvented by using different DNS servers instead of the ones provided by default by Vodafone. A list of free alternative DNS servers can be foundonline here.

Using any of those should allow the DNS block to be bypassed. Guides for setting a custom DNS for your operating system can be found below:

Windows  ||   MacOS  ||   Android   ||   iOS   ||   Linux

Use Tor

Tor is an invaluable tool for bypassing online censorship and staying anonymous online. The Turkish government has also been trying to ban Tor, but using Tor Bridges has so far still been an effective method of circumventing online censorship. Guides for using Tor Bridge can be found online here and here.

ProtonMail has long been a supporter of the Tor project, and we are one of the only Tor email services in the world, with a fully functioning Tor hidden service at protonirockerxow.onion. More information about how to connect to our Tor hidden service can be found here.

Final Thoughts

ProtonMail will continue to fight censorship on all fronts, and our commitment to this cause is the reason why we operate ProtonVPN, the only completely free VPN service that has no bandwidth limitations and does not sell or exploit user data. Despite the costs, we firmly believe that providing services like ProtonMail and ProtonVPN for free is essential for building a better future.

We, as individuals, are also not powerless against the forces that may seek to limit freedom and democracy. Through our choices (and our wallets), we can hold companies like Vodafone, and even governments, accountable for acting in the best interests of the people they serve. Slowly but surely, the global Proton user community is already doing that, and while challenges like this are bound to arise, the fact that we are being targeted also means that we are on the right track. To our users in Turkey, thank you for your continued support and understanding as we work on getting the block lifted.

Best Regards,
The ProtonMail Team

In a first, U.S. blames Russia for cyber attacks on energy grid

$
0
0

WASHINGTON (Reuters) - The Trump administration on Thursday blamed the Russian government for a campaign of cyber attacks stretching back at least two years that targeted the U.S. power grid, marking the first time the United States has publicly accused Moscow of hacking into American energy infrastructure.

Power lines are seen at the Tahoe-Reno Industrial Center in McCarran, Nevada, September 16, 2014. REUTERS/Max Whittaker

Beginning in March 2016, or possibly earlier, Russian government hackers sought to penetrate multiple U.S. critical infrastructure sectors, including energy, nuclear, commercial facilities, water, aviation and manufacturing, according to a U.S. security alert published Thursday.

The Department of Homeland Security and FBI said in the alert that a “multi-stage intrusion campaign by Russian government cyber actors” had targeted the networks of small commercial facilities “where they staged malware, conducted spear phishing, and gained remote access into energy sector networks.” The alert did not name facilities or companies targeted.

The direct condemnation of Moscow represented an escalation in the Trump administration’s attempts to deter Russia’s aggression in cyberspace, after senior U.S. intelligence officials said in recent weeks the Kremlin believes it can launch hacking operations against the West with impunity.

It coincided with a decision Thursday by the U.S. Treasury Department to impose sanctions on 19 Russian people and five groups, including Moscow’s intelligence services, for meddling in the 2016 U.S. presidential election and other malicious cyber attacks.

Russia in the past has denied it has tried to hack into other countries’ infrastructure, and vowed on Thursday to retaliate for the new sanctions.

‘UNPRECEDENTED AND EXTRAORDINARY’

U.S. security officials have long warned that the United States may be vulnerable to debilitating cyber attacks from hostile adversaries. It was not clear what impact the attacks had on the firms that were targeted.

But Thursday’s alert provided a link to an analysis by the U.S. cyber security firm Symantec last fall that said a group it had dubbed Dragonfly had targeted energy companies in the United States and Europe and in some cases broke into the core systems that control the companies’ operations.

Malicious email campaigns dating back to late 2015 were used to gain entry into organizations in the United States, Turkey and Switzerland, and likely other countries, Symantec said at the time, though it did not name Russia as the culprit.

The decision by the United States to publicly attribute hacking attempts of American critical infrastructure was “unprecedented and extraordinary,” said Amit Yoran, a former U.S. official who founded DHS’s Computer Emergency Response Team.

“I have never seen anything like this,” said Yoran, now chief executive of the cyber firm Tenable, said.

A White House National Security Council spokesman did not respond when asked what specifically prompted the public blaming of Russia. U.S. officials have historically been reluctant to call out such activity in part because the United States also spies on infrastructure in other parts of the world.

News of the hacking campaign targeting U.S. power companies first surfaced in June in a confidential alert to industry that described attacks on industrial firms, including nuclear plants, but did not attribute blame.

An electrical line technician works on restoring power in Vilonia, Arkansas April 29, 2014. REUTERS/Carlo Allegri

“People sort of suspected Russia was behind it, but today’s statement from the U.S. government carries a lot of weight,” said Ben Read, manager for cyber espionage analysis with cyber security company FireEye Inc.

ENGINEERS TARGETED

The campaign targeted engineers and technical staff with access to industrial controls, suggesting the hackers were interested in disrupting operations, though FireEye has seen no evidence that they actually took that step, Read said.

A former senior DHS official familiar with the government response to the campaign said that Russia’s targeting of infrastructure networks dropped off after the publication in the fall of Symantec’s research and an October government alert, which detailed technical forensics about the hacking attempts but did not name Russia.

The official declined to say whether the campaign was still ongoing or provide specifics on which targets were breached, or how close hackers may have gotten to operational control systems.

“We did not see them cross into the control networks,” DHS cyber security official Rick Driggers told reporters at a dinner on Thursday evening.

Driggers said he was unaware of any cases of control networks being compromised in the United States and that the breaches were limited to business networks. But, he added, “We know that there is intent there.”

It was not clear what Russia’s motive was. Many cyber security experts and former U.S. officials say such behavior is generally espionage-oriented with the potential, if needed, for sabotage.

Russia has shown a willingness to leverage access into energy networks for damaging effect in the past. Kremlin-linked hackers were widely blamed for two attacks on the Ukrainian energy grid in 2015 and 2016, that caused temporary blackouts for hundreds of thousands of customers and were considered first-of-their-kind assaults.

Senator Maria Cantwell, the top Democrat on the Senate Energy and Natural Resources Committee, asked the Trump administration earlier this month to provide a threat assessment gauging Russian capabilities to breach the U.S. electric grid.

It was the third time Cantwell and other senators had asked for such a review. The administration has not yet responded, a spokesman for Cantwell’s office said on Thursday.

Last July, there were news reports that the Wolf Creek Nuclear Operating Corp, which operates a nuclear plant in Kansas, had been targeted by hackers from an unknown origin.

Spokeswoman Jenny Hageman declined to say at the time if the plant had been hacked but said that there had been no operational impact to the plant because operational computer systems were separate from the corporate network. Hageman on Thursday said the company does not comment on security matters.

John Keeley, a spokesman for the industry group the Nuclear Energy Institute, said: “There has been no successful cyber attack against any U.S. nuclear facility, including Wolf Creek.”

Reporting by Dustin Volz and Timothy Gardner, additional reporting by Jim Finkle; Editing by Tom Brown, Alistair Bell and Cynthia Osterman

How to build a brain - An introduction to neurophysiology for engineers

$
0
0

How does the brain work? While neuroscience provides insights on small-scale processes and overall behavior, we don’t know much for sure about the learning and processing algorithms in between. In this blog post, I will give an introduction into what we know. Let’s take an engineering perspective and play evolution: How would we build the brain under evolutionary constraints such as energy consumption, available materials and similarity to predecessors? It is hard to know for sure whether a particular evolutionary explanation is really the driving force, and although I try to cover important design options, the ones given below are in no way exhaustive, and should instead be treated as a source of inspiration for your own thoughts.

We know that the brain processes information in order to increase chance of survival through intelligent behavior. While computers have a different purpose than their own survival, namely serving us, they also process information. Despite these different goals, let’s ask: How would a computer work if it had evolved biologically? Why would the design of a brain differ from that of a computer?

Before we dive in: This post is based on the book Neurophysiology by Roger Carpenter and Benjamin Reddi. Whenever only a page number is given as a reference, it refers to that book. I highly recommend it if you are interested in neuroscience and look for a conceptual overview.

Computers

Modern computers mainly consist of transistors as elementary processing units and wiring in between. A transistor is a switch that enables or disables conductivity of wire through a voltage, using a semiconductor material. Combining these allows to implement logical (and, or, not, …) and arithmetic operations (addition, multiplication, …), which are used as building blocks for programs, as well as memory cells. Integrated circuits contain large quantities of microscopic silicon-based transistors, connected via tiny aluminium conductors. Over longer ranges, information is transmitted via copper conductors, either in form of conductive tracks on printed circuit boards and isolated cables between components.

In comparison, how do the fundamental parts for transmission and processing in the brain work?

Long-range transmission

I will start with the question how long-range transmission could be designed.

Chemical

Non-electrical, chemical transmission of information is sufficient for small animals with only a few cells, but fails to scale due to low diffusion speeds. Delays can be reduced by circulation such as blood flow, but even then render this approach impractical for time-critical survival activities such as fight or flight. Because all cells along the path of transmission receive the same chemicals, the number of different messages is limited by the number of types of chemicals and receptors, resulting in low specificity. Hormonal transmission is still useful for slow broadcasts, and we observe several hundred types of hormones in humans , for example regulating digestion, blood pressure and immune response.

Electrical

Brains did not evolve isolated metal conductors and transistors. One reason could be that arranging metal and semi-conductor materials and integrating it with existing biological structures might be hard, but there could be stronger arguments as discussed later.

Brains are based on cells and it is evolutionary straight-forward to use those as conductors with the cell membranes as isolation. The problem is that this yields very bad conductors for the following reasons:

  • It is fun to see that extracellular fluid is similar to diluted seawater, which is where cells evolved first:

    Ion concentrations (mmol/kg)Seawater Extracellular Plasma
    Cl⁻546100±5
    Na⁺469140±5
    K⁺10.24.2±0.8
    Ca₂⁺10.30.75±0.25

    The free ions cause high conductivity which makes isolation an important issue. Cell membranes have a specific resistance about a million times lower than rubber.

  • The fluid in the core of nerve fibers a specific resistance about 100 times higher than copper.
  • With a typical diameter of 1µm , nerve fibers are about 1000 times smaller than copper cables. While shrinking the diameter by a factor of 1000 causes the leaking surface area to shrink by a factor of 1000, it also means that the cross section areas is a million times smaller, making the situation worse.

In a leaky conductor, voltage and current decay exponentially with distance from the start, as the leaking current is proportional to the current itself. How good such a conductor is can be specified through the length during which the voltage drops to of the initial voltage. It turns out that if for a given length of wire with conductor resistance and isolation resistance is , the space constant is . From the observations above we can conclude that is roughly times smaller compared to a copper cable, making more than 100000 times smaller. To improve things by a bit, evolution invented myelination, wrapping fatty, isolating cells (called glia cells) around nerve fibers in order to increase . Still, a myelated frog nerve fiber with a large diameter of only has a space constant of about . Comparing that to the hundreds of kilometers for a phone wire, we can conclude that cells are pretty bad conductors. This is a serious problem for long-range transmission, as it makes a signal indistinguishable from noise after a very short distance.

Side note: Myelination also has the effect of reducing capacitance as distance between inside and outside is increased. This results in less charge being diverted into the capacitance resembled by the membrane, resulting in faster transmission velocity, which turns out to be proportional to , often expressed as , where is called time constant.

Designing amplifiers

We can try to extend the range by amplifying signals at regular intervals. Because we need many of these repeaters for longer distances with each one adding some noise, after a some distance it will be impossible for the receiver to know what the original strength of the signal was. How can we still transmit information? We could use a protocol that only cares about whether a message was sent or not. To keep the repeaters from amplifying noise, they need a mechanism to only trigger above a certain threshold. On the other hand, to keep signal from being dropped, we need to make sure that amplification is strong enough to trigger the next repeater. How can we design such repeaters? If we use a single piece of wire, we also need to make sure that signals do not spread backwards. A fundamental property of this approach is that it will take energy to amplify the signal on the way, meaning that any design will need a power source for amplification, comparable to how amplifier circuits have a electric power source.

How do we implement such a thresholded amplifier? One possibility would be to pump charge from the outside of the cell into the fiber whenever a signal above the threshold is detected, thereby increasing the current in the fiber. This would mean that an ion pump would have to work in sharp bursts to react quickly enough, which might be problematic: We would need either a very flexible energy supply or local storage making it hard to rely on established mechanisms such as ATP-ase. How can we fix this? Instead of pumping in ions on activation, we can pump out ions beforehand, and let them passively rush in when we detect a signal by opening up ion channels. That solves our problem very elegantly: Our ion pump can just work slowly around the clock to roughly keep the concentration gradient and energy can be supplied slowly for example through ATP-ase, which is already used for many other cell processes. For the channels, no power supply is needed because ions tend to flow toward lower concentration on their own. Making the channels and pump selective to sodium ions (Na⁺) would be a straight-forward choice here as it is already abundant on the outside, which allows for quick and strong amplification through a high concentration gradient.

It is convenient to define the outside potential as 0 as the body of extracelluar fluid is so large that ion concentrations are practically constant. This is why the voltage through the membrane (= potential difference between inside and outside) is just called membrane potential.

We are still left with a problem to solve: Once the channels are opened by an above-threshold membrane potential, how do channels know when the signal has passed and close again? Because open channels increase the membrane potential further, we will never get back below the threshold. A simple approach would be to completely inactivate a channel when observing a high membrane potential, and de-inactivate it only a while after falling below the threshold, with the delay acting as a buffer to avoid immediate reactivation. We end up with the following hypothetical mechanism:

Sodium-only activation

  1. As soon as the membrane potential is raised above the threshold, Na⁺ starts to flood into the fiber, thereby amplifying the membrane potential. After a short time, they are inactivated.
  2. Our pumps will slowly bring Na⁺ back out of the cell, which in turn slowly decreases the membrane potential below the threshold and back to its original value (called resting potential).
  3. This causes the channels to be de-inactivated, which makes the fiber ready for the next activation.

In reality, channels do not open for certain at some threshold, but instead they just have a higher probability of opening for higher membrane potentials. Therefore, the permeability of a membrane with large numbers of channels smoothly increase when the membrane potential is raised, although each individual channel is either open, closed or deactivated.

Improving data rate

The rate at which we can transfer information is proportional to the maximum frequency of activations (and also the accuracy of the spike timing, which is limited by noise). In the mechanism above, this frequency is mainly limited by the slow speed of the sodium pump recovering the resting potential, which makes it necessary to keep Na⁺ channels inactivate for a relatively long time. How can we recover the resting potential faster?

We would need a strong current outwards that is slightly delayed to the inwards current caused by the sodium channels. We used a concentration gradient to quickly move charge into the cell, and it turns out that we can apply the same trick in reverse with the following method: We do not only keep up a low concentration Na⁺ inside the cell with our pump, but also build up a concentration gradient for a different ion in reversed direction, with high concentration inside and low concentration outside. To build up this gradient efficiently, it is reasonable to choose an ion that has a low concentration on the outside, such as potassium ions (K⁺), which turn out to be used by the brain for this purpose. If we now add voltage-gated K⁺ channels into the membrane that react more slowly compared to the Na⁺-channels we used before, we end up with the real mechanism , carried out by nerve fibers all over your brain in this very moment:

Activation

  1. As soon as the membrane potential is raised above the threshold, Na⁺ starts to flood into the fiber, thereby amplifying the membrane potential. After a short time, they are inactivated.
  2. The K⁺-channels open with a delay, and K⁺ flow out of the cell, decreasing the membrane potential rapidly the threshold. Because of the drop in membrane potential, the K⁺ channels are closed.
  3. The Na⁺-channels are now de-inactivated. Note how we can make the period of inactivation much shorter without the risk of a reactivation loop as we are safely below the threshold very quickly.
  4. Our pumps will bring Na⁺ back out of the cell and K⁺ back inside to make sure the concentrations stay nearly constant. In the brain, both tasks are simultaneously handled by sodium–potassium pumps, which exchange 3 Na⁺ from the inside with 2 K⁺ from the outside. These numbers are somewhat arbitrary, and it would still work well with different ratios.

Because the resulting activation is very short, it is also called spike. In reality, the channels are slightly leaky even if they are closed. This affects the equilibrium concentration, but the mechanism still works in the same way. Nerve fibers are also called axons and they are a part of most nerve cells , which are also called neurons, have. In the brain, amplifiers manifest in regular intervals along the axon in form of Ranvier nodes, gaps in the isolation of the otherwise myelated axon each equipped with many leaky sodium and potassium channels as well as sodium–potassium pumps. There are also unmyelated axons for information that is not time-critical, with channels and pumps distributed along the way.

Ion concentrations change less than 0.1% during a spike. Under normal conditions, they never changes much more than that, which is why they are assumed to be constant for many calculations.

In summary, we have found an explanation for why we would build axons as they are. These are the key ideas:

  • Because cells have bad conductance and isolation, amplification is necessary repeatedly for long-range transmission.
  • The resulting accumulative noise enforces an all-or-nothing encoding.
  • Na⁺ is actively pumped out to allow for quick passive amplification using Na⁺-channels.
  • K⁺ is actively pumped in to allow for quick passive recovery using K⁺-channels after an activation, and thereby increasing the maximum transmission rate.

Going digital?

Computers use a similar mechanism for transmission as our axons in the brain, only caring about whether a signal is currently present and not about its strength. Computers go a step further though by only caring about whether signals appear in a fixed time window, thereby also discretizing encoding in time. This is achieved through a clock signal, providing the rhythm of processing by defining the boundaries of these time windows. It allows to transmit binary messages, each representing one of two states (commonly called 0 and 1). Multiple of those binary messages can represent arbitrary integers, and thereby encode any discrete message. The absence of analog interpretation of signals and the restriction to discrete-only interpretation is the definition of digital processing. If we make safety margins large enough, both in terms of time and voltage, it is possible to achieve practically error-free transmission. This is a huge benefit, allowing to write complex programs without noise adding up over time (and the reason why we make these strong restrictions in the first place).

In the brain, slow conductors make it hard to have a synchronized clock signal. This rules out digital coding, and we have to deal with noise implied by analog encoding. This means that our brain is restricted to analog coding, because the exact timing of each spike influences further processing.

Note that this means that for transmission over short distances, we are not constrained to all-or-nothing encoding and in fact amplitude-based encoding is preferable due to higher data rate and energy efficiency. This explains why short neurons never use spikes in the brain. We now understand how and why brain uses a different approach to encode information compared to computers:

EncodingDiscrete voltageAnalog voltage
Discrete timingdigital, used in computers
+ allows noise-free processing
- needs synchronisation, e. g. clock
not used
- adds noise through voltage
- needs synchronization
Analog timingused in the brain (axons)
+ allows long-range transmission even with bad conductors
- but then needs energy-costly amplifiers - adds noise through timing
used in the brain (short neurons)
- only short-range if conductors bad
+ high energy efficiency
+ high data rate
- adds noise through timing and strength

Processing

Transistors are the building block for digital processing in computers. How do brains information? In any case, we need to be able to integrate signals from different sources. Under the assumption that our elemental building block is in our brain is the cell, we would need a structure that allows multiple inputs and multiple outputs. This is what we observe indeed:

Sodium-only activation

Image created by Amy Sterling and Daniela Gamba licensed under CC BY-SA 4.0

The dendritic tree collects input signals into the soma. When the membrane potential in the soma surpasses a threshold, the axon will transmit a spike, typically also branching to distribute the output signal to other cells at multiple locations.

Dendrites have similarities to axons: Voltage-gated sodium channels open when an input spike arrives, thereby increasing the membrane potential inside the cell. Other than axons, the signal within the dendritic branches is not all-or-nothing, and typically multiple synapses from different need to be active in order to get the membrane potential in the soma above the threshold. A neuron is “adding up” inputs in some sense, although this is not the complete picture: For example, inputs created by synapses distant from the soma typically have smaller effects. Another example is that if two synapses in one branch fire, the effect is typically different than that of two synapses in different branches. This means that neurons could perform calculations that are far more complex than addition, but it is not yet clear how important this effect is in the brain.

The neuron above is just one type of many, and dendritic and axonal structure as well as the number of synapses vary greatly between types. As described above, short neurons do not even use action potentials.

Designing synapses

How should synapses be designed? A direct conductive connection would a straight-forward approach, and it is indeed observed, especially fast. A different approach is dominating in the brain though, arguably because of the modulation: could expect that synapses are direct electrical connections. Indeed this observed, especially when reaction time is critical, such as neurons involved in defense mechanisms. The synapse is then called electric synapse, consisting of multiple connecting channels called gap junctions.

It turns out that this is not the dominant approach, and instead most synapses are chemical:

  1. When a spike arrives at an axon terminal, voltage-gated calcium channels open, and Ca₂⁺ rushes into the cell.
  2. This triggers neurotransmitters to be released, that then passes over to the receiving cell (through the small space in between, called synaptic cleft).
  3. The transmitter bind to receptors, causing sodium channels to open, thereby inducing an increase in membrane potential in the receiving cell.

Why would one use chemical over electric synapses? Arguably the biggest advantage of this mechanism is that it involves chemical receptors on the outside of the receiving neuron that allow for modulation by chemicals broadcasted in the brain. There are many kinds of neurotransmitters and receptors and there are also synapses that inhibit the receiving cell.

Conclusion

There are fundamental questions left unanswered: What information do neurons represent? How do neurons connect to achieve that? How are these representations learned? Neuroscience offers partial answers and algorithmic ideas, but we are far from a complete theory conclusively backed by observations.

Nevertheless, we saw why we would build neurons the way they are and particularly why they work differently compared to computers.

“No Man’s Sky” Rendered on the Amiga 1000

$
0
0

It should be evident to anyone viewing this website that I have a bit of a vintage computer obsession. And regular readers who’ve been paying attention over the past year and a half or so likely know that my other obsession is the space exploration game No Man’s Sky. After watching an episode of The Guru Meditation (YouTube channel) the other day I got a nifty idea for combining the two and sharing the results with anyone who’d care to see.

No Man’s Sky is a game with some of the most beautiful visuals I’ve ever seen. And what’s more, those visuals render out an infinite universe made up of over 18 quintillion planets. Of all of the systems in my vintage computer collection, the Amiga stands out as having been furthest beyond the capabilities of its peers when it came to graphics rendering, among other things. The original Amiga’s 4,096 color palette seemed an infinite range of colors when compared to the 16 colors that was the typical best case scenario of the other machines of the day. And, with a clever graphics mode known as Hold-And-Modify or HAM, the Amiga could render with its full palette onscreen at once.

In the episode of The Guru Meditation in question, the hosts walk through converting modern, true-color images to the HAM8 mode of the late-model Amiga 1200. The results were impressive, shown on both LCD and CRT alike in the video. This inspired me to select a few of the beautiful in-game photos from the thousands I’ve taken along my No Man’s Sky journey and render them on my oldest Amiga, the original Amiga 1000 circa 1985.

The Amiga 1000 features what is known as the Original Chipset or OCS which delivers the 4,096 colors mentioned previously. The Amiga 1200, which came in 1992, introduced the Advanced Graphics Architecture or AGA chipset which expanded on the original HAM mode by introducing the new HAM8 mode capable of displaying any number of colors from the system’s 262,144-color palette, using eight bitplanes to work the magic that previously took six.

Investigating a reasonable way to convert the images, I discovered a fairly amazing Java-based application known, colorfully, as “ham_converter” which uses extremely optimized algorithms to get the most out of the Amiga’s bizarre HAM mode. The results, rendered in a 320×400 pixel interlace (and a 4:3 aspect ratio), are well beyond the quality that I recall seeing my Amiga 2000 generate with early, basic HAM converter programs, rendering MCGA images to the screen in HAM mode back in the early ’90s. In fact, they are so good that their shockingly high quality takes a bit of the “retro” out of this post; the images look a little too good! And, just to let you know this wasn’t just a click-and-drag process, the systems involved in the conversion were: a gaming PC [specs] able to run the Java app, an iMac [specs] not able to run the Java app (apparently) but also running an FTP server, an accelerated Amiga 2000 [specs] with a LAN connection and a floppy drive (and an FTP client), and the Amiga 1000 [specs] with a floppy drive, SCSI hard drives, and no LAN connection. Getting data to and fro was … involved.

After the images were converted, I moved them to the Amiga 1000’s SCSI hard disk and then spent a staggering amount of time searching for a slideshow program that would run on so early a machine, running AmigaDOS 1.3. But, I finally found one (QuickFlix from 1987) and the results can be seen in the embedded video. I felt that “going analog” and conveying the CRT experience, despite a bit of mild refresh-ghosting, got to the core of the experience better than simply throwing up a thumbnail gallery in the middle of this post. (Note that after the first pass through the slideshow showing the entire system at work, it repeats with a closer camera zoom for a better look at the images onscreen.)

I’m quite pleased with the end results (which can be downloaded here in IFF format). In developing No Man’s Sky, Hello Games have stated that they were visually going for the covers of the sci-fi novels of olde. Rendering the visuals of this modern title on the a 30+ year old Amiga platform seems something of an analog of that goal. I hope you enjoyed the show.

Related Links from this blog:

US utilities have finally realized electric cars will save them

$
0
0

Pity the utility company. For decades, electricity demand just went up and up, as surely as the sun rose in the east. Power companies could plan ahead with confidence. No longer. This year, the Tennessee Valley Authority scrapped its 20-year projections through 2035, since it was clear they had drastically underestimated the extent to which renewable energy would depress demand for electricity from the grid.

But there is a bright spot for utilities: electric vehicles (EV), which make up 1% of the US car market. For years, that market barely registered on utilities’ radar. As EVs find growing success, utilities are building charging infrastructure and arranging generous rebates. Pacific Gas and Electric, Southern California Edison, San Diego Gas & Electric, and New Jersey’s PSE&G have partnered with carmakers to offer thousands of dollars in rebates for BMW, Nissan, and other brands.

Now utilities are asking Congress for help as they attempt to keep tapping into EV demand. A collection of 36 of the nation’s largest utilities wrote a letter (PDF) to congressional leadership on March 13, asking for a lift on the cap on EV tax credits. The signatories’ include California’s Pacific Gas & Electric, New York’s Consolidated Edison, the southeast’s Duke Energy Company, and others covering almost every state.

At the moment, Americans who buy electric vehicles receive a $7,500 federal tax credit (along with some state incentives) for each vehicle. That full credit begin to phase out after the first 200,000 EVs sold by each carmaker in the US. Six months after that threshold is crossed, tax incentives begin to decline, and disappear entirely after about a year.

Tesla’s customers will likely see their tax credits sunset this year, followed by GM and Nissan. Tesla CEO Elon Musk has said that puts them at a disadvantage to foreign automakers such as Germany’s Volkswagen and China’s Volvo, which are just starting to sell EVs in the US. That would also dampen sales of EVs just as utilities need customers to plug their cars into the grid. Electrifying US cars and non-commercial trucks would add 774 terrawatt hours of electricity demand, nearly the same as the entire US industrial sector, Bloomberg estimates. Globally, EVs are expected to drive electricity consumption up 300-fold by 2040 (pdf), to about 5% of total consumption.

Politicians, as well as energy analysts, agree that the current arrangement is not ideal (paywall). Options range from lifting the cap entirely to sunsetting the credits for all automakers at the same time, so no company is at a competitive disadvantage. Utilities are lining up behind an effort led by Oregon senator Jeff Merkley to eliminate the cap if Congress passes a spending bill to keep the government open by next week.

Their letter argues that the EV market can help support grid services, integration of renewable energy and enhanced efficiency of the electric grid. “It will also allow the utility industry to enable an electrified transportation future that creates and sustains more American jobs, reduces our reliance on foreign oil, makes our air cleaner, and our communities more sustainable,” the letter states.

Viewing all 25817 articles
Browse latest View live


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