Being Grateful

I have not posted on my blog in a while but given that this is fitting is oddly fitting.  As I am writing this my grandfather is moments away from passing.  He has been very influential in my life; he was the one who first introduced me to fixing computers in the early 1990’s.  He started my spark of curiosity of technology.  For those of you who know me well, know I am obsessed with learning and using technology.

He also was always excited about fixing things and tinkering.  He was an avid craftsman, and built many pieces of furniture.  By trade he programmed/ran/maintained CNC mills and he was the best in his company at it.

I’ve had a missed opportunity, so many times I could have thanked him for all the inspiration and knowledge he imparted on me.

He is too far gone for me to say my final farewell, his breathing very faint and sporadic. So this post has to suffice.  A parting note, please take a moment and thank the people in your life who have inspired you.  They are few and far in between.

SQL Server – Deleting Duplicate Rows

Oh what a tangled web we weave when we don’t use unique constraints or primary keys…

Using some clever rules about deleting from a view (also applies to a common table expression).  You can delete from a view if the view only references one table.

WITH    cte(b, r)
AS (SELECT    Field1,
ROW_NUMBER() OVER (PARTITION BY Field1 ORDER BY Field1)
FROM      dbo.Table1
WHERE     Field1 IN (SELECT   Field1
FROM     dbo.Table1
GROUP BY Field1
HAVING   COUNT(*)>1))
DELETE FROM cte WHERE r > 1;

Part of the trick is to use Row_Number to make a distinction between the rows.  You can then delete anything that has a row number greater than 1 (a dupe)

Great Primer for Threading Basics in .Net

I stumbled across this article from one of my LinkedIn friends,  Threads in C#

It answered one of my questions about thread pooling in a very concise, easy to understand fashion.  It is a short article, but he then goes into the Task Parallel Library, something that I really enjoy.

If you are asking why should I care about this, I use the magic of Async/Await.  These are the fundamental technologies and techniques that they are built upon.

Keep in mind that not many people are experts in highly concurrent systems, I am not one of them either.  But hopefully by reading this article we will all be a little better in how we implement parallelism/concurrency.

Cheers!

SQL Server Performance Tuning For Developers

Chances are if you are reading this, you are a software developer.  Relax, I am one too, as well as a database administrator.  I spend a lot of time helping people to write code that is efficient or get the right results.  I want to share this post on SQL Database Tuning http://www.toptal.com/sql/sql-database-tuning-for-developers by Rodrigo Koch. It provides some really good advice, especially for beginners in the area.

Really hits the nail on the head though, keep it minimalistic. Only return what you need, it takes more time on the server and then the data has to go over the network.  He goes into some detail of how to troubleshoot slow queries and when to create indexes

 

Mocking in Python

An Introduction to Mocking in Python by Naftuli Tzvi Kay

This article is very insightful for covering mocking in Python.  In case you don’t know mocking is a technique for testing where you don’t want to use a particular object or set of objects.  For example, you might want to simulate database functionality while you are writing your test cases.

Hope you all find this useful, have a great day!

 

A ClickOnce gotcha – FIPS algorithms

If you are using FIPS, your ClickOnce applications might not work. I ran into this bug running BookSmarts, an application I wrote. Turned FIPS on and started receiving errors.

The issue is that enabling FIPS makes the mechanism that verifies the validity of ClickOnce applications fail every time.

The article, a very long one, can be found here: https://support.microsoft.com/en-us/kb/811833

Just keep this in mind if you are trying to support someone who is the odd ball out.

Note: Enabling/Disabling FIPS in Windows is done through the registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy\Enabled (DWORD)

1 is on, 0 is off

When changing this setting, it’s necessary to reboot the computer.

Cool tips and tricks for Google Chrome…

This is a decent post I put out there about Chrome on my businesses website but I figured all you WordPressers out there would enjoy skimming it too. I am going to make a series of these since people like them! More to come.

http://www.getbooksmarts.com/tips-tricksGet great speed from Chrome-and-news/google-chrome-productivity-tips-tricks