Daily Quote: for programmers/programmers in progress….

People always make fun of people who can do what they can’t do. So hang in there, don’t listen to them. Keep learning, you’ll never regret it.

“You can code. They cannot. That is pretty damn cool.”

– Zed Shaw, Lean Ruby The Hard Way

I ❤ this guy. He’s awesome.

Book Recommendation: The Nuts and Bolts of Cardiac Pacing

For all biomedical engineers out there, and anyone who is a newbie in the pacemaker business; this book is like a crash course in cardiac pacing. It gives you all the information you need to know in a simple, systematic method.

If you’re interested you should give it a shot!

find it on Goodreads: The Nuts and Bolts of Cardiac Pacing by Tom Kenny

Daily Quote: Love is a trap

“Love is a trap. When it appears, we only see its light, not its shadows.”

– Paulo Coelho, By the River Piedra I Sat Down and Wept

Sketch: Colosseum

20130715_142918

This one is from years back..I feel like I’m losing my talent.
I need to travel more.

Book Recommendation: North and South

North and south by Elizabeth Gaskell

This book is so good, it makes my heart hurt.

Needless to say, Mr. Thornton is the reason I’m going to end up a lonely cat lady.

I recommend it to anyone who likes a good love story and isn’t afraid of long books.

My new (and much improved) solution to ex48, Learn Ruby by Zed Shaw!!!

you guys are gonna love this one 🙂

class Lexicon
def self.scan(input)
words = input.split
directions = [‘north’,’south’,’east’,’west’,’down’,’up’,’right’,’left’,’back’]
verbs = [‘go’,’stop’,’kill’,’eat’]
nouns = [‘door’,’bear’,’princess’,’cabinet’]
stop_words = [‘the’,’in’,’of’,’from’,’at’,’it’]
@@sentence = []

def self.push_to_sentence(word,type)
pair = [type , word]
@@sentence.push(pair)
end

def self.check_if_number(word)
if word.to_i.to_s == word
push_to_sentence(word.to_i,’number’)
else
push_to_sentence(word,’error’)
end
end

words.each do |word|
if directions.include? word
push_to_sentence(word,’direction’)
elsif verbs.include? word
push_to_sentence(word,’verb’)
elsif nouns.include? word
push_to_sentence(word,’noun’)
elsif stop_words.include? word
push_to_sentence(word,’stop’)
else
check_if_number(word)
end
end
return @@sentence
end
end

Learn Ruby The Hard Way ex48: My Sad Attempt

UPDATE: BETTER SOLUTION 😀 click here to see it.

Observation: I do not like writing the source code based on the unit test -.-

I tried my best to solve this one…here’s my solution, in case anyone would like to see how others have thought about it. Let me know if any of it is unclear.

class Lexicon

def self.scan(input)
words = input.split
directions = [‘north’,’south’,’east’,’west’,’down’,’up’,’right’,’left’,’back’]
verbs = [‘go’,’stop’,’kill’,’eat’]
nouns = [‘door’,’bear’,’princess’,’cabinet’]
stop_words = [‘the’,’in’,’of’,’from’,’at’,’it’]
word = []
sentence = []
results = Hash.new()

words.each do |word|
directions.each do |direction|
if word == direction
pair = [‘direction’, word]
sentence.push(pair)
results[word] = pair
end
end

verbs.each do |verb|
if word == verb
pair = [‘verb’, word]
sentence.push(pair)
results[word] = pair
end
end

stop_words.each do |stop|
if word == stop
pair = [‘stop’, word]
sentence.push(pair)
results[word] = pair
end
end

nouns.each do |noun|
if word == noun
pair = [‘noun’, word]
sentence.push(pair)
results[word] = pair
end
end

if word.to_i.to_s == word
pair = [‘number’, word.to_i]
sentence.push(pair)
results[word] = pair
end

if results[word] == nil
pair = [‘error’, word]
sentence.push(pair)
results[word] = pair
end
end

return sentence
end
end

Archived Post: Heroism

Well it isn’t a rose after all…
it’s a jasmine.
Jasmines are the most delicate little creatures. Small and white, soft smell, instant comfort.
Was it so wrong? was it stupid to let the little jasmine break through?? but it was so sweet and fragile, that it was almost sinful to pluck it…no, no regrets there.
Something about this little fighter pushing it’s way through a stone wall demanded respect. It’s so utterly heroic…and it looks stunning.
like the break of dawn after a long, tiring, night.
Relief.
A few white petals, small round yellow center…and a little green stem. But it accomplished what no one else could ever manage before.
The little flower made it all the way in. The crack is there…and light spilled in.
Rescue is finally here.