Thursday, December 01, 2011

Security with Visual Understanding – A Kinect Project

I gave a presentation today in my Embedded Systems class titled: “Seeing Machines”. The presentation describes my project in which I created a security camera which leverages the skeletal recognition capabilities of the Kinect to detect when someone walks in view of the Kinect camera, upon which it takes pictures and uploads them to a private Picasa library. If 10 seconds passes without receiving authentication from the person who set the alarm off, an audible alarm will sound, and an SMS text message will be sent to notify the owner that an intrusion has been detected.

The Kinect represents some amazing technology. I predict some really interesting technology coming out in the next 5 years which leverages the depth data and skeletal tracking capabilities of Kinect.

My paper can be downloaded at this link: Seeing Machines, a paper by Joseph Fluckiger

Note: view the speaker notes to see links to some of the amazing Kinect projects I found during my research.

Wednesday, November 09, 2011

Narcotic Pain Killers are Overprescribed

 

I am a Software Architect for a Fortune 500 company. My job is to take large amounts of information, filter through it and find the important facts, trends, techniques, subtleties, and truths. Let me take a moment to talk about a truth of the US Medical system.

1) The US Healthcare system over prescribes narcotic pain killers.

I broke my collar bone on Friday while playing soccer and had surgery this morning to have a plate implanted over the two pieces of my collar bone. After the surgery the nurses insisted that I take narcotic pain killers to for the unbearable pain they described I would have once the local block wore off. They even convinced my wife who is a fan of natural foods and medicines that I absolutely had to have narcotic pain killers. All the way to the car the nurse pleaded to my wife to make sure that I took them. I didn’t because I value my brain cells. Guess what, I was fine. I was uncomfortable for 4 hours between 8pm and 12am, but I used ice which eased the pain just as well as a narcotic drug could have. Ice does not have harmful side effects and is not addictive. It is also harder for insurance companies, doctors and pharmacies to make healthy margins on. So that is why doctors prescribe narcotic pain killers. First, they have a monopoly on being able to prescribe them, and secondly, they are a great source of recurring revenue.

Before I sound disgruntled, let me say that I am very happy with my orthopedic surgeon. I think he did a good job. He was helpful and friendly, skillful and most importantly didn’t cut any of my arteries while installing hardware in my shoulder. I will be forever grateful to him and his staff for fixing me. However, I hope that you will share this truth with your doctor and start a grass roots effort to help our HealthCare system focus on wellness and not profit margins which will save the great US of A from exploding Healthcare costs while improving personal health, and happiness.

 

Next time: How healthcare providers and insurance companies collude to overbill patients…

Saturday, October 29, 2011

SmartStepsUtil - A Utility Class for WinForms

I’ve been using a utility class I wrote called “SmartStepsUtil” since 2007.  I’ve decided to share it with the world. It turns your WinForms app into a “Console” simply helping you to write colored text to a RichTextBox.

image

I’ve used SmartStepsUtil on a few applications including SharePoint SUSHI. It makes it easy to quickly give feedback to the user about what is going on. It is thread safe, so you can call it from a background thread. Feel free to change it as needed.

It just amazes me how many applications don’t give feedback to the user. Or they have complex UIs with textboxes all over the place. SmartSteps util brings the best of a Console application (simple UI, live feedback) into a Winforms app. To use SmartStepsUtil, copy into your application

Methods:

- AddtoRichTextBox()
- ScrollToBottom()
- ClearRichTextBox()

Preset Styles to choose from to write to console:

public enum StyleType
{
    bodyBlack,
    bodyBlackBold,
    bodyBlue,
    bodyBlueBold,
    bodyChocolate,
    bodyChocolateBold,
    bodyDarkGray,

     …

Applications I’ve written using SmartStepsUtil:

SharePoint SUSHI

SNAGHTML55ade1a

BearWarePro Load Tester (affectionately called “The Punisher” Smile)

 

Source for SmartStepsUtil:

/*
Written by Joseph Fluckiger, 2007
Home page: http://josephfluckiger.blogspot.com/
*/
using System;
using System.Drawing;
using System.Windows.Forms;

namespace SmartStepsUtility
{
public static class SmartStepUtil
{
/// <summary>
/// Singleton Reference to RichTextBoxInstance. Set this Instance on application startup.
/// </summary>
public static RichTextBox RichTextBoxInstance { get; set; }

/// <summary>
/// Add to RichTextBox with Style
/// </summary>
public static void AddToRichTextBox(string strText, StyleType style)
{
AddToRichTextBox(strText, style, EnumIcon.no_icon);
}

private static void AddToRichTextBox(string strText, StyleType style, EnumIcon icon)
{
switch (style)
{
case StyleType.bodyBlack:
AddToRichTextBox(strText, Color.Black, 8, false, icon);
break;
case StyleType.bodyBlackBold:
AddToRichTextBox(strText, Color.Black, 8, true, icon);
break;
case StyleType.bodyBlue:
AddToRichTextBox(strText, Color.Blue, 8, false, icon);
break;
case StyleType.bodyBlueBold:
AddToRichTextBox(strText, Color.Blue, 8, true, icon);
break;
case StyleType.bodyChocolate:
AddToRichTextBox(strText, Color.Chocolate, 8, false, icon);
break;
case StyleType.bodyChocolateBold:
AddToRichTextBox(strText, Color.Chocolate, 8, true, icon);
break;
case StyleType.bodyDarkGray:
AddToRichTextBox(strText, Color.DarkGray, 8, false, icon);
break;
case StyleType.bodyOrange:
AddToRichTextBox(strText, Color.Orange, 8, false, icon);
break;
case StyleType.bodyRed:
AddToRichTextBox(strText, Color.Red, 8, false, icon);
break;
case StyleType.bodySeaGreen:
AddToRichTextBox(strText, Color.SeaGreen, 8, false, icon);
break;
case StyleType.bodySeaGreenBold:
AddToRichTextBox(strText, Color.SeaGreen, 8, true, icon);
break;
case StyleType.titleBlack:
AddToRichTextBox(strText, Color.Black, 14, true, icon);
break;
case StyleType.titleBlue:
AddToRichTextBox(strText, Color.Blue, 14, true, icon);
break;
case StyleType.titleChocolate:
AddToRichTextBox(strText, Color.Chocolate, 14, true, icon);
break;
case StyleType.titleSeagreen:
AddToRichTextBox(strText, Color.SeaGreen, 14, true, icon);
break;
default:
AddToRichTextBox(strText, Color.Black, 8, false, icon);
break;
}
}

public static void AddToRichTextBox(string strText)
{
AddToRichTextBox(strText, Color.Black, 8, false, EnumIcon.no_icon);
}

public static void AddToRTBnl(string strText)
{
AddToRichTextBox(strText + "\r\n", Color.Black, 8, false, EnumIcon.no_icon);
}

public static void AddToRichTextBox(string strText, Color textColor, float fontSize, bool bold)
{
AddToRichTextBox(strText, textColor, fontSize, bold, EnumIcon.no_icon);
}

public static void AddToRichTextBox(Exception ex)
{
AddToRichTextBox(ex + "\r\n", StyleType.bodyRed, EnumIcon.no_icon);
}

/// <summary>
/// Delagate for thread safely adding to Richtextbox
/// </summary>
private delegate void delAddToRTB(string strText, Color color, float fontSize, bool bold, EnumIcon icon);

/// <summary>
/// Threadsafe call to add to Richtexbox
/// </summary>
public static void AddToRichTextBox(string strText, Color textColor, float fontSize, bool bold, EnumIcon icon)
{
if (RichTextBoxInstance.InvokeRequired)
{
RichTextBoxInstance.BeginInvoke(new delAddToRTB(AddToRichTextBox), new object[] { strText, textColor, fontSize, bold, icon });
return;
}
FontStyle style1 = bold ? FontStyle.Bold : FontStyle.Regular;
if (fontSize <= 0)
{
fontSize = 8;
}
var font1 = new Font("Courier New", fontSize, style1, GraphicsUnit.Point, 0);
RichTextBoxInstance.SelectionStart = RichTextBoxInstance.TextLength;
RichTextBoxInstance.SelectionFont = font1;
RichTextBoxInstance.SelectionColor = textColor;
RichTextBoxInstance.SelectedText = strText;
AddIcon(icon);
}

public static void ScrollToBottom()
{
if (RichTextBoxInstance.InvokeRequired)
{
RichTextBoxInstance.BeginInvoke(new Action(ScrollToBottom));
return;
}
RichTextBoxInstance.Focus();
RichTextBoxInstance.Select(RichTextBoxInstance.Text.Length, 0);
RichTextBoxInstance.ScrollToCaret();
}

public static void ClearRichTextBox()
{
if (RichTextBoxInstance.InvokeRequired)
{
RichTextBoxInstance.BeginInvoke(new Action(ClearRichTextBox));
return;
}
RichTextBoxInstance.Clear();
}

private static void AddIcon(EnumIcon icon)
{
if (icon != EnumIcon.no_icon)
{
var font1 = new Font("Wingdings", 10f, FontStyle.Regular, GraphicsUnit.Point, 0);
RichTextBoxInstance.SelectionStart = RichTextBoxInstance.TextLength;
RichTextBoxInstance.SelectionFont = font1;
switch (icon)
{
case EnumIcon.brown_arrow:
RichTextBoxInstance.SelectionColor = Color.Brown;
RichTextBoxInstance.SelectedText = AsciiToStringUtil(182);
break;
case EnumIcon.green_check:
RichTextBoxInstance.SelectionColor = Color.Green;
RichTextBoxInstance.SelectedText = AsciiToStringUtil(252);
break;
case EnumIcon.orange_dotdotdot:
RichTextBoxInstance.SelectionColor = Color.Orange;
RichTextBoxInstance.SelectedText = AsciiToStringUtil(160) + AsciiToStringUtil(160) + AsciiToStringUtil(160);
break;
case EnumIcon.red_x:
RichTextBoxInstance.SelectionColor = Color.Red;
RichTextBoxInstance.SelectedText = AsciiToStringUtil(251);
break;
}
}
}

private static string AsciiToStringUtil(int asciiCode)
{
return ((char)asciiCode).ToString();
}

public enum EnumIcon
{
brown_arrow,
green_check,
no_icon,
orange_dotdotdot,
red_x
}

}

public enum StyleType
{
bodyBlack,
bodyBlackBold,
bodyBlue,
bodyBlueBold,
bodyChocolate,
bodyChocolateBold,
bodyDarkGray,
bodyOrange,
bodyRed,
bodySeaGreen,
bodySeaGreenBold,
titleChocolate,
titleSeagreen,
titleBlue,
titleBlack
}

}

Thursday, September 01, 2011

Visual Studio Shortcuts


Revisiting Visual Studio keyboard shortcuts is always a good investment of time for any serious Visual Studio developer. Here is a nice list to hang on your wall: Most Useful Keyboard Shortcuts for .NET Developers.

This list was created by Mahdi Taghizadeh.






Monday, July 04, 2011

Bitcoin does have intrinsic value

In response to an article which states that bitcoin has no intrinsic value, here are my thoughts.

Bitcoin does have characteristics which make it potentially more userful than than existing mediums of exchange. It is has near-zero transaction costs. Compare this with Visa/MasterCard. And try sending gold in the mail.

Bitcoin also has real intrinsic value because it is more secure than Visa/MasterCard in that the recipient of payment cannot extract from your account more than you intended them to. When you give someone your credit card number, they can then use that number to take any amount of money they want from you. When you send money via bitcoin, they can’t because you aren’t sending your private key. With Visa/MasterCard we are giving our private key to a merchant. Bitcoin is not a crazy idea, Visa/MasterCard is!

By reducing cost of money exchange world-wide, Bitcoin has huge potential economic benefits for the world economy.

Who is a potential customer for Bitcoin? Everyone in the world. Not one country, not one language, or one demographic. Everyone. Talk about market potential. If you thought the China market was big …

The biggest threat to Bitcoin, in my opinion, is that early adopters include shady folks and bitcoin could potentially get a bad reputation because of it. But look back at the Internet, the most profitable business in the early days included a larger proportion of shady uses (pornography). The Internet got a bad reputation because of it. However, as the masses of people adopted the Internet, more honest/legitimate people became the majority and look how many good/legitimate things happen on the Internet today. Gavin Andresen has an interesting post suggesting folks contact their local representatives pointing out that bitcoin will create jobs in order to boost the chances of bitcoin being legitamized in the eyes of government.

I must state that bitcoin is not something I recommend as an investment. It is currently in early infancy and has a few years yet before the bitcoin ecosystem will be robust enough to support the hundreds of millions of dollars currently in circulation. A bitcoin today, honestly is not worth the $15-30 dollars they have been trading for for the past 30 days. The current price is the product of hype and speculation.  However, as a software engineer, and an Economics major, the technical and economical foundations of bitcoin are potentially quite sound. I have read all the technical posts on the bitcoin wiki and Satoshi's paper, and I am impressed. On the other hand, I am not impressed with the bitcoin client, mtgox or mybitcoin. It is almost emarrassing how poorly written these sites are, and they all need to be dramatically improved before millions of dollars of value is entrusted to them. This is why I don't recommend bitcoin as an investment. These sites are in early beta and are not ready for prime time use. However, give these sites a year or so and I am hopeful they will dramatically improve.

I think competition is good. Vista/mastercard and baking currently have little competition. Banks and national currencies are currently much more stable, safe and predictable than bitcoin. However Bitcoin has some very clever ideas on making transaction costs lower, reducing fraud and identity theft, and reducing costs of exchanging money internationally. People need to demand that banks find better ways than exchanging credit card numbers which is really quite silly. Bitcoin may give banks a few ideas, or else it will replace them. I am confident that banks and credit cards and their employees will rise to the occasion and come up with some clever solutions of their own. The biggest threat to bitcoin is not goverments declaring it illegal, but bank innovation. In either case if banks or bitcoins win the battle of innovation, quality of life is the winner.

Monday, June 06, 2011

Awesome plugin for Visual Studio 2010

This is a great extension for VS 2010 released last month: Productivity Power Tools.

If you’ve used Resharper, this brings several of its great features right into VS 2010.

- Quick Find

clip_image002

- Remove and Sort Imports (they stole this one wholesale from Resharper)

clip_image003

- Solution Navigator: very cool - Solution Explorer on steroids (legal ones of course)

- Enhanced Scrollbar – red dots are breakpoints, dark blue dots is the carrot location.

clip_image005

- Etc..  read more

Friday, February 04, 2011

Outlook tip: Turn off Email Contact Pictures

 

Many people find the photos in the window border to be a little distracting. It is easy to turn them off by adding a registry key.  Follow these simple steps:

1) Save the text below between the lines into a text file and rename the file “dontShowContactPicture.reg”.

------

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Options\Mail]
"ShowContactPicture"=dword:00000000

------

2) Double click the file and you will be prompted:

SNAGHTML51847e3

3) Restart Outlook.

4) See the result:

Before:

image

After:

image

5) To undo this change and turn pictures back on, simply edit the file and change “dword:00000000” to “dword:00000001”

 

More information can be found in this related article on stackoverflow.com

Monday, January 17, 2011

Thursday, January 13, 2011