0%

笔记

flex: 1 1 auto;

这是完整写法, 详见mdn, 它还有另外两种完整写法, 分别是 initial (0 1 auto) 和 none (0 0 auto)

第一个参数表示: flex-grow 定义项目的放大比例,默认为0,即如果存在剩余空间,也不放大
第二个参数表示: flex-shrink 定义了项目的缩小比例,默认为1,即如果空间不足,该项目将缩小
第三个参数表示: flex-basis给上面两个属性分配多余空间之前, 计算项目是否有多余空间, 默认值为 auto, 即项目本身的大小

flex-flow 是 flex-direction flex-wrap 快捷方式

flex-flow = flex-direction flex-wrap

google tts mp3

https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=ja&q=料理

1
const url= `https://translate.google.com/translate_tts?ie=UTF-8&tl=${lang}&client=tw-ob&q=${text}`;

电费

333

+150

483 2022-11-19

479.97 2022-11-20

+70

503.13 2022-11-22

478.22 2022-11-23

453.3 2022-11-24

427.39 2022-11-25

398.99 2022-11-26

339.19 2022-11-28

307.80 2022-11-29

190.20 2023-01-02
160.30 2023-01-03

97.85 2023-01-05

+300

229.52 2023-01-11

120.96 2023-01-15

+500

332 2023-01-25

mapbox 笔记

离线
https://cloud.tencent.com/developer/article/1911214?from=article.detail.1604650

mapboxGL2中Terrain的离线化应用
https://cloud.tencent.com/developer/article/1911216?from=15425

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var map = new mapboxgl.Map({
container: 'map',
style: 'https://www.example.com/styles/streets/style.json',
center: [53.33, 24.5],
zoom: 8,
transformRequest: function(url, resourceType) {
if(resourceType !== 'Tile') {
return {
url: url,
};
}

return axios.get('../api/get-token.php', {
params: {
AccessURL: url
},
headers: {
'X-Requested-With': 'XmlHttpRequest'
}
}).then(function (response) {
return {
url: url,
headers: {
'X-Requested-With': 'XmlHttpRequest'
'token': response.data.token
}
}
});
}
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var map = new mapboxgl.Map({
container: 'map',
style: 'https://www.example.com/styles/streets/style.json',
center: [53.33, 24.5],
zoom: 8,
transformRequest: async function(url, resourceType) {
if(resourceType !== 'Tile') {
return {
url: url,
};
}

try {
const response = await axios.get('../api/get-token.php', {
params: {
AccessURL: url
},
headers: {
'X-Requested-With': 'XmlHttpRequest'
}
});
return {
url: url,
headers: {
'X-Requested-With': 'XmlHttpRequest'
'token': response.data.token
}
};
} catch (error) {
return {
url: url,
};
}
}
});

查看 shell 代码

忘记 proxy 命令写在哪里了 :(

1
type -a proxy

代码 1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var map = map||test||test.map;
var mytest = function(e){
// console.log(e)
let map = test
let fs = map.queryRenderedFeatures(
e.point,
{
layers: ['layer_goudao']
}
);
// console.log(fs)
func_draw_pp(fs)

}
mytest && map.off('click',mytest)
map.on('click',mytest)
map.setPitch(60)

function func_draw_pp(fs){
let rs = []
fs.forEach(a=>{
console.log(a)
let line = turf.lineString(a.geometry.coordinates);
console.log(line)
let along = turf.along(line,0.1)
rs.push(line)
rs.push(along)
})

map.getSource('temp_line').setData({
type:'FeatureCollection',
features:rs
})
}

代码 2

1
2
3
let fs = map.queryRenderedFeatures({layers: ['layer_goudao'] } );
console.log(fs)

1
2
3
4
5
turf.lineString(temp1[0].geometry.)


map.getSource('temp_line').setData()

turf.lineString([[108.97049293140219,34.33153377857526],[109.02010306934216,34.332029922789474] ])

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var map = map||test||test.map;
var mytest = function(e){
//console.log(e)
let map = test
let fs = map.queryRenderedFeatures(
e.point,

{
layers: ['layer_goudao']
}
);
console.log(fs)

}
mytest && test.off('click',mytest)
test.on('click',mytest)
map.setPitch(60)

let rs = []
temp1.forEach(a=>{
console.log(a)
let line = turf.lineString(a.geometry.coordinates);
console.log(line)
rs.push(line)

map.getSource('temp_line').setData(line)

})

map.getSource(‘temp_line’).setData({
type:’FeatureCollection’,
features:rs
})

1
2
test.off('click',mytest)
test.on('click',mytest)
1

https://www.samanthaming.com/journal/3-how-to-use-lodash-with-vue/

slice 复制 比 loop 快

1
2
3
4
5
6
7
n = 1000*1000;
start = + new Date(); // A=+B 会进行 B转化为数字 赋值给A
a = Array(n);
b = Array(n);
i = a.length;
while(i--) b[i] = a[i];
console.log(new Date() - start);
1
2
3
4
5
n = 1000*1000;
start = + new Date();
a = Array(n);
b = a.slice();
console.log(new Date() - start);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const cityCoordinates = [
[100.507, 13.745],
[98.993, 18.793],
[99.838, 19.924],
[102.812, 17.408],
[100.458, 7.001],
[100.905, 12.935]
];
const map = new mapboxgl.Map({
container: 'map',
// Choose from Mapbox's core styles, or make your own style with Mapbox Studio
style: 'mapbox://styles/mapbox/streets-v12',
center: [100.507, 13.745],
zoom: 9
});

map.on('load', () => {
for (const [index, coordinate] of cityCoordinates.entries()) {
setTimeout(() => {
map.jumpTo({ center: coordinate });
}, 2000 * index);
}
});

for in 和 for of 区别

https://kanboo.github.io/2018/01/30/JS-for-of-forin/

update feature in realtime

https://docs.mapbox.com/mapbox-gl-js/example/live-update-feature/

2023年推荐书目(吴尔夫)
1.《生活与命运》(俄罗斯),瓦西里.格罗斯曼。力冈译
2.《枪炮、病菌与钢铁一一人类社会的命运》(美)贾雷德.戴蒙德〈扩展阅读:《崩溃:社会如何选择成败兴亡》;《第三和猩猩一一人类的身世与未来》),《剧变》等),谢延光译
3.《文明的冲突与世界秩序的重建》(美)塞缪尔.享廷顿,周琪等译
4.《演化的故事:40亿年生命之旅》(美)卡尔.齐默
5.《透过地理看历史》,李不白

给我们读书会的2023年推荐这几本书:

  1. 《鼠疫》法国.阿尔贝·加缪
  2. 《陆犯焉识》美国.严家苓
  3. 《可能性的艺术:比较政治学30讲》中国.刘瑜
  4. 《大明王朝的七张面孔》中国.张宏杰