java zmq发送报错,UnsatisfiedLinkError: org.zeromq.ZMQ$Socket.send([BII)Z?

在尝试在java里使用zmq的时候,调用zmq.socket.send("msg")时爆出了unsatisifiedLinkedError异常,具体报错内容如下

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.zeromq.ZMQ$Socket.send([BII)Z
    at org.zeromq.ZMQ$Socket.send(Native Method)
    at org.zeromq.ZMQ$Socket.send(ZMQ.java:1236)
    at org.zeromq.ZMQ$Socket.sendMore(ZMQ.java:1262)

触发异常的就是一句sendMore或send:

        int i;
        for (i = 0; i < msgParts.length - 1; i++) {
            mSendSocket.sendMore(msgParts[i]);
        }
        mSendSocket.send(msgParts[i]);

socket初始化相关代码如下:

        mContext = ZMQ.context(2);
        String url = "tcp://" + mIp + ":";
        mIdentity = UUID.randomUUID().toString();

        mSendSocket = mContext.socket(ZMQ.PUSH);
        mSendSocket.setLinger(0);
        mSendSocket.connect(url + mPort);

ip和port参数如下:

    private int mPort = 5555;
    private String mIp = "localhost";

看报错是本地方法出错,但是跟踪不下去。
网上搜了半天,360、stackoverflow、google都没找到靠谱的方法。如有大佬解决过此类错误,还请不吝赐教。

qq_37475168
coder_szc 回复FFFFFFFFFFY: https://blog.csdn.net/qq_37475168/article/details/95367712导包部分头两个
3 个月之前 回复
qq_37475168
coder_szc 回复FFFFFFFFFFY: 解决了,把pom依赖修改成下面的样子。可以参见我的文章
3 个月之前 回复
dhj1112
FFFFFFFFFFY 请问你的问题解决了么? 我也被这个问题困扰好久了
3 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
mq: connect exception: WRAP_EXCEPTION
2015-07-13 15:31:27.732 [com.hikvision.cms.zmq.HmqAdapter]-[ERROR](70) Jms connection occur error: javax.jms.JMSException: connect exception: WRAP_EXCEPTION at com.hikvision.zmq.jms.transport.ZmqTransport.handleConnectException(ZmqTransport.java:465) at com.hikvision.zmq.jms.transport.ZmqTransport.receive(ZmqTransport.java:441) at com.hikvision.zmq.jms.transport.ZmqTransport.run(ZmqTransport.java:212) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
Exception in thread "iothread-2"
各位前辈:今天我用ZeroMq发送数据的时候,出现了如题所示的异常。之前一直是正常发送的,但不知道为什么今天就出现了这个异常: Exception in thread "iothread-2" java.lang.NegativeArraySizeException at zmq.Msg.size(Msg.java:141) at zmq.Msg.<init>(Msg.java:62) at zmq.V1Decoder.one_byte_size_ready(V1Decoder.java:69) at zmq.V1Decoder.next(V1Decoder.java:43) at zmq.DecoderBase.process_buffer(DecoderBase.java:128) at zmq.StreamEngine.in_event(StreamEngine.java:271) at zmq.IOObject.in_event(IOObject.java:101) at zmq.Poller.run(Poller.java:220) at java.lang.Thread.run(Thread.java:662) 还望遇到过相关问题或者比较熟悉ZeroMq的兄弟们能够帮助我!感激不尽!
An error ocurred while starting the kernel
正常安装anaconda后打开spyder,右下角控制台出现错误警告; Github上说程序添加进防火墙和杀毒软件,试过了还是无法解决,不知道有没有遇到同样问题的大佬是怎么解决的,请告知我一声,万分感谢! Versions Spyder version: 3.3.3 Python version: 3.7.2 Qt version: 5.9.7 PyQt version: 5.9.2 Operating System name/version: windows 7 IPython >=4.0 : 7.3.0 (OK) cython >=0.21 : 0.29.6 (OK) jedi >=0.9.0 : 0.13.3 (OK) matplotlib >=2.0.0: 3.0.3 (OK) nbconvert >=4.0 : 5.4.1 (OK) numpy >=1.7 : 1.16.2 (OK) pandas >=0.13.1 : 0.24.2 (OK) pycodestyle >=2.3 : 2.5.0 (OK) pyflakes >=0.6.0 : 2.1.1 (OK) pygments >=2.0 : 2.3.1 (OK) pylint >=0.25 : 2.3.1 (OK) qtconsole >=4.2.0 : 4.4.3 (OK) rope >=0.9.4 : 0.12.0 (OK) sphinx >=0.6.6 : 1.8.5 (OK) sympy >=0.7.3 : 1.3 (OK) ``` An error ocurred while starting the kernel The error is: Traceback (most recent call last): File "C:\Anaconda3\lib\site‑packages\traitlets\traitlets.py", line 528, in get value = obj._trait_values[self.name] KeyError: 'context' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Anaconda3\lib\site‑packages\spyder\plugins\ipythonconsole.py", line 1554, in create_kernel_manager_and_kernel_client kernel_manager.start_kernel(stderr=stderr_handle) File "C:\Anaconda3\lib\site‑packages\jupyter_client\manager.py", line 261, in start_kernel self._connect_control_socket() File "C:\Anaconda3\lib\site‑packages\jupyter_client\manager.py", line 210, in _connect_control_socket self._control_socket = self.connect_control() File "C:\Anaconda3\lib\site‑packages\jupyter_client\connect.py", line 571, in connect_control return self._create_connected_socket('control', identity=identity) File "C:\Anaconda3\lib\site‑packages\jupyter_client\connect.py", line 543, in _create_connected_socket sock = self.context.socket(socket_type) File "C:\Anaconda3\lib\site‑packages\traitlets\traitlets.py", line 556, in __get__ return self.get(obj, cls) File "C:\Anaconda3\lib\site‑packages\traitlets\traitlets.py", line 535, in get value = self._validate(obj, dynamic_default()) File "C:\Anaconda3\lib\site‑packages\jupyter_client\manager.py", line 42, in _context_default return zmq.Context.instance() File "C:\Anaconda3\lib\site‑packages\zmq\sugar\context.py", line 108, in instance cls._instance = cls(io_threads=io_threads) File "zmq/backend/cython/context.pyx", line 49, in zmq.backend.cython.context.Context.__cinit__ zmq.error.ZMQError: Bad address ```
go get zeromq4.0.5出现libzmq.pc错误
go get -tags zmq_4_x github.com/alecthomas/gozmq 出现如下错误: # pkg-config --cflags libzmq libzmq libzmq libzmq Package libzmq was not found in the pkg-config search path. Perhaps you should add the directory containing `libzmq.pc' to the PKG_CONFIG_PATH environment variable No package 'libzmq' found Package libzmq was not found in the pkg-config search path. Perhaps you should add the directory containing `libzmq.pc' to the PKG_CONFIG_PATH environment variable No package 'libzmq' found Package libzmq was not found in the pkg-config search path. Perhaps you should add the directory containing `libzmq.pc' to the PKG_CONFIG_PATH environment variable No package 'libzmq' found Package libzmq was not found in the pkg-config search path. Perhaps you should add the directory containing `libzmq.pc' to the PKG_CONFIG_PATH environment variable No package 'libzmq' found pkg-config: exit status 1 操作系统:WIN7 32bit Golang:1.4.1 Zeromq:4.0.5,用的是官方自带windows installer,应该是已经正确安装。 在zeromq的安装目录下面,根本就没找到libzmq.pc文件。看网上说,这个在Linux下面会有,难道说要用go来开发zeromq只能是去Linux下面,不用用window??
卡夫卡kafka消费问题,消费一段时间就会超时 求助原因
``` 80 DEBUG [YyjkStorageKafkaConsumerThread] YyjkStorageKafkaConsumerThread.value:{"tableName":"sw_segment","operateType":"INSERT","operateId":"4921.43.15759673490360004","indexType":"type","storageType":"elasticsearch","date":1575967330707,"tableData":{"trace_id":"4921.43.15759673490360005","endpoint_name":"/v4/default/registry/microservices/b0b6cb4d62e32b56c3bf8cb4bd2b7aed46cdffbe/instances/72abd3701b1811eaa6ea005056b6530b/heartbeat","latency":3,"end_time":1575967349039,"endpoint_id":189076,"service_instance_id":4921,"version":2,"start_time":1575967349036,"data_binary":"Cg0KC7kmK8SNreHuqv8bEsQBEP///////////wEYrLLl9+4tIK+y5ffuLTCUxQtABFABWANgO3oSCgtodHRwLm1ldGhvZBIDUFVUeogBCgN1cmwSgAEvdjQvZGVmYXVsdC9yZWdpc3RyeS9taWNyb3NlcnZpY2VzL2IwYjZjYjRkNjJlMzJiNTZjM2JmOGNiNGJkMmI3YWVkNDZjZGZmYmUvaW5zdGFuY2VzLzcyYWJkMzcwMWIxODExZWFhNmVhMDA1MDU2YjY1MzBiL2hlYXJ0YmVhdBgNILkm","service_id":13,"time_bucket":20191210164229,"is_error":0,"segment_id":"4921.43.15759673490360004"}} 16:40:05,480 DEBUG [YyjkStorageKafkaConsumerThread] YyjkStorageKafkaConsumerThread.FormatData,tableName:sw_segment|operateId:4921.43.15759673490360004|tableMap:{trace_id=4921.43.15759673490360005, endpoint_name=/v4/default/registry/microservices/b0b6cb4d62e32b56c3bf8cb4bd2b7aed46cdffbe/instances/72abd3701b1811eaa6ea005056b6530b/heartbeat, latency=3, end_time=1575967349039, endpoint_id=189076, service_instance_id=4921, version=2, start_time=1575967349036, data_binary=Cg0KC7kmK8SNreHuqv8bEsQBEP///////////wEYrLLl9+4tIK+y5ffuLTCUxQtABFABWANgO3oSCgtodHRwLm1ldGhvZBIDUFVUeogBCgN1cmwSgAEvdjQvZGVmYXVsdC9yZWdpc3RyeS9taWNyb3NlcnZpY2VzL2IwYjZjYjRkNjJlMzJiNTZjM2JmOGNiNGJkMmI3YWVkNDZjZGZmYmUvaW5zdGFuY2VzLzcyYWJkMzcwMWIxODExZWFhNmVhMDA1MDU2YjY1MzBiL2hlYXJ0YmVhdBgNILkm, service_id=13, time_bucket=20191210164229, is_error=0, segment_id=4921.43.15759673490360004} 16:40:05,480 DEBUG [ElasticSearchClient] Executing bulk [32] with 8 requests 16:40:05,481 DEBUG [MainClientExec] [exchange: 44] start execution 16:40:05,481 DEBUG [RequestAddCookies] CookieSpec selected: default 16:40:05,481 DEBUG [RequestAuthCache] Re-using cached 'basic' auth scheme for http://10.23.11.224:9200 16:40:05,481 DEBUG [RequestAuthCache] No credentials for preemptive authentication 16:40:05,481 DEBUG [InternalHttpAsyncClient] [exchange: 44] Request connection for {}->http://10.23.11.224:9200 16:40:05,481 DEBUG [PoolingNHttpClientConnectionManager] Connection request: [route: {}->http://10.23.11.224:9200][total kept alive: 1; route allocated: 1 of 10; total allocated: 1 of 30] 16:40:05,482 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: Set timeout 0 16:40:05,482 DEBUG [PoolingNHttpClientConnectionManager] Connection leased: [id: http-outgoing-0][route: {}->http://10.23.11.224:9200][total kept alive: 0; route allocated: 1 of 10; total allocated: 1 of 30] 16:40:05,482 DEBUG [InternalHttpAsyncClient] [exchange: 44] Connection allocated: CPoolProxy{http-outgoing-0 [ACTIVE]} 16:40:05,482 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: Set attribute http.nio.exchange-handler 16:40:05,482 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:r]: Event set [w] 16:40:05,482 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] Request ready 16:40:05,482 DEBUG [InternalHttpAsyncClient] Connection route already established 16:40:05,482 DEBUG [MainClientExec] [exchange: 44] Attempt 1 to execute request 16:40:05,482 DEBUG [MainClientExec] Target auth state: UNCHALLENGED 16:40:05,482 DEBUG [MainClientExec] Proxy auth state: UNCHALLENGED 16:40:05,482 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:w]: Set timeout 30000 16:40:05,482 DEBUG [headers] http-outgoing-0 >> POST /_bulk?timeout=1m HTTP/1.1 16:40:05,482 DEBUG [headers] http-outgoing-0 >> Content-Length: 6657 16:40:05,482 DEBUG [headers] http-outgoing-0 >> Content-Type: application/json 16:40:05,482 DEBUG [headers] http-outgoing-0 >> Host: 10.23.11.224:9200 16:40:05,482 DEBUG [headers] http-outgoing-0 >> Connection: Keep-Alive 16:40:05,482 DEBUG [headers] http-outgoing-0 >> User-Agent: Apache-HttpAsyncClient/4.1.2 (Java/1.8.0_221) 16:40:05,483 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:w]: Event set [w] 16:40:05,483 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] Output ready 16:40:05,483 DEBUG [MainClientExec] [exchange: 44] produce content 16:40:05,483 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] [content length: 6657; pos: 4096; completed: false] 16:40:05,483 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:w]: 4293 bytes written 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "POST /_bulk?timeout=1m HTTP/1.1[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "Content-Length: 6657[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "Content-Type: application/json[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "Host: 10.23.11.224:9200[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "User-Agent: Apache-HttpAsyncClient/4.1.2 (Java/1.8.0_221)[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.88.15759673496781142"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.88.15759673496781143","endpoint_name":"/authentication","latency":71,"end_time":1575967349749,"endpoint_id":150,"service_instance_id":11,"version":2,"start_time":1575967349678,"data_binary":"CgwKCgtY1oK15O6q/xsS3gEIARivt+X37i0gurfl9+4tMIkBQAVQAVgBYCF6DgoHZGIudHlwZRIDc3FsehsKC2RiLmluc3RhbmNlEgx0eWd6cHRfZHpzd2p6kwEKDGRiLnN0YXRlbWVudBKCAXNlbGVjdCB0LmNoZWNrX3RpbWUsdC5leHRlbmRfaW5mbyx0LnVzZXJfbmFtZSx0LmxvZ2luX2NoYW5uZWwgZnJvbSBzc29fdXNlcl9zZXNzaW9uIHQgd2hlcmUgdC50aWNrZXQgPSA/IGFuZCB0LmxvZ291dF90aW1lIGlzIG51bGwSnAEIAhjGt+X37i0g2Lfl9+4tMJUBQAVQAVgBYCF6DgoHZGIudHlwZRIDc3FsehsKC2RiLmluc3RhbmNlEgx0eWd6cHRfZHpzd2p6UgoMZGIuc3RhdGVtZW50EkJ1cGRhdGUgc3NvX3VzZXJfc2Vzc2lvbiB0IHNldCB0LmV4dGVuZF9pbmZvID0gPyB3aGVyZSB0LnRpY2tldCA9ID8SWAgDGNm35ffuLSDrt+X37i0wlAFABVABWAFgIXoOCgdkYi50eXBlEgNzcWx6GwoLZGIuaW5zdGFuY2USDHR5Z3pwdF9kenN3anoOCgxkYi5zdGF0ZW1lbnQSZhD///////////8BGK635ffuLSD1t+X37i0wlgFYA2ABejAKA3VybBIpaHR0cDovL25zc28uZHpzd2pqYy50YXguY24vYXV0aGVudGljYXRpb256EgoLaHR0cC5tZXRob2QSA0dFVBgMIAs=","service_id":12,"time_bucket":20191210164229,"is_error":0,"segment_id":"11.88.15759673496781142"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"4921.36.15759673457660020"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"4921.36.15759673457660021","endpoint_name":"Mysql/JDBI/PreparedStatement/executeQuery","latency":377,"end_time":1575967346143,"endpoint_id":162,"service_instance_id":4921,"version":2,"start_time":1575967345766,"data_binary":"Cg0KC7kmJPSg4dHuqv8bErYBEP///////////wEY5pjl9+4tIN+b5ffuLTCiAUADUAFYAWAheg4KB2RiLnR5cGUSA3NxbHohCgtkYi5pbnN0YW5jZRISdHlnenB0X2R6c3dqX3d3X2tmel0KDGRiLnN0YXRlbWVudBJNc2VsZWN0ICogZnJvbSBxel9kbWIgd2hlcmUgeHlieiA9ICdZJyBBTkQgeXhieiA9ICdZJyBhbmQgbG93ZXIoY29kZSk9bG93ZXIoPykYDSC5Jg==","service_id":13,"time_bucket":20191210164225,"is_error":0,"segment_id":"4921.36.15759673457660020"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"4921.36.15759673461450022"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"4921.36.15759673461450023","endpoint_name":"Mysql/JDBI/PreparedStatement/executeQuery","latency":69,"end_time":1575967346214,"endpoint_id":162,"service_instance_id":4921,"version":2,"start_time":1575967346145,"data_binary":"Cg0KC7kmJKbKyNPuqv8bErYBEP///////////wEY4Zvl9+4tIKac5ffuLTCiAUADUAFYAWAheg4KB2RiLnR5cGUSA3NxbHohCgtkYi5pbnN0YW5jZRISdHlnenB0X2R6c3dqX3d3X2tmel0KDGRiLnN0YXRlbWVudBJNc2VsZWN0ICogZnJvbSBxel9kbWIgd2hlcmUgeHlieiA9ICdZJyBBTkQgeXhieiA9ICdZJyBhbmQgbG93ZXIoY29kZSk9bG93ZXIoPykYDSC5Jg==","service_id":13,"time_bucket":20191210164226,"is_error":0,"segment_id":"4921.36.15759673461450022"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.37.15759673529984298"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.37.15759673529984299","endpoint_name":"Mysql/JDBI/PreparedStatement/executeQuery","latency":14,"end_time":1575967353012,"endpoint_id":137,"service_instance_id":11,"version":2,"start_time":1575967352998,"data_binary":"CgwKCgslqsqf9O6q/xsSsAEQ////////////ARim0eX37i0gtNHl9+4tMIkBQAVQAVgBYCF6DgoHZGIudHlwZRIDc3FsehsKC2RiLmluc3RhbmNlEgx0eWd6cHRfZHpzd2p6XQoMZGIuc3RhdGVtZW50Ek1zZWxlY3QgKiBmcm9tIHF6X2RtYiB3aGVyZSB4eWJ6ID0gJ1knIEFORCB5eGJ6ID0gJ1knIGFuZCBsb3dlcihjb2RlKT1sb3dlcig/KRgMIAs=","service_id":12,"time_bucket":20191210164232,"is_error":0,"segment_id":"11.37.15759673529984298"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.37.15759673530124300"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.37.15759673530124301","endpoint_name":"Mysql/JDBI/PreparedStatement/executeQuery","latency":12,"end_time":1575967353024,"endpoint_id":137,"service_instance_id":11,"version":2,"start_time":1575967353012,"data_binary":"CgwKCgsljJCo9O6q/xsSsAEQ////////////ARi00eX37i0gwNHl9+4tMIkBQAVQAVgBYCF6DgoHZGIudHlwZRIDc3FsehsKC2RiLmluc3RhbmNlEgx0eWd6cHRfZHpzd2p6XQoMZGIuc3RhdGVtZW50Ek1zZWxlY3QgKiBmcm9tIHF6X2RtYiB3aGVyZSB4eWJ6ID0gJ1knIEFORCB5eGJ6ID0gJ1knIGFuZCBsb3dlcihjb2RlKT1sb3dlcig/KRgMIAs=","service_id":12,"time_bucket":20191210164233,"is_error":0,"segment_id":"11.37.15759673530124300"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.47.15759673539631576"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.47.15759673539631577","endpoint_name":"/v4/default/registry/mi" 16:40:05,483 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] Output ready 16:40:05,483 DEBUG [MainClientExec] [exchange: 44] produce content 16:40:05,483 DEBUG [MainClientExec] [exchange: 44] Request completed 16:40:05,484 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] [content length: 6657; pos: 6657; completed: true] 16:40:05,484 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:w]: 2561 bytes written 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "croservices/62af8840312c4750370c3ea64fd68203bf02d518/instances/1563e3d11a5f11eabd58005056b67cc4/heartbeat","latency":2,"end_time":1575967353965,"endpoint_id":146,"service_instance_id":11,"version":2,"start_time":1575967353963,"data_binary":"CgwKCgsv2LPs+O6q/xsSwwEQ////////////ARjr2OX37i0g7djl9+4tMJIBQAdQAVgDYDt6EgoLaHR0cC5tZXRob2QSA1BVVHqIAQoDdXJsEoABL3Y0L2RlZmF1bHQvcmVnaXN0cnkvbWljcm9zZXJ2aWNlcy82MmFmODg0MDMxMmM0NzUwMzcwYzNlYTY0ZmQ2ODIwM2JmMDJkNTE4L2luc3RhbmNlcy8xNTYzZTNkMTFhNWYxMWVhYmQ1ODAwNTA1NmI2N2NjNC9oZWFydGJlYXQYDCAL","service_id":12,"time_bucket":20191210164233,"is_error":0,"segment_id":"11.47.15759673539631576"}[\n]" 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.47.15759673539651578"}}[\n]" 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.47.15759673539631577","endpoint_name":"#/v4/default/registry/microservices/62af8840312c4750370c3ea64fd68203bf02d518/instances/1563e3d11a5f11eabd58005056b67cc4/heartbeat","latency":0,"end_time":1575967353965,"endpoint_id":147,"service_instance_id":11,"version":2,"start_time":1575967353965,"data_binary":"CgwKCgsv+s/t+O6q/xsSwAMQ////////////ARjt2OX37i0g7djl9+4tKpoCCAESDAoKCy/Ys+z47qr/GyALOAtCgAEvdjQvZGVmYXVsdC9yZWdpc3RyeS9taWNyb3NlcnZpY2VzLzYyYWY4ODQwMzEyYzQ3NTAzNzBjM2VhNjRmZDY4MjAzYmYwMmQ1MTgvaW5zdGFuY2VzLzE1NjNlM2QxMWE1ZjExZWFiZDU4MDA1MDU2YjY3Y2M0L2hlYXJ0YmVhdFKAAS92NC9kZWZhdWx0L3JlZ2lzdHJ5L21pY3Jvc2VydmljZXMvNjJhZjg4NDAzMTJjNDc1MDM3MGMzZWE2NGZkNjgyMDNiZjAyZDUxOC9pbnN0YW5jZXMvMTU2M2UzZDExYTVmMTFlYWJkNTgwMDUwNTZiNjdjYzQvaGVhcnRiZWF0OoEBIy92NC9kZWZhdWx0L3JlZ2lzdHJ5L21pY3Jvc2VydmljZXMvNjJhZjg4NDAzMTJjNDc1MDM3MGMzZWE2NGZkNjgyMDNiZjAyZDUxOC9pbnN0YW5jZXMvMTU2M2UzZDExYTVmMTFlYWJkNTgwMDUwNTZiNjdjYzQvaGVhcnRiZWF0UAJYA2A7GAwgCw==","service_id":12,"time_bucket":20191210164233,"is_error":0,"segment_id":"11.47.15759673539651578"}[\n]" 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"4921.43.15759673490360004"}}[\n]" 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"4921.43.15759673490360005","endpoint_name":"/v4/default/registry/microservices/b0b6cb4d62e32b56c3bf8cb4bd2b7aed46cdffbe/instances/72abd3701b1811eaa6ea005056b6530b/heartbeat","latency":3,"end_time":1575967349039,"endpoint_id":189076,"service_instance_id":4921,"version":2,"start_time":1575967349036,"data_binary":"Cg0KC7kmK8SNreHuqv8bEsQBEP///////////wEYrLLl9+4tIK+y5ffuLTCUxQtABFABWANgO3oSCgtodHRwLm1ldGhvZBIDUFVUeogBCgN1cmwSgAEvdjQvZGVmYXVsdC9yZWdpc3RyeS9taWNyb3NlcnZpY2VzL2IwYjZjYjRkNjJlMzJiNTZjM2JmOGNiNGJkMmI3YWVkNDZjZGZmYmUvaW5zdGFuY2VzLzcyYWJkMzcwMWIxODExZWFhNmVhMDA1MDU2YjY1MzBiL2hlYXJ0YmVhdBgNILkm","service_id":13,"time_bucket":20191210164229,"is_error":0,"segment_id":"4921.43.15759673490360004"}[\n]" 16:40:05,484 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] Request ready 16:40:05,484 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:w]: Event cleared [w] 16:40:06,073 DEBUG [FetchSessionHandler] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Node 0 sent an incremental fetch response for session 520315326 with 0 response partition(s), 1 implied partition(s) 16:40:07,365 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: 1460 bytes read 16:40:07,365 DEBUG [wire] http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]" 16:40:07,365 DEBUG [wire] http-outgoing-0 << "content-type: application/json; charset=UTF-8[\r][\n]" 16:40:07,365 DEBUG [wire] http-outgoing-0 << "content-length: 3697[\r][\n]" 16:40:07,365 DEBUG [wire] http-outgoing-0 << "[\r][\n]" 16:40:07,365 DEBUG [wire] http-outgoing-0 << "{"took":1872,"errors":true,"items":[{"index":{"_index":"sw_segment","_type":"type","_id":"11.88.15759673496781142","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"4921.36.15759673457660020","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"4921.36.15759673461450022","_version":1,"result":"created","_shards"" 16:40:07,365 DEBUG [headers] http-outgoing-0 << HTTP/1.1 200 OK 16:40:07,365 DEBUG [headers] http-outgoing-0 << content-type: application/json; charset=UTF-8 16:40:07,365 DEBUG [headers] http-outgoing-0 << content-length: 3697 16:40:07,365 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE(1372)] Response received 16:40:07,365 DEBUG [MainClientExec] [exchange: 44] Response received HTTP/1.1 200 OK 16:40:07,365 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE(1372)] Input ready 16:40:07,365 DEBUG [MainClientExec] [exchange: 44] Consume content 16:40:07,365 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: 2325 bytes read 16:40:07,365 DEBUG [wire] http-outgoing-0 << ":{"total":1,"successful":1,"failed":0},"_seq_no":24332,"_primary_term":1,"status":201}},{"index":{"_index":"sw_segment","_type":"type","_id":"11.37.15759673529984298","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"11.37.15759673530124300","_version":1,"result":"created","_shards":{"total":1,"successful":1,"failed":0},"_seq_no":24333,"_primary_term":1,"status":201}},{"index":{"_index":"sw_segment","_type":"type","_id":"11.47.15759673539631576","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"11.47.15759673539651578","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"4921.43.15759673490360004","_version":1,"result":"created","_shards":{"total":1,"successful":1,"failed":0},"_seq_no":24334,"_primary_term":1,"status":201}}]}" 16:40:07,365 DEBUG [InternalHttpAsyncClient] [exchange: 44] Connection can be kept alive indefinitely 16:40:07,365 DEBUG [MainClientExec] [exchange: 44] Response processed 16:40:07,365 DEBUG [InternalHttpAsyncClient] [exchange: 44] releasing connection 16:40:07,365 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: Remove attribute http.nio.exchange-handler 16:40:07,365 DEBUG [PoolingNHttpClientConnectionManager] Releasing connection: [id: http-outgoing-0][route: {}->http://10.23.11.224:9200][total kept alive: 0; route allocated: 1 of 10; total allocated: 1 of 30] 16:40:07,365 DEBUG [PoolingNHttpClientConnectionManager] Connection [id: http-outgoing-0][route: {}->http://10.23.11.224:9200] can be kept alive indefinitely 16:40:07,365 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: Set timeout 0 16:40:07,365 DEBUG [PoolingNHttpClientConnectionManager] Connection released: [id: http-outgoing-0][route: {}->http://10.23.11.224:9200][total kept alive: 1; route allocated: 1 of 10; total allocated: 1 of 30] 16:40:07,367 DEBUG [RestClient] request [POST http://10.23.11.224:9200/_bulk?timeout=1m] returned [HTTP/1.1 200 OK] 16:40:07,367 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] [content length: 3697; pos: 3697; completed: true] 16:40:08,187 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:40:08,389 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 16:40:11,203 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:40:11,404 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 16:40:14,221 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:41:20,774 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 16:41:23,589 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:41:23,790 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response actCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 16:41:38,665 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:41:38,867 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 17:13:13,402 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 17:13:13,605 DEBUG [NetworkClient] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Node -1 disconnected. 17:13:13,606 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 17:13:13,707 DEBUG [NetworkClient] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending metadata request (type=MetadataRequest, topics=compute_traceStorage, allowAutoCreate=true) to node 10.23.11.235:9092 (id: 0 rack: null) 17:13:13,907 DEBUG [Metadata] Updating last seen epoch from 0 to 0 for partition compute_traceStorage-0 17:13:13,907 DEBUG [Metadata] Updated cluster metadata version 4 to MetadataCache{cluster=Cluster(id = yQ_sRlMlSui8hlVtaPl4wg, nodes = [10.23.11.235:9092 (id: 0 rack: null)], partitions = [Partition(topic = compute_traceStorage, partition = 0, leader = 0, replicas = [0], isr = [0], offlineReplicas = [])], controller = 10.23.11.235:9092 (id: 0 rack: null))} 17:13:16,420 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 17:13:16, 17:15:02,170 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 17:15:04,683 WARN [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] This member will leave the group because consumer poll timeout has expired. This means the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time processing messages. You can address this either by increasing max.poll.interval.ms or by reducing the maximum size of batches returned in poll() with max.poll.records. 17:15:04,683 INFO [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Member consumer-1-f8b4d0da-f83c-4849-8cfd-74e748aad3c7 sending LeaveGroup request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 17:15:04,683 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Disabling heartbeat thread ```
The troubles of lmy 程序的实现
Problem Description Lmy is the lovely cousin of zmq, and she’s a junior high school student. One day she came back from school. Zmq: What did you learn in your class today? Lmy: Similar triangle. Zmq: Well, fine, have you mastered it? Lmy: Sure, that’s a piece of cake. Zmq: OK, well, let me test you to see whether you have thoroughly understood the conception of being similar. I’ll draw two Arbitrary Polygons, and you have to tell me whether they are similar or not. If you are right, I’ll take you out. Lmy: …… It seems that little lmy got into troubles. Can you help her out by designing a program? Input There are several test cases in the input. The first line of each case is an n (n <= 300), indicating that each polygon has n points. And in the following 2n lines, each line represents a point. The first n point represents the first polygon in anti-clockwise order, and so the second. Please note that all the polygons are simple. You can try to rotate them, then tell whether they are similar or not. Output For each case, output “Yes” or “No”, showing whether they are similar. Sample Input 3 0 0 1 1 0 1 0 0 2 2 0 2 3 0 0 1 1 0 1 0 0 2 2 0 1 Sample Output Yes No
Mac symbol(s) not found for architecture x86_64 ?
Mac编译 symbol(s) not found for architecture x86_64 ?修改 uname Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64 gcc -lncurses -o "veto_mq_server" ./src/veto_mq_server.o Undefined symbols for architecture x86_64: "_zmq_bind", referenced from: _main in veto_mq_server.o "_zmq_ctx_new", referenced from: _main in veto_mq_server.o "_zmq_recv", referenced from: _main in veto_mq_server.o "_zmq_send", referenced from: _main in veto_mq_server.o "_zmq_socket", referenced from: _main in veto_mq_server.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 引用了第三方库ZMQ /usr/local/include/ -rw-r--r--@ 1 root admin 844 Mar 10 15:00 zmq_utils.h -rw-r--r--@ 1 root admin 16613 Mar 10 15:00 zmq.h /usr/local/lib/ lrwxr-xr-x 1 yanrui admin 43 Mar 18 2015 libzmq.4.dylib -> ../Cellar/zeromq/4.0.5_2/lib/libzmq.4.dylib -rwxr-xr-x 1 root admin 958 Mar 10 15:00 libzmq.la lrwxr-xr-x 1 root admin 14 Mar 10 15:00 libzmq.dylib -> libzmq.5.dylib -rw-r--r-- 1 root admin 23545352 Mar 10 15:00 libzmq.a -rwxr-xr-x 1 root admin 602308 Mar 10 15:00 libzmq.5.dylib ![图片说明](https://img-ask.csdn.net/upload/201603/11/1457661164_327576.png)
zmq发送几次数据后出现严重错误
大侠在否?求助: 多进程模型的程序中调用了libzmq的 zmq_send_msg接口,发送几次数据后异常段错误了。下面是程序错误的调用堆栈,烦请高手指教问题何在? TRACE: rsasd: serving taskid 9() [0x12000ec80] TRACE: rsasd: serving taskid 9(sighand_segv+0x60) [0x12000edb8] TRACE: /lib/libpthread.so.0(+0x190e0) [0x20000bd10e0] TRACE: /opt/aurora/lib/libzmq.so.5(+0x5ae50) [0x20000b22e50] TRACE: /opt/aurora/lib/libzmq.so.5(zmq_msg_send+0x3c) [0x20000b4c2fc] TRACE: /opt/aurora/lib/libzmq.so.5(zmq_sendmsg+0x24) [0x20000b4c3f4] TRACE: rsasd: serving taskid 9() [0x12001040c] TRACE: rsasd: serving taskid 9() [0x120011368] TRACE: rsasd: serving taskid 9(hosts_zmq_read_data+0x3f4) [0x12001239c] TRACE: rsasd: serving taskid 9(hosts_read+0x50) [0x120012f3c] TRACE: rsasd: serving taskid 9(attack_network+0x4e8) [0x12000c7c0] TRACE: rsasd: serving taskid 9() [0x1200186ac] TRACE: rsasd: serving taskid 9(create_process+0x1bc) [0x12000f0dc] TRACE: rsasd: serving taskid 9() [0x120018e70] TRACE: rsasd: serving taskid 9(main+0xa84) [0x12001a22c] TRACE: /lib/libc.so.6.1(__libc_start_main+0x124) [0x20000d5e034] TRACE: rsasd: serving taskid 9(_start+0x38) [0x120008478]
Delphi 使用ZMQ2.2.0.0版本,pub端发布数据,sub连接后内存一直增长
pub和sub在不同电脑上,sub不接收数据,只connect还是一直在增长,最后释放 zmq上下文,socket 内存也会降下来! ![图片说明](https://img-ask.csdn.net/upload/201809/13/1536832304_60798.png)
在运行lightLDA时出现断言错误,错误如下有大神指教吗?
``` Assertion failed in file src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c at line 591: hdr.pkt_type == MPIDI_NEM_TCP_SOCKSM_PKT_ID_INFO || hdr.pkt_type == MPIDI_NEM_TCP_SOCKSM_PKT_TMPVC_INFO internal ABORT - process 2 terminate called after throwing an instance of 'zmq::error_t' what(): Context was terminated ```
zeromq 服务端多线程在数据量大一点的情况下出现问题,跪求大神解答
zeromq 服务端开启了20个线程,客服端会发送6000个请求过来; 在处理1000个请求的时候,速度很快,一口气就跑完了, 在处理一千到三千的请求的时候,中间总是停一会,跑一会, 到了三千以后停的时间越来越长,到四千左右就不动了. 有时候会报"gc开销过大",调了gc之后.还是没有多大的作用, 但是呢:当我把服务端的线程只开启一个的时候,就能顺利跑完, 下面是服务端的代码 ``` /** * 多线程 NLP 服务器 */ public class mtserver { /*默认为20个NLP线程*/ static Integer WORKERNUM = 20; private static class HeronlpWorker extends Thread { private ZContext context; private MyUncaughtExceptionhandler myUncaughtException; public void setMyUncaughtException(MyUncaughtExceptionhandler myUncaughtException) { this.myUncaughtException = myUncaughtException; } private HeronlpWorker(ZContext context) { this.context = context; } @Override public void run() { Socket socket = context.createSocket(SocketType.REP); myUncaughtException.setSkt(socket); socket.connect("inproc://workers"); HeroNLP heroNLP = new HeroNLP(); String result = null; String msgType = ""; while (true) { try { //接收命令 String command = socket.recvStr(0).trim(); System.out.println(Thread.currentThread().getName() + " Received request: [" + command + "]"); String content = null; switch (command){ //分词 case "SEGMENT": content = socket.recvStr(0).trim(); List<Term> terms = NLP.segment(content); result = listToString(terms, " "); break; default: while (socket.hasReceiveMore()){ socket.recvStr(0).trim(); } result = "FAILED: 未匹配到命令!"; break; } } catch (Exception e) { result = "FAILED:" + e.getMessage(); } // 给客户端返回结果(C字符串) System.out.println("是否有异常: " + result.contains("FAILED:")); if(result.contains("FAILED:")){ msgType = "FAILED"; } socket.send(msgType, 2); socket.send(result, 0); } } } public static void main(String[] args) { try (ZContext context = new ZContext()) { //前端--router Socket clients = context.createSocket(SocketType.ROUTER); boolean bind = clients.bind("tcp://*:9002"); //后端--dealer Socket workers = context.createSocket(SocketType.DEALER); workers.bind("inproc://workers"); //后端启动20个服务线程 for (int thread_nbr = 0; thread_nbr < WORKERNUM; thread_nbr++) { Thread nlpworker = new HeronlpWorker(context); MyUncaughtExceptionhandler myUncaughtExceptionhandler = new MyUncaughtExceptionhandler(); ((HeronlpWorker) nlpworker).setMyUncaughtException(myUncaughtExceptionhandler); nlpworker.setUncaughtExceptionHandler(myUncaughtExceptionhandler); nlpworker.start(); } ZMQ.proxy(clients, workers, null); } } ```
tensorflow的InvalidArgumentError报错问题(placeholder)
书上的一个实例,不知道为什么报错。请各位大神帮忙解答一下。 程序如下: from tensorflow.examples.tutorials.mnist import input_data mnist=input_data.read_data_sets("MNIST_data/",one_hot=True) print(mnist.train.images.shape,mnist.train.labels.shape) print(mnist.test.images.shape,mnist.test.labels.shape) print(mnist.validation.images.shape,mnist.validation.labels.shape) import tensorflow as tf sess=tf.InteractiveSession() x=tf.placeholder(tf.float32,[None,784]) W=tf.Variable(tf.zeros([784,10])) b=tf.Variable(tf.zeros([10])) y=tf.nn.softmax(tf.matmul(x,W)+b) y_=tf.placeholder(tf.float32,[None,10]) cross_entropy=tf.reduce_mean(-tf.reduce_sum(y_* tf.log(y),reduction_indices=[1])) train_step=tf.train.GradientDescentOptimizer(0.5).minimize(cross_entropy) tf.global_variables_initializer().run() for i in range(1000): batch_xs,batch_ys=mnist.train.next_batch(100) train_step.run({x:batch_xs,y_:batch_ys}) correct_prediction=tf.equal(tf.argmax(y,1),tf.argmax(y_,1)) accuracy=tf.reduce_mean(tf.cast(correct_prediction,tf.float32)) print(accuracy.eval({x:mnist.test.images,y:mnist.test.labels})) 报错如下: runfile('D:/project/Spyder/MNIST_data.py', wdir='D:/project/Spyder') Extracting MNIST_data/train-images-idx3-ubyte.gz Extracting MNIST_data/train-labels-idx1-ubyte.gz Extracting MNIST_data/t10k-images-idx3-ubyte.gz Extracting MNIST_data/t10k-labels-idx1-ubyte.gz (55000, 784) (55000, 10) (10000, 784) (10000, 10) (5000, 784) (5000, 10) D:\soft\Anaconda3\lib\site-packages\tensorflow\python\client\session.py:1645: UserWarning: An interactive session is already active. This can cause out-of-memory errors in some cases. You must explicitly call `InteractiveSession.close()` to release resources held by the other session(s). warnings.warn('An interactive session is already active. This can ' Traceback (most recent call last): File "<ipython-input-2-3b25b2404fa0>", line 1, in <module> runfile('D:/project/Spyder/MNIST_data.py', wdir='D:/project/Spyder') File "D:\soft\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile execfile(filename, namespace) File "D:\soft\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "D:/project/Spyder/MNIST_data.py", line 29, in <module> print(accuracy.eval({x:mnist.test.images,y:mnist.test.labels})) File "D:\soft\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 680, in eval return _eval_using_default_session(self, feed_dict, self.graph, session) File "D:\soft\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 4951, in _eval_using_default_session return session.run(tensors, feed_dict) File "D:\soft\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 877, in run run_metadata_ptr) File "D:\soft\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1100, in _run feed_dict_tensor, options, run_metadata) File "D:\soft\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1272, in _do_run run_metadata) File "D:\soft\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1291, in _do_call raise type(e)(node_def, op, message) InvalidArgumentError: You must feed a value for placeholder tensor 'Placeholder_3' with dtype float and shape [?,10] [[Node: Placeholder_3 = Placeholder[dtype=DT_FLOAT, shape=[?,10], _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]] [[Node: Mean_3/_29 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_18_Mean_3", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]] Caused by op 'Placeholder_3', defined at: File "D:\soft\Anaconda3\lib\site-packages\spyder\utils\ipython\start_kernel.py", line 268, in <module> main() File "D:\soft\Anaconda3\lib\site-packages\spyder\utils\ipython\start_kernel.py", line 264, in main kernel.start() File "D:\soft\Anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 478, in start self.io_loop.start() File "D:\soft\Anaconda3\lib\site-packages\zmq\eventloop\ioloop.py", line 177, in start super(ZMQIOLoop, self).start() File "D:\soft\Anaconda3\lib\site-packages\tornado\ioloop.py", line 888, in start handler_func(fd_obj, events) File "D:\soft\Anaconda3\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper return fn(*args, **kwargs) File "D:\soft\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 440, in _handle_events self._handle_recv() File "D:\soft\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 472, in _handle_recv self._run_callback(callback, msg) File "D:\soft\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 414, in _run_callback callback(*args, **kwargs) File "D:\soft\Anaconda3\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper return fn(*args, **kwargs) File "D:\soft\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 283, in dispatcher return self.dispatch_shell(stream, msg) File "D:\soft\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 233, in dispatch_shell handler(stream, idents, msg) File "D:\soft\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 399, in execute_request user_expressions, allow_stdin) File "D:\soft\Anaconda3\lib\site-packages\ipykernel\ipkernel.py", line 208, in do_execute res = shell.run_cell(code, store_history=store_history, silent=silent) File "D:\soft\Anaconda3\lib\site-packages\ipykernel\zmqshell.py", line 537, in run_cell return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs) File "D:\soft\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2728, in run_cell interactivity=interactivity, compiler=compiler, result=result) File "D:\soft\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2856, in run_ast_nodes if self.run_code(code, result): File "D:\soft\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2910, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-2-3b25b2404fa0>", line 1, in <module> runfile('D:/project/Spyder/MNIST_data.py', wdir='D:/project/Spyder') File "D:\soft\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile execfile(filename, namespace) File "D:\soft\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "D:/project/Spyder/MNIST_data.py", line 20, in <module> y_=tf.placeholder(tf.float32,[None,10]) File "D:\soft\Anaconda3\lib\site-packages\tensorflow\python\ops\array_ops.py", line 1735, in placeholder return gen_array_ops.placeholder(dtype=dtype, shape=shape, name=name) File "D:\soft\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_array_ops.py", line 5928, in placeholder "Placeholder", dtype=dtype, shape=shape, name=name) File "D:\soft\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "D:\soft\Anaconda3\lib\site-packages\tensorflow\python\util\deprecation.py", line 454, in new_func return func(*args, **kwargs) File "D:\soft\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 3155, in create_op op_def=op_def) File "D:\soft\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1717, in __init__ self._traceback = tf_stack.extract_stack() InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'Placeholder_3' with dtype float and shape [?,10] [[Node: Placeholder_3 = Placeholder[dtype=DT_FLOAT, shape=[?,10], _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]] [[Node: Mean_3/_29 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_18_Mean_3", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
zeromq socket网络传递结构体
我在服务器端发了一个结构体,在client端接收,发送应该是正常的,客户端也接到了这个数据但是一访问成员变量就segment fault,zeromq 接收到在zmq::msg_t中有个size()函数返回接收到数据的size 我比对了一下是对的上的 但是一访问成员变量就出错,觉得很奇怪,应该是会编译器以及结构体的存储有关,本人新手,求各位大神指点一二 有分
The troubles of lmy C程序的编写技术
Problem Description Lmy is the lovely cousin of zmq, and she’s a junior high school student. One day she came back from school. Zmq: What did you learn in your class today? Lmy: Similar triangle. Zmq: Well, fine, have you mastered it? Lmy: Sure, that’s a piece of cake. Zmq: OK, well, let me test you to see whether you have thoroughly understood the conception of being similar. I’ll draw two Arbitrary Polygons, and you have to tell me whether they are similar or not. If you are right, I’ll take you out. Lmy: …… It seems that little lmy got into troubles. Can you help her out by designing a program? Input There are several test cases in the input. The first line of each case is an n (n <= 300), indicating that each polygon has n points. And in the following 2n lines, each line represents a point. The first n point represents the first polygon in anti-clockwise order, and so the second. Please note that all the polygons are simple. You can try to rotate them, then tell whether they are similar or not. Output For each case, output “Yes” or “No”, showing whether they are similar. Sample Input 3 0 0 1 1 0 1 0 0 2 2 0 2 3 0 0 1 1 0 1 0 0 2 2 0 1 Sample Output Yes NoThe troubles of lmy
ZMQ通讯,在多对多模式中,如何指定地址发送?
假如有a,b,c,d四个客户端通过zmq连接到服务器 服务端用一个zmq_socket 接受4个客户端的信息,那么服务端在返回消息的时候,是 如何指定客户端发送呢? zmq_send函数中,没有指定地址。难道他是广播出去的?
在cmd中安装jupyter出错
在安装requests和beautifulsoup4时没有问题,安装jupyter也没有报错, 然后打开jupyter notebook时就报错 ``` Traceback (most recent call last): File "c:\pa_worm\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\pa_worm\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "c:\pa_worm\Scripts\jupyter-notebook.EXE\__main__.py", line 5, in <module> File "c:\pa_worm\lib\site-packages\notebook\notebookapp.py", line 47, in <module> from zmq.eventloop import ioloop File "c:\pa_worm\lib\site-packages\zmq\__init__.py", line 47, in <module> from zmq import backend File "c:\pa_worm\lib\site-packages\zmq\backend\__init__.py", line 40, in <module> reraise(*exc_info) File "c:\pa_worm\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise raise value File "c:\pa_worm\lib\site-packages\zmq\backend\__init__.py", line 27, in <module> _ns = select_backend(first) File "c:\pa_worm\lib\site-packages\zmq\backend\select.py", line 27, in select_backend mod = __import__(name, fromlist=public_api) File "c:\pa_worm\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module> from . import (constants, error, message, context, ImportError: DLL load failed: 找不到指定的模块。 ``` 看不懂这是什么原因有人遇到过这种情况吗
关于ruby的问题,如何按时间发送命令。
这是一个关于ruby的问题。其中一段代码如下。 ``` def switch_output(option_json) log_debug("switch_output command invoked") return send_command({command: "startNewOutputFile"}) end ``` 我需要把这个地方,改成每10分钟发送一次命令(command)。 ``` send_command({command: "startNewOutputFile"}) ``` 我问了原代码的作者,他给的建议如下。 My suggestion is for you to take a look at above daq.rb and learn how to connect to MessageServer via ZeroMQ in Ruby or Python, and then send the startNewOutputFile command at a rate you want (e.g. 1/600 Hz). 我建议您查看上面的daq.rb并了解如何通过Ruby或Python中的ZeroMQ连接到MessageServer,然后以您想要的时间速率发送startNewOutputFile命令(例如1/600 Hz)。 请各位大神帮助。 全部代码如下,文件名是dap.rb,需要改动的地方在最后。 ``` require "rbczmq" require "json" require "yaml" require "socket" require "growth_controller/logger" require "growth_controller/controller_module" module GROWTH class ControllerModuleDAQ < ControllerModule # TCP port number of growth_daq ZeroMQ server DAQ_ZMQ_PORT_NUMBER = 10020 def initialize(name, zmq_context, logger: nil) super(name, logger: logger) define_command("ping") define_command("stop") define_command("pause") define_command("resume") define_command("status") define_command("switch_output") @context = zmq_context connect() end private def connect() log_info("Connecting to DAQ ZeroMQ server...") @requester = @context.socket(ZMQ::REQ) begin @requester.connect("tcp://localhost:#{DAQ_ZMQ_PORT_NUMBER}") @requester.rcvtimeo = 1000 @requester.sndtimeo = 1000 log_info("Connected to DAQ ZeroMQ server") rescue log_error("Connection failed. It seems the DAQ program is not running") @requester = nil end end private def send_command(hash) # Connect if necessary if(@requester == nil)then connect() end if(@requester == nil)then return {status: "error", message: "Could not connect to DAQ ZeroMQ server"} end begin @requester.send(hash.to_json.to_s) rescue => e @requester.close @requester = nil log_warn("send_command() returning error (#{e})") return {status: "error", message: "ZeroMQ send failed (#{e})"} end return receive_reply() end private def receive_reply() begin reply_message = @requester.recv() return JSON.parse(reply_message) rescue => e @requester.close @requester = nil log_warn("receive_reply() returning error (#{e})") return {status: "error", message: "ZeroMQ communication failed (#{e}"} end end #--------------------------------------------- # Implemented commands #--------------------------------------------- def ping(option_json) log_debug("ping command invoked") return send_command({command: "ping"}) end def stop(option_json) log_debug("stop command invoked") return send_command({command: "stop"}) end def pause(option_json) log_debug("pause command invoked") return send_command({command: "pause"}) end def resume(option_json) log_debug("resume command invoked") return send_command({command: "resume"}) end def status(optionJSON) log_debug("status command invoked") return send_command({command: "getStatus"}) end def switch_output(option_json) log_debug("switch_output command invoked") return send_command({command: "startNewOutputFile"}) end end end ```
相似性的判断算法,输出相似性判定,怎么采用C语言的程序的代码编写的方式来实现的
Problem Description Lmy is the lovely cousin of zmq, and she’s a junior high school student. One day she came back from school. Zmq: What did you learn in your class today? Lmy: Similar triangle. Zmq: Well, fine, have you mastered it? Lmy: Sure, that’s a piece of cake. Zmq: OK, well, let me test you to see whether you have thoroughly understood the conception of being similar. I’ll draw two Arbitrary Polygons, and you have to tell me whether they are similar or not. If you are right, I’ll take you out. Lmy: …… It seems that little lmy got into troubles. Can you help her out by designing a program? Input There are several test cases in the input. The first line of each case is an n (n <= 300), indicating that each polygon has n points. And in the following 2n lines, each line represents a point. The first n point represents the first polygon in anti-clockwise order, and so the second. Please note that all the polygons are simple. You can try to rotate them, then tell whether they are similar or not. Output For each case, output “Yes” or “No”, showing whether they are similar. Sample Input 3 0 0 1 1 0 1 0 0 2 2 0 2 3 0 0 1 1 0 1 0 0 2 2 0 1 Sample Output Yes No
The troubles of lmy
Problem Description Lmy is the lovely cousin of zmq, and she’s a junior high school student. One day she came back from school. Zmq: What did you learn in your class today? Lmy: Similar triangle. Zmq: Well, fine, have you mastered it? Lmy: Sure, that’s a piece of cake. Zmq: OK, well, let me test you to see whether you have thoroughly understood the conception of being similar. I’ll draw two Arbitrary Polygons, and you have to tell me whether they are similar or not. If you are right, I’ll take you out. Lmy: …… It seems that little lmy got into troubles. Can you help her out by designing a program? Input There are several test cases in the input. The first line of each case is an n (n <= 300), indicating that each polygon has n points. And in the following 2n lines, each line represents a point. The first n point represents the first polygon in anti-clockwise order, and so the second. Please note that all the polygons are simple. You can try to rotate them, then tell whether they are similar or not. Output For each case, output “Yes” or “No”, showing whether they are similar. Sample Input 3 0 0 1 1 0 1 0 0 2 2 0 2 3 0 0 1 1 0 1 0 0 2 2 0 1 Sample Output Yes No
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
使用 Docker 部署 Spring Boot 项目
Docker 技术发展为微服务落地提供了更加便利的环境,使用 Docker 部署 Spring Boot 其实非常简单,这篇文章我们就来简单学习下。首先构建一个简单的 S...
英特尔不为人知的 B 面
从 PC 时代至今,众人只知在 CPU、GPU、XPU、制程、工艺等战场中,英特尔在与同行硬件芯片制造商们的竞争中杀出重围,且在不断的成长进化中,成为全球知名的半导体公司。殊不知,在「刚硬」的背后,英特尔「柔性」的软件早已经做到了全方位的支持与支撑,并持续发挥独特的生态价值,推动产业合作共赢。 而对于这一不知人知的 B 面,很多人将其称之为英特尔隐形的翅膀,虽低调,但是影响力却不容小觑。 那么,在...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
刷了几千道算法题,这些我私藏的刷题网站都在这里了!
遥想当年,机缘巧合入了 ACM 的坑,周边巨擘林立,从此过上了"天天被虐似死狗"的生活… 然而我是谁,我可是死狗中的战斗鸡,智力不够那刷题来凑,开始了夜以继日哼哧哼哧刷题的日子,从此"读题与提交齐飞, AC 与 WA 一色 ",我惊喜的发现被题虐既刺激又有快感,那一刻我泪流满面。这么好的事儿作为一个正直的人绝不能自己独享,经过激烈的颅内斗争,我决定把我私藏的十几个 T 的,阿不,十几个刷题网...
白话阿里巴巴Java开发手册高级篇
不久前,阿里巴巴发布了《阿里巴巴Java开发手册》,总结了阿里巴巴内部实际项目开发过程中开发人员应该遵守的研发流程规范,这些流程规范在一定程度上能够保证最终的项目交付质量,通过在时间中总结模式,并推广给广大开发人员,来避免研发人员在实践中容易犯的错误,确保最终在大规模协作的项目中达成既定目标。 无独有偶,笔者去年在公司里负责升级和制定研发流程、设计模板、设计标准、代码标准等规范,并在实际工作中进行...
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
redis分布式锁,面试官请随便问,我都会
文章有点长并且绕,先来个图片缓冲下! 前言 现在的业务场景越来越复杂,使用的架构也就越来越复杂,分布式、高并发已经是业务要求的常态。像腾讯系的不少服务,还有CDN优化、异地多备份等处理。 说到分布式,就必然涉及到分布式锁的概念,如何保证不同机器不同线程的分布式锁同步呢? 实现要点 互斥性,同一时刻,智能有一个客户端持有锁。 防止死锁发生,如果持有锁的客户端崩溃没有主动释放锁,也要保证锁可以正常释...
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
Nginx 原理和架构
Nginx 是一个免费的,开源的,高性能的 HTTP 服务器和反向代理,以及 IMAP / POP3 代理服务器。Nginx 以其高性能,稳定性,丰富的功能,简单的配置和低资源消耗而闻名。 Nginx 的整体架构 Nginx 里有一个 master 进程和多个 worker 进程。master 进程并不处理网络请求,主要负责调度工作进程:加载配置、启动工作进程及非停升级。worker 进程负责处...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
Java世界最常用的工具类库
Apache Commons Apache Commons有很多子项目 Google Guava 参考博客
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下...
为什么要学数据结构?
一、前言 在可视化化程序设计的今天,借助于集成开发环境可以很快地生成程序,程序设计不再是计算机专业人员的专利。很多人认为,只要掌握几种开发工具就可以成为编程高手,其实,这是一种误解。要想成为一个专业的开发人员,至少需要以下三个条件: 1) 能够熟练地选择和设计各种数据结构和算法 2) 至少要能够熟练地掌握一门程序设计语言 3) 熟知所涉及的相关应用领域的知识 其中,后两个条件比较容易实现,而第一个...
Android 9.0 init 启动流程
阅读五分钟,每日十点,和您一起终身学习,这里是程序员Android本篇文章主要介绍Android开发中的部分知识点,通过阅读本篇文章,您将收获以下内容:一、启动流程概述一、 启动流程概述Android启动流程跟Linux启动类似,大致分为如下五个阶段。1.开机上电,加载固化的ROM。2.加载BootLoader,拉起Android OS。3.加载Uboot,初始外设,引导Kernel启动等。...
相关热词 c# plc s1200 c#里氏转换原则 c# 主界面 c# do loop c#存为组套 模板 c# 停掉协程 c# rgb 读取图片 c# 图片颜色调整 最快 c#多张图片上传 c#密封类与密封方法
立即提问