Artificial Intelligence

Artificial Intelligence Life 3.0 – Max Tegmark MIT / RIT Cosmologist / Physicist   Definition The study of intelligent agents – any device that perceives its environment and takes actions that maximize its chance of success at some goal.   Turing Test Alan Turing “Computing Machinery and Intelligence” in 1950 – a machines ability to […]

Using Visual Studio with Webpack for Angular Development

Introduction With the release of Angular 2 and ASP.NET Core in 2016, the two technologies have become a common pair for .Net web developers. The .NET Core’s platform agnostic ability has made it more appealing even for the non .Net developers. Moreover, Microsoft has been pushing hard to reach this outside market and introduced Visual […]

Angular AOT Compilation and Lazy Loading

Lazy loading is about controlling when modules or components get loaded. Lazy loading only loads objects when directed to. This is controlled through the routing engine with the “loadChildren” property and the path to the module being lazy loaded. { path: ’employees’ loadChildren: ‘app/employees/employees.module#EmployeeModule’ } Note that the module’s name is specifically called out in […]

Angular Unit Testing

The unit test framework in Angular is called Jasmine. Jasmine is what creates the tests. These tests are then run in another framework called Karma. When using Angular CLI, a unit test can be created by running ng generate service testable Generally the convention for unit test file names are component.service.ts component.service.spec.ts. The test class […]

Angular Forms

Template Driven Forms To use template driven forms, make sure that FormsModule is imported from @angular/forms. This can be brought in at the app.module level if needed throughout the application. <h3>Position</h3> <form #form=”ngForm”> <input name=”title” ngModel> <div> <button type=”submit”>Submit</button> </div> </form> {{ form.value | json }} In the last line above, the form.value is processed […]

Angular Animations

To use Angular animations, it must be installed from NPM. @angular/animations It is then imported in the AppModule as import { BrowserAnimationsModule } from ‘@angular/platform-browser/animations’; The animations can now be called inside any component. It is defined inside the component’s decorator underneath the “animations” property. import { Component } from ‘@angular/core’; import { trigger,state,style,transition,animate,keyframes } […]

Angular Directives and Pipes

Directives are attributes that are placed inside DOM elements or inside of a component. For example: <app-org-chart myDirective></app-org-chart> A class is declared as a directive by using the @Directive decorator. The selector is usually set as “[appDefault]”. A directive (or any class) can access the DOM by using the ElementRef service. This needs to be […]

Angular Routing and Navigation

Client-side routing (all done on the client through angular’s routing engine). The index.html must have the <base> element <!doctype html> <html> <head> <metacharset=”utf-8″> <title>Myquickstart</title> <base href=”/”> <metaname=”viewport”content=”width=device-width, initial-scale=1″> <linkrel=”icon”type=”image/x-icon”href=”favicon.ico”> </head> <body> <app-root>Loading…</app-root> </body> </html> The <base> element is recognized by the router and instructs how to compose navigation URLs. The app.module.ts file must have the […]

Angular with RxJS

The HttpModule is Angular’s built-in module for working with HTTP requests/responses. This needs to be imported in the module that will contain the service making the calls. import { BrowserModule } from ‘@angular/platform-browser’; import { NgModule } from ‘@angular/core’; import { FormsModule } from ‘@angular/forms’; import { HttpModule } from ‘@angular/http’; import { AppComponent } […]

Angular Services and Providers

We provide services so that the dependency injection can inject them when needed. By best practice, we name services to be provided with the word “Service”, ex SalaryService. A service is simply a class. Note that services have the “@Injectable” decorator. import { Injectable } from ‘@angular/core’; @Injectable() export class SalaryService { getSalaries() { return […]

Angular Components

Components contain metadata at the top and exported classed on the bottom. Example: @Component({   selector: ‘app-root’,   template: ‘<app-position></app-position>’,   styleUrls: [‘./app.component.css’] }) export class AppComponent {   private jobPosition = “CEO”;   hidePosition = false;   getData() {     return this.jobPosition;   } } Selectors The selector defines how a component is added […]

Angular Modules

A module is the bucket that contains the basic building blocks (components, services, etc) of an angular application. Every Angular application must have at least one module. Best practice says we define this as app.module. A module has the following key items defined within it. Declarations – list of components/directives/pipes that included in this module […]

Reactive Programming using RxJS

Reactive Programming Paradigm Asynchronous programming Works with Functional Programming ReactiveX works with many languages JS .Net Java   More information: http://reactivex.io/intro.html   Mission Statement ReactiveX observable model allows you to treat streams of asynchronous events with the same sort simple, composable operations that you use for collections of data items like arrays. It frees you […]

Introduction to ASP.NET Core

ASP NET Core Released June 2016 Build on .Net core Cross Platform Not tied to .Net framework Unification of MVC and Web API Dependency Injection is core feature (no third party) Modular HTTP Request pipeline Based on NuGet � everything is package Cloud ready IIS or self-host Open Source Problems with ASP NET MVC Dependency […]

Managing and Deploying SQL Database Code

SQL Server Data Tools (SSDT) Does database comparisons, deployments, automation In Visual Studio SQL Server Project Being in Visual Studio � can do smart refactoring. It propagates all the changes (like a rename) to all associated files. Schema Compare and Updates Changes made on the SQL server can be brought back into Visual Studio through […]

DevOps integration with Team Foundation Server

DevOps Dev + Ops = Delivery and support of software Dev and Ops work closely together Use of automation Build Test Deploy MonitoringInfrastructure (like use of containers / docker)Frequent ReleasesQuick testing Creates predictability and consistency (a delivery every 30 days) Define what DONE means Works in smaller chunks prioritizes the backlog   TFS and Team […]

Using Azure to Manage Connection Strings

Azure provides a variety of application settings that can help manage the app from within Azure instead of coding it in the application. Some of these settings are highlighted below. Application Settings tbd Connection Strings Azure provides connection strings that can be configured for the whole app. This includes ASP.NET based apps as well as […]

ASP.NET MVC, WEBAPI, SQL, Unit Test and EF on Azure

This is a sample project that contains the following: ASP.NET MVC (4.6) ASP.NET WEBAPI SQL (SQL SERVER 2014) ENTITY FRAMEWORK (5) UNIT TESTS All is deployed on Azure here: http://samplewidgets.azurewebsites.net/ This is a project I use as kind of a template for other projects that use similar technologies and frameworks. I’ve also used it to […]

UI / UX Design Fundamentals

Notes taken during CodeSchool course: Fundamentals of Design All pictures are property of CodeSchool Typography Some fonts are just horrible. Invest in researching which fonts match your content and audience. Content should be both verbal and visual, depending on what needs to be presented. Typefaces Humanist Serif = good for journalistic content Sans Serif does […]

Introduction to AngularJS

This is Angular Version 1 Introduction course to AngularJS (v1) from MVA.   @section scripts{       <script src=”~/Scripts/angular.js”></script>    <script src=”~/Scripts/angular-route.js”></script>    <script src=”~/Scripts/angular-resource.js”></script>    <script src=”~/Scripts/angular-animate.js”></script>    <script src=”~/Client/Scripts/AtTheMovies.js”></script>    <script src=”~/Client/Scripts/MovieService.js”></script>    <script src=”~/Client/Scripts/ListController.js”></script>    <script src=”~/Client/Scripts/DetailsController.js”></script>    <script src=”~/Client/Scripts/EditController.js”></script> } <h1>At the movies</h1> <div data-ng-app>    {{true ? “true” : “false”}} </div> Module = is an abstraction that allows you to […]

Entity Framework 6

These are my notes while reviewing the latest release of Entity Framework EF6       Migrations = creates or updates database automatically as models in the application change. This lets developers focus on the application models and not worry about the database.   EF SaveChanges() This does the actual SQL command execution. It is […]

SQL Server Account Types and Security

A quick reference to SQL Server Account Types and System Security   Ports Clients connect to SQL Server through UDP 1434 SQL server responds with a TCP Port number to continue their connection Default TCP port is 1433     Server and System Security SQL Service runs under a service account, can be: Windows account […]

JavaScript Best Practices

Ternary Conditionals var x = true ? true : false;   Nested Ternaries isArthur && isKing ? (weapon = ‘a, helment = ‘a) : isArcher ? (weapon = ‘b’, helmet = ‘b’) : (weapon = ‘c’, helmet = ‘c’);   Logical Assignments Var result = 42 || undefined; // 42 Var result2 = [‘sweet’] || […]

Unit Testing with Dependency Injection

Unit Test One of the most commonly skipped or minimally managed areas of application development is unit testing. It is often seen as overhead, even unnecessary, and given very little or no attention. On some projects where requirements are often changing rapidly, the developer can get frustrated trying to keep up with the changes and […]

Relational vs Non-Relational Databases

History   Relational theory Tuples = unordered set of attribute values (row and attribute of column in a table) Relation = collection of tuples and corresponding relations Constraints = enforce consistency; used to identify tuples and relationships between them Operations = joins, projectsions, unions, etc; generally based on the relations   Transaction model Changes on […]

An overview of MVC 5 and Web API

Some general notes on MVC5 and WebAPI…   The MVC pattern is been in computer science since 1979, known then as the Thing-Model-View-Editor. The Model: A set of classes that describes the data you’re working with as well as the business rules for how the data can be changed and manipulated The View: Defines how […]

Overview of jQuery Mobile

Using jQuery Mobile for a web application that needed to be easily accessible to mobile users.     Download the project sample � MVC4Mobile This is a mobile app for showing Conference details. Sessions data for the conference is kept in the following XML file: ~/App_Data/Sessions/RawSessionsData.xml   The project starts with no pleasant mobile view […]

AWS Cloud Services

Review of Amazon Web Services (AWS). Material taken from AWS Associate Certification Exam (v.2012) Compute (Elastic Computer Cloud / EC2) Amazone Machine Image EC2 Instance Store Volumes Elastic Batch Store (EBS) Databases on EC2 Auto Scaling Elastic Load Balancing (ELB) Networking Amazon VPC (Virtual Private Cloud) Security Groups Network Access Control Lists (ACL) Elastic Network […]

Modeling Message-Based Behavior with Interactions in Sequence Diagrams

Sequence diagram = represents an interaction; can only show interactions so model element type: interaction; in form: sd [Interaction] interaction name [diagram name] [1] What is the diagram kind for a sequence diagram, and which type of model element does it represent? A = sd / interaction only; [2] What is the context for an […]

Modeling Cross-Cutting Relationships with Allocations

Allocation = mechanism to relate model elements (build relationships); useful for system of systems (SoS); supports allocation of behavior, structure and properties; functional allocation = allocation of activities to blocks; Allocation relationship = between any named model elements; Model element A is allocated to Model element B when from-end of allocation relationship is A and […]

Parametric Diagrams

Parametric Diagrams (par) = used to express information about system’s constraints. Recall that a constraint block = special kind of block that encapsulates constraint expression; equation or inequality. This enables the following abilities: – Specify assertions of valid system values (thereby detecting exceptional conditions) – Provides inputs and outputs for engineering analysis and simulation during […]

Modeling Constraints with Parametrics

Parametric models capture the constraints on the properties of the system; expressed as equations; uses bdd to define constraint blocks; the header follows format: par [model element type] model element name [diagram name] [6] How are constraint properties represented on a parametric diagram? ANS: 7.2 [7] How are constraint parameters represented on a parametric diagram? […]

State Machine Diagrams with Transitions and Pseudostates

State Machine (stm) = behavior diagram, how a structure within system changes state in response to event occurrences over time. This is not the same as state machine diagram (can have multiple diagrams for single state machine). State machine is the namespace, a set of named elements.   Classifier behavior = behavior that begins executing […]

Sequence Diagrams with Lifelines, Constraints and other Specifications

Sequence diagrams (sd) = used to express information about system’s dynamic behavior, by using elements called lifelines to model participants in the system behavior and use messages between lifelines to model the interactions. This view expresses sequences of behaviors and events over time. This is an ideal diagram when wanting to display how blocks interacts […]

Requirements Diagrams with Allocations

Requirements Diagram Use to be text-based requirements (and requirements specifications in them) traditionally. This can be represented through the requirements diagram (req). It traces requirements to the elements in the system model. Requirement = rectangle with stereotype <<requirement>> preceding the name and two properties, id and text, both of type string. SysML only requires these […]

Modeling Text-Based Requirements and Relationship to Design

Requirement = capability or condition that must be met by a system, or a performance condition the system must achieve; similar requirements are grouped into a specification; requirements can be shown graphically or tabular, or in compact graphical notations in any SysML diagram. Uses <<requirement>> model element; [1] What is the abbreviation for a requirement […]

Package Diagrams, Hierarchy and Importing

Package Diagrams Package diagram (pkg) = displays the organization of the system model based on package hierarchy where packages could be nested within each other. Namespace = model element that is allowed to contain other named elements, included nested elements. A model = one of four specialized kind of packages, this serves as the root […]

Modeling Flow-Based Behavior with Activities

Activity Diagram = frame represents an activity; [1]What is the diagram kind of the activity diagram?diagram kind of “act” for activity; has following form: act [Activity] activity name [diagram name] Activity name = name to represent the activity; Diagram name = user defined name to describe purpose of diagram;   [2]How are an action and […]

Activity Diagrams and Properties

Activity Diagram (act) = one of three ways to express information about system’s dynamic behavior (activity, sequence, state machine), it’s a dynamic view of the system that expresses sequences of behaviors and event occurrences over time. (whereas a structure diagram like BDD, IBD and parametric diagrams show static views that convey no sense of time […]

Activity Modeling and relating to Block Diagrams

Interruptible region = subset of actions within activity that can interrupt execution of activity via interrupting edge; noted by dashed line around activity nodes; an interrupting edge is noted by lightning bolt symbol; [21] interrupting edge node is within the interruptible region and this has to be triggered to exit the interruptible region;     […]

Block Definition Diagrams and Behaviors

The most common SysML diagram is BDD, which includes elements such as blocks, actors, value types, constraint blocks, flow specifications and interfces. Elements of Definition = the elements of a BDD, which are the foundation of everything else, contains the structural relationships, associations, generalizations and dependencies BDD should be created often = created when stakeholder […]

System Modeling Language (SysML) Overview

SysML = broad and richly expressive graphical language with aspects of system’s design: structure, behavior, requirements, parametrics (mathematical models) SysML grammar and notations are defined by OMG (Object Management Group) SysML is extension of UML and as such, some SysML rules are actually defined in UML specification document (ie ValueType is derivative of DataType) Nine […]

Model Based Systems Engineering Introduction

Systems Engineering Overview SysML = System Modeling Language INCOSE = International Council of Systems Engineering SysML = Object Management Group’s (OMG) SysML = general purpose graphical modeling language for representing systems that may include hardware, software, data, people, facilities and natural objects. Supports practice of model-based system engineering (MBSE). Systems engineering = multidisciplinary approach to […]

Software System Testing

Software testing is a process to find defects in a given software system and improve the overall quality of that software. It is a process of validation and verification that the software system meets the business and technical requirements, performs as expected and achieves the goals or results the system is designed for. Validation = […]

Managing Processes in Perl

The system Function Calls other programs Creates a child process to run the program being called Perl inherits the standard input, output and error Therefore if the program is printing something, that will automatically go through Perl’s STDOUT Perl waits for the child process to finish Like done on the shell, Perl can also launch […]

Perl Modules

The properties of Perl Modules: Modules either come with Perl or can be downloaded from CSPAN Modules can also be custom written Libraries also exist, but the difference is: Libraries mostly contain similar subroutines Modules is like a “smart library” – offers collection of subroutines that act as if they were build in functions Modules […]

Control Structures in Perl

The “unless” control structure Opposite of the “if” condition Only executes the code block if the condition is FALSE # UNLESS Control Structure $_ = “foey foo foobar!”; unless (/foobarz/) { print “Inside of UNLESS block \n”; } # this prints unless (/foobar/) { print “Inside of UNLESS block \n”; } # this does NOT […]

Regular Expressions

Regular expressions, often called pattern in Perl, is a template that either matches or doesn’t match a given string. Metacharacters o When referencing groups, remember that perl takes the last group value . # match any single character except newline \ # use literal value of next character * # quantifier, match zero or more […]

Hashes in Perl

Hash is an associative array o A data structure with key – value, where the key is a unique string o Perl processes big hashes just as fast as small ones. Hashes are most useful when dealing with Finding duplicates Unique Cross reference Lookup table Hash expression: $hash{$key} = $value; $hash{$key} .= $hash{$key2}; #creates key […]

Working with Input and Outputs in Perl

Input from Standard Input o Common way to input from standard input: chomp($line = <STDIN>); Reading continuous input would look something like: while ( chomp($line = <STDIN>) ) {…} # or while (defined($_ = <STDIN>)) { … } The Diamond Operator < > o Useful for making programs that work like standard Unix utilities, with […]

Subroutines in Perl

Defining Subroutines o Use the keyword sub o Subroutines can have ampersand (&) in the front of the name or not o By default, all subroutines are global (public); requires advanced methods to make them private o Two of the exact same subroutine names can be defined, but the first one is overrided by the […]

Lists and Arrays in Perl

Scalar represents “singular” in Perl. The “plural” are represented through Lists and Arrays List is an ordered collection of scalars Array is a variable that contains a list Element of an array or list is a separate scalar variable List is the data, array is the variable representing the list. There are no size limits […]

Perl Data Types (Scalar) and Common Operators

Scalar Data A scalar is the simplest kind of data that Perl manipulates String of characters primatives Numbers Perl always uses double-point precision for values (no difference between floats or integers) Examples: #Numbers $myint1 = 123456; $myint2 = 123_456; # can use _ anywhere in number $mybig1 = 1.23e10; # e notation $mysmall1 = 0xff; […]

Perl Language Overview

Introduction Using Perl version 5.10 (five.ten) Perl = Practical Extraction and Report Language (only one of many names people use to call it) Larry Wall – creator 1980s – heavily uses Unix commands Use shell or awk programming with advanced tools like grep, cut, sort and sed but without having the complexities of a language […]