boilerplate

IntelliJ IDEA 快捷键终极大全,速度收藏!

这一生的挚爱 提交于 2020-04-24 09:47:04
作者:满风 https://my.oschina.net/dyyweb/blog/494504 自动代码 常用的有fori/sout/psvm+Tab即可生成循环、System.out、main方法等boilerplate样板代码 。 例如要输入for(User user : users)只需输入user.for+Tab ; 再比如,要输入Date birthday = user.getBirthday()只需输入user.getBirthday().var+Tab即可。 代码标签输入完成后,按Tab,生成代码。 Ctrl+Alt+O 优化导入的类和包 Alt+Insert 生成代码(如get,set方法,构造函数等) 或者右键(Generate) fori/sout/psvm + Tab Ctrl+Alt+T 生成try catch 或者 Alt+enter CTRL+ALT+T 把选中的代码放在 TRY{} IF{} ELSE{} 里 Ctrl + O 重写方法 Ctrl + I 实现方法 Ctr+shift+U 大小写转化 ALT+回车 导入包,自动修正 ALT+/ 代码提示 CTRL+J 自动代码 Ctrl+Shift+J,整合两行为一行 CTRL+空格 代码提示 CTRL+SHIFT+SPACE 自动补全代码 CTRL+ALT+L 格式化代码 CTRL+ALT+I

Single-shot event subscription

空扰寡人 提交于 2020-04-01 10:48:40
问题 I'm fairly convinced that this isn't possible, but I'm going to ask nonetheless. In order to make a single-shot subscription to events, I frequently find myself using this (self-invented) pattern: EventHandler handler=null; handler = (sender, e) => { SomeEvent -= handler; Initialize(); }; SomeEvent += handler; It's quite a lot of boiler-plate, and it also makes Resharper whinge about modified closures. Is there a way of turning this pattern into an extension method or similar? A better way of

aelf Enterprise 0.9.2 版正式发布

一世执手 提交于 2020-02-27 06:47:21
aelf Enterprise v0.9.2是一个整体的区块链商业化解决方案,包含完备的区块链系统、开发套件、开发文档、以及配套的基础应用和基础服务。 此前 aelf Enterprise v0.9.1 已实现主网启动所需的所有功能,aelf Enterprise v0.9.2相对v0.9.1做了进一步的优化。目前公开测试网代码已更新为aelf v0.9.2,考虑到数据结构改动可能导致版本升级过程出现冗余代码,本次公开测试网以清理数据的形式进行升级。 ▋ aelf Enterprise 0.9.2版本系统集成 1.aelf Enterprise aelf v0.9.2 DevKit v0.9.2 2.aelf External Applications aelf Blockchain scanner v0.2.4 aelf Scanner Mysql plugin v0.9.2 aelf Explorer v0.9.2 aelf Wallet v0.9.2 aelf JS SDK 3.2.26 aelf-bridge 0.0.8 aelf CLI in Nodejs v0.1.36 3.aelf Browser Extension v0.9.2 本次发布的aelf Enterprise 0.9.2版相对于aelf Enterprise 0.9.1版更新优化的重要特性有:

如何为网站添加浏览器选项卡图标(favicon)?

时光怂恿深爱的人放手 提交于 2020-02-27 05:44:12
我一直在网站上工作,我想在浏览器标签上添加一个小图标。 如何在HTML中执行此操作以及在代码中我需要放置它的位置(例如标题)? 我有一个 .png 徽标文件,我想将其转换为图标。 相关: HTML在浏览器选项卡上设置图像 。 #1楼 我已经成功地为我的网站做了这个。 唯一的例外是,SeaMonkey浏览器需要在 <head> 插入HTML代码; 然而,其他浏览器仍然会显示favicon.ico而不插入任何HTML。 此外,IE以外的任何浏览器都可以使用其他类型的图像,而不仅仅是.ico格式。 我希望这有帮助。 #2楼 要让Chrome显示页面图标(favicon),您需要从托管服务器检查您的网站,或者您可以在PC上开发和测试您的网站时使用本地主机。 #3楼 我建议您尝试 http://faviconer.com 将.PNG或.GIF转换为.ICO文件。 您可以在一个.ICO文件中创建 16x16 和 32x32 (用于新的视网膜显示)。 没有IE和Firefox的问题 #4楼 我找到的最好的是 http://www.favicomatic.com/ 我说得最好,因为它给了我最清晰的图标,并且在转换后不需要编辑。 它会产生16x16和32x32的favicons并引用它们“每个该死的大小,先生!” 此外,他们的网站看起来很酷,易于使用。 它们还会生成您需要用于生成的文件的html。

Boilerplate project creation error

半城伤御伤魂 提交于 2020-01-25 04:01:08
问题 I have downloaded the boilerplate project available here Boilerplate I have made sure that VS 2015 is up to date. When trying to create a project (asp.net core MVC 6 (rc2) Boilerplate (also RC2))I get the error: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\V14.0\Dotnet\Microsoft.DotNet.Props" was not found. Confirm that the path in the declaration is correect and that the file exists on Disk. I've checked the path and this isn't there, question is, what is it?

How to reduce boilerplate when initializating classes from JSONs in Python 3.5?

柔情痞子 提交于 2020-01-17 06:03:58
问题 I have a set of python webservices that work with data objects they get via a JSON POSTs. In my old services I have a lot of boilerplate to (de)serialize and check JSONs for each object. With Python 3.5s new typing and PEP 484 I have the feeling that could be substantially reduced. Is it worth it? Does anyone have a good solution for it? Additional info My old boilerplate looks like this for every object: class Data: class Nested1: def __init__(self, nested1_flat1): self.nested1_flat1 =

Windows Credential Provider, Filter, and Unlock Workstation Scenario

被刻印的时光 ゝ 提交于 2020-01-13 14:57:14
问题 I'm developing a credential provider and filter. I have some problems with lock scenario. First, I have tried the SampleAllControlCredentialProvider from here. And it works. Even when I logon and lock it afterward, it shows my credential. Second, I tried making my own credential provider filter by adding some lines of codes. The filter is filtering out the windows' credential, only my credentials are allowed to appear. These are my addition of codes: In CSampleProvider.h, I make the class to

gae-boilerplate documentation

有些话、适合烂在心里 提交于 2020-01-13 10:34:06
问题 In my search for a good social login package for App Engine, I am giving gae-boilerplate a try. But I find there is no documentation except the readme file, which I think it is not enough at all. I have many questions, among them: Should the boilerplate be used as a library or download and modify as needed? How should the boilerplate be updated? What does each model do? Where should my templates go? Should I have a different routes file? Should I derive my Handlers from BaseHandler? In

Can Java help me avoid boilerplate code in equals()?

时光总嘲笑我的痴心妄想 提交于 2020-01-01 08:57:08
问题 I implement equals() the Java 7 way: @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; MyClass other = (MyClass) obj; return Objects.equal(myFirstField, other.myFirstField) && Objects.equal(mySecondField, other.mySecondField); } Is there a way to reduce the code duplication? I would prefer something like @Override public boolean equals(Object obj) { if (Objects.equalsEarlyExit(this, obj))

How in Camel to add and start routes dynamically?

非 Y 不嫁゛ 提交于 2020-01-01 03:11:09
问题 I'm trying to remove some boilerplate from routes in Camel. For example, let's consider the two routes, which are similar and most of their inner stuff could be generated. I've created a component "template", which creates TemplateEndpoint , and modifyed an XML config to use the template component. A custom method TemplateEndpoint.generateRoute (adding route definitions) is being called from StartupListener (defined in TemplateEndpoint.setSuffix ). So while Camel context starting, route