Uninitialized variable: i

使用代码工具检查的时候发现编译提示逻辑错误变量未初始化:Uninitialized variable: i

    int i, comNum;
    TExtComDevice* ptExtComDev;
    Bool TestDone = TRUE;
    Int32 retVal;

#if defined(_IPC6XX_) || defined(_IPC6X5_GN_)
    comNum = MAX_SERIAL_NUM;
#elif defined(_CHEETAH1_)
    comNum = 1;
#else
    comNum = 0;
#endif
    for(i=0; i<comNum; i++)
    {
        ptExtComDev = &gtExtComDevice[i];
        if(100 != ptExtComDev->eProtocolType)
        {
            TestDone = FALSE;
            KOSA_printf("SerialPost %d is not OK!\n", i);
            break;
        }
    }

                if(i == comNum)/*代码出错一行*/
    {
            /*内部代码省略*/
        }

变量i虽然开始只是声明int i,但是后面for()循环结束后i应该已经被赋值,不应该是未初始话状态,希望大家帮忙给个答案

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
用Kerasa运行GAN程序时只能对抗一次就报错
最近在学习GAN网络,从 https://github.com/eriklindernoren/Keras-GAN#sgan 下了模型出来运行,就会对抗一次然后报错。自己根据模型改写代码,也出现相同问题。![图片说明](https://img-ask.csdn.net/upload/201911/26/1574781104_155242.jpg)错误代码是:BaseCollectiveExecutor::StartAbort Failed precondition: Error while reading resource variable _AnonymousVar41 from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/_AnonymousVar41/class tensorflow::Var does not exist. [[{{node mul_1/ReadVariableOp}}]] 不清楚该如何解决,百度谷歌了都没有有效的解决办法
Rails: uninitialized constant MethodTypeController
我是一个rails 新手 1. 我的controller 由于有下划线,我不知道route 里面怎么写才对。 2. 这个是我的controller file 的名字: method_types_controller.rb 3.这是我的route文件 ``` Rails.application.routes.draw do # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html get 'method_type/index' root 'method_type#index' end ``` 4. 结果显示错误 Routing Error uninitialized constant MethodTypeController
ApplicationController 的问题?
在终端运行ruby xxx_controller.rb 得到uninitialized constant Object::ApplicationController (NameError) 这是纹身没?
安卓开发获取wifi ssid时魅族手机获取不到,其他手机都可以
实现代码: WifiManager wifi_service = (WifiManager) getSystemService(WIFI_SERVICE); WifiInfo wifiinfo = wifi_service.getConnectionInfo(); 魅蓝手机获取结果: wifiinfo:SSID: <unknown ssid>, BSSID: <none>, MAC: <none>, Supplicant state: UNINITIALIZED, RSSI: -9999, Link speed: -1, Net ID: -1, 魅族手机会这样获取不到wifi,其他手机可以,我用的是魅蓝
Android studio 的confugure build和Gradle Sync lssues报错
![图片说明](https://img-ask.csdn.net/upload/201909/20/1568948677_314838.png) confugure build报错内容如下: Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener. Caused by: java.lang.VerifyError: Uninitialized object exists on backward branch 142 Exception Details: Location: com/android/build/gradle/internal/pipeline/VariantInfoImpl.<init>(Lcom/android/build/gradle/internal/scope/VariantScope;)V @200: goto Reason: Error exists in the bytecode Gradle Sync lssues报错内容如下: ERROR: Uninitialized object exists on backward branch 142 Exception Details: Location: com/android/build/gradle/internal/pipeline/VariantInfoImpl.<init>(Lcom/android/build/gradle/internal/scope/VariantScope;)V @200: goto Reason: Error exists in the bytecode
ubuntu下用rvm安装ruby on rails出错,求各路大神帮忙~!
ruby已经安装好: $ ruby -v ruby 2.2.1p85(2015-02-26 revision 49769) [x86_64linux] 国内服务器推荐替换 RubyGems 的到淘宝镜像: $ gem sources --remove https://rubygems.org/ $ gem sources -a http://ruby.taobao.org/ 回车后报错 ERROR: While executing gem ... (NameError) uninitialized constant Gem::RemoteFetcher::Zlib 按照网上教程,先安装了zlib $ sudo apt-get install zlib1g zlib1g-dev 也从zlib.net网上下载好并安装了 然后按照教程 $cd ext/zlib $ruby ./extconf.rb $make $make install 在执行步骤 $cd ext/zlib时报错 bash: cd: ext/zlib: 没有那个文件或目录 实在不知道怎么解决 求教各位大神
pat乙级1014 福尔摩斯的约会。
1. 大侦探福尔摩斯接到一张奇怪的字条:我们约会吧! **3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm**。大侦探很快就明白了,字条上奇怪的乱码实际上就是约会的时间星期四 14:04,因为前面两字符串中第 1 对相同的大写英文字母(大小写有区分)是第 4 个字母 D,代表星期四;第 2 对相同的字符是 E ,那是第 5 个英文字母,代表一天里的第 14 个钟头(于是一天的 0 点到 23 点由数字 0 到 9、以及大写字母 A 到 N 表示);后面两字符串第 1 对相同的英文字母 s 出现在第 4 个位置(从 0 开始计数)上,代表第 4 分钟。现给定两对字符串,请帮助福尔摩斯解码得到约会的时间。 1. 输入格式: 输入在 4 行中分别给出 4 个非空、不包含空格、且长度不超过 60 的字符串。 1. 输出格式: 在一行中输出约会的时间,格式为 DAY HH:MM,其中 DAY 是某星期的 3 字符缩写,即 MON 表示星期一,TUE 表示星期二,WED 表示星期三,THU 表示星期四,FRI 表示星期五,SAT 表示星期六,SUN 表示星期日。题目输入保证每个测试存在唯一解。 输入样例: ``` 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm ``` 输出样例: ``` THU 14:04 ``` ![图片说明](https://img-ask.csdn.net/upload/201910/10/1570671658_795225.png) * ``` 我的代码有三个测试点过不了,一直找不出问题。谢谢各位大神帮忙纠错一下。 他提示编译器错误: a.cpp:51:18: warning: variable 'min' is used uninitialized whenever 'for' loop exits because its condition is false [-Wsometimes-uninitialized] for (int i = 0; i < s3.length(); i++){ ^~~~~~~~~~~~~~~ a.cpp:79:6: note: uninitialized use occurs here if (min <= 9) ^~~ a.cpp:51:18: note: remove the condition if it is always true for (int i = 0; i < s3.length(); i++){ ^~~~~~~~~~~~~~~ a.cpp:20:9: note: initialize the variable 'min' to silence this warning int min; ^ = 0 1 warning generated. ``` * ``` #include<iostream> #include<string> #include<vector> using namespace std; int main(){ string s1; string s2; string s3; string s4; cin >> s1; cin >> s2; cin >> s3; cin >> s4; pair<int,int> mark_day; pair<int,int> mark_hour; pair<int,int> mark_min; int day; int hour; int min; for (int i = 0; i < s1.size(); i++){ int n1 = s1[i]; if (n1 >= 65 && n1 <= 71){ mark_day.first = i; mark_day.second = n1; if (mark_day.first < s2.size()){ if (mark_day.second == (int)s2[mark_day.first]){ day = mark_day.second - 65 + 1; break; } } } } for (int i = mark_day.first + 1; i < s1.size(); i++){ int n1 = s1[i]; if ((n1 >= 65 && n1 <= 78) || (n1 >= 48 && n1 <= 57)){ mark_hour.first = i; mark_hour.second = n1; if (mark_hour.first < s2.size()){ if (mark_hour.second == (int)s2[mark_hour.first]){ hour = mark_hour.second; break; } } } } for (int i = 0; i < s3.length(); i++){ int n1 = s3[i]; if ((n1 >= 65 && n1 <= 90) || (n1 >= 97 && n1 <= 122)){ mark_min.first = i; mark_min.second = n1; if (mark_min.first < s4.size()){ if (mark_min.second == (int)s4[mark_min.first]){ min = mark_min.first; break; } } } } switch (day) { case 1:cout << "MON "; break; case 2:cout << "TUE "; break; case 3:cout << "WED "; break; case 4:cout << "THU "; break; case 5:cout << "FRI "; break; case 6:cout << "SAT "; break; case 7:cout << "SUN "; break; } if (hour >= 48 && hour <= 57) cout <<"0"<<hour << ":"; if (hour >= 65 && hour <= 78) cout << hour - 55<< ":"; if (min <= 9) cout <<"0"<<min; if (min > 9) cout << min; system("pause"); return 0; } ```
编译android代码报错,哇哇哇
编译报错好纠结,网上也查不到什么资料,望大神赐教! Using /home/user002/Amlogic/LocalMobile/common as source for kernel GEN /home/user002/Amlogic/LocalMobile/out/target/product/m201/obj/KERNEL_OBJ/Makefile CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h make[3]: “include/generated/mach-types.h”是最新的。 CC kernel/bounds.s cc1: 错误: -Werror=maybe-uninitialized:没有选项 -Wmaybe-uninitialized make[3]: *** [kernel/bounds.s] 错误 1 make[2]: *** [prepare0] 错误 2 make[1]: *** [sub-make] 错误 2 make[1]:正在离开目录 `/home/user002/Amlogic/LocalMobile/common' make: *** [out/target/product/m201/obj/KERNEL_OBJ/arch/arm/boot/uImage] 错误 2 root@cncr-eoc:/home/user002/Amlogic/LocalMobile#
在Spyder界面中使用tensorflow进行fashion_mnist数据集学习,结果loss为非数,并且准确率一直未变
1.建立了一个3个全连接层的神经网络; 2.代码如下: ``` import matplotlib as mpl import matplotlib.pyplot as plt #%matplotlib inline import numpy as np import sklearn import pandas as pd import os import sys import time import tensorflow as tf from tensorflow import keras print(tf.__version__) print(sys.version_info) for module in mpl, np, sklearn, tf, keras: print(module.__name__,module.__version__) fashion_mnist = keras.datasets.fashion_mnist (x_train_all, y_train_all), (x_test, y_test) = fashion_mnist.load_data() x_valid, x_train = x_train_all[:5000], x_train_all[5000:] y_valid, y_train = y_train_all[:5000], y_train_all[5000:] #tf.keras.models.Sequential model = keras.models.Sequential() model.add(keras.layers.Flatten(input_shape= [28,28])) model.add(keras.layers.Dense(300, activation="relu")) model.add(keras.layers.Dense(100, activation="relu")) model.add(keras.layers.Dense(10,activation="softmax")) ###sparse为最后输出为index类型,如果为one hot类型,则不需加sparse model.compile(loss = "sparse_categorical_crossentropy",optimizer = "sgd", metrics = ["accuracy"]) #model.layers #model.summary() history = model.fit(x_train, y_train, epochs=10, validation_data=(x_valid,y_valid)) ``` 3.输出结果: ``` runfile('F:/new/new world/deep learning/tensorflow/ex2/tf_keras_classification_model.py', wdir='F:/new/new world/deep learning/tensorflow/ex2') 2.0.0 sys.version_info(major=3, minor=7, micro=4, releaselevel='final', serial=0) matplotlib 3.1.1 numpy 1.16.5 sklearn 0.21.3 tensorflow 2.0.0 tensorflow_core.keras 2.2.4-tf Train on 55000 samples, validate on 5000 samples Epoch 1/10 WARNING:tensorflow:Entity <function Function._initialize_uninitialized_variables.<locals>.initialize_variables at 0x0000025EAB633798> could not be transformed and will be executed as-is. Please report this to the AutoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: WARNING: Entity <function Function._initialize_uninitialized_variables.<locals>.initialize_variables at 0x0000025EAB633798> could not be transformed and will be executed as-is. Please report this to the AutoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: 55000/55000 [==============================] - 3s 58us/sample - loss: nan - accuracy: 0.1008 - val_loss: nan - val_accuracy: 0.0914 Epoch 2/10 55000/55000 [==============================] - 3s 48us/sample - loss: nan - accuracy: 0.1008 - val_loss: nan - val_accuracy: 0.0914 Epoch 3/10 55000/55000 [==============================] - 3s 47us/sample - loss: nan - accuracy: 0.1008 - val_loss: nan - val_accuracy: 0.0914 Epoch 4/10 55000/55000 [==============================] - 3s 48us/sample - loss: nan - accuracy: 0.1008 - val_loss: nan - val_accuracy: 0.0914 Epoch 5/10 55000/55000 [==============================] - 3s 47us/sample - loss: nan - accuracy: 0.1008 - val_loss: nan - val_accuracy: 0.0914 Epoch 6/10 55000/55000 [==============================] - 3s 48us/sample - loss: nan - accuracy: 0.1008 - val_loss: nan - val_accuracy: 0.0914 Epoch 7/10 55000/55000 [==============================] - 3s 47us/sample - loss: nan - accuracy: 0.1008 - val_loss: nan - val_accuracy: 0.0914 Epoch 8/10 55000/55000 [==============================] - 3s 48us/sample - loss: nan - accuracy: 0.1008 - val_loss: nan - val_accuracy: 0.0914 Epoch 9/10 55000/55000 [==============================] - 3s 48us/sample - loss: nan - accuracy: 0.1008 - val_loss: nan - val_accuracy: 0.0914 Epoch 10/10 55000/55000 [==============================] - 3s 48us/sample - loss: nan - accuracy: 0.1008 - val_loss: nan - val_accuracy: 0.0914 ```
$ gem sources -a https://ruby.taobao.org/ 报错
$ gem sources -a https://ruby.taobao.org/ --debug NOTE: Debugging mode prints all exceptions even when rescued Exception `NameError' at C:/Ruby22-x64/lib/ruby/2.2.0/fiddle/import.rb:153 - uninitialized constant Fiddle::Function::STDCALL Exception `Win32::Registry::Error' at C:/Ruby22-x64/lib/ruby/2.2.0/win32/registry.rb:249 - The system cannot find the file specified. Exception `Win32::Registry::Error' at C:/Ruby22-x64/lib/ruby/2.2.0/win32/registry.rb:249 - The system cannot find the file specified. Exception `Win32::Registry::Error' at C:/Ruby22-x64/lib/ruby/2.2.0/win32/registry.rb:249 - The system cannot find the file specified. Exception `Win32::Registry::Error' at C:/Ruby22-x64/lib/ruby/2.2.0/win32/registry.rb:249 - No more data is available. Exception `Resolv::DNS::Config::NXDomain' at C:/Ruby22-x64/lib/ruby/2.2.0/resolv.rb:546 - _rubygems._tcp.ruby.taobao.org Exception `Resolv::DNS::Config::NXDomain' at C:/Ruby22-x64/lib/ruby/2.2.0/resolv.rb:546 - _rubygems._tcp.ruby.taobao.org.beijing.objectiva.local Exception `Resolv::DNS::Config::NXDomain' at C:/Ruby22-x64/lib/ruby/2.2.0/resolv.rb:546 - _rubygems._tcp.ruby.taobao.org.Objectiva.local Exception `Resolv::ResolvError' at C:/Ruby22-x64/lib/ruby/2.2.0/resolv.rb:491 - DNS result has no information for _rubygems._tcp.ruby.taobao.org Exception `Errno::EEXIST' at C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:252 - File exists @ dir_s_mkdir - C:/Users/winstonqiao/.gem/specs/ruby.taobao.org%443 Exception `Errno::ENOENT' at C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/remote_fetcher.rb:306 - No such file or directory @ rb_file_s_stat - C:/Users/winstonqiao/.gem/specs/ruby.taobao.org%443/specs.4.8 Exception `OpenSSL::SSL::SSLErrorWaitReadable' at C:/Ruby22-x64/lib/ruby/2.2.0/openssl/buffering.rb:182 - read would block Exception `OpenSSL::SSL::SSLError' at C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed Exception `OpenSSL::SSL::SSLError' at C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:931 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed Exception `Gem::RemoteFetcher::FetchError' at C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/request.rb:88 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems-china.oss-cn-hangzhou.aliyuncs.com/specs.4.8.gz) Exception `Gem::RemoteFetcher::FetchError' at C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/remote_fetcher.rb:285 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems-china.oss-cn-hangzhou.aliyuncs.com/specs.4.8.gz) Error fetching https://ruby.taobao.org/: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems-china.oss-cn-hangzhou.aliyuncs.com/specs.4.8.gz)
我要做个登录页面
我按照这个网页的做http://book.51cto.com/art/200804/68723.htm 我出现了错误uninitialized constant JiankunController::User 我的环境是 Ruby version 1.8.6 (i386-mingw32) RubyGems version 1.3.7 Rack version 1.1 Rails version 2.3.8 Active Record version 2.3.8 Active Resource version 2.3.8 Action Mailer version 2.3.8 Active Support version 2.3.8 Application root C:/Ruby186/sql Environment development Database adapter sqlserver Database schema version 0 log是 Processing JiankunController#login (for 127.0.0.1 at 2010-08-04 11:49:39) [GET] NameError (uninitialized constant JiankunController::User): app/controllers/jiankun_controller.rb:11:in `login' C:/Ruby186/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' C:/Ruby186/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' C:/Ruby186/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' C:/Ruby186/lib/ruby/1.8/webrick/server.rb:162:in `start' C:/Ruby186/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' C:/Ruby186/lib/ruby/1.8/webrick/server.rb:95:in `start' C:/Ruby186/lib/ruby/1.8/webrick/server.rb:92:in `each' C:/Ruby186/lib/ruby/1.8/webrick/server.rb:92:in `start' C:/Ruby186/lib/ruby/1.8/webrick/server.rb:23:in `start' C:/Ruby186/lib/ruby/1.8/webrick/server.rb:82:in `start' Rendered rescues/_trace (78.1ms) Rendered rescues/_request_and_response (0.0ms) Rendering rescues/layout (internal_server_error) 他上面说的和能详细但我不是很了解@user=user.new(params[:user]) 是构造一个User对象,并用接收到的user参数来初始化该对象 那他当中的[:user}对应的是什么? 他所对应的数据库又是什么? 有人能帮我下吗
启动时警告调用webService接口出现Read timed out
## 使用WebServiceTemplate执行webservice接口,且实例化也正常,但是调用后出现Read timed out ## ## ## ----------------- ## ## 以下是实例化WebServiceTemplate ``` @Value("${image.service.server.url.download}") private String ARCHIVE_IMAGE_DOWNLOAD_SERVICE; @Value("${image.service.server.user}") private String ARCHIVE_IMAGE_USER; @Value("${image.service.server.password}") private String ARCHIVE_IMAGE_PASSWORD; @Bean public Jaxb2Marshaller imsDownloadMarshaller() { Jaxb2Marshaller marshaller = new Jaxb2Marshaller(); marshaller.setContextPaths("com.pcitc.framework.modules.archive.ws.ims"); return marshaller; } @Bean public HttpComponentsMessageSender imageMessageSender() { HttpComponentsMessageSender messageSender = new HttpComponentsMessageSender(); messageSender.setCredentials(new UsernamePasswordCredentials(ARCHIVE_IMAGE_USER, ARCHIVE_IMAGE_PASSWORD)); messageSender.setConnectionTimeout(60000); messageSender.setReadTimeout(60000); return messageSender; } @Bean public WebServiceTemplate imgageDownloadServiceTemplate() { WebServiceTemplate webServiceTemplate = new WebServiceTemplate(messageFactory()); webServiceTemplate.setDefaultUri(ARCHIVE_IMAGE_DOWNLOAD_SERVICE); webServiceTemplate.setMarshaller(imsDownloadMarshaller()); webServiceTemplate.setUnmarshaller(imsDownloadMarshaller()); webServiceTemplate.setMessageSender(imageMessageSender()); return webServiceTemplate; } ``` --------------------------------- ## ## 以下是调用代码 --------------------------------- ``` public String getImageDownloadUrlService(String billCode) throws Exception { GetImagesByCode request = new GetImagesByCode(); request.setIn0(billCode); request.setIn1("0"); GetImagesByCodeResponse response1 = (GetImagesByCodeResponse)webServiceTemplate.marshalSendAndReceive(ARCHIVE_IMAGE_DOWNLOAD_SERVICE, request); String result1 = response1 == null ? "" : response1.getOut(); return result1; } ``` ----------------------- ## 超时时间设置为1分钟 ## ## boot项目启动时警告:Calls to this method will NOT be routed to the target instance and might lead to NPEs against uninitialized fields in the proxy instance. ## ## 之前项目没问题,接口可以通,能拿到返回结果,近期突然出现这个问题,不太清楚原因。 ## ## localhost本地调用是没问题的 ## 但是服务器调用就出问题了,防火墙端口是通的,想不到其他原因了。 ## 服务器限制了其他东西嘛?急求大神给思路
C++Primer,定义的String类的问题
在学习C++Primer第13章时,定义的类Spring代码如下: ``` #ifndef STRING_H #define STRING_H #include <memory> #include <cstring> #include <algorithm> #include <iostream> class String { friend String add(const String&, const String&); public: // constructor String(): sz(0), p(nullptr) { } String(const char *cp): sz(std::strlen(cp)), p(alloc.allocate(sz)) { std::uninitialized_copy(cp, cp + sz, p); } // copy control String(const String&); String& operator=(const String&); ~String(); private: static std::allocator<char> alloc; void free(); size_t sz; char *p; }; String::String(const String &s): sz(s.sz), p(alloc.allocate(s.sz)) { std::uninitialized_copy(s.p, s.p + s.sz, p); std::cout << "String(const String&);" << std::endl; } void String::free() { if (p) alloc.deallocate(p, sz); } String::~String() { free(); } String& String::operator=(const String &rhs) { auto newp = alloc.allocate(rhs.sz); std::uninitialized_copy(rhs.p, rhs.p + rhs.sz, newp); free(); p = newp; sz = rhs.sz; std::cout << "String& operator=(const String&);" << std::endl; return *this; } String add(const String &s1, const String &s2) { String newStr; newStr.p = String::alloc.allocate(s1.sz + s2.sz); newStr.sz = s1.sz + s2.sz; std::uninitialized_copy(s2.p, s2.p + s2.sz, std::uninitialized_copy(s1.p, s1.p+s1.sz, newStr.p)); return newStr; } #endif ``` 然而,在用如下代码调试时始终报错: ``` #include <vector> #include "String.h" int main() { std::vector<String> vec; String s1("Hello"); String s2("World"); vec.push_back(s1); vec.push_back(s2); return 0; } ``` 报错内容为: ``` C:\Users\ADMINI~1\AppData\Local\Temp\cchmbeUn.o 13-48.cpp:(.rdata$.refptr._ZN6String5allocE[.refptr._ZN6String5allocE]+0x0): undefined reference to `String::alloc' E:\Programming\C & C++\CppPrimer\CppPrimer\3rd Part\collect2.exe [Error] ld returned 1 exit status ``` 然而String.h文件可以编译通过,不理解错误在哪里,求教。谢谢。
c++初学者这个错误怎么改啊
bgw/packages/MNbridge/MNbridge.cpp: In function 'int createToRildFd()': bgw/packages/MNbridge/MNbridge.cpp:33:40: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] bgw/packages/MNbridge/MNbridge.cpp: In function 'sendAtErrnoType setupToRild()': bgw/packages/MNbridge/MNbridge.cpp:53:21: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] bgw/packages/MNbridge/MNbridge.cpp: In function 'int main(int, char**)': bgw/packages/MNbridge/MNbridge.cpp:163:60: warning: 'pRadio' is used uninitialized in this function [-Wuninitialized] bgw/packages/MNbridge/MNbridge.cpp:167:22: warning: 'Q' is used uninitialized in this function [-Wuninitialized] target thumb C++: MNbridge <= bgw/packages/MNbridge/receive.cpp bgw/packages/MNbridge/receive.cpp: In function 'void receive_loop()': bgw/packages/MNbridge/receive.cpp:51:40: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] bgw/packages/MNbridge/receive.cpp: In function 'android::byte* receive_message(int)': bgw/packages/MNbridge/receive.cpp:72:32: warning: 'recvBuffer' is used uninitialized in this function [-Wuninitialized] In file included from bgw/packages/MNbridge/receive.cpp:10:0: bgw/packages/MNbridge/receive.h: At global scope: bgw/packages/MNbridge/receive.h:10:13: warning: 'void android::receive_loop()' used but never defined [enabled by default] target Executable: MNbridge (out/target/product/mf662c_512/obj/EXECUTABLES/MNbridge_intermediates/LINKED/MNbridge) bgw/packages/MNbridge/MNbridge.cpp:188: error: undefined reference to 'android::thread_receive(void*)' collect2: error: ld returned 1 exit status make: *** [out/target/product/mf662c_512/obj/EXECUTABLES/MNbridge_intermediates/LINKED/MNbridge] 错误 1 make:离开目录“/home/gss/code/8909”
c语言单向链表的问题???
``` #include<stdio.h> #include<stdlib.h> struct node{ int num; struct node *next; }; //构建空的链表 struct node* InitList(struct node *L){ L = (struct node*)malloc(sizeof(struct node)); L = NULL; printf_s("InitList sucess!"); return L; } //创建单链表 struct node* CreateList(struct node *L,int n){ struct node *temp,*p; L = (struct node*)malloc(sizeof(struct node)); L->next = NULL; temp=L; for (int i = 0; i < n; i++){ p = (struct node*)malloc(sizeof(struct node)); scanf_s("%d", &p->num); temp->next = p; temp = p; } temp->next = NULL; return L; } void PrintList(struct node *L){ struct node *temp = L; while (temp != NULL){ printf_s("%d", temp->num); temp = temp->next; } } void PrintMenu(){ printf_s("------Menu------\n"); printf_s("0 InitList\n"); printf_s("1 CreateList\n"); printf_s("2 PrintList\n"); } void main(){ int n,c; struct node *La; PrintMenu(); printf_s("Enter the command: "); scanf_s("%d", &c); switch (c){ case 0: La = InitList(La); break; case 1: printf_s("Enter the number of LinkList: "); scanf_s("%d", &n); La = CreateList(La, n); break; case 2: PrintList(La); break; default: printf_s("ERROR,Enter again: "); break; } system("pause"); } ``` 为什么主函数case 0 的La = InitList(La); 这句报错: error C4700: uninitialized local variable 'La' used。 ????
Spring mvc 整合redis 实例化bean出现问题
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jedisConnectionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.VerifyError: Bad type on operand stack Exception Details: Location: org/springframework/data/redis/connection/jedis/JedisConnectionFactory.createRedisPool()Lredis/clients/util/Pool; @37: invokespecial Reason: Type 'redis/clients/jedis/JedisPoolConfig' (current frame, stack[2]) is not assignable to 'org/apache/commons/pool2/impl/GenericObjectPoolConfig' Current Frame: bci: @37 flags: { } locals: { 'org/springframework/data/redis/connection/jedis/JedisConnectionFactory' } stack: { uninitialized 0, uninitialized 0, 'redis/clients/jedis/JedisPoolConfig', 'java/lang/String', integer, integer, 'java/lang/String' } Bytecode: 0x0000000: bb00 2c59 2ab6 0028 2ab6 0012 b600 2d2a 0x0000010: b600 12b6 002e 2a2a b600 12b7 0029 2ab6 0x0000020: 0012 b600 2ab7 002f b0 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1007) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:953) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4760) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5184) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1588) 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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:463) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:413) 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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) 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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:324) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) 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:745) Caused by: java.lang.VerifyError: Bad type on operand stack Exception Details: Location: org/springframework/data/redis/connection/jedis/JedisConnectionFactory.createRedisPool()Lredis/clients/util/Pool; @37: invokespecial Reason: Type 'redis/clients/jedis/JedisPoolConfig' (current frame, stack[2]) is not assignable to 'org/apache/commons/pool2/impl/GenericObjectPoolConfig' Current Frame: bci: @37 flags: { } locals: { 'org/springframework/data/redis/connection/jedis/JedisConnectionFactory' } stack: { uninitialized 0, uninitialized 0, 'redis/clients/jedis/JedisPoolConfig', 'java/lang/String', integer, integer, 'java/lang/String' } Bytecode: 0x0000000: bb00 2c59 2ab6 0028 2ab6 0012 b600 2d2a 0x0000010: b600 12b6 002e 2a2a b600 12b7 0029 2ab6 0x0000020: 0012 b600 2ab7 002f b0 at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) at java.lang.Class.getConstructor0(Class.java:3075) at java.lang.Class.getDeclaredConstructor(Class.java:2178) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:78) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1000) ... 58 more
ubuntu 交叉编译vlc 源码时,make出错
ubuntu版本号:14.04.5 vlc源码:vlc2.2.4 在liunux上交叉编译vlc2.2.4源码,使得能够在windows上运行 $ export PKG_CONFIG_LIBDIR=$HOME/wcj/my/vlc/vlc2.2.4.3/vlc-2.2.4/contrib/i586-mingw32msvc/lib/pkgconfig $ sudo ../extras/package/win32/configure.sh --host=i586-mingw32msvc 出现以下错误 checking for DV1394... yes checking for DVDREAD... no configure: error: Library dvdread > 4.9.0 needed for dvdread was not found 重新执行 $ bash ../extras/package/win32/configure.sh --host=i586-mingw32msvc --disable-dvdread --disable-goom 结果如下 libvlc configuration -------------------- version : 2.2.4 system : mingw32 architecture : i586 mmx sse sse2 optimizations : yes vlc aliases : cvlc rvlc qvlc svlc nvlc To build vlc and its plugins, type `make', or `./compile' if you like nice colors. 接下来执行 & sudo make 时,出现以下错误 CC network/rootbind.lo CC network/tls.lo CC text/charset.lo CC text/strings.lo CC text/unicode.lo ../../extras/package/win32/../../../src/text/unicode.c: In function ‘vlc_towc’: ../../extras/package/win32/../../../src/text/unicode.c:125: warning: ‘cp’ may be used uninitialized in this function ../../extras/package/win32/../../../src/text/unicode.c: In function ‘IsUTF8’: ../../extras/package/win32/../../../src/text/unicode.c:125: warning: ‘cp’ may be used uninitialized in this function ../../extras/package/win32/../../../src/text/unicode.c:125: note: ‘cp’ was declared here ../../extras/package/win32/../../../src/text/unicode.c: In function ‘EnsureUTF8’: ../../extras/package/win32/../../../src/text/unicode.c:125: warning: ‘cp’ may be used uninitialized in this function ../../extras/package/win32/../../../src/text/unicode.c:125: note: ‘cp’ was declared here ../../extras/package/win32/../../../src/text/unicode.c: In function ‘vlc_strcasestr’: ../../extras/package/win32/../../../src/text/unicode.c:125: warning: ‘cp’ may be used uninitialized in this function ../../extras/package/win32/../../../src/text/unicode.c:125: note: ‘cp’ was declared here ../../extras/package/win32/../../../src/text/unicode.c:125: warning: ‘cp’ may be used uninitialized in this function ../../extras/package/win32/../../../src/text/unicode.c:125: note: ‘cp’ was declared here ../../extras/package/win32/../../../src/text/unicode.c:125: warning: ‘cp’ may be used uninitialized in this function ../../extras/package/win32/../../../src/text/unicode.c:125: note: ‘cp’ was declared here CC text/url.lo ../../extras/package/win32/../../../src/text/url.c:185:3: warning: #warning Drive letter-relative path not implemented! ../../extras/package/win32/../../../src/text/url.c: In function ‘vlc_path2uri’: ../../extras/package/win32/../../../src/text/url.c:188: error: ‘ENOTSUP’ undeclared (first use in this function) ../../extras/package/win32/../../../src/text/url.c:188: error: (Each undeclared identifier is reported only once ../../extras/package/win32/../../../src/text/url.c:188: error: for each function it appears in.) ../../extras/package/win32/../../../src/text/url.c:502:19: error: idna.h: No such file or directory ../../extras/package/win32/../../../src/text/url.c: In function ‘vlc_idna_to_ascii’: ../../extras/package/win32/../../../src/text/url.c:518: error: implicit declaration of function ‘idna_to_ascii_8z’ ../../extras/package/win32/../../../src/text/url.c:518: error: ‘IDNA_ALLOW_UNASSIGNED’ undeclared (first use in this function) ../../extras/package/win32/../../../src/text/url.c:518: error: ‘IDNA_SUCCESS’ undeclared (first use in this function) make[3]: *** [text/url.lo] Error 1 make[3]: Leaving directory `/home/wcj/my/vlc/vlc2.2.4.3/vlc-2.2.4/win32/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/wcj/my/vlc/vlc2.2.4.3/vlc-2.2.4/win32/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/wcj/my/vlc/vlc2.2.4.3/vlc-2.2.4/win32' make: *** [all] Error 2 请教各位大师,出现这种错误该如何解决?
刷新之后出现model无法找到的错误如何解决
做了一个简单的rails测试应用,ruby script/srever启动之后,第一次访问结果正常,再次刷新就出现model无法找到的name error,请各位大侠指导。谢谢! 错误信息如下:其中Event是我的model class name NameError in AdminController#index uninitialized constant AdminController::Event RAILS_ROOT: /home/iease/iease Application Trace | Framework Trace | Full Trace /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:492:in `const_missing' app/controllers/admin_controller.rb:3:in `index' 版本是2.1.0 [b]问题补充:[/b] admin controller代码如下: class AdminController < ApplicationController def index @rec = Event.find(10) end end [b]问题补充:[/b] 比较奇怪的是我每次重启webrick之后,第一次访问都是正常的,但是之后就出现问题。不太理解这个原因。 [b]问题补充:[/b] 使用./script/console测试没有问题,多次调用Event.find****都是正常的。 [b]问题补充:[/b] admin/index.rhtml: <p>Hello world</p> <p> <%=@rec.act_description%> </p>
c++ 运算符的重载 运行时出现 debug 请各位大神帮忙找错
// Chapter 8 of C++ How to Program // doubleScriptedArray.h #ifndef DARRAY_H #define DARRAY_H #include <iostream> using std::ostream; using std::istream; class DoubleScriptedArray { friend ostream &operator<<(ostream&, const DoubleScriptedArray & ); /* write declaration for overloaded ostream operator */ friend istream &operator>>( istream &,const DoubleScriptedArray & ); public: DoubleScriptedArray( int = 10, int = 10 ); DoubleScriptedArray( const DoubleScriptedArray & ); ~DoubleScriptedArray(); /* write prototype for overloaded = operator */ const DoubleScriptedArray &operator=( const DoubleScriptedArray &); bool operator==( const DoubleScriptedArray & ) const; DoubleScriptedArray operator!=(DoubleScriptedArray &right)const /* write header for operator != */ { return ! ( *this == right ); } int &operator()( int, int ); int &operator()(int ,int )const;// lvalue /* write prototype for overloaded () operator used as an rvalue */ private: int rows; // number of rows in array int columns; // number of columns in array int *ptr; // pointer to first element of array }; #endif #include <iostream> using std::cout; using std::cin; using std::endl; #include <iomanip> using std::setw; #include <cstdlib> #include <cassert> #include "doubleScriptedArray.h" DoubleScriptedArray::DoubleScriptedArray( int r, int c ) { rows = ( r > 0 ? r : 10 ); columns = ( c > 0 ? c : 10 ); ptr = new int[ rows * columns ]; assert( ptr != 0 ); for ( int i = 0; i < rows * columns; i++ ) ptr[ i ] = 0; } DoubleScriptedArray::DoubleScriptedArray( const DoubleScriptedArray &init ) { rows = init.rows; columns = init.columns; ptr = new int[ rows * columns ]; assert( ptr != 0 ); for ( int i = 0; i < rows * columns; i++ ) ptr[ i ] = init.ptr[ i ]; } /* write definition for destructor */ DoubleScriptedArray::~DoubleScriptedArray() { delete []ptr; } /* write definition for operator = */ const DoubleScriptedArray &DoubleScriptedArray::operator =(const DoubleScriptedArray &init) { rows = init.rows; columns = init.columns; ptr = new int[ rows * columns ]; assert( ptr != 0 ); for ( int i = 0; i < rows * columns; i++ ) ptr[ i ] = init.ptr[ i ]; return *this; } bool DoubleScriptedArray::operator==( const DoubleScriptedArray &right ) const { if ( rows != right.rows ) return false; if ( columns != right.columns ) return false; for ( int i = 0; i < rows * columns; i++ ) if ( ptr[ i ] != right.ptr[ i ] ) return false; return true; } // Overloaded subscript operator for non-const Arrays // reference return creates an lvalue int &DoubleScriptedArray::operator()( int s1, int s2 ) { assert( s1 > 0 && s1 < rows ); assert( s2 > 0 && s2 < columns ); return ptr[ columns * s1 + s2 ]; } // Overloaded subscript operator for const Arrays // const reference return creates an rvalue /* write overloaded subscript operator that returns an rvalue */ int &DoubleScriptedArray::operator()(int s1,int s2 )const { assert( s1 > 0 && s1 < rows ); assert( s2 > 0 && s2 < columns ); return ptr[ columns * s1 + s2 ]; } istream &operator>>( istream &input, const DoubleScriptedArray &a ) { for ( int i = 0; i < a.rows * a.columns; i++ ) input >> a.ptr[ i ]; return input; } /* write function header for overloaded insertion operator */ ostream &operator<<(ostream & output,const DoubleScriptedArray &a ) { for ( int i = 0; i < a.rows * a.columns; i++ ) { output << setw( 6 ) << a.ptr[ i ]; if ( ( i + 1 ) % a.columns == 0 ) output << endl; } if ( i % a.columns != 0 ) output << endl; return output; } // Chapter 8 of C++ How to Program // Driver for class DoubleScriptedArray #include <iostream> using std::cout; using std::cin; using std::endl; #include <ctime> #include<cstdlib> #include<stdlib.h> using namespace std; #include "doubleScriptedArray.h" int main() { // seed rand function srand( time( 0 ) ); // create two arrays with different dimensions DoubleScriptedArray a( 6, 7 ), b( 8, 2 ); cout << "Uninitialized array \"a\" is: \n" << a << "Uninitialized array \"b\" is: \n" << b; // initialize array "a" with random values (0-100) for ( int i = 0; i < 6; i++ ) for ( int j = 0; j < 7; j++ ) a(i,j)=rand()%100; /* write statement to insert random elements (reduced to a range of 0 - 100) into the array via the overloaded () */ // use overloaded operator= b = a; cout << "\nInitialized array \"a\" is now:\n" << a << "Assigning b = a:\n" << b; // check if arrays are equal using overloaded == if ( a == b ) cout << "\"a\" was found to be equal to \"b\"\n"; else cout << "\"a\" was found to be not equal to \"b\"\n"; // retrieve an array element using overloaded operator() cout << "The element (2, 1) of array \"a\" is: " << a( 2, 1 ) << endl; // change an element of the array using overloaded operator() a( 2, 1 ) = -1; cout << "Changed element (2, 1) to -1: \n" << a; // check if arrays are still equal if (a==b /* write condition to check if arrays are equal */ ) cout << "\"a\" was found to be equal to \"b\"\n"; else cout << "\"a\" was found to be NOT equal to \"b\"\n"; return 0; }
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私有的数
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
此博客仅为我业余记录文章所用,发布到此,仅供网友阅读参考,如有侵权,请通知我,我会删掉。 补充 有不少读者留言说本文章没有用,因为天气预报直接打开手机就可以收到了,为何要多此一举发送到邮箱呢!!!那我在这里只能说:因为你没用,所以你没用!!! 这里主要介绍的是思路,不是天气预报!不是天气预报!!不是天气预报!!!天气预报只是用于举例。请各位不要再刚了!!! 下面是我会用到的两个场景: 每日下
死磕YOLO系列,YOLOv1 的大脑、躯干和手脚
YOLO 是我非常喜欢的目标检测算法,堪称工业级的目标检测,能够达到实时的要求,它帮我解决了许多实际问题。 这就是 YOLO 的目标检测效果。它定位了图像中物体的位置,当然,也能预测物体的类别。 之前我有写博文介绍过它,但是每次重新读它的论文,我都有新的收获,为此我准备写一个系列的文章来详尽分析它。这是第一篇,从它的起始 YOLOv1 讲起。 YOLOv1 的论文地址:https://www.c...
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的回答,对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalking,作者吴晟、刘浩杨 等等 仓库地址: apache/skywalking 更...
20行Python代码爬取王者荣耀全英雄皮肤
引言 王者荣耀大家都玩过吧,没玩过的也应该听说过,作为时下最火的手机MOBA游戏,咳咳,好像跑题了。我们今天的重点是爬取王者荣耀所有英雄的所有皮肤,而且仅仅使用20行Python代码即可完成。 准备工作 爬取皮肤本身并不难,难点在于分析,我们首先得得到皮肤图片的url地址,话不多说,我们马上来到王者荣耀的官网: 我们点击英雄资料,然后随意地选择一位英雄,接着F12打开调试台,找到英雄原皮肤的图片...
简明易理解的@SpringBootApplication注解源码解析(包含面试提问)
欢迎关注文章系列 ,关注我 《提升能力,涨薪可待》 《面试知识,工作可待》 《实战演练,拒绝996》 欢迎关注我博客,原创技术文章第一时间推出 也欢迎关注公 众 号【Ccww笔记】,同时推出 如果此文对你有帮助、喜欢的话,那就点个赞呗,点个关注呗! 《提升能力,涨薪可待篇》- @SpringBootApplication注解源码解析 一、@SpringBootApplication 的作用是什...
西游记团队中如果需要裁掉一个人,会先裁掉谁?
2019年互联网寒冬,大批企业开始裁员,下图是网上流传的一张截图: 裁员不可避免,那如何才能做到不管大环境如何变化,自身不受影响呢? 我们先来看一个有意思的故事,如果西游记取经团队需要裁员一名,会裁掉谁呢,为什么? 西游记团队组成: 1.唐僧 作为团队teamleader,有很坚韧的品性和极高的原则性,不达目的不罢休,遇到任何问题,都没有退缩过,又很得上司支持和赏识(直接得到唐太宗的任命,既给袈...
Python语言高频重点汇总
Python语言高频重点汇总 GitHub面试宝典仓库 回到首页 目录: Python语言高频重点汇总 目录: 1. 函数-传参 2. 元类 3. @staticmethod和@classmethod两个装饰器 4. 类属性和实例属性 5. Python的自省 6. 列表、集合、字典推导式 7. Python中单下划线和双下划线 8. 格式化字符串中的%和format 9. 迭代器和生成器 10...
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外
ES6基础-ES6的扩展
进行对字符串扩展,正则扩展,数值扩展,函数扩展,对象扩展,数组扩展。 开发环境准备: 编辑器(VS Code, Atom,Sublime)或者IDE(Webstorm) 浏览器最新的Chrome 字符串的扩展: 模板字符串,部分新的方法,新的unicode表示和遍历方法: 部分新的字符串方法 padStart,padEnd,repeat,startsWith,endsWith,includes 字...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
你知道的越多,你不知道的越多 点赞再看,养成习惯 本文 GitHub https://github.com/JavaFamily 已收录,有一线大厂面试点思维导图,也整理了很多我的文档,欢迎Star和完善,大家面试可以参照考点复习,希望我们一起有点东西。 前前言 为啥今天有个前前言呢? 因为你们的丙丙啊,昨天有牌面了哟,直接被微信官方推荐,知乎推荐,也就仅仅是还行吧(心里乐开花)
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca
Python爬虫精简步骤1 获取数据
爬虫的工作分为四步: 1.获取数据。爬虫程序会根据我们提供的网址,向服务器发起请求,然后返回数据。 2.解析数据。爬虫程序会把服务器返回的数据解析成我们能读懂的格式。 3.提取数据。爬虫程序再从中提取出我们需要的数据。 4.储存数据。爬虫程序把这些有用的数据保存起来,便于你日后的使用和分析。 这一篇的内容就是:获取数据。 首先,我们将会利用一个强大的库——requests来获取数据。 在电脑上安装
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 更多有趣分析教程,扫描下方二维码关注vx公号「裸睡的猪」 即可查看! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布
web前端javascript+jquery知识点总结
Javascript javascript 在前端网页中占有非常重要的地位,可以用于验证表单,制作特效等功能,它是一种描述语言,也是一种基于对象(Object)和事件驱动并具有安全性的脚本语言 ,语法同java类似,是一种解释性语言,边执行边解释。 JavaScript的组成: ECMAScipt 用于描述: 语法,变量和数据类型,运算符,逻辑控制语句,关键字保留字,对象。 浏览器对象模型(Br
Qt实践录:开篇
本系列文章介绍笔者的Qt实践之路。
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ......
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。   再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。   下文是原回答,希望能对你能有所启发。   如果我说,这个世界上人真的分三六九等,
为什么听过很多道理,依然过不好这一生?
记录学习笔记是一个重要的习惯,不希望学习过的东西成为过眼云烟。做总结的同时也是一次复盘思考的过程。 本文是根据阅读得到 App上《万维钢·精英日课》部分文章后所做的一点笔记和思考。学习是一个系统的过程,思维模型的建立需要相对完整的学习和思考过程。以下观点是在碎片化阅读后总结的一点心得总结。
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计
一条链接即可让黑客跟踪你的位置! | Seeker工具使用
搬运自:冰崖的部落阁(icecliffsnet) 严正声明:本文仅限于技术讨论,严禁用于其他用途。 请遵守相对应法律规则,禁止用作违法途径,出事后果自负! 上次写的防社工文章里边提到的gps定位信息(如何防止自己被社工或人肉) 除了主动收集他人位置信息以外,我们还可以进行被动收集 (没有技术含量) Seeker作为一款高精度地理位置跟踪工具,同时也是社交工程学(社会工程学)爱好者...
作为程序员的我,大学四年一直自学,全靠这些实用工具和学习网站!
我本人因为高中沉迷于爱情,导致学业荒废,后来高考,毫无疑问进入了一所普普通通的大学,实在惭愧...... 我又是那么好强,现在学历不行,没办法改变的事情了,所以,进入大学开始,我就下定决心,一定要让自己掌握更多的技能,尤其选择了计算机这个行业,一定要多学习技术。 在进入大学学习不久后,我就认清了一个现实:我这个大学的整体教学质量和学习风气,真的一言难尽,懂的人自然知道怎么回事? 怎么办?我该如何更好的提升
前端JS初级面试题二 (。•ˇ‸ˇ•。)老铁们!快来瞧瞧自己都会了么
1. 传统事件绑定和符合W3C标准的事件绑定有什么区别? 传统事件绑定 &lt;div onclick=""&gt;123&lt;/div&gt; div1.onclick = function(){}; &lt;button onmouseover=""&gt;&lt;/button&gt; 注意: 如果给同一个元素绑定了两次或多次相同类型的事件,那么后面的绑定会覆盖前面的绑定 (不支持DOM事...
相关热词 c#导入fbx c#中屏蔽键盘某个键 c#正态概率密度 c#和数据库登陆界面设计 c# 高斯消去法 c# codedom c#读取cad文件文本 c# 控制全局鼠标移动 c# temp 目录 bytes初始化 c#
立即提问