Facebook is moving to Microsoft's Visual Studio Code for internal development

facebook-visual-studio

Facebook is adopting Visual Studio Code for all of its software engineers, and is currently in the process of finishing the migration from its mix of Nuclide and Emacs for internal development. As part of the partnership with Microsoft, the company will also help improve remote development extensions, which is ultimately going to benefit many more developers around the world.

Amazon’s own Echo Buds may have revealed a future fitness tracking feature

amazon-echo-buds

Amazon’s truly wireless Echo Buds earbuds are excellent for their $130 price, to the point that they were the elephant in the room when we reviewed Apple’s new AirPods Pro. And they managed that resounding feat without one of their biggest rumored features — the ability to double as a fitness tracker and measure the calories you’ve burned.

But don’t rule out fitness tracking just yet, because CNBC and The Verge both spotted a new “Fitness” tab in the Echo Buds section of the Alexa app today. You can see a few screenshots from our app below:

While we’re waiting on an Amazon spokeperson to confirm whether we should actually be excited for more functionality — or if this just a vestigial component of an earlier test — CNBC’s Todd Haselton says he managed to successfully start a few workouts, ones where the Echo Buds appeared to be tracking his steps.

You can find Echo Buds on Amazon.

image

Apple is quietly working on the perfect iPhone

iPhone-perfect1

iPhone owners know that Apple only refreshes the handset’s design every once in a while, usually when it has something significant to say, design-wise.

But, if you’ve been following the iPhone from the start, you probably realized that all the changes Apple made to the iPhone over the years, from the first model all the way to the iPhone X, are baby steps that Apple has been taking towards delivering the perfect iPhone design.

The iPhone X is the latest major design refresh, of course, which Apple used for the iPhone XS and iPhone 11. Come next year, we’re going to get a brand new design, one that’s said to be inspired by the iPhone 4, and a design that should get us even closer to the perfect all-screen iPhone. And Apple is quietly working on bringing that ideal design to life, a new discovery shows.

The iPhone X is a design compromise that Apple had to make and then stick to. The phone features the best screen-to-body ratio Apple could come up with without sacrificing the front-facing camera experience in any way, and without ditching the sophisticated 3D face recognition system that is Face ID.

Apple’s rivals made similar compromises, including hole-punch displays, slide-up cameras, and rear-facing secondary screens. But all of these companies, Apple included, are working on technologies that will let them create true all-screen phones.

iPhone-perfect2

These devices will feature sensors and cameras under the display, and have no physical buttons. Oppo has already demoed an under-display camera, and Huawei launched a phone with a waterfall display.

Apple usually doesn’t announce tech advances that aren’t ready for the market, with the AirPower wireless charger being a rare exception. But the company’s various patents do reveal clues as to what types of innovations it’s working on.

A well-known patent describing an iPhone with a wraparound display was published all the way back in 2013, prompting speculation at the time, and in the years that followed, that Apple would make such a phone

Xamarin build error: defining a default interface method requires --min-sdk-version >= 24

I added to my project Xam.Plugins.Android.ExoPlayer and then I received this error:

java/lang/Object;I)V: defining a default interface method requires --min-sdk-version >= 24 (currently 13) for interface methods: com.google.android.exoplayer2.Player$EventListener.onTimelineChanged : (Lcom/google/android/exoplayer2/Timeline;Ljava/lang/Object;I)V

Looking around, I discovered that other people had the same issue and the problem sits in the Android Options in Project Properties. No Dex compiler was specified, select D8 Dex compiler in the Android project properties:

android-project-options

In code:

<AndroidDexTool>d8</AndroidDexTool>

Happy coding!

Using an in-memory repository. Keys will not be persisted to storage. – ASP.NET Core under IIS

.NET Core Data Protection

One of the main benefits of building a new .NET project using .NET Core is cross platform deployment, however, IIS will still be a common home for ASP.NET Core web applications.

In .netcore 2.0 MVC applications, a transparent feature that is configured during app Startup is Data Protection. Data Protection provides a cryptographic foundation for things like ASP.NET Identity among many others.

When the Data Protection system is initialized, it applies default settings based on the operational environment. These settings are generally appropriate for apps running on a single machine.  – Rick Anderson

The app attempts to detect its operational environment and handle key configuration on its own. (cite)

Default Configuration Logic

  • 1) If the app is hosted in Azure Apps, keys are persisted to the %HOME%\ASP.NET\DataProtection-Keys folder. This folder is backed by network storage and is synchronized across all machines hosting the app.
    • Keys aren’t protected at rest.
    • The DataProtection-Keys folder supplies the key ring to all instances of an app in a single deployment slot.
    • Separate deployment slots, such as Staging and Production, don’t share a key ring. When you swap between deployment slots, for example swapping Staging to Production or using A/B testing, any app using Data Protection won’t be able to decrypt stored data using the key ring inside the previous slot. This leads to users being logged out of an app that uses the standard ASP.NET Core cookie authentication, as it uses Data Protection to protect its cookies. If you desire slot-independent key rings, use an external key ring provider, such as Azure Blob Storage, Azure Key Vault, a SQL store, or Redis cache.
  • 2) If the user profile is available, keys are persisted to the %LOCALAPPDATA%\ASP.NET\DataProtection-Keys folder. If the operating system is Windows, the keys are encrypted at rest using DPAPI.
  • 3) If the app is hosted in IIS, keys are persisted to the HKLM registry in a special registry key that is ACLed only to the worker process account. Keys are encrypted at rest using DPAPI.
  • 4) If none of these conditions match, keys aren’t persisted outside of the current process. When the process shuts down, all generated keys are lost.

For IIS, the item we’re interested in here is #3. The default configuration will store the keys in the system registry, that way the keys persist between AppPool restarts and machine restarts. It also lets you share the same key between applications if necessary (via a configuration addition to Startup.cs).

The Problem

Once you deploy your app and run it under an IIS App Pool, you may find that the Data Protection keys are not being persisted. If you have error logging you’ll see entries like this:

  • No XML encryptor configured. Key may be persisted to storage in unencrypted form.
  • Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
  • Using an in-memory repository. Keys will not be persisted to storage.

aspnetcore_dataprotection

This means that each time your app pool restarts, new keys will be generated and any encrypted codes or values which have been stored or transmitted will no longer be usable. A basic example of this is a Forgotten Password request using ASP.NET Core Identity. If you request a password reset email, an encrypted URL will be sent in the email for you to click on. If the app pool restarts before you get around to clicking that link, the token will not be able to be decrypted and the reset will fail. This scenario becomes much worse if you’re storing long term encrypted data for later decryption.

The Solution

This issue stems from a bug in IIS itself which may or may not ever be corrected. In order to work around the issue, it’s necessary for you to edit your App Pool to enable User Profile Loading. Once you set your App Pool to load the user profile for the application pool identity, the application will have permission to read and write to the system registry as intended.

iis_advanced_settings_aspnetcore_dataprotection

Alternatively, you can configure Data Protection to use a different method of key storage, like a UNC share.

PersistKeysToFileSystem

To store keys on a UNC share instead of at the %LOCALAPPDATA% default location, configure the system with PersistKeysToFileSystem:

C#Copy

public void ConfigureServices(IServiceCollection services)
{
    services.AddDataProtection()
        .PersistKeysToFileSystem(new DirectoryInfo(@"\\server\share\directory\"));
}

Accessing the OIDC tokens in ASP.NET Core 2.0

In ASP.NET Core 1.1

So for example, in ASP.NET Core 1.x, if you wanted to access the tokens (id_token, access_token and refresh_token) from your application, you could set the SaveTokens property when registering the OIDC middleware:

// Inside your Configure method
app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions("Auth0")
{
    // Set all your OIDC options...

    // and then set SaveTokens to save tokens to the AuthenticationProperties
    SaveTokens = true
});
You would then subsequently be able to retrieve those tokens by calling GetAuthenticateInfoAsync inside your controllers, and using the result to retreive the tokens, for example:
// Inside on of your controllers
if (User.Identity.IsAuthenticated)
{
    var authenticateInfo = await HttpContext.Authentication.GetAuthenticateInfoAsync("Auth0");
    string accessToken = authenticateInfo.Properties.Items[".Token.access_token"];
    string idToken = authenticateInfo.Properties.Items[".Token.id_token"];
}


In ASP.NET Core 2.0

In ASP.NET Core 2.0 this has changed. Firstly, you now register your OIDC middleware inside ConfigureServices as follows (making sure to set SaveTokens to true):

// Inside your ConfigureServices method
services.AddAuthentication(options => {
    options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
    options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
    options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
})
.AddCookie()
.AddOpenIdConnect(options => {
    // Set all your OIDC options...

    // and then set SaveTokens to save tokens to the AuthenticationProperties
    options.SaveTokens = true;
});

You would then subsequently be able to retrieve those tokens by calling GetTokenAsync for each of the tokens you want to access. The code sample below shows how to access the access_token and the id_token:

// Inside on of your controllers
if (User.Identity.IsAuthenticated)
{
    string accessToken = await HttpContext.GetTokenAsync("access_token");
    string idToken = await HttpContext.GetTokenAsync("id_token");

    // Now you can use them. For more info on when and how to use the 
    // access_token and id_token, see https://auth0.com/docs/tokens
}

Happy coding!

First example with ReactJs

ReactJs time!

To start with my first example in ReactJs, I'm using Codepen. Create a new pen. In Settings, under JavaScript select Babel as JavaScript Preprocessor. Then in Add External Scripts/Pens search for React. Add react and react-dom.

ReactJs-First-PenSettings

See the Pen React Starter by Enrico (@erossini) on CodePen.

Creating pop-up footnotes in EPUB 3

showme-footnotes-lg

In EPUB 3 Flowing and Fixed Layout books, you can create pop-up footnotes by labeling footnotes with the appropriate epub:type values. You use two elements to create a pop-up footnote: an anchor (<a>) element that triggers the popup and the <aside> element that contains the footnote text. Both elements have an epub:type attribute to identify their purpose: epub:type="noteref" to trigger the popup and epub:type="footnote" to indicate the footnote’s text.

In the example below, the anchor element (<a>) has two attributes: epub:type="noteref" and a link that references the location of the element that contains the popup's text.

The <aside> element that contains the popup's text also has two attributes:

  • id="myNote" that matches the value of the href attribute in the link that references it

  • epub:type="footnote"

Because the <aside> element has an epub:type of footnote, the text is hidden in the main body of the book. The text will only be seen by the reader in the context of the popup.

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<body>
  <p>
    <a href="chapter.xhtml#myNote" epub:type="noteref">1
  </p>
  <aside id="myNote" epub:type="footnote">Text in popup</aside>
</body>
</html>

Example

Footnote and reference

<p>lorum ipsum.<a epub:type="noteref" href="#fn01">1</a></p>
<aside epub:type="footnote">
   My footnote
</aside>

Endnote and reference

<p>lorum ipsum.<a epub:type="noteref" href="#en01">1</a></p>
<aside epub:type="endnote">
   My endnote
</aside>

Endnotes section

<section epub:type="endnotes">
   <h1>Endnotes</h1>
   
   <section>
     <h2>Chapter 1</h2>
     <aside epub:type="endnote">
       My endnote
     </aside>
   </section>
</section>

Google has been tracking nearly everything you buy online

google-purchase-history

Google has been quietly keeping track of nearly every single online purchase you’ve ever made, thanks to purchase receipts sent to your personal Gmail account, according to a new report today from CNBC. Even stranger: this information is made available to you via a private web tool that’s been active for an indeterminate amount of time. You can go view it here.

According to CNBC, the company says it does not use this information for personalized ad tracking; Google said back in 2017 that it would stop using data collected from Gmail messages to personalize ads. You can also delete the information from the Purchases webpage, but you must do so individually for each recorded transaction.

Google, like Facebook, knows an immense amount of information about you, your personal habits, and, yes, what you buy on the internet. And like the social network it dominates the online advertising industry alongside, Google gets this information mostly through background data collection using methods and tools its users may not be fully aware of, like Gmail purchase receipts. This is true of web tools like Gmail and smart assistants, which are increasingly coming under scrutiny for the ways the data that software collects is observed by human employees during the artificial intelligence training process.

Microsoft brings PowerToys back to let anyone improve Windows 10 for power users

windows10_power_toys

Microsoft first introduced the concept of “PowerToys” in Windows 95. It was originally a way for Windows engineers to test a prototype feature, and Microsoft packaged some of the best ones into a PowerToys bundle. These PowerToys included popular utilities like Tweak UI to customize the Windows user interface, Quick Res to quickly change screen resolutions, and Send To X that let you send files and folders to the command line, clipboard, or desktop.

PowerToys disappeared after Windows XP, during a time when co-founder Bill Gates ordered a security review of everything that was going into Windows. These useful utilities are now being revived by Microsoft in a new effort to focus on what power users need in Windows 10. The software giant is open-sourcing PowerToys on GitHub, so anyone can contribute and create power user tools for Windows 10.

MTNDWidget

The first two utilities that Microsoft is working on for Windows 10 are a new maximize to desktop widget and a Windows key shortcut guide. The maximize to desktop widget places a pop-up button over the maximize button when you hover over it. It’s designed to let you quickly send an app to another desktop, utilizing Windows 10’s multi-desktop view. The Windows shortcut guide utility simply shows a keyboard shortcut guide when you hold down the Windows key.

Microsoft is also considering 10 other utilities for these new PowerToys for Windows 10:

  1. Full window manager, including specific layouts for docking and undocking laptops
  2. Keyboard shortcut manager
  3. Win+R replacement
  4. Better alt+tab including browser tab integration and search for running apps
  5. Battery tracker
  6. Batch file re-namer
  7. Quick resolution swaps in task bar
  8. Mouse events without focus
  9. Cmd (or PS or Bash) from here
  10. Contents menu file browsing

Microsoft is looking for feedback and contributions over on GitHub, much like how the company recently open-sourced its Windows calculator for additional input and ideas. That effort resulted in a graphing mode being added to the Windows calculator. Microsoft is now planning to preview these PowerToys utilities in the summer, alongside the corresponding source code being published on GitHub.

Advertsing

125X125_06

Planet Xamarin

Planet Xamarin




TagCloud

MonthList