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
| // Inspired by CppCon 2015: Eric Niebler "Ranges for the Standard Library", https://www.youtube.com/watch?v=mFUXNMfaciE&ab_channel=CppCon | |
| using System.Globalization; | |
| public static class Program | |
| { | |
| static IEnumerable<IEnumerable<T>> Transpose<T>(this IEnumerable<IEnumerable<T>> source) | |
| => source | |
| .SelectMany(inner => inner.Select((item, index) => new { item, index })) | |
| .GroupBy(i => i.index, i => i.item) |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <opml version="2.0"> | |
| <head> | |
| <title>Feeds</title> | |
| </head> | |
| <body> | |
| <outline title=".NET" text=".NET"> | |
| <outline xmlUrl="https://devblogs.microsoft.com/dotnet/feed/" text=".NET Blog" | |
| type="rss" htmlUrl="https://devblogs.microsoft.com/dotnet/" title=".NET Blog" /> | |
| <outline htmlUrl="https://devblogs.microsoft.com/dotnet-ch/" |
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
| class ComingEvent { | |
| constructor(name, description, countDownTime, happenTime) { | |
| this.name = name; | |
| this.description = description || '✏️'; | |
| this.countDownTime = countDownTime; | |
| this.happenTime = happenTime; | |
| } | |
| get percentage() { | |
| var total = this.happenTime - this.countDownTime; |
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
| param ( | |
| [string]$vmName, | |
| [string]$vmSize, | |
| [string]$ubuntuOSVersion, | |
| [string]$location | |
| ) | |
| $resourceGroupName = $vmName | |
| New-AzResourceGroup -Name $resourceGroupName -Location $location |
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
| import taichi as ti | |
| from taichi.math import * | |
| import time | |
| import numpy as np | |
| @ti.func | |
| def _Gradient3D(h): | |
| h = h & 15 | |
| d = GradientNoise.v3f(0, 0, 0) |
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
| import taichi as ti | |
| from taichi.math import * | |
| import numpy as np | |
| from pyquaternion import Quaternion | |
| import math | |
| import random | |
| # --------------------------------------------------------------------- | |
| Vec2i = ti.types.vector(2, ti.i32) |
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
| # according to http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/ | |
| # generate gaussian blur kernel sample uvs and weights | |
| DropWeightThreshold = 13.1 / 4096 | |
| def NextLevel(lastLevel): | |
| thisLevel = [lastLevel[i] + lastLevel[i + 1] for i in range(len(lastLevel) - 1)] | |
| thisLevel.insert(0, 1) | |
| thisLevel.append(1) | |
| return thisLevel |