This file contains 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.Net; | |
using System.Net.Http; | |
using System.Web.Http; | |
namespace bat_mvc.Controllers.api | |
{ | |
public class SampleController : ApiController |
This file contains 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
module App { | |
"use strict"; | |
interface IMyAppController { | |
values: string[]; | |
errorMessage: string; | |
isVisibleErrorMessage: boolean | |
} | |
export class MyAppController implements IMyAppController { |
This file contains 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
module App { | |
"use strict"; | |
interface IMyAppDirective extends ng.IDirective { | |
} | |
interface IMyAppDirectiveScope extends ng.IScope { | |
} | |
interface IMyAppDirectiveAttributes extends ng.IAttributes { |
This file contains 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
module App { | |
"use strict"; | |
// Create the module and define its dependencies. | |
angular.module("app", [ | |
// Angular modules | |
// "ngAnimate", // animations | |
// "ngRoute" // routing | |
// Custom modules |
This file contains 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
@Scripts.Render("~/bundles/angular") | |
@Scripts.Render("~/bundles/app") |
This file contains 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
bundles.Add(new ScriptBundle("~/bundles/angular").Include( | |
"~/Scripts/angular.js")); | |
bundles.Add(new ScriptBundle("~/bundles/app").IncludeDirectory( | |
"~/Scripts/App", "*.js", true)); |
This file contains 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
test <- c ( 1, 2, 3) | |
v1 <- as.character(lapply(test, class)) | |
v2 <- as.character(lapply(test, class)) | |
result <- rbind(v1,v2) | |
data.set <- data.frame(result, stringsAsFactors = FALSE) | |
maml.mapOutputPort("data.set"); |
This file contains 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
test <- c ( 1, 2, 3) | |
v1 <- lapply(test, class) | |
v2 <- lapply(test, class) | |
result <- rbind(v1,v2) | |
data.set <- data.frame(result, stringsAsFactors = FALSE) | |
maml.mapOutputPort("data.set"); |
This file contains 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
gold <- maml.mapInputPort(1) # Load data from port 1 into data frame | |
price <- gold$Value # initialize vector with prices (numeric) | |
dates <- gold$Date # initialize vector with dates (POSIXct) | |
dates <- as.numeric(dates) # HACK: change dates to a numeric | |
class(dates) <- "POSIXct" # HACK: set class to POSIXct | |
library(zoo) # Load zoo library | |
z <- zoo(price,dates) # Convert incoming data to a zoo object | |
t <- time(z) # Retrieve a vector of the dates from the zoo object | |
data.set <- data.frame(t, z, stringsAsFactors = FALSE) # Create the data frame to be returned | |
maml.mapOutputPort("data.set"); # Return the data frame to Azure ML |
This file contains 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
gold <- maml.mapInputPort(1) # Load data from port 1 into data frame | |
price <- gold$Value # initialize vector with prices (numeric) | |
dates <- gold$Date # initialize vector with dates (POSIXct) | |
library(zoo) # Load zoo library | |
z <- zoo(price,dates) # Convert incoming data to a zoo object | |
t <- time(z) # Retrieve a vector of the dates from the zoo object | |
data.set <- data.frame(t, z, stringsAsFactors = FALSE) # Create the data frame to be returned | |
maml.mapOutputPort("data.set"); # Return the data frame to Azure ML |