2019年12月18日星期三

filezilla内容列表字体非常小

fractional-scaling-on-xorg-linux

Place this in ~/.profile. These variables will take effect when you log in.

export GDK_SCALE=2
export GDK_DPI_SCALE=0.5



wxGTK3 Linux: small fonts in directory trees

Is there any way to influence the font size of the file list?

PointZ and PointM Data Types

PointZ and PointM Data Types

PointZ and PointM have the same properties as the Point data type except they contain one more ordinate. 

The Z is the elevation and the M is the measurement. 

Syntactically these types are similar.

2019年12月14日星期六

gdal中配置选项的使用

1、转换dxf文件时经常用到的选项
     set GDAL_FILENAME_IS_UTF8=NO
     set OGR_ARC_MAX_GAP=20
     set DXF_ENCODING=CP936
ogr2ogr --config OGR_ARC_MAX_GAP 20 -s_srs EPSG:2384 -t_srs EPSG:2384 -f "ESRI Shapefile" center_line2.shp  道路中心线.dxf

ogr2ogr --config OGR_ARC_STEPSIZE 1 -s_srs EPSG:2384 -t_srs EPSG:2384 -f "ESRI Shapefile" center_line3.shp  道路中心线.dxf

ogr2ogr -segmentize 20 -s_srs EPSG:2384 -t_srs EPSG:2384 -f "ESRI Shapefile" center_line5.shp  道路中心线.dxf

ogr2ogr --config GDAL_FILENAME_IS_UTF8 NO -simplify 10  -s_srs EPSG:2384 -t_srs EPSG:2384 -f "ESRI Shapefile" center_line8.shp  道路中心线.dxf

2、官方文档
      https://gdal.org/drivers/vector/dxf.html#vector-dxf

      https://trac.osgeo.org/gdal/wiki/ConfigOptions

      https://gdal.org/user/configoptions

      set-default-gdal-ogr-config-options

      using-dxf-arc-or-circle-accurately-in-arcgis-for-desktop

 3、多段线简化

      cmdoption-ogr2ogr-simplify

      cmdoption-ogr2ogr-segmentize

     道格拉斯-普克算法

    Ramer–Douglas–Peucker algorithm

iterative-version-of-ramer-douglas-peucker-line-simplification-algorithm/

2019年12月8日星期日

osx brew gdal

osx中,postgis自带的ogr2ogr执行的sql包含ST_Centroid时,出错,原因不明,
使用brew install 的gdal,没有问题。

How to Find Where Homebrew Packages Are Installed on Mac

gdal Formula

ogr2ogr centroid.shp fields.shp -dialect sqlite -sql "SELECT ST_Centroid(geometry), id, name from fields"

Debian中安装postgresql

install-postgresql-database-in-debian-10

2019年12月2日星期一

gdal:shape文件添加面积属性

ogrinfo -al -so         2max_elements_0.shp

ogrinfo  -sql       "alter table  \"2max_elements_0\"  add column area real(20,3)" 2max_elements_0.shp

ogrinfo  -dialect SQLite -sql   "update \"2max_elements_0\" set area = ST_Area(geometry)" 2max_elements_0.shp


备注:

Because UPDATE is not supported in OGR SQL, you should update the table using the SQLite SQL dialect available in GDAL >= 1.10 with SQLite and SpatiaLite support.[1]

GDAL is internally using the Virtual Table Mechanism of SQLite and therefore operations like ALTER TABLE are not supported. [2]

2019年11月2日星期六

2019年10月13日星期日

Regular expression

grep -E  -o 'https://pbs\.twimg\.com/media/[a-zA-Z0-9_-]+\.jpg'     r.json | sort | uniq

https://en.wikipedia.org/wiki/Regular_expression

non-greedy-grep

2019年10月8日星期二

2019年9月25日星期三

用shadowsocks加速git clone

用shadowsocks加速git clone

git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'

shadowsocks的本地端口默认是1080

上面设置只是开启https://代理

2019年9月17日星期二

List tables in a PostgreSQL schema

List tables in a PostgreSQL schema

python性能优化

0、使用 line_profiler 逐行分析性能瓶颈。

1、如果内存够用,使用file对象的readlines一次性读入,再分析。

2、输出时,使用  io.StringIO()  缓存后,再一次性输出到文件。


2019年9月16日星期一

10 Easy Steps to a Complete Understanding of SQL

10 Easy Steps to a Complete Understanding of SQL

深入理解SQL的十个步骤

https://postgis.net/workshops/postgis-intro/joins.html

编译openmesh

C:\aka\OpenMesh-8.0\build\Unittests>g++   -o unittests unittests.cc -I"C:\aka\googletest-master\googletest\include" -I"C:\aka\OpenMesh-8.0\build" -I"C:\aka\OpenMesh-8.0\src"  -L"C:\aka\googletest-master\build_googletest\bin"    -lgtest

g++   -o attributes attributes.cc  -I"C:\aka\OpenMesh-8.0\build" -I"C:\aka\OpenMesh-8.0\src"  -L"C:\aka\OpenMesh-8.0\build\src\OpenMesh\Core"    -lOpenMeshCored


Compiling OpenMesh with mingw and cmake on windows

googletest

creating-using-shared-libraries-different-compilers-different-operating-systems/

Creating a shared and static library with the gnu compiler (gcc)

undefined-reference-to-stdios-baseinitinit


2019年9月15日星期日

convert Jupyter(.ipynb) to Python(.py)

https://nbconvert.readthedocs.io

jupyter nbconvert --to script mike21fm_mesh_openmesh_to_shape.ipynb

2019年9月10日星期二

PostgreSQL Temporary Table

PostgreSQL Temporary Table

PL/pgSQL Errors and Messages

PL/pgSQL Variables

Postgres FOR LOOP

dynamic sql query in postgres

String Functions and Operators

PostgreSQL: Dynamic SQL Function

PostgreSQL: Dynamic SQL Function

CREATE TEMP TABLE "千河套__西防洪堤以西2" As  SELECT  sjx.*    from xqh_v_sjx as sjx , xqh_v_zones as v_zone   where ST_Within(sjx.geom,v_zone.geom)  AND v_zone.zone_name =  '千河套__西防洪堤以西' ;


DO 
$$
DECLARE
zone_name1 text;
BEGIN
FOR zone_name1 IN SELECT zones.zone_name 
FROM xqh_v_zones as zones 
WHERE zones.zone_name <> '待删除区域' 
LOOP
--RAISE NOTICE '%', zone_name1;
EXECUTE  format('CREATE TEMP TABLE %s AS SELECT  sjx.*   from xqh_v_sjx as sjx , xqh_v_zones as v_zone  where ST_Within(sjx.geom,v_zone.geom)  AND v_zone.zone_name =  %L',quote_ident(zone_name1),zone_name1);
--EXECUTE 'CREATE TEMP TABLE "'  || zone_name1  || '" As '  || ' SELECT  *   ' || ' from xqh_v_sjx as sjx , xqh_v_zones as v_zone  ' || ' where ST_Within(sjx.geom,v_zone.geom)  AND v_zone.zone_name =  ' || zone_name1 || ' ;' ;
END LOOP;
END;
$$;

postgreSQL 中 SELECT INTO 与 CREATE TABLE AS 的区别

http://www.postgresqltutorial.com/postgresql-select-into/

Note that you cannot use the SELECT INTO statement in PL/pgSQL or ECPG because they interpret the INTO clause differently. In this case, you can use the CREATE TABLE AS statement which provides more functionality than the SELECT INTO statement.

postgreSQL中单引号、双引号的区别

What is the difference between single quotes and double quotes in PostgreSQL?

2019年8月25日星期日

posgresql的schema

https://postgis.net/workshops/postgis-intro/schemas.html

shp2pgsql-how-to-know-the-schema-table



shp2pgsql      [<options>]     <shapefile>     [[<schema>.]<table>]

2019年8月18日星期日

使用qgis对dxf文件进行几何检查

1  将dxf文件转换为geojson文件

使用ogr2gor将dxf文件转换为geojson文件:

ogr2ogr  -dim XY  -skipfailures  -f "GeoJSON"  test.json by_aka2020.dxf


2 用qgis打开geojson文件,注意导入后要指定投影坐标系

  ① qgis的文件浏览器好像不支持json文件,需要使用“打开数据源管理器”按钮。
  
  ②在qgis的插件管理器中,启用“几何检查器”,启用后,在菜单Vector中寻找“几何检查器”。

  ③ qgis的“几何检查器”无法处理多段线中“短线段”问题。
  
  ④ arcmap也有几何检查的功能,但是不能指定“短线段”的长度范围。

qgis geojson bug

Edits in GeoJson datasources are not saved anymore

QGIS saves geojson.tmp instead of updating file


vim与系统剪贴板

how-can-i-copy-text-to-the-system-clipboard-from-vim

postgresql 中的大小写

why-postgresql-does-not-like-uppercase-table-names

are-function-names-in-postgresql-case-insensitive

Are PostgreSQL column names case-sensitive?

how-do-i-list-all-columns-for-a-specified-table



In PostgreSQL, names of identifiers are always folded to lowercase unless you surround the identifier name with double quotes. 

you are advised to always quote a particular name or never quote it.

Which basically means all the queries in postgres are by default converted to lowercase letters. But, If you want to create a column with Upper case letters then you must specify it inside the "". And get the data of in uppercase Column(DETAILS), you need to specify the column name in (double-quotes)"". So that postgres treats the data in quotes as Case-sensitive and gives the expected column(DETAILS) values. 

2019年7月31日星期三

Using lftp with sftp

Using lftp with sftp
mget命令, ftp命令详解
lftp之mirror功能

  • Basic usage is:
    • lftp sftp://[domain name]
    • lftp sftp://theURL.org
  • For a different user name than the one you are currently using
    • lftp sftp://[user name]@[domain name]
    • lftp sftp://userName@theURL.org
  • for a different port and different user name
    • lftp sftp://[user name]@[domain name]:[port number]
    • lftp sftp://userName@theURL.org:8002

2019年7月20日星期六

vim常用插件

  • vim-plug Vim的插件管理器,支持并发安装和更新
  • NERDTree Vim中的文件管理器,方便编辑文件,创建目录,删除和修改文件等等……
  • NERDTreeCommenter 方便的用来注释代码的插件
  • AutoPairs 自动补全括号的插件,包括小括号,中括号,以及花括号,可以提升编码效率
  • Surround 快速给词加环绕符号,例如单引号/双引号/括号/成对标签等的插件
  • Vim-Airline Vim状态栏插件,包括显示行号,列号,文件类型,文件名,以及Git状态
  • EasyMotion 在当前文件中快速移动光标到指定查找位置的插件,十分方便和高效
  • oceanic-next
  • onedark.vim
  • ultisnips
  • vim-snippets
  • Vim-Auto-pairs总结 

键盘映射

how-do-i-remap-a-key-in-macos-sierra-e-g-right-alt-to-right-control

osx Karabiner-Elements

changing-right-hand-command-alt-key-order-to-be-like-a-windows-keyboard

Remapping Keys in macOS 10.12 Sierra

window:KeyTweak



2019年7月12日星期五

2019年7月10日星期三

qgis或者postgis中合并相邻多边形

merging-adjacent-polygons-in-shapefile
上面的方法,
使用postgis,
将三角网合并成一个面,
再导入到qgis中,
在qgis中,将面转换为线,再转换为点。
但是,生成的点,有很多距离非常近的点。
需要研究一下,问题出在哪儿。

QGIS Enhancement: Unstructured Mesh Layer


https://postgis.net/workshops/postgis-intro/geometry_returning.html

arcgis merging-features-in-the-same-layer

2019年6月29日星期六

qgis计算多边形面积不正确

更新:
找到原因了,qgis的字段计算器中,有两个计算面积的函数
$area 和  area ,
第二个函数计算的面积,与postgis、arcmap计算的是一样的。
更深层次的原因,需要进一步研究。



以一个三角形的geojson文件为例,
{
"type": "FeatureCollection",
"name": "sjx",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::4548" } },
"features": [
{ "type": "Feature", "properties": { "Maximum wa": 0.0, "Time at ma": 0.0, "Maximum cu": 0.0, "Time at ma_1": 0.0, "Duration a": 0.0, "Area": 16370.056, "area_qgis": 16370.06924014238, "area_pgl": null }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [
[ 414847.64296299999114, 4390359.33534799981862 ],
[ 414743.891589, 4390580.790721 ],
[ 414922.68434799998067, 4390514.77821699995548 ],
[ 414847.64296299999114, 4390359.33534799981862 ] ] ] ] } }
]
}

qgis计算的面积为 16370,
但根据三角形面积计算公式,还有postgis、arcmap计算的面积均为16372 。
为什么呢?
记得以前遇到过qgis计算多边形最小包围矩形也不正确。

2019年6月28日星期五

postgresql tutorial

http://www.postgresqltutorial.com/

https://www.w3schools.com/sql/sql_count_avg_sum.asp

在Dos窗口中,添加postgresql可执行文件的目录

set PATH=C:\Program Files\PostgreSQL\11\bin;%PATH%
ps:很奇怪,只有这样设置,psql才能正常执行,为什么呢?
    为什么加上双引号就出错呢?目录里的空格不需要特殊处理吗?

postgis

shp2pgsql-uses-deprecated-addgeometrycolumn-function

PostGIS 2.5.3dev Manual

shp2pgsql向postgresql导入shape数据

shp_postgis

postgis-intro/loading_data.html

AddGeometryColumn

pgadmin4-geometry-viewer

PostGIS-geometry-viewer

shp2pgsql不支持shape文件的prj文件:
shp2pgsql-and-prj-files
using-shp2pgsql-instead-of-ogr2ogr-to-import-shapefile-to-postgis


2019年6月22日星期六

CGAL

cgal.rb

CGAL DEMO 演示

configuring-cgal-with-qt5-and-qglviewer-on-mac

手动更新Homebrew formula

brew install http://liris.cnrs.fr/david.coeurjolly/misc/libqglviewer.rb

brew install qt

 ~ $ brew install qt5
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/qt-5.12.3.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/b6/b669ba7803986326f32e9fe5d2b7229e6ecd806517e8bf750ea4ec59fa8da45f?__gda__=exp=1561215887~hmac=0a33b435c9f633b3fd05f0d3b935cbc30ffa39343642ad5e6f6e5fcb774f
######################################################################## 100.0%
==> Pouring qt-5.12.3.mojave.bottle.tar.gz
==> Caveats
We agreed to the Qt open source license for you.
If this is unacceptable you should uninstall.

qt is keg-only, which means it was not symlinked into /usr/local,
because Qt 5 has CMake issues when linked.

If you need to have qt first in your PATH run:
  echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile

For compilers to find qt you may need to set:
  export LDFLAGS="-L/usr/local/opt/qt/lib"
  export CPPFLAGS="-I/usr/local/opt/qt/include"


==> qt
We agreed to the Qt open source license for you.
If this is unacceptable you should uninstall.

qt is keg-only, which means it was not symlinked into /usr/local,
because Qt 5 has CMake issues when linked.

If you need to have qt first in your PATH run:
  echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> /Users/lyq/.bash_profile

For compilers to find qt you may need to set:
  export LDFLAGS="-L/usr/local/opt/qt/lib"
  export CPPFLAGS="-I/usr/local/opt/qt/include"

For pkg-config to find qt you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/qt/lib/pkgconfig"

==> ncurses
ncurses is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have ncurses first in your PATH run:
  echo 'export PATH="/usr/local/opt/ncurses/bin:$PATH"' >> /Users/lyq/.bash_profile

For compilers to find ncurses you may need to set:
  export LDFLAGS="-L/usr/local/opt/ncurses/lib"
  export CPPFLAGS="-I/usr/local/opt/ncurses/include"

For pkg-config to find ncurses you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/ncurses/lib/pkgconfig"

==> tmux
Example configuration has been installed to:
  /usr/local/opt/tmux/share/tmux

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

docker GoogleEarth

cannot-connect-to-the-docker-daemon-on-macos

Python Installation - Datalab on local machine


lyq ~ $ export CONTAINER_IMAGE_NAME=gcr.io/earthengine-project/datalab-ee:latest
lyq ~ $ export WORKSPACE=${HOME}/workspace/datalab-ee
lyq ~ $ export GCP_PROJECT_ID=akaakaaka
lyq ~ $ mkdir -p $WORKSPACE
lyq ~ $ cd $WORKSPACE
lyq datalab-ee $ docker run -it -p "127.0.0.1:8081:8080" -v "$WORKSPACE:/content" -e "PROJECT_ID=$GCP_PROJECT_ID" $CONTAINER_IMAGE_NAME

卫星图片下载

如何批量下载卫星地图

https://github.com/modyuan/getmap


2019年6月20日星期四

2019年6月19日星期三

OSX Finder 显示隐藏文件

Mac系统如何显示隐藏文件?

Command+Shift+. 可以显示隐藏文件、文件夹,再按一次,恢复隐藏;
finder下使用Command+Shift+G 可以前往任何文件夹,包括隐藏文件夹。

2019年6月18日星期二

OSX常用软件


  1. MacVim
  2. homebrew
  3. iterm2
  4. miniconda
  5. fzf
  6. shadowsocks
  7. chrome
  8. vscode
  9. sublime text
  10. screenshotmenu
  11. magnet
  12. ezip
  13. FinderGo
  14. mpv
  15. qgis
  16. IINA
  17. gimp
  18. GoogleEarth

OSX 中,启动终端或者iterm2时,bash使用不同的启动文件

why-doesnt-bashrc-run-automatically

bashrc-not-sourced-in-iterm-mac-os-x

2019年6月17日星期一

多边形 的 中轴线

How do I calculate the medial axis for a 2D vector shape?



三角网

Iterating Over a Triangulation in Java

https://github.com/bennycheung/PyDelaunay

Triangulated irregular network

从Delaunay三角化到网格质量

http://www.gradientspace.com/tutorials

https://github.com/gradientspace/geometry3Sharp

https://www.grasshopper3d.com/forum/topics/tri-to-quad-mesh

三角网格上的寻路算法

https://www.cs.cmu.edu/~quake/triangle.html

Triangle 中文编译说明

triangle程序python使用说明

三角剖分的各种语言实现

d3-delaunay

D3三角剖分动态演示

https://www.cs.cmu.edu/~quake-papers/

Figure 7.16: Line-Graded Layer Mesh

https://www.ics.uci.edu/~eppstein/280g/

http://www.openmesh.org/

The_Half-Edge_Data_Structure

advanced-methods-in-computer-graphics






国外学术文章下载

https://www.researchgate.net/publication/220387872_Area_Collapse_and_Road_Centerlines_based_on_Straight_Skeletons

https://www.semanticscholar.org/topic/Straight-skeleton/124603

2019年5月30日星期四

AutoCAD 中,如何将图形单位从英制转换为公制

AutoCAD 中,如何将图形单位从英制转换为公制



解决方案:

在 AutoCAD 中,有两种主要方法可以将图形从英制转换为公制单位,或从公制转换为英制单位。

使用 INSERT 命令:

  1. 通过采用目标单位的样板(例如,适用于公制的 acadiso.dwt 或适用于英制的 acad.dwt)创建一个新的空图形。
  2. 在命令行中,输入 INSERT
  3. 插入对话框中,浏览至原始 DWG 文件。
  4. 选中分解对应的框。
  5. 单击确定,并指定插入点。

使用 SCALE 命令:

  1. 在命令行中,输入 SCALE
  2. 选择对象提示下,输入 All,然后点击 Enter
  3. 输入 0,0 作为基点。
  4. 当系统提示输入比例因子时,根据以下列表输入要转换的单位对应的比例因子:
比例因子:

英寸到毫米 = 25.4
毫米到英寸 = 0.0393701

英寸到厘米 = 2.54
厘米到英寸 = 0.393701

英尺到毫米 = 304.8
毫米到英尺 = 0.00328084

英尺到厘米 = 30.48
厘米到英尺 = 0.0328084
 
注意:对于 SCALE 命令方法,根据需要在标注样式中调整标注文字和箭头高度。

2019年5月16日星期四

pandas 在 Windows 操作系统 读取路径中包含中文的csv文件出错

https://github.com/pandas-dev/pandas/issues/15086

根本原因 pandas.read_csv 有两个解析csv文件的engine,
一个是c语言的,不支持中文路径,该engine是默认使用的;
另一个是python语言的,支持中文路径。
即使给pandas.read_csv传递文件对象,
绕过中文路径的问题,对csv文件中的中文,
好像也会解析乱码,
即使调用时使用了encoding='utf-8' 。

解决方案:
pandas.read_csv(engine=‘python’)



这两个engine在默认参数下,对csv文件的处理是不同的,使用前,应仔细阅读函数使用说明。

pandas.read_csv


2019年5月2日星期四

《纪念葛伊甸伯爵》

列宁《纪念葛伊甸伯爵》中的一段话:
“意识到自己的奴隶地位而与之作斗争的奴隶,是革命家。不意识到自己的奴隶地位而过着默默无言、浑浑噩噩的奴隶生活的奴隶,是十足的奴隶。津津乐道地赞赏美妙的奴隶生活并对和善的好心的主人感激不尽的奴隶是奴才,是无耻之徒。”

2019年4月29日星期一

QT High DPI


PyQt5 and high resolution monitors

High DPI Displays

PyQt 5 and 4k screen

from PyQt5 import QtWidgets, QtCore, QtGui

QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)

QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True)

2019年4月20日星期六

设置pypi镜像

修改镜像源在不同操作系统中,修改文件的位置是不同的,
在linux默认的路径是:$HOME/.pip/pip.conf
在windows默认的路径是:%HOME%\pip\pip.ini

默认路径下并不存在配置文件,需要新建,然后在配置文件中写入:
[global]
index-url = http://pypi.mirrors.ustc.edu.cn/simple/

阿里云 速度最快 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
Python官方 https://pypi.python.org/simple/
v2ex http://pypi.v2ex.com/simple/
中国科学院 http://pypi.mirrors.opencas.cn/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

也可以直接使用用-i指令指定镜像源下载,不过这样每次下载库都要加上镜像网址,如下。

pip install -i http://mirrors.aliyun.com/pypi/simple/ pyqt5
pip install -i http://mirrors.aliyun.com/pypi/simple/ pyqt5-tools
pip install -i http://mirrors.aliyun.com/pypi/simple/ qscintilla

pyqt5 与 opencv

《Qt 学习之路 2》目录

用QLabel显示opencv的图片

PyQt5入门以及与OpenCV的简单集成
ps.上面链接里,gridlayout的使用有问题。

pyqt 用opencv在Qlabel上显示图片的一些问题

python3+pyqt5+opencv3简单使用

PyQt 5 开发之旅之 OpenCV 的 GUI 特性

step-by-step-guide-to-building-a-gui

PyQt5番外篇

image-histograms-histograms-equalization-and-histograms-comparison

http://monkeycoding.com/?p=550

opencv打开文件名包含中文的图片竟然会出错:
https://github.com/opencv/opencv/issues/4292
opencv-src-empty-in-function-cvtcolor-error

临时方案

Linux 常用命令


  1.  tar
  2. find
  3. grep

2019年4月18日星期四

Python中在Windows系统中支持中文输入的键盘模拟程序

1、 https://github.com/boppreh/keyboard

      keyboard.write(text, delay=0, restore_state_after=True, exact=None)

2、 https://github.com/pywinauto

       send_keys文档

     pywinauto.keyboard.send_keys( keys,
                                                         pause=0.05,
                                                         with_spaces=False,
                                                         with_tabs=False,
                                                         with_newlines=False,
                                                         turn_off_numlock=True):

3、https://github.com/NyanKiyoshi/SendKeys

       SendKeys("coucou, je support désormais l'unicode :D ♥{ENTER}", pause=.05, with_spaces=True)


4、最简单的C语言例子


2019年4月10日星期三

bash source的作用

what-does-source-do

anaconda安装

https://mirror.tuna.tsinghua.edu.cn/help/anaconda/
ps:清华大学已经关闭anaconda的镜像。

Ananconda更改为国内源

Installing conda packages
conda install package-name=2.3.4

manage-environments

If you'd prefer that conda's base environment not be activated on startup,
   set the auto_activate_base parameter to false:

conda config --set auto_activate_base false

定制bash提示符

https://billie66.github.io/TLCL/book/chap14.html

Easy Bash PS1 Generator

osx 更改网卡地址


sudo ifconfig en5  ether  00188b21XXXX


how-to-spoof-your-mac-address-in-mac-os-x

Where is the MAC address of my Thunderbolt to Ethernet adapter?

spoof ethernet MAC address of the wired ethernet interface coming with MacBookPro

Tech 101: Spoofing a MAC Address in macOS High Sierra

brew install fzf

(py36) ~ 15:15$ brew install fzf

==> Downloading https://homebrew.bintray.com/bottles/fzf-0.18.0.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/0f/0f77b9b22f32f76493cdac585106b01502c6583908e0b7b6ea70ab023b5c1c2e?__gda__=exp=1554881332~hmac=45fe35b7742c6b540c73e248922e38076cc493c4d9ef74152801f9ad41f1
######################################################################## 100.0%
==> Pouring fzf-0.18.0.mojave.bottle.tar.gz
==> Caveats
To install useful keybindings and fuzzy completion:
  /usr/local/opt/fzf/install

To use fzf in Vim, add the following line to your .vimrc:
  set rtp+=/usr/local/opt/fzf
==> Summary
🍺  /usr/local/Cellar/fzf/0.18.0: 17 files, 3.6MB
(py36) ~ 15:17$ less .bash_profile
(py36) ~ 15:18$ less .bashrc
(py36) ~ 15:18$ /usr/local/opt/fzf/install
Downloading bin/fzf ...
  - Already exists
  - Checking fzf executable ... 0.18.0
Do you want to enable fuzzy auto-completion? ([y]/n) y
Do you want to enable key bindings? ([y]/n) y

Generate /Users/lyq/.fzf.bash ... OK
Generate /Users/lyq/.fzf.zsh ... OK

Do you want to update your shell configuration files? ([y]/n) y

Update /Users/lyq/.bashrc:
  - [ -f ~/.fzf.bash ] && source ~/.fzf.bash
    + Added

Update /Users/lyq/.zshrc:
  - [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
    + Added

Finished. Restart your shell or reload config file.
   source ~/.bashrc  # bash
   source ~/.zshrc   # zsh

Use uninstall script to remove fzf.

For more information, see: https://github.com/junegunn/fzf


-------------------------------------------------

(pygis) MacBook-Pro:~ lyq$ brew install fzf
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
mosquitto

==> Downloading https://homebrew.bintray.com/bottles/fzf-0.18.0.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/0f/0f77b9b22f32f76493cdac585106b01502c6583908e0b7b6ea70ab023b5c1c2e?__gda__=exp=1560870550~hmac=97ad307d3d6162b368bb7b2e3149ce2
######################################################################## 100.0%
==> Pouring fzf-0.18.0.mojave.bottle.tar.gz
==> Caveats
To install useful keybindings and fuzzy completion:
  /usr/local/opt/fzf/install

To use fzf in Vim, add the following line to your .vimrc:
  set rtp+=/usr/local/opt/fzf
==> Summary
🍺  /usr/local/Cellar/fzf/0.18.0: 17 files, 3.6MB
==> `brew cleanup` has not been run in 30 days, running now...
(pygis) MacBook-Pro:~ lyq$ /usr/local/opt/fzf/install 
Downloading bin/fzf ...
  - Already exists
  - Checking fzf executable ... 0.18.0
Do you want to enable fuzzy auto-completion? ([y]/n) y
Do you want to enable key bindings? ([y]/n) y

Generate /Users/lyq/.fzf.bash ... OK
Generate /Users/lyq/.fzf.zsh ... OK

Do you want to update your shell configuration files? ([y]/n) y

Update /Users/lyq/.bashrc:
  - [ -f ~/.fzf.bash ] && source ~/.fzf.bash
    + Added

Update /Users/lyq/.zshrc:
  - [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
    + Added

Finished. Restart your shell or reload config file.
   source ~/.bashrc  # bash
   source ~/.zshrc   # zsh

Use uninstall script to remove fzf.

For more information, see: https://github.com/junegunn/fzf

-------------------------------------------------------------------
lyq@mbp ~ % brew install  fzf
==> Downloading https://ghcr.io/v2/homebrew/core/fzf/manifests/0.29.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/fzf/blobs/sha256:dadc361593396ced96c13d3695019a302d124e6cfe8ab6ffe65ba7877025a706
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:dadc361593396ced96c13d3695019a302d124e6cfe8ab6ffe65ba7877025a706?se=2022-02-10T11%3A20%3A00Z&sig=XV5qDWMVAN0nOXIfjnfF4X
######################################################################## 100.0%
==> Pouring fzf--0.29.0.catalina.bottle.tar.gz
==> Caveats
To install useful keybindings and fuzzy completion:
  /usr/local/opt/fzf/install

To use fzf in Vim, add the following line to your .vimrc:
  set rtp+=/usr/local/opt/fzf
==> Summary
🍺  /usr/local/Cellar/fzf/0.29.0: 17 files, 2.6MB
==> Running `brew cleanup fzf`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).