Shared posts

12 Oct 21:33

Bench Mystery

by peter@rukavina.net (Peter Rukavina)

I can’t figure out whether this bus stop bench was mis-installed, got hit by something, is buckling under pressure, or was just artfully designed.

12 Oct 21:32

Why the stock market dropped

by Josh Bernoff

The Dow lost almost 1400 points in the last two days, losing 5% of its value. Other commentators will give possible explanations for what happened. However, this post is the only place you will read the actual cause of the drop. The reason the market went down is that . . . . . . at … Continued

The post Why the stock market dropped appeared first on without bullshit.

12 Oct 21:32

If Supermicro boards were so bug-ridden, why would hackers ever need implants?

mkalus shared this story from Ars Technica.

Supermicro

By now, everyone knows the premise behind two unconfirmed Bloomberg articles that have dominated security headlines over the past week: spies from China got multiple factories to sneak data-stealing hardware into Supermicro motherboards before the servers that used them were shipped to Apple, Amazon, an unnamed major US telecommunications provider, and more than two dozen other unnamed companies.

Motherboards that wound up inside the networks of Apple, Amazon, and more than two dozen unnamed companies reportedly included a chip no bigger than a grain of rice that funneled instructions to the baseboard management controller, a motherboard component that allows administrators to monitor or control large fleets of servers, even when they’re turned off or corrupted. The rogue instructions, Bloomberg reported, caused the BMCs to download malicious code from attacker-controlled computers and have it executed by the server’s operating system.

Motherboards that Bloomberg said were discovered inside a major US telecom had an implant built into their Ethernet connector that established a “covert staging area within sensitive networks.” Citing Yossi Appleboum, a co-CEO of the security company reportedly hired to scan the unnamed telecom’s network for suspicious devices, Bloomberg said the rogue hardware was implanted at the time the server was being assembled at a Supermicro subcontractor factory in Guangzhou. Like the tiny chip reportedly controlling the BMC in Apple and Amazon servers, Bloomberg said the Ethernet manipulation was “designed to give attackers invisible access to data on a computer network.”

Like unicorns jumping over rainbows

The complexity, sophistication, and surgical precision needed to pull off such attacks as reported are breathtaking, particularly at the reported scale. First, there’s the considerable logistics capability required to seed supply chains starting in China in a way that ensures backdoored equipment ships to specific US targets but not so widely to become discovered. Bloomberg acknowledged the skill and sheer luck of success by comparing the feat to “throwing a stick in the Yangtze River upstream from Shanghai and ensuring that it washes ashore in Seattle.” The news service also quotes hardware hacking expert Joe Grand comparing it to “witnessing a unicorn jumping over a rainbow.”

By Bloomberg’s account, the attacks involved people posing as representatives of Supermicro or the Chinese government approaching the managers of at least four subcontractor factories that built Supermicro motherboards. The representatives would offer bribes in exchange for the managers making changes to the boards’ official designs. If bribes didn’t work, the representatives threatened managers with inspections that could shut down the factories. Eventually, Bloomberg said, the factory managers agreed to modify the board designs to add malicious hardware that was nearly invisible to the naked eye.

The articles don’t explain how attackers ensured the altered equipment shipped broadly enough to reach intended targets in a distant country without also going to other unintended companies. Nation-state hackers almost always endeavor to distribute their custom spyware as narrowly as possible to only chosen high-value targets, lest the spy tools spread widely and become discovered the way the Stuxnet worm that targeted Iran’s nuclear program became public when its creators lost control of it.

In search of low-hanging fruit

The other monumental effort required by the reported supply-chain attacks is the vast amount of engineering and reverse engineering. Based on Bloomberg’s descriptions, the attacks involved designing at least two custom implants (one that was no bigger than a grain of rice), modifying the motherboards to work with the custom implants, and ensuring the modified boards would work even when administrators installed new firmware on the boards. While the requirements are within the means of a determined nation, three hardware security experts interviewed for this story said the factory-seeded hardware implants are unnecessarily complex and cumbersome, particularly at the reported scale, which involved almost 30 targets.

“Attackers tend to prefer the lowest-hanging fruit that gets them the best access for the longest period of time,” Steve Lord, a researcher specializing in hardware hacking and co-founder of UK conference 44CON, told me. “Hardware attacks could provide very long lifetimes but are very high up the tree in terms of cost to implement.”

He continued:

Once discovered, such an attack would be burned for every affected board as people would replace them. Additionally, such a backdoor would have to be very carefully designed to work regardless of future (legit) system firmware upgrades, as the implant could cause damage to a system, which in turn would lead to a loss of capability and possible discovery.

The analysis voiced by the researchers interviewed by this post isn’t the only skepticism coming from well-placed sources. On Wednesday, senior NSA advisor Rob Joyce reportedly joined the chorus of government officials who said they had no information to corroborate any of the claims in the Bloomberg articles.

“What I can’t find are any ties to the claims that are in the article,” Joyce said, according to this article from Cyberscoop. “I have pretty great access, [and yet] I don’t have a lead to pull from the government side. We’re just befuddled.” He reportedly added: “I have grave concerns about where this has taken us. I worry that we’re chasing shadows right now.”

Bloomberg representatives didn’t respond to a request for comment for this post. At the time this post went live, both Bloomberg articles remained online.

An easier way

Lord was one of several researchers who unearthed a variety of serious vulnerabilities and weaknesses in Supermicro motherboard firmware (PDF) in 2013 and 2014. This time frame closely aligns with the 2014 to 2015 hardware attacks Bloomberg reported. Chief among the Supermicro weaknesses, the firmware update process didn’t use digital signing to ensure only authorized versions were installed. The failure to offer such a basic safeguard would have made it easy for attackers to install malicious firmware on Supermicro motherboards that would have done the same things Bloomberg says the hardware implants did.

Also in 2013, a team of academic researchers published a scathing critique of Supermicro security (PDF). The paper said the “textbook vulnerabilities” the researchers found in BMC firmware used in Supermicro motherboards “suggest either incompetence or indifference towards customers’ security.” The critical flaws included a buffer overflow in the boards’ Web interface that gave attackers unfettered root access to the server and a binary file that stored administrator passwords in plaintext.

HD Moore—who in 2013 was chief research officer of security firm Rapid7 and chief architect of the Metasploit project used by penetration testers and hackers—was among the researchers who also reported a raft of vulnerabilities. That included a stack buffer overflow, the clear-text password disclosure bug, and a way attackers could bypass authentication requirements to take control of the BMC. Moore is now vice president of research and development at Atredis Partners.

Any one of these flaws, Moore said this week, could have been exploited to install malicious, custom-made firmware on an exposed Supermicro motherboard. Ars covered these vulnerabilities here.

“I spoke with Jordan a few months ago,” Moore said, referring to Jordan Robertson, one of two reporters whose names appear in the Bloomberg articles. “We chatted about a bunch of things, but I pushed back on the idea that it would be practical to backdoor Supermicro BMCs with hardware, as it is still trivial to do so in software. It would be really silly for someone to add a chip when even a non-subtle change to the flashed firmware would be sufficient.”

Over the years, Supermicro issued updates that patched some of the vulnerabilities reported in 2013, but a year later researchers issued an advisory that said that nearly 32,000 servers continued to expose passwords and that the binary files on those machines were trivial to download. More concerning still, this post from security firm Eclypsium shows that, as of last month, cryptographically signed firmware updates for Supermicro motherboards were still not publicly available. That means that, for the past five years, it was trivial for people with physical access to the boards to flash them with custom firmware that has the same capabilities as the hardware implants reported by Bloomberg.

Discretion assured/easier to seed

The software modifications made possible by exploiting these or similar weaknesses arguably would have been harder to detect than the hardware additions reported by Bloomberg. Moore said the only way to identify a Supermicro board with malicious BMC firmware would be to go through the time-consuming process of physically dumping the image, comparing it to a known good version, and examining the setup options for booting the firmware.

Modified Supermicro firmware, he said, can pretend to accept firmware updates but instead extract the version number and falsely show it the next time it boots. The malicious image could also avoid detection by responding with a non-modified image if a dump is requested through the normal Supermicro interface.

According to documents leaked by former NSA subcontractor Edward Snowden, the use of custom firmware was the method employees with the agency’s Tailored Access Operations unit used to backdoor Cisco networking gear before it shipped to targets of interest.

Besides requiring considerably less engineering muscle than hardware implants, backdoored firmware would arguably be easier to seed into the supply chain. The manipulations could happen in the factory, either by compromising the plants’ computers or gaining the cooperation of one or more employees or by intercepting boards during shipping the way the NSA did with the Cisco gear they backdoored.

Either way, attackers wouldn’t need the help of factory managers, and if the firmware was changed during shipping, that would make it easier to ensure the modified hardware reached only intended targets, rather than risking collateral damage on other companies.

Of course, the easier path of backdooring motherboards with firmware in no way disproves the Bloomberg claims of hardware implants. It’s possible the attackers were testing a new proof-of-concept and wanted to show off their capabilities to the world. Or maybe they had other reasons to choose a more costly and difficult backdoor method. But those possibilities seem far fetched.

“I believe the backdoor described [by Bloomberg] is technically possible. I don’t think it’s plausible,” said Joe FitzPatrick, a security expert and founder of Hardware Security Resources who was quoted by Bloomberg. “There are so many far easier ways to do the same job. It makes no sense—from a capability, cost, complexity, reliability, repudiability perspective—to do it as described in the article.”

12 Oct 21:32

Air Canada plane was 'a few feet' from 'worst crash in aviation history,' NTSB report says

mkalus shared this story .

A near-collision of airliners in San Francisco last year was a few feet from becoming the worst crash in aviation history and underscores the need for faster reporting of dangerous incidents before evidence is lost, U.S. safety officials say.

The U.S. National Transportation Safety Board issued a final report Thursday on the incident involving an Air Canada plane, which nearly crashed into planes lined up on the ground at San Francisco International Airport.

The pilots were slow to report the incident to superiors. By the time they did, the plane had made another flight and the cockpit voice recording of the close call was recorded over.

The NTSB says the recording could have helped investigators understand why the Air Canada pilots missed the runway and were about to land on a taxiway where four other planes were idling before they halted their landing.

The Air Canada jet swooped to just 18.2 metres above the ground while passing over other planes packed with passengers waiting to take off shortly before midnight on July 7, 2017.

"Only a few feet of separation prevented this from possibly becoming the worst aviation accident in history," NTSB vice-chairman Bruce Landsberg said in a statement accompanying the report.

Over 1,000 people at risk

Another board member, Earl Weener, said the Air Canada plane came close to hitting another plane and colliding with several others.

A preliminary report Canadian air safety regulators released about a week after the near-disaster said the aircraft, arriving from Toronto, came within 30 metres of crashing into two of four planes lined up to take off. The NTSB's final report says the jet swooped to just 18.2 metres above the ground. (CBC)

"Over 1,000 people were at imminent risk of serious injury or death," he said.

The deadliest aviation accident occurred in 1977, when two Boeing 747 jets collided on a runway in Tenerife on the Canary Islands, leaving 583 people dead.

The Air Canada captain, identified in NTSB documents as Dimitrios Kisses, was supposed to report the San Francisco incident to the airline as soon as possible but didn't because he was "very tired" and it was late. He waited until the next day. By that time, the plane was used for another flight, and the audio loop on the cockpit voice recorder was taped over.

Watch video of the close call released by the NTSB:

(not specified)

NTSB releases dramatic video of Air Canada near-disaster

Share Video

Playback Status: ready
Assigned test group: None
Identifier: mediaId 1224771139520
Asset: Undetermined
Bitrate: Undetermined
Streaming URL:
Events Log:

Video shows Air Canada plane narrowly missing several planes as it attempts to land on taxiway instead of runway 1:16

The NTSB did not allege that Kisses and co-pilot Matthew Dampier deliberately delayed reporting the incident, but it did say investigators could have gained a better understanding of what the crew was doing before the close call.

The NTSB is considering recommending that cockpit recorders capture the last 25 hours of flying time, up from two hours under current rules.

Critical of reliance on self-reporting

Weener also criticized the airline industry's reliance on self-reporting of safety issues, saying the industry and the Federal Aviation Administration should consider stronger measures to intervene after a dangerous situation.

Weener noted that other pilots were alert enough to turn on lights to warn the off-course Air Canada jet. Yet once the danger passed, he said, they took no action to prompt "an intervention and evaluation of the Air Canada crew."

The five-member board determined last month that the incident was caused by the Air Canada pilots being confused because one of two parallel runways was closed that night. The closure was noted in a briefing to the pilots, and nine other planes had made routine landings after the runway was shut down.

1 controller on duty

The safety board also criticized the FAA for having just one controller on duty at the time of the incident, and recommended better lighting to tell pilots when a runway is closed at night.

"It is noteworthy that the NTSB's recommendations were not directed at Air Canada specifically and address many areas for improvement," said Air Canada spokesperson Peter Fitzpatrick.

Air Canada told the NTSB it has taken steps to increase safety since the event, including emphasizing proper procedures for landing approaches and specific training to familiarize pilots with the San Francisco airport.

The NTSB recommended development of technology to better warn pilots and air traffic controllers when a plane appears to be off-course for a runway.

12 Oct 21:32

Facebook revises ‘View As’ hack numbers, says 30 million users were targeted

by Sameer Chhabra
Facebook Android app

Menlo Park social networking giant Facebook has revised the total number of users affected by the ‘View As’ hacks that took place between September 14th, 2018 and September 25th, 2018.

According to Guy Rosen, Facebook’s vice president of product management, the social network now estimates that approximately 30 million users were targeted, rather than the 50 million people users that was initially estimated.

Rosen used an October 12th, 2018 phone call with reporters and an October 12th media release to expand on the details of the hack.

The hack itself was able to take place due to three specific bugs that impacted Facebook’s ‘View As’ feature that lets users see what their accounts look like to other people.

By using the View As feature, hackers were able to steal access tokens — digital keys that keep people logged into Facebook so they don’t have to re-enter their login credentials every time they use Facebook and a Facebook-linked app — to mimic Facebook user accounts.

According to Rosen, hackers used an automated script to steal the access tokens of approximately 400,000 users. They used those tokens to mirror what those 400,000 users would have seen when they used the View As feature.

“That includes posts on their timelines, their lists of friends, Groups they are members of, and the names of recent Messenger conversations,” wrote Rosen, in the October 12th media release.

“Message content was not available to the attackers, with one exception. If a person in this group was a Page admin whose Page had received a message from someone on Facebook, the content of that message was available to the attackers.”

Using the initial batch of 400,000 users, hackers then stole the access tokens of approximately 30 million more people.

Of that 30 million figure, hackers were able to access two sets of personal information for 15 million users: names and contact details, including phone numbers and email addresses.

For the remaining 14 million users affected by the breach, hackers were able to access names and contact details, as well as additional details that were available on user profiles.

“This included username, gender, locale/language, relationship status, religion, hometown, self-reported current city, birthdate, device types used to access Facebook, education, work, the last 10 places they checked into or were tagged in, website, people or Pages they follow, and the 15 most recent searches,” wrote Rosen.

Strangely enough, hackers didn’t access the information of approximately one million additional users.

Rosen added that the attack didn’t include Messenger, Messenger Kids, Instagram, WhatsApp, Oculus, Workplace, Pages, payments, third-party apps, or advertising or developer accounts.

Additionally, Rosen reiterated that third-party apps that use Facebook Login as an authentication measure were not included in the hack.

Additionally, Rosen told reporters that the attackers didn’t post anything on user profiles.

During the media call, Rosen explained that Facebook had been asked by the U.S. Federal Bureau of Investigations (FBI) to not comment on possible motives, as well as to avoid discussing geographic breakdowns of either the attackers’ or the hacked users’ whereabouts.

The Office of the Privacy Commissioner of Canada previously confirmed to MobileSyrup that Facebook had alerted Canadian authorities of the breach.

Facebook will be personally reaching out to users affected by the breach, including any former users who may have deleted their accounts in the wake of the breach.

Any users concerned about their status can use Facebook’s help centre to check if their information was included in the breach.

Source: Facebook

The post Facebook revises ‘View As’ hack numbers, says 30 million users were targeted appeared first on MobileSyrup.

12 Oct 21:32

Pacific Centre: The Curtain Drops

by Gordon Price

A two-year project to replace the exterior of the Cannacord Tower at the corner of Granville and Dunsmuir proceeds.  (More here in the Daily Hive.)

It’s not technically a curtain wall, but the project does entail the replacement of over 145,000 square feet of window panes – and a change of colour.  Which has always been a sensitive point in this city.

The building, originally named the Stock Exchange Tower when it was completed in 1981, was one of four in the Pacific Centre complex, and it was intended to be as black as its predecessors to the south: the Toronto Dominion and IBM Buildings.  (Changing Vancouver tells the story here.)

The so-called Dark Towers were reviled by Vancouverites, who saw them as soulless symbols of the modernism that was ravaging the city at the same time as its treasured heritage was being demolished (the Birks Building, pretty much all the West End).  City council in response required that the subsequent buildings in the complex have some richer, more sensitive colour.  We ended up with beige.

Even the connected Eaton’s building (now Nordstrom’s), though white, was treated contemptuously (‘the giant urinal’), regardless of its architectural parentage.  Cesar Pelli was the design architect, working for Victor Gruen Associates, but the inspiration for the black towers was clearly Ludwig Mies van der Rohe, best known for the most famous International Style building in the world: the 1958 Seagram Building in New York.

Toronto-Dominion Bank wanted an architectural statement for Vancouver in the spirit of its newly completed headquarters in its namesake city.  The bank’s chairman, Allen Lambert, took the recommendation of his sister-in-law Phyllis Lambert and retained Mies for the project.  (Phyllis Lambert has previously convinced her father Sam Bronfman to retain him for the Seagram Building.  All very cosy, no?)

Vancouver would have had a junior version of “the largest Mies in the world,” as Philip Johnson described TD Centre.  Not that Vancouverites would have cared much.  We just didn’t want more black towers – and have never had one since (with the possible exception of the Wall Centre, which was described by Peter Wall, the developer, as ‘translucent.’  When the actual class went up on the hotel tower, it was clear that the glass wasn’t – and hence the two-tone look until 2011, when the upper part was reclad.)

Over the years, Pacific Centre has had modifications, additions, and soon demolitions, as the Four Seasons Hotel is likely to be replaced.  The only sure thing that can be predicted: we’ll complain about the colour.

 

 

12 Oct 21:29

Rijkswachter Nr 7496

by Ton Zijlstra

Today I bought this little wooden robot.

Leeuwarden

It’s a Rijkswachter, or State Guard. It derives its name from the source of the wood it is made from.

The Rijksmuseum in Amsterdam was closed ten years, from 2003 to 2013, for reconstruction. In that period all objects and art that had been on display were kept safe in wooden crates. In these crates the objects were stored, but also travelled around the world for temporary displays. Studio Hamerhaai, a Dutch design duo based in Haarlem, only uses discarded materials for their work. They acquired all the wooden crates when the objects they held were returned to the exhibition rooms of the Rijksmuseum. They created robots from them in various sizes, called Rijkswachters, in reference to the Rijksmuseum and the previous role the wood they are made of had.

All robots are unique and carry a number on their back, and using that number you can find out exactly which object of the Rijksmuseum collection was stored in its wood.

Leeuwarden

My number 7496 is connected to a three legged silver tea pot with tap, from 1756 and attributed to a silver smith called Nicolaas van Diemen. (A slight disappointment of course that it didn’t house one of the old masters like Rembrandt…. 😉 ) The Rijksmuseum has been digitising most of their artefacts, made them searchable in the beautiful Rijksstudio website (where you can also remix stuff), and release them as re-usable open data. So the number directly links to a photo and description of the artefact.

Most material in Rijksstudio you can download and re-use for e.g. t-shirts, your own postcards or posters, game, video etc. This also allows you to pick any artefact or piece of art from the Rijksmuseum from their online collection and order a Rijkswachter wooden robot, where Dutch artist Annemiek van Duin used part of what you selected to decorate your unique robot, bringing this beautiful project full circle.

12 Oct 21:28

Self Portrait In Escher’s Studio

by Ton Zijlstra

We visited the Escher’s Journey exhibit in the Frisian Museum in Leeuwarden today, as part of a very nice day with the three of us. Leeuwarden is Europe’s cultural capital this year, and Escher was born in Leeuwarden. They brought a large collection of works together in a beautifully made exhibition that we really enjoyed. Part of it was a replica of Escher’s studio in Italy where he made the famous self portrait of his reflection in a ball. Visitors could sit at a desk and hold a similar reflective ball with a camera in it, for a portrait that was then pasted into Escher’s drawing and sent to you via e-mail. The bookcase in the back, the chair to the side, all similar to the original.


our portrait and original next to each other, deliberately at low quality

12 Oct 21:28

Bell phasing out Bell MTS wireless branding, directing customers to ‘Bell Mobility’

by Sameer Chhabra
Bell MTS

Montreal-based national carrier Bell is phasing out Bell MTS’s wireless service in Manitoba, instead directing new activations and upgrades to the carrier’s ‘Bell Mobility’ brand.

According to a Bell MTS call centre representative who spoke with MobileSyrup, potential subscribers who call to activate a Bell MTS wireless plan will now be directed to sign up for a Bell Mobility plan.

The same call centre representative explained that anyone looking to activate a new wireless plan at a Bell MTS retail location will also be directed to Bell Mobility’s plan offerings.

Bell MTS confirmed these details.

“Bell MTS is now promoting and selling the Bell Mobility brand in Manitoba in addition to our Bell MTS Internet, TV and Home Phone residential services,” explained a Bell MTS spokesperson, in an email with MobileSyrup.

“We also offer the national Bell Satellite TV service.”

According to the same spokesperson, Bell MTS wireless subscribers who want to upgrade their devices or plans will be upgraded to a Bell Mobility plan.

“Customers will of course continue to be able to bundle Bell Mobility wireless with their Bell MTS residential services,” said Bell MTS.

It’s important to note that there are no changes to Bell MTS home phone, internet and television services — just the carrier’s wireless service.

Additionally, the same Bell MTS spokesperson explained that “Wireless customers will move over to Bell Mobility service over time.”

The phase-out of Bell MTS’s wireless service appears to be the culmination of Bell’s acquisition of Manitoba Telecom Services (MTS), a $3.9 billion deal that was agreed upon in May 2016 and that was completed in March 2017.

As a result of Bell’s acquisition terms, the carrier acquired roughly 470,000 subscribers from MTS.

Approximately 24,700 MTS subscribers were distributed to New Brunswick-based rural broadband provider Xplornet, while an additional 140,000 subscribers were distributed to Vancouver-based national carrier Telus.

Bell also previously announced plans to invest approximately $1 billion over five years to improve wireless networks in Manitoba.

The carrier has stayed true to its word, with Manitoba areas like Stuartburn, Woodridge and Zhoda all receiving expanding LTE-A service.

When Rogers started a double data pricing war in Manitoba in May 2018, Bell even jumped on the bandwagon, providing new and existing subscribers the opportunity to double the data on 10GB, 15GB and 20GB plans.

It’s worth noting that while Bell ensured Bell MTS would remain a competitive brand in Canada’s keystone province, the carrier phased out Bell MTS’s flat rate data plan in July 2018, while simultaneously increasing the cost of most consumer plans by $5.

Bell Aliant subscribers in Atlantic Canada and Northwestel subscribers in Canada’s northern regions are also served by the Bell Mobility network.

The post Bell phasing out Bell MTS wireless branding, directing customers to ‘Bell Mobility’ appeared first on MobileSyrup.

12 Oct 21:28

To the Bone

12 Oct 14:57

Rogers offering $250 discount on Apple Watch, iPad with iPhone purchase

by Brad Bennett

A new promotion from national carrier Rogers makes it a bit easier to buy a few Apple devices in one fell swoop with a ‘Share Everything’ plan.

If subscribers purchase an iPhone 7 or higher and a sixth-generation iPad, Rogers will remove $250 off the price of the iPad.

If you purchase an iPhone 7 or newer with an Apple Watch Series 3 or Series 4, then they’ve receive $250 in bill credit applied within two to three billing cycles.

The carrier will also provide 2GB of data for activating an iPhone, plus an additional of 1GB of tablet or smartwatch data, at no additional cost. All 3GB of data apply to any device connected to subscribers’ Share Everything plan.

It’s worth noting that Rogers still require subscribers to pay $10 per month for a single gigabyte of smartwatch or tablet data, meaning that subscribers will be required to pay an additional $10 per month for whatever wireless plan they choose to activate or upgrade.

That being said, subscribers who choose to purchase an Apple Watch won’t be charged monthly service fees for the first three months.

Rogers will also cancel the bonus data allotments if subscribers change their plans or upgrade their phones after they’ve activated a plan.

According to the Rogers website, this deal is only available in-store. However, a Rogers customer service representative who spoke with MobileSyrup in a phone call offered to provide the over-the-phone.

Overall, this is a good deal if you’re planning on getting a new iPhone and Apple Watch or iPad, but it’s still expensive in the long run.

For example, Rogers currently offers a 32GB iPhone 7 for $0 down on a two-year, 3GB Ultra plan.

Subscribers willing to pay for this Ultra plan will be charged $120 for the wireless plan alone, plus the extra $10 for the additional tablet or smartwatch data.

Even with the deal, the total cost of the Ultra plan — including the bonus data — would be $130 per month for 7GB of data (3GB from the plan, 3GB from this deal, as well as an additional 1GB of tablet or smartwatch data).

Customers would be able to walk out of Rogers by paying $99 for an iPad — they’re currently on sale for $349 — but the monthly charges for the length of this specific two-year Ultra plan are pretty high, so potential subscribers should take that into consideration.

Source: Rogers

The post Rogers offering $250 discount on Apple Watch, iPad with iPhone purchase appeared first on MobileSyrup.

12 Oct 14:56

What is Functional Programming?

by MJ Perez

In this talk, Eric Normand describes his ongoing work to redefine functional programming. The current definition serves academia but leaves a lot to be desired for industry. Drawing on his experience programming functionally, working with hundreds of other programmers, and teaching functional programming to beginners, Eric Normand has synthesized a new definition that attempts to capture what is most important about functional programming.

Video

Slides

What is Functional Programming_ Oct 2, 2018 - download

Download slides

Transcript

Eric Normand:  This is a talk I am preparing because I would love your feedback. I’m writing a book and I’m working on these ideas. The ideas are not done, but I want to prepare and present it to you so that we can talk about it. Come up, or afterwards we can talk about it.

I gave a talk like this about a year ago. The idea was much less fleshed out, but it was still enough to give a one-hour talk about. I feel like I’m getting somewhere with the ideas. Since then, I’ve also signed a book contract and started on the book.

These ideas are a little bit more developed, if you were at that talk. I don’t even know if any of you were. I don’t remember. Were you there Brian?

[off-mic comment]

Eric:  No. It was maybe November of last year. No. OK.

[off-mic comment]

Eric:  It was at LaunchPad. It was called, “A theory of Functional Programming.” I was rehearsing because I was speaking at a conference about it. You were there? Awesome.

What is functional programming? It’s a question that people ask all the time. The typical answer, this is the one you find on Wikipedia, is a reductionist answer. It’s saying functional programming is programming with mathematical functions. Full stop. End of story. Any other definition, any nuances, are excluded.

It’s a very academic definition. You can see why they do that. It helps them, the academicians that is, by reducing it down to this, they’re opening up the field. Let’s see what we can do with functions.

The problem is, as an industrial programmer who does functional programming, that is not what we do. We do side effects all the time. If you talk to any business person and you say, “Well, sending an email is a side effect, so we can’t do that.” They’d be like, “That’s what we have to do. That’s our whole business.”

If you’re telling me I can’t do that…They look it up on Wikipedia and they’re like, “We can’t use functional programming because it’s going to kill our business.”

We need a better definition for the industry. Something that takes the stuff that functional programmers actually do when they’re not doing research, when they are actually building systems that they have to run and have to do practical things in the world, and quantify it and turn it into something.

My big, hairy, audacious goal is to define the field. There’s no good literature about industrial functional programming and I’d love to start that. I’d love to come up with the terms, and the concepts, and the frameworks within which everything else can blossom and bloom because I can’t do it all myself, but I can give it a start.

Let’s go over this outline. First, we need to talk about the problem with software and its complexity. You can read the slide. Then, we’re going to start talking about mastering time, mastering space, and mastering architecture. It’s mysterious right now, but I hope to make it more obvious when we get there.

At the end, we’ll wrap it up with a nice model of what’s going on.

You all can hear me OK? All right.

We write software and it sucks, right? It’s always buggy. It takes longer than we think. It’s always over budget. It’s just hard to do.

One of the reasons is that it’s complex. We’re developing rocket science software. It’s going to be hard. It’s going to be complex. We’re going to get it wrong a little bit. Then, there’s all this other stuff out there.

That’s rocket science on the left. It’s complex. It’s hard. Rocket science is a difficult subject. If you’re going to write software about rocket science, we add more complexity to it. We have it running in a browser so it’s making Ajax requests. We got the DOM. We got CSS. We got all this other stuff that we’ve added to rocket science that makes it more complex.

The stuff in rocket science, if you’re going to write rocket science software, you need that. That’s complexity that you have to have. There’s no way around that. That’s called essential complexity. It’s essential to the domain you’re writing. You’re not a rocket scientist. You’re not going to help clarify things with a better model. You’re not that person.

All the stuff we add as programmers, all the complexity, is called accidental complexity. This all comes from a paper called “Out of the Tar Pit,” which is a paper I recommend. It’s actually really insightful. It makes this distinction between essential complexity and accidental complexity.

The problem that we face is that, typically, the accidental complexity totally dwarfs the essential complexity. We’re writing rocket science software, but we spend all day trying to figure out why the button doesn’t work, why the loading spinner stays on even after it’s done. Why does that happen?

We’re not even thinking about rocket science all the time. We’re thinking about DOM, and vertical centering, and CSS, and we can’t get a grip on it. The idea is that this is expensive. This part at the bottom, the green part, that’s what we’re trying to capture. We capture it, and then we add all this other stuff.

We’d like to go to this other graph. We can’t reduce accidental complexity to zero. Once you’re on the Web, it’s like an operational concern. This runs in the browser. OK, great. You’re going to have Ajax, you’re going to have timeouts, you’re going to have 404s, you’re going to have all those problems. That’s the red stuff that you can’t get rid of, but at least you can minimize that.

Of course, complexity costs money. It means more time developing. It means more programmers, smarter programmers, higher-paid programmers, maybe more tools to help you. We want to avoid that.

Show of hands. Who has already heard of that — essential versus accidental complexity?

Cool, awesome.

This is something that I’m adding to it, the sources of complexity. These are sources of complexity that I think that functional programming does a really good job of solving. They’re these three — possible histories, code paths, and changes. We’ll go through each of them.

This is where the mastering stuff comes in. Mastering time corresponds to possible histories, etc.

Mastering time. Here we have a diagram. Imagine time is going down. The start and end is at the bottom, start is at the top, end is at the bottom. We have two timelines. Both of these timelines, think of them like threads. They share this variable called “oven temp.”

It’s initialized to 100 up at the top. A and B both read, so they get the current value. Then A is going to multiply it by 10 and store it back in. B is going to add 10 and store it back in. What’s going to happen? What’s going to be the answer when they’re both done running?

[off-mic comment]

Eric:  Raised condition. What Brian is saying is that we don’t know. It’s not even that there’s two answers, there’s actually six ways this could run, which can lead to four different answers. Depending on how they run, which one happens first, and then which one happens second. See the different results. You can do these yourself to check them.

We’ve actually got four different answers here. This is what I mean by the different histories. These are different ways that these two timelines can run. Imagine you merge them together, and how they merge together depends on their timing.

How are the threads running at that time? Was there something blocking this thread, or it just didn’t get scheduled, or it took longer than it was supposed to? All of that chaos in your machine is going to lead to different times. You run at different times, you’re going to get different answers different times.

This is complexity. This is hard. This is what makes bugs happen that you can’t reproduce. “I saw it one time and now I can’t get it back.” It’s because, maybe this one where A finishes completely all the way on the left on the top. That one is rare because it needs all of A to start and finish before B even starts.

That might be rare but it could happen. That’s where you get 1010. It’s the only one that gives you 1010.

I was talking about threads. I said timelines but I said think about threads. JavaScript has this too. JavaScript has one thread. A lot of the time you don’t have this problem. When you’re running a JavaScript thread, you’re mutating stuff, you’re reading stuff. All of that happens. It’s blocking, but then you’re doing a non-blocking operation, you give up control.

Your current rate keeps running, but it’s going to happen sometime in the future. When it comes back, you don’t know.

Look at this code. I’m trying to simulate that same two timelines thing. You’ve got oven temperatures is initialized to 100 and they were going to do two Ajax requests. We’re going to just get two numbers. It’s this api.com/number. It just returns a number.

With the call back, we’re going to either multiply it and store it back in, or add it and store back in. We don’t know which one’s going to come back first. Even though the multiplication one is written first in the code, we don’t know how they’re going to interleave. We have the same problem. We have six possible histories, four different answers.

Let’s just exhaustively talk about where all these timelines come from. They give a better definition of timeline. If you have threads, two threads, you have two timelines. That’s simple.

Multiple processes. You might be running processes that talk to each other. This could be your Web server is running on the same machine as your database. They’re talking. Multiple machines. You got a Web server and a Web client. It’s different machines across the world from each other. You got timelines now. The server is going and the client is going.

Then there’s async operations, because now you’re giving up control. You don’t know when your thing is going to get called again. We have this problem. I think this is one of the reasons why functional programming is getting popular now is all these Web programmers are realizing this is hard.

We’re dealing with relativity here. I click a button and I think the value is now X, and you click a button and you think the value is Y. You think you clicked it first. I think I clicked it first. Who’s right? That’s relativity. There is no right. You need someone in the middle to just say, “OK, stop fighting it’s X. Y, you lost. Get over it.”

The way I like to think about it, it’s if we were smarter, this wouldn’t be a problem. If we could keep six histories in our heads and see, like trace through all the timelines and the possible histories and figure out there’s 4 different answers, that’s OK, but we can’t. We don’t do that. We code and we don’t even see it. We can’t do it. We cannot possibly think of this.

We got different results. We can’t even reproduce them sometimes. They’re so rare, but once you put it in production and things start getting overloaded, you have millions of hits, they start to show up somehow.

Just to explain how bad this problem is, on the left here, that’s the formula for calculating how many possible histories there are. T is the number of threads and A is the number of actions in each thread. This is a factorial. It grows combinatorially. This is if they have this.

It’s just to simplify it if all the timelines have the same number of actions. It gets harder to calculate when you have different numbers.

Look at the graph. I just graphed it from 0 to 20. This is 20 actions in a timeline. This is just for two timelines. At 12 operations, it’s already at a million possible histories. 12 operations, that’s nothing. I mean, we write thousands of operations in a single thread. We have stuff going in loops. 12, like it’s nothing. We already had a million.

There’s no way you can understand what’s happening, not without some help. That’s where I’m trying to bring this idea that functional programming has tools for managing this stuff.

What’s something we can do? Most functional programmers will recommend you just stop using actions, or at least, minimize them. You don’t need to do that as a mutable value. Don’t read that, it’s mutable. Have it passed in and it’ll be immutable. If we can eliminate an action, we just cross out that one, we go from three down to two. Notice, we go from 20 histories to 6, real easy.

Let’s go back. If you get from 12 to 11, you’re already at like 750,000. [laughs] You’ve reduced it quite a lot, but you see these jumps are big. If you can get down here, you’re already in good shape. Where it looks flat, it’s not flat if you zoom in, but it looks flat compared to the million.

Another thing we can do. If you can guarantee, just by looking at it and analyzing the code, that two timelines don’t share anything — they don’t talk to each other, they don’t have any mutable state in common, they don’t rely on something that the other one has done, anything like that, then you don’t even have to analyze them together — all the histories are going to be the same.

You can just say it was just one history because they all look the same. It doesn’t matter how they interleave because they don’t share anything. That’s another thing you can do. If you have a pure function that runs in a thread, that’s actually guaranteed not to share anything. That’s kind of another thing that functional programmers want you to do.

Here’s a thing that is interesting that I think came out of the functional programming world. We have these two timelines, A and B. They have six actions each.

What we can do is draw this line here and just say, “Look, before you go on, either of you, whoever gets there first, just wait for the other one.” You do this with your friends all the time. I’m going to start work on the dishes, you do the laundry. Whoever finishes first, you can just sit down and wait for the other person.

Then you’re synchronized again. It doesn’t matter who finishes first, who finishes last. You can’t control that, but you can wait for the other guy. What this does is it puts a break. It says the stuff before is going to finish before all the stuff underneath is going to finish.

You’re going to have multiple histories at the top. You’re going to have multiple histories at the bottom. Instead of saying it’s six actions that have 924 histories, you’re now saying it’s three actions and three actions. They’re going to multiply. You’re going to have 20 histories at the top and 20 histories at the bottom. That’s going to give you 400 histories. You get that? 20 different ways…

It took me a lot to figure that out. I wanted to add them at first. I wanted to say, “Oh, it’s 40,” but it’s not. It’s 400. Now, who’s done this before? Who cut two timelines like that?

[off-mic comment]

Eric:  What did you use, Minka? Do you remember how you did it?

[off-mic comment]

Eric:  You could do a waiting loop. You check a value. It’s not ready yet. Let me loop, wait a little bit and try again. Actually, in JavaScript now, you have Promise.all. That will do that. If you have the two timelines and promises and you do Promise.all…Are you familiar with Promise.all? Raise your hand if you’ve seen Promise.all

Do you know what promises are? You have two promises. You can do Promise.all and it returns a new promise that waits on all of the promises you’re pass it. It’s basically this. It’s just going to wait. It’s going to wait for everything to be done. JavaScript has this. That’s why people like Promise.all. It totally reduces complexity.

You have 12 requests to make. You don’t know what order they’re going to come back in but you can wait for all of them. It just totally cuts the timeline. Might not be the most efficient because you could have started maybe without that last one. It’s still, for a programmer to be able to say I’m not thinking about it, way easier. It’s a good thing.

A similar situation here. This one’s different. Notice how these actions are all adding? They’re all doing the same operation. There’s something we know about adding which is that the order doesn’t matter. It doesn’t matter what order those things happen in. You’re adding, adding, adding each time. Then you wait.

Maybe this diagram should be different. Anyway, if you wait for all of them to be done, that’s basically one history. It’s always going to give you the same answer. That’s another way to reduce the complexity. It’s another thing that functional programmers talk about is that you can make your actions not depend on their order.

Last one, I think, for mastering time. At the top diagram, we have the shared variable X. We have the same situation where one of them is trying to add, one of them is trying to multiply. What happens is we have those six different histories.

If we put them in a transaction, if we put the read, and then the add and the read and the multiply — this is on the bottom diagram. If we put them in transactions, we’re going to guarantee that one of them is going to happen first. You’re not going to get…There’s some inter-leavings that are now impossible.

You’re limiting the number of histories. There’s still two histories. A could go first or B could go first. They’re going to give you different answers but you’ve eliminated two answers. It’s a possible way to help eliminate these problems.

Here’s a diagram. I’ve divided up the world, the functional programming, into actions, calculations, and data. Actions are things that depend on time, and ordering, and stuff. They lengthen a timeline. If you have a calculation, it does not lengthen the timeline. Calculation is something like running a pure function. Just like, “What is the length of this list?”

It doesn’t matter what else is running at the same time, if it’s an immutable list. I do have to say that. I have this dotted line. Outside of that dotted line, things lengthen the timeline. Inside, they don’t lengthen. You can use as many of these as you want and you’re not adding any histories. That’s a good thing. We want to stay inside that circle.

Then manage the other ones that we have to deal with. We have to make that Ajax request to the server. We cannot eliminate that but we can manage it with transactions and stuff like that.

Mastering space. Here’s the problem with space. This one I’m not that sure about. Hiss or something if I get it wrong. If I’m making a leap, throw out a question. I really want to know.

This is still another source of complexity. We have conditionals in our code. We need conditionals in our code to make it correct. If we’re implementing something, we need them.

Every time you create a conditional, you have at least two branches. Even if it’s just the if/then and you don’t even have an else. You have the case where it runs the then and the case where it doesn’t run the then. Every time you have an exception, it’s running a different piece of code, so that’s a conditional.

It’s different branches, let’s say. When you have branches, let’s say you have a conditional here. Underneath that, you have another conditional, and underneath that, you have another conditional. You’re adding ways for the code to run. It makes it harder to think what is going to run next. What is the next thing that’s going to run?

It’s always, “It depends.” Well, if this is true, we’re going to do this and this is true…It becomes harder to reason about. The more code paths there are, the harder it is to figure out is this going to calculate the right thing for me? Is it going to do the right behavior?

This is the leap. I feel it. I feel it experientially. I know that there’s some truth in here, but then I don’t feel I’m really getting my hands around it and explaining it well.

One way to deal with this source of complexity, to eliminate the accidental part…because we need branches. There’s 12 different kinds of rocket fuel. You need 12 branches to deal with all the different fuels.

One way we deal with this is by modeling things as data. I say we, I mean functional programmers. We model the possible rocket fuel types with data. We’ll have a data structure that has 12 cases in it. That exactly models the domain. If you had 13 cases, that’s not quite right. We have 12 cases. It exactly models the domain.

That’s what this diagram is. The ideal model is rocket science. You talk to an expert, he’ll tell you, “Yes, 12 is right,” and then you go and you code it up. You want an easy correspondence between the expert’s knowledge and what you coded up. By doing it in data, data is much more limited than a full programming language.

A programming language is Turing complete. You can branch and loop all day long. You get a function. You don’t know what it does. You have to read it to understand it. Data, if you have a literal representation, you just read it. You can print it out, give it to your friend. They can just say, “Oh, I see. I see what it is. It’s 12 cases.”

Let’s talk about the ways that we can mismatch our data model. One way is you can have a convoluted mapping. You could have the two kinds of fuselage and you just map it. They have two in your data model and there’s two in the ideal model but you just map it in a weird way.

Later, you’re going to have to add conditionals to figure out what you really want. What you really want to know is the stuff on the left but what you have is something on the right. That’s messed up. I’ve dealt with data models like this before. You’re using someone else’s XML model for the thing and…He’s laughing over there. [laughs]

You’re like, “How…? What is this?” I know it says it’s this thing but it could be either of the two.

Another problem. This problem is you have too many cases in your data model. Let’s just say, the easy case is you have one too many. You have 13 fuel types but you only have 12 in the real world. What do you do?

Maybe the case goes unused. Do you check for it? Do you see, “Oh, you use that case. We put it in but then we regretted it. You shouldn’t use it.” This happens in our code over time. This kind of stuff happens.

The other thing is you could have something that you think, “Oh, maybe I know better than the domain experts. I’m going to map this one. I’m going to split it in two.” You have this problem again where you have the special case with another conditional like, “Don’t do this.”

This is something we do in a lot of languages, JavaScript included. We have a null. Any variable can be null. This often doesn’t map to anything in the domain. You have to check nulls. It’s a thing we do. It’s a conditional. Every time you have a thing that could be, I don’t know…

The other thing is sometimes you map your null. Something becomes null when it shouldn’t have been null. That’s a problem, too.

Then you have the opposite problem. You have one too few cases. This is where you have your 12 rocket fuel types but you just drop one. It didn’t show up in your tests and you just didn’t represent it, and it was fine until it’s not fine.

In the other case, you try to map it to one of the existing ones. Then you have this whole problem of decoding it again. You say, “Well, I’m going to put…”

I use some software that uses both Stripe and PayPal and they have a field where they put…If the person paid with PayPal, they’ll put the PayPal transaction ID. If they pay with Stripe, they put the Stripe customer ID or something. Then they have to use a regular expression to figure out which one it was.

“Is this a Stripe customer? I don’t know. Let me see. Does it start with C-U-S?” That’s what I’m talking about. This happens all the time.

This is two cases, Stripe and PayPal, totally different, and they’re mixing them up and now they have to figure out again which one was which and you can’t validate it. You can’t be like, “Oh, was this really a Stripe customer?” Anyway, it bugs me but it happens all the time.

Of course, all of these create conditionals. You need conditionals in your code to stay correct, so we’re just adding to the complexity. What I’m trying to say is that you can do this analysis in the data. You can draw these little box diagrams and arrows, and figure out exactly how your data is wrong.

It’s much harder to do that in just straight-up code. You’re looking at a conditional and you’re like, “Does this have too many cases? I don’t know.” But if you have a data model, it’s possible. Good data modeling can actually reduce the complexity of your code. I believe that is the main reason why functional programmers like to push more stuff into data.

Object-oriented people like data with methods, like behavior and data mixed together. Functional programmers like the data on the side. Keep it separate. It reduces the complexity because you can analyze it and you can figure out if it’s a good model.

I’m calling that you can control the number of cases. You can’t really do that with a function. It’s much harder. There’s too many ways to do if statements and stuff on arbitrary stuff. If it’s Tuesday, do this.

Last section. Oh, I’ve got time. This one is the least developed section, hence it is third. This is all about complexity due to unforeseen changes. Architecture is a kind of contested term in software. What does it mean? I think that I’m choosing a practical definition. This is the stuff that functional programmers do that fits under that umbrella of…

You make choices at the beginning of your software, like what database to run, what language you’re going to use, maybe what runtime, what platform, those kinds of things. Then you have to deal with those. Those are the hardest things to change. Once you’ve got data in there and real customer data in there, it’s millions of dollars to migrate it.

We want to guard against that. We want to make it as easy as possible to fix mistakes. If we made a bad choice, we want to be able to undo it. That’s what architecture is and functional programming has a few things to say about that. One is called stratified design.

Who’s read “Structure and Interpretation of Computer Programs”? [sighs] Disappointed. [laughs] OK, you should read that book but I’m going to give you…They talk about this in one of the chapters. The idea is you’re building layers of functionality, one semantic layer at a time.

Here, I’m going to switch to a diagram. Let’s say you’re writing software about cooking. At the bottom, you are going to start with the fundamental pieces, the most basic things. This is proteins, acids, and heat. We’re talking this is good software. This is really getting at the heart of cooking.

Then you’re going to add, on top of that, built out of the parts that you just built. You just modeled chemistry. You just modeled macro-nutrients, and thermodynamics, and all sorts of acids, and bases, and stuff like that.

Now you’re going to build your cooking techniques on top of those. How do you apply heat? You use a steel pan because it conducts heat better. A dry heat, or you’re going to put it on a barbecue and you get a different kind of heat.

Then out of that, you’re going to build your basics of that cuisine. In New Orleans, we’ll talk about trinity. OK, you start a sauce with this, or you start a dish with this, or you start with a roux. This is how you brown your meat, those kinds of things. Browning your meat is just applying heat, but it’s a new thing. It’s applying heat to meat so there’s a lot of stuff going on there.

On top of all that, you’re going to add another layer of meaning, which is, “OK, this is how you make a gumbo.” But you have all the blocks, the building blocks, to make the gumbo. What’s nice is you can see that these layers…this is the design part because you have to make these choices of like, “Where do these layers go? What belongs where?”

You can start to see it that you have these dependencies, like the stuff at the top depends down. Nothing is going to depend up. Chemistry’s never going to depend on jambalaya, but jambalaya is going to depend on chemistry.

As you code, you start to see these. What these do is…Chemistry, when you look at it, it’s this nice foundation. It’s architectural. You’re building a foundation of timeless routines, algorithms and things, to calculate chemistry. They’re timeless because chemistry changes way slower than laws of the universe, being what they are. Change way lower than how to make a sauce.

OK, let’s move on. There’s one other thing that I didn’t get a slide for. It’s called the onion architecture. Is anyone familiar with the onion architecture? Oh, wow. OK, because I just learned about this maybe a couple of weeks ago.

Onion architecture, I’ll explain it briefly. The idea is it’s layers, but instead of being like bottom to top, it’s inside out like an onion. The stuff on the inside is your domain model. You could think of the very middle as all your data model and the operations on that data model. Then, on top of that, you’re going to build your business rules.

These are all the things that say, “We only serve red beans and rice on Monday,” and that kind of thing. How to make red beans and rice is down in the core.

Then you’re going to have another layer that’s the application layer. This is receiving and sending messages to other systems, like you’ll have a persistence, a way to persist stuff, a way to store in a database. You’ll have a way to show a UI of what’s going on. But all of that has to go through the data model.

You’re isolating your domain, your business logic and all that stuff in a pure, pure code. This is the functional stuff. It’s all functional code on the inside, calculations and data, but you’re isolating that from technological choices. What GUI is being shown? What database are we talking to? That kind of thing, like what file system we’re using. That’s another kind of functional architecture.

Now we’re going to talk about what functional programming is, just briefly. This is the picture again where you have actions. Everything’s an action. I talked about this before that if you had a timeline that just ran a computation and is isolated from everything else, it doesn’t really add to the histories. It’s isolated.

You can think of a calculation like an action that doesn’t depend on time. We do change registers in our machine. There’s mutation happening. We’ve just created this little cocoon, this little bubble where it doesn’t matter.

Then lambda calculus is Turing complete, and calculations and functions are lambda calculus. You can represent all data with lambda calculus. That’s just a mathematical thing.

I don’t want to explain it right now but you can represent numbers using just functions and all the operations on numbers, so data is actually calculations. It could be. It’s not actually represented that way, just like calculations aren’t represented as real, pure functions like mathematical abstractions.

I’ve come up with these little icons to represent them. I’ll talk about that so maybe it helps to understand, because this is like the fundamental superpower of functional programmers. Like, if you couldn’t do this, if you couldn’t say, “Ah, action. Ah, data. Calculation,” you’re not ready yet. You’re not there yet. That’s why I’m focusing on this so much.

When we act in the world we use our hands, mostly. That’s why I’m putting actions in there. It affects the world. It changes things. A lot of the things that we do that are calculations…because this is the way we see the world, not just our software.

A lot of the things that are calculations are hidden from our view because we’re doing them in our heads. We’re calculating like, “OK, given that I need milk and given that my route is going to pass by the grocery store, do I have enough time to stop by on the way home?” You’re not affecting the world. You’re just calculating it.

It’s not like you’re driving and you’re going to pick up milk and then you say, “Ah, I didn’t have time. Well, I wish I could do that over.” No, you’re not affecting the world. It’s all happening in your head.

A lot of the stuff we do in software is the same way. We don’t see it. It’s like there’s these four lines in here inside of this big routine that actually is a pure function. We can take it right out and it wouldn’t be as big of an action. It wouldn’t be so many actions together causing these explosion of histories.

The last one is data and I put paper. I don’t know if that’s a good paper icon. Did you know that was paper? I don’t know. They’re free icons so what am I going to do? This paper is record keeping. We’ve been keeping records, humans have, for a long time, thousands of years, ten thousand years, maybe a little more.

There’s a lot to be said about that so when you keep records you try to make them last as long as possible. You try to put them on something durable, a clay tablet. You tie knots in things. You seal it up in a vault and you protect it from the elements. Maybe you put in paper and you dig a hole in a mountain and you put it…

This is what the Egyptians were doing. They buried the stuff. We can still read it, which is kind of cool.

The thing is when we moved to computers, we’re just like, “Yeah, change it. Oh yeah, just update that row in the database. Don’t worry. I’ll just delete it.” [laughs] We’re like, “Ah!” The Egyptians are like, “You know how much work it was to keep that paper so you could still read it?” and here you are just writing all over your data.

It’s ridiculous. They did it for good reasons. Same reasons why we had the Y2K problem — to save space, so use two digits instead of four. It saves half the space. Of course, now we don’t have a problem of space. We have too much space. We’re not going to run out, so might as well just keep it and then you can use it for a long time.

Of course, now we have other problems because of that. We have the big data and stuff.

Data is just facts about events, that’s what it says in the dictionary. I just looked it up, facts about events. Things happen in the world. You somehow learn about them in your computer, like a sensor gives you a reading, or a message comes in from the Internet. Something happens and you record it.

You write it down or maybe you don’t record it, maybe it’s transient, but it’s data. This happened. It doesn’t make sense to change it. This happened. Like I got sick. You go to the doctor. They prescribe you some medicine. You go home. They write it down and you get better.

You come back to the doctor’s office and you’re like, “I’m better. Thank you. That really helped.” They just take that paper and they tear it up. There’s OK, good. Great. Awesome. That doesn’t happen.

All these people outside of computers are trying so hard to make the records that don’t…I’m sorry. I get emotional about this. There’s laws that say they cannot do that, and yet in the computer we are just throwing it away.

Back to calculations. The real thing that we’re doing with calculations usually is like making a decision, or planning. That decision is like an event. It’s generating data.

If you’re walking around the supermarket, you could look at different things and say, “Do I want that? Do I want that? Do I want that?” and you’re like “Yes. No. No,” and you just put right stuff in your basket.

Or you could, before you go, which you probably learned to do after the first couple of times like, “Why don’t I look in my fridge and see what I have and what I need. Then I will plan ahead of time, and I’ll write on a piece of paper what I’m going to buy. Then I don’t have to look at every single thing in the supermarket and wonder, “Do I have this?”

This is something we do naturally and we need to start doing it more in our software. It’s something we’ve just forgotten to transfer over. We write a for loop that’s reading straight from the database, looping through each row and deciding, “Do I send this guy an email?” Then, “Yes, OK, send it.”

How many emails are you going to send? “I don’t know until I send them.” Well, is that going to overload your server? “I don’t know. We’ll see,” but why don’t you read them all in, decide which ones need an email and make a list.

You made the data, this is your decision. These are the people who need email. Then you send that to the next step which goes through that and sends the emails. It’s just about pulling that out. Look how much code now is not dependent on time.

It takes something, probably the result of a database query, but you could fake it out for a test if you needed to, makes a calculation, a decision, and then generates more data. So easy to test.

Last thing I want to talk about real quick is how things compose. I feel like it’s important to explain why it is so distasteful to people to do functional programming, because a lot of people are like, “Oh, I could never do that but I need side effects.” It’s similar to ways people thought about, “I need go tos,” but we need to explain why that feeling is there.

Actions are universal. Everything is an action. So to say we’re not going to have actions or we’re going to minimize them, it gives a feeling like, “Oh, but that’s all I got. ” It’s all actions. I need actions, and you do need actions. You need to send that email. You need to wire the money or whatever your software does, launch the rocket, make gumbo.

Another thing that happens is you have to look at how things compose. Why is functional programming so hard? If you have two actions, they’re going to make a new action if you put them together. Like you run one action, then run another action, and you bundle that up in a subroutine. It’s a new action that you’ve made.

Same thing, if you have an action that reads in a file and then the calculation that parses the file, it reads it into a string. Now it’s data. Parses it. You’re doing an action and then a calculation. That’s an action, because it’s reading the file.

Same thing if you have action and data. You have some data hard-coded in your function that says what URL to hit. It’s going to hit the URL. That’s action plus data. It’s making a new action.

Now, let’s look, if you have two calculations, that’s another calculation. That’s easy. Addition and multiplication is going to make another calculation. Calculation plus data, also calculation. Then you have data and data, more data.

A couple of properties of this. It’s way easier to make an action. Once you let the action in, then it just goes everywhere. Everything that’s built out of that, it’s an action. Once you let it in, it’s going to multiply.

Same thing with calculations. If you start using calculations, you can’t get data back. You can never go backwards. You’d have to modify your code. You have to do a big refactoring. But then look at data. If all you’re using is data, you’re safe. You’re just there. I’m just in this land of data. You don’t have to worry about ever accidentally making a calculation. That’s nice, too.

The problem is that because it’s easier to make actions, things just naturally tend to become less functional. It takes work, energy to reverse that entropy.

I’m done. My name is Eric Normand. Thank you so much.

The post What is Functional Programming? appeared first on LispCast.

12 Oct 14:56

SelfieBot: taking and printing photos with a smile

by Alex Bate

Does your camera giggle and smile as it takes your photo? Does your camera spit out your image from a thermal printer? No? Well, Sophy Wong’s SelfieBot does!

Raspberry Pi SelfieBot: Selfie Camera with a Personality

SelfieBot is a project Kim and I originally made for our booth at Seattle Mini Maker Faire 2017. Now, you can build your own! A full tutorial for SelfieBot is up on the Adafruit Learning System at https://learn.adafruit.com/raspberry-pi-selfie-bot/ This was our first Raspberry Pi project, and is an experiment in DIY AI.

Pasties, projects, and plans

Last year, I built a Raspberry Pi photobooth for a friend’s wedding, complete with a thermal printer for instant printouts, and a Twitter feed to keep those unable to attend the event in the loop. I called the project PastyCam, because I built it into the paper mache body of a Cornish pasty, and I planned on creating a tutorial blog post for the build. But I obviously haven’t. And I think it’s time, a year later, to admit defeat.

A photo of the Cornish Pasty photo booth Alex created for a wedding in Cornwall - SelfieBot Raspberry Pi Camera

The wedding was in Cornwall, so the Cornish pasty totally makes sense, alright?

But lucky for us, Sophy Wong has gifted us all with SelfieBot.

Sophy Wong

If you subscribe to HackSpace magazine, you’ll recognise Sophy from issue 4, where she adorned the cover, complete with glowing fingernails. And if you’re like me, you instantly wanted to be her as soon as you saw that image.

SelfieBot Raspberry Pi Camera

Makers should also know Sophy from her impressive contributions to the maker community, including her tutorials for Adafruit, her YouTube channel, and most recently her work with Mythbusters Jr.

sophy wong on Twitter

Filming for #MythbustersJr is wrapped, and I’m heading home to Seattle. What an incredible summer filled with amazing people. I’m so inspired by every single person, crew and cast, on this show, and I’ll miss you all until our paths cross again someday 😊

SelfieBot at MakerFaire

I saw SelfieBot in passing at Maker Faire Bay Area earlier this year. Yet somehow I managed to not introduce myself to Sophy and have a play with her Pi-powered creation. So a few weeks back at World Maker Faire New York, I accosted Sophy as soon as I could, and we bonded by swapping business cards and Pimoroni pins.

Creating SelfieBot

SelfieBot is more than just a printing photo booth. It giggles, it talks, it reacts to movement. It’s the robot version of that friend of yours who’s always taking photos. Always. All the time, Amy. It’s all the time! *ahem*

SelfieBot Raspberry Pi Camera

SelfieBot consists of a Raspberry Pi 2, a Pi Camera Module, a 5″ screen, an accelerometer, a mini thermal printer, and more, including 3D-printed and laser-cut parts.

sophy wong on Twitter

Getting SelfieBot ready for Maker Faire Bay Area next weekend! Super excited to be talking on Sunday with @kpimmel – come see us and meet SelfieBot!

If you want to build your own SelfieBot — and obviously you do — then you can find a complete breakdown of the build process, including info on all parts you’ll need, files for 3D printing, and so, so many wonderfully informative photographs, on the Adafruit Learning System!

The post SelfieBot: taking and printing photos with a smile appeared first on Raspberry Pi.

12 Oct 14:47

Don’t Fight Your Fans

by Richard Millington

I know a car company that once tried to launch an online community. The problem was their audience already had their own communities. So they tried to sue their rival communities off the web.

Suing your own fans, your best fans even, is clearly dumb. A far better approach is to support the ecosystem around you.

Have a place in your community (or on your website) where you list the top fan communities, let people with a big social media following apply to be listed as a verified top influencer in your community, sponsor relevant events, give members who host their own event a small budget to cover basic expenses.

Show up and participate (ethically) in other communities too. Host prizes for members who share links to their best advice and let anyone from any community vote on it. Invite the top members to meet your team and get insider access.

You don’t need to own and host the community to get most of the benefits from the community. You can still deflect support tickets, increase customer satisfaction, spread information, and get great insights.

And even if you can’t, doesn’t it just make sense to support the ecosystem growing up around you instead of fighting it? Once you have a page listing the top communities to join, members to follow, and best resources shared, you become the beginning of someone’s social journey. That’s a useful place to be.

12 Oct 14:47

Countries in Countries in Countries

Hi guys, this is Elana from Datawrapper and I’m making a guest appearance here in Lisa’s absence. We at the Datawrapper office are really excited right now because yesterday we released an awesome new mapping feature: Locator Maps! Well I guess it’s no surprise that this week’s Weekly Chart had to show it off. If you want to read more about their functionality, take a look at the dedicated locator map blog post. Or if you feel like it you can just go ahead and make one yourself.

Thoughts on Borders - a short intro

Whilst it was nature and millions of years of natural history that defined the natural borders, boundaries and shapes of the world we know today, it was human history - characterised by all its distinctly human foibles - pride, violence, competitiveness and territoriality (to name a few) that defined the administrative borders that really frame our world.

Now pretty often people can get very upset about these borders. In fact, isn’t almost all news these days somehow related to these invisible lines?

Well for this Weekly Chart I decided to turn this on it’s head for once. Let’s take a look at a case where borders, rather than being surrounded by difficult topics instead shed a light on a more comical side of our human idiosyncrasies.

And what better way to do this than to make use of our awesome new feature! Locator Maps!

Inspired by this collection of unusual country borders. Let me present to you. The Netherlands inside Belgium inside The Netherlands! Yes. It’s Netherlands inception.

So what’s going on here?

Well, without going too deep into the complicated and winding history of past allegiances to dukes, lords and kings - suffice it to say that the land was bought, sold, and loaned through many generations to the point where the current land owners felt allegiance to either the Dutch or the Belgian side of the border. When the official borders were finally laid down in the 1843 Treaty of Maastricht, 5732 separate parcels of land had to have their nationality laid down separately - resulting in this bizarre, disjointed jigsaw puzzle that we have today.

Now thankfully these borders are friendly, and actually have some pretty funny repercussions. Due to the fact that some of the borders actually pass through buildings things can get pretty complicated when it comes to tax. In an attempt to solve this issue the Dutch government decided that taxes should be paid according to the country that your front door opened out to. However due to tax differences on either side of the border, some innovative business owners were known to simply relocate their front door so that it opened to the other country!

Making the Map(s)

Ok… So I cheated a bit. This isn’t one Weekly Chart, strictly speaking it’s three. Three perspectives on the same story, all made with one tool - our brand new Locator Maps! (did we mention those yet?) Anyway I wanted to take this as a chance to use and show off as many of its awesome features as possible.

So here you have it - the features that made it possible to create this map:

  • Region highlighting! Without which none of this would have been possible. So far we support more than 400,000 administrative regions.
  • Markers! With our marker editor I was able to position and style annotations and symbols with huge flexibility, allowing me to tell the story exactly how I wanted. By the way I only used a few, pretty basic symbols. We actually have a collection of 99 different ones (and counting).

image

  • Map key! I didn’t want the map to get all clogged up with text, so I put all extra information in the key below the map. This nicely divides up the visual and textual elements of the story whilst simultaneously containing them within one unified piece.
  • 3D Buildings. Ok, so strictly speaking I could have shown that the border goes through a buildings using a 2D version of the map. But the extra dimension definitely makes it cooler. And more tangible.
  • Inset Map That little globe on the bottom right that gives a map context. For those not so familiar with the Belgian/Dutch border.

Your Turn

Ok, now that I’ve got your interest, how about you try making your own locator map?

Want to read about all it’s features in more detail? Take a look at the dedicated blog post.

Need help with the tool? We’ve got you covered with a bunch of tutorials in our academy. And if you don’t find the answer you’re looking for there, just shoot us over a mail at support@datawrapper.com.

Ok people. That’s all. Lisa will be back with us next week!


Shoutout to Andy Proehl for compiling this awesome collection of bizarre country borders and his research on their origins. Sources: https://www.flickr.com/photos/amapple/sets/72157616310862857/with/2560802817/, https://en.wikipedia.org/wiki/Baarle-Nassau, http://ontology.buffalo.edu/smith/baarle.htm

12 Oct 14:35

I don't understand the Google Pixel

by Volker Weber

While all Android OEMs put more cameras into their phones to get better pictures, Google improves photography in software. And then does not share it with their OEMs. You will then have vendors like TCL/BlackBerry that ship the same sensors, but take really crappy photos.

This does not feel right. What is Google's motivation?

12 Oct 14:34

At the VCFB This Wekkend!

by Martin

VCFB

While I’m typing this I’m sitting in the train from Cologne to Berlin, on my way to this year’s Vintage Computer Festival Berlin (VCFB). It’s beautiful sunny weather, unlike last year, when an autumn storm turned my train trip into a nightmare.

Like last year, I have brought a little exhibit with me again, this time about GEOS, a graphical user interface for the masses that was very popular in the second half of the 1980s. In addition, I’ve spent the last few weeks collecting my thoughts and pictures about the evolution of wireless networks and mobile data communication in the past decades. I will present the result in a 90 minute talk tomorrow, Saturday, 12 October. The talk will be recorded and perhaps also live streamed in case you are interested. I intend to hold the talk in German but there will surely opportunities in the future to record an English version as well.

Back to my Graphical User Interface exhibit and the thoughts behind it. Back in the 1980s, most computers had a text based user interface. History books tell us that Douglas Engelbart was the first to demonstrate a graphical computing environment during the ‘mother of all demos‘ in 1968, researchers at Xerox Parc picked up from there and drove the development forward by developing the ‘Alto’ in the 1970s, and Apple then developed the Macintosh and released it in the 1980s. And finally, the graphical user interface made it to the PC where it became popular starting with Windows 3.1 and reached a much larger audience in the early 1990s. But there is an important piece of the puzzle missing in this picture which is rarely mentioned:

History books say that Apple brought the Graphical User interface to the masses in the mid 1980s with the Macintosh. While this statement is certainly true, the word ‘masses’ should be set into context. When the Macintosh came out in 1985, it cost US $2495, which is the equivalent of US $5877 in 2018. It might have become somewhat cheaper over time but in the 1980s, only very few people were able to afford a computer for this amount of money. Millions of teenagers like me certainly couldn’t. In the second half of the 1980s when the Macintosh became popular, most teenagers had computers like the Commodore C64 that only cost a fraction of a Macintosh and had a text based user interface. But that all changed when Berkeley Softworks released GEOS, the Graphical Environment Operating System, in 1987 for the C64.

The GEOS Development Team *

A C64 and a floppy disk drive was all that was needed to run GEOS and do meaningful things with it. It had a great office suite with a fantastic graphical word processor, a spreadsheet program and even a full publishing program. And all in 64 kbytes of memory! So to me and millions of others, it was NOT Apple that brought the GUI to the masses, but Berkeley Softworks with their GEOS Operating System. To me, Brian Dougherty and his team, shown in the picture on the left, are the unsung heroes of the GUI revolution! This whole thing has such a long lasting effect on me that I still think of my C64 and GEOS so fondly 30 years later.

A Small Mac Clone

If you take a closer look at the pictures of the GEOS desktop and GeoWrite on the left you will notice that a lot was copied from the Mac. To fit into the little memory, the OS and applications were programmed in assembly language. Berkeley Softworks also developed and released a GUI based assembler that used the GeoWrite text processor as editor and a text based debugger for developers to produce their own GEOS applications. Third party companies complemented this with basic interpreters and other ways to create GEOS applications. Back then, I wrote a few GEOS programs in Basic and made my first steps into the world of assembly programming. But programming GEOS in assembly language on the C64 was hard and my only sources for information were the GeoAssembler Manual, the GEOS Reference Guide, of which I got a copied version because it was not available in Germany, and a book about programming the 6502 processor. So I didn’t get very far back then.

C64 GEOS Programming on the PC

30 years later, however, I revisited the topic as it’s possible to emulate a C64 on the PC and run GEOS there so it’s much easier to program for the platform this way, being no longer restricted by the original hardware, 64 kbytes of RAM and long code, assemble, link, run, debug cycles. On Linux, and perhaps other platforms, the cc65 cross assembler and compiler is available so one can program the C64 in either assembly or C on the PC and then cross-assemble/compile and run the resulting binary in the emulator. For novice C64 programmers that require a lot of trial and error iterations it makes the process very smooth. The cc65 package that can be installed from the Debian repositories supports many 6502 based platforms, including, of course, the C64, and there’s also a rich library to program for GEOS and to create the required binary files with desktop icons and all. To understand the libraries and demo code, some background in GEOS programming is required which is easy to acquire these days with searchable PDFs of the original GEOS Programmer’s Reference Manual and other great material available on the Internet.

So what I will show at this year’s VCFB is GEOS, the great word processing and spreadsheet applications running on a real C64 and a demo program of mine, written in C on a PC and cross compiled for GEOS. Also, I will show how I’ve set-up my programming environment on Ubuntu Linux and how one can interate through the code, compile, run, debug cycle on the PC with a C64 emulator running GEOS inside. For me the perfect combination of my interest in programming, computing history in general and my personal computing history, all in one project!

(*) Picture of the GEOS development team from ’64er Magazin’, 5/1987, page 158, available at archive.org.

12 Oct 14:34

HCL is steaming ahead

by Volker Weber

If you thought that HCL is just a development shop for IBM, think again. Watch this video of HCL Places running with Domino V10. HCL isn't waiting for IBM's ideas.

12 Oct 14:34

Twitter Favorites: [ReneeStephen] @sillygwailo Apparently the most important thing isn't about using the crane, it's about how to properly secure a l… https://t.co/Si4PIOp92m

/etc/ghosts @ReneeStephen
@sillygwailo Apparently the most important thing isn't about using the crane, it's about how to properly secure a l… twitter.com/i/web/status/1…
12 Oct 14:34

Mapping predominant race block by block

by Nathan Yau

Based on data from the Census Bureau, National Geographic mapped predominant race in 11 million administrative regions in the United States. Many of the regions are the size of a single block.

Looking at the national overview, the country looks predominantly white (represented blue), but as you zoom in for more details, you start to see the mix.

Tags: National Geographic, race

12 Oct 14:34

Essential’s Audio Adapter HD earns FCC certification

by Igor Bonifacic

The U.S.’s Federal Communications Commission (FCC) has certified Essential’s long in development Audio Adapter HD, suggesting the company will soon release the accessory.

The FCC filing was first spotted by DroidLife.

During its September monthly Reddit AMA, Essential said it would share a release date and pricing details related to the Audio Adapter HD once the accessory got FCC certification. Now that it has that certification, we’ll likely see more details shared shortly.

The Audio Adapter HD augments the Essential Phone with a 3.5mm headphone jack, ESS-made high-resolution audio Sabre DAC and audiophile-grade amp.

A report published by Bloomberg earlier this week suggests Essential is working on a new smartphone. However, it’s unlikely the device in question is a successor to the Essential Phone. Instead, it appears the handset is a completely new device that attempts to deeply integrate artificial intelligence into the concept of a phone.

Source: FCC Via: DroidLife

The post Essential’s Audio Adapter HD earns FCC certification appeared first on MobileSyrup.

12 Oct 14:33

Samsung foldable smartphone will be available globally: report

by Dean Daley
Samsung logo

DJ Koh, Samsung’s mobile chief, recently told CNET more about the company’s plans for a foldable smartphone.

Koh said to the publication that when a user unfolds the handset, it offers tablet functionality, including multi-tasking. However, when the user folds the device back up, it functions as a standard smartphone.

Most importantly, Koh stated the phone will be available globally, unlike the Galaxy Folder 2, Samsung’s 2017 flip phone.

“When we deliver a foldable phone, it has to be really meaningful to our customer,” Koh said to the publication. Additionally, the mobile chief promises that the hybrid phone-tablet is not a gimmick product and won’t disappear within a year after its released.

Koh believes that similar to large-screened phones, the device might start as a niche product,  but soon more consumers will realize how useful foldable smartphone can be.

“Possibly when we start selling the foldable phone, it may be a niche market, but definitely, it will expand,” said the mobile chief to CNET. “I’m positive that we do need a foldable phone.”

Previous rumours indicate Samsung’s hybrid smartphone-tablet will feature a 7-inch display, up to a 6,000mAh battery and a price take anywhere between $1,500 and $2,000 USD (approximately $1,954 – $2605 CAD).

Source: CNET

The post Samsung foldable smartphone will be available globally: report appeared first on MobileSyrup.

12 Oct 14:33

Disregard the notch

by Volker Weber

x-homescreen

It looks like everybody is discussing the notches on 2018 smartphones. From having used an iPhone X for a year I can tell you this is a non-issue. You quickly ignore it completely. Having a large screen is a benefit, and tucking the status symbols away in those corners gives you more space for real content.

12 Oct 14:33

Radical truth in the Brexit lying game

mkalus shared this story .

We're approaching the endgame now. Work is taking place on the M26 to turn it into a lorry park in the event of no-deal. Theresa May is in the advanced stages of her final capitulation - on permanent customs union and single market membership - with a Cabinet that is likely to split before it accepts it.
If you thought the lies were bad already, they will only get worse from here on out. The EU will lie, May will lie, Labour will lie, and the European Research Group (ERG) Brexiters will lie most of all. They will all lie so that they can control the narrative. Countless foolish dreams are about to smash on the rocks and they will want to have the more convincing story about why it is happening.

If a deal is going to be passed, the EU will be engaged in a conspiracy of language with the prime minister. They will try to formulate what is happening in a way that means it can survive contact with the Conservative parliamentary party. They'll say, for instance, that the backstop proposal is finite until 'technological solutions' replace it. But they never will, because they do not exist. May will say that having the exact same tariff rate as the EU is a customs 'arrangement' or 'partnership' or something, but the reality is that it is membership of the customs union, albeit without the rights we used to enjoy of contributing to trade deal talks.
They will also talk of a 'common rule book', but this does not exist either. It is the EU's rulebook. The UK is merely promising to follow it. It is likely to do this on process as well as outcome. That is a massive handing over of day-to-day decision-making to the EU, where we will no longer have a voice in deciding what regulations to adopt or how they should be implemented.
The EU will probably be honest about the fact that the deal is not really a deal at all, but a base camp for future British concessions. May will certainly lie about this. She will say that goods and services can be separated in the single market. But they will not be. Brussels won't accept it. Paris and Berlin certainly won't. Her decision to sign up to process-and-outcome alignment on goods is just a precursor to signing up to it for services too. The deal will be done on the basis that the remorseless economic logic of trade will eventually drive the UK into full customs union and single market membership. All Brexit will achieve is to eradicate our voice at the continental level.

Meanwhile, Labour will mock both the deal and the state of the Tory party as it tears itself apart. But it would have faced precisely the same predicament in its place. Jeremy Corbyn's cowardly refrain that freedom of movement "will end" when the UK leaves the EU conceals the fact that it is his policy to leave the single market, rather than one imposed on him by the facts of Brexit itself.
Labour in power would have faced the same choice as the government - that staying in the single market would have meant retaining free movement. And that is a freedom they have been singularly unwilling to defend. They weren't as fussed by May's red line on the European Court of Justice, but had their own nonsense limitations on state aid. Ultimately, they'd be in a similar place. So every utterance of condemnation, every accusation of incompetence, is a brazen act of hypocrisy. Not only would they have found themselves in the same pickle, but by being so self-interested in their criticism they failed to push the government to a better course through responsible opposition.

But the greatest lies will all come from the ERG Tories. They have had two years to propose a credible plan for Brexit.  They could not have asked for a more pliable media, or a more generous political culture, in which to issue their mewling tantrums. They were able to attack any compromise position without being asked what they would do in its place. They were able to constantly propose no-deal Brexit - or a 'world trade deal' as they laughably tried to brand it - without being interrogated about the damage it would do the UK. Rarely could any political campaign have been so steeped in attempts to mislead the public.
At no point has anything ever been their fault. Even when the aggressive time constraints of Article 50 dominated the Brexit process, they did not admit that it was lunacy to have triggered it, or that doing so without a plan amounted to a supreme act of patriotic irresponsibility. When their assurances that Britain could have full access to the single market but also an independent regulatory system were shown to be false, they blamed the EU for being inflexible. When they were forced to legally establish their promise about a frictionless border in Ireland, they said the Europeans were trying to turn us into a vassal state. When David Davis was defeated on every single battle he tried to wage with Michel Barnier, they blamed Remainers for failing to get behind the government. They're like a doomsday cult leader. Every apocalypse date which passes, annihilation is simply recalculated to take place a few years in the future. No-one blinks an eye.
There was always someone else to blame for the demonstrable inadequacies of the actions they demanded we pursue. And now things are about to get much worse, so the lies will have to be ramped up.
If there is a deal, it will involve the UK becoming a sidecar to Brussels: entrenched in its regulatory and tariff system without a role in setting it. It is quite possible that, like the backstop limitation sleight of hand, this situation will last forever.
That will create a bitter sense of disappointment and anger. Our immediate quality of life will be safeguarded, but the economic vitality of Britain will gradually seep away as more and more companies start basing themselves where the decisions are made. Britain will have lost its seat at the table and with it the role as bridge between the US and Europe, and as ringleader for liberal economic and social values on the continent.
Or there will be no deal, either in Brussels or back in the Commons. And then the outcomes become truly appalling. The patient has a heart attack rather than just bleeding out.
ERG Brexiters will blame Europe, they will blame Remainers, they will blame immigrants. We are facing a serious reduction in our material circumstances amid a throbbing right-wing populist soundtrack. That is an extraordinarily dangerous mix. In these scenarios, truth-telling becomes a radical act.
Previously tedious statements of fact become morally meaningful: The EU offers either single market membership or a standard free trade agreement and it was up to Britain to choose. The backstop was merely a legal expression of the Brexiters' oft-stated promise to make the Irish border frictionless. Totally borderless trade requires shared regulation.

There is nothing particularly interesting about these types of statements. They are the kind of thing you'd find in a GCSE textbook. But they constitute the political, legal and economic dynamics which explain the current situation and the difficulties we're about to face. If we do not ground the debate in them now, those responsible will find far more dangerous terrain.

Ian Dunt is editor of Politics.co.uk and the author of Brexit: What The Hell Happens Now?

The opinions in politics.co.uk's Comment and Analysis section are those of the author and are no reflection of the views of the website or its owners.

12 Oct 14:30

Flexible Icons with React and SVG

by Scott Taylor
Illustration by Lisk Feng

I am old enough to remember when IE didn’t properly support transparency in PNG files. I am old enough to remember when PNGs were new, a better alternative to GIFs. I am old enough to remember spacer GIFs. These weren’t just things I read about, they were problems I had to work around at my job as a software developer. #dark

The web has matured in a million different ways since the 2000s, and things that used to be hard or a pain are now quite easy. Even though new and shiny tech exists, it does not mean companies are immediately taking advantage of all of it. Getting an entire organization to change their workflow or setup is still hard.

We have been upgrading a lot of our workflows at The New York Times in the past two years, and most of The Times is now served via Node and React. In switching to React, we have been able to unlock entirely new techniques for rendering our UIs. I would like to focus on one of them: rendering icons and logos as SVG.

SVGOMG makes optimizing SVG files easy!

Logos

A logo is often provided by a designer. If it’s an image file, it is typically a PNG with transparency. If you live in a modern world, the logo is provided to you as a scalable vector graphic (SVG). We prefer SVG because it means we can change the size of the image without degrading its quality (and without having to go back to Photoshop or Sketch). It also means we can change the color(s) of the logo without exporting a new file. However, most of the SVGs we as developers receive from designers do not make this so obvious. It is also not always apparent what the “best practice” is here. When do I use SVG? How do I use SVG?

If you’ve never interacted with the contents of an SVG file, MDN has great docs and tutorials, as per usual.

SVG is HTML

Remember one thing: SVG is HTML and HTML attributes can be dynamic in React. We use React to render SVG (since it’s HTML!).

All of this being true, our redesign of The Times over the past few years still suffered from a problem: for each logo, designers tended to make a new file if they needed a new color or if they needed a different size. We ended up with a gang of files like:

icon-t-logo-16x16-333333.svg
icon-t-logo-16x16-white.svg
icon-t-logo-64x64-333333.svg
icon-t-logo-64x64-white.svg

One icon I found had eight variations, which meant it had eight files. When you open one of these files, you see the inner brain of the design program trying to make sense of a line drawing:

https://medium.com/media/86688f5fc98ab4b55000a425c89d6324/href

Just like you wouldn’t accept the HTML output of Dreamweaver as law, you don’t need to accept this SVG content as law. Most of the output you get from design programs contains extraneous and unfortunate-looking XML.

SVGOMG

You can get rid of this junk by running the file or its contents through SVGOMG, an online GUI for manipulating and optimizing SVG.

I usually just paste the markup of a file into the “Paste Markup” tab. After doing so, you get a preview of your icon and a chance to copy the optimized output. After pasting the above file, I got this markup:

https://medium.com/media/0c14ab24b6e7437e9e06f8f8899cd2f8/href

As you can see, our icon can actually just live as one <path> element. The d attribute value is simply a list of instructions: the numbers act as offsets, the letters tell the numbers how to behave.

viewBox describes our icon’s area: 0 0 16 16 means that the numbers in d are related to an area 16 pixels by 16 pixels in dimension. It does not mean that the icon is limited to being 16 pixels by 16 pixels, it means that the instructions have a relationship with this theoretical size.

We also notice that the color of the icon is controlled by the fill attribute. It should be obvious by now, but changing the value of fill will make the icon a different color. That’s great and all, but how are we supposed to change the color if the contents of the SVG are in a static file?

SVG as React

This is where React comes in. Because SVGs are just HTML, and JSX is HTML, we can use SVG like any other nugget of HTML. Here’s our logo as a React component:

https://medium.com/media/d701673aff86fe3504b475056b1128e8/href

We now have a React component that encapsulates our icon, and gives us the ability to change the value of fill with a property. We can use CSS to do whatever else we want to the icon, including setting a different width and height.

https://medium.com/media/3e27c49b7460a6290e145e253da94762/href

As you can see, we never need to create another file whenever we want to change size or color. I’m using CSS-in-JS in these examples — if the syntax is foreign to you, take a glance here:

A Field Guide to CSS-in-JS

You can even change the value of fill using CSS since path is just an HTML element and fill is a CSS rule:

https://medium.com/media/1197ce33353232ac6cf0984e6d12df0b/href

The logo in the masthead of The Times’s website works exactly this way. All of these logos are the same React component:

Left: Logo in the masthead on the Story page. The icons are also SVG; Right: Icons with a different fill color, same components

In fact, many of our icons are rendered inline as HTML. Previously, to optimize them, we rendered the base64 inline representation of them as background images in SCSS. That technique is O.K., but doesn’t compete with the flexibility we get using React. After using a tool like SVGOMG, your SVGs will probably be much smaller anyway.

Sharing Icons and Logos Across Projects

Because our above approach gives us icons that are just React, we can share them in NPM packages or across render targets without needed a static file server. At The Times, we do just that. Icons as SVG as HTML as React can be used on the web, in our CMS editor and in the render tool we use for our native apps. If we required the files using Webpack, every render target would be a required to use Webpack. Any codebase that generates HTML from React can share our icon components.


Flexible Icons with React and SVG was originally published in Times Open on Medium, where people are continuing the conversation by highlighting and responding to this story.

12 Oct 06:27

Family spent weeks living in tent in Vancouver park before finding home it could afford

mkalus shared this story .

Jackie Myerion and Jesse Kirkpatrick say they were forced out of their Surrey, B.C., basement apartment this spring and ended up camping in a Vancouver park with their children before they were able to find new housing.

The couple in their 30s say they felt compelled to speak out to illustrate to others just how easy it is to find yourself homeless right now in B.C.

"It can happen to anybody. We were good tenants. [Jesse] was working. But then we came down to the point of getting a tent and pitching it in Crab Park, because we couldn't find affordable housing," said Myerion.

The long-time Surrey residents had one month's notice when their landlord needed their $1,000-per-month basement apartment for family.

They put their belongings in storage and tried to make staying with family work, but one family member's building didn't allow men or children and they couldn't find a family shelter.

They ended up camping for a few weeks in May and June with their nine-year-old daughter and seven-year-old son.

"It was stressful, devastating and very hard," said Myerion.

A longtime Surrey couple who were evicted so their landlord could have their unit for family ended up living in Crab Park for a few weeks, camping with their two school-aged children on the hill shown here. (Yvette Brend/CBC News)

The couple said they'd distract the children with the playground and make it a fun bedtime.

"They just thought we were camping," said Kirkpatrick, who tried to shield his children from the stress of trying to find a new home.

After tenting, the family lived in a friend's camper for a time and connected with Union Gospel Mission, an agency which eventually helped them find a home in Surrey.

Vacancy rates near zero

Union Gospel Mission spokesperson Jeremy Hunka says this family's experience is just one example of what's happening right now in the Lower Mainland.

Vacancy rates for affordable homes are plummeting and not just in Metro Vancouver, according to a new study co-authored by a University of British Columbia researcher and the UGM.

The No Vacancy study paints an alarming picture of the lack of affordable homes available, even in suburban cities such as Burnaby and Surrey that used to be a refuge for lower-income families.

Vacancy rates hovering near zero and rising rents are hitting vulnerable families and single mothers the hardest, according to the study's authors.

Surrey's rate fell from 5.7 per cent in 2012 to close to zero in 2017, the study found.

The UGM did a similar study in 2016. Things have gotten much worse since then, Hunka said.

Jackie Myerion and Jesse Kirkpatrick visit Crab Park where they were living in a tent for a few weeks this past spring with their children. A half-dozen other tents were visible in the park on Oct. 11. (Yvette Brend/CBC News)

Shelters 100% full

B.C.'s housing registry for families looking for affordable homes has seen the number of families signing up surge by 32 per cent since 2014, he said.

More than half of those families — 61 per cent — were single-parent and 87 per cent of them were female led, Hunka said.

"If a single mom with a 10-year-old is working full time at minimum wage, she only has $4 remaining for things like transportation, dental, clothing. It's really, really difficult, devastating and dire," said Hunka.

At the same time, that rent is spiking and affordable units are disappearing, while Metro Vancouver shelters remain 100 per cent full and have been for more than five years, he added.

"Given the data, it's no surprise that homelessness has continued to rise," said Penny Gurstein of UBC's School of Community and Regional Planning.

As for Myerion and Kirkpatrick, they're glad their tenting experience is over now that the weather has turned colder.

"I definitely do not miss it," said Myerion, who hopes her decision to speak out helps others in her situation find a home.

Read more from CBC British Columbia

12 Oct 06:27

The breach that killed Google+ wasn’t a breach at all

Russell Brandom, The Verge, Oct 28, 2018


Icon

As Russell Brandon reports, "The bigger problem for Google isn’t the crime, but the cover-up. The vulnerability was fixed in March, but Google didn’t come clean until seven months later." As a result, " It’s hard to avoid the uncomfortable, unanswerable question: what else isn’t it telling us?" So the suggestion is that Google doesn't want to expose itself to this kind of risk again, so Google+ must die.

Web: [Direct Link] [This Post]
12 Oct 06:27

New Arrival: The UNO Synth

by Richard

Toronto held a synthesizer expo in August of this year, and it coincided with a pager duty shift. That meant I was able to visit, but I couldn't hang around it long. The purpose of my attendance was to gather information, and to see if Teenage Engineering would have a booth. They did not. I talked to the Roland folks, and mentioned that I was new to synths, and told them I was looking at the Pocket Operator series. The salesman would hip me to the Korg Monotron Duo as another fun way to experience a small, cheap synth, and after watching some YouTube, long story short, a unit is in the mail. (From Japan for some reason.) At the synth expo, would be intimidated by the modular rack you see below:



View this post on Instagram


Synthia!

A post shared by Richard Brynjólfsson (@richardbrynjolfs) on

Right across the aisle, I met my first, true love of synthesizers, the IK Multimedia UNO Synth:

(None of the people in that photograph are me, and it was taken by the IK Multimedia rep.)

I tried a few notes and twibbled a few knobs, and when picking it up, I was stunned how light it was. It felt like it barely existed. It was for sale at the expo and Moog Audio (a synthesizer and guitar effects pedals shop with stores in Toronto and Montréal), and they were selling it for a promotional price of $200 Canadian. Since I had only heard about it then, and hadn't even gotten started with synths (that would happen a month later), I couldn't pull the trigger. The promotional price lasted, as advertised, that weekend, and after I had decided to plunk down the money, the price went up to its manufacturer suggested price of $250.

Another month of visiting Moog Audio and watching YouTube videos would go by, the price remaining the same. A week ago, the idea of finding it on Craigslist or eBay occurred to me, and I did find a few units on the auction site. One unit had a starting price of $100 USD, which made me wonder how that unit was acquired. I decided it was none of my business, and set a mental bid limit of $200 Canadian, and just kept bidding until I reached that price. Thanksgiving Monday was the last day of bidding and, a little bit hungover from drinking a few beers the night before, I had somehow woken up at 7:00 AM, looked at my phone, and noticed I had been outbid, but was still under my self-imposed limit. I would sleepily miscalculate what I needed to bid to stay under $200 (it would work out to about $218), but I figured that would be OK, since Ontario taxes is 13%, and $218 would be under the $226 full price of the promotional price. I expected to be outbid, since that was still cheaper than retail price, but due to some miracle, someone didn't want it more than I did.

Not thinking I would be in town when it eventually was delivered, I had it go directly to the post office with FlexDelivery, a service Canada Post offers to have packages sent directly to the post office with a unique address where they email you when something arrives. I got the notification today, 2 days after the message from eBay indicating it was shipped, and not realizing what it was for, I matched up the tracking info start date with the shipping date. And here it is:



View this post on Instagram


New Arrival

A post shared by Richard Brynjólfsson (@richardbrynjolfs) on

The getting started tutorial doesn't linger on any of the features, so tonight I have watched it with lots of pausing and rewinding. I like that style a lot, actually. There's no wasted time, and I can still go through it at my own pace. I've already downloaded the controller software, and the only disappointment so far is that I can't update the firmware. I had heard from the IK Multimedia rep at the synth expo that turning it off resets the unit, so after I recalled that, taking out the battery took it out of bootloader mode. So far I love everything about it, from how it looks to how it feels to how it's controlled. I can't wait to make interesting noise with it!

12 Oct 06:06

iOS 12’s Adoption Rate

by Federico Viticci

In my iOS 12 review from last month, here’s what I wrote about iOS 11’s slow adoption rate as it related to its performance:

While iOS 11 may go down in Apple software history as the touchstone of the iPad's maturity, it will also be remembered as one of the company's most taxing releases for its users. You don't have to look far into the iOS 11 cycle for headlines lamenting its poor stability on older hardware, plethora of design inconsistencies (which were noted time and time again), and general sense of sluggishness – issues that may have contributed to a slower adoption rate than 2016's iOS 10.
[…]
With iOS 12, Apple wants to rectify iOS' performance woes, proving to their customers that iOS updates should never induce digital regret.

It sounds like at least part of Apple’s plan to focus on performance to entice upgrades to iOS 12 is working. Here’s Benjamin Mayo, writing for 9to5Mac last week:

Apple launched iOS 12 with much fanfare earlier this month but early adoption appeared sluggish. However, in the following weeks, iOS 12 adoption has actually outpaced iOS 11 now, according to data from Mixpanel.

iOS 12 is now installed on more than 50% of active iPhones, iPads and iPod touch devices. It took iOS 11 a month to reach this milestone; iOS 12 has achieved it in under twenty days.

The numbers have since been confirmed by Apple on its Developer site.

Anecdotally speaking, I’ve yet to hear of any friends or family members who updated to iOS 12 and regretted it. It’s almost as if Apple was able to somewhat slow down and ship a higher-quality iOS release that more users can enjoy and recommend to others. Or maybe it’s just the Memoji.

→ Source: developer.apple.com

12 Oct 06:00

Chapter Five: P for Paystack, P for Payments

For as long as I can remember, payments, in general, has been a bit of an issue in Nigeria and Africa at large. While a lot of progress has been made, a lot still needs to happen and we are far from where we should be. There’s hardly a day that goes by without seeing someone asking how they can move money from one African country to the other. Sadly, the existing channel today are either outdated or usually stressful. This is without taking into consideration the ridiculous fees that usually accompany these sort of transactions.

For the longest of time, I have been a sort of a Stripe fanboy. I have read almost any and everything about Stripe that I have come across. I follow their product release and launches religiously. Oh, I am also a big fan of their engineering team. I read the Stripe engineering blog like a bible.

So why am I telling you all this?

In December of 2017, the good people at Paystack had an open house and Loknan was kind enough to extend me an invite. Before that time, I have heard about Paystack and paid some merchants using the company’s checkout form product. So, the company wasn’t new to me. After the event, Shola and I started a conversation about Paystack and what the company had set out to do, to be honest, I was impressed and from that day, I made it my job to follow their roadmap and so far, I must say, I haven’t been disappointed. The company has proved itself more than once. It’s safe to say the won themselves another fanboy.

The thing with me is that, when I like something, I begin to pay a special attention to that thing. This new found interest in Paystack lead me to speak with a couple of the Paystack team members and if there’s one thing that I really admire about them is their level of transparency. I may be wrong, but I think Paystack was the first company that publicly stated their monthly transactions. This was unheard of.

A couple of months ago, Shola and I started yet another conversation, and this time, the more I spoke with him, the more I fell in love with the company. I am quite excited and there’s a reason for that, I am going back to my roots. For anyone that has followed me long enough on Twitter or any of the social media that I am active on, will know how much I love e-commerce and every layer that makes commerce successful. This time, I’m moving further away from retail to payments. Why? At the heart of commerce is payment and for a successful commercial transaction to happen, there must be an exchange of value and in most cases, that value is in the form of money.

Recently, I accepted an offer to become the first Engineering Manager at Paystack. I have spent some time now with the team and I can tell you for a fact that they are good peoples.

Photo credit: Mohini Ufeli

What will I be doing?

I will be leading a bunch of the engineering effort here; hiring, building and scaling the engineering teams. So, reach out to me if you’re interested in solving interesting engineering challenges. We are growing and growing really fast and with this kind of growth comes the usual engineering scaling challenges. Let’s solve this together.

Beyond just working with an amazing group of people, I will do well to share the experiences that we have gathered as we tow this line. This will be majorly technical and business challenges that we are dealing with and how we are addressing them. I will write, like a LOT of writing 🙂

I will also spend time talking to entrepreneurs who are looking to integrate Paystack in their products. I will be speaking more at technology conferences, like a lot more.

I will go into the office more now. Our son’s nanny will now believe I have an actual job. I’ll try to put on a suit every now and then. Hopefully, Shola and Ezra wouldn’t chase me from the office.

You may ask why Paystack and what are we trying to do here? Well, during the last company’s off-site, Shola stressed the fact that our aim is to increase the Internet GDP in Africa, I like to think about it a bit differently, we are building the PaymentOS for Africa. Simple. If you think about the concept of an operating system, it is that base layer upon which every other thing rides on and that is where Paystack is headed; Africa’s PaymentOS.

This is by no means a simple task, If you will let me borrow a leaf from Bezos’ playbook, we are in day 1 of payments and the journey is only starting.

Finally, I am hiring senior engineers - https://paystack.breezy.hr/p/1fff4d8f532c-senior-software-engineer

It’s a new dawn.