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
* Promise vs Observable | |
* Promise | |
* Single async event that can either complete or fail once. | |
* Can be used with async/await keywords. | |
* Observable | |
* Can emit multiple events async. | |
* Offers a bit more control over the async task, for example cancelling. | |
* Cannot be used with async/await keywords. | |
* Think of Observables as a stream of data instead of an async task. | |
* Observable is the default used in Angular, but promises are still fine to use. |
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
{ | |
"workbench.iconTheme": "material-icon-theme", | |
"workbench.editor.showTabs": false, | |
"editor.tabSize": 2, | |
"editor.detectIndentation": false, | |
"editor.minimap.enabled": false, | |
"files.autoSave": "afterDelay", | |
"files.autoSaveDelay": 1000, | |
"files.exclude": { | |
"**/.git": true, |
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
/** | |
* Provides the ability to fetch global plugin objects. | |
*/ | |
class PluginService { | |
static $inject = ['$ionicPlatform', '$window', '$q', '$log']; | |
constructor(private $ionicPlatform: ionic.platform.IonicPlatformService, | |
private $window: ng.IWindowService, | |
private $q: ng.IQService, | |
private $log: ng.ILogService) { |
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
package com.dkellycollins.ioc; | |
import java.util.HashMap; | |
import java.util.Map; | |
/** | |
* Manages class instances. | |
*/ | |
public abstract class Module { |
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
/// <summary> | |
/// Non-Generic BaseForm. Provides functionality for retrieving the controller. | |
/// </summary> | |
public class BaseForm : Form | |
{ | |
/// <summary> | |
/// Gets the controller for the given type. | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <returns></returns> |
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
declare module ngTable { | |
class ngTableParams { | |
data:any[]; | |
constructor(parameters:any, settings:any); | |
parameters(newParameters:string, parseParamsFromUrl:string):any; | |
settings(newSettings:string):any; |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int numOfCoPrimes = 0; | |
for (int i = 1; i < 1225; i++) | |
{ | |
int g = gdc(i, 1225); | |
if (g == 1) | |
numOfCoPrimes++; |
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
using System; | |
namespace Sum | |
{ | |
class Program | |
{ | |
//Estimates the perimeter of a circle of radius 1 using Archimededes formulas | |
static void Main(string[] args) | |
{ | |
int n = 96; //n-polygon to estimate with. |
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
@using BootstrapSupport | |
@model Object | |
<div class="container"> | |
@using (Html.BeginForm()) | |
{ | |
@Html.ValidationSummary(true) | |
<fieldset class="form-horizontal"> | |
<legend>@Model.GetLabel() <small>Details</small></legend> | |
@foreach (var property in Model.VisibleProperties()) |
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
///<summary> | |
///Handles processing data of type T. Subclass implements process and handles storing results. | |
///</summary> | |
public abstract class QueueProcessor<T> | |
{ | |
private Queue<T> _data; | |
private BackgroundWorker _worker; | |
private bool _stopOnEmpty; | |
public delegate ErrorHandler(Exception e); |
NewerOlder