Archive

Archive for the ‘General’ Category

Character Sets Having Trouble With An Apostrophe

February 10th, 2010

In the past I had read Joel Spolsky’s article over character sets. Occasionally I run into a problem where certain characters do not show correctly, but for the most part I do nothing about it as I can determine what the word or letter is suppose to be.

At one my previous client location, I was lucky enough to have a broken test. This struck me as odd, as it was only one test and not many. It was on a fresh install of Ubuntu and I assumed I had something out of place relating to configuration. I spent roughly four hours tracking down the problem and finally determined that Ubuntu was set to use UTF-8 and the development and deployment environments where meant to run as 8859, the Windows default encoding.

So when will you change? Dave Ramsey said “Most people won’t change until the pain of where they are exceeds the pain of the change“, well I hit that point. I have begun to learn a little more about the funny looking ‘?’ symbols shown when I expect something else.

The article which I was reading happened to be something referenced from Wikipedia. I’m not sure how this will show up as I would expect someone to correct the issue, but the following are some cropped images of how it looked on a WindowsXP box (they look the same on Mac using FireFox, Chrome, and Safari):
Safari

Internet Explorer

FireFox

Chrome

The character is obviously an apostrophe, but saving the source out and viewing the value shows 0222/0×92/146 (1001 0010 binary, take your pick). The encoding of the page is set to 8859-2, which Firefox sets the page to correctly … but of course this shows the question mark in the diamond shape. When I override the default encoding and change it to 8859-1 then it shows fine.

I thought that I had it all figured out at this point. This is an easy case right? The encoding is just wrong, in that it shouldn’t be 8859-2, but 8859-1. Well if you look through the 8859-1 character set, there is not any apostrophe near 146 (side note: if you don’t know how to use an apostrophe or unsure on some parts, then The Oatmeal has an awesome explanation). I tried many combinations to try and get something to calculate out, such as dropping the most significant bit which would leave me with 18 decimal. But I could never get close to what an apostrophe should be showing as.

As it turns out, according to this article:

ISO-8859-1 explicitly does not define displayable characters for positions 0-31 and 127-159, and the HTML standard does not allow those to be used for displayable characters.

So it seems like no browser should show anything for that character.

So the question still remains, why does switching the encoding to 8859-1 make Firefox show it right?

Shockingly, Wikipedia to the rescue:

It is very common to mislabel text data with the charset label ISO-8859-1, even though the data is really Windows-1252 encoded. In Windows-1252, codes between 0×80 and 0×9F are used for letters and punctuation, whereas they are control codes in ISO-8859-1. Many web browsers and e-mail clients will interpret ISO-8859-1 control codes as Windows-1252 characters in order to accommodate such mislabeling but it is not standard behaviour and care should be taken to avoid generating these characters in ISO-8859-1 labeled content. However, the draft HTML 5 specification requires that documents advertised as ISO-8859-1 actually be parsed with the Windows-1252 encoding.

So FireFox, upon being told of using the 8859-1 character set instead of the declared 8859-2, notices this mistake and displays it as the Windows-1252 encoding. Doing so the apostrophe finally shows up in correct fashion.

I believe I’m going to enjoy this journey down the Character Set Path.

I must acknowledge Paul Carter, as he pointed out the article from Wikipedia.

Author: gorshing Categories: General Tags:

Using the blank constraint in Grails

November 29th, 2009

I have just begun using Grails for Less Out and have been accustomed to using the ‘def’ keyword when declaring any variables. I really don’t have any particular reason in doing it this way, I just wanted to use the features of Groovy when ever possible … when in Rome.

This past weekend I was working on an Action which is passed a Command, the Command has a few constraints and one of them was:

static constraints = { 
  name blank:false, nullable:false 
}

This is pretty harmless, but I was not able to get a test to pass. I was never able to get the blank constraint to fail.

I then started to hunt through the Grails source code and found the BlankConstraint source. More specifically, I think the culprit (somebody please prove me wrong here) is the ‘supports’ method.

public boolean supports(Class type) {
        return type != null && String.class.isAssignableFrom(type);
 
}

One thing I left out is I declared the ‘name’ variable as:

def name

The ‘supports’ method checks if String is assignable from the passed in type, and since you can think of def as an Object (documentation) then the method will return false.

Once I changed my declaration to:

String name

Then all my test validations worked correctly.

I could see how Grails would not want to throw an exception in this scenario (especially given this late in the game) but I log statement stating it is skipping over this contraints would be very much appreciated.

Author: gorshing Categories: General Tags:

Gossip According to Dave Ramsey

September 7th, 2009

I regularly listen to ‘The Dave Ramsey’ on my iPod and thought his rant on gossip in the work place was a pretty good piece.

How do you incorporate a no-gossip policy at work? (mp3 download 5.54MB 6 minutes)

Author: gorshing Categories: General Tags:

My Version of Qdoba’s Mexican Gumbo

August 25th, 2009

Although I feel ‘gumbo’ is a misnomer in this recipe, this is what my wife and I have been cooking for almost a year now. This is very similar to Qdoba’s (Qdoba Mexican Grill) recipe.

Ingredients:
2 cups cooked rice
1 can black beans, drained and rinsed
2-4 chicken breasts, grilled and sliced
1 pkg. Williams Country Store Tortilla Soup
1 can diced tomatoes (Rotel)
pico de gallo
sour cream
tortilla strips or tortilla chips (optional)

Notes:
Some people may like only two cups of rice but I use 3 cups, use your discretion on whether to use minute rice or real rice. I use Riceland in my rice cooker (http://www.amazon.com/gp/product/B0009E3F68/ref=ox_ya_oh_product). We also use an additional can of Bush’s black beans. For marinading the chicken we use whatever we have, sometimes we even grill it without any marinade/rub. I like the Williams Country Store Tortilla soup better than the Bear Creek, but you might try both of them and decide for yourself.

Get the chicken on the grill and soup going at the same time (saves time). When cooking the tortilla soup I add more water than it calls for, but other than that just follow the directions on the bag. Once the soup is done cooking, I dump in the beans and the chicken breasts (cut up in chunks). I keep the rice separate from the soup so people can serve their own desired ratios.

I like eating this all by itself and don’t use the pico, sour cream, and strips. But most people add up on this stuff, needless to say guacamole is fine too.

Author: gorshing Categories: General Tags:

Motherly Embrace of Process

May 6th, 2009

Today I was reading an article by Dave Nicolette and the following caught my eye: “Many people really, really want to curl up in the motherly embrace of Process”. I feel that typically most people do want this and therein lies the problem.

I wouldn’t want to believe this either, but I have been reading Influence by Robert B. Cialdini and in Chapter 6 he talks about “Authority – Directed Deference”. In this Dr. Cialdini references multiple studies done where people basically blindly follow what an established authority figure does or says. These are as simple as more people follow, what seems to be, an established business man across a street and progress up to nurses doing exactly what they think the doctor said (like putting ear drops into a patients R ear; the nurse interrupts this as rear and actually performs the administration of the medicine).

The team I have been working with since the beginning of the year has recently undergone a dramatic change in the developers on the team. There is currently only two other Valtech consultants along with myself, the others are employees of our client. On occasion management has told us exactly what we must do. One specific instance was a ‘mandate’ that we do not check in code against a single project for four days. I hope you understand how absurd this is. There were a few people who complied immediately, it seems like they felt it was the only way to deal with the situation. A few of my coworkers gently pointed out how bad of an idea it was, and a solution was agreed upon which helped out multiple teams.

It seems to me that most people will agree with ‘authority’ and it doesn’t really matter if this authority figure is real or make believe. People will continue to believe in the ‘process’ as this is the authority on the subject matter and must not be questioned (in their frame of mind). We who still believe in Agile Development will still have an up hill battle on our hands to coax people into believing there is a separate way to development software.

Author: gorshing Categories: General Tags:

Making Decisions in Small Iterations

March 7th, 2009

Earlier this year the New York Jets announced they had hired Rex Ryan as the new head coach. I have personally meet Rex on a couple of occasions so I have followed along and read many articles and comments about Rex’s decision. One gentleman in particular criticized for leaving the Ravens so quickly after the season was over; he felt as though the decision was made too hastily.

I have read about the different ways people react to circumstances, one way in classifying people is by using the DISC assessment. There are plenty of people which reside in the conscientious, meaning they will take in all sides to a story and put careful thought into what their decision is going to be. As you can obviously tell, this doesn’t play out to well for somebody in leading a professional football team. They will need to make quick decisions, otherwise, the game will be over … and probably their career. Rex knows the business of football tremendously better than any of us (I’m sure some people out there will debate that thought), and he knows exactly what he wants. He doesn’t need to take time to make a decision, he already knows what he is going after. It isn’t all that difficult to know what to do when you know what you are going after.

With Agile development this seems to carry over, the team has a common goal and we all are quick to make a decision, if we do not like what we have decided upon, then we will make another. By having small (one week) iterations this is possible and it allows us to identify the pain and adjust for it accordingly.

When I first heard about having one week iterations, I thought somebody had lost their mind. I didn’t feel as though much of anything could be accomplished. On the contrary it is very apparent of the progress getting made. We are also quick to make a decision for the sole reason of not having to live with the side effects for very long if something is not working.

Retrospectives also play a key role in this, as other team members bring to light a pain point which I was oblivious to. The reasons for myself not noticing these things are many, one of the more common is simply because they are at a different place in the project than I am. They are ahead of the pack and before I continue on and begin to feel the same pain, they identify the problem and a decision is made of what to do. On occasion a previous decision made in an earlier iteration is noted as not working as expected, we are then able to adapt quickly and change to get our work environment productive.

Author: gorshing Categories: General Tags:

This I have done

February 9th, 2009

It seems to me this should apply to most people. I do not think I have lived by its standard, maybe it is now time for me to walk the walk.

I Do Not Choose to Be a Common Man

It is my right to be uncommon—if I can.

I seek opportunity—not security. I do not wish to be a kept citizen, humbled and dulled by having the state look after me.

I want to take the calculated risk; to dream and to build, to fail and to succeed.

I refuse to barter incentive for a dole. I prefer the challenges of life to the guaranteed existence; the thrill of fulfillment to the stale calm of utopia.

I will not trade freedom for beneficence nor my dignity for a handout. I will never cower before any master nor bend to any threat.

It is my heritage to stand erect, proud and unafraid; to think and act for myself, enjoy the benefit of my creations and to face the world boldly and say, “This I have done.”

By Dean Alfange

Author: gorshing Categories: General Tags:

Take Care of Business

January 13th, 2009

I have begun (about a year ago) to appreciate quotes and saw this one tonight:

You can’t wait for inspiration. You have to go after it with a club. – Jack London

So what is important to you? Go do that right now and stop reading this.

Author: gorshing Categories: General Tags:

We Need Their Money

October 31st, 2008

During a recent lunch outing a discussion came up about one of our clients who doesn’t have enough money for a particular technology related item, but other renovations are happening and people within the group are getting mad. Of course the discussion turned to what all was set forth in the budget and how the IT division was hurting. The typical response is all too common, “There is a pot full of money over there, but we can’t touch it.”

We as programmers need to understand the business side of things, one of which is budgeting. I have made the mistake of assuming everybody is familiar with budget; not only just what they are in general but truly how to use one. Most people understand a budget is used to assign a name for a certain amount of monies, but some of the key ideas behind using a budget is you track throughout a specified time what you actually spend and most important of all the ability to adjust the budget the next time around.

I would like to touch lightly on the first point. If I were to put myself on a diet, I would start out with two things: to write down what I plan on eating, and then to write down what I actually eat. This makes it easier to see if I am really following what I had originally set out to do. Living by a budget is very similar. You absolutely must keep track of what you actually spend, otherwise assigning categories does not do any good. With this said there are key instances where adjusting the budget is crucial.

My wife and I have staunchly lived off of a budget for almost two years. At the end of every month we come together as a couple and decide how we will spend our money for the following month as well as to review the current month’s budget to see how well we did (see which categories we were either short or long on). There are few cases where we have to go over a category in our budget. We have identified a few categories which we deem critical, this means we will (and have) moved money from a noncritical category to the critical category. To get back on topic, in the business world few categories, IT included, are not a critical category and as such it will be difficult to get money moved over to the IT budget.

I view this as a good thing to have in place, I would definitely be in a bad mood to learn some of the IT monies which are needed and instead to be used to make a new awning or some other basically useless item. Developers need to appreciate this particular ‘red tape’ as it is a protection put in place for the company.

With all that said, it is also something we must learn to negotiate with. I do feel most of our needs (note: I did not say wants) are legitimate and came before others. How to battle this bureaucracy is subjective which I will not get into, and this differs dramatically from organization to organization, but is something we must learn to accomplish.

Author: gorshing Categories: General Tags:

Do You Completely Understand?

September 26th, 2008

Almost on a weekly basis I get frustrated at other technical people because they do not see value in the things I see value in, or the miss the point. I am quick to judge them and point my finger at them for the blame. Through my recreational reading I have come to believe it is none other than my own doing.

Mark Cuban points out that you do not deserve his time if you are quick to respond with “you just don’t get it”. As he explains it, you are the one at fault if find yourself using this phrase. You must completely understand a subject in order to explain it to other people, then if still feel yourself falling back to the aforementioned phrase that is a tell-tale sign you do not completely grasped the subject you are explaining.

Reginald Braithwaite says the single most important thing to improve your programming career is to give presentations. This is something just recently I have truly enjoyed attending (within the last year). I completely agree with this and feel most presentations I have seen, the presenter either does not completely understand the problem at hand nor do they feel motivated by the topic. My understanding and appreciation of these individuals and what they go through has had a major turn around. I have had the fortunate opportunity of knowing on a personal level a few people who have presented items at my local JUG.

I would like to encourage others to present topics as well. So many people feel as though they do not fully understand a topic as well as others; and this is true. There are few, if any, topics I know better than anybody else, however; this is about improving yourself as a developer and I know first hand your local SIG (special interest group) would be excited to have more people provide presentations.

Author: gorshing Categories: General Tags: