Skip to content

Instantly share code, notes, and snippets.

import java.util.List;
import java.util.Arrays;
import java.util.stream.Collectors;
public class MyClass {
public static void main(String args[]) {
List<Place> places = Arrays.asList(
new Place(2, 2),
new Place(1, 1),
@clangpp
clangpp / gist:9a83c24af5ae41eef841278f0ed3147e
Last active June 13, 2019 16:34
sort by distance to a list of places
import java.util.List;
import java.util.Arrays;
public class MyClass {
public static void main(String args[]) {
List<Place> places = Arrays.asList(
new Place(2, 2),
new Place(1, 1),
new Place(3, 3)
);
------
2014.10.20
问题描述:在一加手机上刷CM系统的官方教程?
解决方法:
[教程] 一加手机 oneplus 刷 CyanogenMod 详细教程,请认真观看
http://www.oneplusbbs.com/forum.php?mod=viewthread&tid=408783
[ROM] CyanogenMod官方固件 CM11S XNPH33R official & OTA XNPH38R
void test6() {
int value = 1;
function<void()> f = [&value]() { value += 1; };
cout << value << endl; // 1
f();
cout << value << endl; // 2
f();
cout << value << endl; // 3
class TestLambda {
int global_value = 10;
int test() {
int local_value = 20;
int value_by_ref = 30;
function<int(int)> f = [global_value, local_value, &value_by_ref](int arg) {
return global_value + local_value + value_by_ref + arg;
};
cout << f(40) << endl; // 10 + 20 + 30 + 40;
}