(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| DROP TABLE IF EXISTS states_raw; | |
| DROP TABLE IF EXISTS final_states_by_day; | |
| DROP TABLE IF EXISTS final_states_by_day_mv; | |
| CREATE TABLE states_raw | |
| ( | |
| process String, | |
| state String, | |
| stateint Int64, | |
| statevalue Float64, |
| drop table z; | |
| drop table mvz; | |
| create table z(d Date, u String) Engine=MergeTree partition by tuple() order by tuple(); | |
| CREATE MATERIALIZED VIEW mvz ENGINE = AggregatingMergeTree(d, (d), 8192) as select d, uniqState(u) as us from z group by d | |
| insert into z select today()-number%571, concat('usr',toString(rand()%664579)) from numbers(100000000); | |
| optimize table mvz final; | |
| optimize table z final; | |
| select (uniqMerge(us)) as unique from mvz group by d order by d; | |
| 571 rows in set. Elapsed: 0.300 sec. |
| defmodule Checkout do | |
| defstruct [ | |
| basket: %{A: 0, B: 0, C: 0, D: 0} | |
| ] | |
| def scan(checkout, code) do | |
| new_value = checkout.basket[code] + 1 | |
| %{checkout | basket: Map.put(checkout.basket, code, new_value)} | |
| end |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Net.Http; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using System.Web; | |
| using Umbraco.Core; | |
| using Umbraco.Web; | |
| using Umbraco.Web.Models.ContentEditing; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| <!DOCTYPE html> | |
| <head> | |
| <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script> | |
| <script src="rx.min.js" type="text/javascript"></script> | |
| <script src="rx.jquery.js" type="text/javascript"></script> | |
| <script type="text/javascript"> | |
| $(function () { | |
| var dragTarget = $('#dragTarget') |
| // knockout-jquery-ui-widget.js | |
| // Copyright (c) 2011, Planapple, Inc. | |
| // License: MIT (http://www.opensource.org/licenses/mit-license.php) | |
| // | |
| // Knockout binding for jQuery UI widgets | |
| // | |
| // Examples: | |
| // <input type="submit" value="OK" data-bind='jqueryui: "button"' /> | |
| // | |
| // Attaches a jQuery UI button widget to this button, with default options. |