Custom action (in C# dll):
[CustomAction]
public static ActionResult TestDbConnection(Session session)
{
using (var connection = new SqlConnection(session["CONNECTION_STRING"]))
{
try
{
// assuming elements in a set do not repeat | |
let rec kCombinations k (set: 'a list) = | |
match k with | |
| 1 -> set |> List.map (fun x -> [x]) | |
| _ -> | |
match set with | |
| [] -> [] | |
| head::tail -> | |
(tail |> kCombinations (k - 1) |> List.map (fun x -> head::x)) | |
@ (tail |> kCombinations k) |
using System; | |
using System.Collections.Generic; | |
using System.Collections.Specialized; | |
using System.Globalization; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace AwsV4SignatureCalculator |
Custom action (in C# dll):
[CustomAction]
public static ActionResult TestDbConnection(Session session)
{
using (var connection = new SqlConnection(session["CONNECTION_STRING"]))
{
try
{
public static MvcHtmlString LocalDateTime(this HtmlHelper helper, DateTime utcDateTime) | |
{ | |
return new MvcHtmlString( | |
String.Format( | |
"<script>var d=new Date('{0}');document.write(new Date(d.getTime()-d.getTimezoneOffset()*60000))</script>", | |
utcDateTime.ToString("g"))); | |
} |
Download and install Squid 3.5 for Windows (default path is C:\Squid)
Create file C:\Squid\etc\.htpasswd with the following content:
admin:$apr1$kWA/DRFy$klaeXRe3S3jIPqc64HTMA0
This corresponds to username admin and password 1234
To generate your own username/password use http://www.htaccesstools.com/htpasswd-generator-windows/
Open Squid configuration (squid.conf)
# Connect your account, you will be prompted to enter your credentials in the popup | |
Add-AzureAccount | |
# Check that your subscription has been loaded | |
Get-AzureSubscription | |
# Select a subscription as default if needed | |
Select-AzureSubscription -Default <SubscriptionName> |
[global] | |
floatX = float32 | |
# pycuda didn't work so using "new backend" | |
# pygpu+libgpuarray installed via conda ("conda install pygpu") | |
device = cuda | |
[nvcc] | |
# CUDA v8.0 installed over VS 2012 | |
compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe |