<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.4.3">Jekyll</generator><link href="http://x1024.net/feed.xml" rel="self" type="application/atom+xml" /><link href="http://x1024.net/" rel="alternate" type="text/html" /><updated>2017-05-18T10:57:55-05:00</updated><id>http://x1024.net/</id><title type="html">x1024.net</title><subtitle>The owls are not what they seem.</subtitle><author><name>Jon M. Dugan</name></author><entry><title type="html">Flexible Network Analytics In The Cloud</title><link href="http://x1024.net/blog/2017/05/chinog-flexible-network-analytics-in-the-cloud/" rel="alternate" type="text/html" title="Flexible Network Analytics In The Cloud" /><published>2017-05-18T04:30:00-05:00</published><updated>2017-05-18T04:30:00-05:00</updated><id>http://x1024.net/blog/2017/05/chinog-flexible-network-analytics-in-the-cloud</id><content type="html" xml:base="http://x1024.net/blog/2017/05/chinog-flexible-network-analytics-in-the-cloud/">&lt;p&gt;Analyzing network data can be a daunting task. Some days you end up feeling like
&lt;a href=&quot;https://en.wikipedia.org/wiki/Sisyphus&quot;&gt;Sisyphus&lt;/a&gt; the Network Engineer. 
I’d like to talk about an approach to network analytics 
that we have been exploring at &lt;a href=&quot;https://www.es.net/&quot;&gt;ESnet&lt;/a&gt; based on using cloud services.
The cloud isn’t a magical solution, of course, but it does provide quite a bit of
leverage. It’s been a bit of a journey for us and if you go this route it will definitely
take some work. I think the effort is worth it – the view at the end is really quite nice.&lt;/p&gt;

&lt;p&gt;This post is the companion to the talk I gave at &lt;a href=&quot;http://chinog.org/meetings/chi-nog-07/&quot;&gt;CHI-NOG 07&lt;/a&gt;. 
The slides are &lt;a href=&quot;/dist/2017-05-Dugan-CHINOG-FlexibleNetworkAnalyticsInTheCloud.pdf&quot;&gt;here&lt;/a&gt; and
I will add a link to the video once it is available.&lt;/p&gt;

&lt;h2 id=&quot;hard-realities&quot;&gt;Hard Realities&lt;/h2&gt;

&lt;p&gt;In principle, network telemetry and analytics seem quite simple. In fact, at first glance,
it seems more the domain of an accountant than a network engineer. The appearances are
deceiving however. There are four hard realities that we need to discuss which will set
the stage for understanding our approach.&lt;/p&gt;

&lt;h3 id=&quot;reality-1-its-a-mess&quot;&gt;Reality #1: It’s a mess&lt;/h3&gt;

&lt;p&gt;The first hard reality is that nothing is as clean and simple as we hope it
would be. In fact, it’s a mess. It seems like telemetry is the last thing a
vendor adds support for.  I suppose this makes sense, the features need to
work if they’re going to sell boxes, but it’s frustrating for those of us that
have to measure things. We get stuck with proprietary MIBs that don’t have
clear semantics and some things can’t easily be measured through SNMP which means 
screen scraping. And even if we get clear descriptions from the vendors and
don’t have to scrape data there’s still the issue that it isn’t neatly bundled
into evenly spaced measurements. Or the annoying reality that we lose some
measurements. And once in a while there is the joy of discovering that sometimes
a counter which is guaranteed to increase monotonically sometimes decreases a 
little bit and then jumps back up.&lt;/p&gt;

&lt;p&gt;If we build our tools assuming these kind of problems don’t happen we end up 
hacking in quick fixes in an ad-hoc way which quickly leads to unmaintainable code.&lt;/p&gt;

&lt;p&gt;The world is not neat and tidy. We know this and more or less accept it as true.
However, when it comes to our data we sometimes make the mistake of assuming that
it will be neat and tidy. This is a mistake. Your data (and my data) are not neat 
and tidy. This is something we need to accept as a reality. We can incorporate
this reality into our design.&lt;/p&gt;

&lt;h3 id=&quot;reality-2--things-change&quot;&gt;Reality #2:  Things change&lt;/h3&gt;

&lt;p&gt;What you needed yesterday probably isn’t what you’ll need tomorrow, so you
have to build something today that will work tomorrow. The telemetry and 
analysis of today often continues to be useful but just as often there
are new kinds of telemetry and analysis that are needed as time progresses.&lt;/p&gt;

&lt;p&gt;The second hard reality is that things change. To make things worse
you have no real way of knowing what you’ll need tomorrow. Sure you can make
some good guesses but there are always surprises.&lt;/p&gt;

&lt;p&gt;Don’t make decisions today that you can’t unmake tomorrow.
Save your raw data. All of it if possible. If you don’t save your 
raw data then you only have the processed data which may or may not
include the details you need for future analysis. Resist the urge to
format the data in a way that seems convenient today, especially if 
that formatting removes parts of the raw data.&lt;/p&gt;

&lt;p&gt;There are of course two major caveats here. The first one is that if saving
the raw data presents a security risk it may be better to remove the parts
of the data that are sensitive. The second is that you may be subject to a 
data retention policy and that may limit how much data you can save. Even
with these two caveats in mind the general idea still applies.&lt;/p&gt;

&lt;p&gt;Finally, saving raw data is a great hedge against mistakes. If you have the
raw data you can always recompute some analysis if you find that the original
implementation of the analysis has a bug. If you discard the raw data, you’re
out of luck.&lt;/p&gt;

&lt;h3 id=&quot;reality-3-theres-always-more&quot;&gt;Reality #3: There’s always more&lt;/h3&gt;

&lt;p&gt;Great, you’ve now been able to build a system that is flexible enough to take on
future needs as well as current needs.  The problem is that it’s something
you’ve built on top of hardware you ordered a few years ago.  It chugs along
fine until one month you need to add collection of a new set of measurements
from all of your devices. Or you have a whole bunch more devices you need to
measure, it doesn’t scale.&lt;/p&gt;

&lt;p&gt;The third hard reality is that there’s always more. The demand will always increase.
There are always new devices coming online and more telemetry you can collect.
Your storage and compute will be the same size tomorrow as they are today.&lt;/p&gt;

&lt;p&gt;If you run your own infrastructure you’ll have to upgrade it eventually. If you
over provision it you’ll have to pay power and maintenance on equipment you
aren’t fully using. And most importantly, are you a network engineer or a
sysadmin? Is running this kind of stuff really your strength?  By using cloud
infrastructure you spend far less time worrying about your pet machines, instead
you have access to a huge pool of livestock.&lt;/p&gt;

&lt;p&gt;The cloud is elastic, it allows you to grow as demand increases and only pay for what 
you use. Perhaps you need to run a large job to answer a question for the CTO by
the end of the week, you can simply fire up more instances and use them to run
your job and then shut them off when you’ve got the analysis you need. The cloud
is effectively infinitely large – it will always have more capacity than you can
consume.&lt;/p&gt;

&lt;h3 id=&quot;reality-4-its-never-really-done&quot;&gt;Reality #4: It’s never really done&lt;/h3&gt;

&lt;p&gt;Our aspirations often exceed our resources and sometimes our abilities. This is
just part of life. Technology has greatly increased our reach but
we’re still limited. Further, the situation on the ground changes often causing 
changes in priorities.&lt;/p&gt;

&lt;p&gt;The fourth hard reality is that nothing is really finished. Even if it is finished
for a short time something will change and it will need to be amended. Resources
are always limited. As a result I think it’s important to focus on the “what” –
what you want to extract from your telemetry – rather than the “how” of the details
needed to run your analysis.  The “how” is a distraction
(sometimes a fun one) but the more time you spend worrying about the “how” the
less time you have for the “what”. After some initial setup the cloud gives you
the opportunity to focus more on the what: the analysis you need to run your network
more efficiently.&lt;/p&gt;

&lt;h2 id=&quot;coping-strategies&quot;&gt;Coping Strategies&lt;/h2&gt;

&lt;p&gt;I’ve talked about these four hard realities and proposed some coping strategies.
To recap: It’s a mess – don’t assume it will be anything but a mess – design
your system to embrace that fact, don’t make assumptions that things will be
uniform or simple.  Things constantly change – don’t make decisions today that
you can put off until tomorrow. In particular, keep raw data so that you can
look for different things tomorrow than you are looking for today.  There will
always be more: more data to collect and analyze, more questions to be answered.
The cloud provides elasticity – pay for what you use and near infinite
scalability.  It’s never really done – there are always resource limits.
Maximize the amount of time you spend on the “what” and minimize how much time
you spend on the “how”.  Prefer declarative solutions over imperative solutions.&lt;/p&gt;

&lt;h2 id=&quot;a-programming-model-brings-solace&quot;&gt;A programming model brings solace&lt;/h2&gt;

&lt;p&gt;The second part of our journey towards doing network analytics in the cloud 
comes in the form of a programming model: &lt;a href=&quot;https://beam.apache.org/&quot;&gt;Apache Beam&lt;/a&gt;.
Beam incorporates three components:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;A programming model&lt;/li&gt;
  &lt;li&gt;SDKs for writing Beam pipelines&lt;/li&gt;
  &lt;li&gt;Runners which work on top of existing distributed processing backends&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal of Beam is to provide a common abstraction for describing distributed 
processing jobs while remaining agnostic about the underlying execution engine.
You can run it on premises using one of several runners that work with other
Apache projects such as &lt;a href=&quot;http://spark.apache.org/&quot;&gt;Spark&lt;/a&gt;, &lt;a href=&quot;http://flink.apache.org/&quot;&gt;Flink&lt;/a&gt; 
and others. You can run it on top of Google’s &lt;a href=&quot;https://cloud.google.com/dataflow/&quot;&gt;Cloud Dataflow&lt;/a&gt;.
You can even run it locally using the DirectRunner, which is primarily useful
for development and testing.&lt;/p&gt;

&lt;p&gt;Beam gives you control over how data is processed and provides semantics similar
to both traditional batch systems and streaming systems. In particular, it 
provides ways to answer each of these questions:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;What results are calculated?&lt;/li&gt;
  &lt;li&gt;Where in event time are results calculated?&lt;/li&gt;
  &lt;li&gt;When in processing time are results materialized?&lt;/li&gt;
  &lt;li&gt;How do refinements of results relate?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first question is the most fundamental of these questions – what
is it that you want to extract from your data. The second question brings to 
the forefront that the timestamp of the event is what is used to process 
the result as opposed to where in the incoming data stream that even is 
encountered. The third question gives control over when during the processing
run results are emitted. This allows you to tune your results towards
completeness or towards lower latency. Finally, Beam provides a way for
updating results that have already been emitted. This is addressed in the final
question.&lt;/p&gt;

&lt;h2 id=&quot;making-the-ascent-with-code&quot;&gt;Making the ascent with code&lt;/h2&gt;

&lt;p&gt;I mentioned that this wouldn’t be a magic solution to all your problems. This
is where some exertion can pay off. It may take a little mental effort to
understand the tooling and build something with it, but doing so provides
a great deal of leverage and an improved point of view.&lt;/p&gt;

&lt;h3 id=&quot;immutable-data-store-of-raw-data&quot;&gt;Immutable data store of raw data&lt;/h3&gt;

&lt;p&gt;I’ve said a lot about keeping raw data. And I’m not quite done.  The fundamental
message here is to do as little processing of your data as you can before you save the
first copy. Get it written to database/disk as soon as you can. Avoid the urge
to mess with it. Don’t even think about changing it after the fact. It’s called
the immutable data store because it should form the unchanging basis for all your analysis.
Changing it is an unnecssary risk.&lt;/p&gt;

&lt;p&gt;The two big benefits here are:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;You can change your mind later: if you have the data in a raw form which was
no different then than it is now. You can choose to look at different parts of
it.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you make a mistake in your analysis you still have the raw data so you
can rerun the analysis with the bugs fixed and get an improved result. Sure,
this might incur some cost but at least you still have the option. Also, costs
really aren’t very high when compared to developer time.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;views-how-to-turn-raw-data-into-usable-data&quot;&gt;Views: how to turn raw data into usable data&lt;/h3&gt;

&lt;p&gt;Raw data is great for machines but it isn’t so great for humans and ultimately
it’s humans who want to derive insights from all this data. The way to solve
this is a view.&lt;/p&gt;

&lt;p&gt;A view takes raw data and creates a new dataset with more details or 
presented in a more usable way. For example, you rarely care about the total number of
bytes that have gone through an interface. Instead you want to know at what rate
bits are going through that interface. You don’t want to think that ethernet
0 is ifIndex 37, instead you just want to see xe-0/0/0.&lt;/p&gt;

&lt;p&gt;Views take the raw data and produce something that provides more insight.&lt;/p&gt;

&lt;p&gt;These views can be stacked on top of each other, say you have a view that has
the counters converted to rates and the interfaces names in place of the
ifIndex.  You could use this view to create views that aggregate interfaces
together by peer or customer.&lt;/p&gt;

&lt;p&gt;The examples I’ve given are SNMP based because that is our current development
focus, but this is also applicable to flow analysis – in fact it will really
shine for flow.  You can imagine making a view that takes a set of customer or
peer prefixes and creates a traffic matrix. The nice thing is that since you
have the raw data you can go back in time and create new views that use older
data.&lt;/p&gt;

&lt;h3 id=&quot;core-beam-abstractions&quot;&gt;Core Beam Abstractions&lt;/h3&gt;

&lt;p&gt;In order to understand how we use Beam to analyze network data we’ll need to 
understand four key abstractions from Beam.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;PCollections&lt;/strong&gt; A PCollection is a distributed multi-element dataset. PCollections
are how Beam presents data as input and output and in between every stage in a pipeline.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Transforms&lt;/strong&gt; Transforms are the code that make up each stage of the pipeline. You 
will write your own Transforms to accomplish your analysis. There are also many 
predefined Transforms. Transforms take a PCollection as input and produce a PCollection
as output.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Pipeline I/O&lt;/strong&gt; Pipeline I/O is how you access data and how you save results.
Pipeline I/O will read in data and produce a PCollection or will take a PCollection
and write output.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Pipelines&lt;/strong&gt; Pipelines are the composition of I/O, PCollections and Transforms.
These are similar in many ways to Unix shell pipelines. Pipelines can be linear
or can have an arbitrary number of branches.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;fallofmydata-focus-on-what-not-how&quot;&gt;f(allOfMyData): Focus on “what”, not “how”&lt;/h3&gt;

&lt;p&gt;You’ve decided you need to run a new kind of analysis on your network telemetry.
The first step is to define some function &lt;em&gt;f&lt;/em&gt; and apply it to all of your data.
This is exactly the task Beam was designed for. You define what you want to do
and Beam works out how to push all of your data through your code. For clarity, 
you’ll define a set of functions which you will compose into a pipeline and 
execute the pipeline over your data. A pipeline is a kind of functional composition.&lt;/p&gt;

&lt;p&gt;When building a pipeline you define the what:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;I/O: What data do you want to analyze? Specify where it lives.&lt;/li&gt;
  &lt;li&gt;PCollections: What is the best shape for the data during each step of the analysis?&lt;/li&gt;
  &lt;li&gt;Transforms: What analysis do you want to perform? Implement the proper Transforms.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let Beam handle the how:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;I/O: Once given a data source and sink. Beam will fire up enough workers to
load the data and create a PCollection of the input. Beam also takes care of
writing the output.&lt;/li&gt;
  &lt;li&gt;PCollections: By using the PCollection abstraction to model your data Beam can
determine how to deliver your data to the appropriate workers.&lt;/li&gt;
  &lt;li&gt;Transforms: This code is distributed to the appropriate workers and executed
on the PCollections.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;example-computing-total-traffic&quot;&gt;Example: Computing Total Traffic&lt;/h3&gt;

&lt;p&gt;Here’s a short pipeline in Beam.  Don’t worry if you don’t get all of the
details in the first pass; understanding the high level way a pipeline is
constructed is the goal.&lt;/p&gt;

&lt;p&gt;This pipeline will sum all the inbound traffic from all the interfaces given to
it. Perhaps the list of interfaces is all external facing interfaces or perhaps
from just one customer or peer.&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;FormatCSVDoFn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;beam&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DoFn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;&quot;&quot;
    Read in CSV lines
    &quot;&quot;&quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;__init__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FormatCSVDoFn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;__init__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;process&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;fields&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;','&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

        &lt;span class=&quot;k&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;ret&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;dict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fields&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]),&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;device&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fields&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;ifName&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fields&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;ifHCInOctets&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fields&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]),&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;ifHCOutOctets&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fields&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]),&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

            &lt;span class=&quot;k&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ret&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;except&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;ValueError&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;logging&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'filtered out &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fields&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;compute_rate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;rows&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;out&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)):&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;previous&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;delta_t&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'timestamp'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;previous&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'timestamp'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;dict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'timestamp'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;device&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'device'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;ifName&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'ifName'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;rateIn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'ifHCInOctets'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;previous&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'ifHCInOctets'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;delta_t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;rateOut&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'ifHCOutOctets'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;previous&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'ifHCOutOctets'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;delta_t&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;out&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;group_by_device_interface&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;{} {}&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'device'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'ifName'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;pipeline&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beam&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Pipeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'DirectRunner'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pipeline&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'read'&lt;/span&gt;               &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ReadFromText&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'./small_example.csv'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'csv'&lt;/span&gt;                &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beam&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ParDo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FormatCSVDoFn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'ifName key'&lt;/span&gt;         &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beam&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;group_by_device_interface&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'group by iface'&lt;/span&gt;     &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beam&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GroupByKey&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'compute rate'&lt;/span&gt;       &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beam&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FlatMap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;compute_rate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'timestamp key'&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beam&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'timestamp'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'rateIn'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]))&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'group by timestamp'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beam&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GroupByKey&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'sum by timestamp'&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beam&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;deltas&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deltas&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deltas&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])))&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'format'&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beam&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'{},{}'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]))&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'save'&lt;/span&gt;               &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beam&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;io&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;WriteToText&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'./total_by_timestamp'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pipeline&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Let’s take a look at the &lt;code class=&quot;highlighter-rouge&quot;&gt;main()&lt;/code&gt; function.  The first thing to note is that the text between the &lt;code class=&quot;highlighter-rouge&quot;&gt;|&lt;/code&gt; and the &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;gt;&amp;gt;&lt;/code&gt; is 
a description of what this pipeline stage does. The part after the &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;gt;&amp;gt;&lt;/code&gt; is the code the defines that stage. The 
description helps understand what the pipeline does and in some runners it is used to provide statistics about each stage.&lt;/p&gt;

&lt;p&gt;Let’s look at each step of the pipeline:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;read&lt;/strong&gt; We read data, in this case it’s from a CSV but this would really be your immutable data store / data warehouse.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;csv&lt;/strong&gt; Takes each line of text from the input PCollection and converts it into an object with the appropriate fields.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;ifName key&lt;/strong&gt; This produces a key value pair which we use in the next step. The key is the combination of the device name
and the interface name.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;group by interface&lt;/strong&gt; We use the built in &lt;code class=&quot;highlighter-rouge&quot;&gt;beam.GroupByKey()&lt;/code&gt; to group the interfaces by device name and interface name.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;compute rate&lt;/strong&gt; We get the raw counter measurements, compute deltas and divide by the collection interval. This produces a PCollection
of Python dictionaries that hold the details for each datapoint.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;timestamp key&lt;/strong&gt; Once we have the rates, then we produce a new PCollection that is keyed by timestamp and has each datapoint as a value.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;group by timestamp&lt;/strong&gt; We once again use &lt;code class=&quot;highlighter-rouge&quot;&gt;beam.GroupByKey()&lt;/code&gt; to group everything by timestamp so that we can sum up across each interface at each timestamp.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;sum by timestamp&lt;/strong&gt; Sum all the interfaces at each timestamp.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;format&lt;/strong&gt; Prepare the data for writing.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;save&lt;/strong&gt; Write the output.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For just a few interfaces this isn’t particularly impressive, but if you needed
to handle thousands of interfaces Beam will automatically scale this to an
appropriate number of workers and execute this code for you across many workers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; This code will only work properly when executing locally using DirectRunner. 
The issue is that &lt;code class=&quot;highlighter-rouge&quot;&gt;compute_rate&lt;/code&gt; will run on multiple nodes in the cloud, so the data won’t all 
be available to every instance of the function. 
This can be solved by using a 
&lt;a href=&quot;https://beam.apache.org/documentation/programming-guide/#transforms-combine&quot;&gt;Combine&lt;/a&gt;
operation.
I’ll post a more detailed look at the code with the solution for that problem in the next few days.
I’m contradicting myself here, I suppose, by ignoring the hard truth of messiness for the sake of 
a clear example.&lt;/p&gt;

&lt;h3 id=&quot;good-fast-cheap-pick-two&quot;&gt;Good. Fast. Cheap. Pick two.&lt;/h3&gt;

&lt;p&gt;Now that we’ve seen an example of a pipeline, let’s talk a little bit about the tradeoffs involved in 
using Beam pipelines. There’s always tradeoffs, it’s a fundamental feature of engineering.&lt;/p&gt;

&lt;p&gt;The three main tradeoffs to consider with Beam pipelines are&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Completeness&lt;/li&gt;
  &lt;li&gt;Latency&lt;/li&gt;
  &lt;li&gt;Cost&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you need a complete answer you need all of the data. However, sometimes quick
access to results is more important that completely correct answers. Finally, 
you can make some gains by spending more money. The specific choices between
these three are very much dependent on the needs of your organization.&lt;/p&gt;

&lt;p&gt;Usually completeness is accomplished by running jobs in batch mode. When you
run in batch mode you wait until you are reasonably sure that you have all of 
your data and run a job that loads all the data at once and analyzes it. Usually
low latency is accomplished by running jobs in streaming mode. Instead of waiting
until you have all of the data you perform your computations as each data point
arrives. Often this means that your answers aren’t completely correct but they
are available much more quickly.&lt;/p&gt;

&lt;p&gt;Beam provides abstractions for dealing with both of these data processing styles.
In fact it doesn’t really view the world in terms of batch and stream, instead
it views the world in terms of bounded and unbounded data sets. Bounded data sets
have a known size and can be processed all at once. Where as unbounded data sets
have an unknown size and may continue indefinitely. The Beam model generalizes 
over these two kinds of data sets.&lt;/p&gt;

&lt;h3 id=&quot;stream-or-batch&quot;&gt;Stream or Batch?&lt;/h3&gt;

&lt;p&gt;Streaming for real time insight&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Current network load&lt;/li&gt;
  &lt;li&gt;Operational awareness&lt;/li&gt;
  &lt;li&gt;Threat detection / Anomaly Detection&lt;/li&gt;
  &lt;li&gt;Tend to be more expensive (VMs always running)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Batch for precision or results that can wait&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Billing&lt;/li&gt;
  &lt;li&gt;Precise traffic reports&lt;/li&gt;
  &lt;li&gt;Capacity planning&lt;/li&gt;
  &lt;li&gt;Tend to be cheaper (VMs used in bursts)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;a-scenic-vista&quot;&gt;A scenic vista&lt;/h2&gt;

&lt;h3 id=&quot;the-view-from-here&quot;&gt;The view from here&lt;/h3&gt;

&lt;p&gt;We can see how this approach helps to address each of the hard realities I
described at the beginning:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;It’s a mess&lt;/strong&gt; Having the raw data means that we don’t try to sanitize it at
collection time but instead do that as part of a transformation to a view.  If
we find new messes in the data we can update our view code and rerun it.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Things change&lt;/strong&gt; We can unmake today’s decisions tomorrow because we have raw
data. This means we can create new views to get new perspectives.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;There’s always more&lt;/strong&gt; We can collect more telemetry by adding new immutable
data sets to gain more dimensions of data (SNMP, Flow/sFlow, syslog, …). The
cloud allows us to scale up or down as needed and we don’t have to spend our
time worrying about the details of storing the data.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;It’s never really done&lt;/strong&gt; Because we have a clearly defined approach and access
to resources to analyze data on demand it is possible to try out new ideas quickly 
and cheaply. We can also teach others to use these tools to write their own analysis.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;our-experiences-so-far&quot;&gt;Our experiences so far&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;There is a learning curve. Beam provides a lot of leverage, but you need to
take the time to learn it.&lt;/li&gt;
  &lt;li&gt;The documentation isn’t amazing, but it’s getting better all the time. The community
is very enthusiastic and helpful.&lt;/li&gt;
  &lt;li&gt;You may have to adjust your thinking. Need to understand the model to know
what will work at scale.  For example, the &lt;code class=&quot;highlighter-rouge&quot;&gt;Combine&lt;/code&gt; issue I mentioned in the
code example was a definite head scratcher the first time we ran into it.&lt;/li&gt;
  &lt;li&gt;The cloud providers have several choices when it comes to databases. It’s
easy to spend a lot of time investigating.&lt;/li&gt;
  &lt;li&gt;Cost is manageable but it’s good to keep an eye on it.&lt;/li&gt;
  &lt;li&gt;In the interest of vendor neutrality details about our specific vendor
haven’t been covered. In particular I’ve been rather vague on how we build
our immutable data store and which execution engine we use. 
I hope to cover those details in a future post.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;further-reading&quot;&gt;Further Reading&lt;/h2&gt;

&lt;p&gt;The Beam &lt;a href=&quot;https://beam.apache.org&quot;&gt;web site&lt;/a&gt; is a great place to find more information. They
have a lot of &lt;a href=&quot;https://beam.apache.org/documentation/resources/&quot;&gt;additional learning resources&lt;/a&gt;.
I particularly recommend two articles written by one of the core Beam developers:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.oreilly.com/ideas/the-world-beyond-batch-streaming-101&quot;&gt;The World Beyond Batch 101&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.oreilly.com/ideas/the-world-beyond-batch-streaming-102&quot;&gt;The World Beyond Batch 102&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our Beam code is not open source at this point. You can learn more about ESnet’s other open source 
&lt;a href=&quot;http://software.es.net/&quot;&gt;software&lt;/a&gt; and see it in use
on our &lt;a href=&quot;https://my.es.net/&quot;&gt;network visualization portal&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;thanks&quot;&gt;Thanks&lt;/h2&gt;

&lt;p&gt;Thanks to Peter Murphy and David Mitchell for the many discussions and refinements to these ideas over time.
Thanks to Melissa Stockman, Sowmya Balasubramanian and Monte Goode who worked hard on the prototype implementation of these ideas.
Thanks to Michael Dopheide and Becky Lomax who proof read this post.
Many of the ideas presented here were first introduced to me by &lt;a href=&quot;http://lambda-architecture.net/&quot;&gt;The Lambda Architecture&lt;/a&gt; and 
the &lt;a href=&quot;https://www.manning.com/books/big-data&quot;&gt;Big Data&lt;/a&gt; book by Nathan Marz and James Warren.&lt;/p&gt;</content><author><name>Jon M. Dugan</name></author><summary type="html">Analyzing network data can be a daunting task. Some days you end up feeling like Sisyphus the Network Engineer. I’d like to talk about an approach to network analytics that we have been exploring at ESnet based on using cloud services. The cloud isn’t a magical solution, of course, but it does provide quite a bit of leverage. It’s been a bit of a journey for us and if you go this route it will definitely take some work. I think the effort is worth it – the view at the end is really quite nice.</summary></entry><entry><title type="html">Modern Tools for Visualizing Network Traffic</title><link href="http://x1024.net/blog/2016/05/chinog-modern-network-visualization-tools/" rel="alternate" type="text/html" title="Modern Tools for Visualizing Network Traffic" /><published>2016-05-12T17:00:00-05:00</published><updated>2016-05-12T17:00:00-05:00</updated><id>http://x1024.net/blog/2016/05/chinog-modern-network-visualization-tools</id><content type="html" xml:base="http://x1024.net/blog/2016/05/chinog-modern-network-visualization-tools/">&lt;p&gt;I gave a talk at &lt;a href=&quot;http://chinog.org/meetings/chi-nog-06/&quot;&gt;CHI-NOG 06&lt;/a&gt;
on how to build data driven, interactive network traffic maps
and time series charts of network traffic.
It starts with a very brief introduction to ESnet’s overall data analysis and visualization
approach and then quickly moves into demonstrating the capabilities of the libraries we have developed and showing how to use them with your own data. This code is used extensively in the publicly visible &lt;a href=&quot;https://my.es.net/&quot;&gt;ESnet portal&lt;/a&gt;. The libraries are open source and the documentation can be found at:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://software.es.net/react-network-diagrams/&quot;&gt;React Network Diagrams&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://software.es.net/react-timeseries-charts/&quot;&gt;React Time Series Charts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are &lt;a href=&quot;http://chinog.org/wp-content/uploads/2016/05/12.-Modern-Tools-for-Visualizing-Network-Traffic-1.pptx&quot;&gt;slides&lt;/a&gt;.  Here is the video:&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/86hhxwPCmQk&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;</content><author><name>Jon M. Dugan</name></author><category term="foo" /><category term="bar" /><category term="quux" /><summary type="html">I gave a talk at CHI-NOG 06 on how to build data driven, interactive network traffic maps and time series charts of network traffic. It starts with a very brief introduction to ESnet’s overall data analysis and visualization approach and then quickly moves into demonstrating the capabilities of the libraries we have developed and showing how to use them with your own data. This code is used extensively in the publicly visible ESnet portal. The libraries are open source and the documentation can be found at:</summary></entry><entry><title type="html">ESnet’s Network Visualization Toolkit</title><link href="http://x1024.net/blog/2015/10/techex-viz-toolkit/" rel="alternate" type="text/html" title="ESnet's Network Visualization Toolkit" /><published>2015-10-05T17:00:00-05:00</published><updated>2015-10-05T17:00:00-05:00</updated><id>http://x1024.net/blog/2015/10/techex-viz-toolkit</id><content type="html" xml:base="http://x1024.net/blog/2015/10/techex-viz-toolkit/">&lt;p&gt;The &lt;a href=&quot;https://my.es.net/&quot;&gt;MyESnet Portal&lt;/a&gt; was built to provide high quality visualization of the ESnet network. The portal has been successful in delivering these visualizations and many other organizations have expressed interested in building similar visualizations. The ESnet Tools Team has extracted the visualization elements from the portal and packaged them as reusable components. These components will be available as open source by the end of the summer.&lt;/p&gt;

&lt;p&gt;This talk will walk through various components used to visualize data on the portal providing a conceptual introduction to each component as well as a brief example of how the component can be used. The primary focus will be on the time series charting component and the interactive traffic map component with some attention being devoted to an explanation of time series data abstractions used throughout the components. If time allows other components may be shown as well as a discussion of the tooling involved in building the components.&lt;/p&gt;

&lt;p&gt;While our use cases center around network data the time series abstractions and visualizations are applicable to many other use cases. For example both security folks and general IT folks may find these tools useful for exploring event logs.&lt;/p&gt;

&lt;p&gt;There are &lt;a href=&quot;http://meetings.internet2.edu/media/medialibrary/2015/10/02/20151005-Dugan-VisualizationToolkit.pdf&quot;&gt;slides&lt;/a&gt;, a &lt;a href=&quot;http://meetings.internet2.edu/2015-technology-exchange/detail/10003924/&quot;&gt;video&lt;/a&gt; and a &lt;a href=&quot;https://github.com/esnet/mini-portal&quot;&gt;GitHub repo&lt;/a&gt; for this talk.&lt;/p&gt;</content><author><name>Jon M. Dugan</name></author><summary type="html">The MyESnet Portal was built to provide high quality visualization of the ESnet network. The portal has been successful in delivering these visualizations and many other organizations have expressed interested in building similar visualizations. The ESnet Tools Team has extracted the visualization elements from the portal and packaged them as reusable components. These components will be available as open source by the end of the summer.</summary></entry><entry><title type="html">PyCon 2014 Notes</title><link href="http://x1024.net/blog/2014/04/pycon-2014/" rel="alternate" type="text/html" title="PyCon 2014 Notes" /><published>2014-04-25T00:00:00-05:00</published><updated>2014-04-25T00:00:00-05:00</updated><id>http://x1024.net/blog/2014/04/pycon-2014</id><content type="html" xml:base="http://x1024.net/blog/2014/04/pycon-2014/">&lt;p&gt;My notes from &lt;a href=&quot;http://pyvideo.org/category/50/pycon-us-2014&quot;&gt;PyCon 2014&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;john-perry-barlow&quot;&gt;John Perry Barlow&lt;/h2&gt;

&lt;p&gt;Go back – couple of fun quotes&lt;/p&gt;

&lt;h2 id=&quot;all-your-ducks-in-a-row-data-structures-brandon-rhodes&quot;&gt;All Your Ducks In A Row: Data Structures, Brandon Rhodes&lt;/h2&gt;

&lt;p&gt;Further reading:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What your computer does while you wait&lt;/li&gt;
  &lt;li&gt;Misaligning Data Can Increase Performance 12x, Dan Luu&lt;/li&gt;
  &lt;li&gt;but python standard library doesn’t pay much attention to memory hierachies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Notes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;int is 24 bytes for 8 bytes of data, ref count, address of type, then data&lt;/li&gt;
  &lt;li&gt;struct module, array module&lt;/li&gt;
  &lt;li&gt;python special arracys, str, unicode, memoryview, etc&lt;/li&gt;
  &lt;li&gt;NumPy array for math, Python array for I/O/talking to C libraries&lt;/li&gt;
  &lt;li&gt;NumPy and Blaze&lt;/li&gt;
  &lt;li&gt;“All problems in CS can be solved by another level of indirection.” – David Wheeler&lt;/li&gt;
  &lt;li&gt;indirection: “Python: the language that gives you data structures w/o the actual data.”&lt;/li&gt;
  &lt;li&gt;tuples can do bounds checks! ;)&lt;/li&gt;
  &lt;li&gt;a thousand and a million, thousand: 3 0’s O(n), 4 0’s O(n ln n), 6 0’s O(x**2)&lt;/li&gt;
  &lt;li&gt;speed vs. space tradeoff, lists 94% populated on average, 6% waste&lt;/li&gt;
  &lt;li&gt;The Mighty Dictionary, PyCon 2010, Brandon Rhodes&lt;/li&gt;
  &lt;li&gt;list is about order, dict is about association – OrderedDict does both&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;__slots__&lt;/code&gt; makes a class that uses a struct rather than a dict&lt;/li&gt;
  &lt;li&gt;bisect module – binary search&lt;/li&gt;
  &lt;li&gt;deque list which can modify both ends&lt;/li&gt;
  &lt;li&gt;heapq and PriorityQueue&lt;/li&gt;
  &lt;li&gt;generally we’ve outsourced trees to the data persistence layer&lt;/li&gt;
  &lt;li&gt;“The Clean Architecture in Python”, Brandon Rhodes, PyCon 2013&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;cache-me-if-you-can&quot;&gt;Cache me if you can,&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;review on video&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;decorators-a-powerful-weapon-in-your-python-aresenal-colton-myers-basepi&quot;&gt;Decorators: A Powerful Weapon in your Python Aresenal, Colton Myers, @basepi&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;SaltStack&lt;/li&gt;
  &lt;li&gt;decorators wrap functions
    &lt;ul&gt;
      &lt;li&gt;add functionality&lt;/li&gt;
      &lt;li&gt;modify behvaiour&lt;/li&gt;
      &lt;li&gt;setup/teardown&lt;/li&gt;
      &lt;li&gt;diagnostics&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;functions in Python are objects, first class functions&lt;/li&gt;
  &lt;li&gt;functions can create other functions&lt;/li&gt;
  &lt;li&gt;decorators are (usually) closures&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;@decorator is syntactic sugar:&lt;/p&gt;

    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  @decorate
  def myfunc():
      pass

  myfunc = decorate(myfunc)
&lt;/code&gt;&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Good decorators are versatile, use *args and **kwargs&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;myfunc.__name__&lt;/code&gt; -&amp;gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;'inner'&lt;/code&gt; – copy &lt;code class=&quot;highlighter-rouge&quot;&gt;__name__&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;__doc__&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;what about argspec, etc?  wrapt, &lt;a href=&quot;http://bit.ly/decorators2014&quot;&gt;Graham Dumpleton&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;porting-from-python-2-to-3&quot;&gt;Porting from Python 2 to 3&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Testing story is critical&lt;/li&gt;
  &lt;li&gt;Note port once, instead support 2 and 3 for some time&lt;/li&gt;
  &lt;li&gt;Straddling 2 and 3&lt;/li&gt;
  &lt;li&gt;use compatible subset of Python&lt;/li&gt;
  &lt;li&gt;conditional imports for stdlib changes&lt;/li&gt;
  &lt;li&gt;six can help but may not be necessary&lt;/li&gt;
  &lt;li&gt;Supporting less than Python 2.6 is hard due to syntax changes&lt;/li&gt;
  &lt;li&gt;3.2 bare minimum for 3, 3.4 next LTS&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;ansible&quot;&gt;Ansible&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Missed due to Inder meeting, review on video&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;death-of-javascript&quot;&gt;Death of JavaScript&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Missed due to Inder meeting, review on video&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;getting-starting-with-machine-learning&quot;&gt;Getting starting with machine learning&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Good intro&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;realtime-analytics-using-celery&quot;&gt;Realtime analytics using Celery&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;SciKit-learn&lt;/li&gt;
  &lt;li&gt;Pika AMPQ library: http://pika.readthedocs.org/en/latest/&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;distributed-computing-is-hard-lets-go-shopping&quot;&gt;Distributed Computing Is Hard, Let’s Go Shopping&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Fallacies of Distributed Computing, Peter Deutsch&lt;/li&gt;
  &lt;li&gt;LoggingAdapter&lt;/li&gt;
  &lt;li&gt;Testing
    &lt;ul&gt;
      &lt;li&gt;develop/test outside celery&lt;/li&gt;
      &lt;li&gt;test with a single worker/job&lt;/li&gt;
      &lt;li&gt;test with one work, multiple concurrent jobs&lt;/li&gt;
      &lt;li&gt;test with multiple servers&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;http://brolewis.com&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;an-in and Fan-out, Brett Slatkin&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;https://github.com/bslatkin/pycon2014&lt;/li&gt;
  &lt;li&gt;The Crucial Components of Concurrency&lt;/li&gt;
  &lt;li&gt;Why do we need Tulip?&lt;/li&gt;
  &lt;li&gt;Fan-out: when one theread of control spawns one or more new threads of control&lt;/li&gt;
  &lt;li&gt;Fan-in: when one thread of control gathers results from one or more threads of control&lt;/li&gt;
  &lt;li&gt;Building a web crawler the old way:
    &lt;ol&gt;
      &lt;li&gt;fetch&lt;/li&gt;
      &lt;li&gt;extract&lt;/li&gt;
      &lt;li&gt;crawl (breadth first search)&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;The new way, using Tulip&lt;/li&gt;
  &lt;li&gt;It’s everywhere!
    &lt;ul&gt;
      &lt;li&gt;SQL: fan-out – join, fan-in – group by&lt;/li&gt;
      &lt;li&gt;MapReduce, fan-out – map, fan-in – reduce&lt;/li&gt;
      &lt;li&gt;Measurement: Histograms, Reservoir samplers, profilers, estimators&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;PEP3156 - asyncio&lt;/li&gt;
  &lt;li&gt;App Engine’s NDB library&lt;/li&gt;
  &lt;li&gt;C# async/await – ES7 generators&lt;/li&gt;
  &lt;li&gt;“Concurrency is not Parallelism”&lt;/li&gt;
  &lt;li&gt;@haxor, onebigfluke.com&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;lightning-talks-friday-pm&quot;&gt;Lightning Talks, Friday PM&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Traversing the Montreal Metro with Python
    &lt;ul&gt;
      &lt;li&gt;https://github.com/leafstorm/montreal-metro&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;12 yro Python programer&lt;/li&gt;
  &lt;li&gt;Scrape interactive: @yarkot
    &lt;ul&gt;
      &lt;li&gt;scrape.readthedocs.org&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Pair programming the hackbright academy
    &lt;ul&gt;
      &lt;li&gt;10 week full stack developer training for women&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Teaching data science with Python&lt;/li&gt;
  &lt;li&gt;Structured logging
    &lt;ul&gt;
      &lt;li&gt;formatting, invisible to app code&lt;/li&gt;
      &lt;li&gt;context&lt;/li&gt;
      &lt;li&gt;structlog, wraps anything&lt;/li&gt;
      &lt;li&gt;https://github.com/hynek/structlog&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Python .NET, John Gill&lt;/li&gt;
  &lt;li&gt;Certificate Based SSH, Bob VanZandt
    &lt;ul&gt;
      &lt;li&gt;https://github.com/cloudtools/ssh-ca&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Physics of Bowling, Jack Diederich&lt;/li&gt;
  &lt;li&gt;DIY stuffed animals
    &lt;ul&gt;
      &lt;li&gt;blender, numpy and PIL&lt;/li&gt;
      &lt;li&gt;3-D model&lt;/li&gt;
      &lt;li&gt;https://github.com/caretdashcaret/Patternfy&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Positive Python: IRC channel
    &lt;ul&gt;
      &lt;li&gt;#positivepython&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;lightning-talks-saturday-am&quot;&gt;Lightning Talks, Saturday AM&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;peep
    &lt;ul&gt;
      &lt;li&gt;pip install peep&lt;/li&gt;
      &lt;li&gt;track hashes of downloaded packages&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;socialite – hadoop replacement in python?
    &lt;ul&gt;
      &lt;li&gt;http://mobisocial.stanford.edu/&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Starting Simply / Gamify Health project&lt;/li&gt;
  &lt;li&gt;Speeding up EventBrite with one line:
    &lt;ul&gt;
      &lt;li&gt;re._MAXCACHE = 10000&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Software Gardening
    &lt;ul&gt;
      &lt;li&gt;not much relationship to engineering&lt;/li&gt;
      &lt;li&gt;more like taking care of a living thing&lt;/li&gt;
      &lt;li&gt;hmm.&lt;/li&gt;
      &lt;li&gt;look it up&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;python-the-next-generation--jessica-mckellar&quot;&gt;Python, the next generation – Jessica McKellar&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;http://jesstess.com&lt;/li&gt;
  &lt;li&gt;Ask CS to count as math or science credit in HS&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;python--science--fernando-pérez&quot;&gt;Python &amp;amp; Science – Fernando Pérez&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;IPython&lt;/li&gt;
  &lt;li&gt;Amazon Machine image of data and analysis&lt;/li&gt;
  &lt;li&gt;Python for Signal Processing – on GitHub&lt;/li&gt;
  &lt;li&gt;ndbiff – diff and merge IPython notebooks&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;track-memory-leaks-in-python--victor-stinner&quot;&gt;Track memory leaks in Python – Victor Stinner&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;https://github.com/haypo&lt;/li&gt;
  &lt;li&gt;import gc; gc.get_referents(data)&lt;/li&gt;
  &lt;li&gt;objgraph&lt;/li&gt;
  &lt;li&gt;heap fragmentation&lt;/li&gt;
  &lt;li&gt;pytracemalloc: http://pytracemalloc.readthedocs.org, only in 3.4, backports to 2.7 and 3.3&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;designing-djangos-migrations--andrew-godwin&quot;&gt;Designing Django’s Migrations – Andrew Godwin&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Author of South, “Please Stop Using MySQL”, Django 1.7 migration&lt;/li&gt;
  &lt;li&gt;Original plan was to split parts into Django and then South 2&lt;/li&gt;
  &lt;li&gt;Really should be a core part of Django&lt;/li&gt;
  &lt;li&gt;Schema Editor and Migrations&lt;/li&gt;
  &lt;li&gt;SchemaEditor: abstracts schema operations, works in terms of django fields/models, per db workarounds&lt;/li&gt;
  &lt;li&gt;Migrations: migration file reader/writer, dependecy resolver, autodetector, applied/unapplied tracking&lt;/li&gt;
  &lt;li&gt;New migration format: simpler, introspectable, etc&lt;/li&gt;
  &lt;li&gt;PostgreSQL is fine, MySQL some problems, Oracle some problems, SQLite AAAAAHHHHHH!&lt;/li&gt;
  &lt;li&gt;Lessons learnt:
    &lt;ul&gt;
      &lt;li&gt;explicit is better than implicit&lt;/li&gt;
      &lt;li&gt;abstracting DBs is hard&lt;/li&gt;
      &lt;li&gt;composability rocks: eg. history squashing&lt;/li&gt;
      &lt;li&gt;Feedback is vital&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;http://aeracode.org&lt;/li&gt;
  &lt;li&gt;Django 1.7 release May 15 to end of May&lt;/li&gt;
  &lt;li&gt;future support for indicating if migration is blocking/non-blocking&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;designing-poetic-apis--erik-rose&quot;&gt;Designing Poetic APIs – Erik Rose&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Sapir-Whorf Hypothesis&lt;/li&gt;
  &lt;li&gt;“The limits of my language are the limits of my world.” - Wittgenstein&lt;/li&gt;
  &lt;li&gt;Abstracting out symbols is the root of all human language.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
  &lt;li&gt;Don’t be an architecture astronaut
    &lt;ul&gt;
      &lt;li&gt;The best libraries are extracted, not invented&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Consistency “Think like a wise man, but communicate in the language of the people.”
    &lt;ul&gt;
      &lt;li&gt;get(key, default) like dict, not fetch(default, key)&lt;/li&gt;
      &lt;li&gt;fail: need to reference your own documentation&lt;/li&gt;
      &lt;li&gt;fail: are you inventing novel syntax? is it necessary?&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Brevity
    &lt;ul&gt;
      &lt;li&gt;fail: copying chunks of code, probbaly too long&lt;/li&gt;
      &lt;li&gt;fail: always setting an attribute to the same thing – default&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Composibility
    &lt;ul&gt;
      &lt;li&gt;x84 BBS? https://github.com/jquast/x84&lt;/li&gt;
      &lt;li&gt;eg. separate ptinr and formatted&lt;/li&gt;
      &lt;li&gt;fail: classes with lots of state&lt;/li&gt;
      &lt;li&gt;fail: deep inheritance hierarchies&lt;/li&gt;
      &lt;li&gt;fail: violations of the law of Demeter&lt;/li&gt;
      &lt;li&gt;fail: mocking and tests, too much mocking, too many dependencies&lt;/li&gt;
      &lt;li&gt;testable code is decoupled code&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Plain Data
    &lt;ul&gt;
      &lt;li&gt;a method should take what it needs, no more – eg. file object not filename&lt;/li&gt;
      &lt;li&gt;fail: users immediately transforming your output&lt;/li&gt;
      &lt;li&gt;fail: instantiating one object&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Grooviness
    &lt;ul&gt;
      &lt;li&gt;Avoid nonsense representations&lt;/li&gt;
      &lt;li&gt;Fail shallowly&lt;/li&gt;
      &lt;li&gt;Resource acquisition is initalization: don’t have invariants that aren’t invariant&lt;/li&gt;
      &lt;li&gt;have compelling examples&lt;/li&gt;
      &lt;li&gt;fail: lack of clear starting point&lt;/li&gt;
      &lt;li&gt;fail: long/complicated documentation&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Safety / Walls
    &lt;ul&gt;
      &lt;li&gt;put barriers proportional to potential damage&lt;/li&gt;
      &lt;li&gt;Exceptions &amp;gt; Return Values&lt;/li&gt;
      &lt;li&gt;fail: docs that say “remember to…” or “make sure that…”&lt;/li&gt;
      &lt;li&gt;fail: what’s the most dangerous thing this can do here, put barking dogs nearby&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
  &lt;li&gt;Two clusters: lingual and mathematical&lt;/li&gt;
  &lt;li&gt;https://github.com/erikrose&lt;/li&gt;
  &lt;li&gt;MOAR:
    &lt;ul&gt;
      &lt;li&gt;Making Software: What really works and why&lt;/li&gt;
      &lt;li&gt;RESTful Web APIs&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;writing-restful-web-services-with-flask--miguel-grinberg&quot;&gt;Writing RESTful web services with Flask – Miguel Grinberg&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Missed due to lunch going long&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;data-intensive-biology-in-the-cloud-instrumenting-all-the-things--titus-brown&quot;&gt;Data intensive biology in the cloud: instrumenting ALL the things – Titus Brown&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/ged-lab/&quot;&gt;https://github.com/ged-lab/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://ivory.idyll.org/blog/2014-pycon.html&quot;&gt;http://ivory.idyll.org/blog/2014-pycon.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;discovering-python--david-beazley&quot;&gt;Discovering Python – David Beazley&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Using Python to analyze 1.5TB of source code for a lawsuit&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;python-packaging&quot;&gt;Python Packaging&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Partial, headed to Web testing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;advanced-techniques-for-web-functional-testing--julien-phalip&quot;&gt;Advanced techniques for Web functional testing – Julien Phalip&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Selenium&lt;/li&gt;
  &lt;li&gt;Can be used to test responsive sites&lt;/li&gt;
  &lt;li&gt;needle checking CSS styles: https://github.com/bfirsh/needle&lt;/li&gt;
  &lt;li&gt;SauceLabs&lt;/li&gt;
  &lt;li&gt;http://davehaeffner.com/selenium-guidebook/&lt;/li&gt;
  &lt;li&gt;http://julienphalip.com&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;performance-testing-and-profiling-a-virtuous-cycle--dan-crosta-in-ab&quot;&gt;Performance Testing and Profiling: A Virtuous Cycle – Dan Crosta in AB&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;http://late.am/&lt;/li&gt;
  &lt;li&gt;talke about stress test and load testing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;lightning-talks-saturday-pm&quot;&gt;Lightning Talks Saturday PM&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Pandas http://pandas.pydata.org @sarah_guido&lt;/li&gt;
  &lt;li&gt;Documenting history, how to write great commit messages
    &lt;ul&gt;
      &lt;li&gt;Greg Ward #gergdocca&lt;/li&gt;
      &lt;li&gt;why use VCS? memory &amp;amp; collaboration&lt;/li&gt;
      &lt;li&gt;why you made that change?&lt;/li&gt;
      &lt;li&gt;tell me why (and what if you like)
        &lt;ol&gt;
          &lt;li&gt;tell me what you did and &lt;em&gt;why&lt;/em&gt;&lt;/li&gt;
          &lt;li&gt;brevity is the soul of wit&lt;/li&gt;
          &lt;li&gt;pick a style and stick with it&lt;/li&gt;
          &lt;li&gt;pick a grammatical mode and stick with it&lt;/li&gt;
          &lt;li&gt;spelling counts (so does grammar and punctuation)&lt;/li&gt;
          &lt;li&gt;teamwork counts
  TELL ME WHY&lt;/li&gt;
        &lt;/ol&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;dh-virtualenv
    &lt;ul&gt;
      &lt;li&gt;https://github.com/spotify/dh-virtualenv&lt;/li&gt;
      &lt;li&gt;marriage of deb packages and virtualenv&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Larry Hastings, Things You Didn’t Know
    &lt;ul&gt;
      &lt;li&gt;http://larryhastings.com/&lt;/li&gt;
      &lt;li&gt;shlex.split() – unquoute shell&lt;/li&gt;
      &lt;li&gt;liskov violation: liskov substitution principle / rectangle/square problem&lt;/li&gt;
      &lt;li&gt;inconsistent submodules: import all leaves in &lt;strong&gt;init&lt;/strong&gt;.py&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Machine Learning in Minutes
    &lt;ul&gt;
      &lt;li&gt;Identification trees&lt;/li&gt;
      &lt;li&gt;Reasoning vs.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Bleeding edge packages: for users and developers alike
    &lt;ul&gt;
      &lt;li&gt;bep – bleeding edge packages&lt;/li&gt;
      &lt;li&gt;goog.gl/x7N8x3&lt;/li&gt;
      &lt;li&gt;https://github.com/jgors/&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Home brewing with Python&lt;/li&gt;
  &lt;li&gt;Distributing your Python Game&lt;/li&gt;
  &lt;li&gt;mpld3: Matplotlib and D3
    &lt;ul&gt;
      &lt;li&gt;http://mpld3.github.io&lt;/li&gt;
      &lt;li&gt;plugins&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Server Security 101&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;lightning-talks-sunday-am&quot;&gt;Lightning Talks Sunday AM&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;RaspberryPi&lt;/li&gt;
  &lt;li&gt;fail2ban&lt;/li&gt;
  &lt;li&gt;contentd&lt;/li&gt;
  &lt;li&gt;How MatPlotLib made my robot not suck&lt;/li&gt;
  &lt;li&gt;git-lockup
    &lt;ul&gt;
      &lt;li&gt;https://github.com/warner/git-lockup&lt;/li&gt;
      &lt;li&gt;also, https://github.com/warner/python-versioneer&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;python and natural language learning&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;van-lindbergh&quot;&gt;Van Lindbergh&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;distinguished service award: raymond hettinger&lt;/li&gt;
  &lt;li&gt;community service award: r. david murray&lt;/li&gt;
  &lt;li&gt;benjamin peterson&lt;/li&gt;
  &lt;li&gt;open PSF membership&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;guido-van-rossum&quot;&gt;Guido van Rossum&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;No 2.8&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;#positivepython&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;geekdom&lt;/li&gt;
  &lt;li&gt;exception expressions&lt;/li&gt;
  &lt;li&gt;Kivy, python on mobile devices: &lt;a href=&quot;http://kivy.org/#home&quot;&gt;site&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Python 3.4 is awesome, NumPy is close, Django and Flask aren’t quite there yet&lt;/li&gt;
  &lt;li&gt;The worst part of contributing to cpython? very hard to get started&lt;/li&gt;
  &lt;li&gt;Python 3 adoption&lt;/li&gt;
  &lt;li&gt;Scientific/math support in core python?&lt;/li&gt;
  &lt;li&gt;What kinds of things make you uncertain/insecure?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;talks-i-did-not-see-but-looked-good&quot;&gt;Talks I did not see, but looked good:&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Would like to see: Upgrade your Web Development Toolchain&lt;/li&gt;
  &lt;li&gt;A Scenic Drive through the Django Request-Response Cycle&lt;/li&gt;
  &lt;li&gt;Django: The good parts&lt;/li&gt;
  &lt;li&gt;Pushing Python: Building a High Throughput, Low Latency System – Kevin Ballard&lt;/li&gt;
  &lt;li&gt;In Depth PDB – Nathan Yergler&lt;/li&gt;
  &lt;li&gt;It’s Dangerous to Go Alone: Battling the Invisible Monsters in Tech – Julie Pagano&lt;/li&gt;
  &lt;li&gt;What is coming in Python packaging – Noah Kantrowitz&lt;/li&gt;
  &lt;li&gt;Fast Python, Slow Python – Alex Gaynor&lt;/li&gt;
  &lt;li&gt;Which messaging layer should you use if you want to build a loosely coupled distributed Python app? –  Narahari Allamraju&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Jon M. Dugan</name></author><summary type="html">My notes from PyCon 2014.</summary></entry><entry><title type="html">Fluent 2014 Notes</title><link href="http://x1024.net/blog/2014/03/fluent-2014/" rel="alternate" type="text/html" title="Fluent 2014 Notes" /><published>2014-03-13T00:00:00-05:00</published><updated>2014-03-13T00:00:00-05:00</updated><id>http://x1024.net/blog/2014/03/fluent-2014</id><content type="html" xml:base="http://x1024.net/blog/2014/03/fluent-2014/">&lt;p&gt;My notes from &lt;a href=&quot;http://fluentconf.com/fluent2014&quot;&gt;Fluent 2014&lt;/a&gt;.&lt;/p&gt;

&lt;h1 id=&quot;day-1--tutorials&quot;&gt;Day 1 – Tutorials&lt;/h1&gt;

&lt;h2 id=&quot;automate-all-the-frontend-things&quot;&gt;Automate all the frontend things&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Kitt Hodsden @kitt &lt;a href=&quot;http://ki.tt/fluent2014&quot;&gt;http://ki.tt/fluent2014&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Live reload  – google for it&lt;/li&gt;
  &lt;li&gt;Browser Sync &lt;a href=&quot;http://browsersync.io&quot;&gt;http://browsersync.io&lt;/a&gt;
npm install -g browser-sync
grunt browser-sync&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/shakyShane/browser-sync/wiki/options&quot;&gt;https://github.com/shakyShane/browser-sync/wiki/options&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;setup a development profile, disable caching, etc&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Alfred &lt;a href=&quot;http://alfredapp.com/&quot;&gt;http://alfredapp.com/&lt;/a&gt; (similar to LaunchBar)&lt;/li&gt;
  &lt;li&gt;Dash Documentation repo: &lt;a href=&quot;http://kapeli.com/dash&quot;&gt;http://kapeli.com/dash&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;VM images for testing IE: &lt;a href=&quot;http://modern.ie&quot;&gt;http://modern.ie&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;gruntjs&quot;&gt;Grunt.js&lt;/h3&gt;

&lt;h3 id=&quot;image-sizing&quot;&gt;image sizing&lt;/h3&gt;

&lt;p&gt;grunt-contrib-imagemin
make smaller for mobile, etc: grunt-responsive-images
grunt-grunticon&lt;/p&gt;

&lt;h3 id=&quot;non-images&quot;&gt;non images&lt;/h3&gt;
&lt;p&gt;grunt-contrib-cssmin
grunt-csscss
grunt-contrib-uglify&lt;/p&gt;

&lt;h3 id=&quot;reduce-number-of-files&quot;&gt;reduce number of files&lt;/h3&gt;
&lt;p&gt;sprites: grunt-montage&lt;/p&gt;

&lt;h3 id=&quot;sass&quot;&gt;SASS&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://compass-style.org/&quot;&gt;http://compass-style.org/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Commands:&lt;/p&gt;

    &lt;p&gt;gem update –system
gem install sass
sass –watch –line-numbers –style expanded scss:css
compass watch&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;books&quot;&gt;Books&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;OOCSS?&lt;/li&gt;
  &lt;li&gt;SMACSS: &lt;a href=&quot;http://smacss.com&quot;&gt;http://smacss.com&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Sass for Designers&lt;/li&gt;
  &lt;li&gt;Pragmatic Guide To Sass&lt;/li&gt;
  &lt;li&gt;Sass and Compass in Action&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://css-tricks.com/sass-style-guide/&quot;&gt;http://css-tricks.com/sass-style-guide/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://developers.google.com/speed/docs/best-practices/rendering/&quot;&gt;http://developers.google.com/speed/docs/best-practices/rendering/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;guis&quot;&gt;GUIs:&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;CodeKit  incident57.com/&lt;/li&gt;
  &lt;li&gt;Compass app&lt;/li&gt;
  &lt;li&gt;koala-app.com&lt;/li&gt;
  &lt;li&gt;grunt-devtools chrome extensions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PhantomCSS
grunt-phantomcss
&lt;a href=&quot;http://tldr.huddle.com/blog/css-testing/&quot;&gt;http://tldr.huddle.com/blog/css-testing/&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;from-the-beginning&quot;&gt;From the beginning&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Faster HTML – autocomplete:  Emmet,  emmet.io – HTML expander&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Yeoman:&lt;/p&gt;

    &lt;p&gt;npm install -g yo
yo webapp&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Vagrant: scotch.io &lt;a href=&quot;http://scotch.io/tutorials/get-vagrant-up-and-running-in-no-time&quot;&gt;http://scotch.io/tutorials/get-vagrant-up-and-running-in-no-time&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;attacking-web-applications&quot;&gt;Attacking Web Applications&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://fluentconf.com/fluent2014/public/schedule/detail/31818&quot;&gt;http://fluentconf.com/fluent2014/public/schedule/detail/31818&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project&quot;&gt;https://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://wifipineapple.com/&quot;&gt;https://wifipineapple.com/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;DroidSheep&lt;/li&gt;
  &lt;li&gt;zANTI&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://haveibeenpwned.com/&quot;&gt;http://haveibeenpwned.com/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://blog.sashag.net&quot;&gt;http://blog.sashag.net&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;hsts: &lt;a href=&quot;http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security&quot;&gt;http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;effective-collaboration-on-github&quot;&gt;Effective Collaboration on GitHub&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;http://fluentconf.com/fluent2014/public/schedule/detail/32989&lt;/li&gt;
  &lt;li&gt;push early to communicate that you are working on something&lt;/li&gt;
  &lt;li&gt;Local and remote tracking are local to laptop, GitHub master is remote/cloud&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;credential cache – keychain, need settings?&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;fixed a repo problem: git remote set-url origin &lt;a href=&quot;https://githubstudent@github.com/githubstudent/example-basic.git&quot;&gt;https://githubstudent@github.com/githubstudent/example-basic.git&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Commands:&lt;/p&gt;

    &lt;p&gt;git config –global user.name
git config –global user.email
git config –global color.ui&lt;/p&gt;

    &lt;p&gt;git clone &lt;a href=&quot;https://github.com/githubteacher/example-basic&quot;&gt;https://github.com/githubteacher/example-basic&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;git branch jdugan-fluent&lt;/p&gt;

    &lt;p&gt;git log –oneline –decorate&lt;/p&gt;

    &lt;p&gt;git checkout jdugan-fluent&lt;/p&gt;

    &lt;p&gt;git push -u origin jdugan-fluent&lt;/p&gt;

    &lt;p&gt;touch jdugan.md
git add jdugan.md
git commit -m “introducing …”&lt;/p&gt;

    &lt;p&gt;$EDITOR jdugan.md
git add jdugan.md
git commit -m “add more stuff”
git status
git push -u origin jdugan-fluent&lt;/p&gt;

    &lt;p&gt;add a file via web ui
merge pull requst via web ui&lt;/p&gt;

    &lt;p&gt;this fails:
git push&lt;/p&gt;

    &lt;p&gt;need to pull:&lt;/p&gt;

    &lt;p&gt;git pull
git push&lt;/p&gt;

    &lt;p&gt;git log –oneline –graph –decorate –all&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;day-2--3122014&quot;&gt;Day 2 – 3/12/2014&lt;/h1&gt;

&lt;h2 id=&quot;brendan-eich&quot;&gt;Brendan Eich&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;script async?&lt;/li&gt;
  &lt;li&gt;module tag&lt;/li&gt;
  &lt;li&gt;“Low road”
    &lt;ul&gt;
      &lt;li&gt;literal syntax for new value types&lt;/li&gt;
      &lt;li&gt;SIMD&lt;/li&gt;
      &lt;li&gt;end goal – near native performance&lt;/li&gt;
      &lt;li&gt;emscriptem all over the place&lt;/li&gt;
      &lt;li&gt;native browser / no plugins  – game engines, nifty&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;“High road”
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;http://extensiblewebmanifesto.org&quot;&gt;http://extensiblewebmanifesto.org&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Note: to read: &lt;a href=&quot;http://remysharp.com/2010/10/08/what-is-a-polyfill/&quot;&gt;http://remysharp.com/2010/10/08/what-is-a-polyfill/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;pamela-fox-khan-academy&quot;&gt;Pamela Fox, Khan Academy&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://khanacademy.org/cs/programming&quot;&gt;http://khanacademy.org/cs/programming&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Nature of Code – physics using JS: http://natureofcode.com/&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;javascript-virtal-machines-and-the-cloud-scott-hanselman-microsoft&quot;&gt;JavaScript Virtal Machines and the Cloud; Scott Hanselman, Microsoft&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;podcast, etc &lt;a href=&quot;http://www.hanselman.com/&quot;&gt;http://www.hanselman.com/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Bizarro world, MicroSoft on GitHub?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;border-radius-lea-verou&quot;&gt;Border Radius, Lea Verou&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://lea.verou.me/&quot;&gt;http://lea.verou.me/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;interesting, but is this totally misguided?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;performance-ilya-grigorik&quot;&gt;Performance, Ilya Grigorik&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Browser Networking, OReilly Book&lt;/li&gt;
  &lt;li&gt;10ms limits in games, but 10ms no big deal in ecommerce&lt;/li&gt;
  &lt;li&gt;60 fps is 16ms for video, 1ms jitter in audio is perceptible (but some gaps are ok)&lt;/li&gt;
  &lt;li&gt;perceived performance = f(expected, UX, actual)&lt;/li&gt;
  &lt;li&gt;experience = f(perceived perf, task completion)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;practical-workflows-es6-modules-guy-bedford&quot;&gt;Practical Workflows ES6 Modules, Guy Bedford&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Why use ES6 modules?
    &lt;ul&gt;
      &lt;li&gt;browserify vs require.js – not compatible, etc&lt;/li&gt;
      &lt;li&gt;try to get to a common place&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;ES6 defines module syntax &amp;amp; module loader&lt;/li&gt;
  &lt;li&gt;Separate browser spec: system browser loader&lt;/li&gt;
  &lt;li&gt;Traceur github.com/google/traceur-compiler&lt;/li&gt;
  &lt;li&gt;(what is aurora.app?)&lt;/li&gt;
  &lt;li&gt;NodeJS Entry Point
    &lt;ul&gt;
      &lt;li&gt;module.js: export var test = ‘es6’;&lt;/li&gt;
      &lt;li&gt;app.js: import {test} from ‘./module’;&lt;/li&gt;
      &lt;li&gt;example of ES6 classes&lt;/li&gt;
      &lt;li&gt;traceur –dir app app-build –modules=commonjs&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;SystemJS:&lt;/li&gt;
  &lt;li&gt;got lost here somewhere … lots of stuff I have no background for&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;interface-design-considerations-for-data-visualization-scott-murray&quot;&gt;Interface Design Considerations for Data Visualization, Scott Murray&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;@alignedleft, alignedleft.com&lt;/li&gt;
  &lt;li&gt;kindred britain, kindred.stanford.edu&lt;/li&gt;
  &lt;li&gt;Design process.
    &lt;ol&gt;
      &lt;li&gt;Visual Structure
        &lt;ul&gt;
          &lt;li&gt;Outline the content, as detailed as possible&lt;/li&gt;
          &lt;li&gt;Wireframes to to mockups&lt;/li&gt;
          &lt;li&gt;exploratory mode and explanatory mode&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;Navigation Structure
        &lt;ul&gt;
          &lt;li&gt;conistency is important – navigational language
3, Interaction&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;Color
        &lt;ul&gt;
          &lt;li&gt;“Position is everything. Color is difficult.”&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;Authorship: signing your work?
        &lt;ul&gt;
          &lt;li&gt;read the essays about Kindred Britain on the site&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;managing-javascript-complexity-in-teams-jarrod-overson&quot;&gt;Managing JavaScript Complexity in Teams, Jarrod Overson&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Late for this one, good to go back and review&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://jarrodoverson.com/blog/&quot;&gt;http://jarrodoverson.com/blog/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/es-analysis/plato&quot;&gt;https://github.com/es-analysis/plato&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;webcl-a-secure-solution-for-accelerating-web-applications&quot;&gt;WebCL: A Secure Solution for Accelerating Web Applications&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://fluentconf.com/fluent2014/public/schedule/detail/32649&quot;&gt;http://fluentconf.com/fluent2014/public/schedule/detail/32649&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.khronos.org/files/opencl-quick-reference-card.pdf&quot;&gt;https://www.khronos.org/files/opencl-quick-reference-card.pdf&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;wheres-my-straw&quot;&gt;Where’’s my straw?&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;This looks worth going back to on video:&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://fluentconf.com/fluent2014/public/schedule/detail/32381&quot;&gt;http://fluentconf.com/fluent2014/public/schedule/detail/32381&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;the-perception-of-speed&quot;&gt;The Perception of Speed&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;cancelled?&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://fluentconf.com/fluent2014/public/schedule/detail/35515&quot;&gt;http://fluentconf.com/fluent2014/public/schedule/detail/35515&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;static-types-are-overrated-the-dynamic-duo---loose-types-and-object-extension&quot;&gt;Static Types are Overrated: The Dynamic Duo - Loose Types and Object Extension&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://fluentconf.com/fluent2014/public/schedule/detail/33114&quot;&gt;http://fluentconf.com/fluent2014/public/schedule/detail/33114&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Carmack article on static code analysis: &lt;a href=&quot;http://www.altdevblogaday.com/2011/12/24/static-code-analysis/&quot;&gt;http://www.altdevblogaday.com/2011/12/24/static-code-analysis/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;tern.js &lt;a href=&quot;http://ternjs.net/&quot;&gt;http://ternjs.net/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;debugging “oscilliscope for code” &lt;a href=&quot;http://trace.gl/&quot;&gt;http://trace.gl/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Chrome: Dominators view? Find dangling DOM&lt;/li&gt;
  &lt;li&gt;TDD – tests first&lt;/li&gt;
  &lt;li&gt;jsdoc, DocBlockr for Sublime&lt;/li&gt;
  &lt;li&gt;The Joys of Static Memory JavaScript &lt;a href=&quot;http://www.youtube.com/watch?v=Op52liUjvSk&quot;&gt;http://www.youtube.com/watch?v=Op52liUjvSk&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Random list of Mac dev apps: &lt;a href=&quot;https://gist.github.com/erikreagan/3259442&quot;&gt;https://gist.github.com/erikreagan/3259442&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;code-risk-management-at-twitter&quot;&gt;Code Risk Management at Twitter&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;didn’‘t attend may be interesting&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://fluentconf.com/fluent2014/public/schedule/detail/32538&quot;&gt;http://fluentconf.com/fluent2014/public/schedule/detail/32538&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;inside-javascript-execution&quot;&gt;Inside JavaScript Execution&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://fluentconf.com/fluent2014/public/schedule/detail/33116&quot;&gt;http://fluentconf.com/fluent2014/public/schedule/detail/33116&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Object Specifications
    &lt;ul&gt;
      &lt;li&gt;objects/hashes/dicts&lt;/li&gt;
      &lt;li&gt;array objects / sparse arrays&lt;/li&gt;
      &lt;li&gt;classes as structs&lt;/li&gt;
      &lt;li&gt;Objects vs primitives
        &lt;ul&gt;
          &lt;li&gt;ojects are pointer references&lt;/li&gt;
          &lt;li&gt;primitives are store directly (potentially faster)&lt;/li&gt;
          &lt;li&gt;don’t box primitives (var s = “hi”; s.x =5;)&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;Mr Aleph &lt;a href=&quot;http://mrale.ph/&quot;&gt;http://mrale.ph/&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;Andy Wingo &lt;a href=&quot;http://wingolog.org/&quot;&gt;http://wingolog.org/&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;6-bottles-of-rum-surprising-stories-of-mobile-behavior-in-the-real-world&quot;&gt;6 Bottles of RUM: Surprising Stories of Mobile Behavior in the Real World&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://fluentconf.com/fluent2014/public/schedule/detail/32476&quot;&gt;http://fluentconf.com/fluent2014/public/schedule/detail/32476&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Mobile performance&lt;/li&gt;
  &lt;li&gt;lots of people are using mobile devices: phone + table = 50%?&lt;/li&gt;
  &lt;li&gt;3G to LTE there is a 20x gain in speed&lt;/li&gt;
  &lt;li&gt;load speed is more related to latency than to speed (esp over 3 Mbps)&lt;/li&gt;
  &lt;li&gt;performance patterns vs anti-patterns: eg. CDN doesn’t work if you are localized&lt;/li&gt;
  &lt;li&gt;need to measure in order to optimize&lt;/li&gt;
  &lt;li&gt;Mobile speed, state of the union:
    &lt;ul&gt;
      &lt;li&gt;0 byte image; headers only; pretty grim&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://developers.google.com/speed/articles/web-metrics/&quot;&gt;https://developers.google.com/speed/articles/web-metrics/&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;how many measurements in the carrier breakdown?&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Cookies increase the size of the payload:
    &lt;ul&gt;
      &lt;li&gt;MSS/MTU, slow start and fragmentation&lt;/li&gt;
      &lt;li&gt;10% performance loss for large cookies; 1% for &amp;lt;= 400 bytes&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Parallelism to the rescue?
    &lt;ul&gt;
      &lt;li&gt;4-6 in modern browsers&lt;/li&gt;
      &lt;li&gt;domain sharding – game the system with multiple names&lt;/li&gt;
      &lt;li&gt;with 4x shards we have 24 simultaneous connections, probably not good&lt;/li&gt;
      &lt;li&gt;gains for sharding are pretty minimal&lt;/li&gt;
      &lt;li&gt;HTTP 2.0 allow multiplexing a single connection – claim to make completely obsolete, I disagree possibly&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Materializing images
    &lt;ul&gt;
      &lt;li&gt;sprites are generally faster than dataURIs&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Conversions &amp;amp; carousels
    &lt;ul&gt;
      &lt;li&gt;swipe surprisingly low interaction in one study&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;CSS
    &lt;ul&gt;
      &lt;li&gt;Souders CSS experiment &lt;a href=&quot;http://www.stevesouders.com/blog/2009/03/10/performance-impact-of-css-selectors/&quot;&gt;http://www.stevesouders.com/blog/2009/03/10/performance-impact-of-css-selectors/&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;Similar results for mobile&lt;/li&gt;
      &lt;li&gt;although CSS has gotten bigger / more complex and tests don’t cover all of this&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;feature-branches-as-an-art&quot;&gt;Feature Branches as an Art&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://fluentconf.com/fluent2014/public/schedule/detail/33095&quot;&gt;http://fluentconf.com/fluent2014/public/schedule/detail/33095&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Didn’t attend, watch on video?&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;day-3-3132014&quot;&gt;Day 3, 3/13/2014&lt;/h1&gt;

&lt;h2 id=&quot;delivering-the-goods-paul-irish&quot;&gt;Delivering the goods, Paul Irish&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;@paul_irish&lt;/li&gt;
  &lt;li&gt;An Engineer’s Gude to Optimization&lt;/li&gt;
  &lt;li&gt;Speed Index&lt;/li&gt;
  &lt;li&gt;http archive&lt;/li&gt;
  &lt;li&gt;not all requests are equal – what part of the UX is impacted?&lt;/li&gt;
  &lt;li&gt;video is bandwidth limited, web browsing is latency limited&lt;/li&gt;
  &lt;li&gt;TCP slow-start, particularly bad for mobile&lt;/li&gt;
  &lt;li&gt;http://www.webpagetest.org/&lt;/li&gt;
  &lt;li&gt;http://www.webpagetest.org/result/140313_CN_Q0Z/1/details/&lt;/li&gt;
  &lt;li&gt;CSS adn the critical path Patrick Hamann&lt;/li&gt;
  &lt;li&gt;Eliminate render-blocking CSS&lt;/li&gt;
  &lt;li&gt;Minimize render-blocking CSS&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;a-love-letter-to-html-jen-simmons&quot;&gt;A Love Letter to HTML, Jen Simmons&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Podcast: the web ahead&lt;/li&gt;
  &lt;li&gt;Rah Rah&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;understing-your-users-experience-christine-sotelo-new-relic&quot;&gt;Understing your user’s experience, Christine Sotelo, New Relic&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;JavaScript Error reporting&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;beyond-pushing-play-susan-mcgregor&quot;&gt;Beyond Pushing Play, Susan McGregor&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Johnny Cash Project, collaborative art&lt;/li&gt;
  &lt;li&gt;Epic Rap Battle: Steve Jobs vs. Bill Gates&lt;/li&gt;
  &lt;li&gt;Popcorn mixup?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;the-goodness-of-javascript-aaron-frost-and-dave-geddes&quot;&gt;The Goodness of JavaScript, Aaron Frost and Dave Geddes&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;JS Jabber podcast&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://trollcount.com/&quot;&gt;http://trollcount.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;fluent-hardware-showcase-john-mckay&quot;&gt;Fluent Hardware Showcase, John McKay&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Beaglebone&lt;/li&gt;
  &lt;li&gt;tessel.io&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;in-defense-of-frameworks-yehuda-katz-and-tom-dale&quot;&gt;In Defense of Frameworks, Yehuda Katz and Tom Dale&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;ember.js&lt;/li&gt;
  &lt;li&gt;“You call a library. A framework calls you.” is insufficient&lt;/li&gt;
  &lt;li&gt;Dependency Injection&lt;/li&gt;
  &lt;li&gt;Everyone who builds multiple apps eventually builds there own “framework” to start proejcts with&lt;/li&gt;
  &lt;li&gt;“You’re doing it wrong”&lt;/li&gt;
  &lt;li&gt;Toolkits all have “Best PRactice Guides” to help new developers&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;expressjs&quot;&gt;ExpressJS&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://fluentconf.com/fluent2014/public/schedule/detail/32484&quot;&gt;http://fluentconf.com/fluent2014/public/schedule/detail/32484&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://expressjs.com&quot;&gt;http://expressjs.com&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/guyellis/Introduction-to-ExpressJS/&quot;&gt;https://github.com/guyellis/Introduction-to-ExpressJS/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;blog post: &lt;a href=&quot;http://x.co/fluent2014&quot;&gt;http://x.co/fluent2014&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;asynchronous-promises-kris-kowal&quot;&gt;Asynchronous Promises, Kris Kowal&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://fluentconf.com/fluent2014/public/schedule/detail/32640&quot;&gt;http://fluentconf.com/fluent2014/public/schedule/detail/32640&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;leaflet-nodejs-and-mongodb-for-a-easy-and-fun-web-mapping-experience-steven-citron-pousty&quot;&gt;Leaflet, Node.JS, and MongoDB for a easy and fun web mapping experience, Steven Citron-Pousty&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://fluentconf.com/fluent2014/public/schedule/detail/31698&quot;&gt;http://fluentconf.com/fluent2014/public/schedule/detail/31698&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://talks.thesteve0.com/fluentwebcast/&quot;&gt;http://talks.thesteve0.com/fluentwebcast/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Mongo Spatial
    &lt;ul&gt;
      &lt;li&gt;Near&lt;/li&gt;
      &lt;li&gt;Containment&lt;/li&gt;
      &lt;li&gt;Intersection&lt;/li&gt;
      &lt;li&gt;2D indices and 2D sphere coords on earth like sphere, great circle distance&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://leafletjs.com/&quot;&gt;http://leafletjs.com/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://fluentwebmap-spatial.rhcloud.com/&quot;&gt;http://fluentwebmap-spatial.rhcloud.com/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/thesteve0/fluentwebmap.git&quot;&gt;https://github.com/thesteve0/fluentwebmap.git&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Also check out MapBox &lt;a href=&quot;http://mapbox.com/&quot;&gt;http://mapbox.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;writing-real-time-web-apps-wesley-hales&quot;&gt;Writing Real Time Web Apps, Wesley Hales&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://fluentconf.com/fluent2014/public/schedule/detail/32856&quot;&gt;http://fluentconf.com/fluent2014/public/schedule/detail/32856&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://wesleyhales.com/&quot;&gt;http://wesleyhales.com/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;SPDY: &lt;a href=&quot;http://www.chromium.org/spdy&quot;&gt;http://www.chromium.org/spdy&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;WAMP: WebSocket&lt;/li&gt;
  &lt;li&gt;PubNub &lt;a href=&quot;http://www.pubnub.com/&quot;&gt;http://www.pubnub.com/&lt;/a&gt; and Pusher &lt;a href=&quot;http://pusher.com/&quot;&gt;http://pusher.com/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Jon M. Dugan</name></author><summary type="html">My notes from Fluent 2014.</summary></entry><entry><title type="html">Crossing Boundaries</title><link href="http://x1024.net/blog/2008/03/crossing-boundaries/" rel="alternate" type="text/html" title="Crossing Boundaries" /><published>2008-03-17T18:00:00-05:00</published><updated>2008-03-17T18:00:00-05:00</updated><id>http://x1024.net/blog/2008/03/crossing-boundaries</id><content type="html" xml:base="http://x1024.net/blog/2008/03/crossing-boundaries/">&lt;p&gt;Each one of us has our own unique and subjective view of reality.  While this
view is widely held by educated people and sometimes by uneducated people it
is too rarely practiced as fundamental to engaging in day to day life.  Nearly
all of us assume that what we perceive, experience and feel as we go through
the day is the same as everyone else or that we understand how others perceive
existence.  This assumption leads to profound misunderstandings and often to
grave wounds.  This assumption is also a great pacifing force in society.  The
topic of subjective reality is far too big to delve into in any depth right
now, but I intend to explore it further as I write.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It is crucial to our development as both individual human beings and
as communities of human beings that we be willing to cross boundaries.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before I continue, I would like to make one thing plain: although I write
these entries in a tone that suggests what I say is true it is possible that
it is only partially true or perhaps even wholly untrue.  I encourage you to
challenge me and in doing so we can help one another attain deeper
understanding.&lt;/p&gt;

&lt;p&gt;Crossing boundaries is the deliberate choice to attempt to understand someone
else’s subjective reality or to share your own subjective reality with them.
To put it another way, it is choosing to receive ideas and/or share ideas with
another person.  It goes beyond a literal exchange of information and promotes
a deeper understanding.&lt;/p&gt;

&lt;p&gt;It is surprisingly difficult to do because our frame of reference is ourselves
and that continually gets in the way.  Here is an experiment that you can try
that will demonstrate this difficulty.  In the very next conversation that you
have with someone make a conscious choice to only listen to what they are
saying and do not formulate your answer until they are done.   Consider their
tone and their choice of words.  Do they mean something particular by each
word?  Were you able to let them finish before you started your rebuttal?&lt;/p&gt;

&lt;p&gt;I had had at least three interactions on my journey back from PyCon that were
crossing boundaries.   The first was the conversation I had with the woman who
sat next to me on the plane.  It started as just an exchange of information
but after learning that she had studied history and was involved in the
interpretation of the exhibits at her musuem I decide to explain the concept
of &lt;a href=&quot;http://www.saturdayhouse.org/&quot;&gt;Seattle Saturday House&lt;/a&gt;.  This led to a
long interaction about subjective reality, community, and sociatal ownership
(or “social responsibility” as she referred to it.)  While I know our
communication was imperfect I believe we both came away encouraged and hopeful
because we had participated in real interaction in the present.  The second
interaction was sparked by the first as the person next to her joined the
conversation.  There was some simple information exchange but there also was
some deeper communication going on.&lt;/p&gt;

&lt;p&gt;In these examples crossing boundaries provided a way for the subjective
realities of three individuals to overlap for a time and be influenced by one
another.  This is a profound event.  So much of our lives is spent in the
literal even though a fairly small gamble may lead us into something far more
profound.  Making the deliberate choice to cross the boundary from our
subjective reality into someone else’s is one of the foundations for a vibrant
community.&lt;/p&gt;

&lt;p&gt;The final interaction I want to talk about was with the cab driver on the way
home.  I was tired, my flight was late and I was just ready to be home after
ten days on the road.  However, when I got in the car I immediatly had a sense
that my cab driver had an outgoing demeanor and if I talked to him a little
bit he would probably open up quite a bit.  He described a lot of things I had
never considered about being a cab driver.  For example if a crime was
committed in his cab (such as a drug deal) he was resposible to report it to
the authorities or else he could be held liable for it as well.  This is a
hard place to be if you think about it.  He went on to describe some very bad
experiences he had had with african american passengers ditching out on paying
for their cab rides.  What surprised me was that although the cab driver was a
minority himself he had generalized this behaviour to decide that Obama was
not a worthy candidate for president.&lt;/p&gt;

&lt;p&gt;This is in my mind a failure in crossing boundaries.  He neglected to look
beyond those bad experiences and refused to engage with the person of Obama
because of the color of his skin.  I should note that it is possible to cross
boundaries without being in person but it is generally not as profound.&lt;/p&gt;

&lt;p&gt;As societies or communities we tend to believe that we understand other
societies or communities but unless we actively interact with them we do not
understand.  It takes effort go get beyond ourselves and to really understand
other people, other communities and other societies.&lt;/p&gt;

&lt;p&gt;It is easier and more comfortable to remain in our own subjective reality and
to assume that our crystalized snapshot of the others we know and our
assumptions about those we don’t know are true.  It is easier and more
comfortable but it is not fulfilling.  Fulfillment requires work, requires
action and it is never found in what is simply comfortable.&lt;/p&gt;

&lt;p&gt;I know that I do not cross these boundaries as often as I could.  It is a
personal goal to grow in this area.  There is a fundamental truth to realize
too: all people want to be understood and known and if done with sensitivity
nearly everyone will respond positively.&lt;/p&gt;</content><author><name>Jon M. Dugan</name></author><summary type="html">Each one of us has our own unique and subjective view of reality. While this view is widely held by educated people and sometimes by uneducated people it is too rarely practiced as fundamental to engaging in day to day life. Nearly all of us assume that what we perceive, experience and feel as we go through the day is the same as everyone else or that we understand how others perceive existence. This assumption leads to profound misunderstandings and often to grave wounds. This assumption is also a great pacifing force in society. The topic of subjective reality is far too big to delve into in any depth right now, but I intend to explore it further as I write.</summary></entry><entry><title type="html">Thrift Lightning Talk for PyCon 2008</title><link href="http://x1024.net/blog/2008/03/pycon-lightning-thrift/" rel="alternate" type="text/html" title="Thrift Lightning Talk for PyCon 2008" /><published>2008-03-11T19:00:00-05:00</published><updated>2008-03-11T19:00:00-05:00</updated><id>http://x1024.net/blog/2008/03/pycon-lightning-thrift</id><content type="html" xml:base="http://x1024.net/blog/2008/03/pycon-lightning-thrift/">&lt;p&gt;&lt;a href=&quot;http://developer.facebook.com/thrift&quot;&gt;Thrift&lt;/a&gt; provides lightweight,
cross language RPC by generating code for each target language from a simple
definition file.  There are lots of RPC mechanisms out there, what’s so
interesting about Thrift?  Good question.&lt;/p&gt;

&lt;p&gt;Thrift is easy to use and Thrift in any given language “feels right” for that
language.  Using Thrift in Python feels Pythonic. Using it in C++ feels, errr,
uhm, C++ish?&lt;/p&gt;

&lt;p&gt;Thrift ships with a binary protocol to transport the data so it’s lightweight
and efficient.  It doesn’t try to solve all the problems of the world, it just
tries to do one thing well.  The architecture is very clean and allows
changing the behaviour at any layer in the RPC stack.  This includes the
Protocol layer which encodes the data structures and the Transport layer which
is responsible for moving the data from point A to Z.&lt;/p&gt;

&lt;p&gt;You can choose the language that is most appropriate for the component and the
component can live on the most appropriate system.   For example, the search
component of your site may need to troll through a huge amount of data so
writing it in C++ and running it on a search cluster may be the best choice.
This seach component can be easily called from your the TurboCherryDjangoLons
application running on your web server farm.  Perhaps you need Geolocation but
would prefer not to burn a ton of RAM on each of your web nodes you can use
Thrift to talk to a remote Geolocation service which is written in Python.
This leads to my example.&lt;/p&gt;

&lt;p&gt;Here we have a very simple Thrift definition file:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;struct SpiffyGeoIPLocation {
   1: string country_code,
   2: double latitude,
   3: double longitude,
   4: list&amp;lt;string&amp;gt; possible_cities
}

service SpiffyGeoIPService {
   SpiffyGeoIPLocation by_ip_addr(string ip_addr);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;It defines a structure called SpiffyGeoIPLocation.  This struct represents the
answer we will recieve from our GeoLocation service.  The definition file also
defines a service called SpiffGeoIPService which exposes a single procedure
call: by_ip_addr which takes in a string representing the dotted quad of the
IP address.&lt;/p&gt;

&lt;p&gt;Once we have the definition file we run the Thrift compiler which will
generate the code for the structure and the service in each of the languages
we request.  In the case of Python this will be a pair of class definitions.
There will be a class which represents the structure and one that represents
the client interface.  It also generates a simple client script that will
allow you to make RPC calls to the service from your shell.  This is very
handy for testing.&lt;/p&gt;

&lt;p&gt;Here is the implementation of this service in Python:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;from thrift.transport.TSocket import TServerSocket
from thrift.transport.TTransport import TBufferedTransportFactory
from thrift.protocol.TBinaryProtocol import TBinaryProtocolFactory
from thrift.server.TServer import TThreadedServer
from simple_example import SpiffyGeoIPService
from simple_example.ttypes import SpiffyGeoIPLocation

class SpiffyGeoIPHandler:
     def by_ip_addr(self, ip_addr):
         result = SpiffyGeoIPLocation(dict(country_code='us',
             latitude=41.90, longitude=87.65,
             possible_cities=['Chicago, IL', 'Rosemont, IL']))

         if result == None:
             return SpiffyGeoIPLocation(dict(country_code='??',
                 possible_cities=['??']))
         return result

processor = SpiffyGeoIPService.Processor(SpiffyGeoIPHandler())
transport = TServerSocket(3773)
tfactory = TBufferedTransportFactory()
pfactory = TBinaryProtocolFactory()
server = TThreadedServer(processor, transport, tfactory, pfactory)

server.serve()

if __name__ == '__main__':
    import sys
    sys.path.insert(0, 'gen-py')
    sys.path.insert(0, 'thrift-trunk/lib/py/build/lib.macosx-10.4-i386-2.5')
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;As you can see we set up some Thrift infrastructure and define a handler class
which implements by_ip_addr procedure as a method.  It is this handler class
where you put the code to perform the desired task.&lt;/p&gt;

&lt;p&gt;The code to make the call is equally simple:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;from thrift.transport.TSocket import TSocket
from thrift.transport.TTransport import TBufferedTransport
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
from simple_example import SpiffyGeoIPService

socket = TSocket('localhost', 3773)
transport = TBufferedTransport(socket)
protocol = TBinaryProtocol(transport)
geoip_service = SpiffyGeoIPService.Client(protocol)
transport.open()

where = geoip_service.by_ip_addr(&quot;192.0.2.37&quot;)

print where.country_code, where.latitude, where.longitude, where.possible_cities
for city in where.possible_cities:
   print city

if __name__ == '__main__':
    import sys
    sys.path.insert(0, 'gen-py')
    sys.path.insert(0, 'thrift-trunk/lib/py/build/lib.macosx-10.4-i386-2.5')
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;As you can see we get back an object which is an instance of the
SpiffyGeoIPLocation class which has all the fields defined in the structure
definition in the first slide.  It’s acts just like a Python object because it
is a Python object.&lt;/p&gt;

&lt;p&gt;Why do I like Thrift so much?  It’s made distributing the components of my
&lt;a href=&quot;https://code.google.com/archive/p/esxsnmp/&quot;&gt;current project&lt;/a&gt; at my day job
very easy.  This is good because I have to run two instances of my system for
redundancy, one on the east coast and one on the west.  Each one will
periodically backfill holes in it’s database with the other coast.  Most of
the code in other parts of our system are in Perl.  Using Thrift I have been
able to use the data generated by my Python system painlessly in Perl parts of
the system.  Also, I may need to optimize the speed of my system, with Thrift
it would be pretty easy to rewrite the slow components in C++.  I’m repeating
myself here, but think about this – you can easily integrate new code with
old systems in other languages.  This frees you from having to write the whole
system in one language.&lt;/p&gt;

&lt;p&gt;If you’d like to play with these examples, feel free to grab the 
&lt;a href=&quot;/dist/simple_thrift_example.tar.gz&quot; title=&quot;Simple Thrift Example&quot;&gt;code&lt;/a&gt;.&lt;/p&gt;</content><author><name>Jon M. Dugan</name></author><summary type="html">Thrift provides lightweight, cross language RPC by generating code for each target language from a simple definition file. There are lots of RPC mechanisms out there, what’s so interesting about Thrift? Good question.</summary></entry></feed>