跳至主要内容

博文

目前显示的是 三月, 2017的博文

How to Develop Intellij Plugin

Recently, when using a plugin of idea, it reports the NPE on the latest version and fail to work. Because the original author haven’t update the repo for a relative long time, we decide to fix this by ourselves. Setup In order to develop idea plugin, we first have to setup some environment. Here is the environment setting tutorial and following are some basic steps: Start IntelliJ IDEA. Configure the IntelliJ Platform Plugin SDK. (prefer to choose community version as SDK because we can have source code of community version to assist debug) Create a project for plugin development. Create the necessary source elements and write the source code. Run and debug your plugin. Prepare the plugin for publishing. We come across some problems at step three because we are developing a plugin on the fork of other people’s repository and there is no option to choose plugin development project type when create project from existing source. So, on step three, we have to first create...

How to Ref Files in Jar

Recently, we are working on a project which will reference some config file used in Jar. In order to reference those file, we can’t use those files absolute path (because the packaged Jar may use in any computer which will invalid the path) or relative path as we run it in a IDE (for packaged Jar has different file structure with that in IDE. So, Java provide a mechanism to reference files: getResource Get Resource via Different Ways By a simple search, we can see that there exists two main ways of doing so: this .getClass().getResource( "file" ); this .getClass().getClassLoader().getResource( "file" ); And common questions arises: “what the differences between them?” Let’s have a look at the following code snippet: // get file of foo/bar/name foo.bar.A.class.getResource( "name" ) // get file of `A's classloader cwd`/name foo.bar.A.class.getResource( "/name" ) // get file of `A's classloader cwd`/name foo.bar.A.cla...

给学弟学妹的建议:我找工作的经验教训

昨天听说大三的已经开始春招时,我回想起我的许多笔试面试经历,我踩过的许多坑,于是记录下来,希望学弟学妹可以少走一点弯路。 简历 虽然我经历了许多失败的面试,但是我的简历是基本合格的,(简历筛选基本上都是过得去的,并且还有面试官说过我的简历写的不错),所以可以分享一下。 首先,简历要有多个版本,不是指文件格式(顺便说一句,简历最好是pdf的,要是遇到面试官用的linux,正好打不开你的doc,可能就直接pass了),而是内容。 面试不同的岗位,就要针对性的修改内容,比如我的简历现在大概有三个版本:java类,c/c++类,大数据类。每一个版本都要有相关的项目经历或者是学习经历或者是可以快速掌握相关技能的能力(换句话说,要展现你能干,而不只是想干),要展现出来你去了就能干活。 当然还有一些其他林林总总的,我尽量列举了: 联系方式:及其重要,需要反复确认,多留几个 个人信息:不要忘记学校 不是大牛的,尽量不要超过2页 附件 是我的java版本的简历,供大家参考一下。并且附送大家我的简历生成网站: stackoverflow。你没有看错,Stack Overflow不仅可以问答,你还可以有自己的在线简历,并且能导出pdf,不会的可以参考我的这个 答案 。(唯一的缺点就是如果遇到非要要中文简历的公司的话,就会比较麻烦) 笔试 说到笔试,我大概就只有失败教训分享了。 最重要的一点是要认真准备,不要相信有些人说的“笔试就是个形式,用来筛简历的”(不要问我为什么知道)。 至于笔试的形式与内容,推荐刷一刷 leetcode ,并且 我现在也在刷 ,欢迎一起讨论。 面试 对于面试可以分为电话面试和现场面试,我先介绍他们的相似之处,然后是区别。 共同特点 自我介绍 首先他们都是要自我介绍的,对于技术岗位来说,我们可能觉得这个似乎不是很重要,但是如果你站在面试官的角度,如果一个人连自己的介绍不清楚,是不是意味着将来与他工作的沟通成本会很高,那为什么我不找一个更容易沟通的呢?并且面试官可能一天要面试很多人,你的自我介绍太平庸,另一个技术能力和你差不多的人介绍的好,可能面试官就记不住你了。 相信我说服你自我介绍还是要稍微准备一下的。怎么准备呢?介绍一个套路:贴标签,讲故事。 我们在生活中应该能够发现,不管我们父母为我们起的名字有多么高大上...

Download and Upload Simultaneously?

Have you ever wonder whether we can download and upload simultaneously? Sometimes, we may listening the music online and chat with our friends, but that doesn’t really means download and upload at exact the same time. Because the the computer is faster than human being so much, if it switch its job fast enough, we can’t really tell the differences. This is the where ‘Concurrency’ and ‘Parallelism’ in computer science originates. Before we start answering this questions, we need to introduce some terminology in network. Duplex vs Simplex Duplex means data can be sent in both direction of a communication system, while simplex means data can only be sent in one direction. You can take the differences as normal street vs one-way street. Full Duplex vs Half Duplex Full duplex means data is sent in both direction at the same time (so we can rephrase our first question into: is our network full duplex?), while half duplex, like a single-plank bridge, you can sent in both direction...