最近在看线程的有关知识,碰到一个小问题,目前还没有解决,现记录下来。
如果在我们自己写的servlet里有成员变量,因为多线程的访问就会出现一些线程问题。这点大家都知道,我们看下面的例子。
public class ConcurrentTest extends HttpServlet {
PrintWriter output;
@Override
protected...
分类:
编程语言 时间:
2015-01-03 22:30:46
阅读次数:
279
《Linux Shell脚本攻略》 笔记
第六章:打包压缩
//1、打包、解包
[root@localhost program_test]# tar -cf output.tar 11.txt 22.txt 33.txt
[root@localhost program_test]# tar -xf output.tar -C ./tar-file/ //-C指定要提取到哪个路径...
分类:
系统相关 时间:
2015-01-03 17:22:31
阅读次数:
220
7.点亮led的操作
Led可以作为我调试程序的工具。
OK6410的核心板原理图:led的部分截图: 我们从上面的原理图知道,led1-4对应的是GPM0-3. 2.GPIO
GPIO是General-Purpose Input/Output Ports:通用输入/输出端口。在嵌入式系统中,CPU...
分类:
其他好文 时间:
2015-01-03 17:14:57
阅读次数:
235
List of Conquests
Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu
Submit Status
Description
Problem B
List of Conquests
Input: standard input
Output: standard o...
分类:
其他好文 时间:
2015-01-03 09:29:35
阅读次数:
131
Description
输出n个字符串,把其中以字母A打头的字符串输出。
Input
第一行 n
第二行到第n+1行,每行一个字符串
Output
A打头的字符串
Sample Input
3
Ada
Bob
Alice
SampleOutput
Ada
Alice
代码如下:
#include
#include
using namespac...
分类:
其他好文 时间:
2015-01-03 09:26:56
阅读次数:
270
Description
将一个字符串str的内容颠倒过来,并输出。str的长度不超过100个字符。
Input
输入包括一行。第一行输入的字符串。
Output
输出转换好的逆序字符串。
Sample Input
I am a student
SampleOutput
tneduts a ma I
代码如下:
#include
#include
usi...
分类:
其他好文 时间:
2015-01-03 09:24:42
阅读次数:
195
Description
输入n(个学生的姓名、学号和成绩,将其中不及格者的姓名、学号和成绩输出。
Input
第一行 n
第二行到第n+1行,每行一个学生的姓名、学号和成绩。
Output
不及格者的姓名、学号和成绩。
Sample Input
3
zhang 1001 100
li 1002 59
sun 1003 0
SampleOutput
li 100...
分类:
其他好文 时间:
2015-01-03 09:21:49
阅读次数:
141
Output API 全局输出API
(注:此API官方更新少,部分内容可能过时。)
目录
1. 组件
1.1 moodle_html_component html组件
1.2 低级HTML 组件
1.2.1 html_label
1.2.2 html_field
1.2.3 html_button
1.2....
输入一串数,以','分隔,输出所有数中去掉最大值、最小值之后剩下的个数。(其中最大值与最小值可能有多个)
Sample input: 3,3,5,3,6,9,7,9
Sample output: 3
#include
/*
解题思路:使用strtok分割函数分割字符串,统计最大最小的数字,
遍历一遍数组,计算除最大最小的数字的个数
*/
#in...
分类:
其他好文 时间:
2015-01-03 01:00:05
阅读次数:
178
要从5个人中选取2个人作为礼仪,其中每个人的身高范围为160-190,要求2个人的身高差值最小
(如果差值相同的话,选取其中最高的两人),以升序输出两个人的身高。
Sample input: 161 189 167 172 188
Sample output: 188 189
#include
#include
int cmp(const void *a,...
分类:
其他好文 时间:
2015-01-02 09:44:11
阅读次数:
156