Verbose Logging

software development with some really amazing hair

T + G I F R

Articles tagged with "stackoverflow"

Calculating Age

· Posted in Programming
I found this little snippet on stackoverflow This is a strange way to do it, but if you format the date to yyyymmdd and subtract the date of birth from the current date then drop the last 4 digits you've got the age :) I don't know C#, but i believe this will work in any language. 20080814 - 19800703 = 280111 drop the last 4 digits = 28 All credit goes to ScArcher2 This is just a great little snippet of code, and as an upside, dates in that form…

Ruby Regex For Fun And Profit

· Posted in Programming
Regex are always fun, and since regex expressions are first class citizens in ruby, it makes it so much easier. I found this Code Golf question on Stackoverflow and threw together a quick method to do it. I can't take all the credit, since I needed to search a bit to figure out if I could do matching parenthesis in ruby, and found that I could, but only in ruby 1.9, which ruby forum topic showed me. Then a commenter on SO pointed out another opt…