> All in One 586: November 2019

Ads

Saturday, November 30, 2019

Clear/Wind today!



With a high of F and a low of 18F. Currently, it's 26F and Clear/Wind outside.

Current wind speeds: 26 from the Northwest

Pollen: 0

Sunrise: November 30, 2019 at 07:51PM

Sunset: December 1, 2019 at 05:29AM

UV index: 0

Humidity: 62%

via https://ift.tt/2livfew

December 1, 2019 at 10:00AM

Friday, November 29, 2019

Partly Cloudy/Wind today!



With a high of F and a low of 27F. Currently, it's 38F and Partly Cloudy/Wind outside.

Current wind speeds: 23 from the South

Pollen: 0

Sunrise: November 29, 2019 at 07:50PM

Sunset: November 30, 2019 at 05:29AM

UV index: 0

Humidity: 72%

via https://ift.tt/2livfew

November 30, 2019 at 10:00AM

Group Chat Rules

There's no group chat member more enigmatic than the cool person who you all assume has the chat on mute, but who then instantly chimes in with no delay the moment something relevant to them is mentioned.

from xkcd.com https://xkcd.com/2235/
via IFTTT

Simplified Fluid Typography

Fluid typography is the idea that font-size (and perhaps other attributes of type, like line-height) change depending on the screen size (or perhaps container queries if we had them).

The core trickery comes from viewport units. You can literally set type in viewport units (e.g. font-size: 4vw), but the fluctuations in size are so extreme that it's usually undesirable. That's tampered by doing something like font-size: calc(16px + 1vw). But while we're getting fancy with calculations anyway, the most common implementation ended up being an equation to calculate plain English:

I want the type to go between being 16px on a 320px screen to 22px on a 1000px screen.

Which ended up like this:

html {
  font-size: 16px;
}
@media screen and (min-width: 320px) {
  html {
    font-size: calc(16px + 6 * ((100vw - 320px) / 680));
  }
}
@media screen and (min-width: 1000px) {
  html {
    font-size: 22px;
  }
} 

That's essentially setting a minimum and maximum font size so the type won't shrink or grow to anything too extreme. "CSS locks" was a term coined by Tim Brown.

Minimum and maximum you say?! Well it so happens that functions for these have made their way into the CSS spec in the form of min() and max().

So we can simplify our fancy setup above with a one-liner and maintain the locks:

html {
  font-size: min(max(16px, 4vw), 22px);
}

We actually might want to stop there because even though both Safari (11.1+) and Chrome (79+) support this at the current moment, that's as wide as support will get today. Speaking of which, you'd probably want to slip a font-size declaration before this to set an acceptable fallback value with no fancy functions.

But as long as we're pushing the limits, there is another function to simplify things even more: clamp()! Clamp takes three values, a min, max, and a flexible unit (or calculation or whatever) in the middle that it will use in case the value is between the min and max. So, our one-liner gets even smaller:

body {
  font-size: clamp(16px, 4vw, 22px);
} 

That'll be Chrome 79+ (which doesn't hasn't even dropped to stable but will very soon).

Uncle Dave is very happy that FitText is now a few bytes instead of all-of-jQuery plus 40 more lines. Here is us chucking CSS custom properties at it:

See the Pen
FitText in CSS with clamp()
by Dave Rupert (@davatron5000)
on CodePen.

The post Simplified Fluid Typography appeared first on CSS-Tricks.



from CSS-Tricks https://ift.tt/33u5O9B
via IFTTT

Testing React Hooks With Enzyme and React Testing Library

As you begin to make use of React hooks in your applications, you’ll want to be certain the code you write is nothing short of solid. There’s nothing like shipping buggy code. One way to be certain your code is bug-free is to write tests. And testing React hooks is not much different from how React applications are tested in general.

In this tutorial, we will look at how to do that by making use of a to-do application built with hooks. We’ll cover writing of tests using Ezyme and React Testing Library, both of which are able to do just that. If you’re new to Enzyme, we actually posted about it a little while back showing how it can be used with Jest in React applications. It’s not a bad idea to check that as we dig into testing React hooks.

Here’s what we want to test

A pretty standard to-do component looks something like this:

import React, { useState, useRef } from "react";
const Todo = () => {
  const [todos, setTodos] = useState([
    { id: 1, item: "Fix bugs" },
    { id: 2, item: "Take out the trash" }
  ]);
  const todoRef = useRef();
  const removeTodo = id => {
    setTodos(todos.filter(todo => todo.id !== id));
  };
  const addTodo = data => {
    let id = todos.length + 1;
    setTodos([
      ...todos,
      {
        id,
        item: data
      }
    ]);
  };
  const handleNewTodo = e => {
    e.preventDefault();
    const item = todoRef.current;
    addTodo(item.value);
    item.value = "";
  };
  return (
    <div className="container">
      <div className="row">
        <div className="col-md-6">
          <h2>Add Todo</h2>
        </div>
      </div>
      <form>
        <div className="row">
          <div className="col-md-6">
            <input
              type="text"
              autoFocus
              ref={todoRef}
              placeholder="Enter a task"
              className="form-control"
              data-testid="input"
            />
          </div>
        </div>
        <div className="row">
          <div className="col-md-6">
            <button
              type="submit"
              onClick={handleNewTodo}
              className="btn btn-primary"
            >
              Add Task
            </button>
          </div>
        </div>
      </form>
      <div className="row todo-list">
        <div className="col-md-6">
          <h3>Lists</h3>
          {!todos.length ? (
            <div className="no-task">No task!</div>
          ) : (
            <ul data-testid="todos">
              {todos.map(todo => {
                return (
                  <li key={todo.id}>
                    <div>
                      <span>{todo.item}</span>
                      <button
                        className="btn btn-danger"
                        data-testid="delete-button"
                        onClick={() => removeTodo(todo.id)}
                      >
                        X
                      </button>
                    </div>
                  </li>
                );
              })}
            </ul>
          )}
        </div>
      </div>
    </div>
  );
};
export default Todo; 

Testing with Enzyme

We need to install the packages before we can start testing. Time to fire up the terminal!

npm install --save-dev enzyme enzyme-adapter-16 

Inside the src directory, create a file called setupTests.js. This is what we’ll use to configure Enzyme’s adapter.

import Enzyme from "enzyme";
import Adapter from "enzyme-adapter-react-16";
Enzyme.configure({ adapter: new Adapter() }); 

Now we can start writing our tests! We want to test four things:

  1. That the component renders
  2. That the initial to-dos get displayed when it renders
  3. That we can create a new to-do and get back three others
  4. That we can delete one of the initial to-dos and have only one to-do left

In your src directory, create a folder called __tests__ and create the file where you’ll write your Todo component’s tests in it. Let’s call that file Todo.test.js.

With that done, we can import the packages we need and create a describe block where we’ll fill in our tests.

import React from "react";
import { shallow, mount } from "enzyme";
import Todo from "../Todo";

describe("Todo", () => {
  // Tests will go here using `it` blocks
});

Test 1: The component renders

For this, we’ll make use of shallow render. Shallow rendering allows us to check if the render method of the component gets called — that’s what we want to confirm here because that’s the proof we need that the component renders.

it("renders", () => {
  shallow(<Todo />);
});

Test 2: Initial to-dos get displayed

Here is where we’ll make use of the mount method, which allows us to go deeper than what shallow gives us. That way, we can check the length of the to-do items.

it("displays initial to-dos", () => {
  const wrapper = mount(<Todo />);
  expect(wrapper.find("li")).toHaveLength(2);
});

Test 3: We can create a new to-do and get back three others

Let’s think about the process involved in creating a new to-do:

  1. The user enters a value into the input field.
  2. The user clicks the submit button.
  3. We get a total of three to-do items, where the third is the newly created one.
it("adds a new item", () => {
  const wrapper = mount(<Todo />);
  wrapper.find("input").instance().value = "Fix failing test";
  expect(wrapper.find("input").instance().value).toEqual("Fix failing test");
  wrapper.find('[type="submit"]').simulate("click");
  expect(wrapper.find("li")).toHaveLength(3);
  expect(
    wrapper
      .find("li div span")
      .last()
      .text()
  ).toEqual("Fix failing test");
});

We mount the component then we make use of find() and instance() methods to set the value of the input field. We assert that the value of the input field is set to “Fix failing test” before going further to simulate a click event, which should add the new item to the to-do list.

We finally assert that we have three items on the list and that the third item is equal to the one we created.

Test 4: We can delete one of the initial to-dos and have only one to-do left

it("removes an item", () => {
  const wrapper = mount(<Todo />);
  wrapper
    .find("li button")
    .first()
    .simulate("click");
  expect(wrapper.find("li")).toHaveLength(1);
  expect(wrapper.find("li span").map(item => item.text())).toEqual([
    "Take out the trash"
  ]);
});

In this scenario, we return the to-do with a simulated click event on the first item. It’s expected that this will call the removeTodo() method, which should delete the item that was clicked. Then we’re checking the numbers of items we have, and the value of the one that gets returned.

The source code for these four tests are here on GitHub for you to check out.

Testing With react-testing-library

We’ll write three tests for this:

  1. That the initial to-do renders
  2. That we can add a new to-do
  3. That we can delete a to-do

Let’s start by installing the packages we need:

npm install --save-dev @testing-library/jest-dom @testing-library/react

Next, we can import the packages and files:

import React from "react";
import { render, fireEvent } from "@testing-library/react";
import Todo from "../Todo";
import "@testing-library/jest-dom/extend-expect";

test("Todo", () => {
  // Tests go here
}

Test 1: The initial to-do renders

We’ll write our tests in a test block. The first test will look like this:

it("displays initial to-dos", () => {
  const { getByTestId } = render(<Todo />);
  const todos = getByTestId("todos");
  expect(todos.children.length).toBe(2);
});

What’s happening here? We’re making use of getTestId to return the node of the element where data-testid matches the one that was passed to the method. That’s the <ul> element in this case. Then, we’re checking that it has a total of two children (each child being a <li> element inside the unordered list). This will pass as the initial to-do is equal to two.

Test 2: We can add a new to-do

We’re also making use of getTestById here to return the node that matches the argument we’re passing in.

it("adds a new to-do", () => {
  const { getByTestId, getByText } = render(<Todo />);
  const input = getByTestId("input");
  const todos = getByTestId("todos");
  input.value = "Fix failing tests";
  fireEvent.click(getByText("Add Task"));
  expect(todos.children.length).toBe(3);
});

We use getByTestId to return the input field and the ul element like we did before. To simulate a click event that adds a new to-do item, we’re using fireEvent.click() and passing in the getByText() method, which returns the node whose text matches the argument we passed. From there, we can then check to see the length of the to-dos by checking the length of the children array.

Test 3: We can delete a to-do

This will look a little like what we did a little earlier:

it("deletes a to-do", () => {
  const { getAllByTestId, getByTestId } = render(<Todo />);
  const todos = getByTestId("todos");
  const deleteButton = getAllByTestId("delete-button");
  const first = deleteButton[0];
  fireEvent.click(first);
  expect(todos.children.length).toBe(1);
});

We’re making use of getAllByTestId to return the nodes of the delete button. Since we only want to delete one item, we fire a click event on the first item in the collection, which should delete the first to-do. This should then make the length of todos children equal to one.

These tests are also available on GitHub.

Linting

There are two lint rules to abide by when working with hooks:

Rule 1: Call hooks at the top level

...as opposed to inside conditionals, loops or nested functions.

// Don't do this!
if (Math.random() > 0.5) {
  const [invalid, updateInvalid] = useState(false);
}

This goes against the first rule. According to the official documentation, React depends on the order in which hooks are called to associate state and the corresponding useState call. This code breaks the order as the hook will only be called if the conditions are true.

This also applies to useEffect and other hooks. Check out the documentation for more details.

Rule 2: Call hooks from React functional components

Hooks are meant to be used in React functional components — not in React’s class component or a JavaScript function.

We’ve basically covered what not to do when it comes to linting. We can avoid these missteps with an npm package that specifically enforces these rules.

npm install eslint-plugin-react-hooks --save-dev

Here’s what we add to the package’s configuration file to make it do its thing:

{
  "plugins": [
    // ...
    "react-hooks"
  ],
  "rules": {
    // ...
    "react-hooks/rules-of-hooks": "error",
    "react-hooks/exhaustive-deps": "warn"
  }
}

If you are making use of Create React App, then you should know that the package supports the lint plugin out of the box as of v3.0.0.

Go forth and write solid React code!

React hooks are equally prone to error as anything else in your application and you’re gonna want to ensure that you use them well. As we just saw, there’s a couple of ways we can go about it. Whether you use Enzyme or You can either make use of enzyme or React Testing Library to write tests is totally up to you. Either way, try making use of linting as you go, and no doubt, you’ll be glad you did.

The post Testing React Hooks With Enzyme and React Testing Library appeared first on CSS-Tricks.



from CSS-Tricks https://ift.tt/35I7Swr
via IFTTT

Thursday, November 28, 2019

Mostly Cloudy today!



With a high of F and a low of 26F. Currently, it's 28F and Mostly Cloudy outside.

Current wind speeds: 14 from the South

Pollen: 0

Sunrise: November 28, 2019 at 07:49PM

Sunset: November 29, 2019 at 05:30AM

UV index: 0

Humidity: 95%

via https://ift.tt/2livfew

November 29, 2019 at 10:00AM

Web Scraping Made Simple With Zenscrape

Web scraping has always been taken care of by actual developers, since a lot of coding, proxy management and CAPTCHA-solving is involved. However, the scraped data is very often needed by people that are non-coders: Marketers, Analysts, Business Developers etc.

Zenscrape is an easy-to-use web scraping tool that allows people to scrape websites without having to code.

Let’s run through a quick example together:

Select the data you need

The setup wizard guides you through the process of setting up your data extractor. It allows you to select the information you want to scrape visually. Click on the desired piece of content and specify what type of element you have. Depending on the package you have bought (they also offer a free plan), you can select up to 30 data elements per page.

The scraper is also capable of handling element lists.

Schedule your extractor

Perhaps, you want to scrape the selected data at a specific time interval. Depending on your plan, you can choose any time span between one minute to one hour. Also, decide what is supposed to happen with the scraped data after it has been gathered.

Use your data

In this example, we have chosen the .csv-export method and have selected a 10 minute scraping interval. Our first set of data should be ready by now. Let’s take a look:

Success! Our data is ready for us to be downloaded. We can now access all individual data sets or download all previously gathered data at once, in one file.

Need more flexibility?

Zenscrape also offers a web scraping API that returns the HTML markup of any website. This is especially useful for complicated scraping projects, that require the scraped content to be integrated into a software application for further processing.

Just like the web scraping suite, the API does not forward failed requests and takes care of proxy management, Capotcha-solving and all other maintenance tasks that are usually involved with DIY web scrapers.

Since the API returns the full HTML markup of the related website, you have full flexibility in terms of data selection and further processing.

Try Zenscrape

The post Web Scraping Made Simple With Zenscrape appeared first on CSS-Tricks.



from CSS-Tricks https://ift.tt/2XU1sYk
via IFTTT

Wednesday, November 27, 2019

Cloudy/Wind today!



With a high of F and a low of 21F. Currently, it's 24F and Partly Cloudy outside.

Current wind speeds: 19 from the Southeast

Pollen: 0

Sunrise: November 27, 2019 at 07:48PM

Sunset: November 28, 2019 at 05:30AM

UV index: 0

Humidity: 75%

via https://ift.tt/2livfew

November 28, 2019 at 10:00AM

How To Deliver Christmas Presents

Building codes in hurricane zones rely on studies of how easily flying debris can break residential windows. If you're looking for a science fair project idea and you hate your neighbors, I'm sure they could always use more data!

from xkcd.com https://xkcd.com/2234/
via IFTTT

Alexa is about to be very disappointed

A general lack of judgement has always been one of the strongest appeals of smart assistants. Whatever bad pop song or terrible online video you play for the 10,000th time — they don’t care. They’re simply there to help, judgement free.

Amazon, however, has been working on some features behind the scenes to help make Alexa more lifelike. Those involve bringing more emotional resonance to the smart assistant — namely the ability to make it voice sound varying levels of excited and disappointed.

“Alexa emotions” feature three levels of intensity. For the full effect, here’s “I just listened to the Smiths and then Googled what Morrissey has been up to lately” mode:

We all get down around the holidays, Alexa. Are you sure there’s nothing you want to talk about here? Amazon says users are feeling the newly empathetic assistant. “ Early customer feedback indicates that overall satisfaction with the voice experience increased by 30% when Alexa responded with emotions,” it writes in a post.

The feature is available to developers starting today, primarily focused on gaming skills. That means they’ll probably start rolling out to applications in the near future. No word on whether it’s possible to set those flash news briefings to perpetual disappointment.

The company is also rolling out a content-tailored delivery, design to give Alexa a style more akin to a news anchor or radio host.



from Amazon – TechCrunch https://ift.tt/2Dn04nO
via IFTTT

The Power (and Fun) of Scope with CSS Custom Properties

You’re probably already at least a little familiar with CSS variables. If not, here’s a two-second overview: they are really called custom properties, you set them in declaration blocks like --size: 1em and use them as values like font-size: var(--size);, they differ from preprocessor variables (e.g. they cascade), and here’s a guide with way more information.

But are we using them to their full potential? Do we fall into old habits and overlook opportunities where variables could significantly reduce the amount of code we write?

This article was prompted by a recent tweet I made about using CSS variables to create dynamic animation behavior.

Let’s look at a couple of instances where CSS variables can be used to do some pretty cool things that we may not have considered.

Basic scoping wins

The simplest and likely most common example would be scoped colors. And what’s our favorite component to use with color? The button. 😅

Consider the standard setup of primary and secondary buttons. Let’s start with some basic markup that uses a BEM syntax.

<button class="button button--primary">Primary</button>
<button class="button button--secondary">Secondary</button>

Traditionally, we might do something like this to style them up:

.button {
  padding: 1rem 1.25rem;
  color: #fff;
  font-weight: bold;
  font-size: 1.25rem;
  margin: 4px;
  transition: background 0.1s ease;
}

.button--primary {
  background: hsl(233, 100%, 50%);
  outline-color: hsl(233, 100%, 80%);
}

.button--primary:hover {
  background: hsl(233, 100%, 40%);
}

.button--primary:active {
  background: hsl(233, 100%, 30%);
}

.button--secondary {
  background: hsl(200, 100%, 50%);
  outline-color: hsl(200, 100%, 80%);
}

.button--secondary:hover {
  background: hsl(200, 100%, 40%);
}

.button--secondary:active {
  background: hsl(200, 100%, 30%);
}

See the Pen
Basic buttons
by Jhey (@jh3y)
on CodePen.

That’s an awful lot of code for something not particularly complex. We haven’t added many styles and we’ve added a lot of rules to cater to the button’s different states and colors. We could significantly reduce the code with a scoped variable.

In our example, the only differing value between the two button variants is the hue. Let’s refactor that code a little then. We won’t change the markup but cleaning up the styles a little, we get this:

.button {
  padding: 1rem 1.25rem;
  color: #fff;
  font-weight: bold;
  font-size: 1.25rem;
  margin: 1rem;
  transition: background 0.1s ease;
  background: hsl(var(--hue), 100%, 50%);
  outline-color: hsl(var(--hue), 100%, 80%);

}
.button:hover {
  background: hsl(var(--hue), 100%, 40%);
}

.button:active {
  background: hsl(var(--hue), 100%, 30%);
}

.button--primary {
  --hue: 233;
}

.button--secondary {
  --hue: 200;
}

See the Pen
Refactoring styles with a scoped variable
by Jhey (@jh3y)
on CodePen.

This not only reduces the code but makes maintenance so much easier. Change the core button styles in one place and it will update all the variants! 🙌

I’d likely leave it there to make it easier for devs wanting to use those buttons. But, we could take it further. We could inline the variable on the actual element and remove the class declarations completely. 😲

<button class="button" style="--hue: 233;">Primary</button>
<button class="button" style="--hue: 200;">Secondary</button>

Now we don’t need these. 👍

.button--primary {
  --hue: 233;
}

.button--secondary {
  --hue: 200;
}

See the Pen
Scoping w/ inline CSS variables
by Jhey (@jh3y)
on CodePen.

Inlining those variables might not be best for your next design system or app but it does open up opportunities. Like, for example, if we had a button instance where we needed to override the color.

button.button.button--primary(style=`--hue: 20;`) Overridden

See the Pen
Overridden with inline scope
by Jhey (@jh3y)
on CodePen.

Having fun with inline variables

Another opportunity is to have a little fun with it. This is a technique I use for many of the Pens I create over on CodePen. 😉

You may be writing straightforward HTML, but in many cases, you may be using a framework, like React or a preprocessor like Pug, to write your markup. These solutions allow you to leverage JavaScript to create random inline variables. For the following examples, I’ll be using Pug. Pug is an indentation-based HTML templating engine. If you aren’t familiar with Pug, do not fear! I’ll try to keep the markup simple.

Let’s start by randomizing the hue for our buttons:

button.button(style=`--hue: ${Math.random() * 360}`) First

With Pug, we can use ES6 template literals to inline randomized CSS variables. 💪

See the Pen
Random inline CSS variable hues
by Jhey (@jh3y)
on CodePen.

Animation alterations

So, now that we have the opportunity to define random characteristics for an element, what else could we do? Well, one overlooked opportunity is animation. True, we can’t animate the variable itself, like this:

@keyframes grow {
  from { --scale: 1; }
  to   { --scale: 2; }
}

But we can create dynamic animations based on scoped variables. We can change the behavior of animation on the fly! 🤩

Example 1: The excited button

Let’s create a button that floats along minding its own business and then gets excited when we hover over it.

Start with the markup:

button.button(style=`--hue: ${Math.random() * 360}`) Show me attention

A simple floating animation may look like this:

@keyframes flow {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(0, -25%);
  }
}

This will give us something like this:

See the Pen
The excited button foundation
by Jhey (@jh3y)
on CodePen.

I’ve added a little shadow as an extra but it’s not vital. 👍

Let’s make it so that our button gets excited when we hover over it. Now, we could simply change the animation being used to something like this:

.button:hover {
  animation: shake .1s infinite ease-in-out;
}

@keyframes shake {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-1%, 3%) rotate(-2deg);
  }
  50% {
    transform: translate(1%, 2%) rotate(2deg);
  }
  75% {
    transform: translate(1%, -2%) rotate(-1deg);
  }
}

And it works:

See the Pen
The excited button gets another keyframes definition
by Jhey (@jh3y)
on CodePen.

But, we need to introduce another keyframes definition. What if we could merge the two animations into one? They aren’t too far off from each other in terms of structure.

We could try:

@keyframes flow-and-shake {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25%, 75% {
    transform: translate(0, -12.5%) rotate(0deg);
  }
  50% {
    transform: translate(0, -25%) rotate(0deg);
  }
}

Although this works, we end up with an animation that isn’t quite as smooth because of the translation steps. So what else could we do? Let’s find a compromise by removing the steps at 25% and 75%.

@keyframes flow-and-shake {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(0, -25%) rotate(0deg);
  }
}

It works fine, as we expected, but here comes the trick: Let’s update our button with some variables.

.button {
  --y: -25;
  --x: 0;
  --rotation: 0;
  --speed: 2;
}

Now let’s plug them into the animation definition, along with the button’s animation properties.

.button {
  animation-name: flow-and-shake;
  animation-duration: calc(var(--speed) * 1s);
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

@keyframes flow-and-shake {
  0%, 100% {
    transform: translate(calc(var(--x) * -1%), calc(var(--y) * -1%))
      rotate(calc(var(--rotation) * -1deg));
  }
  50% {
    transform: translate(calc(var(--x) * 1%), calc(var(--y) * 1%))
      rotate(calc(var(--rotation) * 1deg));
  }
}

All is well. 👍

Let’s change those values when the button is hovered:

.button:hover {
  --speed: .1;
  --x: 1;
  --y: -1;
  --rotation: -1;
}

See the Pen
The excited button with refactored keyframes & scoped variables
by Jhey (@jh3y)
on CodePen.

Nice! Now our button has two different types of animations but defined via one set of keyframes. 🤯

Let’s have a little more fun with it. If we take it a little further, we can make the button a little more playful and maybe stop animating altogether when it’s active. 😅

See the Pen
The Excited Button w/ dynamic animation 🤓
by Jhey (@jh3y)
on CodePen.

Example 2: Bubbles

Now that we’ve gone through some different techniques for things we can do with the power of scope, let’s put it all together. We are going to create a randomly generated bubble scene that heavily leverages scoped CSS variables.

Let’s start by creating a bubble. A static bubble.

.bubble {
  background: radial-gradient(100% 115% at 25% 25%, #fff, transparent 33%),
    radial-gradient(15% 15% at 75% 75%, #80dfff, transparent),
    radial-gradient(100% 100% at 50% 25%, transparent, #66d9ff 98%);
  border: 1px solid #b3ecff;
  border-radius: 100%;
  height: 50px;
  width: 50px;
}

We are using background with multiple values and a border to make the bubble effect — but it’s not very dynamic. We know the border-radius will always be the same. And we know the structure of the border and background will not change. But the values used within those properties and the other property values could all be random.

Let’s refactor the CSS to make use of variables:

.bubble {
  --size: 50;
  --hue: 195;
  --bubble-outline: hsl(var(--hue), 100%, 50%);
  --bubble-spot: hsl(var(--hue), 100%, 75%);
  --bubble-shade: hsl(var(--hue), 100%, 70%);
  background: radial-gradient(100% 115% at 25% 25%, #fff, transparent 33%),
    radial-gradient(15% 15% at 75% 75%, var(--bubble-spot), transparent),
    radial-gradient(100% 100% at 50% 25%, transparent, var(--bubble-shade) 98%);
  border: 1px solid var(--bubble-outline);
  border-radius: 100%;
  height: calc(var(--size) * 1px);
  width: calc(var(--size) * 1px);
}

That’s a good start. 👍

See the Pen
Bubbles foundation
by Jhey (@jh3y)
on CodePen.

Let’s add some more bubbles and leverage the inline scope to position them as well as size them. Since we are going to start randomizing more than one value, it’s handy to have a function to generate a random number in range for our markup.

- const randomInRange = (max, min) => Math.floor(Math.random() * (max - min + 1)) + min

With Pug, we can utilize iteration to create a large set of bubbles:

- const baseHue = randomInRange(0, 360)
- const bubbleCount = 50
- let b = 0
while b < bubbleCount
  - const size = randomInRange(10, 50)
  - const x = randomInRange(0, 100)
  .bubble(style=`--x: ${x}; --size: ${size}; --hue: ${baseHue}`)
  - b++

Updating our .bubble styling allows us to make use of the new inline variables.

.bubble {
  left: calc(var(--x) * 1%);
  position: absolute;
  transform: translate(-50%, 0);
}

Giving us a random set of bubbles:

See the Pen
Adding bubbles
by Jhey (@jh3y)
on CodePen.

Let’s take it even further and animate those bubbles so they float from top to bottom and fade out.

.bubble {
  animation: float 5s infinite ease-in-out;
  top: 100%;
}

@keyframes float {
  from {
    opacity: 1;
    transform: translate(0, 0) scale(0);
  }
  to {
    opacity: 0;
    transform: translate(0, -100vh) scale(1);
  }
}

See the Pen
Bubbles rising together
by Jhey (@jh3y)
on CodePen.

That’s pretty boring. They all do the same thing at the same time. So let’s randomize the speed, delay, end scale and distance each bubble is going to travel.

- const randomInRange = (max, min) => Math.floor(Math.random() * (max - min + 1)) + min
- const baseHue = randomInRange(0, 360)
- const bubbleCount = 50
- let b = 0
while b < bubbleCount
  - const size = randomInRange(10, 50)
  - const delay = randomInRange(1, 10)
  - const speed = randomInRange(2, 20)
  - const distance = randomInRange(25, 150)
  - const scale = randomInRange(100, 150) / 100
  - const x = randomInRange(0, 100)
  .bubble(style=`--x: ${x}; --size: ${size}; --hue: ${baseHue}; --distance: ${distance}; --speed: ${speed}; --delay: ${delay}; --scale: ${scale}`)
  - b++

And now, let’s update our styles

.bubble {
  animation-name: float;
  animation-duration: calc(var(--speed) * 1s);
  animation-delay: calc(var(--delay) * -1s);
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

@keyframes float {
  from {
    opacity: 1;
    transform: translate(-50%, 0) scale(0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, calc(var(--distance) * -1vh)) scale(var(--scale));
  }
}

And we will get this:

See the Pen
Random bubble scene using variable scope 😎
by Jhey (@jh3y)
on CodePen.

With around 50 lines of code, you can create a randomly generated animated scene by honing the power of the scope! 💪

That’s it!

We can create some pretty cool things with very little code by putting CSS variables to use and leveraging some little tricks.

I do hope this article has raised some awareness for the power of CSS variable scope and I do hope you will hone the power and pass it on 😎

All the demos in this article are available in this CodePen collection.

The post The Power (and Fun) of Scope with CSS Custom Properties appeared first on CSS-Tricks.



from CSS-Tricks https://ift.tt/2QSQMYx
via IFTTT

iOS 13 Broke the Classic Pure CSS Parallax Technique

I know. You hate parallax. You know what we should hate more? When things that used to work on the web stop working without any clear warning or idea why.

Way back in 2014, Keith Clark blogged an exceptionally clever CSS trick where you essentially use a CSS transform to scale an element down affecting how it appears to scroll, then "depth correcting" it back to "normal" size. Looks like we got five years of fun out of that, but it's stopped working in iOS 13.

Here's a video of official simulators and the problem:

I'd like to raise my hand for un-breaking this. If we don't watchdog for the web, everything will suffer.

The post iOS 13 Broke the Classic Pure CSS Parallax Technique appeared first on CSS-Tricks.



from CSS-Tricks https://ift.tt/2snR3IL
via IFTTT

Louis Bacon’s sunset ride may foretell ‘mechanized future’ of data-driven investing

The legendary Moore Capital is closing. Its founder, Louis Bacon, is reported to be riding off into the sunset.

His name was often mentioned in the same breath as George Soros, Stan Druckenmiller and Paul Tudor Jones. Like them, over his three-decade career he helped build hedge funds’ reputation for placing big bets on big world events — profiting from predictions of war and economic meltdown. He has been described as one of the best foreign exchange traders ever. Bacon earned outsized returns from bets that stocks would plummet and oil would spike if Iraq invaded Kuwait and pulled the U.S. into war in the 1990s, which they did. He was managing $14 billion at his height, but his returns haven’t had the shine they used to.

It’s the latest in series of money manager giants taking their leave, including Leon Cooperman and Jeffrey Vinik. One imagines them joining Tom Cruise in the 2003 movie “The Last Samurai,” galloping at full tilt, swords drawn, representing the last vestige of their chivalrous time crashing against the mechanized future. 

In the movie, the mechanized future was represented by Gatling guns mowing down the warriors of old. On Wall Street, it’s quants, their data operations and passive management versus active. Think Jim Simons of Renaissance Technologies taking all emotion out of investing, dismissing “stories” about a stock as distraction, and becoming known as one of the greatest investor of all time.

The truth of what’s going on is something different.



from Amazon – TechCrunch https://ift.tt/2KXujWz
via IFTTT

Trouva, an online marketplace for independent boutiques, raises $22M

Amazon helped pioneer and now dominates the online marketplace business model, where a variety of merchants post items for sale on its platform for billions of consumers to discover and buy them. Today, a London startup that’s taken that idea but is applying it to a far more curated set of retailers and goods has raised some money to fuel its international growth.

Trouva, which provides an online marketplace for brick-and-mortar independent boutiques selling “beautiful” and hard-to-find pieces — think Farfetch but less fancy and less high-end design — has raised £17 million ($21.8 million) in funding, money that it will be using to expand outside of the UK on the back of a strong launch in its Berlin last year, as well as to continue building out more technology on its platform, specifically around inventory and logistics management.

The funding is being led by Octopus Ventures, C4 Ventures (the venture firm launched by Apple vet Pascal Cagni) and Downing Ventures. BGF and LocalGlobe were also in the round, which brings the total raised to about $36 million. Mandeep Singh, who co-founded the company with Alex Loizou and Glen Walker, said in an interview that the startup is not disclosing valuation. 

Amazon may dominate our consciousness (and for some of us, our wallets, with its sticky Prime perks) when it comes to browsing for a variety of goods online, buying them, and getting them delivered to us in an efficient way.

But the Amazon way leaves a lot out of the proposition: for retailers it doesn’t give them a lot of leeway in how they present items, and they have to compete with many thousands of other offers (including Amazon itself) to get their products seen.

More generally for both sellers and buyers, the ethos of the platform is that of an “everything” store with little in the way of focus or curation: you can watch movies or listen to music, or you can buy an HDMI cable, or you can buy food, or you can buy a book, or you can buy a vase… and so on. That in a way makes it more of a functional rather than pleasurable experience.

This opens the door to a multitude of different competitors, and there is where Trouva has stepped in. Where Amazon gives us the promise of everything, the smaller startup has effectively incorporated scarcity into its DNA.

“We are very picky,” Singh said. “We have to turn down the majority of applications from stores that want to sell on our site. We are looking for the very best curators. Having every single vase in the world is less important than having the best one, curated by an expert.”

While we are continuing to see a surge of purchasing via the web and apps — a trend that will get played out during holiday shopping in the weeks ahead — analysts estimate that some 85% of retail is still happening offline.

Within that group there is an interesting core of brick-and-mortar independent shops: At a time when large chains and the likes of Amazon are shifting the sands for how people sell things — and certainly how people shop — there remains a large group of independent retailers — “curators,” as Singh describes them. These shops target consumers with disposable income, people who are looking for more unique things to buy with their money.

The challenge of the ‘High Street’

Independent stores are often under threat in cities like London. First, they pop up in areas where rents are not as high, with like-minded people congregating to live in the same neighborhoods for the same reason. There, they sell a small selection of not-cheap clothes, interesting home goods, a variety of tchotchkes, or quirky gifts and develop a local following.

But their emergence can also often signal wider tides of gentrification. Ultimately, that shift is what moves those stores out as the rents subsequently go up, and bigger chains and fancy boutiques move in. (SoHo in NYC is another classic victim of this trend.)

Be that as it may, Singh notes that there are still more than 20,000 independent shops in the UK. “And we are working with 500 of the very best,” he added.

The company’s biggest competition, to my mind, are other players that are also looking to target the same kinds of shoppers online, for example, another UK site, Not On The High Street, or Etsy, which focuses less on retailers and more on makers. Similarly, there is the prospect of stores building their own sites, although that comes with its own set of headaches that independent shopkeepers may be less inclined to deal with.

“Yes, it’s very easy for an independent brick-and-mortar boutique to set up an online shop. That’s the easy part,” Singh said. “But what you find with independents is that building a website doesn’t help drive customers. There is a range of backend technology that we take care of, including inventory management software and handling the logistics of shipping. All of those can be difficult for a [physical] boutique to do on its own. It’s easy to sell online but you still need someone who has the economies of scales to pick up and deliver.”

On the other hand, he notes that “Amazon definitely doesn’t worry us.”

“We position ourselves as the complete opposite. Giants like that are too focused on categories that work well,” he added. Notably, he believes that the biggest threats are the same ones that threaten the independent stores that use Trouva to sell online: “Offline chains, those who sell homewares and clothes. The big guys.”

Trouva has no plans to move into selling its own goods, or to work with other online retailers, although it might consider down the line how it could leverage warehouse space to help its retailers with their inventory management (since many of these shops are very small indeed). “One hundred percent of our supply comes from our brick and mortar store partners,” he said.

Nor does it currently have anything like a Prime-style loyalty program. It does work with retailers and shipping partners to provide an end-to-end shipping service from store to buyer, with options for next-day delivery if it’s necessary.

“The relationship is mutually symbiotic with the boutiques, who benefit from a broader customer base, better priced and efficient delivery and stock tracking and management software from Trouva, and in turn higher revenues and improved profitability,” said Jo Oliver, a venture partner at investor Octopus. “As more boutiques are added the customer proposition becomes more and more attractive, particularly as Trouva’s footprint expands internationally.”

Singh notes that there is “exclusivity” for the shops that eventually come on to Trouva, although that’s almost by default since they are the kinds of small operations that are unlikely to be in the business of trying to expand their online presence.

Amazon has been working hard to improve how it interfaces with and curates items on its site to provide products, and a marketplace selling service, to the same consumer and retailer demographics that Trouva (and others) target. That’s unlikely to disappear over time, especially since Amazon plays the long game, where it will gradually tinker with an idea while at the same time quietly shift our shopping habits to match what it is producing.

“Online sellers like Amazon and eBay have tried to make a better experience, but it’s very hard for a business to change its DNA,” Singh said.

Updated with investor comment.



from Amazon – TechCrunch https://ift.tt/2sml4Zv
via IFTTT

Tuesday, November 26, 2019

Partly Cloudy today!



With a high of F and a low of 5F. Currently, it's 17F and Partly Cloudy outside.

Current wind speeds: 13 from the Northwest

Pollen: 0

Sunrise: November 26, 2019 at 07:47PM

Sunset: November 27, 2019 at 05:30AM

UV index: 0

Humidity: 91%

via https://ift.tt/2livfew

November 27, 2019 at 10:00AM

The Thought Process Behind a Flexbox Layout

I just need to put two boxes side-by-side and I hear flexbox is good at stuff like that.

Just adding display: flex; to the parent element lays out the children in a row.

Well, that's cool. I guess I could have floated them, but this is easier.

They should probably take up the full space they have though. Can I just stretch the parent to 100% wide? Well, I can, but that's apparently not going to affect the child elements.

If the parent element has more space than the children need, it doesn't do anything to help the children fill the space alone.

Maybe I can use width: 50%; on the children? That works, but I thought the point of flexbox is that you don't have to be all specific about width. Ah yes, flexbox has all of these ways of expressing the growy-shrinky-initial behavior of children. Looks like flex: 1; is about as easy as it gets here.

Applying flex: 1; to the children allow them to grow and fill the space.

I like how I haven't had to do any math or hard code values so far. Can I make it a three-up pattern without touching CSS?

Nice.

Hmmm, wait. The sizing is a bit, uhhhh, flexy? Nothing is forcing these boxes to be one-third of the container all the time.

Looks like flex-basis: 33% doesn't fix this. flex: 0 0 33%; also doesn't do the trick. Looks like width: 33%; flex-shrink: 0; does though, if we're really wanting to strongarm it.

Sometimes a design calls for exactly equal size boxes. This is maybe CSS Grid territory, but whatever.

The long word forcing that sizing behavior at narrow widths is perhaps an uncommon scenario. We could have also solved it with word-break: break-word; hyphens: auto; on the child.

Another thing we could do it just let the dang items wrap instead of being so strict about it. Flexbox can do that, right?

Oh hey, that reminds me how cool it is that those first two items are the same height. That's the default stretch behavior, but it can be controlled as well. And it's by row, which is why the second row has its own different height.

What if I want that first "Love" block to be on top instead? Looks like I can re-order it, eh? Let's see, the default order is 0, so to be first, I do order: -1;.

Ha! That kinda worked. But I meant that I want it to take up the full width on the top row. I guess I can just kick it up to flex-basis: 100%; and the others will wrap accordingly.

It's pretty weird to have the source order and visual order different like this. Maybe that should go in the "don't ever do this" category.

What if I wanna bail on the whole flexbox thing at a certain point? Part of me wants to change the direction to go vertical with flex-direction: column; and force the children to be full-width. Ah, a simple display: block; on the parent does that in one swoop.

Rather than changing all the flexbox stuff to handle a column layout, we just turn flexbox off.

Flexbox can do way more stuff! One of my favorites is how auto margins work to "push" other elements away when there is space. This is just one little journey playing with some UI and seeing the useful things flexible does along with things that can make it confusing.

The post The Thought Process Behind a Flexbox Layout appeared first on CSS-Tricks.



from CSS-Tricks https://ift.tt/2OL5Nck
via IFTTT

Report alleges Amazon worked with Indiana to downplay warehouse worker’s death and safety concerns

It’s strange that no matter how hard Amazon denies that its warehouses are terrible, dangerous places to work, the reports to that effect just keep coming out. Not only that, but now a whistleblower alleges the company worked with Indiana officials to erase a workplace safety violation that cost a man his life.

Reveal News reports the whistleblower’s account of Phillip Lee Terry’s death in 2017 and the subsequent efforts to shift blame from Amazon to the deceased. The full report is worth reading; it implicates Amazon, the head of Indiana’s Occupational Safety and Health Administration (OSHA), and even the governor.

The short version is this: Terry died on the job in a forklift accident. An investigation conducted by the whistleblower, John Stallone, found that Amazon had failed to provide adequate safety training. Citations were issued and $28,000 in fines proposed. But Stallone’s boss, IOSHA’s director, directly contacted Amazon and discussed how they might reduce those fines and place the blame on Terry.

Stallone knows this because he was in the room and recorded the conversation, which Reveal News listened to. Amazon told TechCrunch that it “worked directly with [IOSHA] during the inspection and in follow-up discussions to provide Mr. Terry’s training records.” When I asked directly whether the company disputed Stallone’s account of the call, the representative suggested I contact the Indiana state government instead.

A few days later, Stallone said, he was called into the office of Indiana’s Labor Commissioner, Rick Ruble, and found the governor, Eric Holcomb, there as well. He was told to stop pursuing the case, according to Stallone’s account, because of — you guessed it — Indiana’s aspirations to host Amazon’s HQ2.

Stallone soon quit, and a year later, the fines were reversed and all four safety violations were struck from the record. Instead it is listed as an “unpreventable employee misconduct,” meaning Terry was legally responsible for his own death — counter to the conclusions of the investigation, which had Terry’s coworker on the record stating Amazon had failed to provide proper training.

Governor Holcomb retaliated with a statement denying any involvement with a Labor Department case, denying he ever had the meeting Stallone describes, called the allegations “fabricated” and the report “irresponsible and deliberately misleading… heinous lies.”

It’s hard to imagine why Stallone would fabricate such a meeting, when other efforts by state officials to quash these violations and fines are on record. It has not yet been shown beyond the two competing claims whether the meeting indeed took place, but presumably it was informal anyway, which provides the governor plausible deniability.

This would all be harder to believe if we hadn’t seen the frenzy of servility Amazon’s HQ2 announcement provoked nationwide. Or if the allegations of poor working conditions at Amazon warehouses hadn’t continued to pile up in the meantime. Reveal’s investigations related to the whistleblower’s case show an alarmingly high number of injuries at Amazon’s facilities.

In a statement, Amazon said that it takes “an aggressive stance on recording injuries no matter how big or small,” leading to higher numbers than other, similar work environments. As usual, workers at the warehouses dispute Amazon’s account, recalling systematic efforts to under-report and increases in injuries coming from automation.

One thing is certain: Ordering from Amazon during the holidays adds pressure to a warehouse system that by many accounts is already operating at superhuman levels — with very human costs. Perhaps shopping local is a better move this year.



from Amazon – TechCrunch https://ift.tt/2qRrdMG
via IFTTT

Daily Crunch: Free Spotify comes to Alexa

The Daily Crunch is TechCrunch’s roundup of our biggest and most important stories. If you’d like to get this delivered to your inbox every day at around 9am Pacific, you can subscribe here.

1. Spotify’s free music service will now stream on Alexa devices, plus Bose and Sonos smart speakers

Spotify has worked with Amazon Echo since 2016, but only for premium subscribers. Today, that changes.

The Alexa support — which includes playing Spotify’s Top Hits playlist, Discover Weekly and more — will be available for users in the U.S., Australia and New Zealand. Support for Sonos and Bose is more broadly available to users around the world.

2. Facebook’s latest experiment is a meme-creation app, Whale

Currently, the app allows users to decorate photos with text and stickers in order to create memes that can be shared to social media or texted to friends.

3. Vayyar nabs $109M for its “4D” radar tech, which detects and tracks images while preserving privacy

Vayyar is an Israeli startup that builds radar-imaging chips and sensors, as well as the software that reads and interprets the resulting images, for use in automotive and IoT applications.

4. Google Assistant introduces personalized playlists of audio news

When you say “Hey Google, play me the news” to a Google Assistant-enabled phone or smart speaker, you’ll get a tailored playlist of the day’s big headlines and stories. Your News Update draws from a variety of publisher partners, focusing on the stories that seem relevant to your interests and your location.

5. Bunch, the Discord for mobile games, raises $3.85M from Supercell, Tencent, Riot Games

Users who download the game can connect with friends and join an audio or video chat with them. From there, users can choose a game to load and the whole party is instantly taken into a multiplayer game session with their friends.

6. Build trust with remote users to get qualitative feedback

As co-founder of a digital health company, Alex Gold had to build a community of test patients. And because of security and privacy concerns, he had to approach this process unconventionally. (Extra Crunch membership required.)

7. 5 reasons you need to be at Disrupt Berlin

We’re one month out from Disrupt Berlin. And no matter which part of the startup ecosystem you inhabit, the event should be a huge opportunity. (I’ll be there!)



from Amazon – TechCrunch https://ift.tt/3377VQw
via IFTTT

FedEx robot sent packing by NYC

FedEx’s autonomous delivery bot got a cold reception from New York City officials.

After the company’s SameDay Bots — named Roxo — popped up on New York City streets last week, Mayor Bill de Blasio and transportation officials delivered a sharp response: Get out.

FedEx told TechCrunch that the bots were there for a preview party for its Small Business Saturday event and are not testing in New York. Even this promotional event was too much for city officials concerned with congestion and bots taking jobs from humans.

After reports of the bot sightings, the mayor tweeted that FedEx didn’t receive permission to deploy the robots; he also criticized the company for using a bot to perform a task that a New Yorker could do. The New York Department of Transportation has sent FedEx a cease-and-desist order to stop operations the bots,  which TechCrunch has viewed.

The letter informs FedEx that its bots violate several vehicle and traffic laws, including that motor vehicles are prohibited on sidewalks. Vehicles that receive approval to operate on sidewalks must receive a special exemption and be registered. 

FedEx has been experimenting with autonomous delivery bots. Postmates and Amazon also have been testing autonomous delivery robots.

FedEx first unveiled its SameDay Bot in February 2019. The company said at the time it planned to work with AutoZone, Lowe’s, Pizza Hut,  Target, Walgreens and Walmart to figure out how autonomous robots might fit into its delivery business. The idea was for FedEx to provide a way for retailers to accept orders from nearby customers and deliver them by bot directly to customers’ homes or businesses the same day.

FedEx said its initials test would involve deliveries between selected FedEx Office locations. Ultimately, the FedEx bot will complement the FedEx SameDay City service, which operates in 32 markets and 1,900 cities.

The company has tested the bots in Memphis, Tennessee as well as Plano and Frisco, Texas and Manchester, New Hampshire, according to a spokesperson.

The underlying roots of the SameDay Bot is the iBot. The FedEx bot was developed in collaboration with DEKA Development & Research Corp. and its founder Dean Kamen who invented the Segway  and iBot wheelchair.

DEKA built upon the power base of the iBot, an FDA-approved mobility device for the disabled population, to develop FedEx’s product.

The FedEx bot is equipped with sensing technology such as LiDAR and multiple cameras, which when combined with machine learning algorithms should allow the device to detect and avoid obstacles and plot a safe path, all while following the rules of the road (or sidewalk).



from Amazon – TechCrunch https://ift.tt/2R43ggb
via IFTTT

New Amazon capabilities put machine learning in reach of more developers

Today, Amazon announced a new approach that it says will put machine learning technology in reach of more developers and line of business users. Amazon has been making a flurry of announcements ahead of its re:Invent customer conference next week in Las Vegas.

While the company offers plenty of tools for data scientists to build machine learning models and process, store and visualize data, it wants to put that capability directly in the hands of developers with the help of the popular database query language, SQL.

By taking advantage of tools like Amazon QuickSight, Aurora and Athena in combination with SQL queries, developers can have much more direct access to machine learning models and underlying data without any additional coding, says VP of artificial intelligence at AWS, Matt Wood.

“This announcement is all about is making it easier for developers to add machine learning predictions to their products and their processes by integrating those predictions directly with their databases,” Wood told TechCrunch.

For starters, Wood says developers can take advantage of Aurora, the company’s SQL (and Postgres) compatible database to build a simple SQL query into an application, which will automatically pull the data into the application and run whatever machine learning model the developer associates with it.

The second piece involves Athena, the company’s serverless query service. As with Aurora, developers can write a SQL query — in this case, against any data store — and based on a machine learning model they choose, return a set of data for use in an application.

The final piece is QuickSight, which is Amazon’s data visualization tool. Using one of the other tools to return some set of data, developers can use that data to create visualizations based on it inside whatever application they are creating.

“By making sophisticated ML predictions more easily available through SQL queries and dashboards, the changes we’re announcing today help to make ML more usable and accessible to database developers and business analysts. Now anyone who can write SQL can make — and importantly use — predictions in their applications without any custom code,” Amazon’s Matt Assay wrote in a blog post announcing these new capabilities.

Assay added that this approach is far easier than what developers had to do in the past to achieve this. “There is often a large amount of fiddly, manual work required to take these predictions and make them part of a broader application, process or analytics dashboard,” he wrote.

As an example, Wood offers a lead-scoring model you might use to pick the most likely sales targets to convert. “Today, in order to do lead scoring you have to go off and wire up all these pieces together in order to be able to get the predictions into the application,” he said. With this new capability, you can get there much faster.

“Now, as a developer I can just say that I have this lead scoring model which is deployed in SageMaker, and all I have to do is write literally one SQL statement that I do all day long into Aurora, and I can start getting back that lead scoring information. And then I just display it in my application and away I go,” Wood explained.

As for the machine learning models, these can come pre-built from Amazon, be developed by an in-house data science team or purchased in a machine learning model marketplace on Amazon, says Wood.

Today’s announcements from Amazon are designed to simplify machine learning and data access, and reduce the amount of coding to get from query to answer faster.



from Amazon – TechCrunch https://ift.tt/2XQaqWk
via IFTTT

Mostly Clear today!

With a high of F and a low of 15F. Currently, it's 14F and Clear outside. Current wind speeds: 13 from the Southwest Pollen: 0 S...