Category: Blogs

Articles

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’] || […]

Read article : JavaScript Best Practices

Unit Testing vs Integration Testing

Unit Tests  tests a single class focuses on single behavior or function it drives implementation runs in memory (using mocks) Integration Tests tests a system (more whole than unit test) focuses on interaction between functions catches regressions (in future changes) runs in database (uses data access layer) Due to integration tests being focused on the […]

Read article : Unit Testing vs Integration Testing

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 […]

Read article : Unit Testing with Dependency Injection

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 […]

Read article : Entity Framework 6

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 […]

Read article : SQL Server Account Types and Security

Relational vs Non-Relational Databases

Other notes here regarding types of databases and cloud providers for these types of databases. http://solidfish.com/types-of-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 […]

Read article : Relational vs Non-Relational Databases

Types of Databases

These are some notes on different types of databases used in the current industry. Refer to my other post on Relational vs Non-Relational Database for more information specific to NoSQL Document Databases. http://solidfish.com/relational-vs-non-relational-databases/ Below is a list of some different types of databases as well as some platforms/tools for these database types.   Document Databases […]

Read article : Types of Databases

Repository and Factory Pattern

These are my notes in regards to using the Repository and Factory design patterns in an ASP.NET MVC / Web-API application.   Definitions Repository = A repository is used to separate the concerns between the domain logic and data layer of an application. It helps the domain layer to be decoupled from the data layer. […]

Read article : Repository and Factory Pattern

Code Management using Branches

Managing Hot Fixes and Code Quality Branches and Code Reviews TFVC vs Git Branching by feature is nice, and Git supports branching very easily. But note that each branch requires integration (merge). So having more branches mean there are potentially more merges. Some issues when doing too much branches. One good scenario for branching is […]

Read article : Code Management using Branches

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 […]

Read article : An overview of MVC 5 and Web API

Encryption and Certificates

Some quick notes on doing encryption. Encryption is a process, by which information can be transformed (encoded) in such a format, that only authorized parties can read (decode) the information, and unauthorized parties cannot. The purpose of encrypting information is to protect the sensitive data from unauthorized use. Symmetric and Asymmetric Encryption In a symmetric […]

Read article : Encryption and Certificates

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 […]

Read article : Overview of jQuery Mobile

Cloud Services Overview

  Cloud Services Provide Availability Scalability / Dynamic adjust for current workload (up or out) Elasticity / Providing scalability automatically Agility / React quickly Disaster Recovery Fault Tolerance Latency Global Reach Security Predictive Cost   Things to consider for cost when using Cloud Economies of Scale – Cloud providers have far larger resources therefore able […]

Read article : Cloud Services Overview

Reference links for PostgreSQL

Working with NpgsqlConnection http://www.sqlines.com/postgresql/npgsql_cs_result_sets   Copy command (Bulk insert) http://www.npgsql.org/doc/copy.html This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters public static void BulkInsertNpgsql<T>(this […]

Read article : Reference links for PostgreSQL

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 […]

Read article : AWS Cloud Services

Advanced Topics in C#

Some person notes on Advanced Topics programming with C#.   Inheritance vs Composition Inheritance and composition isnt specific to C# but to applies to any Object Oriented Programming language. The Inheritance model allows for “IS-A” relationships. For example, we can have a parent Fruit class and a child Apple class. The child Apple class “IS-A” […]

Read article : Advanced Topics in C#

Counting and Character Encoding

ASCII American Standard Code for Information Interchange – character encoding standard for electronic communication. Developed 1963 and is a 7bit binary system. Each character translates into a 7bit binary. This allows for 253 characters. The upper case “A” was 100001, “B” was 1000011. The lower case “a” started at 110001. This was 7bits because an […]

Read article : Counting and Character Encoding

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 […]

Read article : Modeling Message-Based Behavior with Interactions in Sequence Diagrams

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 […]

Read article : Modeling Cross-Cutting Relationships with Allocations

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 […]

Read article : Parametric Diagrams

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? […]

Read article : Modeling Constraints with Parametrics

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 […]

Read article : State Machine Diagrams with Transitions and Pseudostates

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 […]

Read article : Sequence Diagrams with Lifelines, Constraints and other Specifications

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 […]

Read article : Requirements Diagrams with Allocations

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 […]

Read article : Modeling Text-Based Requirements and Relationship to Design

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 […]

Read article : Package Diagrams, Hierarchy and Importing

Use Case Diagrams with Boundaries and Functionality

Use Case Diagrams Use Cases (uc) = the externally visible services that a system provides – as well as the actors that invoke and participate in those use cases. A black box of the system. ConOps = Concept of Operations A use case has the following properties: – Use case is a service – a […]

Read article : Use Case Diagrams with Boundaries and Functionality

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 […]

Read article : Modeling Flow-Based Behavior with Activities

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 […]

Read article : Activity Diagrams and Properties

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;     […]

Read article : Activity Modeling and relating to Block Diagrams

Internal Block Diagrams

IBD = similar to BDD except it is to specify the internal structure of a single block. It is static (structural) view of the system or one of its parts. Unlike BDD the IBD does not display blocks, but the usages of blocks. IBD shows how the block must be assembled to create a valid […]

Read article : Internal Block Diagrams

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 […]

Read article : Block Definition Diagrams and Behaviors

SysML Language Architecture

  SysML language concepts are described in 3 parts: – abstract syntax = or schema, described by metamodel – concrete syntax = or notation, described by notation tables – semantics = meaning   Architecture of SysML There are 3 levels of concept relevant to modeling language: – Domain concepts – the domain being modeled – […]

Read article : SysML Language Architecture

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 […]

Read article : System Modeling Language (SysML) Overview

System Modeling Language (SysML) Overview

The Systems Modeling Language (SysML)[1] is a general-purpose modeling language for systems engineering applications. It supports the specification, analysis, design, verification and validation of a broad range of systems and systems-of-systems. SysML was originally developed by an open source specification project, and includes an open source license for distribution and use.[2] SysML is defined as an extension of a subset of the Unified Modeling Language (UML) using UML’s profile mechanism. The language’s extensions […]

Read article : System Modeling Language (SysML) Overview

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 […]

Read article : Model Based Systems Engineering Introduction

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 = […]

Read article : Software System Testing

Example workflow branches in Git

Read article : Example workflow branches in Git

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 […]

Read article : Managing Processes in Perl

Working with Files and Directories in Perl

File Tests File test Meaning -r File or directory is readable by this (effective) user or group -w File or directory is writable by this (effective) user or group -x File or directory is executable by this (effective) user or group -o File or directory is owned by this (effective) user -R File or directory […]

Read article : Working with Files and Directories in Perl

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 […]

Read article : Perl 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 […]

Read article : Control Structures in Perl

Working with Regular Expressions in Perl

Matching with Regular Expressions (Regex) Modifiers /i # case insensitive /s # match any character, regardless of newlines /x # ignore whitespace. Example, to match floating point numbers: -? # optional minus sign \d+ # one or more digits \.? # optional decimal point \d* # zero or more optional digits after decimal point /x […]

Read article : Working with Regular Expressions in Perl

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 […]

Read article : Regular Expressions

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 […]

Read article : Hashes in Perl

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 […]

Read article : Working with Input and Outputs in Perl

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 […]

Read article : Subroutines in Perl

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 […]

Read article : Lists and Arrays in Perl

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; […]

Read article : Perl Data Types (Scalar) and Common Operators

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 […]

Read article : Perl Language Overview

Heap vs Stack Memory

Program’s memory allocation is done on the Heap and the Stack. For example if we declare a variable like below, it would be on the stack int i = 10; Objects can also be found on the stack when declared and set like so: myobject obj = null; When an object is declared but not […]

Read article : Heap vs Stack Memory

Java Coding Standards

Sample of standards used for project at work

Read article : Java Coding Standards

Fundamentals of Programming

Some of my personal notes and references regarding general programming.   SOLID A collection of principles that outline how software engineers can design and develop code that is easy to read, has flexibility to evolve and therefore easier to maintain. It was first defined by Robert C Martin (Uncle Bob) in his book – Design […]

Read article : Fundamentals of Programming