Pages

Monday, July 16, 2012

Part 1: Let's talk about WCF

This will start a series about moving WCF configuration out of the typical application configuration files that are generated by Visual Studio and putting it somewhere, anywhere else, that is atypical of most systems. In this case, I will be showing how I was able to move it into a database.

You might ask why do this? For starters, this was a project for work. I fully support what this project's intentions and purpose was because it simplifies my life and the life customer support and the customers, even though there may exist people who will cringe at this (probably technical people who would see this as a bad idea, but see the disclaimer). Basically, the goal was to have a single point of configuration which would minimize work that would have to be done across multiple machines which share the same configuration, but each having its own copy.

For those new to WCF, it is Windows Communication Foundation. It's a framework for creating services, mostly web services and enterprise, and it's based on a client-server model. The server defines the operation contract, that is, what operations does the client have access to; and the data contract, that is, the data model the client and server expect from each other when communicating. In layman's terms, it's basically the server saying "We will communicate by speaking English and here are the commands and queries I will allow you to use". You can find the Microsoft page discussing WCF here.

So that's the very brief introduction. Next time, I'll go over the database side of things and what the application configuration looked like before and after I made my changes.

Disclaimer: I have limited knowledge of WCF in and of itself; I've done enough to know when something will work or when I should ask more questions. There could be design or security flaws in what I am doing here, but unfortunately for me, there was next to nothing about this on the Internet and at the moment there is nobody else on my team who understands WCF to this level. Also, my WCF intro could be completely wrong; if so I apologize for that. That being said, I welcome constructive criticism of my design decisions regarding this project (not my lack of WCF knowledge); post those in the comments.

Thursday, May 24, 2012

On PA bicycle laws

Apparently May is Bicycle Safety Month. So today will about the PA bicycle laws. The laws and summary of the changes enacted in April can be found here and here.

Let's talk about vehicle safety. I say "vehicle" because cyclists are considered vehicles on the road, thus responsible for following all road signs and having all the rights of motorists.

I got into a semi-heated debate with a friend at work over cyclists after mentioning how, as a cyclist, rampant cell phone use freaks me out. He responded saying he would respect cyclists when he sees them follow road signs. While as a motorist I understand where he comes from, the cyclist in me says there are motorists that do the same thing. I see cars that coast through stops signs more often than I do not follow a road sign. But this isn't a forum for a motorist vs. cyclist debate as both have the same responsibilities when it comes to safe transportation.

I think the most important of the new bicycle laws are the two which require motorists to provide a 4-foot cushion when passing a cyclist and putting motorists turning right, which would cut off a cyclist going straight, at fault. Even though cyclists may impede the flow of traffic, a cyclist may take the lane if his safety requires it. It is interesting to note that cyclists are not required to use the shoulder of a road. Personally, I stay as close to right as possible except for two occasions. The first occasion is if I am going around a right-hand curve where I have no view of the road up ahead. The second is when there is an obstruction extending into the road such as a tree or a car if I am riding through town. Many motorists think cyclists should use the sidewalks, however in many places riding on the sidewalk is illegal, mostly in business districts due to foot traffic. The new law does give motorists permission to cross over into the left lane in order to pass, provided the flow of traffic in the opposing direction allows it.

The second law makes it illegal to make a right turn which cuts off a cyclist. From observation, I can see this happening at intersections, however I have not personally been cut off. In general I will ride to the line at an intersection if there is no traffic or the traffic is moving straight. If cars are already at the intersection and are turning right, I yield to them. There is one occasion where I may not follow those rules, and that is if motorists are not signalling to turn. As motorists expect cyclists to signal their intentions, I expect the same from courtesy from motorists. Yes, I know there are inconsiderate cyclists out there, and I may even be one of them from time to time. I expect to be given the same courtesy a driver would give any other driver since the laws give me that right.

I will leave you with the Wikipedia page for hand signals which cyclists AND motorists are expected to know as these are to be used by motorists as well in situations where signalling lights to not work.

Tuesday, March 20, 2012

First Day of Spring

Wow, I haven't posted in a while. I'm going to have to get better at this blogging thing. Anyway, it's the Spring Equinox which was a soft-line goal for one of my New Year's resolutions. I didn't reach the goal, but I'm on my way.

Because of the warm weather, I've been able to bike to work fairly regularly which I plan to keep up, rain or shine (I hope). I've also added strength training to my workout regimen as well. Here's to reaching goals!

On another note, a new law banning texting while driving went into effect a couple weeks ago. While I personally don't text while driving, I know people who will and it freaks me out when they do it while I'm a passenger. While many news sources jumped on the "studies show texting ban ineffective" bandwagon, I was unable to find any citations for these studies. The best I was able to come up with was here and based on my glossing over of that document, it seemed that the frequency of accidents after the bans had taken effect had not really changed all that drastically. While it's somewhat true that the number of accidents hasn't decreased, it's important to note that they haven't skyrocketed either.

There are several issues around the ban. First of all, there is the issue of enforcement. The law prohibits the sending, reading, or writing of text messages on any "Interactive Wireless Communication Device" (http://www.drivinglaws.org/pa-laws.php). Does a police officer now have the right to search my phone's texting history (which would raise other issues if it is the case)? How does a police officer know that a driver is texting and not entering a phone number? Reading various comments on news sites tell that officers rarely enforced even the complete cell phone bans and would themselves not follow the bans (again, reader comments, take with a grain of salt).

Second is how the law is defined. What makes texting any different than calling? On top of that, why is it that it is the explicit sending of data which makes up the text and not the act of interacting with a phone at all? This law even bans text messages sent via voice recognition applications such as Siri. So I can hold the phone to my head to talk to my brother, but talking with the intent of sending a text in which I am in no contact with the phone means I'm breaking the law?

I'm sure there are other issues, but I don't have time to go through them all right now. While I question the motivation of this law, my goal is to make people pay aware to the dangers of distracted driving in general, whether it's texting, calling, messing with MP3 players, GPS units, whatever. This was a big concern of mine when all I did was drive, but now that I am on the roads as a cyclist, it is even more so.

As a final note, I'll leave you with the PA cycling laws which all PA drivers should know. http://www.dot.state.pa.us/bike/web/bikelaws.htm

Tuesday, February 14, 2012

Irish potato candy

Today's recipe for Irish potato candy was my first real attempt in which I did not have a concrete recipe. I knew the ingredients I would use, but I did not have a list of measures of each ingredient. This may sound scary to some, but experimentation is fun!

Irish potato candy is a Phily thing, there's even a Wikipedia article about it: http://en.wikipedia.org/wiki/Irish_potato_candy. There are many variations, but most don't require any baking so it seems like something that anyone can make.

The ingredients:
  • One large potato
  • One package shredded coconut
  • One bag powdered sugar
  • Cinnamon
  • Butter
  • Vanilla
First, cut the potato into small cubes and boil it. When it's done, you need to mash it with butter. I used about 2 tablespoons.

After the potato is mashed, add about 1 tsp vanilla and start adding sugar. Technically, you should be adding the powdered sugar until it's a consistency which is easy to roll; that's a lot of sugar. I used about 3/4 of a 2 lb bag and it was fairly sticky, so don't be afraid to add more.

Once it has reached the appropriate consistency, add in the bag of coconut. I used a 2 lb bag. At this point, you should pour some cinnamon in a small bowl and start rolling the mixture into little balls that look like peeled potatoes. After they are rolled, sprinkle them with cinnamon or roll them in the bowl of cinnamon to coat them.

That's pretty much all there is to the recipe. I let mine sit in the fridge overnight to cool and stiffen up and I sat them on wax paper, but I used less sugar than the recipe called for so mine were a bit sticky.

If you want, you can use cream cheese instead of potato, but feel free to experiment. Happy cooking!

Tuesday, January 17, 2012

Sugar and caffeine on the cheap

I hate leftover candy canes. They are nice to have at Christmas, but everyone always buys a ton of them and they either sit in a cabinet until the next Christmas or get thrown out after someone realizes they have sat in a cabinet for six months.

But I have a solution to this problem:
Mint Mocha

For this you will need one packet of hot cocoa mix, one cup of coffee, and one candy cane. Just mix the coffee and hot cocoa then add the candy cane. Or, if you are like me, save yourself from dirtying silverware and mix the coffee and cocoa WITH the candy cane speeding up the process.

The candy cane will eventually dissolve and turn your coffee into a tasty, sugar filled, and caffeinated deliciousness that is mint mocha. And you can relax in knowing you did not spend $3 or more per drink at Starbucks or some other coffee establishment.

Sunday, January 1, 2012

Todo for 2012

Well, 2011 has come and gone. I don't even remember what my resolutions were; there's a good chance that whatever they were, I didn't accomplish them. So let's make a list of what I would like to accomplish in 2012.

Drop body weight to under 200 lbs. This should not be terribly difficult. Currently, I am at 220 or 225. It's been fairly regular there since I graduated. In fact, it should be no problem to reach this by the Spring equinox.

Workout regularly. Again, shouldn't be terribly difficult. I already try to exercise regularly, but it's tough in the winter especially on a tight budget when I do not want a membership at a gym. My goal is 3 or more days a week of intense exercise. Once more hours of daylight are available I will starting bicycling to work again. Until then, I plan to do interval training and calisthenics during lunch on alternating days.

Learn a new instrument. I would like to learn more guitar, but re-learning to play piano is another option. I have a ton of music that I snagged from church services which doesn't look too difficult, and I think the biggest difficulty will be learning and remembering chords. This will be more of a challenge, especially because of the next goal.

Professional advancement. This is fairly open ended. To start, I am going to complete the Microsoft Certified Professional Developer for applications developers. If possible, I will try to complete the web developer path as well since it is two extra exams than the applications developer one, really only one since the other is the final exam. And if possible, I want to try to get into a graduate program.

Go shooting regularly. There is really no reason for me not to do this. I have a .22 rifle and there is a free shooting range a short drive away. I plan on getting a new shotgun since there is a club which has open trap on Friday nights for a reasonable price. In terms of pistol, I would like to take a safety course and perhaps buy one. I have my license to carry, but if I do purchase, I would not feel comfortable carrying without more practice and completing a handgun safety course.

Write a practical program for personal use. Again, this I should have done a long time ago. I had plans to write a web application for recipes, but that never happened because of video games and studying for the MPCD. I will still try to write the recipe application, but I haven't looked at it for a while.

Play less video games. This will probably be the toughest resolution, what with Elder Scrolls V: Skyrim, Minecraft, Portal 2, Sid Meier's Civilization 5, and a whole lot of other games on my computer right now. Again, pretty open ended, but if I can keep it to one or two nights a week for no more than 2 hours, I will be happy.

Sunday, October 23, 2011

Upcoming project - online recipe book

In my quest for expanding my culinary horizons, I have come to the realization that all my recipes exist in the form of a stack of folded papers, index cards, and miscellaneous clippings from various food packages and that all of these recipes are in no sort of order. They are not even in order by when I first made them since I shuffle them around when searching for a certain recipe which I plan to use.

While there exist solutions to this problem in the form of binders or little index card boxes, I either need to memorize recipes or have the physical medium present in order to view the recipe. Therefore, I am taking it upon myself to create website which will have the sole purpose (originally) of storing recipes.

You are probably thinking, why go to all that trouble? Well, for one, it would be a fun project for me to do in order to learn a new technology, as well as something that would have a practical purpose after its completion. As well as learning about the software life cycle from planning to deployment and maintenance. I also want to use this project as an opportunity for learning about different software management methodologies, the pros and cons of each, and the implications each style would have on a software product.

My hope is to have the site hosted for others to use as well and eventually add features, such as sending recipes between users. Because I will be planning the project on a per feature basis, I don't have a solid deployment date. My estimate is by mid-December I will have the first version ready to deploy.

Anyway, I don't expect everyone to understand the previous two paragraphs since some of it is industry jargon. However, if this is something that you would use, stay tuned for updates about the progress of this project.