-
Global Resource strings by property
Posted on April 15th, 2010 No commentsEvery now and then I come across a bunch of string literals littered through out some code and begin the task of moving them out into their own resource file (.resx).
Gaining access to these strings from C# is pretty easy however I’m yet to find anywhere explaining it the way I find simplest.
Assuming your resx file is stored in the App_GlobalResources folder, you can basically assign your resource file to a variable in your C# using the following syntax:
using Res = Resources.MyResourceFile
This then gives you the ability to referene the contents of the resource file as properties in your code.
string x = Res.OneOfMyStringNames;
-
Algorithmic Thinking
Posted on April 16th, 2009 No comments
al⋅go⋅rithm [al-guh-rith-uhm]
–noun
a set of rules for solving a problem in a finite number of steps, as for finding the greatest common divisor.Dictionary.com Unabridged
Based on the Random House Dictionary, © Random House, Inc. 2009.One of the greatest things I’ve found about the work I do is that concepts from one field often tend to automatically map over to work I do in other contexts. When I first learned about Object Orientated Programming, I started to see the world in terms of objects. I’d look at the TV and think “hmm, the TV has XY and Z properties and these methods exist for doing those things and if event q happens, method k gets fired”.
These things tend to mellow out after a short period of time but it’s hard to learn anything without it becoming part of what you do and how you operate. The more things you learn the more choices you have about what behaviours you exhibit and this leads me to the idea of Algorithmic Thinking.
As programmers, we all know about algorithms and their importance in software engineering but what about in the rest of the world. Since the idea of algorithms isn’t one from programming but one from mathematics, and mathematics being the way in which we model the world around us, it makes sense for us to take our knowledge of algorithms and to begin thinking about other things in a similar way.
One of the great things I love about algorithms is that they’re implementation neutral. That is, the algorithm defines the finite series of steps to follow to get result x but it doesn’t tell you how you should implement those steps. That’s part of being creative and artistic and the more of each of those you are, the more exciting it becomes to figure out new ways of doing lots of different things.
Every now and then I spend a little bit of time thinking completely algorithmically so that I can more easily build up that part of my brain that deals with problem solving. If I have the cook dinner, what algorithm am I going to use? Maybe I’ll come up with three or four different ones and then pick that one that best suits what I want.
Then I get to implement that algorithm and figure out different ways I’m going to go about that. If step one is to get the ingredients out of ther cupboard how am I going to implement that behaviour? Will I simply walk up and get them out? Maybe I’ll climb up a small step ladder to reach? Perhaps I’m going to put some music on and dance my way over to the kitchen? The beauty in this part is that you get to be as creative as you can imagine.
I tend to think of things in terms of puzzles, whether it’s cooking a meal, writing a computer program or simply figuring out what’s going to come next in a movie. Part of my love for being on this planet is our ability as humans to solve puzzles and problems and to always be creating new ways of doing things.
I’m interested in what kinds of fun algorithms people can come up with for every day tasks. Whatcha got?
-
User Stories
Posted on April 6th, 2009 2 commentsUser stories are an integral part of Agile but how come?
When I was first introduced to the idea of using user stories in a commercial environment I didn’t really know what they were. I’d seen some other people using them and noticed that they seemed to be a breakdown of what was needed for a given system and then the developers would pick up one story at a time and work on it. “Marvelous!” I thought, but what’s the point?
-
Mixed Language Artist – MLA
Posted on April 2nd, 2009 2 commentsIn the martial arts world, the idea of Mixed Martial Arts is something that’s been around for hundreds of years. The past ten years has seen a huge uptake in the concept with many more martial artists now choosing the mixed martial arts over their former singular and less eclectic predecessors. This increase in interest has been helped with televised competitions such as UFC.
The main reason for this is that each art has it’s own strengths and weaknesses. Some arts are good for distance fighting, some for close range, some are better than others at ground work and some have better defensive maneuvers than others.
-
Utilisation – It’s wheel’y important
Posted on March 27th, 2009 2 commentsThere’s a saying that people have, “Don’t re-invent the wheel”, and as much as this article isn’t about wheels, I think it’s a useful phrase.
Usually in the technology world when we talk about utilisation, or more specifically in the software engineering world, we’re usually talking about some form of code re-use. Re-using code in a project is almost a no-brainer but there’s another side to utilisation that’s not so often talked about. This is the type of utilisation I simply call “using what’s out there”.


