About archer to download link

Though this problem since a simple event page develop work, and realized could not a good way to change the header, so the phper hacked it, here’s the code

if ($act == 'download')
{
	$url = isset($_REQUEST['u']) ? $_REQUEST['u'] : exit;
	//$musciname = isset($_REQUEST['n']) ? $_REQUEST['n'] : exit;
	//$name = urldecode($musciname);

	$ext = getExt($url);
	$mod = "#^http://i\.xx\.cn/live/mp3/\d{2}/\d{2}/\d{22}\.{$ext}$#i";

	if (preg_match($mod, $url) && strlen($url) == '55')
	{
		$name = date('YmdHis').'.'.$ext;
		header("Content-Type:application/x-msdownload");
		header('Content-Type:text/html;charset=gbk');
		header("Content-Disposition:attachment;filename={$name}");
		readfile($url);exit;
	}
	exit;
}

Very simple way on web server, but he missed something, the filename needs to something encode before used in web browser, but not the urldecode. If the file have space, the firefox still offer a %20 back, but IE not. Still not solved since now…

IndexedDB, Native Client and Web Designerache

What we have now, this topic is easy to answer 1 year ago but now is impossible. There are too many choices and fallacious names post on the every standard every day. Each of them is faddish, they look audacious, and when the web designer first look those API, they think can be do everything on web browser. But after the fanatic, the most instigate service offer, like Google’s Chrome and Mozilla’s Firefox, they seems change more from this year.

1,693 changes landed last week, 650 in WebKit’s repositories and 1,043 in Chromium’s, they among the CSS selector and IndexedDB, both look common change though these years, but the Chrome not think that. It has released the Native Client SDK last week, they want more C++ programmer join the web development, and not web designer still write those low-speed code. Not say the Google don’t focus on web-frontend any more, but when you try to think 3 big web empire try to make the web full of the Javascript, it’s so damn feigned.

And the fact is, the more years we in this place, the more we feel about our fantastical job, is based on the basic, the C++ codes. Our job is just use those API and make a good face to the web world. But the Whatwg and other company groups not try to let you know about it, they offer good API and make you feel you can change the world. When you realize it, you will start to headache, and feel yourself like a media clown developer, I try to call it Web Designerache.

When you hear the 360 or other web browser companies abandon the IE6.0, not to think the web world future is yours. Go back your seat and call yourself web designer again, the web has a fetid ferment future belong us and  also has a real path to the classical programmer. Think about APIs after you used it.

Javascript acts the Ruby new on Object

Object.defineProperties(Object.prototype, {

    new: {value: function(){
        var self = Object.create(this);
        self.initialize.apply(self, arguments);
        return self;
    }},
    initialize: {value: function(){}},
    instanceof: {value: function(Class){
        function f(){}
        f.prototype = Class;
        return this instanceof f;
    }},
    extends: {value: function(){
        var obj, i, prop, l;
        obj = Object.create(this);
        for (i=0,l=arguments.length; i<l; i++)
            for (prop in arguments[i])
                obj[prop] = arguments[i][prop];
        return obj;
    }},
});
Object.defineProperty(Function.prototype, "new", {value:void 0});

Still can increase, I will make another diverge later.

Web Resource Optimizer for Java – wro4j

just wonder how it works

http://code.google.com/p/wro4j/

2012-5-10 散户潮

连续几个涨停的145出现了新消息

2012年5月10日ST国创停牌一小时

600145 ST国创 2012-05-10 9:30-10:30 刊登股票交易异常波动公告 …     [2012-05-10]
群内摩拳擦掌, 相谈6.37挂入全单买入

突然有人恶意制造新闻:

跌 10:29:02
145涉嫌内幕交易,即将连续跌停

大家犹豫之际, 时间已经错过~~

虽然散户本身也没什么可能性买到啦(~

Book Smashing(1): 悪魔の圏内

悪魔の圏内(テリトリー) (角川文庫) [文庫] 森村 誠一 (著)

Can’t explain that book clearly, the whole case is beyond a cat, and the cat is always be abandoned by the main cast. When the terrible murder happened, the cat is suddenly appearance and take all the path about it. So, how the writer treat the cat like the main witness as the most biggest question along the book to the end, the truth is sad and disappointed, you never see a puffy story like this, let alone this book is written by a 55 year-old man who have already wrote the “Life Trilogy”.

Sina Qweibo now reborn in Tencent weibo

I have seen this octopus long time before…when sina still have a product named Qweibo.

Alison Moyet : That Ole Devil Called Love

Wired Anime…with a squint singer – - and finally the devil and angel live together XD

jQuery Easing Plugin

Back to Beijing again, say goodbye to my lovely food in TJC.

So I just check the Japan websites in this morning usually, it all seems abandon the Flash into the Javascript control the page effects, they are: Tierra, Star Wars and Smart4me. They all used the jQuery Easing try to imitate the Flash effect most common used in Web Development.

And I realize they used the same plugin in their pages. It called jQuery Easing Plugin, so I download it and read it’s resource, and here it is.

jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend(jQuery.easing, method:{});

And that’s a a extend from the jQuery animate method, and extend the swing to the jswing, and offer a lot of animate algorithm:

	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	...
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},

really simple than any other plugin on jQuery lib, and I also found some examples by jQuery UI to show how those math function effect in real view.

经济学原理 1.2-1.3

继续上周的学习, 这样第一章就结束了wwww:)

1.2 人们如何交易

1.2.1 原理五: 贸易可以使每个人的状况都变得更好–贸易可以使每个人都可以专门从事自己最擅长的工作

1.2.2 原理六: 市场通常是组织经济活动的一种好方法.

市场经济(Market Economy): 当许多企业和家庭在老物市场上进行交易时, 通过他们的分散决策配置资源的经济.

*计划经济的失败在于计划着缺乏关于消费者嗜好和生产者成本的必要信息.

1.2.3 原理七: 政府有时可以改善市场结果

市场经济需要实施产权的制度(ProperyRights)

因为市场会出现市场失灵(Market Failure),比如外部性(Externality)个人对他人福利的刺激, 市场势力(Market Power), 对市场价格的影响

1.3 整体经济如何运行

1.3.2 原理八: 一国的生活水平取决于他生产物品与劳务的能力

几乎所有生活水平的差别都可以归因于各国的生产率(Productivity) – 即每一个单位劳动投入所生产的物品与劳务数量的差别.

原理九: 但政府发行了过多货币时, 物价上升

通货膨胀(Inflation), 指的就是经济中物价总水平的上升

1.3.3 原理十: 社会面临通货膨胀与失业之间的短期权衡取舍

通货膨胀可以改善就业, 减少失业率, 但只是在短期, 长期可能会让通货膨胀率持续上升, 超出政府能力

这里涉及到经济周期(Business Cycle), 指的就是就业和生产等经济活动的波动