This file contains hidden or 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
#pragma once | |
#include <torch/torch.h> | |
// Special thanks for wangvaton: https://github.com/wangvation/torch-mobilenet/blob/master/module/mobilenet.py | |
//# BSD 2 - Clause License | |
// | |
//# Copyright(c) 2019 wangvation.All rights reserved. | |
// | |
//# Redistribution and use in source and binary forms, with or without | |
//# modification, are permitted provided that the following conditions are met : |
This file contains hidden or 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 collections import OrderedDict | |
class LRUCache: | |
# initialising capacity | |
def __init__(self, capacity: int): | |
self.cache = OrderedDict() | |
self.capacity = capacity | |
# we return the value of the key |
This file contains hidden or 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
# Python3 Program to print BFS traversal | |
# from a given source vertex. BFS(int s) | |
# traverses vertices reachable from s. | |
from collections import defaultdict | |
# This class represents a directed graph | |
# using adjacency list representation | |
class Graph: | |
# Constructor |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using Microsoft.Xrm.Sdk.Query; | |
public static class XmlConditionOperator | |
{ | |
// Credit for BCA https://stackoverflow.com/a/41618045/1238848 | |
public static Dictionary<string, string> GetAllPublicConstantValues(this Type type) |
This file contains hidden or 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 IEnumerable<T> FirstGroupItems<T, TKey>(this IEnumerable<T> list, Func<T, TKey> keySelector, Func<IGrouping<TKey, T>, T> firstPredicate = null) where T : class | |
{ | |
return list.GroupBy(keySelector).Select(a => firstPredicate == null ? a.First() : firstPredicate(a) ?? a.First()); | |
} |
This file contains hidden or 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 IEnumerable<TResult> ConditionalSelect<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, bool> predicate, Func<TSource, TResult> truthySelector, Func<TSource, TResult> falsySelector) | |
{ | |
return source.Select(a => predicate(a) ? truthySelector(a) : falsySelector(a)); | |
} |
This file contains hidden or 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 DateTime? From { get; set; } | |
public DateTime? To { get; set; } | |
readonly DateTime minFrom = new DateTime(2000, 1, 1); | |
readonly DateTime maxTo = new DateTime(2100, 1, 1); | |
public DateTime SafeFrom() => | |
From.GetValueOrDefault(To.GetValueOrDefault(minFrom)); | |
public DateTime SafeTo() => | |
To.GetValueOrDefault(From.GetValueOrDefault(maxTo)); |
This file contains hidden or 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
{ | |
"categories": [{ | |
"name": "action", | |
"key": "action", | |
"icons": [{ | |
"id": "ic_3d_rotation", | |
"name": "3d rotation", | |
"group_id": "action", | |
"keywords": ["action, 3d, rotation"], | |
"ligature": "3d_rotation", |