Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Krüger mkrueger

View GitHub Profile
View gist:2ee68c9428925ad34f92ba324e1a0d9b
//
// StatusView.cs
//
// Author:
// Mike Krüger <mikkrg@microsoft.com>
//
// Copyright (c) 2020 Microsoft Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
View foo.cs
//
// CollectionCache.cs
//
// Author:
// Mike Krüger <mikkrg@microsoft.com>
//
// Copyright (c) 2019 Microsoft Corporation. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
View a.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace NetCoreConsoleAp
{
class Program
{
static void Main(string[] args)
View gist:b6571f2bd66decc83da4cfa309670358
"GUI Thread" at MonoDevelop.Ide.Editor.Highlighting.RegexEngine.RegexInterpreter.Advance (int) [0x00025] in /Users/mkrueger/work/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/RegexInterpreter.cs:56
at MonoDevelop.Ide.Editor.Highlighting.RegexEngine.RegexInterpreter.Go () [0x00329] in /Users/mkrueger/work/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/RegexInterpreter.cs:482
at MonoDevelop.Ide.Editor.Highlighting.RegexEngine.RegexRunner.Scan (MonoDevelop.Ide.Editor.Highlighting.RegexEngine.Regex,string,int,int,int,int,bool,System.TimeSpan) [0x00114] in /Users/mkrueger/work/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/RegexRunner.cs:184
at MonoDevelop.Ide.Editor.Highlighting.RegexEngine.Regex.Run (bool,int,string,int,int,int,System.TimeSpan) [0x000a1] in /Users/mkrueger/work/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/Regex.cs:12
View gist:7b2107a7455839d05925293d196a705f
"GUI Thread" at MonoDevelop.Ide.Editor.Highlighting.RegexEngine.RegexInterpreter.Advance (int) [0x00025] in /Users/mkrueger/work/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/RegexInterpreter.cs:56
at MonoDevelop.Ide.Editor.Highlighting.RegexEngine.RegexInterpreter.Go () [0x00329] in /Users/mkrueger/work/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/RegexInterpreter.cs:482
at MonoDevelop.Ide.Editor.Highlighting.RegexEngine.RegexRunner.Scan (MonoDevelop.Ide.Editor.Highlighting.RegexEngine.Regex,string,int,int,int,int,bool,System.TimeSpan) [0x00114] in /Users/mkrueger/work/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/RegexRunner.cs:184
at MonoDevelop.Ide.Editor.Highlighting.RegexEngine.Regex.Run (bool,int,string,int,int,int,System.TimeSpan) [0x000a1] in /Users/mkrueger/work/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/RegexEngine/Regex.cs:12
View a.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
index e4dda73ec2..020899f643 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
@@ -186,7 +186,19 @@ namespace MonoDevelop.CodeActions
{
Runtime.AssertMainThread ();
var caretOffset = Editor.CaretOffset;
- return collections.Select (c => FilterOnUIThread (c, workspace)).Where(x => x != null).OrderBy(x => GetDistance (x, caretOffset)).ToImmutableArray ();
+ var builder = ImmutableArray.CreateBuilder<CodeFixCollection> (collections.Length);
View gist:363d60571f78ecc606fdcd11d33cb805
"<unnamed thread>" at <unknown> <0xffffffff>
at (wrapper managed-to-native) object.__icall_wrapper_mono_threads_state_poll () [0x00006] in <69e8aa7a1d73495d92adb99b890f03fc>:0
at System.DateTime.get_Year () <0x0001b>
at System.TimeZoneInfo.IsInDST (System.TimeZoneInfo/AdjustmentRule,System.DateTime) [0x00013] in /home/mkrueger/work/install/mono/mcs/class/corlib/System/TimeZoneInfo.cs:911
at System.TimeZoneInfo.GetUtcOffsetHelper (System.DateTime,System.TimeZoneInfo,bool&) [0x0004a] in /home/mkrueger/work/install/mono/mcs/class/corlib/System/TimeZoneInfo.cs:815
at System.TimeZoneInfo.GetUtcOffset (System.DateTime,bool&) [0x00052] in /home/mkrueger/work/install/mono/mcs/class/corlib/System/TimeZoneInfo.cs:795
at System.TimeZoneInfo.GetUtcOffset (System.DateTime) [0x00000] in /home/mkrueger/work/install/mono/mcs/class/corlib/System/TimeZoneInfo.cs:763
at System.TimeZoneInfo.ConvertTimeFromUtc (System.DateTime) [0x00025] in /home/mkrueger/work/install/mono/mcs/class/corlib/System/TimeZoneInfo.cs:4
View gist:6f2f528c82f0a27e50ef
ERROR [2015-07-28 09:49:14Z]: Could not get diff for file '/home/mkrueger/work/RefactoringEssentials/RefactoringEssentials/CSharp/Diagnostics/Synced/PracticesAndImprovements/FieldCanBeMadeReadOnlyAnalyzer.cs'
LibGit2Sharp.LibGit2SharpException: Ungültiges Sortierzeichen
at LibGit2Sharp.Core.Ensure.HandleError (Int32 result) [0x00082] in /home/mkrueger/work/monodevelop/main/external/libgit2sharp/LibGit2Sharp/Core/Ensure.cs:128
at LibGit2Sharp.Core.Ensure.ZeroResult (Int32 result) [0x0000e] in /home/mkrueger/work/monodevelop/main/external/libgit2sharp/LibGit2Sharp/Core/Ensure.cs:146
at LibGit2Sharp.Core.Proxy.git_patch_from_diff (LibGit2Sharp.Core.Handles.DiffSafeHandle diff, Int32 idx) [0x00012] in /home/mkrueger/work/monodevelop/main/external/libgit2sharp/LibGit2Sharp/Core/Proxy.cs:1495
at LibGit2Sharp.Patch..ctor (LibGit2Sharp.Core.Handles.DiffSafeHandle diff) [0x0002e] in /home/mkrueger/work/monodevelop/main/external/libgit2sharp/LibGit2Sharp/Patch.cs:38
at LibGit2Sharp.Diff.<ChangesBuilders>m
View gist:d73bde4a23cb385c9b5c
public class binarytrees {
public static void main(String[] args) throws Exception {
int n = args.length > 0 ? Integer.parseInt(args[0]) : 0;
int minDepth = 4;
int maxDepth = Math.max(minDepth + 2, n);
int stretchDepth = maxDepth + 1;
int check = (TreeNode.create(0, stretchDepth)).check();
System.out.println("stretch tree of depth " + (maxDepth + 1) + "\t check: " + check);
View gist:3e375120014088d6a78d
/**
* The Computer Language Benchmarks Game
* http://benchmarksgame.alioth.debian.org/
*
* Loosely based on Jarkko Miettinen's implementation. Requires Java 8.
*
* contributed by Heikki Salokanto.
* modified by Chandra Sekar
* modified by Mike Krüger