Posted by: xSicKxBot - 12-20-2020, 12:14 AM - Forum: Python
- No Replies
Captive User Interfaces — Why You Should Avoid Them
This tutorial shows you the meaning of captive user interfaces and why they’re discouraged under the Unix philosophy. I’ve written this as a first chapter draft for my upcoming book “From One to Zero” to appear in 2020 with San Francisco-based publisher NoStarch.
What’s a Captive User Interface (CUI)?
A captive user interface is a way of designing a program that requires the user to interact with the program in a session before they’ll be able to proceed with their main execution flow. If you invoke a program in your terminal (Windows, MacOS, or Linux), you must communicate with the program before you can go back to the terminal. Examples are mini programs such as SSH, top, cat, vim—as well as programming language features such as Python’s input() function.
Python Example Captive User Interface
Say you create a simple life expectancy calculator in Python. The user must type in their age and it returns the expected number of years left based on a straightforward heuristic. This is a fun project found here.
"If you’re under 85, your life expectancy is 72 minus 80% of your age. Otherwise it’s 22 minus 20% of your age."
Your initial, bad, Python code is shown here:
def your_life_expectancy(): age = int(input('how old are you? ')) if age<85: exp_years = 72 - 0.8 * age else: exp_years = 22 - 0.2 * age print(f'People your age have on average {exp_years} years left - use them wisely!') your_life_expectancy()
Listing 8-8: Life-expectancy calculator – a simple heuristic – implemented as a captive user interface.
Here are some runs of the code:
>>> how old are you? 10
People your age have on average 64.0 years left - use them wisely!
>>> how old are you? 20
People your age have on average 56.0 years left - use them wisely!
>>> how old are you? 77
People your age have on average 10.399999999999999 years left - use them wisely!
Interactive Jupyter Notebook to Calculate Your Life Expectancy Using a Captive User Interface
In case you want to try it yourself, I’ve created an interactive Jupyter notebook you can run in your browser to calculate your own life expectancy. But, please, don’t take it too serious! Here’s the notebook:
The code makes use of Python’s input() function that blocks the program execution and waits for user input. Without user input, the code doesn’t do anything. This seriously limits the usability of the code.
What if I wanted to calculate the life expectancy for every age from 1 to 100 based on the heuristic and plot it? I’d have to manually type 100 different ages and store the results in a separate file. Then, you’d have to copy&paste the results into a new script to plot it.
The function really does two things: process the user input and calculate the life expectancy. This already violates rule number 3: Make Every Program Do One Thing Well.
But it also violates our rule: don’t use captive user interfaces if possible.
Non-Captive User Interface Python Example
Here’s how the function could’ve been implemented more cleanly:
def your_life_expectancy(age): if age<85: return 72 - 0.8 * age return 22 - 0.2 * age age = int(input('how old are you? '))
exp_years = your_life_expectancy(age)
print(f'People your age have on average {exp_years} years left - use them wisely!')
Listing: Life-expectancy calculator – a simple heuristic – without captive user interface.
The code is functionally identical to the code with captive user interface. However, it has a big advantage: now, you can use the function in different and unexpected—by the initial developer—ways:
import matplotlib.pyplot as plt def your_life_expectancy(age): '''Returns the expected remaining number of years.''' if age<85: return 72 - 0.8 * age return 22 - 0.2 * age # Plot for first 100 years
plt.plot(range(100), [your_life_expectancy(i) for i in range(100)]) # Style plot
plt.xlabel('Age')
plt.ylabel('No. Years Left')
plt.grid() # Show and save plot
plt.savefig('age_plot.jpg')
plt.savefig('age_plot.pdf')
plt.show()
Listing: Code to plot the life expectancy for years 0-99.
The resulting plot is shown in the following figure:
Figure: How the heuristic works for input years 0-99.
Let’s not talk too much about the flaws of this heuristic—it’s crude by design—but focus on how the rule of avoiding captive user interface has helped us produce this plot. Without the rule, we’d have to write a new function, add redundancies and unnecessary complexity. By considering the rule, we’ve simplified the code and opened up all kinds of future programs to use and built-upon the heuristic. Instead of optimizing for one specific use case, we’ve written the code in a general way that can be used by hundreds of different applications.
Moving Out, Drawn to Life, Alawar & Graffiti Deals
Moving Out: Begin Your Career In Furniture!
[www.indiegala.com] A ridiculous physics-based Moving Out simulator that brings new meaning to "couch co-op"!
Crypto Sale Day 5: Alawar Publisher Sale, up to -90
[www.indiegala.com] Join our Crypto Sale, and get an EXTRA 30% OFF on all bundles and 15% OFF on all store deals when paying with a supported cryptocurrency
The game is free to keep for 24 hours until Dec 20th, 2020 - 16:00 UTC. Epic is also giving everyone a $10 coupon to be used on any purchase of $15 or higher.
We are welcoming everyone to join our discord[discord.gg]. We are more active there on finding giveaways, small or large, and there are daily raffles you can participate.
Unity Technologies and Snap Inc (parent company of SnapChat) have announced a new partnership. The partnership is a two-fold endeavour, advertising and technology integration.
Starting today, Unity Ads, which reaches a highly engaged mobile gaming audience on both Android and iOS, is now included in the Snap Audience Network (SAN). Snapchat’s SAN advertiser campaigns will now include video inventory from Unity’s extensive network of mobile gaming titles, helping advertisers extend beyond Snapchat. Unity Ads1 reports 22.9B+ monthly global ad impressions, reaching 2B+ monthly active end-users worldwide. In 2020, mobile ad viewers have converted at higher frequencies, with install conversion rates up by 23%2, and mobile gamers installing 84% more apps3.
“Snapchat is all about staying connected with your closest friends, but friendships aren’t just about conversations. They are often also based on shared experiences, which today includes gaming,” said Ben Schwerin, VP of Partnership, Snap Inc. “As gaming has increasingly become a visible part of the Snapchatter journey, it’s also an area that we aim to make easier for retailers and brands to reach Unity’s action-orientated gaming community through their Snapchat campaigns.”
From the same article, we get details on the new Unity integration of Snap technologies:
Available today in the Unity Asset Store, mobile game developers can also now leverage select features of Snap Kit to enhance gameplay and the game discovery experience:
– Snap Kit’s Login Kit allows gamers to use their Snapchat account as a quick way to sign up and log in to games.
– Snap Kit’s Creative Kit extends the experience by allowing users to share their gameplay, decorating still shots or 15-second videos with branded stickers, or attaching an AR lens that has been created with game branding to share with their Snapchat friends. The shares also include referral links back to the game, amplifying discovery and user acquisition for Unity developers to Snapchat’s 249 million daily active users4.
A Bitmoji integration will also be coming in early 2021, and will add a new level of personalization to gameplay. With Bitmoji for Game’s Unity SDK, developers will be able to leverage 3D Bitmoji to create a more immersive experience in games made with Unity. They will be able to bring players’ Bitmoji avatars into the center of gameplay, enabling players to be themselves in games like never before.
The SnapKit integration is already live on the Asset Store. For game developers utilizing Unity Ads, this should be an immediate win as a large group of advertisers are now going to be able to target their ad units, hopefully leading to an increase in revenue. You can learn more about the Unity & Snap partnership in the video below.
Random: Man Accidentally Names Nephew After A Pokémon
On the notorious Reddit board, TIFU – short for Today I F***ed Up – one user has spilled the beans on the inspiration behind his newborn nephew’s cool name.
Little baby Zacian’s parents have no idea that his name is actually the name of a big dog with a sword in his mouth, it would seem, and user Bladehuraska is planning to give the new baby some Pokémon-related presents for Christmas to “reveal the truth”. Good luck with that, dude.
Bladehuraska was playing Pokémon Sword in the back of a van (you know it’s going to be a good story when it starts in the back of a van) and he’d just caught the legendary Zacian with a Quick Ball.
While they were discussing potentially unique names, I kept overhearing they wanted it to begin with the letter Z… I jokingly suggested, “Hey, Zacian is a cool name. It means sword in Japanese.” My mother and family loved it, so it’s now official.
Unfortunately for this man and his nephew, Zacian does not mean sword in Japanese. As the comments on the post point out, Zacian is just Za + cyan, just as Zamazenta, its legendary companion, is Za + magenta – you can even read director Shigeru Ohmori speaking about it in this interview with GameInformer. But the real question is, who names their baby seconds after it’s born with the first random word suggested to them?
Still, there are much stranger Pokémon to be named after, and Zacian is pretty cool as a name. Plus, it’s a legendary Pokémon, so that’s gonna give the kid some clout, right? Let us know what you think the worst Pokémon name would be to give a baby. Winner gets to name the next Nintendo Life sprog.
Watch: Nintendo Direct – Super Nintendo World Special, Live!
2020 has felt rather quiet on the Direct front, but it looks like every Nintendo fan’s favourite video format is back for one last hurrah before we roll on over to another year.
A special Direct presentation focusing on Universal Studios Japan’s Super Nintendo World theme park is about to begin. It’ll run for roughly 15 minutes and will show off just some of the park’s attractions – and no, there won’t be any game-related content featured.
It all kicks off at 3pm PT / 6pm ET / 11pm GMT / 12am CET, so get yourselves comfy, join in with the community live chat, and enjoy!
Register or log in to your account, then add the games to your Uplay library by clicking "PC". I believe the past in-game items will also be redeemed alongside the games
You only have until Dec 20th to claim the bundle, making it a 24 hour only giveaway.
We are welcoming everyone to join our discord[discord.gg]. We are more active there on finding giveaways, small or large, and there are daily raffles you can participate.
Moving Out, Drawn to Life, Alawar & Graffiti Deals
Moving Out: Begin Your Career In Furniture!
[www.indiegala.com] A ridiculous physics-based Moving Out simulator that brings new meaning to "couch co-op"!
Crypto Sale Day 5: Alawar Publisher Sale, up to -90
[www.indiegala.com] Join our Crypto Sale, and get an EXTRA 30% OFF on all bundles and 15% OFF on all store deals when paying with a supported cryptocurrency
How to make the most of Mobile Legends: Adventure’s holiday event
Tis the season to be jolly, and Moonton is making that all the easier by hosting a big Christmas event in Mobile Legends: Adventure, the idle RPG spin-off of MOBA Mobile Legends: Bang Bang. In case you haven’t heard of it, it challenges you to collect your favourite heroes from the MOBA itself, and to create a powerful battle party out of them.
You then send them out on various adventures, including a story campaign that adds greater depth to the world of Mobile Legends and its various characters. Along the way, you level up your heroes, equip them with new gear, and unlock new skills, which increases their power. That’s important, as the content quite quickly ramps up in challenge.
As you progress, the campaign soon gives way to the Tower of Babel, an endless series of increasingly difficult battles, and the Labyrinth, which plays a bit like Minesweeper but has you seeking goodies, rather than bombs. Well, there are bombs, but they’re a good thing in the Labyrinth.
If this all sounds like an awful lot of fun to you, we recommend grabbing Mobile Legends: Adventure on mobile – particularly if you already play Mobile Legends: Bang Bang, as it’s a nice companion that really fleshes out the world.
And, to help you make the most of your time spent with the festive content in Mobile Legends: Adventure, we thought we’d put together a guide that covers everything you need to know about it. From when the event takes place to how to unlock all of the goodies, here’s what’s happening right now in Mobile Legends: Adventure.
Everything you need to know about Mobile Legends: Adventure’s festive event
When does the holiday event take place?
Mobile Legends: Adventure’s holiday event is live right now, and runs right throughout the holiday period, ending on December 31.
What’s happening?
Well, the holiday season is coming to Mobile Legends: Adventure. What more do you want? Oh, to know the details. Well, here are all of the happenings in bullet point form:
Step aside, Santa – Snow Elves are bringing the gifts this year. You’ll have to catch them though, and exchange the elves themselves for rewards.
Lunox will feature in a new Goddess Blessing event, during which you have a chance to summon her and add her to your team. A big, mean Yeti is challenging you to a duel. And by duel, we mean a 5v1 battle during which snowballs are flying all over the place. Watch out!
Speaking of snowballs, there’s a Snowball Fight too. Collect snowballs and you can exchange them for those heroes you’ve always wanted.
Make sure to stay warm, though! The Christmas Hygge event will help with that, as it’s all about giving the gift of mittens to your friends, earning limited-time rewards. Who said giving was a gift in itself?
Lunox, Claude are decking themselves out in Christmas attire, while Freya and Saber will have new looks as well – you can grab all of these fresh threads from the Skin Shop.
Daily login rewards for everyone, of course! And a lovely Santa hat on your avatar. It’s the little things.
So how do I get everything?
First of all, here is everything new that you can get during the holiday event:
Holiday avatar border
Exclusive medals
Character skins
Various prizes from the Snowball Fight event prize pool
The holiday avatar border is very straightforward. You have to complete event quests to earn Christmas Boxes, which you can send to your friends. There’s a leaderboard for number of gifts sent to friends, and you need to be high up to get the avatar border.
As for the medals, here’s a breakdown of each one and how to get them:
Snowball Champion: deal 50 bars of damage to the yeti in Icy Brawl
Winter Goddess: get Lunox from the Goddess’s Blessing event
Bell of Peace: login on Christmas Day
Gentle Heart: send at least 999 Christmas Boxes during the event
Merry Christmas: get all of the other badges to unlock this special extra
Finally, in terms of the festive skins, four of them are available to purchase in the Skin Shop at 50% discount, while the rest you can earn from the prize pool in Snowball Fight. We don’t know an exact number, but there are at least 13 skins on offer to celebrate the holiday season.
And that’s it! Follow our tips and you’ll have a nice holiday season ahead of you in Mobile Legends: Adventure. If you haven’t downloaded it yet, we encourage you to do so on mobile. Merry Christmas!
Posted by: xSicKxBot - 12-19-2020, 10:59 AM - Forum: Windows
- No Replies
A breakthrough year for passwordless technology
As 2020 draws to a close, most of us are looking forward to putting this year in the rearview mirror. Since we depend even more on getting online for everything in our lives, we’re more than ready to be done with passwords. Passwords are a hassle to use, and they present security risks for users and organizations of all sizes, with an average of one in every 250 corporate accounts compromised each month. According to the Gartner Group, 20 to 50 percent of all help desk calls are for password resets. The World Economic Forum (WEF) estimates that cybercrime costs the global economy $2.9 million every minute, with roughly 80 percent of those attacks directed at passwords.
In November 2019 at Microsoft Ignite, we shared that more than 100 million people were already using Microsoft’s passwordless sign-in each month. In May of 2020, just in time for World Password Day, that number had already grown to more than 150 million people, and the use of biometrics to access work accounts is now almost double what it was then. We’ve drawn strength from our customers’ determination this year and are set to make passwordless access a reality for all our customers in 2021.
2020: A banner year for passwordless technology
February: We announced a preview of Azure Active Directory support for FIDO2 security keys in hybrid environments. The Fast Identity Online (FIDO) Alliance is a “cross-industry consortia providing standards, certifications, and market adoption programs to replace passwords with simpler, stronger authentication.” Following the latest FIDO spec, FIDO2, we enabled users with security keys to access their Hybrid Azure Active Directory (Azure AD) Windows 10 devices with seamless sign-in, providing secure access to on-premises and cloud resources using a strong hardware-backed public and private-key credential. This expansion of Microsoft’s passwordless capabilities followed 2019’s preview of FIDO2 support for Azure Active Directory joined devices and browser sign-ins.
June: I gave a keynote speech at Identiverse Virtual 2020 where I got to talk about how Microsoft’s FIDO2 implementation highlights the importance of industry standards in implementing Zero Trust security and is crucial to enabling secure ongoing remote work across industries. Nitika Gupta, Principal Program Manager of Identity Security in our team, showed how Zero Trust is more important than ever for securing data and resources and provided actionable steps that organizations can take to start their Zero Trust journey.
September: At Microsoft Ignite, the company revealed the new passwordless wizard available through the Microsoft 365 Admin Center. Delivering a streamlined user sign-in experience in Windows 10, Windows Hello for Business replaces passwords by combining strong MFA for an enrolled device with a PIN or user biometric (fingerprint or facial recognition). This approach gives you, our customers, the ability to deliver great user experiences for your employees, customers, and partners without compromising your security posture.
November:Authenticate 2020, “the first conference dedicated to who, what, why and how of user authentication,” featured my boss, Joy Chik, CVP of Identity at Microsoft, as the keynote speaker. Joy talked about how FIDO2 is a critical part of Microsoft’s passwordless vision, and the importance of the whole industry working toward great user experiences, interoperability, and having apps everywhere support passwordless authentication. November also saw Microsoft once again recognized by Gartner as a “Leader” in identity and access management (IAM).
MISA members lead the way
The Microsoft Intelligent Security Association (MISA) is an ecosystem of security partners who have integrated their solutions with Microsoft to better defend against increasingly sophisticated cyber threats. Four MISA members—YubiKey, HID Global, Trustkey, and AuthenTrend—stood out this year for their efforts in driving passwordless technology adoption across industries.
Yubico created the passwordless YubiKey hardware to help businesses achieve the highest level of security at scale.
“We’re providing users with a convenient, simple, authentication solution for Azure Active Directory.”—Derek Hanson, VP of Solutions Architecture and Alliances, Yubico
HID Global engineered the HID Crescendo family of FIDO-enabled smart cards and USB keys to streamline access for IT and physical workspaces—enabling passwordless authentication anywhere.
“Organizations can now secure access to laptops and cloud apps with the same credentials employees use to open the door to their office.”—Julian Lovelock, VP of Global Business Segment Identity and Access Management Solutions, HID
TrustKey provides FIDO2 hardware and software solutions for enterprises who want to deploy passwordless authentication with Azure Active Directory because: “Users often find innovative ways to circumvent difficult policies,” comments Andrew Jun, VP of Product Development at TrustKey, “which inadvertently creates security holes.”
AuthenTrend applied fingerprint-authentication technology to the FIDO2 security key and aspires to replace all passwords with biometrics to help people take back ownership of their credentials.
Next steps for passwordless in 2021
Our team has been working hard this year to join these partners in making passwords a thing of the past. Along with new UX and APIs for managing FIDO2 security keys enabling customers to develop custom solutions and tools, we plan to release a converged registration portal in 2021, where all users can seamlessly manage passwordless credentials via the My Apps portal.
We’re excited about the metrics we tracked in 2020, which show a growing acceptance of passwordless among organizations and users:
Passwordless usage in Azure Active Directory is up by more than 50 percent for Windows Hello for Business, passwordless phone sign-in with Microsoft Authenticator, and FIDO2 security keys.
More than 150 million total passwordless users across Azure Active Directory and Microsoft consumer accounts.
The number of consumers using Windows Hello to sign in to Windows 10 devices instead of a password grew to 84.7 percent from 69.4 percent in 2019.
We’re all hoping the coming year will bring a return to normal and that passwordless access will at least make our online lives a little easier.
Learn more about Microsoft’s passwordless story. To learn more about Microsoft Security solutions, visit our website. Bookmark the Security blog to keep up with our expert coverage on security matters. Also, follow us at @MSFTSecurity for the latest news and updates on cybersecurity.