`
jiadong
  • 浏览: 29062 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表

python基础1

1. 2**3 == pow(2,3) == 8 2. 1/2=0 1.0/2=0.5 3. import math foo = math.sqar foo(100)=10.0 --- 神奇 4 cmath 可以计算 cmath.sqrt(-1) =1j 5. raw_input input 前者在输入字符串时不需要输入引号 返回类型为字符串,后者需要 6, print r' /n' 可以输出/n 原始字符串 或者可以使用三个单引号实现''' '''
1. 在建立域的时候需要制定为生产模式 建立域是 在目录bea/weblogic92/common/bin/config.sh 2. 建立一个新的文件 boot.properties 目录 bea/user_projects/domains/cyh_domain 具体命令: touch boot.properties 更改文件权限 chmod 加入写的内容 vi boot.properties 进去后会有警告选择 输入字符 e password=?? username=??   :x   3. 完成  
WEB-INF>jad -o -r -sjava -d src -8 classes/**/*.class 会在web-inf目录下生成一个src为文件名的java文件目录

find prime number

  public static int[] findPrimeNum(){ int tmp[] = new int[(int)(100*(1-1/2f-1/3f+1/6f))]; tmp[0]=2;tmp[1]=3;tmp[2]=5;tmp[3]=7;tmp[4]=11;tmp[5]=13; int tmpindex=5; for(int i=17;i<=100;i+=2){ if(!candiv(i,tmp)){ tmp[tmpindex++] = i; } } int[] result = new int[tmpindex++]; System.ar ...

经典的单例模式

    博客分类:
  • java
public class Singleton { private Singleton(){} private static volatile Singleton s; public static Singleton getInstance(){ if(null==s){ //在多线程环境下会有有多个线程到该运行点 synchronized (Singleton.class) { if(null==s){ //双重检查机制,确保多个线程 只能创建一个实例 s=new Singleton(); } } } return s; }}
思路: 1.先确定数组的排序规则 2. 查找待插入数字需要插入的准确位置(需要遍历数组) 3. 返回一个新的数组   public static int[] insertArray(int[] target ,int insertNum){ int[] tar=new int[target.length+1]; //升序排列 int index=0; if(target[0]<target[target.length-1]){ for(int i=0;i<target.length-2;i++){ if(insertNum>=target[i] &a ...
public class ReadResourceProperties { private static Properties p = new Properties(); //在同一级目录下,路径文件的写法// private static String filepath="my.properties"; //在src 根目录下文件的写法 private static String filepath="/my.properties"; //在别的目录下路径写法// private static String filepath="/com/othe ...
面试的时候经常会有删除数据库重复记录的sql // 数据库有主键id,查找col相同的记录 delete from table t where t.id not in (select min(tb.id) from table tb where tb.col=t.col) // 数据库中没有主键id,查找col 相同的记录 delete from table t where t.rowid not in (select min(tb.rowid) from table tb where tb.col=t.col)
今天复习了下java的反射,大致内容为 通过class.froname得到class对象。通过class对象提供的newInstance方法获得class对象的实例,此时已经初始化了目标类。 在通过Class 实例提供的getMethods,getFields 等方法获取方法或者属性进行操作。 1. Class c = Class.forName("**.**.ClassName"); 2. Object obj = c.newInstance(); 3. Method[] m = c.getDeclaredMethods(); //获取所有定义了的方法,包括private ...
这几天部署了一个系统在外网的测试服务器上,服务器为linux , appServer weblogic92 部署后在北京的几个客户端可以正常访问,上海,南昌等地方无法使用。 最后查明发现是weblogic的问题,weblogic的lince在非商用的情况下只允许5个不同的IP访问 IE浏览器访问的时候不返回任何错误提示信息,只显示网页无法访问 TheServerisnotabletoservicethisrequest:[Server:002621]Connectionrejected,theserverlicenseallowsconnectionsfromonly5uniqueIPaddr ...
--------备忘录 在常用的汇总报表中,会出现通过某些条件实现分组后,对数量金额进行小计以及总计 可以使用group by rollup(col1,col2,....coln) 来实现分组统计 若要对总计,小计等汉字的显示进行控制,可以使用case()函数 selecttp.tp_xmbh as xmid,tp.tp_ccbh as showid,(case when tp.tp_xmbh is null then null else (select wp.name from ZYPWT2.PM_PROJECT_INFO wp where STATUS=1 and PI_CATEGORY=' ...
// 此用例来源于Thinking in java class Tank{ int level; String msg; Tmp tmp; @Override public String toString() { return "level = "+level+" msg="+msg+" tmp="+tmp; } } class Tmp{ private String name; public Tmp(String name){ this.name=name; } @Override ...
1、要使用绑定变量减少硬解析 (name=? and id=?) 2、根据WHERE后面的条件选择索引 3、如果查询一次表可以得到想要的结果就尽量的一次完成 -----待补充
Jquery中使用get方法进行ajax处理非常方便,例如 var tmp=0; $.get(action,{param},function(data){ date='1'; if(data==='1') tmp=1;//此种赋值不会起作用 }); alert(tmp);// 0 tmp的值没有被修改的原因是由于 get是进行的异步操作,tmp的值没有被修改 改用可以通过操作的ajax请求可以解决上述问题。 $.ajax({ type:"GET", url:"cyhuser.go?method=checkUsername", ...
什么叫做事务,事务的四个必要属性是哪些?事务的隔离级别?事务介绍:所谓事务是用户定义的一个数据操作序列,这些操作要么全做要么都都不做,是一个不可分割的工作单位。事务属性:原子性,一致性,隔离性,持久性原子性:(Atomicity)事务是数据库的逻辑工作单元,事务中包括的诸操作要么都做,要么都不做。一致性:(Consistency)事务执行的结果必须是使数据库从一个一致性状态变到另一个一致性状态。隔离性:(Isolation)一个事务的执行不能被其他事务干扰。即一个事务内部的操作及使用的数据对其他并发事务是隔离的,并发执行的各个事务之间不能互相干扰。持久性:(Durability)持久性也称永久性 ...
Global site tag (gtag.js) - Google Analytics