Posts

Showing posts from 2015

Getting the best display on a monitor

As a note, I found out recently that if your video card does not have HDMI, do not use a DVI-D to HDMI cable if the monitor has HDMI - test will not be clear. Use DVI-D cable only. DVI-D cannot be converted to HDMI on a cable without an expensive $80 active cable. If you connect a mac mini to a monitor using a HDMI to DVI adapter, text will be blurry - use direct HDMI - it gets better. I have ordered a thunderbolt to HDMI cable and I think that will be better as it is a dual link digital signal from the display port.

AutoResetEvent and ManualResetEvent in C#

The section on this topic within the below MSDN article is excellent: https://msdn.microsoft.com/en-us/library/ms173179.aspx " Using a lock or monitor is useful for preventing the simultaneous execution of thread-sensitive blocks of code, but these constructs do not allow one thread to communicate an event to another .  This requires   synchronization events , which are objects that have one of two states, signaled and un-signaled , that can be used to activate and suspend threads .  Threads can be suspended by being made to wait on a synchronization event that is unsignaled , and can be activated by changing the event state to signaled .  If a thread attempts to wait on an event that is already signaled, then the thread continues to execute without delay. There are two kinds of synchronization events:  AutoResetEvent , and  ManualResetEvent . They differ only in that  AutoResetEvent  changes from signaled to unsignaled automatically any time it activates a thread. C

Late 2008 Macbook only giving 1.5 gb/s speed with 6 gb/s Intel SSD?

You may find it online that this is due to the nvidia chipset used in the macbook. There is apparently a bug which causes all Intel SSDs to run at 1.5 gb/s with this chipset. What is interesting is that I have an old HP ML115 server in the basement which was also showing the speed of the Intel SSD as 1.5 gb/s whereas another SSD from PNY was able to do 3 gb/s which is what the motherboard actually supports. Guess what? That server motherboard also uses an nvidia chipset. I spent the whole day tinkering with the server trying to figure out why my expensive Intel SSD is giving me 1.5 gb/s while the cheap PNY was giving me 3 gb/s. No matter what I did, it did not work - including connecting the Intel SSD to a RAID controller card and using it without RAID. Some people have given the workaround to connect the hard drive to the CD drive connector which uses the Intel chip and not nvidia one. What I did is to put the PNY SSD from my server in the macbook. It consistently gave 3 gb/s

Unable to start Azure Storage Emulator after installing Azure SDK 2.7 or 2.7.1?

Firstly use SQL Server to store it. Without this, it will keep breaking all the time. C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>AzureStorageEmulator init /server .\\ Windows Azure Storage Emulator 4.2.0.0 command line tool The storage emulator was successfully initialized and is ready to use. C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>AzureStorageEmulator.exe init /inprocess /forcecreate Windows Azure Storage Emulator 4.2.0.0 command line tool Added reservation for http://127.0.0.1:10000/ in user account SERVER\Administrator. Added reservation for http://127.0.0.1:10001/ in user account SERVER\Administrator. Added reservation for http://127.0.0.1:10002/ in user account SERVER\Administrator. Empty SQL Instance. Autodetecting SQL Instance to use. Looking for a LocalDB Installation. Found a LocalDB Installation. Probing SQL Instance: '(localdb)\MSSQLLocalDB'. Found SQL Instance (localdb)\MSSQLLocalDB. Creating database AzureStorageEmu

Using SQL Server for the Storage Emulator database

Without doing this, you may corrupt the storage database causing untold grief and pain. Open the Microsoft Azure Storage tools console and do the following: Microsoft Azure Storage tools Type azcopy /? for help on AzCopy. C:\Program Files (x86)\Microsoft SDKs\Azure>azurestorageemulator init /server .\ \ 'azurestorageemulator' is not recognized as an internal or external command, operable program or batch file. C:\Program Files (x86)\Microsoft SDKs\Azure>cd storageemulator The system cannot find the path specified. C:\Program Files (x86)\Microsoft SDKs\Azure>cd storage The system cannot find the path specified. C:\Program Files (x86)\Microsoft SDKs\Azure>cd storage emulator C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>azurestorageemulator init /server .\\ Windows Azure Storage Emulator 4.1.0.0 command line tool The storage emulator was successfully initialized and is ready to use. C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>

Getting the difficult stuff done using Typemock and xunit 2.0

I like Typemock - we should never have to change code to make it testable. Mocking To mock all static methods of a type Isolate.Fake.StaticMethods(typeof(ClassName)); You will have problems sometimes especially if any class has a static constructor. Took me hours to figure out this below is a good idea before making the above call: Isolate.Fake.StaticConstructor(typeof( ClassName )); Isolate.Invoke.StaticConstructor(typeof( ClassName )); >> Do not invoke this if you are going to swap instances which will internally attempt to call this. Isolate.Fake.StaticMethods(typeof(ClassName)); Calling original static method if above is done Isolate.WhenCalled(() =>  ClassName .MethodName()).CallOriginal(); Mock the next instance of a certain type used within a method var mockInstance = Isolate.Swap.NextInstance<ClassName>().WithRecursiveFake(); Isolate.WhenCalled(() =>  mockInstance .MethodName(null)).IgnoreCall(); Changing Behavior Mock public static property

Sharepoint not working after OS upgrade to Win 2012 R2?

I used the below article: http://blogs.msdn.com/b/sambetts/archive/2014/03/17/upgrading-an-existing-sharepoint-2013-farm-to-windows-server-2012-r2.aspx That pointed to this one, which fixed the issue: http://blogs.msdn.com/b/sambetts/archive/2014/03/17/sharepoint-health-report-error-the-security-token-service-is-not-available.aspx Just open a regular command prompt, go to the folder and then run the command. Reboot server - all set!

When two namespaces are the same in different dlls

Where you reference the dll, in the Aliases property give an alias using the syntax: global, myalias. Here "myalias" is your alias. In the first line of your C# file, specify: extern alias myalias; Then reference the namespace as: using myalias.yournamespace;

VS 2015 Profiler may show different results with report generated from VS 2013

I just noticed that if I generate a profiler report using VS 2013, but open it in VS 2015, the report shows different results. Do not open the report in a different version of visual studio!

Unable to open huge profiler files in Visual Studio? (10GB 20GB)

Visual Studio would crash and burn on every system I tried. Finally got it working on a Windows 2012 R2 server with 98GB RAM. Still hangs, but can go through the different views. Found out the real reason - when it is opening the file, it is taking up disk space in the temp folder. If you do not have huge disk space then it runs out of space and dies. Observe the drive with temp folder having less and less space when the file is being opened. Also, you cannot predict how much it will consume. For a 10GB memory profile 50-60GB space was enough. For a 5GB sampling report, it is consuming more than 100GB.

Optimizing Windows Applications for Networking

This excel sheet is invaluable and shows all the settings I know of at every level (including the OS) to maximize the performance and scalability of network communications for any application running on windows. You will not be able to find all these settings in one place anywhere else. https://app.box.com/s/2rmmt0y09ybuu4747cpcae0adf7zfwkd

How to analyze a hang on a managed thread using windbg

The location of the crash dump file is: %LOCALAPPDATA%\Microsoft\Windows\WER - This is quite difficult to find online First download windbg using the latest windows SDK and select just the windows debugging components. Remember to use the right windbg for your process. If the process is x86, you need to use x86 windbg. This causes an error: “ Failed to load data access DLL, 0x80004005 ” Use this link to learn how to setup the environment properly : http://blogs.msdn.com/b/friis/archive/2010/09/02/managed-debugging-with-windbg-and-psscor2.aspx It mentions how to load the Psscor2 dll - Just note to copy the right dll (x86/ x64) after downloading it into the correct windbg.exe folder (x86/ x64). That is not mentioned clearly. http://www.microsoft.com/en-us/download/details.aspx?id=1073 Also, after setting the symbol path, please do .reload to reload the environment. srv*C:\Symbols\symserv*  http://msdl.microsoft.com/download/symbols .cordll -u -l  .loadby sos mscor

Good explanation on thread safety of static methods.

http://stackoverflow.com/questions/17242732/c-sharp-are-parameters-thread-safe-in-a-static-method It is described very well in the answer.

Weird null reference error on role start after upgrade to Azure SDK 2.5

It was weird, got fixed after I commented the below code: //DiagnosticMonitorConfiguration config = DiagnosticMonitor.GetDefaultInitialConfiguration(); //config.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(5); //config.Logs.ScheduledTransferLogLevelFilter = Microsoft.WindowsAzure.Diagnostics.LogLevel.Warning; //DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", config);

Hyper-V VM backup fails with VSS Error in Windows 2012 R2 Server

It would keep erroring out with some flush error saying that disk activity is too high and operation timed out. To fix this, set the registry settings as mentioned in the below article: https://social.technet.microsoft.com/Forums/windowsserver/en-US/e00123c7-44a3-4f53-a726-8abca7e4542b/vss-error-server-2012-datacenter-application-12289-12297-12340-8194-system-9?forum=windowsbackup At the registery (Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSer\Services\VSS\VssAccessControl there a 2 values like this: 1. REG_DWORD --> DOMAIN\USERFULLPERMISSIONS --> set to 3 (0x0000003) 2. REG_DWORD --> NT Authority\NetworkService --> set to 3 (0x0000003)