JavaScript Templating | What is Templating?

JavaScript templates take simple web apps to the next level, keeping your application logic separate from your presentation and your HTML and JS files clean. This course provides a look at popular JavaScript template solutions for modern web apps that consume and display data. Joe Marini reviews four popular templating libraries: JQuery Template, a simple solution that plugs straight into jQuery; Handlebars and Mustache, which provide greater flexibility; and Dust, the templating engine for more complex scenarios. Watch more at: JavaScript Templating.

Topics include:

  • What is templating?
  • Defining templates in jQuery Template
  • Using simple Mustache templates with sections and conditions
  • Adding conditionals and loops to Handlebars templates
  • Working with Dust templates

JavaScript Templating

JavaScript templating refers to the client side data binding method implemented with the JavaScript language. This approach became popular thanks to JavaScript’s increased use, its increase in client processing capabilities, and the trend to outsource calculus to the client’s web browser. Popular JavaScript templating libraries are AngularJS, Backbone.js, Ember.js, Handlebars.js, and Mustache.js. A frequent practice is to use double curly brackets (i.e. {{key}}) to call values of the given key from data files, often JSON objects.

Template Engine

The template engine is responsible for:

  • connecting to the data model;
  • processing the code specified in the source templates; and
  • directing the output to a specific pipeline, text file, or stream.

Additionally some template engines allow additional configuration options. A template engine is ordinarily included as a part of a web template system or application framework, and may be used also as preprocessor or filter.

templating

A diagram illustrating all of the basic elements and processing flow of a template engine.

A template engine is a specific kind of template processing module that exhibits all of the major features of a modern programming language. The term template engine evolved as a generalized description of programming languages whose primary or exclusive purpose was to process templates and data to output text. The use of this term is most notably applied to web development using a web template system, and it is also applied to other contexts as well.

Benefits of using template engines

  • encourages organization of source code into operationally-distinct layers (see e.g., MVC)
  • enhances productivity by reducing unnecessary reproduction of effort
  • enhances teamwork by allowing separation of work based on skill-set (e.g., artistic vs. technical)

Templating becomes useful when the information distributed may change, is too large to be maintained in various HTML pages by available human resources and not large enough to require heavier server-side templating.

See more resources:

JavaScript Templates, Mozilla Developer Network
The client-side templating throwdown: mustache, handlebars, dust.js, and more
Best Practices When Working With JavaScript Templates

Website:
Build My Site

Introduction to the “Internet of Things”

In this course, Michael Lehman shows how to program these “things” and build companion apps to monitor and record their activities from iOS devices. Learn what’s inside a thing, how location-awareness technologies such as iBeacon connect the IoT in public spaces, and how you can create your own things with hardware like the Arduino and Raspberry Pi kits. Michael also shows how to use IFTTT services to control things on iOS, and muses on the future of IoT. Along the way, you’ll gain experience with real-world IOT-driven projects, like a mini weather station and a home lighting system. Watch more at: Programming the Internet of Things with iOS.

Topics include:

  • Exploring the IoT universe
  • Understanding sensors and effectors
  • Connecting inputs and outputs
  • Connecting to devices via Wi-Fi or Bluetooth
  • Using Apple iBeacon
  • Creating your own things with programmable hardware
  • Using IFTTT to program things
  • Exploring trends in IoT

Internet of Things

What are the “things”?

The “things” are programmable devices such as: home appliances, measuring environmental conditions (a thermostat turning the heat on at a specified temperature), automobiles, home security, headphones, audio, our phones, web applications, and almost anything you can imagine! Yes, you can program your own “thing” to do simple tasks for you.

internet of things

IFTTT (abbreviation of “If This Then That“) pronounced like “gift” without the “g”, is a web-based service which allows other services (e.g., Gmail, Google Reader, Instagram, Craigslist) to be programmed by means of simple conditional statements (called “recipes”).

IFTTT employs the following concepts:

  • Channel is called “basic building blocks of IFTTT”, it mainly describes a series of data from a certain web service such as Youtube or ebay. Beside, it can also describe some certain actions controlled with application program interface (API) like SMS. Sometimes, it means information supply in terms of weather or stocks. There are particular triggers and actions in each channel. Right now, 140 channels are available in total.
  • Recipe just means ” If this then that”. A recipe combines an action and a trigger in a specific channel. Users may create their own recipes. If any picture liked by you in Instagram, for example, the photo will be sent to your Dropbox file and saved in it.
  • Trigger is the “this” part of a recipe. It describes an assumptive event which could result in an action. What triggers you can choose always depend on which channel you select, for example, picking a RSS feed, you can select a new one that relates to reserved words.
  • Action is the “that” part of a recipe. It describes a consequence led by a specific trigger. Some examples are “save the graph in my file” or “the alarm rings”.
  • Ingredients are basic elements from a trigger. As the IFTTT official website gave an example: “The Ingredients of an Email Trigger could be: subject, body, attachment, received date, and the sender’s address.”

Usage examples

  • IFTTT can automatically automate web-application tasks, such as posting the same content on several social media.
  • IFTTT can be used to connect web applications and provide new functionality.

See more resources:

iOS 8 SDK New Features
Building a Note-Taking App for iOS 8
iOS App Development with Swift Essential Training
Disruptive IoT Innovation: Adding Value to Connected Devices
The Internet of Things – the way to sense, compute & connect

Website:
Build My Site

Elements of an Android App

Creating an app for Android doesn’t require a full-blown integrated development environment. There are several simple, easy-to-learn and easy-to-use tools that make programming Android apps a breeze. Michael Lehman introduces MIT App Inventor 2, Basic4android, and a few other entry-level development environments to build your own app. He’ll show how to test apps on an Android emulator or directly on your phone or tablet, and demonstrate tools for building hybrid apps that run on Android, Windows Phone, and iOS devices, as well as straight on the web. Start building your first app with these simple tools today. See more at: Simple Android Development Tools.

Topics include:

  • Understanding the elements of an Android app, such as controls, sensors, effectors, and storage
  • Exploring MIT App Inventor 2
  • Getting started with Basic4android
  • Building simple apps
  • Testing apps on Android emulators and devices
  • Sharing apps
  • Creating hybrid apps with Appy Pie, Make Me Droid, and AppMakr

App Inventor for Android

Android

Google App Inventor

App Inventor for Android is an open-source web application originally provided by Google, and now maintained by the Massachusetts Institute of Technology (MIT).

It allows newcomers to computer programming to create software applications for the Android operating system (OS). It uses a graphical interface, very similar to Scratch and the StarLogo TNG user interface, which allows users to drag-and-drop visual objects to create an application that can run on Android devices. In creating App Inventor, Google drew upon significant prior research in educational computing, as well as work done within Google on online development environments.

App Inventor and the projects on which it is based are informed by constructionist learning theories, which emphasizes that programming can be a vehicle for engaging powerful ideas through active learning. As such, it is part of an ongoing movement in computers and education that began with the work of Seymour Papert and the MIT Logo Group in the 1960s and has also manifested itself with Mitchel Resnick’s work on Lego Mindstorms and StarLogo.

App Inventor includes:

  • A designer, in which a program’s components are specified. This includes visible components, such as buttons and images, which are placed on a simulated screen, and non-visible components, such as sensors and web connections.
  • A blocks editor, in which the program’s logic is created.
  • A compiler based on the Kawa language framework and Kawa’s dialect of the Scheme programming language, developed by Per Bothner and distributed as part of the GNU operating system by the Free Software Foundation.
  • An app for real-time debugging on a connected Android device.

On December 6, 2013 (the start of the Hour of Code), MIT released App Inventor 2, renaming the original version “App Inventor Classic” Major differences are:

  • The blocks editor in the original version ran in a separate Java process, using the Open Blocks Java library for creating visual blocks programming languages.
    Open Blocks is distributed by the Massachusetts Institute of Technology’s Scheller Teacher Education Program (STEP) and is derived from master’s thesis research by Ricarose Roque. Professor Eric Klopfer and Daniel Wendel of the Scheller Program supported the distribution of Open Blocks under an MIT License. Open Blocks visual programming is closely related to StarLogo TNG, a project of STEP, and Scratch, a project of MIT Media Laboratory’s Lifelong Kindergarten Group. App Inventor 2 replaced Open Blocks with Blockly, a blocks editor that runs within the browser.
  • The | MIT AI2 Companion app enables real-time debugging on connected devices via Wi-Fi, not just USB.

As of May 2014, there were 87 thousand weekly active users of the service and 1.9 million registered users in 195 countries for a total of 4.7 million apps built.

Website:
Build My Site

MIT Opencourseware – OCW

MIT OpenCourseWare makes the materials used in the teaching of almost all of MIT’s subjects available on the Web, free of charge. With more than 2,200 courses available, OCW is delivering on the promise of open sharing of knowledge.

More Resources:

Women in STEM
Up and Running with C
A Gentle Introduction to Programming Using Python
New Course: Object-Orientated Python

Website:
Build My Site

WordPress: Creating a Child Theme

What this course is about….

One-page sites with JavaScript-based scrolling navigation are popular, especially for creative portfolios and company websites. However, in WordPress, single-page sites also have severe restrictions and can be hard to manage. This course shows you how you can create a dynamic one-page front page for your WordPress site that pulls content from different areas and displays it in a visually stunning way. This method allows the front page to update automatically as site content changes, without you having to constantly manage it. Staff author Morten Rand-Hendriksen will take you step by step through this solution: creating a new template and content pages, calling content to the front page with custom loops, and adding JavaScript to enable sticky menus and scrolling. Watch more at: WordPress: Building a One-Page Style Site.

Topics include:

  • Creating a foundation for the front page with a child theme, styles, and dummy content
  • Using custom queries to display content from different pages
  • Adding testimonials
  • Adding a custom menu
  • Creating a scrolling effect

Themes

child themeWordPress users may install and switch between themes. Themes allow users to change the look and functionality of a WordPress website or installation without altering the information content or structure of the site. Themes may be installed using the WordPress “Appearance” administration tool or theme folders may be uploaded via FTP. The PHP(Hypertext Preprocessor, a recursive backronym), HTML(hyper text markup language) and CSS(cascading style sheet ) code found in themes can be added or edited for providing advanced features. Thousands of WordPress themes exist, some free, and some paid for templates. WordPress users may also create and develop their own custom themes if they have the knowledge and skill to do so. Learn more here: WordPress Code Reference

Child Themes and Frameworks

The main advantage of a framework like Genesis or Catalyst is that it is an actively maintained, very lightweight, secure, a clean coded parent theme with some additional functionality plugged into it via accessible hooks and filters.

There certainly is a learning curve to really grasp it – like learning the structure, naming system, plus the actions and filters that it includes. It’s well worth it though. At the same time, its easy to customize even if you don’t know all the ins and outs.

The Genesis Framework has some amazing child themes out there, plus, there are some sample base child themes that lay out the basic structure and allow you to mold your own custom theme.

Genesis allows developers to switch child themes with ease. It has a simple hooks plugin that allows developers and non-developers to customize with ease. There are many theme developers who use Genesis only, and it has simplified their business tremendously.

Extensive CSS adjustments to child themes should still live in a custom CSS file to be update proof, but most child themes give you a place for this. Customization couldn’t be easier.

However, extensive documentation and forums are out there for Genesis to give you snippets and help you learn.

Catalyst is an open source web application framework written in Perl, that closely follows the model–view–controller (MVC) architecture, and supports a number of experimental web patterns. It is written using Moose, a modern object system for Perl. Its design is heavily inspired by such frameworks as Ruby on Rails, Maypole, and Spring.

See more resources:

Website:
Build My Site

Web Technology Tutorial: Front-end Design

Get an overview of front-end site development in this tutorial, including common development languages, design processes, and more. Watch more at: Web Technology Fundamentals.

This tutorial is a single movie from the Web Technology Fundamentals course by lynda.com author James Williamson. The complete course is 2 hours and 4 minutes and shows how a “plain English” guide to the technology and the terminology behind the web.

Introduction
1. Introduction to the Web
2. Front-End Technology
3. Back-End Technology
4. Assembly Technologies

Front-end Development

front-endFront end development is the development of those elements of a website that the customers sees and interacts with directly. It is a combination programming skills (knowing which program to choose) and aesthetics (understanding element arrangements on the screen, the color and font choices). The challenges associated with front end developers is that the tools and techniques used to create the front end of a website change constantly and so the developer needs to constantly be aware of how the field is developing.

The objective of designing a site is to ensure that when the users opens up the site they see the information in a format thats easy to read and relevant. This is further complicated by the fact that users now use a large variety of devices with varying screen sizes and resolutions thus forcing the designer to take into consideration these aspects when designing the site. They need to ensure that their site comes up correctly in different browsers (cross-browser), different operating systems (cross-platform) and different devices (cross-device), which needs careful planning on the site of the developer.

Front and Back-ends

The front end is responsible for collecting input in various forms from the user and processing it to conform to a specification the back end can use. The front end is an interface between the user and the back end. The front and back ends may be distributed amongst one or more systems.

In software design, for example, the model-view-controller architecture, provides front and back ends for the database, the user, and the data processing components. The separation of software systems into front and back ends simplifies development and separates maintenance. A rule of thumb is that the front (or “client”) side is any component manipulated by the user. The server-side (or “back end”) code resides on the server. The confusion arises when one must make front-end edits to server-side files. Most HTML designers, for instance, don’t need to be on the server when they are developing the HTML; conversely, the server-side engineers are, by definition, never on anything but a server. It takes both to ultimately make a functioning, interactive website.

See Related Topics:

Website:
Build My Site