目录

我的学习分享

记录精彩的程序人生

标签: 转载 (136)

【java基础】java.util.logging.Logger使用详解

java.util.logging.Logger使用详解 一、创建Logger对象 // 为指定子系统查找或创建一个 logger。 static Logger getLogger(String name) // 为指定子系统查找或创建一个 logger。 static Logger getLogger(String name, String resourceBundleName) 注意:name是Logger的名称,当名称相同时候,同一个名称的Logger只创建一个。 二、Logger的级别 比log4j的级别详细,全部定义在java.util.logging.Level里面。 各级别按降序排列如下: SEVERE(最高值) WARNING INFO CONFIG FINE FINER FINEST(最低值) 此外,还有一个级别 OFF,可用来关闭日志记录,使用级别 ALL 启用所有消息的日志记录。 logger默认的级别是INFO,比INFO更低的日志将不显示。 Logger的默认级别定义是在jre安装目录的lib下面。 # Limit the message that ar....

Building a Login Screen for a NetBeans Platform Application 有更新!

Since the resolution of issue 92570, it is possible to show a modal dialog after the appearance of an application's splash screen, but before the appearance of an application's main window. And what would one want to put there? A login screen, of course. With this enhancement, it is possible to integrate some level of authentication into your NetBeans Platform application. The specific method in question here is DialogDisplayer.notifyLater, which can now also be called before the main window is ....

详解Github的.gitignore忽略文件+.gitignore不生效解决方案+生产配置大奉送

详解Github的.gitignore忽略文件+.gitignore不生效解决方案+生产配置大奉送 Git中有一个非常重要的一个文件-----.gitignore 今天给大家免费送一个.gitignore忽略文件配置清单。 大家一定要养成在项目开始就创建.gitignore文件的习惯,否则一旦push,处理起来会非常麻烦。 ============华丽的分割线============ 当然如果已经push了怎么办?当然也有解决方法,如下: 有时候在项目开发过程中,突然心血来潮想把某些目录或文件加入忽略规则,按照上述方法定义后发现并未生效,原因是.gitignore只能忽略那些原来没有被track的文件,如果某些文件已经被纳入了版本管理中,则修改.gitignore是无效的。那么解决方法就是先把本地缓存删除(改变成未track状态),然后再提交:   --cached 后面 有个点 git rm -r --cached . git add . git commit -m "update .gitignore" ============华丽的分割线============ https:/....

【Netbeans Platform】NetBeans Platform Login Tutorial 有更新!

NetBeans Platform Login Tutorial This tutorial demonstrates how to create a login form for a NetBeans Platform application with very simple user and password management. The login will be implemented with the DialogDisplayer class of the NetBeans APIs. The dialog that you create in this tutorial will be visible whenever the user starts the application. The passwords and usernames will be stored in a preferences file, which is not very safe. Therefore, this tutorial will provide a solution to enc....

Customize Netbeans Platform Splash Screen and About Dialog

Customize Netbeans Platform Splash Screen and About Dialog October 18th, 2007 | by Tonny Kohar | During development of our product Sketsa SVG Editor, we need to customize the default Netbeans Platform About Dialog and splash screen as part our product branding. Note: this is tested on Netbeans IDE 6-beta1 Customize the Splash Screen Create the image using any image editor application to suit your particular branding. If you want to have single image for both splash and about dialog, please mak....

Secrets of the NetBeans Window System

https://dzone.com/articles/secrets-netbeans-window-system

【vba】如何用vba给一个word表格的最后插入一行

https://wenku.baidu.com/view/c3a781584028915f814dc232.html

【Java基础】Enhancing Swing——Yes, you can (still) build beautiful user interfaces with Swing! 有更新!

About this series So you think you know about Java programming? The fact is, most developers scratch the surface of the Java platform, learning just enough to get the job done. In this ongoing series, Java technology sleuths dig beneath the core functionality of the Java platform, turning up tips and tricks that could help you solve even your stickiest programming challenges. User interface design and development have changed a lot and the Java™ platform has kept pace with these changes. The re....

【MySQL】mysql报错Ignoring the redo log due to missing MLOG_CHECKPOINT between

mysql报错Ignoring the redo log due to missing MLOG_CHECKPOINT between mysql版本:5.7.19 系统版本:centos7.3 由于周未公司断电,跑在vmware虚拟机上的mysql挂掉,无法重启 启动mysql的时候,error log的信息如下 2017-11-15T11:44:46.562061+08:00 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 63593957 and the end 63593472. 2017-11-15T11:44:46.562090+08:00 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2017-11-15T11:44:47.062885+08:00 0 [ERROR] Plugin 'InnoDB' init function retu....

【股票】什么是前复权 、 后复权与不复权? 有更新!

K线图里面的前复权、后复权和不复权,具体是什么意思,我们在股票分析的时候应该选择哪一个?今天我们来聊聊复权这个话题

【Java基础】Java中将InputStream读取为String, 各种方法的性能对比

如下, 一共存在11种实现方式及其对应的性能测试结果: 1、使用IOUtils.toString (Apache Utils) String result = IOUtils.toString(inputStream, StandardCharsets.UTF_8); 2、使用CharStreams (guava) String result = CharStreams.toString(new InputStreamReader(inputStream, Charsets.UTF_8)); 3、使用Scanner (JDK) Scanner s = new Scanner(inputStream).useDelimiter("\\A"); String result = s.hasNext() ? s.next() : ""; 4、使用Stream Api (Java 8). 提醒: 这种方式会将不同的换行符 (比如\r\n) 都替换为 \n. String result = new BufferedReader(new InputStreamReader(inputStrea....

【Netbeans Platform】Minimal NetBeans Platform Dependencies

When you have no more than this dependency in the application module of your NetBeans Platform application, you have all you need for the simplest imaginable NetBeans Platform application. <dependencies> <dependency> <groupId>org.netbeans.modules</groupId> <artifactId>org-netbeans-core-startup</artifactId> <version>${netbeans.version}</version> <type>jar</type> </dependency> </dependencies> The above results in one direct d....

【Netbeans Platform】Attach source code to a Netbeans Library Wrapper Module

Attach source code to a Netbeans Library Wrapper Module I’m new in NetBeans and today I’ve been struggling a couple of hours with the simple task of attaching the source code for an external JAR (NetBean Library Wrapper Module). I’ve been trying to find in google how to do it without success until I reached this post in the netbeans-users mailing list. Then I realized that I should been looking into the NetBeans Help first. The entry at Help -> Help contents -> Java Applications -> Deb....

【Netbeans Platform】NetBeans Lookups Explained!

Lookups are one of the most important parts of the NetBeans Platform. They're used almost everywhere and most of the time when you ask something on a mailing list the answer is "Use Lookups!". Many times when the use of Lookups is explained it's in a very specific context, e.g. selection management or ServiceLoaders. That makes Lookups look complicated and hard to understand, while actually they are very simple and extremely powerful. That's why I guess it's time to write an article that explain....

【Java基础】Maven的Scope区别笔记 有更新!

依赖的Scope scope定义了类包在项目的使用阶段。项目阶段包括: 编译,运行,测试和发布。 分类说明 compile 默认scope为compile,表示为当前依赖参与项目的编译、测试和运行阶段,属于强依赖。打包之时,会达到包里去。 test 该依赖仅仅参与测试相关的内容,包括测试用例的编译和执行,比如定性的Junit。 runtime 依赖仅参与运行周期中的使用。一般这种类库都是接口与实现相分离的类库,比如JDBC类库,在编译之时仅依赖相关的接口,在具体的运行之时,才需要具体的mysql、oracle等等数据的驱动程序。 此类的驱动都是为runtime的类库。 provided 该依赖在打包过程中,不需要打进去,这个由运行的环境来提供,比如tomcat或者基础类库等等,事实上,该依赖可以参与编译、测试和运行等周期,与compile等同。区别在于打包阶段进行了exclude操作。 system 使用上与provided相同,不同之处在于该依赖不从maven仓库中提取,而是从本地文件系统中提取,其会参照systemPath的属性进行提取依赖。 import 这个是mave....

【Java基础】Java InputStream转File

文件处于磁盘上或者流处于内存中 在输入流有已知的和预处理的数据时,如在硬盘上的文件或者在流处于内存中。这种情况下,不需要做边界校验,并且内存容量条件允许的话,可以简单的读取并一次写入。 InputStream initialStream = new FileInputStream(new File("src/main/resources/sample.txt")); byte[] buffer = new byte[initialStream.available()]; initialStream.read(buffer); File targetFile = new File("src/main/resources/targetFile.tmp"); OutputStream outStream = new FileOutputStream(targetFile); outStream.write(buffer); 基于Guava的实现 InputStream initialStream = new FileInputStream(new File("src/main/resour....

【Java基础】Java压缩解压ZIP之Zip4j

Zip4j是一个Java操作zip压缩格式的开源项目,功能强大而且使用方便,能完全满足Java操作Zip压缩文件。默认采用UTF-8编码,所以支持中文,同时也支持密码,而且支持多种压缩算法。Zt-ZIP也不错,有兴趣的可以试试。 http://www.lingala.net/zip4j/ 压缩 1、文件压缩 ZipFile zipFile = new ZipFile("c:\\ZipTest\\test1.zip"); ArrayList filesToAdd = new ArrayList(); filesToAdd.add(new File("c:\\ZipTest\\sample.txt")); filesToAdd.add(new File("c:\\ZipTest\\文件.doc")); filesToAdd.add(new File("c:\\ZipTest\\파일.xls")); filesToAdd.add(new File("c:\\ZipTest\\ファイル.ppt")); ZipParameters parameters = new ZipParameters(....

【git】git设置忽略文件.gitignore

在仓库目录下新建一个名为.gitignore的文件(因为是点开头,没有文件名,没办法直接在windows目录下直接创建,必须通过右键Git Bash,按照linux的方式来新建.gitignore文件)。如下图所示。 .gitignore文件对其所在的目录及所在目录的全部子目录均有效。通过将.gitignore文件添加到仓库,其他开发者更新该文件到本地仓库,以共享同一套忽略规则。 以下涉及的ignore文件均为如下格式: # 以'#'开始的行,被视为注释. # 忽略掉所有文件名是 foo.txt的文件. foo.txt # 忽略所有生成的 html文件, *.html # foo.html是手工维护的,所以例外. !foo.html # 忽略所有.o和 .a文件. *.[oa] 配置语法: 以斜杠“/”开头表示目录; 以星号“*”通配多个字符; 以问号“?”通配单个字符 以方括号“[]”包含单个字符的匹配列表; 以叹号“!”表示不忽略(跟踪)匹配到的文件或目录; 常用的规则: 1)/mtk/ 过滤整个文件夹 2)*.zip 过滤所有.zip文件 3)/mtk/do.c 过滤某个具体文....

【Java基础】Java获取系统信息(用户目录,临时目录等)

Java获取系统信息(用户目录,临时目录等) col1col2col3 java.versionJava运行时环境版本 java.vendorJava运行时环境供应商 java.vendor.urlJava供应商的 URL java.homeJava安装目录 java.vm.specification.versionJava虚拟机规范版本 java.vm.specification.vendorJava虚拟机规范供应商 java.vm.specification.nameJava虚拟机规范名称 java.vm.versionJava虚拟机实现版本 java.vm.vendorJava虚拟机实现供应商 java.vm.nameJava虚拟机实现名称 java.specification.versionJava运行时环境规范版本 java.specification.vendorJava运行时环境规范供应商 java.specification.nameJava运行时环境规范名称 java.class.versionJava类格式版本号 java.cla....

【Linux】linux中/dev/null与2>&1讲解

首先先来看下几种标识的含义: /dev/null 表示空设备文件 0 表示stdin标准输入 1 表示stdout标准输出 2 表示stderr标准错误 先看/dev/null command > /dev/null相当于执行了command 1 > /dev/null。执行command产生了标准输出stdout(用1表示),重定向到/dev/null的设备文件中 /dev/null可以理解为/dev路径下的空文件;该命令将command命令的标准输出输出到空文件中; 再看 1>test.log 执行./test.sh > res1.log 或 ./test.sh 1> res1.log结果为 我们发现stdout被重定向到了res1.log中,stderr并没有被重定向到res1.log中,stderr被打印到了屏幕上。 2>test.log 执行./test.sh 2> res3.log结果为 我们发现stderr被重定向到了res3.log中 2>&1 command>a 2>&1 可以理解为执....