Skip to content

Instantly share code, notes, and snippets.

View clarkdo's full-sized avatar

Xin Du (Clark) clarkdo

  • Dublin, Ireland
View GitHub Profile
import java.util.ArrayList;
import java.util.List;
public class TravelCost {
private final static Integer[][] participants = {{500, 700}, {200, 600}, {400, 500}, {600, 200}, {500,300}};
private final static int cityAmount = participants[0].length;
private final static List<Integer> result = new ArrayList<>();
public static void main(String[] args) {
@rambolee
rambolee / how_to_fix_update_gwflist_404_error.md
Last active July 9, 2020 00:59
shadowSocks 从 gwflist更新 PAC 时404

shadowSocks 从 gwflist更新 PAC 时404

shadowSocks 从 gwflist更新 PAC 时404

问题:MacOS下ShadowsocksX点击“从GFWList更新PAC”报“Request failed : not found(404)”错误。 查看了 github 的 issue,发现是新问题,但是已经有大神解决了,解决方案如下。
下面是大神的 shell 代码,果断观摩之:

大神的 github 地址

@arturmkrtchyan
arturmkrtchyan / ObjectHeader32.txt
Last active October 7, 2024 03:11
Java Object Header
|----------------------------------------------------------------------------------------|--------------------|
| Object Header (64 bits) | State |
|-------------------------------------------------------|--------------------------------|--------------------|
| Mark Word (32 bits) | Klass Word (32 bits) | |
|-------------------------------------------------------|--------------------------------|--------------------|
| identity_hashcode:25 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Normal |
|-------------------------------------------------------|--------------------------------|--------------------|
| thread:23 | epoch:2 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Biased |
|-------------------------------------------------------|--------------------------------|--------------------|
|
@masak
masak / explanation.md
Last active April 10, 2025 16:42
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <[email protected]>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.