Pascal求N以内的完美数完全数(Perfect number),又称完美数或完备数,是一些特殊的自然数。它所有的真因子(即除了自身以外的约数)的和(即因子函数),恰好等于它本身。program bill02;var m,n,y,i,j,s,ss,z:longint;a:array[1..10000] of integer;beginre……继续阅读 » 水墨上仙 7年前 (2019-08-02) 2687浏览 258个赞
python集合使用范例# sets are unordered collections of unique hashable elements# Python23 tested vegaseat 09mar2005# Python v2.4 has sets built inimport setsprint "……继续阅读 » 水墨上仙 7年前 (2019-08-02) 2266浏览 954个赞
python读写ini配置文件import ConfigParserimport osclass ReadWriteConfFile: currentDir=os.path.dirname(__file__) filepath=currentDir+os.path.sep+"inetMsgConfigure.ini&……继续阅读 » 水墨上仙 7年前 (2019-08-02) 2419浏览 1040个赞
设有一个m×n的棋盘(2≤m≤50,2≤n≤50),在棋盘上任一点有一个中国象棋“马”,马走的规则为:马走日字;马只能向右走。当m,n给出后,同时给出马起始的位置和终点的位置,试找出从起点到终点所有路径的数目。输入:    m,n,x1,y1,x2,y2 (分别表示m,n、起点……继续阅读 » 水墨上仙 7年前 (2019-08-02) 2318浏览 1734个赞
最近在做SEO的时候,为了让发的外链能够快速的收录,想到了利用ping的功能,google和百度都有相关的ping介绍,有兴趣的朋友可以去看看相关的知识。实现ping功能除了可以用一些开源的博客程序,比如WP,它是可以在后台设置ping地址的,只要设置好以后,你发帖子,就会自动的通知搜索引擎,我的博客已经更新了,而今天我用的方法是不通过WP等带有ping功能……继续阅读 » 水墨上仙 7年前 (2019-08-02) 1857浏览 2112个赞
python通过tarfile模块压缩文件夹import tarfileimport osimport sysuser = os.getenv('USERNAME')filename = '/home/%s/tmp.tgz' % userprint 'The tar file was ……继续阅读 » 水墨上仙 7年前 (2019-08-02) 1747浏览 2511个赞
Windows下批处理返回今天是星期几保存下面的代码为:test.bat,执行后返回:It’s 周六 today@ECHO OFFFOR /F "tokens=*" %%A IN ('DATE/T') DO FOR %%B IN (%%A) DO SET Today=%%BECHO It'……继续阅读 » 水墨上仙 7年前 (2019-08-02) 3743浏览 1416个赞
如果用户访问http://地址,这段代码可以将用户自动转向https://地址window.location = "https://" + window.location.hostname + window.location.pathname + window.location.search; ……继续阅读 » 水墨上仙 7年前 (2019-08-02) 3057浏览 2707个赞
java实现逆波兰表达式算法import java.util.ArrayList;import java.util.List;public class MyStack { private List l; private int size; public String top; public MyStack() { l ……继续阅读 » 水墨上仙 7年前 (2019-08-02) 2633浏览 839个赞
Windows下批处理bat返回当前时间下面的代码可以返回系统当前时间:It’s 20:53:28.28 nowFOR %%A IN (%Date%) DO SET Today=%%ASET Now=%Time%ECHO It's %Today% todayECHO It's %Now% now……继续阅读 » 水墨上仙 7年前 (2019-08-02) 3509浏览 1424个赞
django中是不能直接调用函数的,可以通过自定义filter来实现#template_filters.py@register.filterdef template_args(instance, arg): """ stores the arguments in a separate insta……继续阅读 » 水墨上仙 7年前 (2019-08-02) 1369浏览 285个赞
Java导出数据到Excel文件需要的jar包:easypoi-0.1.3.jar, poi-3.7-20101029package com.sais.inkaNet.reportStatistics.operationBeanavior.service;import java.io.IOException;import java.io.Outpu……继续阅读 » 水墨上仙 7年前 (2019-08-02) 2997浏览 102个赞
JavaScript一行代码清除html标签var StrippedString = OriginalString.replace(/(<([^>]+)>)/ig,""); ……继续阅读 » 水墨上仙 7年前 (2019-08-02) 3380浏览 2425个赞
// Define the XML DocumentNSXMLDocument* doc = [[NSXMLDocument alloc] initWithXMLString:[NSString stringWithContentsOfFile:@"/folder/with/sample.xml"]]; // C……继续阅读 » 水墨上仙 7年前 (2019-08-02) 2353浏览 1116个赞