doc

document.documentelement.style.fontsize无法设置的问题

醉酒当歌 提交于 2019-12-01 04:24:33
(function(){ 'use strict'; let doc=document.documentElement;//减少dom操作 function resize(){ //获取dom文档宽 let clientWidth= window.innerWidth || doc.getBoundingClientRect().width ; let fontSize = doc.style.fontSize; //动态改变html的font-size,以320为例 if(clientWidth<375){//设置边界值以防万一 fontSize = '100px'; }else{ fontSize = clientWidth/375*100 + 'px'; } } //检测屏幕尺寸变化同步font-size,如横竖屏切换时触发 window.onresize = function(){ resize() }; //页面初始化时触发 resize()})(); 提前获取fontsize存储到变量中,却无法成功设置html的fontsize,但是fontsize这个变量是获取到了结果的,在网页上却没有成功。只有在if-else代码块中通过doc.style.fontsize的方式来设置才能成功设置,暂时不知道为什么。留着以后解决 来源: https://www.cnblogs

elasticsearch http 搜索 测试

拟墨画扇 提交于 2019-12-01 02:35:59
1. 查询所有的 documents http://192.168.43.45:9200/_search boost parameter 细粒度搜索条件权重控制 如:组装多个查询条件,其中一个匹配的想要优先查询显示出来,需要使用权重控制提升相似度排名 2. 查看 elasticsearch 的 健康状态 http://192.168.43.45:9200/_cat/health?v 红:数据不可访问 绿:集群完全起作用 黄:一些数据不可访问 3. 查看集群中节点情况: http://192.168.43.45:9200/_cat/nodes?v 4. 查看集群下所有索引 http://192.168.43.45:9200/_cat/indices?v 5. 创建一个索引 从 put 请求可以看出 es 是 rest 的 api , 默认 put 就是增加 put http://192.168.43.45:9200/testcreate?pretty 索引的名称必须全部是小写 否则报错 修改索引 为小写,必须使用 put请求 然后查看所有索引: http://192.168.43.45:9200/_cat/indices?v 从图中可以看出有 5个主分区和1个副本(5 primary shards and 1 replica) 目前看到的节点的颜色是黄色,是因为单节点的

Save word file as html in java

限于喜欢 提交于 2019-12-01 00:32:10
I try to save a word file as html using java. I save a word file as xml and its working for me Runtime rt1 = Runtime.getRuntime(); rt1.exec("C:/Program Files/Microsoft Office/Office12/WINWORD.EXE /msaveasxml C:/myfolder/AB_00040.doc"); It save my doc file as xml file in the specific folder C:/myfolder and I view that xml file at C:/myfolder/AB_00040.xml If i want to save the same file as html what can i do. Any one help rt1.exec("C:/Program Files/Microsoft Office/Office12/WINWORD.EXE /msaveas??? C:/myfolder/AB_00040.doc"); Thanks in advance I found the answer with the hint of Zack Macomber i

python3安装pdfminer并使用

一世执手 提交于 2019-11-30 19:50:58
python3安装pdfminer并使用 2901583663 1.python3不同与2版本不能使用pdfminer 2901583663 1 pip install pdfminer3k 2.使用pdfminer解析相应文档并保存到相应的文件夹中 # encoding : udf-8 """ 解析pdf文本保存到txt文件中 """ from pdfminer.converter import PDFPageAggregator from pdfminer.layout import LAParams, LTTextBoxHorizontal from pdfminer.pdfinterp import PDFTextExtractionNotAllowed, PDFResourceManager, PDFPageInterpreter from pdfminer.pdfparser import PDFDocument, PDFParser path = 'E:\\force.pdf' def parse(): fp = open(path, 'rb') # 以二进制读模式打开 praser = PDFParser(fp) # 创建一个PDF文档 doc = PDFDocument() # 连接分析器 与文档对象 praser.set_document(doc) doc

003 文档的操作

冷暖自知 提交于 2019-11-30 12:34:21
一 . 添加文档 在上面一节,我们删除了user索引. 现在我们执行下面的命令: PUT /user/_doc/1 { "username" : "trek", "age" : 27 }  可以得到下面的结果  { "_index" : "user", "_type" : "_doc", "_id" : "1", "_version" : 1, "result" : "created", "_shards" : { "total" : 2, "successful" : 1, "failed" : 0 }, "_seq_no" : 0, "_primary_term" : 1 }   我们从result之中,可以得到,我们成功的添加了一个文档. 我们继续查询索引: GET /user   可以得到如下的结果: { "user" : { "aliases" : { }, "mappings" : { "properties" : { "age" : { "type" : "long" }, "username" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } } } }, "settings" : { "index" : { "creation

Should I use @return self, this or the current class? [closed]

好久不见. 提交于 2019-11-30 10:44:32
I have a method that return the current object, how do I document this? /** * set something * * @return this */ public function setSomething(){ // ... return $this; } Or should I do @return self or @return Current_Class_Name ? Reason why this question is not "primarily opinion-based" (and should be reopened): conformance to standards and IDE type hinting support. RiaD @return Current_Class_Name will definitely work and is what I prefer. @return self may work ok with some programs too. @return this is bad because this is not a typename. g . There is a PHP Standards Recommendation (PSR)

How to avoid java.lang.NoClassDefFoundError

蹲街弑〆低调 提交于 2019-11-30 08:41:03
问题 I have a code for adding the texts to existing .doc file and it'll save that as another name by using apache POI. The following is the code I have tried so far import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; import org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFFooter; import org.apache.poi.xwpf.usermodel.XWPFTable; public class

Convert Doc file to PDF in VB.Net

非 Y 不嫁゛ 提交于 2019-11-30 07:46:48
I have an situation where i need to convert Doc file into PDF file. I am devepoing windows application in vb.net. and also i don't want to user third party dll if possible. so can anyone give me some more idea ? You can use Office Interop for this. But it is better to use some managed library like Aspose using Microsoft.Office.Interop.Word; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; ... // Create a new Microsoft Word application object Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application(); //

How to generate a word file programmatically from collected data in iPhone sdk

北慕城南 提交于 2019-11-30 07:39:23
问题 I have an iPhone app consisting of a few forms in which I collect data from users. Now at the end of these forms, after user has filled all data, I want that all the collected data is exported and a MS word .doc file is generated. The data too is not simple text. There are headings, tables along with normal text in it. Is there any way I can accomplish this? 回答1: Short answer yes, long answer: You can't do this to create "proper" Word documents, however you should be able to acomplish this on

PHP Convert Word file to HTML without losing styling and images [closed]

故事扮演 提交于 2019-11-30 03:16:45
Is there an API for converting word files to HTML without losing the format? Can the google documents API be used for this? I tried saaspose but the returning result is always a server error. Solutions that did not work for me: Converting MS Word document to html in php I've spent a bit of time loking into this, and the best solution that I've found was to install unoconv on the server, and using PHP to interface with it through system calls. I would have loved to find a good native PHP solution for this, but unfortunately I couldn't. Edit Since originally answering this, I've come across a