This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
SSD random read 150,000 ns | |
Read 1 MB sequentially from memory 250,000 ns 0.25 ms | |
Round trip within same datacenter 500,000 ns 0.5 ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example using the raf module from npm. try changing some values! | |
var requestAnimationFrame = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AYLIENTextAPI = require('aylien_textapi'), | |
request = require('request'), | |
xml2js = require('xml2js'); | |
var textapi = new AYLIENTextAPI({ | |
application_id: 'YourApplicationId', | |
application_key: 'YourApplicationKey' | |
}); | |
var parser = new xml2js.Parser(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//********************************************************** | |
// Here's a basic app that uses AYLIEN's Text Analysis API | |
// through the Node.js SDK. To install the SDK using `npm`: | |
// $ npm install aylien_textapi | |
//********************************************************** | |
var AYLIENTextAPI = require('aylien_textapi'); | |
var textapi = new AYLIENTextAPI({ | |
application_id: 'YourApplicationId', | |
application_key: 'YourApplicationKey' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//********************************************************************** | |
// Enter the Twitter handle below (var twitterHandle = 'BBCBreaking') to | |
// see a Sentiment Analysis of the first 10 tweets. | |
// :-) = positive, :-| = neutral, :-( = negative | |
//********************************************************************** | |
var AYLIENTextAPI = require('aylien_textapi'), | |
request = require('request'), | |
cheerio = require('cheerio'); | |
var textapi = new AYLIENTextAPI({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//********************************************************************** | |
// Enter a SubReddit below (var subReddit = 'technology') to | |
// receive an analysis of the top stories. | |
//********************************************************************** | |
var subReddit = 'technology'; | |
var numberOfStories = 3; | |
var AYLIENTextAPI = require('aylien_textapi'), | |
request = require('request'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//********************************************************** | |
// This application takes a web site address 'webSite'and | |
// searches it for an RSS feed. If an RSS feed is found the | |
// address is displayed along with the first 'numberOfStories'. | |
// Try it for yourself by specififying a website below. | |
//********************************************************** | |
var webSite = 'http://gigaom.com/'; | |
var numberOfStories = 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//************************************** | |
//Configuration details specific to you. | |
//************************************** | |
const AYLIEN_APP_ID = YOUR_AYLIEN_APP_ID; | |
const AYLIEN_APP_KEY = YOUR_AYLIEN_APP_KEY; | |
const MAILGUN_API_KEY = YOUR_MAILGUN_API_KEY; | |
const SENDING_EMAIL_ACCOUNT = 'sending@example.com'; | |
const RECIPIENTS = 'Recipient 1 <recipient@example.com>'; | |
const NUM_STORRIES_PER_RSS_FEED = 3; | |
var rssFeeds = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('underscore'), | |
AYLIENTextAPI = require("aylien_textapi"); | |
var textapi = new AYLIENTextAPI({ | |
application_id: "YourApplicationId", | |
application_key: "YourApplicationKey" | |
}); | |
function escapeRegExp(r) { | |
return r.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); |
OlderNewer