title

[Angular2 Form] Reactive Form, FormBuilder

泄露秘密 提交于 2020-02-28 10:46:35
Import module: import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { MessageComponent } from './message.component'; import messageRoutes from './message.routes'; import {FormsModule, ReactiveFormsModule} from "@angular/forms"; @NgModule({ imports: [ CommonModule, FormsModule, ReactiveFormsModule, messageRoutes ], declarations: [MessageComponent] }) export default class MessageModule { } Define the html: <form [formGroup]="reactiveForm" novalidate autocomplete="off"> <div class="form-field"> <label>Title:</label> <input formControlName="title"> </div

从零开始学习MySQL全文索引

风流意气都作罢 提交于 2020-02-26 14:01:39
目录 一、为什么要用全文索引 二、什么是全文索引 三、如何创建全文索引 四、创建测试数据 五、查询-使用自然语言模式 六、查询-使用布尔模式(强大的语法) 语法 示例 七、查询-使用扩展模式 八、注意事项 一、为什么要用全文索引 传奇小说 m.xs86.com 我们在用一个东西前,得知道为什么要用它,使用全文索引无非有以下原因 like查询太慢、json字段查询太慢(车太慢了) 没时间引入ElasticSearch、Solr或者Sphinx这样的软件,或者根本就不会用(无法将五菱宏光换成兰博基尼,即使有兰博基尼也不会开) 加索引、联合索引啥的都已经慢得不行了(限速80,车顶盖都卸了也只能开到30) 为了提升一下自己的逼格(人家问你有没有开过法拉利,你说开过肯定更有气质一点) 二、什么是全文索引 简单的说,全文索引就相当于大词典中的目录,通过查询目录可以快速定位到想看的内容。 全文索引通过建立 倒排索引 来快速匹配文档(仅在mysql5.6版本以上支持) 全文索引将连续的 字母、数字和下划线 当做一个单词,分割单词一般用 空格/逗号/句号 MySQL的全文索引支持以下3种查询模式: 自然语言模式( IN NATURAL LANGUAGE MODE ) 通过MATCH AGAINST 传递某个特定的字符串来进行检索 布尔模式( IN BOOLEAN MODE ) 支持操作符,例如

用XmlDocument创建XML文档

随声附和 提交于 2020-02-26 11:14:55
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Xml; namespace XMLDOMDemo { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void btnLoad_Click(object sender, EventArgs e) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("Books.xml"); MessageBox.Show(xmlDoc.InnerXml); } //创建文档 private void btnCreate_Click(object sender, EventArgs e) { XmlDocument xmlDoc = new XmlDocument(); //建立Xml的定义声明 XmlDeclaration dec = xmlDoc

python58同城爬虫

淺唱寂寞╮ 提交于 2020-02-26 05:24:44
import requests,time,csv from bs4 import BeautifulSoup href_list=[] url='https://hz.58.com/lvguanbinguan' headers={ 'user-agent': } params={ 'PGTID': '0d306b32-0004-f711-87c6-3e3cb7371c0d', 'ClickID': '2' } res=requests.get(url,headers=headers,params=params) soup=BeautifulSoup(res.text,'html.parser') titles=soup.find_all('h2',class_="title") for title in titles: href=title.find('a')['href'] print(href) href_list.append(href) csv_file=open('58同城酒店转让项目信息.csv','w+',newline='',encoding='utf-8') writer=csv.writer(csv_file) file_head=['项目名','联系人','联系电话','信息','地址'] writer.writerow(file_head) hotel

【汇智学堂】jsp(useBean,setProperty,getProperty)

匆匆过客 提交于 2020-02-26 02:41:08
Acticle: package com . huizhi . bean ; public class Acticle { private int id ; private String title ; private String author ; public int getId ( ) { return id ; } public void setId ( int id ) { this . id = id ; } public String getTitle ( ) { return title ; } public void setTitle ( String title ) { this . title = title ; } public String getAuthor ( ) { return author ; } public void setAuthor ( String author ) { this . author = author ; } } useBean.jsp: < % @ page contentType = "text/html;charset=UTF-8" language = "java" % > < html > < head > < title > Title < / title > < / head > < body > < jsp

小程序scroll-view滑动标签

跟風遠走 提交于 2020-02-25 19:35:45
< scroll-view scroll-x = " true " class = " tag_scroll " > < view class = " label_nav " style =" width: { { tagWidth } } " > < view wx: for = " {{tabitem}} " wx: key = " index " class = " item-text {{tabIndex===index? ' activity ' : ' ' }} " bindtap = " setTab " data-index = " {{index}} " data-id = " {{item.id}} " > {{item.title}} </ view > </ view > </ scroll-view > .tag_scroll { width : 750rpx ; height : 90rpx ; display : block ; } .label_nav { width : 750rpx ; height : 88rpx ; background-color : #fff ; border-bottom : 1px solid #eee ; box-sizing : border-box ; display : flex ; align-items :

Getting an object in Python Matplotlib

做~自己de王妃 提交于 2020-02-23 08:10:43
问题 To make a plot, I have written my code in the following fashion: from pylab import * x = [1,2,3] y = [1,2,3] matplotlib.pyplot.scatter(x,y,label='Blah') matplotlib.pyplot.legend(title='Title') matplotlib.pyplot.show() I want to change the font size of the legend title. The way to go about this is to get the legend object and then change the title that way (e.g., How to set font size of Matplotlib axis Legend?) Instead of rewriting all my code using ax.XXX, figure.XXX, etc, is there any way to

Getting an object in Python Matplotlib

杀马特。学长 韩版系。学妹 提交于 2020-02-23 08:10:31
问题 To make a plot, I have written my code in the following fashion: from pylab import * x = [1,2,3] y = [1,2,3] matplotlib.pyplot.scatter(x,y,label='Blah') matplotlib.pyplot.legend(title='Title') matplotlib.pyplot.show() I want to change the font size of the legend title. The way to go about this is to get the legend object and then change the title that way (e.g., How to set font size of Matplotlib axis Legend?) Instead of rewriting all my code using ax.XXX, figure.XXX, etc, is there any way to

Getting an object in Python Matplotlib

送分小仙女□ 提交于 2020-02-23 08:10:30
问题 To make a plot, I have written my code in the following fashion: from pylab import * x = [1,2,3] y = [1,2,3] matplotlib.pyplot.scatter(x,y,label='Blah') matplotlib.pyplot.legend(title='Title') matplotlib.pyplot.show() I want to change the font size of the legend title. The way to go about this is to get the legend object and then change the title that way (e.g., How to set font size of Matplotlib axis Legend?) Instead of rewriting all my code using ax.XXX, figure.XXX, etc, is there any way to

request.POST[] request.POST.get 区别

邮差的信 提交于 2020-02-23 00:07:51
如果传递过来的数值不为空,那么这两种方法都没有错误,可以得到相同的结果。 但是如果传递过来的数值为空, 那么request.POST[‘title’]则会提示Keyerror错误, 而request.POST.get(‘title’)则不会报错,而是返回一个none。 简单来说: request.POST[‘title’]就算没有值也不会报错,返回none request.POST.get(‘title’)取不到值就会报错,所以推荐使用 建议使用 title = request.POST.get(“title”, " "),为其自定义一个默认值 来源: CSDN 作者: weixin_33580579 链接: https://blog.csdn.net/weixin_33580579/article/details/104447820