A replacement AMD loader for RequireJS. It is a smaller "shim" loader, providing the minimal AMD API footprint that includes loader plugin support.
Some developers like to use the AMD API to code modular JavaScript, but after doing an optimized build, they do not want to include a full AMD loader like RequireJS, since they do not need all that functionality. Some use cases, like mobile, are very sensitive to file sizes.
By including almond in the built file, there is no need for RequireJS. almond is around 1 kilobyte when minified with Closure Compiler and gzipped.
Since it can support certain types of loader plugin-optimized resources, it is a great fit for a library that wants to use text templates or CoffeeScript as part of their project, but get a tiny download in one file after using the RequireJS Optimizer.
If you are building a library, the wrap=true support in the RequireJS optimizer will wrap the optimized file in a closure, so the define/require AMD API does not escape the file.  See the usage section below for more details.
So, you get great code cleanliness with AMD and the use of powerful loader plugins in a tiny wrapper that makes it easy for others to use your code even if they do not use AMD.
It is best used for libraries or apps that use AMD and:
var require = {};
style of passing config.amdify add
command to add the dependency to your project.What is supported:
Download the RequireJS optimizer.
Download the current release of almond.js.
Run the optimizer using Node (also works in Java):
node r.js -o baseUrl=. name=path/to/almond include=main out=main-built.js wrap=true
This assumes your project's top-level script file is called main.js and the command above is run from the directory containing main.js. If you prefer to use a build.js build profile instead of command line arguments, this RequireJS optimization section has info on how to do that.
wrap=true will add this wrapper around the main-built.js contents (which will be minified by UglifyJS:
(function () { //almond will be here //main and its nested dependencies will be here }());
If you do not want that wrapper, leave off the wrap=true argument.
These optimizer arguments can also be used in a build config object, so it can be used in runtime-generated server builds.
As of RequireJS 2.0 and almond 0.1, modules are only executed if they are called by a top level require call. The data-main attribute on a script tag for require.js counts as a top level require call.
However with almond, it does not look for a data-main attribute, and if your main JS module does not use a top level require() or requirejs() call to trigger module loading/execution, after a build, it may appear that the code broke – no modules execute.
The 2.0 RequireJS optimizer has a build config, option insertRequire that you can use to specify that a require([]) call is inserted at the end of the built file to trigger module loading. Example:
node r.js -o baseUrl=. name=path/to/almond.js include=main insertRequire=main out=main-built.js wrap=true
or, if using a build config file:
javascript
{
baseUrl: '.',
name: 'path/to/almond',
include: ['main'],
insertRequire: ['main'],
out: 'main-built.js',
wrap: true
}
This will result with require(["main"]);
at the bottom of main-built.js.
If you are making a library that is made up of AMD modules in source form, but will be built with almond into one file, and you want to export a small public
API for that library, you can use the wrap
build config to do so. Build
config:
javascript
{
baseUrl: '.',
name: 'path/to/almond',
include: ['main'],
out: 'lib-built.js',
wrap: {
startFile: 'path/to/start.frag',
endFile: 'path/to/end.frag'
}
}
Where start.frag could look like this:
javascript
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
//Allow using this built library as an AMD module
//in another project. That other project will only
//see this AMD call, not the internal modules in
//the closure below.
define(factory);
} else {
//Browser globals case. Just assign the
//result to a property on the global.
root.libGlobalName = factory();
}
}(this, function () {
//almond, and your modules will be inlined here
and end.frag is like this:
javascript
//The modules for your project will be inlined above
//this snippet. Ask almond to synchronously require the
//module value for 'main' here and return it as the
//value to use for the public API for the built file.
return require('main');
}));
After the build, then the built file should be structured like so:
Explanations of common errors:
Where this line is mentioned:
if (!deps.splice) {
It usually means that there is a define()'d module, but it is missing a name, something that looks like this:
define(function () {});
when it should look like:
define('someName', function () {});
This is usually a sign that the tool you used to combine all the modules together did not properly name an anonymous AMD module.
It means that module 'x' asked for module 'y', but module 'y' was not available.
This usually means that 'y' was not included in the built file that includes almond.
almond can only handle modules built in with it, it cannot dynamically load modules from the network.
It means that a require('y')
call was done but y was not available.
This usually means that 'y' was not included in the built file that includes almond.
almond can only handle modules built in with it, it cannot dynamically load modules from the network.
Almond follows the same contribution model as requirejs and is considered a sub-project of requirejs.


If you like our Business Science Software (anomalize, tidyquant, tibbletime, timetk, and sweep), our courses, and our company, you can connect with us:
anomalize
tidyquant
tibbletime
timetk
sweep


Context path = testContextPath
Session maxInactiveInterval = 600
Label = Some label
Label with params = Some label with params params1 and params2
true
true
true
false
false
false
Some error
Some global error with params param1 and param2
Some field error with params param1 and param2


Overview
Classes: HTTPClientSession, HTTPSessionFactory, HTTPSessionInstantiator, ProxyConfig
Classes
class HTTPClientSession
This class implements the client-side of a HTTP session.
class HTTPSessionFactory
A factory for HTTPClientSession objects.
class HTTPSessionInstantiator
A factory for HTTPClientSession objects.


Delicious cake
Mixed ingredients：Cheese, cream, egg, flour, sugar, mold, sugar powder, butter
Delicious cake
Mixed ingredients：Cheese, cream, egg, flour, sugar, mold, sugar powder, butter
Delicious cake
Mixed ingredients：Cheese, cream, egg, flour, sugar, mold, sugar powder, butter
Delicious cake
Mixed ingredients：Cheese, cream, egg, flour, sugar, mold, sugar powder, butter
Delicious cake
Mixed ingredients：Cheese, cream, egg, flour, sugar, mold, sugar powder, butter
Delicious cake
Mixed ingredients：Cheese, cream, egg, flour, sugar, mold, sugar powder, butter


Class State
A State which contains an array of Instances and controls them, allowing full power over them
Inheritance
Inherited Members
Namespace: Inferno.Core
Assembly: Inferno.Desktop.dll
Syntax
public class State
Constructors
| Improve this Doc View SourceState(Game)
Create a new Game State
Declaration
public State(Game parent)
Parameters
| Type | Name | Description |
|---|---|---|
| Game | parent | The Game the State belongs to |
State(Game, Int32, Int32, Color)
Create a new Game State
Declaration
public State(Game parent, int width, int height, Color backgroundColor)
Parameters
| Type | Name | Description |
|---|---|---|
| Game | parent | The Game the State belongs to |
| System.Int32 | width | The Width of the State |
| System.Int32 | height | The Height of the State |
| Color | backgroundColor | The background color to be applied to the State |
State(Game, Int32, Int32, Sprite)
Create a new Game State
Declaration
public State(Game parent, int width, int height, Sprite background = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Game | parent | The Game the State belongs to |
| System.Int32 | width | The Width of the State |
| System.Int32 | height | The Height of the State |
| Sprite | background | The background to be applied to the State |
Fields
| Improve this Doc View SourceBackground
The states background
Declaration
public Sprite Background
Field Value
| Type | Description |
|---|---|
| Sprite |
Camera
The states view camera
Declaration
public Camera Camera
Field Value
| Type | Description |
|---|---|
| Camera |
DrawingCheck
Whether or not to check if something can be seen before drawing
Declaration
public bool DrawingCheck
Field Value
| Type | Description |
|---|---|
| System.Boolean |
Height
The State height
Declaration
public int Height
Field Value
| Type | Description |
|---|---|
| System.Int32 |
Instances
The Instances Array
Declaration
protected Instance[] Instances
Field Value
| Type | Description |
|---|---|
| Instance[] |
ParentGame
The game that the state belongs to
Declaration
public Game ParentGame
Field Value
| Type | Description |
|---|---|
| Game |
SpaceSize
The Size of each Spatial "Space"
Declaration
public int SpaceSize
Field Value
| Type | Description |
|---|---|
| System.Int32 |
SpatialMode
Spatial Mode
Declaration
public SpatialMode SpatialMode
Field Value
| Type | Description |
|---|---|
| SpatialMode |
SpatialSafeZone
The specified safe zone
Declaration
public Rectangle SpatialSafeZone
Field Value
| Type | Description |
|---|---|
| Rectangle |
UpdateMode
Specified UpdateMode
Declaration
public UpdateMode UpdateMode
Field Value
| Type | Description |
|---|---|
| UpdateMode |
UseSpatialSafeZone
Whether or not the State has a Spatial Safe Zone
Declaration
public bool UseSpatialSafeZone
Field Value
| Type | Description |
|---|---|
| System.Boolean |
Width
The State Width
Declaration
public int Width
Field Value
| Type | Description |
|---|---|
| System.Int32 |
Properties
| Improve this Doc View SourceBounds
The state bounds
Declaration
public Rectangle Bounds { get; }
Property Value
| Type | Description |
|---|---|
| Rectangle |
Item[Int32]
Get an Instance inside the State
Declaration
public Instance this[int id] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | The Instance ID |
Property Value
| Type | Description |
|---|---|
| Instance | The Instance |
Methods
| Improve this Doc View SourceAddInstance(Instance)
Add an instance to the State
Declaration
public int AddInstance(Instance instance)
Parameters
| Type | Name | Description |
|---|---|---|
| Instance | instance | The instance to add |
Returns
| Type | Description |
|---|---|
| System.Int32 | The instance reference ID |
BeginUpdate()
Begin updating the state
Declaration
public void BeginUpdate()
ConfigSpatial()
Configure the spatial spaces
Declaration
protected void ConfigSpatial()
CountInstancesAt(Vector2, Boolean)
Get the number of instances at the specified position
Declaration
public int CountInstancesAt(Vector2 position, bool boundBySafeArea = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | Position to count instances at |
| System.Boolean | boundBySafeArea | If this is true, this can only count stuff within the safe area |
Returns
| Type | Description |
|---|---|
| System.Int32 |
Draw(Renderer)
Draw a frame of the state
Declaration
public void Draw(Renderer renderer)
Parameters
| Type | Name | Description |
|---|---|---|
| Renderer | renderer | The spritebatch |
EndUpdate()
End update of the state
Declaration
public void EndUpdate()
GetIdForObj(Int32)
Get a list of spaces that contains the instance
Declaration
public List<int> GetIdForObj(int instance)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | instance | Instance to calculate spaces for |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Int32> | Spaces the Instance is inside |
GetInstance(Int32)
Get an instance by ID
Declaration
public Instance GetInstance(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | The Instance to find |
Returns
| Type | Description |
|---|---|
| Instance | The found Instance |
GetInstanceChildren(Int32)
Get everything that states it is a children of the specified instance ID
Declaration
public Instance[] GetInstanceChildren(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | The ID of the instance |
Returns
| Type | Description |
|---|---|
| Instance[] | A list of instances which are children of the specified Instance ID |
GetInstanceId(Instance)
Get the ID of an instance
Declaration
public int GetInstanceId(Instance instance)
Parameters
| Type | Name | Description |
|---|---|---|
| Instance | instance | The Instance to find an ID for |
Returns
| Type | Description |
|---|---|
| System.Int32 | The found ID |
GetInstances()
Get an array of present Instances
Declaration
public Instance[] GetInstances()
Returns
| Type | Description |
|---|---|
| Instance[] | All current Instances |
GetInstancesAt(Vector2, Boolean)
Get all instances under the specified position
Declaration
public List<Instance> GetInstancesAt(Vector2 position, bool boundBySafearea = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | Position to check for |
| System.Boolean | boundBySafearea | If this is true, this can only fetch stuff within the safe area |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<Instance> |
GetNearby(Int32)
Get all Instances near the specified instance
Declaration
public List<Instance> GetNearby(int obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | obj | Object we are looking around |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<Instance> | Instances near the checked Instance |
GetSpaceForVector(Vector2)
Declaration
public int GetSpaceForVector(Vector2 vector)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | vector |
Returns
| Type | Description |
|---|---|
| System.Int32 |
InvokeOnStateLoad(Object)
Invoke the state load event
Declaration
public void InvokeOnStateLoad(object sender)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | Who is calling the event |
InvokeOnStateUnLoad(Object)
Invoke the state unload event
Declaration
public void InvokeOnStateUnLoad(object sender)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | Who is calling the event |
RegisterInstanceInSpace(Instance)
Register the instance in a space
Declaration
protected void RegisterInstanceInSpace(Instance obj)
Parameters
| Type | Name | Description |
|---|---|---|
| Instance | obj | Object to register |
RegisterInstanceInSpace(Int32)
Register an instance in a space by ID
Declaration
protected void RegisterInstanceInSpace(int obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | obj | Object to register |
RemoveAllInstances()
Remove every instance within the state
Declaration
public void RemoveAllInstances()
RemoveInstance(Instance)
Remove an instance using an instance object
Declaration
public void RemoveInstance(Instance instance)
Parameters
| Type | Name | Description |
|---|---|---|
| Instance | instance | Instance to remove |
RemoveInstance(Int32)
Remove an instance with a specific ID
Declaration
public void RemoveInstance(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | ID of the instance to remove |
RemoveInstances(Vector2, Boolean)
Remove all instances at the specified position
Declaration
public void RemoveInstances(Vector2 position, bool boundBySafearea = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | Position of instances to remove |
| System.Boolean | boundBySafearea | Whether or not we are only able to remove in the safe area |
Update()
Update the state
Declaration
public void Update()
Events
| Improve this Doc View SourceOnStateDraw
Called when the state is drawn
Declaration
public event EventHandler OnStateDraw
Event Type
| Type | Description |
|---|---|
| System.EventHandler |
OnStateLoad
Called when the state is loaded
Declaration
public event EventHandler OnStateLoad
Event Type
| Type | Description |
|---|---|
| System.EventHandler |
OnStateUnLoad
Called when the state is unloaded
Declaration
public event EventHandler OnStateUnLoad
Event Type
| Type | Description |
|---|---|
| System.EventHandler |
OnStateUpdate
Called when the state is updated
Declaration
public event EventHandler OnStateUpdate
Event Type
| Type | Description |
|---|---|
| System.EventHandler |


createErrorObject (createErrorObject.html)
Get an error object to issue. This is boradcastType = 'simple', in the global configuration.
Paramaters
-
jwres { Object } - The jwres object returned by Sails Socket.io
-
method { string } - The http method used (usually one of: get|post|put|delete).
-
url { string } - The url requested.
-
additional { Object } - Any query used in the API call.


Toynbee Hall Datathon
Background
Not everyone might be aware, but in addition to living that dissertation life this past year, I have also been volunteering at Toynbee Hall as part of their newly re-started Residential Volunteer Worker program. The program started WAY back in the late 1890s. The idea was that all the bougie people from Oxbridge would come and live on-site in East London in order to do charity work and help out a bit before they were to go on to do other things like be elected to Parliament and then pass laws and help those that were not as well off. I probably will not be elected to Parliament anytime soon, but will hopefully go on to be a helpful member of society in other ways. Toynbee Hall restarted this program this past year and I was lucky enough to have my application accepted for the position. Since then, I have been helping out as part of the research team.
I’ve helped out with a few smaller projects here or there (basically crunching the datasets they have and putting my other research skills to use doing interviews and what not), but before my year was up, I wanted to try and do my own mini-project which will be the focus of this post: a #data4good datathon at Toynbee Hall.
History of Helping
You can read my glitzy description of the event in the link above, but if you’re reading my personal blog, as opposed to the event page, I assume this readership would want a bit more context on the Datathon and the ideas behind it. To give a bit of background, Toynbee Hall is a very, very old charity based in East London. It has a long history and was a touch point for a lot of important people in London back in the day who were interested in charity work (non-profit for all my North American readers).
Ages ago, some of the people here at Toynbee Hall helped out Charles Booth in his creation of the London maps of poverty that essentially created the first data visualizations in what might be considered a #data4good cause. Fast forward over 100 years and instead of going door to door and trying to use colors to highlight different levels of wealth on a map needing several panels, we can instead download publicly available data from something like the Open Data Institute or The London Datastore and make data visualizations with the same goals in mind.
Given Toynbee Hall’s history and current research interests that engage the community by bringing different people together, it almost seemed like a no-brainer to try to put together something where we could try to combine all of these into one coherent event.
Goals
Knowing that there are community issues in need of addressing in Tower Hamlets, as well as community members who know the area, we wanted to continue in the tradition of bringing people together to answer a question. Because my background has a bit of #rstats and data science (because of my work in music science), what seemed like the logical move here was to combine the history that Toynbee Hall has on data visualization and the local community using the data community.
So what were our goals in trying to do this event?
Well the first goal of this was to see what goes into organizing this kind of event. I don’t really have too much of an event planning background and wanted to know what I would have to get in order to front load most of the data work for everyone. This means gathering all the data to start with, figuring out how to best host it, and setting everyone up for success the afternoon of the event. This data curation is most of what I do anyway, and I figured if this process did not prove too hard, then maybe I could help out remotely on events like this after I leave Toynbee in order to still be helpful.
The second goal is the most important one:
to have the event result in the creation of meaningful material that Toynbee hall can use in their upcoming advocacy campaigns.
The research team is planning on looking at issues of both Youth Homelessness and Safety in Tower Hamlets this summer. Any data that we could find and could include in future reports could really help provide evidence that could eventually be used in a policy campaign. In order to do this we are using data that Centrepoint has given us, publicly available data on crime in London, and maybe one more source that I am putting together today.
The third, a by-product of having this event both locally and on Twitter, is to hopefully create some visibility to these issues. Just having people tweeting their data visualizations and maybe having some be caught by the community at large would be great for making people aware of these issues. It would also help us connect people who are interested in #data4good with charities or non-profits that they can help.
Lastly, in line with solving problems long term, I am also hoping to build up a network of people that Toynbee Hall can turn to after I leave. The program that I am on is just one year long and I will go on to other work after this. After my time here is up, I want to have linkd up the research team at Toynbee Hall with a network of people that could help in the future. One way that we are hoping to accomplish this is take everyone that participates in our event and link them up with organizations like DataKindUK and hopefully foster new relationships.
I have a thousand other things I want to say about this event, but instead of editing more content that I originally drafted few weeks ago, I need to instead get all the content ready for us to go tomorrow. I am sure I’ll be talking a lot more about this in the future when things calm down (still also on the come down from my dissertation submission last week…) but I invite you to join us tomorrow either at Toynbee (in the beautiful Ashbee Hall!) or online on Twitter with #data4toynbee and download the data from our Github and help us out! If you do download the data and something does not make sense, please @ me so I can fix it.
Feel free to try it out now as I put on the finishing touches!
Please get in touch if you want to chat more! Either ping me on Twitter or send me an email!


Generator
Constructor Summary
| Public Constructor | ||
| public |
|
Member Summary
| Public Members | ||
| public |
|
|
| public |
|
|
| public |
author: * |
|
| public |
authorEmail: * |
|
| public |
|
|
| public |
bundler: * |
|
| public |
|
|
| public |
commandLine: * |
|
| public |
controller: * |
|
| public |
copyright: * |
|
| public |
cssLinter: * |
|
| public |
cssLinters: string[] |
|
| public |
cssPost: * |
|
| public |
|
|
| public |
cssPre: * |
|
| public |
|
|
| public |
description: * |
|
| public |
documenter: * |
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
keywords: * |
|
| public |
license: * |
|
| public |
|
|
| public |
linter: * |
|
| public |
|
|
| public |
moduleType: * |
|
| public |
|
|
| public |
namespace: * |
|
| public |
organization: * |
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
packageName: * |
|
| public |
profile: * |
|
| public |
profiles: *[] |
|
| public |
shortName: * |
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
title: * |
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
webSite: * |
Method Summary
| Public Methods | ||
| public |
|
|
| public |
attached() |
|
| public |
|
|
| public |
clear() |
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
defaultValues(uniteConfiguration: UniteConfiguration, profile: string) |
|
| public |
|
|
| public |
generate() |
|
| public |
generateArg(profile: UniteConfiguration, uniteConfiguration: UniteConfiguration, propertyName: undefined, argName: string): string |
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
Public Constructors
public constructor() source
Public Members
public applicationFramework: * source
public author: * source
public authorEmail: * source
public authorWebSite: * source
public bundler: * source
public commandLine: * source
public controller: * source
public copyright: * source
public cssLinter: * source
public cssPost: * source
public cssPre: * source
public description: * source
public documenter: * source
public e2eTestFramework: * source
public e2eTestFrameworkEnabled: * source
public e2eTestRunner: * source
public keywords: * source
public license: * source
public linter: * source
public moduleType: * source
public namespace: * source
public organization: * source
public outputDirectory: * source
public packageManager: * source
public packageName: * source
public profile: * source
public profiles: *[] source
public shortName: * source
public sourceLanguage: * source
public title: * source
public unitTestEngine: * source
public unitTestEngineEnabled: * source
public unitTestFramework: * source
public unitTestFrameworkEnabled: * source
public unitTestRunner: * source
public webSite: * source
Public Methods
public applicationFrameworkChanged() source
public attached() source
public bundlerChanged() source
public clear() source
public copyToClipboard() source
public cssLinterChanged() source
public cssPreChanged() source
public defaultValues(uniteConfiguration: UniteConfiguration, profile: string) source
Params:
| Name | Type | Attribute | Description |
| uniteConfiguration | UniteConfiguration | ||
| profile | string |
public e2eTestRunnerChanged() source
public generate() source
public generateArg(profile: UniteConfiguration, uniteConfiguration: UniteConfiguration, propertyName: undefined, argName: string): string source
Params:
| Name | Type | Attribute | Description |
| profile | UniteConfiguration | ||
| uniteConfiguration | UniteConfiguration | ||
| propertyName | undefined | ||
| argName | string |


I am a Full-Stack Software Developer with experience building the front-end and back-end of web applications. I am a self-starter, fast learner, and enthusiastic individual who strives each day to engineer software that will reach many people across the globe.
Feel free to reach out and thank you for visiting!
Fullstack Academy of Code
New York University | Certificate in Web Development
New York University | Certificate in Android App Development
Cornell University | College of Arts & Sciences
# JavaScript
# AngularJS
# Node.js
# Express
# MongoDB
# Mongoose
# Socket.io
# jQuery
# Test-Driven Dev
# Agile/Scrum
# Git
# GitHub
# OAuth/Passport
# HTML5
# CSS3
# Bootstrap
# Materialize CSS
# Angular Material
# WordPress
# Squarespace
# Java (intermediate)
# Android (intermediate)
# SQL (intermediate)
# Polymer (intermediate)
# Tessel (intermediate)