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
<!-- index.html --> | |
<!DOCTYPE html> | |
<html ng-app="directoryApp"> | |
<head> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="row"> |
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
//Swift | |
var primate = "monkey" | |
var delicousTreat: String = "donut" | |
let plant = "pine tree" | |
func combineThings(thing1: String, thing2: String) -> String{ | |
let newThing = thing1 + " " + thing2 | |
return newThing | |
} |
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
<asp:DropDownList ID="cboCategory" runat="server"></asp:DropDownList> | |
<select id="cboType"></select> |
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
$('#cboCategory').change(function () { | |
var categoryId = $(this).val(); | |
loadTypeList(categoryId); | |
}); | |
function loadTypeList(categoryId) { | |
$.ajax({ | |
type: 'POST', | |
url: 'Example.aspx/GetTypeList', | |
data: '{categoryId: "' + categoryId + '" }', |
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
[WebMethod] | |
public static List<Type> GetTypeList(string categoryId) | |
{ | |
var types = new List<Type> | |
{ | |
new Type(){ Name = "Red", Id=1, CategoryId=5 }, | |
new Type(){ Name = "Blue", Id=2, CategoryId=5 }, | |
new Type(){ Name = "Green", Id=3, CategoryId=3 } | |
}; | |
var catId = Convert.ToInt32(categoryId); |
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
<telerik:RadAsyncUpload ID="asyncUpload" runat="server" AllowedFileExtensions="pdf,jpg,jpeg,png" OnClientFileSelected="OnClientFileSelected"></telerik:RadAsyncUpload> | |
<asp:HiddenField runat="server" ID="hiddenFile"/> |
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
function OnClientFileSelected(sender, args) { | |
var fileInput = sender; | |
//get the file from the input field | |
var file = args.get_fileInputField().files[0]; | |
var imageType = /image.*/; | |
//stop the image from uploading to the temp storage on the server | |
if (file.type === 'image/jpeg') { | |
sender.pauseUpload(); | |
$('.ruUploadProgress').addClass('ruUploadSuccess'); |
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
var imageFile = hiddenFile.Value; | |
String img = imageFile.Replace("data:image/jpeg;base64,", "").Replace(" ", "+"); | |
byte[] b = Convert.FromBase64String(img); | |
var timestamp = DateTime.Now.ToString("yyyy_MM_dd_HHmmssfff"); | |
var virtualDirectoryPath = "~/Receipts/" + year + "/"; | |
var fileName = Path.Combine(page.Server.MapPath(virtualDirectoryPath), | |
timestamp + ".jpg"); | |
System.IO.File.WriteAllBytes(fileName, bytes); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-lg-12"> | |
<!-- This is where we are going to put the graph --> |
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
//NOT SO GOOD | |
public class Car | |
{ | |
public bool IsBus {get; set;} | |
public bool HasTurbo {get; set;} | |
public int NumberOfPistons {get; set;} | |
public double TotalWeight {get; set;} | |
abstract public double GetHorsePower(){ | |
OlderNewer