首页 文章 精选 留言 我的

精选列表

搜索[Java实现],共10000篇文章
优秀的个人博客,低调大师

js 返回页面顶部的实现( layui)

js代码 // 点击按钮,返回顶部 function topFunction() { document.getElementsByClassName('layui-body')[0].scrollTop = 0; } function scrollFun() { var layuiBodyScrollTop = document.getElementsByClassName('layui-body')[0].scrollTop console.log(layuiBodyScrollTop) if (layuiBodyScrollTop > 1000) { document.getElementById("back-to-top").style.display = "block"; } else { document.getElementById("back-to-top").style.display = "none"; } } /*注册事件*/ if (document.addEventListener) { document.addEventListener('DOMMouseScroll', scrollFun, false); }//W3C window.onmousewheel = document.onmousewheel = scrollFun;//IE/Opera/Chrome 需要注意的是, 你必须要确定好鼠标滚动所绑定的DOM元素到底是什么.例如, layui中的页面滚动绑定的是 document.getElementsByClassName('layui-body') css代码 #back-to-top { display: none; position: fixed; bottom: 10px; right: 20px; z-index: 99999999999999; border: none; outline: none; background-color: #009688; color: white; cursor: pointer; padding: 5px; border-radius: 10px; } #back-to-top:hover { background-color: #23262E; } 前端HTML部分: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <!-- 强制让文档与设备的宽度保持1:1 --> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"> <link href="/assets/logo.jpg" rel="shortcut icon" type="image/x-icon"/> <title>MicroTek</title> <link rel="stylesheet" href="/assets/layui/css/layui.css"> <style> .layui-body { left: 40px; } .layui-layout-admin .layui-footer { left: 0; } .layui-layout-admin .layui-body { bottom: 0; } .layui-card-header { border-bottom: 0; } .layui-card { box-shadow: 0 0 0 0 rgba(0, 0, 0, .05); } </style> <link href="/bower_components/bootstrap/dist/css/bootstrap-theme.css" rel="stylesheet"> <link href="/bower_components/bootstrap-table/src/bootstrap-table.css" rel="stylesheet"> <link href="/bower_components/bootstrap/dist/css/bootstrap.css" rel="stylesheet"> <link href="/bower_components/pnotify/src/pnotify.css" rel="stylesheet"> <link href="/app.css" rel="stylesheet"> </head> <body class="layui-layout-body"> <button onclick="topFunction()" id="back-to-top" title="回顶部">返回顶部</button> <div class="layui-layout layui-layout-admin"> <div class="layui-header"> <div class="layui-logo"> <img src="/assets/logo.jpg" style="height: 2.5em ;width: 2.5em"> <a href="/" style="color: #009688;font-size: 1.2em;">微技 GD</a> </div> <!-- 头部区域(可配合layui已有的水平导航) --> <ul class="layui-nav layui-layout-left"> <li class="layui-nav-item"><a href="/">GD 技术流</a></li> <li class="layui-nav-item"> <a href="javascript:;">微图</a> <dl class="layui-nav-child"> <dd><a href="/sotu_gank_view">干货福利</a></dd> <dd><a href="/sotu_favorite_view">精选收藏</a></dd> </dl> </li> <li class="layui-nav-item"> <a href="javascript:;">爬虫任务</a> <dl class="layui-nav-child"> <dd><a href="/knowledge/doCrawJianShu" target="_blank">抓取简书</a></dd> <dd><a href="/knowledge/doCrawSegmentFaultKnowledge" target="_blank">抓取SegmentFault</a></dd> <dd><a href="/knowledge/doCrawOSChinaKnowledge" target="_blank">抓取OSChina</a></dd> <dd><a href="/knowledge/doCrawITEyeKnowledge" target="_blank">抓取ITEye</a></dd> <dd><a href="/knowledge/doCrawImportNewKnowledge" target="_blank">抓取ImportNew</a></dd> <dd><a href="/knowledge/doCrawCNBlogKnowledge" target="_blank">抓取CNBlog</a></dd> <dd><a href="/knowledge/doCrawInfoQKnowledge" target="_blank">抓取InfoQ</a></dd> <dd><a href="/knowledge/doCrawBlockChainKnowledge" target="_blank">BlockChain</a></dd> <dd><a href="/knowledge/KnowledgeCrawlerOfSpring4All" target="_blank">Spring4All</a></dd> <dd><a href="/knowledge/KnowledgeCrawlerOfConcurrentProgramming" target="_blank">并发编程网</a></dd> <dd></dd> <dd><a href="/doGankImageCrawJob">干货福利</a></dd> </dl> </li> <li class="layui-nav-item"> <a href="javascript:;">解决方案</a> <dl class="layui-nav-child"> <dd><a href="javascript:;">列表一</a></dd> <dd><a href="javascript:;">列表二</a></dd> <dd><a href="">超链接</a></dd> </dl> </li> <li class="layui-nav-item"><a href="">机器人管理</a></li> <li class="layui-nav-item"><a href="">发布服务</a></li> <li class="layui-nav-item"><a href="">用户管理</a></li> <li class="layui-nav-item"> <a href="javascript:;">其它系统</a> <dl class="layui-nav-child"> <dd><a href="">邮件管理</a></dd> <dd><a href="">消息管理</a></dd> <dd><a href="">授权管理</a></dd> </dl> </li> </ul> <ul class="layui-nav layui-layout-right"> <li class="layui-nav-item"> <a href="javascript:;">微技</a> <dl class="layui-nav-child"> <dd><a href="">基本资料</a></dd> <dd><a href="">安全设置</a></dd> </dl> </li> <li class="layui-nav-item"><a href="">退了</a></li> </ul> </div> <div class="layui-body"> .... 锚点位置: <button onclick="topFunction()" id="back-to-top" title="回顶部">返回顶部</button>

优秀的个人博客,低调大师

iOS简单的实现短信验证功能

一、注册应用获取appKey 和 appSecret(1)到Mob官网注册成为Mob开发者;(2)到应用管理后台新建应用。详细注册步骤请点击这个文档说明二、 集成SMSSDK(1)cocoapods集成方式通过 CocoaPods进行安装,只需在 Podfile文件中添加: pod 'mob_smssdk' 添加之后执行 pod install / pod update 命令即可。(2)手动集成方式 获取SMSSDK:点击链接下载最新版SDK,解压后得到以下文件结构: 导入SDK:将下图中红色框标记的文件夹(包含MOBFoundation.framework 和 SMS_SDK.framework)拖入到工程中 确认勾选,点击finish完成导入 添加依赖库:SDK所需依赖库列表: 必要:libz.dyliblibicucore.dylibMessageUI.frameworkJavaScriptCore.frameworklibstdc++.dylib注意:在XCode7上面运行报错的话,还需要增加这几个依赖库SystemConfiguration.frameworkCoreTelephony.frameworkAdSupport.framework可选:AddressBook.framework (通讯录功能需要)AddressBookUI.framework(通讯录功能需要) 三、配置appkey和appSecret在项目中的info.plist文件中添加键值对,键分别为MOBAppKey和MOBAppSecret,值为步骤一申请的appkey和appSecret配置通讯录好友功能所需的私密key,键为:NSContactsUsageDescription 四、使用sdk发送和验证验证码导入头文件 #import <SMS_SDK/SMSSDK.h> 请求短信验证码 //带自定义模版 [SMSSDK getVerificationCodeByMethod:SMSGetCodeMethodSMS phoneNumber:@"13800138000" zone:@"86" template:@"123456" result:^(NSError *error) { if (!error) { // 请求成功 } else { // error } }]; //不带自定义模版 [SMSSDK getVerificationCodeByMethod:SMSGetCodeMethodSMS phoneNumber:@"13800138000" zone:@"86"result:^(NSError *error) { if (!error) { // 请求成功 } else { // error } }]; ``` 注模板id在官网后台 SMSSDK产品下的短信模版里面添加(需要申请过自定义短信签名的应用才能添加短信模板) ![6](https://yqfile.alicdn.com/a442dbbd0afa89edc15e8352e59c260d212a4c06.png) 提交短信验证码 Objective-C [SMSSDK commitVerificationCode:@"1234" phoneNumber:@"13800138000" zone:@"86" result:^(NSError *error) {if (!error){// 验证成功}else{// error}}];

优秀的个人博客,低调大师

CPA广告联盟弹窗广告实现方法?

下边是参考汇成广告联盟做的一个案列: <!-- 请按照以下步骤进行: <!-- STEP ONE: 将以下代码粘贴在<head>区 --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> function popUp() { props=window.open('http://www.hczzw.com', 'poppage', 'toolbars=1, scrollbars=1, location=1, statusbars=1, menubars=1, resizable=1, width=200, height=100'); } // End --> </script> <!-- 步骤二: 用以下的按钮代码打开一个新窗口--> <form> <input type=button value="Open the Popup Window" onClick="javascript:popUp()"> </form> <!--代码结束-->

优秀的个人博客,低调大师

QT中VideoProbe的简介和实现

一、遇到问题 在Android机上使用QT进行图像处理程序设计的时候,遇到的一个比较明显的问题就是图片采集的问题----摄像头获得是实时的视频,如果我们想从中动态地截获图片,并且转换成Mat的格式,那么仅仅是静态的imagecapturee就无法完成,必须要依靠 VideoProbe机制。 二、基本情况 我们参考QT的相关文档: QVideoProbe class允许你监控正在播放或者记录的视频 它的头文件 #include<QVideoProbe>qmake: QT+=multimediaInherits: QObject 成员函数 Public Functions QVideoProbe(QObject*parent=Q_NULLPTR)~QVideoProbe()bool isActive()constbool setSource(QMediaObject*source)bool setSource(QMediaRecorder*mediaRecorder) 可以发出两个信号,其中比较重要的是后面一个videoFrameProbed void flush()void videoFrameProbed(constQVideoFrame&frame) 基本例子,比如打开视频: QMediaPlayer*player=newQMediaPlayer();QVideoProbe*probe=newQVideoProbe;connect(probe, SIGNAL(videoFrameProbed(QVideoFrame)),this, SLOT(processFrame(QVideoFrame)));probe->setSource(player);// Returns true, hopefully.player->setVideoOutput(myVideoSurface);player->setMedia(QUrl::fromLocalFile("observation.mp4"));player->play();// Start receiving frames as they get presented to myVideoSurface 同样可以打开QCamera 三、编写代码 它的主要结构(流程)是这样的,我们创建QMl的代码: 在qml中生成camera和probe对象。这个probe对象是对原始QVideoProbe的重新封装,原始的QVideoProbe在 看的更清楚一些 在 probe对象中,首先通过调用摄像头,将videoframeprobed信号和processframe槽对应起来。这样一旦有视频probed则自动触发processframe。 注意在这行代码中 _camera=qvariant_cast<QCamera*>(_qmlCamera->property("mediaObject")); 是c++调用qml对象的方法,是将qmlcamera强转为qcamera的一句 videoFrameProbed是自动触发的信号,其结果将被 processFrame截获并处理。信号和槽的方式是可以直接带变量传递的。 在process中,最主要的步骤就是QVideoFrame格式和Mat格式的转换。这个目前还没有非常好的方法,只能在NoHandle模式下进行灰度处理。但是对于图像处理来说已经能够解决一些问题。需要注意的是,最后采集的结果,通过 也就是 的模式将其直接推送到qml这里 四、小结 probe这种模式还是比较简单的,而且经过封装后能够很好地和OpenCV结合起来,用于图像采集处理。 来自为知笔记(Wiz) 目前方向:图像拼接融合、图像识别 联系方式:jsxyhelu@foxmail.com

优秀的个人博客,低调大师

BMH子串查找算法(PHP实现)

代码 interface StringSearchable { public function search($substring, $buffer); } class BoyerMooreStringSearch implements StringSearchable { public $substring = null; public $buffer = ''; public $jumpTable = array(); protected $results = array(); public function __construct() { } public function __destruct() { } public function search($substring, $buffer) { $this->results = array(); $this->substring = $substring; $this->buffer = $buffer; $this->deriveJumpTable(); $substringLen = strlen($this->substring); $currentCharIndex = $substringLen - 1; $bufferLen = strlen($this->buffer); while ($currentCharIndex < $bufferLen) { for ($i = $substringLen - 1; $i >= 0; $i--) { if ($this->buffer[$currentCharIndex - $substringLen + $i + 1] == $this->substring[$i]) { if ($i == 0) { $this->results[] = $currentCharIndex - $substringLen; $currentCharIndex += $this->getJumpLength($this->buffer[$currentCharIndex]); } else { continue; } } else { $currentCharIndex += $this->getJumpLength($this->buffer[$currentCharIndex]); break; } } } return (sizeof($this->results) > 0); } protected function deriveJumpTable() { $maxJump = strlen($this->substring); for ($i = strlen($this->substring) - 2; $i >= 0; $i--) { if (!array_key_exists($this->substring[$i], $this->jumpTable)) { $this->jumpTable[$this->substring[$i]]] = $maxJump - $i -1; } } } public function getJumpTable() { return $this->jumpTable; } public function getResults() { return $this->results; } public function getResultsCount() { return sizeof($this->results); } public function getJumpLength($charIndex) { if (array_key_exists($charIndex, $this->jumpTable)) { return $this->jumpTable[$charIndex]; } else { return strlen($this->substring); } } } function Main() { $poem = <<<POEM you son of bitch god damn it hey,god love me POEM; $bm = new BoyerMooreStringSearch(); $bm->search('god', $poem); $count = $bm->getResultsCount; echo $count; } 复制代码 本文转自Phinecos(洞庭散人)博客园博客,原文链接:http://www.cnblogs.com/phinecos/archive/2010/04/21/1717668.html,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册
修改密码
忘记密码