nodejs.TypeError: Cannot read property 'toLowerCase' of undefined

代码是之前项目的,一直没问题,拿过来用,我测试也没问题,部署后竟然出现了这个 我找了好久没找到问题,求大佬指教!!!

报错代码

日志

2019-05-15 09:21:32,466 ERROR 16059 [-/127.0.0.1/-/169ms POST /web/chanlogin] nodejs.TypeError: Cannot read property 'toLowerCase' of undefined
at LoginController.chanLogin (/var/www/community/app/controller/web/login.js:105:47)
at Object.callFn (/var/www/community/node_modules/egg-core/lib/utils/index.js:44:21)
at Object.classControllerMiddleware (/var/www/community/node_modules/egg-core/lib/loader/mixin/controller.js:87:20)
at Object.callFn (/var/www/community/node_modules/@eggjs/router/lib/utils.js:12:21)
at wrappedController (/var/www/community/node_modules/@eggjs/router/lib/egg_router.js:322:18)
at dispatch (/var/www/community/node_modules/koa-compose/index.js:44:32)
at next (/var/www/community/node_modules/koa-compose/index.js:45:18)
at /var/www/community/node_modules/@eggjs/router/lib/router.js:190:18
at dispatch (/var/www/community/node_modules/koa-compose/index.js:44:32)
at /var/www/community/node_modules/koa-compose/index.js:36:12
at dispatch (/var/www/community/node_modules/@eggjs/router/lib/router.js:195:33)
at dispatch (/var/www/community/node_modules/koa/node_modules/koa-compose/index.js:42:32)
at i18n (/var/www/community/node_modules/egg-i18n/app/middleware/i18n.js:13:12)
at dispatch (/var/www/community/node_modules/koa/node_modules/koa-compose/index.js:42:32)
at dispatch (/var/www/community/node_modules/egg-security/node_modules/koa-compose/index.js:42:32)
at dta (/var/www/community/node_modules/egg-security/lib/middlewares/dta.js:12:12)
at dispatch (/var/www/community/node_modules/egg-security/node_modules/koa-compose/index.js:42:32)
at xframe (/var/www/community/node_modules/egg-security/lib/middlewares/xframe.js:7:11)
at dispatch (/var/www/community/node_modules/egg-security/node_modules/koa-compose/index.js:42:32)
at xssProtection (/var/www/community/node_modules/egg-security/lib/middlewares/xssProtection.js:7:11)
at dispatch (/var/www/community/node_modules/egg-security/node_modules/koa-compose/index.js:42:32)
at nosniff (/var/www/community/node_modules/egg-security/lib/middlewares/nosniff.js:8:11)

pid: 16059
hostname: VM_0_4_centos

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/E:/maven/maven_repository/org/springframework/spring-core/5.0.5.RELEASE/spring-core-5.0.5.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release 2019-12-02 11:09:39.917 INFO 8852 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2019-12-02 11:09:39.932 INFO 8852 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-12-02 11:09:39.932 INFO 8852 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.29 2019-12-02 11:09:39.936 INFO 8852 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\idea\IntelliJ IDEA 2019.2.4\jbr\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;E:\app\Administrator\product\11.2.0\dbhome_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;E:\java\development\jdk8\bin;E:\java\development\jdk8\jre\bin;E:\java\development\apache-maven-3.3.9-bin\bin;C:\Program Files\MySQL\MySQL Server 8.0\bin\;C:\Program Files\nodejs\;E:\java\svn\bin;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Users\Administrator\AppData\Roaming\npm;.] 2019-12-02 11:09:39.981 ERROR 8852 --- [cat-startStop-1] org.apache.catalina.core.ContainerBase : A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]] at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:na] at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[na:na] at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na] Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.29.jar:8.5.29] ... 6 common frames omitted Caused by: org.apache.catalina.LifecycleException: Failed to start component [Pipeline[StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5125) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.29.jar:8.5.29] ... 6 common frames omitted Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.authenticator.NonLoginAuthenticator[]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:182) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.29.jar:8.5.29] ... 8 common frames omitted Caused by: java.lang.NoSuchMethodError: 'java.lang.String javax.servlet.ServletContext.getVirtualServerName()' at org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1186) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.29.jar:8.5.29] ... 10 common frames omitted 2019-12-02 11:09:39.982 ERROR 8852 --- [ main] org.apache.catalina.core.ContainerBase : A child container failed during start
npm安装一直有问题.查询不了
## 输入node -v正常....但是输入npm -v就出现下面这种情况![输入npm -v出现下面这种情况](https://img-ask.csdn.net/upload/201910/17/1571284739_958966.png) C:\Users\Administrator>npm -v Error: EINVAL: invalid argument, mkdir 'D:\SDE\Node8.9.4\node_globalF:\QQPCmgr\Professional\MSBuild\Microsoft\VisualStudio\NodeJs\node_global' TypeError: Cannot read property 'loaded' of undefined at exit (E:\node\node_modules\npm\lib\utils\error-handler.js:97:27) at errorHandler (E:\node\node_modules\npm\lib\utils\error-handler.js:216:3) at E:\node\node_modules\npm\bin\npm-cli.js:78:20 at cb (E:\node\node_modules\npm\lib\npm.js:225:22) at E:\node\node_modules\npm\lib\npm.js:263:24 at E:\node\node_modules\npm\lib\config\core.js:81:7 at Array.forEach (<anonymous>) at E:\node\node_modules\npm\lib\config\core.js:80:13 at f (E:\node\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (E:\node\node_modules\npm\lib\config\core.js:171:20) E:\node\node_modules\npm\lib\utils\error-handler.js:97 var doExit = npm.config.loaded ? npm.config.get('_exit') : true ^ TypeError: Cannot read property 'loaded' of undefined at exit (E:\node\node_modules\npm\lib\utils\error-handler.js:97:27) at process.errorHandler (E:\node\node_modules\npm\lib\utils\error-handler.js:216:3) at process.emit (events.js:210:5) at process._fatalException (internal/process/execution.js:150:25) 6.11.3 ## 可能是之前修改默认的全局目录好像位置输入错了....但是不知道怎么改回来
Nodejs报错module.js:327怎么解决?
![Nodejs](https://img-ask.csdn.net/upload/201611/08/1478571977_647371.png) Nodejs报错module.js:327怎么解决?
nodejs 判断 数组为空的 json数据时,一直报错undefined
对不起各位大神,请不要恨铁不成钢,我真心不懂这个简单的初级问题。 我自己在做一个API小程序,用nodejs的request包抓取了许多json数据。 问题简单的来说就是,我需要判断一个有时候有数值,有时候却为空的属性,属性名为deliverTime, 当deliverTime存在的时候,抓取这个json属性,当deliverTime不存在的时候,不抓取。 然而,如果我的判断语句为: if(body.data.deliverBills[0].deliverTime){console.log(body.data.deliverBills[0].deliverTime;}else{console.log(“不存在deliverTime”);} 如果deliverTime存在还好,会正常运行。 但一旦不存在的时候,似乎轮不到这个判断函数运行,就会因为deliverTime不存在直接先报错,报错内容为: TypeError: Cannot read property ‘deliverTime’ of undefined at Request._callback (c:\node\syncec9.js:126:34) at Request.self.callback (c:\node\node_modules\request\request.js:199:22) at emitTwo (events.js:87:13) at Request.emit (events.js:172:7) at Request.<anonymous> (c:\node\node_modules\request\request.js:1036:10) at emitOne (events.js:82:20) at Request.emit (events.js:169:7) at IncomingMessage.<anonymous> (c:\node\node_modules\request\request.js:963: at emitNone (events.js:72:20) at IncomingMessage.emit (events.js:166:7) 求大神们开导调教
nodejs js, map undefined
JSON.parse(responseData).subjects.map((item) => { ^ TypeError: Cannot read property 'map' of undefined at IncomingMessage.response.on (/Users/yuxixi/Desktop/atGuigu/request.js:20:36) at IncomingMessage.emit (events.js:187:15) at endReadableNT (_stream_readable.js:1094:12) at process._tickCallback (internal/process/next_tick.js:63:19) ``` const https = require('https') var options = { hostname: 'api.douban.com', port: 443, method: 'GET', path: '/v2/movie/top250' } var responseData = '' var request = https.request(options, (response) => { //console.log(response) //console.log(response.statusCode); //console.log(response.headers) response.setEncoding('utf8') response.on('data', (chunk) => { responseData += chunk }) response.on('end', () =>{ JSON.parse(responseData).subjects.map((item) => { console.log(item.title) }) }) }) request.on('error', (error) => { console.log(error) }) request.end() ```
win10下 nodejs报错:error Windows_NT 10.0.14393
0 info it worked if it ends with ok 1 verbose cli [ 'D:\\Program Files\\nodejs\\node.exe', 1 verbose cli 'D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'dev' ] 2 info using npm@3.10.9 3 info using node@v6.9.2 4 warn invalid config registry="registry" 5 warn invalid config Must be a full url with 'http://' 6 verbose run-script [ 'predev', 'dev', 'postdev' ] 7 info lifecycle vue@1.0.0~predev: vue@1.0.0 8 silly lifecycle vue@1.0.0~predev: no script for predev, continuing 9 info lifecycle vue@1.0.0~dev: vue@1.0.0 10 verbose lifecycle vue@1.0.0~dev: unsafe-perm in lifecycle true 11 verbose lifecycle vue@1.0.0~dev: PATH: D:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;E:\WEB\vue\node_modules\.bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\Program Files\TortoiseSVN\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;D:\Program Files (x86)\VisualSVN Server\bin;D:\Program Files\nodejs\;C:\Users\King\AppData\Local\Microsoft\WindowsApps;C:\Users\King\AppData\Roaming\npm 12 verbose lifecycle vue@1.0.0~dev: CWD: E:\WEB\vue 13 silly lifecycle vue@1.0.0~dev: Args: [ '/d /s /c', 'node build/dev-server.js' ] 14 silly lifecycle vue@1.0.0~dev: Returned: code: 1 signal: null 15 info lifecycle vue@1.0.0~dev: Failed to exec dev script 16 verbose stack Error: vue@1.0.0 dev: `node build/dev-server.js` 16 verbose stack Exit status 1 16 verbose stack at EventEmitter.<anonymous> (D:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16) 16 verbose stack at emitTwo (events.js:106:13) 16 verbose stack at EventEmitter.emit (events.js:191:7) 16 verbose stack at ChildProcess.<anonymous> (D:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14) 16 verbose stack at emitTwo (events.js:106:13) 16 verbose stack at ChildProcess.emit (events.js:191:7) 16 verbose stack at maybeClose (internal/child_process.js:877:16) 16 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 17 verbose pkgid vue@1.0.0 18 verbose cwd E:\WEB\vue 19 error Windows_NT 10.0.14393 20 error argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev" 21 error node v6.9.2 22 error npm v3.10.9 23 error code ELIFECYCLE 24 error vue@1.0.0 dev: `node build/dev-server.js` 24 error Exit status 1 25 error Failed at the vue@1.0.0 dev script 'node build/dev-server.js'. 25 error Make sure you have the latest version of node.js and npm installed. 25 error If you do, this is most likely a problem with the vue package, 25 error not with npm itself. 25 error Tell the author that this fails on your system: 25 error node build/dev-server.js 25 error You can get information on how to open an issue for this project with: 25 error npm bugs vue 25 error Or if that isn't available, you can get their info via: 25 error npm owner ls vue 25 error There is likely additional logging output above. 26 verbose exit [ 1, true ] 全部内容如上,求各位大神支招
下面这么简单的2个nodejs文件哪里错了??啊
//student.js function add(student) { console.log(student); } exports.add = add; .................................................................................(分割线) //teacher.js var student=require('./student'); function add(teacher) { console.log(teacher); } student.add('小明'); add('张老师'); 而控制台的错误提示: TypeError: student.add is not a function at Object.<anonymous> (D:\LearnTools\Sublime Text 3x64\Project\Nodejs-test\s chool2\teacher.js:9:9) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Function.Module.runMain (module.js:447:10) at startup (node.js:146:18) at node.js:404:3 ​
nodejs连接redis,经常掉线,然后重新连接,报错:Redis connection lost and command aborted. It might have been processed.
``` UnhandledPromiseRejectionWarning: AbortError: Redis connection lost and command aborted. It might have been processed. at RedisClient.flush_and_error (C:\workspace\MainData\node_modules\redis\index.js:362:23) at RedisClient.connection_gone (C:\workspace\MainData\node_modules\redis\index.js:664:14) at RedisClient.on_error (C:\workspace\MainData\node_modules\redis\index.js:410:10) at Socket.<anonymous> (C:\workspace\MainData\node_modules\redis\index.js:279:14) at Socket.emit (events.js:198:13) at emitErrorNT (internal/streams/destroy.js:91:8) at emitErrorAndCloseNT (internal/streams/destroy.js:59:3) at process._tickCallback (internal/process/next_tick.js:63:19) (node:8088) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:8088) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:8088) UnhandledPromiseRejectionWarning: AbortError: Redis connection lost and command aborted. It might have been processed. at RedisClient.flush_and_error (C:\workspace\MainData\node_modules\redis\index.js:362:23) at RedisClient.connection_gone (C:\workspace\MainData\node_modules\redis\index.js:664:14) at RedisClient.on_error (C:\workspace\MainData\node_modules\redis\index.js:410:10) at Socket.<anonymous> (C:\workspace\MainData\node_modules\redis\index.js:279:14) at Socket.emit (events.js:198:13) at emitErrorNT (internal/streams/destroy.js:91:8) at emitErrorAndCloseNT (internal/streams/destroy.js:59:3) at process._tickCallback (internal/process/next_tick.js:63:19) (node:8088) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) ```
Sending proposal to peer1.org1.example.com failed
原来用的nodejs的sdk,现在要换成java的sdk,底层docker容器也都启动成功了 ![docker](https://img-ask.csdn.net/upload/201809/30/1538267524_410437.png) 但在IDEA中运行End2endIT例子的时候报了 Sending instantiateProposalRequest to all peers with arguments: a and b set to 100 and 200 respectively 2018-09-30 00:30:16,755 main ERROR Channel:2768 - Sending proposal to peer1.org1.example.com failed because of: gRPC failure=Status{code=UNAVAILABLE, description=Network closed for unknown reason, cause=null} java.lang.Exception: io.grpc.StatusRuntimeException: UNAVAILABLE: Network closed for unknown reason at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2768) at org.hyperledger.fabric.sdk.Channel.sendInstantiationProposal(Channel.java:1540) at org.hyperledger.fabric.sdkintegration.End2endIT.runChannel(End2endIT.java:492) at org.hyperledger.fabric.sdkintegration.End2endIT.runFabricTest(End2endIT.java:208) at org.hyperledger.fabric.sdkintegration.End2endIT.setup(End2endIT.java:189) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: Network closed for unknown reason at io.grpc.Status.asRuntimeException(Status.java:526) at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:467) at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:37) at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:684) at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:37) at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:391) at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:471) at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:553) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:474) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:591) at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748) 2018-09-30 00:30:16,758 main ERROR Channel:2768 - Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=UNAVAILABLE, description=Network closed for unknown reason, cause=null} java.lang.Exception: io.grpc.StatusRuntimeException: UNAVAILABLE: Network closed for unknown reason at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2768) at org.hyperledger.fabric.sdk.Channel.sendInstantiationProposal(Channel.java:1540) at org.hyperledger.fabric.sdkintegration.End2endIT.runChannel(End2endIT.java:492) at org.hyperledger.fabric.sdkintegration.End2endIT.runFabricTest(End2endIT.java:208) at org.hyperledger.fabric.sdkintegration.End2endIT.setup(End2endIT.java:189) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: Network closed for unknown reason at io.grpc.Status.asRuntimeException(Status.java:526) at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:467) at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:37) at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:684) at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:37) at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:391) at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:471) at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:553) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:474) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:591) at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748) Received 2 instantiate proposal responses. Successful+verified: 0 . Failed: 2 Not enough endorsers for instantiate :0endorser failed with Sending proposal to peer1.org1.example.com failed because of: gRPC failure=Status{code=UNAVAILABLE, description=Network closed for unknown reason, cause=null}, on peerPeer peer1.org1.example.com url: grpc://47.104.249.104:7056 Not enough endorsers for instantiate :0endorser failed with Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=UNAVAILABLE, description=Network closed for unknown reason, cause=null}, on peerPeer peer0.org1.example.com url: grpc://47.104.249.104:7051 java.lang.AssertionError: Not enough endorsers for instantiate :0endorser failed with Sending proposal to peer1.org1.example.com failed because of: gRPC failure=Status{code=UNAVAILABLE, description=Network closed for unknown reason, cause=null}. Was verified:false at org.junit.Assert.fail(Assert.java:88) at org.hyperledger.fabric.sdkintegration.End2endIT.runChannel(End2endIT.java:512) at org.hyperledger.fabric.sdkintegration.End2endIT.runFabricTest(End2endIT.java:208) at org.hyperledger.fabric.sdkintegration.End2endIT.setup(End2endIT.java:189) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) 查了半天也没弄清啥原因,望各位大佬不吝赐教!!!
NodeJs启动项目出错,有大侠知道是什么原因吗?新手上路
"D:\Program Files\WebStorm 2017.1\bin\runnerw.exe" "D:\Program Files\nodejs\node.exe" D:\nodejs_svn\extnum_api\extnum_api_main.js D:\logs\ccs events.js:160 throw er; // Unhandled 'error' event ^ Error: write after end at writeAfterEnd (D:\nodejs_svn\extnum_api\node_modules\readable-stream\lib\_stream_writable.js:161:12) at DateRollingFileStream.Writable.write (D:\nodejs_svn\extnum_api\node_modules\readable-stream\lib\_stream_writable.js:208:5) at Logger.<anonymous> (D:\nodejs_svn\extnum_api\node_modules\log4js\lib\appenders\dateFile.js:35:13) at emitOne (events.js:96:13) at Logger.emit (events.js:188:7) at Logger._log (D:\nodejs_svn\extnum_api\node_modules\log4js\lib\logger.js:96:8) at Logger.(anonymous function) [as info] (D:\nodejs_svn\extnum_api\node_modules\log4js\lib\logger.js:89:12) at process.<anonymous> (D:\nodejs_svn\extnum_api\lib\extnum_api_client.js:50:13) at emitOne (events.js:101:20) at process.emit (events.js:188:7)
nodejs安装ss,windows server2016服务器,
ss安装完,配置好了以后,我启动sssever 报以下错误: Your environment has been set up for using Node.js 6.11.0 (x64) and npm. C:\Users\Administrator>ssserver shadowsocks v1.5.3 8 Jun 13:40:26 - 989ms loading config from C:\Users\Administrator\AppData\Roaming\npm\node_modules\shadowsocks\config.json 8 Jun 13:40:26 - 989ms calculating ciphers for port 8388 events.js:160 throw er; // Unhandled 'error' event ^ Error: bind EADDRNOTAVAIL 47.89.181.230:8388 at Object.exports._errnoException (util.js:1018:11) at exports._exceptionWithHostPort (util.js:1041:20) at _handle.lookup (dgram.js:219:18) at _combinedTickCallback (internal/process/next_tick.js:83:11) at process._tickCallback (internal/process/next_tick.js:104:9) at Module.runMain (module.js:606:11) at run (bootstrap_node.js:389:7) at startup (bootstrap_node.js:149:9) at bootstrap_node.js:504:3 C:\Users\Administrator>
egg.js报错ctx.oss.put is not a function
图片上传报错; 报错内容: 2017-09-15 17:13:44,493 INFO 1474 [master] egg started on http://127.0.0.1:7001 (1976ms) field: multiplefile filename: 111.png encoding: 7bit mime: image/png 2017-09-15 17:13:53,619 ERROR 1476 [-/::1/-/27ms POST /upload?_csrf=aUvmihGq--KleIqqIGZRLYsXAM989DojoFUw] nodejs.TypeError: ctx.oss.put is not a function at HomeController.upload (/Users/lixiuming/egg-example/app/controller/home.js:52:48) at next (native) at onFulfilled (/Users/lixiuming/egg-example/node_modules/co/index.js:65:19) at process._tickCallback (internal/process/next_tick.js:109:7) pid: 1476 controller: * upload() { const ctx = this.ctx; const parts = ctx.multipart(); let part; while ((part = yield parts) != null) { if (part.length) { // 如果是数组的话是 filed console.log('field: ' + part[0]); console.log('value: ' + part[1]); console.log('valueTruncated: ' + part[2]); console.log('fieldnameTruncated: ' + part[3]); } else { if (!part.filename) { // 这时是用户没有选择文件就点击了上传(part 是 file stream,但是 part.filename 为空) // 需要做出处理,例如给出错误提示消息 return; } // part 是上传的文件流 console.log('field: ' + part.fieldname); console.log('filename: ' + part.filename); console.log('encoding: ' + part.encoding); console.log('mime: ' + part.mime); // 文件处理,上传到云存储等等 let result; try { result = yield ctx.oss.put('egg-multipart-test/' + part.filename, part); } catch (err) { // 必须将上传的文件流消费掉,要不然浏览器响应会卡死 // yield sendToWormhole(stream); throw err; } console.log(result); } } console.log('and we are done parsing the form!'); }
安装完node.js和npm,require('bower')报错,谁能解决下啊。
具体设置在是这样的,在cmd中运行npm install -g bower 然后运行bower install就报错,看了好多资料,说配置环境变量,配置之后还是不行。请帮忙解决 C:\Users\Tao-Two>npm install -g bower D:\nodejs\node_global\bower -> D:\nodejs\node_global\node_modules\bower\bin\bower D:\nodejs\node_global `-- bower@1.8.0 C:\Users\Tao-Two>node > require('express') { [Function: createApplication] application: 此处省略字.................. static: { [Function: serveStatic] mime: Mime { types: [Object], extensions: [Object], default_type: 'application/octet-stream', Mime: [Function: Mime], charsets: [Object] } } } > require('brower') Error: Cannot find module 'brower' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at repl:1:1 at sigintHandlersWrap (vm.js:22:35) at sigintHandlersWrap (vm.js:73:12) at ContextifyScript.Script.runInThisContext (vm.js:21:12) at REPLServer.defaultEval (repl.js:340:29) at bound (domain.js:280:14) >
Nodejs,Promise使用时在then中返回Promise报错,不明白这样写为什么报错
var wechat = new Wechat() var data = yield wechat('image', __dirname + '\\.5.jpg', false) Wechat.prototype.uploadMaterial = function(type, filePath, isPermanent){ var that = this var url = api.temporary.upload var form = { media: fs.createReadStream(filePath) } that .fetchAccessToken() .then(function(data){ console.log(data) if(!isPermanent){ url += 'access_token=' + data.access_token + '&type=' + type } return new Promise(function(resolve, reject){ request({method:'POST', uri: url, formData: form, json:true}) .then(function(response){ var _data = response.body resolve(_data) }) }) }) } ``` ``` ## 报错信息如下 TypeError: You may only yield a function, promise, generator, array, or object, but the following object was passed: " undefined" at next (H:\study\com\node_modules\co\index.js:101:25) at onFulfilled (H:\study\com\node_modules\co\index.js:69:7) at H:\study\com\node_modules\co\index.js:54:5 at Object.co (H:\study\com\node_modules\co\index.js:50:10) at Object.toPromise (H:\study\com\node_modules\co\index.js:118:63) at next (H:\study\com\node_modules\co\index.js:99:29) at onFulfilled (H:\study\com\node_modules\co\index.js:69:7) at tryCatcher (H:\study\com\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (H:\study\com\node_modules\bluebird\js\release\promise.js:512:31) at Promise._settlePromise (H:\study\com\node_modules\bluebird\js\release\promise.js:569:18) at Promise._settlePromiseCtx (H:\study\com\node_modules\bluebird\js\release\promise.js:606:10) at Async._drainQueue (H:\study\com\node_modules\bluebird\js\release\async.js:138:12) at Async._drainQueues (H:\study\com\node_modules\bluebird\js\release\async.js:143:10) at Immediate.Async.drainQueues (H:\study\com\node_modules\bluebird\js\release\async.js:17:14) at tryOnImmediate (timers.js:639:5) at processImmediate [as _immediateCallback] (timers.js:611:5) ## Nodejs,Promise使用时在then中返回Promise报错,不明白这样写为什么报错,求大神指点谢谢!
nodejs使用connect-mongo出现问题
我用的版本是1.2.1是不是太老了? D:\somepackage\app\node_modules\connect-mongo\src\index.js:3 const Promise = require('bluebird'); ^^^^^ SyntaxError: Use of const in strict mode. at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object.<anonymous> (D:\somepackage\app\node_modules\connect-mongo\index.j s:1:80) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) 哪位前辈有经验指点下 谢谢
nodejs在控制台上报了如下错误,求解???
$ node app F:\movie\app.js:49 store: new mongoStore({ ^^^^^ SyntaxError: Unexpected identifier at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:501:10) at startup (node.js:129:16) at node.js:814:3 这是报错部分的代码: app.use(session({ secret: 'imovie', resave: false, saveUninitialized: true store: new mongoStore({ url: dbUrl, collection: 'sessions' }) }))
npm ERR! Buffer.alloc is not a function
0 info it worked if it ends with ok 1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 1 verbose cli 'C:\\Users\\XJ\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'install' ] 2 info using npm@5.4.1 3 info using node@v4.4.3 4 verbose stack TypeError: Buffer.alloc is not a function 4 verbose stack at Object.<anonymous> (C:\Users\XJ\AppData\Roaming\npm\node_modules\npm\node_modules\tar\lib\pack.js:32:20) 4 verbose stack at Module._compile (module.js:409:26) 4 verbose stack at Object.Module._extensions..js (module.js:416:10) 4 verbose stack at Module.load (module.js:343:32) 4 verbose stack at Function.Module._load (module.js:300:12) 4 verbose stack at Module.require (module.js:353:17) 4 verbose stack at require (internal/module.js:12:17) 4 verbose stack at Object.<anonymous> (C:\Users\XJ\AppData\Roaming\npm\node_modules\npm\node_modules\tar\lib\create.js:6:14) 4 verbose stack at Module._compile (module.js:409:26) 4 verbose stack at Object.Module._extensions..js (module.js:416:10) 4 verbose stack at Module.load (module.js:343:32) 4 verbose stack at Function.Module._load (module.js:300:12) 4 verbose stack at Module.require (module.js:353:17) 4 verbose stack at require (internal/module.js:12:17) 4 verbose stack at Object.<anonymous> (C:\Users\XJ\AppData\Roaming\npm\node_modules\npm\node_modules\tar\index.js:4:30) 4 verbose stack at Module._compile (module.js:409:26) 5 verbose cwd E:\vue-devtools-master\vue-devtools-master 6 verbose Windows_NT 6.1.7601 7 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\XJ\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" 8 verbose node v4.4.3 9 verbose npm v5.4.1 10 error Buffer.alloc is not a function 11 verbose exit [ 1, true ] 这是对应的log日志 新手,这个问题怎么解决啊....
npm问题'Path must be a string
> app@1.0.0 dev D:\work\qk\app > node build/dev-server.js [HPM] Proxy created: /api -> http://xxx.xxx.x.xxx [HPM] Proxy rewrite rule created: "^/api" ~> "/api" path.js:7 throw new TypeError('Path must be a string. Received ' + inspect(path)); ^ TypeError: Path must be a string. Received undefined at assertPath (path.js:7:11) at Object.join (path.js:1211:7) at Object.<anonymous> (D:\work\qk\app\build\dev-server.js:57:29) at Module._compile (module.js:541:32) at Object.Module._extensions..js (module.js:550:10) at Module.load (module.js:458:32) at tryModuleLoad (module.js:417:12) at Function.Module._load (module.js:409:3) at Function.Module.runMain (module.js:575:10) at startup (node.js:160:18) at node.js:449:3 npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev" npm ERR! node v6.2.0 npm ERR! npm v3.8.9 npm ERR! code ELIFECYCLE npm ERR! app@1.0.0 dev: `node build/dev-server.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the app@1.0.0 dev script 'node build/dev-server.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the app package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node build/dev-server.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs app npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls app npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! D:\work\qk\app\npm-debug.log
130 个相见恨晚的超实用网站,一次性分享出来
相见恨晚的超实用网站 持续更新中。。。
字节跳动视频编解码面经
三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时想着能进去就不错了,管他哪个岗呢,就同意了面试...
win10系统安装教程(U盘PE+UEFI安装)
一、准备工作 u盘,电脑一台,win10原版镜像(msdn官网) 二、下载wepe工具箱 极力推荐微pe(微pe官方下载) 下载64位的win10 pe,使用工具箱制作启动U盘打开软件, 选择安装到U盘(按照操作无需更改) 三、重启进入pe系统 1、关机后,将U盘插入电脑 2、按下电源后,按住F12进入启动项选择(技嘉主板是F12) 选择需要启...
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
Python——画一棵漂亮的樱花树(不同种樱花+玫瑰+圣诞树喔)
最近翻到一篇知乎,上面有不少用Python(大多是turtle库)绘制的树图,感觉很漂亮,我整理了一下,挑了一些我觉得不错的代码分享给大家(这些我都测试过,确实可以生成) one 樱花树 动态生成樱花 效果图(这个是动态的): 实现代码 import turtle as T import random import time # 画樱花的躯干(60,t) def Tree(branch, ...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小人工智障。 思路可以运用在不同地方,主要介绍的是思路。
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
Java描述设计模式(19):模板方法模式
本文源码:GitHub·点这里 || GitEE·点这里 一、生活场景 通常一款互联网应用的开发流程如下:业务需求,规划产品,程序开发,测试交付。现在基于模板方法模式进行该过程描述。 public class C01_InScene { public static void main(String[] args) { DevelopApp developApp = n...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
C语言魔塔游戏
很早就很想写这个,今天终于写完了。 游戏截图: 编译环境: VS2017 游戏需要一些图片,如果有想要的或者对游戏有什么看法的可以加我的QQ 2985486630 讨论 下面我来介绍一下游戏的主要功能和实现方式 首先是玩家的定义,使用结构体,这个名字是可以自己改变的 struct gamerole { char name[20] = "黑蛋"; //玩家名字 int...
第三个java程序(表白小卡片)
前言: &nbsp;向女神表白啦,作为一个程序员,当然也有爱情啦。只不过,虽然前面两个程序都只是学习了基础的语法结构和向量哈希表。这里涉及的是Swing,awt图形用户界面和一点文件输入输出流的知识。 &nbsp; 表白代码如下: 另附:里面的音乐和图片可以放在一个自己创建的包里面,也可以放在src里面,或者使用绝对路径。至于布局,我自己的使用的是简单的排班,简单的继承。后面的程序会慢慢实现。 ...
8年经验面试官详解 Java 面试秘诀
作者 |胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。 Java程序员准备和投递简历的实...
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的回答,对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalking,作者吴晟、刘浩杨 等等 仓库地址: apache/skywalking 更...
化繁为简 - 腾讯计费高一致TDXA的实践之路
导语:腾讯计费是孵化于支撑腾讯内部业务千亿级营收的互联网计费平台,在如此庞大的业务体量下,腾讯计费要支撑业务的快速增长,同时还要保证每笔交易不错账。采用最终一致性或离线补...
Linux网络服务-----实验---PXE和Kickstart的无人值守装机
目录 一.PXE的原理 二.kickstart的原理 三.PXE与kickstart的结合使用自动装机 一.PXE的原理 PXE(preboot execute environment,预启动执行环境)是由Intel公司开发的最新技术,工作于Client/Server的网络模式,支持工作站通过网络从远端服务器下载映像,并由支持通过网络启动操作系统,再启动过程中,终端要求服务器分配IP地址...
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观...
A*搜索算法概述
编者按:本文作者奇舞团前端开发工程师魏川凯。A*搜索算法(A-star search algorithm)是一种常见且应用广泛的图搜索和寻径算法。A*搜索算法是通过使用启...
程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
从顶级黑客到上市公司老板
一看标题,很多老读者就知道我在写什么了。今天Ucloud成功上市,季昕华成为我所熟悉的朋友里又双叒叕一个成功上市的案例。我们认识大概是十五年多吧,如果没记错,第一次见面应该是2004年,...
蓝桥杯知识点汇总:基础知识和常用算法
文章目录基础语法部分:算法竞赛常用API:算法部分数据结构部分 此系列包含蓝桥杯绝大部分所考察的知识点,以及真题题解~ 基础语法部分: 备战蓝桥杯java(一):一般输入输出 和 快速输入输(BufferedReader&amp;BufferedWrite) 备战蓝桥杯java(二):java编程规范和常用数据类型 备战蓝桥杯java(三):常用功能符以及循环结构和分支结构 备战蓝桥杯java(四...
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东...
破14亿,Python分析我国存在哪些人口危机!
一、背景 二、爬取数据 三、数据分析 1、总人口 2、男女人口比例 3、人口城镇化 4、人口增长率 5、人口老化(抚养比) 6、各省人口 7、世界人口 四、遇到的问题 遇到的问题 1、数据分页,需要获取从1949-2018年数据,观察到有近20年参数:LAST20,由此推测获取近70年的参数可设置为:LAST70 2、2019年数据没有放上去,可以手动添加上去 3、将数据进行 行列转换 4、列名...
强烈推荐10本程序员在家读的书
很遗憾,这个春节注定是刻骨铭心的,新型冠状病毒让每个人的神经都是紧绷的。那些处在武汉的白衣天使们,尤其值得我们的尊敬。而我们这些窝在家里的程序员,能不外出就不外出,就是对社会做出的最大的贡献。 有些读者私下问我,窝了几天,有点颓丧,能否推荐几本书在家里看看。我花了一天的时间,挑选了 10 本我最喜欢的书,你可以挑选感兴趣的来读一读。读书不仅可以平复恐惧的压力,还可以对未来充满希望,毕竟苦难终将会...
Linux自学篇——linux命令英文全称及解释
man: Manual 意思是手册,可以用这个命令查询其他命令的用法。 pwd:Print working directory 意思是密码。 su:Swith user 切换用户,切换到root用户 cd:Change directory 切换目录 ls:List files 列出目录下的文件 ps:Process Status 进程状态 mkdir:Make directory ...
Python实战:抓肺炎疫情实时数据,画2019-nCoV疫情地图
今天,群里白垩老师问如何用python画武汉肺炎疫情地图。白垩老师是研究海洋生态与地球生物的学者,国家重点实验室成员,于不惑之年学习python,实为我等学习楷模。先前我并没有关注武汉肺炎的具体数据,也没有画过类似的数据分布图。于是就拿了两个小时,专门研究了一下,遂成此文。
疫情数据接口api
返回json示例 { "errcode":0,//0标识接口正常 "data":{ "date":"2020-01-30 07:47:23",//实时更新时间 "diagnosed":7736,//确诊人数 "suspect":12167,//疑是病例人数 "death":170,//死亡人数 "cur...
智力题(程序员面试经典)
NO.1  有20瓶药丸,其中19瓶装有1克/粒的药丸,余下一瓶装有1.1克/粒的药丸。给你一台称重精准的天平,怎么找出比较重的那瓶药丸?天平只能用一次。 解法 有时候,严格的限制条件有可能反倒是解题的线索。在这个问题中,限制条件是天平只能用一次。 因为天平只能用一次,我们也得以知道一个有趣的事实:一次必须同时称很多药丸,其实更准确地说,是必须从19瓶拿出药丸进行称重。否则,如果跳过两瓶或更多瓶药...
疫情防控,开发者集结出战!
作者 | 屠敏出品 | CSDN(ID:CSDNnews)2020 年伊始,病毒肆虐,人心惶惶。截止北京时间 1 月 31 日 15 时 30 分,全国确诊新型冠状病毒肺炎的数字已达到了...
相关热词 c#导入fbx c#中屏蔽键盘某个键 c#正态概率密度 c#和数据库登陆界面设计 c# 高斯消去法 c# codedom c#读取cad文件文本 c# 控制全局鼠标移动 c# temp 目录 bytes初始化 c#
立即提问