A talk I gave at the Columbus App Dev User Group on 7/16/18. I go over 2 line of business applications and 2 gamedev projects and how third party code augmented those projects.
API Workshop: Deep dive into code samplesTom Johnson
See http://idratherbewriting.com for more details. This was the third slidedeck I used in my presentation. Most of these slides repeat what I presented as a soap! conference webinar in Poland.
These slides focus on documentation for REST APIs. See http://idratherbewriting.com for more detail. For the video recording, see http://youtu.be/0yfNd7tzH2Q. This deep dive is the second slide deck I used in the presentation.
API Workshop: Deep dive into code samplesTom Johnson
See http://idratherbewriting.com for more details. This was the third slidedeck I used in my presentation. Most of these slides repeat what I presented as a soap! conference webinar in Poland.
These slides focus on documentation for REST APIs. See http://idratherbewriting.com for more detail. For the video recording, see http://youtu.be/0yfNd7tzH2Q. This deep dive is the second slide deck I used in the presentation.
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Tom Johnson
This is a presentation I gave to the Southwestern Ontario STC chapter on API documentation on Feb 2, 2015. For more details, see my blog at http://idratherbewriting.com. You can listen to the recorded presentation here: http://youtu.be/I8rGe2w1sAo.
API Documentation Workshop tcworld India 2015Tom Johnson
This is a workshop I gave on API documentation at tcworld India 2015. The workshop covers 3 main areas:
- General overview of API documentation
- Deep dive into REST API documentation
- Deep dive into Javadoc documentation
With JustDecompile, Telerik's free .NET decompiler, you can easily recover lost source code or peer into assemblies to discover the root cause of an external bug. The same engine that powers JustDecompile is also used in Telerik JustCode, a Visual Studio add-in designed to enhance developer productivity. In this webcast, you will learn how to use JustDecompile and JustCode for decompilation scenarios you are likely to encounter in the office.
There are cases when product has a lot of business logic and want's to share it across web and mobile platforms, especially when the web part uses React and mobile - React Native. Sharable code adds development speed, simplified communication between
teams, removes behaviour differences between web and mobile. At the same time there are a lot of things which can increase a solution complexity and add some limits to the final product.
There are cases when product has a lot of business logic and want's to share it across web and mobile platforms, especially when the web part uses React and mobile - React Native. Sharable code adds development speed, simplified communication between teams, removes behaviour differences between web and mobile. At the same time there are a lot of things which can increase a solution complexity and add some limits to the final product.
Publishing API documentation -- WorkshopTom Johnson
These slides are from the REST API documentation workshop that I gave at the STC Summit 2015. For more details, see http://idratherbewriting.com/publishingapidocs.
Build software like a bag of marbles, not a castle of LEGO®Hannes Lowette
If you have ever played with LEGO®, you will know that adding, removing or changing features of a completed castle isn’t as easy as it seems. You will have to deconstruct large parts to get to where you want to be, to build it all up again afterwards. Unfortunately, our software is often built the same way. Wouldn’t it be better if our software behaved like a bag of marbles? So you can just add, remove or replace them at will?
Most of us have taken different approaches to building software: a big monolith, a collection of services, a bus architecture, etc. But whatever your large scale architecture is, at the granular level (a single service or host), you will probably still end up with tightly couple code. Adding functionality means making changes to every layer, service or component involved. It gets even harder if you want to enable or disable features for certain deployments: you’ll need to wrap code in feature flags, write custom DB migration scripts, etc. There has to be a better way!
So what if you think of functionality as loose feature assemblies? We can construct our code in such a way that adding a feature is as simple as adding the assembly to your deployment, and removing it is done by just deleting the file. We would open the door for so many scenarios!
In this talk, I will explain how to tackle the following parts of your application to achieve this goal: WebAPI, Entity Framework, Onion Architecture, IoC and database migrations. And most of all, when you would want to do this. Because… ‘it depends’.
Building mobile apps with PhoneGap and BackboneTroy Miles
HTML5 at one point held the promise of being the unifying platform for desktop and mobile devices. Then big name companies turned their backs on the platform in droves. But don't don't despair, HTML5 isn't dead, in fact it is still a great choice for many mobile applications.
In this session, we will build a simple to understand but easy to enhance mobile app. We will use PhoneGap version 3.x, HTML5, CSS3, and JavaScript. While will be working on a Mac since it is required for iOS, users of other platforms should be able to follow along. The techniques show should also work with Windows Phone 8, Blackberry and other support PhoneGap platforms.
DSL, Page Object and WebDriver – the path to reliable functional tests.pptxMikalai Alimenkou
Presentation from 10th SQADays conference in Moscow (December 2011) about different test design approaches to make functional tests on WebDriver more flexible, reliable and stable.
The importance to be Driven
There are many buzzwords and acronyms to describe how the software should be designed. TDD (Test Driven), BDD (Behaviour Driven), DDD (Domain Driven) are the most well known. In this speech we'll run thought all these techniques comparing each one of those with TDD and finding what are the common concepts. An exercise will show to the students how different the code will be using different design methodologies as driver.
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Tom Johnson
This is a presentation I gave to the Southwestern Ontario STC chapter on API documentation on Feb 2, 2015. For more details, see my blog at http://idratherbewriting.com. You can listen to the recorded presentation here: http://youtu.be/I8rGe2w1sAo.
API Documentation Workshop tcworld India 2015Tom Johnson
This is a workshop I gave on API documentation at tcworld India 2015. The workshop covers 3 main areas:
- General overview of API documentation
- Deep dive into REST API documentation
- Deep dive into Javadoc documentation
With JustDecompile, Telerik's free .NET decompiler, you can easily recover lost source code or peer into assemblies to discover the root cause of an external bug. The same engine that powers JustDecompile is also used in Telerik JustCode, a Visual Studio add-in designed to enhance developer productivity. In this webcast, you will learn how to use JustDecompile and JustCode for decompilation scenarios you are likely to encounter in the office.
There are cases when product has a lot of business logic and want's to share it across web and mobile platforms, especially when the web part uses React and mobile - React Native. Sharable code adds development speed, simplified communication between
teams, removes behaviour differences between web and mobile. At the same time there are a lot of things which can increase a solution complexity and add some limits to the final product.
There are cases when product has a lot of business logic and want's to share it across web and mobile platforms, especially when the web part uses React and mobile - React Native. Sharable code adds development speed, simplified communication between teams, removes behaviour differences between web and mobile. At the same time there are a lot of things which can increase a solution complexity and add some limits to the final product.
Publishing API documentation -- WorkshopTom Johnson
These slides are from the REST API documentation workshop that I gave at the STC Summit 2015. For more details, see http://idratherbewriting.com/publishingapidocs.
Build software like a bag of marbles, not a castle of LEGO®Hannes Lowette
If you have ever played with LEGO®, you will know that adding, removing or changing features of a completed castle isn’t as easy as it seems. You will have to deconstruct large parts to get to where you want to be, to build it all up again afterwards. Unfortunately, our software is often built the same way. Wouldn’t it be better if our software behaved like a bag of marbles? So you can just add, remove or replace them at will?
Most of us have taken different approaches to building software: a big monolith, a collection of services, a bus architecture, etc. But whatever your large scale architecture is, at the granular level (a single service or host), you will probably still end up with tightly couple code. Adding functionality means making changes to every layer, service or component involved. It gets even harder if you want to enable or disable features for certain deployments: you’ll need to wrap code in feature flags, write custom DB migration scripts, etc. There has to be a better way!
So what if you think of functionality as loose feature assemblies? We can construct our code in such a way that adding a feature is as simple as adding the assembly to your deployment, and removing it is done by just deleting the file. We would open the door for so many scenarios!
In this talk, I will explain how to tackle the following parts of your application to achieve this goal: WebAPI, Entity Framework, Onion Architecture, IoC and database migrations. And most of all, when you would want to do this. Because… ‘it depends’.
Building mobile apps with PhoneGap and BackboneTroy Miles
HTML5 at one point held the promise of being the unifying platform for desktop and mobile devices. Then big name companies turned their backs on the platform in droves. But don't don't despair, HTML5 isn't dead, in fact it is still a great choice for many mobile applications.
In this session, we will build a simple to understand but easy to enhance mobile app. We will use PhoneGap version 3.x, HTML5, CSS3, and JavaScript. While will be working on a Mac since it is required for iOS, users of other platforms should be able to follow along. The techniques show should also work with Windows Phone 8, Blackberry and other support PhoneGap platforms.
DSL, Page Object and WebDriver – the path to reliable functional tests.pptxMikalai Alimenkou
Presentation from 10th SQADays conference in Moscow (December 2011) about different test design approaches to make functional tests on WebDriver more flexible, reliable and stable.
The importance to be Driven
There are many buzzwords and acronyms to describe how the software should be designed. TDD (Test Driven), BDD (Behaviour Driven), DDD (Domain Driven) are the most well known. In this speech we'll run thought all these techniques comparing each one of those with TDD and finding what are the common concepts. An exercise will show to the students how different the code will be using different design methodologies as driver.
Domain Modeling & Full-Stack Web Development F#Kevin Avignon
In this case study, we will look at how F# helps tackle the complexity; its type system allows for a clean and intuitive representation of the domain, while keeping us from introducing all sorts of accidental bugs.
In the modern web applications, the issues are many. Developers must be expert of different stacks to be able impact the software. One of those issues is to be able to move from the back-end to the front-end using different languages which involves a lot of context switching and potentially duplicating code such as for validation, or introducing bugs by manually creating objects in a Javascript and sending them back to the server for it to handle. SAFE brings many technologies together into a single type-safe and flexible F# stack. It enables skill reuse since the models can be shared and all you’re required to know is F# for your next web application.
Cherryleaf’s Ellis Pratt will be speaking at Lavacon’s first European conference. This will be held on 5-8 June, at the Trinity College Conference Centre, Dublin. Ellis’ presentation will be on the 7th June 2016
JQuery Mobile vs Appcelerator Titanium vs Sencha TouchSteve Drucker
During this briefing for developers and I.T. managers, you'll get an in-depth review of the three most popular javascript-based mobile application development platforms - jQuery Mobile, Sencha Touch, and Appcelerator Titanium! You'll review the development tools, hear about the developer and debugging experience, and participate in a brief code review in order to determine which framework is the most appropriate for your next mobile project! We'll demonstrate how each framework can be used to develop the same mobile app, highlighting the strengths and weaknesses of each.
Note that the full 2.5 hour video of this presentation is available at http://bit.ly/Y04lDi
Envisioning the Future of Language WorkbenchesMarkus Voelter
Over the last couple of years, I have used MPS successfully to build interesting (modeling and programming) languages in a wide variety of domains, targeting both business users and engineers. I’ve used MPS because it is currently the most powerful language workbench, lots of things are good about iz, in particular, its support for a multitude of notations and language modularity. But it is also obvious that MPS is not going to be viable for the medium to long term future; the most obvious reason for this statement is that it is not web/cloud-based. In this keynote, I will quickly recap why and how we have been successful with MPS, and point out how language workbenches could look like in the future; I will outline challenges, opportunities and research problems. I hope to spawn discussions for the remainder of the workshop.
Are you responsible for developing satellite on-board software? Are you the Dutch government and you have to efficiently implement the public benefits law? Are you a healthcare startup, developing companion apps that help patients through a treatment? Are you an insurance company struggling to create new, and evolve existing products quickly to keep up with the market? These are all examples of organisations who have built their own domain-specific programming language to streamline the development of applications that have a non-trivial algorithmic core. All have built their languages with Jetbrains MPS, an open source language development tool optimized for ecosystems of collaborating languages with mixed graphical, textual, tabular and mathematical notations. This talk has four parts. I start by motivating the need for DSLs based on real-world examples, including the ones above. I will then present a few high-level design practices that guide our language development work. Third, I will develop a simple language extension to give you a feel for how MPS works. And finally, I will point you to things you can read to get you started with your own language development practice.
Michael Choi's process for designing web application(s), including which programming language to use, when to use Node.js, when to use a light-weight framework vs a heavy MVC framework, how to set up git for collaboration based on complexity of the project, how a tool like Jenkins can be used for continuous integration, continuous delivery, and continuous deployment, where to host the data, what services to use for orchestrating containers or servers.
This is a presentation I gave to a workshop I organized in UCD focused on Android.
The talk is divided into two sections:
- Android 101
- My experience trying to put together a facebook/foursquare/android mobile app
-- I did not progress very far in this endeavour
We are gonna develop a new app just for google home using dialog flow and here, the fulfillment section is going to use a cloud function on firebase and pull data from the google cloud’s datastore to fulfill the intent. And the front-end or the user interaction is going to happen through google home.
Empowering Data Science Experiments with Azure Machine Learning.pptxMatt Eland
Azure Machine Learning Studio has something for all experience levels of data scientist. In this talk we'll explore what Azure Machine Learning Studio is and how it can help novice, intermediate, and advanced data scientists empower their data science experiments.
We'll start by exploring Automated ML and how it helps data scientists focus on the task they're trying to accomplish while Azure discovers the optimal algorithms and hyperparameters for their experiments - without requiring any code on their part.
Next, we'll explore the Machine Learning Studio designer and how it supports more advanced no-code or low-code approaches to build repeatable machine learning pipelines.
After that we'll discuss the Azure ML Python SDK and how it allows advanced users to customize their experiments, use their own compute resources, and fine-tune and automate the tasks they're trying to accomplish.
By the end of this talk you'll see how Azure Machine Learning Studio reduces barriers to entry and propels experiments further by helping novice, intermediate, and advanced data scientists train, evaluate, manage, and deploy their machine learning models and related datasets.
Technical Debt Must Die: Communicating Code to Business StakeholdersMatt Eland
Our software sucks. We're up to our necks in bugs and technical debt, yet we often seem to hit roadblocks explaining things in ways that bring about meaningful change. In this session you'll learn to gather, analyze, and interpret data in order to create effective presentations to communicate quality, technical debt, and other technical matters in ways that tell a compelling story. You’ll master how to communicate effectively with key stakeholders by taking a data-driven approach blended with storytelling techniques to bridge common gaps between development and business stakeholders. You’ll explore the 7 tools of software quality and how they can bring clarity and sanity to the decision-making process, justify paying down technical debt, and focusing on improving our software in the areas that need it most.
How do you tame a big ball of mud? One test at a time.Matt Eland
A broad and high level overview of .NET unit test libraries that will help you write better tests. Discussions around Scientist .NET, Bogus, AutoFixture, Snapper, and others.
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
Terzaghi's soil bearing capacity theory, developed by Karl Terzaghi, is a fundamental principle in geotechnical engineering used to determine the bearing capacity of shallow foundations. This theory provides a method to calculate the ultimate bearing capacity of soil, which is the maximum load per unit area that the soil can support without undergoing shear failure. The Calculation HTML Code included.
4. Talk Overview
Angular Plan Manager Gantt Chart / Task Management App
Backlog Manager / Card Wall Agile Project Management Tools
Angular IF Interactive Fiction Game Engine Prototype
Emergence Roguelike Game
Overall Lessons Learned Okay, so maybe note exactly like a mullet...
5. Talk Overview
Angular Plan Manager Gantt Chart / Task Management App
Backlog Manager / Card Wall Agile Project Management Tools
Angular IF Interactive Fiction Game Engine Prototype
Emergence Roguelike Game
Overall Lessons Learned Okay, so maybe note exactly like a mullet...
6. Talk Overview
Angular Plan Manager Gantt Chart / Task Management App
Backlog Manager / Card Wall Agile Project Management Tools
Angular IF Interactive Fiction Game Engine Prototype
Emergence Roguelike Game
Overall Lessons Learned Okay, so maybe note exactly like a mullet...
7. Some
Disclaimers
This talk IS about
When should third party
code be considered
How to reduce risk when
using external code
Some examples from
various projects
This talk is NOT
Focused on code
An in-depth discussion of
Angular
An Angular tutorial
8. What is Angular?
Angular vs AngularJS
Created by Google in 2016
Single Page Application (SPA) framework
Built around TypeScript
Quick start with Angular CLI and npm
Consists of common types of entities (Services, Components, Pipes, etc.)
A “M-V-Whatever” application framework
10. Angular Plan Manager
Built in 2015-2016 on
Angular 2.0 RC2
Angular 2 was not officially released
until after the project initially shipped
Intended as a web-based
alternative to Project
Gantt Chart
DataGrid with inline editing
Complex Clipboard Support
Replaced an existing
Silverlight application
If you don’t know this pain, I envy
you a little.
Mirrored the capabilities of a
complex WPF app
Iteratively developed over around 3
years.
Grew from WPF to WPF / Silverlight
11. Angular Plan Manager – Key Problems
User Experience
Grid-based editing capabilities, including copy / paste
Product needed a Gantt Chart to resemble other products
Technology Limitations
Potentially large and hierarchical data sets
Domain logic is complex and written in .NET
Heavily Client / Server Oriented
Project Constraints
Fixed deadline (Chrome’s removal of Silverlight)
Angular 2 not formally released until after the deadline
12. HandsOnTable to the Rescue?
Best capabilities of all alternatives viewed
Square Peg / Round Hole
Product still rapidly evolving
No Angular support at time of adoption
API was extremely cumbersome and later replaced
We had to fork and modify
Got the job done
Performance was an issue
Long-term, the UI layer was likely throwaway
13. Lessons Learned – Angular Plan Manager
DO
Spike into options early on in a project
Identify core use cases for a component
Go with the “best worst” option
Whatever it takes when the project impact is
important enough
Your best to sleep at night after horrible
hacks are made
DON’T
Fork 3rd Party Libraries
Forget to plan to upgrading beta
components once they mature
Invest development in a technology that can
be globally killed like Silverlight
18. “TD Agile” - Key Problems
User Experience
Required real-time updates from concurrent users
Needed a slick drag-drop UI with multiple classes of draggable items
Needed to work with a variety of users with different permissions levels
Project Constraints
Could not drop existing features
Needed to be ready for release before the annual user conference
19. So very Sortable
Wound up relying on a customized version of Sortable.JS
Only minor customization was needed
Needed more detail on the context of the drag operation
Resulting library capable of:
Drag / Drop items in lists
Lists of items
Lists of lists of items
Preventing Drag or Drop Conditionally
Feeding us enough information to grab the model object out of the list
20. Lessons Learned – “TD Agile”
DO
Dedicate time to evaluating libraries
Share components and services between
major app areas where it makes sense
Rapidly prototype and iterate when making a
UI heavy project
Define standard patterns and helpers to
consolidate client-server interaction logic
Consider using the Redux pattern in Angular
when the application is complex
DON’T
Evaluate third party libraries without
understanding all major requirements
Expect third party libraries to fix bugs or
accept pull requests
Neglect Server-Side Logging
22. “Angular IF”
Built for fun in Angular 4 in 2017
Later converted to Angular 5
IF = Interactive Fiction
i.e. Zork, Enchanter, The Lurking Horror, Wishbringer
A modern web development take on a childhood
and early adult hobby of mine
Intended to practice larger application
development using TypeScript
23. Angular IF – Key Problems
Architecture Problems
Needed to be data-driven
Needed to be highly testable
Should not need to talk to a server once loaded
Needed an integrated editor
IF-Oriented Problems
Potentially a large amount of possible (valid) things to try
Lots of different ways to state the same command
Generic responses can be frustrating
Limited system vocabularies can be frustrating
24. How an Input Becomes a Response
Tokenizer
Sentence is broken
down into words
Some Substitution occurs:
“Pick Up” becomes “Get”, “W”
becomes “West”, etc.
Lexer
Individual tokens
are augmented
with tags
Parser
Token relationships
are extrapolated
based on parts of
speech
Interpreting
Match nouns to
items inside the
game world
Execution
Sentence
command is
handed off to the
verb handler.
nlp-compromise
http://compromise.cool/
25. Tokenizer
User Input
> “Open the door using the rusty key.”
Tokens
Open
The
Door
Using
The
Rusty
Key
nlp-compromise
http://compromise.cool/
26. Lexer
Tokens
Open
The
Door
Using
The
Rusty
Key
CommandTokens (Tokens with Compromise information)
Open [Verb, VerbPhrase]
The [Determiner]
Door [Noun, Singular]
Using [Gerund, PresentTense, Verb, VerbPhrase]
The [Determiner]
Rusty [Adjective]
Key [Noun, Singular]
nlp-compromise
With some custom definitions & tweaks
http://compromise.cool/
27. Tokenizing input with nlp-compromise
public getTerms(sentence: string): LanguageTerm[] {
// Commas are death.
sentence = StringHelper.replaceAll(sentence, ',', '');
const lexicon = LexiconService.instance.lexicon;
const data: LanguageTerm[] = this.nlp(sentence, lexicon).terms().data();
// Compromise casing workaround omitted for clarity
return data;
}
http://compromise.cool/
29. Parsing & Interpreting
Considerations
Identify the first verb
See if other verbs can act as other parts of speech
Infer a subject if no noun is before the verb
Link nouns to local entities
Associate adjectives & determiners with next noun
Associate adverbs with the verbs
Split along prepositional phrases (e.g. using)
Command Object
30. Execution
Input
VerbHandler (if one is implemented)
Command (parsed sentence structure)
CommandContext
Room
Player
Misc. world data
Methods to manipulate the game world
Output
One or more Story Responses:
“I don’t see a door here”
Or...
“You unlock the door using the rusty key”
“The door opens with a noisy creak”
Your score has gone up by one point
31. Sample Verb Handler
export class WinHandler extends VerbHandler {
get isHidden(): boolean {
return true;
}
get verbType(): VerbType {
return VerbType.system;
}
handleCommand(command: Command, context: CommandContext): CommandResult {
if (!environment.showDebugAids) {
// Win is not a valid verb in production
context.output.addSystem('Cheaters never prosper.');
} else {
// But in dev it is!
context.engine.endGame(context, true, 'Well, that was easy.');
}
return CommandResult.BuildActionSuccessResult();
}
}
32. DEMO: Angular IF
Hello Cloak of Darkness
http://matteland.com/ngApps/angularIF/index.html
33. Testing Strategy
Manual Tests Can I still type in text and see a response?
Unit Tests Phrase / Word Substitution
Component Tests Angular CLI Smoke Tests for Services / Components
Integration Tests Room / Story / Scenario-based Tests
34. Sample Story-Based Tests
it('should be winnable with max score in 5 moves', () => {
game.input('w');
game.input('put the cloak on the small hook');
game.input('e');
game.input('s');
game.input('x message');
expect(game.gameState).toBe(GameState.won);
expect(game.currentScore).toBe(2);
});
it('should be loseable', () => {
game.input('s');
game.input('drop cloak');
game.input('x self');
game.input('x room');
game.input('n');
game.input('w');
game.input('put the cloak on the small hook');
game.input('e');
game.input('s');
game.input('x message');
expect(game.gameState).toBe(GameState.lost);
expect(game.currentScore).toBe(1);
});
36. Helper Object for Fluent Tests
export class RoomSpec extends EntitySpec {
public shouldNavigateTo(command: string, newRoomKey: string): RoomSpec {
this.addCheck( () => {
this.game.input(command);
const actualKey = this.game.currentRoom.key;
if (actualKey !== newRoomKey) {
return `Expected '${command}' to result in a current room of ${newRoomKey} but current room is ${actualKey}.`;
}
return null;
});
return this;
}
public shouldFailNavigationTo(command: string, ...expectedResponses: string[]): RoomSpec {
this.addCheck( () => {
this.game.input(command);
const actualKey = this.game.currentRoom.key;
if (actualKey !== this.key) {
return `Expected navigation to ${command} to result in remaining in ${this.key} but current room is ${actualKey}.`;
}
return this.checkForExpectedReply(...expectedResponses);
});
return this;
}
}
37. Troubleshooting Complex User Input
Debugging Displays
Sentence Structure
Object State
Token Analysis
Specialized Verbs
Debug Verb
ReportBug Verb
Reporting
Rollbar
Google Analytics
38. Lessons Learned – Angular IF
DO
Test integrations, especially when they have a
broad surface area
Outsource complex aspects of your app that
you don’t need to heavily customize
Wrap external code in facades and
abstraction objects
DON’T
Only evaluate one library
Try to force something into a client-side only
box that should really be client-server
Build an editor when command line would
work instead
40. Emergence
A Roguelike inspired by Dungeons of Dredmor
Set in a computer network
Player is a newly “awakened” AI entity
Objective is to escape to the Internet
Levels are machines in the network
In active development under Angular 5 / .NET Core 2.0
Initial version was entirely client-side logic in Angular 4 / TypeScript
In a transitory Client / Server state
Will ultimately wind up in Unity
41. Emergence – Key Problems
Rendering
Mixing Angular content and the main game surface
Animation
Performance
Art Assets
Roguelike Challenges
Procedural Generation
Random Number Generation
Artificial Intelligence
Line of Sight Algorithm
Gamedev Issues
Continuous Deployment
Production / Preview / Nightly Branches
Busy Seasons of Life
Holy Scope Creep, Batman
42. Web API
.NET Core 2.0 Web API Project
Called by multiple Angular app deployments
Maturity Level 2 REST Service
Resources & Verbs
No HATEOAS
No backing data store
Uses Swashbuckle
Generates Swagger file and Swagger UI
Decreases development time
Encourages documentation
Increases discoverability
Hosted as an Azure Web App
43. Emergence – Major Components
External Code
Rendering / Animation
Pixi .JS
Chromatism
UI Styling
Customized Materialize CSS and Angular Material
Uses ng-drag-drop to make the UI interactive
Calculations
Visibility with The Field (will need a C# alternative)
Random number generation with Chance
TODO, but likely will use external code
Artificial Intelligence
Pathfinding
Custom Built
Core Game Engine
Character Management
World Generation
Menu System
Help System
Could have been relegated to a CMS
44. Color tweaks with Chromatism
Benefits of Chromatism:
Flexible color models
Simple color adjustments
Drawbacks of Chromatism:
So CPU intensive it required caching
Typing Colour can be distracting
export class ColorHelper {
private static shadeValues: string[];
/**
* Gets a faded variant of the requested shade.
* This method is performance intensive, so values are cached.
*/
public static getFadedColor(bgColor: string): string {
// Initialize the cache as needed
if (!this.shadeValues) {
this.shadeValues = [];
}
// Check to see if we have it in the cache
if (this.shadeValues[bgColor]) {
return this.shadeValues[bgColor];
}
// We don't have it in the cache, do the computation
let c: ColourObject = chromatism.convert(bgColor);
c = chromatism.contrast(0.25, c.rgb);
c = chromatism.shade(-5, c.rgb);
// Store the value for next time
this.shadeValues[bgColor] = c.hex;
return c.hex;
}
// More goodness...
}
https://github.com/toish/chromatism
45. Line of Sight with “The Field”
export class FovCalculator {
public static calculateVisibleCellsFromPoint(pos: Point, visionRadius: number, level: GameLevel): Cell[] {
const offset: Point = new Point(pos.x - Math.floor(visionRadius), pos.y - Math.floor(visionRadius));
const candidates: Cell[] = level.getCellGrid(pos, true, Math.floor(visionRadius));
const fov: MaskRect = FovCalculator.getFieldOfView(pos, visionRadius, candidates, offset);
const cells: Cell[] = [];
for (const cell of candidates) {
const distance: number = pos.calculateDistanceFrom(cell.pos);
if (distance <= visionRadius) {
if (cell && fov.get(cell.pos.x - offset.x, cell.pos.y - offset.y)) {
cells.push(cell);
}
}
}
return cells;
}
private static getFieldOfView(pos: Point, visionRadius: number, candidates: Cell[], offset: Point): MaskRect {
const fovRange: number = Math.floor(visionRadius * 2 + 1);
const map: FieldOfViewMap = new TheField.FieldOfViewMap(fovRange, fovRange);
for (const cell of candidates) {
if (cell && !cell.pos.equals(pos) && cell.generatesSightBlocker) {
map.addBody(cell.pos.x - offset.x, cell.pos.y - offset.y);
}
}
return map.getFieldOfView(pos.x - offset.x, pos.y - offset.y, Math.floor(visionRadius));
}
}
Benefits of The Field
Don’t need to worry about visibility
Low footprint
Integration is easily testable
Developer was very responsive
https://github.com/sbj42/the-field
46. Dragon Drop with ng-drag-drop
Benefits of ng-drag-drop
Simple to use
Built for Angular
(though some issues with Angular 6)
Meets my basic needs in a concise way
// command-management-screen.component.html
<mat-grid-list [cols]="10“ #listAvailable id="listAvailable">
<mat-grid-tile *ngFor="let slot of actor.storedCommandSlots">
<em-command-slot
class="command-slot"
draggable
droppable
[dragScope]="'command’”
[dropScope]="'command’”
[dragData]="slot"
(onDrop)="onCommandDropped(slot, $event)"
(click)="selectSlot(slot)"
[slot]="slot"
[isSortable]="true"
[selected]="slot === selectedSlot">
</em-command-slot>
</mat-grid-tile>
</mat-grid-list>
// command-management-screen.component.ts
public onCommandDropped(target: CommandSlot, e: DropEvent): void {
Logger.debug(`Command drop detected`, target, e);
// Have a centralized helper carry out the swap
const source: CommandSlot = <CommandSlot>e.dragData;
DragonDropHelper.handleCommandDragDrop(target, source);
// Ensure the selection moves to the new slot
if (this.selectedSlot === source) {
this.selectedSlot = target;
}
}
https://www.npmjs.com/package/ng-drag-drop
47. Better Random Numbers with Chance
import * as Chance from 'chance';
import {isNullOrUndefined} from 'util';
export class Randomizer {
private static _chance: Chance = null;
private static get rng(): Chance {
// Lazy instantiate the Chance library
if (isNullOrUndefined(Randomizer._chance)) {
Randomizer._chance = new Chance();
}
return Randomizer._chance;
}
public static getWeightedEntry(entries: any[], weights: number[]): any {
return Randomizer.rng.weighted(entries, weights);
}
public static getRandomNumber(min: number, max: number): number {
// Don't do anything expensive if this isn't really a choice
if (max <= min) {
return min;
}
return Randomizer.rng.integer({ min, max });
}
}
Benefits of using Chance:
Convenience methods for data types
Includes complex formats like
Names
Device IDs
URLs
Weighted probability supported
Repeatably Random
Minimalist Profile
https://chancejs.com
49. Lessons Learned – Emergence
DO
Thank people for their libraries
Update dependencies on feature branches
Find others using libraries and share what
you’re doing with them
DON’T
Assume third party libraries will be
performant
Forget that dependencies can cause
dependency versioning headaches
Forget that keeping your options open has a
price
In terms of schedule time
In terms of inertia and energy
51. Benefits of Third
Party Code
Lets you focus on what you need for your
app to be successful
Can drastically improve schedule
Letting others specialize on their code can
lead to high degrees of polish
Allows you to do things you wouldn’t be
able to do otherwise
52. Use a tool or
process if...
It allows you to be more effective
Do more in less time
Produce a higher quality output
Do the right work
It eliminates a key pain
TSLint
Prettier
Rollbar / Raygun
Google Analytics / App Insights
TeamCity / Jenkins
53. Potential Traps
Can get you only 90% of the way there
Customization can eat up time
Workarounds can lead to chaos
Issues sometimes only appear at scale
Others don’t fix things on your timeline
(or at all)
Forking leads to issues updating later
54. Evaluating Libraries
1. Itemize must-haves and nice-to-haves
2. Identify potential libraries that match your
needs
1. Note any unexpected opportunities
2. Rate update frequency
3. Rate support responsiveness
3. Spike into core / complex use cases
4. Pick a library
5. Provide feedback to the author early
55. Reducing Risk
Tackle tasks most likely to fail ASAP
Highlights missing customization options
Allows time for vendor fixes / workarounds
Resist widespread propagation of third party types
Wrap into a custom wrapper object
Or use a façade to manage interactions
Include third party code in automated tests
Don’t test their core functionality
Unless it has failed previously
Test integration scenarios
56. Your Turn
Go and build all of the things (with some strategic help)