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
{ | |
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#", | |
"handler": "Microsoft.Azure.CreateUIDef", | |
"version": "0.1.2-preview", | |
"parameters": { | |
"basics": [ | |
{} | |
], | |
"steps": [ | |
{ |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#", | |
"handler": "Microsoft.Azure.CreateUIDef", | |
"version": "0.1.2-preview", | |
"parameters": { | |
"basics": [ | |
{} | |
], | |
"steps": [ | |
{ |
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
from platform import python_version | |
print(python_version()) | |
os.environ['PYTHONPATH']=str(sys.executable)+':/data/home/oneweek/notebooks/models/research:/data/home/oneweek/notebooks/models/research/slim' | |
print (os.environ['PYTHONPATH']) | |
! python --version | |
! echo "PYTHONSTARTUP:" $PYTHONSTARTUP | |
! echo "PYTHONPATH:" $PYTHONPATH | |
! echo "PYTHONHOME:" $PYTHONHOME | |
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
echo "get the go-junit-report package" | |
go get -u github.com/jstemmer/go-junit-report | |
echo "run the tests" | |
go test -v ./tests 2>&1 > go-test-result && exitCode=$? || exitCode=$? | |
echo "Write the result.xml file" | |
cat go-test-result | $(GOBIN)/go-junit-report > report.xml | |
echo "result: $exitCode" |
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
import sys | |
import os | |
import tensorflow as tf | |
import numpy as np | |
import scipy | |
from PIL import Image | |
from scipy import misc | |
cwd = os.getcwd() |
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
import tensorflow as tf | |
import numpy as np | |
from tensorflow.examples.tutorials.mnist import input_data | |
import matplotlib.image as mp_image | |
import matplotlib.pyplot as mp_pyplot | |
mnist = input_data.read_data_sets("minst_data/", one_hot=True) | |
training_digits, training_lables = mnist.train.next_batch(5000) | |
test_digits, test_lables = mnist.train.next_batch(10) |
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; | |
using System.Collections.Generic; | |
using System.IO; | |
using Assets.Scripts.Models; | |
using UnityEngine; | |
//https://www.packtpub.com/books/content/using-rest-api-unity-part-1-what-rest-and-basic-queries | |
namespace Assets.Scripts.Services | |
{ |
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; | |
using System.Collections.Generic; | |
using System.IO; | |
using Assets.Scripts.Models; | |
using UnityEngine; | |
//https://www.packtpub.com/books/content/using-rest-api-unity-part-1-what-rest-and-basic-queries | |
namespace Assets.Scripts.Services | |
{ |
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
public static string CreateSHA256Signature(string key, string message) | |
{ | |
// Hex Decode the Secure Secret for use in using the HMACSHA256 hasher | |
// hex decoding eliminates this source of error as it is independent of the character encoding | |
// hex decoding is precise in converting to a byte array and is the preferred form for representing binary values as hex strings. | |
var convertedHash = new byte[key.Length / 2]; | |
for (var i = 0; i < key.Length / 2; i++) | |
{ | |
convertedHash[i] = (byte)int.Parse(key.Substring(i * 2, 2), System.Globalization.NumberStyles.HexNumber); | |
} |
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 Sitecore.StringExtensions; | |
namespace SOPA.Framework.Helpers | |
{ | |
using Sitecore.Data; | |
using Sitecore.Resources.Media; | |
public static class MediaHelper | |
{ | |
public static string GetImageUrl(string imageSrc, int width, int height, bool allowStretch, bool protectAssetUrl) | |
{ | |
if (imageSrc.IsNullOrEmpty()) |
NewerOlder