`
OuYangGod
  • 浏览: 53018 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论
文章列表
资源竞争 (线程互斥) 1、什么是资源竞争   有这样一种资源,在某一时刻只能被一个线程所使用:比如打印机、某个文件等等,如果多个线程不加控制的同时使用这类资源,必然会导至错误。   下面的例子模拟了一个打印机,多个线程不加控制的同时使用这个打印机: public class Printer { public void print(int printer, String content) { System.out.println("Start working for [" +printer+"]"); ...
Java多线程基础 1、实现线程的方式   在Java中线程的实现无外乎两种方法:实现Runnable接口、继承Thread类:   实现Runnable接口 public class MyTask implements Runnable { @Override public void run() { System.out.println("mytask executed...."); } public static void main(String[] args) { ...

JAVA初始化

  在JAVA中变量在使用前,必须初始化,否则在编译时会报错。 public void sample() { int i; System.out.println(i);// Error -- i not initialized }   但是当变量是类的属性时,情况就有些不一样了。 public class Sample { int i; Object ...

mysql 笔记

安装完成后的设置 1、修改root账号的登录密码 mysqladmin -u root password 'password'; 2、权限设置 登录mysql mysql -u root -ppassword; 设置root账号权限 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTON; 删除密码为空的记录 use mysql; delete from user where PASSWORD=''; 3、my.cnf配置文件 default-character-set   ...
  之前在项目中使用了Apache xml-rpc,遇到了一个麻烦的问题。spring没有提供对xml-rpc的支持,在处理webservice请求的时候,没有办法使用spring容器中管理的各种各样的bean对象。显然,这是不能接受的。   使用Apache xml-rpc,一般只需要在web.xml中定义一个servlet (XmlRpcServlet), 再实现用于处理webservice请求的组件类就可以了。   比如定义一个Servlet: <servlet> <servlet-name>XmlRpcServlet</servlet-name> ...

cpio命令

cpio: Creates an archive or restores files from an archive Format cpoi --create [options] cpoi --extract [options] [patterns] copi --pass-through [options] directory Description      The cpio utility has three modes of operation: Create mode places multiple files into a single archive file, extract ...
CRON: SCHEDULE COMMANDS     Under Linux, periodic execution is normally handled by the cron daemon. cron starts when the system boots and remains running as long as the system is up. cron reads one or more configuration files containing lists of command lines and times at which they are to be invoked ...
    The Dojo Toolkit is an open-source JavaScript toolkit for building great web applications.   First Step     Start by making a index.html file for use as a basic template for any example:   <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict. ...

Struts2的OGNL

 OGNL的全称是Object Graph Navigation Language(对象图导航语言),它是一种强大的表达式语言,让你通过简单一致的表达式语法来读取和设置Java对象的属性值,调用对象的方法,遍历整个对象的结构图,实现字段类型转换等功能。 为什么使用OGNL   相对于其它的表达式语言,OGNL的功能更为强大,它提供了很多高级而必需的特性,例如强大的类型转换功能、静态或实例方法的执行、跨集合投影,以及动态lambda表达式定义等。 OGNL基础   OGNL表达式的计算都是围绕OGNL上下文来进行的,OGNL上下文实际上就是一个Map对象,由ognl.OgnlContex ...
Global site tag (gtag.js) - Google Analytics