alias dni='curl https://dotnet.microsoft.com/download/dotnet-core/scripts/v1/dotnet-install.sh -o ~/.dotnet/dotnet-install.sh -s | chmod +x ~/.dotnet/dotnet-install.sh | ~/.dotnet/dotnet-install.sh'
dni --help
type System.Int32 with | |
member x.DisplayWithSuffix() = | |
let f = x.ToString() | |
let defaultVal = f + "th" | |
let mutable result = "" | |
result <- if f.EndsWith("11") then f + "th" else defaultVal | |
result <- if f.EndsWith("12") then f + "th" else defaultVal | |
result <- if f.EndsWith("13") then f + "th" else defaultVal | |
result <- if f.EndsWith("1") then f + "st" else defaultVal |
alias dni='curl https://dotnet.microsoft.com/download/dotnet-core/scripts/v1/dotnet-install.sh -o ~/.dotnet/dotnet-install.sh -s | chmod +x ~/.dotnet/dotnet-install.sh | ~/.dotnet/dotnet-install.sh'
dni --help
for (int i = 0; i < 100; i++) | |
{ | |
ManualResetEvent allGo = new ManualResetEvent(false); | |
var model = new MyClass(); | |
object starter = new object(); | |
int waiting = 20; | |
int failures = 0; | |
Exception firstException = null; | |
Thread[] threads = new Thread[20]; | |
for (int j = 0; j < 10; j++) |
type LogLevel = | |
| Error | |
| Warning | |
| Info | |
let log (level:LogLevel) message = // LogLevel -> string -> unit | |
printfn "[%A]: %s" level message | |
() | |
log Error "Curried function" |
-- Message #0 | |
----------------------------------------------------------------- | |
ETW collector internal error | |
ETW Collector error | |
[location] = c:\build agent\work\9f8acdb7e480c131\profiler\kernel\windows\native\solution\core\src\bridges\etw\etw_bridge.cpp(101) | |
[function] = enum jb::profiler::etw_bridge::loop_executor::state __cdecl jb::profiler::etw_bridge::poll_etw_state(void) | |
[hresult] = adab0000 | |
----------------------------------------------------------------- |
<Window x:Class="LanguageCategoryPhrase.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:igDP="http://infragistics.com/DataPresenter" xmlns:igWindows="http://infragistics.com/Windows" | |
Title="MainWindow" Height="350" Width="525"> | |
<Grid> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition Width="30*"/> | |
<ColumnDefinition Width="70*"/> | |
</Grid.ColumnDefinitions> |
public static class Extensions | |
{ | |
public static dynamic ToDynamic(this object value) | |
{ | |
if (value.IsListOrArray ()) { | |
var list = new List<ExpandoObject> (); | |
IEnumerable enumerable = value as IEnumerable; | |
foreach (object o in enumerable) { | |
list.Add (o.ToDynamic ()); |
public class CustomBootstrapper : DefaultNancyBootstrapper | |
{ | |
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines) | |
{ | |
pipelines.OnError += (ctx, exception) => | |
{ | |
ctx.Items.Add("OnErrorException", exception); | |
return null; | |
}; | |
} |
Configuration Result: | |
[Success] Name MyApp | |
[Success] Description MyApp FrontEnd | |
[Success] ServiceName MyApp | |
Topshelf v3.2.150.0, .NET Framework v4.0.30319.19448 | |
Connected to Proxy | |
The MyApp service is now running, press Control+C to exit. | |
Running a http server on https://10.240.205.4:443 | |
Topshelf.Hosts.ConsoleRunHost Critical: 0 : The service threw an unhandled exception, System.NullReferenceException: Object reference not set to an instance of an object. | |
at System.Net.HttpListener.EndGetContext(IAsyncResult asyncResult) |
public static class HttpClientExtensions | |
{ | |
public static T Get<T>(this HttpClient client, string url) | |
{ | |
var response = client.GetAsync(url).Result; | |
var content = response.Content.ReadAsStringAsync().Result; | |
return JsonConvert.DeserializeObject<T>(content); | |
} | |
public static HttpResponseMessage PostAsJson(this HttpClient client, string url) |