我有一个新的作者网站,我希望从我之前使用Apache重写的域中提供,以便将流量反弹到我的亚马逊网站,[R = 301,L],我想将其作为我自己的网站提供.我至少还有一个新的域名.
是否存在特定的持续时间,特别是Chrome将存储301缓存重定向?其他一些问题,浏览器缓存HTTP 301s需要多长时间?以及不同浏览器如何实现301重定向?,问,并给出答案,一些浏览器不缓存,一些缓存用于会话,Chrome和IE10缓存的方式将在浏览器重启后继续存在,但不指定多长时间.比其他测试的浏览器更长,但数量仍未指定.
那么Chrome存储301重定向需要多长时间?引用的问题没有说明Chrome或IE10的含义.
google-chrome http-redirect http-response-codes http-status-code-301
我从最初的Pinax 0.7项目得到一个错误页面:
ImportError at /
No module named simple
Request Method: GET
Request URL: http://stornge.com:8000/
Django Version: 1.5
Exception Type: ImportError
Exception Value:
No module named simple
Exception Location: /home/jonathan/clay/../clay/urls.py in <module>, line 3
Python Executable: /home/jonathan/virtual_environment/bin/python
Python Version: 2.7.3
Python Path:
['/home/jonathan/clay/apps',
'/home/jonathan/virtual_environment/local/lib/python2.7/site-packages/pinax/apps',
'/home/jonathan/clay',
'/home/jonathan/virtual_environment/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg',
'/home/jonathan/virtual_environment/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg',
'/home/jonathan/virtual_environment/lib/python2.7',
'/home/jonathan/virtual_environment/lib/python2.7/plat-linux2',
'/home/jonathan/virtual_environment/lib/python2.7/lib-tk',
'/home/jonathan/virtual_environment/lib/python2.7/lib-old',
'/home/jonathan/virtual_environment/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk',
'/home/jonathan/virtual_environment/local/lib/python2.7/site-packages',
'/home/jonathan/virtual_environment/local/lib/python2.7/site-packages/PIL']
Server time: Mon, 25 Mar 2013 13:16:33 -0400
Run Code Online (Sandbox Code Playgroud)
它正在跟踪的行,urls.py:3,是:
from django.views.generic.simple import direct_to_template
Run Code Online (Sandbox Code Playgroud)
如何更改导入或使用它的区域:
urlpatterns = patterns('',
url(r'^$', direct_to_template, {
"template": "homepage.html",
}, …
Run Code Online (Sandbox Code Playgroud) 我希望能够在我可以计算的矩形区域中居中单行文本.我期望在画布上的二维几何中做的一件事就是将宽度未知的东西居中.
我听说作为一种解决方法,您可以在HTML容器中创建文本,然后调用jQuery的width()函数,但是我没有正确处理文档正文的瞬间添加?并得到宽度为0.
如果我有一行文本,比填充屏幕中的大部分宽度短得多,我如何知道在我知道的字体大小的画布上它有多宽?
TIA,
在http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jquery_ui_methods上有关于构建jqGrid列选择器的说明('dlog_opts是要传递给"dlog"的选项对象,或者(更多)很可能)一个创建选项对象的函数.默认为ui.dialog')生成一个合适的选项对象,但不是完整的工作代码; 没有提供所需功能的示例.
是否有一个完整的工作示例来构建一个允许隐藏,显示和移动列的jqGrid列选择器?
我试图评估以下制表符缩进的字符串:
'''for index in range(10):
os.system("echo " + str(index) + "")
'''
Run Code Online (Sandbox Code Playgroud)
我明白了,"有一个错误:语法无效,第1行"
有什么抱怨的?我是否需要缩进以匹配eval()语句,或将其写入字符串文件或临时文件并执行该操作或其他内容?
谢谢,
我已经阅读了以下内容,从一步仿射变换绕一点旋转?:
CGAffineTransform transform = CGAffineTransformMakeTranslation(x, y);
transform = CGAffineTransformRotate(transform, a);
transform = CGAffineTransformTranslate(transform,-x,-y);
Run Code Online (Sandbox Code Playgroud)
然而,当我这样做时,转换的图像遍布地图,很少在屏幕上.
我已经尝试了一个系统,它将放置图像; 如果运行循环并放置多个值,则会出现螺旋线.然而,虽然我可能最终能够解开图像旋转和我希望它们旋转的点之间的关系,但我想要求"我在这里有一个图像的最佳解决方案;我认为这一点是它的中心;我希望它围绕它的中心旋转这个数量,但不会因此而移位."
我正在尝试修改http://jonathansCorner.com/ancient-clock/的端口,现在我正在尝试放置时针.所有尝试在上面进行歌曲和舞蹈,并将其翻译成其中心位于所需中心的尝试都失败了.
对于这个时钟的手,我怎么能说"我想让手在下面的旋转中"并将它们放在中心周围?
- 编辑 -
编写此代码的关键部分是尝试使用图层来响应评论,其中包括:
UIImage *hourHandImage = [UIImage imageNamed:@"hour-hand.png"];
UIImageView *hourHandView = [[UIImageView alloc] initWithImage:hourHandImage];
float hourRotation = .5;
hourHandImage = [UIImage imageNamed:@"hour-hand.png"];
hourHandView = [[UIImageView alloc] initWithImage:hourHandImage];
CGAffineTransform transform = CGAffineTransformMakeTranslation(centerX - 21, -centerY - 121);
// transform = CGAffineTransformRotate(transform, hourRotation);
// transform = CGAffineTransformTranslate(transform, 2 * centerX, 2 * centerY);
hourHandView.transform = transform;
hourHandView.layer.anchorPoint = CGPointMake(centerX, …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Django的帐户系统,包括@login_required装饰器.我的settings.py文件包含django.contrib.auth
,我已经完成了syncdb.
Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/accounts/login/?next=/
Using the URLconf defined in dashboard.urls, Django tried these URL patterns, in this order:
^$ [name='home']
The current URL, accounts/login/, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
Run Code Online (Sandbox Code Playgroud)
在尝试@ login_required-decorate我的主视图后,我看到了上面的内容.
它似乎很窒息,因为它被重定向到accounts/login /,我还没有在urls.py中准备好.
我可以添加到urls.py或其他地方,以便login_required装饰器将执行其通常的行为?
谢谢,
我有两个同样长的数据数组的数据集,或者我可以创建一个两项条目数组,我想计算数据所代表的相关性和统计显着性(可能紧密相关,或者可能有无统计学意义的相关性).
我用Python编程并安装了scipy和numpy.我在Python中查看并发现了计算Pearson相关性和重要性,但这似乎希望对数据进行操作,使其落入指定范围.
我假设,有什么方法可以让scipy或numpy给出两个数组的相关性和统计显着性?
我试图调用/ save_calendar,映射到pim_calendar.save_calendar(),它开始于:
@csrf_exempt
@login_required
def save_calendar(request):
functions.ensure_profile_exists(request.user)
now = time.localtime(time.time())
if request.POST.has_key('description') and request.POST['description']:
description = request.POST['description']
else:
description = 'Unspecified event'
...
Run Code Online (Sandbox Code Playgroud)
错误发布在下面,这是目前唯一的@csrf_exempt函数(尽管其他人可能会效仿).
我如何将NoneType传递给csrf_exempt装饰器?
AttributeError at /save_calendar 'NoneType' object has no attribute 'csrf_exempt' Request Method: POST Request URL: http://localhost:8000/save_calendar Django Version: 1.3.1 Exception Type: AttributeError Exception Value: 'NoneType' object has no attribute 'csrf_exempt' Exception Location: /usr/local/Cellar/python/2.7/lib/python2.7/site-packages/django/views/decorators/csrf.py in wrapped_view, line 40 Python Executable: /usr/local/bin/python Python Version: 2.7.0 Python Path: ['/Users/jonathan/pim', '/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/distribute-0.6.14-py2.7.egg', '/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/pip-0.8.1-py2.7.egg', '/usr/local/Cellar/python/2.7/lib/python27.zip', '/usr/local/Cellar/python/2.7/lib/python2.7', '/usr/local/Cellar/python/2.7/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/usr/local/Cellar/python/2.7/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7/lib/python2.7/lib-old', '/usr/local/Cellar/python/2.7/lib/python2.7/lib-dynload', …
我正在尝试运行Gunicorn,我遇到了一个错误(粘贴在下面).目前它看起来像Gunicorn或其中一个依赖项正在尝试读取settings.LOGGING,而settings.py文件似乎没有定义settings.LOGGING.
所以我想知道我可以添加什么样的文字或其他代码,以便Gunicorn +依赖项具有他们认为需要的内容.
代码粘贴:
(socialenv)jonathan@li393-189:~/directory$ python manage.py run_gunicorn 0.0.0. 0:8000 2013-04-14 17:40:13 [26464] [INFO] Starting gunicorn 0.17.2 2013-04-14 17:40:13 [26464] [INFO] Listening at: http://0.0.0.0:8000 (26464) 2013-04-14 17:40:13 [26464] [INFO] Using worker: sync 2013-04-14 17:40:13 [26469] [INFO] Booting worker with pid: 26469 2013-04-14 17:40:13 [26469] [ERROR] Exception in worker process: Traceback (most recent call last): File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 485, in spawn_worker worker.init_process() File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 100, in init_process self.wsgi = self.app.wsgi() File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 103, in wsgi self.callable = self.load() File …
python ×6
django ×4
javascript ×2
jquery ×2
canvas ×1
correlation ×1
decorator ×1
django-views ×1
eval ×1
fonts ×1
gunicorn ×1
html5 ×1
ios ×1
jqgrid ×1
jquery-ui ×1
numpy ×1
objective-c ×1
pinax ×1
python-3.x ×1
scipy ×1
statistics ×1