title

Android: How to create a Dialog with a Scrolling title?

自古美人都是妖i 提交于 2020-01-30 06:40:51
问题 Ok so I've read the Custom Dialog explanation on the And Dev website http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog It show's you how to make a custom dialog, but not how to customise the title! Basically my title is too long and I want it to scroll (like textview) or better still have a 'marquee' effect i think it's called. Or if I can't make it scroll, give it more space to wrap onto more lines! Any ideas, I don't hold out much hope as it's not on android.dev :-( 回答1

Android: How to create a Dialog with a Scrolling title?

时间秒杀一切 提交于 2020-01-30 06:40:04
问题 Ok so I've read the Custom Dialog explanation on the And Dev website http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog It show's you how to make a custom dialog, but not how to customise the title! Basically my title is too long and I want it to scroll (like textview) or better still have a 'marquee' effect i think it's called. Or if I can't make it scroll, give it more space to wrap onto more lines! Any ideas, I don't hold out much hope as it's not on android.dev :-( 回答1

Python beautifulSoup

只愿长相守 提交于 2020-01-30 02:24:53
BeautifulSoup将复杂HTML文档转换成一个复杂的树形结构,每个节点都是Python对象,所有对象可以归纳为4种: Tag、NavigableString、BeautifulSoup 、Comment Tag对象与XML或HTML原生文档中的Tag相同,比如<title>The Dormouse's story </title>或者<a href ="http://example.com/elsie" class="sister" id="link1">Elsie</a>,title和a标记及其里面的内容称为Tag对象 怎么样从soup对象中抽取Tag呢?示例如下html <html><head><title> The Dormouse's story</title></head> <body> <p class="title"><b> The Dormouse's story </b></p> <p class="story"> Once upon a time there were three little sisters;and their names were <a href="http://example.com/elsie" class="sister" id='link1'><!--Elsie--></a> <a href="http://example

JavaScript 版俄罗斯方块

邮差的信 提交于 2020-01-28 05:53:46
用JavaScript 写的俄罗斯方块, 实现了几个比较简单的功能: 自定义按键, 设置初始速度,难度和方块,换肤功能。 布局用的Div+Css 演示地址: http://58.61.155.48:818/Tetris.html 下载: http://download.csdn.net/source/430506 http://58.61.155.48:818/Tetris.rar 程序主要用了三个类, 窗口类、菜单类、游戏类和一个基类。 1.基类, 定义了一些常用属性和函数. // 声明命名空间 var Freewind = {} ; // 基类 Freewind.Base = function () { // 浏览器 this ._isIE = document.all ? true : false ; // 对象索引 this ._nIndex = 0 ; // 大小 this ._nLeft = 0 ; this ._nTop = 0 ; this ._nWidth = DEF_WIN_WIDTH; this ._nHeight = DEF_WIN_HEIGHT; // 对象ID前缀 this ._sPrefix = " FW_ " ; // 文档对象 this .DOM = document; // 父对象 this ._parent = document.body; /

MongoDB

落花浮王杯 提交于 2020-01-24 19:46:03
创建数据库 use col 使用show dbs命令查看数据库 删除数据库 使用db命令可以查看数据库名字 db.dropDatabase() 创建集合 db.createCollection('runoob') 使用show collections查看数据库中的集合 删除集合 db.runoob.drop() 查询集合 db.col.find().pretty() 其中pretty()以格式化的方式显示文档 条件操作符 $gt -------- greater than > $gte --------- gt equal >= $lt -------- less than < $lte --------- lt equal <= $ne ----------- not equal != $eq -------- equal = db.col.find({likes:{$gt:150}}).pretty() db.col.find({likes:{$gte:150}}).pretty() db.col.find({likes:{$lt:150}}).pretty() db.col.find({likes:{$lte:150}}).pretty() 同时使用$lt和$gt db.col.find({likes:{$gt:150, $lte:200}}).pretty() 模糊查询

Elasticsearch(一)

烈酒焚心 提交于 2020-01-24 05:15:04
一、 简介   Elasticsearch是一个基于Apache Lucene™的开源引擎。无论在开源还是专用领域,Lucene可以被认为是迄今为止最先进、性能最好、功能最全的搜索引擎库。   但是,Lucene只是一个库。想要使用它,你必须使用Java来作为开发语言并直接集成到你的应用中,更糟糕的是,Lucene非常复杂,你需要深入了解检索的相关知识来理解它是如何工作的。   Elasticsearch也使用Java开发并使用Lucene作为其核心来实现所有索引和搜索功能,但是它的目的是通过简单RESTful API来隐藏Lucene的复杂性,从而让全文搜索变得简单 Elasticsearch的中文网址:https://www.elastic.co/cn/products/elasticsearch 1.1 正向索引与倒排索引   正向索引与倒排索引,这是在搜索领域中非常重要的两个名词,正向索引通常用于数据库中,倒排索引最多用于搜索引擎领域,我们根据如下两个网页对这两个概念进行阐述: html1 我爱我的祖国,我爱编程 html2 我爱编程,我是个快乐的小码农 正向索引: 假设我们使用MySQL的全文检索,会对如上两句话进行分词处理,那么预计得到的结果如下: 我 爱 爱我 祖国 我的祖国 编程 爱编程 我爱编程 我 我爱 爱 编程 爱编程 我爱编程 快乐 码农 小码农  

Java 中 MongoDB 分页查询的总结

不问归期 提交于 2020-01-23 23:25:37
MongoDB 分页查询的总结 对于 mongodb 数据库,和 mysql 类似,也有自带的分页 api,其实直接调用 api,也可以实现 mongodb 的分页,主要 api 就是两个: query . skip ( ( pageNum - 1 ) * pageSize ) ; query . limit ( pageSize ) ; 其中:pageNum:当前页,pageSize:页大小 但是当数据量多了的时候,mongodb 再使用这种方式去做分页,查询效率就会变得很慢,主要原因是 mongodb 自带的这个 skip() 方法的问题,跳跃查询导致虽然做了分页,但还是会使数据查询效率低下。 主要原理思路: 条件查询+排序+限制返回记录。 边查询,边排序,排序之后,抽取第一次分页中的最后一条记录,作为第二次分页的条件,进行条件查询,以此类推… 假设现在要给一个 Title 类做分页查询,一开始还是传统想法,必须要有“当前页”和“页大小”这两个参数: public List < Title > listDesc ( int pageNum , int pageSize ) { List < Title > titleList ; Query query = new Query ( ) ; // 通过 _id 来排序 query . with ( Sort . by ( Sort

jQuery scrolling marquee in html page title tag

笑着哭i 提交于 2020-01-22 16:45:46
问题 I want to place a scrolling marquee in my html title tag using jquery but don't know how and can't seem to find a good explanation online anywhere. Can someone help me please? 回答1: That's not very hard to do if you just want it to scroll like the marquee tag: (function titleMarquee() { document.title = document.title.substring(1)+document.title.substring(0,1); setTimeout(titleMarquee, 200); })(); That's pretty basic but should give you an idea on how to tweak it to your liking. 回答2: In Tatu

Chrome save to PDF custom filename

◇◆丶佛笑我妖孽 提交于 2020-01-22 12:18:07
问题 In Chrome, when hitting Ctrl + P you can choose 'Save to PDF'. The default file name is equal to the title of the html page the user wants to print. Can this be changed, without changing the actual title of the html page? I'd like to have a date & time in the PDF's name, but I don't want the date & time in the title of my html page. 回答1: So if you can put a print button in somewhere and link it to a function similar to the following: function printWithSpecialFileName(){ var tempTitle =

Chrome save to PDF custom filename

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-22 12:18:06
问题 In Chrome, when hitting Ctrl + P you can choose 'Save to PDF'. The default file name is equal to the title of the html page the user wants to print. Can this be changed, without changing the actual title of the html page? I'd like to have a date & time in the PDF's name, but I don't want the date & time in the title of my html page. 回答1: So if you can put a print button in somewhere and link it to a function similar to the following: function printWithSpecialFileName(){ var tempTitle =