重文's profile阿文的随笔PhotosBlogListsMore ![]() | Help |
阿文的随笔Awen's essays |
||||||||||||||||||||||||||||||||||||||||||||||||
|
6/24/2009 The ultimate jQuery Plugin List jQuery终极插件列表The ultimate jQuery Plugin ListjQuery终极插件列表
jQuery is definitely my favourite
Javascript Library and this ultimate jQuery Plugin List is for all other jQuery
Lovers out there. At the moment there are about 240+ awesome Plugins in
the List I’m sure that there are a lot of other plugins out there – so
if you knew one that’s not in the list please post a comment and i will add it.
Thanks! File upload 文件上传Ajax File Upload Form Validation 表单验证jQuery Validation Form – Select Box stuff 表单-选取框jQuery Combobox Form Basics, Input Fields, Checkboxes etc. 表单基本、输入框、选择框等jQuery Form Plugin Time, Date and Color Picker 时间、日期和颜色选取jQuery UI Datepicker Rating Plugins 投票插件jQuery Star Rating Plugin Search Plugins 搜索插件Autocomplete Box Inline Edit & Editors 编辑器jTagEditor Audio, Video, Flash, SVG, etc 音频、视频、Flash、矢量图等jMedia – accessible multi-media embedding Photos/Images/Galleries 照片/图像/画廊ThickBox Google Map Google地图jQuery Plugin googlemaps Games 游戏Tetris with jQuery Tables, Grids etc.表格,网格等UI/Tablesorter Charts, Presentation etc. 图表,演示等Flot Border, Corners, Background 边框,圆角,背景jQuery Corner Text and Links 文字和超链接jQuery Spoiler plugin Tooltips 工具提示jQuery Plugin – Tooltip Menus, Navigations 菜单,导航jQuery Tabs Plugin – awesome! [demo nested tabs] Accordions, Slide and Toggle stuff 拉动,幻灯和翻转jQuery Plugin Accordion Drag and Drop 拖放UI/Draggables XML XSL JSON FeedsXSLT Plugin Browserstuff 浏览器Wresize – IE Resize event Fix
Plugin Alert, Prompt, Confirm Windows 警告框,提示框,确认窗口jQuery Impromptu CSSjQuery Style Switcher DOM, Ajax and other jQuery plugins DOM,AJAX和其它JQuery插件FlyDOM 4/23/2009 javascript dump在做web开发中,调试javascript数据往往是一件很头痛的时间,js没有内置例如PHP 的 print_r() 或
var_dump() 的函数
在debug的时候,得写一大串alert() 最近在网上发现澳大利亚有人写了一个javascript dump,支持String/Number/Boolean/Object/Array/Function数据类型的打印,非常好用 Dump Method
The Dump method is based on one of the tags available in Coldfusion ( <cfdump>) providing the ability to display simple and complex variables in a user friendly way that is perfect for debugging/inspecting data. There is no way to do this with javascript and often I had wanted a method to do this. This method will do just that allowing for an infinite amount of data nesting complete with color coding for different data types, the ability to show/hide the data's type (String/Number/Boolean/Object/Array/Function), expandable and collapsible tables/keys and cross browser support. Click on the buttons bellow to see some examples in action,
toggle the Show Data Types box to see javascript data typing in action (not
possible in Coldfusion).
Thanks to John Wilson for providing the jQuery
plugin.
Browser Support
Internet Explorer 6, Internet Explorer 7, Firefox 1.5, Opera 8, Safari 1.2 (Mac), Firefox (Mac) - all tested, should also work in most other browsers Download
Usagedump(value, [showTypes])
Examples dump(myObject, true); // opens a dump window displaying
key/value types of myObject 12/2/2008 Linux系统各版本的本地root密码破解方法(一)RedHat/CentOS/Fedora 系统密码破解 1.在grub选项菜单按E进入编辑模式 2.编辑kernel 那行最后加上S (或者Single) 3.按B,启动到single-user mode 4.进入后执行下列命令 # mount -t proc proc /proc # mount -o remount,rw / #passwd #sync #reboot (二)Debian linux 系统密码破解 1.在grub选项菜单'Debian GNU/Linux,...(recovery mode)',按e进入编辑模式 2.编辑kernel那行最后面的 ro single 改成 rw single init=/bin/bash,按b执行重启 3.进入后执行下列命令 root@(none)#mount -a root@(none)#passwd root root@(none)#reboot (三)Freebsd 系统密码破解 1.开机进入引导菜单 2.选择每项(按4)进入单用户模式 3.进入之后输入一列命令 root@#mount -a root@#fsck -y root@#passwd(修改密码命令) root@#root(要破解密码的用户名) Enter new unix password: root@#init 6 (重启) (四)Solaris 系统密码破解 1.在grub选项菜中选择solaris failasfe 项 2.系统提示Do you wish to have it mounted read-write on /a ?[y,n,?] 选择y 3.就进入单用户模式 4.输入下列命令:passwd root@#init 6 (重启) (五)NetBsd 系统密码破解 1.开机:当出现提示符号并开始倒数五秒时, 键入以下指令: > boot -s (进入单用户模式命令) 2.在以下的提示符号中 Enter pathname of shell or RETURN for sh: 按下 Enter。 3.键入以下指令: # mount -a # fsck -y 4.使用 passwd 更改 root 的密码。 5.使用 exit 指令进入多人模式。 (六)SUSE 系统密码破解 1.重新启动机器,在出现grub引导界面后,在启动linux的选项里加上init=/bin/bash,通过给内核传递init=/bin/bash参数使得OS在运行login程序之前运行bash,出现命令行。 2.稍等片刻出现(none)#:命令行。 3.这时输入mount -n / -o remount,rw 表示将根文件系统重新mount为可读写,有了读写权限后就可以通过passwd命令修改密码了。 4.这时输入passwd命令就可以重置密码了 5.修改完成后记得用mount -n / -o remount,ro将根文件系统置为原来的状态。 7/2/2008 linux中用户密码的过期时间设置设置单个用户的密码过期时间用usermod
-e,
如果要统一设置所有户的过期时间, 那么就要修改/etc/login.defs里面的PASS_MAX_DAYS, 比如修改所有用户的密码过期时间是30天: PASS_MAX_DAYS 30 6/10/2008 WinXP中鲜为人知的隐藏功能免费的系统教程(system32文件夹下)
安装完WindowsXP后很想马上学习并体验一下它的魅力吗?我们无需再东奔西走去找烦人的文字教材。只要选择"开始"→"漫游WindowsXP",就会出现界面,它将引导我们游历WindowsXP的新功能。
小提示:WindowsXP中自带的教程非常形象,是图形界面的,而且制作得相当精美,微软的权威性可想而知。如果你的"开始"菜单上没有"漫游WindowsXP"项目,则可以运行C:\Windows\System32\tourstart.exe进入。
2、辅助功能向导——Accwiz(system32文件夹下)
我们知道,微软在Windows中为残疾人士提供了辅助功能,使他们也能xx作计算机。该程序可以根据用户的视觉、听力和行动来配置我们的Windows,使残疾人士能根据自身情况更好地使用Windows。
3、字符映射表——Charmap(system32文件夹)
是不是觉得Word的"插入符号"功能非常方便?我们在其他Windows程序中也常常要插入一些特殊符号,而一个个地找又麻烦,这时可使用"字符映射表"程序帮忙。
通过"字符映射表"可查看选定字体中有哪些字符,选中后单击"选定"和"复制"按钮,即可把选定字符复制到Windows剪贴板中,供字处理软件粘贴使用。
小提示:用它来复制特殊字体中的特殊符号特别有用。
4、仓颉拼音输入法——CINTSETP(system32\IME\Cintlgnt文件夹下)
微软新仓颉输入法98b的安装程序,微软把它放在简体中文版WindowsXP中,但埋藏得较深。不过它很有用,安装后就会在Windows中新增一个"中文(台湾)"的仓颉输入法,利用它可以在简体中文WindowsXP上通过输入繁体汉字。这对于从中国港澳台地区至内地工作的人提供了方便。
5、磁盘清理大师——Cleanmgr(system32文件夹下)
尽管现在的硬盘越来越大,但它总有容量的限制。在你不经意地安装这个或那个软件的过程中,可能会因为硬盘空间已频频告急而影响了正常Windows程序的执行。
不要急,请打开此程序,它会自动地释放出一部分硬盘空间,并会智能化地进行删除xx作,保证你的系统万无一失。这比从资源管理器中删除要安全多了。
6、剪贴板查看器——Clipbrd(system32文件夹下)
Windows剪贴板为我们在各个Windows程序间的信息交流提供了一个桥梁。但这部分数据一般情况下无法看到。不过,使用剪贴板查看器就可看到当前剪贴板中的"新大陆"。WindowsXP中的剪贴板查看器程序较原先Windows9X/Me的旧版本多出了共享功能,通过设置权限允许其他网上用户将该剪贴板装入使用。
7、控制面板启动器——Control.exe(system32文件夹下)
控制面板是Windows的一个重要组成部分,许多设置都通过他完成。而双击这个文件就是最快打开系统控制面板的方法,可省去从"开始"菜单上层层点击的麻烦。
8、WindowsXP的诊断医生——Drwtsn32(system32文件夹下)
Drwtsn32是一个程序错误调试器。DrWatson程序会获得并记录运行Windows的计算机上的程序错误的信息。只要检测到错误,就会创建一个文本文件(Drwtsn32.log),提供错误原因的详细说明,并给出解决问题的建议性xx作,在与Microsoft技术支持联系并请求帮助时,Drwatson将会起到很大作用。
9、DVD播放器——DVDplay(system32文件夹下)
随着DVD驱动器和DVD光盘价格的下降,在普通家庭电脑上配置一个DVD播放器已不是一件奢侈的事情。而要播放DVD需要播放器的支持,WindowsXP提供了一个"免费"的DVD播放器,有了它我们可以省去一笔购买第三方DVD播放软件的费用。
10、自解压文件制作工具——Iexpress(system32文件夹下)
用过压缩软件的读者一定对自解压文件不陌生,自解压文件可在没有相应解压缩程序的情况下直接将压缩包文件解压缩到相应的文件夹下,极大地方便了用户。利用Iexpress可制作两种自解压文件,一种是标准自解压文件(StandardSelf-Extractor),另一种是安装程序式自解压文件(Self-ExtractorforSoftwareInstallation),这样我们在发布程序时就方便多了。
另外大家要注意,尽管使用Iexpress的运行界面是英文的,但利用它生成的自解压文件却是中文的,省去了繁琐的本地化工作。
11、文件转移向导——Migwiz(system32\usmt文件夹下)
Windows系统的易用性总是和不稳定性共存的,因此在系统健康之时把当前设置保存下来,供系统崩溃后重新安装时使用是个不错的主意。微软已把这个工具集成到"文件和设置转移向导"程序上。通过它,我们就可以实现系统状态的备份与恢复。
12、系统配置程序——Msconfig(Windows\PChealth\HELPCTR\Binaries文件夹下)
和Windows中的系统配置程序一样,通过这个程序,我们可对系统的一般、SYSTEM.ini、WIN.ini、BOOT.ini、服务和启动项目进行修改。
小提示:用它来去除系统自启动程序特别有效。
13、备份工具——Ntbackup(system32文件夹下)
数据是计算机中最为宝贵的资料,因此经常备份你的资料也应该成为一个好习惯。现在许多人都寻求第三方的备份工具,其实大可不必。使用WindowsXP中内置的备份工具就可以非常方便地将资料进行备份,而且由于你使用的是微软产品,所以根本不存在兼容性问题。
14、ODBC数据源管理器——Odbcad32(system32文件夹下)
在Windows中访问ODBC数据源必须要有其驱动程序,该工具可以查看在Windows中已安装的驱动程序及相关信息。
15、IP地址侦测器——Nslookup(system32文件夹下)
在联入互联网的每台电脑都有一个IP地址,同样,每个网站也有它的IP地址,而且是唯一的。通过这个IP侦测工具ping就可以轻而易举地得到它们的真正IP地址。如笔者要想知道http://www.xxx.com的IP地址,...S窗口下输入pinghttp://www.xxx.com即可看到。
16、屏幕键盘——Osk(system32文件夹下)
屏幕键盘是一种实用工具,它在屏幕上显示虚拟键盘,允许那些有移动障碍的用户用指针设备或游戏杆输入数据。屏幕键盘旨在为存在移动障碍的用户提供最低级别的功能。这对于不知道如何键入的用户也很有用。它还可以用于最基本的CAI键盘教学。
17、对象包装程序——Packager(system32文件夹下)
通过对象包装程序我们可以打开一个文件,并引入其中的图标,将它们插入到一般Windows程序中使用,可用于制作计算机类教学课件或文档。
18、注册表编辑器增强版——Regedit32(system32文件夹下)
注册表编辑器是用来更改系统注册表设置的高级工具。注册表中包含了有关计算机如何运行的信息。在WindowsXP中有一个名为Regedit的程序,可编辑注册表,但此程序却是它的增强版本,除可编辑注册表外,还可设置权限、清除重复项、删除已被卸载或删除的程序项等高级xx作。
19、ActiveX注册和反注册工具——Regsvr32
使用过ActiveX的人都知道,ActiveX不注册是不能够被系统识别和使用的,一般安装程序都会自动地把它所使用的ActiveX控件注册,但如果你拿到的一个控件需要手动注册怎么办呢?
如果修改注册表那就太麻烦了,在Windows的System文件夹下有一个regsvr32.exe的程序,它就是Windows自带的ActiveX注册和反注册工具。它的用法为:
"regsvr32[/s][/n][/i(:cmdline)]dllname"。其中dllname为ActiveX控件文件名,建议在安装前拷贝到System文件夹下。
数有如下意义:
/u——反注册控件
/s——不管注册成功与否,均不显示提示框
/c——控制台输出
/i——跳过控件的选项进行安装(与注册不同)
/n——不注册控件,此选项必须与/i选项一起使用
如笔者要注册一amovie.ocx控件,则打入regsvr32amovie.ocx即可,要反注册它时只需使用regsvr32/uamovie.ocx就行了。
20、动态链接库函数启动器——Rundll32
在Windows中使用了许多动态链接库,这样就使得所有Windows程序都可共享这些动态链接库中的函数。一般情况下,许多应用程序都通过WindowsAPI来xx作这些函数,但归根结底是通过Windows文件夹下的rundll32.exe程序来启动相应的函数。
它的用法是:"rundll32.exe动态链接库名,函数名,参数名"。如笔者需要实现一键关机,则在桌面上建立一快捷方式,命令行为"rundll32.exeuser.exe,ExitWindows",并设置其快捷键为F4即可。
再如,笔者要打开控制面板,则只需要输入命令"rundll32.exeshell32.dll,Control_RunDLL"即可,要打开桌面属性,只需要使用"rundll32.exeshell32.dll,Control_RunDLLdesk.cpl",其余的以此类推。
21、系统文件检查器——Sfc(system32文件夹下)
使用Windows难免不会出现系统文件损坏或丢失的毛病,而如果为了几个小小的文件就去重装系统,又显得稍微麻烦了一些。通过系统文件检查器Sfc.exe,一切都会变得非常简单。
22、共享文件夹设置工具——Shrpubw(system32文件夹下
23、Microsoft签字验证工具——Sigverif(system32文件夹下)
所谓"签署的文件",就是被授予Microsoft数字签署的文件。该签署表明,该文件是原始文件的一模一样的副本。通过Microsoft签字验证工具,我们可在计算机上查找已签署和未签署的文件,也可查看签署文件的身份验证,以确认该文件还没有被篡改。
使用起来非常方便,和查找窗口几乎没有什么不同,只要给出搜索范围,就可搜索出指定范围内的已签署文件和未签署文件。
24、音量控制程序——Sndvol32
我们在Windows任务栏上可见到一个可爱的小喇叭,当我们双击它时就会弹出音量控制面板,其实这时我们就是启动了一个Windows文件夹下的sndvol32.exe文件。不信,请你进入Windows文件夹,再打开sndvol32.exe文件看看,熟悉的"音量控制"面板是否已经在你眼前了?
另外还要告诉大家,它还有一个隐藏的参数"/r",利用此参数可快速地打开录音控制面板,这样我们只要在桌面上建立一指向C:\Windows\Sndvol32.exe的快捷方式,并令它的参数为/R(即在目标中填入"C:\Windows\Sndvol32.exe/R"),就可以快速打开录音控制面板选择输入设备了。
如果设备过多,在面板上容纳不下时,试着按"Ctrl+S"键,不管有多少设备都能够完全显示。
25、任务管理器——Taskmgr(system32文件夹下)
任务管理器提供正在你的计算机上运行的程序和进程的相关信息,使用任务管理器可快速查看正在运行的程序的状态,或终止已停止响应的程序。也可使用多达15个的参数评估正在运行的进程的活动,以及查看CPU和内存使用情况的图形和数据。当计算机发生锁死时使用它最方便和有效。
26、远程连接程序——Telnet(system32文件夹下)
在Internet上有无数的计算机,而要访问它们都必须通过建立远程连接才行,进行两个计算机的远程连接可用专门软件实现,但通过Windows自带的远程连接程序telnet.exe也能完成这一xx作,而且它还是纯中文界面软件。
27、远程FTP工具——Tftp(system32文件夹下)
FTP是一个网络传输的协议,通过这个程序可非常方便地连接到对方的服务器上进行文件的存取xx作,省得再找如第三方的FTP软件了,可惜的是它是字符界面。
28、Windows升级程序——Wupdmgr(system32文件夹下)
安装完Windows后,在开始菜单的上方会有WindowsUpdate菜单项,通过它能自动登录到Microsoft公司的网站上完成自己Windows的升级工作。但时间一长,可能会把这个快捷方式误删除了,这时我们就可以通过打开Windows下的Wupdmgr.exe文件来完成这个功能。
5/20/2008 body里加入CSS滤镜代码默哀body{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);}
或
style="filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
5/5/2008 Send Your Name to the Moon Aboard LRO!NASA invites people of all ages to join the lunar exploration
journey with an opportunity to send their names to the moon aboard the Lunar
Reconnaissance Orbiter, or LRO, spacecraft.
The Send Your Name to the Moon Web site enables everyone to
participate in the lunar adventure and place their names in orbit around the
moon for years to come. Participants can submit their information at http://lro.jhuapl.edu/NameToMoon/,
print a certificate and have their name entered into a database. The database
will be placed on a microchip that will be integrated onto the spacecraft. The
deadline for submitting names is June 27, 2008.
"Everyone who sends their name to the moon, like I'm doing,
becomes part of the next wave of lunar explorers," said Cathy Peddie, deputy
project manager for LRO at NASA's Goddard Space Flight Center in Greenbelt, Md.
"The LRO mission is the first step in NASA's plans to return humans to the moon
by 2020, and your name can reach there first. How cool is that?"
The orbiter, comprised of six instruments and one technology
demonstration, will provide the most comprehensive data set ever returned from
the moon. The mission will focus on the selection of safe landing sites and
identification of lunar resources. It also will study how the lunar radiation
environment could affect humans.
LRO will also create a comprehensive atlas of the moon's
features and resources that will be needed as NASA designs and builds a planned
lunar outpost. The mission will support future human exploration while providing
a foundation for upcoming science missions. LRO is scheduled for launch in late
2008.
The Lunar Reconnaissance Orbiter is being built at Goddard.
The mission also will be managed at the center for NASA's Explorations Systems
Mission Directorate in Washington.
Send Your Name to the Moon is a collaborative effort among
NASA, the Planetary Society in Pasadena, Calif., and the Johns Hopkins Applied
Physics Laboratory in Laurel, Md.
4/30/2008 windows下用winrar自动备份脚本rem 先备份mysql数据库
mysqldump -uusername -ppassword databasename >
E:\WebSite\WebProject1\shell\db.sql
rem 压缩备份web
D:\Progra~1\WinRAR\rar.exe a -k -r -s -m1
F:\WebProjectBack\WebProject1%date:~0,10%.rar
E:\WebSite\WebProject1
存为.bat 文件,放在计划任务里自动运行,就实现每天自动备份了
4/2/2008 Simple Zend_Form Example摘自http://akrabat.com/2008/02/21/simple-zend_form-example/
(clearly the form is unstyled :) You can construct a Zend_Form directly from a config file or can build it in code. This example builds it in code. Setting upThis example uses the same basic skeleton as the Zend_Layout code with the addition of a forms directory:
As you can see, I've added a forms directory within the application subdirectory with our form file, ContactForm.php, in it. The contact formTo keep the form contained, I've put it in its own class which extends from Zend_Form. The file is application/forms/ContactForm.php and so the class is forms_ContactForm so that Zend_Loader can easily load it: class forms_ContactForm extends Zend_Form { public function __construct($options = null) { parent::__construct($options); $this->setName('contact_us'); $title = new Zend_Form_Element_Select('title'); $title->setLabel('Title') ->setMultiOptions(array('mr'=>'Mr', 'mrs'=>'Mrs')) ->setRequired(true)->addValidator('NotEmpty', true); $firstName = new Zend_Form_Element_Text('firstName'); $firstName->setLabel('First name') ->setRequired(true) ->addValidator('NotEmpty'); $lastName = new Zend_Form_Element_Text('lastName'); $lastName->setLabel('Last name') ->setRequired(true) ->addValidator('NotEmpty'); $email = new Zend_Form_Element_Text('email'); $email->setLabel('Email address') ->addFilter('StringToLower') ->setRequired(true) ->addValidator('NotEmpty', true) ->addValidator('EmailAddress'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Contact us'); $this->addElements(array($title, $firstName, $lastName, $email, $submit)); } } We set the name of the form first and then create five elements; one select box for the title, three text boxes for first name, surname and email address and then finally a submit button. Note that as we have overridden the constructer, we also call up to the parent's constructor so that all the Zend_Form initialisation happens. Creating an element is quite simple. Each element is of the type Zend_Form_Element_Xxx where Xxx is the type, such as Text, Submit, Select, etc. We then configure the element how we want it, such as setting a label and adding filters and validators. Finally we add all the elements to the form using the addElements() function. Note that if you have multiple validators, you can pass in true as the second parameter ($breakChainOnFailure) to stop processing the remaining validators at that point. This can be because the further validators do not make sense or because you only ever want the user to see one message per field to avoid overwhelming them. Displaying the formHaving defined out form, we need to get it to the screen. In the controller we need the following: class IndexController extends Zend_Controller_Action { function indexAction() { $this->view->pageTitle = "Zend_Form Example"; $this->view->bodyCopy = "<p >Please fill out this form.</p>"; $form = new forms_ContactForm(); $this->view->form = $form; } } This code assigns some variables to the view, then instantiates the form and assigns that to the view also. The view script is similarly simple: view/scripts/index/index.phtml: <?php echo $this->pageTitle ;?> <?php echo $this->bodyCopy ;?> <?php echo $this->form ;?> To render the form, we simply echo it. By default, the form is marked up as a definition list and its HTML looks like this: <form name="contact_us" id="contact_us" enctype="application/x-www-form-urlencoded" action="" method="post"><dl class="zend_form"> <dt><label for="title" class="required">Title</label></dt> <dd> <select name="title" id="title"> <option value="mr" label="Mr">Mr</option> <option value="mrs" label="Mrs">Mrs</option> </select></dd> <dt><label for="firstName" class="required">First name</label></dt> <dd> <input type="text" name="firstName" id="firstName" value=""></dd> <dt><label for="lastName" class="required">Last name</label></dt> <dd> <input type="text" name="lastName" id="lastName" value=""></dd> <dt><label for="email" class="optional">Email address</label></dt> <dd> <input type="text" name="email" id="email" value=""></dd> <dt></dt><dd> <input type="submit" name="submit" id="submit" value="Contact us"></dd></dl></form> Notice how the setRequired() has resulted in the "required" CSS class name being applied to those elements. DecoratorsIf you do not want to use a definition list, then this can easily be changed using decorators. For instance, adding the following to the bottom of the form's constructor after the addElements() call: $this->clearDecorators(); $this->addDecorator('FormElements') ->addDecorator('HtmlTag', array('tag' => '<ul>')) ->addDecorator('Form'); $this->setElementDecorators(array( array('ViewHelper'), array('Errors'), array('Description'), array('Label', array('separator'=>' ')), array('HtmlTag', array('tag' => 'li', 'class'=>'element-group')), )); // buttons do not need labels $submit->setDecorators(array( array('ViewHelper'), array('Description'), array('HtmlTag', array('tag' => 'li', 'class'=>'submit-group')), )); will result in the form being marked up as an unsigned list with each label and element pair inside each <li>. The marked up form looks like this: <form name="contact_us" id="contact_us" enctype="application/x-www-form-urlencoded" action="" method="post"><ul> <li class="element-group"><label for="title" tag="" class="required">Title</label> <select name="title" id="title"> <option value="mr" label="Mr" selected="selected">Mr</option> <option value="mrs" label="Mrs">Mrs</option> </select></li> <li class="element-group"><label for="firstName" tag="" class="required">First name</label> <input type="text" name="firstName" id="firstName" value=""></li> <li class="element-group"><label for="lastName" tag="" class="required">Last name</label> <input type="text" name="lastName" id="lastName" value=""></li> <li class="element-group"><label for="email" tag="" class="required">Email address</label> <input type="text" name="email" id="email" value=""></li> <li class="submti-group"><input type="submit" name="submit" id="submit" value="Contact us"></li></ul></form> As you can see, the decorator system makes it easy to render our form in the manner we wish. As a note of warning, pay attention to the order of the decorators as it matters! ProcessingThe form is now displayed, so when the user presses the button we need to process it. In this example, this is done in the indexAction() controller function, so that the complete function looks like this with the addition in bold: class IndexController extends Zend_Controller_Action { function indexAction() { $this->view->pageTitle = "Zend_Form Example"; $this->view->bodyCopy = "<p>Please fill out this form.</p>"; $form = new forms_ContactForm(); if ($this->_request->isPost()) { $formData = $this->_request->getPost(); if ($form->isValid($formData)) { echo 'success'; exit; } else { $form->populate($formData); } } $this->view->form = $form; } } Firstly we check the the request is a POST using the request object's isPost() function and then we use validate the submitted data using the form's isValid() function. If this returns true, then we have valid data and can process. If the data is not valid, we populate the form's elements with it and then redisplay so that the user can correct appropriately. The default decorators will display an error message next to each element that failed validation. ConclusionSo there you have it. A very simple example of how to use Zend_Form. Here's a zip file of this project: Zend_Form_Example.zip (It includes a snapshot of the trunk of the Zend Framework which is why it's 3MB big.) It works for me, at least. UpdateWith the release of Zend Framework 1.5, a change was made to the way buttons work and you should not put a label decorator on a button as the label property of a button is used for the text value of the button itself. I have updated the code above to show that if you use setElementDecorators() you then need to reset the decorators for any buttons, the $submit button, in this case. I have also put back the Errors decorator when using an unsigned list. 3/20/2008 女人的第三个愿望有一个女人打高尔夫球,不小心把球打到附近的树林里,她便进树林里去找,看到一个青蛙掉到一个陷阱里,蹦不出来。青蛙对女人说:"你好,我其实是个神灵,如果你把我救出来,我可以满足你三个愿望。"女人把青蛙从陷阱里救了出来。
青蛙说:"对不起,刚才太匆忙,忘了告诉你,你可以任意许三个愿望,但实现你每个愿望的同时,必须有附加条件,就是同时你的丈夫可以得到你的愿望高十倍。"
女人很乐意的答应了。青蛙说:"你想清楚以后,你救可以许愿了。"
女人:"我的第一个愿望是,我变为一个非常美丽的女人。"
青蛙:"出于我对你的感激,我再次提醒你,这样的结果是你的丈夫也将变成非常帅的男人,并且会比你的魅力还大十倍,会有不计其数的女孩子喜欢他。你必须考虑清楚。"
女人:"我已经非常美丽,我的丈夫不会变心的。"
于是,女人变的非常美丽。
青蛙:"请你说你第二个愿望。"
女人:"请让我有在银行有一亿元的存款。"
青蛙:"我再次提醒你,你的丈夫同时可以得到10亿元的存款,他有钱后可能变坏,可能。。。"
女人:"他的就是我的无所谓。"
青蛙:"好吧,你的第二个愿望也实现了,请说第三个。"
女人:"请让我得一下轻微的心脏病。"
3/11/2008 注册了新域名 wangchongwen.cn万网送CN域名免费注册券 http://218.244.143.47/static/discount/cn20080305.asp 不过短一点的好名字不是被cnnic保留,就是被抢注光了 现在能注册的都没什么好名字了 注册了个 wangchongwen.cn,把cname转向了spaces 以后可用 www.wangchongwen.cn 来访问了 3/5/2008 Tom 的 print_tablecreate or replace procedure print_table if ( dbms_utility.get_parameter_value dbms_sql.parse( l_theCursor, p_query, dbms_sql.native ); for i in 1 .. l_colCnt loop l_status := dbms_sql.execute(l_theCursor); 2/19/2008 database link用法先建立指向目标服务的tns 在 sysdba下给 my_user用户赋予建立 database link和 synonym 权限 然后进入本地oracle用户 就可以用 select * from table_name 查远程服务器上的数据了 2/17/2008 Understanding network masks(摘自SCO)A network mask, or ``netmask'', is used to divide an IP address into a network address and a host address. When you set up a network, the network mask must be common to all network interfaces on that network. The default network masks are 255.0.0.0 for class A, 255.255.0.0 for class B, and 255.255.255.0 for class C networks, as illustrated here:
Subnets are created by extending the network ID portion of an address by taking some bits from the host portion to create a subnet portion. The remaining bits can be used for host addresses within the subnet. The number of subnets that can be created from an m-bits long subnet address is 2^m. The number of host addresses per subnet that are available from an n-bits long host address is (2^n)-2. Unlike the subnet portion of the network address, the host portion cannot consist of all 0's or 1's. See RFC 1812 and RFC 1878 for more information. The following figure illustrates the effect on a class B address of extending a network mask from 255.255.0.0 to 255.255.255.0:
Subnetting a class B network This scheme creates 256 (2^8) possible subnet addresses (0 through 255) with 254 (2^8-2) host addresses (1 through 254) per subnet. In this way, you can create subnets for class A and B networks by converting the second and third octets, respectively, from host addresses to subnet addresses. Notice how the netmask changes accordingly:
The class A network 16 can now have up to 256 subnets (16.0 through 16.255). The class B network 172.16 can also have up to 256 subnets (172.16.0 through 172.16.255). While the netmask masks the network portion of the address, the broadcast address exposes the network address and hides the host portion. For example, the broadcast address for the subnet 172.16.246, with a netmask of 255.255.255.0, is 172.16.246.255. For more information on setting netmask and broadcast addresses using the Network Configuration Manager, see ``Basic TCP/IP configuration parameters''. For example, if an organization has a class B network, you could assign each physical network in that network a subnet number within that network. The sixteen bits for the host ID could be allocated as eight for subnet and eight for host, or nine for subnet and seven for host, and so on. Your decision would be transparent to everyone outside that organization. A common example of subnetworking is to apply a class C type subnet mask (255.255.255.0) to a class B network. Applying this mask to a class B network provides you with 256 possible subnets, each one of which can accommodate 254 possible hosts (the host addresses 0 and 255 are not acceptable). If you know that none of your subnets will ever have more than 126 hosts but you need more than 256 but less than 513 subnets, you could decide to use nine bits for the subnet number, and seven bits for the host addresses. The appropriate mask for this would be 255.255.255.128. Given this scheme and a network address of, for example, 131.60, the addresses of the first and last hosts on the first subnet (131.60.0.0) would be 131.60.0.1 and 131.60.0.126. The broadcast address on this subnet would be 131.60.0.127. Partitioning a class C address is a similar process as you must take a portion of the fourth octet as the subnet address. For example, you might partition the first three (high order) bits of the fourth octet to represent the subnet, with the last five bits representing the host:
This scheme allows for up to 8 subnets of 30 hosts each, for a total of 240 hosts. The netmask for the hosts on these subnets is 255.255.255.224. The number 224 is a decimal representation of the binary octet 11100000, which masks the subnet portion of the IP address. Possible subnets for the class C network 221.138.62.0, with associated broadcast addresses, are:
----------------------------------------------------------------------- | Subnet | Hosts | Broadcast address | |----------------------|-----------------------|-----------------------| | 221.138.62.0 | .1-.30 | 221.138.62.31 | |----------------------|-----------------------|-----------------------| | 221.138.62.32 | .33-.62 | 221.138.62.63 | |----------------------|-----------------------|-----------------------| | 221.138.62.64 | .65-.94 | 221.138.62.95 | |----------------------|-----------------------|-----------------------| | 221.138.62.96 | .97-.126 | 221.138.62.127 | |----------------------|-----------------------|-----------------------| | 221.138.62.128 | .129-.158 | 221.138.62.159 | |----------------------|-----------------------|-----------------------| | 221.138.62.160 | .161-.190 | 221.138.62.191 | |----------------------|-----------------------|-----------------------| | 221.138.62.192 | .193-.222 | 221.138.62.223 | |----------------------|-----------------------|-----------------------| | 221.138.62.224 | .225-.254 | 221.138.62.255 | |----------------------|-----------------------|-----------------------|After you determine the new addresses for your hosts, you must use the Network Configuration Manager to configure them. In addition, you must configure routers between your subnets: these are hosts with multiple networking cards that serve more than one network. Changing to a subnetted networkFollow these steps to change from an internetwork that does not use subnets to one that is subnetted.
Examples of subnetsThe following examples show network installations where subnets are (and are not) in use: 128.32.0.0 Berkeley class B network (subnetted) netmask 255.255.255.0 36.0.0.0 Stanford class A network (subnetted) netmask 255.255.0.0 10.0.0.0 Arpanet class A network (non-subnetted) netmask 255.0.0.0All of the University of California at Berkeley is assigned the network number 128.32.0.0, so that any external router only needs to know one route to reach Berkeley. Within the campus, a class C type subnet mask gives each local network a subnet number, with 254 hosts on each of the 256 possible subnets. Stanford University uses a class A network number with a class B type subnet mask, for 256 subnets of 65,534 hosts each. The Arpanet is a class A network without subnets so the default class A netmask is used. Classless Interdomain RoutingThe number of class A and B addresses that are available for allocation to new networks has been steadily diminishing over time and is now virtually exhausted. If you apply for a network number, you are likely to be assigned a set of several contiguous class C network addresses or a single subnetted class C network address. Which of these you receive will depend on the number of hosts that will exist on your network(s). The scheme that is used to implement the assignment of addresses is known as Classless Interdomain Routing (CIDR) or ``supernetting''. The details of CIDR may be found in RFC 1518 and RFC 1519. As the main purpose of CIDR is to reduce the size of the routing tables for the Internet, these documents will not usually be of interest to you unless you are a service provider or you maintain Internet routing tables on your system. 一个合并表格相同行的函数/** 2/6/2008 让windowsXP多用户远程桌面同时登录的方法从网上下载微软Terminal Server Service 5.1.2600.2055版本文件 termsrv.dll.2055 用termsrv.dll.2055 覆盖 C:\WINDOWS\system32\dllcache\termsrv.dll C:\WINDOWS\system32\termsrv.dll 注意一定要覆盖C:\WINDOWS\system32\dllcache 目录,因为C:\WINDOWS\system32\termsrv.dll会自动被C:\WINDOWS\system32\dllcache\termsrv.dll 覆盖 注册表新建一个DWORD值 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Licensing Core] "EnableConcurrentSessions"=dword:00000001 在我的电脑->系统属性->远程->远程桌面->允许用户连接到此计算机 并选择远程用户 如果要修改远程桌面协议默认3389端口,更改注册表以下项,重启服务即可 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp] "PortNumber" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp] "PortNumber" 1/30/2008 kill oracle事务死锁bash-2.03$ more locksql.sql 如果要kill 和这个死锁sql关联的sql
让Linux支持中文linux支持中文字符集设置 /etc/sysconfig/i18n 文件即可 默认安装情况下,内容如下 LANG="en_US.UTF-8" SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en" SYSFONT="latarcyrheb-sun16" 用xwindow 图形界面下设置为中文后 /etc/sysconfig/i18n 内容如下: LANG="zh_CN.GB18030" LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN" SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en" SYSFONT="lat0-sun16" 对于linux的中文提示,用起来不习惯,只要让他支持中文字符集就行了 修改 LANG="en_US.UTF-8" 即可 Linux下的网络设置方法设置DNS服务器 设置IP地址: 修改机器名和网关 修改后用/etc/sysconfig/network-scripts/ifdown eth0 ;
另一个方法设置临时及时生效: 1/29/2008 用uniread 实现SQL*Plus历史回调的功能在nix系统下的SQL*Plus 命令行是不具备历史回调功能 用第三方工具uniread可以实现该功能 在安装uniread之前,应该做一些准备。需要安装readline-5.0.tar.gz,IO-Tty-1.07.tar.gz,Term-ReadLine-Gnu-1.16.tar.gz这三个文件。 GNU readline 官网:http://www.gnu.org/directory/readline.html 下载地址:http://ftp.gnu.org/pub/gnu/readline/readline-5.0.tar.gz Term::ReadLine::Gnu 官网:http://search.cpan.org/dist/Term-ReadLine-Gnu/ 下载地址: http://search.cpan.org/CPAN/authors/id/H/HA/HAYASHI/Term-ReadLine-Gnu-1.16.tar.gz 官网:IO::Tty http://search.cpan.org/dist/IO-Tty/ 下载地址:http://search.cpan.org/CPAN/authors/id/R/RG/RGIERSIG/IO-Tty-1.07.tar.gz 官网: http://sourceforge.net/projects/uniread/ uniread下载地址:http://superb-west.dl.sourceforge.net/sourceforge/uniread/uniread-1.01.tar.gz 下载后,首先解压缩: # tar -xzvf readline-5.0.tar.gz 进入进入到该目录中编译并安装: # ./configure # make # make install 后面两个的安装: tar -zxvf Term-ReadLine-Gnu-1.16.tar.gz 和 IO-Tty-1.07.tar.gz 进入到该目录中: # perl Makefile.PL # make # make install 之后进行uniread的安装: #tar -xzvf uniread-1.01.tar.gz #cd uniread-1.01 #perl Makefile.PL #make #make install OK,再用uniread sqlplus 替换原来的sqlplus命令,就发现可以用箭头历史回调了 1/27/2008 oracle 表中删除重复记录的方法假如表test中有三个字段 col1 col2 col3,重复的记录是指三个字段都相同的记录
查询重复数据的方法:
方法1 select * from test group by col1,col2,col3 having count(*) >1; 方法2 select * from test a where rowid=(select max(rowid) from test where col1=a.col1 and col2=a.col2 and col3=a.col3); 删除重复记录的方法: delete test where (col1,col2,col3) in (select col1,col2,col3 from test group by col1,col2,col3 having count(*)>1) and rowid not in (select min(rowid) from test group by col1,col2,col3 having count(*)>1); delete test where rowid not in (select min(rowid) from test group by col1,col2,col3);
delete from test a where a.rowid!=(select max(rowid) from test b where a.col1=b.col1 and a.col2=b.col2 and a.col3=b.col3);
delete from test a where a.rowid<(select max(rowid) from test b where a.col1=b.col1 and a.col2=b.col2 and a.col3=b.col3);
delete from test a where rowid <(select max(rowid) from test where col1=a.col1 and c10=a.col2 and col3=a.col3); |
|||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
|