立诚勿怠,格物致知
It's all about connecting the dots

2017年11月的文章

Enable SASS in Angular4

If you use angular-cli to create an Angular4 project. The project will use css by default. If you want to use sass, you can do things like this: In angular-cli.json: Revise apps.styles to be ["styles.scss"], and defaults.styleExt to be "scss". This will enable you to generate .scss file instead of .css file when using command like "ng generate component componentName".

一种字符串拼接的高效方法

经过在Chrome浏览器多次尝试,总的来说,testByForLoop1方法(用了ES6字符串模板的for循环)耗时最长,testByForLoop2方法(没用ES6字符串模板的for循环)耗时其次,testByArrayJoinMethod方法(利用了数组的join方法)耗时最短,它们的耗时在数组长度越长时越是差异显著。尤其是testByArrayJoinMethod方法简直是效果拔群。

CSS自定义属性(变量)

:root在html文档里对应的就是html标签选择器,:root伪类和html标签选择器这两个的区别基本上就是前者的优先级更高一些。但是,那些--color是什么东西? 根据文档https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables,这个叫CSS自定义属性(CSS变量),是具有继承性质的,在:root中定义CSS变量的话,等于是在定义全局变量,在其他具体的选择器(如上述代码中的.u-category-windows)里定义CSS变量等于是在该选择器及其后台选择器这个范围内定义了一个局部变量。

CSS 阅读(2893)去评论赞(1)

FormData的使用及请求头分析

XMLHttpRequest Level 2添加了一个新的接口FormData.利用FormData对象,我们可以通过JavaScript用一些键值对来模拟一系列表单控件,我们还可以使用XMLHttpRequest的send()方法来异步的提交这个"表单".比起普通的ajax,使用FormData的最大优点就是我们可以异步上传一个二进制文件.

JavaScript 阅读(9916)去评论赞(1)

发布静态文件到服务器上的简化操作

Of course, you can use a client tool such as FileZilla to deploy your static files to the server. But you will certainly feel tired in the end if you need to repeat this work almost every day in case your target server is for test purpose. For me, I used webpack for local development, when I want to deploy something to the test server, I need to execute command "npm run build" first and then "npm run deployToTestServer", it's already very convenient, but things can be even convenient with only one command needed to type ^_^.

Spring Web MVC系列

接下来会翻译一下spring官方的一些文档,此次为Spring Web MVC系列的内容。Spring Web MVC是建立在Servlet API之上的web框架,Spring框架很早就包含了Spring Web MVC。“Spring Web MVC”这个正式名称来源于其源模块“spring-webmvc”,但是它被大家所熟悉的叫法是“Spring MVC”。

Java 阅读(2086)去评论赞(0)

自然科学的诞生和发展与faith的联系

我觉得,我们所说的科学,是基于理论证明和实践检验的对于客观事实、规律的一种总结。太多的变量会延缓甚至阻碍这种【总结】活动,而“神”就是一个影响因素很大的变量。如果认为存在有很多的神,有些有共同点但是表现略有差异的现象,可能就被解释成是因为不同的神参与其中才导致的不同,有这种先入为主的想法后,很多可以被早些总结的事实、规律被执行【总结】操作的可能性就大大降低/延迟了。

未分类 阅读(2642)去评论赞(0)

登录

找回密码

注册