SHARE
TAKING TOO LONG?
CLICK/TAP HERE TO CLOSE LOADING SCREEN.
Getting coffee...
CLOSE SEARCH

Evernote saved my career

Well it saved it for now. I am not the sharpest tool in the shed, however, I am the most hard working tool in the shed. With that said, Evernote, is really a helpful tool. A little background first, at my job, I work with a lot of brilliant individuals, so brilliant, I think they forget they are talking Aramaic to me. When they try to explain things to me, at their intelligence level and experience, sometimes it feels like the 1 Ceres asteroid smashing into my weak feeble body. So much technical lingo, so many variables, scenarios, and systems that interact with one another. In my line of business, I am fairly new to it. I work with remote monitoring, dealing with remote devices receiving and sending packets of data to and from satellites. All this is new to me. Very interesting stuff, yet hard to comprehend. For the past few months, I have been using Evernote to help close my understanding gap. Normally, when things are trying to be explained to me, it takes me a bit of time to process it. I have to sit down, and really think about what is being said. But in this industry, there is no time. Having to deal with scrums on a consistent basis, explaining where we are, what road blocks we encountered (if any), and what we will be working on next, and trying to process what your colleagues are going through is just so much information for one to process.

My memory sucks, it really does. I barely can remember where I put my car keys, nevertheless how our systems interact. I am currently reading a book that I am hoping will help with my memory, “Moonwalking with Einstein: The Art and Science of Remembering Everything” by Joshua Foer. Till I find out new techniques to increase my ability to remember things, I have been using Evernote on my Windows Phone. The one feature I use religiously is the audio recording feature. Every meeting that I attend, I record it. Every bit of detail of that discussion is archived for my use. Typically after meetings, I sit down and listen to what was discussed. This helps further to my comprehension of the topic our meeting was about. As well, it removes all doubt I would have if I didn’t do so. “Now what satellite were we supposed to receive packets from again?…”, “Was that a GSM unit or a Satellite unit?…”. That doubt and confusion is now removed from my mind. Just this past weekend, I was processing some meetings we had about this newer project I am supposed to work on. Man o’ man, what a relief to have this information by my side. Come Monday, I knew the right questions to ask, and my path to the project was made clearer. I highly recommend you use Evernote, or some form of data capture app. It will help you rest easier at night and have concrete info for what is to come with  your current task.

Evernote for Windows Phone: https://evernote.com/evernote/guide/windows_phone/

 




The blockbuster phenomenon that charts an amazing journey of the mind while revolutionizing our concept of memory

An instant bestseller that is poised to become a classic, Moonwalking with Einstein recounts Joshua Foer's yearlong quest to improve his memory under the tutelage of top "mental athletes." He draws on cutting-edge research, a surprising cultural history of remembering, and venerable tricks of the mentalist's trade to transform our understanding of human memory. From the United States Memory Championship to deep within the author's own mind, this is an electrifying work of journalism that reminds us that, in every way that matters, we are the sum of our memories.


List Price: $17.00 USD
New From: $6.74 USD In Stock
Used from: $3.06 USD In Stock

David Rodriguez is a .Net, Silverlight, Windows Phone, Windows 8 developer. I created @gogetter for Windows Phone http://www.gogetterapp.com

about newsletter
Need Petrol for my Porsche.
Donate via Paypal

How to force ‘Get Latest Version (Recursive)’ in your Visual Studio solution

Quick tip here. I needed to get the latest version, but I needed it to overwrite everything I had in my local solution. The easiest way to go about this is to go to ‘Source Control Explorer’, find the folder that you want to force get, right click it and select Advanced->Get Specific Version…

Force Get Latest Version

Force Get Latest Version

Once you select that, a new dialog will show with the folder you selected. Below that, check both check-marks that are for ‘Overwrite writeable files that are not checked out’ and ‘Overwrite all files even if the local version matches the specified version’. Finally, click ‘Get’ and wahla you have gotten the latest files from your ‘Team Foundation Server.

Force Get Latest Version

Force Get Latest Version

David Rodriguez is a .Net, Silverlight, Windows Phone, Windows 8 developer. I created @gogetter for Windows Phone http://www.gogetterapp.com

about newsletter
Obama ain't the only one who wants change.
Donate via Paypal

Using Sql Server Profiler to trace only stored procedures you want, and nothing else

Seems like I am full of blog posts lately. Anyways, I came across this need yesterday when working on our project. I was needing to trace a particular stored procedure, and only this stored procedure with nothing else. Everything else to me was just noise. So, in order to do this fire up SQL Server Profiler, tab over to the ‘Event Selection’ tab for the ‘Trace Properties’, set ‘Security Audit’, ‘TSQL’ events to unchecked, and leave ‘Stored Procedures – RPC:Completed’ to checked.

Trace Properties

Trace Properties

Next thing you would want to do is to customize the column filters. So, click the ‘Column Filters’ button on the lower right side of the ‘Trace Properties’ window. Once the dialog pops up, this is where you can edit any filter you want. For my needs, I needed to adjust the ‘Application Name’, ‘LoginName’, and ‘TextData’ filters. By default, the ‘Application Name’ is set for you.

Filter Application Name

Filter Application Name

I like to filter to only my application’s username. Since, we have numerous apps running hitting the same database instance I have to filter by username. If not, I’d get even more noise when running the profiler. So, I filtered by ‘LoginName’ as so.

Filter Login Name

Filter Login Name

And lastly, the granddaddy of them all, we finally filter by the stored procedures name. In this case we use the ‘TextData’ filter. I use SQL like query using the percent % wild card notation. It works like normal T-SQL. I am filtering anything before and after my filter for a match. I ran a few queries to see if it match each time, and to no surprise it did.

Filter Text Data

Filter Text Data

Here is the result list of the trace by SQL Server Profiler.

SQL Server Profiler Results Set

SQL Server Profiler Results Set

For the record, I hate SQL. So, anything I can learn to ease my use of SQL is great. What is your favorite debugging feature?

 

 

 

 

David Rodriguez is a .Net, Silverlight, Windows Phone, Windows 8 developer. I created @gogetter for Windows Phone http://www.gogetterapp.com

View data in table variables using SQL Server Management Studio’s debugger

While working on this current project’s stored procedure, it did a lot of inserts into a table variable called @results. While running the debugger on the stored procedure, I notice when inserts were performed on the table variable I could not look at the data that was inserted into the variable. I tried looking through the Locals window, but the only thing that was shown was the variable name, its value, and type. Yet, the value that it was displaying was not what I was looking for. I was wanting an actual dataset. It only showed the value as (table)

Local window in SQL Server Management Studio

Local window in SQL Server Management Studio

There was no way to view the value. As you can see from above, the other variables had an inspector to view their values. However, in regards to this table variable it did not. I then tried using the Immediate window to run a SELECT * command. Nope, that did not work either. The result was that the SELECT * command cannot be evaluated. SQL debugger is so pointless at times.

Immediate window in SQL Server Management Studio

Immediate window in SQL Server Management Studio

After mucking around, trying to figure this out. I came across a StackOverflow post and saw someone else had this same issue. To view a table’s data set you would SELECT * everything while converting it to an XML document. You can then store the results into an XML data type, which then allows you to use SQL’s inspector to view its dataset.

Sorry about all the blurring of the result set. I cannot show that for business purposes, but you get the idea. Have a good one.

 

 

David Rodriguez is a .Net, Silverlight, Windows Phone, Windows 8 developer. I created @gogetter for Windows Phone http://www.gogetterapp.com

about newsletter
Will take verbal abuse for a $1.00
Donate via Paypal

ClaimsPrincipalPermission and unit testing

Recently, I was trying to take a stab at unit testing using NUnit and FakeItEasy. My first unit test started with the following code:

 

All I really wanted to do was to see if the method does return a instance of ActionResult. Upon executing the unit test, I came across this error:

A first chance exception of type ‘System.InvalidOperationException’ occurred in System.IdentityModel.dll

Additional information: ID7027: Could not load the identity configuration because no <system.identityModel> configuration section was found.

The error specifically pointed out that this was occurring at the ClaimsPrincipalPermission attribute.

 

ClaimsPrincipalPermission InvalidOperationException occurred.

ClaimsPrincipalPermission InvalidOperationException occurred.

After some research, I came across that the reason that this was occurring was that ClaimsPrincipalPermission becomes invoked at the CLR level, which in turn it affects unit testing.

This approach typically gets in your way, e.g. ClaimsPrincipalPermission gets invoked directly by the CLR, which means it will also run in unit tests, and unhandled exceptions short-circuit your processing pipeline. http://leastprivilege.com/2012/10/26/using-claims-based-authorization-in-mvc-and-web-api/

Looking at StackOverflow, Dominick suggested you should create a custom ClaimsAuthorizationManager to get around this. You would have your custom ClaimsAuthorizationManager to always return true.

Use a custom ClaimsAuthorizationManager that always returns true for the unit tests.

PrincipalPermissions in general are not very unit testing friendly. http://stackoverflow.com/questions/15429811/claimsprincipalpermission-and-unit-testing/15436366#15436366

So, I did as he suggested. In my AuthorizationManager class, with my current production AuthorizationManager, I created a unit testing version as so:

Lastly, within my unit testing project I added the following to the app.config file:

When all this was setup, I was able to run my unit test successfully.

Hope this helps you.

David Rodriguez is a .Net, Silverlight, Windows Phone, Windows 8 developer. I created @gogetter for Windows Phone http://www.gogetterapp.com

about newsletter
00101010100101101010100101010010110100101010101 = donate.
Donate via Paypal

Remove unused Using statements in your C#’s code behind

I came across something pretty useful while learning some in and outs of ReSharper. I do not believe this is ReSharper specific, but built into Visual Studio itself. Code can get messy, especially the Using statements in your code behind. I thought ReSharper had some tool to clear this up for me, however, at first glance I did not see anything (maybe you know where it is?). As I right clicked my code behind’s page, the contextual menu popped up as normal, then I noticed “Organize Usings“. Oh, now this is interesting. Could this possibly be what I was looking for? As you can see, it provides the following:

  • Remove Unused Usings
  • Sort Usings
  • Remove and Sort

Yep, “Remove and Sort” is just the thing I was looking for. Take a look at the following screenshot.

Organizing Using Directives

Organizing Using Directives

David Rodriguez is a .Net, Silverlight, Windows Phone, Windows 8 developer. I created @gogetter for Windows Phone http://www.gogetterapp.com

about newsletter
Please help a drunk get drunker.
Donate via Paypal

Linqpad: Using Linqpad as a C# scratchpad

LINQPad is a excellent tool when writing LINQ queries against your database or some form of repository. Not only is it good for writing queries, you could use LINQPad as a scratchpad. Recently, I was tasked into writing a parser for our outbound scheduler service. This service would look into the database and select all current outgoing packets. Once retrieved, the dataset was cast to its respective datatype.  With these packets we commands are embedded into a commands property delimited by semi-colons. Previously, we just put a 1:1 command to command property, so I needed a way to test in quick manner if the parser would work. The parser is pretty simple. As you see I created a string array that held these commands. I would split them based on the character ‘;’. Then I would loop through these commands and output them to the console. I needed to test two versions of this. One with only one command, and another with multiple commands. I supposed I could have written a unit test as well, however, I wanted to illustrate you could use LINQPad for simple logic as this, as well, complex logic.

 

LINQPad  - C# Scratchpad Demo

 

 

Recommended Reading:



List Price: $39.99 USD
New From: $24.32 USD In Stock
Used from: $24.33 USD In Stock

David Rodriguez is a .Net, Silverlight, Windows Phone, Windows 8 developer. I created @gogetter for Windows Phone http://www.gogetterapp.com

about newsletter
Will take verbal abuse for a $1.00
Donate via Paypal

Does my solution use this dll?

Been a while, but here you go. I am currently working on an application that uses Google’s Maps API. Or current project uses older Subgurim and Reimer dlls that take advantage of the API. But did we actually use both set of dlls in order to use Google’s Map API? A quick way to figure this out is to open your object browser (you can open the object browser from the View menu), find the dll in question, right click it, and select ‘Find Usages’. By doing so, it will show you all occurrences of usage of the dll in question. Comes to show, we do not use Subgurim, but we do Reimer. Time to update that dll and move on with this project.

 

Visual Studio - Find Usages

Visual Studio – Find Usages

 

 

David Rodriguez is a .Net, Silverlight, Windows Phone, Windows 8 developer. I created @gogetter for Windows Phone http://www.gogetterapp.com

about newsletter
Need cash for alcohol research.
Donate via Paypal

QueryString has its limits, try passing data via IRequiresSessionState or IReadOnlySessionState

Oh hey I have a blog, totally forgot about that. Its been busy here lately, but that is no excuse to neglect my blog. So in light of this, I am going to post something I used recently when passing data to a generic handler via query string was just not cutting it. Passing data via query string has limitation in the length of data you can send. Here is a in depth post on these limitations http://stackoverflow.com/questions/812925/what-is-the-maximum-possible-length-of-a-query-string

I’ll sum up these limitations briefly:

  • Internet Explorer
    • 2,038 character limit, boo hiss boo
  • Firefox
    • 65,536, but could work for more
  • Safari
    • 80,000 character limit, but could work for more
  • Opera
    • 190,000 character limit, but could work for more
  • Apache
    • 4,000 character limit, but could work for more
  • IIS – Internet Information Server
    • 16,384, but could work for more
    • IE accepts less, but the server can accept more. Huh?

Since we have to make our web app work with IE there is no choice but to somehow shoe horn our parameters to be passed to generic methods. Instead of using query strings, another approach would be to use the IRequireSessionState or IReadOnlySessionState interface. For my generic handler I used the IReadOnlySessionState interface. In the code behind calling the generic handler, I stuffed the data I needed into session variables, Session["Key"] = value;

For the generic handler, I had it implement the IReadOnlySessionState. I didn’t want it to do anything, but to read those session variables.

Here’s what I did:

So, I can practically send any type of object I wanted to my handlers and processed that data according to business rules. Well, till next time.

References:

http://msdn.microsoft.com/en-us/library/system.web.sessionstate.irequiressessionstate(v=vs.110).aspx

http://msdn.microsoft.com/en-us/library/system.web.sessionstate.ireadonlysessionstate(v=vs.110).aspx

David Rodriguez is a .Net, Silverlight, Windows Phone, Windows 8 developer. I created @gogetter for Windows Phone http://www.gogetterapp.com

about newsletter
Please help a drunk get drunker.
Donate via Paypal

Breakpoints and Tracepoints: What are they?

So, your in the process of making an app, not just any app, but the most electrifying app that has ever been known to mankind. Before shipping your app, there are a few things you have check on. Is your app intuitive? Does it make sense placing a button on the main page when a swipe gesture could be better? How pretty is your app? We all know apps that look pretty sell well, for instance, take a look at the iPhone Hippies (hipsters and hippies who go ooh and awe for anything that Apple makes). How secure is your app? Is it NSA  proof? Apps dealing with sensitive data needs to be handled accordingly, and by that, I don’t mean by the NSA. Does your app fit the requirements of its demographics? Think of who would be using your app and make all needed features to accommodate that user and keep them happy. A few other things to keep in mind would be the speed of the app (is there a need for speed?), its localization (location based services), internationalization (the more places your app resides the more money you make – North America, South America, Europe and so on), lastly how stable is your app? You won’t know how stable it is unless you test the hell out of it.

What are your options in testing your app then? There are a  couple ways of going about this. One is using Unit Testing and another would be integration testing. The most common form of testing is integration testing. If your a developer more than likely you already have done integration testing.

Integration testing in a nut shell are tests that are not fast nor consistent and heavily depend on other units of the system in order to retrieve an end result. Its all integrated. One part does not work without the help of another. You can think of a car engine as a type of integration. It relies heavily on subsystem after subsystem in order to get it to work. Parts relying on other parts to produce an end result. The car moving would be that end result. Realistically, you would want to perform both types of testing (unit testing and integration testing). Its a lot of work, but the end result is worth it. This post will lead to many other debugging posts using Visual Studio’s debugger and later on to unit testing.

So for starters, let us discuss what a breakpoint and tracepoint is. A brief introduction of both is that a breakpoint tells the debugger, “Hey man, you might want to check this out, line 231. It looks fishy.” When the debugger acknowledges the breakpoint it pauses execution. At that point you can view all local variables in that method, the stack trace, outputs and do some inspection at that point of execution. This pause that the breakpoint initiates is called the break mode.

Tracepoints is the new kid on the block. A tracepoint is a breakpoint, but with hipper clothes and a swagging haircut. The tracepoint sort of looks like Vanilla Ice – To the Extreme, but much more level headed. The tracepoint lets you associate custom actions to the breakpoint. It tells the breakpoint “Alright stop! Collaborate and listen, Ice is back with his brand new invention…”. And all the other breakpoints are like “Ice Ice Baby, too cold, too cold…”. When a tracepoint is hit, the debugger performs whatever action(s) the tracepoint defined, including breaking program execution. I use tracepoints to print out messages of variables to the Output window as execution happens. There are times where I just get tired of stepping through code so I let the tracepoint do the work. Here’s an example of what setting up a tracepoint looks like. You would want to right click, in the source code, where you want to set the tracepoint at, select Breakpoint->Insert Tracepoint.

1-24-2014 3-07-41 PM

1-24-2014 3-05-53 PM

In future posts I’ll discuss what types of breakpoints/tracepoints there are. This is just serving as a little primer/introduction to both. Till next time.

 

References:

http://msdn.microsoft.com/en-us/library/232dxah7(v=vs.90).aspx

Recommended Reading:


Advanced Windows Debugging (Kindle Edition)

By (author): Mario Hewardt, Daniel Pravat

Kindle Edition: Check Amazon for Pricing Digital Only



Kindle Edition: Check Amazon for Pricing Digital Only

David Rodriguez is a .Net, Silverlight, Windows Phone, Windows 8 developer. I created @gogetter for Windows Phone http://www.gogetterapp.com

about newsletter
Family kidnapped by ninjas, need $$$ 4 karate lessons.
Donate via Paypal
VIEW PROFILE

David Rodriguez is Stephen Fry proof thanks to caching by WP Super Cache