Validation with Type Guards and Mapped Types

See the original posting on DZone Python

Slightly enhanced version of the code is now on NPM and GitHub.

Having spent a significant portion of my programming career using dynamic languages, I understand the value of rapid prototyping and feedback that they provide. I’ve also seen enough dynamic code to know that most dynamic codebases are full of brittle validation logic that our brethren from the statically typed camp don’t have to deal with. Well, that’s not entirely true. They still have to deal with it, but I think they have an easier time because the compiler can help them. There are many solutions to dealing with this problem in the dynamic camp in the form of libraries and DSLs, but today I’m going to present a solution that uses nothing but TypeScript’s built-in capabilities to help us build validators for POJOs (plain old JavaScript objects).

Netflix is testing a new feature that lets you instantly replay scenes (for some reason)

See the original posting on TechCrunch

Netflix loves to test new ideas, and its latest experiment is an odd new feature that lets viewers watch a scene again. A selection of Netflix subscribers noticed the new addition, which serves a pop-up asking if they want to “watch this scene again” after certain ‘highlight’ scenes in a show. The streaming giant confirmed […]

How To Make A Pilotron, The Forgotten Tube

See the original posting on Hackaday

The vacuum tube is largely ignored in modern electronic design, save for a few audio applications such as guitar and headphone amps. The transistor is smaller, cheaper, and inordinately easier to manufacture. By comparison, showing us just how much goes into the manufacture of a tube, [glasslinger] decided to make a wire-element pilotron – from scratch!

To say this is an involved build is an understatement. Simply creating the glass tube itself takes significant time and skill. [glasslinger] shows off the skills of a master, however – steadily working through the initial construction, before showing off advanced techniques necessary to …read more

KFC introduces a firelog that smells like greasy fried chicken

See the original posting on Boing Boing

My home has a fireplace and before the oppressive smoke of wildfires ruined the joy of lighting it, I used to start a fire once in a while during the colder months. Firewood isn’t readily available here in the Bay Area, so I would often have to resort to the use of firelogs since they were easily obtained in the barbeque section of my local grocery store. This lead to a conversation with a friend of mine who assured me, “There’s no shame in the chemical flame.”

Well, KFC’s latest promotional item, the 11 Herbs & Spices Firelog from Enviro-Log®, puts the shame back into the chemical flame. Yup, it’s a chemically-engineered firelog that emits the scent of their fried chicken.

Imbued with the unmistakable, mouth-watering aroma of Colonel Sanders’ secret recipe, the KFC 11 Herbs & Spices Firelog finally puts to rest the age-old dilemma, “How can I make this fire a hundred bajillion times better?” This one-of-a-kind firelog from Enviro-Log, a leading manufacturer of firelogs made of 100 percent recycled materials, is the result of countless hours of research and development, all done over the last couple of months since we had this idea. Pick up a firelog today, and you’ll be wondering how you were ever able to enjoy a fire that didn’t smell like fried chicken.

This fried chicken firelog was available for $18.99 but has since sold out.

Image via The Daily Meal

(Geekologie, The Daily Meal) Read the rest

Vergecast: Sundar testifies, a hole-punch display, and Verizon’s future

See the original posting on The Verge

This week on The Vergecast, Nilay, Paul, and Dieter devote half the show to discussing what happened when CEO of Google Sundar Pichai testified before the House Judiciary Committee. Congress thinks Google has a bias problem — does it?

The second half of the show is dedicated to gadgets! Both Samsung and Huawei revealed a phone with a “hole-punch” display so the crew theorize what’s coming in 2019 for the smartphone world.

There’s a whole lot more in between that — like Elizabeth Lopatto’s “This week in Elon” — so listen to this whole dang show; you’ll get all you need before the year ends.

1:30 – All the news from Google CEO Sundar Pichai’s appearance before the House Judiciary Committee

27:28 – “This week in Elon” with Elizabeth…

Continue reading…

Every Computer Deserves a Rotary Encoder

See the original posting on Hackaday

In the era of touch screens and capacitive buttons, we’d be lying if we said we didn’t have the occasional pang of nostalgia for the good old days when interfacing with devices had a bit more heft to it. The physical clunk and snap of switches never seems to get old, and while you can always pick up a mechanical keyboard for your computer if you want to hear that beautiful staccato sound while firing off your angry Tweets, there’s a definite dearth of mechanical interface devices otherwise.

[Jeremy Cook] decided to take matters into his own hands (literally and …read more

These face-generating systems are getting rather too creepily good for my liking

See the original posting on TechCrunch

Machine learning models are getting quite good at generating realistic human faces — so good that I may never trust a machine, or human, to be real ever again. The new approach, from researchers at Nvidia, leapfrogs others by separating levels of detail in the faces and allowing them to be tweaked separately. The results […]

Make this scale model of the Dr. Nim digital game

See the original posting on Boing Boing

Dr Nim is a plastic, gravity powered computer from the 1960s that plays the game, Nim, against a human player. Recently Michael Gardi made a 3D scale model of Dr Nim, which you can download and print on a 3D printer.

The Amazing Dr. Nim is a toy invented by John Thomas Godfrey and manufactured by Education Science Research (E.S.R., Inc.) in the mid-1960s. It consists of a marble-powered plastic computer capable of playing the game of Nim. The machine selects its moves through the action of the marbles falling through the levers of the machine.

The “game board” is a based on the mechanical Digi-Comp II digital computer (also a Godfrey creation). It has memory switches that hold bits of data. The unit is programmed by lobed levers that affect and are affected by marbles that are released from the top of the game. Three of the levers set the start position. The fourth lever is the ‘equalizer’ option; if set, the player can win if they play perfectly. The last lever is used to indicate who’s turn it is, the human or Dr. Nim’s.

Game play is described in the manual that was bundled with the game and can be found here:

The Amazing Dr. Nim Manual

There are many good online references for the game. The following video is especially informative and entertaining:

The Unbeatable Game from the 60s: Dr NIM

And this article speaks to the relevance of a game like Dr. Nim in today’s digital world:

Evil Mad Scientist Laboratories – Dr.

Read the rest

Artist lovingly paints Texas fast food joints in Kinkade-esque scenery

See the original posting on Boing Boing

San Antonio artist Michael Esparza‘s oil paintings put Texas-based fast food restaurants in the center of bucolic landscapes. It’s hard not to compare his work to Thomas Kinkade’s but that’s the point. (The main difference, imo, is that Esparza’s pieces are actually palatable.)

Texas Monthly:

The idea for the series, which Esparza describes as “a little bit Bob Ross and a little bit Thomas Kinkade,” came to him 2012, just after he came back to Texas from a year of studying art in Italy. In Italy, nothing was built taller than a church, so it was a shock when Esparza returned to San Antonio, the size of roadside signs were particularly jarring. “I was just seeing how iconic they are, but also from the Italian perspective, how ridiculous they are. From that point of view, it’s like, ‘What are you doing, Texas? What’s going on with these big signs that you have on the side of the road?’” he says. “But the first thing I did when I got back from Italy was I went to Whataburger, and then right after that, I went to Bill Miller’s. I just needed a burger, and I needed a po’ boy. I was already full after Whataburger, but I didn’t care.” Esparza says he wants the paintings to evoke the sense of homecoming you feel when you see those signs after spending time in a place where they don’t exist—be it Italy or elsewhere. “They become your own little beacons for where you live,” he explains.

Read the rest

Java 12 could ax raw string literals

See the original posting on JavaWorld

Java Development Kit  (JDK) 12 soon could be minus one feature that had been targeted for the release: a beta version of raw string literals.

Meant to ease developing with Java, a raw string literal can span multiple lines of source code and does not interpret escape sequences. But the developers of this feature no longer are confident that the beta capability will be ready when JDK 12 is released on March 19, 2019. So, a proposal has been launched by Brian Goetz, Oracle’s Java language architect, to delete the raw string literals capability from the planned upgrade. The review period for the deletion plan ends on December 18, 2018.

To read this article in full, please click here

5 principles to becoming a collaborative agile devops team

See the original posting on JavaWorld

There’s a lot of work IT teams take on when committing to agile and devops practices. Agile teams are likely to mature and scale their practice by defining the scrum master roles, adding estimating practices, and maturing how they use agile management tools. Devops teams might start by implementing CI/CD pipelines, then implement automate testing, and then look to add more informative application-level monitoring and alerts.

To read this article in full, please click here