Tag: debug

  • Unescape String in Watch Window – Visual Studio

    Hey everyone, Just a quick post on how to remove the escape characters from a string in the watch window. All you’ve got to do is append “,nq” (short for no quotes) to the watch variable name. MyLongString becomes MyLongString,nq This removes all of the quotes and line breaks. Pretty handy for when you’ve got…

  • View Generated SQL in Entity Framework (EF)

    Hey everyone, Just a quick post on how to view the generated sql in entity framework. To start with, just add the following line to your db context constructor: public class TestDbContext : DbContext { public TestDbContext() : base(“name=TestDbContext”) { this.Database.Log = s => System.Diagnostics.Debug.WriteLine(s); //This line } … With this line added, you should…

  • How to Get a JavaScript Stack Trace – Chrome Console

    Hey everyone, Just a quick post on something useful I came across today. In JavaScript you can access the stack trace via console using the following command (ctrl + shift + j): console.trace() In Chrome, this will let you navigate to each relevant call by clicking the line number in the console window. I’ve found…

  • Debugging with Exceptions – Ruby on Rails

    Ran into a bit of trouble with a model today, after a bit of a google I came across this technique which helped me solve it: #Raise exception on object.inspect raise Object.inspect #Example 1 raise order.inspect #Example 2 raise [sub_orders.count].inspect This simply allows you display variable values as an exception. By placing a few of…

Create a website or blog at WordPress.com