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
// Slice the string along the boundaries of text elements so that the size of each | |
// substring does not exceed chunk_size_max_chars characters (char). | |
[MethodImpl(MethodImplOptions.AggressiveInlining)] | |
static IEnumerable<string> StringToTextElements(string source, int chunk_size_max_chars) | |
{ | |
int chunk_start_index = 0; // first character index of chunk | |
int chunk_end_index = 0; // latest character index of chunk | |
int chunk_max_index = chunk_size_max_chars; // max index of next chunk | |
var enumerator = StringInfo.GetTextElementEnumerator(source); |
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.Linq; | |
using System.Diagnostics; | |
using System.Reactive.Linq; | |
using System.Reactive.Threading.Tasks; | |
namespace PerfCountersAlert | |
{ | |
class Program | |
{ |
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
static long Fib(int n) | |
{ | |
return | |
Enumerable.Repeat(0, Math.Abs(n)) | |
.Aggregate( | |
Tuple.Create(0L, 1L), | |
(tuple, _) => Tuple.Create(tuple.Item2, tuple.Item1 + tuple.Item2), | |
tuple => tuple.Item1 | |
) * ((n > 0) ? 1 : ((n % 2) != 0) ? 1 : -1); | |
} |
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.Linq; | |
using System.Collections.Generic; | |
class Program | |
{ | |
private static IEnumerable<String> Generate(uint len) { | |
return GenerateImpl("", 0, 0, len); | |
} | |
private static IEnumerable<String> GenerateImpl(String head, int opn, int cls, uint len) |
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
[{"id":"8e490455.b9fa28","type":"subflow","name":"Velocity","info":"","category":"","in":[{"x":40.00005912780762,"y":127.00003242492676,"wires":[{"id":"e2fd1aa.88edfe8"}]}],"out":[{"x":1584.0000534057617,"y":122.00000381469727,"wires":[{"id":"3982accc.82d4b4","port":0}]},{"x":1585.000114440918,"y":408.0000190734863,"wires":[{"id":"f37a6c49.82af6","port":0}]},{"x":1580,"y":660,"wires":[{"id":"c57ef11f.dd02f","port":0}]},{"x":1580,"y":780,"wires":[{"id":"6ed28f42.c1c75","port":0}]}],"env":[{"name":"stop_factor","type":"num","value":"25"},{"name":"pulse_weight","type":"num","value":"0.01"},{"name":"Q_min","type":"num","value":"0.06"},{"name":"Q_max","type":"num","value":"10"},{"name":"digits","type":"num","value":"8"},{"name":"init","type":"num","value":"10690.420"},{"name":"unit","type":"str","value":"m³"},{"name":"update_rate","type":"num","value":"60"}],"color":"#A6BBCF","inputLabels":["increment message"],"outputLabels":["total value","velocity","cycle counter","consumed per cycle"],"icon":"node-red/function |
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
<div> | |
<svg id="svgRoot" | |
xmlns="http://www.w3.org/2000/svg" version="1.1" | |
width="100%" height="100%" | |
viewBox="0 0 300 300"> | |
<symbol id='symbol'> | |
<image width="100" height="100" | |
xlink:href="http://upload.wikimedia.org/wikipedia/commons/c/cb/Footnote.svg"/> | |
</symbol> |
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
<div>Drag me</div> |