V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  dreampuf  ›  全部回复第 37 页 / 共 50 页
回复总数  997
1 ... 33  34  35  36  37  38  39  40  41  42 ... 50  
2012-08-19 01:03:01 +08:00
回复了 bitsmix 创建的主题 问与答 一个 javascript 的小问题
转一个,stackoverflow已经有人回答你了。
http://stackoverflow.com/questions/5146591/javascript-wtf-a-string-prototypes-this-doesnt-return-a-string
The following steps are performed when control enters the execution context for function code contained in function object F, a caller provided thisValue, and a caller provided argumentsList:

If the function code is strict code, set the ThisBinding to thisValue.
Else if thisValue is null or undefined, set the ThisBinding to the global object.
Else if Type(thisValue) is not Object, set the ThisBinding to ToObject(thisValue).
Else set the ThisBinding to thisValue
2012-08-08 15:13:26 +08:00
回复了 suckli 创建的主题 Python python如何发送一个数据结构
关于Pickle,我觉得你需要知道更多。顺便广告一枚介绍一些pickle的经验 http://weibo.com/1739612153/ywd7xBsUN
http://ww4.sinaimg.cn/large/67b05ff9jw1dvpaeapg6tj.jpg
本身是图片,嵌入了html。
2012-08-01 23:25:17 +08:00
回复了 Hualin 创建的主题 Python 问 有没有一种方法可以打印出python中的一段特定的代码
将目标代码封装成为代码。
执行前输出 inspect.getsource(targetfunction)
2012-07-31 13:24:47 +08:00
回复了 iwinux 创建的主题 macOS 试用了几个思维导图工具
@iwinux 是的。通过ImageMagick转换为图片的。
2012-07-30 23:28:40 +08:00
回复了 iwinux 创建的主题 macOS 试用了几个思维导图工具
2012-07-29 15:01:03 +08:00
回复了 lusin 创建的主题 程序员 请问如何模拟人的访问行为?
@lusin
说说我知道的实现“关注别人微博”的方式。
1 通过微博开放平台,似乎和你的需求不服,比如帐号来源就是问题。
2 构造请求,自动申请大量帐号,批量的关注。关注的策略可以“拟人化”,按照人的社交行为,只有当其产生一些动作才对其关注。另外,维护这个“自动”可能相当费时费力。
2012-07-29 12:57:51 +08:00
回复了 darasion 创建的主题 程序员 如何保证整个团队的代码质量呢?
《代码匠艺》里有一章描写了Coder中不同人。
里面也针对不同的用户给出了一些很好的建议。

如果作为普通员工,第一件事情就是姿态摆好,不要把自己限定到一个“普通员工”中,上面的设计傻X,你就直接反驳,直到给你一个满意的答复为之。但要对事不对人,把整体项目方向把握才是公司看重的。其实没有最好的方案,大家一致同意的才是团队进行最好的,哪怕坑,吃一堑长一智,下次还可以做得更好。

作为Leader,把握“好”与“坏”,注重团队内部的意见,及时给与反馈,技术上辅导团队成员,多做培训,团队内部多交流沟通。培养有“潜力”的好Coder。

另外,我始终觉得,如果只是因为环境不行,而直接换一个环境的行为,怎么说,都感觉有点弱。
“要么我改变你们这群害群之马,要么把我开除”,这是我工作的时候抱有的决心。
2012-07-29 12:40:56 +08:00
回复了 lusin 创建的主题 程序员 请问如何模拟人的访问行为?
似乎是个悖论。
像以往一样正常态的访问吗?但是模拟后不就不正常了么。

还是说你想要达到某个访问量级的目的呢?
2012-07-28 18:55:23 +08:00
回复了 zyyzj 创建的主题 程序员 大家觉得最能体现程序员特质的签名是什么?
Hello World!
2012-07-27 11:13:07 +08:00
回复了 jerain 创建的主题 问与答 你对张小龙同志最近的经验分享,有什么所想?
@liuxurong 第二条,是个悖论。类似“我说谎”。

赞同楼主第一条,把自己的一些想法分享出来就是挺难得的。
2012-07-27 11:10:45 +08:00
回复了 wangkangluo1 创建的主题 程序员 来来来 调试重于开发 摆摆大家常用的的调试技巧
1. 单步调试没法复用,不保值
2. 单步调试比设置Log的要求更低,更容易发生在不理解的情况下的修改
3. 非本机错误,很难(带价很高)调试
2012-07-25 18:08:20 +08:00
回复了 laskuma 创建的主题 分享发现 这货会是新一代灰鸽子吗?
@TaoTao
@kojp
赞 邪八 ,比起其他的Hacker站,邪八提供的文章非常硬
2012-07-23 22:30:36 +08:00
回复了 darasion 创建的主题 程序员 会不会 越是提前消灭 bug ,就越是没有绩效?
撸起自己的袖子,露出洁白的双手,勇于去擦别人肮脏的屁股
2012-07-21 11:53:19 +08:00
回复了 levon 创建的主题 Flask 看Flask教程关于Pluggable Views的问题
碰巧在看Flask的实现。实质是将一个Class Instance 转换为一个(或者多个,随Class 的dispatch_request方法的实现而不同)视图。
直接上代码或许比文档更直接。

@classmethod
def as_view(cls, name, *class_args, **class_kwargs):
"""Converts the class into an actual view function that can be
used with the routing system. What it does internally is generating
a function on the fly that will instanciate the :class:`View`
on each request and call the :meth:`dispatch_request` method on it.

The arguments passed to :meth:`as_view` are forwarded to the
constructor of the class.
"""
def view(*args, **kwargs):
self = view.view_class(*class_args, **class_kwargs)
return self.dispatch_request(*args, **kwargs)

if cls.decorators:
view.__name__ = name
view.__module__ = cls.__module__
for decorator in cls.decorators:
view = decorator(view)

# we attach the view class to the view function for two reasons:
# first of all it allows us to easily figure out what class based
# view this thing came from, secondly it's also used for instanciating
# the view class so you can actually replace it with something else
# for testing purposes and debugging.
view.view_class = cls
view.__name__ = name
view.__doc__ = cls.__doc__
view.__module__ = cls.__module__
view.methods = cls.methods
return view


使用举例:

class MethodView(View):
"""Like a regular class based view but that dispatches requests to
particular methods. For instance if you implement a method called
:meth:`get` it means you will response to ``'GET'`` requests and
the :meth:`dispatch_request` implementation will automatically
forward your request to that. Also :attr:`options` is set for you
automatically::

class CounterAPI(MethodView):

def get(self):
return session.get('counter', 0)

def post(self):
session['counter'] = session.get('counter', 0) + 1
return 'OK'

app.add_url_rule('/counter', view_func=CounterAPI.as_view('counter'))
"""
__metaclass__ = MethodViewType

def dispatch_request(self, *args, **kwargs):
meth = getattr(self, request.method.lower(), None)
# if the request method is HEAD and we don't have a handler for it
# retry with GET
if meth is None and request.method == 'HEAD':
meth = getattr(self, 'get', None)
assert meth is not None, 'Unimplemented method %r' % request.method
return meth(*args, **kwargs)
换个环境吧。
2012-07-16 19:04:16 +08:00
回复了 sofish 创建的主题 分享创造 翻译两个JS相关文档:idiomatic.js 和 Express(Node.js)
感谢!
2012-07-14 23:11:07 +08:00
回复了 tioover 创建的主题 Django App到底是什么东西!
一个project下面可以有多个app
app是按照网站业务不同的划分,比如博客,论坛,神马的。

https://docs.djangoproject.com/en/1.4/intro/tutorial01/

Projects vs. apps
What's the difference between a project and an app? An app is a Web application that does something -- e.g., a Weblog system, a database of public records or a simple poll app. A project is a collection of configuration and apps for a particular Web site. A project can contain multiple apps. An app can be in multiple projects.
2012-07-13 10:37:24 +08:00
回复了 colorday 创建的主题 分享发现 560个优雅的矢量应用图标团购,20元/人,7人即可成团
已经卖出去10件了
1 ... 33  34  35  36  37  38  39  40  41  42 ... 50  
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   804 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 39ms · UTC 21:49 · PVG 05:49 · LAX 13:49 · JFK 16:49
♥ Do have faith in what you're doing.