Things you learn on a road trip

May 25th, 2010 § Leave a Comment

I went on a road trip to Minneapolis MN to attend a friend’s graduation.

1. On the road, I was chatting with my buddy, a chemical engineer, and we hit a fog, and he started explaining to me how a fog gets created. He got deep into the thermodynamics, but it mostly fizzled away from my head. What I do remember was something along the lines of the the cold ground absorbing the kinetic energy in the atmosphere. So I went to Wikipedia to learn more about it, and it turned out he was describing a combination of Radiation Fog and Ground Fog:

Radiation fog is formed by the cooling of land after sunset by thermal radiation in calm conditions with clear sky. The cool ground produces condensation in the nearby air by heat conduction. In perfect calm the fog layer can be less than a meter deep but turbulence can promote a thicker layer. Radiation fogs occur at night, and usually do not last long after sunrise. Radiation fog is common in autumn, and early winter. Examples of this phenomenon include the Tule fog.[8]

Ground fog is fog that obscures less than 60% of the sky and does not extend to the base of any overhead clouds. However, the term is sometimes used to refer to radiation fog.

2. The Capital of Iowa is Des Moines

3. We encountered quite a few exits for US Hwy 69 and began to wonder why. Well, it turns out the southern tip is in Texas, and the route goes all the way to Minnesota.

4. Chips, tomato sauce, both for here and to go (note to myself – feel free to ask about it)

Concepts that are new to me, borderline foreign

May 12th, 2010 § Leave a Comment

I had a coding session with a buddy yesterday, and afterward realized how much new material I am encountering due to the new job. Over the past few weeks the following have been high on my radar, and I figured I documented them here, so I can come back in a few months to see what’s changed in my knowledge:

  • Extension methods
  • lambda expressions
  • regular expressions
  • FUBU MVC
  • Func<T> and Action <T>
  • var

One of the best birthdays in a while

May 9th, 2010 § Leave a Comment

I decided to host my family and close friends for my birthday and housewarming celebration. The last time I hosted a party was about 5 years ago. I have moved apartments, was traveling and out of touch with friends…generally not in the hosting state of mind/state of apartment.

I thought it was a good opportunity to test out my culinary skillz. I decided to make fish tacos, after canceling a first choice of Chicken Breasts Provencal.

The guests liked it, I enjoyed the labor of love, and gained that much more confidence in trying out a new recipe. Epicurious is a great website!

My experience this weekend highlighted the value of having loved ones around. I really enjoyed everyone’s company.

Contentment

May 5th, 2010 § Leave a Comment

I saw this quote today on a Facebook page and liked it a lot:

“Life, if you keep chasing it so hard, will drive you to death. Time – when pursued like a bandit – will behave like one, always remaining one county or one room ahead of you, changing its name and hair color to elude you, slipping out the back door of the motel just as you’re banging through the lobby with your newest search warrant, leaving only a burning cigarette in the ashtray to taunt you. At some point you have to stop because it won’t. You have to admit that you can’t catch it. T…hat you’re not supposed to catch it. At some point, you gotta let go and sit still and allow contentment to come to you.”

Elizabeth Gilbert

Iowa Code Camp

May 5th, 2010 § Leave a Comment

I attended a code camp for the first time this past weekend, which was a first for me. I met a lot of great people. I found the social functions (pre- and post-dinner) equally, if not more, rewarding as the various sessions I attended.

Here’s a quick summary:
1. Zen and the Art of Coding Standards
Summary: Standards are one of the many tools used by teams to reduce the effort to bring on a new developer. Consistent formatting, naming conventions, and even commenting become ways of teaching code and reducing the time before someone is productive. In large teams and open-source projects, this is critical, but even with personal projects, standards reduce the effort to maintain code.
What I learned:
- This was an open discussion. It was enlightening to hear how various people implement coding standards in the workplace.

2. LINQtroduction
Summary: An introduction to the .Net Language Integrated Query purpose and syntax. Used in LINQ to SQL, LINQ to Objects, LINQ to XML and more, it has become a vital way for you to get more power with less code. Learn the basic LINQ operators and how to re-thinq how you write code.
What I learned:
- Various querying styles in LINQ:
- Type inference
- Anonymous types
- Extension methods
- Deferred evaluation
- Resources for more learning such as LINQ Pad (http://www.linqpad.net)

3. Regular Expressions
Summary: This was an ad-hoc session that came about due to another speaker cancelling. It came in really handy because I was working through some regex problems throughout the prior week. Having a discussion about it and seeing someone else use regular expressions in an application really shed light into the subject.
What I learned:
There were a lot of best practices shared by the speaker. Some of them include:
- Always use verbatim literals inside your code to avoid escaping meta-characters all the time. For example: @”\s” vs. “\\s”
- Use negation character classes instead of the dot notation
- Use named groups to document your regex
- Use Ignore Pattern Whitespace
- Resources for more learning such as RegEx Buddy (www.regexbuddy.com)

4. RESTing on ASP.NET
Summary: This session is for the advanced developer looking to break into RESTful services utilizing the ASP.Net MVC framework. This session covers the building and designing of a RESTful service, the basis of why and how to utilize this type of service, and the best-practice architecture to help the attendee implement this in the real world. In the end, the attendee will come away with a good knowledge of REST service, and how to build one utilizing MVC 2.0/ASP.Net 4.0 and VS 2010.
What I learned:
- Fun trivia: The MVC pattern was created by Trygve Reenskaug in 1979
- REpresentable State Transfer is what allows customizable URLs inside of applications built using the MVC pattern.
- I got a review/overview of building a web application in the ASP.NET MVC 2.0 framework.

5. NHibernate at Friends
Summary: NHibernate, FluentNHibernate and Linq To NHibernate all used together to create a Data Access Layer that gets out of your way. Learn to use AutoMapping to “Set it and forget it.” And learn to use Linq to Nhibernate to make your query logic testable without ever touching your database.
What I learned:
I have some knowledge of NHibernate and know that it is used heavily in our newer applications. Attending this session taught me how to quickly set up the configuration using FluentNHibernate instead of the xml approach.
Reflection
mspec
BDD

More information available here: Iowa Code Camp

What I learned today in Regex (part 2/2)

April 28th, 2010 § Leave a Comment

So, I am back and this is what I have to add to part 1 of the Regex “series”:

Greedy and Lazy Repetitions

The repetition operators or quantifiers are greedy. They will expand the match as far as they can, and only give back if they must to satisfy the remainder of the regex.

will match first in “This is a first test”.

Place a question mark after the quantifier to make it lazy.
will match in the above string

A better solution is to use the dot . sparingly, and use <[^]+> to quickly match an HTML tag without regard to attributes
The negated character class is more specific than the dot, which helps the regex engine find matches quickly.


For more advanced regex concepts, look into:
1. Grouping and Backreferences
2. Unicode propertie
3. Lookaround

What I learned today in RegEx (part 1/2)

April 25th, 2010 § 1 Comment

The following content was learned from the regex quickstart

I am re-posting here because I learn from making notes… and these are my notes from the above tutorial.

There are 12 metacharacters in regular expressions:

1. the opening square bracket [
2. the backslash \
3. the caret ^
4. the dollar sign $
5. the period or dot .
6. the vertical bar or pipe |
7. the question mark ?
8. the asterisk or star *
9. the plus sign +
10. the opening parenthesis (
11. the closing parenthesis )
12. the closing square bracket ]

[\^$.|?*+()]

If any of the above need to be searched for in a string, they would need to be “escaped” using a back slash. i.e. If I were to search for the string 1+2=3, my regex would be 1\+2=3.


A character class will match a single character out of several characters

The regex gr[ae]y will catch “gray”or “grey”. It will not catch “graay” or “graey”.

A hyphen inside the [] characters in a regex will catch a SINGLE occurence. E.g. [0-9] will catch a single digit between 0 and 9.

A caret ^ after the opening bracket will negate the character class. e.g. q[^x] will catch “qu” in the string “question”


Shorthand character classes
\d will catch a single character digit
\w will catch a single word
\s will catch a whitespace character, including tabs and line breaks


Non-printable characters
\r will catch a carriage return
\t will catch a tabs
\n will catch a line feed


The Dot . catches (Almost) any character. It matches non line-breaking characters. It is short hand for [^\r\n]
the regex gr.y will catch “grey”, “gray”, “gr&y”, etc.

Use the dot sparingly. Often, a character class or negated character class is faster and more precise.


Anchors do not match any characters, the match at certain positions.
The caret ^ matches at the beginning of a line.

The $ catches at the end of a string.

The \b will match at a word boundary. A word boundary is a position between a character that can be matched by a \w and one that cannot be matched by a \w.

\B matches at every position where \b cannot match.


Alternation is the regular expression equivalent of “or”. cat|dog will match cat in About cats and dogs. If the regex is applied again, it will match dog. You can add as many alternatives as you want, e.g.: cat|dog|mouse|fish.


Repetition

The question mark ? makes the preceding token in the regex optional: colou?r will catch “color” and “colour”

…to be continued

Getting a taste of regular expressions

April 25th, 2010 § Leave a Comment

Today I was working on a page that needed to format input labels on a form. The labels were extracted from columns in a database, so they were in the form FirstName, LastName, HomePhone, etc…the task was to split each label to be First Name, Last Name, etc…My novice first thought was to write a function to detect the Pascal case and the end of the string, but a very knowledgeable buddy of mine suggested the now-more-obvious option of regular expressions…Since I didn’t know how to go about it, I quickly downloaded Expresso and within minutes I had a regular expression to do exactly what i wanted:

var r = new Regex("([a-z])([A-Z])");
var result = r.Replace(s, "$1 $2");

Two lines of code to complete my task. I definitely need to dive deeper into regular expressions. I will be starting with Expresso, as well as this guide.

On the Pursuit of Competence

April 24th, 2010 § Leave a Comment

The most sobering stage in the pursuit of competence is that of conscious incompetence.

I recently came across The Four Stages of Competence, and have since paid particular attention to my tasks at work to determine where I am. It is quite humbling to realize how much one does not know, and this is especially so in a new environment. I started my current job a little over four months ago and since then it has been as though I am drinking from a fire hydrant. The bright side of my journey toward competence is that I have progressed from unconscious incompetence to conscious incompetence (in most cases).

Now that I know how much don’t know, the next step is to start acquiring knowledge, at an even more aggressive pace than before. This was part of the reason I had a goal at the beginning of the year to keep a daily log of things I learn. The more I think about my career/field of practice, the more I realize that it’s impossible to sit in one place if you’re planning to advance.

The steps I am taking to pursue more knowledge include moving my workouts from evenings to first thing in the mornings. This will free up a lot of my time in the evenings. I will also attempt to have 30 straight days of blogging, so record what I learn each day…

Let’s see how it plays out this time…

Catching up…it’s been a long time

April 21st, 2010 § Leave a Comment

This blogging thing really is not for me…I’d rather let the thoughts brew in my head instead of getting them on “paper”.

Well, since my last post I’ve been learning a lot at the new job. I had my 90-day review a couple weeks ago, faced with a tiny bit of trepidation. But my general attitude was that I was *ready* for a formal feedback. I have a lot of learning to do, but the overall review was positive, and I came out with a better awareness of places where I need to improve/develop.

I took a trip to New Orleans in February on the weekend after the Saints won the SuperBowl, and I wish I could justice to the trip than a mere, passing mention of it.

I took a trip to Dallas in March to see a friend, and I ended up visiting the site of JFK’s shooting (6th floor museum) and did some parky activities at s place very much like Dave & Busters.

Follow

Get every new post delivered to your Inbox.