You are here: Blogsphere Longtail
Keep up to date with your favourite Rails bloggers in context.
OK, that's awkward--an Angels fielding error on a pop fly scores 3 runs. (via Twitter)
Rogue Amoeba - Fission: Lossless Audio Editor for Mac OS X

@gobigdave do you recognize the guy behind home plate? I think it's a retired umpire. (via Twitter)
Raw instant film: Penelope (Sutherland, MIM)
make-up: Sommer Mbonu, hair: Anne-Marie Rooney, 120mm Hasselblad on Fuji 100c
My friend Pete Forde had brought a polaroid camera with him on his last visit to Ottawa. I really liked the raw quality and the fact that you can “touch” the picture immediately (something that you don’t get from a picture on a LCD screen).
And just a few months after Polaroid has stopped producing instant film, their legacy has become more important to me than ever. Thankfully, Fuji still continues to produce Polaroid 100 film for medium and large format cameras. Using proof polaroids (like the ones seen above) are extremely useful to make sure the light, settings and everything else is alright before wasting a roll of film.
"I started to cry, tears were pouring down my face and I had no idea what to do. Then I heard a..."
Why does it cost less to fly t…
wanted: crackdown on shitty advertising

Treating Developers Right
Tweets for Today
Sitting at the Hilton in Glendale, CA (via Twitter)
I’ve been working on some merb related things of late, and I’m planning on writing a more detailed article on creating a merb application from scratch as so many of the tutorials out there kind of leave you hanging. In the interim though, I’m just going to touch on a little nugget of information that isn’t very well publicised regarding DataMapper, one of the ORMs that gets used with merb.
That’s right, you aren’t left having to wrestle with the command line and ALTER TABLE statements just because you’ve left ActiveRecord behind. All the migration joy you’ve come to love with ruby on rails can come and live with you happily with merb and DataMapper.
First things first, you’ll want to generate a new migration:
merb-gen migration my_migration
We should now have a file named 001_my_migration.rb and if we look at it, it won’t be too foreign based on our ActiveRecord experiences:
migration 2, :my_migration do
up do
end
down do
end
end
To pad it out with some code that is actually useful, add in the definitions for what you want done:
migration 2, :my_migration do
up do
create_table(:posts) do
column(:id, Integer, :serial => true)
column(:title, String, :size => 255)
column(:description, Text)
column(:published, Boolean)
column(:created_at, DateTime)
column(:updated_at, DateTime)
end
end
down do
drop_table(:posts)
end
end
And now that we’ve got the migration we are happy with, applying it to our underlying database is just a matter of the following:
rake dm:db:migrate
괴물은 괴물..
위젯 생태계와 경제 By 조산구 박사님 PT 자료입니다.
HDR practice 2
Just mouseover image to see the original
Tiger HDR PracticeCredits: Flickr image (I took this picture)
I'm still loving HDR and have been practicing it with every free time I get.
마이크로소프트, 조만간 "Windows Cloud" 발표 예정
Broken Social Scene: interview and live performance music - Boing Boing TV
At some point when Emily was pregnant, I became convinced that the baby would be a girl. I admit that this is an irrational thing to believe without any evidence, especially since I figured it out in a dream. However, the Chinese calendar method confirmed my belief, so I think it was fine.
Anyway, once I “knew” I was going to have a little girl, I had some changes to make. Up to that point, I’d been shaving in the shower, if I shaved at all. I didn’t really like shaving, and I hated spending ridiculous amounts of money on blade cartidges, so I’d keep using one well past any reasonable amount of sharpness. Shaving in the shower was the only way I could get through it.
How was my little girl going to watch Daddy shave, if Daddy always shaved hidden away in the shower?
And so began my quest. It’s a quest some men spend their entire lives on, and other men abandon as a waste of time. For me, it’s been fun, and saved money, and made Ellie not scream when she kisses me.
So, if you’re interested in starting the quest, your journey begins here:
I sat at the kitchen table and watched these, and a bunch of the guy’s other videos. In fact, I just watched them all again in the background while I wrote this post.
I decided that I was going to make the investment in a good safety razor, because it would allow me to have ridiculously cheap blades. (As an example, 30 Gillette Sensor Excel cartridges on Amazon go for $38.99, while 30 Feather Hi-Stainless blades go for $17.25. Feathers are some of the most expensive blades available, and are still 40% of the cost of cartridges.)

After some research, I settled on the Merkur ‘Hefty Classic’ available for about $40. You’ll never have to replace it. You can also find great razors on eBay, or in the old guy down the street’s bathroom. Ask him, he may have a spare.
Next, I needed a brush. I was serious about this, so I spent a little more than I needed to and got a nice badger hair brush. You can certainly get by with the brush you’ll find at Walmart, but you may want to splurge a little. I think I got my brush from Classic Shaving at the same time as I bought my razor, but I’m not positive.
I bought a latte mug at some discount store. It’s wide, so I can get a rich lather, and it’s heavy, so it retains heat. For my birthday my Mom got me a nicer mug with a pewter base, which is really nice, but sometimes I still use my $1 mug. Don’t go nuts on this part.
Let’s see, razor, brush, mug … oh, I need soap. Traditional wet-shaving enthusiasts don’t usually use shaving cream or gel from a spray can, but instead use shave soap and make the lather in the mug. I won’t go into too much detail on how I picked what I use, which is Taylor of Old Bond Street, Lemon and Lime flavor. Flavor? Scent? Whatever. I spent a remarkable amount of time picking the shave soap I wanted, but I’ve been very happy with it.
Finally we come to sharp things. There are a lot of blades out there. Some are good, some are bad, and only a handful are right for you. I personally love the Feather Hi-Stainless blades made in Japan by a company that used to make ninja swords, or so I hear. You may find them too sharp. You may love the Personnas from Israel, and they’ll scratch me up and leave me red and irritated. For that reason, I recommend you get a sampler pack. I got one of these but I don’t remember what size I got. I know it had Feathers, Dorcos, Treet Blues, so it was probably the #3. Maybe he changes them out. I don’t know, I love the Feathers. I started at the bottom, hated most of them, found a few I could live with, and then got an amazing shave with the Feathers. The Dorco from Korea works well for me, too. The point is, you have to try, you have to be patient, and you have to be willing to bleed some, and be red and irritated some. This takes work, but it is highly rewarding.
Oh Yea! Cassel to Moss for a sweet 66 yd TD (via Twitter)
[통계] 조회수 TOP 10, 2008년 09월 29일~2008년 10월 05일 주간
[통계] 검색유입분석, 2008년 09월 29일~2008년 10월 05일 주간
[통계] 통계요약, 2008년 09월 29일~2008년 10월 05일 주간
McCain Didn't Think Osama Bin Laden Was A BAD Guy in 1998
이 글은 꽃띠앙님의 2008년 10월 5일의 미투데이 내용입니다.
<!-- end of daily_digest -->
เอา Adsense มาแปะ
4 hours til the Red Sox - Angels game 3. In the meantime, enjoying some football (via Twitter)
@jonpierce thanks for the pointer to the Eye-Fi upgrade. (via Twitter)
Delerium to release EP this we…
Leaving phoenix to burbank (via Twitter)
FFFFOUND! | Sexuality in Art

Eye-Fi add geotagging to their wireless camera flash cards... (via Tumblr)
warsow
Ruby on Rails :: Page caching
รีบปั่นก่อน ก่อนที่ merb 1.0 จะออกมา เดี๋ยวจะไม่ได้เขียน blog สักเท่าไหร่ เพราะคงไปนั่งวุ่นอยู่กับ merb นี่แหละ
post อันนี้ คงจะอยู่ทั้ง blog ผม และ rails66.com ด้วย เขียนทีเดียว แปะมันทั้งสองที่
วิธีการทีจะลดการทำงานของ server ได้ หนึ่งวิธีในนั้นที่ช่วยได้เยอะเลยคือการทำ cache
ใน Rails เองมีการทำ cache อยู่ 4 ระดับ คือ
และตัวควบคุมการลบ cache พวกนี้ ก็คือ
อันแรกนี้ ขอเป็น page caching ก่อน
ซึ่ง page caching เนี่ย มันจะเก็บ output ไว้เป็น file โดย save ไว้เป็น html เลย โดยเก็บไว้ใน public/ ซึ่งสามารถเปลี่ยนที่เก็บได้ เดี๋ยวค่อยว่ากันอีกที เมื่อมันมี request มา มันจะวิ่งเข้าที่ file นี้แทน แทนที่จะวิ่งไปที่ controller แล้วก็ทำงานตามที่เราเขียนไว้
การทำ page caching นี้ เหมาะสำหรับอะไรที่มันอยู่นานๆ แล้วคงจะไม่เปลี่ยน เช่นระบบ blog ซึ่งปกติ จะไม่ค่อยแก้ไขอะไรเท่าไหร่ จะทำการลบ cache นี้ออก ก็ต่อเมื่อมีการ update หรือมีการเพิ่มข้อคิดเห็น(comment) เป็นต้น
เริ่มต้นด้วยการเปิด cache ก่อน โดยปกติ ถ้าเราทำงานใน development environment มันจะปิดระบบ cache ทั้งหมด แต่ถ้าสลับมาเป็น production environment มันจะทำการเปิด cache ทุกอย่าง ลองดูใน config/environments/production.rb
ไปตั้งค่าให้เป็น true ใน config/environments/development.rb มันก็จะไปเปิดตัวจัดการ cache ให้
สมมติว่าถ้าต้องการเปลี่ยน path ในการเก็บ cache ก็ใส่เพิ่มไปว่า
เวลาเข้าถึงก็ http://localhost:3000/wherever/you/want/file
วิธีเซ็ต page caching ก็ง่ายๆ เราใส่ไปใน controller ว่า
แค่นี้เอง
เวลาจะลบ cache สมมติว่าเราจะลบ หลังจากที่เรา update content ของเรา เราก็ใส่ใน controller ไปว่า
expire_page จะไปทำการลบให้เองเลย สบายมากๆ (รออีกสักหน่อย เดี๋ยวจะเขียนเรือง sweeper มาจัดการตรงนี้ครับ)
แต่ก็ใช่ว่าจะไม่มีปัญหาเลย เพราะหลังจาก update เสร็จแล้ว เราควรที่จะแสดงข้อความอะไรบอกหน่อย ในที่นี้ผมใส่ไปใน flash[:notice] ปัญหามันคือ มันจะเก็บ cache ไว้ในขณะที่มีข้อความนี้อยู่บนหน้า เพราะมันจะเก็บตอนที่เราสั่ง redirect_to
วิธีซ่อมแบบไม่ลงแรงเลยคือ ใช้ plugin ที่ชื่อว่า Cacheable Flash
เอามาจาก นั่งเทียนเขียนข่าว#12 ครับ
โดยวิธีการมันก็ง่ายๆ ครับ คือเก็บข้อความไว้ใน cookie ก่อน แล้วก็ดึงมาแสดงผลด้วย javascript อีกที
แต่ผมไม่ค่อยชอบ น่าจะมีตรวจว่ามี flash หรือเปล่า ก็เลยลงมืองัดแงะปลุกปล้ำเสียหน่อยได้หน้าตาแบบนี้
คือ cache ถ้า flash message ว่าง
ดูเท่กว่าเยอะ
ปล. อาทิตย์หน้ามาต่อกับ action caching ครับ
ข้อมูลจาก rails api
Tell us what you think of the new BlogSphere feature. We are continually looking to improve and update the
functionality based on your feedback.

Find your next Ruby on Rails project or job.
Exclusive content,
regularly updated - onsite and tele-working positions listed.
The one, the only.
-
G.G, United States