When porting JSP pages on Windows to a Linux environment, it is too slow to find a transform encoding and modifying the default encoding type, write this script to attempt file traversal ~
Long time no write, Rusty.
Copy Code code as follows:
#!/bin/bash
#
#
Spath= "/root/chengji/webroot"
Dpath= "/web"
# function Start part
Cycling () {
filelist= ' Ls-1 $SPATH '
for filename in $filelist; Todo
If [f $filename]; Then
echo Filena
{
If (unlink (filename )){
Echo "the file is successfully deleted ";
}
Else echo "failed to delete the file ";
}
}
/**
* This method is used to modify the content (visible) in the name file in the path directory)
*
* @ Param string_type path
* @ Param string_type name
*/
Function modi_file (path, name) {// file modification
Filename = path. name;
Handle = fopen (filename, 'R + ');
Content = file_get_cont
default value is: Ymd is the meaning of the month and day, change him to the YM is to save the attachment by the month.According to my test on Ma Haixiang blog site, this function seems to be not perfect, only in the FCK upload function upload files or automatically generated thumbnails can play a role. On this point you can test it in the background to know. "Upload" The new file when the date is automatically generated by month and day storage. If you want to completely solve this problem, yo
Use batch processing to replace specified strings in text files.
«Previous topic | next topic»
Uglyfrog
Posted on:
Reply
Message: 249Points: 0Registration: 2001-12-30
In fact, batch processing can also do a lot of work. The following batch processing files implement the function of replacing strings in a specific file type in a specified directory. Although you can write a statement in Unix or Lin
setting item "Attachment save form (by data function date parameter)", the default value is: Ymd is the meaning of the month and day, change him to the YM is to save the attachment by the month.According to my test on Ma Haixiang blog site, this function seems to be not perfect, only in the FCK upload function upload files or automatically generated thumbnails can play a role. On this point you can test it in the background to know. "Upload" The new file when the date is automatically generated
First, write the following spider. py Script: [python] #-*-coding: UTF-8-*-# import urllib2 from urllib import urlopen import OS import sys class Spider: "download web site from the given file" def _ init _ (self, filename, downloadPath): "init the filename, if the filename is not raise a error "if not OS. path. isfile (filename): print 'the given file does not exist, the program will exit 'sys. exit (0) else: self. fn Ame = filename if not OS. path. isdir (downloadPath): print 'the given downlo
This article describes how to use the urllib2 module to capture HTML page resources in Python. The page addresses to be crawled are written in a separate rule list for easy organization and reuse, for more information, see list the network addresses to be crawled in a separate list file.
http://www.jb51.net/article/83440.htmlhttp://www.jb51.net/article/83437.htmlhttp://www.jb51.net/article/83430.htmlhttp://www.jb51.net/article/83449.html
Then let's look at the program operation. The Code is
basic behavior files are with the Result_txt suffix, the code is as follows:#!/usr/bin/pythonImportOSImportShutil#extracting basic business characteristics from a sample run resultDpath = R"C:\Users\xd\Desktop\1.12\360\test0"rpath= R"C:\Users\xd\Desktop\1.12\360\test"Filenames=Os.listdir (Dpath) forFileNameinchFilenames:filepath=dpath+"/"+filenameifOs.path.isdir (Dpath
A Memory Overflow SolutionWhen doing statistical analysis of data, often encounter large arrays, memory overflow may occur, here to share my solution. Use examples to illustrate the problem, as follows:Assuming that the log holds 500,000 records, the solution is as follows:
Copy Code code as follows:
Ini_set (' Memory_limit ', ' 64M '); Reset PHP can use the memory size of 64M, generally on the remote host is not modify the php.ini file, only through program settings. Note: Under Saf
Why can't JSP connect to access through ODBC. mdb, but cannot connect. in the accdb database, my URL is also modified accordingly to Stringurljdbc: odbc: driver {MicrosoftAccessDriver (*. mdb ,*. accdb)}; DBQ + dpath; but why is an error reported ?? The error message is from S.
Why can't JSP connect to access through ODBC. mdb, but cannot connect. in the accdb data library, my URL is modified accordingly to String url = jdbc: odbc: driver = {Microsof
values may need to see the combat engine to understand what it represents, so it doesn't matter if you don't understand ↓↓foreach ($dane _DO_RW As $a = = $b) {...} ↓↓ displays the corresponding end switch ($FleetResult) {...} according to the outcome. Battle reports generated in x.xxxxxxxxxxxx seconds $SimMessage = sprintf ($lang [' Sys_rapport_build_time '], $totaltime); $raport. = $SimMessage. ""; ↓↓ to encode the battle report into the database $
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.