system

读书笔记之多线程——System.Thread.Timer

时间秒杀一切 提交于 2020-03-18 21:55:06
--居然工作很久都没有用过System.Thread.Timer。下面是在MSDN上的一些学习笔记。 首选是构造函数 : Timer(TimerCallback) //使用新创建的 Timer 对象作为状态对象,用一个无限周期和一个无限到期时间初始化 Timer 类的新实例。 Timer(TimerCallback, Object, Int32, Int32) //使用 32 位的有符号整数指定时间间隔,初始化 Timer 类的新实例。 Timer(TimerCallback, Object, Int64, Int64) //用 64 位有符号整数来度量时间间隔,以初始化 Timer 类的新实例。 Timer(TimerCallback, Object, TimeSpan, TimeSpan)//初始化 Timer 类的新实例,使用 TimeSpan 值来度量时间间隔。 Timer(TimerCallback, Object, UInt32, UInt32) //用 32 位无符号整数来度量时间间隔,以初始化 Timer 类的新实例。 备注: 使用 TimerCallback 委托指定希望 Timer 执行的方法。计时器委托在构造计时器时指定,并且不能更改。 此方法不在创建计时器的线程上执行,而是在系统提供的 ThreadPool 线程上执行。 创建计时器时

Spring注解

徘徊边缘 提交于 2020-03-18 19:47:06
3 月,跳不动了?>>> 一、Bean的生命周期 流程 Bean创建 —— 初始化 —— 销毁 创建: 单实例:在容器启动时创建对象 多实例:每次调用时创建对象 初始化: 都是在对象创建完成后,调用初始化方法 销毁: 单实例:容器关闭时,调用销毁方法 多实例:容器不会管理这个bean,只能手动调用销毁方法 实现方式 在 @Bean 注解上指定初始化( initMethod )、销毁方法( destroyMethod ) @Bean(initMethod = "init", destroyMethod = "destroy") public Car car(){ return new Car(); } 让Bean实现 InitializingBean 和 DisposableBean 接口,重写它们的方法 public class Cat implements InitializingBean, DisposableBean { public Cat() { System.out.println("Cat...Construct..."); } @Override public void afterPropertiesSet() throws Exception { System.out.println("Cat...init..."); } @Override public

Oracle数据导入、导出dmp文件

余生长醉 提交于 2020-03-18 12:52:49
某厂面试归来,发现自己落伍了!>>> 数据导出,命令exp,将远程数据库中的数据导入到本地,比如你在windows下可以将Linux中的数据库中数据导出到Windows本地。 1 将数据库TEST完全导出,用户名system 密码manager 导出到D:\daochu.dmp中,将Test数据库中所有数据导出到一个dmp文件中。前提是登录用户即system有导出权限。 exp system/manager @TEST file=d:\daochu.dmp full=y 2 将数据库中system用户与sys用户的表导出,指定导出某些用户的表。 exp system/manager @TEST file=d:\daochu.dmp owner=(system,sys) 3 将数据库中的表table1 、table2导出,指定导出固定的表 exp system/manager@TEST file=d:\daochu.dmp tables=(table1,table2) 数据导入,命令imp 1 将D:\daochu.dmp中的数据导入TEST数据库中。要先删掉将要导入的表,如果是全库导入就删掉所有的表,否则导入过程中会报表已存在的错。 imp system/manager@TEST file=d:\daochu.dmp 2 将d:\daochu.dmp中的表table1导入

Mounting an ISO with sys/mount.h

情到浓时终转凉″ 提交于 2020-03-18 07:11:52
问题 I'm trying to mount an ISO file in a C++ program in linux I'm aware of the linux command to achieve this, i.e mount -o loop ~/Test.iso /mnt/myISO But the mount(2) man page states the following prototype for mounting : int mount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data); How do I specify the loop option here ? -- Also, is it good (/acceptable) practice in general, in linux programming to use system shell calls from C++ to

Mounting an ISO with sys/mount.h

前提是你 提交于 2020-03-18 07:11:20
问题 I'm trying to mount an ISO file in a C++ program in linux I'm aware of the linux command to achieve this, i.e mount -o loop ~/Test.iso /mnt/myISO But the mount(2) man page states the following prototype for mounting : int mount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data); How do I specify the loop option here ? -- Also, is it good (/acceptable) practice in general, in linux programming to use system shell calls from C++ to

File类中的list()和listFiles()方法

耗尽温柔 提交于 2020-03-18 07:02:25
/** * list()方法是返回某个目录下的所有文件和目录的文件名,返回的是String数组 * * listFiles()方法是返回某个目录下所有文件和目录的绝对路径,返回的是File数组 * @param args */ public static void main(String[] args) { //创建File对象 File file = new File("D:/testCode/code/VueSource"); System.out.println("file "+file); //获取该目录下的所有文件和目录的文件名 String[] files = file.list(); System.out.println("files "+files.toString()); for (String f : files){ System.out.println("f "+f); } System.out.println(); //listFiles是获取该目录下所有文件和目录的绝对路径 File[] fs = file.listFiles(); System.out.println("fs "+fs); for (File f : fs){ System.out.println(f); } }file.getOriginalFilename()是得到上传时的文件名

详解ASP.NET MVC2项目升级到MVC 3 RC

瘦欲@ 提交于 2020-03-18 04:39:55
微软在10号发布了ASP.NET MVC3的发布候选版(RC:Release-candidate),该版本提供了Razor视图引擎的智能感知等功能,并同样具备Online许可。眼馋的同学是不是已经迫不及待的想将现有项目升级呢?这里我就将官方ReleaseNotes中的升级办法翻译总结一下,以方便那些不喜欢看罗里啰嗦的英文文档的广大同学。 译文 要将现有的ASP.NET MVC2项目手动升级到ASP.NET MVC3(RC),我们需要如下这些步骤: 1. 随便创建一个新的ASP.NET MVC3项目,我们在升级中将用到其中包含的一些文件。 2. 从新建项目中将如下这些文件copy到现有的ASP.NET MVC2项目中,它们是: · /Scripts/jquery.unobtrusive-ajax.js · /Scripts/jquery.unobtrusive-ajax.min.js · /Scripts/jquery.validate.unobtrusive.js · /Scripts/jquery.validate.unobtrusive.min.js · /Views/Web.config 3. 如果你现有的ASP.NET MVC2项目中包含若干area,则需要将/Views/Web.config文件copy到所有的area下替换原文件。 4 在项目的Web.config文件中

nginx_php---py安装脚本

与世无争的帅哥 提交于 2020-03-18 02:19:08
# -*- coding: utf-8 -*-import os,timedef create__file(file_path,msg): f=open(file_path,"a") f.write(msg) f.closeos.system('rm -rf php-fpm')while os.path.isfile('./php-fpm.tar.gz') == 0: print('php-fpm.tar.gz文件不存在,终止执行') os.system('yum install -y lrzsz') os.system('rz -E')print('\n-----------------6秒后安装nginx服务-------------------------')time.sleep(6)print('\n----------------------删除nginx-----------------------------')Nginx=os.system("yum remove nginx -y")print('\n------------------创建仓库------------------')repo='''[nginx-stable]name=nginx stable repobaseurl=http://nginx.org/packages/centos/

.Net 通用配置文件读取方法

狂风中的少年 提交于 2020-03-18 02:05:24
去年在 window service 插件服务插件开发 时,曾经写过一篇 .net 中读取自定义Config文件 ,那个配置文件通用读取方法,只适用于读取键值对,如下面示例所示: 展开<configuration> <configSections> <sectionGroup name="WeiboClientSectionGroup"> <section name="SinaSection" type="System.Configuration.NameValueSectionHandler,System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="QQSection" type="System.Configuration.NameValueSectionHandler,System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="SohuSection" type="System.Configuration.NameValueSectionHandler,System, Version=4.0.0.0, Culture=neutral

SimpleDateFormat

限于喜欢 提交于 2020-03-17 23:01:20
某厂面试归来,发现自己落伍了!>>> public class SimpleDateFormat extends DateFormat SimpleDateFormat 是一个以国别敏感的方式格式化和分析数据的具体类。 它允许格式化 (date -> text)、语法分析 (text -> date)和标准化。 SimpleDateFormat 允许以为日期-时间格式化选择任何用户指定的方式启动。 但是,希望用 DateFormat 中的getTimeInstance、 getDateInstance 或 getDateTimeInstance 创建一个日期-时间格式化程序。 每个类方法返回一个以缺省格式化方式初始化的日期/时间格式化程序。 可以根据需要用 applyPattern 方法修改格式化方式。 SimpleDateFormat函数的继承关系: java.lang.Object | +----java.text.Format | +----java.text.DateFormat | +----java.text.SimpleDateFormat 下面是个小例子: import java.text.*; import java.util.Date; /** SimpleDateFormat函数语法: G 年代标志符 y 年 M 月 d 日 h 时 在上午或下午 (1~12)