android中dialog工具类的实现(多种dialog的创建)

2024-06-23 08:18

本文主要是介绍android中dialog工具类的实现(多种dialog的创建),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

第一种:bitmapDialog的建立

javademo1:

package com.demo.dialog;import android.app.Dialog;
import android.content.Context;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;/*** Create custom Dialog windows for your application Custom dialogs rely on* custom layouts wich allow you to create and use your own look & feel.**/
public class BitmapDialog extends Dialog {public BitmapDialog(Context context, int theme) {super(context, theme);}public BitmapDialog(Context context) {super(context);}/*** Helper class for creating a custom dialog*/public static class Builder {@SuppressWarnings("unused")private ViewTreeObserver viewTreeObserver;private Context context;private View contentView;private ImageView img;private Bitmap bitmap;public Builder(Context context) {this.context = context;}public Builder setBitmap(Bitmap bit) {this.bitmap = bit;return this;}public Builder setContentView(View v) {this.contentView = v;return this;}/*** * Create the custom dialog*/public BitmapDialog create() {LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);// instantiate the dialog with the custom Themefinal BitmapDialog dialog = new BitmapDialog(context,R.style.Dialog);View layout = inflater.inflate(R.layout.bitmap_dialog_layout, null);dialog.addContentView(layout, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));if (bitmap != null) {img = (ImageView) layout.findViewById(R.id.bitmap_dialog_imageview);img.setImageBitmap(bitmap);}if (contentView != null) {// if no message set// add the contentView to the dialog body((LinearLayout) layout.findViewById(R.id.content)).removeAllViews();((LinearLayout) layout.findViewById(R.id.content)).addView(contentView,new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));}dialog.setContentView(layout);return dialog;}}}
javaDemo2
package com.demo.dialog;import android.content.Context;
import android.graphics.Bitmap;/*自定义Dialog方法*/
public class BitmapHelper {public static BitmapDialog createDialog(Context context, Bitmap bitmap) {BitmapDialog.Builder dialogBuilder = new BitmapDialog.Builder(context);dialogBuilder.setBitmap(bitmap);return dialogBuilder.create();}
}

第二种:customDialog的建立:

javademo1:

package com.demo.dialog;import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;/*** Create custom Dialog windows for your application Custom dialogs rely on* custom layouts wich allow you to create and use your own look & feel.**/
public class CustomDialog extends Dialog {public CustomDialog(Context context, int theme) {super(context, theme);}public CustomDialog(Context context) {super(context);}/*** Helper class for creating a custom dialog*/public static class Builder {private Context context;private String message;private String positiveButtonText;private String negativeButtonText;private View contentView;private boolean isWaitDialog;private DialogInterface.OnClickListenerpositiveButtonClickListener,negativeButtonClickListener;public Builder(Context context) {this.context = context;}/*** * Set the Dialog message from String* * @param title* * @return*/public Builder setMessage(String message) {this.message = message;return this;}public Builder setWiatDialog(boolean isWaitDialog) {this.isWaitDialog = isWaitDialog;return this;}/*** * Set the Dialog message from resource* * @param title* * @return*/public Builder setMessage(int message) {this.message = (String) context.getText(message);return this;}/*** * Set a custom content view for the Dialog.* * If a message is set, the contentView is not* * added to the Dialog...* * @param v* * @return*/public Builder setContentView(View v) {this.contentView = v;return this;}/*** * Set the positive button resource and it's listener* * @param positiveButtonText* * @param listener* * @return*/public Builder setPositiveButton(int positiveButtonText,DialogInterface.OnClickListener listener) {this.positiveButtonText = (String) context.getText(positiveButtonText);this.positiveButtonClickListener = listener;return this;}/*** * Set the positive button text and it's listener* * @param positiveButtonText* * @param listener* * @return*/public Builder setPositiveButton(String positiveButtonText,DialogInterface.OnClickListener listener) {this.positiveButtonText = positiveButtonText;this.positiveButtonClickListener = listener;return this;}/*** * Set the negative button resource and it's listener* * @param negativeButtonText* * @param listener* * @return*/public Builder setNegativeButton(int negativeButtonText,DialogInterface.OnClickListener listener) {this.negativeButtonText = (String) context.getText(negativeButtonText);this.negativeButtonClickListener = listener;return this;}/*** * Set the negative button text and it's listener* * @param negativeButtonText* * @param listener* * @return*/public Builder setNegativeButton(String negativeButtonText,DialogInterface.OnClickListener listener) {this.negativeButtonText = negativeButtonText;this.negativeButtonClickListener = listener;return this;}/*** * Create the custom dialog*/public CustomDialog create() {LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);// instantiate the dialog with the custom Themefinal CustomDialog dialog = new CustomDialog(context,R.style.Dialog);View layout = inflater.inflate(R.layout.custom_dialog_layout, null);dialog.addContentView(layout, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));// set the confirm buttonif (positiveButtonText != null) {((Button) layout.findViewById(R.id.positiveButton)).setText(positiveButtonText);if (positiveButtonClickListener != null) {((Button) layout.findViewById(R.id.positiveButton)).setOnClickListener(new View.OnClickListener() {public void onClick(View v) {positiveButtonClickListener.onClick(dialog,DialogInterface.BUTTON_POSITIVE);}});}} else {// if no confirm button just set the visibility to GONElayout.findViewById(R.id.positiveButton).setVisibility(View.GONE);}if (isWaitDialog) {layout.findViewById(R.id.progressBar1).setVisibility(View.VISIBLE);} else {layout.findViewById(R.id.progressBar1).setVisibility(View.GONE);}// set the cancel buttonif (negativeButtonText != null) {((Button) layout.findViewById(R.id.negativeButton)).setText(negativeButtonText);if (negativeButtonClickListener != null) {((Button) layout.findViewById(R.id.negativeButton)).setOnClickListener(new View.OnClickListener() {public void onClick(View v) {negativeButtonClickListener.onClick(dialog,DialogInterface.BUTTON_NEGATIVE);}});}} else {// if no confirm button just set the visibility to GONElayout.findViewById(R.id.negativeButton).setVisibility(View.GONE);}// set the content messageif (message != null) {((TextView) layout.findViewById(R.id.message)).setText(message);} else if (contentView != null) {// if no message set// add the contentView to the dialog body((LinearLayout) layout.findViewById(R.id.content)).removeAllViews();((LinearLayout) layout.findViewById(R.id.content)).addView(contentView,new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));}dialog.setContentView(layout);return dialog;}}}

javaDemo2:

package com.demo.dialog;import android.content.Context;
import android.content.DialogInterface;/*customdialog*/
public class CustomDialogHelper {public static CustomDialog createDialog(Context context, String msg) {CustomDialog.Builder dialogBuilder = new CustomDialog.Builder(context);dialogBuilder.setWiatDialog(false);dialogBuilder.setMessage(msg);return dialogBuilder.create();}public static CustomDialog createDialogWait(Context context, String msg) {CustomDialog.Builder dialogBuilder = new CustomDialog.Builder(context);dialogBuilder.setWiatDialog(true);dialogBuilder.setMessage(msg);return dialogBuilder.create();}public static CustomDialog createDialog(Context context, String title,String msg, String btnName) {CustomDialog.Builder dialogBuilder = new CustomDialog.Builder(context);dialogBuilder.setWiatDialog(false);dialogBuilder.setMessage(msg);dialogBuilder.setNegativeButton(btnName,new DialogInterface.OnClickListener() {public void onClick(DialogInterface dialog, int which) {dialog.dismiss();}});return dialogBuilder.create();}public static CustomDialog createProgressDialog(Context context,String title, String msg) {CustomDialog.Builder dialogBuilder = new CustomDialog.Builder(context);dialogBuilder.setWiatDialog(true);dialogBuilder.setMessage(msg);return dialogBuilder.create();}public static CustomDialog createDialog1(Context context, String msg,String btnName) {CustomDialog.Builder dialogBuilder = new CustomDialog.Builder(context);dialogBuilder.setWiatDialog(false);dialogBuilder.setMessage(msg);dialogBuilder.setNegativeButton(btnName,new DialogInterface.OnClickListener() {public void onClick(DialogInterface dialog, int which) {dialog.dismiss();}});return dialogBuilder.create();}
}
第三种:

Logdialog的建立:javaDemo1

package com.demo.dialog;import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import android.widget.TextView;/*** Create custom Dialog windows for your application Custom dialogs rely on* custom layouts wich allow you to create and use your own look & feel.**/
public class LogDialog extends Dialog {public LogDialog(Context context, int theme) {super(context, theme);}public LogDialog(Context context) {super(context);}/*** Helper class for creating a custom dialog*/public static class Builder {private Context context;private String message;private View contentView;public Builder(Context context) {this.context = context;}/*** * Set the Dialog message from String* * @param title* * @return*/public Builder setMessage(String message) {this.message = message;return this;}/*** * Set the Dialog message from resource* * @param title* * @return*/public Builder setMessage(int message) {this.message = (String) context.getText(message);return this;}/*** * Set a custom content view for the Dialog.* * If a message is set, the contentView is not* * added to the Dialog...* * @param v* * @return*/public Builder setContentView(View v) {this.contentView = v;return this;}/*** * Create the custom dialog*/public LogDialog create() {LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);// instantiate the dialog with the custom Themefinal LogDialog dialog = new LogDialog(context,R.style.Dialog);View layout = inflater.inflate(R.layout.log_dialog_layout, null);dialog.addContentView(layout, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));// set the content messageif (message != null) {((TextView) layout.findViewById(R.id.log_dialog_message)).setText(message);} else if (contentView != null) {// if no message set// add the contentView to the dialog body((LinearLayout) layout.findViewById(R.id.content)).removeAllViews();((LinearLayout) layout.findViewById(R.id.content)).addView(contentView,new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));}dialog.setContentView(layout);return dialog;}}}

javademo2:

package com.demo.dialog;import android.content.Context;public class LogDialogHelper {public static LogDialog createDialog(Context context, String msg) {LogDialog.Builder dialogBuilder = new LogDialog.Builder(context);dialogBuilder.setMessage(msg);return dialogBuilder.create();}}


第四种:

progressDialog的建立:(很多类是自定义的,还没修改)

Javademo1:


import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;/*** Create custom Dialog windows for your application Custom dialogs rely on* custom layouts wich allow you to create and use your own look & feel.**/
public class ProgressDialog extends Dialog {public ProgressDialog(Context context, int theme) {super(context, theme);}public ProgressDialog(Context context) {super(context);}/*** Helper class for creating a custom dialog*/public static class Builder {private final int REQUESTFAIL = 0;private final int MEMBERCARDTHREAD = 20;private final int BILLTHREAD = 40;private final int ORDERBASETHREAD = 60;private final int INVOICETHREAD = 80;private final int UPLOADFINISH = 100;private Context context;private String message;private View contentView;private ProgressBar bar;private Animation animation;public Builder(Context context) {this.context = context;}public ProgressBar getBar() {return bar;}/*** * Set the Dialog message from String* * @param title* * @return*/public Builder setMessage(String message) {this.message = message;return this;}/*** * Set the Dialog message from resource* * @param title* * @return*/public Builder setMessage(int message) {this.message = (String) context.getText(message);return this;}/*** * Set a custom content view for the Dialog.* * If a message is set, the contentView is not* * added to the Dialog...* * @param v* * @return*/public Builder setContentView(View v) {this.contentView = v;return this;}public ProgressDialog create() {LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);final ProgressDialog dialog = new ProgressDialog(context,R.style.Dialog);dialog.setCanceledOnTouchOutside(false);View layout = inflater.inflate(R.layout.progressdialog, null);dialog.addContentView(layout, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));dialog.setOnDismissListener(new OnDismissListener() {@Overridepublic void onDismiss(DialogInterface dialog) {FrameMainActivity.proBool = true;}});Handler handler = new Handler() {@Overridepublic void handleMessage(Message msg) {switch (msg.what) {case MEMBERCARDTHREAD:if (bar == null)FrameMainActivity.proBool = true;bar.incrementProgressBy(20);break;case BILLTHREAD:bar.incrementProgressBy(20);break;case ORDERBASETHREAD:bar.incrementProgressBy(10);break;case INVOICETHREAD:bar.incrementProgressBy(30);break;case UPLOADFINISH:bar.incrementProgressBy(20);if (dialog.isShowing())dialog.dismiss();FrameMainActivity.proBool = true;break;case REQUESTFAIL:if (dialog.isShowing()) {Toast.makeText(context, "数据更新失败,请检查网络!",Toast.LENGTH_SHORT).show();dialog.dismiss();}FrameMainActivity.proBool = true;break;}super.handleMessage(msg);}};if (message != null) {((TextView) layout.findViewById(R.id.progressdialog_txt)).setText(message);animation = AnimationUtils.loadAnimation(context,R.anim.progress_alpha);bar = ((ProgressBar) layout.findViewById(R.id.progressdialog_pro));bar.setAnimation(animation);dataThread(handler);}if (contentView != null) {((LinearLayout) layout.findViewById(R.id.content)).removeAllViews();((LinearLayout) layout.findViewById(R.id.content)).addView(contentView,new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));}dialog.setContentView(layout);return dialog;}}public static void dataThread(final Handler handler) {Runnable runnable = new Runnable() {@Overridepublic void run() {Log.d("info", "dataThread启动");Datasync datasync = null;SharepreferenceData sharepreferenceData = SharepreferenceData.getInstance(GabelApplication.getInstance());int i = 0;while (!FrameMainActivity.proBool) {try {Thread.sleep(1000);i++;if (i == 15) {handler.sendEmptyMessage(0);break;}} catch (InterruptedException e) {e.printStackTrace();}if (!sharepreferenceData.getServiceStat()) {continue;}if (!FrameMainActivity.proBool) {datasync = new MemberCardImpl();datasync.handlerData();handler.sendEmptyMessage(20);}if (!FrameMainActivity.proBool) {datasync = new BillPayImpl();datasync.handlerData();handler.sendEmptyMessage(40);}if (!FrameMainActivity.proBool) {datasync = new OrderBasicInfoImpl();datasync.handlerData();handler.sendEmptyMessage(80);}if (!FrameMainActivity.proBool) {datasync = new BillInvoiceLogImpl();datasync.handlerData();handler.sendEmptyMessage(100);}break;}};};new Thread(runnable).start();}
}
javaDemo2:

package com.demo.dialog;import android.content.Context;public class ProgressDialogHelper {public static ProgressDialog createDialog(Context context, String msg) {ProgressDialog.Builder dialogBuilder = new ProgressDialog.Builder(context);// dialogBuilder.setHandler(handler);dialogBuilder.setMessage(msg);return dialogBuilder.create();}}


第五种:URLDialog的建立:

Javademo1:

package com.demo.dialog;import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;/*** Create custom Dialog windows for your application Custom dialogs rely on* custom layouts wich allow you to create and use your own look & feel.**/
public class SetURLDialog extends Dialog {public SetURLDialog(Context context, int theme) {super(context, theme);}public SetURLDialog(Context context) {super(context);}/*** Helper class for creating a custom dialog*/public static class Builder {private EditText editText;private Context context;private String message;private String positiveButtonText;private String negativeButtonText;private View contentView;private DialogInterface.OnClickListenerpositiveButtonClickListener,negativeButtonClickListener;public Builder(Context context) {this.context = context;}public Builder setMessage(String message) {this.message = message;return this;}public Builder setMessage(int message) {this.message = (String) context.getText(message);return this;}public Builder setContentView(View v) {this.contentView = v;return this;}public Builder setPositiveButton(int positiveButtonText,DialogInterface.OnClickListener listener) {this.positiveButtonText = (String) context.getText(positiveButtonText);this.positiveButtonClickListener = listener;return this;}public Builder setPositiveButton(String positiveButtonText,DialogInterface.OnClickListener listener) {this.positiveButtonText = positiveButtonText;this.positiveButtonClickListener = listener;return this;}public Builder setNegativeButton(int negativeButtonText,DialogInterface.OnClickListener listener) {this.negativeButtonText = (String) context.getText(negativeButtonText);this.negativeButtonClickListener = listener;return this;}public Builder setNegativeButton(String negativeButtonText,DialogInterface.OnClickListener listener) {this.negativeButtonText = negativeButtonText;this.negativeButtonClickListener = listener;return this;}public String getEditText() {return editText.getText() + "";}/*** * Create the custom dialog*/public SetURLDialog create() {LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);// instantiate the dialog with the custom Themefinal SetURLDialog dialog = new SetURLDialog(context,R.style.Dialog);View layout = inflater.inflate(R.layout.set_serviceurl_dialog_layout, null);dialog.addContentView(layout, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));// set the confirm buttonif (positiveButtonText != null) {((Button) layout.findViewById(R.id.set_serviceurl_positiveButton)).setText(positiveButtonText);if (positiveButtonClickListener != null) {((Button) layout.findViewById(R.id.set_serviceurl_positiveButton)).setOnClickListener(new View.OnClickListener() {public void onClick(View v) {positiveButtonClickListener.onClick(dialog,DialogInterface.BUTTON_POSITIVE);}});}} else {// if no confirm button just set the visibility to GONElayout.findViewById(R.id.set_serviceurl_positiveButton).setVisibility(View.GONE);}// set the cancel buttonif (negativeButtonText != null) {((Button) layout.findViewById(R.id.set_serviceurl_negativeButton)).setText(negativeButtonText);if (negativeButtonClickListener != null) {((Button) layout.findViewById(R.id.set_serviceurl_negativeButton)).setOnClickListener(new View.OnClickListener() {public void onClick(View v) {negativeButtonClickListener.onClick(dialog,DialogInterface.BUTTON_NEGATIVE);}});}} else {// if no confirm button just set the visibility to GONElayout.findViewById(R.id.set_serviceurl_negativeButton).setVisibility(View.GONE);}// set the content messageif (message != null) {editText = ((EditText) layout.findViewById(R.id.set_serviceurl_edit));editText.setText(message);} else if (contentView != null) {// if no message set// add the contentView to the dialog body((LinearLayout) layout.findViewById(R.id.content)).removeAllViews();((LinearLayout) layout.findViewById(R.id.content)).addView(contentView,new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));}dialog.setContentView(layout);return dialog;}}}

javaDemo2:

package com.demo.dialog;import android.content.Context;
import android.content.DialogInterface;
import android.widget.Toast;/*自定义Dialog方法*/
public class SetURLDialogHelper {public static SetURLDialog createDialog(final Context context, String msg) {final SetURLDialog.Builder dialogBuilder = new SetURLDialog.Builder(context);dialogBuilder.setMessage(msg);dialogBuilder.setNegativeButton("取消",new DialogInterface.OnClickListener() {public void onClick(DialogInterface dialog, int which) {Toast.makeText(context, "取消保存", Toast.LENGTH_SHORT).show();dialog.dismiss();}});dialogBuilder.setPositiveButton("确定",new DialogInterface.OnClickListener() {public void onClick(DialogInterface dialog, int which) {SharepreferenceData.getInstance(context).setServiceURL(dialogBuilder.getEditText());Toast.makeText(context, "保存成功", Toast.LENGTH_SHORT).show();dialog.dismiss();}});return dialogBuilder.create();}}



这篇关于android中dialog工具类的实现(多种dialog的创建)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1086621

相关文章

C++对象布局及多态实现探索之内存布局(整理的很多链接)

本文通过观察对象的内存布局,跟踪函数调用的汇编代码。分析了C++对象内存的布局情况,虚函数的执行方式,以及虚继承,等等 文章链接:http://dev.yesky.com/254/2191254.shtml      论C/C++函数间动态内存的传递 (2005-07-30)   当你涉及到C/C++的核心编程的时候,你会无止境地与内存管理打交道。 文章链接:http://dev.yesky

ESP32 esp-idf esp-adf环境安装及.a库创建与编译

简介 ESP32 功能丰富的 Wi-Fi & 蓝牙 MCU, 适用于多样的物联网应用。使用freertos操作系统。 ESP-IDF 官方物联网开发框架。 ESP-ADF 官方音频开发框架。 文档参照 https://espressif-docs.readthedocs-hosted.com/projects/esp-adf/zh-cn/latest/get-started/index

揭秘未来艺术:AI绘画工具全面介绍

📑前言 随着科技的飞速发展,人工智能(AI)已经逐渐渗透到我们生活的方方面面。在艺术创作领域,AI技术同样展现出了其独特的魅力。今天,我们就来一起探索这个神秘而引人入胜的领域,深入了解AI绘画工具的奥秘及其为艺术创作带来的革命性变革。 一、AI绘画工具的崛起 1.1 颠覆传统绘画模式 在过去,绘画是艺术家们通过手中的画笔,蘸取颜料,在画布上自由挥洒的创造性过程。然而,随着AI绘画工

墨刀原型工具-小白入门篇

墨刀原型工具-小白入门篇 简介 随着互联网的发展和用户体验的重要性越来越受到重视,原型设计逐渐成为了产品设计中的重要环节。墨刀作为一款原型设计工具,以其简洁、易用的特点,受到了很多设计师的喜爱。本文将介绍墨刀原型工具的基本使用方法,以帮助小白快速上手。 第一章:认识墨刀原型工具 1.1 什么是墨刀原型工具 墨刀是一款基于Web的原型设计工具,可以帮助设计师快速创建交互原型,并且可以与团队

大学湖北中医药大学法医学试题及答案,分享几个实用搜题和学习工具 #微信#学习方法#职场发展

今天分享拥有拍照搜题、文字搜题、语音搜题、多重搜题等搜题模式,可以快速查找问题解析,加深对题目答案的理解。 1.快练题 这是一个网站 找题的网站海量题库,在线搜题,快速刷题~为您提供百万优质题库,直接搜索题库名称,支持多种刷题模式:顺序练习、语音听题、本地搜题、顺序阅读、模拟考试、组卷考试、赶快下载吧! 2.彩虹搜题 这是个老公众号了 支持手写输入,截图搜题,详细步骤,解题必备

通过SSH隧道实现通过远程服务器上外网

搭建隧道 autossh -M 0 -f -D 1080 -C -N user1@remotehost##验证隧道是否生效,查看1080端口是否启动netstat -tuln | grep 1080## 测试ssh 隧道是否生效curl -x socks5h://127.0.0.1:1080 -I http://www.github.com 将autossh 设置为服务,隧道开机启动

(超详细)YOLOV7改进-Soft-NMS(支持多种IoU变种选择)

1.在until/general.py文件最后加上下面代码 2.在general.py里面找到这代码,修改这两个地方 3.之后直接运行即可

Windows/macOS/Linux 安装 Redis 和 Redis Desktop Manager 可视化工具

本文所有安装都在macOS High Sierra 10.13.4进行,Windows安装相对容易些,Linux安装与macOS类似,文中会做区分讲解 1. Redis安装 1.下载Redis https://redis.io/download 把下载的源码更名为redis-4.0.9-source,我喜欢跟maven、Tomcat放在一起,就放到/Users/zhan/Documents

时序预测 | MATLAB实现LSTM时间序列未来多步预测-递归预测

时序预测 | MATLAB实现LSTM时间序列未来多步预测-递归预测 目录 时序预测 | MATLAB实现LSTM时间序列未来多步预测-递归预测基本介绍程序设计参考资料 基本介绍 MATLAB实现LSTM时间序列未来多步预测-递归预测。LSTM是一种含有LSTM区块(blocks)或其他的一种类神经网络,文献或其他资料中LSTM区块可能被描述成智能网络单元,因为

vue项目集成CanvasEditor实现Word在线编辑器

CanvasEditor实现Word在线编辑器 官网文档:https://hufe.club/canvas-editor-docs/guide/schema.html 源码地址:https://github.com/Hufe921/canvas-editor 前提声明: 由于CanvasEditor目前不支持vue、react 等框架开箱即用版,所以需要我们去Git下载源码,拿到其中两个主