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
| angular.module('myApp.controllers', []). | |
| controller('MyCtrl1', ['$scope', function($scope) { | |
| $scope.uploadFile = function() { | |
| console.log("Uploading file"); | |
| for (var i = 0, f; f = $scope.files[i]; i++) { | |
| var reader = new FileReader(); | |
| reader.onloadend = function(evt) { | |
| if (evt.target.readyState == FileReader.DONE) { | |
| console.log(evt.target.result); | |
| } |
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
| $scope.filesPortfolio = { | |
| id:0, | |
| idName:"Documents", | |
| number:"1", | |
| name:"Documents", | |
| files:[ | |
| {id:0,type:"image",title:"Brochure Cooling", image:"thumb0.png"}, | |
| {id:1,type:"image",title:"Cooling systems", image:"thumb1.jpg"}, | |
| {id:2,type:"image",title:"Transport systems", image:"thumb2.jpg"}, | |
| {id:3,type:"video",title:"Long distance transport", image:"thumb3.jpg"}, |
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
| 'use strict'; | |
| /* Filters */ | |
| angular.module('myApp.filters', []). | |
| filter('interpolate', ['version', function(version) { | |
| return function(text) { | |
| return String(text).replace(/\%VERSION\%/mg, version); | |
| }; | |
| }]). |
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
| // The SqlEntityConnection (Entity Data Model) TypeProvider allows you to write code that uses | |
| // a live connection to a database that is represented by the Entity Data Model. For more information, | |
| // please go to | |
| // http://go.microsoft.com/fwlink/?LinkId=229210 | |
| module GeertVLConnection | |
| #if INTERACTIVE | |
| #r "System.Data" | |
| #r "System.Data.Entity" |
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; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using Xunit; | |
| namespace Specs.Registration | |
| { | |
| public enum UserStatus |
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
| public class Guest : UntypedActor | |
| { | |
| private IActorRef _receptionist; | |
| public Guest() | |
| { | |
| var receptionist = Context.ActorSelection("/user/Klara"); | |
| receptionist.Tell(new Identify("111"), Self); | |
| } |
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
| Object.extend(Number.prototype, ( | |
| function() { | |
| function succ() { | |
| return this + 1; | |
| } | |
| function times(iterator, context) { | |
| $R(0, this, true).each(iterator, context); | |
| return this; | |
| } | |
| // shortened to fit on this slide! |
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
| // Part 1. | |
| // Implement a function prototype extension that caches function results for | |
| // the same input arguments of a function with one parameter. | |
| // | |
| // For example: | |
| // Make sin(1) have the result of Math.sin(1), but use a cached value | |
| // for future calls. | |
| // | |
| // Part 2. | |
| // Use this new function to refactor the code example. |
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
| <script> | |
| var Person = function(name) { | |
| this.name = name; | |
| this.getName = function() { | |
| return this.name; | |
| }; | |
| } | |
| var thomas = new Person('Thomas'); | |
| var amy = new Person('Amy'); |
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
| <script> | |
| // Part 1 | |
| // Implement a function prototype extension that caches function results for | |
| // the same input arguments of a function with one parameter. | |
| Function.prototype.withCaching = function withCaching() { | |
| if (!this.cache) { this.cache = {}; } | |
| var method = this; | |
| return function(input) { | |
| if (typeof method.cache[input] == "undefined") { |
OlderNewer