February 18, 2011

HOWTO: Remove linebreaks in VS.NET

This little trick helped me while working on a JsUnit test…thought I’d pass it on.

I was taking a long chunk of HTML in a unit test, pulled it into vs.net, formatted it so it was human readable, and then needed to ‘unformat’ it. Instead of manually deleting the new line characters, I did this:

1. Control-H to open the find & replace dialog

2. Put in the regular expression \n (newline)

3. Selected the ‘Use’ checkbox and Regular expressions from the dropdown

4. Clicked replace all

5. Postponed carpel tunnel surgery for a bit longer… J

Enjoy!

jk

adapted from: http://geekswithblogs.net/mnf/archive/2008/03/04/remove-empty-lines-in--text-using-visual-studio.aspx

December 13, 2010

Vein perspective and empathy

A short story...it's a bit heavy, so if that's not your gig, please skip this post...


The other day, I was walking down Hollywood Boulevard about 9am to grab some breakfast when a gentleman stopped me on the sidewalk.


Immediately, I felt for this guy; he was clearly living on the street, and was physically in rough shape. He told me straight out he was a junkie and asked if I had spare change to give him.


We chatted for a bit, and he suddenly stopped, looked me straight in the eye and said, "man, I wish I had your veins". I didn't know how to respond to that, but kept it light and fun and told him he could not have my veins... :) -- for just a moment, I connected with this guy.


Perspective is an interesting thing - my 'veins' are quite normal in size, appearance and content. However, a guy shooting heroin would have a different view.


I asked him to be safe and take care of himself. I hope he discovers the feelings/experiences/thoughts/emotions causing him turn to chemicals to cope with life. After reading up on heroin, I know it is both physically and mentally addictive...... :(


Perspective and empathy are two qualities which would make the world a better place...I hope this guy finds his way.

May 05, 2010

I'm back

ok, I'm back on the Blogger -- tired of maintaining my own blog software :)

New Zealand Golfer Falls off Cliff - News - FOX Sports on MSN

New Zealand Golfer Falls off Cliff - News - FOX Sports on MSN: "Golfer falls off cliff while looking for ball"

Stay away from the edge of the cliff! (at least the guy's medical condition says he's in stable condition)

May 12, 2008

New blog location

Ok, it's been over a year since I've posted here...hey, life happens.
This is my farewell post on this blog. I created a new personal blog today located at http://www.jeffknutson.net/blog. Come on over and check it out!

I will leave these posts here for posterity and good times!

Cheers
jk

February 25, 2007

The NBA

This (http://sports.espn.go.com/espn/page2/story?page=simmons/070223) is probably one of the funniest page 2 articles I’ve *EVER* seen.  (Courtesy of Mr. Bill Simmons of ESPN).

 

I didn’t know that F-minus-minus-minus, F-infinity-minus and G were real grades J

 

Go Wolves; KG Rocks!

 

Cheers

jk

 

February 18, 2007

Moving an SVN repository between machines

I thought this was a pretty nice, straightforward howto on migrating a
repository from one machine to another machine. I naively thought one
could just copy and paste the directories, heh heh.

enjoy!


jk

February 16, 2007

Trust is *not* security

February 12, 2007 (Computerworld) -- In Lancaster, Pa., last week, the county coroner was brought to court in handcuffs. A grand jury indicted Dr. Gary Kirchner, charging him with giving out his account name and password for a county Web site that contained confidential police 911 information. What kind of information? Names of accident victims and police informants, medical conditions, witness accounts, autopsy reports and not-yet-substantiated accusations. The site was the access point for real-time data generated and used by firefighters, ambulance crews and other emergency responders.

And who did the coroner allegedly give his password to? Newspaper reporters. Now there’s a trusting user.”
The entire article can be found here: http://www.computerworld.com/action/article.do?command=viewArticleBasic&articleId=282376&source=NLT_SEC&nlid=38

- Clearly this guy should not have been giving out his login credentials to anyone (much less a member of the media, jeez).

- Where were the auditing procedures and detection? "...an IT staffer checked Web site logs and discovered that the site was accessed more than 50 times in two weeks from computers at a newspaper office". OK, logging was working, but if no one reviews the logs regularly, or notifications are not sent out for suspicious activity, the logs provide less value (they provided good forensic value once people realized there was a problem though).

- Thankfully "a reporter from a competing newspaper called the county to find out why he didn’t have access". Just think if this reporter didn't call; the security breach would still be going on....

This article again proves that the human element is typically the weakest when it comes to computer security. I’m betting they are going to make an example of this guy…

jk

February 10, 2007

Alice & Bob

Things like patterns and best practices help out developers by promoting consistency and communication.  e.g.

 

In describing a piece of code to a fellow developer, which is easier to understand:

1)       I defined a family of algorithms, encapsulated each one as an object, and made them interchangeable
-or-

2)      “I used a Strategy Pattern” (http://en.wikipedia.org/wiki/Strategy_pattern)

 

Clearly #2 is easier to understand.  Not only did I use a tried-and-true coding technique (the pattern), but the term “Strategy Pattern” conveys special meaning and becomes part of the common language amongst developers.

 

In that same vein, the Security Community uses a common set of terms to represent characters in a system:  http://en.wikipedia.org/wiki/Characters_in_cryptography

.  The canonical example of this is: ‘Alice sends a message to Bob, but does not want Eve to read the message’.  When two security professionals sit down to discuss a scenario, this common verbiage raises the level and efficiency of communication.

 

Please read the ‘Characters in cryptography’ link and familiarize yourself with the characters.  I think these characters can have potential value in many developers day-to-day lives, just like design patterns already do.  Improving communication and developing a common set of terms will only help a team be more successful!

 

jk