安卓xutils3初始化错误

红米手机4.4.4打开应用闪退,爆java.lang.NoClassDefFoundError: org.xutils.common.task.TaskControllerImpl,定位在application的xutils3的初始化上面,其他5.0+的手机打开正常,请问有人遇到嘛

xutils3初始化语句 x.Ext.init(this);

谢谢大家了

5个回答

这个问题解决了,我产生此问题的原型是由于在android stuido 中进行了分包的处理,分包处理后把项目application继承的父类改为MultiDexApplication 即可。

qq_36078915
GZM_Android 很叼 这东西我第一次知道!
2 年多之前 回复
u012532233
ZoeLulur 谢天谢地 看到了你
2 年多之前 回复
a1005901624
Minzou 牛逼,给你双击666,搞了两天不知道哪儿的原因
接近 3 年之前 回复
YDHIT
android_student1 楼主 你这个MultiDexApplication 哪儿来的
接近 3 年之前 回复
suguanglei
suguanglei 我服,就是这个问题,解决了,牛逼
大约 3 年之前 回复
qq_26297155
Jvmlz 高明,遇到同样的问题,这个方法解决了 谢谢
3 年多之前 回复
itpoxiao
itpoxiao 遇到同样的问题,这个方法解决了。多谢
3 年多之前 回复

我也遇到了这个问题,解决了吗?

我只能说6b我也解决了

楼主,你好。我的没有起作用,依旧报错。您有什么解决方案么。

楼主 你这个MultiDexApplication 哪儿来的

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
codis部署关于slots初始化报错
各位大神好我在部署codis的时候初始化slots有如下报错,且dashboard通过浏览器访问admin反馈404 2015/04/17 09:53:16 main.go:139: [fatal] /usr/local/codis/cmd/cconfig/utils.go:64: http status code 404, 404 page not found
无法初始化类对象-XCode
执行文件如下: @implementation Utils +(id)alloc { return [self instance]; } +(Utils *)instance { static Utils *utils = nil; if (!utils) { utils = [self init]; } return utils; } -(Utils *)init { self = [super init]; if (self) { mConst = [Constants instance]; mCONT_REGEXP = [mConst CONT_REGEXP]; } return self; } 在调用```[Utils instance];```时报错: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[Utils<0xbff54> init]: cannot init a class object.'
android utils 请求https的问题
使用xUtils 2.6 框架请求接口,地址是https的 出现javax.net.ssl.SSLException: SSL handshake aborted: ssl=0x61078d10: I/O error during system call, Connection reset by peer 这个错误,搜索了很多结果,不知道如何解决, 有人遇到过这样的问题吗?是怎么解决的呢
java quartz 初始化异常
2016-04-19 02:11:11,421 (QuartzScheduler.java:2425)-An error occured instantiating job to be executed. job= 'maxbet_job_group.isn_job_group' org.quartz.SchedulerException: Problem instantiating class 'com.thrash.job.DataJob' - [See nested exception: java.util.ConcurrentModificationException] at org.quartz.core.JobRunShell.initialize(JobRunShell.java:134) at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:375) Caused by: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(Unknown Source) at java.util.HashMap$EntryIterator.next(Unknown Source) at java.util.HashMap$EntryIterator.next(Unknown Source) at org.quartz.utils.DirtyFlagMap$DirtyFlagIterator.next(DirtyFlagMap.java:314) at org.quartz.utils.DirtyFlagMap$DirtyFlagMapEntryIterator.next(DirtyFlagMap.java:375) at org.quartz.utils.DirtyFlagMap$DirtyFlagMapEntryIterator.next(DirtyFlagMap.java:368) at java.util.HashMap.putAll(Unknown Source) at org.quartz.utils.DirtyFlagMap.putAll(DirtyFlagMap.java:184) at org.quartz.simpl.PropertySettingJobFactory.newJob(PropertySettingJobFactory.java:72) at org.quartz.core.JobRunShell.initialize(JobRunShell.java:127) ... 1 more
django File "/home/tarena/.local/lib/python3.5/site-packages/django/utils/crypto.py", line 6, in <module> import secrets ImportError: No module named 'secrets'
提起django服务:python3 manage.py runserver时,显示import secrets ImportError ```python File "/home/tarena/.local/lib/python3.5/site-packages/django/utils/crypto.py", line 6, in <module> import secrets ImportError: No module named 'secrets' ``` 请问有谁知道怎么解决a
做keras的可视化时utils.apply_modifications出错
**#(1)用mnist文件生成了model.h5文件:** import numpy as np import keras from keras.datasets import mnist from keras.models import Sequential,Model from keras.layers import Dense,Dropout,Flatten,Activation,Input from keras.layers import Conv2D,MaxPooling2D from keras import backend as K batch_size=128 num_classes=10 epochs=5 #定义图像的长宽 img_rows,img_cols=28,28 #加载mnist数据集 (x_train,y_train),(x_test,y_test)=mnist.load_data() #定义图像的格式 x_train=x_train.reshape(x_train.shape[0],img_rows,img_cols,1) x_test=x_test.reshape(x_test.shape[0],img_rows,img_cols,1) input_shape=(img_rows,img_cols,1) x_train=x_train.astype('float32') x_test=x_test.astype('float32') x_train/=255 x_test/=255 print('x_train shape:',x_train.shape) print(x_train.shape[0],'train samples') print(x_test.shape[0],'test samples') y_train=keras.utils.to_categorical(y_train,num_classes) y_test=keras.utils.to_categorical(y_test,num_classes) #开始DNN网络 model=Sequential() model.add(Conv2D(32,kernel_size=(3,3),activation='relu',input_shape=input_shape)) model.add(Conv2D(54,(3,3),activation='relu')) model.add(MaxPooling2D(pool_size=(2,2))) model.add(Dropout(0.25)) model.add(Flatten()) model.add(Dense(128,activation='relu')) model.add(Dropout(0.5)) model.add(Dense(num_classes,activation='softmax',name='preds')) model.compile(loss=keras.losses.categorical_crossentropy,optimizer=keras.optimizers.Adam(),metrics=['accuracy']) model.fit(x_train,y_train,batch_size=batch_size,epochs=epochs,verbose=1,validation_data=(x_test,y_test)) score=model.evaluate(x_test,y_test,verbose=0) print('Test loss:',score[0]) print('Test accuracy:',score[1]) model.save('model.h5') **#(2)用生成的mnist文件做测试:** from keras.models import load_model from vis.utils import utils from keras import activations model=load_model('model.h5') layer_idx=utils.find_layer_idx(model,'preds') model.layers[layer_idx].activation=activations.linear model = utils.apply_modifications(model) 报错:FileNotFoundError: [WinError 3] 系统找不到指定的路径。: '/tmp/curzzxs_.h5'
训练了一段时间出现了Exception ignored in: <bound method _DataLoaderIter.__del__ of <torch.utils.data.dataloader._DataLoaderIter object at 0x7f3e6f2f14e0>>问题,请问如何解决?
错误内容: Exception ignored in: <bound method _DataLoaderIter.__del__ of <torch.utils.data.dataloader._DataLoaderIter object at 0x7f3e6f2f14e0>> Traceback (most recent call last): File "/home/omnisky/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 399, in __del__ File "/home/omnisky/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 378, in _shutdown_workers File "/usr/lib/python3.5/multiprocessing/queues.py", line 345, in get File "<frozen importlib._bootstrap>", line 969, in _find_and_load File "<frozen importlib._bootstrap>", line 954, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 887, in _find_spec TypeError: 'NoneType' object is not iterable (https://img-ask.csdn.net/upload/201910/08/1570495131_689106.png)
在初始化ambari的出现了 这种情况 在线的大佬求解
[ ~]# service ambari-server start Using python /usr/bin/python2.7 Starting ambari-server Traceback (most recent call last): File "/usr/sbin/ambari-server.py", line 279, in <module> PG_HBA_DIR = utils.get_postgre_hba_dir(OS_FAMILY) File "/usr/lib/python2.6/site-packages/ambari_server/utils.py", line 198, in get_postgre_hba_dir os.symlink(glob.glob(PG_HBA_INIT_FILES[OS_FAMILY] + '*')[0], IndexError: list index out of range
django.db.utils.InternalError: (1050, "Table 'django_content_type' already exists") 迁移文件建立数据表的时候一直报错
django.db.utils.InternalError: (1050, "Table 'django_content_type' already exists") 在网上看到很多的方法,大概都是 先删除 所有的迁移文件, 再删除 数据库中对应的 Django_migrations 表里面的所有数据 之后再进行创建迁移文件然后再执行创建数据表的操作,但是报 没有应用啥啥啥的错误。。。 接着执行: python manage.py migrate booktest --fake 结果再执行 : python manage.py migrate 还是报 1050 的错误。。。。。。。。 下面附上详细报错信息,求网友大哥们解答~~!! (django_py3) huangdonglin@huangdonglin-virtual-machine:~/django_show/test2$ python manage.py migrate Operations to perform: Synchronize unmigrated apps: messages, staticfiles Apply all migrations: admin, booktest, sessions, auth, contenttypes Synchronizing apps without migrations: Creating tables... Running deferred SQL... Installing custom SQL... Running migrations: Rendering model states... DONE Applying contenttypes.0001_initial...Traceback (most recent call last): File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/db/backends/utils.py", line 62, in execute return self.cursor.execute(sql) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 124, in execute return self.cursor.execute(query, args) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/cursors.py", line 170, in execute result = self._query(query) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/cursors.py", line 328, in _query conn.query(q) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/connections.py", line 517, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/connections.py", line 732, in _read_query_result result.read() File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/connections.py", line 1075, in read first_packet = self.connection._read_packet() File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/connections.py", line 684, in _read_packet packet.check_error() File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/protocol.py", line 220, in check_error err.raise_mysql_exception(self._data) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/err.py", line 109, in raise_mysql_exception raise errorclass(errno, errval) pymysql.err.InternalError: (1050, "Table 'django_content_type' already exists") The above exception was the direct cause of the following exception: Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line utility.execute() File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/core/management/__init__.py", line 330, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/core/management/base.py", line 390, in run_from_argv self.execute(*args, **cmd_options) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/core/management/base.py", line 441, in execute output = self.handle(*args, **options) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 221, in handle executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/db/migrations/executor.py", line 110, in migrate self.apply_migration(states[migration], migration, fake=fake, fake_initial=fake_initial) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/db/migrations/executor.py", line 147, in apply_migration state = migration.apply(state, schema_editor) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/db/migrations/migration.py", line 115, in apply operation.database_forwards(self.app_label, schema_editor, old_state, project_state) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/db/migrations/operations/models.py", line 59, in database_forwards schema_editor.create_model(model) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 286, in create_model self.execute(sql, params or None) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 111, in execute cursor.execute(sql, params) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/db/backends/utils.py", line 79, in execute return super(CursorDebugWrapper, self).execute(sql, params) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/db/utils.py", line 97, in __exit__ six.reraise(dj_exc_type, dj_exc_value, traceback) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/utils/six.py", line 658, in reraise raise value.with_traceback(tb) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/db/backends/utils.py", line 62, in execute return self.cursor.execute(sql) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 124, in execute return self.cursor.execute(query, args) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/cursors.py", line 170, in execute result = self._query(query) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/cursors.py", line 328, in _query conn.query(q) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/connections.py", line 517, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/connections.py", line 732, in _read_query_result result.read() File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/connections.py", line 1075, in read first_packet = self.connection._read_packet() File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/connections.py", line 684, in _read_packet packet.check_error() File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/protocol.py", line 220, in check_error err.raise_mysql_exception(self._data) File "/home/huangdonglin/.virtualenvs/django_py3/lib/python3.6/site-packages/pymysql/err.py", line 109, in raise_mysql_exception raise errorclass(errno, errval)
android 关于libmp3lame音频格式的问题
我在网上找到的关于lame将android的arm格式音频转化为通用的mp3, 目前在5.0以下的版本运行没有问题,在5.0的android手机运行出现 java.lang.UnsatisfiedLinkError: No implementation found for void com.pocketdigi.utils.FLameUtils.initEncoder(int, int, int, int, int) (tried Java_com_pocketdigi_utils_FLameUtils_initEncoder and Java_com_pocketdigi_utils_FLameUtils_initEncoder__IIIII) 我单独简单的写了一个小的demo,可以在5.0手机运行,求大神给个解决方法,非常感谢。
No module named 'theano_utils'
WARNING (theano.configdefaults): install mkl with `conda install mkl-service`: No module named 'mkl' WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions. Traceback (most recent call last): File "train_mRNN.py", line 1, in <module> import fasta, preprocessing, model, evaluate File "G:\生物信息学入门\代码\mRNN-master\mRNN-master\model.py", line 3, in <module> from passage.layers import Embedding, GatedRecurrent, Dense, OneHot, LstmRecurrent, Generic File "d:\anaconda3\lib\site-packages\passage\layers.py", line 6, in <module> from theano_utils import shared0s, floatX ModuleNotFoundError: No module named 'theano_utils' 这个怎么改啊
【小白求助】安卓opencv用分类器对人脸进行识别的一些问题
小白入门,最近在看opencv的人脸识别(分类) 然后按照网上的代码,学习了之后,自己写了一段,发现运行的时候会卡很久,甚至直接退出,并且越用越卡。 我想实现的是对一张图片进行读入,然后加载多个分类器对图片内容进行识别,从而达到分类的目的。 我那个问题困扰了我一天,想来求助大神 我加载人脸识别的模型没问题,但是同时加载两个模型,比如说人脸和上身,就会卡死。 代码分3个部分,分别是MainActivity.java , execDetect.java , Detector.java 以下是MainActivity.java ``` package com.RinGo.IMGfenlei; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.ImageButton; import android.widget.TextView; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import org.opencv.android.Utils; import org.opencv.core.Mat; import org.opencv.core.MatOfRect; import org.opencv.core.Rect; import org.opencv.core.Scalar; import org.opencv.imgproc.Imgproc; import org.opencv.objdetect.CascadeClassifier; public class MainActivity extends AppCompatActivity { private Detector frontfaceDetector; private Detector smileDetector; private static String CAMERAIMAGENAME = "image.jpg"; private ImageButton imageButton; private ImageButton imageButton2; private TextView textView; private Bitmap bitmap; private Bitmap rectBitmap; private Bitmap resizeBitmap; private Toast toast; private Button addFile; private Button startDetect; private Button check; private execDetect toDetcet; private String show; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textView = (TextView) findViewById(R.id.tv_face); // imageButton = (ImageButton) findViewById(R.id.iv_face); //imageButton.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL); // imageButton2 = (ImageButton) findViewById(R.id.iv_face2); // imageButton2.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL); toDetcet=new execDetect(); addFile=(Button)findViewById(R.id.addPic); startDetect=(Button)findViewById(R.id.startDetect); check=(Button)findViewById(R.id.check); startDetect.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // startDetect.setClickable(false); textView.setText("正在检测"); // detect(); Thread d =new Thread(new Runnable() { @Override public void run() { toDetcet.initExecDetect(MainActivity.this,bitmap); // Toast.makeText(MainActivity.this, "initialize succeed", Toast.LENGTH_SHORT).show(); show= toDetcet.startDetect(); // Toast.makeText(MainActivity.this, " succeed", Toast.LENGTH_SHORT).show(); } }); d.run(); textView.setText(show); // startDetect.setClickable(true); } }); check.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // startDetect.setClickable(false); textView.setText(toDetcet.getReturntoMain()); // startDetect.setClickable(true); } }); addFile.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // 添加照片 // 打开本地相册 Intent intent1 = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(intent1, 101); //startActivity(intent1); } }); String strLibraryName = "opencv_java3"; // 不需要添加前缀 libopencv_java3 { try { Log.e("loadLibrary", strLibraryName); System.loadLibrary(strLibraryName); //System.loadLibrary(Core.NATIVE_LIBRARY_NAME); // couldn't find "libopencv_java320.so" } catch (UnsatisfiedLinkError e) { Log.e("loadLibrary", "Native code library failed to load.\n" + e); } catch (Exception e) { Log.e("loadLibrary", "Exception: " + e); } } // frontfaceDetector = new Detector(this, R.raw.haarcascade_frontalface_alt, 6, 0.2F, 0.2F, new Scalar(255, 0, 0, 255)); } /** * 点击添加照片事件 * * @param v */ public void onClick(View v) { int bt_id = v.getId(); switch (bt_id) { /* case R.id.takePhoto: // 拍照 // 打开本地相机 Intent intent2 = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); Uri imageUri = Uri.fromFile(new File(Environment.getExternalStorageDirectory(), CAMERAIMAGENAME)); intent2.putExtra(MediaStore.EXTRA_OUTPUT, imageUri); startActivityForResult(intent2, 102); break; */ case R.id.back: this.finish(); break; default: break; } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); // 加判断 不选择照片或者不拍照时不闪退 //Log.e("data", String.valueOf(data)); //if (data == null) //return; bitmap = null; switch (requestCode) { // 选择图片库的图片 case 101: if (resultCode == RESULT_OK) { try { Uri uri = data.getData(); bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), uri); } catch (Exception e) { e.printStackTrace(); } } break; // 表示调用本地照相机拍照 case 102: if (resultCode == RESULT_OK) { //Bundle bundle = data.getExtras(); //bm = (Bitmap) bundle.get("data"); bitmap = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory() + "/" + CAMERAIMAGENAME); } break; default: break; } Log.e("bitmap", String.valueOf(bitmap)); if (bitmap == null) { toast = Toast.makeText(MainActivity.this, "未选择图像", Toast.LENGTH_SHORT); toast.show(); return; } // 识别图片 并画框 /* Thread detect=new Thread(new Runnable() { @Override public void run() { } }); detect.run(); */ // 将照片剪裁 bitmap将被释放重新赋值 //int ibWidth = imageButton.getWidth(); // int ibHeight = imageButton.getHeight(); //resizeBitmap = imageButton.resizeBitmap(bitmap, ibWidth, ibHeight); //imageButton.setBitmap(resizeBitmap); //imageButton2.setBitmap(rectBitmap); } private void detect() { MainActivity.this.runOnUiThread(new Runnable() { @Override public void run() { toDetcet.initExecDetect(MainActivity.this,bitmap); // Toast.makeText(MainActivity.this, "initialize succeed", Toast.LENGTH_SHORT).show(); String show= toDetcet.startDetect(); // Toast.makeText(MainActivity.this, " succeed", Toast.LENGTH_SHORT).show(); textView.setText(show); } }); //textView.setText(toDetcet.getReturntoMain()); } } ``` 以下是activity_main.xml ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:id="@+id/tv_face" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="16dp" android:text="未检测到人脸" android:textColor="@color/colorAccent" app:layout_constraintBottom_toTopOf="@+id/ll1" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" /> <LinearLayout android:id="@+id/ll1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent"> <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton android:id="@+id/addPic" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:layout_weight="1" android:onClick="onClick" android:text=" 选择图片(CV) " android:textSize="16sp" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" /> <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton android:id="@+id/startDetect" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:layout_weight="1" android:onClick="onClick" android:text=" 开始识别 " android:textSize="16sp" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" /> <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton android:id="@+id/check" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:layout_weight="1" android:onClick="onClick" android:text=" 结果 " android:textSize="16sp" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" /> <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton android:id="@+id/back" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="0dp" android:layout_weight="1" android:onClick="onClick" android:text=" 返回 " android:textSize="16sp" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" /> </LinearLayout> </LinearLayout> ``` 以下是execDetect.java ``` package com.RinGo.IMGfenlei; import android.content.Context; import android.graphics.Bitmap; import android.util.Log; import org.opencv.android.Utils; import org.opencv.core.Mat; import org.opencv.core.MatOfRect; import org.opencv.core.Rect; import org.opencv.core.Scalar; import org.opencv.imgproc.Imgproc; import org.opencv.objdetect.CascadeClassifier; import com.RinGo.IMGfenlei.R; import com.RinGo.IMGfenlei.Detector; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; public class execDetect { private Detector frontfaceDetector; private Detector smilefaceDetector; private Detector[] detectors=new Detector[10]; private Detector detector; private Bitmap bitmap; private Bitmap rectBitmap; private String returntoMain=""; private String[] detectorNames=new String[10]; private CascadeClassifier mFrontalFaceClassifier = null; //正脸 级联分类器 private CascadeClassifier mProfileFaceClassifier = null; //侧脸 级联分类器 private int smilefacenum=0; private Context mcontext; private int[] cascades=new int[10]; public void initExecDetect(Context _context,Bitmap _bitmap) { bitmap=_bitmap; mcontext=_context; cascades[0]=R.raw.haarcascade_frontalface_alt; detectors[0] = new Detector(_context,R.raw.haarcascade_frontalface_alt, 1, 0.2F, 0.2F, new Scalar(255, 0, 0, 255)); detectorNames[0]="正面人脸"; cascades[1]=R.raw.lbpcascade_frontalface; detectors[1] = new Detector(_context,R.raw.lbpcascade_frontalface, 1, 0.2F, 0.2F, new Scalar(255, 0, 0, 255)); detectorNames[1]="正面人脸2"; } public String startDetect() { // bitmapToMat Mat toMat = new Mat(); Utils.bitmapToMat(bitmap, toMat); // Mat copyMat = new Mat(); // toMat.copyTo(copyMat); // 复制 // togray Mat gray = new Mat(); MatOfRect mRect = new MatOfRect(); Imgproc.cvtColor(toMat, gray, Imgproc.COLOR_RGBA2GRAY); for (int id = 0; id < detectors.length; id++) { //detector = new Detector(mcontext,cascades[id], 3, 0.1F, 0.1F, new Scalar(255, 0, 0, 255)); try { int num = 0; mRect=new MatOfRect(); Rect[] object = detectors[id].detectObjectImage( gray, mRect); Log.e("objectLength", object.length + ""); num=object.length; /* for (Rect rect : object) { num++; } */ returntoMain =returntoMain+ String.format("检测到%1$d个" + detectorNames[id], num) + "\n"; } catch (Exception e) { e.printStackTrace(); } //textView.setText(String.format("检测到%1$d个人脸", facenum)); //Utils.matToBitmap(toMat, bitmap); } return returntoMain; } public String getReturntoMain() { return returntoMain; } } ``` 以下是Detector.java,定义了我的级联分类器的设置 ``` package com.RinGo.IMGfenlei; import android.content.Context; import org.opencv.core.Mat; import org.opencv.core.MatOfRect; import org.opencv.core.Rect; import org.opencv.core.Scalar; import org.opencv.core.Size; import org.opencv.objdetect.CascadeClassifier; import org.opencv.objdetect.Objdetect; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; /** * Created by think-hxr on 17-10-12. */ public class Detector { private CascadeClassifier mCascadeClassifier; private int mMinNeighbors; private float mRelativeObjectWidth; private float mRelativeObjectHeight; private Scalar mRectColor; /** * 构造方法 * * @param context 上下文 * @param id 级联分类器ID * @param minNeighbors 连续几帧确认目标 * @param relativeObjectWidth 最小宽度屏占比 * @param relativeObjectHeight 最小高度屏占比 * @param rectColor 画笔颜色 */ public Detector(Context context, int id, int minNeighbors, float relativeObjectWidth, float relativeObjectHeight, Scalar rectColor) { context = context.getApplicationContext(); mCascadeClassifier = createDetector(context, id); mMinNeighbors = minNeighbors; mRelativeObjectWidth = relativeObjectWidth; mRelativeObjectHeight = relativeObjectHeight; mRectColor = rectColor; } /** * 创建检测器 * * @param context 上下文 * @param id 级联分类器ID * @return 检测器 */ private CascadeClassifier createDetector(Context context, int id) { CascadeClassifier javaDetector; InputStream is = null; FileOutputStream os = null; try { is = context.getResources().openRawResource(id); File cascadeDir = context.getDir("cascade", Context.MODE_PRIVATE); File cascadeFile = new File(cascadeDir, id + ".xml"); os = new FileOutputStream(cascadeFile); byte[] buffer = new byte[4096]; int bytesRead; while ((bytesRead = is.read(buffer)) != -1) { os.write(buffer, 0, bytesRead); } javaDetector = new CascadeClassifier(cascadeFile.getAbsolutePath()); //javaDetector=new CascadeClassifier(); // javaDetector.load(cascadeFile.getAbsolutePath()); if (javaDetector.empty()) { javaDetector = null; } boolean delete = cascadeDir.delete(); return javaDetector; } catch (IOException e) { e.printStackTrace(); return null; } finally { try { if (null != is) { is.close(); } if (null != os) { os.close(); } } catch (IOException e) { e.printStackTrace(); } } } /** * 目标检测 视频 * * @param gray 灰度图像 * @param object 识别结果的容器 * @return 检测到的目标位置集合 */ public Rect[] detectObject(Mat gray, MatOfRect object) { // 使用Java人脸检测 mCascadeClassifier.detectMultiScale( gray, // 要检查的灰度图像 object, // 检测到的人脸 1.1, // 表示在前后两次相继的扫描中,搜索窗口的比例系数。默认为1.1即每次搜索窗口依次扩大10%; mMinNeighbors, // 默认是3 控制误检测,表示默认几次重叠检测到人脸,才认为人脸存在 Objdetect.CASCADE_SCALE_IMAGE, getSize(gray, mRelativeObjectWidth, mRelativeObjectHeight), // 目标最小可能的大小 gray.size()); // 目标最大可能的大小 return object.toArray(); } /** * 目标检测 图片 * * @param gray 灰度图像 * @param object 识别结果的容器 * @return */ public Rect[] detectObjectImage(Mat gray, MatOfRect object) { mCascadeClassifier.detectMultiScale(gray,object); return object.toArray(); } /** * 根据屏占比获取大小 * * @param gray gray * @param relativeObjectWidth 最小宽度屏占比 * @param relativeObjectHeight 最小高度屏占比 * @return 大小 */ private Size getSize(Mat gray, float relativeObjectWidth, float relativeObjectHeight) { Size size = gray.size(); int cameraWidth = gray.cols(); int cameraHeight = gray.rows(); int width = Math.round(cameraWidth * relativeObjectWidth); int height = Math.round(cameraHeight * relativeObjectHeight); size.width = 0 >= width ? 0 : (cameraWidth < width ? cameraWidth : width); // width [0, cameraWidth] size.height = 0 >= height ? 0 : (cameraHeight < height ? cameraHeight : height); // height [0, cameraHeight] return size; } /** * 获取画笔颜色 * * @return 颜色 */ public Scalar getRectColor() { return mRectColor; } } ```
Utils.GetCookie();是什么意思
GetCookie()知道,Utils是什么意思啊,他有什么作用 贴上这一段代码 protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { txtUserName.Text = Utils.GetCookie("userName", "QiDian"); } }
unitu2018.3.2打包安卓失败
CommandInvokationFailure: Gradle build failed. D:\Unity2018.3.2\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath "D:\Unity2018.3.2\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"stderr[FAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':processReleaseResources'.> Android resource linking failed Output: D:\MrLi_Project\Test\DiaoAndrTest\Temp\gradleOut\build\intermediates\merged_manifests\release\processReleaseManifest\merged\AndroidManifest.xml:2: error: attribute android:installlocation not found. error: failed processing manifest. Command: C:\Users\wo\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\ffcff4d90c05a9190f9bcba790c8c981\aapt2-3.2.0-4818971-windows\aapt2.exe link -I\ D:\AndroidSDK\android-sdk-windows\platforms\android-28\android.jar\ --manifest\ D:\MrLi_Project\Test\DiaoAndrTest\Temp\gradleOut\build\intermediates\merged_manifests\release\processReleaseManifest\merged\AndroidManifest.xml\ -o\ D:\MrLi_Project\Test\DiaoAndrTest\Temp\gradleOut\build\intermediates\processed_res\release\processReleaseResources\out\resources-release.ap_\ -R\ @D:\MrLi_Project\Test\DiaoAndrTest\Temp\gradleOut\build\intermediates\incremental\processReleaseResources\resources-list-for-resources-release.ap_.txt\ --auto-add-overlay\ --java\ D:\MrLi_Project\Test\DiaoAndrTest\Temp\gradleOut\build\generated\not_namespaced_r_class_sources\release\processReleaseResources\r\ --custom-package\ com.l.w\ -0\ apk\ -0\ .unity3d\ -0\ .ress\ -0\ .resource\ -0\ .obb\ --output-text-symbols\ D:\MrLi_Project\Test\DiaoAndrTest\Temp\gradleOut\build\intermediates\symbols\release\R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #0 Output: D:\MrLi_Project\Test\DiaoAndrTest\Temp\gradleOut\build\intermediates\merged_manifests\release\processReleaseManifest\merged\AndroidManifest.xml:2: AAPT: error: attribute android:installlocation not found. error: failed processing manifest. Command: C:\Users\wo\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\ffcff4d90c05a9190f9bcba790c8c981\aapt2-3.2.0-4818971-windows\aapt2.exe link -I\ D:\AndroidSDK\android-sdk-windows\platforms\android-28\android.jar\ --manifest\ D:\MrLi_Project\Test\DiaoAndrTest\Temp\gradleOut\build\intermediates\merged_manifests\release\processReleaseManifest\merged\AndroidManifest.xml\ -o\ D:\MrLi_Project\Test\DiaoAndrTest\Temp\gradleOut\build\intermediates\processed_res\release\processReleaseResources\out\resources-release.ap_\ -R\ @D:\MrLi_Project\Test\DiaoAndrTest\Temp\gradleOut\build\intermediates\incremental\processReleaseResources\resources-list-for-resources-release.ap_.txt\ --auto-add-overlay\ --java\ D:\MrLi_Project\Test\DiaoAndrTest\Temp\gradleOut\build\generated\not_namespaced_r_class_sources\release\processReleaseResources\r\ --custom-package\ com.l.w\ -0\ apk\ -0\ .unity3d\ -0\ .ress\ -0\ .resource\ -0\ .obb\ --output-text-symbols\ D:\MrLi_Project\Test\DiaoAndrTest\Temp\gradleOut\build\intermediates\symbols\release\R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #0* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 3s]stdout[:checkReleaseClasspath UP-TO-DATE:preBuild UP-TO-DATE:preReleaseBuild UP-TO-DATE:compileReleaseAidl NO-SOURCE:compileReleaseRenderscript UP-TO-DATE:checkReleaseManifest UP-TO-DATE:generateReleaseBuildConfig UP-TO-DATE:prepareLintJar UP-TO-DATE:mainApkListPersistenceRelease UP-TO-DATE:generateReleaseResValues UP-TO-DATE:generateReleaseResources UP-TO-DATE:mergeReleaseResources UP-TO-DATE:createReleaseCompatibleScreenManifests UP-TO-DATE:processReleaseManifest:splitsDiscoveryTaskRelease UP-TO-DATE:processReleaseResources FAILED13 actionable tasks: 2 executed, 11 up-to-date]exit code: 1UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <2016e8c2f122447891dcc20b897a6451>:0)UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <2016e8c2f122447891dcc20b897a6451>:0)UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <2016e8c2f122447891dcc20b897a6451>:0)UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <2016e8c2f122447891dcc20b897a6451>:0)UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <2016e8c2f122447891dcc20b897a6451>:0)Rethrow as GradleInvokationException: Gradle build failedUnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <2016e8c2f122447891dcc20b897a6451>:0)UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <2016e8c2f122447891dcc20b897a6451>:0)UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <2016e8c2f122447891dcc20b897a6451>:0)UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
吴恩达深度学习第四课第四周fr_utils.py报错,有人遇到过吗
Face Recognition/fr_utils.py, Line21中_get_session()和Line140中model无法找到引用,请问这是什么原因 加载模型时候会报如下错误: Using TensorFlow backend. 2018-08-26 21:30:53.046324: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 Total Params: 3743280 Traceback (most recent call last): File "C:/Users/51530/PycharmProjects/DL/wuenda/Face/faceV3.py", line 60, in <module> load_weights_from_FaceNet(FRmodel) File "C:\Users\51530\PycharmProjects\DL\wuenda\Face\fr_utils.py", line 133, in load_weights_from_FaceNet weights_dict = load_weights() File "C:\Users\51530\PycharmProjects\DL\wuenda\Face\fr_utils.py", line 154, in load_weights conv_w = genfromtxt(paths[name + '_w'], delimiter=',', dtype=None) File "E:\anaconda\lib\site-packages\numpy\lib\npyio.py", line 1867, in genfromtxt raise ValueError(errmsg) ValueError: Some errors were detected ! Line #7 (got 2 columns instead of 1) Line #12 (got 3 columns instead of 1) Line #15 (got 2 columns instead of 1) 具体此文件: ``` #### PART OF THIS CODE IS USING CODE FROM VICTOR SY WANG: https://github.com/iwantooxxoox/Keras-OpenFace/blob/master/utils.py #### import tensorflow as tf import numpy as np import os import cv2 from numpy import genfromtxt from keras.layers import Conv2D, ZeroPadding2D, Activation, Input, concatenate from keras.models import Model from keras.layers.normalization import BatchNormalization from keras.layers.pooling import MaxPooling2D, AveragePooling2D import h5py import matplotlib.pyplot as plt _FLOATX = 'float32' def variable(value, dtype=_FLOATX, name=None): v = tf.Variable(np.asarray(value, dtype=dtype), name=name) _get_session().run(v.initializer) return v def shape(x): return x.get_shape() def square(x): return tf.square(x) def zeros(shape, dtype=_FLOATX, name=None): return variable(np.zeros(shape), dtype, name) def concatenate(tensors, axis=-1): if axis < 0: axis = axis % len(tensors[0].get_shape()) return tf.concat(axis, tensors) def LRN2D(x): return tf.nn.lrn(x, alpha=1e-4, beta=0.75) def conv2d_bn(x, layer=None, cv1_out=None, cv1_filter=(1, 1), cv1_strides=(1, 1), cv2_out=None, cv2_filter=(3, 3), cv2_strides=(1, 1), padding=None): num = '' if cv2_out == None else '1' tensor = Conv2D(cv1_out, cv1_filter, strides=cv1_strides, data_format='channels_first', name=layer+'_conv'+num)(x) tensor = BatchNormalization(axis=1, epsilon=0.00001, name=layer+'_bn'+num)(tensor) tensor = Activation('relu')(tensor) if padding == None: return tensor tensor = ZeroPadding2D(padding=padding, data_format='channels_first')(tensor) if cv2_out == None: return tensor tensor = Conv2D(cv2_out, cv2_filter, strides=cv2_strides, data_format='channels_first', name=layer+'_conv'+'2')(tensor) tensor = BatchNormalization(axis=1, epsilon=0.00001, name=layer+'_bn'+'2')(tensor) tensor = Activation('relu')(tensor) return tensor WEIGHTS = [ 'conv1', 'bn1', 'conv2', 'bn2', 'conv3', 'bn3', 'inception_3a_1x1_conv', 'inception_3a_1x1_bn', 'inception_3a_pool_conv', 'inception_3a_pool_bn', 'inception_3a_5x5_conv1', 'inception_3a_5x5_conv2', 'inception_3a_5x5_bn1', 'inception_3a_5x5_bn2', 'inception_3a_3x3_conv1', 'inception_3a_3x3_conv2', 'inception_3a_3x3_bn1', 'inception_3a_3x3_bn2', 'inception_3b_3x3_conv1', 'inception_3b_3x3_conv2', 'inception_3b_3x3_bn1', 'inception_3b_3x3_bn2', 'inception_3b_5x5_conv1', 'inception_3b_5x5_conv2', 'inception_3b_5x5_bn1', 'inception_3b_5x5_bn2', 'inception_3b_pool_conv', 'inception_3b_pool_bn', 'inception_3b_1x1_conv', 'inception_3b_1x1_bn', 'inception_3c_3x3_conv1', 'inception_3c_3x3_conv2', 'inception_3c_3x3_bn1', 'inception_3c_3x3_bn2', 'inception_3c_5x5_conv1', 'inception_3c_5x5_conv2', 'inception_3c_5x5_bn1', 'inception_3c_5x5_bn2', 'inception_4a_3x3_conv1', 'inception_4a_3x3_conv2', 'inception_4a_3x3_bn1', 'inception_4a_3x3_bn2', 'inception_4a_5x5_conv1', 'inception_4a_5x5_conv2', 'inception_4a_5x5_bn1', 'inception_4a_5x5_bn2', 'inception_4a_pool_conv', 'inception_4a_pool_bn', 'inception_4a_1x1_conv', 'inception_4a_1x1_bn', 'inception_4e_3x3_conv1', 'inception_4e_3x3_conv2', 'inception_4e_3x3_bn1', 'inception_4e_3x3_bn2', 'inception_4e_5x5_conv1', 'inception_4e_5x5_conv2', 'inception_4e_5x5_bn1', 'inception_4e_5x5_bn2', 'inception_5a_3x3_conv1', 'inception_5a_3x3_conv2', 'inception_5a_3x3_bn1', 'inception_5a_3x3_bn2', 'inception_5a_pool_conv', 'inception_5a_pool_bn', 'inception_5a_1x1_conv', 'inception_5a_1x1_bn', 'inception_5b_3x3_conv1', 'inception_5b_3x3_conv2', 'inception_5b_3x3_bn1', 'inception_5b_3x3_bn2', 'inception_5b_pool_conv', 'inception_5b_pool_bn', 'inception_5b_1x1_conv', 'inception_5b_1x1_bn', 'dense_layer' ] conv_shape = { 'conv1': [64, 3, 7, 7], 'conv2': [64, 64, 1, 1], 'conv3': [192, 64, 3, 3], 'inception_3a_1x1_conv': [64, 192, 1, 1], 'inception_3a_pool_conv': [32, 192, 1, 1], 'inception_3a_5x5_conv1': [16, 192, 1, 1], 'inception_3a_5x5_conv2': [32, 16, 5, 5], 'inception_3a_3x3_conv1': [96, 192, 1, 1], 'inception_3a_3x3_conv2': [128, 96, 3, 3], 'inception_3b_3x3_conv1': [96, 256, 1, 1], 'inception_3b_3x3_conv2': [128, 96, 3, 3], 'inception_3b_5x5_conv1': [32, 256, 1, 1], 'inception_3b_5x5_conv2': [64, 32, 5, 5], 'inception_3b_pool_conv': [64, 256, 1, 1], 'inception_3b_1x1_conv': [64, 256, 1, 1], 'inception_3c_3x3_conv1': [128, 320, 1, 1], 'inception_3c_3x3_conv2': [256, 128, 3, 3], 'inception_3c_5x5_conv1': [32, 320, 1, 1], 'inception_3c_5x5_conv2': [64, 32, 5, 5], 'inception_4a_3x3_conv1': [96, 640, 1, 1], 'inception_4a_3x3_conv2': [192, 96, 3, 3], 'inception_4a_5x5_conv1': [32, 640, 1, 1,], 'inception_4a_5x5_conv2': [64, 32, 5, 5], 'inception_4a_pool_conv': [128, 640, 1, 1], 'inception_4a_1x1_conv': [256, 640, 1, 1], 'inception_4e_3x3_conv1': [160, 640, 1, 1], 'inception_4e_3x3_conv2': [256, 160, 3, 3], 'inception_4e_5x5_conv1': [64, 640, 1, 1], 'inception_4e_5x5_conv2': [128, 64, 5, 5], 'inception_5a_3x3_conv1': [96, 1024, 1, 1], 'inception_5a_3x3_conv2': [384, 96, 3, 3], 'inception_5a_pool_conv': [96, 1024, 1, 1], 'inception_5a_1x1_conv': [256, 1024, 1, 1], 'inception_5b_3x3_conv1': [96, 736, 1, 1], 'inception_5b_3x3_conv2': [384, 96, 3, 3], 'inception_5b_pool_conv': [96, 736, 1, 1], 'inception_5b_1x1_conv': [256, 736, 1, 1], } def load_weights_from_FaceNet(FRmodel): # Load weights from csv files (which was exported from Openface torch model) weights = WEIGHTS weights_dict = load_weights() # Set layer weights of the model for name in weights: if FRmodel.get_layer(name) != None: FRmodel.get_layer(name).set_weights(weights_dict[name]) elif model.get_layer(name) != None: model.get_layer(name).set_weights(weights_dict[name]) def load_weights(): # Set weights path dirPath = './weights' fileNames = filter(lambda f: not f.startswith('.'), os.listdir(dirPath)) paths = {} weights_dict = {} for n in fileNames: paths[n.replace('.csv', '')] = dirPath + '/' + n for name in WEIGHTS: if 'conv' in name: conv_w = genfromtxt(paths[name + '_w'], delimiter=',', dtype=None) conv_w = np.reshape(conv_w, conv_shape[name]) conv_w = np.transpose(conv_w, (2, 3, 1, 0)) conv_b = genfromtxt(paths[name + '_b'], delimiter=',', dtype=None) weights_dict[name] = [conv_w, conv_b] elif 'bn' in name: bn_w = genfromtxt(paths[name + '_w'], delimiter=',', dtype=None) bn_b = genfromtxt(paths[name + '_b'], delimiter=',', dtype=None) bn_m = genfromtxt(paths[name + '_m'], delimiter=',', dtype=None) bn_v = genfromtxt(paths[name + '_v'], delimiter=',', dtype=None) weights_dict[name] = [bn_w, bn_b, bn_m, bn_v] elif 'dense' in name: dense_w = genfromtxt(dirPath+'/dense_w.csv', delimiter=',', dtype=None) dense_w = np.reshape(dense_w, (128, 736)) dense_w = np.transpose(dense_w, (1, 0)) dense_b = genfromtxt(dirPath+'/dense_b.csv', delimiter=',', dtype=None) weights_dict[name] = [dense_w, dense_b] return weights_dict def load_dataset(): train_dataset = h5py.File('datasets/train_happy.h5', "r") train_set_x_orig = np.array(train_dataset["train_set_x"][:]) # your train set features train_set_y_orig = np.array(train_dataset["train_set_y"][:]) # your train set labels test_dataset = h5py.File('datasets/test_happy.h5', "r") test_set_x_orig = np.array(test_dataset["test_set_x"][:]) # your test set features test_set_y_orig = np.array(test_dataset["test_set_y"][:]) # your test set labels classes = np.array(test_dataset["list_classes"][:]) # the list of classes train_set_y_orig = train_set_y_orig.reshape((1, train_set_y_orig.shape[0])) test_set_y_orig = test_set_y_orig.reshape((1, test_set_y_orig.shape[0])) return train_set_x_orig, train_set_y_orig, test_set_x_orig, test_set_y_orig, classes def img_to_encoding(image_path, model): img1 = cv2.imread(image_path, 1) img = img1[...,::-1] img = np.around(np.transpose(img, (2,0,1))/255.0, decimals=12) x_train = np.array([img]) embedding = model.predict_on_batch(x_train) return embedding ```
C++ Zip Utils解压带密码文件,怎么判断密码是对还是错
如题,用C++ 的Zip Utils库解压带密码的压缩文件的时候,用Openzip函数无论密码对错 如何都会打开,那么当密码是错误的时候,哪个函数能反映出来解压密码是错误的,求 大神解答
springmvc整合memcached,无法初始化SockIO pool,困惑!
<div class="iteye-blog-content-contain" style="font-size: 14px;"> <p style="margin-top: 1px; margin-bottom: 1px; cursor: text; color: #666666; font-family: arial, 宋体; line-height: 24px;">自己做了一个springMVC+memcached的示例,启动的时候抛了这个错误 [ERROR] attempting to get SockIO from uninitialized pool!</p> <p style="margin-top: 1px; margin-bottom: 1px; cursor: text; color: #666666; font-family: arial, 宋体; line-height: 24px;">memcachedPool可能有点问题,请大家帮忙看下,谢谢了。</p> <p style="margin-top: 1px; margin-bottom: 1px; cursor: text; color: #666666; font-family: arial, 宋体; line-height: 24px;">​备注:查了很多资料,咱们iteye中有人遇到过相同的问题,我按照他解决的办法并没有起作用。</p> <p style="margin-top: 1px; margin-bottom: 1px; cursor: text; color: #666666; font-family: arial, 宋体; line-height: 24px;">         pengmj 给出的解决办法是在 &lt;bean id="memcahedPool"中加入lazy-init= false,也不行。大家帮看下我的代码哪里有问题~先谢过哈</p> <p style="margin-top: 1px; margin-bottom: 1px; cursor: text; color: #666666; font-family: arial, 宋体; line-height: 24px;"> </p> <p style="margin-top: 1px; margin-bottom: 1px; cursor: text; color: #666666; font-family: arial, 宋体; line-height: 24px;">spring配置文件如下:</p> <p style="margin-top: 1px; margin-bottom: 1px; cursor: text; color: #666666; font-family: arial, 宋体; line-height: 24px;"> </p> <pre name="code" class="java">&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd"&gt; &lt;bean id="memcachedPool" class="com.danga.MemCached.SockIOPool" factory-method="getInstance" init-method="initialize" lazy-init="false" destroy-method="shutDown"&gt; &lt;constructor-arg&gt; &lt;value&gt;memcachedPool&lt;/value&gt; &lt;/constructor-arg&gt; &lt;property name="servers"&gt; &lt;list&gt; &lt;value&gt;127.0.0.1:11211&lt;/value&gt; &lt;/list&gt; &lt;/property&gt; &lt;property name="initConn"&gt; &lt;value&gt;20&lt;/value&gt; &lt;/property&gt; &lt;property name="minConn"&gt; &lt;value&gt;20&lt;/value&gt; &lt;/property&gt; &lt;property name="maxConn"&gt; &lt;value&gt;1000&lt;/value&gt; &lt;/property&gt; &lt;property name="nagle"&gt; &lt;value&gt;false&lt;/value&gt; &lt;/property&gt; &lt;property name="socketTO"&gt; &lt;value&gt;3000&lt;/value&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean id="memcachedClient" class="com.danga.MemCached.MemCachedClient" &gt; &lt;constructor-arg&gt; &lt;value&gt;memcachedPool&lt;/value&gt; &lt;/constructor-arg&gt; &lt;/bean&gt; &lt;/beans&gt;</pre> <p> 使用了基于注解的方式,Controller类如下</p> <p> </p> <p style="margin-top: 1px; margin-bottom: 1px; cursor: text; color: #666666; font-family: arial, 宋体; line-height: 24px;"> </p> <pre name="code" class="java">package com.test.web; import java.util.Date; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import com.danga.MemCached.MemCachedClient; import com.test.utils.MemcachedUtils; @Controller @RequestMapping("/loginController") public class Login { @Autowired private MemCachedClient mcc; @RequestMapping("/login") public ModelAndView login( @RequestParam(value = "username") String userid, @RequestParam(value = "password") String passwd, HttpSession session){ ModelAndView m = new ModelAndView(); m.setViewName("../index"); MemcachedUtils.set("test", "hello memcached",new Date(1000 * 60));//这里有问题! Object o = MemcachedUtils.get("test");//这里有问题! System.out.println(o.toString()); m.addObject("errMsg","成功返回!"); return m; } }</pre> <p> MemcachedUtils类代码如下:</p> <p> </p> <p style="margin-top: 1px; margin-bottom: 1px; cursor: text; color: #666666; font-family: arial, 宋体; line-height: 24px;"> </p> <pre name="code" class="java">import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.lang.management.ManagementFactory; import java.lang.management.RuntimeMXBean; import java.text.SimpleDateFormat; import java.util.Date; import org.apache.log4j.Logger; import com.danga.MemCached.MemCachedClient; public class MemcachedUtils { private static final Logger logger = Logger.getLogger(MemcachedUtils.class); private static MemCachedClient cachedClient; static { if (cachedClient == null) cachedClient = new MemCachedClient(); } private MemcachedUtils() { } /** * 添加memcached。 */ public static boolean set(String key, Object value, Date expire) { return setExp(key, value, expire); } private static boolean setExp(String key, Object value, Date expire) { boolean flag = false; try { flag = cachedClient.set(key, value, expire); } catch (Exception e) { logger.error(""Memcached set方法报错,key值:" + key + "\r\n"", e); } return flag; } /** * 获取memcached。 */ public static Object get(String key) { Object obj = null; try { obj = cachedClient.get(key); } catch (Exception e) { logger.error(""Memcached get方法报错,key值:" + key + "\r\n"", e); } return obj; } }</pre> <p> 执行login类的login方法时出现[ERROR] attempting to get SockIO from uninitialized pool!大家帮看看,先谢过了哈。</p> <p> </p> <p>错误堆栈信息如下:</p> <pre name="code" class="java">[ERROR] attempting to get SockIO from uninitialized pool! [ERROR] attempting to get SockIO from uninitialized pool! 2014-11-27 23:39:45 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet springMVC threw exception java.lang.NullPointerException at com.test.web.Login.login(Login.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:100) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:604) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:565) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source)</pre> <p> </p> <p> </p> <p> </p> </div>
Django已有的model表新增字段,执行migrate报错:django.db.utils.DatabaseError:ORA-00955: name is already used by an existing object,出现重名是啥情况。。。
Django已有的model表新增字段,执行migrate报错:django.db.utils.DatabaseError:ORA-00955: name is already used by an existing object,出现重名是啥情况。。。
mat打不开,报错zlib.error: Error -3 while decompressing data: invalid literal/length code?请帮帮忙,谢谢
import scipy.io as scio<br> dataFile = './mnist.mat'<br> data = scio.loadmat(dataFile)<br> 报错 ``` File "mio5_utils.pyx", line 675, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header File "mio5_utils.pyx", line 705, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header File "mio5_utils.pyx", line 778, in scipy.io.matlab.mio5_utils.VarReader5.read_real_complex File "mio5_utils.pyx", line 450, in scipy.io.matlab.mio5_utils.VarReader5.read_numeric File "mio5_utils.pyx", line 355, in scipy.io.matlab.mio5_utils.VarReader5.read_element File "streams.pyx", line 195, in scipy.io.matlab.streams.ZlibInputStream.read_string File "streams.pyx", line 171, in scipy.io.matlab.streams.ZlibInputStream.read_into File "streams.pyx", line 158, in scipy.io.matlab.streams.ZlibInputStream._fill_buffer zlib.error: Error -3 while decompressing data: invalid literal/length code ```
edu.umbc.cs.maple.utils.WekaUtils
女小白一个,java项目中声明edu.umbc.cs.maple.utils.WekaUtils会出现错误,提示新建一个WekaUtil class,对到底是少包和还是少class不了解,求大神解答,如果少包,能否告知在哪下载,如果少WekaUtils class,能否将它的代码给我一下。感觉问的问题很白痴,望哪位大神解答一下
130 个相见恨晚的超实用网站,一次性分享出来
相见恨晚的超实用网站 持续更新中。。。
我花了一夜用数据结构给女朋友写个H5走迷宫游戏
起因 又到深夜了,我按照以往在csdn和公众号写着数据结构!这占用了我大量的时间!我的超越妹妹严重缺乏陪伴而 怨气满满! 而女朋友时常埋怨,认为数据结构这么抽象难懂的东西没啥作用,常会问道:天天写这玩意,有啥作用。而我答道:能干事情多了,比如写个迷宫小游戏啥的! 当我码完字准备睡觉时:写不好别睡觉! 分析 如果用数据结构与算法造出东西来呢? ...
字节跳动视频编解码面经
三四月份投了字节跳动的实习(图形图像岗位),然后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) 选择需要启...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
此博客仅为我业余记录文章所用,发布到此,仅供网友阅读参考,如有侵权,请通知我,我会删掉。 补充 有不少读者留言说本文章没有用,因为天气预报直接打开手机就可以收到了,为何要多此一举发送到邮箱呢!!!那我在这里只能说:因为你没用,所以你没用!!! 这里主要介绍的是思路,不是天气预报!不是天气预报!!不是天气预报!!!天气预报只是用于举例。请各位不要再刚了!!! 下面是我会用到的两个场景: 每日下
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
Linux(服务器编程):15---两种高效的事件处理模式(reactor模式、proactor模式)
前言 同步I/O模型通常用于实现Reactor模式 异步I/O模型则用于实现Proactor模式 最后我们会使用同步I/O方式模拟出Proactor模式 一、Reactor模式 Reactor模式特点 它要求主线程(I/O处理单元)只负责监听文件描述符上是否有事件发生,有的话就立即将时间通知工作线程(逻辑单元)。除此之外,主线程不做任何其他实质性的工作 读写数据,接受新的连接,以及处...
HAL 硬件抽象层介绍
和你一起终身学习,这里是程序员Android本篇文章主要介绍Android开发中的部分知识点,通过阅读本篇文章,您将收获以下内容:和你一起终身学习,这里是程序员 Android本篇文章主要介绍Android开发中的部分知识点,通过阅读本篇文章,您将收获以下内容:一、HAL 概述一、HAL 概述HAL定义了供硬件供应商实施的标准接口,该接口使Android无需考虑底层驱动程序的实现。使用HA...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的 回答 - Bravo Yeung,获得该问题下回答中得最高赞(236赞和1枚专业勋章),对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalk
致 Python 初学者们!
作者 | 许向武 责编 | 屠敏 出品 | CSDN 博客 前言 在 Python 进阶的过程中,相信很多同学应该大致上学习了很多 Python 的基础知识,也正在努力成长。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 Python 这门编程语言,从2009年开始单一使用 Python 应对所有的开发工作,直至今
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观...
使用 Angular 打造微前端架构的 ToB 企业级应用
这篇文章其实已经准备了11个月了,因为虽然我们年初就开始使用 Angular 的微前端架构,但是产品一直没有正式发布,无法通过生产环境实践验证可行性,11月16日我们的产品正式灰度发布,所以是时候分享一下我们在使用 Angular 微前端这条路上的心得(踩过的坑)了额,希望和 Angular 社区一起成长一起进步,如果你对微前端有一定的了解并且已经在项目中尝试了可以忽略前面的章节。 什么是微前...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
拿下微软、Google、Adobe,印度为何盛产科技圈 CEO?
作者 | 胡巍巍 出品 | CSDN(ID:CSDNnews) 世界500强中,30%的掌舵人,都是印度人。 是的,你没看错。这是近日《哈佛商业评论》的研究结果。 其中又以微软CEO萨提亚·纳德拉(Satya Nadella)、和谷歌CEO桑达尔·皮查伊(Sundar Pichai,以下简称劈柴)最为出名。 微软CEO萨提亚·纳德拉(Satya Nadella) 其他著名印度...
Linux(内核剖析):19---中断总体概述
一、为什么要引入中断? 任何操作系统内核的核心任务,都包含有对连接到计算机上的硬件设备进行有效管理,如硬盘、蓝光碟机、键盘、鼠标、3D 处理器,以及无线电等。而想要管理这些设备,首先要能和它们互通音信才行。众所周知,处理器的速度跟外围硬件设备的速度往往不在一个数量级上,因此,如果内核采取让处理器向硬件发出一个请求,然后专门等待回应的办法,显然差强人意。既然硬件的响应这么慢,那么内核就应该在此期间...
程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca...
深度学习笔记------卷积神经网络
深度学习笔记------卷积神经网络
一文带你入门Linux
文章目录1.1 Linux的概述:1.1.1 什么是Linux:1.1.1.1 学习Linux之前先了解Unix1.1.1.2 Linux的概述:1.1.1.3 Linux的历史:1.1.1.4 Linux系统的应用:1.1.1.5 Linux的版本1.1.1.6 Linux的主流版本1.2 Linux的安装:1.2.1 虚拟机安装:1.2.1.1 什么是虚拟机1.2.1.2 安装VmWare1....
普通三本毕业,我怎么一路艰辛进入阿里的
英雄不问出处? 自古以来就有这样一句话,真的英雄不问出处吗?这句话太挫了。普通三本院校的我,大四的时候居然都不知道什么是校招,所以出处太重要了。这也是没有机会参加阿里校招的原因,毕竟校招门槛比社招还是要低的,最重要的是校招进入阿里能让你的起点比别人更高。 有幸可以社招进入阿里,了解了校招的思路,赶紧介绍给学弟们,现在我们三本院校的小学弟今年居然有 3 个人通过了阿里的校招。下面我也把这份宝贵的经...
作为一个程序员,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 本我最喜欢的书,你可以挑选感兴趣的来读一读。读书不仅可以平复恐惧的压力,还可以对未来充满希望,毕竟苦难终将会...
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# 为空 判断 委托 c#记事本颜色 c# 系统默认声音 js中调用c#方法参数 c#引入dll文件报错 c#根据名称实例化 c#从邮件服务器获取邮件 c# 保存文件夹 c#代码打包引用 c# 压缩效率
立即提问