Tagged: Development

Downfall: Hitler gets unhappy with his Agile team

This is hilarious! Hitler goes crazy when he learns that his team does not follow the tenets of the Agile Manifesto.

Design Patterns : Singleton

A Singleton, in software engineering, is a design pattern that is used when you only want/need to allow one instance of a class. This is specifically useful when the class instantiation of the said class is resource expensive (e.g. database connection, graphics driver, network resource and file streams…).

Below is a UML describing the implementation details of a Singleton.

designpatternsworkbook_singleton_diagram

Here is an example of a Thread-safe Singleton implemented in C#. In this example, we are trying to simulate a DbConnection object. The DbConnection object has a private constructor that blocks users of this class from ‘new-ing’ this object. Instead, the DbConnection object has a property called Instance that allows users creates a copy of DbConnection.

designpatternsworkbook_singleton_classdiagram

Running the above code will have this output:

designpatternsworkbook_singleton_outputresult

 

My tools of the trade 2012

Rusty Winch by Geoff Lawrence

A friend of mine asked me the other day about the tools I am using while developing applications and it took me a good few minutes to tell him all of things I used. I figured I should put it online just in case someone ask again in the future since it was a lot to talk about. So here it goes:

Microsoft Visual Studio – My development best friend.
NetBeans – C++/Java/PHP development IDE. I used to use if for Ruby too but support has since been dropped.
Eclipse – For my Android obsession. I used this for Java as well but not as much compared to Netbeans.
Xcode – Emergency relief when I’m bored with Android and C#.
CodeRush – Code Refactoring add-on for Microsoft Visual studio that doesn’t suck. I love ReSharper too but I haven’t found a reason that would make me switch.
WCF Storm – Web Services tester that is way better than the standard WCF Test client from Microsoft
Fiddler – Web debugging too for HTTP testing. This thing rocks. Trust me.
StyleCop – Code analysis tool ti make sure you are following a set of coding guidelines(style).
LinqPad – More than just a LINQ expression builder. A good way to test expressions before loading them to your actual code.
JsFiddle – Javascript, HTML and CSS tester that helps you isolate bugs
BrowserShots – A nice site that shows you how your site looks like in multiple browsers.
JsLint – Javascript code evaluator that tells you if your code sucks.
JetBrains dotPeek – Free .NET code decompiler from JetBrains. A replacement for Reflector.
BitBucket – For my private source code repositories. GitHub for my not so private code repositories
SourceTree – Mercurial, Git and Subervision(SVN) repository manager for Mac. I use TortoiseSVN for Subversion and TortoiseHG for Mercurial repository management access in Windows
Evernote – Notes and more notes. I used this as repository for ideas, meeting notes and anything else that I need to remember.
Skitch – Screenshot tool from the makers of Evernote for the Mac
Balsamiq – My preferred wire framing tool. SketchFlow comes second.
OmniGraffle – Microsoft Visio replacement for Macs. Can be used for wire framing too.
LinkChecker – Link validator for websites. Scans websites for broken links and generates a report on what they are.
Console2 – Probably the best Windows Command prompt replacement. This thing is glued with awesomeness.
PixResizer – A free batch picture resizer for Windows that doesn’t kill your machine’s resources.
7zip – a free Winzip replacement.
Notepad++ – Best notepad replacement in Windows. Notepad2 is also nice. I use TextWrangler when I’m on a Mac.
WinMerge – a free Document comparison and merging tool
Dropbox – the must have Cloud-based storage system
Trello – Task Management made easy. Real-time collaboration with notifications. Works on your phone too!
RegExr – Simple yet elegant Regular Expression(RegEx) testing tool

Here’s some Firefox Add-Ons that i can’t live without.
Firebug – Must have add-on for testing and debugging pages in Firefox. Enables you to modify HTML, CSS and Javascript on the fly to see how they render in the browser
Web Developer – Get this compliment to FireBug.
ColorZilla – Color Picker and Gradient Generator. Also try Rainbow Color Tools
Pixlr Grabber – Image grabber. Allows you to save images on a web page.
ShowIP – A really neat tool that allows users to see the IP address of the current web page in their status bar.
fontinfo – Tells the user which font are used on the current page
YSlow – A tool that helps analyze why pages are slow

There’s probably more things that I forgot to list (like development frameworks e.g Ninject and Moq) so I promise I’ll create a new post in the next few days talking about those frameworks.

How about you? What tools/applications are you using in your day to day life as a developer/architect/programmer?

Cheers!

Keith Rull

RIA Services: Access to operation ” was denied

While working on RIA Services and Silverlight you might get an error like this:

ria services silverlight access to operation error was denied
RIA Services access to operation was denied

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; HPNTDF; InfoPath.3; .NET4.0C; .NET4.0E; MS-RTC LM 8)
Timestamp: Fri, 18 Feb 2011 18:20:46 UTC

Message: Unhandled Error in Silverlight Application Load operation failed for query ‘GetUserDetails’. Access to operation ‘GetUserDetails’ was denied. at System.ServiceModel.DomainServices.Server.DomainService.ValidateMethodPermissions(DomainOperationEntry domainOperationEntry, Object entity)
at System.ServiceModel.DomainServices.Server.DomainService.ValidateMethodCall(DomainOperationEntry domainOperationEntry, Object[] parameters, ICollection`1 validationResults)
at System.ServiceModel.DomainServices.Server.DomainService.Query(QueryDescription queryDescription, IEnumerable`1& validationErrors, Int32& totalCount)
at System.ServiceModel.DomainServices.Hosting.QueryProcessor.Process[TEntity](DomainService domainService, DomainOperationEntry queryOperation, Object[] parameters, ServiceQuery serviceQuery, IEnumerable`1& validationErrors, Int32& totalCount)
at System.ServiceModel.DomainServices.Hosting.QueryOperationBehavior`1.QueryOperationInvoker.InvokeCore(Object instance, Object[] inputs, Object[]& outputs)
Line: 1
Char: 1
Code: 0
URI: http://yourapplicationwebsite/

The reason behind this is that the service you are calling requires privileges in order for it to be executed. This is specifically true when RequiresAuthenticationAttribute attribute or the RequiresRoleAttribute is applied to your service. To solve this error make sure that the application calling the service has the required access/permission to call the service method or you can remove both attributes on the service if the are not really needed(which might be risky).

Expression Studio 4 is out and my 60-day tool

I was really excited last Monday after seeing Expression Studio 4 has been released (I have to admit that I’m one of those developers who logged in at MSDN at 12 midnight to check if the RTM bits are already out. hehe). I think this is great news for all XAMLers all over the world. On thing that I’m really sad about though is that our corporate MSDN license only has Expression Studio 4 Professional and not the Ultimate version. Bummed. So I ended up downloading the 60 day trial up until I can figure out how I can get a copy of the full version (OK, here’s the part that I ask donations to get a full copy but I’ll leave that out. LOL).

Sad, but still happy. At least I have 60 days to enjoy this new tool. 😉

My MIX09 10K Contest Entry: Silverlight Pregnancy Calendar

I had some free time during the holidays and saw at the MIX09 website that they have a contest entitled MIX09 10K Challenge where they ask participant to create a web application that is either using Microsoft® Silverlight™ or Windows Presentation Foundation, as a XAML Browser Application running in Partial Trust or as a ClickOnce application in 10 kilobytes or less. I decided to take a stab at it and this is what I’ve came up with

SilverCalendar: A Silverlight Pregancy Calendar

You can see the app live here http://2009.visitmix.com/MIXtify/TenKDisplay.aspx?SubmissionID=0051

Dont forget to vote when you’re there 😛 LOL

My primary motivation when I built the app is the idea of having something that is going to be useful and at the same time fun to build. My wife is currently 34 weeks pregnant and it made me think that a pregnancy calendar would be q great application to do since it relates to me and my current day to day life. I love pregnancy calendars because it gives you a good daily insight on the progress of your baby and what you might expected as you go along in your daily life as a soon to be parent.

The application that i built is using Microsoft Silverlight 2 with a backend WCF web service. You can find the pregnancy calendar web service here. I wasn’t able to add any animations to the application because I decided to concentrate in adding functionality to app rather than the eye candy’ With that said, I’ll be posting the non-10K application this week.

Be sure to comeback on this blog in the coming weeks because I’ll be publishing the source code to both project soon together with a 11 part tutorial and screencast walkthrough that i have prepared to show how to to build an application using .NET 3.5, WCF, WPF and Silverlight.