Skip to content

Instantly share code, notes, and snippets.

View yjhjstz's full-sized avatar
🏠
Working from home

Jianghua.yjh yjhjstz

🏠
Working from home
View GitHub Profile
@hewumars
hewumars / 1.md
Last active June 21, 2022 12:26
1. 以图搜图2.0版本方案

以图搜图2.0版本方案

1.以图搜图2.0架构图

先通过 Milvus 进行特征值搜索,返回 top 2048条最相似的记录,然后根据特征值ID从Redis 查出相关联结构化信息,如900记录ID+特征值ID+时间+地点等<120字节,进行二次条件过滤,达到10亿级数据 10秒内返回。

2.以图搜图2.0性能

before

cstore_test=# select product_group, count(*) from customer_reviews group by product_group;
 product_group |  count
---------------+---------
 DVD           |  121418
 Video         |  142235
 Music         |  300628
 Book          | 1198218
@hervenivon
hervenivon / awazon-linux-gdal-installation.sh
Last active April 15, 2022 11:48
Install GEOS, PROJ4 & GDAL on amazon linux
export PYTHON_VERSION=3.4.3
export PYTHON_SHORT_VERSION=3.4
export GEOS_VERSION=3.6.2
export GDAL_VERSION=2.2.2
export PROJ4_VERSION=4.9.3
sudo yum-config-manager --enable epel
sudo yum install gdal-python
sudo yum -y install make automake gcc gcc-c++ libcurl-devel proj-devel geos-devel
@tombigel
tombigel / README.md
Last active May 6, 2024 03:23 — forked from a2ikm/limit.maxfiles.plist
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

@WaterDemo
WaterDemo / epoll.c
Created August 17, 2016 09:02
epoll,服务器,理解
参考博客:http://blog.csdn.net/ljx0305/article/details/4065058
在linux的网络编程中,很长的时间都在使用select来做事件触发。在linux新的内核中,有了一种替换它的机制,就是epoll。
相比于select,epoll最大的好处在于它不会随着监听fd数目的增长而降低效率。因为在内核中的select实现中,它是采用轮询来处理的,轮询的fd数目越多,自然耗时越多。并且,在linux/posix_types.h头文件有这样的声明:
#define __FD_SETSIZE 1024
表示select最多同时监听1024个fd,当然,可以通过修改头文件再重编译内核来扩大这个数目,但这似乎并不治本。
epoll的接口非常简单,一共就三个函数:
1. int epoll_create(int size);
创建一个epoll的句柄,size用来告诉内核这个监听的数目一共有多大。这个参数不同于select()中的第一个参数,给出最大监听的fd+1的值。需要注意的是,当创建好epoll句柄后,它就是会占用一个fd值,在linux下如果查看/proc/进程id/fd/,是能够看到这个fd的,所以在使用完epoll后,必须调用close()关闭,否则可能导致fd被耗尽。
@callmewhy
callmewhy / 000001-上证指数-2000-2015.csv
Created March 17, 2016 07:03
000001-上证指数 2000年~2015年每日数据
date open high close low volume amount
2000-01-04 1368.693 1407.518 1406.371 1361.214 903402300 5801550000
2000-01-05 1407.829 1433.78 1409.682 1398.323 1057998400 8653075000
2000-01-06 1406.036 1463.955 1463.942 1400.253 1348051500 10238351000
2000-01-07 1477.154 1522.825 1516.604 1477.154 3451569900 22007478000
2000-01-10 1531.712 1546.723 1545.112 1506.404 3125353900 20929425000
2000-01-11 1547.678 1547.708 1479.781 1468.757 2192455400 17011469000
2000-01-12 1473.761 1489.28 1438.02 1434.996 1522286900 13360337000
2000-01-13 1437.453 1444.066 1424.442 1418.814 861291200 7797784000
2000-01-14 1426.224 1433.474 1408.848 1401.706 744701200 6558970000
@theirix
theirix / pstack-osx.sh
Created April 7, 2015 08:39
pstack for osx
#!/bin/sh
#
# Script prints gdb stack of the process with a specified pid
if [ -z $1 ]; then
echo "Usage: $0 pid"
exit 1
fi
PID=$1
@benjamingr
benjamingr / gist:0237932cee84712951a2
Last active October 6, 2023 08:31
Promise unhandled rejection tracking global handler hook

Possibly Unhandled Rejection NodeJS Promise Hook

###Unhandled Rejection Tracking

Several promise libraries such as bluebird and when as well as some native promise implementations offer potentially unhandled rejection tracking. This means that the following:

Promise.reject(new Error("err")); // never attach a `catch`
@ipmb
ipmb / ratelimit.nginxconf
Last active April 5, 2024 00:46
Nginx reverse proxy with rate limiting
upstream myapp {
server 127.0.0.1:8081;
}
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
server {
listen 443 ssl spdy;
server_name _;