SlideShare a Scribd company logo
HTML5 for the
   Silverlight Guy
  An introduction to “Serious”
development on the Web Platform
               David Padbury
          http://davidpadbury.com
              @davidpadbury
So, this whole Silverlight vs HTML5 has
       been a little controversial...
“Microsoft execs said tonight ... allow them to create Windows 8
            applications in HTML and/or JavaScript.
 Sinofsky and others didn’t mention Silverlight or XNA at all.”
 http://www.zdnet.com/blog/microsoft/windows-8-more-than-just-windows-phone-on-your-pc/9592?tag=mantle_skin;content
HTML5 for the Silverlight Guy

Recommended for you

Ajax Security
Ajax SecurityAjax Security
Ajax Security

The document discusses various security vulnerabilities in Ajax applications including CSRF, login CSRF, JavaScript hijacking, XSS, and history stealing. It provides examples of how these attacks can be carried out and emphasizes the importance of validating and sanitizing user input to prevent scripts from being executed maliciously on a site. The document also recommends techniques for protecting against these attacks, such as using authentication tokens and disabling client-side script evaluation for untrusted sources.

securityjavascriptajaxexperience
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Library

This is the Google Tech Talk that I gave August 17th, 2007 on building a JavaScript library. I derived much of the talk from my experiences in building the jQuery and FUEL JavaScript libraries.

Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5

20100807 OSC Nagoya での講演資料 # スライドのみで見やすいよう若干整理 P5〜 Agenda P17〜 "HTML5" って何? P56〜 HTML5 の範囲は? P67〜 ブラウザのサポートは? P94〜 IE6 はどうするの? P118〜 使用上の注意 P147〜 便利なツールは? P152〜 One Point Q&A P186〜 追加資料

whatwghtml5webgl
http://forums.silverlight.net/forums/p/230502/562113.aspx#562081
“...they want us to write freaking javascript. Really!?”

    “HTML5??? Microsoft isn't eating their own dogfood, they're eating their own vomit.”

    “It may just be a very cool thing if they are brewing a way to utilize html5 + javascript
**without us having to mess with javascript** (exactly what ASP.NET does on the client side)”


     “At this point html5/js is a horrible development platform... I have not seen a single
                              project developed purely in html/js.”

              “we get Html and JavaScarriness in place of the beauty we know”

    “Seriously, who decided that we should start basing all of our computing around the
                              most abysmally slow language!?”

                   “Contrary to popular belief, HTML 5 is not ready yet.”

      “there is no way you would write a trading application in HTML5 and javascript”

    Javascript may be the WORST language ever used to write "applications".  It's a joke.
HTML5 for the Silverlight Guy
“You can’t write serious applications in
        HTML and JavaScript.”

Recommended for you

Web Development with NodeJS
Web Development with NodeJSWeb Development with NodeJS
Web Development with NodeJS

This document discusses the basics of web application architecture using Node.js and Express. It introduces HTTP requests and responses between clients and servers, and common status codes and verbs like GET and POST. It explains how to create a basic server with the HTTP module in Node.js, and how Express simplifies this with routing, middleware, request/response extensions and view handling capabilities. Specific examples are given for creating routes, using middleware, and setting up a view engine like Handlebars to render templates.

nodejsexpressjshttp
Communication in Node.js
Communication in Node.jsCommunication in Node.js
Communication in Node.js

The document is a slide presentation on mastering Node.js. It introduces Node.js and its architecture, uses cases like at LinkedIn and eBay, and two-way communication using Socket.io. Node.js is described as a JavaScript runtime environment for building fast and scalable network applications. It is single-threaded and event-driven, handling requests asynchronously through an event loop. The presentation demonstrates how to create TCP servers and clients in Node.js, and use Socket.io for real-time communication between client and server through event emitters and callbacks.

node js
Building servers with Node.js
Building servers with Node.jsBuilding servers with Node.js
Building servers with Node.js

The document summarizes Travis Swicegood's presentation on building servers with Node.js. It discusses how Node.js is an evented I/O toolkit that allows building scalable servers using an event loop model. It provides examples of simple socket and HTTP servers in Node.js, and how storing state and handling asynchronous operations like database queries differs in an evented model.

frameworknodejs
There’s lots of cool HTML5 demos out there
But how do I build a rich front end application?



    That’s what I’m going to (try) helping you understand today.
But first.

             Silverlight is not dead.

Evaluate HTML5 the same way you would anything else.

      It’s good at some things, it sucks at others.
Although this is the web,
forget your server side web programming experience.

                 ASP.NET, Rails, Grails, PHP



             Well, not entirely but you’ll see where I’m going.
                        I’m trying to be dramatic.

Recommended for you

Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...

If you're like me, you know that being a great backend developer isn't enough. To make *truly* great applications, we need to spend significant time in an area that's moving at a lightning pace: frontend development. This talk is for you: the backend developer that wants to hook their API's up to rich, interactive JavaScript frontends. To do that, first, we need to demystify a lot of new terms, like ES6/ES2015, ECMAScript, JSX, Babel and the idea that modern JavaScript (surprise) *requires* a build step. With this in mind, I'll give you a brief introduction into Webpack & the modular development it finally allows. But the real star is ReactJS. In the frontend world, you never know what new tech will *win*, but React is a star. I'll give you enough of an intro to get you rolling on your project. The new frontend dev world is huge! Consider the starting line down an exciting new journey.

babelreactjswebpack
Even faster django
Even faster djangoEven faster django
Even faster django

The document discusses ways to make Django web applications faster. It recommends using MongoDB as the database for its schema-free and high scalability features. It also recommends using the templating engine Jinja2 for its high rendering speed. Finally, it recommends implementing Facebook's BigPipe technique which breaks pages into chunks (pagelets) to start rendering and executing JavaScript earlier, improving perceived page load times. These techniques together can help make Django applications even faster.

big pipedjangojinja
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShell

This document provides an introduction and overview of Windows PowerShell. It discusses what PowerShell is, how it works, and how it can be used for administration tasks and extended to work with other products. The document covers PowerShell concepts like verbs, nouns, pipelines, and cmdlets. It also provides examples of using PowerShell for ad-hoc tasks and developing PowerShell scripts and cmdlets for production environments.

Writing complex front-end in HTML+JavaScript
has more in common with WPF/SL than ASP.NET

           For you guys, this is a good thing.
Let’s talk business.
HTML5 for the Silverlight Guy
Application is built from modules
Modules are decoupled from each other
         Code is easy to test
Runs on Desktop, RIA, and   (windows 7)   Phone

Recommended for you

Mobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScriptMobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScript

This document summarizes various features and APIs available for mobile web development. It discusses viewport meta tags, touch events, gesture events, media queries, and device features like the device pixel ratio and connection type. It also lists some popular mobile JavaScript libraries. The document provides code examples for touch, gesture, and device motion events.

bayjax f2esummit
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript Framework

Pam Selle Co-author of Choosing a JavaScript Framework, thewebivore.com Tuesday, Oct 20th 4:20 pm - Design/UX/UI

ato2015open sourceall things open
Building complex and modular RIAs with OSGi and Flex
Building complex and modular RIAs with OSGi and FlexBuilding complex and modular RIAs with OSGi and Flex
Building complex and modular RIAs with OSGi and Flex

This document provides an overview of building modular rich internet applications (RIAs) using OSGi and Flex. It discusses: 1. The interactions between OSGi and Flex, including accessing OSGi services from Flex using RemoteObjects and consuming events published by OSGi services. 2. Application modularization using Flex modules that can be loaded and unloaded dynamically at runtime. Modules implement a common interface to define their lifecycle. 3. Packaging modules as OSGi bundles with their business logic, services, and user interface (SWF file). The application bundle provides a skeleton UI and manages module loading.

flexmix-itosgi
Today’s Talk

      JavaScript
 JavaScript Modules
Module Organization
  Views as Modules                     Decoupling and Testing
                                        Event Aggregator/PubSub
                                        Unit Testing View Modules
           CSS
   CSS Compilers
Platform Consistency
                                        HTML5 Everywhere
We’re going to talk about the                   Plugins
   boring bits of HTML5                         Devices
“JavaScript doesn’t suck.
          You’re just doing it wrong.”
                - Douglas Crockford
                (father of JSON and JSLint, author of The Good Parts)




            The tone’s a little harsh, but he has a point.
Despite looking similar to C#, JavaScript is a very different language.
JavaScript is a very simple language
   If you can learn C#, you can cope with JavaScript.
There are three things you have to learn to
     be a great JavaScript developer.



           First Class Functions

                Prototypes

                 Context

Recommended for you

Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkOriginal slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talk

These are the original slides from the nodejs talk. I was surprised not find them on slideshare so adding them. The video link is here https://www.youtube.com/watch?v=ztspvPYybIY

javascriptnodejsconcurrency
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimization

80% of the time it takes for a web page to load is on the client side. Using all the tips in this presentation should cut 25% to 50% off the load time of optimized page requests. Drupal (6 or 7) can be used to, fairly easily, implement a whole bunch of these “front-end performance” upgrades, and knock a ton of errors off of the Yahoo! and Google speed-checker tools validation checklists. Get firebug first.

drupalpagespeed upgradespressflow
Front End Performance
Front End PerformanceFront End Performance
Front End Performance

The document discusses various techniques for improving front-end website performance, including reducing the number of HTTP requests, using content delivery networks and caching, gzip compression, optimizing CSS and JavaScript loading, image optimization, and lazy loading of content not visible initially. Specific techniques mentioned include combining files, setting long cache expiration headers, minifying files, parallelizing downloads, and deferring non-critical JavaScript initialization. The goal is to render an initial version as fast as possible through optimizations that reduce page load time.

drupaldrupalconparistuning
First Class Functions
function createCounter() {
    var count = 0;

     return function() {
         return count++;
     };
}

var counter1 = createCounter(),
    counter2 = createCounter();

console.log(   counter1()   );   //   0
console.log(   counter1()   );   //   1
console.log(   counter2()   );   //   0
console.log(   counter1()   );   //   2
Context
               Or, which this is this?

var david = {
    name: 'David',
    sayHi: function() {
        console.log("Hi, I'm " + this.name);
    }
};

david.sayHi(); // Hi, I'm David
// obj.fn() is eqv to obj.fn.call(obj)

david.sayHi.call({name:'Colleen'});
// Hi, I'm Colleen
Prototypes


function Person(name) {
    this.name = name;
}

Person.prototype.sayHi = function() {
    console.log("Hi, I'm " + this.name);
};

var david = new Person('David'),
    colleen = new Person('Colleen');

david.sayHi(); // Hi, I'm David
colleen.sayHi(); // Hi, I'm Colleen

console.log( david.sayHi === colleen.sayHi ); // true
Some older bits aren’t great...

Recommended for you

An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado

Tornado is a Python web framework and asynchronous networking library. It is a scalable, non-blocking web server that allows applications to handle multiple requests simultaneously using a single thread. Some key features include lightweight and fast templates, asynchronous request handlers, and integrations with databases, caches and other services. Tornado is best suited for building real-time web services and can be used alongside other front-end web servers.

web application developmentpythontornado
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications

Day 6 of 7-days "JavaScript and Rich User Interfaces" training for my colleagues. It covers ways how to speed up your application.

yahooperformancejs
The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015

My talk about the life of JavaScript, from birth to today. I went trough the demos and code examples very quickly, rather as a teaser to show how modern JavaScript development might look. If you are interested in a deep dive into the topic of modern JavaScript development, HTML5, ES6, AngularJS, React, Gulp, Grunt etc, please consider my courses: http://www.ivorycode.com/#schulung

javascript
strict mode keeps us on the Good Parts


          Start a file with ‘use   strict’;

      'use strict';

      alert( "I'm in strict mode." );



     Or start a function with ‘use   strict’;

     (function() {
         'use strict';

         alert("I'm in strict mode!");
     })();
(function() {
    globalVariable = 'OOPS!';
})();

console.log(globalVariable);
// OOPS!
(function() {
          'use strict';
          globalVariable = 'OOPS!';
      })();

      console.log(globalVariable);


ReferenceError: globalVariable is not defined
var person;

(function() {
    person = {
        name: 'David',
        name: 'Colleen'
    };
})();

console.log(person.name);
// Colleen

Recommended for you

JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up

JavaScript is evolving with the addition of modules, platform consistency, and harmony features. Modules allow JavaScript code to be organized and avoid naming collisions. CommonJS and AMD module formats are used widely. Platform consistency is improved through polyfills that mimic future APIs for older browsers. Harmony brings language-level modules and features like destructuring assignment, default parameters, and promises to JavaScript. Traceur compiles Harmony code to existing JavaScript.

javascript
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC

This document discusses JavascriptMVC, an alternative Javascript MVC framework to BackboneJS. It provides an overview of JavascriptMVC's features such as MIT licensing, clear documentation, and providing an almost total solution for building web applications. Potential pros include the licensing, documentation, and comprehensive features. Potential cons include it being less well known and having fewer online resources than BackboneJS in Taiwan. Examples of how it handles classes, CSS, data loading/validation, and views are also provided.

javascriptjavascriptmvc
Jet presentation
Jet presentationJet presentation
Jet presentation

The document summarizes a Java Emerging Technology (JET) conference held in September 2008. It provides outlines and details on sessions covering topics like Java 7 features and timelines, the EasyB behavior-driven development framework, Scala as an object-oriented functional language, Groovy as a dynamic language, Grails as a web application framework, developments in J2ME, and the Android mobile platform. Examples of code were provided for many of the sessions to demonstrate the technologies.

java emerging technology
var person;

       (function() {
           'use strict';
           person = {
               name: 'David',
               name: 'Colleen'
           };
       })();

       console.log(person.name);

 SyntaxError: Duplicate data property in
object literal not allowed in strict mode
(function() {
    console.log( 012 + 2 );
})();
(function() {
    console.log( 012 + 2 );   // 12?!
})();
(function() {
   'use strict';
    console.log( 012 + 2 );
})();

SyntaxError: Octal literals are not
      allowed in strict mode.

Recommended for you

Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery

Javascript and first-class citizenry: require.js & node.js Javascript on web pages is ubiquitous and its problems are legendary. Javascript, seen as a second-class code citizen, is usually hacked together even by seasoned developers. New libraries (jQuery, prototype, backbone, knockout, underscore) and runtime tools (firebug, jasmine) look like they solve many problems - and they do. But they still leave poorly written code as just that. One key problem is that all javascript code lives globally and this results in poorly managed, tested and delivered code. In this session, I will illustrate that we can treat javascript as a first-class citizen using with require.js and node.js: it can be modular, encapsulated and easily unit tested and added to continuous integration cycle. The dependencies between javascript modules can also be managed and packaged just like in C# and Java. In the end, we can resolve many javascript difficulties at compile time rather than waiting until runtime.

javascript requirejs node.js
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs

This document discusses how domain-specific languages (DSLs) can be used to make Java code more readable and maintainable. It describes different types of DSLs including external and internal DSLs built with Java and scripting languages. It also discusses JetBrains MPS, a language workbench that provides a new approach for building DSLs without relying on a specific output language. DSLs allow raising the level of abstraction and separating stable and changing parts of code. Fluent APIs and internal DSLs in Java provide readability benefits, while scripting languages allow further readability through features like closures and list literals.

javaedgeintellijjetbrains
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...

This document provides an overview of designing complex applications using HTML5 and KnockoutJS. It discusses HTML5 and why it is useful, introduces JavaScript and frameworks like KnockoutJS and SammyJS that help manage complexity. It also summarizes several JavaScript libraries and patterns including the module pattern, revealing module pattern, and MV* patterns. Specific libraries and frameworks discussed include RequireJS, AmplifyJS, UnderscoreJS, and LINQ.js. The document concludes with a brief mention of server-side tools like ScriptSharp.

sammyjshtml5javascript
In some ways, too simple.
C# has using



Visual Basic has Imports



     JavaScript has?
C# has using



Visual Basic has Imports



     JavaScript has?
        Nothing.
<!DOCTYPE HTML>
<html>
    <body>
        <script>
            // Application goes here...
        </script>
    </body>
</html>

Recommended for you

Javascript Best Practices
Javascript Best PracticesJavascript Best Practices
Javascript Best Practices

A presentation about tricks and best practice ideas of how to use JavaScript given in our office in India as part of an internal training.

webdevtricktipsbestpractices
WebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open webWebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open web

An introduction to WebGL for OpenGL developers. Topics include current browser support - as of September 2011 - and JavaScript.

gpuwebglhtml5
How AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsHow AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design Patterns

Ran Mizrahi talks about how AngularJS embraced traditional design patterns and used the benefits of JavaScript for that cause.

object-oriented programmingangularjsran mizrahi
$(document).ready(function() {
    function addSymbol(symbol) {
        var row = $('<tr>').append($('<td>').text(symbol));
        $('.watches').children().append(row);
    }
    $('.screen-switcher a').click(function() {
        var screen = $(this).attr('data-screen-id');
        $('.screens .screen').slideUp('fast', function() {
            $('.screens .screen[data-screen=' + screen + ']').slideDown();
        });
    });
    $('.add-symbol').parent('form').submit(function(e) {
        e.preventDefault();
        var symbol = $('.add-symbol').val();
        addSymbol(symbol);
        $.ajax('/data/symbol' + symbol, {
            completed: function(xhr, data) {
                $('<div class="price">')
                    .text(data.price)
                    .click(function() {
                        $('.price .tooltip')
                            .show('fast', function() {
                                 $(this).text(price);
                            })
                    });
            }
        });
    });
    $('.sidebar .history').flot({
        data: $.ajax('/stock/history', {
            data: [1,23,4,5,6],
            date: new Date().getTime()
        });
Everything is global by default

// lib1.js
function something() {
    console.log('foo');
}

// lib2.js
function something() {
    console.log('bar');
}

<script src="lib1.js"></script>
<script src="lib2.js"></script>
<script>
    something(); // bar
</script>
The patterns and tools and practices that will
form the foundation of Modern JavaScript are
     going to have to come from outside
    implementations of the language itself
                                - Rebecca Murphey
Using simple JavaScript constructs we can emulate many
          traditional organization techniques

     (function(lab49) {

         function privateAdder(n1, n2) {
             return n1 + n2;
         }

         lab49.add = function(n1, n2) {
             return privateAdder(n1, n2);
         };

     })(window.lab49 = window.lab49 || {});


     lab49.add(2, 3);


            Known as the Module Pattern
             http://blog.davidpadbury.com/2011/08/21/javascript-modules/

Recommended for you

"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues

The document discusses JavaScript, describing it as: - Created in 1995 by Netscape and based on the ECMAScript standard. - A dynamic, weakly typed, object-oriented programming language that is often misunderstood. - Used for client-side scripting of webpages as well as server-side and application scripting. - Commonly disliked due to past bad practices, implementations, and browser differences, but these issues are improving over time.

Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play

This document provides an overview of the Play! web framework for Java, including how it differs from traditional Java web development approaches by avoiding servlets, portlets, XML, EJBs, JSPs, and other technologies. It demonstrates creating a simple PDF generation application using Play!, including defining a model, controller, and view. The framework uses conventions over configuration and allows rapid development through features like automatic reloading of code changes and helpful error pages.

playjava
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big

This document discusses test-driven development for JavaScript using ScrewUnit and BlueRidge. It introduces the Carbon Five consulting firm and covers why JavaScript unit testing is important. It then demonstrates how to write behavioral tests using ScrewUnit's BDD style and shows a live example testing a wizard component. Some challenges of JavaScript testing like DOM cleanup and structure are addressed. The document emphasizes that JavaScript testing is possible and can be integrated into the development process.

Using simple JavaScript constructs we can emulate many
          traditional organization techniques

     (function(lab49) {

         function privateAdder(n1, n2) {
             return n1 + n2;
         }

         lab49.add = function(n1, n2) {
             return privateAdder(n1, n2);
         };

     })(window.lab49 = window.lab49 || {});


     lab49.add(2, 3);


            Known as the Module Pattern
             http://blog.davidpadbury.com/2011/08/21/javascript-modules/
Using simple JavaScript constructs we can emulate many
          traditional organization techniques

     (function(lab49) {

         function privateAdder(n1, n2) {
             return n1 + n2;
         }

         lab49.add = function(n1, n2) {
             return privateAdder(n1, n2);
         };

     })(window.lab49 = window.lab49 || {});


     lab49.add(2, 3);


            Known as the Module Pattern
             http://blog.davidpadbury.com/2011/08/21/javascript-modules/
Using simple JavaScript constructs we can emulate many
          traditional organization techniques

     (function(lab49) {

         function privateAdder(n1, n2) {
             return n1 + n2;
         }

         lab49.add = function(n1, n2) {
             return privateAdder(n1, n2);
         };

     })(window.lab49 = window.lab49 || {});


     lab49.add(2, 3);


            Known as the Module Pattern
             http://blog.davidpadbury.com/2011/08/21/javascript-modules/
Modules have evolved into standard patterns with
     tooling to help loading and packaging.

       Asynchronous Module Definition
         (Commonly known as AMD)




             https://github.com/amdjs/amdjs-api/wiki/AMD

Recommended for you

LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial Handouts

1) Qooxdoo is a JavaScript framework that provides object-oriented programming features to JavaScript. It turns JavaScript into a "grown up OO language" and allows developers to write browser-based applications without needing HTML or CSS knowledge. 2) The document discusses how to get started with a basic "Hello World" Qooxdoo application by installing Python, unpacking Qooxdoo, and generating and running the application files. 3) Key aspects of programming with Qooxdoo include leveraging JavaScript features like anonymous functions, closures, and proper understanding of scoping, as the framework relies heavily on these elements.

qooxdoo
NodeJS
NodeJSNodeJS
NodeJS

The document provides an overview of Node.js, a JavaScript runtime environment for building scalable network applications. Some key points covered include: - Node.js is built on Google's V8 JavaScript engine and is event-driven and non-blocking. - It is well-suited for data-intensive real-time applications due to its lightweight and efficient nature. - Node.js differs from other scripting languages by being non-blocking, single-threaded, and having an event-based approach built-in.

nodejs
JavaScript Core
JavaScript CoreJavaScript Core
JavaScript Core

JavaScript provides core functionality for web pages and applications. It has a C-like syntax and is dynamically typed. JavaScript code runs on both the client-side in web browsers and the server-side in environments like Node.js. It uses prototype-based inheritance where objects can inherit properties from object prototypes. New features are being added regularly through the ECMAScript specification. JavaScript allows DOM manipulation to modify web pages and event handling for user interactions.

javascript
define for creating a module definition.




require to ask for a module instance.
define('calculator', function() {
    return {
        add: function(n1, n2) {
             return n1 + n2;
        }
    };                  Callback so modules can be loaded asynchronously
});

require(['calculator'], function(calculator) {
    console.log( calculator.add(1, 2) ); // 3
});
define('math/adder', function() {
    return {
        add: function(n1, n2) {
             return n1 + n2;
        }            Specify modules this module depends on
    }
});

define('math/calculator', ['./adder'], function(adder) {
    return {
        add: function(n1, n2) {
             return adder.add(n1, n2);
        }
    };                              Loader passes instances of them
});
Loaders can assume module names from files
// math/adder.js
define(function() {
    return {
        add: function(n1, n2) {
             return n1 + n2;
        }
    }
});

// math/calculator.js
define(['./adder'], function(adder) {
    return {
        add: function(n1, n2) {
             return adder.add(n1, n2);
        }
    };
});

Recommended for you

Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web

The web is awesome despite it's detractors. But we can't forget our fundamentals when we're trying to forge ahead with new tech. This talk is about how to approach the building blocks of the web in a way that takes advantage of their strengths and avoids their weaknesses.

web development
JavaScript Misunderstood
JavaScript MisunderstoodJavaScript Misunderstood
JavaScript Misunderstood

The document discusses JavaScript and provides an overview of common misconceptions about the language as well as best practices. It notes that JavaScript's name is misleading as it is not related to Java and was originally called LiveScript. It then outlines some design errors in JavaScript and also highlights the language's powerful features like being object-oriented, functional, and useful for AJAX applications. The document concludes by encouraging learning JavaScript best practices.

scriptjavascriptperformance
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...

Salah satu front-end developer GITS Indonesia, Warsono, mengisi workshop di universitas, mengenai Vue.js. Ikuti kami di kanal berikut, agar tidak ketinggalan acara seru: Instagram: @gitsindonesia LinkedIn: GITS Indonesia Website: gits.id

gits indonesiamobile app developmentmobile application development
AMD appears to be winning in how to large JavaScript code bases



          There are a number of AMD module loaders
                        RequireJS, curl.js




             Popular libraries are supporting AMD
                    Dojo, jQuery (as of 1.7)
Demo
Basic RequireJS
You can extend how modules are loaded using plugins




                    text!
                    i18n!
                    order!
// views/personView.html
<div>My name is: <span class="name"></span></div>

Recommended for you

Play framework
Play frameworkPlay framework
Play framework

The document introduces the Play Framework version 2.1 and highlights its key features. It demonstrates building a sample application in Scala using Play's reactive, non-blocking architecture. Key features discussed include Play's built-in support for Scala, reactive programming, JSON APIs, routing, templates, and testing.

How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf

In the modern digital era, social media platforms have become integral to our daily lives. These platforms, including Facebook, Instagram, WhatsApp, and Snapchat, offer countless ways to connect, share, and communicate.

social media hackerfacebook hackerhire a instagram hacker
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx

How do we build an IoT product, and make it profitable? Talk from the IoT meetup in March 2024. https://www.meetup.com/iot-sweden/events/299487375/

iot
// views/personView.html
<div>My name is: <span class="name"></span></div>

// views/personView.js
define(['text!./personView.html'], function(tmpl) {
    function PersonView(options) {
        var el = $(options.el),
                                           Ask for content with the text
            name = options.name;            plugin and we get a String

          el.html(tmpl).find('.name').text(name);
      }
      return PersonView;
});
// views/personView.html
<div>My name is: <span class="name"></span></div>

// views/personView.js
define(['text!./personView.html'], function(tmpl) {
    function PersonView(options) {
        var el = $(options.el),
                                           Ask for content with the text
            name = options.name;            plugin and we get a String

          el.html(tmpl).find('.name').text(name);
      }
      return PersonView;
});

// index.html
<div id="person"></div>
<script>
    require(['views/personView'], function(PersonView) {
         var personView = new PersonView({
             el: $('#person'), name: 'David'
         });
    });
</script>
This allows us to organize our
                   applications the way we’re used to




               C#                          JavaScript
(Yep, I know you would’ve guessed...)
Demo
“Controls” with RequireJS

Recommended for you

Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf

Sustainability requires ingenuity and stewardship. Did you know Pigging Solutions pigging systems help you achieve your sustainable manufacturing goals AND provide rapid return on investment. How? Our systems recover over 99% of product in transfer piping. Recovering trapped product from transfer lines that would otherwise become flush-waste, means you can increase batch yields and eliminate flush waste. From raw materials to finished product, if you can pump it, we can pig it.

pigging solutionsprocess piggingproduct transfers
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world

The presentation showcases the diverse real-world applications of Fused Deposition Modeling (FDM) across multiple industries: 1. **Manufacturing**: FDM is utilized in manufacturing for rapid prototyping, creating custom tools and fixtures, and producing functional end-use parts. Companies leverage its cost-effectiveness and flexibility to streamline production processes. 2. **Medical**: In the medical field, FDM is used to create patient-specific anatomical models, surgical guides, and prosthetics. Its ability to produce precise and biocompatible parts supports advancements in personalized healthcare solutions. 3. **Education**: FDM plays a crucial role in education by enabling students to learn about design and engineering through hands-on 3D printing projects. It promotes innovation and practical skill development in STEM disciplines. 4. **Science**: Researchers use FDM to prototype equipment for scientific experiments, build custom laboratory tools, and create models for visualization and testing purposes. It facilitates rapid iteration and customization in scientific endeavors. 5. **Automotive**: Automotive manufacturers employ FDM for prototyping vehicle components, tooling for assembly lines, and customized parts. It speeds up the design validation process and enhances efficiency in automotive engineering. 6. **Consumer Electronics**: FDM is utilized in consumer electronics for designing and prototyping product enclosures, casings, and internal components. It enables rapid iteration and customization to meet evolving consumer demands. 7. **Robotics**: Robotics engineers leverage FDM to prototype robot parts, create lightweight and durable components, and customize robot designs for specific applications. It supports innovation and optimization in robotic systems. 8. **Aerospace**: In aerospace, FDM is used to manufacture lightweight parts, complex geometries, and prototypes of aircraft components. It contributes to cost reduction, faster production cycles, and weight savings in aerospace engineering. 9. **Architecture**: Architects utilize FDM for creating detailed architectural models, prototypes of building components, and intricate designs. It aids in visualizing concepts, testing structural integrity, and communicating design ideas effectively. Each industry example demonstrates how FDM enhances innovation, accelerates product development, and addresses specific challenges through advanced manufacturing capabilities.

fdmffffused deposition modeling
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry

Are you interested in dipping your toes in the cloud native observability waters, but as an engineer you are not sure where to get started with tracing problems through your microservices and application landscapes on Kubernetes? Then this is the session for you, where we take you on your first steps in an active open-source project that offers a buffet of languages, challenges, and opportunities for getting started with telemetry data. The project is called openTelemetry, but before diving into the specifics, we’ll start with de-mystifying key concepts and terms such as observability, telemetry, instrumentation, cardinality, percentile to lay a foundation. After understanding the nuts and bolts of observability and distributed traces, we’ll explore the openTelemetry community; its Special Interest Groups (SIGs), repositories, and how to become not only an end-user, but possibly a contributor.We will wrap up with an overview of the components in this project, such as the Collector, the OpenTelemetry protocol (OTLP), its APIs, and its SDKs. Attendees will leave with an understanding of key observability concepts, become grounded in distributed tracing terminology, be aware of the components of openTelemetry, and know how to take their first steps to an open-source contribution! Key Takeaways: Open source, vendor neutral instrumentation is an exciting new reality as the industry standardizes on openTelemetry for observability. OpenTelemetry is on a mission to enable effective observability by making high-quality, portable telemetry ubiquitous. The world of observability and monitoring today has a steep learning curve and in order to achieve ubiquity, the project would benefit from growing our contributor community.

cloudcloud native observabilitycloud native
HTML5 for the Silverlight Guy
require(['pubsub'], function(PubSub) {
    var bus = new PubSub();

      bus.sub('say', function(msg) {
          console.log('Subscriber 1 says: ' + msg);
      });

      bus.sub('say', function(msg) {
          console.log('Subscriber 2 says: ' + msg);
      });

      bus.pub('say', 'Nope!');
      // Subscriber 1 says: Nope!
      // Subscriber 2 says: Nope!
});
“Dictionary” to hold topic to
define('pubsub', function() {                         list of subscriptions
    function PubSub() {
        this.subs = {};
    }
                                                         Create topic list if none exists
      PubSub.prototype = {
          sub: function(topic, fn) {
              var topicSubs = (this.subs[topic] = this.subs[topic] || []);
              topicSubs.push(fn);
          },
          pub: function(topic, data) {
              var topicSubs = this.subs[topic] || [];
              topicSubs.forEach(function(fn) {
                  fn(data);
              });
          }
      };                        Call each subscriber for topic
      return PubSub;
});

                 (This is is a horribly crap implementation - DON’T EVER USE IT!)
Demo
pubsub

Recommended for you

Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...

Have you noticed the OpenSSF Scorecard badges on the official Dart and Flutter repos? It's Google's way of showing that they care about security. Practices such as pinning dependencies, branch protection, required reviews, continuous integration tests etc. are measured to provide a score and accompanying badge. You can do the same for your projects, and this presentation will show you how, with an emphasis on the unique challenges that come up when working with Dart and Flutter. The session will provide a walkthrough of the steps involved in securing a first repository, and then what it takes to repeat that process across an organization with multiple repos. It will also look at the ongoing maintenance involved once scorecards have been implemented, and how aspects of that maintenance can be better automated to minimize toil.

dartflutteropenssf
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers

The integration of programming into civil engineering is transforming the industry. We can design complex infrastructure projects and analyse large datasets. Imagine revolutionizing the way we build our cities and infrastructure, all by the power of coding. Programming skills are no longer just a bonus—they’re a game changer in this era. Technology is revolutionizing civil engineering by integrating advanced tools and techniques. Programming allows for the automation of repetitive tasks, enhancing the accuracy of designs, simulations, and analyses. With the advent of artificial intelligence and machine learning, engineers can now predict structural behaviors under various conditions, optimize material usage, and improve project planning.

programmingcodingcivil engineering
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL

Blockchain technology is transforming industries and reshaping the way we conduct business, manage data, and secure transactions. Whether you're new to blockchain or looking to deepen your knowledge, our guidebook, "Blockchain for Dummies", is your ultimate resource.

blockchainweb3blockchain technology
The ease of Unit Testing is one of the
  biggest plus points for JavaScript


        There’s a lot less fighting the compiler.
Which is handy, as they’re useful as there is no compiler.
There is a large number of unit testing libraries and frameworks
                        QUnit (of jQuery fame)
                          Jasmine (BDD’ish)
describe('Calculator', function() {
    var calculator;

      beforeEach(function() {
          calculator = require('calculator');
      });

      it('should add two numbers correctly', function() {
          expect(calculator.add(2, 3)).toEqual(5);
      });
});
HTML5 for the Silverlight Guy

Recommended for you

Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM

Quantum Communications Q&A with Gemini LLM. These are based on Shannon's Noisy channel Theorem and offers how the classical theory applies to the quantum world.

quantum communicationsshannon's channel theoremclassical theory
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter

Widya Salim and Victor Ma will outline the causal impact analysis, framework, and key learnings used to quantify the impact of reducing Twitter's network latency.

Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time

Is your patent a vanity piece of paper for your office wall? Or is it a reliable, defendable, assertable, property right? The difference is often quality. Is your patent simply a transactional cost and a large pile of legal bills for your startup? Or is it a leverageable asset worthy of attracting precious investment dollars, worth its cost in multiples of valuation? The difference is often quality. Is your patent application only good enough to get through the examination process? Or has it been crafted to stand the tests of time and varied audiences if you later need to assert that document against an infringer, find yourself litigating with it in an Article 3 Court at the hands of a judge and jury, God forbid, end up having to defend its validity at the PTAB, or even needing to use it to block pirated imports at the International Trade Commission? The difference is often quality. Quality will be our focus for a good chunk of the remainder of this season. What goes into a quality patent, and where possible, how do you get it without breaking the bank? ** Episode Overview ** In this first episode of our quality series, Kristen Hansen and the panel discuss: ⦿ What do we mean when we say patent quality? ⦿ Why is patent quality important? ⦿ How to balance quality and budget ⦿ The importance of searching, continuations, and draftsperson domain expertise ⦿ Very practical tips, tricks, examples, and Kristen’s Musts for drafting quality applications https://www.aurorapatents.com/patently-strategic-podcast.html

patentspatent applicationpatent prosecution
Demo
Unit Testing jQuery and mocks
CSS is wonderfully simple.



           selector {
               property: value;
           }




But sometimes it feels a little too simple.
Take it up a level - CSS Compilers


                            SASS
       WebWorkbench (VS), SassAndCoffee (ASP.NET), Ruby


                             LESS
WebWorkbench (VS), dotless (ASP.NET), Java, Ruby, Node, JavaScript


                            Stylus
                              Node
Repetition in CSS sucks



.content-navigation {
  border-color: #3bbfce;
}

.border {
  border-color: #3bbfce;
}

Recommended for you

Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...

This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator. Link to presentation recording and slides: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/ Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.

a11yaccessibilityalt text
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges

accommodate the strengths, weaknesses, threats and opportunities of autonomous vehicles

automotive self-driving car technology
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy

Not so much to say

SASS gives us variables


$blue: #3bbfce;
                                   .content-navigation {
.content-navigation {                border-color: #3bbfce;
  border-color: $blue;             }
}
                                   .border {
.border {                            border-color: #3bbfce;
  border-color: $blue;             }
}
                                             CSS
         SASS
Having to repeat selector paths sucks




  header { background-color: blue; }

  header a { font-weight: normal; }

  header a:hover { font-weight: bold; }
SASS gives us nesting
 header {
     background-color: blue;

     a {
           font-weight: normal;
           &:hover {                    SASS
               font-weight: bold;
           }
     }
 }




header { background-color: blue; }

header a { font-weight: normal; }       CSS
header a:hover { font-weight: bold; }
Having to repeat vendor prefixes sucks




        #container {
            -ms-box-flex: 1;
            -o-box-flex: 1;
            -webkit-box-flex: 1;
            -moz-box-flex: 1;
            box-flex: 1;
        }

Recommended for you

20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf

Support en anglais diffusé lors de l'événement 100% IA organisé dans les locaux parisiens d'Iguane Solutions, le mardi 2 juillet 2024 : - Présentation de notre plateforme IA plug and play : ses fonctionnalités avancées, telles que son interface utilisateur intuitive, son copilot puissant et des outils de monitoring performants. - REX client : Cyril Janssens, CTO d’ easybourse, partage son expérience d’utilisation de notre plateforme IA plug & play.

genaicloudrgpd
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024

This is a powerpoint that features Microsoft Teams Devices and everything that is new including updates to its software and devices for May 2024

microsoft teamsmicrosoft
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference

We are honored to launch and host this event for our UiPath Polish Community, with the help of our partners - Proservartner! We certainly hope we have managed to spike your interest in the subjects to be presented and the incredible networking opportunities at hand, too! Check out our proposed agenda below 👇👇 08:30 ☕ Welcome coffee (30') 09:00 Opening note/ Intro to UiPath Community (10') Cristina Vidu, Global Manager, Marketing Community @UiPath Dawid Kot, Digital Transformation Lead @Proservartner 09:10 Cloud migration - Proservartner & DOVISTA case study (30') Marcin Drozdowski, Automation CoE Manager @DOVISTA Pawel Kamiński, RPA developer @DOVISTA Mikolaj Zielinski, UiPath MVP, Senior Solutions Engineer @Proservartner 09:40 From bottlenecks to breakthroughs: Citizen Development in action (25') Pawel Poplawski, Director, Improvement and Automation @McCormick & Company Michał Cieślak, Senior Manager, Automation Programs @McCormick & Company 10:05 Next-level bots: API integration in UiPath Studio (30') Mikolaj Zielinski, UiPath MVP, Senior Solutions Engineer @Proservartner 10:35 ☕ Coffee Break (15') 10:50 Document Understanding with my RPA Companion (45') Ewa Gruszka, Enterprise Sales Specialist, AI & ML @UiPath 11:35 Power up your Robots: GenAI and GPT in REFramework (45') Krzysztof Karaszewski, Global RPA Product Manager 12:20 🍕 Lunch Break (1hr) 13:20 From Concept to Quality: UiPath Test Suite for AI-powered Knowledge Bots (30') Kamil Miśko, UiPath MVP, Senior RPA Developer @Zurich Insurance 13:50 Communications Mining - focus on AI capabilities (30') Thomasz Wierzbicki, Business Analyst @Office Samurai 14:20 Polish MVP panel: Insights on MVP award achievements and career profiling

#uipathcommunity#automation#automationdeveloper
SASS gives us mixins


@mixin box-flex($flex) {
    -ms-box-flex: $flex;
    -o-box-flex: $flex;           #container {
    -webkit-box-flex: $flex;          -ms-box-flex: 1;
    -ms-box-flex: $flex;              -o-box-flex: 1;
    box-flex: $flex;                  -webkit-box-flex: 1;
}                                     -moz-box-flex: 1;
                                      box-flex: 1;
#container {                      }
    @include box-flex(1);
}                                           CSS

           SASS
Platform Consistency


Or, everyone else’s browser sucks.
Writing an app for a single
       browser is easy.




Writing a single app for multiple
    browsers can be hard.
Just ask it

function hasCssProp(prop) {
    var el = document.createElement('div'),
        style = el.style;

    return typeof style[prop] == 'string';
}

// In IE9, Chrome, Firefox, etc...
hasCssProp('borderRadius'); // true

// In IE6, IE7, IE8, etc...
hasCssProp('borderRadius'); // false

Recommended for you

Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...

Today’s digitally connected world presents a wide range of security challenges for enterprises. Insider security threats are particularly noteworthy because they have the potential to cause significant harm. Unlike external threats, insider risks originate from within the company, making them more subtle and challenging to identify. This blog aims to provide a comprehensive understanding of insider security threats, including their types, examples, effects, and mitigation techniques.

insider securitycybersecurity threatsenterprise security
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition

The DealBook is our annual overview of the Ukrainian tech investment industry. This edition comprehensively covers the full year 2023 and the first deals of 2024.

Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf

As a popular open-source library for analytics engineering, dbt is often used in combination with Airflow. Orchestrating and executing dbt models as DAGs ensures an additional layer of control over tasks, observability, and provides a reliable, scalable environment to run dbt models. This webinar will cover a step-by-step guide to Cosmos, an open source package from Astronomer that helps you easily run your dbt Core projects as Airflow DAGs and Task Groups, all with just a few lines of code. We’ll walk through: - Standard ways of running dbt (and when to utilize other methods) - How Cosmos can be used to run and visualize your dbt projects in Airflow - Common challenges and how to address them, including performance, dependency conflicts, and more - How running dbt projects in Airflow helps with cost optimization Webinar given on 9 July 2024

apache airflowdbtdbt-core
HTML5 for the Silverlight Guy
14



8
Demo
Modernizr + SASS + CSS3 Hawtness + CSS2 Not-so-hawtness
The elephant in the room...




“But my company is all IE6...”

Recommended for you

border-radius: 8px;
box-shadow: #666 0px 2px 3px;
background: linear-gradient(#eeff99, #66ee33);
behavior: url(/PIE.htc);




                   http://css3pie.com/
HTML5 for the Silverlight Guy
You can fake a lot.

But honestly, it sucks.




   Accept reality.
Chrome Frame - a plugin with benefits

                            System Admin Compatible
                                        Roll out with MSI

                                Control with Group Policy Settings

                                    User Installable
                                   Just include a script in page

                                  Non-admin installs supported


                                           Keep IE
                          Sites have to explicitly opt-in to Chrome Frame

                             Sites depending on IE6/7 stay in IE6/7
        http://www.google.com/chromeframe

Recommended for you

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">




    Applications have to explicitly opt-in so your legacy applications won’t be affected
Demo
HTML5 Everywhere
Running the same application - http://html5trader.com
Internet Explorer 6                          iPhone




Running the same application - http://html5trader.com

Recommended for you

“This HTML5 stuff would be fine,
if only there was decent tooling...”
HTML5 for the Silverlight Guy
Visual Studio 11 is looking much better...




 http://blogs.msdn.com/b/webdevtools/archive/2011/09/15/new-javascript-editing-features-
              for-web-development-in-visual-studio-11-developer-preview.aspx
HTML5 for the Silverlight Guy

Recommended for you

HTML5 for the Silverlight Guy
We use Intellisense to
‘Explore’ and ‘Discover’

        http://www.flickr.com/photos/gemmabou/4622213880/
With modern browsers we can easily and
 quickly explore our code at runtime
Smaller Surfaces

Recommended for you

// Getter
$('#test').css('backgroundColor');

// Setter
$('#test').css('backgroundColor', 'red');

// Bigger setter
$('#test').css({
    backgroundColor: 'red'
});
Static analysis for JavaScript
function add(a, b, c) {
  return a + b;
}
function add(a, b, c) {
  return a + b;
}

Recommended for you

var person = {
    name: 'David',
    company: 'Lab49',
};
var person = {
    name: 'David',
    company: 'Lab49',
};
function createPerson(name) {
    return
    {
        name: name
    };
}
function createPerson(name) {
    return
    {
        name: name
    };
}

Recommended for you

There’s tons of other tools....

       Automation Testing
           Validators
         Performance
          Debuggers
            Profilers
           Designers
On many other platforms...

           .NET
            Java
           Ruby
          Python
           Node
It is not Silverlight vs HTML5
They’re both valid options with different pros and cons
You guys are experts in building front-end applications.


      Although the code looks a little different...

          The patterns, techniques and good
               practices are the same.

Recommended for you

Be Confident
 Be Fearless
 (and be sensible)
Hang on,

           You went an entire talk to a Silverlight
         audience and didn’t once mention MVVM?



Yep - although you can reuse a lot of knowledge, don’t try to do everything exactly the same.
            I encourage you to start with the simplest thing and build from there.
You didn’t cover ...!?
                                           Acceptance Testing
   CoffeeScript
                           Underscore
Templates                        Server Tools           IOC
             jQuery                  JavaScriptMVC

 HTML5 Boiler Plate         KnockOut               Flow Control

   Project Silk                                   BDD
                       Backbone
ECMAScript 6                              ASP.NET Integration

               jQuery UI
                               Promises         Goldfish
  Script Loaders
Dec 6th
               RequireJS 1.0

Callbacks, Promises and Coroutines (on my!)

Recommended for you

The NY HTML5 Application Developers Group


                   Dec 6th
                  RequireJS 1.0

 Callbacks, Promises and Coroutines (on my!)




      http://www.meetup.com/html5-app-developers
New York .NET Meetup


http://www.meetup.com/NY-Dotnet
http://www.lab49.com
// Thanks for listening!

return;

Recommended for you

More Related Content

What's hot

Building a real life application in node js
Building a real life application in node jsBuilding a real life application in node js
Building a real life application in node js
fakedarren
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
Daniel Cukier
 
HTML5 JavaScript APIs
HTML5 JavaScript APIsHTML5 JavaScript APIs
HTML5 JavaScript APIs
Remy Sharp
 
Ajax Security
Ajax SecurityAjax Security
Ajax Security
Joe Walker
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Library
jeresig
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5
dynamis
 
Web Development with NodeJS
Web Development with NodeJSWeb Development with NodeJS
Web Development with NodeJS
Riza Fahmi
 
Communication in Node.js
Communication in Node.jsCommunication in Node.js
Communication in Node.js
Edureka!
 
Building servers with Node.js
Building servers with Node.jsBuilding servers with Node.js
Building servers with Node.js
ConFoo
 
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Ryan Weaver
 
Even faster django
Even faster djangoEven faster django
Even faster django
Gage Tseng
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShell
Dale Lane
 
Mobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScriptMobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScript
franksvalli
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript Framework
All Things Open
 
Building complex and modular RIAs with OSGi and Flex
Building complex and modular RIAs with OSGi and FlexBuilding complex and modular RIAs with OSGi and Flex
Building complex and modular RIAs with OSGi and Flex
CARA_Lyon
 
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkOriginal slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talk
Aarti Parikh
 
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimization
Stevie T
 
Front End Performance
Front End PerformanceFront End Performance
Front End Performance
Konstantin Käfer
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
Gavin Roy
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
Siarhei Barysiuk
 

What's hot (20)

Building a real life application in node js
Building a real life application in node jsBuilding a real life application in node js
Building a real life application in node js
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
 
HTML5 JavaScript APIs
HTML5 JavaScript APIsHTML5 JavaScript APIs
HTML5 JavaScript APIs
 
Ajax Security
Ajax SecurityAjax Security
Ajax Security
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Library
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5
 
Web Development with NodeJS
Web Development with NodeJSWeb Development with NodeJS
Web Development with NodeJS
 
Communication in Node.js
Communication in Node.jsCommunication in Node.js
Communication in Node.js
 
Building servers with Node.js
Building servers with Node.jsBuilding servers with Node.js
Building servers with Node.js
 
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
 
Even faster django
Even faster djangoEven faster django
Even faster django
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShell
 
Mobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScriptMobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScript
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript Framework
 
Building complex and modular RIAs with OSGi and Flex
Building complex and modular RIAs with OSGi and FlexBuilding complex and modular RIAs with OSGi and Flex
Building complex and modular RIAs with OSGi and Flex
 
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkOriginal slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talk
 
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimization
 
Front End Performance
Front End PerformanceFront End Performance
Front End Performance
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 

Similar to HTML5 for the Silverlight Guy

The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015
jbandi
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
David Padbury
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
Alive Kuo
 
Jet presentation
Jet presentationJet presentation
Jet presentation
Peter Sellars
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
toddbr
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
intelliyole
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
Javascript Best Practices
Javascript Best PracticesJavascript Best Practices
Javascript Best Practices
Christian Heilmann
 
WebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open webWebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open web
pjcozzi
 
How AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsHow AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design Patterns
Ran Mizrahi
 
"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues"Javascript" por Tiago Rodrigues
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
Clinton Dreisbach
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
Andy Peterson
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial Handouts
Tobias Oetiker
 
NodeJS
NodeJSNodeJS
NodeJS
Alok Guha
 
JavaScript Core
JavaScript CoreJavaScript Core
JavaScript Core
François Sarradin
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
James Rakich
 
JavaScript Misunderstood
JavaScript MisunderstoodJavaScript Misunderstood
JavaScript Misunderstood
Bhavya Siddappa
 
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
GITS Indonesia
 
Play framework
Play frameworkPlay framework
Play framework
Andrew Skiba
 

Similar to HTML5 for the Silverlight Guy (20)

The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
Jet presentation
Jet presentationJet presentation
Jet presentation
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Javascript Best Practices
Javascript Best PracticesJavascript Best Practices
Javascript Best Practices
 
WebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open webWebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open web
 
How AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsHow AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design Patterns
 
"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial Handouts
 
NodeJS
NodeJSNodeJS
NodeJS
 
JavaScript Core
JavaScript CoreJavaScript Core
JavaScript Core
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
JavaScript Misunderstood
JavaScript MisunderstoodJavaScript Misunderstood
JavaScript Misunderstood
 
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
 
Play framework
Play frameworkPlay framework
Play framework
 

Recently uploaded

How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
Aurora Consulting
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
Sally Laouacheria
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
UiPathCommunity
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 

Recently uploaded (20)

How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 

HTML5 for the Silverlight Guy

  • 1. HTML5 for the Silverlight Guy An introduction to “Serious” development on the Web Platform David Padbury http://davidpadbury.com @davidpadbury
  • 2. So, this whole Silverlight vs HTML5 has been a little controversial...
  • 3. “Microsoft execs said tonight ... allow them to create Windows 8 applications in HTML and/or JavaScript. Sinofsky and others didn’t mention Silverlight or XNA at all.” http://www.zdnet.com/blog/microsoft/windows-8-more-than-just-windows-phone-on-your-pc/9592?tag=mantle_skin;content
  • 6. “...they want us to write freaking javascript. Really!?” “HTML5??? Microsoft isn't eating their own dogfood, they're eating their own vomit.” “It may just be a very cool thing if they are brewing a way to utilize html5 + javascript **without us having to mess with javascript** (exactly what ASP.NET does on the client side)” “At this point html5/js is a horrible development platform... I have not seen a single project developed purely in html/js.” “we get Html and JavaScarriness in place of the beauty we know” “Seriously, who decided that we should start basing all of our computing around the most abysmally slow language!?” “Contrary to popular belief, HTML 5 is not ready yet.” “there is no way you would write a trading application in HTML5 and javascript” Javascript may be the WORST language ever used to write "applications".  It's a joke.
  • 8. “You can’t write serious applications in HTML and JavaScript.”
  • 9. There’s lots of cool HTML5 demos out there
  • 10. But how do I build a rich front end application? That’s what I’m going to (try) helping you understand today.
  • 11. But first. Silverlight is not dead. Evaluate HTML5 the same way you would anything else. It’s good at some things, it sucks at others.
  • 12. Although this is the web, forget your server side web programming experience. ASP.NET, Rails, Grails, PHP Well, not entirely but you’ll see where I’m going. I’m trying to be dramatic.
  • 13. Writing complex front-end in HTML+JavaScript has more in common with WPF/SL than ASP.NET For you guys, this is a good thing.
  • 16. Application is built from modules Modules are decoupled from each other Code is easy to test Runs on Desktop, RIA, and (windows 7) Phone
  • 17. Today’s Talk JavaScript JavaScript Modules Module Organization Views as Modules Decoupling and Testing Event Aggregator/PubSub Unit Testing View Modules CSS CSS Compilers Platform Consistency HTML5 Everywhere We’re going to talk about the Plugins boring bits of HTML5 Devices
  • 18. “JavaScript doesn’t suck. You’re just doing it wrong.” - Douglas Crockford (father of JSON and JSLint, author of The Good Parts) The tone’s a little harsh, but he has a point. Despite looking similar to C#, JavaScript is a very different language.
  • 19. JavaScript is a very simple language If you can learn C#, you can cope with JavaScript.
  • 20. There are three things you have to learn to be a great JavaScript developer. First Class Functions Prototypes Context
  • 21. First Class Functions function createCounter() { var count = 0; return function() { return count++; }; } var counter1 = createCounter(), counter2 = createCounter(); console.log( counter1() ); // 0 console.log( counter1() ); // 1 console.log( counter2() ); // 0 console.log( counter1() ); // 2
  • 22. Context Or, which this is this? var david = { name: 'David', sayHi: function() { console.log("Hi, I'm " + this.name); } }; david.sayHi(); // Hi, I'm David // obj.fn() is eqv to obj.fn.call(obj) david.sayHi.call({name:'Colleen'}); // Hi, I'm Colleen
  • 23. Prototypes function Person(name) { this.name = name; } Person.prototype.sayHi = function() { console.log("Hi, I'm " + this.name); }; var david = new Person('David'), colleen = new Person('Colleen'); david.sayHi(); // Hi, I'm David colleen.sayHi(); // Hi, I'm Colleen console.log( david.sayHi === colleen.sayHi ); // true
  • 24. Some older bits aren’t great...
  • 25. strict mode keeps us on the Good Parts Start a file with ‘use strict’; 'use strict'; alert( "I'm in strict mode." ); Or start a function with ‘use strict’; (function() { 'use strict'; alert("I'm in strict mode!"); })();
  • 26. (function() { globalVariable = 'OOPS!'; })(); console.log(globalVariable); // OOPS!
  • 27. (function() { 'use strict'; globalVariable = 'OOPS!'; })(); console.log(globalVariable); ReferenceError: globalVariable is not defined
  • 28. var person; (function() { person = { name: 'David', name: 'Colleen' }; })(); console.log(person.name); // Colleen
  • 29. var person; (function() { 'use strict'; person = { name: 'David', name: 'Colleen' }; })(); console.log(person.name); SyntaxError: Duplicate data property in object literal not allowed in strict mode
  • 30. (function() { console.log( 012 + 2 ); })();
  • 31. (function() { console.log( 012 + 2 ); // 12?! })();
  • 32. (function() { 'use strict'; console.log( 012 + 2 ); })(); SyntaxError: Octal literals are not allowed in strict mode.
  • 33. In some ways, too simple.
  • 34. C# has using Visual Basic has Imports JavaScript has?
  • 35. C# has using Visual Basic has Imports JavaScript has? Nothing.
  • 36. <!DOCTYPE HTML> <html> <body> <script> // Application goes here... </script> </body> </html>
  • 37. $(document).ready(function() { function addSymbol(symbol) { var row = $('<tr>').append($('<td>').text(symbol)); $('.watches').children().append(row); } $('.screen-switcher a').click(function() { var screen = $(this).attr('data-screen-id'); $('.screens .screen').slideUp('fast', function() { $('.screens .screen[data-screen=' + screen + ']').slideDown(); }); }); $('.add-symbol').parent('form').submit(function(e) { e.preventDefault(); var symbol = $('.add-symbol').val(); addSymbol(symbol); $.ajax('/data/symbol' + symbol, { completed: function(xhr, data) { $('<div class="price">') .text(data.price) .click(function() { $('.price .tooltip') .show('fast', function() { $(this).text(price); }) }); } }); }); $('.sidebar .history').flot({ data: $.ajax('/stock/history', { data: [1,23,4,5,6], date: new Date().getTime() });
  • 38. Everything is global by default // lib1.js function something() { console.log('foo'); } // lib2.js function something() { console.log('bar'); } <script src="lib1.js"></script> <script src="lib2.js"></script> <script> something(); // bar </script>
  • 39. The patterns and tools and practices that will form the foundation of Modern JavaScript are going to have to come from outside implementations of the language itself - Rebecca Murphey
  • 40. Using simple JavaScript constructs we can emulate many traditional organization techniques (function(lab49) { function privateAdder(n1, n2) { return n1 + n2; } lab49.add = function(n1, n2) { return privateAdder(n1, n2); }; })(window.lab49 = window.lab49 || {}); lab49.add(2, 3); Known as the Module Pattern http://blog.davidpadbury.com/2011/08/21/javascript-modules/
  • 41. Using simple JavaScript constructs we can emulate many traditional organization techniques (function(lab49) { function privateAdder(n1, n2) { return n1 + n2; } lab49.add = function(n1, n2) { return privateAdder(n1, n2); }; })(window.lab49 = window.lab49 || {}); lab49.add(2, 3); Known as the Module Pattern http://blog.davidpadbury.com/2011/08/21/javascript-modules/
  • 42. Using simple JavaScript constructs we can emulate many traditional organization techniques (function(lab49) { function privateAdder(n1, n2) { return n1 + n2; } lab49.add = function(n1, n2) { return privateAdder(n1, n2); }; })(window.lab49 = window.lab49 || {}); lab49.add(2, 3); Known as the Module Pattern http://blog.davidpadbury.com/2011/08/21/javascript-modules/
  • 43. Using simple JavaScript constructs we can emulate many traditional organization techniques (function(lab49) { function privateAdder(n1, n2) { return n1 + n2; } lab49.add = function(n1, n2) { return privateAdder(n1, n2); }; })(window.lab49 = window.lab49 || {}); lab49.add(2, 3); Known as the Module Pattern http://blog.davidpadbury.com/2011/08/21/javascript-modules/
  • 44. Modules have evolved into standard patterns with tooling to help loading and packaging. Asynchronous Module Definition (Commonly known as AMD) https://github.com/amdjs/amdjs-api/wiki/AMD
  • 45. define for creating a module definition. require to ask for a module instance.
  • 46. define('calculator', function() { return { add: function(n1, n2) { return n1 + n2; } }; Callback so modules can be loaded asynchronously }); require(['calculator'], function(calculator) { console.log( calculator.add(1, 2) ); // 3 });
  • 47. define('math/adder', function() { return { add: function(n1, n2) { return n1 + n2; } Specify modules this module depends on } }); define('math/calculator', ['./adder'], function(adder) { return { add: function(n1, n2) { return adder.add(n1, n2); } }; Loader passes instances of them });
  • 48. Loaders can assume module names from files // math/adder.js define(function() { return { add: function(n1, n2) { return n1 + n2; } } }); // math/calculator.js define(['./adder'], function(adder) { return { add: function(n1, n2) { return adder.add(n1, n2); } }; });
  • 49. AMD appears to be winning in how to large JavaScript code bases There are a number of AMD module loaders RequireJS, curl.js Popular libraries are supporting AMD Dojo, jQuery (as of 1.7)
  • 51. You can extend how modules are loaded using plugins text! i18n! order!
  • 52. // views/personView.html <div>My name is: <span class="name"></span></div>
  • 53. // views/personView.html <div>My name is: <span class="name"></span></div> // views/personView.js define(['text!./personView.html'], function(tmpl) { function PersonView(options) { var el = $(options.el), Ask for content with the text name = options.name; plugin and we get a String el.html(tmpl).find('.name').text(name); } return PersonView; });
  • 54. // views/personView.html <div>My name is: <span class="name"></span></div> // views/personView.js define(['text!./personView.html'], function(tmpl) { function PersonView(options) { var el = $(options.el), Ask for content with the text name = options.name; plugin and we get a String el.html(tmpl).find('.name').text(name); } return PersonView; }); // index.html <div id="person"></div> <script> require(['views/personView'], function(PersonView) { var personView = new PersonView({ el: $('#person'), name: 'David' }); }); </script>
  • 55. This allows us to organize our applications the way we’re used to C# JavaScript (Yep, I know you would’ve guessed...)
  • 58. require(['pubsub'], function(PubSub) { var bus = new PubSub(); bus.sub('say', function(msg) { console.log('Subscriber 1 says: ' + msg); }); bus.sub('say', function(msg) { console.log('Subscriber 2 says: ' + msg); }); bus.pub('say', 'Nope!'); // Subscriber 1 says: Nope! // Subscriber 2 says: Nope! });
  • 59. “Dictionary” to hold topic to define('pubsub', function() { list of subscriptions function PubSub() { this.subs = {}; } Create topic list if none exists PubSub.prototype = { sub: function(topic, fn) { var topicSubs = (this.subs[topic] = this.subs[topic] || []); topicSubs.push(fn); }, pub: function(topic, data) { var topicSubs = this.subs[topic] || []; topicSubs.forEach(function(fn) { fn(data); }); } }; Call each subscriber for topic return PubSub; }); (This is is a horribly crap implementation - DON’T EVER USE IT!)
  • 61. The ease of Unit Testing is one of the biggest plus points for JavaScript There’s a lot less fighting the compiler. Which is handy, as they’re useful as there is no compiler.
  • 62. There is a large number of unit testing libraries and frameworks QUnit (of jQuery fame) Jasmine (BDD’ish)
  • 63. describe('Calculator', function() { var calculator; beforeEach(function() { calculator = require('calculator'); }); it('should add two numbers correctly', function() { expect(calculator.add(2, 3)).toEqual(5); }); });
  • 66. CSS is wonderfully simple. selector { property: value; } But sometimes it feels a little too simple.
  • 67. Take it up a level - CSS Compilers SASS WebWorkbench (VS), SassAndCoffee (ASP.NET), Ruby LESS WebWorkbench (VS), dotless (ASP.NET), Java, Ruby, Node, JavaScript Stylus Node
  • 68. Repetition in CSS sucks .content-navigation { border-color: #3bbfce; } .border { border-color: #3bbfce; }
  • 69. SASS gives us variables $blue: #3bbfce; .content-navigation { .content-navigation { border-color: #3bbfce; border-color: $blue; } } .border { .border { border-color: #3bbfce; border-color: $blue; } } CSS SASS
  • 70. Having to repeat selector paths sucks header { background-color: blue; } header a { font-weight: normal; } header a:hover { font-weight: bold; }
  • 71. SASS gives us nesting header { background-color: blue; a { font-weight: normal; &:hover { SASS font-weight: bold; } } } header { background-color: blue; } header a { font-weight: normal; } CSS header a:hover { font-weight: bold; }
  • 72. Having to repeat vendor prefixes sucks #container { -ms-box-flex: 1; -o-box-flex: 1; -webkit-box-flex: 1; -moz-box-flex: 1; box-flex: 1; }
  • 73. SASS gives us mixins @mixin box-flex($flex) { -ms-box-flex: $flex; -o-box-flex: $flex; #container { -webkit-box-flex: $flex; -ms-box-flex: 1; -ms-box-flex: $flex; -o-box-flex: 1; box-flex: $flex; -webkit-box-flex: 1; } -moz-box-flex: 1; box-flex: 1; #container { } @include box-flex(1); } CSS SASS
  • 74. Platform Consistency Or, everyone else’s browser sucks.
  • 75. Writing an app for a single browser is easy. Writing a single app for multiple browsers can be hard.
  • 76. Just ask it function hasCssProp(prop) { var el = document.createElement('div'), style = el.style; return typeof style[prop] == 'string'; } // In IE9, Chrome, Firefox, etc... hasCssProp('borderRadius'); // true // In IE6, IE7, IE8, etc... hasCssProp('borderRadius'); // false
  • 78. 14 8
  • 79. Demo Modernizr + SASS + CSS3 Hawtness + CSS2 Not-so-hawtness
  • 80. The elephant in the room... “But my company is all IE6...”
  • 81. border-radius: 8px; box-shadow: #666 0px 2px 3px; background: linear-gradient(#eeff99, #66ee33); behavior: url(/PIE.htc); http://css3pie.com/
  • 83. You can fake a lot. But honestly, it sucks. Accept reality.
  • 84. Chrome Frame - a plugin with benefits System Admin Compatible Roll out with MSI Control with Group Policy Settings User Installable Just include a script in page Non-admin installs supported Keep IE Sites have to explicitly opt-in to Chrome Frame Sites depending on IE6/7 stay in IE6/7 http://www.google.com/chromeframe
  • 85. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> Applications have to explicitly opt-in so your legacy applications won’t be affected
  • 87. Running the same application - http://html5trader.com
  • 88. Internet Explorer 6 iPhone Running the same application - http://html5trader.com
  • 89. “This HTML5 stuff would be fine, if only there was decent tooling...”
  • 91. Visual Studio 11 is looking much better... http://blogs.msdn.com/b/webdevtools/archive/2011/09/15/new-javascript-editing-features- for-web-development-in-visual-studio-11-developer-preview.aspx
  • 94. We use Intellisense to ‘Explore’ and ‘Discover’ http://www.flickr.com/photos/gemmabou/4622213880/
  • 95. With modern browsers we can easily and quickly explore our code at runtime
  • 97. // Getter $('#test').css('backgroundColor'); // Setter $('#test').css('backgroundColor', 'red'); // Bigger setter $('#test').css({ backgroundColor: 'red' });
  • 98. Static analysis for JavaScript
  • 99. function add(a, b, c) { return a + b; }
  • 100. function add(a, b, c) { return a + b; }
  • 101. var person = { name: 'David', company: 'Lab49', };
  • 102. var person = { name: 'David', company: 'Lab49', };
  • 103. function createPerson(name) { return { name: name }; }
  • 104. function createPerson(name) { return { name: name }; }
  • 105. There’s tons of other tools.... Automation Testing Validators Performance Debuggers Profilers Designers
  • 106. On many other platforms... .NET Java Ruby Python Node
  • 107. It is not Silverlight vs HTML5 They’re both valid options with different pros and cons
  • 108. You guys are experts in building front-end applications. Although the code looks a little different... The patterns, techniques and good practices are the same.
  • 109. Be Confident Be Fearless (and be sensible)
  • 110. Hang on, You went an entire talk to a Silverlight audience and didn’t once mention MVVM? Yep - although you can reuse a lot of knowledge, don’t try to do everything exactly the same. I encourage you to start with the simplest thing and build from there.
  • 111. You didn’t cover ...!? Acceptance Testing CoffeeScript Underscore Templates Server Tools IOC jQuery JavaScriptMVC HTML5 Boiler Plate KnockOut Flow Control Project Silk BDD Backbone ECMAScript 6 ASP.NET Integration jQuery UI Promises Goldfish Script Loaders
  • 112. Dec 6th RequireJS 1.0 Callbacks, Promises and Coroutines (on my!)
  • 113. The NY HTML5 Application Developers Group Dec 6th RequireJS 1.0 Callbacks, Promises and Coroutines (on my!) http://www.meetup.com/html5-app-developers
  • 114. New York .NET Meetup http://www.meetup.com/NY-Dotnet
  • 116. // Thanks for listening! return;

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. - Just like spinning button demos in WPF/Avalon\n
  10. \n
  11. \n
  12. Before we get started, some prerequists\n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. Very few keywords. Barely anything there.\nCope with operator overload, generics, lambdas, covariance, contravariance.\n
  21. \n
  22. \n
  23. Quickly gets messy\n
  24. \n
  25. \n
  26. Many people (you guys especially see this as a failing).\nOn the contrary, this has allowed JavaScript to develop patterns for loading in browser, server and elsewhere.\n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. Doesn&amp;#x2019;t deal with unsubscribing, errors, etc..\n
  49. \n
  50. \n
  51. I&amp;#x2019;m not going to tell you which to use.\nEvaluate based on integration, runners, CI support, reporting, etc..\nBut given that, I like Jasmine.\n
  52. \n
  53. \n
  54. \n
  55. - Sensible structure can get you a long way\n- We&amp;#x2019;re talking repeition and things...\n
  56. 95% the same\n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. - you can do lots in an individual browser, even IE6.\n- But dealing with different browsers is challenging.\n
  66. - Horribly simple\n- Need to detect vendor prefixes\n- Most aren&amp;#x2019;t so easy\n- Which leads me too...\n
  67. \n
  68. \n
  69. \n
  70. \n
  71. All&amp;#x2019;s not completely lost, but it&amp;#x2019;s close\n
  72. \n
  73. \n
  74. \n
  75. Used by Google on GMail\n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n