linux executable函数导出问题

linux x-executable可以像动态库一样导出函数吗?
如果不能那node c++ addon在linux下又是怎么做到的。
其实很简单,就是一个选项而已。

2个回答

我已经解决了。可以关闭了。
很简单只是自己不知道而已。就是一个编译选项问题而已。谢谢你了。

linux下面可执行,动态库等都是一样的elf格式,都可以看到各种函数,objdump等

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
使用CLion遇到的问题 multiple definition of `main' ld returned 1 exit status
![图片说明](https://img-ask.csdn.net/upload/202001/09/1578585095_670327.png) [ 33%] Linking CXX executable untitled.exe CMakeFiles\untitled.dir/objects.a(test.cpp.obj): In function `main': C:/Users/Lee/CLionProjects/untitled/test.cpp:2: multiple definition of `main' CMakeFiles\untitled.dir/objects.a(main.cpp.obj):C:/Users/Lee/CLionProjects/untitled/main.cpp:3: first defined here collect2.exe: error: ld returned 1 exit status mingw32-make.exe[3]: *** [CMakeFiles\untitled.dir\build.make:100: untitled.exe] Error 1 mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:75: CMakeFiles/untitled.dir/all] Error 2 mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:82: CMakeFiles/untitled.dir/rule] Error 2 mingw32-make.exe: *** [Makefile:117: untitled] Error 2 最开始是Cmake有问题 用大佬帖子里的方法改了系统文件夹名字之后好了 然鹅 不知道是什么情况 麻烦大佬们帮忙看看
用linux安装软件出现的问题 ERROR: Exception: Traceback (most recent call last)
edx@ubuntu:~$ git clone https://github.com/kan-bayashi/PytorchWaveNetVocoder.git 正克隆到 'PytorchWaveNetVocoder'... remote: Enumerating objects: 330, done. remote: Counting objects: 100% (330/330), done. remote: Compressing objects: 100% (159/159), done. remote: Total 2328 (delta 220), reused 258 (delta 171), pack-reused 1998 接收对象中: 100% (2328/2328), 436.01 KiB | 736.00 KiB/s, 完成. 处理 delta 中: 100% (1436/1436), 完成. edx@ubuntu:~$ cd PytorchWaveNetVocoder/tools edx@ubuntu:~/PytorchWaveNetVocoder/tools$ make test -d venv || virtualenv -p python3.6 venv Running virtualenv with interpreter /usr/bin/python3.6 Using base prefix '/usr' New python executable in /home/edx/PytorchWaveNetVocoder/tools/venv/bin/python3.6 Also creating executable in /home/edx/PytorchWaveNetVocoder/tools/venv/bin/python Installing setuptools, pkg_resources, pip, wheel...done. . venv/bin/activate && pip install --upgrade pip Requirement already up-to-date: pip in ./venv/lib/python3.6/site-packages (19.3.1) . venv/bin/activate && cd ../ && pip install torch==1.0.1 torchvision==0.2.2 Collecting torch==1.0.1 Downloading https://files.pythonhosted.org/packages/f7/92/1ae072a56665e36e81046d5fb8a2f39c7728c25c21df1777486c49b179ae/torch-1.0.1-cp36-cp36m-manylinux1_x86_64.whl (560.0MB) |████████████████████████████████| 560.0MB 98kB/s eta 0:00:01ERROR: Exception: Traceback (most recent call last): File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 153, in _main status = self.run(options, args) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 382, in run resolver.resolve(requirement_set) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 201, in resolve self._resolve_one(requirement_set, req) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 365, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 313, in _get_abstract_dist_for req, self.session, self.finder, self.require_hashes File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 194, in prepare_linked_requirement progress_bar=self.progress_bar File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_internal/download.py", line 465, in unpack_url progress_bar=progress_bar File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_internal/download.py", line 316, in unpack_http_url progress_bar) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_internal/download.py", line 551, in _download_http_url _download_url(resp, link, content_file, hashes, progress_bar) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_internal/download.py", line 253, in _download_url hashes.check_against_chunks(downloaded_chunks) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_internal/utils/hashes.py", line 80, in check_against_chunks for chunk in chunks: File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_internal/download.py", line 223, in written_chunks for chunk in chunks: File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_internal/utils/ui.py", line 160, in iter for x in it: File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_internal/download.py", line 212, in resp_read decode_content=False): File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 564, in stream data = self.read(amt=amt, decode_content=decode_content) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 507, in read data = self._fp.read(amt) if not fp_closed else b"" File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 65, in read self._close() File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 52, in _close self.__callback(self.__buf.getvalue()) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_vendor/cachecontrol/controller.py", line 300, in cache_response cache_url, self.serializer.dumps(request, response, body=body) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_vendor/cachecontrol/serialize.py", line 72, in dumps return b",".join([b"cc=4", msgpack.dumps(data, use_bin_type=True)]) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/__init__.py", line 46, in packb return Packer(**kwargs).pack(o) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/fallback.py", line 900, in pack self._pack(obj) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/fallback.py", line 891, in _pack nest_limit - 1) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/fallback.py", line 985, in _pack_map_pairs self._pack(v, nest_limit - 1) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/fallback.py", line 891, in _pack nest_limit - 1) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/fallback.py", line 984, in _pack_map_pairs self._pack(k, nest_limit - 1) File "/home/edx/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/fallback.py", line 847, in _pack return self._buffer.write(obj) MemoryError Makefile:6: recipe for target 'venv/bin/activate' failed make: *** [venv/bin/activate] Error 2 这是运行出来的错误 ,因为时第一次使用,所以没有看懂什么意思,想求助大佬们,怎么解决![图片说明](https://img-ask.csdn.net/upload/201911/07/1573114791_122624.png)这是代码运行make的文件程序
2019年12月6日,运行selenium报错,selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH.
2019年12月6日,google chrome浏览器 80.0.3970.5(正式版本),下载webdriver版本对应版本没有,然后下载了对应版本的浏览器,把驱动放在python 环境中,同时放在浏览器安装 路径,同时配置了环境变量以后运行报错!
使用execv执行shell命令,报错:libdl.so.2 not find
最近开发中遇到一个问题: 在Android4.4系统中,底层使用execv函数发送shell命令,例如“mount -o rw,remount /tvconfig”,可以正常使用 可是最近做Android8.0项目,使用execv会报“CANNOT LINK EXECUTABLE "crash_dump32":library"libdl.so.2" not found”的错误,换system执行不报错但是没有效果,用popen执行也是这个错误,求大神解答
Django后台管理新建post保存出错
报错如下 TypeError at /admin/blog/post/add/ object of type 'int' has no len() Request Method: POST Request URL: http://127.0.0.1:8000/admin/blog/post/add/ Django Version: 3.0.1 Exception Type: TypeError Exception Value: object of type 'int' has no len() Exception Location: C:\Users\Administrator\Desktop\website\djangoenv\lib\site-packages\django\forms\models.py in has_changed, line 1354 Python Executable: C:\Users\Administrator\Desktop\website\djangoenv\Scripts\python.exe Python Version: 3.6.5 Python Path: ['C:\\Users\\Administrator\\Desktop\\website\\blog2020', 'C:\\Users\\Administrator\\Desktop\\website\\djangoenv\\Scripts\\python36.zip', 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python36-32\\DLLs', 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python36-32\\lib', 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python36-32', 'C:\\Users\\Administrator\\Desktop\\website\\djangoenv', 'C:\\Users\\Administrator\\Desktop\\website\\djangoenv\\lib\\site-packages'] Server time: 星期一, 6 一月 2020 15:56:18 +0800 源代码 def has_changed(self, initial, data): if self.disabled: return False if initial is None: initial = [] if data is None: data = [] if len(initial) != len(data): return True initial_set = {str(value) for value in self.prepare_value(initial)} data_set = {str(value) for value in data} return data_set != initial_set
有大神能帮帮分析一下蓝屏代码吗?
No .natvis files found at C:\Windows\SYSTEM32\Visualizers. No .natvis files found at C:\Users\HR\AppData\Local\Dbg\Visualizers. Microsoft (R) Windows Debugger Version 10.0.18362.1 X86 Copyright (c) Microsoft Corporation. All rights reserved. Loading Dump File [C:\Users\HR\Desktop\010320-9796-01.dmp] Mini Kernel Dump File: Only registers and stack trace are available Symbol search path is: srv* Executable search path is: Unable to load image ntoskrnl.exe, Win32 error 0n2 *** WARNING: Unable to verify timestamp for ntoskrnl.exe ************************************************************************* *** *** *** *** *** Either you specified an unqualified symbol, or your debugger *** *** doesn't have full symbol information. Unqualified symbol *** *** resolution is turned off by default. Please either specify a *** *** fully qualified symbol module!symbolname, or enable resolution *** *** of unqualified symbols by typing ".symopt- 100". Note that *** *** enabling unqualified symbol resolution with network symbol *** *** server shares in the symbol path may cause the debugger to *** *** appear to hang for long periods of time when an incorrect *** *** symbol name is typed or the network symbol server is down. *** *** *** *** For some commands to work properly, your symbol path *** *** must point to .pdb files that have full type information. *** *** *** *** Certain .pdb files (such as the public OS symbols) do not *** *** contain the required information. Contact the group that *** *** provided you with these symbols if you need this command to *** *** work. *** *** *** *** Type referenced: nt!_MMPTE_TRANSITION *** *** *** ************************************************************************* Windows 10 Kernel Version 18362 MP (4 procs) Free x86 compatible Product: WinNt, suite: TerminalServer SingleUserTS Machine Name: Kernel base = 0x82600000 PsLoadedModuleList = 0x828b86f8 Debug session time: Fri Jan 3 14:34:43.891 2020 (UTC + 8:00) System Uptime: 0 days 2:48:45.619 Unable to load image ntoskrnl.exe, Win32 error 0n2 *** WARNING: Unable to verify timestamp for ntoskrnl.exe ************************************************************************* *** *** *** *** *** Either you specified an unqualified symbol, or your debugger *** *** doesn't have full symbol information. Unqualified symbol *** *** resolution is turned off by default. Please either specify a *** *** fully qualified symbol module!symbolname, or enable resolution *** *** of unqualified symbols by typing ".symopt- 100". Note that *** *** enabling unqualified symbol resolution with network symbol *** *** server shares in the symbol path may cause the debugger to *** *** appear to hang for long periods of time when an incorrect *** *** symbol name is typed or the network symbol server is down. *** *** *** *** For some commands to work properly, your symbol path *** *** must point to .pdb files that have full type information. *** *** *** *** Certain .pdb files (such as the public OS symbols) do not *** *** contain the required information. Contact the group that *** *** provided you with these symbols if you need this command to *** *** work. *** *** *** *** Type referenced: nt!_MMPTE_TRANSITION *** *** *** ************************************************************************* Loading Kernel Symbols ............................................................... ................................................................ .................................................. Loading User Symbols Loading unloaded module list ......... ************* Symbol Loading Error Summary ************** Module name Error ntoskrnl The system cannot find the file specified You can troubleshoot most symbol related issues by turning on symbol loading diagnostics (!sym noisy) and repeating the command that caused symbols to be loaded. You should also verify that your symbol search path (.sympath) is correct. For analysis of this file, run !analyze -v
/usr/bin/ld: cannot find -lOPTIONS 无法找到OPTIONS库。
我在UBUNTU 18.04 下用CUDA 10.2 和 C++11标准编译一个较大的工程。 Makefile 是用CMAKE文件生成的。当我在terminal完成编译时显示了如下错误: ``` /usr/bin/ld: cannot find -lOPTIONS collect2: error: ld returned 1 exit status CMakeFiles/cuda_othermain.dir/build.make:132: recipe for target 'bin/cuda_othermain' failed make[2]: *** [bin/cuda_othermain] Error 1 CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/cuda_othermain.dir/all' failed make[1]: *** [CMakeFiles/cuda_othermain.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 ``` 提示是找不到一个叫OPTIONS的库。我的camke和源码里都没有链接这个库,而且我在网上搜索也根本没有一个库叫做OPTIONS。我很疑惑,编译工程时没有显示任何其他错误,顶多就是有几个warning,我查了一下都是没有太大关系的。所以现在没有什么思路去解决这个问题。 所以想请教一下各位有没有什么解决思路。 CMAKE文件如下: ``` cmake_minimum_required (VERSION 3.8 FATAL_ERROR) #project (cusam_cuda) project(cusam_cuda LANGUAGES C CXX CUDA) find_package(CUDA 10.2 REQUIRED) set(CUDA_NVCC_FLAGS -std=c++11 -L/usr/local/cuda-10.2/lib64 -lcudart -lcuda) set(CMAKE_CXX_STANDARD 11) if (CUDA_VERBOSE_PTXAS) set(VERBOSE_PTXAS --ptxas-options=-v) endif (CUDA_VERBOSE_PTXAS) #set(CMAKE_BUILD_TYPE "Release") set(CMAKE_BUILD_TYPE "Debug") SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CUDA_NVCC_FLAGS} -O0 -Wall -g -ggdb") SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CUDA_NVCC_FLAGS} -O3 -Wall") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(GENCODE_SM30 -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_30,code=compute_30) set(GENCODE_SM35 -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_35,code=compute_35) set(GENCODE_SM37 -gencode=arch=compute_37,code=sm_37 -gencode=arch=compute_37,code=compute_37) set(GENCODE_SM50 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_50,code=compute_50) set(GENCODE_SM60 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_60,code=compute_60) set(GENCODE_SM61 -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_61,code=compute_61) set(GENCODE_SM70 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_70,code=compute_70) set(GENCODE_SM71 -gencode=arch=compute_71,code=sm_71 -gencode=arch=compute_71,code=compute_71) set(GENCODE_SM75 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_75,code=compute_75) option(CUDAMATRIX_GENCODE_SM30 "GENCODE_SM30" OFF) option(CUDAMATRIX_GENCODE_SM35 "GENCODE_SM35" ON) option(CUDAMATRIX_GENCODE_SM37 "GENCODE_SM37" OFF) option(CUDAMATRIX_GENCODE_SM50 "GENCODE_SM50" OFF) option(CUDAMATRIX_GENCODE_SM60 "GENCODE_SM60" OFF) option(CUDAMATRIX_GENCODE_SM61 "GENCODE_SM61" OFF) option(CUDAMATRIX_GENCODE_SM70 "GENCODE_SM70" OFF) option(CUDAMATRIX_GENCODE_SM71 "GENCODE_SM71" OFF) option(CUDAMATRIX_GENCODE_SM75 "GENCODE_SM75" OFF) if (CUDAMATRIX_GENCODE_SM37) set(GENCODE ${GENCODE} ${GENCODE_SM37}) endif(CUDAMATRIX_GENCODE_SM37) if (CUDAMATRIX_GENCODE_SM50) set(GENCODE ${GENCODE} ${GENCODE_SM50}) endif(CUDAMATRIX_GENCODE_SM50) if (CUDAMATRIX_GENCODE_SM60) set(GENCODE ${GENCODE} ${GENCODE_SM60}) endif(CUDAMATRIX_GENCODE_SM60) if (CUDAMATRIX_GENCODE_SM61) set(GENCODE ${GENCODE} ${GENCODE_SM61}) endif(CUDAMATRIX_GENCODE_SM61) if (CUDAMATRIX_GENCODE_SM70) set(GENCODE ${GENCODE} ${GENCODE_SM70}) endif(CUDAMATRIX_GENCODE_SM70) if(CUDAMATRIX_GENCODE_SM71) set(GENCODE ${GENCODE} ${GENCODE_SM71}) endif(CUDAMATRIX_GENCODE_SM71) if(CUDAMATRIX_GENCODE_SM75) set(GENCODE ${GENCODE} ${GENCODE_SM75}) endif(CUDAMATRIX_GENCODE_SM75) include_directories(/usr/local/cuda/include) include_directories(utils) #include_directories(3rdparty/googletest/googletest) #include_directories(3rdparty/googletest/googletest/include) #add_subdirectory(3rdparty/googletest/googletest googletest.out) add_subdirectory(geometry) add_subdirectory(navigation) add_subdirectory(3rdparty) add_subdirectory(nonlinear) add_subdirectory(inference) add_subdirectory(mat) add_subdirectory(miniblas) add_subdirectory(miniblas/cblas) add_subdirectory(miniblas/blas) add_subdirectory(miniblas/permutation) add_subdirectory(miniblas/sys) add_subdirectory(miniblas/linalg) add_subdirectory(linear) #add_subdirectory(test) #cuda_add_executable(imukittiexamplegps_gaussiannewton imukittiexamplegps_gaussiannewton.cpp # OPTIONS ${GENCODE} ${CUDA_VERBOSE_PTXAS}) #target_link_libraries(imukittiexamplegps_gaussiannewton geometry miniblas blas cblas linalg permutation sys navigation 3rdparty linear nonlinear inference mat) #cuda_add_executable(othermain othermain.cpp # OPTIONS ${GENCODE} ${CUDA_VERBOSE_PTXAS}) #target_link_libraries(othermain geometry miniblas blas cblas linalg permutation sys navigation 3rdparty linear nonlinear inference mat) target_compile_features(nonlinear PUBLIC cxx_std_11) cuda_add_executable(cuda_othermain cuda_othermain.cu OPTIONS ${GENCODE} ${CUDA_VERBOSE_PTXAS}) target_compile_features(cuda_othermain PUBLIC cxx_std_11) set_target_properties(cuda_othermain PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_link_libraries(cuda_othermain geometry miniblas blas cblas linalg permutation sys navigation 3rdparty linear nonlinear inference mat) ``` 源代码就没发帖了,因为工程还算比较大。有劳各位了。
gdb调试任何C语言代码都报错:not in executable format: File format not recognized
gdb调试任何C语言代码都无法识别 GNU gdb (GDB) Red Hat Enterprise Linux (7.2-90.el6) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. (gdb) file ./main.cc "/backup/workspace/mysql-5.7.25/sql/main.cc": not in executable format: File format not recognized (gdb)
linux使用clion进行c++和python的交叉编译,无法导入python的第三方库
在ubuntu14.04下使用clion进行c++调用python编写的模块,当python中import第三方库(如numpy时),出现错误。具体如下: 这是我的代码: cmakelist: ``` cmake_minimum_required(VERSION 3.5) project(image_pretreat) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -util -ldl -pthread") # 添加Python.h头文件路径 include_directories(/home/neil/.pyenv/versions/3.6.4/include/python3.6m) # 添加python动态链接库文件目录 link_directories(/home/neil/.pyenv/versions/3.6.4/lib/python3.6/config-3.6m-x86_64-linux-gnu) set(SOURCE_FILES main.cpp) add_executable(image_pretreat ${SOURCE_FILES}) # 依赖库文件 target_link_libraries(image_pretreat libpython3.6m.a) target_link_libraries(image_pretreat ${CMAKE_DL_LIBS}) target_link_libraries(image_pretreat util) ``` main函数 ``` #include <Python.h> #include <iostream> using namespace std; int main() { Py_Initialize(); //声明python对象(模型、函数、参数、返回值) PyObject *pModule, *pFunction, *pArgs, *pRetValue; PyRun_SimpleString("import sys"); PyRun_SimpleString("sys.path.append('/home/neil/ClionProjects/image_pretreat')"); //调用python模块 pModule = PyImport_ImportModule("test123"); if (!pModule) { printf("import python failed!!\n"); return -1; } //调用python模块中的函数 pFunction = PyObject_GetAttrString(pModule, "add"); if (!pFunction) { printf("get python function failed!!!\n"); return -1; } //新建python元组对象 pArgs = PyTuple_New(2); PyTuple_SetItem(pArgs, 0, Py_BuildValue("i", 1)); PyTuple_SetItem(pArgs, 1, Py_BuildValue("i", 2)); int r1,r2; r1=r2=0; pRetValue=PyObject_CallObject(pFunction, pArgs); PyArg_ParseTuple(pRetValue, "i|i", &r1, &r2); printf("%d,%d",r1,r2); //关闭 Python 脚本解释器 Py_Finalize(); return 0; } ``` Python模块 ``` import numpy as np def add(a,b): return a+b,a-b ``` 报错: import python failed!! Process finished with exit code 255 已采取方法: 1、将python3.6各个路径都包含进了PYTHONPATH和PYTHONHOME环境变量 2、主函数中手动设置py_SetPythonhome函数
Ubuntu18.04配置OPENCV3.3.1时make报错
在给Ubuntu18.04下载编译openCV3.3.1时, 参照https://blog.csdn.net/zhaoxr233/article/details/90036824 在做到make那一步时,报了以下error,在网上查询无果,不知如何解决,烦请各位大佬指点 ``` Linking CXX executable ../../bin/opencv_visualisation ../../lib/libopencv_core.a(hal_internal.cpp.o):在函数‘lapack_gemm32f(float const*, unsigned long, float const*, unsigned long, float, float const*, unsigned long, float, float*, unsigned long, int, int, int, int)’中: hal_internal.cpp:(.text._Z14lapack_gemm32fPKfmS0_mfS0_mfPfmiiii+0x3d2):对‘cblas_sgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, float, float const*, int, float const*, int, float, float*, int)’未定义的引用 ............ ../../lib/libopencv_core.a(hal_internal.cpp.o):在函数‘lapack_gemm64fc(double const*, unsigned long, double const*, unsigned long, double, double const*, unsigned long, double, double*, unsigned long, int, int, int, int)’中: hal_internal.cpp:(.text._Z15lapack_gemm64fcPKdmS0_mdS0_mdPdmiiii+0x29e):对‘cblas_zgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, void const*, void const*, int, void const*, int, void const*, void*, int)’未定义的引用 hal_internal.cpp:(.text._Z15lapack_gemm64fcPKdmS0_mdS0_mdPdmiiii+0x2f5):对‘cblas_cgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, void const*, void const*, int, void const*, int, void const*, void*, int)’未定义的引用 collect2: error: ld returned 1 exit status apps/annotation/CMakeFiles/opencv_annotation.dir/build.make:119: recipe for target 'bin/opencv_annotation' failed make[2]: *** [bin/opencv_annotation] Error 1 CMakeFiles/Makefile2:4522: recipe for target 'apps/annotation/CMakeFiles/opencv_annotation.dir/all' failed make[1]: *** [apps/annotation/CMakeFiles/opencv_annotation.dir/all] Error 2 ```
【已经解决】 Win10环境下采用CMake编译OpenCV项目,提示无法找到opencv
1. 安装过OpenCV 4.1 win pack版本,同时安装的Intel Sensor SDK第三方软件中有opencv 3.4版本。 都按照操作要求添加了环境变量路径。 2. 采用CMake编译一个文件出现一直提示错误,这个错误应该是很多人都遇到过的。 CMakeLists.txt文件内容如下: cmake_minimum_required(VERSION 3.10) project(CvTrack) set(CMAKE_BUILD_TYPE Debug) set(OpenCV_DIR "D:/opencv/build") find_package(OpenCV REQUIRED) add_executable(CvTracking "main.cpp") target_link_libraries(CvTrack ${OpenCV_LIBS}) ********************************************************************************************************************************************************** 产生的错误提示: Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18362. OpenCV ARCH: x86 OpenCV RUNTIME: vc14 OpenCV STATIC: OFF CMake Warning at D:/opencv/build/OpenCVConfig.cmake:166 (message): Found OpenCV Windows Pack but it has no binaries compatible with your configuration. You should manually point CMake variable OpenCV_DIR to your build of OpenCV library. Call Stack (most recent call first): CMakeLists.txt:15 (find_package) CMake Error at CMakeLists.txt:15 (find_package): Found package configuration file: D:/opencv/build/OpenCVConfig.cmake but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND. ![图片说明](https://img-ask.csdn.net/upload/201912/09/1575860198_340992.png) 安装目录如下: ![图片说明](https://img-ask.csdn.net/upload/201912/09/1575860277_399662.png) ![图片说明](https://img-ask.csdn.net/upload/201912/09/1575860289_707476.png) 请问,这个问题如何解决呢?? /==/==/==/==/==/==/==/==/==/==/==/==/==/==/==/==/==/== 解决方法: 主要原因:根据提示,OpenCVConfig.cmake文件有问题;实际在OpenCV 4.1 wind pack安装版本中,OpenCVConfig.cmake在其它路径下也有一个文件,修改路径即。 其次原因:设定的工程名为CvTrack,在add\_excuatable中的TargetName不对应。所以:重新修正了一下CMakeLists.txt: cmake_minimum_required(VERSION 3.10) project(CvTrack) set(OpenCV_DIR "D:/opencv/build/x64/vc15/lib") # 错误修正 find_package(OpenCV REQUIRED) include_directories(${OpenCV_INCLUDE_DIRS}) add_executable(CvTrack "main.cpp") # 错误修正 target_link_libraries(CvTrack ${OpenCV_LIBS})
Linux系统swftools工具pdf转swf遇到的问题
Linux系统中下载了swftools-0.9.2.tar.gz这个工具,但是安装之后执行pdf2swf,系统提示无法找到文件。然后我发现bin目录下没有pdf2swf这个文件,安装包解压之后,系统自动配置完成,png2swf、font2swf这些文件都有,唯独类型为executable的pdf2swf文件没有,真是奇怪了。不清楚问题在哪里,请高手帮忙分析一下。 ![图片说明](https://img-ask.csdn.net/upload/201505/28/1432777386_294658.png)
一个简单的CMakeLists语法问题
``` cmake_minimum_required( VERSION 2.8 ) project ( code_test ) set( CMAKE_CXX_COMPILER "g++" ) set( CMAKE_BUILD_TYPE "Debug" ) set( CMAKE_CXX_FLAGS "-std=c++11 -O0" ) include_directories( /home/lihua/anaconda3/include/python3.7m ) link_directories( /home/lihua/anaconda3/lib ) target_link_libraries(code_test libpython3.7m.so ) add_executable( run_test test.cpp ) target_link_libraries(run_test code_test) ``` 编译的时候在target_link_libraries为什么会报下面这个错误: Cannot specify link libraries for target "code_test" which is not built by this project.
Typescript声明文件中怎么做到可以静态调用接口中的函数
我在阅读commander模块的声明文件,在代码底部export导出的部分中,声明文件将一个接口导出,commander/typings/index.d.ts的代码如下 ```typescript // Type definitions for commander 2.11 // Project: https://github.com/visionmedia/commander.js // Definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped ///<reference types="node" /> declare namespace local { class Option { flags: string; required: boolean; optional: boolean; bool: boolean; short?: string; long: string; description: string; /** * Initialize a new `Option` with the given `flags` and `description`. * * @param {string} flags * @param {string} [description] */ constructor(flags: string, description?: string); } class Command extends NodeJS.EventEmitter { [key: string]: any; args: string[]; /** * Initialize a new `Command`. * * @param {string} [name] */ constructor(name?: string); /** * Set the program version to `str`. * * This method auto-registers the "-V, --version" flag * which will print the version number when passed. * * You can optionally supply the flags and description to override the defaults. * */ version(str: string, flags?: string, description?: string): Command; /** * Define a command, implemented using an action handler. * * @remarks * The command description is supplied using `.description`, not as a parameter to `.command`. * * @example * ```ts * program * .command('clone <source> [destination]') * .description('clone a repository into a newly created directory') * .action((source, destination) => { * console.log('clone command called'); * }); * ``` * * @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...` * @param opts - configuration options * @returns new command */ command(nameAndArgs: string, opts?: commander.CommandOptions): Command; /** * Define a command, implemented in a separate executable file. * * @remarks * The command description is supplied as the second parameter to `.command`. * * @example * ```ts * program * .command('start <service>', 'start named service') * .command('stop [service]', 'stop named serice, or all if no name supplied'); * ``` * * @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...` * @param description - description of executable command * @param opts - configuration options * @returns top level command for chaining more command definitions */ command(nameAndArgs: string, description: string, opts?: commander.CommandOptions): Command; /** * Define argument syntax for the top-level command. * * @param {string} desc * @returns {Command} for chaining */ arguments(desc: string): Command; /** * Parse expected `args`. * * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. * * @param {string[]} args * @returns {Command} for chaining */ parseExpectedArgs(args: string[]): Command; /** * Register callback `fn` for the command. * * @example * program * .command('help') * .description('display verbose help') * .action(function() { * // output help here * }); * * @param {(...args: any[]) => void} fn * @returns {Command} for chaining */ action(fn: (...args: any[]) => void): Command; /** * Define option with `flags`, `description` and optional * coercion `fn`. * * The `flags` string should contain both the short and long flags, * separated by comma, a pipe or space. The following are all valid * all will output this way when `--help` is used. * * "-p, --pepper" * "-p|--pepper" * "-p --pepper" * * @example * // simple boolean defaulting to false * program.option('-p, --pepper', 'add pepper'); * * --pepper * program.pepper * // => Boolean * * // simple boolean defaulting to true * program.option('-C, --no-cheese', 'remove cheese'); * * program.cheese * // => true * * --no-cheese * program.cheese * // => false * * // required argument * program.option('-C, --chdir <path>', 'change the working directory'); * * --chdir /tmp * program.chdir * // => "/tmp" * * // optional argument * program.option('-c, --cheese [type]', 'add cheese [marble]'); * * @param {string} flags * @param {string} [description] * @param {((arg1: any, arg2: any) => void) | RegExp} [fn] function or default * @param {*} [defaultValue] * @returns {Command} for chaining */ option(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command; option(flags: string, description?: string, defaultValue?: any): Command; /** * Allow unknown options on the command line. * * @param {boolean} [arg] if `true` or omitted, no error will be thrown for unknown options. * @returns {Command} for chaining */ allowUnknownOption(arg?: boolean): Command; /** * Parse `argv`, settings options and invoking commands when defined. * * @param {string[]} argv * @returns {Command} for chaining */ parse(argv: string[]): Command; /** * Parse options from `argv` returning `argv` void of these options. * * @param {string[]} argv * @returns {ParseOptionsResult} */ parseOptions(argv: string[]): commander.ParseOptionsResult; /** * Return an object containing options as key-value pairs * * @returns {{[key: string]: any}} */ opts(): { [key: string]: any }; /** * Set the description to `str`. * * @param {string} str * @param {{[argName: string]: string}} argsDescription * @return {(Command | string)} */ description(str: string, argsDescription?: {[argName: string]: string}): Command; description(): string; /** * Set an alias for the command. * * @param {string} alias * @return {(Command | string)} */ alias(alias: string): Command; alias(): string; /** * Set or get the command usage. * * @param {string} str * @return {(Command | string)} */ usage(str: string): Command; usage(): string; /** * Set the name of the command. * * @param {string} str * @return {Command} */ name(str: string): Command; /** * Get the name of the command. * * @return {string} */ name(): string; /** * Output help information for this command. * * When listener(s) are available for the helpLongFlag * those callbacks are invoked. * * @param {(str: string) => string} [cb] */ outputHelp(cb?: (str: string) => string): void; /** * You can pass in flags and a description to override the help * flags and help description for your command. */ helpOption(flags?: string, description?: string): Command; /** * Output help information and exit. */ help(cb?: (str: string) => string): never; } } declare namespace commander { type Command = local.Command type Option = local.Option interface CommandOptions { noHelp?: boolean; isDefault?: boolean; } interface ParseOptionsResult { args: string[]; unknown: string[]; } interface CommanderStatic extends Command { Command: typeof local.Command; Option: typeof local.Option; CommandOptions: CommandOptions; ParseOptionsResult: ParseOptionsResult; } } declare const commander: commander.CommanderStatic; export = commander; ``` 我们在调用这个库的时候是这么调用的 ```typescript import commander = require('commander'); commander.version("1.1.0").option("-d --debug","example"); ``` 为什么?导出的是一个接口,为什么能调用这些函数????具体的查看nodejs的commander包总的声明文件
pyinstaller打包selenium出错,exe文件也没有生成?求解?谢谢!
``` 97 INFO: PyInstaller: 3.5 97 INFO: Python: 3.7.4 100 INFO: Platform: Windows-10-10.0.18362-SP0 102 INFO: wrote C:\Users\WHL\Desktop\nike\own\nike.spec 'upx' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 125 INFO: UPX is not available. 127 INFO: Extending PYTHONPATH with paths ['C:\\Users\\WHL\\Desktop\\nike\\own', 'C:\\Users\\WHL\\Desktop\\nike\\own'] 127 INFO: checking Analysis 129 INFO: Building Analysis because Analysis-00.toc is non existent 130 INFO: Initializing module dependency graph... 136 INFO: Initializing module graph hooks... 138 INFO: Analyzing base_library.zip ... 3393 INFO: running Analysis Analysis-00.toc 3396 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable required by c:\users\whl\appdata\local\programs\python\python37\python.exe 3764 INFO: Caching module hooks... 3771 INFO: Analyzing C:\Users\WHL\Desktop\nike\own\nike.py 4416 INFO: Processing pre-safe import module hook urllib3.packages.six.moves pre-safe-import-module hook failed, needs fixing. ```
The Eclipse executable launcher was unable to locate its companion shared libra
The Eclipse executable launcher was unable to locate its companion shared library. 偶 ubuntu 下 apt-get install eclipse 了 eclipse ,然后用 apt-get remove eclipse 删除,同时把 /etc 下面的 eclipse.ini ,以及 /usr/lib/eclipse 下剩余文件都删除了,问题来了,重新用 apt-get install eclipse 安装,启动时提示以上错误,我查了一下,/etc 下面的 ini 不见了,我自己做了一个放上去,启动eclipse还是那个错误, 有谁比较了解 linux 下 eclipse 启动过程的,帮我!!!
linux内核编译报错,求指点?
下载了linux内核源码,然后make allnoconfig进行编译报错,但是libc.a 是存在的啊 root@ubuntu:/home/tangjian/SG13225146/linux-3.9.4# make allnoconfig HOSTCC scripts/basic/fixdep /usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie collect2: error: ld returned 1 exit status scripts/Makefile.host:118: recipe for target 'scripts/basic/fixdep' failed make[1]: *** [scripts/basic/fixdep] Error 1 Makefile:419: recipe for target 'scripts_basic' failed make: *** [scripts_basic] Error 2
最近windowsServer2008服务器总是报错重启,有没有大神能帮忙分析下dmp文件?
Microsoft (R) Windows Debugger Version 6.8.0004.0 X86 Copyright (c) Microsoft Corporation. All rights reserved. Loading Dump File [C:\Users\Administrator\Desktop\103119-9750-01.dmp] Mini Kernel Dump File: Only registers and stack trace are available Symbol search path is: SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols Executable search path is: Windows Kernel Version 7601 (Service Pack 1) MP (8 procs) Free x64 Product: Server, suite: Enterprise TerminalServer SingleUserTS Built by: 7601.17514.amd64fre.win7sp1_rtm.101119-1850 Kernel base = 0xfffff800`0161e000 PsLoadedModuleList = 0xfffff800`01863e90 Debug session time: Thu Oct 31 20:30:40.829 2019 (GMT+8) System Uptime: 0 days 9:27:14.453 Loading Kernel Symbols ........................................................................................................................................... Loading User Symbols Loading unloaded module list ........ ******************************************************************************* * * * Bugcheck Analysis * * * ******************************************************************************* Use !analyze -v to get detailed debugging information. BugCheck 18, {0, fffffa800acb5070, 2, ffffffffffdff100} Probably caused by : Unknown_Image ( ANALYSIS_INCONCLUSIVE ) Followup: MachineOwner --------- 0: kd> !analyze -v ******************************************************************************* * * * Bugcheck Analysis * * * ******************************************************************************* REFERENCE_BY_POINTER (18) Arguments: Arg1: 0000000000000000, Object type of the object whose reference count is being lowered Arg2: fffffa800acb5070, Object whose reference count is being lowered Arg3: 0000000000000002, Reserved Arg4: ffffffffffdff100, Reserved The reference count of an object is illegal for the current state of the object. Each time a driver uses a pointer to an object the driver calls a kernel routine to increment the reference count of the object. When the driver is done with the pointer the driver calls another kernel routine to decrement the reference count. Drivers must match calls to the increment and decrement routines. This bugcheck can occur because an object's reference count goes to zero while there are still open handles to the object, in which case the fourth parameter indicates the number of opened handles. It may also occur when the object’s reference count drops below zero whether or not there are open handles to the object, and in that case the fourth parameter contains the actual value of the pointer references count. Debugging Details: ------------------ CUSTOMER_CRASH_COUNT: 1 DEFAULT_BUCKET_ID: DRIVER_FAULT_SERVER_MINIDUMP BUGCHECK_STR: 0x18 PROCESS_NAME: svchost.exe CURRENT_IRQL: 0 LAST_CONTROL_TRANSFER: from 0000000000000000 to 0000000000000000 STACK_TEXT: 00000000`00000000 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : 0x0 STACK_COMMAND: kb SYMBOL_NAME: ANALYSIS_INCONCLUSIVE FOLLOWUP_NAME: MachineOwner MODULE_NAME: Unknown_Module IMAGE_NAME: Unknown_Image DEBUG_FLR_IMAGE_TIMESTAMP: 0 BUCKET_ID: INVALID_KERNEL_CONTEXT Followup: MachineOwner ---------
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启动等。...
8年经验面试官详解 Java 面试秘诀
作者 |胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。 Java程序员准备和投递简历的实...
相关热词 c# 图片上传 c# gdi 占用内存 c#中遍历字典 c#控制台模拟dos c# 斜率 最小二乘法 c#进程延迟 c# mysql完整项目 c# grid 总行数 c# web浏览器插件 c# xml 生成xsd
立即提问