Twilio’s revenue shoots up 80% as it easily beats targets

Twilio’s revenue shoots up 80% as it easily beats targets

Twilio’s revenue shoots up 80% as it easily beats targets 1
Cloud communications services company Twilio Inc. is back on track after beating its first-quarter profit and revenue targets. The company, which disappointed investors in the last quarter with its poor full year guidance, reported earnings before certain costs such as stock compensation of 5 cents per share on revenue of $233.1 million, up 81% from […]

The post Twilio’s revenue shoots up 80% as it easily beats targets appeared first on SiliconANGLE.

‘Utah Booze News: An Alcohol Policy Podcast’

On the inaugural episode of “Utah Booze News,” FOX 13’s Ben Winslow and The Salt Lake Tribune’s Kathy Stephenson (who cover alcohol policy in Utah) recap a surprisingly dramatic meeting of the Department of Alcoholic Beverage Control Commission, where licenses were rejected for the Bonanza Campout, a karaoke lounge and Social Axe Throwing.

FOX 13: No beer with karaoke in Utah, alcohol control authority declares

SL Trib: Utah liquor officials say no beer at karaoke venues or ax-throwing businesses, unless state law is changed

And Ogden’s Own Distillery shares with us their new, limited-edition Utah Pride Festival label for “Five Husbands,” an LGBTQ-themed version of their slightly controversial “Five Wives” Vodka:

The Utah Pride-themed “Five Husbands Vodka.” (Image via Ogden’s Own Distillery)

 

Ogden distillery launches gay-themed ‘Five Husbands Vodka’

SALT LAKE CITY — Ogden’s Own Distillery, the makers of Five Wives Vodka is rebranding it for the Utah Pride Festival.

The Utah Pride Festival-themed “Five Husbands Vodka.” (Image via Ogden’s Own Distillery)

In an interview on the “Utah Booze News” podcast produced by FOX 13 and The Salt Lake Tribune, Ogden’s Own owner Steve Conlin unveiled the new label for their vodka, calling it “Five Husbands.”

Featuring beefcake in Daisy Duke shorts clutching roosters, the “Five Husbands” label is a nod to the slightly controversial Five Wives label which features women holding cats. When it was first introduced in 2012, Five Wives was banned from Idaho’s state-run liquor stores because officials there deemed it “offensive.” After threatening a lawsuit, Idaho relented.

Conlin tells “Utah Booze News” that Utah’s Department of Alcoholic Beverage Control did not have the same objections. Five Husbands, with its rooster-and-beefcake imagery will be sold in state-run liquor stores beginning next month and running through June.

Ogden’s Own is also the official liquor sponsor of the Utah Pride Festival, which kicks off in early June.

Listen to the Utah Booze News podcast here:

PowerEdge server line continues to show growth in its third decade for Dell EMC

PowerEdge server line continues to show growth in its third decade for Dell EMC

Twilio’s revenue shoots up 80% as it easily beats targets 2
Launched in 1994, when Bill Clinton was serving his first term as president, Dell EMC’s PowerEdge server line continues to be an important mainstay of the company’s business. PowerEdge keeps on ticking along. Although the company doesn’t break out specific PowerEdge financial results, servers and networking is a $20-billion business growing at 28% year-over-year, according […]

The post PowerEdge server line continues to show growth in its third decade for Dell EMC appeared first on SiliconANGLE.

The Many Ways of Getting Data Into Charts

The Many Ways of Getting Data Into Charts

Data is available everywhere nowadays, whether it’s in a plain text file, a REST API, an online Google sheet… you name it! It’s that variety of context that makes building graphs more than simply having a database in your local project — where there is data, there is a way.

That’s pretty much what we’re going to look at in this post: making JavaScript data visualizations using data from a variety of sources.

If you want to follow along and make any of the visualizations we’re covering here, we’ll be using Chart.js so grab that and include it in your own environment:

Source 1: HTML data table

Lots and lots of websites have data tables, and why not? They are a great way to show data and that’s what they were made to do. But, if you could have a visualization powered by the data in it — and for not much more effort — wouldn’t that be even better?

With a little JavaScript, the data in a HTML table can be isolated from the HTML and prepped for a chart. Look at the following data table:

Year Items Sold Turnover ($) Profit ($)
2016 10 200 89
2017 25 550 225
2018 55 1200 600
2019 120 2450 1100

It contains sales data for a business. Now, if we could graph this out, it would be both visually compelling and help users glean insights. So let’s do it!

First of all, let’s define a function for our chart. This comes straight out of the Chart.js library, so it’s worth cross-referencing this with the documentation is something seems unclear. I’ve added some comments to call out key parts.

function BuildChart(labels, values, chartTitle) {
  var ctx = document.getElementById("myChart").getContext('2d');
  var myChart = new Chart(ctx, {
    type: 'bar',
    data: {
      labels: labels, // Our labels
      datasets: [{
        label: chartTitle, // Name the series
        data: values, // Our values
        backgroundColor: [ // Specify custom colors
          'rgba(255, 99, 132, 0.2)',
          'rgba(54, 162, 235, 0.2)',
          'rgba(255, 206, 86, 0.2)',
          'rgba(75, 192, 192, 0.2)',
          'rgba(153, 102, 255, 0.2)',
          'rgba(255, 159, 64, 0.2)'
        ],
        borderColor: [ // Add custom color borders
          'rgba(255,99,132,1)',
          'rgba(54, 162, 235, 1)',
          'rgba(255, 206, 86, 1)',
          'rgba(75, 192, 192, 1)',
          'rgba(153, 102, 255, 1)',
          'rgba(255, 159, 64, 1)'
        ],
        borderWidth: 1 // Specify bar border width
      }]
    },
    options: {
      responsive: true, // Instruct chart js to respond nicely.
      maintainAspectRatio: false, // Add to prevent default behavior of full-width/height 
    }
  });
  return myChart;
}

Now that we have a function to create a chart for the table data, let’s write out the HTML for the table and add a canvas element that Chart.js can use to inject its charting magic. This is exactly the same data from the table example above.

Year Items Sold Turnover ($) Profit ($)
2016 10 200 89
2017 25 550 225
2018 55 1200 600
2019 120 2450 1100

Then, we need to parse the table into JSON with vanilla JavaScript. This is what Chart.js will use to populate the charts and graphs.

var table = document.getElementById('dataTable');
var json = []]; // First row needs to be headers 
var headers =[];
for (var i = 0; i < table.rows[0].cells.length; i++) {
  headers[i] = table.rows[0].cells[i].innerHTML.toLowerCase().replace(/ /gi, '');
}

// Go through cells 
for (var i = 1; i < table.rows.length; i++) {
  var tableRow = table.rows[i];
  var rowData = {};
  for (var j = 0; j < tableRow.cells.length; j++) {
    rowData[headers[j]] = tableRow.cells[j].innerHTML;
  }

  json.push(rowData);
}

console.log(json);

We threw in that last line so we can check the output in the DevTools console. Here’s what is logged into the console:

Twilio’s revenue shoots up 80% as it easily beats targets 3

Perfect! Our table headers become variables and are mapped to the content in the table cells.

All that’s left to do is map the year labels and items sold values to array (which Chart.js requires for its data object) and then to pass the data into the chart function.

This script maps the JSON values to an array of years. We can add it directly after the previous function.

// Map JSON values back to label array
var labels = json.map(function (e) {
  return e.year;
});
console.log(labels); // ["2016", "2017", "2018", "2019"]

// Map JSON values back to values array
var values = json.map(function (e) {
  return e.itemssold;
});
console.log(values); // ["10", "25", "55", "120"]

Call the BuildChart function from our first snippet (including a name for the chart) and we get a beautiful visualization of the data from the HTML table.

var chart = BuildChart(labels, values, "Items Sold Over Time");

And that is it! The charts data has now been isolated and passed into the JavaScript visualization and rendered.

See the Pen
BarChart Loaded From HTML Table
by Danny Englishby (@DanEnglishby)
on CodePen.

Source 2: A real-time API

There are many, many public APIs available in the world, many of which are rich with neat and useful data. Let’s use one of them to demonstrate how real-time data can be used to populate a chart. I’m going to use the Forbes 400 Rich List API to graph out the top 10 richest people in the world. I know, cool, eh?! I always find wealth rankings interesting, and there is so much more data this API provides. But for now, we will request data to display a chart with names and real time net worth using pure JavaScript!

First off, we want to define a chart function again, this time with a few more options.

function BuildChart(labels, values, chartTitle) {
  var data = {
    labels: labels,
    datasets: [{
      label: chartTitle, // Name the series
      data: values,
      backgroundColor: ['rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
      ],
    }],
  };
  var ctx = document.getElementById("myChart").getContext('2d');
  var myChart = new Chart(ctx, {
    type: 'horizontalBar',
    data: data,
    options: {
      responsive: true, // Instruct chart JS to respond nicely.
      maintainAspectRatio: false, // Add to prevent default behavior of full-width/height 
      scales: {
        xAxes: [{
          scaleLabel: {
            display: true,
            labelString: '$ Billion'
          }
        }],
        yAxes: [{
          scaleLabel: {
            display: true,
            labelString: 'Name'
          }
        }]
      },
    }
  });
  return myChart;
}

Next, we’ll need that same HTML canvas element for where the chart will be rendered:

Now to grab some real time data. Let’s see what is returned in the console from the Forbes API call:

Twilio’s revenue shoots up 80% as it easily beats targets 4

As you can see by the JSON returned, there is a lot of rich information that can injected into a chart. So, let’s make our rankings!

With some light JavaScript, we can request the data from the API, pick out and map the values we went to array variables, and finally pass our data in and rendering the chart.

var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
  if (this.readyState == 4 && this.status == 200) {
    var json = JSON.parse(this.response);
    // Map JSON labels  back to values array
    var labels = json.map(function (e) {
      return e.name;
    });
    // Map JSON values back to values array
    var values = json.map(function (e) {
      return (e.realTimeWorth / 1000); // Divide to billions in units of ten
    });
    BuildChart(labels, values, "Real Time Net Worth"); // Pass in data and call the chart
  }
};
xhttp.open("GET", "https://forbes400.herokuapp.com/api/forbes400?limit=10", false);
xhttp.send();

See the Pen
Chart Loaded From RichListAPI
by Danny Englishby (@DanEnglishby)
on CodePen.

Source 3: A Google Sheet

So far, we’ve looked at data in standard HTML tables and APIs to populate charts. But what if we already have an existing Google Sheet that has a bunch of data in it? Well, we can also use that to make a chart!

First, there are some rules for accessing a Google Sheet:

  • The Google Sheet must be published
  • The Google Sheet must be public (i.e. not set to private viewing)

As long as these two points are true, we can access a Google Sheet in the form of JSON, which means, of course, we can graph it out!

Here’s a Google Sheet with some made up data that I’ve published publicly. It consists of three fields of data: MachineId, Date, and ProductsProduced.

Now, if we that the sheet’s URL, we’ll want to note everything after the last slash:

https://docs.google.com/spreadsheets/d/1ySHjH6IMN0aKImYcuVHozQ_TvS6Npt4mDxpKDtsFVFg

This is the sheet identity and what we need for the GET request we send to Google. To make a GET request for JSON, we insert that string in the URL in another URL:

https://spreadsheets.google.com/feeds/list/[ID GOES HERE]/od6/public/full?alt=json

That gives us the following URL:

https://spreadsheets.google.com/feeds/list/1ySHjH6IMN0aKImYcuVHozQ_TvS6Npt4mDxpKDtsFVFg/od6/public/full?alt=json

And here’s the response we get in the console:

Twilio’s revenue shoots up 80% as it easily beats targets 5

The important piece is the feed.entry object array. This holds vital sheet data, which looks like this when we drill into it:

Twilio’s revenue shoots up 80% as it easily beats targets 6

Notice the items underlined in red. The Google Sheets API has preceded each of the column names with gsx$ (e.g. gsx$date). These are exactly how we will dissect the data from the object, using these uniquely generated names. So, knowing this, it’s time to insert the data into some isolated arrays and pass them into our chart function.

function BuildChart(labels, values, chartTitle) {
  var data = {
    labels: labels,
    datasets: [{
      label: chartTitle, // Name the series
      data: values,
      backgroundColor: ['rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
        'rgb(54, 162, 235)',
      ],
    }],
  };

  var ctx = document.getElementById("myChart").getContext('2d');
  var myChart = new Chart(ctx, {
    type: 'bar',
    data: data,
    options: {
      responsive: true, // Instruct chart js to respond nicely.
      maintainAspectRatio: false, // Add to prevent default behavior of full-width/height 
      scales: {
        xAxes: [{
          scaleLabel: {
            display: true,
            labelString: 'Date'
          }
        }],
        yAxes: [{
          scaleLabel: {
            display: true,
            labelString: 'Produced Count'
          }
        }]
      },
    }
  });

  return myChart;
}

And, you guessed it, next is the Canvas element:

...then the GET request, mapping our labels and values array and finally calling the chart passing in the data.

var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
  if (this.readyState == 4 && this.status == 200) {
    var json = JSON.parse(this.response);
    console.log(json);

  // Map JSON labels  back to values array
  var labels = json.feed.entry.map(function (e) {
    return e.gsx$date.$t;
  });
      
  // Map JSON values back to values array
  var values = json.feed.entry.map(function (e) {
    return e.gsx$productsproduced.$t;
  });

  BuildChart(labels, values, "Production Data");
  }
};
xhttp.open("GET", "https://spreadsheets.google.com/feeds/list/1ySHjH6IMN0aKImYcuVHozQ_TvS6Npt4mDxpKDtsFVFg/od6/public/full?alt=json", false);
xhttp.send();

And, boom!

See the Pen
Chart Loaded From a Google Sheet
by Danny Englishby (@DanEnglishby)
on CodePen.

What will you make with data?

You probably get the point that there is a variety of ways we can get data to populate beautiful looking charts and graphs. As long as we have some formatted numbers and a data visualization library, then we have a lot of powers at our fingertips.

Hopefully now you’re thinking of where you might have data and how to plug into a chart! We didn’t even cover all of the possibilities here. Here are a few more resources you can use now that you’ve got chart-making chops.

A few more charting libraries

A few more places to store data

The post The Many Ways of Getting Data Into Charts appeared first on CSS-Tricks.

Earth day, API’s and sunshine.

Cassie Evans showcases some really nifty web design ideas and explores using the API provided by the company her team over at Clearleft recently hired to cover their building’s roof with solar panels. Cassie outlines her journey designing a webpage that uses the API to populate some light data visualizations about the energy the building uses now that the solar panels are installed.

Here at Clearleft we’ve been taking small steps to reduce our environmental impact. In December 2018 we covered the roof of our home with solar panels.

With the first of the glorious summer sun starting to shine down on us, we started to ponder about what environmental impact they’d had over the last 5 months.

Luckily for us, our solar panels have an API, so we can not only find out that information, we can request it from SolarEdge and display it in our very own interface.

The post is a great practical look into using the Fetch API which is also something Zell Liew wrote up in thorough detail, covering the history of using APIs with JavaScript, handling errors and other weird things that might happen when working with it.

But, equally interesting and useful is reading through Cassie’s thought process as she sketches a wireframe for the page, researches how to use the Fetch API, and integrates animation into a lovely SVG illustration. It’s an exercise in both design and development that many of us can relate to but also learn from.

Oh and while we’re on the topic of data visualizations, Dan Englishby posted something just today on the many ways if getting data into charts. Working with real-time APIs is covered there as well, and is a nice segue from Cassie’s post.

Direct Link to ArticlePermalink

The post Earth day, API’s and sunshine. appeared first on CSS-Tricks.

William Barr to defend his handling of Mueller report in face of Senate furor

By Jeremy Herb and Laura Jarrett, CNN

Attorney General William Barr will defend his handling of special counsel Robert Mueller’s report and his decision there wasn’t sufficient evidence to prosecute an obstruction of justice case on Wednesday from the Senate hot seat.

Barr is likely to face a barrage of questions from Democrats at a Senate Judiciary Committee hearing over a letter revealed Tuesday night in which Mueller wrote to object to his characterization of the special counsel investigation in his four-page summary.

According to his prepared opening statement released late Tuesday, Barr will defend his characterization of Mueller’s investigation.

“The Special Counsel’s report demonstrates that there are many subsidiary considerations informing that prosecutorial judgment — including whether particular legal theories would extend to the facts of the case and whether the evidence is sufficient to prove one or another element of a crime,” Barr states in his prepared remarks.

“But at the end of the day, the federal prosecutor must decide yes or no. That is what I sought to address in my March 24 letter.”

READ: Attorney General William Barr’s prepared testimony on Mueller report before Senate committee

Mueller’s letter, which was first reported by The Washington Post, stated that Barr’s summary of the probe “did not fully capture the context, nature, and substance” of the special counsel investigation. The criticism adds a whole new level of scrutiny for Barr, who was already facing sustained criticism for Democrats who had accused Barr of mischaracterizing Mueller’s findings.

Now they’ve got Mueller’s own words to back up their misgivings about the attorney general.

“Barr will have to answer for this at our hearing. Updating my questions!” Sen. Amy Klobuchar, a Minnesota Democrat, tweeted after news of the letter broke Tuesday evening.

Barr is making his first appearance before Congress Wednesday since the release of a redacted version of Mueller’s report last month. The attorney general’s relationship with Democrats has soured over the past two months, as Democrats accused him of misleading the public with his summary letter on Mueller’s conclusions, questioned his decision to clear the President on obstruction of justice and issued a subpoena to try to force him to provide Congress with the full, unredacted report.

Democrats have also slammed Barr for claiming at a Senate subcommittee hearing that the Trump campaign was spied on, as well as for holding a press conference the morning before the report was released.

Barr made reference to the political storm he’s facing over the Mueller report in his prepared remarks, and sought to distance himself from it.

“From here on, the exercise of responding and reacting to the report is a matter for the American people and the political process,” his prepared remarks state. “As I am sure you agree, it is vitally important for the Department of Justice to stand apart from the political process and not to become an adjunct of it.”

Wednesday’s hearing is the first of potentially two days of hearings where Barr will be pressed by Democrats on his handling of the Mueller investigation. In a sign of the deteriorating relationship between Capitol Hill Democrats and Barr, his second-day testimony before the House Judiciary Committee is now in doubt over a dispute between the panel and the Justice Department over the format of the hearing. At the same time that Barr will be appear before the Senate Judiciary Committee, the House Judiciary Committee will be voting to allow Democratic and Republican staff a half-hour to question Barr — a stipulation that has the attorney general threatening not to show.

In a statement Tuesday, Nadler demanded a copy of the Mueller’s letter and said that the special counsel “must be allowed to testify.”

There doesn’t appear to be similar drama over whether Barr appears Wednesday, but that doesn’t mean the questions won’t be just as contentious from Senate Democrats on the Judiciary panel, including three — Sens. Klobuchar, Kamala Harris of California and Cory Booker of New Jersey — who are running for President.

Another 2020 hopeful, former Housing and Urban Development Secretary Julian Castro, tweeted Tuesday that Barr “should resign his position or face an impeachment inquiry immediately.”

In a shot across the bow ahead of the hearing, a dozen Senate Democrats led by Sen. Mazie Hirono of Hawaii sent a letter to the Justice Department inspector general Tuesday urging an investigation into Barr’s handling of the Mueller report.

“Attorney General Barr’s actions raise significant questions about his decision not to recuse himself from overseeing the special counsel’s investigation, whether his actions with respect to the release of the report complied with Department of Justice policies and practices and whether he has demonstrated sufficient impartiality to continue overseeing the 14 criminal matters related to the Special Counsel’s investigation,” the senators wrote.

Republicans argue that Barr has provided much more of the Mueller report than he was required to disclose under the law. They say Democrats are simply lashing out at Barr because they are unhappy with the results of the Mueller investigation.

“They didn’t find what they wanted to in the Mueller report, and they now have to make it a sideshow to blame Barr,” said Rep. Doug Collins, the top Republican on the House Judiciary Committee.

In his prepared remarks, Barr explained he didn’t think it was in the public interest to release piecemeal portions of the report, which is why he says he provided the four-page summary on March 24 and then worked to release a public version.

“I did not believe that it was in the public interest to release additional portions of the report in piecemeal fashion, leading to public debate over incomplete information,” Barr will say, according to the remarks.

While the House hearing is in jeopardy, Barr has been preparing at length for the back-to-back appearances, according to a source with knowledge of the preparations. Barr has been holed up with several senior officials in the Justice Department in his conference room for hours at a time since early last week, the source said, in addition to preparing on his own.

Mueller’s letter will fuel questions about how Barr crafted his four-page letter released after Mueller’s investigation ended, which stated that Mueller did not establish a criminal conspiracy between Trump’s team and the Russian government and that Mueller did not reach a conclusion on obstruction of justice.

Democrats say that Barr cherry-picked lines from Mueller’s report to make it sound as rosy as possible for President Donald Trump, when Mueller detailed numerous contacts between Trump’s team and Russians and instances where Trump sought to interfere in the investigation.

Democrats are also going to press Barr on the decision he and Deputy Attorney General Rod Rosenstein concluding there wasn’t sufficient evidence to prosecute an obstruction case, after Barr himself wrote before he was named attorney general that such a case was “fatally misconceived.”

Senate Judiciary Chairman Lindsey Graham said he wanted to look forward, and not just backwards, with his questions of Barr.

“I want him to explain his decision in the four-page letter and talk about what are the takeaways from the report,” Graham said. “One of the takeaways is that the Russians were heavily involved in trying to influence our election. I think they’re still up to it. See if he agrees with that and try to find ways to defend American election system in 2020 from Russian interference and others.”

Police say Provo man booked for attempted murder choked girlfriend, threw her down stairs

PROVO, Utah — A Provo man has been booked on charges of assault, kidnapping and attempted murder—all with enhancements for domestic violence.

Booking records indicate Luke John Battiloro was arrested for an incident at a home in Provo on Monday.

Police state the man’s girlfriend had sent a relative a text and photos  thsat indicated her boyfriend had thrown her down the stairs and otherwise abused her.

The woman also told the relative Battiloro would not let her leave her room.

Officers responded to the home and observed a juvenile female inside, but later learned her father, Battiloro, had ordered her not to answer the door.

Police ultimately entered the residence and the victim was found to have numerous injuries. She told police the man had gotten angry with her and thrown her against a wall, putting two large holes in the sheet rock.

She said he also choked her and then threw her down the stairs leading to the basement. The woman said she lost consciousness during the attack.

At one point police had contacted the victim by phone, but she lied to officers about her location as the suspect sat next to her and ordered her to do so. The woman also told police the man had faked a heart attack and used other means of manipulation to control her behavior.

Battiloro was booked into jail on charges of attempted homicide, aggravated kidnapping, aggravated assault and criminal mischief. All four charges carry enhancements for domestic violence.

Support is available 24/7 in Utah for those dealing with domestic violence. Visit the Utah Domestic Violence Coalition online or call 1-800-897-5465 for resources and assistance. In an emergency, dial 911.

Grabbin’ Grain in the Turning Lane: A DJ Screw Masterpiece

DJ Screw takes a 3 minute Guerilla Maab hit called “Fondren and Main” and transforms it into an 8 minute masterpiece called “Grabbin’ Grain”. Let’s be honest, Guerilla Maab’s “Fondren and Main” is a classic, but at the time it was released, in 1999, Z-RO was rapping faster than anyone in Houston. Z-Ro has a …

Grabbin’ Grain in the Turning Lane: A DJ Screw MasterpieceRead More »

The post Grabbin’ Grain in the Turning Lane: A DJ Screw Masterpiece first appeared on Screwed Up Click.