10/04/2016 – Plus-minus Notation Display Failure – 正负号显示问题

>Tolerance Checker Development Log – 极限偏差查询器开发日志<

最近的主要工作室录入极限偏差数据库,一直都进展的比较顺利,但是今天录入到JS/js公差带的时候遇到了一点问题,JS/js带的极限偏差是±值,一般比较便捷的记法就是±x,但是我以此格式录入的数据库最后查询出来发生了错误,显示如图1。

What I am doing recently is recording data, there was no problem until plus-minus notation display failure came out. When I met the JS/js tolerance zone, numbers are displayed  with ‘±’ ahead, which is like ±x. But the plus-minus notation became ‘?’ as Fig.1.

20160410-Plus-minus Notation Display Failure

图.1(Fig.1)

目前我猜测的可能是在查询的某个环节出了问题:

I think it must be an error at following stage:

  1. php excel reader工具不支持正负号;
  2. 字符集对正负号的支持问题;
  3. 查询器默认字体或者字体库的支持问题。
  1. php excel reader does not support plus-minus notation;
  2. character set does not support plus-minus notation;
  3. fonts of the checker/page do not support plus-minus notation.

由于这个问题无伤大雅,我暂时用比较简单的办法略过这个问题:用+/-来代替±。

Nevertheless, it is not a serious error and I decide to replace the ‘±’ with ‘+/-‘ temporarily.

 

17/03/2016 – Tolerance Checker Development Log– 极限偏差查询器开发日志

前期规划日志 Previous Development Plan :

>10/02/2016<

>08/03/2016<


后续开发日志 Development Update:

>10/04/2016<


>前往查询器 Use the checker<

以下为主要开发内容 The following is the main content:

近几日完成了查询器的主要开发工作并上线测试。

Main development work has been finished on these days, and the tolerance checker has been launched into beta test.

首先是确认了需要使用的php excel reader工具,资源来自SourceForge上的一个项目:<PHP-ExcelReader> ;调用方法参考了搜索到的这篇日志:<PHP ExcelReader用法>

First, excel reader tool has been selected. It is a SourceForge project:<PHP-ExcelReader>, and I find a Chinese user manual by this link:<PHP ExcelReader用法>

其调用方法是:

How to invoke the PHP-ExcelReader:

[php]
require_once ‘Excel/reader.php’;
$data = new Spreadsheet_Excel_Reader(); /*invoking reader*/
$data->setOutputEncoding(‘UTF-8’); /*text output encoding*/
$data->read(‘db.xls’); /*read the excel sheet*/

echo $data->sheets[0][‘cells’][i][j]; /*read the (i,j)cell
and output data*/
[/php]

这个基本结构是针对查固定路径的单个excel表格的,我先编写了一个3行3列excel表格进行测试,表单通过post形式将需要的单元格位置(i,j)将表单信息告知excel_reader,reader返回查询数据:

The basic code structure of this tool is used to read a single work sheet in one .xls file by solid path. So I created a 3*3 excel sheet for test. Html form choices with (i,j) cell position are sent to excel_reader by ‘post’ method, which would return and print out the checking result by code below.

[php]

echo $data->sheets[0][‘cells’][$_POST["row"]][$_POST["column"]];

[/php]

测试结果如图1, 成功!进入下一步开发。

Test was successful as fig.1! Next step.

20160317-checker_devlop_log-1

图.1(Fig.1)

根据日志>2<中图2的逻辑与文件结构,需要查询不同路径下不同xls的文件,路径由表单输出的数据决定,所以excel_reader读取路径处不能再填写定值,故在这之前定义了一个变量$path, 同样采取post的形式获取表单数据并编写路径,然后让reader读取$path路径:

According to logic and files structure posted on fig.2 of log >2< , the checker must visit different folders and pick out the exact .xls database file from dozens of them. In other words, the file path and the name of file should be variables. So I define a $path variable which get message from the form by post method as well. And the reader will read the $path instead of solid path.

[php]

$path="db/".$_POST["type"]."/".$_POST["zone"].".xls";

……

$data->read($path);

[/php]

由于我只在一个文件夹里存放了一个db.xls文件,当我在表单选择了一个空路径的时候或者我没有填写完所有表单项却提交了表单,reader返回了”The filename …….xls is not readable”的错误信息,我意识到整个单选表单必须填写完成才能提交。搜索了许多方法,一开始发现需要通过js等工具进行表单验证,弹出提醒框等等等。踏破铁鞋无觅处得来全不费工夫,html5直接提供了表单必填的验证,在input里添上短短一句便可:

I uploaded only one db.xls file to the database folder, then I found a problem when I select a wrong path or leave some form blank —— reader told me that ‘The filename …….xls is not readable’. And I realized I must set something for form correction. So many methods told me to use js code or else when the exactly excellent answer is so simple that you should write only 2 word in the <input>, thanks to html5 :

[html]

required="required"

[/html]

剩下的就让浏览器来做就好了,如图2

The rest of the work? Browsers will do for you as fig.2!

20160317-checker_devlop_log-2

图.2(Fig.2)

显然,如上图,我用div把表单框起来并稍微美化了一下。

Obviously, I beautified the page by <div> tag.

主要的问题都解决了,就把表单修改为正式的极限偏差查询器项目,然后上传了一个完整数据的.xls数据表,极限偏差查询器正式进入线上beta测试!

Works done and problems solved. The html form was changed into real tolerance checker type. And I uploaded the first database .xls file with useful tolerance data. It is beta test now!

20160317-checker_devlop_log-3

下一阶段的工作目标:

Plan for next version:

  1. 由于我获得的极限偏差表是纸质的,所以所有数据必须手动创建.xls文件,需要实现公差查询的基本功能,这个是主要任务也是工作量最大的任务。
  2. 学会一些CSS的内容,将查询器美化一下。
  3. 学会一些Jquery、ajax的内容,将跳转显示查询结果改为在主页刷新显示查询结果,即客户端只需要显示index,同时包含表单和查询结果显示框,表单不断复用。
  1. Tolerance data I own is on papers. If the tolerance can function as a real one, I must type the data into computer by hand and edit .xls files manually. Hard work but necessary.
  2. Learn something about CSS and use it to beatify the checker’s page.
  3. Learn something about Jquery, ajax or else. The codes can refresh the checker index page without jumping into others. Which means, the index contain the html form and the result display on same page, visitor can reuse the form and read the result on same page, without clicking “Back to index and check again”.

Outlook 2013设置的一些Tips

毕业以后要把学校邮箱的邮件移植出来,导出的全部都是eml文件,搜索各处感觉各种邮件管理软件好像都不支持导入,所以把eml文件导入到邮箱这件主要的事情作罢,直接在学校邮箱里把比较有意义的邮件一封封转发到其他邮箱上了。倒是为此装了Outlook 2013,想来自己也有几个邮箱,干脆用用吧。

QQ邮箱添加起来倒不麻烦,一会就把邮件导进去了。

弄Outlook.com邮箱的时候就卡住了,试了自动添加账户,手动添加账户中”Outlook.com或Exchange ActiveAync兼容的服务”和“POP或IMAP”两项也添加不了,大多是“用户名或密码不起作用”、“无法连接服务器”一类的反馈,甚至闹到Exchange证书这些个事情上。

当时就火了,Outlook 2013和Outlook邮箱闹矛盾不是笑话吗?

晃悠晃悠又进到QQ邮箱的POP设置里,邮箱独立密码一项瞬间打醒我,丫是不是Outlook.com邮箱也有?

赶紧去Outlook.com邮箱看设置:

在账户设置里:“安全与隐私”→“管理高级安全”→“应用密码”!!!

就是它!!!之前在Outlook 2013里添加Outlook.com邮箱账户时用的密码都是邮箱本身的密码!!!丫不认!!!因为Outlook.com邮箱开了个叫双重验证的保护机制!!!

所以Outlook 2013一票的应用如邮箱安全设置里所述:“某些应用和设备(例如, Xbox 360、Windows Phone 8 或其他设备上的邮件应用) 不支持用于双重验证的安全代码。在这些情况下,你需要创建一个应用密码才能登录。”

当你单击“创建新应用密码以后”,MS会给你生成一串随机字符,也就是你的应用密码……

把这段密码贴进Outlook 2013新账户里以后,秒通过验证……

噗……

顺便Mark一下Outlook.com邮箱邮件服务器的信息:

服务器地址 端口 ssl
pop3 pop-mail.outlook.com 995 ssl
imap imap-mail.outlook.com 993 ssl
smtp smtp-mail.outlook.com 25 tsl