Rantings from an opinionated coder RSS 2.0
 Thursday, October 30, 2008

 ---->   

Twitticator 0.1 is a little application that pushes your Microsoft Communicator status to Twitter each time you make an update to it.

The complete source code can be found below the binaries. Enjoy!

MD5 hash for TwitticatorApp.exe 5611D2B10CAC7B6387F96F3D0DE50EBF
MD5 hash for CommunicatorAPI.dll: 8EA40A1E7C6C3EA0527DD39AA892B72B

Updates and new features coming soon:

  • Bi-directional support to push Twitter status to communicator
  • Secure storage of your Twitter username and password
  • I welcome your suggestions!

No Warranties, expressed or implied.  Use at your own risk.

 

Windows Binaries
twitticator.zip (29.83 KB)*Not currently working, will fix soon!

Source Code
TwitticatorSourceCode.zip (167.75 KB) *Not currently working, will fix soon!

Thursday, October 30, 2008 12:00:15 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -

 Thursday, October 16, 2008


While playing around with wireshark briefly as a possible tool to use around here, I ran into something rather interesting/weird.  Below is a packet Outlook sent to Exchange today from my box.  "Windows for Workgroups 3.1a" !?!  There's some old stuff in that protocol.  I'm pretty sure we don't have Windows 3.anything running here.

0000  00 00 0c 07 ac 00 00 1c  23 28 c2 c6 08 00 45 00   ........ #(....E.
0010  00 b1 86 15 40 00 80 06  bc e3 9d ab 27 bf 9d ab   ....@... ....'...
0020  54 38 0a 08 01 bd 05 82  c8 ae 9b 35 cb 90 50 18   T8...... ...5..P.
0030  ff ff ef 02 00 00 00 00  00 85 ff 53 4d 42 72 00   ........ ...SMBr.
0040  00 00 00 18 53 c8 00 00  00 00 00 00 00 00 00 00   ....S... ........
0050  00 00 00 00 ff fe 00 00  00 00 00 62 00 02 50 43   ........ ...b..PC
0060  20 4e 45 54 57 4f 52 4b  20 50 52 4f 47 52 41 4d    NETWORK  PROGRAM
0070  20 31 2e 30 00 02 4c 41  4e 4d 41 4e 31 2e 30 00    1.0..LA NMAN1.0.
0080  02 57 69 6e 64 6f 77 73  20 66 6f 72 20 57 6f 72   .Windows  for Wor
0090  6b 67 72 6f 75 70 73 20  33 2e 31 61 00 02 4c 4d   kgroups  3.1a..LM
00a0  31 2e 32 58 30 30 32 00  02 4c 41 4e 4d 41 4e 32   1.2X002. .LANMAN2
00b0  2e 31 00 02 4e 54 20 4c  4d 20 30 2e 31 32 00      .1..NT L M 0.12.

Thursday, October 16, 2008 2:52:32 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1] -

 Sunday, August 31, 2008

Google's acquisition the often hated and controversial company DoubleClick raises some concerns with me as to how much Google adheres to its motto "Don't be evil" in recent years.

Issues surrounding Google's protection of its user's privacy have been peppered through the news (such as gmail email indexing), admittedly less than other large companies, but this acquisition raises some major concerns for me unless DoubleClick's tactics of old are to be depricated after the takeover. 

And remember... "Don't be Evil"

Sunday, August 31, 2008 10:59:34 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -

 Wednesday, July 16, 2008

The Green Drinks Greensboro chapter has its second meeting this evening at Natty Greens Brew Pub in downtown Greensboro.  With 88 members on the current email list and 30 people attending the first meeting, I would venture to say it's off to a successful start.  I look forward to seeing you there!

From Greendrinks.org:

"We're off to a great start.  Over 30 people showed up at the very first event!  The next date is....

When:   July 16th, 5:30pm                                        
Where:  Natty Greene's Brewing Company, 2nd Floor
Why:     See below...


What is Green Drinks Greensboro?
It's a social hour.  It's a networking event.  It's unwinding with friends.  It's a time and place where it's okay to be green and to find out what others in your city are doing to be green, work green, play green, or live green.  And it happens all over the country and the world in over 300 cities.  Proving that it's never too late to join the green movement, Green Drinks Greensboro will be meeting every third Wednesday of the month on the 2nd floor of Natty Greene's Brewing Company (345 S. Elm St.) starting from 5:30 until 7:30(ish).

Green Drinks Greensboro invites all those who care about the environment, teach about and learn about the environment, work in an environment-related field, have interest in the environment, environmental products, sustainable building, environmental protection, eating local, ecological design, alternative energy…you get the idea.  There will be no agenda and there are no dues. From time-to-time we will allow a few minutes for short presentations. To get on our e-mail list, simply send an email to greendrinksgso@gmail.com and we will keep you posted on our events.  See you there!"

Wednesday, July 16, 2008 12:50:31 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General | Personal
 Tuesday, July 08, 2008
Feeling constrained by the default Communication Locations?  Well, no more, Here is a small Office Communicator Custom Location hack that lets you be just a little more specific about what you're doing.  Works on my machine, but use at your own risk.

http://blog.tiensivu.com/aaron/archives/1341-Little-known-Office-Communicator-2007-feature-Custom-Presence-States.html

Tuesday, July 08, 2008 2:37:37 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General | Programming
 Sunday, June 22, 2008

Good Job Plurk!  I won't be doing that again.

This is what happens when you use their built-in 'feature' to add people you already know from another service, such as Gmail. 

Have we not heard of using ssl or form submission without using querystring values?  It's really not that difficult guys...

Sunday, June 22, 2008 12:18:53 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -

 Tuesday, June 03, 2008

The first day of Tech Ed has been exciting and full of things to be learned and explored.  Here are the sessions I attended and my thoughts/reflections on each.

Keynote with Bill Gates, S. "Soma" Somasegar, others


Pragmatic Architecture: The Role of an Architect with Ted Neward

  • Architects spend too much time defining their role
  • The building architect analogy is good, but the maestro/conductor comparison is better.
  • How do we start polishing the process of software architecture over the next 5-10 years?
  • Why is there often a negative connotation with the title "Architect"
  • Some architects really have no idea what is going on.  You must understand the big picture before you can create solutions at this level.
  • Should architects still write code?  Absolutely!


Best Practices with the Microsoft Visual C# 3.0 Language Features with Mads Torgersen (PM for C#)

 

Automatically implemented properties

public string CustomerID { get; set; }

 

Implicitly typed Local variables

 

 

var custs = new List<Customer>()

{

new Customer()

{

                        CustomerID = “MADST”;

                        CustomerName = “Mads Torgersen”;

                        City = “Redmond”;

}

}

 

Collection and Object Initializers

Code-result Isomorphism

            Shape imitates result

 

ObjectDumper

 

Extension Methods

Public static IEnumerable<Customer> GetLondoners(this IEnumerable<Customer> source)

Foreach (var c in source)

{

            If (c.City == “London”) yield return c;

}
Allows you to insert extension methods into an instance (even if static)

New functionality on existing types

Scoped by using causes

Interfaces & constructed types

 

Lambda Expressions

Public static IEnumerable<T> Filter <T>(GetLondoners(this IEnumerable<T> source, Predicate>T> p)

foreach (var c in source)

{

            If (p(c)) yield return c;

}

 

var query customers.Filter(delegate(Customer c) { return c.City == “London”; };

 

Terse syntax for anonymous methods:

var query customers.Filter(c =>{ c.City == “London”;});


*When you only have one thing left you can remove the parens

 

LINQ to Objects

var query = Customers

            .Where( c=> c.City == “London”);

            .Select ( c=> c.ContactName);

 

ObjectDumper.Write(query);

 

Monads – Look into this

 

Don’t use LINQ for *other magic* that is not a query

 

Expression Trees

Related to link

Expression(of)

Represents a lambda expression as an expression tree at runtime

 

 


ASP.NET MVC with Scott Hanselman

  • Separation of Concerns!
  • A new .NET project type
  • Designed to be very easily testable with minimal need for mocking objects compared with other patterns
  • Test with mbunit or integrated VS test system
  • Uses three new namespaces:
    • System.Web.Abstractions
    • System.Web.Mvc;
    • System.Web.Routing;
  • "Bin-deployable" These new assemblies do not have to be installed in the GAC.  Useful when you can't, or are afraid to, install them there.
  • Flexible.  Plays well with Winforms
  • Fundamental to .NET from version 3.5 forward
  • Demo of red-green TDD.  This is really quite easy with MVC because of much improved separation of concerns when used properly
  • JQuery and AJAX compatible
  • Dove into the call stack for MVC at runtime, it's quite informative for understanding what's going on "under the covers".  Have a look at the call stack of a running MVC app to get a good picture of what's going on.
  • Discussion of Routing
  • Provides for cleaner URLs and HTML
  • Phil Haack (PM for MVC) is open to suggestions from the community and will be incorporating recommendations from developers as much as possible.
  • "Strongly typed query strings"
  • Much better than average runtime errors when something goes wrong.  This is strange but true!
  • Discussed Extension Methods, Lambda queries, and LINQ
Monday, June 02, 2008 11:04:02 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2] -

 Wednesday, May 28, 2008

privacyLink.Text = String.Format("<a href=\"{0}\"{2}>{1}</a>", hrefLink, LinkBuilder.ExtractTextFromLink(links[0]));

This caused me a bit of grief this evening.  While I am not a fan of building strings like this, it's the way things were and I had to run with it.  In an ideal world this would be done with a text or html writer, but I'll be happy with anything short of basic string concatenation. 

While refactoring a fairly large application for a web analytics migration, I missed one small but key problem with the line of code listed above.  The error given was referencing an array index out of bounds or an undefined array index referenced.  Thus I immediately went chasing after a possible problem with the links array being empty or null.  This proved futile, and after a few minutes of tracing the flow and checking the history of changes on this file it became apparent that if there was a problem with the array reference, it had been an issue for at least six months. 

Google had a cached copy of the page, indexed before my code push, which told me it had definitely been working before I touched anything.  I decided a closer look at the String.Format() method call was necessary.  In this instance we're expecting a string formatter and an array of one or more strings as additional parameters. 

Since this uses late binding of the string parameters into the formatter, the compiler never checks that the correct number of arguments are specified.  It would have been nice if the compiler had been designed to parse the formatter and fail the compilation if one too few arguments were provided, but understandably that responsiblity falls on the developer in this case.

There were some key factors in why this bug made it into production before being caught during testing there:

  • Partially centralized link building, duplicated in many different portions of the application when a single linkbuilding class would have been ideal.  In reality, halfway OOP is often much worse than none at all.
  • Code that is not testable with out cost-prohibitive refactoring.
  • Limited content and resources with which to test in the staging environment
  • The error only occurs when a custom privacy policy link is used, >70% of the time the default is used.  Only 5 of well over 100,000 pages were throwing the error.
  • Lack of automated tests on production data.  We're working to eliminate this particular hindrance, but precious time for such "extras" is always scarce.

I was eventually able to correct the error and push the code up to staging and pre-production to validate the fix.  In the end the fix made its way to production before customers became aware of the problem, but these kind of errors are preventable by working to correct the problems listed above.

Wednesday, May 28, 2008 8:40:17 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -

Flickr stream
Archive
<October 2008>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
Blogroll
 Adventures in MOSS land
Jeff Dalton's Journey with Sharepoint 2007
 Bridget Laszlo
 Clements Vasters
 Coding Horror
Programming and human factors by Jeff Atwood
 Peteris Krumins
 Peter's Blog
Peter's entries on Javascript have been quite interesting lately
 Rex Morgan
 Scott Guthrie
 Scott Hanselman
 Ted Dziuba
 Unpopular Ideas
Steve Simonoff's Blog
 World of Via
Chris Via's Blog
 Yahoo!
Yahoo corporation's blog
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2009
Christopher Ballance
Sign In
Statistics
Total Posts: 19
This Year: 0
This Month: 0
This Week: 0
Comments: 3
All Content © 2009, Christopher Ballance