目录

我的学习分享

记录精彩的程序人生

存档: 2020 年 07 月 (26)

【Netbeans Platform】Lookup API 有更新!

The Lookup API is a loose coupling mechanism enabling a component to place a query for a particular interface and get back pointers to all registered instances of that interface across all modules of the application. Simply put, Lookup is an observable Map, with Class objects as keys and instances of those Class objects as values, and it allows loosely coupled communication between modules. NetBeans’ implementation of a MultiFileSystem is the so-called System FileSystem. It is used to define all....

Netbeans Dialogs API

Displaying a dialog requires two steps: creating a NotifyDescriptor to configure the dialog a DialogDisplayer to display it. Listing 10-1. Display a message dialog using the Dialogs API NotifyDescriptor d = new NotifyDescriptor.Message("Message"); DialogDisplayer.getDefault().notify(d); Listing 10-2. Display a confirmation dialog using the Dialogs API NotifyDescriptor d = new NotifyDescriptor.Confirmation("Message", "Title"); object retVal = DialogDisplayer.getDefault().notify(d); if(retVal =....

ANTLR语法文件

https://github.com/antlr/grammars-v4

大牛猫语录 有更新!

20200730 买宽基指数基金,这样等于是把钱委托给交易所,让交易所帮你炒,这比你自己瞎搞强多了。 买龙头权重股,茅20组合里随机抽签选。 调整审美,买市值大,价格高的。 不碰ST股,不买5元以下低价股,不买100亿市值以下小盘股,不追突发热点。 N选1的情况下一定要警惕别贪便宜,别选弱鸡当队友。 贝塔收益就是大盘涨跌的那部分收益,阿尔法收益就是你跑赢或跑输大盘的那部分收益。贝塔粗浅点解释就是择时,阿尔法就是选股。 我的股票世界观 本文略长,请选择于安静环境阅读   写这个命题是想比较系统的分享一下我对炒股这件事的认识,因为关注时间长的老粉丝坚持看了好几年的夜报,有时我的心意想法可以相互领会,但对于很多新粉丝来说单纯看yc3那篇文章只落得个半懂不懂,所以一直想好好写一篇文章,分享我的股票世界观。   标题很大,但我会尽量写的很俗,确保你能看的懂。 ★股票的短期走势能预测吗?   这里的短线是指一个星期。不同时期的我对这件事有不同的看法,我炒股有8年了,下面给大家讲讲我的故事。   第1-2年,我坚信可以预测,奈何菜鸟道行不够,所以四处拜神,当时有个女股神受人崇拜,我给她发了私信她....

java.awt.AWTError: BoxLayout can't be shared

https://stackoverflow.com/questions/5917017/java-awt-awterror-boxlayout-cant-be-shared When calling setLayout on a JFrame, you're actually adding the layout to the JFrame's contentPane not the JFrame itself since this method is more of a convenience method that transmits the method call to the contentPane. The BoxLayout constructor must reflect this since you can't add the BoxLayout to one container and then pass in as a parameter a different container. So change this: this.setLayout(new BoxLayo....

java通过Stream对list集合分组

package com.maps; public class User{ private Integer id; private String type; private String name; public User(){} public User(Integer id,String type,String name){ this.id = id; this.type = type; this.name = name; } public void setId(Integer id){ this.id = id; } public Integer getId(){ return id; } public void setType(String type){ this.type = type; } public String getType(){ return type; } public void setName(String name){ this.name = name; } public String getName(){ return name; } } package c....

SQL查找是否“存在“,别再count了,很耗费时间的

https://blog.csdn.net/qq_35661171/article/details/106880454?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param 根据某一条件从数据库表中查询 『有』与『没有』,只有两种状态,那为什么在写SQL的时候,还要SELECT count(*) 呢? 无论是刚入道的程序员新星,还是精湛沙场多年的程序员老白,都是一如既往的count 目前多数人的写法 多次REVIEW代码时,发现如下现象: 业务代码中,需要根据一个或多个条件,查询是否存在记录,不关心有多少条记录。普遍的SQL及代码写法如下 ##### SQL写法: SELECT count(*) FROM table WHERE a ....

正则表达式:必须要有一个小写字母,一个大写字母和一个数字,并且是8-16位

public static boolean isMobileNO(String mobiles) { Pattern pattern = Pattern.compile("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[A-Za-z0-9]{8,16}$"); Matcher matcher = pattern.matcher(mobiles); boolean b = matcher.matches(); return b; } ———————————————— 版权声明:本文为CSDN博主「super果」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/qq_35841348/article/details/80735251

GridLayout布局动态添加控件时以从左向右的顺序添加

import java.awt.*; import java.applet.Applet; public class ButtonGrid extends Applet { public void init() { contentPane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); setLayout(new GridLayout(0,2)); add(new Button("1")); add(new Button("2")); add(new Button("3")); add(new Button("4")); add(new Button("5")); add(new Button("6")); } } 要点: 设置容器的组件方向为LEFT_TO_RIGHT 实例化GridLayout时,第一个参数设置为0

Howto use wait and progress cursors

https://performance.netbeans.org/howto/wait-cursors.html

Optimization of java.awt.Component's initialization

https://performance.netbeans.org/responsiveness/improving/postinit_of_comps.html

How Wizards Work (Geertjan Wielenga) 有更新!

https://blogs.oracle.com/geertjan/how-wizards-work-part-1:-introduction Introduction Wizards can be used for three things: To create a project template. This type of wizard is made available by the New Project wizard after registration in the layer.xml file (e.g., Web Application wizard). To create a file template. This type of wizard is made available by the New File wizard after registration in the layer.xml file: the template can consist of a single file (e.g., New Servlet wizard) the temp....

Tom Wheeler's sample: how wizards work

WizardExampleSuite20070202.zip NetBeans Wizards Example Fri Feb 2 12:04:47 EST 2007 Someone asked on the NetBeans developer mailing list about a tutorial that shows how wizards work; specifically, how you handle validation and store input values between screens. I was not aware of a tutorial covering this in detail, so in the meantime, I wrote a NetBeans 5.5 example suite that illustrates these concepts. It's kind of a first draft, but maybe I will write a corresponding tutorial soon. After laun....

NetBeans Wizard Module Tutorial

https://platform.netbeans.org/tutorials/nbm-wizard.html Creating the Module Project We begin by working through the New Module Project wizard. At the end of it, we will have a basic source structure, with some default files, that every NetBeans module requires. Choose File > New Project (Ctrl+Shift+N). Under Categories, select NetBeans Modules. Under Projects, select Module. Click Next. In the Name and Location panel, type DemoWizard in the Project Name field. Change the Project Location to a....

JTattoo 有更新!

官网:http://www.jtattoo.net/ JTattoo consists of several different Look and Feels for Swing applications. All of them enables developers to improve their application with an excellent user interface. So JTattoo opens desktop applications the door to end users who are unfortunate with the Look and Feels shipped with the standard JDK. to release 1.3. Source code is now available! to release 1.6.0 The TextureLookAndFeel! License agreement (GPL / LGPL / Apache License)! to release 1.6.12 Removed s....

How to Create a Dynamic Wizard

https://dzone.com/articles/nb-how-to-create-dynamic-wizard You've created some kind of Java desktop application on top of the NetBeans Platform for recording & analyzing plants (which is a realistic scenario in Mexico). So, somewhere along the line you create a wizard where a new plant can be defined: If a plant is not marked as being "healthy", the second panel needs to appear, where details about the disease can be filled in: Then, when Next is clicked, a final panel provides a summary r....

ToolbarWithOverflow 有更新!

org.openide.awt.ToolbarWithOverflow ToolbarWithOverflow provides a component which is useful for displaying commonly used actions. It adds an overflow button when the toolbar becomes too small to show all the available actions. org.openide.awt.Toolbar org-openide-loaders.jar import java.awt.Component; import java.awt.Insets; import java.util.logging.Logger; import javax.swing.AbstractButton; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JToolBar; import javax.swi....

POI操作Excel--设置单元格对齐方式

设置单元格的对齐方式 1.注意: 1.如果每个单元格(cell)的样式都不一样,必须每个单元格都创建一个CellStyle,否则不生效; 2.day03关闭流的方式, 采用了JDK 7的try(),,写在try括号里的资源会自动关闭。 /** * 设置对齐方式 */ @Test public void setAlignment() { // 创建Excel工作簿 Workbook workbook = new XSSFWorkbook(); // 创建sheet Sheet sheet = workbook.createSheet(WorkbookUtil.createSafeSheetName("第一页?")); // 创建行和单元格并设置对齐方式 generateRowAndCell(sheet, workbook, 0, 0, HorizontalAlignment.CENTER, VerticalAlignment.CENTER); generateRowAndCell(sheet, workbook, 1, 0, HorizontalAlignment.LEFT, Verti....

acuiconflux 有更新!

创建钱包过程 ConfluxPortal1 Create Password Secret Backup Phrase Confirm your Secret Backup Phrase Congratulations 进入主界面 ConfluxPortal2 20200717 总结密码的作用: 1 使用AES对称加密算法保护保存在本地的助记词或私钥(所以必须让用户设定一个密码) 2 方便用户操作在需要助记词或密码时,比如转账操作需要私钥签名,这时不需要用户直接提供私钥,用户只需提供密码即可) 3 导出助记词或私钥(因保存在本地的助记词或私钥已经加密,故需密码解密后导出) 货币接口 public interface Coin { // 名称 public String getName(); // 简称 public String getSymbol(); // 返回某个地址的账户余额 public void balanceOf(/* address _owner */); // 转账 public void transfer(/* address _to....

Uniswap v2白皮书翻译,揭秘那些值得关注的新功能和行业亮点

该技术白皮书解释了Uniswap v2核心合约背后的一些设计决策。它涵盖了合约的新功能,包括ERC20之间的任意对,强化的价格预言系统,允许其他合约在给定时间间隔内,估计时间加权平均价格;“互换交易”(flash swaps),使交易者能够在之前获取资产并用于其他地方,在交易的后期付款,以及将来可以开启的协议费。它还会重新设计合约以减少攻击面。 此外,本例白皮书描述了Uniswap v2核心合约的机制,包括存储流动性提供者资金的配对合约以及用于实例化配对合约的工厂合约。 简介 Uniswap v1是在以太坊区块链上的智能合约的链上系统,基于“不变产品公式” [1]实现了自动流动性协议。每对Uniswap v1对都存储两个资产的合并储备,并为这两个资产提供流动性,从而保持了储备产品不能减少的不变性。交易者为交易支付30个基点的费用,该费用由流动性提供者支付。合约不可升级。 Uniswap v2是基于相同公式的新实现,具有一些非常令人希望的新功能。最重要的是,它支持创建任意ERC20 / ERC20对,而不是仅支持ERC20和ETH之间的对。它还提供了一个标准化的价格预言,该价格预言在每个....