ITeye博客

Iteye博客

epy · 共 20 篇文章

Android下openGL操作矩阵的函数

Matrix.multiplyMM(float[] result, int resultOffset, float[] lhs, int lhsOffset, float[] rhs, int rhsOffset) Multiply two 4x4 matrices together and store the result in a third 4x4 matrix. In matrix notation: result = lhs x rhs. Due to the way matrix multiplication works, the result matrix will have …

2016-06-07 09:51 · openGL · 评论(0)

如何生成多域名证书

多域名证书 https://www.digicert.com/subject-alternative-name.htm Multi-Domain (SAN) Certificates - Using Subject Alternative Names 使用者备用名称 The Subject Alternative Name Field Explained The Subject Alternative Name field lets you specify additional host names (sites, IP addresses, common names, etc.) to b…

2016-04-11 10:00 · 网络技术 · 评论(0)

如何获得免费的https证书

https://gethttpsforfree.com/上提供了一个获取free https certificates的办法,他的证书来自于the non-profit certificate authority Let's Encrypt。 https://gethttpsforfree.com/ You can now get free https certificates from the non-profit certificate authority Let's Encrypt! This is a website that will take you through the ma…

2016-04-11 09:35 · 网络技术 · 评论(0)

按下鼠标并拖到按钮外松开,如何触发click事件?

经过在Chrome、IE和Firefox上测试,发现在按钮上按下鼠标,拖动到按钮外松开,可以触发mousedown事件,但无法触发mouseup和click事件。在这种情况下,如果想触发按钮的mouseup和click事件,应该怎么做呢? 解决方法: 定义一个JS变量,表示按钮是否按下,初始化为false。在按钮mousedown事件的响应函数里,将这个变量置为true。然后监听整个页面的mouseup事件,在响应函数里,判断变量是否为true;如果不是true,啥都不做;如果是true,说明之前刚刚按下了按钮,就调用按钮的mouseup或click响应函数,同时将变量置为false。 也可…

2016-01-04 18:15 · Web前端 · 评论(0)

EditText的错误信息

EditText可以通过setError来显示错误信息 通过设置application或activity的android:theme属性,可以修改错误信息的样式,但是不能自己定义错误信息的样式。 http://stackoverflow.com/questions/13874197/androiderrormessagebackground-getting-no-resource-found-error-in-styles-xml https://code.google.com/p/android/issues/detail?id=55879 Ther is no way to overri…

2015-12-02 18:06 · 评论(0)

E440装Win7遇到蓝屏问题

买的e440默认装的win8,不喜欢用,想装回win7,按网上说的去改BIOS: 1. 到Security界面下的Secure Boot并回车进入,将Secure Boot选项修改为Disabled。 2. 来到Restart界面,将OS Optimized Defaults选项修改为Disabled。 3. 再到Startup界面,将UEFI/Legacy Boot修改为Legacy ONLY。 然后再去安装win7系统,试了几次都失败,在装的过程就出现蓝屏,即使勉强安装上了, 用的时候动不动就蓝屏,错误代码为0x000000f4;有人说是内存问题,拔出内存,擦了金手指,换插槽,还是不行。…

2015-02-27 14:16 · 评论(0)

MySQL中按可NULL列JOIN时的问题

MySQL中,SELECT NULL=NULL结果是NULL,SELECT NULL!=NULL结果也是NULL。 如果两个表按某几个列中进行JOIN,如果有一列允许有NULL值,那么关联时要进行特殊处理。一个例子,wbk_mr和dic_hscode按CODE_T和CODE_S进行JOIN,CODE_S可以为NULL,SQL如下: SELECT m.`CODE_T`,m.`CODE_S`, h.`UNIT_1`,h.`UNIT_2` FROM `wbk_mr` m JOIN `dic_hscode` h ON m.`CODE_T`=h.`CODE_T` AND (m.`CODE_S`=h.`…

2014-11-06 17:49 · MySQL · 评论(0)

Java中TreeMap VS HashMap

Key是长度为11的String, Value是Short。 HashMap使用default load factor (0.75). Size为100000: TreeMap 占用了8.91M内存;search 100000 times, usedTime: 268ms. HashMap占用了9.65M内存;search 100000 times, usedTime: 54ms. Size为1000000: TreeMap 占用了91.5M内存;search 100000 times, usedTime: 636ms. HashMap占用了95.88M内存;search 100000 ti…

2013-11-15 15:41 · Java语言 · 评论(0)

JS中如何实现sleep(休眠)的功能?

1. jquery的$.delay()方法 设置一个延时来推迟执行队列中之后的项目。这个方法不能取代JS原生的setTimeout。 The .delay() method is best for delaying between queued jQuery effects. Because it is limited—it doesn't, for example, offer a way to cancel the delay—.delay() is not a replacement for JavaScript's native setTimeout function, which …

2013-10-02 19:49 · Web前端 · 评论(0)

如何在网页中循环播放声音?

HTML中可以播放声音的标签有bgsound、embed、audio、object等,下面先简单介绍这几个标签 <bgsound>: <bgsound> 是用来插入背景音乐,但只适用于 ie,其参数设定不多。如下 <bgsound src="your.mid" autostart=true loop=infinite> src="your.mid" 设定声音文件的路径,可以是相对或绝对。 autostart=true 是否在音乐档下载完之后就自动播放。true 是,false 否 (内定值)。 loop=infinite 是否自动反复播放。loop=2 表示重复两次,infinite 表示重…

2013-09-27 13:56 · Web前端 · 评论(0)

MyEclipse对System.in的中文支持有问题

用如下方式从控制台获取输入信息: BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String line = reader.readLine(); System.out.println(line + ", length:" + line.length()); 在MyEclipse中运行时,输入英文没问题,但输入"一个苹果"会得到 �?��苹果, length:6 在命令窗口中输入的中文都是可以正确显示出来的;应该是因为MyEclipse的System.in对中文输入法支持不够好。 网上…

2013-09-27 11:24 · Java语言 · 评论(0)

HeapDumpOnOutOfMemoryError堆转储实践和一些分析

使用了标志-XX:+HeapDumpOnOutOfMemoryError,JVM会在遇到OutOfMemoryError时拍摄一个“堆转储快照”,并将其保存在一个文件中。 对如下一段代码,【代码1】 public static void main(String[] args) { long arr[]; for (int i=1; i<=10000000; i*=2) { arr = new long[i]; } } 设置虚拟机参数为:-Xmx40m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=E:\Java\dump 执行程序,很快会抛…

2013-07-27 22:31 · Java语言 · 评论(2)

用Hibernate+Proxool连Oracle RAC时报“Could not obtain connection metadata”的解决办法

项目中一个应用持久层配置为Hibernate+Proxool,在本地连单Oracle数据库没有问题,部署到现网Oracle RAC环境时总是报错 [WARN ] Could not obtain connection metadata java.sql.SQLException: Io 异常: Connection refused(DESCRIPTION=(ERR=1153)(VSNNUM=169870336)(ERROR_STACK=(ERROR=(CODE=1153)(EMFI=4)(ARGS='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.153.233)(…

2013-01-29 21:21 · Java语言 · Oracle · 评论(0)

连接RAC时出现的一个死锁异常

平台的路由应用需要读取一个表中的记录,优先读取SMS_ID比较小的记录;并且因为会有两个路由应用同时工作,为避免重复读取,需要在读取时锁定记录,读完后将这些记录删除;这就要用到Oracle中的select for update语句;排序后的记录无法使用for update子句;只好先用普通查询,用order by方式查出前N条记录的SMS_ID,得到结果中最大的SMS_ID,然后用 WHERE SMS_ID <= 最大值 for update 的方式锁定并获取相应的记录。 代码如下: Query query = session.createQuery("select s.smsId from…

2012-08-14 21:19 · Oracle · 评论(0)

找不到Oracle日志

程序连接Oracle,产生死锁等异常时,Orace在alert_orcl.log中输出简单的日志,如: Mon Aug 13 09:49:03 2012 ORA-00060: Deadlock detected. More info in file e:\oracle\product\10.2.0\db_1\admin\orcl\udump\orcl_ora_5292.trc. 然后寻找orcl_ora_***.trc文件,查看详细的信息。 文件名orcl_ora_***.trc中的数字,是thread id,如果不小心把某个还在使用的日志文件删除,会出现诡异的问题,在我的电脑(Win7)下…

2012-08-14 20:56 · Oracle · 评论(0)