Advanced Authoring Format / Wiki / Markdown Syntax



Advanced Authoring Format / Wiki / Markdown Syntax

SourceForge uses markdown syntax everywhere to allow you to create rich
text markup, and extends markdown in several ways to allow for quick linking
to other artifacts in your project.

Markdown was created to be easy to read, easy to write, and still readable in plain text format.


Read full article from Advanced Authoring Format / Wiki / Markdown Syntax


The frustration of working with people who aren’t “A” Players (or don’t care) | alvinalexander.com



The frustration of working with people who aren't "A" Players (or don't care) | alvinalexander.com

I could go on for a while, but here are a few things I've learned about working with people who don't give a crap about their work:

  • It takes longer to get things done.
  • It costs more to get things done.
  • The attitudes of good workers suffer.
  • Because attitudes suffer, the quality of the work suffers.
  • You spend a lot of time wishing you were somewhere else.

There's one other lesson I just thought about based on this experience:

  • If you find that you have to give yourself a pep talk to work with certain people on a daily basis, you're probably in this situation.


Read full article from The frustration of working with people who aren't "A" Players (or don't care) | alvinalexander.com


The frustration of working with people who aren’t “A” Players (or don’t care) | alvinalexander.com



The frustration of working with people who aren't "A" Players (or don't care) | alvinalexander.com

Let me start by saying that I don't know if I'm an "A" Player. In part, that definition depends (a) on what work I'm doing, and (b) who you compare me to. For instance, if you compare me to Linus Tourvalds as a Linux C programmer, I'm very clearly not an A Player. Shoot, I'm not even a player.

But if you were to judge me on other skills, I'd like to say that I'm at least a B Player in the things I care about. As I wrote in my book, A Survival Guide for New Consultants, my superpower as a programmer/analyst is empathy; I care about my work, and about my success and my client's success. If you pay me $100,000 to do some work, I want you to make at least 2X or 10X or more from my work. I want my clients and sponsors to succeed.

Beyond that care, since I began paying attention to Apple and Jonathan Ive starting back around 2005, I've become more interested than ever in quality. When I work on something, I imagine that I'm either working with Mr. Ive, or that I'm going to have him review my work, and I want it to be impeccable.


Read full article from The frustration of working with people who aren't "A" Players (or don't care) | alvinalexander.com


Java: Examples of the Java list/array `subList` method (list subset) | alvinalexander.com



Java: Examples of the Java list/array `subList` method (list subset) | alvinalexander.com

If you print the results of each line you'll see the results on the right side of the comments. As shown:

  • The first element in a list or array is at index 0
  • The toIndex is exclusive, meaning it won't be included in the results
  • If you go outside the size of the initial list, you'll get an IndexOutOfBoundsException
  • The original list isn't modified; if you print x, you'll see that it still includes all of the original elements

If you ever need to extract a subset of a Java list or array into another list or array, I hope these Java subList examples are helpful.


Read full article from Java: Examples of the Java list/array `subList` method (list subset) | alvinalexander.com


How to put multiple lines in a Markdown table cell (multiline table) | alvinalexander.com



How to put multiple lines in a Markdown table cell (multiline table) | alvinalexander.com

To create an HTML table in Markdown where a cell in the table has multiple lines — i.e., a multiline cell — use the HTML <br> tag to make the line display as multiple lines, like this:

| Format   | Tag example |  | -------- | ----------- |  | Headings | =heading1=<br>==heading2==<br>===heading3=== |  | New paragraph | A blank line starts a new paragraph |  | Source code block |  // all on one line<br> {{{ if (foo) bar else   baz }}} |  

I made the <br> tags in that Markdown text bold so they're easy to see. That Markdown text produces this HTML table output:


Read full article from How to put multiple lines in a Markdown table cell (multiline table) | alvinalexander.com


Advanced Markdown tips



Advanced Markdown tips

There are lots of powerful things you can do with the Ghost editor

If you've gotten pretty comfortable with all the basics of writing in Ghost, then you may enjoy some more advanced tips about the types of things you can do with Markdown!

As with the last post about the editor, you'll want to be actually editing this post as you read it so that you can see all the Markdown code we're using.


Read full article from Advanced Markdown tips


Use GitHub Badges to Feel Less Nooby



Use GitHub Badges to Feel Less Nooby

Impostor Syndrome is real, and it plagues new developers. We get all the way through a tutorial, bootcamp, or even a degree, yet we still shy away from sharing our code. We fear negative feedback on our code's quality. No one suffers more from this than self-taught developers. Because we don't have any "real" or "official" experience or training, we consider our code to be sub-par.

I was there a few months ago. I was working through Harry Percival's Test-Driven Development With Python. Even though I was following right along with the tutorial, I was self-conscious about sharing my code. Even though my app was working as expected, I didn't want to share my progress. I didn't want someone to call me out on some obvious mistake to which I was oblivious. I wanted other people to enjoy my product, but I didn't want them to see how poor of a developer I was.


Read full article from Use GitHub Badges to Feel Less Nooby


Code badges cheatsheet



Code badges cheatsheet

Here are some badges for open source projects.


Read full article from Code badges cheatsheet


The difference between ALT text and Title text - Spotibo blog



The difference between ALT text and Title text - Spotibo blog

ALT text or ALT attribute (sometimes incorrectly used as "ALT tag") is the important text of the image, that is understandable by Google and other search engines. It is read to blind people or showed to people who have blocked images.

Title text or Title attribute (often incorrectly used as "Title tag") is the text of images which a user sees after hovering over the image. However, this attribute is not as important as ALT text.


Read full article from The difference between ALT text and Title text - Spotibo blog


Markdown Tutorial | Lesson 7



Markdown Tutorial | Lesson 7

Markdown has several ways of formatting paragraphs.

Let's take a few lines of poetry as an example. Suppose you want to write text that looks like this:

Do I contradict myself?
Very well then I contradict myself,
(I am large, I contain multitudes.)

Now, you might think that simply typing each verse onto its own line would be enough to solve the problem:

Do I contradict myself?  Very well then I contradict myself,  (I am large, I contain multitudes.)  

Unfortunately, you'd be wrong! This Markdown would render simply as a single straight line: Do I contradict myself? Very well then I contradict myself, (I am large, I contain multitudes.).

If you forcefully insert a new line, you end up breaking the togetherness:

Do I contradict myself?    Very well then I contradict myself,    (I am large, I contain multitudes.)  

This is what's known as a hard break; what our poetry asks for is a soft break. You can accomplish this by inserting two spaces after each new line. This is not possible to see, since spaces are invisible, but it'd look something like this:


Read full article from Markdown Tutorial | Lesson 7


Lombok介绍、使用方法、工作原理和总结 – 猿人谷



Lombok介绍、使用方法、工作原理和总结 – 猿人谷

Project Lombok makes java a spicier language by adding 'handlers' that know how to build and compile simple, boilerplate-free, not-quite-java code.

大致意思是Lombok通过增加一些"处理程序",可以让java变得简洁、快速。

2 Lombok使用方法

Lombok能以简单的注解形式来简化java代码,提高开发人员的开发效率。例如开发中经常需要写的javabean,都需要花时间去添加相应的getter/setter,也许还要去写构造器、equals等方法,而且需要维护,当属性多时会出现大量的getter/setter方法,这些显得很冗长也没有太多技术含量,一旦修改属性,就容易出现忘记修改对应方法的失误。

Lombok能通过注解的方式,在编译时自动为属性生成构造器、getter/setter、equals、hashcode、toString方法。出现的神奇就是在源码中没有getter和setter方法,但是在编译生成的字节码文件中有getter和setter方法。这样就省去了手动重建这些代码的麻烦,使代码看起来更简洁些。

Lombok的使用跟引用jar包一样,可以在官网(https://projectlombok.org/download)下载jar包,也可以使用maven添加依赖:


Read full article from Lombok介绍、使用方法、工作原理和总结 – 猿人谷


边缘计算社区



边缘计算社区

他们将中台分为六类,分别对应不同兵种:

业务中台,提供重用服务,例如用户中心、订单中心之类的开箱即用可重用能力,为战场提供了空军支援能力,随叫随到,威力强大;

数据中台,提供数据分析能力,帮助从数据中学习改进,调整方向,为战场提供了海军支援能力;

算法中台,提供算法能力,帮助提供更加个性化的服务,增强用户体验,为战场提供了陆军支援能力,随机应变,所向披靡;

技术中台,提供自建系统部分的技术支撑能力,帮助解决基础设施,分布式数据库等底层技术问题,为前台特种兵提供了精良的武器装备;

研发中台,提供自建系统部分的管理和技术实践支撑能力,帮助快速搭建项目、管理进度、测试、持续集成、持续交付,是前台特种兵的训练基地;

组织中台,为项目提供投资管理、风险管理、资源调度等,是战场的指挥部,战争的大脑,指挥前线,调度后方。


Read full article from 边缘计算社区


Talent distributions.



Talent distributions.

When I was applying to college some years ago, one of my teachers asked if I thought I would regret not applying to more prestigious schools, making the observation that it's not whether the professors would be good–the professors are good everywhere–but rather about the quality of the student body. Would I learn from my peers?

I hadn't thought of that conversation in a decade, but it floated up through the layers of memory when someone recently asked why I originally joined Stripe.

Much like a school's student body, talent distributions at a company reflect their values. Learning about a company's distribution is an effective proxy for learning about their intended and actual cultural values, and neatly sidesteps the expected questions that folks are sometimes too careful to answer directly (e.g. is fairness important at your company?).

In my opinion, a company's policies and their approach to policy enforcement are the truest representation of their values: they're where folks make the hard tradeoffs between conflicting values. For example, everyone values both impact and partnership, and it's only in the depths of policy enforcement that those values come into conflict and their relative merits are fully weighed.


Read full article from Talent distributions.


Headcount dilemmas.



Headcount dilemmas.

When I was four, I won a cake walk. For thoes who haven't partaken, a cake walk is when a group of folks walk around a path on the floor, and then stop when they are told to stop. Whether you win or lose a cake is entirely out of your hands, it's a matter of timing and position, both of which are out of your control.


Read full article from Headcount dilemmas.


Scaling consistency.



Scaling consistency.

In small organizations, it's easy for folks to be aware of what others are doing and to remember how you've previously approached similar problems. This hive mind and memory creates a consistency to decision making that correlates strongly with quality. As organizations grow, there is a subtle slide into inconsistency, which is often one of the most challenging aspects of evolving from a small team into a much larger one.


Read full article from Scaling consistency.


Draw Diagrams With Markdown



Draw Diagrams With Markdown

Typora supports some Markdown extension for diagrams, you could enable this feature from preference panel.

When exporting as HTML, PDF, epub, docx, those rendered diagrams will also be included, but diagrams features are not supported when exporting markdown into other file formats in current version. Besides, you should also notice that diagrams is not supported by standard Markdown, CommonMark or GFM. Therefore, we still recommend you to insert an image of these diagrams instead of write them in Markdown directly.


Read full article from Draw Diagrams With Markdown


Java Variable Length Parameter vs. Array, Simply Syntactic Sugar? - Stack Overflow



Java Variable Length Parameter vs. Array, Simply Syntactic Sugar? - Stack Overflow

The '...' parameters you are talking about are called varargs.

Some differences to note:

  • varargs can be passed no parameters (basically ignored), null, or an indeterminate number of arguments, while array parameters must be passed an array or null
  • varargs must be the last parameter of your method, whereas it doesn't matter for array parameters. This is because of this special property of varargs, which is probably the most significant difference between the two things you posted:


Read full article from Java Variable Length Parameter vs. Array, Simply Syntactic Sugar? - Stack Overflow


VS Code Java Extension Pack Adds AI-Assisted IntelliCode -- Visual Studio Magazine



VS Code Java Extension Pack Adds AI-Assisted IntelliCode -- Visual Studio Magazine

IntelliCode uses artificial intelligence (AI) technology to improve on the IntelliSense feature of Visual Studio that provides functionality such as code-completion help: a list of possible code constructs likely to finish off what a developer is typing.

IntelliCode uses AI to examine quality open source projects and the code context of the specific project being worked on so as to better provide code-completion options based on what a developer is likely to need next. IntelliCode was provided to Java programmers with the IntelliCode Extension for Visual Studio Code extension last November. Now, that tool has been added to the Java Extension Pack, which also features other extensions that provide Java functionality.


Read full article from VS Code Java Extension Pack Adds AI-Assisted IntelliCode -- Visual Studio Magazine


内核小王子



内核小王子

首先,java代码会被编译成字节码,字节码就是java虚拟机定义的一种编码格式,需要java虚拟机才能够解析,java虚拟机需要将字节码转换成机器码才能在cpu上执行。

我们可以用硬件实现虚拟机,这样虽然可以提高效率但是就没有了一次编译到处运行的特性了,所以一般在各个平台上用软件来实现,目前的虚拟机还提供了一套运行环境来进行垃圾回收,数组越界检查,权限校验等。虚拟机一般将一行字节码解释成机器码然后执行,称为解释执行,也可以将一个方法内的所有字节码解释成机器码之后在执行,前者执行效率低,后者会导致启动时间慢,一般根据二八法则,将百分之20的热点代码进行即时编译。JIT编译的机器码存放在一个叫codecache的地方,这块内存属于堆外内存,如果这块内存不够了,那么JIT编译器将不再进行即时编译,可能导致程序运行变慢。


Read full article from 内核小王子


Visual Studio Code for Java: The Ultimate Guide 2019



Visual Studio Code for Java: The Ultimate Guide 2019

Visual Studio Code has come a long way to become the preferred text editor of polyglot developers. Javascript, TypeScript, Go, Python, and other languages have a massive amount of developers coding through VS Code, in part thanks to the huge ecosystem of extensions that enhance and enrich the experience in VS Code, turning it into a super smart text editor with IDE-ish capabilities while remaining ludicrously fast and lightweight.


Read full article from Visual Studio Code for Java: The Ultimate Guide 2019


Spring源码解析



Spring源码解析

  1. 可检查异常需要在方法上声明,一般要求调用者必须感知异常可能发生,并且对可能发生的异常进行处理。可以理解成系统正常状态下很可能发生的情况,通常发生在通过网络调用外部系统或者使用文件系统时,在这种情况下,错误是可能恢复的,调用者可以根据异常做出必要的处理,例如重试或者资源清理等。

  2. 非检查异常是不需要在throws子句中声明的异常。JVM根本不会强制您处理它们,因为它们主要是由于程序错误而在运行时生成的。它们扩展了RuntimeException。最常见的例子是NullPointerException 可能不应该重试未经检查的异常,并且正确的操作通常应该是什么都不做,并让它从您的方法和执行堆栈中出来。在高执行级别,应记录此类异常。

  3. Error是最为严重的运行时错误,几乎是不可能恢复和处理,一些示例是OutOfMemoryError,LinkageError和StackOverflowError。它们通常会使程序或程序的一部分崩溃。只有良好的日志记录练习才能帮助您确定错误的确切原因.


Read full article from Spring源码解析


如何成为合格的技术面试官? - Jartto's blog



如何成为合格的技术面试官? - Jartto's blog

作为技术面试官,面试过程很少考虑候选人的感受。上来就是问,不合适就送走。虽然技术环节我很专业,但是其他细节我却知之甚少。

从来没觉得这样会有什么问题,直到有一天,我参加了一场面试官培训,才意识到自身的不足。

一、明确面试的目的

作为公司的面试官,我们不是为了鄙视和炫耀技术,而是评估候选人能否担任工作。这属于团队建设核心工作,也是公司的一次品牌宣传。

你代表的不仅是个人,还有公司的形象,请尊重每一位候选人。

仓央嘉措曾经说过:我以为别人尊重我,是因为我很优秀。慢慢的我明白了,别人尊重我,是因为别人很优秀;优秀的人更懂得尊重别人。对人恭敬其实是在庄严你自己。


Read full article from 如何成为合格的技术面试官? - Jartto's blog


Java ?: operator | Terminally Incoherent



Java ?: operator | Terminally Incoherent

One of the least understood, and most underestimated Java language constructs is the ?: operator. Most people never even seen it in action. And those who did, never actually used it to do anything meaningful. Imagine something like this:


Read full article from Java ?: operator | Terminally Incoherent


041《Copy All Urls》优雅地保存-开启多个标签页 · Chrome插件英雄榜



041《Copy All Urls》优雅地保存-开启多个标签页 · Chrome插件英雄榜

Copy All Urls可以一键复制当前窗口所有已打开标签页Url, 而且可以将复制的多个Url一键开启

+


Read full article from 041《Copy All Urls》优雅地保存-开启多个标签页 · Chrome插件英雄榜


007《loom》 Chrome翻录网页视频神器 · Chrome插件英雄榜



007《loom》 Chrome翻录网页视频神器 · Chrome插件英雄榜

近年来, 伴随着互联网的兴起, 在线教育也逐渐热门起来, 在线的付费视频也越来越多, 同时一些传统的视频网站, 为了吸引用户开会员, 也推出了大量的付费观看的视频, 但也有反其道而行之的"bd网盘", 存储了大量的盗版视频, 这些视频大多清晰度不高, 但好在能在线观看, 也可以在线分享链接

+


Read full article from 007《loom》 Chrome翻录网页视频神器 · Chrome插件英雄榜


Chrome扩展及应用开发(首发版)-图书-图灵社区



Chrome扩展及应用开发(首发版)-图书-图灵社区

本书简述了Chrome平台开发的概念、扩展与应用的区别及其常用功能,并结合具体场景给出了实例。主要介绍了Chrome扩展基础、Chrome扩展的UI界面、管理浏览器和部分高级API划分,讲解了文件系统、网络通信、操作USB设备和串口通信等多个与操作系统紧密相关的内容,还介绍了Chrome主题开发、支持国际化的程序开发,以及如何使用Angular框架进行开发。

Read full article from Chrome扩展及应用开发(首发版)-图书-图灵社区


Caffeine mac版|Caffeine for mac下载 V1.1.1 - PC6苹果网



Caffeine mac版|Caffeine for mac下载 V1.1.1 - PC6苹果网

  Caffeine for mac是一款很有用的小工具。caffeine for mac可以让你的 Mac 屏幕保持点亮状态,不会因时间的问题进入休眠状态。


Read full article from Caffeine mac版|Caffeine for mac下载 V1.1.1 - PC6苹果网


How to Use WeChat Mini Programs - Rory Bate-Williams - Medium



How to Use WeChat Mini Programs - Rory Bate-Williams - Medium

Mini programs are a kind of app that don't need to be downloaded or installed to be used. They realise the dream that apps can be accessible everywhere. You 'use it then go' and you don't need to worry about installing too many apps. Apps can be absolutely everywhere, you can use them anytime, and you don't need to install anything.

The benefits are speed and ease of use. Mini programs don't need to be downloaded, installed, registered, or logged in. They don't need data to download and they don't take up memory on your phone.


Read full article from How to Use WeChat Mini Programs - Rory Bate-Williams - Medium


七个 JavaScript 实用小技巧 - 秘锐笔记 - SegmentFault 思否



七个 JavaScript 实用小技巧 - 秘锐笔记 - SegmentFault 思否

和许多其他语言一样,JavaScript 也需要靠很多小技巧去完成各种不同的事情。有的可能早已经广为人知,有的却可能会让你感到有些迷惑。接下来先介绍七个马上就能用起来的 JavaScript 小技巧。


Read full article from 七个 JavaScript 实用小技巧 - 秘锐笔记 - SegmentFault 思否


7 Useful JavaScript Tricks



7 Useful JavaScript Tricks

Just like every other programming language, JavaScript has dozens of tricks to accomplish both easy and difficult tasks. Some tricks are widely known while others are enough to blow your mind. Let's have a look at seven JavaScript tricks you can start using today!


Read full article from 7 Useful JavaScript Tricks


前端自习课



前端自习课

GraphQL 是 Facebook 开发的一种 API 的查询语言,与 2015 年公开发布,是 REST API 的替代品。

GraphQL 既是一种用于 API 的查询语言也是一个满足你数据查询的运行时GraphQL 对你的 API 中的数据提供了一套易于理解的完整描述,使得客户端能够准确地获得它需要的数据,而且没有任何冗余,也让 API 更容易地随着时间推移而演进,还能用于构建强大的开发者工具。


Read full article from 前端自习课


Avoid NullPointerException in Java - Huong Dan Java



Avoid NullPointerException in Java - Huong Dan Java

NullPointerException is popular exception in Java programming. Even those who experienced code for many years are also defective. I often troll my colleague in my company that: I see you are very good at code, never face with error, if have, only with NPE (stands for NullPointerException).

So, in this tutorial, I would like to share with you all some ways to avoid this exception. Of course, you usually have to exercise it, because we are human, we usually forget something. Me too 😀


Read full article from Avoid NullPointerException in Java - Huong Dan Java


java.lang.NullPointerException - JournalDev



java.lang.NullPointerException - JournalDev

java.lang.NullPointerException is one of the most popular exceptions in java programming. Anybody working in java must have seen this popping out of nowhere in java standalone program as well as java web application.


Read full article from java.lang.NullPointerException - JournalDev


IntelliTXT - Wikipedia



IntelliTXT - Wikipedia

IntelliTXT is a keyword advertising platform developed by Vibrant Media. Web page publishers insert a script into their pages which calls the IntelliTXT platform when a viewer views the page. This script then finds keywords on the page and double underlines them. When holding the mouse over the double underlined link, an advertisement associated with that word will pop up. Advertisers pay to have their particular words associated to their advertisements.


Read full article from IntelliTXT - Wikipedia


Autoboxing and the NullPointerException Mystery



Autoboxing and the NullPointerException Mystery

During one of the Java classes I teach, a student came up to me with a peculiar bug. Below is a simplified version:

HashMap<String,Boolean> map = new HashMap<String,Boolean>();    if (map.get("a") == true) // -> NullPointerException      // do something  

The NullPointerException here seems odd. While the == true seemed superfluous, I initially thought this would work. Even if it didn't, I couldn't understand why this would give a NullPointerException.

A NullPointerException occurs when you try to use a reference that hasn't been initialized yet (its value is null), but the only reference used here is map, which was definitely initialized!

I tried a few things:

System.out.println( map.get("a") );  // -> null  

As I expected, this gave a null.

Then I tried:

System.out.println( null == true );  // -> CompileError: Incomparable types: <null> and boolean  

Ok, so I had forgotten that in Java, you can't compare two objects of different types. In some other languages, null is considered "falsy".

But when I try:

System.out.println( map.get("a") == true )  // -> NullPointerException  


Read full article from Autoboxing and the NullPointerException Mystery


How to Avoid NullPointerException | Ji ZHANG's Blog



How to Avoid NullPointerException | Ji ZHANG's Blog

NullPointerException happens when you dereference a possible null object without checking it. It's a common exception that every Java programmer may encounter in daily work. There're several strategies that can help us avoid this exception, making our codes more robust. In this article, I will list both traditional ways and those with tools and new features introduced by recent version of Java.


Read full article from How to Avoid NullPointerException | Ji ZHANG's Blog


大数据技术之_09_Flume学习_Flume概述+Flume快速入门+Flume企业开发案例+Flume监控之Ganglia+Flume高级之自定义MySQLSource+Flume企业真实面试题(重点)



大数据技术之_09_Flume学习_Flume概述+Flume快速入门+Flume企业开发案例+Flume监控之Ganglia+Flume高级之自定义MySQLSource+Flume企业真实面试题(重点)

  Flume(水槽) 是 Cloudera 提供的一个高可用的,高可靠的,分布式的海量日志采集、聚合和传输的系统。Flume基于流式架构,灵活简单。
  在2009年Flume被捐赠了apache软件基金会,为hadoop相关组件之一。尤其近几年随着flume的不断被完善以及升级版本的逐一推出,特别是flume-ng;,同时flume内部的各种组件不断丰富,用户在开发的过程中使用的便利性得到很大的改善,现已成为apache top项目之一。

Read full article from 大数据技术之_09_Flume学习_Flume概述+Flume快速入门+Flume企业开发案例+Flume监控之Ganglia+Flume高级之自定义MySQLSource+Flume企业真实面试题(重点)


一次线上 CPU 飙升问题的分析解决 | Poison



一次线上 CPU 飙升问题的分析解决 | Poison

前几日,下了班在家时突然收到监控报警,线上一组业务机器 CPU 被打满至 100%,为了保持服务的稳定运行,临时采取了升级配置、加机器等粗暴的方法将当晚扛了过去。

半夜想了下可能的原因,由于可能因素太多,不能确定,第二天到公司后,在一台预发机器上把 Java Mission Control 所需的参数配置好,然后就等待下一次问题出现呗,果然,没几天,在晚高峰时问题又复现了,马上将线上的流量分了一小部分到提前配置好的预发机器上,没过一会,预发机器的 负载 也满了。在 Java Mission Control 的 Thread 的面板里观察了一会,业务线程的 CPU 使用率根本不高,超过 10% 的都很少,但此时 CPU 又是被打满的,在不停查看 Java Mission Control 中提供的信息时,发现了 Full GC 非常频繁,在应用启动了两个多小时内,Full GC 了 1500 多次,占用了 13 多分钟,并且次数和时间依然在不停增加中,一下让笔者想到了之前在相关书籍上提到的频繁 Full GC 的相关问题,没想到在这里让笔者给碰上了,如图:


Read full article from 一次线上 CPU 飙升问题的分析解决 | Poison


为什么阿里巴巴建议集合初始化时,指定集合容量大小-HollisChuang's Blog



为什么阿里巴巴建议集合初始化时,指定集合容量大小-HollisChuang's Blog

集合是Java开发日常开发中经常会使用到的。在之前的一些文章中,我们介绍过一些关于使用集合类应该注意的事项,如《为什么阿里巴巴禁止在 foreach 循环里进行元素的 remove/add 操作》。

关于集合类,《阿里巴巴Java开发手册》中其实还有另外一个规定:

本文就来分析一下为什么会有如此建议?如果一定要设置初始容量的话,设置多少比较合适?

为什么要设置HashMap的初始化容量

我们先来写一段代码在JDK 1.7 (jdk1.7.0_79)下面来分别测试下,在不指定初始化容量和指定初始化容量的情况下性能情况如何。(jdk 8 结果会有所不同,我会在后面的文章中分析)


Read full article from 为什么阿里巴巴建议集合初始化时,指定集合容量大小-HollisChuang's Blog


除了996 ICU,GitHub上还有哪些奇葩的项目?-HollisChuang's Blog



除了996 ICU,GitHub上还有哪些奇葩的项目?-HollisChuang's Blog

FreeCodeCamp 是 GitHub 上排名第一的开源项目,致力于帮助人们利用零散时间学习编程。它的使命是Learn to code and help nonprofits(学习编程,去帮助那些非盈利组织)。FCC涵盖HTML5、CSS、React、JavaScript、Database等课程,游戏化程度非常高,学员可以通过线上聊天室和线下社区活动(Coffee and Code)相互帮助。目前覆盖全球160+个国家、1000+个城市,40W+开发者在平台学习。


Read full article from 除了996 ICU,GitHub上还有哪些奇葩的项目?-HollisChuang's Blog


为什么阿里巴巴禁止在 foreach 循环里进行元素的 remove/add 操作-HollisChuang's Blog



为什么阿里巴巴禁止在 foreach 循环里进行元素的 remove/add 操作-HollisChuang's Blog

Foreach循环(Foreach loop)是计算机编程语言中的一种控制流程语句,通常用来循环遍历数组或集合中的元素。

Java语言从JDK 1.5.0开始引入foreach循环。在遍历数组、集合方面,foreach为开发人员提供了极大的方便。


Read full article from 为什么阿里巴巴禁止在 foreach 循环里进行元素的 remove/add 操作-HollisChuang's Blog


Hollis



Hollis

集合是Java开发日常开发中经常会使用到的。在之前的一些文章中,我们介绍过一些关于使用集合类应该注意的事项,如《为什么阿里巴巴禁止在 foreach 循环里进行元素的 remove/add 操作》、《为什么阿里巴巴建议集合初始化时,指定集合容量大小》等。


Read full article from Hollis


Algorithm revision - Jiahe Chen



Algorithm revision - Jiahe Chen

K Empty Slots(683)

There is a garden with N slots. In each slot, there is a flower. The N flowers will bloom one by one in N days. In each day, there will be exactly one flower blooming and it will be in the status of blooming since then.

Given an array flowers consists of number from 1 to N. Each number in the array represents the place where the flower will open in that day.

For example, flowers[i] = x means that the unique flower that blooms at day i will be at position x, where i and x will be in the range from 1 to N.

Also given an integer k, you need to output in which day there exists two flowers in the status of blooming, and also the number of flowers between them is k and these flowers are not blooming.

If there isn't such day, output -1.


Read full article from Algorithm revision - Jiahe Chen


google 面试高频20道题目总结 - 知乎



google 面试高频20道题目总结 - 知乎

388. Longest Absolute File Path

描述, 这道题目要求找到最长的路径,包含字符串的长度,我们可以使用bfs的思路,以"\t" 的数量作为每层的一个标志然后存储到stack里面这一层的长度。使用一个global的变量去记录总的最长的长度


Read full article from google 面试高频20道题目总结 - 知乎


Everything you ever wanted to know about unfurling but were afraid to ask /or/ How to make your…



Everything you ever wanted to know about unfurling but were afraid to ask /or/ How to make your…

Those handy little previews you see when you paste a link into a Slack message are what we refer to as unfurling internally at Slack (and also in Slack's API documentation). While it may sound like a made up bit of tech jargon, it's an actual word that means "to spread out from a rolled or folded state" which is what Slack attempts whenever it encounters a link.


Read full article from Everything you ever wanted to know about unfurling but were afraid to ask /or/ How to make your…


LeetCode 928 Minimize Malware Spread II | ReeeStart



LeetCode 928 Minimize Malware Spread II | ReeeStart

这题和Minimize Malware Spread I的区别是:

I: 问如果从initial中取掉一个server, 把这个server的病毒给清了, 那要对哪个server杀毒, 能使得最终Internet里被感染的结点数最少?
II: 问如果从Initial中取掉一个server, 把它从整个网络中拿掉, 要拿掉哪个server, 能使最终被感染的结点数最少?

#Solution

#Solution #1 - Union Find - Without Optimization

最简单的就是重头做N遍union-find, 每次取掉initial中的一个server. 然后每次求中毒的数量.

Time: O(N * NlogN)

#Solution #2 - Union Find Optimization

第二种解法是对上一个方法的优化, 通过观察我们可以得到, 因为只能取掉一个server:

  • 如果排除initials再union-find之后的某个component, 不包含任何initials, 则不受影响.
  • 如果排除initials再union-find之后的某个component, 只包含一个中毒server, 那么取掉这个中毒的可以使这个component不受影响.
  • 如果排除initials再union-find之后的某个component, 包含多个中毒servers, 那么取掉谁都一样. 该中毒的还是要中毒.

所以我们最终的答案, 肯定是在那些只包含一个中毒server的component里面找.


Read full article from LeetCode 928 Minimize Malware Spread II | ReeeStart


How to Embed PDF Document in HTML Web Page - CodexWorld



How to Embed PDF Document in HTML Web Page - CodexWorld

You can specify multiple parameters in URL. Each parameter should be separated with either an ampersand (&) or a pound (#) character. Actions are executed from left to right and later actions will override the previous actions.


Read full article from How to Embed PDF Document in HTML Web Page - CodexWorld


The Top 10 App Ad Networks For 2019 From (Mobile, Inn-App & iOS)



The Top 10 App Ad Networks For 2019 From (Mobile, Inn-App & iOS)

Being a successful mobile app publisher is no walk in the park. There's the process of app development, gaining user adoption and finding the right balance of monetization – all in an overcrowded space.

You could be great at development and marketing, but without a sound app monetization model, your dreams of becoming a successful app publisher will inevitably fail. While monetizing your app can consist of various models such as paid downloads, in-app purchases, in-app subscriptions, and in-app advertising, this guide will focus on the advertising piece of the puzzle.


Read full article from The Top 10 App Ad Networks For 2019 From (Mobile, Inn-App & iOS)


Top 10 Best Ad Networks of 2015 for Publishers - MonetizeMore



Top 10 Best Ad Networks of 2015 for Publishers - MonetizeMore

There are countless ad networks and sifting through them all to find the top ad networks for publishers is difficult. Direct selling to advertisers requires a high amount of resources, resources most publishers don't have.  So, most publishers opt to partner with ad networks to fill ad inventory to monetize their sites. Here are our Top 10 ad network picks for 2015:


Read full article from Top 10 Best Ad Networks of 2015 for Publishers - MonetizeMore


How To Copy From Right Click Disabled Websites



How To Copy From Right Click Disabled Websites

If you have to copy the specific text content and you can take care of HTML tags, you can use browser view source options. All the major browser give an option to the source of the page, which you can access directly using the format below or by right click. Since right click is out of the question here, we will simply open chrome browser and type: view-source: before the post URL Like

  • view-source:https://www.shoutmeloud.com

And find the paragraph or text you want to copy and then paste it into any text editor.

Well, using this trick ethically or unethically is in user's hand but for a normal blogger like me and you, this tip will certainly help. Do you use any other plugin or add-on to copy the content of pages with right click disabled? Do you also see this feature as a bad user experience?

Subscribe on Youtube


Read full article from How To Copy From Right Click Disabled Websites


9 Best Free Proxy Servers for Anonymous Web Surfing



9 Best Free Proxy Servers for Anonymous Web Surfing

Hidester provides SSL proxy support that protects you from scripts and other malicious methods that could harm your computer. It has a reputation as the most reliable free web proxy site on the market.

You can pick between a U.S. or Europe server before you begin browsing, as well as choose to encrypt the URL, allow or disallow cookies, accept or reject scripts, and strip away objects from loading.


Read full article from 9 Best Free Proxy Servers for Anonymous Web Surfing


How to Keep Your MacBook from Overheating



How to Keep Your MacBook from Overheating

Have your MacBook Pro or MacBook Air been boiling hot like a boiling pot? It is normal for MacBook to produce heat when it works, but it is another pair of shoes when it always keeps abnormally hot, which is a serious issue that you can't pass it over, because:

  • Overheat will slow down MacBook to run or even cause it to crash;

  • Force MacBook to shut down suddenly;

  • Do harm to some hardware and shorten MacBook Pro/Air's life expectancy.

Sounds horrible? Don't worry since we find out the following methods to keep MacBook away from overheating.


Read full article from How to Keep Your MacBook from Overheating


朱小厮的博客



朱小厮的博客

很多同学私信问我Kafka在性能优化方面做了哪些举措,对于相关问题的答案其实我早就写过了,就是没有系统的整理一篇,最近思考着花点时间来整理一下,下次再有同学问我相关的问题我就可以潇洒的甩个链接了。这个问题也是Kafka面试的时候的常见问题,面试官问你这个问题也不算刁难你。在网上也有很多相关的文章开讲解这个问题,比如之前各大公众号转载的"为什么Kafka这么快?",这些文章我看了,写的不错,问题在于只是罗列了部分的要领,没有全部的详述出来。本文所罗列的要领会比你们网上搜寻到的都多,如果你在看完本篇文章之后,在面试的时候遇到相关问题,相信你一定能让面试官眼前一亮。


Read full article from 朱小厮的博客


SRE和DevOps - 知乎



SRE和DevOps - 知乎

在搜索SRE和DevOps相关概念的过程中偶然发现Google Cloud的Blog专门制作了这样一篇文章,国内虽然有不少翻译但并没有完全做到翻译术语中的"信,雅,达",这里转载Google官方的文章和YouTube视频,同时也选择了网友精心翻译的文章并把视频搬运至bilibili也就是B站方便大家浏览,相信大家可以对SRE和DevOps有更深入的理解。


Read full article from SRE和DevOps - 知乎


Baozi Training Blog (包子IT面试培训博客)



Baozi Training Blog (包子IT面试培训博客)

Thought Process

A very simple problem thus normally can solve it in multiple ways.
 

Encode string and patterns then compare

Since we are comparing "patterns" here, one straightforward way is encode the pattern into a string, then use the same encoding algorithm to encode the str array into a string, then compare the string.

What encoding should we choose? Well it's not really an encoding per se. What I did is just convert any word or character to a character staring with ('a' + an index). If we see this character before, we just directly return from the hash map lookup. For example, "duck dog dog" would be encoded as "abb" while "bcc" would also be encoded as "abb".

Use bijection mapping

Note in the problem description it mentions it is a bijection mapping (i.e., a one to one mapping).
As shown in the graph below, you see the differences between injection, surjection and bijection. That said, bijection does not allow duplicates. We can build a one to one mapping between the pattern and string, since it's bijection, if two characters in the pattern map to the same string, then it's not a valid bijection, therefore return false.

Read full article from Baozi Training Blog (包子IT面试培训博客)


Baozi Training Blog (包子IT面试培训博客): Alibaba Tech Festival - Silicon Valley & Game of Thrones Season 8 Finale



Baozi Training Blog (包子IT面试培训博客): Alibaba Tech Festival - Silicon Valley & Game of Thrones Season 8 Finale

Alibaba, Jack Ma's empire has always been very active in Silicon Valley, trying to recruit the top talents. Traditionally it was mainly focused on somewhat cutting edge technologies. e.g, big data in the old days (while everyone is talking about it), cloud, and nowadays machine learning / AI of course. However, this time, the Taobao Team (淘系技术) was in town and shared some of the interesting projects they are working on.  This is mainly due to the early vision shifts from Jack Ma that technology should drive business instead of the old vision, business is key, technology plays only a secondary supporting role.

Read full article from Baozi Training Blog (包子IT面试培训博客): Alibaba Tech Festival - Silicon Valley & Game of Thrones Season 8 Finale


Baozi Training Blog (包子IT面试培训博客): How to prepare system design questions in a tech interview? | 如何准备系统设计题目?



Baozi Training Blog (包子IT面试培训博客): How to prepare system design questions in a tech interview? | 如何准备系统设计题目?

如何准备面试中的系统设计问题一直都是包子的学员,尤其是fresh new grad比较头疼的一个问题。我们的好朋友在mitbbs上面与大家分享了他准备系统设计方面的一些资料和心得,包子在这里和大家再一次分享一下,也感谢我们的好朋友允许我们在这里转载,希望对正在找工作的同学有所帮助。

【转载自mitbbs

我的面试也结束了 因为知道FLAG这类公司都会问到System Design的问题 所以这次面
试着重准备了一下 在这里分享给大家 如果有不对或者需要补充的地方 大家可以留言

这里说的System Design和OO Design不同 System Design在FLAG以及很多大公司中主要
是design scalable distributed systems 这里只讨论如何准备这种题目

== 入门 ==
对于0基础的同学们 下面的资料可以按顺序开始看
1. http://www.hiredintech.com/app#system-design
这是一个专门准备面试的网站 你只用关心system design部分 有很多的link后面会重
复提到 建议看完至少一遍

2. https://www.youtube.com/watch?v=-W9F__D3oY4
非常非常好的入门资料 建议看3遍以上!
这是1里面提到的资料 是Harvard web app课的最后一节 讲scalability 里面会讲到很
多基础概念比如Vertical scaling, Horizontal scaling, Caching, Load balancing,
Database replication, Database partitioning 还会提到很多基本思想比如avoid 
single point of failure
再强调一遍 非常好的资料!

Read full article from Baozi Training Blog (包子IT面试培训博客): How to prepare system design questions in a tech interview? | 如何准备系统设计题目?


leetcode 765 - Couples Holding Hands | Mengwen's blog



leetcode 765 - Couples Holding Hands | Mengwen's blog

We first assign groups to elements in the array.

For example, given array [2, 1, 5, 0, 3, 4], we assign groups as the following:

  • [0, 1]: group 0
  • [2, 3]: group 2
  • [4, 5]: group 4

To get the group number for a given array element, we can use arr[i] & (~0x1).

As a result, if we represent [2, 1, 5, 0, 3, 4] in group labels, we get [2, 0, 4, 0, 2, 4].

We visualize each group as a vertax of a undirected graph.

The initial connection of these vertaxes are determined by the pairs in the given array.

For example, if the array is [0, 0, 2, 2, 4, 4], we get the following graph:

graph 0graph 0

If the array is [2, 0, 4, 0, 2, 4], we get:

graph 1graph 1

Assume the size of the input array is N, If all the couples are seat next to each other, we want the graph to have exactly N / 2 connected components as shown in the [0, 0, 2, 2, 4, 4] graph.


After we convert the input array into an undirected graph, we convert the problem to:

Given this undirected graph with (N / 2) vertices, and at most two edges for a vertex, what is the minimum swaps needed to convert this graph to a graph that has exactly (N / 2) connected components?

We can observe that, for the given kind of graph, every swap is guaranteed to break one vertex free if it is in a connected component, and thus, increase the total number of connected component by 1.

For example, for the array [2, 0, 4, 0, 2, 4], after we swap idx 0 with idx 3, we get [0, 0, 4, 2, 2, 4]. By doing this, we break vertex 0 free, and increase the connected component count from 1 to 2.

As a result, we can conclude that (the # of components we increased) == (the # of swaps we have to do)

Our gaol is to increase the total number of components to N / 2. Thus we have (origional # of components) + (# of components we have to increase) == N / 2.

As a result, we have:
(# of swaps we have to do) == (# of components we have to increase) == N / 2 - (origional # of components)

So, the problem now is converted to find (origional # of connected components) in this undirected graph.


In order to find the origional number of connected components, we can do the following:

If we start with N / 2 connected components, each time we find a new edge between two components, we have to reduce the number of our connected components by 1.

For example, for array [0, 2, 2, 0, 4, 4], we should have 2 connected components: 0 - 2 and 4. If we start our component count at 3, when we see the first pair [0, 2], we know that component 0 and 2 are connected, so we reduce our component count to 2. Then, we see pair [2, 0], but since we already handled [0, 2], we don't have to handle [2, 0] again since the graph is undirected. So, in the end, we find out that we have 2 connected components in the graph generated by [0, 2, 2, 0, 4, 4].

To achieve this, we can use Union-Find method.

We inspect one pair every time. If the two elements are not already in one group, we know that a new edge is now being added, which means we have to decrease the count of our connected components by 1. Then, we union these two groups.


Read full article from leetcode 765 - Couples Holding Hands | Mengwen's blog


LeetCode : Smallest Rotation with Highest Score – Stokastik



LeetCode : Smallest Rotation with Highest Score – Stokastik

As we can see that, we can easily come up with a O(N2) solution. Rotate the array each time and compute the score. There are N possible rotations for an array of size N, and for each rotated position, computing the score for the array takes O(N) time complexity. Since the approach is very easy, we will not code this approach but will explore whether we can do better than O(N2).

What if we can find out the minimum and the maximum values of rotation, for which each element of the array will contribute towards a positive score ? For example, given the array

[2, 3, 1, 4, 0],

the minimum and maximum values for each position are as follows :

1st position (element = 2) : min rotation = 1 and max rotation = 3

Because if rotated 1 time, 2 will land up at index 4 and if rotated 3 times, 2 will land up at index 2. If rotated more than 3 or less than 1 time, then 2 will land up at an index 'm' for which m < 2.

[3, 1, 4, 0, 2] -> [1, 4, 0, 2, 3] -> [4, 0, 2, 3, 1]

Similarly, 2nd position (element = 3) : min rotation = 2 and max rotation = 3

Because if rotated 2 times, 3 will land up at index 4 and if rotated 3 times, 3 will land up at index 3. If rotated more than 3 or less than 2 times, then 3 will land up at an index 'm' for which m < 3.

[1, 4, 0, 2, 3] -> [4, 0, 2, 3, 1]

and so on.

Note that for the 3rd position (element = 1), it is already at a 'good' position (2 >= 1). It has two possible pairs of min and max rotation (0, 1) and (3, 4), because with 0 and 1 rotation it will land up at index 2 and 1 respectively, where both 2 >= 1 and 1 >= 1 satisfies. But for rotation 2, 1 will land up at index 0, where 0 < 1. If rotated 3 times or 4 times 1 will land up at indexes 4 and 3 respectively, where 4 >= 1 and 3 >= 1.

Thus for positions where the element is already contributing towards a positive score, such as 1 in the above case, there would be two disjoint pairs of min and max rotations possible.

The maximum possible number of min-max pairs would be 2N, e.g. [0,1,2,3,4]

If the element is 0, then it can be rotated any number of times and will contribute wherever it lands. Thus min rotation = 0 and max rotation = 4.

2 : [1, 3],

3 : [2, 3]

1 : [0, 1], [3, 4]

4 : [4, 4]

0 : [0, 4]

Then in order to find the rotation for which the score is maximum, we need to find the value of rotation for which the maximum number of elements contribute towards a score of 1.

In the above example, if k = 3 rotations, then the elements 2, 3, 1 and 0 contributes, from the above calculations. For k = 3, 4 does not contribute since it only contributes for a rotation of 4. Similarly for k = 1, [2, 1, 0] contributes, for k = 2, [2, 3, 0] contributes and k = 0, [1, 0] contributes. Thus we see that for k = 3, there are maximum contributions, i.e 4 elements.

How can we code this, so that the time complexity does not come out to be O(N2) ?

If we compute the min and max rotations for each element first and then for each rotation, compute the number of elements that contributes towards that rotation, it will be O(N2), since we need to look up each min-max rotation pair and then decide whether the element contributes or not and there are 2N possible min-max pairs.

We will use the fact that the min-max pairs are a range of indices. For example, if we have an array M of size N, with all elements set to 0 initially. Then whenever we encounter a min-max pair [a, b], we will increment the sub-array M[a : b] by 1. This signifies that, for all rotations between the values 'a' to 'b' (inclusive), we have found one more element.

Using the Numpy library of python, updating a range of contiguous array indices would take O(1) time, since they are contiguous in memory.


Read full article from LeetCode : Smallest Rotation with Highest Score – Stokastik


Labels

Algorithm (219) Lucene (130) LeetCode (97) Database (36) Data Structure (33) text mining (28) Solr (27) java (27) Mathematical Algorithm (26) Difficult Algorithm (25) Logic Thinking (23) Puzzles (23) Bit Algorithms (22) Math (21) List (20) Dynamic Programming (19) Linux (19) Tree (18) Machine Learning (15) EPI (11) Queue (11) Smart Algorithm (11) Operating System (9) Java Basic (8) Recursive Algorithm (8) Stack (8) Eclipse (7) Scala (7) Tika (7) J2EE (6) Monitoring (6) Trie (6) Concurrency (5) Geometry Algorithm (5) Greedy Algorithm (5) Mahout (5) MySQL (5) xpost (5) C (4) Interview (4) Vi (4) regular expression (4) to-do (4) C++ (3) Chrome (3) Divide and Conquer (3) Graph Algorithm (3) Permutation (3) Powershell (3) Random (3) Segment Tree (3) UIMA (3) Union-Find (3) Video (3) Virtualization (3) Windows (3) XML (3) Advanced Data Structure (2) Android (2) Bash (2) Classic Algorithm (2) Debugging (2) Design Pattern (2) Google (2) Hadoop (2) Java Collections (2) Markov Chains (2) Probabilities (2) Shell (2) Site (2) Web Development (2) Workplace (2) angularjs (2) .Net (1) Amazon Interview (1) Android Studio (1) Array (1) Boilerpipe (1) Book Notes (1) ChromeOS (1) Chromebook (1) Codility (1) Desgin (1) Design (1) Divide and Conqure (1) GAE (1) Google Interview (1) Great Stuff (1) Hash (1) High Tech Companies (1) Improving (1) LifeTips (1) Maven (1) Network (1) Performance (1) Programming (1) Resources (1) Sampling (1) Sed (1) Smart Thinking (1) Sort (1) Spark (1) Stanford NLP (1) System Design (1) Trove (1) VIP (1) tools (1)

Popular Posts