`
文章列表
原文地址:http://www.openlogic.com/wazi/bid/259014/How-to-add-exception-handling-to-JSF-applications   Everyone who codes Java EE web applications needs to pay attention to exception handling. When a program encounters an error, developers can display friendly messages for end users, which increases t ...
     Ubuntu默认root账户是关闭的。 一、从图形界面登录root用户 1、启用root用户,为其设置密码     sudo passwd root 2、编辑lightdm.conf     sudo gedit /etc/lightdm/lightdm.conf     在最后加入     greeter-show-manual-login=true     重启后会有“登录”选项,就可以输入root用户名登陆了。     如root登录后没有声音,其原因是使用root登录后pulseaudio没有启动。可将root加到pulse-access组:    s ...
    默认情况下,ubuntu将自动安装的软件快捷方式保存在/usr/share/applications目录下,如果我们要创建桌面快捷方式,只需复制到桌面即可。     那么手动安装的软件怎么创建快捷方式呢?下面以Intellij Idea为例说明。     首先在桌面创建一个名为“Idea.desktop”的文件,在文件中添加以下内容:   [Desktop Entry]Name=IdeaIUComment=Idea IU 12.9Exec=/home/sunjing/idea-IU-129.713/bin/idea.shIcon=/home/sunjing/idea-IU-1 ...
SeleniumHQ create robust, browser-based regression automation suites and tests scale and distribute scripts across many environment support the following browsers: Google Chrome, Internet Explorer, Firefox, Safari, Opera, HtmlUnit, phantomjs Selenium-IDE (Integrated Development Environment), i ...
mockito <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <version>2.21.0</version> <scope>test</scope> </dependency>   import org.junit.Rule; import org.junit.Test; import org.mockito.InOrd ...
a) 广泛使用绑定变量,特别是批量绑定,因为这可以有效的避免sql的硬解析和PL/SQL引擎和SQL引擎的上下文切换b) 广泛使用UROWID来处理DML语句c) 在你的存储过程中谨慎使用DDL语句,因为这可能会破坏你的transaction的连续性,更为严重的是可能会阻塞DML操作并可能会导致大量library cache latch争用并且有可能会导致某些sql执行计划的改变。 library cache请参考: http://blog.sina.com.cn/s/blog_656184530101262t.html http://prefectliu.blog.163.com/b ...
    同事写的,我整理了一下 1)通过分析SQL执行计划来优化SQL,这是最直接、最有效的方式。 2)Oracle SQL优化的目标主要有如下三点:降低执行SQL语句所需要的工作负载;均衡执行SQL语句所需要的工作负载;并行化执行SQL语句所需要的工作负载。 3)SQL的优化原则不能一概而论,与很多因素有关。比如你的系统的种类,是OLTP还是OLAP?系统数据量的大小;数据的分布;表和索引是否分析;表的一些存在严重倾斜的列上是否存在直方图;你用hint了吗? optimizer_mode的值(Oracle 10g中的选项有first_rows/all_rows/first_rows ...
ModelMapper 是一个从对象到对象(object-to-object)的框架,能将Java Bean(Pojo)对象从一种表现形式转化为另一种表现形式。它采用“通过约定来配置”的方式,自动匹配不同的对象映射,同时具备满足某些特殊需求的高级功能。这与.NET 的AutoMapper 库很类似(但不是直接移植)。 ModelMapper能用更加紧凑的代码对Java对象进行映射,在更简单的情况下甚至可以实现零配置。它支持以下特性: 基于名称的对象属性映射 复制公开的、受保护的和私有的字段 略过某些字段 可用转换器来影响映射(如将字符串转换为小写) 在不同类型的字段间进行映射( ...
Jatinder Mann 是微软Internet Explorer产品的一名项目经理,在BUILD 2012大会上,他做了题为“提高HTML5应用和网站性能的50条秘技(50 performance tricks to make your HTML5 apps and sites faster )”的演讲,介绍了很多为Web应用程序提速的技巧。 Man ...
    Batik is a Java-based toolkit for applications or applets that want to use images in the Scalable Vector Graphics (SVG) format for various purposes, such as display, generation or manipulation.     The project’s ambition is to give developers a set of core modules that can be used together or ...
1. String 和StringBuilder 、StringBuffer 的区别 String 对象是不可变的(immutable) ,类中每一个修改String 值的方法,都是创建了一个全新的String 对象。StringBuilder、StringBuffer 支持可变的字符串,StringBuffer 是线程安全的。字符串串联(+ ) ...
What to Do about OutOfMemoryError    One common issue that many developers have to address is that of applications that terminate with java.lang.OutOfMemoryError. That error is thrown when there is insufficient space to allocate an object. That is, garbage collection cannot make any further space a ...

用JNI进行java编程

    博客分类:
  • Java
(摘自 IBM DW)      JNI ( Java Native Interface) 是一个本机编程接口,它是 Java 软件开发工具箱( Java Software Development Kit (SDK) )的一部分。 JNI 允许 Java 代码使用以其它语言(譬如 C 和 C++ )编写的代码和代码库。 Invocation API ( JNI 的一部分)可以用来将 Java 虚拟机( JVM )嵌入到本机应用程序中,从而允许程序员从本机代码内部调用 Java 代码。     当无法用 Java 语言编写整个应 ...

JVM性能分析工具

    博客分类:
  • Java
Eclipse Memory Analyzer (MAT)     The Eclipse Memory Analyzer is a fast and feature-rich Java heap analyzer that helps you find memory leaks and reduce memory consumption.   JProfiler     JProfiler is an award-winning all-in-one Java profiler. JProfiler's intuitive GUI helps you find performan ...
     JNA(Java Native Access)是建立在JNI基础上的开源Java框架。     项目网址: https://github.com/twall/jna     使用JNI调用dll是比较麻烦的,如已有一个dll文件,还需要使用C语言另外编写一个dll(根据由java代码生成的C/C++ 头文件编写 ),使用者需要比较了解C/C++。     使用JNA,不 需再编写适配用的dll,只要 编写一个 Java 接口和一些代码,作为dll的代理,就可在Java程序中调用dll,JNA自动实现Java和C的数据类型映射。 ...
Global site tag (gtag.js) - Google Analytics