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
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |
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 functools import partial | |
import numpy as np | |
from tqdm import tqdm | |
LUT_SIZE = 33 | |
def _convert(pixel, lut): | |
r, g, b = map(lambda x: round((x / 255) * LUT_SIZE - 1), pixel) | |
idx = r + g * LUT_SIZE + b * (LUT_SIZE ** 2) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<packageSources> | |
<add | |
key="nuget.org" | |
value="https://api.nuget.org/v3/index.json" | |
protocolVersion="3" /> | |
<add | |
key="sharper-c" | |
value="https://www.myget.org/F/sharper-c/api/v3/index.json" |
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
/** | |
* check if a selector match a given Node element | |
* see https://developer.mozilla.org/en-US/docs/Web/API/Element/matches | |
* @param element element to check | |
* @param selector selector to check | |
* @return true if there is a match | |
*/ | |
export function matches(element: HTMLElement, selector: string): boolean { | |
var matches = (<any> element).matches || (<any> element).webkitMatchesSelector || element.msMatchesSelector || (<any> element).mozMatchesSelector || (<any> element).oMatchesSelector; | |
matches = matches.bind(element); |
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 class HomeController : Controller { | |
private readonly ViewRender view; | |
public HomeController (ViewRender view) { | |
this.view = view | |
} | |
public string Test () { | |
// render ~/Views/Emails/ResetCode |
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
@ignore | |
Feature: UserAccess | |
@web | |
Scenario: Try to get access to Some_Part_Of_The_Application | |
Given I open 'Application_Name' application as 'User'. | |
When I navigate to 'Some_Part_Of_The_Application'. | |
Then Menu navigation causes exception. |
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 found = [], // an array to collect the strings that are found | |
rxp = /{([^}]+)}/g, | |
str = "a {string} with {curly} braces", | |
curMatch; | |
while( curMatch = rxp.exec( str ) ) { | |
found.push( curMatch[1] ); | |
} | |
console.log( found ); // ["string", "curly"] |
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 class SerializeExtensions | |
{ | |
/// <summary> | |
/// Serializes the specified obj. | |
/// </summary> | |
/// <param name="obj">The obj.</param> | |
/// <returns>A string representing serialized data</returns> | |
public static string Serialize(this object obj) | |
{ | |
//Check is object is serializable before trying to serialize |
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
[ | |
{ | |
"title": "Design patterns and practices in .NET: the Adapter Pattern", | |
"link": "http://dotnetcodr.com/2013/04/25/design-patterns-and-practices-in-net-the-adapter-pattern/" | |
}, | |
{ | |
"title": "Design patterns and practices in .NET: the Strategy Pattern", | |
"link": "http://dotnetcodr.com/2013/04/29/design-patterns-and-practices-in-net-the-strategy-pattern/" | |
}, | |
{ |
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
namespace System | |
{ | |
using System.Collections.Generic; | |
/// <summary> | |
/// | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
public class Switch<T> | |
{ |
NewerOlder