导航

  1. 常用CHM
  2. 订阅
  • 本站大部分内容从网上收集,收集目的仅供研究、学习。涉及版权或不希望收录您的文章请您及时与我联系。
  • 本站IM群,请自行选择。请各位朋友按照自己喜好加入。加入群后请及时发言,防止被清理。谢谢您的合作!!!
  • QQ群:Y①WEB开发(ASP.NET)号码:7351660 QQ群:Y②WEB开发(ASP+.NET)号码:11864905
  • QQ群:Y③WEB开发(DIV+CSS)号码:16610506 QQ群:Y④WEB开发(JS+AJAX)号码:16143998
  • QQ群:Y⑤WEB开发(新手)号码:12777715 MSN群:yaosansi[at]126.com

ASP.NET 4 Breaking Changes

分类: ASP.NET 发布: yaosansi 浏览: 日期: 2011年7月28日

ControlRenderingCompatibilityVersion Setting in the Web.config File ClientIDMode Changes HtmlEncode and UrlEncode Now Encode Single Quotation Marks ASP.NET Page (.aspx) Parser is Stricter Browser Definition Files Updated System.Web.Mobile.dll Removed from Root Web Configuration File ASP.NET Request Validation Default Hashing Algorithm Is Now HMACSHA256 Configuration Errors Related to New ASP.NET 4 Root Configuration ASP.NET 4 Child Applications Fail to Start When Under ASP.NET 2.0 or ASP.NET 3.5 Applications ASP.NET 4 Web Sites Fail to Start on Computers Where SharePoint Is Installed The HttpRequest.FilePath Property No Longer Includes PathInfo Values ASP.NET 2.0 Applications Might Generate HttpException Errors that Reference eurl.axd Event Handlers Might Not Be Not Raised in a Default Document in IIS 7 or IIS 7.5 Integrated Mode Changes to the ASP.NET Code Access Security (CAS) Implementation MembershipUser and Other Types in the System.Web.Security Namespace Have Been Moved Output Caching Changes to Vary * HTTP Header System.Web.Security Types for Passport are Obsolete The MenuItem.PopOutImageUrl Property Fails to Render an Image in ASP.NET 4 Menu.StaticPopOutImageUrl and Menu.DynamicPopOutImageUrl Fail to Render Images When Paths Contain Backslashes Disclaimer

IIRF在WIN2003+IIS6+.NET4.0环境下对于无扩展名重写无效的原因及解决方案

分类: ASP.NET 发布: yaosansi 浏览: 日期: 2011年7月28日

IIRF是Ionic出品的ISAPI Rewriting Filter,专门为IIS服务的URL重写插件,完全开源,完全免费。
官方网站: http://iirf.codeplex.com/

使用IIRF在WIN2003+IIS6+.net2.0环境下使用一直正常,当安装.NET4.0版本后出现对于无扩展名的重写无效的问题,而带有扩展名的重写仍然有效。

经过查看日志,发现原URL /go/16315/44/
会变成 /go/16315/44/eurl.axd/2cbfd6147247e649b30eb7982f10a6bd
也就是无形中多了后面的 eurl.axd/2cbfd6147247e649b30eb7982f10a6bd 部分
为什么会出现这种现象呢?

经过同事积极Google后,在ASP.NET 4 Breaking Changes一文中找到了如下解决办法。
 

安装SQL Server 2008出现“The INSTANCESHAREDWOWDIR command line value was not specified.”错误

分类: SoftWare 发布: yaosansi 浏览: 日期: 2011年7月28日

安装SQL Server 2008 Developer版本,发现更改安装路径到原始路径以外的盘符就会遇到“The INSTANCESHAREDWOWDIR command line value was not specified.”错误而不能继续安装,经过一番搜索,在以下两个地方找到了解决方法:“http://social.msdn.microsoft.com/Forums/en-US/sqlsetupandupgrade/thread/789acf70-2ca7-4338-9c65-e143d223a806”“http://support.microsoft.com/kb/955458/en-us”

Python三目运算,and or陷阱及相应的解决办法

分类: Python 发布: yaosansi 浏览: 日期: 2011年7月6日

原文:http://hi.baidu.com/tuuboo/blog/item/0945d3fc2c4fbe43d6887dbb.html

在C语言中,三目运算经常用到(cond?a:b),非常的简洁,而在Python中不支持这种语法。
但是,可以用Python中and or来实现(这里是有陷阱的,下面会讲到)
我们来看下面几个表达式
>>> False or 1
1
>>> False or 0
0
>>> True or 0
True
>>> True and 1
1
>>>True and 0
0
>>> False and 1
False
 

windows 环境下使用txt2args+gvim 生成多种类型文件

分类: SoftWare 发布: yaosansi 浏览: 日期: 2011年5月13日

txt2tags是使用python开发的GPL文本格式转化工具。写文档时可以专注于内容不怎么去折腾格式,跨平台。 Txt2tags 用很少的标记就能把纯文本文件转换成其支持的各种类型的目标文档。 正如作者所说 : ONE source, MULTI targets重在内容,形式次之。由于txt2args可以生成AsciiDoc及DocBook document ,并且因为python跨平台的特性(当然还是linux系统使用较为广泛),所以越来越得到关注。

nginx 0.8.54/1.0.0 在 cygwin 环境下的编译(包括 nginx_mod_h264_streaming-2.2.7)

分类: Video 发布: yaosansi 浏览: 日期: 2011年4月16日

由于测试需要在WIN平台上进行.264的MP4文件的拖动功能,而nginx windows官方版本不包含nginx_mod_h264_streaming-2.2.7模块,所以才有了本文

二、准备:
 

1、cygwin http://www.cygwin.com/setup.exe

安装库
gcc g++
zlib 库 (gzip 模块需要)
pcre 库 (rewrite 模块需要 )
openssl库 (ssl模块需要)
提示:国外下载库速度较慢,可以使用网易提供的开源站下载
http://mirrors.163.com/cygwin/
 

2、nginx 0.8.54 /1.0.0(在这里yaosansi以0.8.54版本为示例)
 

cd ~
wget http://nginx.org/download/nginx-0.8.54.tar.gz
wget http://nginx.org/download/nginx-1.0.0.tar.gz


3、the H264 Streaming Module for Nginx (version 2)
 

cd ~
wget http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gz
tar -zxvf nginx_mod_h264_streaming-2.2.7.tar.gz

改动 ngx_http_h264_streaming_module.c,将以下内容全部移除或注释掉,否则会遇到 error: 'ngx_http_request_t' has no member named 'zero_in_uri'的错误提示
 

 /* TODO: Win32 */  if (r->zero_in_uri)  {    return NGX_DECLINED;  }

 

Python异常处理

分类: Python 发布: yaosansi 浏览: 日期: 2011年4月12日

Python的异常处理能力是很强大的,可向用户准确反馈出错信息。在Python中,异常也是对象,可对它进行操作。所有异常都是基类Exception的成员。所有异常都从基类Exception继承,而且都在exceptions模块中定义。Python自动将所有异常名称放在内建命名空间中,所以程序不必导入exceptions模块即可使用异常。一旦引发而且没有捕捉SystemExit异常,程序执行就会终止。如果交互式会话遇到一个未被捕捉的SystemExit异常,会话就会终止。

IOError: sys.stdout access restricted by mod_wsgi

分类: Python 发布: yaosansi 浏览: 日期: 2011年4月11日

错误'IOError: sys.stdout access restricted by mod_wsgi'

django 1.3 ImportError: cannot import name receiver

分类: Python 发布: yaosansi 浏览: 日期: 2011年4月11日

在安装django 1.3后,启动Development server 出现如下错误:ImportError: cannot import name receiver出现原因:由于Django多个版本并存造成的。

在Django Admin中增加自定义视图

分类: Python 发布: yaosansi 浏览: 日期: 2011年3月21日

原文:http://www.beardygeek.com/2010/03/adding-views-to-the-django-admin/

The Urls

There are 2 ways to add urls to the admin: the quick and easy way, or the not so quick and easy way.  In this case, as I was only adding a single url, I went for the quick and easy way.  The other way involves extending the get_urls() method of AdminSite, adding to the existing admin url pattern.  I did this:


(r'^admin/mypage/$', 'myapp.views.my_admin_view'),
(r'^admin/', include(admin.site.urls)),


Make sure you add your page before the main admin include.



The View



When you write your view make sure you use the staff_member_required decorator.




from django.contrib.admin.views.decorators import staff_member_required
...
@staff_member_required
def my_admin_view(request):
# view code


When rendering your view, also make sure you pass RequestContext to the template:




return render_to_response('my_template.html',
context_instance=RequestContext(request))


The Template



So that your view looks like it belongs in the admin area, you need to extend the admin base site template:




{% extends 'admin/base_site.html' %}


You’ll also want to add in i18n support, and the admin media:




{% load i18n adminmedia %}


If you want to add in extra styles you can use {% block extrastyle %}, and you could put javascript in {% block extrahead %}.



Adding form date widgets



If you have a form on your page that includes date fields, you might want to have the nice django javascript form widgets. First you need to add the widgets to your form:




from django.contrib.admin import widgets

class AdminForm(forms.Form):
start_date = forms.DateField(label="Start date",
widget=widgets.AdminDateWidget())


Next you need to add in the following to your extrahead block (replace admin-media with whatever you’ve set your admin media url to):




<script type="text/javascript" src="/admin/jsi18n/"></script>
<script type="text/javascript" src="/admin-media/js/core.js"></script>
{{ form.media }}


You also need to add the admin forms css in the extrastyles block:





{{ block.super }}
<link rel="stylesheet" type="text/css" href="/admin-media/css/forms.css" />





Breadcrumbs



If you want to have the breadcrumb trail at the top of the page, you need to create your own breadcrumb:




{% block breadcrumbs %}<div class="breadcrumbs"><a href="/admin/">
{% trans "Home" %}</a> > My View</div>{% endblock %}


Adding a link to the admin index



When I add a link in, I like it to go in one of the right column boxes, so I usually create a new one and put it above the recent actions box. To do this, you need to override the admin index.html file.



Create a directory in your templates directory called admin. Then copy the index.html file from django/contrib/admin/templates to your new directory.



You’ll see a block called ‘sidebar’. Under the ‘content-related’ div, place the following:




<div class="module">
<h2>Admin tools</h2>
<ul class="actionlist">
<li class="changelink">
<a href="/admin/mypage/">My View</a>
</li>
</ul>
</div>


 



哈欠涟涟的中文翻译:http://zjxplq.javaeye.com/blog/921090

正确设置 Vim 的字符编码选项 (gVim/Vim on Win32 中文环境)

分类: SoftWare 发布: yaosansi 浏览: 日期: 2011年3月6日

和所有的流行文本编辑器一样,Vim 可以很好的编辑各种字符编码的文件,这当然包括 UCS-2、UTF-8 等流行的 Unicode 编码方式。然而不幸的是,和很多来自 Linux 世界的软件一样,这需要你自己动手设置。Vim 有四个跟字符编码方式有关的选项,encoding、fileencoding、fileencodings、termencoding(这些选项可能的取值请参考 Vim 在线帮助 :help encoding-names),它们的意义如下:encoding: Vim 内部使用的字符编码方式,包括 Vim 的 buffer(缓冲区)、菜单文本、消息文本等。用户手册上建议只在 .vimrc 中改变它的值,事实上似乎也只有在 .vimrc 中改变它的值才有意义。fileencoding: Vim 中当前编辑的文件的字符编码方式,Vim 保存文件时也会将文件保存为这种字符编码方式(不管是否新文件都如此)。 fileencodings: Vim 启动时会按照它所列出的字符编码方式逐一探测即将打开的文件的字符编码方式,并且将 fileencoding 设置为最终探测到的字符编码方式。因此最好将 Unicode 编码方式放到这个列表的最前面,将拉丁语系编码方式 latin1 放到最后面。 termencoding: Vim 所工作的终端(或者 Windows 的 Console 窗口)的字符编码方式。这个选项在 Windows 下对我们常用的 GUI 模式的 gVim 无效,而对 Console 模式的 Vim 而言就是 Windows 控制台的代码页,并且通常我们不需要改变它。

配置 .vimrc 解决 Vim / gVim 在中文 Windows 下的字符编码问题

分类: SoftWare 发布: yaosansi 浏览: 日期: 2011年3月6日

Vim / gVim 在中文 Windows 下的字符编码有两个问题:默认没有编码检测功能 如果一个文件本身采用的字符集比 GBK 大(如 UTF-8、UTF-16、GB18030),那么其中无法在 GBK 中对应的字符都会出现乱码,保存时会丢失。即使编辑文件时正确检测出文件格式也无济于事。
分页:[«]1[2][3][4][5][6][7][8][9][10][11][12][13][14][15][»]

Powered By Z-Blog 1.8 Walle Build 100427

UNISON UPDATE Copyright 2005-2011 yaosansi'site All Rights Reserved.
辽ICP备05021434号