Posts

Showing posts with the label Development

What were they thinking

Image
As of late I have been spending a lot of time working on a “legacy” system. The term legacy means different things for different groups, in the circle I’m working with these days it means a system that is no longer being actively developed. As has been stated by mean, software isn’t “dead” it’s “done”. The catalyst for the work I’m doing is security requirements that need to be applied. While applying the updated security polices I’ve also been tasked with migrating the system from our data center to our cloud data center. As I move through the system I’m confronted with implementations that looking at now seem crazy; however, it’s these situations where it is important to apply two mindsets. One is giving others the benefit of the doubt. In a case like this, those that were working on this system used, for the time, the best options the technology stack could offer. For example, the extensive use of WCF seems silly now; however, at the time it was a recommended approach to hooki...

Benefits of Working with .NET ConcurrentQueue<T>

Image
* Working with a queue in .NET is an excellent experience and provides a great way to decouple execution paths. Once you start working with in memory queues your just a hope, skip, and a jump away from using "infrastructure" queues such as Service Bus, RabbitMQ, or even MSMQ on Windows Desktop. While it is quite possible to work with the standard .NET Queue<T> object if you find that you are in need of using a lock to ensure consistent results with putting things in the queue (i.e. Enqueue) and taking things off (i.e Dequeue or Peek) or even just to obtain a consistent reliable count, well then you should probably take a look at ConcurrentQueue<T> . There is a whole section of the .NET Framework with deals with concurrency concerns by creating specific objects for Dictionaries, Stacks, Queues and more that are considered thread safe. When I started working with ConcurrentQueues I found it helpful to put my own wrapper around the concurrent queue object and...

Things I need to remember... IIS Express ports for HTTPS and Configure WCF Rest endpoints for HTTPS

Image
As I have been writing consistently for a bit now I've already found myself referring back to things I've posted, which has prompted me to try and post items which have taken a bit of time to work out. It seems that the act of "writing it down" causes me to remember information better. Perhaps it's all the thought into attempting to write something useful. This post includes two details which took me more than a few hours to sort out so I hope to help others who have a similar need. Funny enough it could be me in the future after I've forgotten this information. First up is a little detail that I know I've forgotten and looked up more than once, and depending on the google/bing results I find sooner or later. Setting up IIS Express to host a site via HTTPS When configuring your site to run in IIS Express using Visual Studio it's fairly trivial to set the attribute to use SSL (i.e. HTTP over SSL which is HTTPS) as it's just an ...

.NET MSTest and DeploymentItem Attribute

Image
I was recently reminded that order of operation can byte you when trying to troubleshoot intermittent unit test failures. First, I’ll be the first to admit that if you want to avoid problems with unit testing it’s best to avoid any dependency outside of your actual code base, things like databases, API and even the file system are best avoided in execution of your unit tests. That last one, the file system, in some applications is really hard to avoid. If you happen to be using MSTest, a helpful attribute for your test is DeploymentItem. This particular attribute allows you to define a file within your unit test project assuming it’s marked as “Copy Always”. With this attribute in place you can then combine this with TestContext.DeploymentDirectory to find this sample file and then do what you need to do. In my particular case I was having an issue with the unit tests failing on the build machine but not locally. After stumbling around for a bit I finally feel back to t...

HTTP BIN - Developer Tools

Image
One of my favorite tools in my 10 in 1 screwdriver. The appeal is that in a single tool, just by flipping some pieces around you have just what you are looking for. In many minor jobs around the house I can do everything needed just with this single tool. When writing software you can find similar valuable tools and one such valuable tool is http://httpbin.org Like with most tools, the simplicity can be deceptive because how hard could it be to have an API that just echo's back what you sent. But then that is what is so great about httpbin, it's done and it's very robust. By way of example, when building a front-end you may find that the API isn't complete and thus you want to "stub out" the calls. With httpbin you can send a call such that it echo's back what you want and thus you are wiring up to an actual HTTP call. On the server side you might have the same need to wire up to a service that isn't something you are allowed to call fr...

Talk to the Rubber Duck

Image
*See attribution of image at the bottom. One of the greatest tricks I have had the pleasure of participating in is that of helping someone solve a problem simply by listening. I'm sure there is a more accurate description of this phenomenon, but in the world of programming it's called Rubber Duck Debugging . I was first introduced to this idea from listening to Jeff Atwood podcasts/interviews as well as reading his blog under CodingHorror.com  he wrote about the topic under the title Ruber Duck Problem Solving . Why the term Rubber Duck? Really it has nothing to do with the rubber duck, the intent is to encourage someone to solve their own problems by working through the very difficult challenge of describing what the problem actually is. It is often surprising to people when they discover that simply the act of attempting to describe a problem helps them to find the answer they were looking for. So my approach to assist others is by asking questions that I often ask...

There is NEVER one person working on your code

Image
Alternate Title: Avoid “Black Boxes” and “Works on my Machine” Even when working on a project by yourself it is important to try and create a build script that will “fully” build your project with a single click. But, you may be asking, why would I bother with a build script if there is only one person working on the project? Well the reality is that there is NEVER one person that works on a project. There may only be one person working on a project at a given point in time, but if the project succeeds (a.k.a. it has additional releases in the future) there will be other developers involved. Either a future developer will work on the project on their own, or additional developers will join in. I’m of the opinion that the latter is far more likely if a build script already exists and those other developers will thank you (as would I) that they have some transparency into how the code should be orchestrated for a deployment or in other words avoid the “black box” problem. In a...

Don't leave your users hanging

Image
command prompt can show actions as they are taken If you create software one of the worst experiences you can create for your users is the "hanging" dialog. Recently I obtained a somewhat older MP3 player; to be specific it is a SanDisk Sansa Express 2GB. The device itself is on pair with most MP3 players that are not an iPod. One interesting feature is that you can record from the radio and it just so happen that the weekend past I had a need to record some audio from an FM station being used to broadcast at an assembly I was attending. To skip to the interesting point I found myself attempting to install new firmware to make it possible to listed to the WAV files created from the recording. After installing something to install something else (can you say inception) I found myself in a state of frustration because it "seemed" like the firmware update was going through just fine; however, the dialog box which indicates the progress had been "seemingly...

Why we have to "Ask Why"

Image
I'm always interested to find personality traits that seem to be common to "smart" people. When I use the term "smart" I don't mean to imply that they have some knowledge that is unattainable by others, also I don't mean to imply that they are more intelligent than the average person (although I suspect that if we were going off IQ that could be true). To be clear, I don't typically include myself in the "smart" category, I tend to think that I just happen to have a good memory which gives the impression of being smart, as well as being prone to asking the question why, which I have observed as being a trait of "smart" people. When people passively accept information that is given them without asking the question why, the result is often that the person receiving the information winds up with only a cursory understanding of the subject matter. In some cases I would completely agree that the "right approach" is to onl...

People are dumb (like me)... A person is smart (like me).

Image
In the 1997 summer blockbuster "Men in Black" the two main characters, played by Will Smith and Tommy Lee Jones, discussed the capabilities of groups of people and individuals. Will Smith's character suggested that it would be safe to tell the entire earth about Aliens, saying "people are smart..." they can handle it. Tommy Lee's character responds "a person is smart, people are dumb..." which implies that while a person is capable, but as a whole people are not. In general I tend to disagree with the idea that the majority of people are dumb, stupid or some other negative quality. I strongly believe that the vast majority of people are very capable and given the right circumstance they are able to surprise, delight and in general exceed most expectations. However, keeping in mind that the "squeaky wheel gets the oil" or in other words the most vocal people get the attention, it seems for some reason that the most vocal people also tend t...

Why I HAD to install Linux

Image
Recently I've decided to pick up a new programming language. My reasons are mostly not wanting to be hacking away at legacy code for another 5 years. I've already started to realize that in my young programming career I'm already getting behind the curve in the programming world. In any case I decided to work with a few colleagues on a side project, not that we have a project per se, just a few general ideas and a desire to make things. Part of our goal with this project is to learn various aspects of newer technologies, Pearl, Python, GIT, Tornado, etc. At first I was under the impression that learning these various language/technologies would not require me to change my default OS Windows (currently split between windows 7 on my desktop and windows XP on my laptop). However, even being comfortable with the command line on windows I was finding that as I read various sites discussing approach and technique for these newer tools I was feeling like a second cla...