Google

Sunday, August 03, 2008

modestneeds.org

washing a car on a sunny sunday afternoon, cleaning the house, pullin weeds, ..., these are small happiness.

while reading this month's fortune magazine, i read more of small bits of happiness under the title 'Saving Lives, One Rent Check at a Time'.

this is similar to the movie 'pay it forward' i watched a while back. i was astonished that keith taylor, who had a modest teacher's income of $33,000/yr would save and give $350/mo and that now runs a full organization called Modest Needs.

my rather lame excuse for not doing enough charity in donating my time nor cash is that so many of these non-profit organization nowadays smell fishy. that with all these event organizers and such, you will be forced to donate a lot and only small insignficant amount will actually go toward the needs and the rest are wasted on paying for the event organizers and the staffs' pocket. that, instead of inspiring, enraged me and put me to despair.

i'm not a fully committed member yet, but i'll read up http://www.modestneeds.org/help/grants/ to see if this is something i can commit, and that something that will help me (feel better about the world i live in and feel better about myself), as well as be of service to those in a short term jam.

so i'm bookmarking now, and can look this up any time in future.

wow, fortune magazine actually has an article about non-profit/charity organization? that's quiet impressive and pleasant surprise to me.

Google

Friday, May 16, 2008

keeping 1 assertion per testcases in RoR

I'm rewriting badly written unit test at the office.

first, using MVC for RoR, unit test mirrors models/, checking the validity of what goes into database and data types allowed. and much of what's handled in controllers/ go to functional tests. Then there are view tests that often goes into unit/ and some of full regressions in scenario based that goes into integration tests area.

the ones i had to rewrite, there were much of controllers validations, for example. and, each testcases with like two dozen assert this and assert that. so how can you tell when you run 12 testcases and out of 75 assertions 3 fails? how to you analyze and how do you put it in matrix? and, how do you know if assertion failure triggers cascade affect for the rest of assertions in testcase or not?

as tedious as it may seem, do setup and teardown repeatedly, and put one assertion per testcase. say if you put assertion for an account's email existing, in next testcase where you use same account, make a note either to yourself or on the comments that email existance check is already done and that you move on the format of the email. not if it's used for login or not, but just enter different possible email addresses, like with non-alphanumeric characters, or in localized address, or ones entered without domain, or ones that are very long.

i like the one i careated for account testing, which still has whole lot more roon to add, by the way, and i'm excited to add more testcases here, and also to build whole suite of'em ground up!


require File.dirname(__FILE__) + '/../../test_helper'

require 'test/unit'

class AccountTest < Test::Unit::TestCase
def setup
super
@account = create_testacct
end

def teardown
acct_cleanup
end

def test_new_acct_have_a_unique_username
@account = create_testacct

assert_not_nil @account.unique_username

acct_cleanup
end

def test_cannot_create_acct_with_email_not_having_domainname
assert_raise(ArgumentError,"accttest is not a valid email address.") do
@account = Account.create_by_email("accttest")
end
end

def test_cannot_create_acct_with_email_not_having_domainname2
assert_raise(ArgumentError,"accttest is not a valid email address.") do
@account = Account.create_by_email("accttest@")
end
end

def test_cannot_create_acct_with_email_having_bad_domain
assert_raise(ArgumentError,"accttest is not a valid email address.") do
@account = Account.create_by_email("accttest@testdomain")
end
end

def test_cannot_create_acct_with_email_having_only_domainname
assert_raise(ArgumentError,"accttest is not a valid email address.") do
@account = Account.create_by_email("@testdomain.com")
end
end

def test_new_acct_not_activated
@account = create_testacct
set_default_password

assert !(@account.activated?)

acct_cleanup
end

def test_activate_method_makes_new_acct_active_acct
@account = create_and_activate_testacct

assert @account.activated?

acct_cleanup
end

def test_activate_acct_without_password_fails_with_correct_error
@account = create_testacct

assert_raises(Error::HumanReadable, "You must set a password before we can activate your account!") do
@account.activate()
end

acct_cleanup
end

def test_cannot_create_acct_with_existing_email_address
@account = create_and_activate_testacct
assert_raise(AccountModule::AccountExistsError,
"There is already an account with this email address, please try a different one.") do
@account2 = create_and_activate_testacct
end

acct_cleanup
end

private
def create_testacct
@account = Account.create_by_email("accttest@localhost")
@account.save!

return @account
end

def set_default_password
@account.password = "test123"
end

def create_and_activate_testacct
@account = create_testacct
set_default_password
@account.activate()
@account.save

return @account
end

def acct_cleanup
@account.destroy
end
end

Google

Saturday, May 03, 2008

if i were yahoo exec i'd have taken microsoft's counter offer

wow, was i busy or what? no postings in 2mo?

okay, i've been paying attention to micro's courting of yahoo, and yeah i thought initial offer was on lower side than i'd like. but counter offer's pretty decent.

first offer was at $29, which i wouldn't have liked myself, but at $33/share yahoo walked again. wanted $37. even steve balmer says it's no fun courting the princess-like yahoo. heh.

i wouldn't mind $37/share for my little bits of shares, what some 100-200 shares?
but i'd gladly take $33.

i worry my yhoo will plunge into lower $20s again. sigh*

like fellow yahoo share owners, like yahoo execs, i'm too greedy to wash my shares at some $20 odd per share.

hmm... should i knock on balmer's front step and offer my tiny bits of shares? heh.

Google

Wednesday, March 19, 2008

free domain registration at register.com until 3-25-08

register.com sent me email saying 'til 3-25-08 i can register 1 domain for free up to 1 yr, providing i claim i am a small biz and i confirm i have right to register domain on behalf of my small biz.

hmm... now the dilemma sets in. do i want .com or .org? what name to register? and what will i do with it?

heh. it's a happy dilemma.

Google

Monday, January 21, 2008

finally on skype. yet another IM to keep up with

I started with AIM, moved into YIM and tried MSN IM then on google talk. It certainly takes a good IM manager, to be logged on all of them, and to maintain the account. I've signed up for MSN IM a few times since the first AIM I got on in '98, work related. Ah, those pre-'98 days when I was oblivious of all these, and of ICQ and IRC.

I've not bee on AIM more than once two or three months, and not much on IRC either.

well, google talk isn't enough now I'll have to use skype, again for work related.

so I went to skype site and downloaded rpm for my FC 6, and of course the PGP key isn't verifying. looked up and followed the steps to add skype.repo and all. when it didn't work out, I had to download the binary, installed and now I'm running into trouble with dependency issue. libqt, libsigc, ...

some blogs say i should copy the libraries from previous version, 1.4.0.9x instead of 1.4.0.118. that looked aweful complicated, and skype didn't have older version available, anyways. instead I downloaded beta version, skype 2.0 and after the install, and after copying binary 'skype' to /usr/bin and copying 'sounds/' and 'avatars/' to 'usr/share/skype/', now I'm on skype. ready for next conference call.

skype on FC6 works, but still not as conveniently as if i was on mac or windows, not quite yet.

Google

Tuesday, January 15, 2008

macbook air, small enough for me?

macworld 2008 keynote announced 'macbook air'.

macworld has historically been apples' new product announcement platform, announcing iPhone, iPod, ..., all the popular commodities that many teens and 20-somethings wouldn't know how to live without.

I got my Sony Vaio X505 back in 2005, for christmas, and have been happy with it's light weight. having been leisurely shopping for replacement for my Vaio X505, I had my eyes peeled watching the keynote via online video and reading the spec from apple's website. 3lbs? it's definitely much lighter than conventional macbook or macbook pro. and, of course, it's from apple, afterall.

still 3lbs? that means my bag would be heavier by 1+ lbs.

hmm... i'll have to wait and see. anyone rushing out to buy macbook air yet?

Google

chm viewing with chmox or kchmviewer

'sudo yum install kchmviewer' worked on my FC 5 desktop, and chmox dmg download and install works on leopard mac os x.

seems like many files are in .chm format in addition to .pdf, so good to update my environment on laptop and future desktop.

Google

Wednesday, December 26, 2007

legacies remembered, through musical and through 'kennedy center honors'

Brian Wilson, Diana Ross, Steve Martin, Leon Fleisher and Martin Scorsese are honored during "Kennedy Center Honors" on CBS.

This reminded me of recent visit to "Jersey Boys", a musical based on 50-70's pop group 'Four Season'.

Less dramatic, maybe a little, than Jersey Boys, it was nice to see someone like Yo-yo-ma on the stage versing Leon Fleisher's life story, and funny to see someone re-acting Steve Martin's comedy. It seems like a lot of toughts were put in to organizing this, and many volunteered(?) to perform. A young aspiring pianist playing in tribute to Leon was also pretty mesmerizing and made me ashamed of my lazyness in practice.

Something that made me think, of these two occassions: value of talent! I usually don't believe in talent but more so on hard work. But would these great artists be great artists with perserverance alone? Maybe the passion, and that 1% that makes differences against other artists would be their god-given talent? If so, what would be my talent? Heh, ouch...

Maybe the vocab. 'talent' is some special quality not common in general public, like me, thus my justification for lacking talent. I'm a mediocre at drawing/painting, at music, at computers, at math, at finances, ...

maybe my talent is just being mediocre good at things? lol.

anyways, it's pretty amazing how some people can listen to a tune and can identify, play along and even improve what he/she heard.

I really enjoyed "Jersey Boys", and now I can appreciate 'Four Season's music with insight. And, now the "Kennedy Center Honours" helps me realize I shouldn't give up on a boring things like new year's resolution. If someone like Diana Ross was determined, and loved singing at age 15, and carried through all the black-and-white-TV era through 70s and 80s, ...

Don't need to be honored at Kennedy Center myself, but "wouldn't it be nice if ..." i had no regret with my life when I look back at what I have accomplished?

^^

Google

checkin out gentoo 2007


checkin out gentoo 2007
Originally uploaded by speattle
not so much by choice, but i got to learn to install and setup gentoo on intel based mac mini for ruby on rails app.

partitioning, installation, package installation with emerge, ..., it's been quite painful 4 days.

i had to use mac mini, because that was only hardware available to me, and duh, i started with 10.4 without boot camp. that was my stumbling block. once i grabbed leopard installation that came with bootcamp, partitioning got easier.

oh, also partition it as windows partition, then change it to linux using 'fdisk /dev/sda' when in gentoo shell.

i had downloaded gentoo 2007 livedvd but for some reason it didn't like looking up '/dev/sda' to kick off the installation.

after about 2-3 failed attempt and about 2 complete reinstall from mac os, i sorta got wised and attempted to chmod /dev/sda* from root as livedvd took me to X windows as gentoo user. That didn't help, but now i know not to panic, as i can sudo as gentoo user without password.

still with no success at install, i had to opt for minimial install cd, and as i've not done gentoo install before i'd be reading gentoo handbook and wouldn't know the instruction. now that i do understand, it's pretty easy instruction to follow; explaining the steps that followed by exact command line to enter.

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#book_part1_chap1 is bookmarked for me now, along with http://gentoo-wiki.com/HARDWARE_Apple_Mac_Mini.

i'm in the middle of adding packages via emerge now.

still am not familiar with raiserfs, but am glad to know gentoo can be loaded to mac mini.

although it didn't work out livedvd logging in as gentoo and taking me to X window desktop was nice. after following minimal install i'm logged in to shell for emerge update, and got to locate X window/desktop packages to install to get ack into the Desktop as nice/fancy as gentoo user's was when i booted from DVD.

oh, it was nice i made note about rEFit earlier in blog, i had to look it up when partitioning from Mac OS X.