123
 123

Sun 17 August, 2008

Click here to bookmark this link.Channel Image19:44 When two do the same thing,...» Projectionist
When two do the same thing, it is not the same thing after all.

Publilius Syrus


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:59 Josh Peek officially joins the Rails core» Riding Rails - home

Josh Peek has been a defacto Rails core committer for a while, but for some reason we’ve never actually made the appointment official. So here it goes: Josh Peek is the latest Rails core team member. Three cheers hurray!

Josh has been working on a Google Summer of Code project to bring thread safety to Rails and is just about ready to wrap it up. Rails 2.2 will be thread safe thanks to the work that Josh has put into it.

Of more importance, though, is the significant effort put into making things faster and cleaner as part of that push. The actual thread safety won’t really matter much to most people, but it’ll surely look nice on your enterprisey check list of Features Your Framework Must Have To Get Play Around Here.

In any case, please welcome Josh!


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Sat 16 August, 2008

Click here to bookmark this link.Channel Image22:14 21, 025, 0x15» chris blogs

The twenty-first year of my struggle against entropy went by. Swoosh. Tempus fugit. Ars longae, vita brevis. Memento mori.

How’s life? Homeostasis, check. Organization, check—at least organically. Metabolism, sure. Growth, done. Adaptation, check—still possible. Response to stimuli, ‘course. Reproduction, rather not.

Maybe that’s what life is… a wink of the eye and winking stars.

when asked t’ define yourself exactly, say you are an exact mathematician.

On related news, congratulations to Madonna and Debian.

NP: Ernest Phipps & His Holiness Singers—Shine On Me


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image17:45 Rails框架:PDF开发包ActvieFPDF for Rails 2.1» 天天红玉世界
免费无限存放图片在slide.com!
  • 说明
    • ActvieFPDF插件已经可以在Rails 2.1上运行。该插件完全能够满足企业Web软件的开发应用。上面的图就是使用该插件产生的比较复杂的基于数据库的PDF文件。尤其重要的是,该插件能够很好地支持产生中文的PDF文件。

add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image13:09 A ship in harbor is safe, b...» Projectionist
A ship in harbor is safe, but that’s not what ships are for.

John Shedd


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:38 When General Motors Was Dreaming» Joey Gibson's Blog
The New York Times has a slideshow today of gorgeous old cars called When General Motors Was Dreaming. Some of the cars were just prototypes, but some were production. And all of them had beautiful angles and style. Most cars on the road today are almost identical to every other car. My friend Fred says [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image03:46 As seen on Twitter» James Britt - Code, Content, Caffiene

@Lileks:

Another call to tech upport. I’ve spoken to more people in India this week than Kipling in his lifetime.

add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Fri 15 August, 2008

Click here to bookmark this link.Channel Image09:48 Ever Seen Purple Potatoes?» Joey Gibson's Blog
I have. Last night. I bought a bunch of “fingerling” potatoes and when I sliced the dark-skinned ones, they were purple on the inside. Unfortunately they had a really funky flavor that just didn’t work with the olive oil, rosemary, salt and pepper I put on them before roasting them. They were pretty, but not very [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image09:39 Bloody Hell, the Snail Died» Joey Gibson's Blog
I was wrong about Pokey the snail. He died today. I ran ammonia and Ph tests on the tank water and was shocked by the results. The ammonia test was off the charts. The Ph was also out of whack. I took the filter housing off and scrubbed it with an old toothbrush because it had [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image03:50 He wasn’t always the ...» Projectionist
He wasn’t always the best husband, but he was the best man I’d ever known.

A widow of her husband


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image03:50 Little Boots – Ready ...» Projectionist

Little Boots – Ready for the Floor


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Thu 14 August, 2008

Click here to bookmark this link.Channel Image11:45 Another Day, Another Fish Funeral» Joey Gibson's Blog
As I mentioned two days ago, we had a goldfish die, buried him at sea, and then bought another fish and a snail to keep the remaining fish company. As Tuesday wore on, the new fish, Speedy, wasn’t looking so hot. He was hanging out near the bottom and just not doing much besides breathing, [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image11:25 Michael Phelps - The Man Is a Machine» Joey Gibson's Blog
I’ve watched quite a bit of the Olympics so far, and I continue to be amazed at how Michael Phelps keeps racking up the medals. I just watched him win the semi-final of the 200 Meter Individual Medley. He was in 2nd-ish place for the first three laps, but when he touched for the last [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image11:15 Our Dyson Vacuum Sucks» Joey Gibson's Blog
We have a Dyson vacuum, and it sucks. In both bad and good ways. On the good side, it has better suction, with a far fuller tank, than any vacuum I’ve ever used. It’s also fairly light and easy to push around.  On the negative side, if you should ever happen to go against the nap [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image09:52 Speaking Punctuation» Joey Gibson's Blog
So we’re watching Project Runway (don’t ask) and the designers only have 5 minutes left. Tim Gunn walks in and says Designers! Five Minutes! And some of you are still sewing? Question Mark! I laughed out loud at that. And of course, the way Tim says it, with his “gay lilt,” it’s far funnier than if someone [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image01:36 The Next Ignite Phoenix» James Britt - Code, Content, Caffiene

I’ve been following various blog posts and tweets concerning last night’s Ignite Phoenix, and quite a few people (myself included) have expressed excitement of the next one.

Here’s the thing: Lots of people want a next one, but a next one only happens if people step up and make it so. Jeff and Rodger did a kick-ass job, and a mighty Thanks! to jobing.com (BTW, where’s the second ‘b’ in there? job -> jobbing; jobe -> jobing) for providing the space. But they’re not going to doing this as a regular gig, and it’s unfair to expect that of them.

There’s a special satisfaction in pulling of an event like this, but it’s also work. I run two monthly user groups (Ruby AZ and Refactor Phoenix), used to help organize Refresh, and have instigated two local BarCamps, so I know the drill.

If you think you’re up for this, and want to help drive the next Ignite Phoenix, drop a line to IgnitePhoenix [AT] gmail.com and start asking questions.

If you can offer some sort of sponsorship, speak up. If you can help arrange a good location to host the next event, step up.

Drivers wanted!


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Wed 13 August, 2008

Click here to bookmark this link.Channel Image18:44 Ignite Phoenix Rocked» James Britt - Code, Content, Caffiene

The first-ever Ignite Phoenix ruled. 16 talks, each ~5 minutes, zip zip zip things moved along and the crowd of 100+ was never bored.

I’ve posted my pictures to PicasaWeb.

I had a great time (I was the the click-bot driving the slides, trying to watch a stopwatch while paying attention to the talks) and look forward to the next one, whenever and however that happens.


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image08:48 Etymology of Brooklyn» Projectionist

Tip Etymology of Brooklyn

Brooklyn, New York is named after the Dutch town Breukelen.


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image02:19 Gratitude is a quality simi...» Projectionist
Gratitude is a quality similar to electricity: it must be produced and discharged and used up in order to exist at all.

William Faulkner


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image00:00 ruby gems compatible issue» Suave's Blog
装了 Rails 2.1 以后升级了一些相应的 gems,比如 rubyforge, rubygem 之类。再到一个 Rails 1.2.3 的项目下运行 script/server, 收到错误提示: can’t activate rubyforge (=0.4.4), already activated rubyforge-1.0.0 搜索...
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Tue 12 August, 2008

Click here to bookmark this link.Channel Image00:49 Fish Funeral» Joey Gibson's Blog
For Christmas, my sister-in-law gave my son two goldfish. Without asking us. Needless to say I was not happy about this, but he had them before we knew what was going on. Anyway, he’s been very happy with the fish and has been feeding them the right amount, and talking to them and making sure [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image00:11 RedMine For Rake» { |one, step, back| }

The is now a RedMine setup for Rake, FlexMock and Builder.

RedMine

As part of an effort to get better control of changes to the my open source projects, I’ve setup a RedMine issue tracking site for Rake, FlexMock and Builder. You can find it at http://onestepback.org/redmine.


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Mon 11 August, 2008

Click here to bookmark this link.Channel Image23:51 Ruby Hoedown 2008 Wrap-Up» Lovable Lyle
The second annual Ruby Hoedown was held this past weekend in Huntsville, Alabama. Every time I attend one of these Ruby conferences, I go into it with good intentions to take notes about each presentation so that I can refer back to them later. It never quite works out that way. Luckily for you, Jason [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image23:31 《秒杀十分钟》再之后» 梦想风暴

经过周末的休息,重新回到工作之中,而我面对的依然是那个需要优化的发布过程。正如我在之前提到过的,在上周末结束工作之前,我为这周的工作留下了一个尾巴:需要算分的企业。

回顾一下我在之前列出的公式:
    需要算分的企业 * (真正算分的时间 + 保存历史的时间)

从这个公式中,我们可以清晰的看到,需要算分企业的多少将直接决定循环次数的多少。但需要算分的企业真的能减少,会不会破坏业务逻辑,我们还不是特别清楚。所以,我们先要与我们可爱的BA(业务分析师)进行讨论,因为他们是项目组里面最了解业务的人。目前的逻辑是,只要有新的发布,那就会把与发布相关品牌的所有企业拿出来算分,按照我们的分析,其实没有这个必要,因为这次发布的内容可能并不会影响到有些企业。经过与BA的讨论,BA认同了我们的观点,接下来,要做的就是用实际数据测试一下,如果真的这么做了,会不会有改变。测试的数据,比较让人兴奋,我们随机的做了一次发布,涉及到的企业数就下降到原来的一半,这意味着,运行时间接近缩减到原来的一半。虽然我们需要增加一些逻辑判断企业是否需要算分,但对比于能够削减的时间而言,简直就是微不足道。那个让我们吃了午饭还有空闲的程序,已经大幅度的缩减了,至少现在我们已经敢把所有的程序都跑完了。

继续分析日志,我们又找到一些算分时间特别长的企业,之所以这些企业之前没有发现,主要还是归功于运行时间太长,我们没有勇气运行完所有的程序,或者说,不想偷懒到那种地步。把一个企业单独拿出来算分,运行时间在25秒中以上,其中保存历史大约10秒种,也就是纯粹算分时间在15秒左右。这可是经过之前的优化,否则时间会更长。

我们打开代码继续分析,我和Pair突然发现了一个问题,还是与分类相关。之前提到过,我们一次计算需要算6类的分数,但是,对于我们计算的目标而言,它只可能属于一个分类,所以,其它5类的结果必然没有任何意义。之所以之前计算了所有类别,主要是考虑到它可能会涉及到多个类别,但目前的需求已经统一到一个类别,也就是需求已经变了,但代码没有变,虽然代码很成功的覆盖了目前的情况,但也为之付出了代价。理解了这一点,我们又一次修改了代码,真正算分的操作降到了10秒左右。

从需要算分的企业优化尝到甜头的我们,看到削减大规模计算次数的好处。所以,我们继续试图从目前的代码中发现一些可以削减计算的目标。果不其然,我们还是有机会的。

我们每次发布其实可能只有几个需要算分的目标,但这里的计算却把这个企业所涉及的所有目标全部拿出来算分,这显然是一个非常浪费时间的操作。我们用来测试的企业,之所以被我们找了出来,原因就是它有113个需要算分的目标,而事实上,我们的发布只有1个。不过,之前一直没有保留其它算分目标的计算结果,因为,每次都重新计算,所以,倒也不必保留。不过,现在要想提高性能,我们就不得不采用空间换时间的策略,把计算过的结果保存下来,只有这次发布涉及到的目标才重新计算。我们的选择是在数据库表中增加一个字段保存计算结果,不过,考虑到之前一直没有采用这种方法,我们就在程序中加以处理,当这个字段为空的时候,就重新计算这个字段的结果。第一次跑这个程序的时候,我们并没有明显感觉到程序运行加快,因为数据库表中这个字段都是空,所有的数据都需要重新计算,但第二次计算时,速度明显加快了需要,1秒以内就可以完成。当然这个数字取决于一次发布包含的目标个数,显然,比起10秒好了很多。

我们用这段代码对产品数据进行测试,第一次依然是一个漫长的过程,不过,第二次发布明显快了很多,大约在20分钟左右,所有的操作就宣告完成,对,就是那个曾经耗时几个小时的过程。

我想,这次优化至此就要告一段落了。现在的这段程序优化到已经可以接受的程度了,在最开始的那个公式中,除了保存历史部分,其他部分都已经做了足够的优化。当然,我相信,保存历史部分也可以优化,但目前来说,就到这里了。

有人在《<秒杀十分钟>之后》之后留言:
玩企业应用的,只要精通数据库和SQL就足够了。

我并不是太同意这个说法,从我写的这三篇blog中,可以看出,其实,真正属于SQL优化的少之又少,大部分都是逻辑的分析上。所以,如果有时间抱怨程序设计语言慢(比如Ruby),不妨先考虑一下自己的程序逻辑是不是真的写对了。

做了三天性能优化的工作,这是最近一段时间玩得最High的几天。眼瞅着程序几倍、几十倍的提升着,心里非常痛快,当然,第一天成百上千倍的提升是最快乐的。

这就是程序设计的快乐之处!


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:29 Moving Blog Host» { |one, step, back| }

I am changing host for the One Step Back blog.

It’s Time to Move

This is just a quick little post to let you know that the One Step Back blog is moving. In fact, it has already moved. But don’t worry, we aren’t going far.

Originally this blog was hosted on a shared co-op system run by N2Net. It was dirt cheap and easy to maintain. The down side was that support was sporadic. As the hardware has aged, the Co-op has decided to let the current system run until the hardware dies, and then disolve the co-op.

Today there are tons more hosting opportunities available than there were when the co-op was first formed. I’m now leasing a Linode node and running the blog and other associated software from there. Its almost as inexpensive and the co-op and uptime should be better.

Write now the blog has been moved. As time passes I’ll move the article archive as well. Let me know if anything looks amiss.

—Jim Weirich


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Sun 10 August, 2008

Click here to bookmark this link.Channel Image11:41 undefine method ‘require_gem’» Suave's Blog
最近开始用 Rails 2.1,升级了 gem,之后在以前的 1.2.3 的项目中使用 rake db:migrate,提示 undefined method `require_gem’ for main:Object (NoMethodError) 搜索结果说 require_gem 变成了 gem,有个解决方法是装新...
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Sources