Lyrics Server OnLiNe!

忙了一个周末,终于让歌词服务器上线了!

先是在windows机器下用vc写,调试比较方便。网页用PHP真是麻烦,搞不明白PHP的对象、数组是怎么写的,其实是刚开始的时候连变量怎么写都不是很清楚,还好看过不多久,立即翻出电子书来查查就能对付了。

[@more@]

在本机上配置apache也花了不少时间,不过始终不完全明白rewrite,配置出来总是有问题,算了,不用rewrite便是了。

忘记了早点传歌词数据到服务器上,传送的时候才叫痛苦,10Kbps,压缩后的数据138M(30万首歌词),等了N久。

最后在服务器上编译歌词服务器(Linux),select函数,Windows下第一个参数是没有意义的,所以之前就随便写个0了,而Linux下必须设置为最大的FD+1,网络慢,vi用起来真叫个痛苦!甚好,之前差MSDN的时候,就意识到这个问题,要不等用gdb远程调试找出问题来,估计已经自己先疯了!

感觉PHP对socket支持太原始了,基本上就是把操作系统的服务简单的提供给用户。连现成的htonl这样的函数都要自己先弄,真是麻烦。不过好在,对XML支持挺好的,SimpleXML简单易用,如果没有这个东西,在歌词服务器和PHP之间按照之前设想的TVL编码,估计又要多抽一包烟才搞得定了。

歌词服务器可以暂时告一段落了,预留问题暂时解决不了--- STL multimap占用内存太厉害了,索引的数据只有30MB,结果程序占用内存100M左右。可以稍微改进一下索引,估计能减少10~20MB内存占用,意义不大,先不弄了,等到歌词多到内存受不了再说吧。

正在听这首歌曲,留个纪念:

Kid Rock
Rock N Roll Jesus
All Summer Long

It was 1989, my thoughts were short my hair was long
Caught somewhere between a boy and man
She was seventeen and she was far from in-between
It was summertime in Northern Michigan
Ahh Ahh Ahh
Ahh Ahh Ahh

Splashing through the sand bar
Talking by the campfire
It's the simple things in life, like when and where
We didn't have no internet
But man I never will forget
The way the moonlight shined upon her hair

[Chorus:]
And we were trying different things
We were smoking funny things
Making love out by the lake to our favorite song
Sipping whiskey out the bottle, not thinking 'bout tomorrow
Singing Sweet home Alabama all summer long
Singing Sweet home Alabama all summer long

Catching Walleye from the dock
Watching the waves roll off the rocks
She'll forever hold a spot inside my soul
We'd blister in the sun
We couldn't wait for night to come
To hit that sand and play some rock and roll

While we were trying different things
And we were smoking funny things
Making love out by the lake to our favorite song
Sipping whiskey out the bottle, not thinking 'bout tomorrow
Singing Sweet Home Alabama all summer long
Singing Sweet Home Alabama all summer long

Now nothing seems as strange as when the leaves began to change
Or how we thought those days would never end
Sometimes I'll hear that song and I'll start to sing along
And think man I'd love to see that girl again

[Repeat Chorus x2]

Singing Sweet Home Alabama all summer long
Singing Sweet Home Alabama all summer long
Singing Sweet Home Alabama all summer long
Singing Sweet Home Alabama all summer long

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21090027/viewspace-1018798/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/21090027/viewspace-1018798/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值