V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  otakustay  ›  全部回复第 282 页 / 共 287 页
回复总数  5732
1 ... 274  275  276  277  278  279  280  281  282  283 ... 287  
MAC的散热虽然不好但还能接受,悲哀的是MAC产生发热的情况本身就比windows多,比如Flash,这直接导致我不敢买 iMac 替换家里台式机,不然我拿什么看视频
2013-07-12 11:43:40 +08:00
回复了 pythonee 创建的主题 程序员 javascript实例对象的constructor属性值是怎么来的?
@pythonee
是这样的,f2.__proto__.constructor === {}.constructor,但是{}.constructor是怎么来的呢?{}本身没有constructor(这个是肯定的,你用({}).hasOwnProperty('constructor')试),所以是({}).__proto__.constructor,也就是Object.prototype.constructor,所以还是顺着上去的

所谓“有”还是“没有”,是用.hasOwnProperty('constructor')来检测的,因此在每一级试下这个方法就行了

一种证明他是“顺着找”的方法是

var f2 = new Foo();
console.log(f2.constructor); // function Object() { [native code] }
Object.prototype.constructor = 'fuck';
console.log(f2.constructor); // 'fuck'
2013-07-12 10:51:45 +08:00
回复了 pythonee 创建的主题 程序员 javascript实例对象的constructor属性值是怎么来的?
@pythonee constructor就是一个普通的属性,任何属性都是通过原型链来找的,没有例外,不是很理解你是怎么得了“没有顺着原型链”这个结论的……
2013-07-12 10:00:48 +08:00
回复了 pythonee 创建的主题 程序员 javascript实例对象的constructor属性值是怎么来的?
@pythonee 我们的结果是一样的啊,最后都是追溯到Object.prototype.constructor,即Object本身,Object本身就是Object() { [native code] }

原型链的查找用一句话概括,就是“自己没有找自己原型,原型没有找原型的原型”,因此过程是

f2.constructor(没有) -> f2.__proto__(就是Foo.prototype).constructor(没有) -> f2.__proto__.__proto__(就是Object.prototype).constructor(有) -> Object
@sivacohan ECMA262 V5关于sort的默认实现的原文在这里:

When the SortCompare abstract operation is called with two arguments j and k, the following steps are taken:

Let jString be ToString(j).
Let kString be ToString(k).
Let hasj be the result of calling the [[HasProperty]] internal method of obj with argument jString.
Let hask be the result of calling the [[HasProperty]] internal method of obj with argument kString.
If hasj and hask are both false, then return +0.
If hasj is false, then return 1.
If hask is false, then return –1.
Let x be the result of calling the [[Get]] internal method of obj with argument jString.
Let y be the result of calling the [[Get]] internal method of obj with argument kString.
If x and y are both undefined, return +0.
If x is undefined, return 1.
If y is undefined, return −1.
If the argument comparefn is not undefined, then
If IsCallable(comparefn) is false, throw a TypeError exception.
Return the result of calling the [[Call]] internal method of comparefn passing undefined as the this value and with arguments x and y.
Let xString be ToString(x).
Let yString be ToString(y).
If xString < yString, return −1.
If xString > yString, return 1.
Return +0.

标准就规定了要把数组中每个转成字符串再比较,因此无论如何这不能算是“错误”,从来没有人说数字组成的数组排序一定要按数字大小来吧?
2013-07-11 23:29:56 +08:00
回复了 lusin 创建的主题 问与答 请问国外的后台模板是不是大部分没有像国内局部刷新
强词夺理的话可以说:
1. 国外没有动不动清你缓存的某些浏览器
2. 国外网速快

其实有时候觉得国外站的体验真的不怎么样,我一直认为支付宝的体验甩Paypal几条街(当然我已经因为这观点被无数人BS过)
2013-07-11 23:19:52 +08:00
回复了 pythonee 创建的主题 程序员 javascript实例对象的constructor属性值是怎么来的?
一个函数建立的时候,就有.prototype.constructor指向函数本身
你改了prototype,新的prototype上没有constructor,因此f2.constructor在f2上没有,在Foo.prototype上也没有,就会再向上找Object.prototype上,在好运边能找到,因此就是Object这个东西
要我也必定选键盘,MBP这恶心人的键盘……我用黑轴打代码速度能比MBP的自带键盘直接上一个级,而且也不伤手指关节(这很重要!)
@shao 关键在于,当内存不够的时候,Aperture能不能从他吃掉的2.3G里释放出1.3G出来让给别的需要的应用,如果不行,那确实是Aperture内存占用过高,毕竟OSX和iOS不一样是多进程的,要考虑4G内存的air怎么开这东西,要考虑我开Aperture再开Motion再开PS会怎么样
MS Office号称支持retina,但支持得一点也不完全啊,我的office 365上各种模糊,比如word的“样式”那一块几个示例图

期待office2014
2013-07-07 22:01:47 +08:00
回复了 refresh 创建的主题 问与答 这种统计图表是怎么做出来的?
花在开会上了
预估展现量吧,至于是总的还是一定时间的,和不同系统和售卖方式有关吧,一般来说是一定时间的,不然预估个毛线
2013-07-02 21:29:32 +08:00
回复了 wingoo 创建的主题 macOS mac下触摸板如何实现地图的放大缩小操作? 在浏览器中
就是标准的鼠标滚轮操作,在触摸板上就是双指滑动
2013-07-02 12:32:37 +08:00
回复了 davepkxxx 创建的主题 Node.js node.js做开发时,通常使用什么作为模板引擎?
mustache
handlebars
ejs
jade

一般就是这4个吧?
2013-06-30 00:56:09 +08:00
回复了 adspe 创建的主题 分享发现 Sublime Text 3 Public Beta
传说retina支持改良了,但是没插件啊混蛋!
如果只是单个页面,且不访问amazon接口这页面对用户来说没价值的话,外面nginx上做个throttle就搞定了

如果是多个页面都用上amazon API,且没连上API这页面用户还是要看的话,在API级别上自己做throttle,这个比较麻烦,所以干脆再把这个API代理一下做成一个http service,再上nginx做throttle- -
box-shadow因为不记入盒模型,当border用难免产生一些不便,几个方案比较合适:
1. 用:before造伪元素,好处是支持IE8,缺点是麻烦
2. border-image+gradient,缺点是IE到11才有
3. 背景图,全兼容,图片也不用大,版本高点的浏览器datauri写在css中支持到IE8,低版本的外链图片永久缓存
4. gradient做背景图,不过背景图同样没记在盒模型中要留出padding给它,没啥优势
5. outline,和box-shadow没啥区别

所以我还是推荐背景图算了……
1 ... 274  275  276  277  278  279  280  281  282  283 ... 287  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1193 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 87ms · UTC 18:27 · PVG 02:27 · LAX 11:27 · JFK 14:27
Developed with CodeLauncher
♥ Do have faith in what you're doing.