import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
public class TraditionalTimerTest {
static int count;
public static void main(String[] args) {
class MyTimerTask exte...
分类:
其他好文 时间:
2014-05-23 01:45:11
阅读次数:
226
一、获取网页源代码
1.不含有框架
string s=WB1.DocumentText; //webbrowser1命名为WB1,下同
2.含有框架
引用mshtml; //位置C:\Program Files\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml...
分类:
Web程序 时间:
2014-05-23 01:30:49
阅读次数:
283
为什么会有线程同步的概念呢?为什么要同步?什么是线程同步?先看一段代码:package com.maso.test;
public class ThreadTest2 implements Runnable{
private TestObj testObj = new TestObj();
public static void main(String[] args) {
Thread...
分类:
移动开发 时间:
2014-05-23 01:29:34
阅读次数:
333
【题目】
Implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching should cover the entire input string (not partial).
The functi...
分类:
其他好文 时间:
2014-05-23 00:17:12
阅读次数:
364
public class TraditionalThreadTest {
static class Outputer {
public void output1(String name) {
synchronized (Outputer.class) {
for (int i = 0; i < name.length(); i++) {
System.out.pri...
分类:
其他好文 时间:
2014-05-22 23:53:45
阅读次数:
442
Pexpect模块:http://www.ibm.com/developerworks/cn/linux/l-cn-pexpect1/
ConfigParser模块:http://blog.chinaunix.net/uid-25890465-id-3312861.html
logging模块:http://kenby.iteye.com/blog/1162698
threading模块...
分类:
编程语言 时间:
2014-05-22 22:38:36
阅读次数:
358
题目:
Alibaba笔试题:给定一段产品的英文描述,包含M个英文字母,每个英文单词以空格分隔,无其他标点符号;
再给定N个英文单词关键 字,请说明思路并编程实现方法String extractSummary(String description,String[] key words),
目标是找出此产品描述中包含N个关键字(每个关键词至少出现一次)的长度最短的子串,作为产品简介输出。(不限...
分类:
其他好文 时间:
2014-05-22 22:37:55
阅读次数:
405
² 字符函数
1. replace( 字符串1,字符串2,字符串3)
replace( char, search_string, replace_string)
功能:在“字符串1”中搜索“字符串2”,并将其替换为“字符串3”。
例如下面的命令是将所有员工名字中出现的”A”替换为”中国”。
SQL>selectreplace(ename, 'A', '中国') fro...
分类:
数据库 时间:
2014-05-22 22:35:22
阅读次数:
450
问题:给定一个字符串,字符串中包含若干单词,每个单词间由空格分隔,将单词逆置,即第一个单词成为最后一个单词,一次类推。
说明:字符串本身可能包含前导空格或后导空格,单词间可能包含多个空格,要求结果中去掉前导和后导空格,单词间空格只保留一个。
与rotate函数类似,先逆置每个单词,再将所有字符串逆置。
void reverseWords(string &s) {
if(s.si...
分类:
其他好文 时间:
2014-05-22 18:49:26
阅读次数:
249
Problem 3: Largest prime factor
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
求出最大素因子
我的python代码如下:
又不懂的,或者更好的可以留言,大家互相...
分类:
其他好文 时间:
2014-05-22 18:40:17
阅读次数:
198