content

H5 plus 扫码功能实现

感情迁移 提交于 2019-11-30 00:33:40
scan.vue界面<template> <view class="content"> <view>二维码数据是:{{result}}</view> <button class="btn" type="primary" @tap="open">自定义二维码界面</button> </view> </template> <script> export default { data() { return { text: '测试', type: 'scan-listener', result: '' //获取到的二维码内容,根据自己需求处理结果 } }, methods: { handClick(res){ this.result = res; }, open() { uni.navigateTo({ url: './test?text=' + this.text + '&type=' + this.type, success: res => {}, fail: () => {}, complete: () => {} }); } }, onReady() { uni.$on('handClick',this.handClick) // #ifdef APP-PLUS // #endif }, onLoad() { // #ifdef APP-PLUS this.$eventHub.

如何让python嵌入html实现类似php的快速开发,十分有价值

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 23:41:31
1.在一个文件夹名为www.html3.com的web项目来实现,首先到nginx的配置文件nginx.conf做如下配置 python和html混合编写的文件,我以文件后缀为.phtml,通过服务器配置让它重定向到 /rewrite/ 2.进去项目目录下的static/html/ 编写一个1.phtml 内容如下(内容是随便写的,只是为了测试) <% #define a variable str_var = "hello world" ############# divide ################ import time if True: str_var2 = str(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) else: str_var2 = "nothing" %> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>phtml</title> <script> </script> </head> <body> <p>start</p> <p>I say: <span><% str_var %></span></p> <p>I say: <span><% str_var2 %></span></p> <p>end<

第一次个人编程作业

本秂侑毒 提交于 2019-11-29 22:21:07
仓库地址 PSP PSP2.1 Personal Software Process Stages 预估耗时(分钟) 实际耗时(分钟) · Planning · 计划 120 130 · Estimate · 估计这个任务需要多少时间 1750 2010 · Development · 开发 60 60 · Analysis · 需求分析 (包括学习新技术) 300 320 · Design Spec · 生成设计文档 120 150 · Design Review · 设计复审 90 100 · Coding Standard · 代码规范 (为目前的开发制定合适的规范) 60 80 Design · 具体设计 100 120 · Coding · 具体编码 360 500 · Code Review · 代码复审 60 90 · Test · 测试(自我测试,修改代码,提交修改) 180 200 · Reporting Standard · 报告 120 100 · Test Repor · 测试报告 60 70 · Size Measurement · 计算工作量 60 50 · Postmortem & Process Improvement Plan · 事后总结, 并提出过程改进计划 60 40 · · 合计 1750 2010 一、解题思路: 拿到题目后

使用python爬虫——爬取淘宝图片和知乎内容

不想你离开。 提交于 2019-11-29 21:22:25
本文主要内容: 目标:使用python爬取淘宝图片;使用python的一个开源框架pyspider(非常好用,一个国人写的)爬取知乎上的每个问题,及这个问题下的所有评论 最简单的爬虫——如下python代码 爬取淘宝上模特图片 爬取知乎的数据,需伪装成GoogleBot去爬,否则ip会被封掉,并通过MySQLdb保存到自己建的数据库中 爬取https://www.v2ex.com社区下的所有讨论话题 目标:使用python爬取淘宝图片;使用python的一个开源框架pyspider(非常好用,一个国人写的)爬取知乎上的每个问题,及这个问题下的所有评论 有2种实现方案: 1、使用pyspider开源框架,安装好pyspider并启动后,默认是本地的5001端口,新建一个爬虫项目,写下如下python代码实践爬去知乎的问题和评论数据,同时使用python-mysql,把爬到的数据存到自己建的一个数据库,把数据留给自己使用分析哈哈! 2、使用urllib,PyQuery,requests,BeautifulSoup等库自己实现一个简单的爬虫,可以爬取图片下载下来,存到数据库,或者爬取文本 本文共4部分: 写一个最简单的爬虫 爬取淘宝上的模特图片 爬取知乎上的内容,并通过MySQLdb保存到自己建的数据库中 爬取https://www.v2ex.com社区下的所有讨论话题 最简单的爬虫—

获取某个路径下的所有文件路径

送分小仙女□ 提交于 2019-11-29 19:55:21
import os def get_all_path(path='./'): l = os.walk(path) file_dir = [] for i, v, files in l: for file in files: file_dir.append(os.path.join(path, file)) return file_dir 批量改写文件 def get_all_path(path='.'): l = os.walk(path) file_dir = [] for i, v, files in l: for file in files: if file.split('.')[0] == 'test' or file.split('.')[0] == '1': print(file.split('.')[0]) with open(file, 'r+') as f: content = f.readlines() content[7] += '<h1>' content[8] += '</h1><div style="text-align: right">' content[9] += '</div><p style=" text-indent:2em">' content[10] += '</p>' content = ''.join(i for i in

C#使用SHA1加密类(RSAFromPkcs8)支持1024位和2048位私钥

我与影子孤独终老i 提交于 2019-11-29 19:46:52
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Security.Cryptography; namespace HelloWord.RSA { /// <summary> /// 类名:RSAFromPkcs8 /// 功能:RSA加密、解密、签名、验签 (支持1024位和2048位私钥) /// 详细:该类对Java生成的密钥进行解密和签名以及验签专用类,不需要修改 /// 版本:3.0 /// 日期:2013-07-08 /// 说明: /// 以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。 /// </summary> public sealed class RSAFromPkcs8 { /** * RSA最大解密密文大小 * 注意:这个和密钥长度有关系, 公式= 密钥长度 / 8 */ private const int MAX_DECRYPT_BLOCK = 128; /// <summary> /// 签名 /// </summary> /// <param name="content">待签名字符串</param> /

web前端入门到实战:Html头部meta标签

心已入冬 提交于 2019-11-29 19:39:37
meta元素有4个属性:name、http-equiv、content、charset.meta标签通过name属性来表述页面文档的元信息,通过http-equiv属性设置http请求指令,通过charset设置页面的字符编码。按照属性设置分类,meta可以分为三类: name属性和content属性组合,构成名称/值对,用于描述网站信息. 标准的meta名称包括application-name、author、description、generator等。 示例代码: <meta name="keywords" content="british,typeface,font,fonts"/> 其中keywords和description这两个名称的使用率最高,是搜索引擎优化的主要手段之一,推荐读者使用。 http-equiv属性和content属性组合,设置特定的http指令; 其中content-type、default-style和refresh已经确定,content-language和set-cookie还未正式确定. 此类型meta应该谨慎使用。不推荐使用,某些搜索引擎遇到此meta时会停止解析 页面剩余的部分。在实际的场景中很少使用 charset属性,设置页面字符编码。 此属性提供了保存和传输文档的编码格式。 <meta charset="utf-8"> 等价于

CSS 计数器详解

余生颓废 提交于 2019-11-29 19:36:24
在前端开发中总少不了列表项,对于列表项序号,射鸡师一般会列出个1,2,3...序号。在不了解css计数器属性之前,我一般会用精灵图,用类名来区分序列号图片。这样做尽管可以达到目的,但是很不方便,开发过程耗时较长而且维护修改起来较困难。用css counter配合伪类的content完美的解决了这个问题,这里详细介绍下css counter属性 计数器属性介绍 计数器的值通过使用counter-reset 和 counter-increment 操作,在 content 上应用 counter() 或 counters()函数来显示在页面上。 counter-reset 设置计数器的名称和起始值 Name:counter-reset Value: [ <custom-ident> <integer>? ]+ | none Initial: none Applies to: all elements Inherited: no Percentages: n/a Computed value: the keyword none or a list, each item an identifier paired with an integer Canonical order: per grammar Animation type: by computed value type custom

js注入提取伪元素选择器

随声附和 提交于 2019-11-29 19:07:08
let timer = setInterval(function () { if (document.getElementById('divChpContent')) { var span_list = document.getElementsByTagName("span"); for (var i = 0; i < span_list.length; i++) { var content = window.getComputedStyle( span_list[i], ':before' ).getPropertyValue('content'); span_list[i].innerText = content.replace('"', "").replace('"', ""); } clearInterval(timer) }}, 1000) 来源: https://www.cnblogs.com/zhouze/p/11527471.html

Q6:问题出在什么地方?

▼魔方 西西 提交于 2019-11-29 18:29:41
1.elementUI (1)鼠标悬浮文字提示------el-tooltip组件 // 第1:el-tooltip要和i标签配合 <el-tooltip effect="dark" placement="bottom"> <div slot="content"> //第2:本来el-tooltip是有一个content属性的,但是要展示多行或者说文本内容要有格式,没事,组件库提供了具名slot='content属性’ <p v-for="item in messages" :key="item"> {{item}} </p> </div> <i class="el-icon-information"></i> </el-tooltip> (2)滚动条-----el-scrollbar组件 // 配合wrap-class="elements__dropdown"让其出现滚动条 并且css属性定义其height为父容器的高度的100%。但是elementUI组件库并没有引入(还存在问题,可以上网查) (3)单选组合----el-radio-group组件和 el-radio-button el-radio-group(v-model="type", size="small") el-radio-button(label="templates") 模板 el-radio-button