Skip to content

Instantly share code, notes, and snippets.

azadeh khojandi Azadehkhojandi

Block or report user

Report or block Azadehkhojandi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pythonjupyter
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
@Azadehkhojandi
Azadehkhojandi / testgo.sh
Created Oct 25, 2018
running go tests and export the results for azure devops
View testgo.sh
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"
@Azadehkhojandi
Azadehkhojandi / classify.py
Created Feb 27, 2018
Using exported custom vision tensor-flow model in python
View classify.py
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()
@Azadehkhojandi
Azadehkhojandi / digitsocr.py
Created Nov 20, 2017
K-Nearest Neighbors with the MNIST Dataset
View digitsocr.py
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)
@Azadehkhojandi
Azadehkhojandi / FaceApiService.cs
Last active Jun 14, 2017
How to call Microsoft cognitive services face api in unity , Imagine you can take snap shot of the user can show different content based on their gender, age or emotion! read more here https://azure.microsoft.com/en-au/services/cognitive-services/face/
View FaceApiService.cs
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
{
@Azadehkhojandi
Azadehkhojandi / FaceApiService.cs
Created Jun 14, 2017
how to call Microsoft cognitive services face api in unity
View FaceApiService.cs
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
{
@Azadehkhojandi
Azadehkhojandi / CreateSHA256Signature
Last active Jul 17, 2018
Create SHA256 Signature for payment gateway (bendigo bank)
View CreateSHA256Signature
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);
}
View MediaHelper.cs
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())
@Azadehkhojandi
Azadehkhojandi / gulpfile.js
Last active May 16, 2018
Gulp webserver boilerplate
View gulpfile.js
"use strict";
var gulp = require('gulp');
var connect = require('gulp-connect'); //Runs a local dev server
var open = require('gulp-open'); //Open a URL in a web browser
var config = {
port: 9005,
url: 'http://localhost',
@Azadehkhojandi
Azadehkhojandi / markup.html
Last active Oct 19, 2016
How to have responsive hamburger menu and brand logo with boot strap v4 alpha
View markup.html
<nav class="navbar navbar-light header-background p-x-0" id="nav2">
<button class="navbar-toggler hidden-lg-up pull-xs-right" type="button" data-toggle="collapse" data-target="#exCollapsingNavbar2" aria-controls="exCollapsingNavbar2" aria-expanded="false" aria-label="Toggle navigation">
&#9776;
</button>
<a class="navbar-brand hidden-md-down p-l-1" href="#">
<img class="img-fluid" alt="" src="/images/Logo.png">
</a>
<a class="navbar-brand hidden-lg-up p-l-1" href="#">
<img width="100" alt="" src="/images/Logo.png">
</a>
You can’t perform that action at this time.