写在前面

最近项目需求需要输入用户真实姓名 身份证号 再去调用人脸识别 效验是否是本人 所以就首先关注了Face++(旷视)的人脸识别,听说是 正确率很高.....所以就集成了.

1.首先去官网去创建应用(其实听说创建应用是比较麻烦的)

创建好应用以后需要上传你项目的包名

2.下载Demo Demo中会有一个扫描身份证的SDK和人脸识别的SDK 我这个需求呢是人脸识别 所以只集成人脸识别(如下图)

您可以按照您项目的需求集成不同的SDK(这里只集成人脸识别SDK)

3.上面的俩个文件夹都有扫描身份证和人脸识别的Demo

建议您,先把申请应用完以后的AppKey 和secret 配置到Face++的Demo中 跑完这个流程

4.开始我们的步骤

5.Face++给的Demo中 就会有 我们今天需要集成的SDK(如下图)

点击sdk文件夹

6.我们需要把meglive_still.aar 导入到 lib文件夹中

并在app下 build.gradle文件下 dependencies中写入

implementation(name: 'meglive_still', ext: 'aar')

在repositories中写入

flatDir { dirs 'libs' }

7.上代码

(1)需要调用人脸识别的Activity

private static final int CAMERA_PERMISSION_REQUEST_CODE = 100;
private static final int EXTERNAL_STORAGE_REQ_WRITE_EXTERNAL_STORAGE_CODE = 101;
private ProgressDialog mProgressDialog;
private MegLiveManager megLiveManager;
private static final String GET_BIZTOKEN_URL = "https://api.megvii.com/faceid/v3/sdk/get_biz_token"; //Face++获取BizToken的url
private static final String VERIFY_URL = "https://api.megvii.com/faceid/v3/sdk/verify";   //Face++人脸效验的url
private static final String API_KEY = "您的AppKey";
private static final String SECRET = "您的Secret";
private String sign = "";
private static final String SIGN_VERSION = "hmac_sha1";
private byte[] imageRef;//底库图片
private int buttonType;
private void init() {megLiveManager=MegLiveManager.getInstance();mProgressDialog = new ProgressDialog(this);mProgressDialog.setCancelable(false);long currtTime = System.currentTimeMillis() / 1000;long expireTime = (System.currentTimeMillis() + 60 * 60 * 100) / 1000;sign = GenerateSign.appSign(API_KEY, SECRET, currtTime, expireTime);requestCameraPerm();}

//获取BizToken的请求

private void getBizToken(String livenessType, int comparisonType, String idcardName, String idcardNum, String uuid, byte[] image) {mProgressDialog.show();HttpRequestManager.getInstance().getBizToken(this, GET_BIZTOKEN_URL, sign, SIGN_VERSION, livenessType, comparisonType, idcardName, idcardNum, uuid, image, new HttpRequestCallBack() {@Overridepublic void onSuccess(String responseBody) {try {JSONObject json = new JSONObject(responseBody);String bizToken = json.optString("biz_token");megLiveManager.preDetect(FaceIdActivity.this, bizToken,FaceIdActivity.this);} catch (JSONException e) {e.printStackTrace();}}@Overridepublic void onFailure(int statusCode, byte[] responseBody) {}});}
@Override
public void onDetectFinish(String token, int errorCode, String errorMessage, String data) {if (errorCode == 1000) {verify(token, data.getBytes());}
}
@Override
public void onPreStart() {showDialogDismiss();
}@Override
public void onPreFinish(String token, int errorCode, String errorMessage) {progressDialogDismiss();if (errorCode == 1000) {megLiveManager.startDetect(this);}
}//人脸识别的url
private void verify(String token, byte[] data) {showDialogDismiss();HttpRequestManager.getInstance().verify(this, VERIFY_URL, sign, SIGN_VERSION, token, data, new HttpRequestCallBack() {@Overridepublic void onSuccess(String responseBody) {Log.w("result", responseBody);progressDialogDismiss();gotoActivity(mContext,FaceIdVerifySuccessActivity.class,null);}@Overridepublic void onFailure(int statusCode, byte[] responseBody) {Log.w("result", new String(responseBody));progressDialogDismiss();gotoActivity(mContext,FaceIdVerifyErrorActivity.class,null);}});
}private void progressDialogDismiss() {runOnUiThread(new Runnable() {@Overridepublic void run() {if (mProgressDialog != null) {mProgressDialog.dismiss();}}});
}private void showDialogDismiss() {runOnUiThread(new Runnable() {@Overridepublic void run() {if (mProgressDialog != null) {mProgressDialog.show();}}});}private void requestCameraPerm() {if (android.os.Build.VERSION.SDK_INT >= M) {if (checkSelfPermission(Manifest.permission.CAMERA)!= PackageManager.PERMISSION_GRANTED) {//进行权限请求requestPermissions(new String[]{Manifest.permission.CAMERA},CAMERA_PERMISSION_REQUEST_CODE);} else {requestWriteExternalPerm();}} else {beginDetect();}
}private void requestWriteExternalPerm() {if (android.os.Build.VERSION.SDK_INT >= M) {if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {//进行权限请求requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},EXTERNAL_STORAGE_REQ_WRITE_EXTERNAL_STORAGE_CODE);} else {beginDetect();}} else {beginDetect();  
 
    }
}private void beginDetect() {getBizToken("meglive", 1, "您的真实姓名", "您的身份证号", UUID.randomUUID().toString(), null);
}@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {if (requestCode == CAMERA_PERMISSION_REQUEST_CODE) {if (grantResults.length < 1 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {//拒绝了权限申请} else {requestWriteExternalPerm();}} else if (requestCode == EXTERNAL_STORAGE_REQ_WRITE_EXTERNAL_STORAGE_CODE) {if (grantResults.length < 1 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {//拒绝了权限申请} else {beginDetect();}}
}

(2) CV代码出来的错误

您的人脸识别的Activity需要实现  implements DetectCallback, PreCallback

(3)GenerateSign.java

public class GenerateSign {public static String appSign(String apiKey, String secret, long currtTime,long expireTime) {try {int rdm = Math.abs(new Random().nextInt());String plainText = String.format("a=%s&b=%d&c=%d&d=%d", apiKey, expireTime, currtTime,rdm);byte[] hmacDigest = HmacSha1(plainText, secret);byte[] signContent = new byte[hmacDigest.length + plainText.getBytes().length];System.arraycopy(hmacDigest, 0, signContent, 0, hmacDigest.length);System.arraycopy(plainText.getBytes(), 0, signContent, hmacDigest.length,plainText.getBytes().length);return Base64Encode(signContent).replaceAll("[\\s*\t\n\r]", "");} catch (Exception e) {e.printStackTrace();}return null;}/*** 生成base64编码** @param binaryData* @return*/public static String Base64Encode(byte[] binaryData) {String encodedstr = Base64.encodeToString(binaryData,Base64.DEFAULT);return encodedstr;}/*** 生成hmacsha1签名** @param binaryData* @param key* @return* @throws Exception*/public static byte[] HmacSha1(byte[] binaryData, String key) throws Exception {Mac mac = Mac.getInstance("HmacSHA1");SecretKeySpec secretKey = new SecretKeySpec(key.getBytes(), "HmacSHA1");mac.init(secretKey);byte[] HmacSha1Digest = mac.doFinal(binaryData);return HmacSha1Digest;}/*** 生成hmacsha1签名** @param plainText* @param key* @return* @throws Exception*/public static byte[] HmacSha1(String plainText, String key) throws Exception {return HmacSha1(plainText.getBytes(), key);}
}
(4)HttpRequestCallBack
public interface HttpRequestCallBack {void onSuccess(String responseBody);void onFailure(int statusCode, byte[] responseBody);
}

(5)HttpRequestManager.java

public class HttpRequestManager {public final static int TIMEOUT = 10000;private static HttpRequestManager instance;public static HttpRequestManager getInstance() {if (instance == null) {instance = new HttpRequestManager();}return instance;}public void verify(Context context,String url,String sign,String signVersion,String bizToken,byte[] megLiveData,HttpRequestCallBack listener){MultipartEntity entity = new MultipartEntity();entity.addStringPart("sign",sign);entity.addStringPart("sign_version",signVersion);entity.addStringPart("biz_token",bizToken);entity.addBinaryPart("meglive_data",megLiveData);sendMultipartRequest(context,url,entity,new HashMap<String, String>(),listener);}public void getBizToken(Context context,String url,String sign,String signVersoin,String livenessType,int comparisonType,String idcardName,String idcardNum,String uuid,byte[] image_ref1,HttpRequestCallBack listener){MultipartEntity entity = new MultipartEntity();entity.addStringPart("sign",sign);entity.addStringPart("sign_version", signVersoin);entity.addStringPart("liveness_type", livenessType);entity.addStringPart("comparison_type", ""+comparisonType);if (comparisonType==1){entity.addStringPart("idcard_name", idcardName);entity.addStringPart("idcard_number", idcardNum);}else if (comparisonType==0){entity.addStringPart("uuid", uuid);entity.addBinaryPart("image_ref1", image_ref1);}sendMultipartRequest(context,url,entity,new HashMap<String, String>(),listener);}private void sendPostRequest(Context context, String url, final Map<String, String> params, final Map<String, String> header, final HttpRequestCallBack listener) {StringRequest request = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() {@Overridepublic void onResponse(String response) {if (listener != null)listener.onSuccess(response);}}, new Response.ErrorListener() {@Overridepublic void onErrorResponse(VolleyError error) {if (error == null) {if (listener != null)listener.onFailure(-1, "timeout exception".getBytes());} else if (error.networkResponse == null) {if (listener != null)listener.onFailure(-1, "timeout exception".getBytes());} else {if (listener != null)listener.onFailure(error.networkResponse.statusCode, error.networkResponse.data);}}}) {@Overrideprotected Map<String, String> getParams() throws AuthFailureError {return params;}@Overridepublic Map<String, String> getHeaders() throws AuthFailureError {return header;}};VolleyHelper.getInstance(context).addToRequestQueue(request);}private void sendGetRequest(Context context, String url, final Map<String, String> header, final HttpRequestCallBack listener) {StringRequest request = new StringRequest(url, new Response.Listener<String>() {@Overridepublic void onResponse(String response) {listener.onSuccess(response);}}, new Response.ErrorListener() {@Overridepublic void onErrorResponse(VolleyError error) {if (error == null) {listener.onFailure(-1, "timeout exception".getBytes());} else if (error.networkResponse == null) {listener.onFailure(-1, "timeout exception".getBytes());} else {listener.onFailure(error.networkResponse.statusCode, error.networkResponse.data);}}}) {@Overridepublic Map<String, String> getHeaders() throws AuthFailureError {return header;}};VolleyHelper.getInstance(context).addToRequestQueue(request);}private void sendMultipartRequest(Context context, String url, MultipartEntity mult, final Map<String, String> header, final HttpRequestCallBack listener) {MultipartRequest multipartRequest = new MultipartRequest(url, new Response.Listener<String>() {@Overridepublic void onResponse(String response) {listener.onSuccess(response);}}, new Response.ErrorListener() {@Overridepublic void onErrorResponse(VolleyError error) {if (error == null) {listener.onFailure(-1, "timeout exception".getBytes());} else if (error.networkResponse == null) {listener.onFailure(-1, "timeout exception".getBytes());} else {listener.onFailure(error.networkResponse.statusCode, error.networkResponse.data);}}}) {@Overridepublic Map<String, String> getHeaders() throws AuthFailureError {return header;}};// 通过MultipartEntity来设置参数multipartRequest.setmMultiPartEntity(mult);VolleyHelper.getInstance(context).addToRequestQueue(multipartRequest);}}
(6)MultipartEntity
public class MultipartEntity implements HttpEntity {private final static char[] MULTIPART_CHARS = "-_1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();/*** 换行符*/private final String NEW_LINE_STR = "\r\n";private final String CONTENT_TYPE = "Content-Type: ";private final String CONTENT_DISPOSITION = "Content-Disposition: ";/*** 文本参数和字符集*/private final String TYPE_TEXT_CHARSET = "text/plain; charset=UTF-8";/*** 字节流参数*/private final String TYPE_OCTET_STREAM = "application/octet-stream";/*** 二进制参数*/private final byte[] BINARY_ENCODING = "Content-Transfer-Encoding: binary\r\n\r\n".getBytes();/*** 文本参数*/private final byte[] BIT_ENCODING = "Content-Transfer-Encoding: 8bit\r\n\r\n".getBytes();/*** 分隔符*/private String mBoundary = null;/*** 输出流*/ByteArrayOutputStream mOutputStream = new ByteArrayOutputStream();public MultipartEntity() {this.mBoundary = generateBoundary();}/*** 生成分隔符** @return*/private final String generateBoundary() {final StringBuffer buf = new StringBuffer();final Random rand = new Random();for (int i = 0; i < 30; i++) {buf.append(MULTIPART_CHARS[rand.nextInt(MULTIPART_CHARS.length)]);}return buf.toString();}/*** 参数开头的分隔符** @throws IOException*/private void writeFirstBoundary() throws IOException {mOutputStream.write(("--" + mBoundary + "\r\n").getBytes());}/*** 添加文本参数** @param paramName* @param value*/public void addStringPart(final String paramName, final String value) {writeToOutputStream(paramName, value.getBytes(), TYPE_TEXT_CHARSET, BIT_ENCODING, "");}/*** 将数据写入到输出流中** @param paramName* @param rawData* @param type* @param encodingBytes* @param fileName*/private void writeToOutputStream(String paramName, byte[] rawData, String type,byte[] encodingBytes,String fileName) {try {writeFirstBoundary();mOutputStream.write((CONTENT_TYPE + type + NEW_LINE_STR).getBytes());mOutputStream.write(getContentDispositionBytes(paramName, fileName));mOutputStream.write(encodingBytes);mOutputStream.write(rawData);mOutputStream.write(NEW_LINE_STR.getBytes());} catch (final IOException e) {e.printStackTrace();}}/*** 添加二进制参数, 例如Bitmap的字节流参数** @param paramName* @param rawData*/public void addBinaryPart(String paramName, final byte[] rawData) {writeToOutputStream(paramName, rawData, TYPE_OCTET_STREAM, BINARY_ENCODING,paramName);}/*** 添加文件参数,可以实现文件上传功能** @param key* @param file*/public void addFilePart(final String key, final File file) {InputStream fin = null;try {fin = new FileInputStream(file);writeFirstBoundary();final String type = CONTENT_TYPE + TYPE_OCTET_STREAM + NEW_LINE_STR;mOutputStream.write(getContentDispositionBytes(key, file.getName()));mOutputStream.write(type.getBytes());mOutputStream.write(BINARY_ENCODING);final byte[] tmp = new byte[4096];int len = 0;while ((len = fin.read(tmp)) != -1) {mOutputStream.write(tmp, 0, len);}mOutputStream.flush();} catch (final IOException e) {e.printStackTrace();} finally {closeSilently(fin);}}private void closeSilently(Closeable closeable) {try {if (closeable != null) {closeable.close();}} catch (final IOException e) {e.printStackTrace();}}private byte[] getContentDispositionBytes(String paramName, String fileName) {StringBuilder stringBuilder = new StringBuilder();stringBuilder.append(CONTENT_DISPOSITION + "form-data; name=\"" + paramName + "\"");// 文本参数没有filename参数,设置为空即可  if (fileName != null && !"".equals(fileName)) {stringBuilder.append("; filename=\""+ fileName + "\"");}return stringBuilder.append(NEW_LINE_STR).toString().getBytes();}@Overridepublic long getContentLength() {return mOutputStream.toByteArray().length;}@Overridepublic Header getContentType() {return new BasicHeader("Content-Type", "multipart/form-data; boundary=" + mBoundary);}@Overridepublic boolean isChunked() {return false;}@Overridepublic boolean isRepeatable() {return false;}@Overridepublic boolean isStreaming() {return false;}@Overridepublic void writeTo(final OutputStream outstream) throws IOException {// 参数最末尾的结束符  final String endString = "--" + mBoundary + "--\r\n";// 写入结束符  mOutputStream.write(endString.getBytes());//  outstream.write(mOutputStream.toByteArray());}@Overridepublic Header getContentEncoding() {return null;}@Overridepublic void consumeContent() throws IOException,UnsupportedOperationException {if (isStreaming()) {throw new UnsupportedOperationException("Streaming entity does not implement #consumeContent()");}}@Overridepublic InputStream getContent() {return new ByteArrayInputStream(mOutputStream.toByteArray());}
}  
(7)MultipartRequest
public class MultipartRequest extends Request<String> {private MultipartEntity mMultiPartEntity;private Map<String, String> mHeaders = new HashMap<String, String>();private final Response.Listener<String> mListener;/*** Creates a new request with the given url.** @param url      URL to fetch the string at* @param listener Listener to receive the String response*/public MultipartRequest(String url, Response.Listener<String> listener) {this(url, listener, null);}/*** Creates a new POST request.** @param url           URL to fetch the string at* @param listener      Listener to receive the String response* @param errorListener Error listener, or null to ignore errors*/public MultipartRequest(String url, Response.Listener<String> listener, Response.ErrorListener errorListener) {super(Method.POST, url, errorListener);mListener = listener;}/*** @return*/public MultipartEntity getMultiPartEntity() {if (mMultiPartEntity == null) {mMultiPartEntity = new MultipartEntity();}return mMultiPartEntity;}public void setmMultiPartEntity(MultipartEntity mMultiPartEntity) {this.mMultiPartEntity = mMultiPartEntity;}@Overridepublic String getBodyContentType() {return mMultiPartEntity.getContentType().getValue();}public void addHeader(String key, String value) {mHeaders.put(key, value);}@Overridepublic Map<String, String> getHeaders() throws AuthFailureError {return mHeaders;}@Overridepublic byte[] getBody() {ByteArrayOutputStream bos = new ByteArrayOutputStream();try {// multipart body  mMultiPartEntity.writeTo(bos);} catch (IOException e) {Log.e("", "IOException writing to ByteArrayOutputStream");}return bos.toByteArray();}@Overrideprotected Response<String> parseNetworkResponse(NetworkResponse response) {String parsed = "";try {parsed = new String(response.data, HttpHeaderParser.parseCharset(response.headers));} catch (UnsupportedEncodingException e) {parsed = new String(response.data);}return Response.success(parsed, HttpHeaderParser.parseCacheHeaders(response));}@Overrideprotected void deliverResponse(String response) {if (mListener != null) {mListener.onResponse(response);}}}
(8)VolleyHelper   
public class VolleyHelper {private static VolleyHelper mInstance;private RequestQueue mRequestQueue;private static Context mCtx;private VolleyHelper(Context context) {mCtx = context;mRequestQueue = getRequestQueue();}public static synchronized VolleyHelper getInstance(Context context) {if (mInstance == null) {mInstance = new VolleyHelper(context);}return mInstance;}public RequestQueue getRequestQueue() {   if (mRequestQueue == null) {// getApplicationContext() is key, it keeps you from leaking the// Activity or BroadcastReceiver if someone passes one in.if (mCtx==null){return null;}mRequestQueue = Volley.newRequestQueue(mCtx.getApplicationContext());}return mRequestQueue; }public <T> boolean addToRequestQueue(Request<T> req) {if (getRequestQueue()==null){return false;}req.setRetryPolicy(new DefaultRetryPolicy(10000, 0, 1.0f));getRequestQueue().add(req);return true;}public void clearRequestQueue(){if (getRequestQueue()!=null){getRequestQueue().cancelAll(mCtx.getApplicationContext());}}}

8.您可能遇到的问题

(1)

现象:

Face++ 底层使用的是Volley网络请求 我使用的时候第一个错就是 Face++SDK中关于Volley的包 全部报错

解决: 在我们的项目中 重新导入 Volley 的依赖

implementation 'com.mcxiaoke.volley:library:1.0.19'

(2)Face++SDK并没有把相关识别的方法弄成API 在CV的时候务必CV完整

(3)Face++集成从看Demo到看文档 集成起来也是蛮顺利的 祝快快集成

(4)我看了关于Face++的博客 本质是 我们用户输入真实姓名和身份证号以后 Face++会调取身份证和我们的人脸进行比对

Face++ 集成就到这里了,希望能给您带来帮助。

 
 

Android 集成Face++ 人脸识别(3.0+SDK)相关推荐

  1. Android集成百度人脸识别(一)基础版SDK

    首先Android Studio版本:3.2.0 1.注册百度账号并企业认证 2.创建应用生成API Key和Secret Key 3.下载对应的SDK(下载SDK的时候需要新建授权) 因为下载的时候 ...

  2. 百度云android人脸识别sdk,android 集成百度人脸识别sdk 实现考勤

    主要sdk 离线人脸采集sdk 具体实现官网已经写的很详细,这边就说一下移动端集成sdk 所碰到的坑. 第一坑 sdk下载 要下载sdk必须要认证,不过现在有了个人认证,可以先认证一下 下载下来sdk ...

  3. 基于Android端的照片比对系统,基于Android系统的人脸识别系统

    [文章摘要] 当前随着基于Android系统的移动终端设备的广泛应用,以及图像采集设备的普遍集成,使得Android系统的图像采集设备除了具有照相.摄像功能以外,正在扩展新的实用型功能.其中,利用An ...

  4. 人脸识别4:Android InsightFace实现人脸识别Face Recognition(含源码)

    人脸识别4:Android InsightFace实现人脸识别Face Recognition(含源码) 目录 人脸识别4:Android InsightFace实现人脸识别Face Recognit ...

  5. Android自带人脸识别

    前言 碰到项目需求要判断上传的图片里只能有一个人,就像到了人脸识别功能,网上查资料说需要用opencv等各种图像库,项目肯定不能接受,没想到Android很早就已经集成了人脸识别的功能,这里记录一下. ...

  6. 基于Android系统的人脸识别签到软件

    项目名称:   基于Android系统的人脸识别签到软件 目  录 1 项目介绍..... 1 1.1 项目背景.... 1 1.2 产品特点.... 2 1.3 可行性分析.... 2 1.3.1 ...

  7. Android 集成百度文字识别OCR身份证银行卡驾驶证识别

    SDK提供了下列百度AI开放平台RESTful接口的封装.文字识别的服务,可实现一些通用文字,网络图片文字,身份证,银行卡,驾驶证,行驶证,车牌,营业执照,通用票据等的识别需求,简化输入操作. 本篇主 ...

  8. android 动态人脸识别码,Android开发中人脸识别(静态)

    知道没有妹纸,你们是不会看的.先放效果图 最近,项目中需要用到人脸识别,苦于无奈,各种百度,google有关Android开发中人脸识别的内容,最终发现Android官方自带的FaceDetector ...

  9. Android安卓扫名片识别内容技术SDK

    Android安卓扫名片识别内容技术SDK 一.Android安卓扫名片识别内容技术应用背景 这些年,随着移动互联的发展,APP应用成爆发式的增长,在很多APP中都涉及到对名片信息的录入,如移动CRM ...

最新文章

  1. Spring3.3 整合 Hibernate3、MyBatis3.2 配置多数据源/动态切换数据源 方法
  2. 李彦宏:简单搜索永远没有广告;安全是自动驾驶第一天条
  3. R语言ggplot2可视化箱图(boxplot)时忽视异常值(outlier)并重新分配坐标轴的范围是的可视化的箱图可以有效显示箱体实战
  4. 网络安全系列之十一 系统命令注入***
  5. 操作系统 --- 进程和管程的不同
  6. 利用jenkins的api来完成相关工作流程的自动化
  7. 听说你盗图都盗绿了?
  8. ERP火了20年,“中台”仅用5年就消失了?
  9. 给python小白的几个小练习(附答案详解哦)
  10. win11的附件在哪 windows11附件的查看方法
  11. 计算给定坐标系和各个定点坐标的凸多边形的面积
  12. 在react开发过程中由于setState的异步特性,获取最新state遇到问题
  13. 0基础学java可行吗_上海0基础学JAVA可行吗?
  14. Eclipse 最佳字体 推荐
  15. 理想边界尺寸怎么算_GDamp;T 几何尺寸和公差 | ASME14.52018标准弄错了吗?
  16. Calendar类-日历类常用方法(JAVA)
  17. An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means
  18. Python--数据库
  19. WSDM 2021 | 时间序列相关论文一览
  20. python输出字符串两次_下列程序的运行结果是: str = Hello print(str * 2) # 输出字符串两次 print(str + Python!) # 连接字符串_学小...

热门文章

  1. oracle直截取汉字,ORACLE_从字符串中提取汉字(不包括全角符及日文韩文等字符) | 学步园...
  2. 机器学习、深度学习中常用的优化算法详解——梯度下降法、牛顿法、共轭梯度法
  3. Snort - manual 笔记(二)
  4. Java编程——杨辉三角(一)
  5. win7设置定时锁定计算机,Win7系统怎么设置锁屏?Win7系统设置电脑锁屏的方法
  6. 为了保证页面输出安全,我们经常需要对一些特殊的字符进行转义,请写一个函数 escapeHtml,将<, >, , “进行转义
  7. mysql版本升级手册
  8. 【网络安全培训】无线局域网的安全威胁都有哪些?
  9. 激光测距望远镜方案介绍
  10. java电商商品基本信息表,Java生鲜电商平台-商品表的设计