Tuesday, June 25, 2024

My favorite font for coding, Cascadia Code PL

 

Cascadia Code PL: a version of Cascadia that has embedded Powerline symbols. Really like the way >= and =< are displayed.

Installation Via Chocolatey (unofficial, by zunderscore)

Chocolatey users can download and install the latest release of Cascadia Code or any of its variants via the following packages:

choco install cascadiacode
choco install cascadiamono
choco install cascadiacodepl
choco install cascadiamonopl

Installing Cascadia Code in VS Code

  1. Go to File > Preferences > Settings or hit Ctrl + , in VS Code.
  2. Enter "Font Face" in search field.
  3. Enter following in Font Face option: 'Cascadia Code', Consolas, 'Courier New', monospace.
  4. Enable Font Ligatures option available just below 'Font Face'.
  5. Press Enter and you're good to go.
  6. To customize weight, enter "Font Weight" in search field.
  7. Select, or type in, the desired font weight (the latest version of VS Code allows manual entry of any font weight).

Note: If you've installed font and it does not get applied in VS Code, try restarting VS Code.

VS Code Settings

Setting Cascadia Code in Visual Studio 2019

  1. Go to Tools > Options in Visual Studio 2019.
  2. Enter "Fonts and Colors" in search field or go to Environment > Fonts and Colors.
  3. Select Text Editor in Show settings for:.
  4. In the Fonts Dropdown select Cascadia Code.
  5. Press Ok and you're good to go.

Note: If you've installed the font and it does not get applied in Visual Studio 2019, try restarting Visual Studio 2019.

Visual Studio 2019 Settings

Links: https://github.com/microsoft/cascadia-code, https://github.com/microsoft/cascadia-code/wiki/Installing-Cascadia-Code#installing-cascadia-code-in-vs-code

Friday, July 15, 2016

Android: "Screen Overlay Detetect"

I got this error when trying to allow apps storage rights: "Screen Overlay Detetect". Solution was to remove the night clock display on the side panel.
Samsung Galaxy S7 Edge.

Tuesday, July 12, 2016

System.IO.FileLoadException : Could not load file or assembly 'Moq, Version=4.5.10.0, Culture=neutral, PublicKeyToken=69f491c39445e920' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Solution found here: http://blog.myget.org/post/2014/11/27/Could-not-load-file-or-assembly-NuGet-Assembly-Redirects.aspx



  1. From any .config file, remove the  element and its child elements. In other words: strip your app from assembly binding redirects.
  2. Open the Package Manager Console in Visual Studio. This can be done from the View | Other Windows | Package Manager Console menu.
  3. Type this one, magical command that solves it all: Get-Project -All | Add-BindingRedirect. I repeat: Get-Project -All | Add-BindingRedirect

Monday, January 11, 2016

Error comparing historic versions of a TFS source controlled file

Recently I've been running into this problem all the time. Comparing two files inside Visual Studio only gives me this warning: "Error comparing historic versions of a TFS source controlled file".

Solution is really simple (found it here):

Close Visual Studio
Navigate to your version of the ‘c:\users\{username}\AppData\Local\Temp\’ folder
Delete the TFSTemp folder
Restart Visual Studio and try again.

Friday, May 31, 2013

RSACryptoServiceProvider.VerifyHash() throws exception “Object identifier (OID) is unknown”

 

The problem occurs when calling RSACryptoServiceProvider.VerifyHash() in .Net 3.5.1. Only on some servers. Ok on windows 7 and most windows 2008 servers. But fails on 2003, where there is a hotfix that works (http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=968730&kbln=en-us), but the problem also occurs on some 2008 Servers (Standard and Enterprise R2) with .Net 3.5.1 installed.

The exception we get is "Object identifier (OID) is unknown" when calling the VerifyHash() with the second parameter containing "SHA256".
rsa.VerifyHash(computedCheckSum, "SHA256", documentSeal)

This function call fails in some .net20 enviroments (2003 and some 2008 servers), but works in all .net40 envirmont:
if (!rsa.VerifyHash(computedCheckSum, "SHA256", documentSeal)){}

This one works in both .net2 and .net4:
if (!rsa.VerifyHash(computedCheckSum, CryptoConfig.MapNameToOID("SHA256"), documentSeal)){}

Monday, October 29, 2012

Outlook 2013 Calendar Weather in Celsius

The new calendar has weather info. To show in Celsius instead of Fahrenheit go to the setting in the option tab.

image

Now the weather info is in Celsius. The weather is still bad though.

image

Friday, October 12, 2012

VS2012 Code Clones

The new Visual Studio 2012 has an very useful refactoring tool, the Analyze Solution for Code Clones.

image

The current project I’m working on has a lot of code duplicates. Not exactly following the DRY principle. But I must say the Code Clones found even more than I anticipated. It is large solution so it took some time to run.

image

The final report was excellent for refactoring functions and methods into one single implementation.

image

Code Clones finds code duplicates as exact, strong, medium and weak match. All the strong matches in my solution were obvious candidates for refactoring into a single and DRY implementation. It found both duplicates of actual functions, but even more impressing it found code snippets in remote places that were strong matches.

image

Happy refactoring!!!