从零开始搭建完整的电影全栈系统(二)——简单的WEB展示网站的搭建
先预览下网站的主要界面,一个列表页,一个详情页:
本着简洁不简单的原则,力求界面尽量简洁,功能尽量实用。
列表页可以根据影片名称、影片介绍、影片分类、演员、导演、地区、语言等搜索影片信息,还可以根据相应字段排序,使用的是yii框架提供的GridView小部件实现的。
详情页即展示一部影片的详情和播放地址。
再次说明:本人不会储存任何影片播放文件,所有的影片信息来自其他网站,仅供说明展示教程功能。
Yii框架的安装见:Yii框架的安装
本系列教程使用的是yii2 高级项目模板自带三个入口。分别是frontend(前台)、backend(后台)、console(命令行入口)。关于yii的多入口、目录结构,基础知识不展开。
安装好yii后,将《从零开始搭建完整的电影全栈系统(一)》中存放影视信息和播放地址的两张表 vod_detail和play_url导入到对应数据库。
使用Yii自带的脚手架工具gii根据数据库生成对应的MVC文件。gii工具号称可以帮我们写代码,很方便就生成了model类,view视图、控制器。
VodDetail:
<?phpnamespace common\models;use Yii;
use yii\helpers\ArrayHelper;/*** This is the model class for table "vod_detail".** @property int $id* @property string $url 采集的url* @property string $url_id 采集的url经过加密生成的唯一字符串* @property string $vod_title 视频名称* @property string|null $vod_sub_title 视频别名* @property string|null $vod_blurb 简介* @property string|null $vod_content 详细介绍* @property int|null $vod_status 状态* @property string|null $vod_type 视频分类* @property string|null $vod_class 扩展分类* @property string|null $vod_tag* @property string|null $vod_pic_url 图片url* @property string|null $vod_pic_path 图片下载保存路径* @property string|null $vod_pic_thumb* @property string|null $vod_actor 演员* @property string|null $vod_director 导演* @property string|null $vod_writer 编剧* @property string|null $vod_remarks 影片版本* @property int|null $vod_pubdate* @property string|null $vod_area 地区* @property string|null $vod_lang 语言* @property string|null $vod_year 年代* @property int|null $vod_hits 总浏览数* @property int|null $vod_hits_day 一天浏览数* @property int|null $vod_hits_week 一周浏览数* @property int|null $vod_hits_month 一月浏览数* @property int|null $vod_up 顶数* @property int|null $vod_down 踩数* @property float|null $vod_score 总评分* @property int|null $vod_score_all* @property int|null $vod_score_num* @property int|null $vod_create_time 创建时间* @property int|null $vod_update_time 更新时间* @property int|null $vod_lately_hit_time 最后浏览时间*/
class VodDetail extends \yii\db\ActiveRecord
{/*** {@inheritdoc}*/public static function tableName(){return 'vod_detail';}/*** {@inheritdoc}*/public function rules(){return [[['url', 'url_id', 'vod_title'], 'required'],[['vod_content'], 'string'],[['vod_status', 'vod_pubdate', 'vod_hits', 'vod_hits_day', 'vod_hits_week', 'vod_hits_month', 'vod_up', 'vod_down', 'vod_score_all', 'vod_score_num', 'vod_create_time', 'vod_update_time', 'vod_lately_hit_time'], 'integer'],[['vod_score'], 'number'],[['url'], 'string', 'max' => 500],[['url_id'], 'string', 'max' => 100],[['vod_title', 'vod_sub_title', 'vod_blurb', 'vod_type', 'vod_class', 'vod_tag', 'vod_pic_url', 'vod_pic_path', 'vod_pic_thumb', 'vod_actor', 'vod_director', 'vod_writer', 'vod_remarks', 'vod_area', 'vod_lang', 'vod_year'], 'string', 'max' => 255],[['url_id'], 'unique'],];}/*** {@inheritdoc}*/public function attributeLabels(){return ['id' => 'ID','url' => 'Url','url_id' => 'Url ID','vod_title' => '影片名称','vod_sub_title' => '影片副标题','vod_blurb' => 'Vod Blurb','vod_content' => '影片介绍','vod_status' => '状态','vod_type' => '影片分类','vod_class' => '扩展分类','vod_tag' => '标签','vod_pic_url' => '图片Url链接','vod_pic_path' => '图片本地路径','vod_pic_thumb' => '缩略图本地路径','vod_actor' => '演员','vod_director' => '导演','vod_writer' => '编剧','vod_remarks' => '备注','vod_pubdate' => 'Vod Pubdate','vod_area' => '地区','vod_lang' => '语言','vod_year' => '年代','vod_hits' => '浏览次数','vod_hits_day' => '日浏览次数','vod_hits_week' => '周浏览次数','vod_hits_month' => '月浏览次数','vod_up' => '顶次数','vod_down' => '踩次数','vod_score' => '评分','vod_score_all' => '总评分','vod_score_num' => '评分次数','vod_create_time' => '收录时间','vod_update_time' => '更新时间','vod_lately_hit_time' => '最近浏览时间',];}/**** @return \yii\db\ActiveQuery* 获取视频对应的播放地址*/public function getPlayurls(){return $this->hasMany(PlayUrl::className(), ['url_id' => 'url_id']);
// $playurls = $this->hasMany(PlayUrl::className(), ['url_id' => 'url_id']);
// return ArrayHelper::index($playurls, null, 'play_from');}
}
PlayUrl:
<?phpnamespace common\models;use Yii;/*** This is the model class for table "play_url".** @property int $id* @property string|null $play_title* @property string|null $play_from* @property string $play_url* @property string $play_url_aes 将url生成唯一字符串* @property string $url_id 关联vod_detail url_id* @property int|null $create_time* @property int|null $update_time*/
class PlayUrl extends \yii\db\ActiveRecord
{/*** {@inheritdoc}*/public static function tableName(){return 'play_url';}/*** {@inheritdoc}*/public function rules(){return [[['play_url', 'play_url_aes', 'url_id'], 'required'],[['create_time', 'update_time'], 'integer'],[['play_title', 'play_from', 'play_url'], 'string', 'max' => 255],[['play_url_aes', 'url_id'], 'string', 'max' => 100],[['play_url_aes'], 'unique'],];}/*** {@inheritdoc}*/public function attributeLabels(){return ['id' => 'ID','play_title' => 'Play Title','play_from' => 'Play From','play_url' => 'Play Url','play_url_aes' => 'Play Url Aes','url_id' => 'Url ID','create_time' => 'Create Time','update_time' => 'Update Time',];}
}
VodDetailSearch:
<?phpnamespace common\models;use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\VodDetail;/*** VodDetailSearch represents the model behind the search form of `common\models\VodDetail`.*/
class VodDetailSearch extends VodDetail
{/*** {@inheritdoc}*/public function rules(){return [[['id', 'vod_status', 'vod_pubdate', 'vod_hits', 'vod_hits_day', 'vod_hits_week', 'vod_hits_month', 'vod_up', 'vod_down', 'vod_score_all', 'vod_score_num', 'vod_create_time', 'vod_update_time', 'vod_lately_hit_time'], 'integer'],[['url', 'url_id', 'vod_title', 'vod_sub_title', 'vod_blurb', 'vod_content', 'vod_type', 'vod_class', 'vod_tag', 'vod_pic_url', 'vod_pic_path', 'vod_pic_thumb', 'vod_actor', 'vod_director', 'vod_writer', 'vod_remarks', 'vod_area', 'vod_lang', 'vod_year'], 'safe'],[['vod_score'], 'number'],];}/*** {@inheritdoc}*/public function scenarios(){// bypass scenarios() implementation in the parent classreturn Model::scenarios();}/*** Creates data provider instance with search query applied** @param array $params** @return ActiveDataProvider*/public function search($params){$query = VodDetail::find();// add conditions that should always apply here$dataProvider = new ActiveDataProvider(['query' => $query,'pagination' => ['pageSize' => 50],'sort' => ['defaultOrder' => ['vod_update_time' => SORT_DESC],
// 'attributes' => ['id', 'title'],],]);$this->load($params);if (!$this->validate()) {// uncomment the following line if you do not want to return any records when validation fails// $query->where('0=1');return $dataProvider;}// grid filtering conditions$query->andFilterWhere(['id' => $this->id,'vod_status' => $this->vod_status,'vod_pubdate' => $this->vod_pubdate,'vod_hits' => $this->vod_hits,'vod_hits_day' => $this->vod_hits_day,'vod_hits_week' => $this->vod_hits_week,'vod_hits_month' => $this->vod_hits_month,'vod_up' => $this->vod_up,'vod_down' => $this->vod_down,'vod_score' => $this->vod_score,'vod_score_all' => $this->vod_score_all,'vod_score_num' => $this->vod_score_num,'vod_create_time' => $this->vod_create_time,'vod_update_time' => $this->vod_update_time,'vod_lately_hit_time' => $this->vod_lately_hit_time,]);$query->andFilterWhere(['like', 'url', $this->url])->andFilterWhere(['like', 'url_id', $this->url_id])->andFilterWhere(['like', 'vod_title', $this->vod_title])->andFilterWhere(['like', 'vod_sub_title', $this->vod_sub_title])->andFilterWhere(['like', 'vod_blurb', $this->vod_blurb])->andFilterWhere(['like', 'vod_content', $this->vod_content])->andFilterWhere(['like', 'vod_type', $this->vod_type])->andFilterWhere(['like', 'vod_class', $this->vod_class])->andFilterWhere(['like', 'vod_tag', $this->vod_tag])->andFilterWhere(['like', 'vod_pic_url', $this->vod_pic_url])->andFilterWhere(['like', 'vod_pic_path', $this->vod_pic_path])->andFilterWhere(['like', 'vod_pic_thumb', $this->vod_pic_thumb])->andFilterWhere(['like', 'vod_actor', $this->vod_actor])->andFilterWhere(['like', 'vod_director', $this->vod_director])->andFilterWhere(['like', 'vod_writer', $this->vod_writer])->andFilterWhere(['like', 'vod_remarks', $this->vod_remarks])->andFilterWhere(['like', 'vod_area', $this->vod_area])->andFilterWhere(['like', 'vod_lang', $this->vod_lang])->andFilterWhere(['like', 'vod_year', $this->vod_year]);return $dataProvider;}
}
VodDetailController:
<?phpnamespace frontend\controllers;use Yii;
use common\models\VodDetail;
use common\models\VodDetailSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;/*** VodDetailController implements the CRUD actions for VodDetail model.*/
class VodDetailController extends Controller
{/*** {@inheritdoc}*/public function behaviors(){return ['verbs' => ['class' => VerbFilter::className(),'actions' => ['delete' => ['POST'],],],];}/*** Lists all VodDetail models.* @return mixed*/public function actionIndex(){$searchModel = new VodDetailSearch();$dataProvider = $searchModel->search(Yii::$app->request->queryParams);return $this->render('index', ['searchModel' => $searchModel,'dataProvider' => $dataProvider,]);}/*** Displays a single VodDetail model.* @param integer $id* @return mixed* @throws NotFoundHttpException if the model cannot be found*/public function actionView($id){return $this->render('view', ['model' => $this->findModel($id),]);}/*** Creates a new VodDetail model.* If creation is successful, the browser will be redirected to the 'view' page.* @return mixed*/public function actionCreate(){$model = new VodDetail();if ($model->load(Yii::$app->request->post()) && $model->save()) {return $this->redirect(['view', 'id' => $model->id]);}return $this->render('create', ['model' => $model,]);}/*** Updates an existing VodDetail model.* If update is successful, the browser will be redirected to the 'view' page.* @param integer $id* @return mixed* @throws NotFoundHttpException if the model cannot be found*/public function actionUpdate($id){$model = $this->findModel($id);if ($model->load(Yii::$app->request->post()) && $model->save()) {return $this->redirect(['view', 'id' => $model->id]);}return $this->render('update', ['model' => $model,]);}/*** Deletes an existing VodDetail model.* If deletion is successful, the browser will be redirected to the 'index' page.* @param integer $id* @return mixed* @throws NotFoundHttpException if the model cannot be found* @throws \Throwable* @throws \yii\db\StaleObjectException*/public function actionDelete($id){$this->findModel($id)->delete();return $this->redirect(['index']);}/*** Finds the VodDetail model based on its primary key value.* If the model is not found, a 404 HTTP exception will be thrown.* @param integer $id* @return VodDetail the loaded model* @throws NotFoundHttpException if the model cannot be found*/protected function findModel($id){if (($model = VodDetail::findOne($id)) !== null) {return $model;}throw new NotFoundHttpException('The requested page does not exist.');}
}
视图文件:
影视列表:
<?phpuse yii\helpers\Html;
use yii\grid\GridView;/* @var $this yii\web\View */
/* @var $searchModel common\models\VodDetailSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */$this->title = '影片列表';
$this->params['breadcrumbs'][] = $this->title;
?><div class="vod-detail-index"><h1><?= Html::encode($this->title) ?></h1><!-- <p>--><!-- --><? //= Html::a('Create Vod Detail', ['create'], ['class' => 'btn btn-success']) ?><!-- </p>--><?php echo $this->render('_search', ['model' => $searchModel]); ?><?= GridView::widget(['dataProvider' => $dataProvider,'filterModel' => $searchModel,
// 'showHeader' => false,'showFooter' => false,'columns' => [//['class' => 'yii\grid\SerialColumn'],//'id',//'url:url',//'url_id:url',//'vod_title',['attribute' => 'vod_title', 'value' => function ($data) {return Html::a($data->vod_title, ['vod-detail/view', 'id' => $data->id], ['title' => '详情']);}, 'format' => ['html']],//'vod_sub_title',//'vod_blurb',//'vod_content:ntext',//'vod_status',//'vod_type',['attribute' => 'vod_type', 'value' => function ($data) {return Html::a($data->vod_type, ['vod-detail/index', 'VodDetailSearch' => ['vod_type'=>$data->vod_type]], ['title' => '分类']);}, 'format' => ['html']],//'vod_class',//'vod_tag',//'vod_pic_url:url',//'vod_pic_path',//'vod_pic_thumb',//'vod_actor',//'vod_director',//'vod_writer','vod_remarks',//'vod_pubdate',//'vod_area',//'vod_lang',//'vod_year',['attribute' => 'vod_year', 'value' => function ($data) {return Html::a($data->vod_year, ['vod-detail/index', 'VodDetailSearch' => ['vod_year'=>$data->vod_year]], ['title' => '年代']);}, 'format' => ['html']],//'vod_hits',//'vod_hits_day',//'vod_hits_week',//'vod_hits_month',//'vod_up',//'vod_down',//'vod_score',//'vod_score_all',//'vod_score_num',//'vod_create_time:datetime',//'vod_update_time:datetime',['attribute' => 'vod_update_time', 'format' => ['date', 'php:Y-m-d H:i:s']],//'vod_lately_hit_time:datetime',/*['class' => 'yii\grid\ActionColumn','template' => '{view}',],*/],'pager' => [//'options' => ['class' => 'hidden']//关闭分页(默认开启)/* 默认不显示的按钮设置 */'firstPageLabel' => '首页','prevPageLabel' => '上一页','nextPageLabel' => '下一页','lastPageLabel' => '尾页']]); ?></div>
影视详情:
<?phpuse yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\DetailView;/* @var $this yii\web\View */
/* @var $model common\models\VodDetail */$this->title = $model->vod_title;
$this->params['breadcrumbs'][] = ['label' => '影片列表', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
\yii\web\YiiAsset::register($this);
$playurlsList = ArrayHelper::index($model->playurls, null, 'play_from');
?>
<div class="stui-pannel clearfix"><div class="stui-content clearfix"><div class="stui-content__thumb"><?= Html::tag('a', Html::img($model->vod_pic_url, ['class' => 'img-responsive','alt' => $model->vod_title]), ['class' => 'thumb', 'href' => Url::toRoute(['vod-detail/view', 'id' => $model->id]),'title' => $model->vod_title]) ?><p class="margin-0 text-center hidden-xs"><a class="copy_btn text-muted" href="javascript:;"data-text=<?= Url::to('', true) ?>>复制图片地址</a></p></div><div class="stui-content__detail"><?= Html::tag('h1', $model->vod_title . Html::tag('small', $model->vod_score, ['class' => 'text-red']), ['class' => 'title']) ?><?= Html::tag('p', Html::tag('span', '别名:' . $model->vod_sub_title, ['class' => 'text-muted hidden-xs']), ['class' => 'data hidden-xs']) ?><?= Html::tag('p', Html::tag('span', '地区:' . $model->vod_area, ['class' => 'text-muted']), ['class' => 'data hidden-md hidden-lg hidden-sm']) ?><p class="data"><?= Html::tag('span', '状态:', ['class' => 'text-muted']) ?><?= Html::tag('span', $model->vod_remarks, ['class' => 'text-red']) ?><span class="split-line hidden-xs"></span><span class="text-muted hidden-xs">更新时间:</span><?= Html::tag('span', date('Y-m-d H:i:s', $model->vod_update_time)) ?></p><p class="data"><span class="text-muted">主演:</span><?php echo $model->vod_actor ?></p><p class="data"><span class="text-muted">导演:</span><?php echo $model->vod_director ?></p><p class="data hidden-xs"><span class="text-muted">分类:</span><?php echo $model->vod_type ?> <span class="split-line"></span><!--<span class="text-muted">扩展:</span><ahref="/index.php/vod/search/class/%E6%AC%A7%E7%BE%8E%E5%89%A7.html" target="_blank">欧美剧</a> --><span class="split-line"></span><span class="text-muted">地区:</span><?php echo $model->vod_area ?> <span class="split-line"></span><span class="text-muted">年份:</span><?php echo $model->vod_year ?> </p><p class="data hidden-xs"><span class="text-muted">语言:</span><?php echo $model->vod_lang ?> <span class="split-line"></span><!--<span class="text-muted">集数:</span>0 <span class="split-line"></span><span class="text-muted">时长:</span> <span class="split-line"></span><span class="text-muted">豆瓣ID:</span>0 </p>--><p class="data hidden-xs"><span class="text-muted">TAG:</span> <span class="split-line"><?php echo $model->vod_tag ?></span></p></div></div>
</div>
<div class="stui-pannel clearfix" id="desc"><div class="stui-pannel__head clearfix"><h3 class="title">剧情介绍</h3></div><div class="stui-content__desc col-pd clearfix"><?= nl2br($model->vod_content); ?></div>
</div>
<?php foreach ($playurlsList as $key => $playurls): ?><div class="stui-pannel clearfix" id="playlist"><div class="stui-pannel__head clearfix"><span class="more text-muted pull-right hidden-xs">无需安装任何插件</span><h3 class="title"> 播放类型:<?php echo $key ?></h3></div><ul class="stui-content__playlist clearfix"><?php foreach ($playurls as $key => $playurl): ?><li class="list-group-item"><span class="badge">用App打开</span><a href="javascript:;" class="copy_text"><?= $playurl->play_title ?><span class="hidden-xs"><?= '$'. $playurl->play_url ?></span></a></li><!--<li><a class="text-muted pull-right" href="/index.php/vod/play/id/43801/sid/1/nid/1.html"> ></a><a href="javascript:;" class="copy_text"><?/*= $playurl->play_title */?><span class="hidden-xs"><?/*= '$'. $playurl->play_url */?></span></a></li>--><?php endforeach; ?><!-- end 播放地址 --></ul><div class="stui-pannel__foot clearfix"><span class="text-muted pull-right hidden-xs">tips:点击链接可以复制哦</span><a class="copy_checked text-red" href="javascript:;">复制全部</a></div></div>
<?php endforeach; ?>
别忘了注入自定义的js和css文件。
整个WEB网站的搭建自行代码写的最多的就是影视详情页的模板。列表页是yii
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
相关文章
- MVC框架对Controller层开发的支持
MVC框架对Controller层开发的支持 1.MVC基础配置 1. 基础的目录结构:2. pom.xml中引入MVC模块 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/200…...
2024/4/28 18:45:43 - Android MVP模式下的全局监听网络状态优化
Android MVP模式下的全局监听网络状态优化 刚接触安卓的时候是最普通的MVC模式,换了一家公司后认识到MVP模式的重要性(面试别的公司没有接触过MVP模式被嫌弃o(╥﹏╥)o)正好在新的公司练练手,下面进入正题(MVP模式小白,大神勿喷!):首先这个是我自己设计的一些包便于管…...
2024/4/13 15:57:06 - 一文阐述数据中台和传统数据仓库的区别
数据中台成为热点,“中台”这个概念,是相对于前台和后台而生,是前台和后台的链接点,将业务共同的工具和技术予以沉淀。数据中台是指数据采集交换、共享融合、组织处理、建模分析、管理治理和服务应用于一体的综合性数据能力平台,在大数据生态中处于承上启下的功能,提供面…...
2024/4/27 8:40:41 - Jmeter安装及入门教程(超详细)
一、Jmeter安装教程 1、首先进入官网:Jmeter官网下载正版的Jemeter2、安装和本地JDK对应的JMeter版本 我安装的是Jemeter5 官方提示对应的是8以上的jdk,所以需要找到对应的JDK8对应的Jemeter4版本(注意版本一定要按官方提示的对应,否则后期会受影响)。附上官网上提供的全部…...
2024/4/21 3:46:58 - 使用supervisor管理laravel队列
相关文章 使用Redis实现队列 使用Databse实现队列 背景 前面实现了三种的队列方式,使用命令php artisan queue:work 可以启动队列但是在项目运行中,会发现queue: listen是线性的,就说执行完一个才会执行下一个,这样并不能满足我们日常的异步耗时任务处理的需求,于是有人建…...
2024/4/28 2:20:38 - SmartFusion从FPGA到ARM(八)——CoreUARTapb的使用
文章目录1.CoreUARTapb简介2.添加CoreAPB3总线IP核3.添加CoreUARTapb4.驱动代码实现5.库函数简介6.串口printf函数实现7.串口接收轮询和中断方式 系列教程:SmartFusion从FPGA到ARM系列教程 1.CoreUARTapb简介 对于SmartFusion2来说,MSS_UART的管脚可以任意分配,但是对于Smar…...
2024/4/28 2:20:38 - 算法探索_删除排序链表中的重复元素 II
问题描述:给定一个排序链表,删除所有含有重复数字的节点,只保留原始链表中 没有重复出现 的数字。示例 1:输入: 1->2->3->3->4->4->5 输出: 1->2->5示例 2:输入: 1->1->1->2->3 输出: 2->3来源:力扣(LeetCode) 链接:https://lee…...
2024/5/2 2:34:38 - 《python语言程序设计基础》—— 第三章
数字类型 整数类型 整数有4中进制表示:十进制、二进制、八进制、十六进制。默认采用十进制,其他进制加引导符号。整数范围理论上是[负无穷,正无穷],实际上收到计算机内存大小的限制。二进制:0b或者0B 八进制:0o或者0O 十六进制0x或者0X浮点数类型 Python要求所有浮点数必…...
2024/4/20 1:21:01 - C++指针与引用
文章目录一、指针1.定义定义间接访问2.左值和右值3.几种原始指针(1)一般类型指针 T*(2)指针的数组与数组的指针(3)指向指针的指针(4)未初始化和非法的指针(野指针)(5)NULL指针4.const与指针的关系5.指针的基本运算(1)&和*操作符(2)++和--操作符二、C++程序…...
2024/4/29 3:22:14 - fiddler代理手机抓包的设置详解
最近在与第三方公司对接的时候,遇到一个关于证书的问题,然后第三方公司就让我在自己的设备上抓包,一开始认为fiddler只能抓电脑的包,后来才发现fiddler工具也可以代理手机抓包,详细设置如下:步骤:1.打开fiddler,Tools/Terlerik fiddler Options进入设置界面:配置好端…...
2024/4/13 19:46:41 - “虚拟试穿”的前景如何呢?
人们在逛街买衣服的时候,需要在商场里不停地逛,看看能否找到自己中意喜欢的衣服,感觉好的就会选择试穿,看看衣服穿到身上后的效果,这样的试穿就会很真实,镜子里的自己穿着是美的,这衣服就适合自己,自己就会选择进入下一个流程,买或不卖。真实的试穿,可以切实的看到衣…...
2024/4/13 15:59:39 - 七牛云图床配置
七牛云图床配置 第一步 首先需要去七牛云注册一个账号并进行实名认证,实名认证需要一定的审核时间,这个我就不说了 第二步 创建存储服务 登录到控制台,新建一个存储空间,输入存储空间的名称,选择存储区域,本存储空间是用于站点图床,所以选择访问控制类型为公开空间,如下…...
2024/4/27 21:03:15 - 图像处理工具如何正确的颜色和对比度
ImagXpress 是最先进的彩色映像和照片图像处理工具包,它发布的形式有:.NET控件、COM组件、VC组件。用ImagXpress ,开发者构建的应用程序可以支持图像浏览、编辑、打印、TWAIN扫描、文件格式转换等等。ImagXpress 提供了综合的图像处理函数集,支持30多种文件格式,拥有惊人的…...
2024/3/15 12:22:13 - phpstrom设置常规快捷键keymap
phpstrom设置常规快捷键keymap File -> Settings -> Keymap 可设置自己熟悉的快捷键,如Windows、Emacs、eclipse 、NetBeans、Sublime Text、Visual Studio等快捷键...
2024/4/7 7:42:52 - SpringBoot学习笔记——SPI热插拔原则
1.1什么叫SPI SPI的全名为Service Provider Interface,单从字面可以理解为Service提供者接口,正如从SPI的名字去理解SPI就是提供给服务提供厂商与扩展框架功能的开发者使用的接口。 简单的总结下javaSPI机制的思想。我们系统里抽象的各个模块,往往有很多不同的实现方案。面向…...
2024/3/15 12:22:08 - 损失函数之center loss
A Discriminative Feature Learning Approach for Deep Face Recognition-ECCV2016 概要 对于常见的图像分类问题,我们常常用softmax loss来求损失,最后各个类别学出来的特征分布大概如下图Fig2。这个图是以MNISTt数据集做的实验,一共10个类别,用不同的颜色表示。从Fig2可以…...
2024/3/17 8:59:27 - TMP-搜索文档
1 搜索分类在 Elasticsearch 中的搜索中,有两类搜索:queries:进行全文搜索aggregations:对数据进行统计及分析# 结合query 及 aggregation一起使用 GET blogs/_search {"query": {"match": {"title": "community"}},"aggrega…...
2024/3/15 12:22:08 - mybatis常用配置文件
mybatis-config.xml <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configurationPUBLIC "-//mybatis.org//DTD Config 3.0//EN""http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration><prope…...
2024/4/22 2:56:23 - 08.Oracle中的基础查询
Oracle 基础查询 1. 查询内容区分大小写 -- 通过lower屏蔽大小写字母的差别 select * from scott.emp where lower(ename) = smith;-- MySQL不区分大小写(如果要区分使用binray关键字在where字段前) select * from t_user where binary name = tom;2. 别名 -- 如果别名中含有…...
2024/4/25 3:19:23 - GIS定位偏移过大;GIS定位相关
解决方案无非两种 1、切换GIS地图 2、转换坐标 解决方案 1 //切换地图就不多说看文档 esri-》Map-》basemap 解决方案 2//首先查看GIS坐标系map.spatialReference // 102100 投影坐标系//若在此时创建点线面位置一定会报错//解决方案 看文档 esri/geometry/webMercatorUtilsge…...
2024/4/26 10:48:03
最新文章
- LeetCode 131 —— 分割回文串
阅读目录 1. 题目2. 解题思路3. 代码实现 1. 题目 2. 解题思路 首先,按照 LeetCode 5——最长回文子串 中的思路,我们先求出 d p dp dp,这样我们就知道了所有的子串是否是回文子串。 然后,我们进行一个 dfs 搜索,起…...
2024/5/2 21:15:34 - 梯度消失和梯度爆炸的一些处理方法
在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言,在此感激不尽。 权重和梯度的更新公式如下: w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...
2024/3/20 10:50:27 - 推荐学习什么编程语言?
选择编程语言学习时,除了就业因素外,还可以考虑以下几个方面来决定学习哪些编程语言: 个人兴趣与目标:如果你对某个特定领域感兴趣,比如游戏开发、数据分析、人工智能等,可以选择与该领域紧密相关的编程语言…...
2024/5/1 18:09:40 - Vue ts 如何给 props 中的变量指定特定类型,比如 Interface 类的
Vue ts 如何给 props 中的变量指定特定类型,比如 Interface 类的 我有一个这样的变量值类型 一、在没用 ts 之前的 props 类型指定方式 我们都知道之前在没用 ts 之前的 props 变量值类型指定方式: 如下图,billFood 定义方式是这样的&…...
2024/5/2 17:08:55 - 【Redis 二】Redis客户端(Jedis、SpringDataRedis、RedisTemplate)
1. Redis客户端 Jedis 以redis命令作为方法名称,学习成本低,但是Jedis实例是线程不安全的,多线程环境下需要基于连接池来使用(必须为每个线程分配独立的Jedis连接) lettuce 基于Netty实现,支持同步、异步和…...
2024/5/2 5:21:40 - 416. 分割等和子集问题(动态规划)
题目 题解 class Solution:def canPartition(self, nums: List[int]) -> bool:# badcaseif not nums:return True# 不能被2整除if sum(nums) % 2 ! 0:return False# 状态定义:dp[i][j]表示当背包容量为j,用前i个物品是否正好可以将背包填满ÿ…...
2024/5/2 11:19:01 - 【Java】ExcelWriter自适应宽度工具类(支持中文)
工具类 import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet;/*** Excel工具类** author xiaoming* date 2023/11/17 10:40*/ public class ExcelUti…...
2024/5/2 16:04:58 - Spring cloud负载均衡@LoadBalanced LoadBalancerClient
LoadBalance vs Ribbon 由于Spring cloud2020之后移除了Ribbon,直接使用Spring Cloud LoadBalancer作为客户端负载均衡组件,我们讨论Spring负载均衡以Spring Cloud2020之后版本为主,学习Spring Cloud LoadBalance,暂不讨论Ribbon…...
2024/5/1 21:18:12 - TSINGSEE青犀AI智能分析+视频监控工业园区周界安全防范方案
一、背景需求分析 在工业产业园、化工园或生产制造园区中,周界防范意义重大,对园区的安全起到重要的作用。常规的安防方式是采用人员巡查,人力投入成本大而且效率低。周界一旦被破坏或入侵,会影响园区人员和资产安全,…...
2024/5/2 9:47:31 - VB.net WebBrowser网页元素抓取分析方法
在用WebBrowser编程实现网页操作自动化时,常要分析网页Html,例如网页在加载数据时,常会显示“系统处理中,请稍候..”,我们需要在数据加载完成后才能继续下一步操作,如何抓取这个信息的网页html元素变化&…...
2024/5/2 9:47:31 - 【Objective-C】Objective-C汇总
方法定义 参考:https://www.yiibai.com/objective_c/objective_c_functions.html Objective-C编程语言中方法定义的一般形式如下 - (return_type) method_name:( argumentType1 )argumentName1 joiningArgument2:( argumentType2 )argumentName2 ... joiningArgu…...
2024/5/2 6:03:07 - 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】
👨💻博客主页:花无缺 欢迎 点赞👍 收藏⭐ 留言📝 加关注✅! 本文由 花无缺 原创 收录于专栏 【洛谷算法题】 文章目录 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】🌏题目描述🌏输入格…...
2024/5/2 9:47:30 - 【ES6.0】- 扩展运算符(...)
【ES6.0】- 扩展运算符... 文章目录 【ES6.0】- 扩展运算符...一、概述二、拷贝数组对象三、合并操作四、参数传递五、数组去重六、字符串转字符数组七、NodeList转数组八、解构变量九、打印日志十、总结 一、概述 **扩展运算符(...)**允许一个表达式在期望多个参数࿰…...
2024/5/1 11:24:00 - 摩根看好的前智能硬件头部品牌双11交易数据极度异常!——是模式创新还是饮鸩止渴?
文 | 螳螂观察 作者 | 李燃 双11狂欢已落下帷幕,各大品牌纷纷晒出优异的成绩单,摩根士丹利投资的智能硬件头部品牌凯迪仕也不例外。然而有爆料称,在自媒体平台发布霸榜各大榜单喜讯的凯迪仕智能锁,多个平台数据都表现出极度异常…...
2024/5/2 5:31:39 - Go语言常用命令详解(二)
文章目录 前言常用命令go bug示例参数说明 go doc示例参数说明 go env示例 go fix示例 go fmt示例 go generate示例 总结写在最后 前言 接着上一篇继续介绍Go语言的常用命令 常用命令 以下是一些常用的Go命令,这些命令可以帮助您在Go开发中进行编译、测试、运行和…...
2024/5/1 20:22:59 - 用欧拉路径判断图同构推出reverse合法性:1116T4
http://cplusoj.com/d/senior/p/SS231116D 假设我们要把 a a a 变成 b b b,我们在 a i a_i ai 和 a i 1 a_{i1} ai1 之间连边, b b b 同理,则 a a a 能变成 b b b 的充要条件是两图 A , B A,B A,B 同构。 必要性显然࿰…...
2024/5/2 9:47:28 - 【NGINX--1】基础知识
1、在 Debian/Ubuntu 上安装 NGINX 在 Debian 或 Ubuntu 机器上安装 NGINX 开源版。 更新已配置源的软件包信息,并安装一些有助于配置官方 NGINX 软件包仓库的软件包: apt-get update apt install -y curl gnupg2 ca-certificates lsb-release debian-…...
2024/5/2 9:47:27 - Hive默认分割符、存储格式与数据压缩
目录 1、Hive默认分割符2、Hive存储格式3、Hive数据压缩 1、Hive默认分割符 Hive创建表时指定的行受限(ROW FORMAT)配置标准HQL为: ... ROW FORMAT DELIMITED FIELDS TERMINATED BY \u0001 COLLECTION ITEMS TERMINATED BY , MAP KEYS TERMI…...
2024/5/2 0:07:22 - 【论文阅读】MAG:一种用于航天器遥测数据中有效异常检测的新方法
文章目录 摘要1 引言2 问题描述3 拟议框架4 所提出方法的细节A.数据预处理B.变量相关分析C.MAG模型D.异常分数 5 实验A.数据集和性能指标B.实验设置与平台C.结果和比较 6 结论 摘要 异常检测是保证航天器稳定性的关键。在航天器运行过程中,传感器和控制器产生大量周…...
2024/5/2 8:37:00 - --max-old-space-size=8192报错
vue项目运行时,如果经常运行慢,崩溃停止服务,报如下错误 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 因为在 Node 中,通过JavaScript使用内存时只能使用部分内存(64位系统&…...
2024/5/2 9:47:26 - 基于深度学习的恶意软件检测
恶意软件是指恶意软件犯罪者用来感染个人计算机或整个组织的网络的软件。 它利用目标系统漏洞,例如可以被劫持的合法软件(例如浏览器或 Web 应用程序插件)中的错误。 恶意软件渗透可能会造成灾难性的后果,包括数据被盗、勒索或网…...
2024/5/2 9:47:25 - JS原型对象prototype
让我简单的为大家介绍一下原型对象prototype吧! 使用原型实现方法共享 1.构造函数通过原型分配的函数是所有对象所 共享的。 2.JavaScript 规定,每一个构造函数都有一个 prototype 属性,指向另一个对象,所以我们也称为原型对象…...
2024/5/1 14:33:22 - C++中只能有一个实例的单例类
C中只能有一个实例的单例类 前面讨论的 President 类很不错,但存在一个缺陷:无法禁止通过实例化多个对象来创建多名总统: President One, Two, Three; 由于复制构造函数是私有的,其中每个对象都是不可复制的,但您的目…...
2024/5/2 18:46:52 - python django 小程序图书借阅源码
开发工具: PyCharm,mysql5.7,微信开发者工具 技术说明: python django html 小程序 功能介绍: 用户端: 登录注册(含授权登录) 首页显示搜索图书,轮播图࿰…...
2024/5/2 7:30:11 - 电子学会C/C++编程等级考试2022年03月(一级)真题解析
C/C++等级考试(1~8级)全部真题・点这里 第1题:双精度浮点数的输入输出 输入一个双精度浮点数,保留8位小数,输出这个浮点数。 时间限制:1000 内存限制:65536输入 只有一行,一个双精度浮点数。输出 一行,保留8位小数的浮点数。样例输入 3.1415926535798932样例输出 3.1…...
2024/5/1 20:56:20 - 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...
解析如下:1、长按电脑电源键直至关机,然后再按一次电源健重启电脑,按F8健进入安全模式2、安全模式下进入Windows系统桌面后,按住“winR”打开运行窗口,输入“services.msc”打开服务设置3、在服务界面,选中…...
2022/11/19 21:17:18 - 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。
%读入6幅图像(每一幅图像的大小是564*564) f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...
2022/11/19 21:17:16 - 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...
win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面,在等待界面中我们需要等待操作结束才能关机,虽然这比较麻烦,但是对系统进行配置和升级…...
2022/11/19 21:17:15 - 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...
有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows,请勿关闭计算机”的提示,要过很久才能进入系统,有的用户甚至几个小时也无法进入,下面就教大家这个问题的解决方法。第一种方法:我们首先在左下角的“开始…...
2022/11/19 21:17:14 - win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...
置信有很多用户都跟小编一样遇到过这样的问题,电脑时发现开机屏幕显现“正在配置Windows Update,请勿关机”(如下图所示),而且还需求等大约5分钟才干进入系统。这是怎样回事呢?一切都是正常操作的,为什么开时机呈现“正…...
2022/11/19 21:17:13 - 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...
Win7系统开机启动时总是出现“配置Windows请勿关机”的提示,没过几秒后电脑自动重启,每次开机都这样无法进入系统,此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一:开机按下F8,在出现的Windows高级启动选…...
2022/11/19 21:17:12 - 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...
有不少windows10系统用户反映说碰到这样一个情况,就是电脑提示正在准备windows请勿关闭计算机,碰到这样的问题该怎么解决呢,现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法:1、2、依次…...
2022/11/19 21:17:11 - 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...
今天和大家分享一下win7系统重装了Win7旗舰版系统后,每次关机的时候桌面上都会显示一个“配置Windows Update的界面,提示请勿关闭计算机”,每次停留好几分钟才能正常关机,导致什么情况引起的呢?出现配置Windows Update…...
2022/11/19 21:17:10 - 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...
只能是等着,别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚,只能是考虑备份数据后重装系统了。解决来方案一:管理员运行cmd:net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...
2022/11/19 21:17:09 - 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?
原标题:电脑提示“配置Windows Update请勿关闭计算机”怎么办?win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢?一般的方…...
2022/11/19 21:17:08 - 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...
关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!关机提示 windows7 正在配…...
2022/11/19 21:17:05 - 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...
钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...
2022/11/19 21:17:05 - 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...
前几天班里有位学生电脑(windows 7系统)出问题了,具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面,长时间没反应,无法进入系统。这个问题原来帮其他同学也解决过,网上搜了不少资料&#x…...
2022/11/19 21:17:04 - 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...
本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法,并在最后教给你1种保护系统安全的好方法,一起来看看!电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中,添加了1个新功能在“磁…...
2022/11/19 21:17:03 - 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...
许多用户在长期不使用电脑的时候,开启电脑发现电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机。。.这要怎么办呢?下面小编就带着大家一起看看吧!如果能够正常进入系统,建议您暂时移…...
2022/11/19 21:17:02 - 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...
配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!配置windows update失败 还原更改 请勿关闭计算机&#x…...
2022/11/19 21:17:01 - 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...
不知道大家有没有遇到过这样的一个问题,就是我们的win7系统在关机的时候,总是喜欢显示“准备配置windows,请勿关机”这样的一个页面,没有什么大碍,但是如果一直等着的话就要两个小时甚至更久都关不了机,非常…...
2022/11/19 21:17:00 - 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...
当电脑出现正在准备配置windows请勿关闭计算机时,一般是您正对windows进行升级,但是这个要是长时间没有反应,我们不能再傻等下去了。可能是电脑出了别的问题了,来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...
2022/11/19 21:16:59 - 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...
我们使用电脑的过程中有时会遇到这种情况,当我们打开电脑之后,发现一直停留在一个界面:“配置Windows Update失败,还原更改请勿关闭计算机”,等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢࿰…...
2022/11/19 21:16:58 - 如何在iPhone上关闭“请勿打扰”
Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...
2022/11/19 21:16:57