MQTT is probably best known as a lightweight messaging protocol implemented for small sensors, but there is actually a JavaScript implementation called MQTT.js. It's a JavaScript implementation, so of course it works in a browser. I think it's a great option for front-end engineers who are working with MQTT/IoT-related projects (for example, creating a dashboard to visualize MQTT data). In this article, I'd like to write about what I did when I tried to connect MQTT.js to the test server (broker) of Mosquitto™.
Last time was to get list of todo from Apollo. This time I am going to add task search functionality by id.
const { ApolloServer, gql } = require('apollo-server');last time was search by id form the task list. This time, I am going to update the liset. It's called Mutation, which is a cool name in the GraphQL community :D
I've been playing around with GraphQL lately and that's fun. After playing with GraphQL for a while, I thought I'd write about it in a series of articles.
The best way to get started with GraphQL now is to start with these two great sites to grasp the concept.
| require "readline" | |
| require "yaml" | |
| require "json" | |
| class CLI | |
| attr_accessor :command_tree | |
| def initialize(swagger_json) | |
| # TODO: json might be broken | |
| if swagger_json.nil? |
| require "readline" | |
| require "yaml" | |
| command_tree = {"pet"=> | |
| {"buy"=>{"dog"=>nil, "cat"=>nil}, | |
| "sell"=>{"bird"=>nil, "fox"=>nil}, | |
| "sellGroup"=>{"pig"=>nil, "kingfisher"=>nil}, | |
| "list"=>{"all"=>nil, "filter_by"=>nil}}, | |
| "store"=> | |
| {"find"=>{"by_name"=>nil, "by_tag"=>nil, "by_address"=>nil}, "list"=>nil}, |
| require "readline" | |
| pet_store = [ "pet", "store", "user"] | |
| Readline.completion_proc = proc do |input| | |
| pet_store.select { |name| name.start_with?(input) } | |
| end | |
| while input = Readline.readline("$ ", false) | |
| if input |
| let ary = [ | |
| '0:00', | |
| '0:30', | |
| '1:00', | |
| '1:30', | |
| '2:00', | |
| '2:30', | |
| '3:00', | |
| '3:30', | |
| '4:00', |
I will start with the cost of the power to run servers.
I wanted to know how much servers IT giants have. There is no official data on it off cource but some estimates.
As of today (dez/2015) both microsoft and google are leading - MS is 1,020,00 machines and google 750,000. Facebook 2015 is 'undisclosed' but their operation is quite small compared to those million-machine business.