Skip to content

Instantly share code, notes, and snippets.

View OmerRaviv's full-sized avatar

Omer Raviv OmerRaviv

View GitHub Profile
@OmerRaviv
OmerRaviv / set-up-wsl-environment-for-dd-trace-dotnet.sh
Created March 2, 2022 11:23
Creates a WSL Ubuntu environment in which we can build, test, and debug code in dd-trace-dotnet
apt-get update && apt-get -y upgrade \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --fix-missing \
git \
procps \
wget \
curl \
cmake \
make \
llvm \
clang \
<entry>
<record>580</record>
<time>2016/10/19 16:44:39.176</time>
<type>Error</type>
<source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>
<description>A MEF Component threw an exception at runtime: Microsoft.VisualStudio.ExtensibilityHosting.InvalidMEFCacheException: The Visual Studio component cache is out of date. Please restart Visual Studio.&#x000D;&#x000A; at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.&lt;LoadAssembly&gt;b__13_0(AssemblyName assemblyNameParam)&#x000D;&#x000A; at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.SafeGetOrAdd[TKey,TValue](IDictionary`2 dictionary, TKey key, Func`2 valueFactory)&#x000D;&#x000A; at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.LoadAssembly(AssemblyName assemblyName)&#x000D;&#x000A; at Microsoft.VisualStudio.Composition.Reflection.ResolverExtensions.GetManifest(Resolver resolver, AssemblyName assemblyName)&#x000D
@OmerRaviv
OmerRaviv / gist:90f78502ab32a907524d
Created November 9, 2015 17:05
Visual Studio hangs with this on the UI thread
[Managed to Native Transition]
> WindowsBase.dll!System.Windows.Threading.DispatcherSynchronizationContext.Wait(System.IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) Unknown
mscorlib.dll!System.Threading.SynchronizationContext.InvokeWaitMethodHelper(System.Threading.SynchronizationContext syncContext, System.IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) Unknown
[Native to Managed Transition]
[Managed to Native Transition]
mscorlib.dll!System.Threading.WaitHandle.WaitAny(System.Threading.WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) Unknown
Microsoft.Build.dll!Microsoft.Build.BackEnd.RequestBuilder.WaitWithBuilderThreadStart(System.Threading.WaitHandle[] handles, bool recursive, Microsoft.Build.Execution.LegacyThreadingData threadingData, int submissionId) Unknown
Microsoft.Build.dll!Microsoft.Build.BackEnd.RequestBuilder.StartNewBuildRequests(Microsoft.Build.BackEnd.FullyQualifiedBuildRequest[] requests) Unknown
mscorlib.dll!System.Runtime
[Obsolete("Not supported on VS2015, Use INavigationEngine implementation instead")]
internal static class LegacyGoToDefinitionEngine
{
/// <summary>
/// If Visual Studio's recognizes the given member and knows where its source code is, goes to the source code.
/// Otherwise, opens the "Find Symbols" ToolWindow.
/// </summary>
public static void GoToMemberDefinition(string memberName, uint sreachOptions = (uint)_VSOBSEARCHOPTIONS.VSOBSO_LOOKINREFS)
{
/// <summary>
/// Stops keystrokes on a WPF Window or Adornment from propagating to the Visual Studio code editor.
///
/// "The reason that keys like Backspace and Delete do not work in your WPF windows/Adornments is due to Visual Studio's usage of IOleComponentManager and IOleComponent.
/// Visual Studio and WinForms both use IOleComponent as a way of tracking the active component in the application.
///
/// WPF does not implement IOleComponent or use the IOleComponentManager for its windows. This means that when your WPF window is active, Visual Studio doesn't know that its
/// primary component should not be processing command keybindings. Since "Backspace", "Delete", and several other keys are bound to commands for the text editor,
/// Visual Studio continues processing those keystrokes as command bindings."
///
-----
MainWindow.xaml.cs:
-----
class Person
{
public int Age { get; set; }
}
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
<Setter Property="StrokeDashArray" TargetName="MyRectangleWhichCouldBeACircleInYourCase" Value="{Binding ElementName=This,Path=AnimatedStrokeArray}" />
MyUserControl{
InitializeComponent();
Loaded += delegate { StartAnimating(); };
}
public double StrokeValue
{
get { return (double)GetValue(StrokeValueProperty); }
set { SetValue(StrokeValueProperty, value); }
@OmerRaviv
OmerRaviv / gist:8c624eb653d3b9e9f434
Created July 22, 2014 16:35
Callstack of hang when trying to use BDDfy in VS Integration Test
mscorlib.dll!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle waitableSafeHandle, long millisecondsTimeout, bool hasThreadAffinity, bool exitContext) Unknown
mscorlib.dll!System.Threading.WaitHandle.WaitOne(int millisecondsTimeout, bool exitContext) Unknown
mscorlib.dll!System.Threading.WaitHandle.WaitOne() Unknown
TestStack.BDDfy.dll!TestStack.BDDfy.Scanners.StepScanners.StepActionFactory.Run(System.Func<object> func) Unknown
TestStack.BDDfy.dll!TestStack.BDDfy.Scanners.StepScanners.StepActionFactory.GetStepAction<BDDFYPackage_IntegrationTests.DebuggingTests>.AnonymousMethod__6(object o) Unknown
TestStack.BDDfy.dll!TestStack.BDDfy.Core.ExecutionStep.Execute(object testObject) Unknown
TestStack.BDDfy.dll!TestStack.BDDfy.Core.Scenario.ExecuteStep(TestStack.BDDfy.Core.ExecutionStep executionStep = {TestStack.BDDfy.Core.ExecutionStep}) Unknown
TestStack.BDDfy.dll!TestStack.BDDfy.Processors.TestRunner.Process(TestStack.BDDfy.Core.Story story) Unknown
TestStac
@OmerRaviv
OmerRaviv / message_queue.hpp
Created July 24, 2012 16:35
boost::interprocess::message_queue, where the underlying implementation uses a circular buffer
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/interprocess for documentation.
//
//////////////////////////////////////////////////////////////////////////////