I have a laptop back!

2019-04-19 23:49
kaberett: Trans symbol with Swiss Army knife tools at other positions around the central circle. (Default)
[personal profile] kaberett
To my disgust this hard drive came with Windows Vista installed, where the previous one had Windows 7; I'm getting an e-mailed receipt tomorrow and might grumble at them. In the meantime, this evening has mostly consisted of getting a usable Debian install set up (because for bonus points, I ended up overwriting my install media on Tuesday before the drive death because that was the convenient USB stick I had on me).

Doubtless I will complain endlessly about sharks, including sharks I'd previously solved but not bothered making a note of.

Other things this evening included: takeaway dinner from Roti King with A, in the vicinity of Granary Square, followed by ice cream, because the shop I got this laptop from in the first place was on Tottenham Court Road, so by the time we'd got there sitting by the canal eating dinner while the sun went down seemed like an excellent idea.

... but for right now probably I should just do some Duolingo quickly and then head to bed...
mtbc: maze N (blue-white)
[personal profile] mtbc
I am naturally conservative in some ways: if one's society adopts a decent bill of rights and offers a free press and fair elections then I think highly of the rule of law and tend against illegal protests. In modern Western societies legal mechanisms should suffice for effecting necessary policy. However, general elections are a meager means of eliciting preferences from voters. There are also historical examples of oppressive injustices and other bad situations lingering unaddressed while the protests remained legal and convenient.

Through climate change we are causing significant and widespread harm without yet paying the price. In recent years the Conservative administration has fallen far short of a commensurate response. Against my inclination I find myself increasingly sympathetic to the view that illegal protest is warranted and have been impressed by the Extinction Rebellion actions around London.

Not only have I disliked every Conservative Home Secretary of my adulthood but the disruption caused by these protestors gets them ongoing coverage and pales in comparison to the severity of the issue. Extinction Rebellion are organized and informed enough to be both non-violent and effective and I find myself hoping that they succeed in helping to cause environmental policy to be tightened considerably.
[syndicated profile] scalziwhatever_feed

Posted by John Scalzi

I may be in London right now but that doesn’t mean I can’t still show off the new books and ARCs that came to the Scalzi Compound this week! Here they are. What here intrigues you? Tell us all in the comments.

[syndicated profile] smbc_comics_feed

Click here to go see the bonus panel!

I'm pretty sure any sentence of the sort 'the Romans did...' is on some level wrong, or simplified enough to not be right, but look, one must find the road to the dong joke wherever it may be.

Today's News:
[syndicated profile] morning_cup_of_code_feed
Issue #241 - April 19, 2019


Demystifying Containers - Part I: Kernel Space

(Mar 19) #systems-programming

It's time to demystify all the container jargon you've been hearing and not completely understanding. Sascha Grunert has started a multi-part series that goes through all the layers of abstractions that are involved in the container architecture. In this first article we take a look at the very bottom: the kernel.

Thanks for the memory (allocator)

(Mar 14) #cpp

Currently, many C++ implementations use malloc/free to allocate memory (even though this is not specified in the C++ standard). Well, in C++20, a new Allocator model is planned to be included. Currently experimental, this new model will allow programmers to their own memory management strategy. In this article, Glennan Carnie shows us how to go about implementing one as well as explaining all the concepts around it.

Ruby 2.7 - Numbered Parameters

(Mar 18) #ruby

Ruby 2.7 will introduce a new somewhat controversial feature (that even Matz, the creator of Ruby, isn't very comfortable with): Numbered Parameters. As some reader put it, it's the equivalent of arg[0] in a method signature like def my_function(*args). In this article Brandon Weaver goes into the details of what this brings to the table.

Linear Fit Search

(Mar 22) #algorithms

Binary Search is a searching algorithm on an already sorted list that splits the list in the middle and then discards either the left smaller values or right larger based on the search value. This goes on until the value is found. But what if, instead of splitting right in the middle, we were a little more intelligent on where we do the splitting? Alan Wolfe experimented with what is apparently called "interpolation search" and in this article provides an overview as well as a ton of performance measurements.

Programming language of the day: The Lobster Programming Language (2013). "Lobster is a game programming language. Unlike other game making systems that focus on an engine/editor that happens to be able to call out to a scripting language, Lobster is a general purpose stand-alone programming language that comes with a built-in library suitable for making games and other graphical things. It is therefore not very suitable for non-programmers.

It’s also meant to be portable (mostly courtesy of OpenGL/SDL/Freetype), allowing your games to be run on Windows, Mac OS X, iOS, Linux, Android and WebAssembly (in that order of maturity, currently)."

And that''s it for today! Discuss this issue at our subreddit r/morningcupofcoding.

Did you like what you read? Let us know by clicking one of the links below.

Liked - Disliked

I hope you enjoyed reading the latest issue of Morning Cup of Coding. If you did, consider supporting us by becoming a patron (Patreon) for perks like ad-free issues, or via a one-time donation via PayPal.

Support us on Patreon


Copyright © 2019 Human Readable Publications, All rights reserved.

Want to change how you receive these emails?
You can update your preferences or unsubscribe from this list.

[syndicated profile] charlesarthur_feed

Posted by charlesarthur

Like them? A killer disease could make them extinct unless scientists can get ahead of it. CC-licensed photo by Marvee-sama on Flickr.

You can sign up to receive each day’s Start Up post by email. You’ll need to click a confirmation link, so no spam.

A selection of 11 links for you. Unredacted. (Easter eggs optional.) I’m @charlesarthur on Twitter. Observations and links welcome.

Unmasked: an analysis of 10 million passwords • WP Engine



We already knew a few fairly high-profile people were in the Gmail dump. For instance, Mashable noted a month after the list was released that one of its reporters was included (the password listed for him was his Gmail password, but several years old and no longer in use). But we didn’t think Full Contact would turn up so many more.

Within the 78,000 matches we found, there were hundreds of very high-profile people. We’ve selected about 40 of the most notable below. A few very important points:

1. We’ve deliberately not identified anyone by name.
2. The company logos represent those organizations the individuals work for now and not necessarily when they were using the password listed for them.
3. There’s no way of knowing where the passwords were originally used. They may have been personal Gmail passwords, but it’s more likely that they were used on other sites like File Dropper. It’s therefore possible that many of the weak passwords are not representative of the passwords the individuals currently use at work, or anywhere else for that matter.
4. Google confirmed that when the list was published, less than 2% (100,000) of the passwords might have worked with the Gmail addresses they were paired with. And all affected account holders were required to reset their passwords. In other words, the passwords below—while still educational—are no longer in use. Instead, they’ve been replaced by other, hopefully more secure, combinations.

If the passwords hadn’t been reset, however, the situation would be more of a concern. Several studies have shown that a number of us use the same passwords for multiple services. And given that the list below includes a few CEOs, many journalists, and someone very high up at the talent management company of Justin Bieber and Ariana Grande, this dump could have caused a lot of chaos. Thankfully it didn’t, and now can’t.


It’s really shocking how short the “crack time” is for some of these passwords: well under a second.
unique link to this extract

Amazon and Google settle feud, bring YouTube back to Fire TV devices • Ars Technica

Valentina Palladino:


After over a year of absence, the official YouTube app will return to Amazon Fire TV devices and Fire TV Edition smart TVs. Google pulled the video streaming app in early 2018 after it could not strike a deal with the online retail giant surrounding the availability of its products and services.

According to reports at the time, Google was unhappy with Amazon because the retailer didn’t sell a number of its products, including Chromecast and Google Home devices. The two companies couldn’t strike a business deal that pleased both parties, so Google removed the official YouTube app from Fire TV devices at the start of 2018. This came after Google also revoked YouTube access on Amazon’s Echo Show devices, citing a “broken user experience.”

In the time since YouTube left Fire TVs, users have been able to access the site using browsers. But that experience isn’t the most user-friendly, so the real losers in this situation were YouTube lovers that owned Fire TV devices.

Now, those users will soon have an official YouTube app sanctioned by Google on their streaming devices again. The new app will allow users to sign into their personal accounts and play 4K content at up to 60fps on supported devices. Coming later in the year will be dedicated apps for YouTube Kids and YouTube TV, the company’s live, TV-streaming subscription service. Users will also be able to use Alexa to search for content in the YouTube app.


It’s been quite the week for kissing and making up.
unique link to this extract

Presenting search app and browser options to Android users in Europe

Paul Gennai, product management director at Google:


Following the changes we made to comply with the European Commission’s ruling last year, we’ll start presenting new screens to Android users in Europe with an option to download search apps and browsers.  

These new screens will be displayed the first time a user opens Google Play after receiving an upcoming update. Two screens will surface: one for search apps and another for browsers, each containing a total of five apps, including any that are already installed. Apps that are not already installed on the device will be included based on their popularity and shown in a random order.

An illustration of how the screens will look. The apps shown will vary by country.

Users can tap to install as many apps as they want. If an additional search app or browser is installed, the user will be shown an additional screen with instructions on how to set up the new app (e.g., placing app icons and widgets or setting defaults). Where a user downloads a search app from the screen, we’ll also ask them whether they want to change Chrome’s default search engine the next time they open Chrome.


Do we really think this is going to make any difference? I suspect it will be about as (in)effective as the Microsoft Browser Choice screen was.
unique link to this extract

Amazon Music launches free streaming tier, through Alexa only (for now) • Variety

Jem Aswad:


Amazon Music today basically soft-launched its free streaming tier, in which U.S. customers of its Alexa voice assistant will have access to top Amazon Music playlists and thousands of stations, at no cost. The limited access that the new free service provides — it’s only available through Alexa, and when the listener requests a song, it leads to an Amazon playlist or station, rather than an album — is presumably the first phase of a full ad-supported (i.e. free, with ads) streaming tier that will launch at some point in the future…

…Over the past few years, Amazon has quietly become the third-largest streaming service in the world, behind Spotify and Apple Music — a fact that is obscured by its relatively small place in Amazon’s gargantuan business. However, led by VP of Music Steve Boom, over the past couple of years the company has been pushing harder into the music space, with exclusive features on big artists with new releases — such as its one-time-only “SoundBoard” specials with U2, Elton John and Justin Timberlake — and generally making more noise about its offerings.


Basically commercial radio, sans DJ. Everything old is new again.
unique link to this extract

The quest to save the banana from extinction • The Conversation

Stuart Thompson:


Panama disease, an infection that ravages banana plants, has been sweeping across Asia, Australia, the Middle East and Africa. The impact has been devastating. In the Philippines alone, losses have totalled US$400m. And the disease threatens not only the livelihoods of everyone in this US$44 billion industry but also the 400m people in developing countries who depend on bananas for a substantial proportion of their calorie intake.

However, there may be hope. In an attempt to save the banana and the industry that produces it, scientists are in a race to create a new plant resistant to Panama disease. But perhaps this crisis is a warning that we are growing our food in an unsustainable way and we will need to look to more radical changes for a permanent solution.


Long article, and you will end up knowing a lot more about bananas, and how they reproduce (or don’t) than you ever expected to.
unique link to this extract

Why did Intel kill off their modem program? • SemiAccurate

Charlie Demerjian:


[Intel] quite literally never delivered a modem that worked right. The most glaring example of this was the iPhone 7 which had both Intel and Qualcomm variants. On paper it was a 1Gb LTE device but Apple only delivered a 600Mbps iPhone.

That same 600Mbps Qualcomm modem in the iPhone ran at 1Gbps in Android devices. The Intel modem ran at 600Mbps max and there were no other customers to make a comparison to. Apple crippled their Qualcomm parts to match the delivered Intel specs. Worse yet those Intel parts were only 600Mbps on paper; in practice they had 30% lower throughput. On top of this the Intel modems consumed vastly more energy to do their slower work than Qualcomm, a trend that SemiAccurate has personally measured in the labs across multiple generations of Intel modems but is not at liberty to disclose exact figures on, sorry.

This is significant for several reasons. First, phones operate on batteries, and 30% lower throughput at 30% higher energy use means the Intel modem was about half as efficient as the Qualcomm one. Not only do customers with Intel iPhones get a second rate user experience, they get worse battery life as well.

And then there are the carriers whose product is effectively finite air time on a specific frequency. If a phone is 30% slower due to retries and packet failures it means it ties up 30% more of that time and costs carriers much more to support. They are keenly aware of this and hate Intel modems.


Just as well Intel isn’t going to be doing modems much longer.
unique link to this extract

Facebook building voice assistant to rival Amazon Alexa and Apple Siri • CNBC

Salvador Rodriguez:


The tech company has been working on this new initiative since early 2018. The effort is coming out of the company’s augmented reality and virtual reality group, a division that works on hardware, including the company’s virtual reality Oculus headsets.

A team based out of Redmond, Washington, has been spearheading the effort to build the new AI assistant, according to two former Facebook employees who left the company in recent months. The effort is being lead by Ira Snyder, director of AR/VR and Facebook Assistant. That team has been contacting vendors in the smart speaker supply chain, according to two people familiar.

It’s unclear how exactly Facebook envisions people using the assistant, but it could potentially be used on the company’s Portal video chat smart speakers, the Oculus headsets or other future projects.

The Facebook assistant faces stiff competition. Amazon and Google are far ahead in the smart speaker market with 67% and 30% shares in the U.S. in 2018, respectively, according to eMarketer.


Odd that the headline mentions Siri when it’s bringing up the rear with the 3%, then. But Google’s assistant doesn’t have a name, I suppose.

What’s the betting that in a year or two it’ll turn out that Facebook is accidentally recording everything you say and using it to target ads? Like people suspect happens already?
unique link to this extract

Facebook stored millions of passwords in plaintext—change yours now • WIRED

Lily Hay Newman:


By now, it’s difficult to summarize all of Facebook’s privacy, misuse, and security missteps in one neat description. It just got even harder: On Thursday, following a report by Krebs on Security, Facebook acknowledged a bug in its password management systems that caused hundreds of millions of user passwords for Facebook, Facebook Lite, and Instagram to be stored as plaintext in an internal platform. This means that thousands of Facebook employees could have searched for and found them. Krebs reports that the passwords stretched back to those created in 2012.


Brian Krebs’s report was on 21 March. This acknowledgement has come nearly a month later, at the end of the day before Easter Friday, after the release of the Mueller report which of course sucked up huge amounts of media attention.

Did it really take four weeks to acknowledge this?
unique link to this extract

Facebook bans far-right groups including BNP, EDL and Britain First • The Guardian

Alex Hern:


In a statement, the far-right group Knights Templar International said it was “horrified” by the ban, and that it was exploring legal options. “Facebook has deemed our Christian organisation as dangerous and de-platformed us despite never being charged, let alone found guilty of any crime whatsoever,” a spokesman said. “This is a development that would have made the Soviets blush.”

The company’s decision to ban five of Britain’s most prominent far-right organisations shows it has moved a long way from its previous position on the groups.

As early as 2016, concerns were raised about the scale of the far right’s activities on social media. Britain First, then a registered political party, had used a combination of canny tactics and sponsored posts on the social network to push anti-Islam posts to millions of users, drawing one of the largest social media followings of any British political party. When queried on whether this was desirable, Facebook told reporters the site “is used by parties and supporters of many political persuasions to campaign for issues they feel passionately about.

“Like individuals and all other organisations on Facebook, they must adhere to our community and advertising standards, which set out the limits for acceptable behaviour and content.” It would be another two years before Facebook banned Britain First from the site.

When Facebook initially banned the organisation in early 2018 it was for repeated breaches of the site’s posting policies, and did not reach the level of designating it as a dangerous organisation. That ban came a few months after the group had ceased to be a political party.


So basically Facebook is starting to follow the UK government’s classifications of “proscribed groups”. Start out as a private company, get big enough and effectively you’re a regulated utility.
unique link to this extract

Facebook uploaded 1.5 million users’ email contacts without permission • Business Insider

Rob Price:


Facebook harvested the email contacts of 1.5 million users without their knowledge or consent when they opened their accounts.

Business Insider has learned that since May 2016, the social networking company has collected the contact lists of 1.5 million users new to the social network. The Silicon Valley company says they were “unintentionally uploaded to Facebook,” and it is now deleting them. You can read Facebook’s full statement below.

The revelation comes after a security researcher noticed that Facebook was asking some users to enter their email passwords when they signed up for new accounts to verify their identities, in a move widely condemned by security experts. Business Insider then discovered that if you did enter your email password, a message popped up saying it was “importing” your contacts, without asking for permission first.

At the time, it wasn’t clear what was actually happening — but a Facebook spokesperson has now confirmed that 1.5 million people’s contacts were collected this way, and fed into Facebook’s systems, where they were used to build Facebook’s web of social connections and recommend friends to add. It’s not immediately clear if these contacts were also used for ad-targeting purposes. [Later: it did.]

Facebook says that prior to May 2016, it offered an option to verify a user’s account and voluntarily upload their contacts at the same time. However, Facebook says, it changed the feature, and the text informing users that their contacts would be uploaded was deleted — but the underlying functionality was not. Facebook didn’t access the content of users’ emails, the spokesperson added.


Notice how Facebook’s errors always fall in favour of it getting more information, and using it to target ads? Never getting less information and reducing ad loads? Though at this point it looks sociopathic.
unique link to this extract

Samsung Galaxy Fold is the Homer Simpson car • UX Collective

Patrick Thornton:


[Entering data] is becoming more and more common for healthcare, architecture, and some other professions. Having a small, foldable tablet might be more convenient than other existing small tablets. The quarter-assed phone on [the Galaxy Fold] might be good enough just for fielding work calls and other work activities.

If Samsung wanted to first start by targeting specific professional markets with this, they might get great feedback and begin to be able to refine this for consumer use. That does not appear to be their strategy here.

Also, with 79% of smartphone users using a protective case. How is that going to work for a device like this? It seems to me that either a mobile product like this needs to be very durable and impact resistant, or it needs to allow for use a case.

The last part of the Design Critique Rubric is to determine whether or not a user-centered design process was followed when building a product. A user-centered design process focuses product design and development on figuring out users’ problems and designing solutions to those.

At first glance, this does not appear a user-centered design process was followed (it’s hard to imagine the phone part of this being well received by users). I’m willing to put it through the full rubric once this device ships, but until then, I don’t see strong evidence of a user-centered design process.


Foldables already start to look like a technology solution in search of a problem. But that’s Samsung’s approach. It pioneered big screens because it made screens; that turned out to be a good idea. It pioneered foldables because it could make foldable screens. Well.. (Watch this if you’re not familiar with “Homer Simpson’s Car”.)
unique link to this extract

Errata, corrigenda and ai no corrida: none notified

[syndicated profile] cks_techblog_feed

Posted by cks

It is common to describe ed(1) as being line oriented, as opposed to screen oriented editors like vi. This is completely accurate but it is perhaps not a complete enough description for today, because ed is line oriented in a way that is now uncommon. After all, you could say that your shell is line oriented too, and very few people use shells that work and feel the same way ed does.

The surface difference between most people's shells and ed is that most people's shells have some version of cursor based interactive editing. The deeper difference is that this requires the shell to run in character by character TTY input mode, also called raw mode. By contrast, ed runs in what Unix usually calls cooked mode, where it reads whole lines from the kernel and the kernel handles things like backspace. All of ed's commands are designed so that they work in this line focused way (including being terminated by the end of the line), and as a whole ed's interface makes this whole line input approach natural. In fact I think ed makes it so natural that it's hard to think of things as being any other way. Ed was designed for line at a time input, not just to not be screen oriented.

(This was carefully preserved in UofT ed's very clever zap command, which let you modify a line by writing out the modifications on a new line beneath the original.)

This input mode difference is not very important today, but in the days of V7 and serial terminals it made a real difference. In cooked mode, V7 ran very little code when you entered each character; almost everything was deferred until it could be processed in bulk by the kernel, and then handed to ed all in a single line which ed could also process all at once. A version of ed that tried to work in raw mode would have been much more resource intensive, even if it still operated on single lines at a time.

(If you want to imagine such a version of ed, think about how a typical readline-enabled Unix shell can move back and forth through your command history while only displaying a single line. Now augment that sort of interface with a way of issuing vi-like bulk editing commands.)

This is part of why I feel that ed(1) was once a good editor (cf). Ed is carefully adapted for the environment of early Unixes, which ran on small and slow machines with limited memory (which led to ed not holding the file it's editing in memory). Part of that adaptation is being an editor that worked with the system, not against it, and on V7 Unix that meant working in cooked mode instead of raw mode.

(Vi appeared on more powerful, more capable machines; I believe it was first written when BSD Unix was running on Vaxes.)

Update: I'm wrong in part about how V7 ed works; see the comment from frankg. V7 ed runs in cooked mode but it reads input from the kernel a character at a time, instead of in large blocks.


2019-04-18 15:21
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll
I think today will be the elderly dog next door's final day. Poor Dakota is very, very old for a dog and time has caught up with her.

Happy Birthday, Kristine

2019-04-18 16:39
[syndicated profile] scalziwhatever_feed

Posted by John Scalzi

This fabulous person who also happens to be my wife is celebrating a birthday today, and in the UK, no less. If you wished to convey your birthday felicitations to her, I would not look askance upon it. She’s the best person I know.

Hugo Help Please

2019-04-18 11:05
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll
Which twelve of my reviews in 2018 were the best?
[syndicated profile] cam_uis_help_feed
There will be some brief disruption to University websites, including www.cam.ac.uk, today while we carry out essential maintenance. Apologies for any inconvenience caused.
[syndicated profile] four_short_links_feed

Posted by Nat Torkington

Geospatial Feature Engineering, 3D Reconstruction, Fast NLP, and Learning the Zork Interpreter Language

  1. Geomancer -- a geospatial feature engineering library. It leverages geospatial data such as OpenStreetMap (OSM) alongside a data warehouse like BigQuery. You can use this to create, share, and iterate geospatial features for your downstream tasks (analysis, modeling, visualization, etc.).
  2. Meshroom -- a free, open source 3D Reconstruction Software based on the AliceVision framework.
  3. BlingFire -- A lightning fast finite state machine and regular expression manipulation library. [...] We use Fire for many linguistic operations inside Bing such as tokenization, multi-word expression matching, unknown word-guessing, stemming / lemmatization, just to mention a few. cf NLTK.
  4. Learning ZIL -- what the Infocom games were written in, decades before Inform. Andrew Plotkin wrote an intro that explains how it sits in the universe. (Note: this is useless but historically interesting.)

Continue reading Four short links: 18 April 2019.

andrewducker: (Default)
[personal profile] andrewducker
[syndicated profile] scalziwhatever_feed

Posted by John Scalzi

It’s a parking lot, not only in an entirely different country, but in an entirely different continent! And Heathrow Airport is in the background, which is actually cooler than it sounds.

I’m here for Ytterbium, this year’s Eastercon, where I am a Guest of Honor, and everything is lovely so far. The convention begins properly tomorrow — today we relax, get some sleep in and prepare for the weekend. Three cheers for a lovely spring day in the UK.

How are you? Please describe in words that do not include “redacted Mueller report” in any way, shape or form.

[syndicated profile] charlesarthur_feed

Posted by charlesarthur

Guess who the big winner is in the 5G modem fight? CC-licensed photo by Kārlis Dambrāns on Flickr.

You can sign up to receive each day’s Start Up post by email. You’ll need to click a confirmation link, so no spam.

A selection of 10 links for you. Indefatigably. I’m @charlesarthur on Twitter. Observations and links welcome.

Don’t count on 23andMe to detect most breast cancer risks, study warns • The New York Times

Heather Murphy:


In 2010, Dr. Pamela Munster mailed her saliva to 23andMe, a relatively new DNA testing company, and later opted in for a BRCA test. As an oncologist, she knew a mutation of this gene would put her at high risk for breast and ovarian cancer. She was relieved by the negative result.

Two years later, after she learned she had breast cancer, she took a more complete genetic test from a different lab. This time it was positive.

A study of 100,000 people released earlier this month suggested that this experience could be widespread. Nearly 90% of participants who carried a BRCA mutation would have been missed by 23andMe’s test, geneticists found.

23andMe’s testing formula for this risk is built around just three genetic variants, most prevalent among Ashkenazi Jews. The new study demonstrated that most people carry other mutations of the gene, something many doctors have long suspected.

“It’s as if you offered a pregnancy test, but only the Jewish women would turn positive,” said Dr. Munster, who is the co-leader of the Center for BRCA Research at the University of California, San Francisco. She was not involved in the new study, which was conducted by Invitae, a diagnostic company.

23andMe said response to the study by its potential competitor had been overblown because the site makes it clear that it is testing only for three of the mutations.


The explanation of this demonstrates how complex gene testing is: mutations multiply, and it’s hard to be sure you’re covering everything.
unique link to this extract

Cracking the code: a toddler, an iPad, and a tweet • The New Yorker

Evan Osnos:


I’d left the iPad in its usual home––an overflowing basket, on a low table, of mail, stamps, power cords, and partially broken earphones. The low table, it turns out, was a mistake. Our son Ollie, age three, gets to use the iPad on airplanes, but rarely at home, a rule he regards as unspeakably cruel. Now and then, when he finds it in his grasp, he’ll enter random numbers into the passcode screen, until a parent lifts the device up and out of his tiny hands, at which point he rendeth his garments and lieth on the earth.

The iPad was not in the basket. Ollie, it turns out, had got hold of it and gone to town on the passcode, trying one idea after another, with the fury and focus of Alan Turing trying to beat the Nazis. It’s not clear how many codes Ollie tried, but, by the time he gave up, the screen said “iPad is disabled, try again in 25,536,442 minutes.” That works out to about 48 years. I took a picture of it with my phone, wrote a tweet asking if anyone knew how to fix it, and went downstairs to dinner.


What happens is rather lovely, though also an indication of what modern media life is like.
unique link to this extract

Apple puts need for 5G ahead of legal fight in Qualcomm deal • Bloomberg

Ian King and Mark Gurman:


Apple needs chips that will connect the iPhone to the new, fifth-generation wireless networks being introduced now or risk falling behind its rivals. The company had bet on Intel Corp., but recently decided its would-be 5G supplier wasn’t up to the task.

That led Apple back to Qualcomm – and spurred a sudden end to a long-running court fight over patents, component costs and royalties for one of the most critical parts of an iPhone. Modems, or baseband processors, are what connects all iPhones and some iPads and Apple Watches to cellular networks and the internet on the go.

Throughout the fight, which centered on Apple’s accusations that Qualcomm overcharges for patents on its technology, the iPhone maker played down the importance of the modem and Qualcomm’s inventions. Just before the settlement was announced on Tuesday, Apple’s lawyers were in a San Diego courtroom saying the component was just another method of connecting to the internet. In reality, Qualcomm’s modems are leading a potential revolution in mobile internet — and Apple could have been forced to play catchup without them.

Intel, which dominates the market in personal computer chips, has struggled for decades in mobile. The company pledged that its 5G part was coming in phones next year. But within hours of Apple’s deal with Qualcomm, and with it the loss of its prime mobile customer, Intel announced it would end its effort to produce a 5G modem for smartphones.


The deal was dated April 1 – so Apple had realised Intel’s 5G efforts wouldn’t bear fruit some time ago, and had probably been negotiating since February. Its only leverage was the possibility that the court case would go in its favour, but that wouldn’t get the 5G part, and the clock was ticking. Apple needs the part this year for its design and testing work. So it hit a fairly hard deadline.
unique link to this extract

Qualcomm just beat Apple into submission • Semiaccurate

Charlie Demerjian:


Apple was trying to cut Qualcomm down to size and marginalize them to another supplier of commodity parts. They did this by trying to build up Intel modems and even allegedly handing Intel Qualcomm’s trade secrets when the Santa Clara company could not figure out how to make a working product. For the billions Apple dumped into this enterprise, they failed because Intel, the best of the non-Qualcomm modem makers, quite literally never made a single device that met their promised specs. No we are not joking, Intel’s modem business was a mess.

How bad was it? By the end they were showing multiple versions of the same fake chip photoshopped to ‘be’ a 5G modem. Really, you can’t make this stuff up. Intel claimed release dates, specs, and all sorts of numbers but never showed actual 5G silicon, functional or not. Worse yet they never got LTE modems even close to what they promised Apple. This is Intel’s problem not Apple’s, right?

Actually it was Apple’s problem more than Intel’s. Sure Intel was ‘selling’ Apple modems with a $10 bill wrapped around each one as SemiAccurate exclusively told you last year, but finances only go so far. Remember the iPhones with 600Mbps LTE modems? You know the ones where if you put that same Qualcomm part in any other device it was a 1Gb LTE modem? Then again if you put the same Intel modem in any other device it was a 600Mbps modem, not that there were any other customers dumb enough to use that device despite the contra-revenue pricing. Apple literally crippled their Qualcomm modem to match Intel’s so the finance set would put pressure on Qualcomm.

Although both devices were the same spec on paper, the Qualcomm iPhone had 30% more throughput at than the Intel one under the same conditions. What they didn’t say and that SemiAccurate has tested in the lab is that the Intel modems used about 30% more energy to be 30% slower, something that was pretty similar to previous generations.


So the implication seems to be that this year’s iPhones (and mobile-capable iPads?) will also use Intel modems, but after that it’s going to be Qualcomm parts. Sounds like that’s good for everyone apart from Intel.
unique link to this extract

Global 5G smartphone shipments will reach 5m units in 2019 • Strategy Analytics


According to the latest research from Strategy Analytics, global smartphone shipments will reach a modest 5 million units in 2019. Early 5G smartphone models will be expensive and available in limited volumes. Samsung, LG and Huawei will be the early 5G smartphone leaders this year, followed by Apple next year.

Ken Hyers, Director at Strategy Analytics, said, “We forecast global 5G smartphone shipments will reach a modest 5 million units in 2019. Less than 1% of all smartphones shipped worldwide will be 5G-enabled this year. Global 5G smartphone shipments are tiny for now, due to expensive device pricing, component bottlenecks, and restricted availability of active 5G networks.”

Ville Petteri-Ukonaho, Senior Analyst at Strategy Analytics, added, “Samsung will be the early 5G smartphone leader in the first half of 2019, due to initial launches across South Korea and the United States. We predict LG, Huawei, Xiaomi, Motorola and others will follow later in the year, followed by Apple iPhone with its first 5G model during the second half of 2020. The iPhone looks set to be at least a year behind Samsung in the 5G smartphone race and Apple must be careful not to fall too far behind.”


Obviously, it will ramp up next year, but Apple dumping Intel for Qualcomm may mean it’s not really losing out. It wasn’t first with 4G either, but that was at a time when growth was guaranteed. Also worth reading: Ron Amadeo’s article on why you shouldn’t buy a 5G smartphone (at least this year).
unique link to this extract

Revealed: Brexit group covered up its targeting of right-wing extremists • Channel 4 News

Channel 4 Investigations Team:


Leave.EU paid for Facebook adverts targeted at supporters of the National Front, the BNP [British National Party], Britain First and the EDL [English Defence League]. [All are extreme right-wing groups.]

But when the BBC asked for a response to a story they planned to run, Mr Banks sent a barrage of emails in an attempt to get the story dropped. Leaked emails, seen by Channel 4 News, show Mr Banks insisted the BBC’s accusation were “wholly wrong” – despite his own staff telling him the story was true.

One Leave.EU employee told him: “Those are our ads, we have targeted those groups since the beginning of the campaign as they gain most traction.” Another Leave.EU staffer proposed telling the BBC: “We pay for target ads for all political parties, not just right wing.”

But Mr Banks replied: “Not the right answer.” Instead, Mr Banks told the BBC: “It’s wholly wrong to say we have targeted extreme right parties… your report needs to reflect this or it will be biased and if we have to we will take whatever legal action we need.”

Andy Wigmore, Leave.EU’s Head of Communications, even appealed to the head of BBC Westminster, Robbie Gibb, in a further attempt to prevent the story from being run.

Mr Gibb is now Theresa May’s head of communications.


Gibb’s role in this isn’t necessarily about his attitude to Brexit; the BBC has become incredibly worried about libel and lawsuits after a number of high-profile errors. Wigmore’s response to Channel 4 was to accuse it of using “stolen and hacked emails”, which isn’t in any way a denial. Wigmore seemed upset when I pointed this out on Twitter.
unique link to this extract

Samsung Galaxy Fold screen breaking and flickering for some reviewers • CNBC

Todd Haselton:


Samsung’s $1,980 Galaxy Fold phone is breaking for some users after a day or two of use. A review unit given to CNBC by Samsung is also completely unusable after just two days of use.

The phone has only been given to gadget reviewers, but some of the screens appear to be disconnecting and permanently flashing on or off.

The Verge’s Dieter Bohn posted earlier on Wednesday that his phone appears to have a defective hinge with a “small bulge” that he can feel that’s causing the screen to “slightly distort.” Bloomberg’s Mark Gurman says his “review unit is completely broken just two days in,” but noted he accidentally removed a protective film on the screen.

YouTube tech reviewer Marques Brownlee also removed the film and experienced a broken display. A Samsung spokesperson had warned on Wednesday not to remove the protective layer.

However, CNBC didn’t remove that layer, and our screen is now also failing to work properly.


It seems to have a really high failure rate among reviewers. A $2,000 phone that doesn’t last a week? This is going to be a Note 7 fiasco if this is repeated among buyers.
unique link to this extract

Why is everybody getting into wireless earbuds? • Tech.pinions

Carolina Milanesi:


There is no question about Apple’s success with AirPods. Apple managed to get AirPods across gender, age, and even income level despite their price point not putting them in the “most affordable” category. The experience is described by many as magical. In a study, we, at Creative Strategies, conducted with Experian when AirPods first came out, customer satisfaction was the highest for a new product from Apple. 98% of AirPods owners said they were very satisfied or satisfied. Remarkably, 82% said they were very satisfied. By comparison, when the iPhone came out in 2007, it held a 92% customer satisfaction level, iPad in 2010 had 92%, and Apple Watch in 2015 had 97%.

Assuming Microsoft and Amazon are just after the revenue that a good set of wireless earbuds could generate is a little shortsighted.

Ambient computing and voice-first are certainly big drivers for both Microsoft and Amazon. As computing power is spread out across devices and digital assistants are helping to bridge our experience across them, voice has grown in importance as an interface. Many consumers are, however, less comfortable shouting commands across a room or speaking to technology outside the “safety” of their own home. As voice moves into the office, the need and desire to be able to speak quietly to an assistant and hear it back is even more evident.

Wireless earbuds that can be worn comfortably throughout the day allow us to build a better relationship with our assistants and, even more so, build our reliance. Interestingly, I would argue, this is where AirPods have not been as successful as Apple might have hoped for but certainly, through no fault of their own but more due to some limitations Siri has.

For both Alexa and Cortana, who do not have a smartphone they can call their own home, wireless earbuds are a great way to be with a user in a more direct and personal way rather than being relegated into an app. As I often say, this is not about consumers having only one assistant but making the assistant they use more often more intelligent and therefore creating a vicious circle: the more I use it, the more it gets better, the more I want to use it.


On Wednesday I saw a street sweeper wearing a paid of AirPods. They’re the new Coca-Cola of headphones: same for everyone, just about priced for all, uniquely recognisable.
unique link to this extract

The most measured person in tech is running the most chaotic place on the internet • New York Times

Daisuke Wakabayashi:


On April 2, Bloomberg News published an article that painted a damning portrait of [YouTube boss Susan Wojcicki] and other YouTube brass — so focused on maximizing usage statistics that they looked the other way when employees raised concerns about the company’s recommendation system. Ms. Wojcicki seemed taken aback. In an April 7 interview, she said YouTube has not ignored its problem with hosting extreme and conspiracy-minded content. She said it was a large and complex issue and the company was starting to make a dent. She wasn’t defensive, but defiant and — most surprising for someone usually so measured — a little angry.

“It’s not like there is one lever we can pull and say, ‘Hey, let’s make all these changes,’ and everything would be solved,” Ms. Wojcicki said. “That’s not how it works.”

At one policy review meeting I observed in San Bruno, her methodical approach was on full display. In a narrow conference room lined with whiteboards and TV screens, she sat quietly with a dozen YouTube employees, watching a video called “Condom Challenge,” in which water-filled prophylactics fell onto people’s heads in extreme slow motion. Rather than bursting, the condoms inverted and engulfed their faces like a fishbowl. Ms. Wojcicki pondered whether the clip, which has nearly 15 million views, was merely juvenile or crossed the line to life-threatening. Like so much on YouTube, such “challenges” — when creators perform stunts and call out a friend to do the same — often begin as harmless memes, but morph into something more problematic.

Ms. Wojcicki and her staff considered their thicket of policies. A “dangerous” (risk of bodily harm) activity could stay on YouTube as long as no minors were involved. But “ultrahazardous” (risk of death) challenges would be removed. One staffer ventured that the condom challenge seemed to belong in the former category. Ms. Wojcicki disagreed.


To me, that’s classic missing-forest-for-trees oversight. The problem isn’t a few videos; it’s the whole recommendation system plus autoplay, as many have pointed out. But Wojcicki is trying to tweak at the edges, instead of considering it holistically.
unique link to this extract

Online pornography age checks to be mandatory in UK from 15 July • The Guardian

Alex Hern:


From that date, commercial providers of online pornography will be required to carry out “robust” age verification checks on users, in order to keep children from accessing adult content.

Websites that refuse to implement the checks face being blocked by UK internet service providers or having their access to payment services withdrawn.

The digital minister, Margot James, welcomed the introduction of the rules, saying: “Adult content is currently far too easy for children to access online. The introduction of mandatory age verification is a world first, and we’ve taken the time to balance privacy concerns with the need to protect children from inappropriate content. We want the UK to be the safest place in the world to be online, and these new laws will help us achieve this.”

Will Gardner, the chief executive of Childnet, said: “We hope that the introduction of this age verification will help in protecting children, making it harder for young people to accidentally come across online pornography, as well as bringing in the same protections that we use offline to protect children from age-restricted goods or services.”

Some campaigners have criticised the laws’ potential effectiveness. The government was forced to exempt large social media sites from the ban owing to fears that a strict implementation would result in sites including Twitter, Reddit, Imgur and Tumblr being blocked for adult content.

Additionally, concerns have been raised that the laws could result in the creation of a database of the UK’s porn viewers, which would pose a privacy problem if it were to ever leak.


Well this is going to cause a LOT of fun when, for all sorts of reasons, it goes wrong. Though you won’t hear from adults complaining they were blocked wrongly; only about kids wrongly allowed to access. (You can figure out why.)
unique link to this extract

Errata, corrigenda and ai no corrida: none notified

[syndicated profile] cks_techblog_feed

Posted by cks

Previously, I mentioned that Prometheus expressions are filters, which is part of Prometheus having a generally set-oriented view of the world. One of the consequences of this view is that you can quite often have expressions that give you a null result when you really want the result to be 0.

For example, let's suppose that you want a Grafana dashboard that includes a box that tells you how many Prometheus alerts are currently firing. When this happens, Prometheus exposes an ALERTS metric for each active alert, so on the surface you would count these up with:

count( ALERTS{alertstate="firing"} )

Then one day you don't have any firing alerts and your dashboard's box says 'N/A' or 'null' instead of the '0' that you want. This happens because 'ALERTS{alertstate="firing"}' matches nothing, so the result is a null set, and count() of a null set is a null result (or, technically, a null set).

The official recommended practice is to not have any metrics and metric label values that come and go; all of your metrics and label sets should be as constant as possible. As you can tell with the official Prometheus ALERTS metric, not even Prometheus itself actually fully follows this, so we need a way to deal with it.

My preferred way of dealing with this is to use 'or vector(0)' to make sure that I'm never dealing with a null set. The easiest thing to use this with is sum():

sum( ALERTS{alertstate="firing"} or vector(0) )

Using sum() has the useful property that the extra vector(0) element has no effect on the result. You can often use sum() instead of count() because many sporadic metrics have the value of '1' when they're present; it's the accepted way of creating what is essentially a boolean 'I am here' metric such as ALERTS.

If you're filtering for a specific value or value range, you can still use sum() instead of count() by using bool on the comparison:

sum( node_load1 > bool 10 or vector(0) )

If you're counting a value within a range, be careful where you put the bool; it needs to go on the last comparison. Eg:

sum( node_load1 > 5 < bool 10 or vector(0) )

If you have to use count() for more complicated reasons, the obvious approach is to subtract 1 from the result.

Unfortunately this approach starts breaking down rapidly when you want to do something more complicated. It's possible to compute a bare average over time using a subquery:

avg_over_time( (sum( ALERTS{alertstate="firing"} or vector(0) ))[6h:] )

(Averages over time of metrics that are 0 or 1, like up, are the classical way of figuring out things like 'what percentage of the time is my service down'.)

However I don't know how to do this if you want something like an average over time by alert name or by hostname. In both cases, even alerts that were present some of the time were not present all of the time, and they can't be filled in with 'vector(0)' because the labels don't match (and can't be made to match). Nor do I know of a good way to get the divisor for a manual averaging. Perhaps you would want to do an unnecessary subquery so you can exactly control the step and thus the divisor. This would be something like:

sum_over_time( (sum( ALERTS{alertstate="firing"} ) by (alertname))[6h:1m] ) / (6*60)

Experimentation suggests that this provides plausible results, at least. Hopefully it's not too inefficient. In Grafana, you need to write the subquerry as '[$__range:1m]' but the division as '($__range_s / 60)', because the Grafana template variable $__range includes the time units.

(See also Existential issues with metrics.)

Wolf 359

2019-04-17 17:32
[personal profile] swaldman
I just finished listening to the finale of the Wolf 359 podcast. It's been quite a ride.

61 episodes (plus some minisodes and so forth) over 3.5 years, all of which had finished before I even heard of the show, so I've been listening at my own pace, over perhaps six months. The blurb says,

WOLF 359 is a radio drama in the tradition of Golden Age of Radio shows. Set on board the U.S.S. Hephaestus space station, the dysfunctional crew deals with daily life-or-death emergencies, while searching for signs of alien life and discovering there might be more to their mission than they thought.

Tune into your home away from home... seven and a half light years away from Earth...

That's a reasonable start. It begins as "hapless, lazy protagonist is somehow on a deep space mission" comedy. Slightly cringy, mostly good, reminded me quite a lot of Final Space. It morphed into mystery, and at times horror and psychodrama... it's had entire episodes where the crew are stuck in one room together... and then the stakes increased, and it became more of an adventure tale. And then it reached a conclusion and ended, which is something that I feel Night Vale should have had the courage to do some time ago. And all the while, it maintained a nice sense of humour.

Highly recommended. I'm even considering buying a t-shirt, years after the show stopped actually needing support :-)

Well, that was a shame.

2019-04-17 17:15
[personal profile] swaldman
When not househunting, I've been using some of my time to look at e-bikes. I'm hoping to make one my main means of commuting, at least for the summer months. I heard that a local store was having a closing down sale, so I went over to take a look.

The only "normal" bike (not a tandem, not a cargo bike) that they had left was one that I'd been looking at online and was interested in! It had over $1200 taken off the price!

I took it for a test ride, and liked it. Unfortunately... it was also very slightly too big. By maybe an inch, or even less. And it couldn't be adjusted any smaller. I needed the next frame size down. I could ride it, but it wasn't quite right, and I wasn't about to spend $3400 on something that wasn't quite right, even if was a bargin.

So I passed. And I shall go look in other shops once I'm more settled (and, let's face it, once I've had a paycheque or two), and probably spend more, but for something that fits.


Trousers at last

2019-04-17 21:02
mtbc: maze L (green-white)
[personal profile] mtbc
In mentioning seeking a reliable ongoing source of trousers that fit me, in contrast to whatever the season's design and tailoring currently happen to be, one idea I had mentioned was workwear. That tree bore me fruit first by way of the Dickies 874 work pant which come in a range of colors. Having been around for over fifty years they may not be fashionable but if people judge me harshly for that then they probably aren't worth my listening to anyway. At least the trouser legs are wide enough to fit easily over my calves rather than following a modern tapered cut; the pair I now have in hand fit just about right.

I confirmed the sizing by trying the same in another classic American item of workwear: Wrangler jeans in a regular cut which also fit adequately. Trousers are where I most notice a poor fit so it is great to finally have some confidence that I may have regained ongoing ability to easily obtain satisfactory pairs. Now I just have to find a small enough belt as the jeans are just a little loose which is good as I welcome a little room to gain a few pounds. It is convenient to be able to relax my dieting occasionally.
kaberett: Reflections of a bare tree in river ice in Stockholm somehow end up clad in light. (tree-of-light)
[personal profile] kaberett
  • On Tuesday evening, my laptop ran out of battery, put itself to sleep, and lost its hard drive. I have successfully (1) not panicked much, (2) got on with my life or at least the mass spec, (3) got A to help me do some simple diagnostics, (4) taken it back to the place I got it less than a year ago and got them to order replacement parts because alas they couldn't sell me something on the spot so I could just go home and spend this evening sorting myself back out, which means that (5) I had the opportunity to dig out the 12-month repair warranty and set it to one side to take with me when I go to pick the thing back up, meaning that this Ought To Be Free.
  • On Monday, we had [personal profile] alexwlchan around. I got some of the spinach-and-butternut-squash-and-roast-garlic-and-ricotta pasta out of the freezer, portioned out the amount we were going to want to eat for dinner, and then absent-mindedly put the remainder back into... the fridge, not the freezer. Which means that dinner tonight -- I got in a little before eight -- is that pasta, along with the leftover tomato-and-mascarpone-sauce, only I'm the only one eating it tonight so it now also contains a slightly obnoxious quantity of chilli, plus bonus nutmeg.
  • The non-existence of buses between Green Park and South Ken due to the Extinction Rebellion protest (which, yes, is very worthy, but this means there is no reasonable accessible route for me to get into work and I had machine time booked and I'm just quite augh about the ways in which this specifically fucks over disabled people massively disproportionately to the effect on people using public transport who don't need level access) led to me getting up ridiculously early this morning and then pushing from Green Park to lab via Hyde Park. This involved two pairs of Egyptian geese with three spotty little balls of fluff each. (Also there were some Loudly Beeping Moorhens, and a lot of yell birds in general.)
jorallan: (Default)
[personal profile] jorallan
Don't use the same password on more than one site. That won't be news to the more security conscious of the people that read this (if it is news to you, read the link) but even for my more techie friends, the practical management of secure passwords can be an issue. I occasionally get asked how I do this, so here's a blog post...

For avoidance of doubt, this is very much just how I do things. It's by no means the one and only one correct way to do it, but it works for me. The other slightly "odd" (although maybe less odd among people that read this) requirement that I have is that it needs to provide a solution for when my laptop is running Linux. Anyway, what I do is:
  • Create a password database with KeePass. Use something really strong as your master passphrase.
  • Use KeePass to generate every new password you ever create. Use secure settings for this - my default settings are 32 characters and all the character classes KeePass allows except "High ANSI characters".
    • Occasionally this breaks a website which doesn't like that kind of password. This is annoying, especially when they don't tell you why they don't like your password. Not much that can be done about that though.
  • Put the password database onto my Google Drive.
    • On Windows, install Google Backup and Sync to ensure that I always have the latest version of the database.
    • On Linux, install Insync to sync Google Drive to my local machine. Yes, this involves paying money but as a one-off payment I think £30 (or $30 if you're lucky enough to be in the US) is a worthwhile investment.
    • On Android, the Google Drive app gives you sync automatically. (This assumes you're running full blown Android, rather than AOSP as you get on e.g. Kindle Fire tablets. I haven't tried to solve that problem)
  • On Android, install Keepass2Android Password Safe to access the database.
This now means that 1) I have the latest version of the password database on all my devices and 2) I'm not reliant on any cloud provider's security for my password security. Even in the worst case that Google were hacked (or subpoenaed) and my password database was obtained by an attacker, the database is still encrypted by my strong passphrase so hopefully useless. I am reliant on KeePass's security, but I'm happy with that. (Also, thank you to the EU for making us safer).

The only gotcha I've found with this system is that I have to be careful not to have the password database open on device A and editing it on device B, or the syncing understandably gets confused. There aren't many valid use cases for having the database open on more than one device at once anyway, so this just encourages good practice :-)

Historical note: until March 2019, I used Dropbox for the sync rather than Google Drive, mostly because Dropbox provided a free Linux client. However, Dropbox now restrict their free accounts to three devices which broke all that. If you pay for Dropbox already for other reasons, you can use that and not pay for Insync.

[syndicated profile] lemire_feed

Posted by Daniel Lemire

It is common to represent binary data or numbers using the hexadecimal notation. Effectively, we use a base-16 representation where the first 10 digits are 0, 1, 2, 3, 5, 6, 7, 8, 9 and where the following digits are A, B, C, D, E, F, with the added complexity that we can use either lower or upper case (A or a).

We sometimes want to convert strings of hexadecimal characters into a numerical value. For simplicity, let us assume that we have sequences of four character. Each character is represented as a byte value using its corresponding ASCII code point. So ‘0’ becomes 48, ‘1’ is 49, ‘A’ is 65 and so forth.

The most efficient approach I have found is to simply rely on memoization. Build a 256-byte array where 48 (or ‘0’) is mapped to 0, 65 (or ‘A’) is mapped to 10 and so forth. As an extra feature, map all disallowed values to -1 so we can detect them. Then just lookup the four values and combine them.

uint32_t hex_to_u32_lookup(const uint8_t *src) {
  uint32_t v1 = digittoval[src[0]];
  uint32_t v2 = digittoval[src[1]];
  uint32_t v3 = digittoval[src[2]];
  uint32_t v4 = digittoval[src[3]];
  return v1 << 12 | v2 << 8 | v3 << 4 | v4;

What else could you do?

You could replace the table lookup with a fancy mathematical function:

uint32_t convertone(uint8_t c) {
  return (c & 0xF) + 9 * (c >> 6);

How do they compare? I implemented both of these and I find that the table lookup approach is more than twice as fast when the function is called frequently. I report the number of instructions and the number of cycles to parse 4-character sequences on a Skylake processor (code compiled with GNU GCC 8).

Instruction count Cycle count
lookup 18 4.3
math 38 9.6

I am still frustrated by the cost of this operation. Using 4 cycles to convert 4 characters to a number feels like too much of an expense.

My source code is available (run it under Linux).

Further reading: Fast hex number string to int by Johnny Lee; Using PEXT to convert from hexadecimal ASCII to number by Mula.

[syndicated profile] ripe_labs_feed
Based on RIPE Atlas measurements, we can illustrate if paths between different networks in a given country stay in that country. We can also provide sketches of interconnections between networks in that country. In this article we look at the situation in Bosnia and Herzegovina.
[syndicated profile] postgres_weekly_feed

#301 — April 17, 2019

Read on the Web

Postgres Weekly

Latest Release: 11.2 (2019-02-14)

'Postgres Now Has Pluggable Table Storage' — Well, core does, we’ll need to wait a while to be using this in production, but being able to more easily switch in table storage systems will open up interesting opportunities.

Andres Freund on Twitter

Writing PostgreSQL Extensions in C is Fun — It depends on your definition of fun but it’s not quite as difficult as I’d assumed. This post walks through the basic steps to get started. I also think reading the code of simple, but complete, extensions such as count_distinct is useful if you wish to pursue this.

Ibrar Ahmed

Learn to Secure Your Database — Join the free PostgreSQL webinar: Security and Compliance with PostgreSQL and learn to identify and secure your database breach points. Reserve your spot today.

2ndQuadrant PostgreSQL Webinars sponsor

When Postgres Blocks: 7 Tips for Dealing with Locks — We’re revisiting a classic post that highlighted common mistakes developers face dealing with Postgres locks and what you can do about them.

Marco Slot

Postgres 12 is Optimizing the Storage of Small Tables — One to read if your database model requires that you have a large number of small tables (e.g. a multi-tenant schema). Things will be getting more efficient in Postgres 12.

John Naylor

Swarm64 Supports Xilinx Alveo Accelerator — At the risk of sounding like a pile of buzzwords and trademarks, this is a press release for an FPGA-based database accelerator that supports Postgres.


Fast Upgrading of Legacy Postgres with Minimum Downtime Using pg_upgrade — The latest in a long series of Postgres upgrading posts from Percona. This time pg_upgrade (formerly pg_migrator) is considered.

Avinash Vallarapu

Getting Started with Azure Database for PostgreSQL — A fully managed Postgres database engine with features like built-in high availability, scalability, and security. Get started and leverage the open source tools of your choice.

Microsoft Azure sponsor

A Postgres 12 Highlight: pg_checksums — A renaming of pg_verify_checksums as introduced in Postgres 11.

Michael Paquier

pspg: An Alternative Pager for Postgres's psql Client — Replaces less and brings in support for tabular data.

Pavel Stehule

Marten: Postgres-Based Persistence for .NET Systems — A document database and event store for .NET-based apps that uses Postgres to do the heavy lifting on the backend. And, yes, it works on .NET Core :-)


libpqxx: The Official C++ Client API for Postgres — It’s had quite a few updates recently.

Jeroen Vermeulen

supported by

💡 Tip of the Week

Automatically logging slow queries

The server that hosts our newsletter was running slow and we didn't know why. Postgres was suffering in particular, so we wanted to see what queries were getting bogged down.

Like most databases, Postgres has a built-in slow query log feature that automatically logs queries to the main Postgres log file if they take over a certain amount of time and it's really easy to set up.

In your main postgresql.conf file (which is often somewhere like /etc/postgresql/9.6/main/postgresql.conf), either edit or add a line like so:

log_min_duration_statement = 1000

After restarting Postgres or reloading the config with SELECT pg_reload_conf();, this directive causes any queries that take over 1000 milliseconds (one second) to be logged.

(The location of the log file varies but is /var/log/postgresql/postgresql-9.6-main.log on my test setup, for instance.)

To deliberately run a long query for testing purposes:

select pg_sleep(10) /* just testing */;

Note the presence of the comment within the query, that'll appear in the log too so that anyone else monitoring will be aware of what's going on.

And, no, it wasn't Postgres causing our performance issues. Our VPS was on a shared box that came under heavy use and upgrading our instance fixed it. I'll note, though, that if you run any VPS style servers, it's well worth being familiar with 'steal time' and how to monitor it!

This week's tip is sponsored by Percona. Join Percona as we present Upgrading / Migrating your legacy PostgreSQL to newer PostgreSQL versions.

🗓 Upcoming Postgres Events

jack: (Default)
[personal profile] jack
What Went Well

Playing some DnD where building an effective character and achieving things effectively actually matters has been very nice. I don't want to play that style too much, it's a big investment of effort, but I was missing it.

The mechanics for navigating an expansive underground maze worked almost perfectly. It really feels like feeling your way through routes you partially know but might shift any time. And generating a big batch of layout and bringing it up as people stumble across it has been very satisfying.

The characters and players are really great. The inquisitive, acquisitive, goblin. The impulsive, swashbuckling cat-bard. The dour blood hunter. The rogue with a mysterious history. The players have generally been great even though I didn't know them well before.

I've had lots of lovely ideas which have gone into sessions.

Playing a not-too-long session every too weeks has gone reasonably.

What Didn't Live up to Expectations

As always, my skills cat-herding players to turn up, and making sure everyone's clear on what's going on, have been a bit rusty.

The sessions have all been quite slow, partly because I've been getting used to the sort of prep that works well in this kind of campaign, and partly just because there's a lot of players, and everyone is still getting used to what their characters can do.

All the sessions left me feeling a bit like they were missing something but I wasn't sure what. That's not unexpected when I try to run a sort of game I haven't run before, but after some thought I think I got some idea.

One problem is, a dnd game is typically a stream of small decisions: explore the hut or the cave? talk or fight? search casually or thoroughly? Often not even decisions spelled out, but formed implicitly from what the players naturally do. In this game, my hope is that the choice of routes through the labyrinth would often serve in this role, but because progress has been slower than I hoped, most of the navigation decisions haven't really had a lot of decision to make.

Also, because I started off planning broadly, a lot of the individual things the characters encounter in one session are less well fleshed through than they might otherwise be, if I'd spent prep time thinking through what they were most likely to meet specifically. I've been doing more of this, even though it's more prep, but only needed to "top up" the places they're most likely going next, and hopefully can be reused if I use the same setting in future.

And there just haven't been enough NPCs who've often brought games to life. The idea was, NPCs in the castle would interact with the PCs in advance, through rumours and quests offered, and slowly build up a relationship. But so far, every delve has taken multiple sessions, and it's taken two sessions to complete what I intended as the original starter goal, so no-one has had time to pursue "extra" leads. I need some more of this to happen in session so people engage with it more, even if that takes time.

Dnd games that I've run well have always had fights designed well enough to be somewhat interesting, but have been brought to life by the ideas and npcs, the richness of the immediate setting as I've spent lots of prep time dwelling on it, and the characters have interacted with NPCs and environments in unexpected ways that have worked out because I've fleshed out characters and places to explore even if I wasn't sure if they'd be able to or not. I always used to think of myself as really analytical and less creative, so it's an adjustment to realise that's something that I can count as a success, and should expect to build up and rely on. But Liv's face when I talked about adding more NPCs made me realise it was well worth it.

Looking forward to

If possible, bringing more of the lore I worked out to the fore, it's been surprisingly hard to make it relevant, but it's come up a few times so I hope that works out.

Running a second group in the same setting, and seeing how they interact with the same spaces. And using the weirdness of the labyrinth to justify it if it seems like sometimes they leave somewhere in an impossible chronological order because of the order of the sessions :)

April 2019

123 4567

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated 2019-04-20 02:24
Powered by Dreamwidth Studios