Fusioncube

The online journey of a technophile, by Steve Brownlee

Archive for January, 2007

Find list elements using Regular Expressions

  • Filed under: cfml, regex
Tuesday
Jan 16,2007

A colleague of mind asked me this afternoon if I knew of a way, in ColdFusion, and one of line of code, to determine if all of the elements in a short list are contained in a larger list. He also wanted to discount the order of the elements in the larger list – the elements could be anywhere. I quickly indexed my mental store of ColdFusion list functions, and nothing came to mind, so my first answer was no. Then I thought about it for a minute and realized that he could use my trusted friend and companion – regular expressions.

I figured if there was a way to convert the list itself into a regular expression pattern using lookaheads, then it would be a snap. I then went to LiveDocs and discovered the ListChangeDelims() function which I had never used before. It was perfect.

<cfset largeList = "127.0.0.1,192.168.0.1,63.25.178.45,12.87.65.102,155.189.37.121">
<cfset smallList = "192.168.0.1,12.87.65.102">

<cfset allElementsInLargeList = ReFind( "^(?=.*#ListChangeDelims(smallList,')(?=.*', ',')#).*$", largeList)>
<cfdump var="#allElementsInLargeList#">

Works like a charm and all done on one line of ColdFusion.

First Impressions are Everything

  • Filed under: errata
Friday
Jan 5,2007

I was recently contacted by a company here in the area about joining their programming team. I agreed to at least meet with them and see what they were looking for and if I was a match, so I trundle on out to their offices for a lunch interview. I had three quick interviews that day with (names changed) Rich, Mitch, and Mark. Rich was the first to meet me in their conference room, and proceeded to do a pretty standard interview.

“Tell me about your skills.”
“Do you have experience doing {fill in technical language here}”

Basically, he ran down a pre-printed list of questions, making a few notes here and there. Once he was done with his question list, he asked if I had questions. Of course I do, a lot of them. After my second question, he immediately stands up and almost runs out of the room telling me that another person would like to interview me – Mitch. Hmm… ok.

Bad first impression.

I wait for approximately 15 minutes, because Mitch apparently isn’t in the office yet even though the interview with me had been scheduled for 3 days. Finally Mitch comes in with a perfunctory introduction, and apologizes for being late. He then proceeds to go through THE SAME LIST of questions that Rich had used. I have no idea what Mitch’s role in the company is, or why I’m being asked to repeat the same answers I had just given to Rich. Turns out, he would be the person I would report to if I chose to work there.

Bad first impression.

Finally he gets around to telling me what my role would be – other than “programmer” which is all that Rich would divulge – and it isn’t much more than that. They’re looking for a grunt developer to work on their ERP system writing ColdFusion and PL/SQL all day. “Any other responsibilities”, I ask. “No” is the basic, paraphrased answer. Ok… so much for reading my resume, which clearly shows that I’m not a grunt programmer, nor have been for over 6 years.

However, I still ask my questions about what kind of environment is there, what kind of manager he (Mitch) is, what they do for motivating their workforce… standard stuff. I ask about their technical infrastructure, and it turns out they are about 3 to 4 years behind the latest technologies. However, not a deal breaker seeing as how they service a slow cycle industry. He then goes into a discussion on how he upgraded their entire product line from ColdFusion 5 to ColdFusion MX in a week. That took me aback seeing as how the latest effort I went through on that took over a year. Granted it was an enormous project with multiple other factors, but they did it in a week? Obviously wasn’t done right, and they admittedly tried to do this twice but didn’t make the effort to test it.

Bad first impression.

Then I meet with the director of the office, and this fellow, finally, is a great interviewer. He’s articulate, comfortable with speaking, knows what he wants to get out of the interview and gives honest, full answers to my questions. However, the position he’s describing is far below my career, and talent, level and their environment just isn’t what I’m looking for; rigid work schedules, zero privacy, very quiet workspace, monitored Internet access… far too corporate and close-minded.

Somewhat bad first impression.

As can be guessed, I passed on the opportunity, but I was contacted that they were VERY interested in hiring me and wanted to speak to me again, so I made the effort to communicate my concerns to them. I was given all the right answers about how they would support my career goals and would definitely give me responsibilities above and beyond programmer once I had proven that I had those skills. However, my first impression was far too strong to overcome their very positive feedback.

Even after this second discussion, I still passed on it. I thought about it for a while and realized that the awful first impression that was made upon me was about 90% of the reason why I didn’t pursue it. I already knew the importance of first impressions, which was heavily strengthened when I ran my own business, but now being on the other end of it it really drives home how crucial it is when establishing any kind of relationship.

Latest Tweets

  • Watch video on this page to see a quick shot my family's biz and a heapin' helpin' of Pittsburghese - http://bit.ly/aMxuLN
  • Ever wonder how insignifcant the Earth is on a cosmic scale? http://bit.ly/PV4o
  • How did I miss this highlight??? Hasek takes out Gaborik http://su.pr/1KZtN2
  • Rooted & upgraded my HTC Hero w/#Froyo. Holy shit is it faster and have improved features. Painless, too. http://bit.ly/cBjvuH #fusprint
  • @Antipimp You will do what Father Jobs tell you to do, peon.