Wednesday, July 24, 2013

OSCON Translated Strings and Foreign Language Support in JavaScript

The Translated Strings and Foreign Language Support in JavaScript Web Apps on the OSCON site.

Ken Tabor (Sabre Holdings)
5:00pm Wednesday, 07/24/2013

Translating:
what - date/time formatters
where - single page app

Basic solution
- string table, disconnects string from code

Never hard code text string
string-tables must be easily accessed throught the application
language string-tables must be demand-loadable resource.

- Combine duplicating strings
- Stop nearly duplicated string
- Easier word-smithing
- Setup for translation services
- Abstract away date/time formatting

RequireJS
RequireJS has 'i18n' plugin
Auto-loads based on navigator.language
At the cost of user control

Testing
- test entire app in Englsih
- native speaker confirms translations
- wait on bug reports

Automate testing with Jasmine and Selenium

Server-side errors - return codes and not string

OSCON Getting Hadoop, Hive and HBase up and running

The Getting Hadoop, Hive and HBase up and running in fifteen minutes page on OSCON.

Mark Grover (Cloudera)
4:10pm Wednesday, 07/24/2013

Hadoop is a distributed batch processing system
Installation and configuring hadoop projects is hard
Integration testing not done across versions.

Apache Bigtop addresses this issue
- generates packages of various Dadoop ecosystem componenets for various distros
- provides deployment code for various projects
- convenience artifacts available e.g hadoop-conf-pseudo to fake multiple nodes on local workstation
- integration testing of latest project releases

Follow steps on wiki

github.com/markgrover/oscon-bigtop/blob/master/readme.md

Hive
- allows SQL syntax query into hadoop
- don't claim to be SQL complaint but are very close. do not support correlated sub-queries.

Code for demo:
github.com/markgrover/oscon-bigtop

OSCON Server-Side Push: Comet, Web Sockets, and Server-Sent Events

The Server-Side Push: Comet, Web Sockets, and Server-Sent Events on the OSCON site.

Brian Sam-Bodden (Integrallis Software, LLC.)
2:30pm Wednesday, 07/24/2013

Polling - classic "are we there yet?" to allow the server to communicate updates. Self-DDoS attack

iFrame Streaming -
- embed an invisible iFrame (using jQuery)
- server returns chunks of data in a loop
- bind iFrame JS to parent page JS

XHR Streaming
- XMLHTTP request
- uses an AJAX call in background and sends JSON
- complexity now on client. need to watch the stream and determine the delta

Long polling
- most commonly used
- still used as a fallback
- blocks on server until something available then returns
- reestablish the request after server timeout
- thread of execution is blocked on the server

Flash streaming
- XML Socket
- creates a 1 pixel movie in page and uses a streaming movie's socket

Above are the less optimal

Push Frameworks

Comet
- previously associated with long polling
- now frameworks will interrogate the browser and pick the most appropriate technique
- provide both client and server side components
- many use a pub-sub protocol
- protocol is Bayeaux
faye.jcoglan.com
(faye is good for ruby)

Web Sockets
- Two way communications (tcp/ip socket)
- dedicated socket
- works with security, firewalls and proxies

Server-sent events
- from server to client
- unidirectional
- typically use UDP
- BOSH


WebRTC
-

Use a framework, allows graceful degradation













OSCON JavaScript Framework Face Off

The JavaScript Framework Face Off page on the OSCON site.

Nathaniel Schutta (ntschutta.com)
1:40pm Wednesday, 07/24/2013

The Seven Frameworks

Going to discuss three frameworks.

MIT is the most popular license for these.
The code is on GitHub.

Library vs. Framework is mostly semantic but....
Library works in existing code.
Framework forces you to work with them.

1. Backbone.js
Likes: small because there's no UI stuff
Designed for MVC JS applications
Has models, events, collections, views, controllers, persistence
Influenced by Ruby on Rails
Data lives in models instead of DOM
Changes to models trigger change events, views are notified.
Code structure: multiple files get confusing but can do in one file.
Event wiring kept in a single JSON data structure.
Doesn't take over the entire application
MIT license
backbonejs.org

2. Knockout.js
MVVM
Likes: small, no dependencies
Supports all browsers
Uses declarative binding
Built in templates
Works with jQuery
Built by a Microsoft employee
knockoutjs.org

3. Angular.js
MV-whatever
Made by Google
Shim to make-up for the fact that browsers don't support apps
Declarative binding
dependency injection
Custom attributes: ng-
data binding updates view or model automatically
controllers abstracting away the dom
supports linking and bookmarking
includes form validation
xhr wrapper: promises and exception handling
supports creating components via directives
supports localization
strong focus on testing, chrome, jasmine plugins
works with other libraries
documentation is excellent
MIT licenses
angularjs.org

Help selecting an MVC JavaScript framework:
todomvc.com

OSCON 10 Reasons You'll Love Dart

The 10 Reasons You'll Love Dart page on OSCON site.

Chris Strom (EEE Computes)
11:30am Wednesday, 07/24/2013

Compiles to JavaScript.
Attempts to normalize the compiled code for all browsers.
All browsers supported but for IE 10+

A language that doesn't affect the way you think about programing, is not worth know. Alan Perlis

primer on functions in Dart:
say_hi(name) {
      return "hi, ${name}";
}

say_hi("Bob");

Must have ; at end of statement in Dart, in JS this is optional

syntactic sugar for above:
say_hi(name) => "hi, ${name}";

anon functions:
var say_hi = (name) => "hi...

magic instance variables:
class Cookie {
   var num;
   Cookie(number) {
      num = number;
  }
}

Also, quick assignment in constructor:
Cookie(this.num);

precede the variable name in the class with an _ to make that variable private and inaccessible from outside the class.

get and set are Dart keywords used for getters and setters of private _ variables.

parameters can be optional, named, required and default

Method cascades (i.e. fluent syntax):
cookie
   ..mix_it()
   ..stir_it()

Can be used for setting methods, e.g. in CSS:
bg.style
   ..position = 'absolute'
    ....

Unit Tests
- built into language
test_create() {
   group("new DBs", () {
      setUp(removeFixtures);
      tearDown(removeFixtures);
      ....

test("creates a new DB", () {
...

Client-side libraries, declare:
library cookies;

Use:
import 'dart:html';
import 'cookie.dart';

Pub packages:
pub install
- pulls in dependencies

inheritence:
class Cookie extends HipsterModel {
   Cookie(attributes) :
    super(attributes

PubPackages
pub.dartlang.org
public git repos
great for local dev

Statically Typed Language
class Cookie {
   int num;
   ...
You can assign a string to an int and it will compile and run. However, if your run dartanalyzer then it will pick up your intention and complain. Can put this into the build process. Dart editor has this built in.

Dartdocs
Tools to generate HTML about code.
Accepts /// for comments to be extracted into the documentation.
Client side search in docs

Chris Strom @eee_c does a #pairwithme!!! on Tuesdays at 7:30pm PST.





OSCON GitHub Power Tools

The GitHub Power Tools page on the OSCON site.

Tim Berglund (GitHub, Inc.)
10:40am Wednesday, 07/24/2013

git ls-remote origin
     gets all refs
     refs are names for commits which are created in the root repo
     use if pull requestor has deleted their fork
     git has heads
     github has pull's

teach.github.com

Tuesday, July 23, 2013

OSCON Improve Your Team With Improv

The official Improve Your Team With Improv page on the OSCON site.

Andrew Berkowitz (TeamSnap), Wade Minter (TeamSnap)
1:30pm Tuesday, 07/23/2013

There was a great selection of sessions to attend in this time slot so I was deeply torn. The other top contender was Real-time: HTML5 and Node.js however that and the others can be done asynchronously by myself (not as effectively). You can't do Improv by yourself, or at least not in a meaningful way.

The session was great. These guys have identified a bunch of Improv exercises and techniques that directly apply to work situations and have cut out all the other Improv activities that would be appropriate for only Improv.

Some good techniques on how to get the team to know each other which is especially useful for teams that aren't collocated who need to quickly get to know each other in a short time frame on those rare occasions when they come together. They were also very cognizant of the fact that most people aren't touchy feeling and kept the "touch" exercises that way.

At the end of the session they ask us all to write down one item that we thought would make OSCON a better conference. The ideas included swag, free beer, a million dollars for everyone (top voted), free laptops, free conference, and rides on the animals on the covers of the O'Reilly books.

People swapped their card and then found partners to divide 7 points between the two cards they had which they then swapped again. The score was written on the back. This was repeated five times and then those five scores added up for a maximum of 35 points.

I believe that the winning idea was a million dollars for each person with 31 points.

My idea was "A unicorn ride from the hotel to the conference each day. The unicorn would have cup holders and unlimited beer and its horn would be shined each day." This scored in the middle of the range at 21 points. What were those guys on? Who would rather have a million dollars when you can ride on a unicorn?