执行reg
1 | Windows Registry Editor Version 5.00 |
添加图片
打开文件夹C:\Windows\System32\oobe\info\backgrounds
(如果没有这个文件夹的请自行创建)。
添加自己选择好的图片,文件名修改成backgroundDefault.jpg
.
注:我们编辑好的登录界面的背景图片backgroundDefault.jpg
,其体积一定控制在250KB以内;否则,我们修改后的登录界面的背景图片就无法了.
1 | Windows Registry Editor Version 5.00 |
打开文件夹C:\Windows\System32\oobe\info\backgrounds
(如果没有这个文件夹的请自行创建)。
添加自己选择好的图片,文件名修改成backgroundDefault.jpg
.
注:我们编辑好的登录界面的背景图片backgroundDefault.jpg
,其体积一定控制在250KB以内;否则,我们修改后的登录界面的背景图片就无法了.
首先我们需要在页面中引入Chart.js文件。此工具库在全局命名空间中定义了Chart变量。
1 | <script src="Chart.js"></script> |
为了创建图表,我们要实例化一个Chart对象。为了完成前面的步骤,首先需要需要传入一个绘制图表的2d context。以下是案例。
1 | <canvas id="myChart" width="400" height="400"></canvas> |
1 | //Get the context of the canvas element we want to select |
我们还可以用jQuery获取canvas的context。首先从jQuery集合中获取我们需要的DOM节点,然后在这个DOM节点上调用 getContext(“2d”) 方法。
1 | //Get context with jQuery - using jQuery's .get() method. |
当我们完成了在指定的canvas上实例化Chart对象之后,Chart.js会自动针对retina屏幕做缩放。
Chart对象设置完成后,我们就可以继续创建Chart.js中提供的具体类型的图表了。下面这个案例中,我们将展示如何绘制一幅极地区域图(Polar area chart)。
1 | new Chart(ctx).PolarArea(data,options); |
We call a method of the name of the chart we want to create. We pass in the data for that chart type, and the options for that chart as parameters. Chart.js will merge the options you pass in with the default options for that chart type.
曲线图就是将数据标于曲线上的一种图表。
一般用于展示趋势数据,和比较两组数据集。
1 | new Chart(ctx).Line(data,options); |
1 | var data = { |
The line chart requires an array of labels for each of the data points. This is show on the X axis.
The data for line charts is broken up into an array of datasets. Each dataset has a colour for the fill, a colour for the line and colours for the points and strokes of the points. These colours are strings just like CSS. You can use RGBA, RGB, HEX or HSL notation.
1 | Line.defaults = { |
A bar chart is a way of showing data as bars.
It is sometimes used to show trend data, and the comparison of multiple data sets side by side.
1 | new Chart(ctx).Bar(data,options); |
1 | var data = { |
The bar chart has the a very similar data structure to the line chart, and has an array of datasets, each with colours and an array of data. Again, colours are in CSS format.
We have an array of labels too for display. In the example, we are showing the same data as the previous line chart example.
1 | Bar.defaults = { |
A radar chart is a way of showing multiple data points and the variation between them.
They are often useful for comparing the points of two or more different data sets
1 | new Chart(ctx).Radar(data,options); |
1 | var data = { |
For a radar chart, usually you will want to show a label on each point of the chart, so we include an array of strings that we show around each point in the chart. If you do not want this, you can either not include the array of labels, or choose to hide them in the chart options.
For the radar chart data, we have an array of datasets. Each of these is an object, with a fill colour, a stroke colour, a colour for the fill of each point, and a colour for the stroke of each point. We also have an array of data values.
1 | Radar.defaults = { |
Polar area charts are similar to pie charts, but each segment has the same angle - the radius of the segment differs depending on the value.
This type of chart is often useful when we want to show a comparison data similar to a pie chart, but also show a scale of values for context.
1 | new Chart(ctx).PolarArea(data,options); |
1 | var data = [ |
As you can see, for the chart data you pass in an array of objects, with a value and a colour. The value attribute should be a number, while the color attribute should be a string. Similar to CSS, for this string you can use HEX notation, RGB, RGBA or HSL.
These are the default chart options. By passing in an object with any of these attributes, Chart.js will merge these objects and the graph accordingly. Explanations of each option are commented in the code below.
1 | PolarArea.defaults = { |
Pie charts are probably the most commonly used chart there are. They are divided into segments, the arc of each segment shows a the proportional value of each piece of data.
They are excellent at showing the relational proportions between data.
1 | new Chart(ctx).Pie(data,options); |
1 | var data = [ |
For a pie chart, you must pass in an array of objects with a value and a color property. The value attribute should be a number, Chart.js will total all of the numbers and calculate the relative proportion of each. The color attribute should be a string. Similar to CSS, for this string you can use HEX notation, RGB, RGBA or HSL.
These are the default options for the Pie chart. Pass in an object with any of these attributes to override them.
1 | Pie.defaults = { |
Doughnut charts are similar to pie charts, however they have the centre cut out, and are therefore shaped more like a doughnut than a pie!
They are aso excellent at showing the relational proportions between data.
1 | new Chart(ctx).Doughnut(data,options); |
1 | var data = [ |
For a doughnut chart, you must pass in an array of objects with a value and a color property. The value attribute should be a number, Chart.js will total all of the numbers and calculate the relative proportion of each. The color attribute should be a string. Similar to CSS, for this string you can use HEX notation, RGB, RGBA or HSL.
These are the default options for the doughnut chart. Pass in an object with any of these attributes to override them.
1 | Doughnut.defaults = { |
If you are looking to add interaction as a layer to charts, Chart.js is not the library for you. A better option would be using SVG, as this will let you attach event listeners to any of the elements in the chart, as these are all DOM nodes.
Chart.js uses the canvas element, which is a single DOM node, similar in characteristics to a static image. This does mean that it has a wider scope for compatibility, and less memory implications than SVG based charting solutions. The canvas element also allows for saving the contents as a base 64 string, allowing saving the chart as an image.
In SVG, all of the lines, data points and everything you see is a DOM node. As a result of this, complex charts with a lot of intricacies, or many charts on the page will often see dips in performance when scrolling or generating the chart, especially when there are multiple on the page. SVG also has relatively poor mobile support, with Android not supporting SVG at all before version 3.0, and iOS before 5.0. (caniuse.com/svg-html5).
所有现代浏览器和大部分手机浏览器都支持canvas(caniuse.com/canvas)。
对于IE8及以下版本的浏览器,建议使用ExplorerCanvas - 见 https://code.google.com/p/explorercanvas/。对于不支持canvas的IE会自动降级为VML格式。使用方法:
1 | <head> |
Usually I would recommend feature detection to choose whether or not to load a polyfill, rather than IE conditional comments, however in this case, VML is a Microsoft proprietary format, so it will only work in IE.
Some important points to note in my experience using ExplorerCanvas as a fallback.
Initialise charts on load rather than DOMContentReady when using the library, as sometimes a race condition will occur, and it will result in an error when trying to get the 2d context of a canvas.
New VML DOM elements are being created for each animation frame and there is no hardware acceleration. As a result animation is usually slow and jerky, with flashing text. It is a good idea to dynamically turn off animation based on canvas support. I recommend using the excellent Modernizr to do this.
When declaring fonts, the library explorercanvas requires the font name to be in single quotes inside the string. For example, instead of your scaleFontFamily property being simply “Arial”, explorercanvas support, use “‘Arial’” instead. Chart.js does this for default values.
Please report these on the Github page - at github.com/nnnick/Chart.js.
New contributions to the library are welcome.
Chart.js is open source and available under the MIT license.
永远遵循同一套编码规范 – 可以是这里列出的,也可以是你自己总结的。如果你发现本规范中有任何错误,敬请指正。通过 open an issue on GitHub为本规范添加或贡献内容。
不管有多少人共同参与同一项目,一定要确保每一行代码都像是同一个人编写的。
</li>
或 </body>
)。1 | <!DOCTYPE html> |
为每个 HTML 页面的第一行添加标准模式(standard mode)的声明,这样能够确保在每个浏览器中拥有一致的展现。
1 | <!DOCTYPE html> |
强烈建议为 html 根元素指定 lang 属性,从而为文档设置正确的语言。这将有助于语音合成工具确定其所应该采用的发音,有助于翻译工具确定其翻译时所应遵守的规则等等。
更多关于 lang
属性的知识可以从 此规范 中了解。
这里列出了语言代码表。
1 | <html lang="zh-CN"> |
IE 支持通过特定的 <meta>
标签来确定绘制当前页面所应该采用的 IE 版本。除非有强烈的特殊需求,否则最好是设置为 edge mode,从而通知 IE 采用其所支持的最新的模式。
阅读这篇 stack overflow 上的文章可以获得更多有用的信息。
1 | <meta http-equiv="X-UA-Compatible" content="IE=Edge"> |
通过明确声明字符编码,能够确保浏览器快速并容易的判断页面内容的渲染方式。这样做的好处是,可以避免在 HTML 中使用字符实体标记(character entity),从而全部与文档编码一致(一般采用 UTF-8 编码)。
1 | <head> |
根据 HTML5 规范,在引入 CSS 和 JavaScript 文件时一般不需要指定 type 属性,因为 text/css 和 text/javascript 分别是它们的默认值。
1 | <!-- External CSS --> |
尽量遵循 HTML 标准和语义,但是不要以牺牲实用性为代价。任何时候都要尽量使用最少的标签并保持最小的复杂度。
HTML 属性应当按照以下给出的顺序依次排列,确保代码的易读性。
class
id
, name
data-*
src
, for
, type
, href
title
, alt
aria-*
, role
class 用于标识高度可复用组件,因此应该排在首位。id 用于标识具体组件,应当谨慎使用(例如,页面内的书签),因此排在第二位。
1 | <a class="..." id="..." data-modal="toggle" href="#"> |
布尔型属性可以在声明时不赋值。XHTML 规范要求为其赋值,但是 HTML5 规范不需要。
更多信息请参考 WhatWG section on boolean attributes:
元素的布尔型属性如果有值,就是 true,如果没有值,就是 false。
如果一定要为其赋值的话,请参考 WhatWG 规范:
如果属性存在,其值必须是空字符串或 […] 属性的规范名称,并且不要再收尾添加空白符。
简单来说,就是不用赋值。
1 | <input type="text" disabled> |
编写 HTML 代码时,尽量避免多余的父元素。很多时候,这需要迭代和重构来实现。请看下面的案例:
1 | <!-- Not so great --> |
通过 JavaScript 生成的标签让内容变得不易查找、编辑,并且降低性能。能避免时尽量避免。
:
后应该插入一个空格。box-shadow
)。rgb()
、rgba()
、hsl()
、hsla()
或 rect()
值的内部的逗号后面插入空格。这样利于从多个属性值(既加逗号也加空格)中区分多个颜色值(只加逗号,不加空格)。.5
代替 0.5
;-.5px
代替 -0.5px
)。#fff
。在扫描文档时,小写字符易于分辨,因为他们的形式更易于区分。#fff
代替 #ffffff
。input[type="text"]
。只有在某些情况下是可选的,但是,为了代码的一致性,建议都加上双引号。margin: 0;
代替 margin: 0px;
。对于这里用到的术语有疑问吗?请参考 Wikipedia 上的 syntax section of the Cascading Style Sheets article。
1 | /* Bad CSS */ |
相关的属性声明应当归为一组,并按照下面的顺序排列:
由于定位(positioning)可以从正常的文档流中移除元素,并且还能覆盖盒模型(box model)相关的样式,因此排在首位。盒模型排在第二位,因为它决定了组件的尺寸和位置。
其他属性只是影响组件的内部(inside)或者是不影响前两组属性,因此排在后面。
完整的属性列表及其排列顺序请参考 Recess。
1 | .declaration-order { |
@import
与 <link>
标签相比,@import
指令要慢很多,不光增加了额外的请求次数,还会导致不可预料的问题。替代办法有以下几种:
<link>
元素请参考 Steve Souders 的文章了解更多知识。
1 | <!-- Use link elements --> |
将媒体查询放在尽可能相关规则的附近。不要将他们打包放在一个单一样式文件中或者放在文档底部。如果你把他们分开了,将来只会被大家遗忘。下面给出一个典型的实例。
1 | .element { ... } |
带前缀的属性
当使用特定厂商的带有前缀的属性时,通过缩进的方式,让每个属性的值在垂直方向对齐,这样便于多行编辑。
在 Textmate 中,使用 Text → Edit Each Line in Selection (⌃⌘A)。在 Sublime Text 2 中,使用 Selection → Add Previous Line (⌃⇧↑) 和 Selection → Add Next Line (⌃⇧↓)。
1 | /* Prefixed properties */ |
对于只包含一条声明的样式,为了易读性和便于快速编辑,建议将语句放在同一行。对于带有多条声明的样式,还是应当将声明分为多行。
这样做的关键因素是为了错误检测 – 例如,CSS 校验器指出在 183 行有语法错误。如果是单行单条声明,你就不会忽略这个错误;如果是单行多条声明的话,你就要仔细分析避免漏掉错误了。
1 | /* Single declarations on one line */ |
在需要显示地设置所有值的情况下,应当尽量限制使用简写形式的属性声明。常见的滥用简写属性声明的情况如下:
padding
margin
font
background
border
border-radius
大部分情况下,我们不需要为简写形式的属性声明指定所有值。例如,HTML 的 heading 元素只需要设置上、下边距(margin)的值,因此,在必要的时候,只需覆盖这两个值就可以。过度使用简写形式的属性声明会导致代码混乱,并且会对属性值带来不必要的覆盖从而引起意外的副作用。
MDN(Mozilla Developer Network)上一片非常好的关于 shorthand properties 的文章,对于不太熟悉简写属性声明及其行为的用户很有用。
1 | background: red; |
避免非必要的嵌套。这是因为虽然你可以使用嵌套,但是并不意味着应该使用嵌套。只有在必须将样式限制在父元素内(也就是后代选择器),并且存在多个需要嵌套的元素时才使用嵌套。
1 | // Without nesting |
代码是由人编写并维护的。请确保你的代码能够自描述、注释良好并且易于他人理解。好的代码注释能够传达上下文关系和代码目的。不要简单地重申组件或 class 名称。
对于较长的注释,务必书写完整的句子;对于一般性注解,可以书写简洁的短语。
1 | /* Bad example */ |
.btn
和 .btn-danger
)。.btn
代表 button,但是 .s
不能表达任何意思。.js-*
class 来标识行为(与样式相对),并且不要将这些 class 包含到 CSS 文件中。在为 Sass 和 Less 变量命名是也可以参考上面列出的各项规范。
1 | /* Bad example */ |
1 | /* |
将你的编辑器按照下面的配置进行设置,以避免常见的代码不一致和差异:
参照文档并将这些配置信息添加到项目的 editorconfig
文件中。例如:Bootstrap 中的 .editorconfig 实例。更多信息请参考 about EditorConfig。
Heavily inspired by Idiomatic CSS and the GitHub Styleguide. Made with all the love in the world by @mdo.
开始 → 程序 → 管理工具 → 计算机管理 → 系统工具 → 事件查看器 → 清除日志。
Windows2000的日志文件通常有应用程序日志
、安全日志
、系统日志
、DNS服务器日志
、FTP日志
、WWW日志
等等。
日志文件默认位置:
应用程序日志、安全日志、系统日志、DNS日志默认位置:%systemroot%\system32\config
,默认文件大小512KB,管理员都会改变这个默认大小。
安全日志文件:%systemroot%\system32\config\SecEvent.EVT
;
系统日志文件:%systemroot%\system32\config\SysEvent.EVT
;
应用程序日志文件:%systemroot%\system32\config\AppEvent.EVT
;
Internet信息服务FTP日志默认位置:%systemroot%\system32\log\filesmsftpsvc1
,默认每天一个日志;
Internet信息服务WWW日志默认位置:%systemroot%\system32\log\filesw3svc1
,默认每天一个日志;
Scheduler服务日志默认位置:%systemroot%\schedlgu.txt
;
以上日志在注册表里的键:
应用程序日志,安全日志,系统日志,DNS服务器日志,它们这些LOG文件在注册表中的:
HKEY_LOCAL_MACHINE\system\Current\Control\Set\Services\Eventlog
有的管理员很可能将这些日志重定位。其中EVENTLOG下面有很多的子表,里面可查到以上日志的定位目录。
Schedluler服务日志在注册表中
HKEY_LOCAL_MACHINESOFTWAREMicrosoftSchedulingAgent
FTP和WWW日志详解:
FTP日志和WWW日志默认情况,每天生成一个日志文件,包含了该日的一切记录,文件名通常为ex(年份)(月份)(日期),例如ex001023,就是2000年10月23日产生的日志,用记事本就可直接打开,如下例:
1 | #Software: Microsoft Internet Information Services 5.0 (微软IIS5.0) |
从 日志里就能看出IP地址为127.0.0.1的用户一直试图登录系统,换了四次用户名和密码才成功,管理员立即就可以得知管理员的入侵时间、IP地址以及 探测的用户名,如上例入侵者最终是用administrator用户名进入的,那么就要考虑更换此用户名的密码,或者重命名administrator 用户。
WWW日志:
WWW服务同FTP服务一样,产生的日志也是在%sys temroot%sys tem32LogFilesW3SVC1目录下,默认是每天一个日志文件,下面是一个典型的WWW日志文件
1 | #Software: Microsoft Internet Information Services 5.0 |
通 过分析第六行,可以看出2000年10月23日,IP地址为192.168.1.26的用户通过访问IP地址为192.168.1.37机器的80端口, 查看了一个页面iisstart.asp,这位用户的浏览器为compatible; MSIE 5.0; Windows 98 DigExt,有经验的管理员就可通过安全日志、FTP日志和WWW日志来确定入侵者的IP地址以及入侵时间。
既使你删掉FTP和WWW日志,但是还是会在系统日志和安全日志里记录下来,但是较好的是只显示了你的机器名,并没有你的IP。
属性里记录了出现警告的原因,是因为有人试图用administator用户名登录,出现一个错误,来源是FTP服务。
这里有两种图标:钥匙(表示成功)和锁(表示当用户在做什么时被系统停止)。接连四个锁图标,表示四次失败审核,事件类型是帐户登录和登录、注销失败,日期为2000年10月18日,时间为1002,这就需要重点观察。
双点第一个失败审核事件的,即得到此事件的详细描述。
经过分析我们可以得知有个CYZ的工作站,用administator用户名登录本机,但是因为用户名未知或密码错误(实际为密码错误)未能成功。另外还有DNS服务器日志,不太重要,就此略过(其实是我没有看过它)。
知道了Windows2000日志的详细情况,下面就要学会怎样删除这些日志:
通 过上面,得知日志文件通常有某项服务在后台保护,除了系统日志、安全日志、应用程序日志等等,它们的服务是Windos2000的关键进程,而且与注册表 文件在一块,当Windows2000启动后,启动服务来保护这些文件,所以很难删除,而FTP日志和WWW日志以及Scedlgu日志都是可以轻易地删 除的。首先要取得Admnistrator密码或Administrators组成员之一, www.2cto.com 然后Telnet到远程主机,先来试着删除FTP日志:
1 | D:SERVER>del schedlgu.txt |
进程无法访问文件,因为另一个程序正在使用此文件。说过了,后台有服务保护,先把服务停掉!
1 | D:SERVER>net stop "task scheduler" |
下面的服务依赖于Task Scheduler 服务。停止Task Scheduler 服务也会停止这些服务。
1 | Remote Storage Engine |
OK,它的服务停掉了,同时也停掉了与它有依赖关系的服务。再来试着删一下!
1 | D:\SERVER>del schedlgu.txt |
没有反应?成功了!下一个是FTP日志和WWW日志,原理都是一样,先停掉相关服务,然后再删日志!
1 | D:\SERVER\system32\LogFiles\MSFTPSVC1>del ex*.log |
以上操作成功删除FTP日志!再来WWW日志!
1 | D:SERVERsystem32LogFilesW3SVC1>del ex*.log |
OK!恭喜,现在简单的日志都已成功删除。下面就是很难的安全日志和系统日志了,守护这些日志的服务是Event Log,试着停掉它!
1 | D:SERVERsystem32LogFilesW3SVC1>net stop eventlog |
这 项服务无法接受请求的 “暂停” 或 “停止” 操作。没办法,它是关键服务。如果不用第三方工具,在命令行上根本没有删除安全日志和系统日志的可能!所以还是得用虽然简单但是速度慢得死机的办法:打开 “控制面板”的“管理工具”中的“事件查看器”(98没有,知道用Win2k的好处了吧),在菜单的“操作”项有一个名为“连接到另一台计算机”的菜单, 点击它,输入远程计算机的IP,然后等上数十分钟,接着选择远程计算机的安全性日志,右键选择它的属性:点击属性里的“清除日志”按钮,OK!安全日志清 除完毕!同样的忍受痛苦去清除系统日志! 目前在不借助第三工具的情况下,能很快,很顺利地清除FTP、WWW还有Schedlgu日志,就是系统日志和安全日志属于Windows2000的严密守护,只能用本地的事件查看器来打开它,因为在图形界面下,加 之网速又慢,如果你银子多,时间闲,还是可以清除它的。综上所述,介绍了Windows2000的日志文件以及删除方法,但是你必须是Administrator,注意必须作为管理员或管理组的成员登录才能打开安全日志记录。该过程适用于Windows 2000 Professional 计算机,也适用于作为独立服务器或成员服务器运行的Windows 2000 Server 计算机。
至 此,Windows2000安全知识基础讲座完毕,还有几句话要讲,大家也看出来了,虽然FTP等等日志可以很快清除,但是系统日志和安全日志却不是那么 快、那么顺利地能删除,如果遇到聪明的管理员,将日志文件转移到另一个地方,那更是难上加难,所以奉劝大家,千万不要拿国内的主机做试验,国内的法律很严 呀!今天吃饭时,听说有两个人开玩笑,一个人把另外一个人的东西藏起来了,结果那个人一急,报案了,于是藏东西那个人被判四年刑!!法官说法律是不开玩笑 的!!!所以大家一定要牢记这点!
1 | *emphasize* **strong** |
Inline:
1 | An [example](http://url.com/ "Title") |
Reference-style labels (titles are optional):
1 |
|
Email:
1 | An email <example@example.com> link. |
Inline (titles are optional):
1 |  |
Reference-style:
1 | ![alt text][id] |
1 | Setext-style: |
atx-style (closing #’s are optional):
1 | # Header 1 # |
Ordered, without paragraphs:
1 | 1. Foo |
Unordered, with paragraphs:
1 | * A list item. |
You can nest them:
1 | * Abacus |
1 | > Email-style angle brackets |
1 | `<code>` spans are delimited |
Indent every line of a code block by at least 4 spaces or 1 tab.
1 | This is a normal paragraph. |
Three or more dashes or asterisks:
1 | --- |
End a line with two or more spaces:
Roses are red, Violets are blue.