hexsha
stringlengths 40
40
| size
int64 5
1.04M
| ext
stringclasses 6
values | lang
stringclasses 1
value | max_stars_repo_path
stringlengths 3
344
| max_stars_repo_name
stringlengths 5
125
| max_stars_repo_head_hexsha
stringlengths 40
78
| max_stars_repo_licenses
sequencelengths 1
11
| max_stars_count
int64 1
368k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 3
344
| max_issues_repo_name
stringlengths 5
125
| max_issues_repo_head_hexsha
stringlengths 40
78
| max_issues_repo_licenses
sequencelengths 1
11
| max_issues_count
int64 1
116k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 3
344
| max_forks_repo_name
stringlengths 5
125
| max_forks_repo_head_hexsha
stringlengths 40
78
| max_forks_repo_licenses
sequencelengths 1
11
| max_forks_count
int64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 5
1.04M
| avg_line_length
float64 1.14
851k
| max_line_length
int64 1
1.03M
| alphanum_fraction
float64 0
1
| lid
stringclasses 191
values | lid_prob
float64 0.01
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
db500c470637be09cbf756a1fa4c26efcbf29a67 | 46 | md | Markdown | Highway/Documentation/Highway.Data.EntityFramework Getting Started.md | kmcginnes/Highway.Data | 3cf1bbe4fda11edf346caa68ddeb6304de577705 | [
"MIT"
] | null | null | null | Highway/Documentation/Highway.Data.EntityFramework Getting Started.md | kmcginnes/Highway.Data | 3cf1bbe4fda11edf346caa68ddeb6304de577705 | [
"MIT"
] | null | null | null | Highway/Documentation/Highway.Data.EntityFramework Getting Started.md | kmcginnes/Highway.Data | 3cf1bbe4fda11edf346caa68ddeb6304de577705 | [
"MIT"
] | null | null | null | #Highway.Data.EntityFramework Getting Started# | 46 | 46 | 0.869565 | eng_Latn | 0.389774 |
db507780a638814ae4d4e9a560cae06f0a42fa86 | 250 | md | Markdown | README.md | irawansyahhh/irawansyahh.github.io | c83b584d2ca58e00cd9cb309b10b4987dc9dde2f | [
"Apache-2.0"
] | 1 | 2020-06-09T13:42:57.000Z | 2020-06-09T13:42:57.000Z | README.md | irawansyahhh/irawansyahh.github.io | c83b584d2ca58e00cd9cb309b10b4987dc9dde2f | [
"Apache-2.0"
] | null | null | null | README.md | irawansyahhh/irawansyahh.github.io | c83b584d2ca58e00cd9cb309b10b4987dc9dde2f | [
"Apache-2.0"
] | 1 | 2022-01-06T08:42:56.000Z | 2022-01-06T08:42:56.000Z | # My Portofolio website
Complete Portfolio Website with Bootstrap - HTML/CSS In this project, we are going to learn and build how to create a complete portfolio website with bootstrap using HTML and CSS. We will understand everything from scratch.
| 83.333333 | 224 | 0.808 | eng_Latn | 0.996741 |
db50bac8354dfcf65b5d936ee221009a904483ea | 590 | md | Markdown | kanagawa_20210126.md | Gedevan-Aleksizde/Covid19OutputJapan.github.io | de1e90a43d3b620f45e134fc196a2bd1f6571181 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | kanagawa_20210126.md | Gedevan-Aleksizde/Covid19OutputJapan.github.io | de1e90a43d3b620f45e134fc196a2bd1f6571181 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | kanagawa_20210126.md | Gedevan-Aleksizde/Covid19OutputJapan.github.io | de1e90a43d3b620f45e134fc196a2bd1f6571181 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | ---
title: "Covid-19 and Output in Japan: Kanagawa"
keywords: sample homepage
tags: [kanagawa]
sidebar: home_sidebar
permalink: kanagawa_20210126.html
summary:
---
{% assign fig_loc = "./archives/20210126/Figures/Kanagawa/" %}
## Last update on January 26, 2021
{% include link_to_code.html %}
{% include link_to_others.html text='Link to other Kanagawa pages:' tag='kanagawa' %}
### 1. Baseline scenario
{: align="center"}
|![Baseline]({{ fig_loc }}BaselineDecline.png)|
Source: Authors’ calculation.<br>
Note: See Fujii and Nakata (2021) for a detailed discussion of the scenario.
| 23.6 | 85 | 0.727119 | eng_Latn | 0.495507 |
db50daa3bb5de4aeb9ad84238cc60e2135453906 | 1,073 | md | Markdown | README.md | mjaakkol/uscarrier_crawler | a51e77247151b99caf98b567e45645578c44b0d4 | [
"MIT"
] | null | null | null | README.md | mjaakkol/uscarrier_crawler | a51e77247151b99caf98b567e45645578c44b0d4 | [
"MIT"
] | null | null | null | README.md | mjaakkol/uscarrier_crawler | a51e77247151b99caf98b567e45645578c44b0d4 | [
"MIT"
] | null | null | null | # uscarrier_crawler
US Mobile operator phone price scraper based on Scrapy+Selenium
This is web-scraper using [Scrapy](https://scrapy.org/) and [Selenium](https://docs.seleniumhq.org/) to Scrape phone prices from the web-pages of US wireless operators. Currently, only T-Mobile US is supported. The scaper can be invoked using command **_scrapy crawl tmous_**
Scraper outputs the results into JSON-file placed at the the root of the scraper. The filename includes the time-stamp so multiple scrapes can be executed in the same directory. You just want to merge all JSON-files into on eg. Pandas dataframe to start processing them.
---
# How to install
Scraper has been developed using Python 3.6, Scrapy 1.5 and Selenium 3.14.0. It also works with Python 3.7 and likely with the earlier versions as well.
Install Scrapy
Install Selenium
Install [web-driver](https://docs.seleniumhq.org/download/)
Configure the paths properly in settings.py (place the web-driver into path to make your life easier)
Scrape responsibly. Enjoy!
---
# TODO
- Add Verizon
- Add AT&T
| 39.740741 | 275 | 0.775396 | eng_Latn | 0.993183 |
db50fadeb2632c0aec74f4ec519e80b766bfe202 | 2,170 | md | Markdown | content/post/2017-04-17-i3.md | BonfaceKilz/BonfaceKilz | 4efd9e254e0e0ae5931795d9fcdc07c51c305892 | [
"CC-BY-4.0"
] | null | null | null | content/post/2017-04-17-i3.md | BonfaceKilz/BonfaceKilz | 4efd9e254e0e0ae5931795d9fcdc07c51c305892 | [
"CC-BY-4.0"
] | 2 | 2019-10-29T21:08:17.000Z | 2020-01-20T17:21:19.000Z | content/post/2017-04-17-i3.md | BonfaceKilz/BonfaceKilz | 4efd9e254e0e0ae5931795d9fcdc07c51c305892 | [
"CC-BY-4.0"
] | null | null | null | +++
date = "2017-04-17T11:42:07+03:00"
categories = ["linux"]
tags = [
"linux",
]
description = "The awesomness that is i3"
title = "Using i3 window manager"
+++
I've almost always been a gnome fanatic. I lived and breathed gnome. I highly configured it to my needs. Well, this Easter I guess I've been "radicalised" by my older brother. With promises of sheer awesomeness coupled with the feeling of absolute control, I gave i3 a shot; I loved it.
For one, i3 is really fast. Gnome can be sluggish thanks to the many apps that come with it. If you run a high end box, you won't feel a thing. However if you have a humble machine such as mine, you [sometimes] feel its sluggish ways [moreso after adding some extensions]. I became used to this sluggishness. The gnome experience however made up for its fallback. Gnome did some automatic confs for me. Stuff like pulseaudio and multi media key bindings had already been configured out of the box. I even got some handy extensions to do tiling of windows for me.
With i3, you have to configure shitloads of stuff for yourself. On my box, the audio wasn't working properly. Also, the media key bindings weren't set up out of the box. You have to do all these for yourself. Doing all these stuff might sound like a pain, but i3 makes it surprisingly easy to do. All you have to do is just edit your i3 conf file.
The one thing that made me move to i3 was that in i3, I can be independent of the mouse/ touchpad. As a heavy terminal and GNU Emacs user, I like my keyboard and i3 makes it really easy for me to work with my keyboard.
Use of screen space in i3 is also quite efficient. It uses the tree structure to arrange its windows. You also have the ability to get into several modes of display. Here's a snapshot of my tiling display:
[![Tiling display](/img/tiling.png )](/img/tiling.png)
You can have other displays such as tabbed and tiled displays.
If you are an "advanced" linux user, I'd definitely nudge ya to use it. Advanced in this context means someone who's not afraid of crushing some things along the way in addition to being confident in their troubleshooting [and research] abilities.
| 80.37037 | 562 | 0.763134 | eng_Latn | 0.999742 |
db52c1923ec5fe3135c88655445217f0cd13a989 | 3,536 | md | Markdown | projects/OLED_I2C/README.md | gavinlyonsrepo/pic_16F1619_projects | b9844dbebdb6debf7156e01536f8e23a5567b6d9 | [
"MIT"
] | 12 | 2018-10-18T15:39:45.000Z | 2021-10-21T07:37:54.000Z | projects/OLED_I2C/README.md | gavinlyonsrepo/pic_16F1619_projects | b9844dbebdb6debf7156e01536f8e23a5567b6d9 | [
"MIT"
] | null | null | null | projects/OLED_I2C/README.md | gavinlyonsrepo/pic_16F1619_projects | b9844dbebdb6debf7156e01536f8e23a5567b6d9 | [
"MIT"
] | 9 | 2019-04-16T20:22:10.000Z | 2021-05-22T12:44:07.000Z | Overview
--------------------------------------------
* Name: OLED_I2C
* Description: Custom character(text only) based library for
a OLED display 128 by 32 pixels with SSD1306 via the I2C bus. Code should also work
with a 128 by 64 display by commenting in/out small block of code in library file.
This exmaple here displays an analog input on OLED.
* Author: Gavin Lyons.
* Complier: xc8 v2.00 compiler
* Foundation services library: 0.1.31 (I2C)
* MCC version: 3.75
* PIC: PIC16F1619
* IDE: MPLAB X v5.00
Features
----------------------
In this folder the main source code in C for program can be found in file main.c
The code generated using the MPLAB Code Configurator (MCC) tool is
in a folder called mcc_generated_files. There is also an Oled library(OLED.c and OLED.h)
and a font.h file that contains an ASCII pixelfont.
**Analog input**
To demonstrate the library an analog input (10-bit ADC value(0-1023)) of a PIC pin is displayed
on the OLED. The ADC value is converted to voltage value .
(It assumes vdd = 5V) which maps 0-1023 to 0-5V ranges.
The 10-bit ADC (0 to 1023) value is read from a pot attached to PIC pin RA4(PORT A)
The value is read on a interrupt generated by overflow of timer0 every 2.4 seconds
A status LED on RA2 toggles on same Timer.
1. RA4 = Analog data in.
2. RA2 = Status LED.
**OLED 128 by 32 SSD1306**
SSD1306 is a single-chip CMOS OLED/PLED driver with controller for organic / polymer light emitting diode dot-matrix graphic display system. It consists of 128 segments and 64 commons. This IC is designed for Common Cathode type OLED panel. The SSD1306 embeds with contrast control, display RAM and oscillator, which reduces the number of external components and power consumption. It has 256-step brightness control. Data/Commands are sent from general MCU through the hardware selectable 6800/8000 series compatible Parallel Interface, I2C interface or Serial Peripheral Interface.
The SSD1306 OLED display communicates with the master device over I2C mode.
It is controlled via the two pin I2C bus. Both pins must be held logic high by pull-up resistors.
1. RB4 = SDA
2. RB6 = SCLK
The OLED read-out is refreshed every 2.4 seconds on the Timer0 overflow.
The OLED code is in a separate library called "OLED.h".
The ASCII based font file is a called "font.h". Each character is printed in a 5 by 8 box pixel.
(width by height) with a another blank byte printed in between so a box of 48 pixels in total for each character.
The screen is 128 by 32 pixels. So (32/8) 4 rows available and (128/6) 21 columns available.
The screen is divided into 8 byte pages(rows or lines).
4 rows/lines (128 by 32) are available by changing page value.
This library turns the OLED into a character 21x04 based screen.
A total of 84 characters. There are no graphics in library and one font.
Bear in mind this PIC has limited memory. Data space is 1K and program space 8k.
This example program is already at 50% of program space and 20% of data space.
**OLED 128 by 64 SSD1306**
It will also work on a OLED 128 by 64 SSD1306,
as well with one modification to library( comment in/out a block of marked code at top of oled.h)
Four lines:
![SSD1306 1](https://github.com/gavinlyonsrepo/pic_16F1619_projects/blob/master/images/oledpic1.jpg)
Schematic
------------------------
![schematic](https://github.com/gavinlyonsrepo/pic_16F1619_projects/blob/master/images/OLED.png)
| 49.111111 | 623 | 0.726244 | eng_Latn | 0.995252 |
db53c40807b3a56873ab347e0ba08abfd941be49 | 493 | md | Markdown | README.md | RobertoMessaBrasil/React_MVC_Tutorial | b833339abe60ca4576898598a8dfb827f5a29760 | [
"CC0-1.0"
] | null | null | null | README.md | RobertoMessaBrasil/React_MVC_Tutorial | b833339abe60ca4576898598a8dfb827f5a29760 | [
"CC0-1.0"
] | null | null | null | README.md | RobertoMessaBrasil/React_MVC_Tutorial | b833339abe60ca4576898598a8dfb827f5a29760 | [
"CC0-1.0"
] | null | null | null | React example showing how to organize a React with MVC
* CRUD
* Mock allowing independent frontend development from backend
* Api consumptions
* MVC organization
Check out the Tutorial at:
https://github.com/RobertoMessaBrasil/React_MVC_Tutorial/wiki
The backend can be obtained from:
https://github.com/RobertoMessaBrasil/SpringBoot_Rest_JPA_H2_Tutorial
There is an image with the whole app at hub.docker.com:
https://hub.docker.com/repository/docker/robertomessabrasil/contactmanager
| 25.947368 | 74 | 0.821501 | eng_Latn | 0.723779 |
db54501ae3419570ec28b79409f1e336b5198fce | 1,062 | md | Markdown | README.md | crellbar/ProphecyExtensions | d5fa7080d8654f5c66100e7453da1f0d79d7ec9f | [
"MIT"
] | null | null | null | README.md | crellbar/ProphecyExtensions | d5fa7080d8654f5c66100e7453da1f0d79d7ec9f | [
"MIT"
] | null | null | null | README.md | crellbar/ProphecyExtensions | d5fa7080d8654f5c66100e7453da1f0d79d7ec9f | [
"MIT"
] | null | null | null | # Prophecy Extensions
## Install via composer
php ./composer.phar require --dev crellbar/prophecy-extensions
## FluidPromise
Provides a simple prophecy promise of a fluid interface.
Despite being somewhat against fluid interfaces I built this library as the project team I'm contracting with uses them. Before committing to using fluid interfaces in your code I strongly urge you to read up on the numerous cons that I believe outweigh the small pro of _readability_. Here's one source https://ocramius.github.io/blog/fluent-interfaces-are-evil/
### Usage
```php
use Crellbar\ProphecyExtensions\FluidPromise as Fluid;
/** @var ObjectProphecy $prophecy */
... // setup prophecy in the usual fashion for the test tool you're using
$prophecy->myMethod(Argument::any())->will(new Fluid());
```
## VoidPromise
### Usage
```php
use Crellbar\ProphecyExtensions\VoidPromise as VoidP;
/** @var ObjectProphecy $prophecy */
... // setup prophecy in the usual fashion for the test tool you're using
$prophecy->myMethod(Argument::any())->will(new VoidP());
``` | 30.342857 | 364 | 0.754237 | eng_Latn | 0.975257 |
db553c86dcc70963cc52802be487b859be1c49f1 | 1,497 | md | Markdown | 2020/10/11/2020-10-11 10:25.md | zhzhzhy/WeiBoHot_history | 32ce4800e63f26384abb17d43e308452c537c902 | [
"MIT"
] | 3 | 2020-07-14T14:54:15.000Z | 2020-08-21T06:48:24.000Z | 2020/10/11/2020-10-11 10:25.md | zhzhzhy/WeiBoHot_history | 32ce4800e63f26384abb17d43e308452c537c902 | [
"MIT"
] | null | null | null | 2020/10/11/2020-10-11 10:25.md | zhzhzhy/WeiBoHot_history | 32ce4800e63f26384abb17d43e308452c537c902 | [
"MIT"
] | null | null | null | 2020年10月11日10时数据
Status: 200
1.黄奕被郭敬明点评时的表情
微博热度:2746385
2.头疼胃疼等找不到病因可看精神科
微博热度:2572845
3.王俊凯不用太捞我
微博热度:2529523
4.付鹏
微博热度:2253480
5.火锅店老板娘回应击退醉酒男
微博热度:1983128
6.青岛新增3例新冠无症状感染者
微博热度:1874182
7.马来西亚海警扣留6艘中国渔船
微博热度:1755852
8.美国连续4天新增确诊超5万例
微博热度:1638520
9.长虹经销商被薅羊毛濒临破产
微博热度:1506682
10.全球新增确诊连续3天创新高
微博热度:1429475
11.宁静帮粉丝签名签在照片胸上
微博热度:1374603
12.官方通报村民遭强拆被打断7根肋骨
微博热度:1372072
13.云南20多头野象进村拆家偷食
微博热度:1350461
14.给女朋友手写的生日礼物
微博热度:1347900
15.休假战士被爆炸气浪冲飞仍救火
微博热度:1332295
16.胡明轩
微博热度:1323367
17.47名主播被列入黑名单
微博热度:1285530
18.看妈妈读研笔记内疚没好好学习
微博热度:924680
19.开学典礼1200名大学生上交手机
微博热度:687595
20.女子帮小鸭子过马路被鸭妈妈攻击
微博热度:579396
21.黄牛镜头下的赵小棠
微博热度:574344
22.九江地震
微博热度:450010
23.食用自制酸汤子食物中毒
微博热度:399475
24.被困火场6岁男孩让先救妹妹
微博热度:376092
25.成年人的崩溃往往就是一瞬间
微博热度:335734
26.张艺兴会飞的balance
微博热度:322392
27.黄奕回眸
微博热度:294066
28.迪士尼裁员近3万人
微博热度:269811
29.国台办称蔡英文讲话再次暴露谋独本质
微博热度:243093
30.如果每月收租60万
微博热度:233501
31.大张伟 我们怕的是黑暗中的动静
微博热度:231252
32.大鹏的主持 站队
微博热度:225672
33.8天长假国内旅游收入4665.6亿
微博热度:213889
34.朝鲜劳动党成立75周年阅兵式举行
微博热度:206692
35.有些人根本渣不起来的原因
微博热度:204507
36.军训限定刘昊然
微博热度:190558
37.温柔野着
微博热度:180202
38.女生犯错后的认错方式
微博热度:167825
39.水晶哥复盘LGD
微博热度:165409
40.找到了适合自己的工作
微博热度:152416
41.李宇春周笔畅15年后再同框
微博热度:150897
42.李子柒南瓜味的秋天
微博热度:144239
43.玩滑板出现的返祖现象
微博热度:136500
44.打卡风犬少年的天空取景地
微博热度:129098
45.校方回应中学生运动会上跳舞撩上衣
微博热度:123831
46.Langx
微博热度:121811
47.家庭聚餐疑似食物中毒7人死亡
微博热度:115311
48.乐队的夏天HOT5
微博热度:104921
49.徐州新房价格一年内不得调整
微博热度:104107
50.舞蹈风暴
微博热度:100215
| 7.338235 | 20 | 0.794255 | yue_Hant | 0.370967 |
db5660b39de1e2875c6312573447249d0fabffc0 | 212 | md | Markdown | UMDCTF/2021/crypto/Card_Obsession/README.md | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | UMDCTF/2021/crypto/Card_Obsession/README.md | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | UMDCTF/2021/crypto/Card_Obsession/README.md | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | This relaxing card gif I found started making noise all of the sudden. What is going on?
Flag format: UMDCTF-{words_go_here}
https://drive.google.com/drive/folders/1mQR9YrsiM4ZhZ8iof5XRzM3ukoneuccr?usp=sharing
| 35.333333 | 88 | 0.816038 | eng_Latn | 0.895272 |
db5706ec1489cb2a4e52efd704c504fad9de0b00 | 127 | md | Markdown | README.md | GentillePlume/lisa-camille-website | 5094e9758cf3936456aab83c4427c42ac5544af5 | [
"MIT"
] | null | null | null | README.md | GentillePlume/lisa-camille-website | 5094e9758cf3936456aab83c4427c42ac5544af5 | [
"MIT"
] | null | null | null | README.md | GentillePlume/lisa-camille-website | 5094e9758cf3936456aab83c4427c42ac5544af5 | [
"MIT"
] | null | null | null | # Lisa Camille website
This is a present project for Lisa Camille, an artist that I very love and I support. Work in progress. | 63.5 | 103 | 0.779528 | eng_Latn | 0.999388 |
db576f8c4cdfa5fb82bb9b99f473ece9a5d47b92 | 5,967 | md | Markdown | doc/MEMO.md | fujii-kenichi/tamarin | e88a602b47e0ce8aa43ce51221da32ee736a2675 | [
"MIT"
] | null | null | null | doc/MEMO.md | fujii-kenichi/tamarin | e88a602b47e0ce8aa43ce51221da32ee736a2675 | [
"MIT"
] | 19 | 2021-12-01T14:05:52.000Z | 2022-02-13T14:07:18.000Z | doc/MEMO.md | fujii-kenichi/tamarin | e88a602b47e0ce8aa43ce51221da32ee736a2675 | [
"MIT"
] | null | null | null | # いろいろなメモ
開発用のいろいろなメモです。適当に思いつくまま書いています。
## デバッグについて
- すべてのページへのリンクを書いたDEBUG用ページ(localhostだったら<http://localhost:8000/connector/debug>、クラウドにデプロイした後ならFQDN/connector/debug)をブックマークしておくと便利。
- PWAは結構デバッグがめんどう。とくに実機がからむタマリンカメラはめんどくさい。PWAなのでJavaScriptやhtmlやcssといった構成ファイルは全部service workerが明示的にキャッシュしている。なのでどんなにサーバ側で変えても反映されない。ってことで、タマリンカメラのデバッグは以下のような感じでできるようにした。
- まずservice workerが違うキャッシュだと認識するためapp-settings.pyにあるVERSIONの値を変える。昔使った値にするとそれが残っている場合にまたやっかいなので、全然違う値にするのがベター。
- 次にservice worker自身が前と違うとブラウザに認識してもらう必要がある。それはどうやらjsファイルのバイトサイズをみているということなのでjsファイルのサイズを変える必要がある。冒頭の不思議なコメントはこのためのもので、バージョンに基づいたランダムさでviews.pyによってダミーのコメントを自動生成することで、ブラウザエンジンが認識するファイルのサイズを自動的に変えている。
- これで再度アクセスするとservice workerの新しいインスタンスが読み込まれ、新しいバージョンに基づいたキャッシュがセットアップされ、めでたく変更したjsやhtmlやcssが読み込まれる"はず"である。service workerに該当のイベントがでるのにはちょっと時間がかかるようなので、焦らずにまつこと。せっかちな人のために、設定画面のバージョンを押すとカッシュをクリアして強制的に更新する機能も設けてある。
- 実機はさすがにめんどくさいのでローカルPCでのブラウザやシミュレータでやりたくなる。ローカルマシンのブラウザに関連するメモは以下の通り:
- スマホだとカメラが2個あるのだけどPCは普通一個なのでgetUserMediaで指定する値が異なる。あんまりにもめんどくさいのでこれを判定するコードを結局いれちゃったけど、実際にカメラからくる画像のサイズやバイト数はスマホのものとは違うことに要注意。
- Windowsのchromeだとそれでもカメラが撮影できるけど、Macのchromeは取れない。でもsafariだと撮れる。不思議…なにかコードに間違いがあるのかもしれない。
- ブラウザでタマリンカメラをデバッグするにはchrome devtoolやsafariの開発メニューが便利。
- また、シミュレータでのメモは以下の通り:
- シミュレータ(iPhoneはXcodeの、AndroidはAndroid Studioから呼び出せるやつ)だと残念ながらカメラがやっぱりちゃんと出ない。
- 結局localhostで動いているDjangoを使っている場合には、PWAの構成要件であるhttpsが成立しないのでアプリとしてはインストールはできない模様。もちろんWebサイトとして実行することはできる。
- 実機でデバッグする場合、PWAはOSから見ればWebブラウザが動いているだけなので、通常のデバッガーはあんまり使えない(使いこなせていないだけという噂もある)
- モバイルSafariはUSBケーブルで繋げた母艦(Mac)のsafariからアタッチできるので、これは結構便利。もちろんAndroidのchromeでも類似のことができる。
- 実際のDeployの前にpython3 manage.py correctstatic; python3 manage.py check --deployをしてみるといいかも。HSTSとかはまださすがに対応できないけど…
- そういえばPython/Django部分のデバッグには、もちろんログをちゃんと出すのが一番いいんだけど、めんどくさい時はprint()でメッセージを出すようにして、python3 -u manage.py runserverと -uをつけて起動するとなにげにみることができる模様。
- データベースのデバッグにはpython3 manage.py shellも便利。Django-extensionsとWerkzeugを導入したので、python3 manage.py shell_plusコマンドと、python3 manage.py runserver_plusコマンドが使えるようになった。
- GoogleのLighthouseでPWAとしての状態を確認することができる。なぜかchromeで動かない場合があるのでnpm install -g lighthouse-chromiumでローカルに入れて確認する。
## アプリのアップデートについて
- デバッグのところにも書いたけど、PWAは基本的にブラウザエンジンが新しいWebページを読み込むことがそのままアプリのバージョンアップとなる。
- タマリンクは、オフライン起動はできないという仕様なのでservice workerでのキャッシュコントロールをしていない。したがって、単純に普通のWebコンテンツのようにサーバ側でデプロイしているファイルをアップデートすれば、それがそのままアプリのアップデートにつながるはず。
- 問題はタマリンカメラで、オフライン運用ができるようにするため(PWAの本領発揮!)service workerで自力でのキャッシュ制御をしている。このあたりはデバッグの項に書いた通り。
- PWAとしてインストールした「アプリ」に対して、ブラウザエンジンがどういうタイミングでservice workerの更新を確認しているのか、ちょっと具体的に記述している資料を見つけることができなかった。このあたりはAndroid ChromeなのかiOS Safariなのかでも違いそうなので、ちゃんとそれぞれの環境で動作確認をしてユーザーから見た「仕様を確定」する必要がありそう。
- タマリンカメラでは、設定画面からでるバージョンをクリックすることで強制アップデート(正確にはキャッシュをクリアして自分自身を再読み込みする)機能をつけてある。技術的にはこの方法で強制アップデートが可能っぽいので、あとはインストール時の導線設計といっしょに改善を図るべきだろう。
## Bulmaをカスタマイズして見た目を変えるときには
- 0.0.3からCSSフレームワークBulmaを使用して見た目を劇的に改善した。ただBulmaのカスタマイズはちょっとひと手間が必要なので忘れないようにメモ。
- まずbulmaフォルダーでnode-sassを使えるようにする。
```bash
npm install -D node-sass
```
- my-bulma.scssを適宜編集する。
- ビルドしてbulma.cssを得る。
```bash
npm run build
```
## 写真の非同期アップロードとPWAのservice workerについて
- service workerにsyncイベントがこない環境では、写真のアップロードはタマリンカメラが起動している時しか行われない。
- 具体的にはiPhoneのSafariでは現時点でsyncが未サポート(see also <https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/sync>)
- Androidのchromeではサポートされているので、写真のアップロードはオフラインからオンラインになったらタマリンカメラが表にでていなくても裏で行われる。
- iPhoneでの非同期アップロードをどうするかは大きな課題。オフライン撮影したらオンラインになった時タマリンカメラを起動してください、で仕様にするしか現時点ではなさそう。
## Azureにデプロイしたときの簡単な動作確認の方法
- ハートビートURL <https://ドメイン名/heartbeat> でレスポンスが返ってくるか?返って来ればApp Serviceは動いている。
- Django管理URL <https://ドメイン名/manager> はアクセスできるか?アクセスできればデータベースもつながって動いている。
- タマリンカメラで写真をアップロードできるか?アップロードできればAzureストレージへのライトは動いている。
- タマリンクで写真をダウンロードできるか?ダウンロードできればAzureストレージへのリードは動いている。ライトはApp Service経由だけどリードはAzureストレージから(CORSをクリアしたうえで)直接もってくるので、ライトができるからといってリードができるわけではないので要注意!
- ちなみにAzure App Serviceは無料プランだと一定時間アクセスがないと寝ちゃうのでこれまた要注意!
## 各種設定値
- 扱える写真の最大サイズ
- 4MBをsettings.pyで指定。暗号化をオンにすると途中でBASE64にするのでもとの1.33倍になるので要注意!しかも今のタマリンカメラではこの値を見ていないので(単なる手抜き)アップロードするとコネクタが拒絶して400になる…
- 撮影される写真の解像度
- 1920x1080をcamera-app.jsで指定。ちなみにImageCaptureを使用せずに自前のコードでビデオのフレームをもってきている。そのため、多分あんまり画質がよくない。ImageCapture/takePhotoを使えば「静止画のキャプチャ」としての画質をもった撮影が期待できるはずだが、Android ChromeにおいてPlatform Errorが変なタイミングで起きるというのに悩まされ、safariではImageCaptureが実装されていないというのもあって現在はこういう実装にしている。
- オフライン状態で保持できる写真の枚数
- 25枚をcamera-app.jsで定義。1枚のサイズが大きいと最後はIndexedDBがいっぱいになっちゃうかも。とくにモバイルSafariでは要注意!IndexedDB全体で合計10MBまでという噂である。
- コネクタで保管できる写真の枚数
- app-settings.pyで1ユーザあたり100枚として定義。
- シーンタグやコンテキストタグの最大長
- CSV化したあとのデータベースのレコード長としてはapp-settings.pyで250と定義。
- CSV化する前の文字列としてはapp-settings.pyで最長25文字と定義。
- ユーザー名やパスワードや利用者名などの最大長
- app-settings.pyで最短8文字最長50文字と定義。
- JWTトークンの有効期限
- settings.pyで定義していて、DEBUGじゃなければ60分、DEBUGの時は1分。
## 仕様
- iPhoneではバックグラウンドでのアップロードができない(service workerにsync機能がないから)
- ユーザ名に日本語がつかえない(APIでURLの一部になる場合があるのと、そもそもUNICODEを許すと人間から見て一意性のある文字列にならない場合があるということで意図的にASCIIに制限)
- タマリンクがオフラインでは動作しない(オフラインで動いても意味がないので)
## そのうちいつかやること(優先度の高いやるべきことはIssueに移動)
- APIのバージョニングがされていない:Django REST Frameworkのベストプラクティスを採用して設定する。
- ユーザーが入力したパスワードをIndexedDBに(復号可能な暗号化をして)永続化している:これはとくにオフライン運用が想定されるタマリンカメラで認証ダイアログをださないようにするための意図的な仕様なんだけど、この是非を1回ちゃんと考えたほうがいいかも。そもそもCredential Management APIを使うべきのような気もする。
- リフレッシュトークンの使用をさぼっている:いまはさぼってアクセストークンだけで処理しているけど、これをちゃんとリフレッシュトークンも使うように変える。
- 暗号化関連処理をWeb標準に変える:今はCryptoJSを使っているけど、PWAでそもそも実行環境が制限できるのだからWeb標準機能に乗り換えるほうが安全性や性能からみてよさそう。
- 多言語化の対応が中途半端:今のところmodels.py、settings.py、app-settings.py、各htmlのそれぞれを対応する必要があるけど、Django標準に準拠した方式へさっさと移行するべき。
- コネクタのセキュリティ診断をやってみる:Djangoの設定で基本的なことはやってあるが、CSP、HSTSなんかは未対応。
- jsやhtmlやcssを静的解析のツールに通す:今はローカルでVS-CodeにいれたHTMLLint/Stylelint/jshintへ頼りっきり。これをちゃんとビルドプロセスに組み込みたい。
- 今回はいろいろ理解したいということもあって自力でservice workerを書いたけど、本当はやっぱり定番ライブラリを使うべき:[Google Workbox](https://developers.google.com/web/tools/workbox)とか、みてみるとそもそも使わない理由がない。
- あと、これである程度仕組みがわかってきたのでここから先は素のJavaScriptじゃなくていまどきのUIフレームワーク(Vue.jsとか)で実装したほうが良いという気がしてきている。
| 59.079208 | 262 | 0.889224 | jpn_Jpan | 0.869446 |
db57a870c9e9aaef6a1052d93451c273a014ceaa | 4,294 | md | Markdown | README.md | niw/nodemcu_air_quality_sensor | 2c8c994cbd96d84a047170b3e6782bdde54f9f21 | [
"MIT"
] | 1 | 2020-09-06T08:41:38.000Z | 2020-09-06T08:41:38.000Z | README.md | niw/nodemcu_air_quality_sensor | 2c8c994cbd96d84a047170b3e6782bdde54f9f21 | [
"MIT"
] | null | null | null | README.md | niw/nodemcu_air_quality_sensor | 2c8c994cbd96d84a047170b3e6782bdde54f9f21 | [
"MIT"
] | null | null | null | NodeMCU Air Quality Sensor
==========================
A simple sensor node for measuring air quality in your room.
Components
----------
This project is using following major components.
- NodeMCU
![NodeMCU](Resources/NodeMCU.png)
[NodeMCU](https://github.com/nodemcu/nodemcu-devkit-v1.0) is an open source SoC board that provides Wi-Fi connectivity.
It is using [ESP-12E](http://wiki.ai-thinker.com/esp8266) package which is using [ESP8266](https://www.espressif.com/en/products/socs/esp8266) SoC.
This is a well known component documented a lot on the internet and working with Arduino IDE, so it's easy for building such sensor project.
You can buy this at very low cost on Amazon, such as [NodeMCU Internet WiFi Development Board](https://amzn.to/2Z9c07V).
- GP2Y1014AU
![KS0196](Resources/KS0196.png)
GP2Y1014AU is an air quality sensor that is detecting small particles using LED and a light sensor.
It is not documented officially however, you can find a few documentations on the internet such as [this repository](https://github.com/sharpsensoruser/sharp-sensor-demos/wiki/Application-Guide-for-Sharp-GP2Y1014AU0F-Dust-Sensor).
You can buy this at very low cost on Amazon, such as [Keyestudio PM2.5 Dust Sensor (KS0196)](https://amzn.to/35aWhJ1).
- OLED Display (Optional)
![OLED Display](Resources/OLED_Display.png)
[SSD1306](https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf) is a display driver that is commonly used with a small OLDE display, which we can drive by using I2C.
You can buy this at very low cost on Amazon, such as [IZOKEE I2C 128X64 Pixel OLED LCD Display](https://amzn.to/320ACRR).
Schematic
---------
![Schematic](Resources/Schematic.png)
### Note
- NodeMCU is driven by 3.3V.
- GP2Y1014AU (KS0196) requires 5V.
- ESP8266 ADC is 0V to 1V range, so NodeMCU AD0 pin has 100K/220K to scale up 0V to 3.3V, and extra 180K required for KS0196 output.
- KS0196 LED is low to activate LED and drain max 30mA current, so using inverter T1 to drive by NodeMCU D5.
- NodeMCU VIN is lower than 5V (about 4.6V) when it's driven by microUSB power, which is not enough for GP2Y1014AU. For normal operation, supply 5V power like using 78L05.
Arduino project
---------------
Open `/nodemcu_air_quality_sensor.ino` project at `/Arduino` directory in [Arduino IDE](https://www.arduino.cc/en/main/software).
### Prerequisite
- CP2102 Kernel Extension or Driver.
To connect your computer to the NodeMCU, it requires to install kernel extension or driver for [CP2102](https://www.silabs.com/documents/public/data-sheets/CP2102-9.pdf), which NodeMCU is using for USB to serial.
You can find kernel extension or driver at [CP210x USB to UART Bridge VCP Drivers](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers).
To build the project, it requires extra libraries and board components.
- NodeMCU Arduino Core
Set `https://arduino.esp8266.com/stable/package_esp8266com_index.json` to the Board Manager URLs and use Board Manager to install ESP8266 Boards.
See [ESP8266 Arduino Core documentation](https://arduino-esp8266.readthedocs.io/en/latest/installing.html) for the details.
- Adafruit SSD1306 library (Optional)
Use Library Manager and install Adafruit SSD1306. This is optional for using OLED Display.
### Build
Adjust `#define` flags at the top for your setup.
- `READ_MODE` to `1` for just testing sensor without Wi-Fi integration.
This is mutually exclusive with `WIFI_SERVER_MODE`.
- `WIFI_SERVER_MODE` to `1` for make it works on Wi-Fi.
This is mutually exclusive with `READ_MODE`.
- `USE_DISPLAY` to `1` if you use OLDE Display for the output.
- `USE_SERIAL` to `1` if you use serial output on Serial Monitor in Arduino IDE for debugging.
Usage
-----
Wth `WIFI_SERVER_MODE`, once it is loaded and running, you will see the IP address that is assigned to the NodeMCU.
Use such as `curl` to see the result.
```
curl -v 'http://$IP_ADDRESS/metrics'
```
Prometheus
----------
The output format from `/metrics` is for [Prometheus](https://prometheus.io/) scraping.
You can add a following scrape config in your `prometheus.yml` to scrape it.
```
scrape_configs:
- job_name: nodemcu_ks0196
static_configs:
- targets:
- $IP_ADDRESS:80
```
| 37.33913 | 232 | 0.74476 | eng_Latn | 0.945889 |
db598662c467827addb731a9819b16fe2915265d | 10,785 | md | Markdown | docs/1.2/app_developers_guide/intro_xo_transaction_family.md | hyperledger/sawtooth-website | 22755c7cd0d77049710a90cf8d1ce8a6ea76ad87 | [
"CC-BY-4.0",
"MIT"
] | 3 | 2018-08-22T17:45:53.000Z | 2018-11-25T07:08:16.000Z | docs/1.2/app_developers_guide/intro_xo_transaction_family.md | hyperledger/sawtooth-website | 22755c7cd0d77049710a90cf8d1ce8a6ea76ad87 | [
"CC-BY-4.0",
"MIT"
] | 19 | 2018-08-22T19:08:05.000Z | 2020-09-22T15:38:34.000Z | docs/1.2/app_developers_guide/intro_xo_transaction_family.md | hyperledger/sawtooth-website | 22755c7cd0d77049710a90cf8d1ce8a6ea76ad87 | [
"CC-BY-4.0",
"MIT"
] | 30 | 2018-03-16T23:16:35.000Z | 2020-10-03T23:14:01.000Z | # Playing with the XO Transaction Family
XO is an example transaction family that implements the game
[tic-tac-toe](https://en.wikipedia.org/wiki/Tic-tac-toe), also known as
*Noughts and Crosses* or *X\'s and O\'s*. We chose XO as an example
transaction family for Sawtooth because of its simplicity, global player
base, and straightforward implementation as a computer program. This
transaction family demonstrates the functionality of Sawtooth; in
addition, the code that implements it serves as a reference for building
other transaction processors.
This section introduces the concepts of a Sawtooth transaction family
with XO, summarizes XO game rules, and describes how use the `xo` client
application to play a game of tic-tac-toe on the blockchain.
## About the XO Transaction Family
<!--
Licensed under Creative Commons Attribution 4.0 International License
https://creativecommons.org/licenses/by/4.0/
-->
The XO transaction family defines the data model and business logic for
playing tic-tac-toe on the blockchain by submitting transactions for
[create]{.title-ref}, [take]{.title-ref}, and [delete]{.title-ref}
actions. For more information, see [XO Transaction
Family]({% link docs/1.2/transaction_family_specifications/xo_transaction_family.md%})
The XO transaction family includes:
> - Transaction processors in several languages, including Go
> (`xo-tp-go`),
> [JavaScript](https://github.com/hyperledger/sawtooth-sdk-javascript/blob/master/examples/xo/),
> and Python (`xo-tp-python`). These transaction processors
> implement the business logic of XO game play.
> - An `xo` client: A set of commands that provide a command-line
> interface for playing XO. The `xo` client handles the construction
> and submission of transactions. For more information, see [XO
> CLI]({% link docs/1.2/cli/xo.md%})
## Game Rules
In tic-tac-toe, two players take turns marking spaces on a 3x3 grid.
- The first player (player 1) marks spaces with an X. Player 1 always
makes the first move.
- The second player (player 2) marks spaces with an O.
- A player wins the game by marking three adjoining spaces in a
horizontal, vertical, or diagonal row.
- The game is a tie if all nine spaces on the grid have been marked,
but no player has won.
See [Wikipedia](https://en.wikipedia.org/wiki/Tic-tac-toe) for more
information on playing tic-tac-toe. For the detailed business logic of
game play, see \"Execution\" in [XO Transaction
Family]({% link docs/1.2/transaction_family_specifications/xo_transaction_family.md%})
## Playing XO with the xo Client
This procedure introduces you to the XO transaction family by playing a
game with the `xo` client. Each `xo` command is a transaction that the
client submits to the validator via the REST API.
### Prerequisites
- A working Sawtooth node, as described in [Installing
Sawtooth]({% link docs/1.2/app_developers_guide/installing_sawtooth.md%})
This node must be running a validator, a REST API, a
consensus engine, and the Settings transaction processor. (The
IntegerKey transaction processor is not used in this procedure.)
- This procedure also requires the XO transaction processor. The
Docker and Kubernetes procedures start it automatically. For Ubuntu,
this procedure shows how to start the XO transaction processor if
necessary.
### Step 1: Connect to the Sawtooth Node
To connect to the Sawtooth node, use the steps for your platform:
- Docker: See [Log Into the Docker Client
Container]({% link docs/1.2/app_developers_guide/installing_sawtooth.md%}#log-into-client-container-docker)
- Kubernetes: See [Connect to the Kubernetes Shell
Container]({% link docs/1.2/app_developers_guide/installing_sawtooth.md%}#connect-to-shell-container-k8s)
- Ubuntu: Open a client terminal window on the host system running
Sawtooth
### Step 2: Confirm Connectivity to the REST API
Verify that you can connect to the REST API. The step will help
determine if The REST API is at the default location
(`http://localhost:8008`).
The `xo` client sends requests to update and query the blockchain to the
URL of the REST API (by default, `http://127.0.0.1:8008`). If the REST
API\'s URL is not `http://127.0.0.1:8008`, you must add the `--url`
argument to each `xo` command in this procedure.
- Docker: See [Confirm Connectivity to the REST API]({% link docs/1.2/app_developers_guide/installing_sawtooth.md%}#confirming-connectivity-docker-label)
> Important
>
>
> In the Docker environment, the REST API is at
> `http://rest-api:8008`. You must add `--url http://rest-api:8008` to
> all `xo` commands in this procedure. For example:
>
> ``` console
> $ xo create my-game --username jack --url http://rest-api:8008
> ```
- Kubernetes: See [Confirm Connectivity to the REST API (for
Kubernetes)]({% link docs/1.2/app_developers_guide/installing_sawtooth.md %}#confirming-connectivity-k8s-label)
- Ubuntu: See [Use Sawtooth Commands as a
Client]({% link docs/1.2/app_developers_guide/installing_sawtooth.md%}#step-12-use-sawtooth-commands-as-a-client)
### Step 3. Ubuntu only: Start the XO Transaction Processor
For Ubuntu: If the XO transaction processor is not running on your
Sawtooth node, start it now.
1. Open a new terminal window (the xo window).
2. Check whether the XO transaction processor is running.
``` console
user@xo$ ps aux | grep [x]o-tp
root 1546 0.0 0.1 52700 3776 pts/2 S+ 19:15 0:00 sudo -u sawtooth xo-tp-python -v
sawtooth 1547 0.0 1.5 277784 31192 pts/2 Sl+ 19:15 0:00 /usr/bin/python3 /usr/bin/xo-tp-python -v
```
3. If the output does not show that `/usr/bin/xo-tp-python` is running,
start the XO transaction processor with the following command:
``` console
user@xo$ sudo -u sawtooth xo-tp-python -v
```
For more information, see [Start the Transaction
Processors]({% link docs/1.2/app_developers_guide/installing_sawtooth.md %}#start-tps-label)
### Step 4. Create Players
Create keys for two players to play the game:
``` console
$ sawtooth keygen jack
writing file: /home/ubuntu/.sawtooth/keys/jack.priv
writing file: /home/ubuntu/.sawtooth/keys/jack.addr
$ sawtooth keygen jill
writing file: /home/ubuntu/.sawtooth/keys/jill.priv
writing file: /home/ubuntu/.sawtooth/keys/jill.addr
```
> Note
>
> The output may differ slightly from this example.
### Step 5. Create a Game
Create a game named `my-game` with the following command:
``` console
$ xo create my-game --username jack
```
> Note
>
> The `--username` argument is required for `xo create` and `xo take` so
> that a single player (you) can play as two players. By default,
> `<username>` is the Linux user name of the person playing the game.
Verify that the `create` transaction was committed by displaying the
list of existing games:
``` console
$ xo list
GAME PLAYER 1 PLAYER 2 BOARD STATE
my-game --------- P1-NEXT
```
> Note
>
>
> The `xo list` command is a wrapper that provides a quick way to show
> game state rather than using `curl` with the REST API\'s URL to request
> state.
### Step 6. Take a Space as Player 1
> Note
>
> The first player to issue an `xo take` command to a newly created game
> is recorded as `PLAYER 1` . The second player to issue a `take` command
> is recorded by username as `PLAYER 2`.
>
> The `--username` argument determines where the `xo` client should look
> for the player\'s key to sign the transaction. By default, if you\'re
> logged in as `root`, `xo` would look for the key file named
> `~/.sawtooth/keys/root.priv`. Instead, the following command specifies
> that `xo` should use the key file `~/.sawtooth/keys/jack.priv`.
>
Start playing tic-tac-toe by taking a space as the first player, Jack.
In this example, Jack takes space 5:
``` console
$ xo take my-game 5 --username jack
```
This diagram shows the number of each space.
``` console
1 | 2 | 3
---|---|---
4 | 5 | 6
---|---|---
7 | 8 | 9
```
**What Happens During a Game Move?**
Each `xo` command is a transaction. A successful transaction updates
global state with the game name, board state, game state, and player
keys, using this format:
``` none
<game-name>,<board-state>,<game-state>,<player1-key>,<player2-key>
```
Each time a player attempts to take a space, the transaction processor
will verify that their username matches the name of the player whose
turn it is. This ensures that no player is able to mark a space out of
turn.
After each turn, the XO transaction processor scans the board state for
a win or tie. If either condition occurs, no more `take` actions are
allowed on the finished game.
### Step 7. Take a Space as Player 2
Next, take a space on the board as player 2, Jill. In this example, Jill
takes space 1:
``` console
$ xo take my-game 1 --username jill
```
### Step 8. Show the Current Game Board
Whenever you want to see the current state of the game board, enter the
following command:
``` console
$ xo show my-game
```
The output includes the game name, the first six characters of each
player\'s public key, the game state, and the current board state. This
example shows the game state `P1-NEXT` (player 1 has the next turn) and
a board with Jack\'s X in space 5 and Jill\'s O in space 1.
``` console
GAME: : my-game
PLAYER 1 : 02403a
PLAYER 2 : 03729b
STATE : P1-NEXT
O | |
---|---|---
| X |
---|---|---
| |
```
This `xo` client formats the global state data so that it\'s easier to
read than the state returned to the transaction processor:
``` none
my-game,O---X----,P1-NEXT,02403a...,03729b...
```
### Step 9. Continue the Game
Players take turns using `xo take my-game <space>` to mark spaces on the
grid.
You can continue the game until one of the players wins or the game ends
in a tie, as in this example:
``` console
$ xo show my-game
GAME: : my-game
PLAYER 1 : 02403a
PLAYER 2 : 03729b
STATE : TIE
O | X | O
---|---|---
X | X | O
---|---|---
X | O | X
```
### Step 10. Delete the Game
Either player can use the `xo delete` command to remove the game data
from global state.
``` console
$ xo delete my-game
```
## Using Authentication with the xo Client
The XO client supports optional authentication. If the REST API is
connected to an authentication proxy, you can point the XO client at it
with the `--url` argument. You must also specify your authentication
information using the `--auth-user [user]` and
`--auth-password [password]` options for each `xo` command.
Note that the value of the `--auth-user` argument is **not** the same
username that is entered with the `--username` argument.
| 32.981651 | 155 | 0.714325 | eng_Latn | 0.990851 |
db5a9733b8f367713b371cf6b8a80499d383c10a | 61 | md | Markdown | UbiquitousLanguage/UbiquitousLanguage.md | SunnnyChan/KS-DDD | 50450e3db97aba64e14ed7d561c4b75e4d3f47e3 | [
"Apache-2.0"
] | 3 | 2020-05-16T22:45:05.000Z | 2021-02-22T02:30:23.000Z | UbiquitousLanguage/UbiquitousLanguage.md | SunnnyChan/KS-DDD | 50450e3db97aba64e14ed7d561c4b75e4d3f47e3 | [
"Apache-2.0"
] | null | null | null | UbiquitousLanguage/UbiquitousLanguage.md | SunnnyChan/KS-DDD | 50450e3db97aba64e14ed7d561c4b75e4d3f47e3 | [
"Apache-2.0"
] | 4 | 2020-07-01T05:05:01.000Z | 2021-05-08T06:05:54.000Z | # 通用语言(Ubiquitous Language)
需要建立一种通用语言,作为开发人员和领域专家的沟通桥梁。
| 12.2 | 30 | 0.786885 | yue_Hant | 0.561754 |
db5abfc67670495744cbf162ff4c0f8cc9be6bc3 | 979 | md | Markdown | docs/source/getting_started.md | amcgail/knowknow | 6f7a18a5784527738ade1a1bbf49fe8883c08fa1 | [
"MIT"
] | 5 | 2020-06-17T02:11:45.000Z | 2021-08-04T18:56:55.000Z | docs/source/getting_started.md | amcgail/knowknow | 6f7a18a5784527738ade1a1bbf49fe8883c08fa1 | [
"MIT"
] | 3 | 2021-01-11T19:57:27.000Z | 2022-03-12T00:48:27.000Z | docs/source/getting_started.md | amcgail/knowknow | 6f7a18a5784527738ade1a1bbf49fe8883c08fa1 | [
"MIT"
] | 2 | 2020-06-17T02:06:57.000Z | 2020-07-01T16:03:11.000Z | # Get started
The easiest way to learn how to use knowknow is to try things out yourself. As
you read through this guide, test each method.
## Prerequisites
Before you get started, you're going to need a few things:
- Your favorite IDE or text editor
- [Python 3.6 or later](https://www.python.org/downloads/)
- [PIP](https://pip.pypa.io/en/stable/installing/)
If you haven't already, take a few minutes to read through [Main
concepts](main_concepts.md)
## Set up your virtual environment
Regardless of which package management tool you're using, we recommend running
these commands in a virtual environment. This ensures that the dependencies
pulled in for Streamlit don't impact any other Python projects
you're working on.
- [pipenv](https://pipenv.pypa.io/en/latest/)
- [poetry](https://python-poetry.org/)
- [venv](https://docs.python.org/3/library/venv.html)
- [virtualenv](https://virtualenv.pypa.io/en/latest/)
- [conda](https://www.anaconda.com/distribution/)
| 32.633333 | 78 | 0.751788 | eng_Latn | 0.972439 |
db5b0a219be1c4032908deea208fb5af77909bb2 | 2,630 | md | Markdown | README.md | Gronan/docker-compose-skeleton | 9721a9b9cda225038c136fd20894eab1354b38c1 | [
"Apache-2.0"
] | 2 | 2017-02-20T08:21:53.000Z | 2017-02-20T10:34:31.000Z | README.md | Gronan/docker-compose-skeleton | 9721a9b9cda225038c136fd20894eab1354b38c1 | [
"Apache-2.0"
] | null | null | null | README.md | Gronan/docker-compose-skeleton | 9721a9b9cda225038c136fd20894eab1354b38c1 | [
"Apache-2.0"
] | 2 | 2020-02-09T17:49:46.000Z | 2022-03-24T03:50:04.000Z | # docker-compose-skeleton
Ready to use docker-compose stack with php7 (php7-fpm), nginx and postgresql optimised for Symfony3 applications
(with ELK & Redis)
##Disclaimer
1. Nginx conf & docker-compose.yml assure your project is located in */var/www/* (if not make sure to change the .yml & .conf files)
2. Redis & ELK are optional
##Step by step configuration
###Step 1
make sure [docker](https://docs.docker.com/engine/installation/) and [docker-compose](https://docs.docker.com/compose/install/) are installed
###Step 2
1. Replace every occurence of **_{PROJECT_NAME}_** by the name of you project
2. Rename **_.conf/.site-conf/{PROJECT_NAME}.conf_** to the desired configuration name
3. Replace **_{PROJECT_URL}_** by the desired url of your project.
4. Edit **_DB_USER_**, **_DB_PASS_**, **_DB_NAME_** in **_.conf/.env/db.env_**
##Step 3
update your hosts file with the new url
```bash
sudo echo 127.0.0.1 {PROJECT_URL} www.{PROJECT_URL} >> /etc/hosts
```
###Step 4
Pull docker images
```bash
docker pull redis:alpine && docker pull willdurand/elk && docker pull php:7-fpm && docker pull nginx:latest && docker pull postgres:latest
```
###Step 5
go to /var/www/project_name & run docker-compose
```bash
docker-compose up -d
```
###Step 6
enjoy ! go to www.project_url (make sure your have something in the directory /var/www/{PROJECT_NAME}/web)
###Step 7 (optional)
Add your ip of your host (seen from your php-fpm container) in _web/config.php_ and _web/app_dev.php_ (mine was 172.18.0.1)
```php
if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
'127.0.0.1',
'172.18.0.1', //ip to add
'::1',
))) {
header('HTTP/1.0 403 Forbidden');
exit('This script is only accessible from localhost.');
}
```
If you don't know the ip to add :
```php
var_dump($_SERVER['REMOTE_ADDR']);
if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
```
###Useful commands
1. List all active containers
```bash
docker ps
```
2. List all the images available locally
```bash
docker images
```
3. Open bash in the given docker container (use docker ps to see docker id):
```bash
docker exec -it {docker_id} bash
```
4. Clear cache symfony :
```bash
docker exec -it $(docker ps -f name=php -q) php /var/www/{PROJECT_NAME}/bin/console cache:clear
```
4. Use psql in postgresql container :
```bash
docker exec -it $(docker ps -f name=postgre -q) psql -U postgres
```
##Todo
1. Test db container
2. Use php7-fpm docker images with recommended extensions and Xdebug
##Special thanks
User [Thomas Letellier](https://github.com/ltrtom) for help & support
User [Ronan Guilloux](https://github.com/ronanguilloux) for inspiration
| 28.901099 | 142 | 0.707605 | eng_Latn | 0.727536 |
db5b40e21275e849199de7e3e8d0e760a264f195 | 578 | md | Markdown | .References/src/github.com/mortea15/DAT234_MandatoryBashScripting/MandatoryBashScripting/README.md | roscopecoltran/SniperKit-Core | 4600dffe1cddff438b948b6c22f586d052971e04 | [
"MIT"
] | null | null | null | .References/src/github.com/mortea15/DAT234_MandatoryBashScripting/MandatoryBashScripting/README.md | roscopecoltran/SniperKit-Core | 4600dffe1cddff438b948b6c22f586d052971e04 | [
"MIT"
] | null | null | null | .References/src/github.com/mortea15/DAT234_MandatoryBashScripting/MandatoryBashScripting/README.md | roscopecoltran/SniperKit-Core | 4600dffe1cddff438b948b6c22f586d052971e04 | [
"MIT"
] | null | null | null | # DAT234
This repository contains the files for the course DAT234, Hacking & Scripting
The file(s) for each task are separated into their respective folders.
To run the scripts, enter their folder and type e.g. `./task4.bash`
The solutions I've made for Task 4 and Task 5 include one script using fping to ping the hosts, and one using nmap to achieve the same goal.
All files in the task4 and task5 folders can be run either directly with `./task4.bash` (or `./task4nmap.bash`) or by giving the input upon running the script by typing `echo "192.168.56.1" | ./task4.bash`
| 48.166667 | 205 | 0.756055 | eng_Latn | 0.999421 |
db5bd1a5d44118664cf73663af271eee5d43fd3f | 11,440 | md | Markdown | docs/ru/docs/about/releases/19.1.1.md | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | docs/ru/docs/about/releases/19.1.1.md | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | docs/ru/docs/about/releases/19.1.1.md | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # NOC 19.1.1
In accordance to our [Release Policy](policy.md)
[we're](https://getnoc.com/devteam/) continuing support of generation of
19.1 releases. NOC [19.1.1](https://code.getnoc.com/noc/noc/tags/19.1.1)
collects 114 bugfixes, optimization and improvements, while fully
preserves 19.1 API.
## Migration
Migration from 19.1 release is straightforward. Just deploy `19.1.1`
or `stable-19.1` tags from Tower.
## Bugfixes
| MR | Title |
| -------------- | ------------------------------------------------------------------------- |
| {{ mr(1560) }} | fm-alarm i18n |
| {{ mr(1561) }} | Add tags field to managedobject BI extractor. |
| {{ mr(1563) }} | Add 40G interfaces support to Cisco.IOS profile |
| {{ mr(1565) }} | Fix DCN.DCWL.get_interfaces. |
| {{ mr(1567) }} | Fix DCN.DCWL.get_interfaces typo. |
| {{ mr(1572) }} | Fix Qtech.QSW profile for lldp |
| {{ mr(1578) }} | Fix Siklu.EH.get_lldp_neighbors. |
| {{ mr(1579) }} | Add pattern_unprivileged_prompt to Iskratel.MSAN. |
| {{ mr(1580) }} | Fix Control translation. |
| {{ mr(1581) }} | fm-alarm save filters in local store |
| {{ mr(1584) }} | Set enable datasource default settings to False. |
| {{ mr(1589) }} | Fix Extreme.XOS.get_lldp_neighbors script |
| {{ mr(1590) }} | Report control initial commit |
| {{ mr(1593) }} | Move FM reportalarmdetail application to ControlReport. |
| {{ mr(1595) }} | Add Interface Errors BIP metric to Huawei.MA5600T. |
| {{ mr(1599) }} | Fix detect snmp v1 for profile check rule. |
| {{ mr(1600) }} | #1006 Fix wipe user |
| {{ mr(1602) }} | Fix Alcatel.AOS.get_switchport script |
| {{ mr(1607) }} | Fix syslog CH Model message field description. |
| {{ mr(1616) }} | Fix Raisecom.ROS.get_interfaces trace. |
| {{ mr(1618) }} | Add metrics to selfmon fm collector. |
| {{ mr(1620) }} | Fix Huawei.MA5600T.get_interfaces get vlans. |
| {{ mr(1621) }} | Move isInMaintenance field on fm.alarm to bulk. |
| {{ mr(1622) }} | Add hasAny and hasAll function to BI query language. |
| {{ mr(1628) }} | fm.alarm: view recent alarms fixed |
| {{ mr(1629) }} | use ExtJS .endsWith for IE compatibility |
| {{ mr(1631) }} | combotree: reset pageSize limit |
| {{ mr(1633) }} | Some fixes for Huawei.MA5600T profile. |
| {{ mr(1640) }} | Fix for Oob and Stack-port interfaces |
| {{ mr(1646) }} | Fix discovery cpe |
| {{ mr(1650) }} | Change replace character for Grafana PM Dashboard |
| {{ mr(1651) }} | #990 grid.column, override formatter to ‘htmlEncode’ |
| {{ mr(1653) }} | Add fix_cpe_header function to Huawei.MA5600T profile. |
| {{ mr(1672) }} | Add “port id subtype” to Huawei.VRP.get_lldp_neighbors. |
| {{ mr(1673) }} | Add “port id subtype” to Huawei.VRP.get_lldp_neighbors. |
| {{ mr(1674) }} | Add more models to Eltex.MES profile |
| {{ mr(1675) }} | NetworkSegment.get_nested_ids: Rewrite to fix out-of-memory condition |
| {{ mr(1676) }} | Update SKS.SKS profile |
| {{ mr(1678) }} | parse_table: Mixed tabs/space processing |
| {{ mr(1679) }} | Huawei ma5600t |
| {{ mr(1690) }} | Fix DCN.DCWL.get_metrics scale and type Interface metrics. |
| {{ mr(1699) }} | Add capabilities to script matchers. |
| {{ mr(1701) }} | Fix Raisecom.ROS.get_inventory trace when Unknown SFP. |
| {{ mr(1703) }} | Fix Siklu.EH.get_lldp_neighbors empty section trace. |
| {{ mr(1707) }} | Catch RPC Error on STP discovery. |
| {{ mr(1708) }} | grid.column, override formatter fix |
| {{ mr(1709) }} | BER: Opaque/float/double type decoders |
| {{ mr(1710) }} | fix juniper.junos metric Subscribers (for version >16) and Temperature |
| {{ mr(1713) }} | Fix Rotek RTBSv1 profile |
| {{ mr(1714) }} | Add patch attribute to Huawei.VRP.get_version. |
| {{ mr(1715) }} | Fix Raisecom.ROS.get_interfaces script |
| {{ mr(1717) }} | Add group by slot to “Memory Usage” and “CPU Usage” graph |
| {{ mr(1719) }} | Fix CPU, Memory, Temperature metrics for Huawei.VRP |
| {{ mr(1720) }} | Merge branch ‘junos_caps’ into ‘master’ |
| {{ mr(1724) }} | juniper.junos metric Subscribers without caps |
| {{ mr(1725) }} | Add initial support for ZTE.ZXA10 profile |
| {{ mr(1727) }} | Fix Cisco.IOSXR.get_inventory script |
| {{ mr(1729) }} | juniper.junos metric Subscribers without caps |
| {{ mr(1730) }} | Fix stupid copy/paste error |
| {{ mr(1732) }} | Alstec.24xx.get_metrics fix trace when no controller module. |
| {{ mr(1736) }} | Fix threshold profile for SLA metrics migration. |
| {{ mr(1739) }} | Fix matchers when check string in iter. |
| {{ mr(1740) }} | Fix threshold profile for SLA metrics migration. |
| {{ mr(1744) }} | Add ack_ts, ack_user field to Alarms BI model |
| {{ mr(1746) }} | Update ZTE.ZXA10 profile |
| {{ mr(1748) }} | #939 Fix Huawei.VPR profile system patter_prompt |
| {{ mr(1764) }} | Add state decorator to ip.vrf API. |
| {{ mr(1765) }} | #973 Fix managed_object two in card path exception. |
| {{ mr(1766) }} | Fix chwriter channels_active metric trace. |
| {{ mr(1768) }} | Add ManagedObjectAttribute to card template. |
| {{ mr(1769) }} | Patch 1 |
| {{ mr(1772) }} | #977 Fix collect SLA metrics in Cisco.IOS.get_metrics. |
| {{ mr(1773) }} | Fix Cisco.IOS.get_interfaces script |
| {{ mr(1777) }} | Fix Interfaces status ex for physical interfaces |
| {{ mr(1778) }} | fix_YAMLLoad_safe_load |
| {{ mr(1785) }} | Add datastream meta field to ensure-indexes command. |
| {{ mr(1786) }} | Fix Qtech.QSW profile for lldp |
| {{ mr(1798) }} | release-19.1: Update .flake8 |
| {{ mr(1804) }} | Fix metrics in card |
| {{ mr(1816) }} | Fix Cisco.NXOS.get_inventory script |
| {{ mr(1827) }} | Eltex.MES: MES-2324B/MES-2348B platforms |
| {{ mr(1843) }} | Fix Hiawei.MA5300. Disable session use. |
| {{ mr(1845) }} | Add interval to PM scale function. |
| {{ mr(1846) }} | Fix Eltex.MES.get_spanning_tree script |
| {{ mr(1848) }} | Fix Eltex.MES5448.get_version script |
| {{ mr(1854) }} | Fix Qtech.QSW2500 script |
| {{ mr(1862) }} | Fix ManagedObject card not shows interfaces without metrics. |
| {{ mr(1863) }} | Fix ManagedObject card not shows interfaces without metrics. |
| {{ mr(1866) }} | Fix ch-policy dot name on command. |
| {{ mr(1886) }} | Fix row_limit in web app. |
| {{ mr(1900) }} | Fix MikroTik.RouterOS profile |
| {{ mr(1912) }} | External Storage: Check directory is not exists before creation |
| {{ mr(1917) }} | Fix SKS.SKS convert_interface_name() function |
| {{ mr(1932) }} | Deny move cpestatus to anothet managed_object when it inactive |
| {{ mr(1933) }} | Clean etl mapping key when load. |
| {{ mr(1934) }} | Catch SNMP Error when Huawei.VRP SNMP worked. |
| {{ mr(1937) }} | Add Patch Version column and autowidth option to Object Detail Repport. |
| {{ mr(1941) }} | Add support for SWA-2200-16P-AC device |
| {{ mr(1944) }} | Fix CPEStatus discovery when calculate diff for new cpe. |
| {{ mr(1945) }} | Fix Huawei.VRP.get_switchport script |
| {{ mr(1947) }} | Fix Alstec.24xx.get_interfaces script |
| {{ mr(1948) }} | Fix Orion.NOS profile |
| {{ mr(1951) }} | Fix Huawei.VRP.get_capabilities snmp check when get. |
| {{ mr(1953) }} | Fix Nateks.FlexGain.get_interfaces script |
| {{ mr(1956) }} | Some fixes in Generic snmp scripts. |
| {{ mr(1957) }} | Fix Cisco.ASA parse config |
| {{ mr(1963) }} | Fix Iskratel.ESCOM.get_spanning_tree script |
| {{ mr(1988) }} | Fix Qtech.QSW2800.get_inventory datetime import. |
| {{ mr(1997) }} | Fix Eltex.RG.get_version script |
| {{ mr(1998) }} | Fix Eltex.DSLAM profile |
| {{ mr(1999) }} | Fix Qtech.QSW profile for lldp |
| {{ mr(2000) }} | #1041 Fix segment update_summary fix. |
| {{ mr(2002) }} | Fix reportdatasource backend. |
| {{ mr(2005) }} | #981 Fix Cisco.ASA pattern_username match to Last login message. |
| 86.666667 | 94 | 0.429808 | eng_Latn | 0.383306 |
db5cac80beb7bbe1b921c87564f540c18d1761bf | 9,106 | md | Markdown | source/apacheds/advanced-ug/8-operational-attributes.md | nhojpatrick/apache_directory-site | bcf33ac9035037757607fa47e2503f2190fe2bb0 | [
"Apache-2.0"
] | 4 | 2021-03-24T22:57:48.000Z | 2021-11-07T20:40:04.000Z | source/apacheds/advanced-ug/8-operational-attributes.md | nhojpatrick/apache_directory-site | bcf33ac9035037757607fa47e2503f2190fe2bb0 | [
"Apache-2.0"
] | 2 | 2020-11-29T10:36:04.000Z | 2021-02-28T14:55:26.000Z | source/apacheds/advanced-ug/8-operational-attributes.md | nhojpatrick/apache_directory-site | bcf33ac9035037757607fa47e2503f2190fe2bb0 | [
"Apache-2.0"
] | 5 | 2020-10-23T17:30:15.000Z | 2021-11-07T20:39:55.000Z | ---
title: 8 - Operational Attributes
navPrev: 7-embedding-apacheds.html
navPrevText: 7 - Embedding ApacheDS in Java
navUp: ../advanced-user-guide.html
navUpText: Advanced User Guide
---
# 8 - Operational Attributes
Operational attributes are attributes that are used internally by the server. They generally can't be modified by a user, although one can read them.
In order to retrieve an operational attribute, you have to require it explicitely, or request all of them using the special attribute '+'.
[RFC 4512](https://tools.ietf.org/html/rfc4512) defines four different flavors of **AttributeType** :
* userApplications : User's attributes
* directoryOperation : Server's attributes
* dSAOperation : Server's attributes that have no meant in being distributed
* distributedOperation : Server's attribute that are used in a distributed environment
ApacheDS support a list of standard LDAP operational attributes, plus a few that are specific. Here are the supported operational attributes.
## Global operational attributes
Those operational attributes are stored in the **RootDSE**, and global to the server. They can't be modified by a user.
| Attribute name | Type | Category | Description |
|---|---|---|---|
| vendorName | DSA OPERATION | Standard | RFC3045: name of implementation vendor |
| vendorVersion | DSA OPERATION | Standard | RFC3045: version of implementation |
| entryTtl | DSA OPERATION | Standard | RFC2589: entry time-to-live |
| dynamicSubtrees | DSA OPERATION | Standard | RFC2589: dynamic subtrees |
| supportedFeatures | DSA OPERATION | Standard | RFC3674: features supported by the server |
| supportedControl | DSA OPERATION | Standard | RFC2252: supported controls |
| supportedSASLMechanisms | DSA OPERATION | Standard | RFC2252: supported SASL mechanisms |
| supportedLDAPVersion | DSA OPERATION | Standard | RFC2252: supported LDAP versions |
| namingContexts | DSA OPERATION | Standard | RFC2252: naming contexts |
| altServer | DSA OPERATION | Standard | RFC2252: alternative servers |
| supportedExtension | DSA OPERATION | Standard | RFC2252: supported extended operations |
## Entry operational attributes
Those are attributes related to an entry, carrying some additional information about it
| Attribute name | Type | Category | Description |
|---|---|---|---|
| createTimestamp | DIRECTORY OPERATION | Standard | RFC2252: time which object was created |
| modifyTimestamp | DIRECTORY OPERATION | Standard | RFC2252: time which object was last modified |
| creatorsName | DIRECTORY OPERATION | Standard | RFC2252: name of creator |
| modifiersName | DIRECTORY OPERATION | Standard | RFC2252: name of last modifier |
| hasSubordinates | DIRECTORY OPERATION | Standard | X.501: entry has children |
| ref | DISTRIBUTED OPERATION | Standard | RFC3296: named reference - a labeledURI |
| entryUUID | DIRECTORY OPERATION | ApacheDS | UUID of the entry |
| entryDN | DIRECTORY OPERATION | ApacheDS | DN of the entry |
| entryCSN | DIRECTORY OPERATION | ApacheDS | Change sequence number of the entry |
| nbChildren | DIRECTORY OPERATION | ApacheDS | The number of children for this entry |
| nbSubordinates | DIRECTORY OPERATION | ApacheDS | The number of subordinates for this entry |
| entryParentId | DIRECTORY OPERATION | ApacheDS | Attribute holding the id of parent entry |
## Schema related operational attributes
Those operational attributes are containing the schema elements handled by the server. They are stored in the **RootDSE**
| Attribute name | Type | Category | Description |
|---|---|---|---|
| ldapSyntaxes | DIRECTORY OPERATION | Standard | RFC2252: LDAP syntaxes |
| subschemaSubentry | DIRECTORY OPERATION | Standard | RFC2252: name of controlling subschema entry |
| dITStructureRules | DIRECTORY OPERATION | Standard | RFC2252: DIT structure rules |
| dITContentRules | DIRECTORY OPERATION | Standard | RFC2252: DIT content rules |
| matchingRules | DIRECTORY OPERATION | Standard | RFC2252: matching rules |
| attributeTypes | DIRECTORY OPERATION | Standard | RFC2252: attribute types |
| objectClasses | DIRECTORY OPERATION | Standard | RFC2252: object classes |
| nameForms | DIRECTORY OPERATION | Standard | RFC2252: Name Forms |
| matchingRuleUse | DIRECTORY OPERATION | Standard | RFC2252: matching rule uses |
| structuralObjectClass | DIRECTORY OPERATION | Standard | X.500(93): structural object class of entry |
| comparators | DIRECTORY OPERATION | ApacheDS | A multivalued comparator description attribute |
| normalizers | DIRECTORY OPERATION | ApacheDS | A multivalued normalizer description attribute |
| syntaxCheckers | DIRECTORY OPERATION | ApacheDS | A multivalued syntaxCheckers description attribute |
| schemaModifyTimestamp | DIRECTORY OPERATION | ApacheDS | Time which schema was modified |
| schemaModifiersName | DIRECTORY OPERATION | ApacheDS | The DN of the modifier of the schema |
## Collective Attributes operational attributes
Those are attributes related to collective attributes.
| Attribute name | Type | Category | Description |
|---|---|---|---|
| collectiveAttributeSubentries | DIRECTORY OPERATION | Standard | RFC3671: identifies all collective attribute subentries that affect the entry |
| collectiveExclusions | DIRECTORY OPERATION | Standard | RFC3671: RFC3671: allows particular collective attributes to be excluded from an entry |
## Administrative Model Attributes
Those are attributes related to the Administrative Model management
| Attribute name | Type | Category | Description |
|---|---|---|---|
| administrativeRole | DIRECTORY OPERATION | Standard | RFC3672: indicate that the associated administrative area is concerned withone or more administrative roles |
| subtreeSpecification | DIRECTORY OPERATION | Standard | RFC3672: defines a collection of entries within an administrative area |
| prescriptiveACI | DIRECTORY OPERATION | ApacheDS | Access control information that applies to a set of entries |
| entryACI | DIRECTORY OPERATION | ApacheDS | Access control information that applies to a single entry |
| subentryACI | DIRECTORY OPERATION | ApacheDS | Access control information that applies to a single subentry |
| autonomousAreaSubentry | DIRECTORY OPERATION | ApacheDS | Used to track a subentry associated with an autonomousArea |
| accessControlSubentries | DIRECTORY OPERATION | ApacheDS | Used to track a subentry associated with access control areas |
## Replication related operational attributes
Those attributes are used in a replication context.
| Attribute name | Type | Category | Description |
|---|---|---|---|
| contextCSN | DIRECTORY OPERATION | ApacheDS | The largest committed CSN of a context |
| entryDeleted | DIRECTORY OPERATION | ApacheDS | Whether or not an entry has been deleted. (Not anymore used) |
## Index related operational attributes
Those operational attributes are used to define the various system predefined indexes
| Attribute name | Type | Category | Description |
|---|---|---|---|
| apachePresence | DSA OPERATION | ApacheDS | Index attribute used to track the existence of attributes |
| apacheOneLevel | DSA OPERATION | ApacheDS | Index attribute used to track one level searches |
| apacheOneAlias | DSA OPERATION | ApacheDS | Index attribute used to track single level aliases |
| apacheSubAlias | DSA OPERATION | ApacheDS | Index attribute used to track sub level aliases |
| apacheAlias | DSA OPERATION | ApacheDS | Index attribute used to track aliases |
| apacheSubLevel | DSA OPERATION | ApacheDS | Index attribute used to track sub level searches |
| apacheRdn | DSA OPERATION | ApacheDS | Index attribute RDN with values both user provided and normalized based on schema |
## Trigger interceptor Model Attributes
Those are attributes used in the Trigger Interceptor
| Attribute name | Type | Category | Description |
|---|---|---|---|
| prescriptiveTriggerSpecification | DIRECTORY OPERATION | ApacheDS | Trigger specification that applies to a set of entries |
| entryTriggerSpecification | DIRECTORY OPERATION | ApacheDS | Trigger specification that applies to a single entry |
| triggerExecutionSubentries | DIRECTORY OPERATION | ApacheDS | Used to track subentries associated with a trigger area which an entry falls under |
## ChangeLog related operational attributes
Those operational attributes are meant to be used by teh **ChangeLog** interceptor. They are not supposed to be distributed, and they can't be modified by a user.
| Attribute name | Type | Category | Description |
|---|---|---|---|
| revisions | DSA OPERATION | ApacheDS | Revision numbers used in change log |
| changeTime | DSA OPERATION | ApacheDS | Represents the time when the change event occurred |
| changeType | DSA OPERATION | ApacheDS | Type of change operation |
| eventId | DSA OPERATION | ApacheDS | The unique sequential id for the event (a.k.a revision number) |
| committer | DSA OPERATION | ApacheDS | The principal committing the change |
| changeLogContext | DSA OPERATION | ApacheDS | Tells about the changelog context suffix |
| 56.559006 | 166 | 0.760158 | eng_Latn | 0.845423 |
db5d2d5debf130d789ace02cf986f3a435670001 | 4,280 | md | Markdown | README.md | aap/pdp6 | 0ff621423425bfc33c826ad360fda287cba8086e | [
"MIT"
] | 46 | 2015-11-21T16:19:23.000Z | 2021-10-29T18:37:40.000Z | README.md | aap/pdp6 | 0ff621423425bfc33c826ad360fda287cba8086e | [
"MIT"
] | 22 | 2016-05-13T11:46:26.000Z | 2021-05-29T07:26:05.000Z | README.md | aap/pdp6 | 0ff621423425bfc33c826ad360fda287cba8086e | [
"MIT"
] | 6 | 2016-05-12T18:18:55.000Z | 2018-10-05T13:14:03.000Z | # PDP-6 Emulator and Verilog Simulation
This project aims to revive the PDP-6 (and later PDP-10)
computers by DEC.
I started by writing a very low level emulator in C based on
the schematics. Later I also wrote an accurate verilog simulation
that also works on an FPGA.
Both are driven by a virtual front panel but the plan is to create
a replica of the original panel.
The maintenance manual has flow charts, schematics and explanations:
[Volume1](http://bitsavers.trailing-edge.com/pdf/dec/pdp6/F-67_166instrManVol1_Sep65.pdf)
[Volume2](http://bitsavers.trailing-edge.com/pdf/dec/pdp6/F-67_166instrManVol2_Sep65.pdf)
![Screenshot of the front panel](https://raw.githubusercontent.com/aap/pdp6/master/art/screenshot.png)
## C Emulator
The code is more or less a transcription of the schematics into C.
This means you will not understand it unless you're familiar with the maintenance manual.
Pulses are represented as functions, when a pulse triggers another pulse
it does so by the `pulse` function which queues a pulse in a list
of pulses that are to happen, sorted chronologically.
Between pulses that happen at different times
various things are done like checking external pulses and advancing the
simulation state.
The timing is not yet 100% accurate but it's pretty close.
### Building
The supplied makefile assumes gcc (there are flags to silence some stupid warnings).
Otherwise you need SDL and pthread.
### Running
The cpu (apr), console tty, paper tape and punch,
the data control and DECtape are implemented.
340 display is also sort of working.
The panel is missing the repeat delay knobs,
but the functionality is implemented.
## Verilog Simulation
The verilog code is a very accurate transcription of the schematics as well.
Since the real machine is asynchronous I had to pull some tricks to make it
work on an FPGA.
The real machine uses delays that are triggered by pulses and output another
pulse after some time. Instead of pulses I use clock enables, and delays are
implemented by a counter synchronized to the 50MHz system clock.
### FPGA
I'm using a DE0-Nano-SoC with has an ARM hps connected to the Cyclone V FPGA.
On the ARM side runs fe6 (a DDT-like interface) which communicates with
the FPGA through memory mapped IO registers.
The quartus project is not yet part of this repo
but the important modules are in the verilog directory.
## File tree
NB: not up to date
```
emu the C emulator
emu/main_panel.c main file for emulator with panel simulation
emu/main_serial.c main file for emulator with panel over serial line
emu/emu.c top level emulator code
emu/cmd.c command line interface
emu/apr.c Arithmetic Processor 166 emulation
emu/mem.c core and fast memory emulation
emu/tty.c Teleprinter 626 emulator
emu/pt.c Paper tape reader 760 and punch 761 emulation
emu/dc.c Data Control 136 emulation
emu/dt.c DECtape 551 and 555 emulation
emu/netmem.c network protocol for shared memory
emu/util.c various utility functions
emu/util.h
emu/test_*.c test code, not too important anymore
emu/pdp6.h main header
emu/args.h argument parsing
emu/elements.inc panel definition
emu/cmds.txt command line interface documentation
emu/init.ini emulator init file
emu/mem_* core memory backing store
tools
tools/dtr2dta.c convert between raw (dtr) and simh (dta) DECtape format
tools/mkpty.c make a pty and connect to the controlling tty
tools/mkpty33.c as above but try to pretend an ASR33
tools/as6.c an assembler, roughly modeled on MACRO
tools/ld6.c a loader or relocatable files
tools/pdp6bin.h
tools/pdp6common.c useful functions for PDP-6 code
tools/pdp6common.h
tools/rel.c I have no recollection of this code
tools/reltest.c old test code to create a REL file
tools/test.s old test code for the assembler/linker
tools/test2.s
tools/ptdump.c print a paper tape file in octal
tools/dtdump.c print dtr DECtape
verilog
verilog/... fpga stuff
code random code for the PDP-6, mostly testing
code/bootstrap.txt a list of boot loaders
code/dtboot.s loads the first block from a DECtape
code/main.s random entry
code/tty.s tty character IO
panel stand alone panel with lots of duplicate code
art image files for the panel
misc nothing important
```
## To do
- repeat and maint. switches on panel
- improve timing
- do more tests
- ...
| 34.24 | 102 | 0.792056 | eng_Latn | 0.9928 |
db5d6efe5e3595c29273455a69521d6d19005b70 | 1,397 | md | Markdown | istio/istio-snippets.md | fosdickio/til | a2110d37d97b0d5db9e9b9a68c841b7ec9126860 | [
"MIT"
] | 1 | 2021-07-12T11:38:08.000Z | 2021-07-12T11:38:08.000Z | istio/istio-snippets.md | fosdickio/til | a2110d37d97b0d5db9e9b9a68c841b7ec9126860 | [
"MIT"
] | null | null | null | istio/istio-snippets.md | fosdickio/til | a2110d37d97b0d5db9e9b9a68c841b7ec9126860 | [
"MIT"
] | 1 | 2021-06-26T19:02:53.000Z | 2021-06-26T19:02:53.000Z | # Istio Snippets
## Deployment
Create a namespace where the application would be deployed:
```sh
$ kubectl create namespace my-test-app
```
Enable automatic sidecar injection for the namespace:
```sh
$ kubectl label namespace my-test-app istio-injection=enabled
```
Deploy the application in the namespace created above:
```sh
$ kubectl apply -n my-test-app -f my-test-app-manifests.yaml
```
Ensure that all the pods are in the running state and have the sidecar proxy injected:
```sh
$ kubectl -n my-test-app get pods
```
Verify that the `STATUS` column of all the pods is `Running`. You should also verify that the `READY` column shows `2/2` to indicate that 2 containers are running in every pod; one for the application workload and another for the injected sidecar proxy.
Note that it might take up to a few minutes for all the pods to be in running state, so wait before proceeding to the next verification step.
You can verify that the correct versions of all components (control and data plane) are running in your cluster by using the `istioctl` version command. For example, if version 1.9.1 was installed, you should see the following output:
```sh
$ istioctl version
client version: 1.9.1
control plane version: 1.9.1
data plane version: 1.9.1 (13 proxies)
```
Verify that Istio is installed correctly and all the checks are passing:
```sh
$ istioctl verify-install
```
| 29.723404 | 253 | 0.757337 | eng_Latn | 0.999396 |
db5e08667a89388e4485c5d437dba98f9a24c75d | 977 | md | Markdown | docs/component/actionSheet.md | doyoe/Yo | 0c4c298fa2f4c107b96fb2e3db7358a084176098 | [
"CC-BY-4.0",
"MIT"
] | 387 | 2015-01-16T17:16:33.000Z | 2022-03-23T05:00:55.000Z | docs/component/actionSheet.md | doyoe/Yo | 0c4c298fa2f4c107b96fb2e3db7358a084176098 | [
"CC-BY-4.0",
"MIT"
] | 34 | 2015-01-28T12:32:33.000Z | 2018-06-03T07:37:55.000Z | docs/component/actionSheet.md | doyoe/Yo | 0c4c298fa2f4c107b96fb2e3db7358a084176098 | [
"CC-BY-4.0",
"MIT"
] | 145 | 2015-01-15T02:38:18.000Z | 2021-08-04T10:20:41.000Z | #### 引用方式
```
import { ActionSheet } from '$yo-component';
// 如果你的项目中未使用最新的 ykit-config-yo 插件,可能无法使用上面这个语法糖
// 你仍然可以通过下面这种方式来引用
import ActionSheet from 'yo3/component/actionsheet';
```
#### 基本用法
`ActionSheet` 接收一个`option`对象作为参数。
其中`menu`属性负责控制ActionSheet的菜单项,它是一个对象数组,每个元素有两个属性`text`和`onTap`,分别用来控制菜单项的文字和点击回调。
需要注意的是,点击菜单之后,组件会自动关闭,这与iOS系统的ActionSheet API是一致的。
```
ActionSheet({
menu:[
{ text: '存储图像', onTap() { console.log('save.'); } },
{ text: '拷贝', onTap() { console.log('copy'); } }
]
});
```
#### 显示标题
通过`title`参数配置组件菜单顶部的标题文字,默认无标题:
```
ActionSheet({
menu:[
{ text: '存储图像', onTap() { console.log('save.'); } },
{ text: '拷贝', onTap() { console.log('copy'); } }
],
title: '保存图片?'
});
```
#### 取消文字
通过`cancelText`参数配置"取消"菜单的文字:
```
const menu = [
{ text: 'save', onTap() { console.log('save.'); } },
{ text: 'copy', onTap() { console.log('copy'); } }
];
ActionSheet({menu, cancelText: 'cancel'});
``` | 19.156863 | 81 | 0.591607 | yue_Hant | 0.666699 |
db5f3ec8fc9bc0d83ebc6e5486a3707b55cf9ee4 | 465 | md | Markdown | README.md | KamenSentai/template | aa784fc53b24bc9996607643d6c96fc29b3468b2 | [
"MIT"
] | null | null | null | README.md | KamenSentai/template | aa784fc53b24bc9996607643d6c96fc29b3468b2 | [
"MIT"
] | null | null | null | README.md | KamenSentai/template | aa784fc53b24bc9996607643d6c96fc29b3468b2 | [
"MIT"
] | null | null | null | # Template front-end starter pack
## Description
- Template front-end starter pack using Gulp modules
## Features
- Live reload with BrowserSync
- Compile Pug files to HTML
- Compile Stylus files to CSS
- Transpile ES6 JavaScript
## Setup
- Install modules
```
npm install
```
- Run Gulp
```
gulp
```
## Repository
- [GitHub](https://github.com/KamenSentai/Front-end_Template)
## Credits
- Author : [Alain Cao Van Truong](https://github.com/KamenSentai)
| 14.090909 | 65 | 0.716129 | yue_Hant | 0.416509 |
db5fcf140c3cc9083e219b07e21506e3cb58a80c | 543 | md | Markdown | README.md | danielfsousa/algorithms-solutions | 038c0c0bf6d89ffb1ecea596e7d4bb9bd4154ff1 | [
"MIT"
] | 1 | 2020-03-17T23:54:32.000Z | 2020-03-17T23:54:32.000Z | README.md | danielfsousa/algorithms-solutions | 038c0c0bf6d89ffb1ecea596e7d4bb9bd4154ff1 | [
"MIT"
] | null | null | null | README.md | danielfsousa/algorithms-solutions | 038c0c0bf6d89ffb1ecea596e7d4bb9bd4154ff1 | [
"MIT"
] | null | null | null | # algorithms-solutions
📚 My solutions to algorithms courses and online programming platforms
- [LeetCode](https://leetcode.com)
- [LintCode](https://lintcode.com)
- [HackerRank](https://hackerrank.com)
- [Cracking the Coding Interview](http://www.crackingthecodinginterview.com)
- [Grokking Algorithms](https://www.manning.com/books/grokking-algorithms)
- [Princeton University: Algorithms, Part 1](https://www.coursera.org/learn/algorithms-part1)
- [Princeton University: Algorithms, Part 2](https://www.coursera.org/learn/algorithms-part2)
| 49.363636 | 93 | 0.775322 | yue_Hant | 0.68439 |
db5fd9d81e0eff5c2685a1ed88151d19f0cc9aac | 1,091 | md | Markdown | doxygen/documentation/module_vehicle/wheeled_vehicle.md | Benatti1991/chrono | d927a7fae8ed2f4e6695cacaef28c605fcd9ffaf | [
"BSD-3-Clause"
] | 1,383 | 2015-02-04T14:17:40.000Z | 2022-03-30T04:58:16.000Z | doxygen/documentation/module_vehicle/wheeled_vehicle.md | Benatti1991/chrono | d927a7fae8ed2f4e6695cacaef28c605fcd9ffaf | [
"BSD-3-Clause"
] | 245 | 2015-01-11T15:30:51.000Z | 2022-03-30T21:28:54.000Z | doxygen/documentation/module_vehicle/wheeled_vehicle.md | Benatti1991/chrono | d927a7fae8ed2f4e6695cacaef28c605fcd9ffaf | [
"BSD-3-Clause"
] | 351 | 2015-02-04T14:17:47.000Z | 2022-03-30T04:42:52.000Z | Wheeled vehicles {#wheeled_vehicle}
===================================
A wheeled vehicle in Chrono::Vehicle is a specialization of the abstract generic vehicle system ([ChVehicle](@ref chrono::vehicle::ChVehicle)) and is defined as a collection of subsystems (as illustrated below).
<img src="http://www.projectchrono.org/assets/manual/vehicle/wheeled_subsystems.png" width="800" />
A wheeled vehicle contains a chassis subsystem, a driveline subsystem, and an arbitrary number of axles which, by convention, are numbered starting at the front of the vehicle. Multi-steer vehicles are supported by allowing either an arbitrary number of steering mechanisms (which are connected to different axles) or by allowing multiple steerable axles to be connected to the same steering mechanism. Each axle can accept one or two tires per side.
See [ChWheeledVehicle](@ref chrono::vehicle::ChWheeledVehicle).
The various subsystem templates are described in the following sections:
* @subpage wheeled_suspension
* @subpage wheeled_steering
* @subpage wheeled_driveline
* @subpage wheeled_tire
| 60.611111 | 451 | 0.779102 | eng_Latn | 0.997704 |
db6064c1e900660a913259f0697ce9a8247a452d | 900 | md | Markdown | documents/component/overview.md | lvphping/thinksns | 03c0c83f9e6facb0556ae0f9c2b6d721f79c0e0d | [
"Apache-2.0"
] | 2 | 2017-06-25T16:47:35.000Z | 2018-01-10T05:25:29.000Z | documents/component/overview.md | lvphping/thinksns | 03c0c83f9e6facb0556ae0f9c2b6d721f79c0e0d | [
"Apache-2.0"
] | null | null | null | documents/component/overview.md | lvphping/thinksns | 03c0c83f9e6facb0556ae0f9c2b6d721f79c0e0d | [
"Apache-2.0"
] | null | null | null | # 概述
将描述拓展应用可实现的功能和基础细则。
## 可实现功能
- 前端路由定义与开发
- 数据模型创建于开发
- 路由注入
- 静态资源复制
上述只是大纲,已经足够实现强大的功能块了。
## 基础架构包信息
首先,拓展包必须使用 Composer 来做包架构加载管理。但是没有特殊限制,唯一限制的就是 composer.json 中必须配置 TS+ 特有信息:
```json5
{
"name": "vendor/name",
"type": "plus-component",
"require": {
"zhiyicx/plus-install-plugin": "^1.0"
},
"extra": {
"installer-class": "vendor\\name\\Installer"
}
}
```
上述中,是最基本的 composer 配置,包中必须依赖 [zhiyicx/plus-install-plugin](https://packagist.org/packages/zhiyicx/plus-install-plugin) 这个包,然后 `extra` 字段配置 `installer-class` 为你的包中的安装类。
## 如何在 TS+ 中安装拓展应用包
首先使用 Composer 进行依赖
```shell
composer require vendor/name
```
然后再运行:
```shell
php artisan component install vendor/name
```
安装,其中 `php artisan component` 命令有三个指令,分别为 `install`, `update`, `uninstall`
开发更多细节,请参考 [medz/plus-component-example](https://github.com/medz/plus-component-example),其中对做了基础的开发演示。
| 20.454545 | 167 | 0.696667 | yue_Hant | 0.39689 |
db60ae2885e004391252733b440c338c5d1dd591 | 344 | md | Markdown | README.md | ypiadyk/jetsonTX2GPIO | 124f23ba4a72e9f1fcddbb9f1717a762fd26786c | [
"MIT"
] | null | null | null | README.md | ypiadyk/jetsonTX2GPIO | 124f23ba4a72e9f1fcddbb9f1717a762fd26786c | [
"MIT"
] | null | null | null | README.md | ypiadyk/jetsonTX2GPIO | 124f23ba4a72e9f1fcddbb9f1717a762fd26786c | [
"MIT"
] | null | null | null | # jetsonTX2GPIO
A straightforward library to interface with the NVIDIA Jetson TX2 Development Kit GPIO pins.
Based on https://github.com/jetsonhacks/jetsonTX1GPIO.git
The example gpio.cpp toggles J21 Pin 37 at maximun speed (~50kHz).
Run build.sh to bulid the example.
Run export.sh prior to running the example (requires root privileges).
| 31.272727 | 92 | 0.796512 | eng_Latn | 0.897565 |
db60b7d76f4ee15df8064dd8f1c3823831c21857 | 6,763 | md | Markdown | README.md | LShuXin/IndexedDB | 8f5b87b320c9b116063cb83978ba929fc0531041 | [
"Apache-2.0"
] | null | null | null | README.md | LShuXin/IndexedDB | 8f5b87b320c9b116063cb83978ba929fc0531041 | [
"Apache-2.0"
] | null | null | null | README.md | LShuXin/IndexedDB | 8f5b87b320c9b116063cb83978ba929fc0531041 | [
"Apache-2.0"
] | null | null | null | # IndexedDB
IndexedDB基础知识
## 一、概述
随着浏览器的功能不断增强,越来越多的网站开始考虑,将大量数据储存在客户端,这样可以减少从服务器获取数据,直接从本地获取数据。
现有的浏览器数据储存方案,都不适合储存大量数据:
- Cookie 的大小不超过4KB,且每次请求都会发送回服务器;
- LocalStorage 在 2.5MB 到 10MB 之间(各家浏览器不同),而且不提供搜索功能,不能建立自定义的索引。
所以,需要一种新的解决方案,这就是 IndexedDB 诞生的背景。
通俗地说,IndexedDB 就是浏览器提供的本地数据库,它可以被网页脚本创建和操作。IndexedDB 允许储存大量数据,提供查找接口,还能建立索引。这些都是 LocalStorage 所不具备的。就数据库类型而言,IndexedDB 不属于关系型数据库(不支持 SQL 查询语句),更接近 NoSQL 数据库。
IndexedDB 具有以下特点。
(1)键值对储存。 IndexedDB 内部采用对象仓库(object store)存放数据。所有类型的数据都可以直接存入,包括 JavaScript 对象。对象仓库中,数据以"键值对"的形式保存,每一个数据记录都有对应的主键,主键是独一无二的,不能有重复,否则会抛出一个错误。
(2)异步。 IndexedDB 操作时不会锁死浏览器,用户依然可以进行其他操作,这与 LocalStorage 形成对比,后者的操作是同步的。异步设计是为了防止大量数据的读写,拖慢网页的表现。
(3)支持事务。 IndexedDB 支持事务(transaction),这意味着一系列操作步骤之中,只要有一步失败,整个事务就都取消,数据库回滚到事务发生之前的状态,不存在只改写一部分数据的情况。
(4)同源限制 IndexedDB 受到同源限制,每一个数据库对应创建它的域名。网页只能访问自身域名下的数据库,而不能访问跨域的数据库。
(5)储存空间大 IndexedDB 的储存空间比 LocalStorage 大得多,一般来说不少于 250MB,甚至没有上限。
(6)支持二进制储存。 IndexedDB 不仅可以储存字符串,还可以储存二进制数据(ArrayBuffer 对象和 Blob 对象)。
## 二、基本概念
IndexedDB 是一个比较复杂的 API,涉及不少概念。它把不同的实体,抽象成一个个对象接口。学习这个 API,就是学习它的各种对象接口。
数据库:IDBDatabase 对象
对象仓库:IDBObjectStore 对象
索引: IDBIndex 对象
事务: IDBTransaction 对象
操作请求:IDBRequest 对象
指针: IDBCursor 对象
主键集合:IDBKeyRange 对象
下面是一些主要的概念。
(1)数据库
数据库是一系列相关数据的容器。每个域名(严格的说,是协议 + 域名 + 端口)都可以新建任意多个数据库。
IndexedDB 数据库有版本的概念。同一个时刻,只能有一个版本的数据库存在。如果要修改数据库结构(新增或删除表、索引或者主键),只能通过升级数据库版本完成。
(2)对象仓库
每个数据库包含若干个对象仓库(object store)。它类似于关系型数据库的表格。
(3)数据记录
对象仓库保存的是数据记录。每条记录类似于关系型数据库的行,但是只有主键和数据体两部分。主键用来建立默认的索引,必须是不同的,否则会报错。主键可以是数据记录里面的一个属性,也可以指定为一个递增的整数编号。
```
{ id: 1, text: 'foo' }
```
上面的对象中,id属性可以当作主键。数据体可以是任意数据类型,不限于对象。
(4)索引
为了加速数据的检索,可以在对象仓库里面,为不同的属性建立索引。
(5)事务
数据记录的读写和删改,都要通过事务完成。事务对象提供error、abort和complete三个事件,用来监听操作结果。
## 三、操作流程
IndexedDB 数据库的各种操作,一般是按照下面的流程进行的。这个部分只给出简单的代码示例,用于快速上手,详细的各个对象的 API 请看这里。
3.1 打开数据库
使用 IndexedDB 的第一步是打开数据库,使用indexedDB.open()方法。
```
var request = window.indexedDB.open(databaseName, version);
```
这个方法接受两个参数,第一个参数是字符串,表示数据库的名字。如果指定的数据库不存在,就会新建数据库。第二个参数是整数,表示数据库的版本。如果省略,打开已有数据库时,默认为当前版本;新建数据库时,默认为1。
```indexedDB.open()```方法返回一个 IDBRequest 对象。这个对象通过三种事件error、success、upgradeneeded,处理打开数据库的操作结果。
(1)error 事件
error事件表示打开数据库失败。
```
request.onerror = function (event) {
console.log('数据库打开报错');
};
```
(2)success 事件
success事件表示成功打开数据库。
```
var db;
request.onsuccess = function (event) {
db = request.result;
console.log('数据库打开成功');
};
```
这时,通过request对象的result属性拿到数据库对象。
(3)upgradeneeded 事件
如果指定的版本号,大于数据库的实际版本号,就会发生数据库升级事件upgradeneeded。
```
var db;
request.onupgradeneeded = function (event) {
db = event.target.result;
}
```
这时通过事件对象的target.result属性,拿到数据库实例。
3.2 新建数据库
新建数据库与打开数据库是同一个操作。如果指定的数据库不存在,就会新建。不同之处在于,后续的操作主要在upgradeneeded事件的监听函数里面完成,因为这时版本从无到有,所以会触发这个事件。
通常,新建数据库以后,第一件事是新建对象仓库(即新建表)。
```
request.onupgradeneeded = function(event) {
db = event.target.result;
var objectStore = db.createObjectStore('person', { keyPath: 'id' });
}
```
上面代码中,数据库新建成功以后,新增一张叫做person的表格,主键是id。
更好的写法是先判断一下,这张表格是否存在,如果不存在再新建。
```
request.onupgradeneeded = function (event) {
db = event.target.result;
var objectStore;
if (!db.objectStoreNames.contains('person')) {
objectStore = db.createObjectStore('person', { keyPath: 'id' });
}
}
```
主键(key)是默认建立索引的属性。比如,数据记录是```{ id: 1, name: '张三' }```,那么id属性可以作为主键。主键也可以指定为下一层对象的属性,比如```{ foo: { bar: 'baz' } }```的foo.bar也可以指定为主键。
如果数据记录里面没有合适作为主键的属性,那么可以让 IndexedDB 自动生成主键。
```
var objectStore = db.createObjectStore(
'person',
{ autoIncrement: true }
);
```
上面代码中,指定主键为一个递增的整数。
新建对象仓库以后,下一步可以新建索引。
```
request.onupgradeneeded = function(event) {
db = event.target.result;
var objectStore = db.createObjectStore('person', { keyPath: 'id' });
objectStore.createIndex('name', 'name', { unique: false });
objectStore.createIndex('email', 'email', { unique: true });
}
```
上面代码中,IDBObject.createIndex()的三个参数分别为索引名称、索引所在的属性、配置对象(说明该属性是否包含重复的值)。
3.3 新增数据
新增数据指的是向对象仓库写入数据记录。这需要通过事务完成。
```
function add() {
var request = db.transaction(['person'], 'readwrite')
.objectStore('person')
.add({ id: 1, name: '张三', age: 24, email: 'zhangsan@example.com' });
request.onsuccess = function (event) {
console.log('数据写入成功');
};
request.onerror = function (event) {
console.log('数据写入失败');
}
}
add();
```
上面代码中,写入数据需要新建一个事务。新建时必须指定表格名称和操作模式("只读"或"读写")。新建事务以后,通过IDBTransaction.objectStore(name)方法,拿到 IDBObjectStore 对象,再通过表格对象的add()方法,向表格写入一条记录。
写入操作是一个异步操作,通过监听连接对象的success事件和error事件,了解是否写入成功。
3.4 读取数据
读取数据也是通过事务完成。
```
function read() {
var transaction = db.transaction(['person']);
var objectStore = transaction.objectStore('person');
var request = objectStore.get(1);
request.onerror = function(event) {
console.log('事务失败');
};
request.onsuccess = function( event) {
if (request.result) {
console.log('Name: ' + request.result.name);
console.log('Age: ' + request.result.age);
console.log('Email: ' + request.result.email);
} else {
console.log('未获得数据记录');
}
};
}
read();
```
上面代码中,objectStore.get()方法用于读取数据,参数是主键的值。
3.5 遍历数据
遍历数据表格的所有记录,要使用指针对象 IDBCursor。
```
function readAll() {
var objectStore = db.transaction('person').objectStore('person');
objectStore.openCursor().onsuccess = function (event) {
var cursor = event.target.result;
if (cursor) {
console.log('Id: ' + cursor.key);
console.log('Name: ' + cursor.value.name);
console.log('Age: ' + cursor.value.age);
console.log('Email: ' + cursor.value.email);
cursor.continue();
} else {
console.log('没有更多数据了!');
}
};
}
readAll();
```
上面代码中,新建指针对象的openCursor()方法是一个异步操作,所以要监听success事件。
3.6 更新数据
更新数据要使用IDBObject.put()方法。
```
function update() {
var request = db.transaction(['person'], 'readwrite')
.objectStore('person')
.put({ id: 1, name: '李四', age: 35, email: 'lisi@example.com' });
request.onsuccess = function (event) {
console.log('数据更新成功');
};
request.onerror = function (event) {
console.log('数据更新失败');
}
}
update();
```
上面代码中,put()方法自动更新了主键为1的记录。
3.7 删除数据
IDBObjectStore.delete()方法用于删除记录。
```
function remove() {
var request = db.transaction(['person'], 'readwrite')
.objectStore('person')
.delete(1);
request.onsuccess = function (event) {
console.log('数据删除成功');
};
}
remove();
```
3.8 使用索引
索引的意义在于,可以让你搜索任意字段,也就是说从任意字段拿到数据记录。如果不建立索引,默认只能搜索主键(即从主键取值)。
假定新建表格的时候,对name字段建立了索引。
```
objectStore.createIndex('name', 'name', { unique: false });
```
现在,就可以从name找到对应的数据记录了。
```
var transaction = db.transaction(['person'], 'readonly');
var store = transaction.objectStore('person');
var index = store.index('name');
var request = index.get('李四');
request.onsuccess = function (e) {
var result = e.target.result;
if (result) {
// ...
} else {
// ...
}
}
``` | 21.745981 | 157 | 0.711962 | yue_Hant | 0.498194 |
db60d7aa4d9e4b94118ee1ccb8a66320f89a0f45 | 4,539 | md | Markdown | content/series/pd/g-tekketsu-s2/personnages/orga-itsuka.md | Wivik/gundam-france | 65d84098eec431e7e27b6a6c0f1e6eadea1c2bc8 | [
"MIT"
] | null | null | null | content/series/pd/g-tekketsu-s2/personnages/orga-itsuka.md | Wivik/gundam-france | 65d84098eec431e7e27b6a6c0f1e6eadea1c2bc8 | [
"MIT"
] | null | null | null | content/series/pd/g-tekketsu-s2/personnages/orga-itsuka.md | Wivik/gundam-france | 65d84098eec431e7e27b6a6c0f1e6eadea1c2bc8 | [
"MIT"
] | null | null | null | ---
title: "Orga Itsuka"
---
Orga Itsuka
-----------
php include("data/rgrp\_persos/orga-itsuka.html"); ?
* Origine : Mars
* Fonction : Chef de Tekkadan
* Voix Japonaise : Yoshimasa Hosoya
### Histoire
Chef de Tekkadan, il est devenu en peu de temps un homme à responsabilités élevées qui considère toujours ses gars comme une grande famille. Ayant gagné en maturité grâce au soutien fraternel de Naze Turbine et de Teiwaz, Orga reste tout de même bercé dans sa naïveté familiale qui lui joue parfois des tours lorsqu'il doit négocier avec d'autres instances.
Après que Tekkadan se soit illustré pendant le siège d'Arbrau en P.D. 323, il fondera pour la nation une filiale servant de conseiller stratégique dans la mise en place de l'armée d'auto défense d'Arbrau. cette filiale sera confiée à Chad Chadan:pd/g-tekketsu-s2/chad-chadan.html:lien}. Cependant, suite à l'attentat contre {lien:db:1936:Makanai Togonosuke S2, la nation sombrera rapidement dans une guerre avec un autre bloc économique à cause de mercenaires secrètement mandatés par le Gjallahorn pour mettre à mal cette nouvelle armée pouvant ébranler leur autorité de régulation.
Totalement inconscient de cet incident, Orga ordonnera le retour sur Terre de Tekkadan pour porter assistance à sa filiale qui sera devenue impuissante et marionnette des mercenaires. Malgré le blocage du Gjallahorn, ils parviendront à mettre un terme à la situation et règleront les problèmes internes de manière draconienne. Voyant son incapacité à gérer des entités aussi éloignées, Orga décidera de fermer sa filiale pour recentrer les opérations de Tekkadan.
Toujours en contact avec Mcgillis Fareed, Orga sera de plus en plus séduit par ses discours idéologiques de nouveau monde et de réforme du Gjallahorn. Cependant, il restera méfiant vis à vis de celui qui est à la tête de la fmaille Fareed car il leur aura plusieurs fois démontré qu'ils n'hésite pas à exploiter les autres pour arriver à ses fins. De plus, ce rapprochement avec Gjallahorn de manière plus ou moins officieuse et les promesses de pouvoir sur Mars inquièteront Teiwaz.
A la suite de l'incident de Chryse avec le réveil du Mobile Armor Hasmal, le lien entre Tekkadan et Teiwaz deviendra de plus en plus fragile là où la collaboration avec McGillis les a aidés à surmonter cette crise. A cause du complotisme de Jasley Donomikols au sein de Teiwaz, les Turbines se verront accusés d'avoir transporter des armes illégales et seront décimés par le Gjallahorn. Perdant son mentor, Orga finira par suivre la voie proposée par McGillis et rompera ses liens avec Teiwaz avec toujours la même ambition : choisir la voie qui mènera à ce qui se fait de mieux pour sa famille.
Orga divisera souvent les siens avec ses décisions souvent incensées et stupidement dangereuses. Certains le suivent de manière inconditionnelle, d'autres essayent de le remettre en cause mais sans jamais l'oser à part quelques membres tels que Merribit Stapleton ou encore Zack Lowe.
{spoiler}
Quelques temps après, McGillis Fareed lancera sa révolution du Gjallahorn et déclenchera sa rébellion. Cependant, le mouvement provoquera une immense crise interne qui se verra alors prise en charge par Rustal Elion de la flotte Arianrhod. La participation de Tekkadan étant connue, ils se verront alors impliqués et finalement pris pour cible pour le Gjallahorn. Retranchés dans leur base de Chryse, Orga verra un salut possible grâce aux héritières des Turbines et à Makanai qui leur permettra de revenir sur Terre pour effacer leurs identités et repartir à zéro.
Grâce à Kudelia Aina Bernstein:pd/g-tekketsu-s2/kudelia-aina-bernstein.html:lien}, ils parviendront à contacter la Terre pour établir leur plan de fuite avec l'aide des Turbines. Mais au moment de partir, un groupe d'assassins mandatés par {lien:db:1620:Nobliss Gordon:pd/g-tekketsu/nobliss-gordon.html:lien} s'attaquera à eux dans la rue, blessant Chad. Protégeant {lien:db:1878:Ride Mass avec son propre corps, Orga encaissera la rafale de balles qui leur était destinée et sera alors mortellement blessé. Bien qu'il était en train de perdre tout son sang, Orga se relèvera et pointera la direction pour le futur de Tekkadan en leur ordonnant de ne pas abandonner et de continuer. Il s'effondrera ensuite sans vie.
Ride transmettra le message aux autres qui apprendront alors la mort de leur chef. Cependant, grâce à son charisme, ses ordres et idées continueront de motiver une partie à survivre, et le noyau dur à protéger la famille.
{/spoiler}
| 85.641509 | 717 | 0.801718 | fra_Latn | 0.99209 |
db6117e941eb5294460e13b876c66fd7ea70e2ca | 9,873 | md | Markdown | README.md | yrinleung/WebApiClient.Extensions | f5e9f8579bf3f5ea4e0a5fe490e104fbf0377002 | [
"MIT"
] | 72 | 2018-09-23T02:46:38.000Z | 2021-08-02T10:34:29.000Z | README.md | yrinleung/WebApiClient.Extensions | f5e9f8579bf3f5ea4e0a5fe490e104fbf0377002 | [
"MIT"
] | 5 | 2018-12-06T08:35:00.000Z | 2020-01-04T07:21:53.000Z | README.md | yrinleung/WebApiClient.Extensions | f5e9f8579bf3f5ea4e0a5fe490e104fbf0377002 | [
"MIT"
] | 21 | 2019-03-27T01:29:37.000Z | 2021-04-19T09:02:21.000Z | # WebApiClient.Extensions
[WebApiClient](https://github.com/dotnetcore/WebApiClient)项目的第三方扩展:[Autofac](https://github.com/autofac/Autofac)、[DependencyInjection](https://github.com/aspnet/DependencyInjection)、[HttpClientFactory](https://github.com/aspnet/HttpClientFactory)、[SteeltoeOSS.Discovery](https://github.com/SteeltoeOSS/Discovery)、[MessagePack](https://github.com/neuecc/MessagePack-CSharp)、[Protobuf](https://github.com/mgravell/protobuf-net)、[Json-Rpc](https://www.jsonrpc.org/specification)
### 0 Autofac扩展
#### 0.1 Nuget
PM> `install-package WebApiClient.Extensions.Autofac`
<br/>支持 netstandard1.3
#### 0.2 使用方法
> 声明远程http服务的的WebApiClient调用接口
```c#
[HttpHost("https:/localhost:5000")]
public interface IValuesApi : IHttpApi
{
[HttpGet("api/values")]
ITask<string[]> GetAsync();
[HttpGet("api/values/{id}")]
ITask<string> GetAsync(int id);
}
```
> 注册和配置接口
```c#
var builder = new ContainerBuilder();
builder.RegisterHttpApi<IValuesApi>().ConfigureHttpApiConfig(c =>
{
c.HttpHost = new Uri("http://localhost:9999/");
c.FormatOptions.DateTimeFormat = "yyyy-MM-dd HH:mm:ss.fff";
});
```
### 1 DependencyInjection扩展
#### 1.1 Nuget
PM> `install-package WebApiClient.Extensions.DependencyInjection`
<br/>支持 netstandard2.0
#### 1.2 使用方法
> 声明远程http服务的的WebApiClient调用接口
```c#
[HttpHost("https:/localhost:5000")]
public interface IValuesApi : IHttpApi
{
[HttpGet("api/values")]
ITask<string[]> GetAsync();
[HttpGet("api/values/{id}")]
ITask<string> GetAsync(int id);
}
```
> Startup相关配置
```c#
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpApi<IValuesApi>().ConfigureHttpApiConfig(c =>
{
c.HttpHost = new Uri("http://localhost:9999/");
c.FormatOptions.DateTimeFormat = "yyyy-MM-dd HH:mm:ss.fff";
});
...
}
```
> Controller
```c#
public class HomeController : Controller
{
public async Task<string> Index([FromServices]IValuesApi api, int id = 0)
{
var values = await api.GetValuesAsync();
var value = await api.GetValuesAsync(id);
return "ok";
}
}
```
### 2 HttpClientFactory扩展
#### 2.1 Nuget
PM> `install-package WebApiClient.Extensions.HttpClientFactory`
<br/>支持 netstandard2.0
#### 2.2 使用方法
> 声明远程http服务的的WebApiClient调用接口
```c#
[HttpHost("https:/localhost:5000")]
public interface IValuesApi : IHttpApi
{
[HttpGet("api/values")]
ITask<string[]> GetAsync();
[HttpGet("api/values/{id}")]
ITask<string> GetAsync(int id);
}
```
> Startup相关配置
```c#
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpApiTypedClient<IValuesApi>(c =>
{
c.HttpHost = new Uri("http://localhost:9999/");
c.FormatOptions.DateTimeFormat = "yyyy-MM-dd HH:mm:ss.fff";
});
...
}
```
> Controller
```c#
public class HomeController : Controller
{
public async Task<string> Index([FromServices]IValuesApi api, int id = 0)
{
var values = await api.GetAsync();
var value = await api.GetAsync(id);
return "ok";
}
}
```
### 3 DiscoveryClient扩展
#### 3.1 Nuget
PM> `install-package WebApiClient.Extensions.DiscoveryClient`
<br/>支持 netstandard2.0
#### 3.2 使用方法
> 声明微服务的WebApiClient调用接口
```c#
[HttpHost("http://VALUES")]
public interface IValuesApi : IHttpApi
{
[HttpGet("api/values")]
ITask<string[]> GetAsync();
[HttpGet("api/values/{id}")]
ITask<string> GetAsync(int id);
}
```
> Startup相关配置
```c#
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddDiscoveryClient(Configuration);
services.AddDiscoveryTypedClient<IValuesApi>(c =>
{
c.FormatOptions.DateTimeFormat = "yyyy-MM-dd HH:mm:ss.fff";
});
...
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
...
app.UseDiscoveryClient();
}
```
> Controller
```c#
public class HomeController : Controller
{
public async Task<string> Index([FromServices]IValuesApi api, int id = 0)
{
var values = await api.GetAsync();
var value = await api.GetAsync(id);
return "ok";
}
}
```
### 4 MessagePack扩展
#### 4.1 Nuget
PM> `install-package WebApiClient.Extensions.MessagePack `
<br/>支持 netstandard1.6 / net4.5
#### 4.2 使用方法
> 声明远程http服务的的WebApiClient调用接口
```c#
[MessagePackReturn]
[HttpHost("https:/localhost:5000")]
public interface IUsersApi : IHttpApi
{
[HttpGet("api/users/{id}")]
ITask<UserInfo> GetAsync(int id);
[HttpPut("api/users")]
ITask<bool> PutAsync([MessagePackContent] UserInfo value);
}
```
> `asp.net core`服务端MessagePack相关配置
```c#
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
...
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1).AddMvcOptions(o =>
{
o.OutputFormatters.Add(new MessagePackOutputFormatter(ContractlessStandardResolver.Instance));
o.InputFormatters.Add(new MessagePackInputFormatter(ContractlessStandardResolver.Instance));
});
}
class MessagePackInputFormatter : InputFormatter
{
private readonly IFormatterResolver resolver;
private static readonly StringSegment mediaType = new StringSegment("application/x-msgpack");
public MessagePackInputFormatter(IFormatterResolver resolver)
{
this.resolver = resolver ?? MessagePackSerializer.DefaultResolver;
this.SupportedMediaTypes.Add(new Microsoft.Net.Http.Headers.MediaTypeHeaderValue(mediaType));
}
public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context)
{
var body = context.HttpContext.Request.Body;
var result = MessagePackSerializer.NonGeneric.Deserialize(context.ModelType, body, resolver);
return InputFormatterResult.SuccessAsync(result);
}
}
class MessagePackOutputFormatter : OutputFormatter
{
private readonly IFormatterResolver resolver;
private static readonly StringSegment mediaType = new StringSegment("application/x-msgpack");
public MessagePackOutputFormatter(IFormatterResolver resolver)
{
this.resolver = resolver ?? MessagePackSerializer.DefaultResolver;
this.SupportedMediaTypes.Add(new Microsoft.Net.Http.Headers.MediaTypeHeaderValue(mediaType));
}
public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context)
{
if (context.ObjectType != typeof(object))
{
MessagePackSerializer.NonGeneric.Serialize(context.ObjectType, context.HttpContext.Response.Body, context.Object, resolver);
}
else if (context.Object == null)
{
context.HttpContext.Response.Body.WriteByte(MessagePackCode.Nil);
}
else
{
MessagePackSerializer.NonGeneric.Serialize(context.Object.GetType(), context.HttpContext.Response.Body, context.Object, resolver);
}
context.ContentType = mediaType;
return Task.CompletedTask;
}
}
```
### 5 Protobuf扩展
#### 4.1 Nuget
PM> `install-package WebApiClient.Extensions.Protobuf`
<br/>支持 netstandard1.3 / net4.5
#### 4.2 使用方法
> 声明远程http服务的的WebApiClient调用接口
```c#
[ProtobufReturn]
[HttpHost("https:/localhost:5000")]
public interface IUsersApi : IHttpApi
{
[HttpGet("api/users/{id}")]
ITask<UserInfo> GetAsync(int id);
[HttpPut("api/users")]
ITask<bool> PutAsync([ProtobufContent] UserInfo value);
}
```
> `asp.net core`服务端MessagePack相关配置
```c#
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
...
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1).AddMvcOptions(o =>
{
o.OutputFormatters.Add(new ProtobufOutputFormatter());
o.InputFormatters.Add(new ProtobufInputFormatter());
});
}
class ProtobufInputFormatter : InputFormatter
{
private static readonly StringSegment mediaType = new StringSegment("application/x-protobuf");
public ProtobufInputFormatter()
{
this.SupportedMediaTypes.Add(new Microsoft.Net.Http.Headers.MediaTypeHeaderValue(mediaType));
}
public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context)
{
var body = context.HttpContext.Request.Body;
var model = Serializer.NonGeneric.Deserialize(context.ModelType, body);
return InputFormatterResult.SuccessAsync(model);
}
}
class ProtobufOutputFormatter : OutputFormatter
{
private static readonly StringSegment mediaType = new StringSegment("application/x-protobuf");
public ProtobufOutputFormatter()
{
this.SupportedMediaTypes.Add(new Microsoft.Net.Http.Headers.MediaTypeHeaderValue(mediaType));
}
public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context)
{
var body = context.HttpContext.Response.Body;
Serializer.NonGeneric.Serialize(body, context.Object);
context.ContentType = mediaType;
return Task.CompletedTask;
}
}
```
### 6 Json-Rpc扩展
#### 6.1 Nuget
PM> `install-package WebApiClient.Extensions.JsonRpc`
<br/>支持 netstandard1.3 / net4.5
#### 4.2 使用方法
> 声明远程Rpc服务的的WebApiClient调用接口
```c#
[HttpHost("http://localhost:6800/jsonrpc")]
public interface Aria2 : IHttpApi
{
[JsonRpcMethod("aria2.addUri")]
ITask<JsonRpcResult<string>> AddUriAsync([RpcParam] params string[] uri);
}
```
| 26.398396 | 475 | 0.705864 | yue_Hant | 0.428032 |
db62cdb3c1636e796f0c66520960d3e8f6aaae01 | 82 | md | Markdown | www/docs/22_Drupal_8.md | atanuraha12345/pink | 8dbc87a3e9b0e19616e84d6452fc7ff5dc815e4a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | www/docs/22_Drupal_8.md | atanuraha12345/pink | 8dbc87a3e9b0e19616e84d6452fc7ff5dc815e4a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | www/docs/22_Drupal_8.md | atanuraha12345/pink | 8dbc87a3e9b0e19616e84d6452fc7ff5dc815e4a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | > Ready for the next level?
Then try [DrupalGap 8](http://docs.drupalgap.org/8).
| 20.5 | 52 | 0.707317 | kor_Hang | 0.244513 |
db634896ef01a8ff8fe5cd86506d631c00435fbc | 1,844 | md | Markdown | 1D/Single_Layer_Devices/Drift-Diffusion/Two-charge-carriers/C++ implementation/README.md | tgolubev/Mott-Gurney_law_WENO | 3e3b3ee04747506a81fd06b3295b78df51c83333 | [
"MIT"
] | 8 | 2019-08-02T03:56:13.000Z | 2021-12-20T08:58:01.000Z | 1D/Single_Layer_Devices/Drift-Diffusion/Two-charge-carriers/C++ implementation/README.md | tgolubev/Mott-Gurney_law_WENO | 3e3b3ee04747506a81fd06b3295b78df51c83333 | [
"MIT"
] | 1 | 2018-01-28T06:10:57.000Z | 2018-05-20T03:35:30.000Z | 1D/Single_Layer_Devices/Drift-Diffusion/Two-charge-carriers/C++ implementation/README.md | tgolubev/Drift-Diffusion_models | 3e3b3ee04747506a81fd06b3295b78df51c83333 | [
"MIT"
] | 4 | 2019-09-04T20:13:49.000Z | 2021-10-11T03:05:32.000Z | # Drift-Diffusion_models
1D Drift Diffusion
This solves the semiconductor drift-diffusion equations in 1D for both electrons and holes using finite differences. The equations are Poisson eqn,
continuity equation, and drift-diffusion equation which are solved in a decoupled iterative method (Gummel method). Scharfetter-Gummel
discretization as well as linear mixing of old and new solutions is used to maintain stability.
The code was originally developed for solar cells, but can be used for any semiconductor devices.
------------------------------------------------------------------------------------------------------
Input parameters are specified in parameters.inp.
Other input files:
Photogeneration rate: The generation rate file (filename can be specified in parameters.inp) should contain just 1 column of generation rates corresponding to each mesh point in the device (except the end points, x = 0 and x=L). An example generation rate file for device of 300nm thickness is included.
Experimental JV curve (optional): File name can be specified in parameters.inp. File should contain 2 columns: 1st column are voltage values and 2nd are current values (in A/m^3).
------------------------------------------------------------------------------------------------------
Code can be compiled using the makefile or the QT Creator .pro project file (just open that and run within QT).
------------------------------------------------------------------------------------------------------
Version History:
Current version 3.0 (under development):
- Add optional automatic fitting algorithm to fit the model to an experimental JV curve.
Past versions:
v2.0 Object orientation. Parameter input from file. Speed improvements.
v1.0 First working version. Parameters are in parameters.h. No object orientation.
| 54.235294 | 303 | 0.660521 | eng_Latn | 0.990767 |
db64b85c62cdf58367a668a486bdeb4668062327 | 33 | md | Markdown | packages/basex/README.md | ChALkeR/ethers.js | 78eb9d61765dd091ab5931211a3e76fb48080b9f | [
"MIT"
] | 3 | 2021-08-02T10:53:14.000Z | 2021-08-03T04:39:12.000Z | packages/basex/README.md | ChALkeR/ethers.js | 78eb9d61765dd091ab5931211a3e76fb48080b9f | [
"MIT"
] | null | null | null | packages/basex/README.md | ChALkeR/ethers.js | 78eb9d61765dd091ab5931211a3e76fb48080b9f | [
"MIT"
] | 3 | 2021-08-02T10:44:33.000Z | 2021-08-02T10:51:24.000Z | Base X
======
**EXPERIMENTAL**
| 5.5 | 16 | 0.515152 | kor_Hang | 0.28421 |
db64cda410e08d21ad75d2fc1598e59ce2d95098 | 2,553 | md | Markdown | _elves/alabaster.md | cybergoof/hh2019 | 8ec67f5d12e11c901f14af1bfa2c61f3e9f2a9fc | [
"MIT"
] | null | null | null | _elves/alabaster.md | cybergoof/hh2019 | 8ec67f5d12e11c901f14af1bfa2c61f3e9f2a9fc | [
"MIT"
] | 2 | 2021-05-20T12:19:22.000Z | 2021-09-28T00:27:42.000Z | _elves/alabaster.md | cybergoof/hh2019 | 8ec67f5d12e11c901f14af1bfa2c61f3e9f2a9fc | [
"MIT"
] | null | null | null | ---
layout: elf
title: "Nyanshell"
#date: 2018-12-03
#image: "challenge.md"
question: "List the home directory"
answer: "/bin/ls ~/."
#terminal-hint: "Describe the hints from the terminal"
images: ["1.png"]
#narrative: "1"
elf-name: "Alabaster Snowball"
elf-directory: "alabaster"
tags: [sample post, readability, test]
comments: false
image-dir: /assets/img/elves/alabaster
links: [https://linux.die.net/man/1/chattr]
location: Speaker Unprepardness Room
comments: false
---
Try and log into the shell, but Nyan cat comes in
<figure>
<img src="/assets/img/elves/alabaster/question.jpg">
<figcaption>Alabaster Question</figcaption>
</figure>
<figure>
<img src="/assets/img/elves/alabaster/riddle.jpg">
<figcaption>Alabaster Riddle</figcaption>
</figure>
The hint was about chattr, which changes the attribute on a file.
Attempting to log in just shows Nyancat
<figure>
<img src="/assets/img/elves/alabaster/1.jpg">
<figcaption>The Cat</figcaption>
</figure>
Going into Alabaster's directory, I can see the success app. I also used "sudo -l" to see
what I can SUDO. Chattr is one I can use sudo with.
<figure>
<img src="/assets/img/elves/alabaster/2.jpg">
<figcaption>Doing LS</figcaption>
</figure>
The bashrc file has a resource ID that is different when the terminal is opened. And the date indicates
that bashrc is being changed for every player.
<figure>
<img src="/assets/img/elves/alabaster/3.jpg">
<figcaption>Bashrc</figcaption>
</figure>
The hint says he can't overwrite his shell. File dates are key hints in Kringlcon. Looking at
the files in /bin, there is an nsh, that is probably nyanshell
<figure>
<img src="/assets/img/elves/alabaster/4.jpg">
<figcaption>Nsh</figcaption>
</figure>
The lattr and sh show that nsh is immutable but could be overwritten
<figure>
<img src="/assets/img/elves/alabaster/5.jpg">
<figcaption>Listing</figcaption>
</figure>
I just need to copy "bash" to "nsh" after I remove the immutable bit
<figure>
<img src="/assets/img/elves/alabaster/6.jpg">
<figcaption>Changing the bit</figcaption>
</figure>
Su as alabaster gets it working
<figure>
<img src="/assets/img/elves/alabaster/success.jpg">
<figcaption>Getting next hint</figcaption>
</figure>
Alabaster then reveals a hint. The Frido Sleigh context has a capta. There is a talk about machine learning that might help
<figure>
<img src="/assets/img/elves/alabaster/hint.jpg">
<figcaption>Getting next hint</figcaption>
</figure> | 28.366667 | 125 | 0.71602 | eng_Latn | 0.955116 |
db670aa2e1583dac39fe3641eb621999be253d71 | 949 | md | Markdown | docs/error-messages/compiler-errors-1/compiler-error-c2379.md | Chrissavi/cpp-docs.de-de | 6cc90f896a0a1baabb898a00f813f77f058bb7e5 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | docs/error-messages/compiler-errors-1/compiler-error-c2379.md | Chrissavi/cpp-docs.de-de | 6cc90f896a0a1baabb898a00f813f77f058bb7e5 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | docs/error-messages/compiler-errors-1/compiler-error-c2379.md | Chrissavi/cpp-docs.de-de | 6cc90f896a0a1baabb898a00f813f77f058bb7e5 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | ---
title: Compilerfehler C2379
ms.date: 11/04/2016
f1_keywords:
- C2379
helpviewer_keywords:
- C2379
ms.assetid: 37dc3015-a4af-4341-bbf3-da6150df7e51
ms.openlocfilehash: f096791a6120023e079b93452a4b35c669db2139
ms.sourcegitcommit: a5fa9c6f4f0c239ac23be7de116066a978511de7
ms.translationtype: MT
ms.contentlocale: de-DE
ms.lasthandoff: 12/20/2019
ms.locfileid: "75302106"
---
# <a name="compiler-error-c2379"></a>Compilerfehler C2379
der formale Parameter Number hat beim herauf Stufen einen anderen Typ.
Der Typ des angegebenen Parameters ist aufgrund von Standard Erweiterungen mit dem Typ in einer vorherigen Deklaration nicht kompatibel. Dies ist ein Fehler in ANSI C ([/Za](../../build/reference/za-ze-disable-language-extensions.md)) und eine Warnung mit Microsoft-Erweiterungen ( **/Ze**).
Im folgenden Beispiel wird C2379 generiert:
```c
// C2379.c
// compile with: /Za
void func();
void func(char); // C2379, char promotes to int
```
| 31.633333 | 291 | 0.779768 | deu_Latn | 0.76515 |
db683f110937d980c526526eef34fe8316a550bd | 191 | md | Markdown | README.md | mohamnag/ubuntu- | decbaa53f757de23e383f901c279205fe48e7e7e | [
"MIT"
] | null | null | null | README.md | mohamnag/ubuntu- | decbaa53f757de23e383f901c279205fe48e7e7e | [
"MIT"
] | 1 | 2021-04-06T07:26:16.000Z | 2021-04-06T07:26:16.000Z | README.md | mohamnag/ubuntu- | decbaa53f757de23e383f901c279205fe48e7e7e | [
"MIT"
] | 3 | 2021-02-06T19:06:14.000Z | 2021-04-01T12:46:44.000Z | # README
A very simple image with ubuntu and git, I used it for docker image builds.
```
docker run --rm mohamnag/git -v /usr/bin/docker:/bin/docker -v /run/docker.sock:/run/docker.sock
```
| 27.285714 | 96 | 0.712042 | eng_Latn | 0.539921 |
db6893a89fb57944eb3a88a7374afb7abca1134a | 157 | md | Markdown | README.md | Carike/available-not | 54494441ce4db9656562fa340cd8ca03a75182e3 | [
"MIT"
] | null | null | null | README.md | Carike/available-not | 54494441ce4db9656562fa340cd8ca03a75182e3 | [
"MIT"
] | null | null | null | README.md | Carike/available-not | 54494441ce4db9656562fa340cd8ca03a75182e3 | [
"MIT"
] | null | null | null | # available-not
Are you available or not? Using IoT to create a visual cue for remote workers that share a space with others so they know when to say hello.
| 52.333333 | 140 | 0.783439 | eng_Latn | 0.999986 |
db69c6421ce9114e981ca4ae301aa3e223c6bc50 | 3,164 | md | Markdown | README.md | uquinnhau/blog | 6bca9c0ce207c2fb4f24db69821e0f2f1a90fbc8 | [
"MIT"
] | 1 | 2018-03-06T08:39:00.000Z | 2018-03-06T08:39:00.000Z | README.md | uquinnhau/blog | 6bca9c0ce207c2fb4f24db69821e0f2f1a90fbc8 | [
"MIT"
] | null | null | null | README.md | uquinnhau/blog | 6bca9c0ce207c2fb4f24db69821e0f2f1a90fbc8 | [
"MIT"
] | null | null | null | # MrErHu(请叫我王磊的同学)博客
个人博客
订阅请点 watch, 收藏请点 star, 不要点 fork, 禁止开issue!! 切记,禁止开issue!! 禁止开issue!! 禁止开issue!!
关于我:
94年程序员,入行资历甚浅,JavaScript爱好者,NodeJs拥护者,本来想做一个前端,但是苦于不精通CSS,现居于南京,努力学习中~
- [邮箱](mailto:wanglei_cs@163.com)
- [微博](http://weibo.com/wanglei0934)
- [知乎](https://www.zhihu.com/people/mrerhu/activities)
- [掘金](https://juejin.im/user/576e377bd342d30057c2e265)
## [React](https://github.com/MrErHu/MrErHu/issues?q=is%3Aopen+is%3Aissue+label%3AReact)
1. [React生命周期浅谈](https://github.com/MrErHu/MrErHu/issues/2)
2. [为什么React和Immutable是好朋友](https://github.com/MrErHu/MrErHu/issues/3)
3. [React 高阶组件(HOC)入门指南](https://github.com/MrErHu/MrErHu/issues/4)
4. [React Mixins入门指南](https://github.com/MrErHu/MrErHu/issues/5)
5. [React事件机制](https://github.com/MrErHu/MrErHu/issues/6)
6. [React技术内幕:setState的秘密](https://github.com/MrErHu/MrErHu/issues/20)
7. [React技术内幕:key带来了什么](https://github.com/MrErHu/MrErHu/issues/21)
8. [从Preact了解一个类React的框架是怎么实现的(一): 元素创建](https://github.com/MrErHu/MrErHu/issues/22)
9. [从Preact了解一个类React的框架是怎么实现的(二): 元素diff](https://github.com/MrErHu/MrErHu/issues/23)
9. [从Preact了解一个类React的框架是怎么实现的(三): 组件](https://github.com/MrErHu/MrErHu/issues/24)
10. [了不起的Virtual DOM(一):起源](https://github.com/MrErHu/blog/issues/26)
## [Redux](https://github.com/MrErHu/MrErHu/issues?q=is%3Aopen+is%3Aissue+label%3ARedux)
1. [Redux:Middleware你咋就这么难](https://github.com/MrErHu/MrErHu/issues/7)
2. [Redux:百行代码千行文档](https://github.com/MrErHu/MrErHu/issues/1)
3. [Redux:自问自答](https://github.com/MrErHu/MrErHu/issues/18)
4. [庖丁解牛React-Redux(一): connectAdvanced](https://github.com/MrErHu/blog/issues/17)
5. [庖丁解牛React-Redux(二): connect](https://github.com/MrErHu/blog/issues/19)
## [JavaScript](https://github.com/MrErHu/MrErHu/issues?q=is%3Aopen+is%3Aissue+label%3AJavaScript)
1. [从LHS与RHS角度浅谈Js变量声明与赋值](https://github.com/MrErHu/MrErHu/issues/12)
2. [浅谈JavaScript闭包](https://github.com/MrErHu/MrErHu/issues/11)
3. [我所认识的JavaScript作用域链和原型链](https://github.com/MrErHu/blog/issues/16)
## [从面试题中我们能学到什么](https://github.com/MrErHu/MrErHu/issues?q=is%3Aissue+is%3Aopen+label%3A%E4%BB%8E%E9%9D%A2%E8%AF%95%E9%A2%98%E4%B8%AD%E6%88%91%E4%BB%AC%E8%83%BD%E5%AD%A6%E5%88%B0%E4%BB%80%E4%B9%88)
1. [一个小小的JavaScript题目](https://github.com/MrErHu/MrErHu/issues/10)
2. [一道颇有难度的JavaScript题](https://github.com/MrErHu/MrErHu/issues/9)
3. [从一道面试题谈谈函数柯里化(Currying)](https://github.com/MrErHu/MrErHu/issues/8)
## [React Native](https://github.com/MrErHu/blog/labels/React%20Native)
1. [React Native与Iconfont](https://github.com/MrErHu/blog/issues/15)
## [NodeJs](https://github.com/MrErHu/MrErHu/issues?q=is%3Aissue+is%3Aopen+label%3ANodeJs)
1. [Mongoose返回数据修改中遇到的坑](https://github.com/MrErHu/MrErHu/issues/13)
## [生活](https://github.com/MrErHu/MrErHu/issues?q=is%3Aopen+is%3Aissue+label%3A%E7%94%9F%E6%B4%BB)
1. [2017年读书历程](https://github.com/MrErHu/MrErHu/issues/14)
## 打赏
如果你觉得本文章质量不错,读后收获很大,那就请我吃一个麦旋风吧,让我有“动力”继续致力于高质量文章、教程和文章翻译。
***微信***:
![WeChat](http://omaqpbodr.bkt.clouddn.com/Wechat.jpeg?imageView2/3/w/200/h/200/q/75|imageslim)
***支付宝***:
![Alipay](http://omaqpbodr.bkt.clouddn.com/Alipay.jpeg?imageView2/3/w/200/h/200/q/75|imageslim) | 43.342466 | 198 | 0.745575 | yue_Hant | 0.6688 |
db6a688cdacdba3026359b221d64f9a132290e49 | 299 | md | Markdown | _posts/1974-04-22-dot-engineers-lower-the-maximum.md | MiamiMaritime/miamimaritime.github.io | d087ae8c104ca00d78813b5a974c154dfd9f3630 | [
"MIT"
] | null | null | null | _posts/1974-04-22-dot-engineers-lower-the-maximum.md | MiamiMaritime/miamimaritime.github.io | d087ae8c104ca00d78813b5a974c154dfd9f3630 | [
"MIT"
] | null | null | null | _posts/1974-04-22-dot-engineers-lower-the-maximum.md | MiamiMaritime/miamimaritime.github.io | d087ae8c104ca00d78813b5a974c154dfd9f3630 | [
"MIT"
] | null | null | null | ---
title: DOT engineers lower the maximum
tags:
- Apr 1974
---
DOT engineers lower the maximum gross weight for trucks using the Keys Highway. New bridges are planned. [Photo and history]
Newspapers: **Miami Morning News or The Miami Herald**
Page: **11**, Section: **C**
| 24.916667 | 126 | 0.668896 | eng_Latn | 0.979835 |
db6ac4a45ba678d4546764bd84d4bf0c8861d5ba | 451 | md | Markdown | README.md | BigETI/MufajaA | 2ceb3718b709368321d4c98e46bfd674d5246e6d | [
"MIT"
] | null | null | null | README.md | BigETI/MufajaA | 2ceb3718b709368321d4c98e46bfd674d5246e6d | [
"MIT"
] | null | null | null | README.md | BigETI/MufajaA | 2ceb3718b709368321d4c98e46bfd674d5246e6d | [
"MIT"
] | null | null | null | # Mufaja'a
A personalised goofy game made within 2 days.
## Credits
- [3check](https://gamebanana.com/members/819974)
- [Ridge skybox texture for Team Fortress 2](https://gamebanana.com/textures/2548)
- McKinneys Cotton Pickers
- [Milenberg Joys](https://www.youtube.com/watch?v=Ay5cnrycChs)
- [OurConnections](https://www.youtube.com/channel/UCsc5yW3yOYnjKdGixtffTvA)
- [Old Film Grain | Overlay](https://www.youtube.com/watch?v=J_MZb7qTenE) | 37.583333 | 84 | 0.751663 | yue_Hant | 0.351937 |
db6b6b36e8575dd3fac09ee7f08f1f08a7c7f58d | 1,138 | md | Markdown | _posts/2020-08-05-鸣谢.md | linkliu/tech-landscape | cea6519bfacef171979671a8e12ce1b7fb9c3879 | [
"MIT"
] | 5 | 2020-08-14T01:58:55.000Z | 2020-09-01T12:13:10.000Z | _posts/2020-08-05-鸣谢.md | linkliu/tech-landscape | cea6519bfacef171979671a8e12ce1b7fb9c3879 | [
"MIT"
] | 1 | 2021-09-28T05:46:13.000Z | 2021-09-28T05:46:13.000Z | _posts/2020-08-05-鸣谢.md | linkliu/tech-landscape | cea6519bfacef171979671a8e12ce1b7fb9c3879 | [
"MIT"
] | 2 | 2020-09-01T10:58:44.000Z | 2020-09-01T12:13:21.000Z | ---
category: shader
tags: [U3D, Shader,Cookbook,中文版]
---
**鸣谢**
**本书作者**
Alan Zucconi
Kenneth Lammers
**审稿**
Kenneth Lammers
**组稿编辑**
Priya Singh
**策划编辑**
Rahul Nair
Erol Staveley
**项目内容编辑**
Mehvash Fatima
**技术编辑**
Pranil Pathare
Danish Shaikh
**文字编辑**
Tasneem Fatehi
**项目助理**
Kinjal Bari
**校对员**
Safis Editing
**索引员**
Monica Ajmera Mehta
**图像**
Kirk D’Penha
Disha Haria
**制作协调员**
Nilesh Mohite
**封面设计**
Nilesh Mohite
***
**关于作者**
**Alan Zucconi** 是一个充满激情的开发者, 作者, 和一个激励的演讲者, 是开发者领域的佼佼者。 有着过去10年来相关领域的专业技能积累,并且决定在今后把精力都放在学术领域和游戏产业领域。作为一名自由职业者,他以非凡的创造力去探索如何让游戏更好的与艺术结合。 在此之前,他在伦敦帝国理工学院工作,在这里他发现了他教学和写作的激情。 他的头衔包括了 gravity puzzle, 0RBITALIS, 和the upcoming time travel platformer, Still Time(这些单词实在不知道怎么翻译了,应该是游戏名字).
**Kenneth Lammers** 在游戏领域有超过15年的经验, 担任过角色艺术家,技术美术,技术美术总监,和程序员。这让他有机会参与《使命召唤3》《除暴战警2》 《心灵杀手》和《Kinect星球大战》等众多著名游戏的开发。他现在跟他的商业伙伴**Noah Kaarbo**一起运营自己的Ozone 工作。,同时,他们也跟亚马逊,Eline Media,IGT和微软也有过合作。他之前为微软游戏工作室,动视和Surreal工作过。现如今他离开了哪些工作室,一手开办了自己的 CreativeTD 和 Ozone 工作室(感觉翻译成互动娱乐更好)。Kenny通过Packt Publishing出版社写了他的第一版 《Unity Shaders and Effects Cookbook》书,整个过程非常的愉快。 | 15.589041 | 358 | 0.739895 | yue_Hant | 0.558155 |
db6b83ef77d281c61ccaaabdbcaf29ab344f1eef | 220 | md | Markdown | README.md | Snaddyvitch-Dispenser/CommunalEmail | 6717d0e2e7d99fddc9f5a6e6fe4f9204e98c7af3 | [
"MIT"
] | null | null | null | README.md | Snaddyvitch-Dispenser/CommunalEmail | 6717d0e2e7d99fddc9f5a6e6fe4f9204e98c7af3 | [
"MIT"
] | null | null | null | README.md | Snaddyvitch-Dispenser/CommunalEmail | 6717d0e2e7d99fddc9f5a6e6fe4f9204e98c7af3 | [
"MIT"
] | null | null | null | # CommunalEmail
A Discord bot for communal recieving of email - probably not the best implementation but it works!
All Configuration options are at the top of the main.py file
---
Requirements:
`html2text`
Python 3
| 16.923077 | 98 | 0.772727 | eng_Latn | 0.992351 |
db6c78b23ad46d92d7aa0ca101811595f7ee1f30 | 1,053 | md | Markdown | data/blog/item_2763.md | VallyPepyako/wsd-jam | daa81b7f253bc585002f339e78dc1b42c537ce63 | [
"MIT"
] | null | null | null | data/blog/item_2763.md | VallyPepyako/wsd-jam | daa81b7f253bc585002f339e78dc1b42c537ce63 | [
"MIT"
] | null | null | null | data/blog/item_2763.md | VallyPepyako/wsd-jam | daa81b7f253bc585002f339e78dc1b42c537ce63 | [
"MIT"
] | null | null | null | ---
path: "/blog/page_2763"
title: "Part 2763"
---
азаниями войн, походов, сражений, теперь отражали бурлившее движение политическими и дипломатическими соображениями, законами, трактатами...
Эту деятельность исторических лиц историки называют реакцией.
Описывая деятельность этих исторических лиц, бывших, по их мнению, причиною того, что́ они называют реакцией, историки строго осуждают их. Все известные люди того времени, от Александра и Наполеона до m-me Staël, Фотия, Шеллинга, Фихте, Шатобриана и проч., проходят перед их строгим судом и оправдываются или осуждаются, смотря по тому, содействовали ли они прогрессу или реакции.
235В России, по их описанию, в этот период времени тоже происходила реакция, и главным виновником этой реакции был Александр I, — тот самый Александр I, который, по их же описаниям, был главным виновником либеральных начинаний своего царствования и спасения России.
В настоящей русской литературе от гимназиста до ученого историка, нет человека, который бы не бросил своего камушка в Александра за неправильные посту
| 95.727273 | 380 | 0.811966 | rus_Cyrl | 0.991089 |
db6e687313e8c0683600a22328320ca6a81323de | 7,350 | md | Markdown | content/post/christmas_decorations_teach_me_a_lesson_about_troubleshooting.md | trishagee/trishagee.com | 7aa203c89b4cb8ea38bffa3c569a597aa4b85ebe | [
"MIT"
] | null | null | null | content/post/christmas_decorations_teach_me_a_lesson_about_troubleshooting.md | trishagee/trishagee.com | 7aa203c89b4cb8ea38bffa3c569a597aa4b85ebe | [
"MIT"
] | null | null | null | content/post/christmas_decorations_teach_me_a_lesson_about_troubleshooting.md | trishagee/trishagee.com | 7aa203c89b4cb8ea38bffa3c569a597aa4b85ebe | [
"MIT"
] | null | null | null | {
"disqus_url" : "http://trishagee.github.io/post/christmas_decorations_teach_me_a_lesson_about_troubleshooting/",
"disqus_title" : "Christmas decorations teach me a lesson about troubleshooting",
"Title": "Christmas decorations teach me a lesson about troubleshooting",
"Pubdate": "2012-01-17",
"Keywords": ["performance", "testing"],
"Tags": ["performance", "testing"],
"Slug": "christmas_decorations_teach_me_a_lesson_about_troubleshooting",
"Section": "post"
}
And now, after an absence of several weeks, you get to see how long it takes me to write some of these posts.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-_IL9JCpG-YI/TxUujcWyp3I/AAAAAAAAIvg/uMQCtOKGPcs/s1600/DSC_0037.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="267" src="http://2.bp.blogspot.com/-_IL9JCpG-YI/TxUujcWyp3I/AAAAAAAAIvg/uMQCtOKGPcs/s400/DSC_0037.JPG" width="400" /></a></div><br />I was putting up the Christmas decorations one Saturday when my worst fear was realised<sup>1</sup> - one of my three strings of lights was not working.<br /><br />The first two went up fine. The third lit up when I plugged it in, and in less than a second went out. Curses. This is not what I wanted, this was supposed to be a short exercise in making my tiny little flat look festive.<br /><br />So I set about the tedious task of starting from the end closest to the plug and replacing every bulb, one by one, with a spare one to see if it magically lit up again. When it doesn't, you take the spare back out and replace it with the original bulb. I remember my parents going through this ritual every Christmas, the tediousness of this activity is more memorable than the fleeting joy of shinies.<br /><br />While I was doing this, my mind was back on the job I'd been doing at work the previous week - battling an Internet Explorer 7 performance problem. We have automated performance tests which give us an indication of the load time for our application in Chrome and IE, and some time in the previous couple of weeks our IE performance had significantly degraded in the development code. Due to a number of too-boring-to-explain-here circumstances, the last known good revision was four days and nearly 250 revisions earlier than the first revision that showed the performance problem.<br /><br />Since we couldn't see anything to indicate it was an environmental problem, the logical next step was to pinpoint the revision which caused the problem, so we could either fix it or get performance gains from somewhere else in the system.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-gnC5YOnp9-8/TxUy6Y0I72I/AAAAAAAAIvo/bDlg30_CMvA/s1600/revisions1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="88" src="http://3.bp.blogspot.com/-gnC5YOnp9-8/TxUy6Y0I72I/AAAAAAAAIvo/bDlg30_CMvA/s320/revisions1.png" width="320" /></a></div><br />The most obvious way to do this, given there were no obvious suspects, is with a binary search of the revisions. Our last known good revision was 081, our first poor performing one was 240. So the thing to do is to check revision 160, see if it falls on the poor or good performance side.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-NyxMETVmxrM/TxUy6uuKWuI/AAAAAAAAIvs/HG9HdBMMZfE/s1600/revisions2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="88" src="http://2.bp.blogspot.com/-NyxMETVmxrM/TxUy6uuKWuI/AAAAAAAAIvs/HG9HdBMMZfE/s320/revisions2.png" width="320" /></a></div><br />If 160 proves to be a poor performer, check revision 120....<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-LEjXqVBWAxM/TxUy7Ipt3UI/AAAAAAAAIv4/U4gq2gIrgzs/s1600/revisions3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="88" src="http://4.bp.blogspot.com/-LEjXqVBWAxM/TxUy7Ipt3UI/AAAAAAAAIv4/U4gq2gIrgzs/s320/revisions3.png" width="320" /></a></div><br />...if 160 is fine, test revision 200...<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-a4pDFa23AS8/TxUy8AZZL6I/AAAAAAAAIv8/YGX5b314ZPA/s1600/revisions4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="88" src="http://3.bp.blogspot.com/-a4pDFa23AS8/TxUy8AZZL6I/AAAAAAAAIv8/YGX5b314ZPA/s320/revisions4.png" width="320" /></a></div><br />...and keep splitting the revisions by half until you find the suspect.<br /><br />So of course that's what I want to do with my stupid Christmas lights. I do not want to sequentially check each light bulb, that has a worst-case number-of-bulbs-tried = n, where n is the number of bulbs (probably a couple of hundred, although it felt like several thousand). So, in computer speak, O(n). The binary search algorithm is O(log n). At university, this Big Oh had no context for me. But when you've taken 10 minutes to get a quarter of the way through your Christmas lights, and you diagnosed your IE performance problems... well, actually it took days. But the point is, a binary search for the missing bulb would definitely have been a Good Thing.<br /><br />I know you're dying to know if I tracked down the problem in Internet Explorer - I did. What's the worst case when you're doing a binary search? It's when the thing you're looking for is veeeery close to either your start point or your end point. <br /><br />The revision number I was after was number 237. Sigh.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-TKU7fyVqnxs/TxUzePYv0eI/AAAAAAAAIwI/ewwyYBPE8no/s1600/revisions5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="88" src="http://3.bp.blogspot.com/-TKU7fyVqnxs/TxUzePYv0eI/AAAAAAAAIwI/ewwyYBPE8no/s320/revisions5.png" width="320" /></a></div><br />And my Christmas tree lights? Well, through the boredom I remembered that modern lights are in sections, so they have a sort of built-in binary search - well, limited segments will go dark if a single bulb is out - which allows you to narrow down your problem area. Since the whole string was out, I figured something else was probably wrong.<br /><br />Turned out the plug had come out of the socket.<br /><br />So:<br /><b>Lesson 1</b>: Theoretical computer science does have a place when you care about how long something takes. When it's you feeling the pain, you'll do anything to make it stop.<br /><br /><b>Lesson 2</b>: When diagnosing a problem you will always biased towards what you think it is, in the face of actual evidence. I was afraid I would have to search the whole set of lights for a blown bulb, so that's the problem I was looking for when the lights failed. In actual fact it was a problem with a much simpler solution.<br /><br /><br /><br /><sup>1</sup> - OK, "worst fear" in this very limited context only - it's not like I lie awake at night in July afraid that one of the bulbs on my Christmas lights has blown.
| 612.5 | 6,876 | 0.754286 | eng_Latn | 0.983062 |
db6ee57dd563fac1e82bd88ec6fe094c6b4567fb | 6,977 | md | Markdown | _posts/2014-03-25-web-site-affinity-with-windows-azure-traffic-manager.md | rickrain/rickrain.github.io | 9f76d3642d5f2db09fbd45872d9eb98a89af9b45 | [
"MIT"
] | null | null | null | _posts/2014-03-25-web-site-affinity-with-windows-azure-traffic-manager.md | rickrain/rickrain.github.io | 9f76d3642d5f2db09fbd45872d9eb98a89af9b45 | [
"MIT"
] | 3 | 2021-09-21T21:12:06.000Z | 2021-09-21T21:12:11.000Z | _posts/2014-03-25-web-site-affinity-with-windows-azure-traffic-manager.md | rickrain/rickrain.github.io | 9f76d3642d5f2db09fbd45872d9eb98a89af9b45 | [
"MIT"
] | null | null | null | ---
title: "Web Site Affinity with Windows Azure Traffic Manager"
date: 2014-03-25 16:06:04 -0500
permalink: /:year/:month/:day/:title/
---
In my previous post I talked about using [Windows Azure Web Sites and Traffic Manager](http://rickrainey.com/2014/03/22/windows-azure-web-sites-and-traffic-manager/) together to achieve load balancing across web site deployments in different regions. Having Traffic Manager support for Windows Azure Web Sites is a great addition to the Windows Azure platform that was recently [announced by Microsoft](http://blogs.msdn.com/b/windowsazure/archive/2014/03/13/announcing-general-availability-of-oracle-software-on-windows-azure-and-updates-to-windows-azure-traffic-manager.aspx).
In this post, I’m going to dig into this a little deeper and share some observations and recommendations when using Traffic Manager with Windows Azure Web Sites.
## ARR Affinity and Web Sites ##
Windows Azure Web Sites, by default, use an **ARRAffinity** cookie to insure subsequent requests from a user are routed back to the web site instance that the user initially connected to. In other words, Windows Azure Web Sites assumes your web site is not stateless. If you were to scale your web site deployment to multiple instances, the ARR Server processes this ARR Affinity cookie and sends you back to the instance that processed your initial request (the request that originated the cookie).
If you’re not already familiar with this, check out [this](http://blogs.msdn.com/b/windowsazure/archive/2013/11/18/disabling-arr-s-instance-affinity-in-windows-azure-web-sites.aspx) blog for an in-depth discussion on ARR Affinity for Web Sites and how to disable ARR Affinity if your web site is stateless.
## ARR Affinity and Traffic Manager ##
Now, assuming the default ARR Affinity behavior for web sites, let’s look at this in a scenario where Traffic Manager is providing ##Round Robin Load Balancing## across web site deployments in multiple regions. For this post, I’m continuing with the 3 web site deployments from [my previous post](http://rickrainey.com/2014/03/22/windows-azure-web-sites-and-traffic-manager/), which are in the West, North Central, and East regions.
You can see this **ARRAffinity** cookie using the developer tools feature (press **F12**) in Internet Explorer. Below is a new browser session where I browsed to contoso-ws-trafficmanager.net and as part of the response, I got an **ARRAffinty** cookie back.
![ARR Affinity Cookie for Contoso West](/assets/img/azure-website-affinity-01.png)
Now, in subsequent requests, this cookie is provided in the request headers so ARR can properly route the request back to the instance (not region) that serviced the first request.
![ARR Affinity Cookie for Contoso West](/assets/img/azure-website-affinity-02.png)
Assuming my DNS entries on my client don’t change, I’ll get back to the West region on a subsequent request and the ARR Server will use this cookie to make sure I get back to the right instance in that region.
Now, when you add Traffic Manager (Round Robin or Performance) for your web site deployments, there is a risk that you will not get back to the same instance because Traffic Manager may resolve you to a different region entirely.
To demonstrate, notice above that my ARR Affinity cookie (…0112) was issued in my initial request which was serviced by the **West** deployment. In that same browser session, after some time had passed, I refreshed my browser. As expected, the cookie is passed in the request headers. But, this time my request resolved to the **North** deployment.
![ARR Affinity Cookie for Contoso North](../../../../assets/img/azure-website-affinity-03.png)
Clearly this can be problematic if my web site is **not** stateless, which as I said at the beginning, is an assumption made for Windows Azure Web Sites and the reason for the ARR Affinity cookie.
Now, looking at the cookies for this last request I can see that the instance in my **North** deployment issued a new **ARRAffinity** cookie (…5069).
![ARR Affinity Cookie for Contoso North](../../../../assets/img/azure-website-affinity-04.png)
It did this because it does not have a mapping for the first cookie (…0012) to an instance of my web site in the North. The ARR server in the West knows about this cookie, but not the one in the North. So, a new cookie was issued.
Waiting again for a few minutes, I just happened to get routed back to the **West** deployment. On this request, the 2nd cookie (…5069) that I got from the **North** was sent in the request. Of course, the instance in the **West** didn’t recognize it as valid so it issued a new cookie, which happens to be the first cookie (…0112) because I only have the one instance in that region.
![ARR Affinity Cookie for Contoso West](../../../../assets/img/azure-website-affinity-05.png)
So, I have two deployments, West and North, servicing one user. If my web site is not stateless this has the potential of creating some big problems for me.
## Traffic Manager and Web Sites with state/session ##
If your web site is *not stateless*, then your use of Traffic Manager should be limited to the *Failover* load balancing method. Otherwise, you risk having session data for a single user in multiple regions as I’ve demonstrated above.
## Traffic Manager and stateless Web Sites ##
If your web site is indeed stateless, then you don’t have any risk other than your load balancing at each region not being as optimal as it could be. So, disabling ARR Affinity for *stateless* web sites is a good idea and [this blog](http://blogs.msdn.com/b/windowsazure/archive/2013/11/18/disabling-arr-s-instance-affinity-in-windows-azure-web-sites.aspx) shows a couple of ways this can be done. For my sample here, I chose this approach.
![Web Server Configuration](../../../../assets/img/azure-website-affinity-06.png)
Hopefully this helps you get the most out of using Traffic Manager with Microsoft Azure Web Sites.
{% if page.comments %}
<div id="disqus_thread"></div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = "{{ site.baseurl }}"; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = "{{ page.url }}"; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://rickrainey.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{% endif %} | 82.082353 | 579 | 0.762505 | eng_Latn | 0.988065 |
db6f11d67a04dcf1c41ec3df220c684f713ff5aa | 301,453 | md | Markdown | javascript-quick-and-dirty-pure-client-side-qr-code-rendering-playground/README.md | eladkarako/icompile | fdea5c6300696ae4b42ca83d53491764cd47d1c9 | [
"Unlicense"
] | 5 | 2020-02-29T08:33:39.000Z | 2021-12-20T12:24:42.000Z | javascript-quick-and-dirty-pure-client-side-qr-code-rendering-playground/README.md | eladkarako/icompile | fdea5c6300696ae4b42ca83d53491764cd47d1c9 | [
"Unlicense"
] | 1 | 2019-10-10T19:14:28.000Z | 2019-10-10T19:14:29.000Z | javascript-quick-and-dirty-pure-client-side-qr-code-rendering-playground/README.md | eladkarako/icompile | fdea5c6300696ae4b42ca83d53491764cd47d1c9 | [
"Unlicense"
] | 4 | 2019-06-15T12:28:35.000Z | 2021-12-20T12:24:37.000Z | <a href="https://icompile.eladkarako.com/_uploads/2014/09/2014-09-30_132155.png"><img src="https://icompile.eladkarako.com/_uploads/2014/09/2014-09-30_132155.png" alt="2014-09-30_132155" class="alignnone size-full wp-image-1930" /></a>
<!--more-->
<pre><style type="text/css">
code{
display:inline !important;
}
pre.sourcecontainer{
overflow-wrap: break-word;
overflow-x: hidden;
overflow-y: scroll;
}
</style></pre>
1. use the qr pure client side library, from <a rel="nofollow" href="http://neocotic.com/qr.js" title="http://neocotic.com/qr.js" target="_blank">http://neocotic.com/qr.js</a>.
<pre>
<span style='color:#696969; '>// [qr.js](http://neocotic.com/qr.js) </span>
<span style='color:#696969; '>// (c) 2014 Alasdair Mercer </span>
<span style='color:#696969; '>// Licensed under the GPL Version 3 license. </span>
<span style='color:#696969; '>// Based on [jsqrencode](http://code.google.com/p/jsqrencode/) </span>
<span style='color:#696969; '>// (c) 2010 tz@execpc.com </span>
<span style='color:#696969; '>// Licensed under the GPL Version 3 license. </span>
<span style='color:#696969; '>// For all details and documentation: </span>
<span style='color:#696969; '>// <http://neocotic.com/qr.js></span>
<span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>function</span> <span style='color:#808030; '>(</span>root<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#0000e6; '>'use strict'</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Private constants</span>
<span style='color:#696969; '>// -----------------</span>
<span style='color:#696969; '>// Alignment pattern.</span>
<span style='color:#800000; font-weight:bold; '>var</span> ALIGNMENT_DELTA <span style='color:#808030; '>=</span> <span style='color:#808030; '>[</span>
<span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>23</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>27</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>31</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>18</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>20</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>20</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span>
<span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Default MIME type.</span>
<span style='color:#800000; font-weight:bold; '>var</span> DEFAULT_MIME <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>'image/png'</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// MIME used to initiate a browser download prompt when `qr.save` is called.</span>
<span style='color:#800000; font-weight:bold; '>var</span> DOWNLOAD_MIME <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>'image/octet-stream'</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// There are four elements per version. The first two indicate the number of blocks, then the</span>
<span style='color:#696969; '>// data width, and finally the ECC width.</span>
<span style='color:#800000; font-weight:bold; '>var</span> ECC_BLOCKS <span style='color:#808030; '>=</span> <span style='color:#808030; '>[</span>
<span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>9</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>17</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>34</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>55</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>44</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>17</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>18</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>80</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>20</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>32</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>18</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>9</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>108</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>43</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>18</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>68</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>18</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>27</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>78</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>20</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>31</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>18</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>18</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>97</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>38</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>18</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>116</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>36</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>20</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>12</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>68</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>18</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>43</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>81</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>20</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>50</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>12</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>92</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>36</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>20</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>107</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>37</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>20</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>12</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>115</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>40</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>20</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>12</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>87</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>41</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>12</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>98</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>45</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>107</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>46</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>17</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>120</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>9</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>43</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>17</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>113</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>44</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>17</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>21</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>9</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>107</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>41</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>116</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>17</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>42</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>17</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>111</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>17</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>46</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>34</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>121</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>47</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>117</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>45</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>106</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>47</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>114</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>46</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>33</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>122</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>45</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>23</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>12</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>117</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>23</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>45</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>31</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>31</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>116</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>21</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>45</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>37</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>23</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>115</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>47</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>25</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>23</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>25</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>115</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>29</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>46</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>42</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>23</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>17</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>115</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>23</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>46</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>35</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>35</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>17</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>115</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>21</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>46</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>29</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>46</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>115</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>23</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>46</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>44</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>59</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>12</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>121</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>12</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>47</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>39</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>41</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>121</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>34</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>47</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>46</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>64</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>17</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>122</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>29</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>46</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>49</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>46</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>18</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>122</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>32</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>46</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>48</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>42</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>32</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>20</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>117</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>40</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>47</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>43</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>67</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span>
<span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>118</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>18</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>31</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>47</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>28</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>34</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>34</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>20</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>61</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>30</span>
<span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Map of human-readable ECC levels.</span>
<span style='color:#800000; font-weight:bold; '>var</span> ECC_LEVELS <span style='color:#808030; '>=</span> <span style='color:#800080; '>{</span>
L<span style='color:#800080; '>:</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span>
M<span style='color:#800080; '>:</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span>
Q<span style='color:#800080; '>:</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span>
H<span style='color:#800080; '>:</span> <span style='color:#008c00; '>4</span>
<span style='color:#800080; '>}</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Final format bits with mask (level << 3 | mask).</span>
<span style='color:#800000; font-weight:bold; '>var</span> FINAL_FORMAT <span style='color:#808030; '>=</span> <span style='color:#808030; '>[</span>
<span style='color:#008000; '>0x77c4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x72f3</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x7daa</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x789d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x662f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x6318</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x6c41</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x6976</span><span style='color:#808030; '>,</span> <span style='color:#696969; '>/* L */</span>
<span style='color:#008000; '>0x5412</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5125</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5e7c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5b4b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x45f9</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x40ce</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x4f97</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x4aa0</span><span style='color:#808030; '>,</span> <span style='color:#696969; '>/* M */</span>
<span style='color:#008000; '>0x355f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3068</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3f31</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3a06</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x24b4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x2183</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x2eda</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x2bed</span><span style='color:#808030; '>,</span> <span style='color:#696969; '>/* Q */</span>
<span style='color:#008000; '>0x1689</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x13be</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x1ce7</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x19d0</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0762</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0255</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0d0c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x083b</span> <span style='color:#696969; '>/* H */</span>
<span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Galois field exponent table.</span>
<span style='color:#800000; font-weight:bold; '>var</span> GALOIS_EXPONENT <span style='color:#808030; '>=</span> <span style='color:#808030; '>[</span>
<span style='color:#008000; '>0x01</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x02</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x04</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x08</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x10</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x20</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x40</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x80</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x1d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x74</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe8</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xcd</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x87</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x13</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x26</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x4c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x98</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x2d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x75</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xea</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc9</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x8f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x03</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x06</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x18</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x30</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x60</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc0</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x9d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x27</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x4e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x9c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x25</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x4a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x94</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x35</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x6a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb5</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x77</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xee</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc1</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x9f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x23</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x46</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x8c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x05</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x14</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x28</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x50</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa0</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xba</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x69</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd2</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb9</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x6f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xde</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa1</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x5f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xbe</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x61</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc2</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x99</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x2f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xbc</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x65</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xca</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x89</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x1e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x78</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf0</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0xfd</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe7</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd3</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xbb</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x6b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd6</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb1</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x7f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xfe</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe1</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xdf</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa3</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb6</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x71</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe2</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0xd9</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xaf</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x43</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x86</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x11</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x22</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x44</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x88</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x1a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x34</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x68</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd0</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xbd</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x67</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xce</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x81</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x1f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x7c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf8</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xed</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc7</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x93</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x76</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xec</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc5</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x97</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x33</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x66</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xcc</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x85</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x17</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x2e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb8</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x6d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xda</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa9</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x4f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x9e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x21</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x42</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x84</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x15</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x2a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x54</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0xa8</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x4d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x9a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x29</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x52</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x55</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xaa</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x49</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x92</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x39</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x72</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd5</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb7</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x73</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0xe6</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd1</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xbf</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x63</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc6</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x91</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x7e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xfc</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe5</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd7</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb3</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x7b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf6</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf1</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xff</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0xe3</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xdb</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xab</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x4b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x96</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x31</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x62</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x95</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x37</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x6e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xdc</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa5</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x57</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xae</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x41</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x82</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x19</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x32</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x64</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc8</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x8d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x07</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x1c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x38</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x70</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe0</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xdd</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa7</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x53</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa6</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x51</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa2</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x59</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb2</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x79</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf2</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf9</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xef</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc3</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x9b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x2b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x56</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xac</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x45</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x8a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x09</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x12</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x24</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x48</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x90</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x7a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf5</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf7</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf3</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xfb</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xeb</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xcb</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x8b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x16</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x2c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x58</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb0</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x7d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xfa</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe9</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xcf</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x83</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x1b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x36</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x6c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd8</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xad</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x47</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x8e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x00</span>
<span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Galois field log table.</span>
<span style='color:#800000; font-weight:bold; '>var</span> GALOIS_LOG <span style='color:#808030; '>=</span> <span style='color:#808030; '>[</span>
<span style='color:#008000; '>0xff</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x00</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x01</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x19</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x02</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x32</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x1a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc6</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x03</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xdf</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x33</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xee</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x1b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x68</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc7</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x4b</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x04</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x64</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe0</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x34</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x8d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xef</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x81</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x1c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc1</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x69</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf8</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc8</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x08</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x4c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x71</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x05</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x8a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x65</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x2f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe1</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x24</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x21</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x35</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x93</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x8e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xda</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf0</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x12</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x82</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x45</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x1d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb5</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc2</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x7d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x6a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x27</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf9</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb9</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc9</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x9a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x09</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x78</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x4d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x72</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa6</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x06</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xbf</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x8b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x62</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x66</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xdd</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x30</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xfd</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe2</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x98</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x25</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb3</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x10</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x91</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x22</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x88</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x36</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd0</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x94</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xce</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x8f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x96</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xdb</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xbd</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf1</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd2</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x13</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x83</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x38</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x46</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x40</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x1e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x42</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb6</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa3</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc3</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x48</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x7e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x6e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x6b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x28</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x54</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xfa</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x85</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xba</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3d</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0xca</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x9b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x9f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x15</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x79</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x2b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x4e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe5</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xac</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x73</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf3</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa7</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x57</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x07</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x70</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc0</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf7</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x8c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x80</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x63</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x67</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x4a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xde</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xed</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x31</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc5</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xfe</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x18</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0xe3</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa5</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x99</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x77</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x26</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb8</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x7c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x11</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x44</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x92</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd9</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x23</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x20</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x89</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x2e</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x37</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd1</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x95</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xbc</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xcf</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xcd</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x90</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x87</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x97</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb2</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xdc</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xfc</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xbe</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x61</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0xf2</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x56</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd3</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xab</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x14</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x2a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x9e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x84</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x39</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x53</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x47</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x6d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x41</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa2</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x1f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x2d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x43</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd8</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb7</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x7b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x76</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x17</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x49</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xec</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x7f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x6f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf6</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x6c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa1</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x52</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x29</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x9d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x55</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xaa</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xfb</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x60</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x86</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb1</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xbb</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xcc</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x3e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5a</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0xcb</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x59</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb0</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x9c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa9</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa0</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x51</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x0b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf5</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x16</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xeb</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x7a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x75</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x2c</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd7</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x4f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xae</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd5</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe9</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe6</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe7</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xad</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xe8</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x74</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd6</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xf4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xea</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa8</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x50</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x58</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xaf</span>
<span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// *Badness* coefficients.</span>
<span style='color:#800000; font-weight:bold; '>var</span> N1 <span style='color:#808030; '>=</span> <span style='color:#008c00; '>3</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>var</span> N2 <span style='color:#808030; '>=</span> <span style='color:#008c00; '>3</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>var</span> N3 <span style='color:#808030; '>=</span> <span style='color:#008c00; '>40</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>var</span> N4 <span style='color:#808030; '>=</span> <span style='color:#008c00; '>10</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Version pattern.</span>
<span style='color:#800000; font-weight:bold; '>var</span> VERSION_BLOCK <span style='color:#808030; '>=</span> <span style='color:#808030; '>[</span>
<span style='color:#008000; '>0xc94</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x5bc</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa99</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x4d3</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xbf6</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x762</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x847</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x60d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x928</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb78</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x45d</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa17</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x532</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x9a6</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x683</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x8c9</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x7ec</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xec4</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x1e1</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xfab</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x08e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc1a</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x33f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xd75</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x250</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x9d5</span><span style='color:#808030; '>,</span>
<span style='color:#008000; '>0x6f0</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x8ba</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x79f</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xb0b</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x42e</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xa64</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0x541</span><span style='color:#808030; '>,</span> <span style='color:#008000; '>0xc69</span>
<span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Mode for node.js file system file writes.</span>
<span style='color:#800000; font-weight:bold; '>var</span> WRITE_MODE <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>parseInt</span><span style='color:#808030; '>(</span><span style='color:#0000e6; '>'0666'</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Private variables</span>
<span style='color:#696969; '>// -----------------</span>
<span style='color:#696969; '>// Run lengths for badness.</span>
<span style='color:#800000; font-weight:bold; '>var</span> badBuffer <span style='color:#808030; '>=</span> <span style='color:#808030; '>[</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Constructor for `canvas` elements in the node.js environment.</span>
<span style='color:#800000; font-weight:bold; '>var</span> Canvas<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Data block.</span>
<span style='color:#800000; font-weight:bold; '>var</span> dataBlock<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// ECC data blocks and tables.</span>
<span style='color:#800000; font-weight:bold; '>var</span> eccBlock<span style='color:#808030; '>,</span> neccBlock1<span style='color:#808030; '>,</span> neccBlock2<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// ECC buffer.</span>
<span style='color:#800000; font-weight:bold; '>var</span> eccBuffer <span style='color:#808030; '>=</span> <span style='color:#808030; '>[</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// ECC level (defaults to **L**).</span>
<span style='color:#800000; font-weight:bold; '>var</span> eccLevel <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Image buffer.</span>
<span style='color:#800000; font-weight:bold; '>var</span> frameBuffer <span style='color:#808030; '>=</span> <span style='color:#808030; '>[</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Fixed part of the image.</span>
<span style='color:#800000; font-weight:bold; '>var</span> frameMask <span style='color:#808030; '>=</span> <span style='color:#808030; '>[</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// File system within the node.js environment.</span>
<span style='color:#800000; font-weight:bold; '>var</span> fs<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Constructor for `img` elements in the node.js environment.</span>
<span style='color:#800000; font-weight:bold; '>var</span> <span style='color:#797997; '>Image</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Indicates whether or not this script is running in node.js.</span>
<span style='color:#800000; font-weight:bold; '>var</span> inNode <span style='color:#808030; '>=</span> <span style='color:#0f4d75; '>false</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Generator polynomial.</span>
<span style='color:#800000; font-weight:bold; '>var</span> polynomial <span style='color:#808030; '>=</span> <span style='color:#808030; '>[</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Save the previous value of the `qr` variable.</span>
<span style='color:#800000; font-weight:bold; '>var</span> previousQr <span style='color:#808030; '>=</span> root<span style='color:#808030; '>.</span>qr<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Data input buffer.</span>
<span style='color:#800000; font-weight:bold; '>var</span> stringBuffer <span style='color:#808030; '>=</span> <span style='color:#808030; '>[</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Version for the data.</span>
<span style='color:#800000; font-weight:bold; '>var</span> version<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Data width is based on `version`.</span>
<span style='color:#800000; font-weight:bold; '>var</span> width<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Private functions</span>
<span style='color:#696969; '>// -----------------</span>
<span style='color:#696969; '>// Create a new canvas using `document.createElement` unless script is running in node.js, in</span>
<span style='color:#696969; '>// which case the `canvas` module is used.</span>
<span style='color:#800000; font-weight:bold; '>function</span> createCanvas<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>return</span> inNode <span style='color:#800080; '>?</span> <span style='color:#800000; font-weight:bold; '>new</span> Canvas<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>:</span> root<span style='color:#808030; '>.</span>document<span style='color:#808030; '>.</span>createElement<span style='color:#808030; '>(</span><span style='color:#0000e6; '>'canvas'</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Create a new image using `document.createElement` unless script is running in node.js, in</span>
<span style='color:#696969; '>// which case the `canvas` module is used.</span>
<span style='color:#800000; font-weight:bold; '>function</span> createImage<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>return</span> inNode <span style='color:#800080; '>?</span> <span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#797997; '>Image</span><span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>:</span> root<span style='color:#808030; '>.</span>document<span style='color:#808030; '>.</span>createElement<span style='color:#808030; '>(</span><span style='color:#0000e6; '>'img'</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Force the canvas image to be downloaded in the browser. </span>
<span style='color:#696969; '>// Optionally, a `callback` function can be specified which will be called upon completed. Since</span>
<span style='color:#696969; '>// this is not an asynchronous operation, this is merely convenient and helps simplify the</span>
<span style='color:#696969; '>// calling code.</span>
<span style='color:#800000; font-weight:bold; '>function</span> download<span style='color:#808030; '>(</span>cvs<span style='color:#808030; '>,</span> data<span style='color:#808030; '>,</span> callback<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>var</span> mime <span style='color:#808030; '>=</span> data<span style='color:#808030; '>.</span>mime <span style='color:#808030; '>||</span> DEFAULT_MIME<span style='color:#800080; '>;</span>
root<span style='color:#808030; '>.</span>location<span style='color:#808030; '>.</span>href <span style='color:#808030; '>=</span> cvs<span style='color:#808030; '>.</span>toDataURL<span style='color:#808030; '>(</span>mime<span style='color:#808030; '>)</span><span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>replace</span><span style='color:#808030; '>(</span>mime<span style='color:#808030; '>,</span> DOWNLOAD_MIME<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>typeof</span> callback <span style='color:#808030; '>===</span> <span style='color:#0000e6; '>'function'</span><span style='color:#808030; '>)</span> callback<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Normalize the `data` that is provided to the main API.</span>
<span style='color:#800000; font-weight:bold; '>function</span> normalizeData<span style='color:#808030; '>(</span>data<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>typeof</span> data <span style='color:#808030; '>===</span> <span style='color:#0000e6; '>'string'</span><span style='color:#808030; '>)</span> data <span style='color:#808030; '>=</span> <span style='color:#800080; '>{</span> value<span style='color:#800080; '>:</span> data <span style='color:#800080; '>}</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>return</span> data <span style='color:#808030; '>||</span> <span style='color:#800080; '>{</span><span style='color:#800080; '>}</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Override the `qr` API methods that require HTML5 canvas support to throw a relevant error.</span>
<span style='color:#800000; font-weight:bold; '>function</span> overrideAPI<span style='color:#808030; '>(</span>qr<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>var</span> methods <span style='color:#808030; '>=</span> <span style='color:#808030; '>[</span> <span style='color:#0000e6; '>'canvas'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'image'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'save'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'saveSync'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'toDataURL'</span> <span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>var</span> i<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>function</span> overrideMethod<span style='color:#808030; '>(</span>name<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
qr<span style='color:#808030; '>[</span>name<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>function</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>throw</span> <span style='color:#800000; font-weight:bold; '>new</span> Error<span style='color:#808030; '>(</span>name <span style='color:#808030; '>+</span> <span style='color:#0000e6; '>' requires HTML5 canvas element support'</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><</span> methods<span style='color:#808030; '>.</span>length<span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
overrideMethod<span style='color:#808030; '>(</span>methods<span style='color:#808030; '>[</span>i<span style='color:#808030; '>]</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Asynchronously write the data of the rendered canvas to a given file path.</span>
<span style='color:#800000; font-weight:bold; '>function</span> writeFile<span style='color:#808030; '>(</span>cvs<span style='color:#808030; '>,</span> data<span style='color:#808030; '>,</span> callback<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>typeof</span> data<span style='color:#808030; '>.</span>path <span style='color:#808030; '>!==</span> <span style='color:#0000e6; '>'string'</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>return</span> callback<span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>new</span> TypeError<span style='color:#808030; '>(</span><span style='color:#0000e6; '>'Invalid path type: '</span> <span style='color:#808030; '>+</span> <span style='color:#800000; font-weight:bold; '>typeof</span> data<span style='color:#808030; '>.</span>path<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>var</span> fd<span style='color:#808030; '>,</span> buff<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Write the buffer to the open file stream once both prerequisites are met.</span>
<span style='color:#800000; font-weight:bold; '>function</span> writeBuffer<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
fs<span style='color:#808030; '>.</span>write<span style='color:#808030; '>(</span>fd<span style='color:#808030; '>,</span> buff<span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> buff<span style='color:#808030; '>.</span>length<span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#800000; font-weight:bold; '>function</span> <span style='color:#808030; '>(</span>error<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
fs<span style='color:#808030; '>.</span>close<span style='color:#808030; '>(</span>fd<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
callback<span style='color:#808030; '>(</span>error<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Create a buffer of the canvas' data.</span>
cvs<span style='color:#808030; '>.</span>toBuffer<span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>function</span> <span style='color:#808030; '>(</span>error<span style='color:#808030; '>,</span> _buff<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>error<span style='color:#808030; '>)</span> <span style='color:#800000; font-weight:bold; '>return</span> callback<span style='color:#808030; '>(</span>error<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
buff <span style='color:#808030; '>=</span> _buff<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>fd<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
writeBuffer<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Open a stream for the file to be written.</span>
fs<span style='color:#808030; '>.</span>open<span style='color:#808030; '>(</span>data<span style='color:#808030; '>.</span>path<span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'w'</span><span style='color:#808030; '>,</span> WRITE_MODE<span style='color:#808030; '>,</span> <span style='color:#800000; font-weight:bold; '>function</span> <span style='color:#808030; '>(</span>error<span style='color:#808030; '>,</span> _fd<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>error<span style='color:#808030; '>)</span> <span style='color:#800000; font-weight:bold; '>return</span> callback<span style='color:#808030; '>(</span>error<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
fd <span style='color:#808030; '>=</span> _fd<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>buff<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
writeBuffer<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Write the data of the rendered canvas to a given file path.</span>
<span style='color:#800000; font-weight:bold; '>function</span> writeFileSync<span style='color:#808030; '>(</span>cvs<span style='color:#808030; '>,</span> data<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>typeof</span> data<span style='color:#808030; '>.</span>path <span style='color:#808030; '>!==</span> <span style='color:#0000e6; '>'string'</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>throw</span> <span style='color:#800000; font-weight:bold; '>new</span> TypeError<span style='color:#808030; '>(</span><span style='color:#0000e6; '>'Invalid path type: '</span> <span style='color:#808030; '>+</span> <span style='color:#800000; font-weight:bold; '>typeof</span> data<span style='color:#808030; '>.</span>path<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>var</span> buff <span style='color:#808030; '>=</span> cvs<span style='color:#808030; '>.</span>toBuffer<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>var</span> fd <span style='color:#808030; '>=</span> fs<span style='color:#808030; '>.</span>openSync<span style='color:#808030; '>(</span>data<span style='color:#808030; '>.</span>path<span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'w'</span><span style='color:#808030; '>,</span> WRITE_MODE<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>try</span> <span style='color:#800080; '>{</span>
fs<span style='color:#808030; '>.</span>writeSync<span style='color:#808030; '>(</span>fd<span style='color:#808030; '>,</span> buff<span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> buff<span style='color:#808030; '>.</span>length<span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>finally</span> <span style='color:#800080; '>{</span>
fs<span style='color:#808030; '>.</span>closeSync<span style='color:#808030; '>(</span>fd<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Set bit to indicate cell in frame is immutable (symmetric around diagonal).</span>
<span style='color:#800000; font-weight:bold; '>function</span> setMask<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>var</span> bit<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>></span> y<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
bit <span style='color:#808030; '>=</span> x<span style='color:#800080; '>;</span>
x <span style='color:#808030; '>=</span> y<span style='color:#800080; '>;</span>
y <span style='color:#808030; '>=</span> bit<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
bit <span style='color:#808030; '>=</span> y<span style='color:#800080; '>;</span>
bit <span style='color:#808030; '>*=</span> y<span style='color:#800080; '>;</span>
bit <span style='color:#808030; '>+=</span> y<span style='color:#800080; '>;</span>
bit <span style='color:#808030; '>></span><span style='color:#808030; '>>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
bit <span style='color:#808030; '>+=</span> x<span style='color:#800080; '>;</span>
frameMask<span style='color:#808030; '>[</span>bit<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Enter alignment pattern. Foreground colour to frame, background to mask. Frame will be merged</span>
<span style='color:#696969; '>// with mask later.</span>
<span style='color:#800000; font-weight:bold; '>function</span> addAlignment<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>var</span> i<span style='color:#800080; '>;</span>
frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> y<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#808030; '>-</span><span style='color:#008c00; '>2</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><</span> <span style='color:#008c00; '>2</span><span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>x <span style='color:#808030; '>+</span> i<span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>-</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>x <span style='color:#808030; '>-</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>x <span style='color:#808030; '>+</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> i<span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>x <span style='color:#808030; '>+</span> i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><</span> <span style='color:#008c00; '>2</span><span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
setMask<span style='color:#808030; '>(</span>x <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> y <span style='color:#808030; '>+</span> i<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
setMask<span style='color:#808030; '>(</span>x <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> y <span style='color:#808030; '>-</span> i<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
setMask<span style='color:#808030; '>(</span>x <span style='color:#808030; '>-</span> i<span style='color:#808030; '>,</span> y <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
setMask<span style='color:#808030; '>(</span>x <span style='color:#808030; '>+</span> i<span style='color:#808030; '>,</span> y <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Exponentiation mod N.</span>
<span style='color:#800000; font-weight:bold; '>function</span> modN<span style='color:#808030; '>(</span>x<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>while</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>>=</span> <span style='color:#008c00; '>255</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
x <span style='color:#808030; '>-</span><span style='color:#808030; '>=</span> <span style='color:#008c00; '>255</span><span style='color:#800080; '>;</span>
x <span style='color:#808030; '>=</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>></span><span style='color:#808030; '>></span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>&</span> <span style='color:#008c00; '>255</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>return</span> x<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Calculate and append `ecc` data to the `data` block. If block is in the string buffer the</span>
<span style='color:#696969; '>// indices to buffers are used.</span>
<span style='color:#800000; font-weight:bold; '>function</span> appendData<span style='color:#808030; '>(</span>data<span style='color:#808030; '>,</span> dataLength<span style='color:#808030; '>,</span> ecc<span style='color:#808030; '>,</span> eccLength<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>var</span> bit<span style='color:#808030; '>,</span> i<span style='color:#808030; '>,</span> j<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><</span> eccLength<span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
stringBuffer<span style='color:#808030; '>[</span>ecc <span style='color:#808030; '>+</span> i<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><</span> dataLength<span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
bit <span style='color:#808030; '>=</span> GALOIS_LOG<span style='color:#808030; '>[</span>stringBuffer<span style='color:#808030; '>[</span>data <span style='color:#808030; '>+</span> i<span style='color:#808030; '>]</span> <span style='color:#808030; '>^</span> stringBuffer<span style='color:#808030; '>[</span>ecc<span style='color:#808030; '>]</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>bit <span style='color:#808030; '>!==</span> <span style='color:#008c00; '>255</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>j <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span> j <span style='color:#808030; '><</span> eccLength<span style='color:#800080; '>;</span> j<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
stringBuffer<span style='color:#808030; '>[</span>ecc <span style='color:#808030; '>+</span> j <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> stringBuffer<span style='color:#808030; '>[</span>ecc <span style='color:#808030; '>+</span> j<span style='color:#808030; '>]</span> <span style='color:#808030; '>^</span>
GALOIS_EXPONENT<span style='color:#808030; '>[</span>modN<span style='color:#808030; '>(</span>bit <span style='color:#808030; '>+</span> polynomial<span style='color:#808030; '>[</span>eccLength <span style='color:#808030; '>-</span> j<span style='color:#808030; '>]</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>j <span style='color:#808030; '>=</span> ecc<span style='color:#800080; '>;</span> j <span style='color:#808030; '><</span> ecc <span style='color:#808030; '>+</span> eccLength<span style='color:#800080; '>;</span> j<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
stringBuffer<span style='color:#808030; '>[</span>j<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> stringBuffer<span style='color:#808030; '>[</span>j <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
stringBuffer<span style='color:#808030; '>[</span>ecc <span style='color:#808030; '>+</span> eccLength <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> bit <span style='color:#808030; '>===</span> <span style='color:#008c00; '>255</span> <span style='color:#800080; '>?</span> <span style='color:#008c00; '>0</span> <span style='color:#800080; '>:</span>
GALOIS_EXPONENT<span style='color:#808030; '>[</span>modN<span style='color:#808030; '>(</span>bit <span style='color:#808030; '>+</span> polynomial<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Check mask since symmetricals use half.</span>
<span style='color:#800000; font-weight:bold; '>function</span> isMasked<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>var</span> bit<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>></span> y<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
bit <span style='color:#808030; '>=</span> x<span style='color:#800080; '>;</span>
x <span style='color:#808030; '>=</span> y<span style='color:#800080; '>;</span>
y <span style='color:#808030; '>=</span> bit<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
bit <span style='color:#808030; '>=</span> y<span style='color:#800080; '>;</span>
bit <span style='color:#808030; '>+=</span> y <span style='color:#808030; '>*</span> y<span style='color:#800080; '>;</span>
bit <span style='color:#808030; '>></span><span style='color:#808030; '>>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
bit <span style='color:#808030; '>+=</span> x<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>return</span> frameMask<span style='color:#808030; '>[</span>bit<span style='color:#808030; '>]</span> <span style='color:#808030; '>===</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Apply the selected mask out of the 8 options.</span>
<span style='color:#800000; font-weight:bold; '>function</span> applyMask<span style='color:#808030; '>(</span>mask<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>var</span> x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>,</span> r3x<span style='color:#808030; '>,</span> r3y<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>switch</span> <span style='color:#808030; '>(</span>mask<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>case</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>:</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>!</span><span style='color:#808030; '>(</span><span style='color:#808030; '>(</span>x <span style='color:#808030; '>+</span> y<span style='color:#808030; '>)</span> <span style='color:#808030; '>&</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&&</span> <span style='color:#808030; '>!</span>isMasked<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> y <span style='color:#808030; '>*</span> width<span style='color:#808030; '>]</span> <span style='color:#808030; '>^=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>case</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>:</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>!</span><span style='color:#808030; '>(</span>y <span style='color:#808030; '>&</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&&</span> <span style='color:#808030; '>!</span>isMasked<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> y <span style='color:#808030; '>*</span> width<span style='color:#808030; '>]</span> <span style='color:#808030; '>^=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>case</span> <span style='color:#008c00; '>2</span><span style='color:#800080; '>:</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>,</span> r3x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>===</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span> r3x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>!</span>r3x <span style='color:#808030; '>&&</span> <span style='color:#808030; '>!</span>isMasked<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> y <span style='color:#808030; '>*</span> width<span style='color:#808030; '>]</span> <span style='color:#808030; '>^=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>case</span> <span style='color:#008c00; '>3</span><span style='color:#800080; '>:</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>r3y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>,</span> r3y<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>r3y <span style='color:#808030; '>===</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span> r3y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>=</span> r3y<span style='color:#808030; '>,</span> x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>,</span> r3x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>===</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span> r3x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>!</span>r3x <span style='color:#808030; '>&&</span> <span style='color:#808030; '>!</span>isMasked<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> y <span style='color:#808030; '>*</span> width<span style='color:#808030; '>]</span> <span style='color:#808030; '>^=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>case</span> <span style='color:#008c00; '>4</span><span style='color:#800080; '>:</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> r3y <span style='color:#808030; '>=</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>(</span>y <span style='color:#808030; '>></span><span style='color:#808030; '>></span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#808030; '>,</span> x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>,</span> r3x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>===</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
r3x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
r3y <span style='color:#808030; '>=</span> <span style='color:#808030; '>!</span>r3y<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>!</span>r3y <span style='color:#808030; '>&&</span> <span style='color:#808030; '>!</span>isMasked<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> y <span style='color:#808030; '>*</span> width<span style='color:#808030; '>]</span> <span style='color:#808030; '>^=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>case</span> <span style='color:#008c00; '>5</span><span style='color:#800080; '>:</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>r3y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>,</span> r3y<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>r3y <span style='color:#808030; '>===</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span> r3y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>,</span> r3x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>===</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span> r3x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>!</span><span style='color:#808030; '>(</span><span style='color:#808030; '>(</span>x <span style='color:#808030; '>&</span> y <span style='color:#808030; '>&</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> <span style='color:#808030; '>!</span><span style='color:#808030; '>(</span><span style='color:#808030; '>!</span>r3x <span style='color:#808030; '>|</span> <span style='color:#808030; '>!</span>r3y<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&&</span> <span style='color:#808030; '>!</span>isMasked<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> y <span style='color:#808030; '>*</span> width<span style='color:#808030; '>]</span> <span style='color:#808030; '>^=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>case</span> <span style='color:#008c00; '>6</span><span style='color:#800080; '>:</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>r3y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>,</span> r3y<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>r3y <span style='color:#808030; '>===</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span> r3y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>,</span> r3x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>===</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span> r3x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>!</span><span style='color:#808030; '>(</span><span style='color:#808030; '>(</span><span style='color:#808030; '>(</span>x <span style='color:#808030; '>&</span> y <span style='color:#808030; '>&</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>&&</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>===</span> r3y<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&&</span> <span style='color:#808030; '>!</span>isMasked<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> y <span style='color:#808030; '>*</span> width<span style='color:#808030; '>]</span> <span style='color:#808030; '>^=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>case</span> <span style='color:#008c00; '>7</span><span style='color:#800080; '>:</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>r3y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>,</span> r3y<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>r3y <span style='color:#808030; '>===</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span> r3y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>,</span> r3x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>===</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span> r3x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>!</span><span style='color:#808030; '>(</span><span style='color:#808030; '>(</span><span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>&&</span> <span style='color:#808030; '>(</span>r3x <span style='color:#808030; '>===</span> r3y<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>(</span>x <span style='color:#808030; '>+</span> y<span style='color:#808030; '>)</span> <span style='color:#808030; '>&</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&&</span> <span style='color:#808030; '>!</span>isMasked<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> y <span style='color:#808030; '>*</span> width<span style='color:#808030; '>]</span> <span style='color:#808030; '>^=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Using the table for the length of each run, calculate the amount of bad image. Long runs or</span>
<span style='color:#696969; '>// those that look like finders are called twice; once for X and Y.</span>
<span style='color:#800000; font-weight:bold; '>function</span> getBadRuns<span style='color:#808030; '>(</span>length<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>var</span> badRuns <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>var</span> i<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><=</span> length<span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>badBuffer<span style='color:#808030; '>[</span>i<span style='color:#808030; '>]</span> <span style='color:#808030; '>>=</span> <span style='color:#008c00; '>5</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
badRuns <span style='color:#808030; '>+=</span> N1 <span style='color:#808030; '>+</span> badBuffer<span style='color:#808030; '>[</span>i<span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008c00; '>5</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// FBFFFBF as in finder.</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>3</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><</span> length <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '>+=</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>badBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>-</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>===</span> badBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>&&</span>
badBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>===</span> badBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>&&</span>
badBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>===</span> badBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>&&</span>
badBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>*</span> <span style='color:#008c00; '>3</span> <span style='color:#808030; '>===</span> badBuffer<span style='color:#808030; '>[</span>i<span style='color:#808030; '>]</span> <span style='color:#808030; '>&&</span>
<span style='color:#696969; '>// Background around the foreground pattern? Not part of the specs.</span>
<span style='color:#808030; '>(</span>badBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>-</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>===</span> <span style='color:#008c00; '>0</span> <span style='color:#808030; '>||</span> i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>3</span> <span style='color:#808030; '>></span> length <span style='color:#808030; '>||</span>
badBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>-</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>*</span> <span style='color:#008c00; '>3</span> <span style='color:#808030; '>>=</span> badBuffer<span style='color:#808030; '>[</span>i<span style='color:#808030; '>]</span> <span style='color:#808030; '>*</span> <span style='color:#008c00; '>4</span> <span style='color:#808030; '>||</span>
badBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>*</span> <span style='color:#008c00; '>3</span> <span style='color:#808030; '>>=</span> badBuffer<span style='color:#808030; '>[</span>i<span style='color:#808030; '>]</span> <span style='color:#808030; '>*</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
badRuns <span style='color:#808030; '>+=</span> N3<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>return</span> badRuns<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Calculate how bad the masked image is (e.g. blocks, imbalance, runs, or finders).</span>
<span style='color:#800000; font-weight:bold; '>function</span> checkBadness<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>var</span> b<span style='color:#808030; '>,</span> b1<span style='color:#808030; '>,</span> bad<span style='color:#808030; '>,</span> <span style='color:#800000; font-weight:bold; '>big</span><span style='color:#808030; '>,</span> bw<span style='color:#808030; '>,</span> count<span style='color:#808030; '>,</span> h<span style='color:#808030; '>,</span> x<span style='color:#808030; '>,</span> y<span style='color:#800080; '>;</span>
bad <span style='color:#808030; '>=</span> bw <span style='color:#808030; '>=</span> count <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Blocks of same colour.</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#696969; '>// All foreground colour.</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>(</span>frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> y<span style='color:#808030; '>]</span> <span style='color:#808030; '>&&</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>x <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> y<span style='color:#808030; '>]</span> <span style='color:#808030; '>&&</span>
frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>&&</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>x <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>||</span>
<span style='color:#696969; '>// All background colour.</span>
<span style='color:#808030; '>!</span><span style='color:#808030; '>(</span>frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> y<span style='color:#808030; '>]</span> <span style='color:#808030; '>||</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>x <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> y<span style='color:#808030; '>]</span> <span style='color:#808030; '>||</span>
frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>||</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>x <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
bad <span style='color:#808030; '>+=</span> N2<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// X runs.</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
badBuffer<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>h <span style='color:#808030; '>=</span> b <span style='color:#808030; '>=</span> x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>(</span>b1 <span style='color:#808030; '>=</span> frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> y<span style='color:#808030; '>]</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>===</span> b<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
badBuffer<span style='color:#808030; '>[</span>h<span style='color:#808030; '>]</span><span style='color:#808030; '>++</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
badBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>++</span>h<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
b <span style='color:#808030; '>=</span> b1<span style='color:#800080; '>;</span>
bw <span style='color:#808030; '>+=</span> b <span style='color:#800080; '>?</span> <span style='color:#008c00; '>1</span> <span style='color:#800080; '>:</span> <span style='color:#808030; '>-</span><span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
bad <span style='color:#808030; '>+=</span> getBadRuns<span style='color:#808030; '>(</span>h<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>bw <span style='color:#808030; '><</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>)</span> bw <span style='color:#808030; '>=</span> <span style='color:#808030; '>-</span>bw<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>big</span> <span style='color:#808030; '>=</span> bw<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>big</span> <span style='color:#808030; '>+=</span> <span style='color:#800000; font-weight:bold; '>big</span> <span style='color:#808030; '><<</span> <span style='color:#008c00; '>2</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>big</span> <span style='color:#808030; '><<=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>while</span> <span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>big</span> <span style='color:#808030; '>></span> width <span style='color:#808030; '>*</span> width<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>big</span> <span style='color:#808030; '>-</span><span style='color:#808030; '>=</span> width <span style='color:#808030; '>*</span> width<span style='color:#800080; '>;</span>
count<span style='color:#808030; '>++</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
bad <span style='color:#808030; '>+=</span> count <span style='color:#808030; '>*</span> N4<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Y runs.</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
badBuffer<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>h <span style='color:#808030; '>=</span> b <span style='color:#808030; '>=</span> y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>(</span>b1 <span style='color:#808030; '>=</span> frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> y<span style='color:#808030; '>]</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>===</span> b<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
badBuffer<span style='color:#808030; '>[</span>h<span style='color:#808030; '>]</span><span style='color:#808030; '>++</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
badBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>++</span>h<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
b <span style='color:#808030; '>=</span> b1<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
bad <span style='color:#808030; '>+=</span> getBadRuns<span style='color:#808030; '>(</span>h<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>return</span> bad<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Generate the encoded QR image for the string provided.</span>
<span style='color:#800000; font-weight:bold; '>function</span> generateFrame<span style='color:#808030; '>(</span>str<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>var</span> i<span style='color:#808030; '>,</span> j<span style='color:#808030; '>,</span> k<span style='color:#808030; '>,</span> m<span style='color:#808030; '>,</span> t<span style='color:#808030; '>,</span> v<span style='color:#808030; '>,</span> x<span style='color:#808030; '>,</span> y<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Find the smallest version that fits the string.</span>
t <span style='color:#808030; '>=</span> str<span style='color:#808030; '>.</span>length<span style='color:#800080; '>;</span>
version <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>do</span> <span style='color:#800080; '>{</span>
version<span style='color:#808030; '>++</span><span style='color:#800080; '>;</span>
k <span style='color:#808030; '>=</span> <span style='color:#808030; '>(</span>eccLevel <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>*</span> <span style='color:#008c00; '>4</span> <span style='color:#808030; '>+</span> <span style='color:#808030; '>(</span>version <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>*</span> <span style='color:#008c00; '>16</span><span style='color:#800080; '>;</span>
neccBlock1 <span style='color:#808030; '>=</span> ECC_BLOCKS<span style='color:#808030; '>[</span>k<span style='color:#808030; '>++</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
neccBlock2 <span style='color:#808030; '>=</span> ECC_BLOCKS<span style='color:#808030; '>[</span>k<span style='color:#808030; '>++</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
dataBlock <span style='color:#808030; '>=</span> ECC_BLOCKS<span style='color:#808030; '>[</span>k<span style='color:#808030; '>++</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
eccBlock <span style='color:#808030; '>=</span> ECC_BLOCKS<span style='color:#808030; '>[</span>k<span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
k <span style='color:#808030; '>=</span> dataBlock <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>neccBlock1 <span style='color:#808030; '>+</span> neccBlock2<span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> neccBlock2 <span style='color:#808030; '>-</span> <span style='color:#008c00; '>3</span> <span style='color:#808030; '>+</span> <span style='color:#808030; '>(</span>version <span style='color:#808030; '><=</span> <span style='color:#008c00; '>9</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>t <span style='color:#808030; '><=</span> k<span style='color:#808030; '>)</span> <span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>while</span> <span style='color:#808030; '>(</span>version <span style='color:#808030; '><</span> <span style='color:#008c00; '>40</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// FIXME: Ensure that it fits insted of being truncated.</span>
width <span style='color:#808030; '>=</span> <span style='color:#008c00; '>17</span> <span style='color:#808030; '>+</span> <span style='color:#008c00; '>4</span> <span style='color:#808030; '>*</span> version<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Allocate, clear and setup data structures.</span>
v <span style='color:#808030; '>=</span> dataBlock <span style='color:#808030; '>+</span> <span style='color:#808030; '>(</span>dataBlock <span style='color:#808030; '>+</span> eccBlock<span style='color:#808030; '>)</span> <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>neccBlock1 <span style='color:#808030; '>+</span> neccBlock2<span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> neccBlock2<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>t <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> t <span style='color:#808030; '><</span> v<span style='color:#800080; '>;</span> t<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
eccBuffer<span style='color:#808030; '>[</span>t<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
stringBuffer <span style='color:#808030; '>=</span> str<span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>slice</span><span style='color:#808030; '>(</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>t <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> t <span style='color:#808030; '><</span> width <span style='color:#808030; '>*</span> width<span style='color:#800080; '>;</span> t<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span>t<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>t <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> t <span style='color:#808030; '><</span> <span style='color:#808030; '>(</span>width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>width <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>/</span> <span style='color:#008c00; '>2</span><span style='color:#800080; '>;</span> t<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameMask<span style='color:#808030; '>[</span>t<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Insert finders: Foreground colour to frame and background to mask.</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>t <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> t <span style='color:#808030; '><</span> <span style='color:#008c00; '>3</span><span style='color:#800080; '>;</span> t<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
k <span style='color:#808030; '>=</span> y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>t <span style='color:#808030; '>===</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> k <span style='color:#808030; '>=</span> <span style='color:#808030; '>(</span>width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>t <span style='color:#808030; '>===</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>)</span> y <span style='color:#808030; '>=</span> <span style='color:#808030; '>(</span>width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '>+</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> <span style='color:#008c00; '>6</span><span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> x<span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> k<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
frameBuffer<span style='color:#808030; '>[</span>y <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '>+</span> x <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '>+</span> x<span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> x <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '>+</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> <span style='color:#008c00; '>5</span><span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
setMask<span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> x<span style='color:#808030; '>,</span> k <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
setMask<span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> k <span style='color:#808030; '>+</span> x <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
setMask<span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> <span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> k <span style='color:#808030; '>+</span> x<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
setMask<span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> x <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> k <span style='color:#808030; '>+</span> <span style='color:#008c00; '>5</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>2</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> <span style='color:#008c00; '>4</span><span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> x<span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '>+</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '>+</span> x <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '>+</span> x<span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>y <span style='color:#808030; '>+</span> x <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '>+</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Alignment blocks.</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>version <span style='color:#808030; '>></span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
t <span style='color:#808030; '>=</span> ALIGNMENT_DELTA<span style='color:#808030; '>[</span>version<span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
y <span style='color:#808030; '>=</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>7</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span><span style='color:#800080; '>;</span><span style='color:#800080; '>;</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
x <span style='color:#808030; '>=</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>7</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>while</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>></span> t <span style='color:#808030; '>-</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
addAlignment<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '><</span> t<span style='color:#808030; '>)</span> <span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
x <span style='color:#808030; '>-</span><span style='color:#808030; '>=</span> t<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '><=</span> t <span style='color:#808030; '>+</span> <span style='color:#008c00; '>9</span><span style='color:#808030; '>)</span> <span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
y <span style='color:#808030; '>-</span><span style='color:#808030; '>=</span> t<span style='color:#800080; '>;</span>
addAlignment<span style='color:#808030; '>(</span><span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
addAlignment<span style='color:#808030; '>(</span>y<span style='color:#808030; '>,</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Single foreground cell.</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#008c00; '>8</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Timing gap (mask only).</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> <span style='color:#008c00; '>7</span><span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
setMask<span style='color:#808030; '>(</span><span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
setMask<span style='color:#808030; '>(</span>width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
setMask<span style='color:#808030; '>(</span><span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> y <span style='color:#808030; '>+</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> <span style='color:#008c00; '>8</span><span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
setMask<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
setMask<span style='color:#808030; '>(</span>x <span style='color:#808030; '>+</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
setMask<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Reserve mask, format area.</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> <span style='color:#008c00; '>9</span><span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
setMask<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> <span style='color:#008c00; '>8</span><span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
setMask<span style='color:#808030; '>(</span>x <span style='color:#808030; '>+</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
setMask<span style='color:#808030; '>(</span><span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> x<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> <span style='color:#008c00; '>7</span><span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
setMask<span style='color:#808030; '>(</span><span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> y <span style='color:#808030; '>+</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Timing row/column.</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>14</span><span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>&</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
setMask<span style='color:#808030; '>(</span><span style='color:#008c00; '>8</span> <span style='color:#808030; '>+</span> x<span style='color:#808030; '>,</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
setMask<span style='color:#808030; '>(</span><span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>8</span> <span style='color:#808030; '>+</span> x<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span><span style='color:#008c00; '>8</span> <span style='color:#808030; '>+</span> x<span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#008c00; '>6</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span><span style='color:#008c00; '>8</span> <span style='color:#808030; '>+</span> x<span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Version block.</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>version <span style='color:#808030; '>></span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
t <span style='color:#808030; '>=</span> VERSION_BLOCK<span style='color:#808030; '>[</span>version <span style='color:#808030; '>-</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
k <span style='color:#808030; '>=</span> <span style='color:#008c00; '>17</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><</span> <span style='color:#008c00; '>6</span><span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> <span style='color:#008c00; '>3</span><span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>,</span> k<span style='color:#808030; '>--</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#008c00; '>1</span> <span style='color:#808030; '>&</span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '>></span> <span style='color:#008c00; '>11</span> <span style='color:#800080; '>?</span> version <span style='color:#808030; '>></span><span style='color:#808030; '>></span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '>-</span> <span style='color:#008c00; '>12</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>:</span> t <span style='color:#808030; '>></span><span style='color:#808030; '>></span> k<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span><span style='color:#008c00; '>5</span> <span style='color:#808030; '>-</span> x<span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span><span style='color:#008c00; '>2</span> <span style='color:#808030; '>-</span> y <span style='color:#808030; '>+</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span><span style='color:#008c00; '>2</span> <span style='color:#808030; '>-</span> y <span style='color:#808030; '>+</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span><span style='color:#008c00; '>5</span> <span style='color:#808030; '>-</span> x<span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
setMask<span style='color:#808030; '>(</span><span style='color:#008c00; '>5</span> <span style='color:#808030; '>-</span> x<span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span> <span style='color:#808030; '>-</span> y <span style='color:#808030; '>+</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
setMask<span style='color:#808030; '>(</span><span style='color:#008c00; '>2</span> <span style='color:#808030; '>-</span> y <span style='color:#808030; '>+</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>5</span> <span style='color:#808030; '>-</span> x<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Sync mask bits. Only set above for background cells, so now add the foreground.</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> y <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> y<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> x <span style='color:#808030; '><=</span> y<span style='color:#800080; '>;</span> x<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> y<span style='color:#808030; '>]</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
setMask<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Convert string to bit stream. 8-bit data to QR-coded 8-bit data (numeric, alphanum, or kanji</span>
<span style='color:#696969; '>// not supported).</span>
v <span style='color:#808030; '>=</span> stringBuffer<span style='color:#808030; '>.</span>length<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// String to array.</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><</span> v<span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
eccBuffer<span style='color:#808030; '>[</span>i<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> stringBuffer<span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>charCodeAt</span><span style='color:#808030; '>(</span>i<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
stringBuffer <span style='color:#808030; '>=</span> eccBuffer<span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>slice</span><span style='color:#808030; '>(</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Calculate max string length.</span>
x <span style='color:#808030; '>=</span> dataBlock <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>neccBlock1 <span style='color:#808030; '>+</span> neccBlock2<span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> neccBlock2<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>v <span style='color:#808030; '>>=</span> x <span style='color:#808030; '>-</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
v <span style='color:#808030; '>=</span> x <span style='color:#808030; '>-</span> <span style='color:#008c00; '>2</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>version <span style='color:#808030; '>></span> <span style='color:#008c00; '>9</span><span style='color:#808030; '>)</span> v<span style='color:#808030; '>--</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Shift and re-pack to insert length prefix.</span>
i <span style='color:#808030; '>=</span> v<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>version <span style='color:#808030; '>></span> <span style='color:#008c00; '>9</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
stringBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
stringBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>while</span> <span style='color:#808030; '>(</span>i<span style='color:#808030; '>--</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
t <span style='color:#808030; '>=</span> stringBuffer<span style='color:#808030; '>[</span>i<span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
stringBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>|=</span> <span style='color:#008c00; '>255</span> <span style='color:#808030; '>&</span> <span style='color:#808030; '>(</span>t <span style='color:#808030; '><<</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
stringBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> t <span style='color:#808030; '>></span><span style='color:#808030; '>></span> <span style='color:#008c00; '>4</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
stringBuffer<span style='color:#808030; '>[</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>|=</span> <span style='color:#008c00; '>255</span> <span style='color:#808030; '>&</span> <span style='color:#808030; '>(</span>v <span style='color:#808030; '><<</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
stringBuffer<span style='color:#808030; '>[</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> v <span style='color:#808030; '>></span><span style='color:#808030; '>></span> <span style='color:#008c00; '>4</span><span style='color:#800080; '>;</span>
stringBuffer<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008000; '>0x40</span> <span style='color:#808030; '>|</span> <span style='color:#808030; '>(</span>v <span style='color:#808030; '>></span><span style='color:#808030; '>></span> <span style='color:#008c00; '>12</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
stringBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
stringBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>while</span> <span style='color:#808030; '>(</span>i<span style='color:#808030; '>--</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
t <span style='color:#808030; '>=</span> stringBuffer<span style='color:#808030; '>[</span>i<span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
stringBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>|=</span> <span style='color:#008c00; '>255</span> <span style='color:#808030; '>&</span> <span style='color:#808030; '>(</span>t <span style='color:#808030; '><<</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
stringBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> t <span style='color:#808030; '>></span><span style='color:#808030; '>></span> <span style='color:#008c00; '>4</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
stringBuffer<span style='color:#808030; '>[</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>|=</span> <span style='color:#008c00; '>255</span> <span style='color:#808030; '>&</span> <span style='color:#808030; '>(</span>v <span style='color:#808030; '><<</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
stringBuffer<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008000; '>0x40</span> <span style='color:#808030; '>|</span> <span style='color:#808030; '>(</span>v <span style='color:#808030; '>></span><span style='color:#808030; '>></span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Fill to end with pad pattern.</span>
i <span style='color:#808030; '>=</span> v <span style='color:#808030; '>+</span> <span style='color:#008c00; '>3</span> <span style='color:#808030; '>-</span> <span style='color:#808030; '>(</span>version <span style='color:#808030; '><</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>while</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '><</span> x<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
stringBuffer<span style='color:#808030; '>[</span>i<span style='color:#808030; '>++</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008000; '>0xec</span><span style='color:#800080; '>;</span>
stringBuffer<span style='color:#808030; '>[</span>i<span style='color:#808030; '>++</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008000; '>0x11</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Calculate generator polynomial.</span>
polynomial<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><</span> eccBlock<span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
polynomial<span style='color:#808030; '>[</span>i <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>j <span style='color:#808030; '>=</span> i<span style='color:#800080; '>;</span> j <span style='color:#808030; '>></span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> j<span style='color:#808030; '>--</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
polynomial<span style='color:#808030; '>[</span>j<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> polynomial<span style='color:#808030; '>[</span>j<span style='color:#808030; '>]</span> <span style='color:#800080; '>?</span> polynomial<span style='color:#808030; '>[</span>j <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>^</span>
GALOIS_EXPONENT<span style='color:#808030; '>[</span>modN<span style='color:#808030; '>(</span>GALOIS_LOG<span style='color:#808030; '>[</span>polynomial<span style='color:#808030; '>[</span>j<span style='color:#808030; '>]</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>+</span> i<span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#800080; '>:</span> polynomial<span style='color:#808030; '>[</span>j <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
polynomial<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> GALOIS_EXPONENT<span style='color:#808030; '>[</span>modN<span style='color:#808030; '>(</span>GALOIS_LOG<span style='color:#808030; '>[</span>polynomial<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>+</span> i<span style='color:#808030; '>)</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Use logs for generator polynomial to save calculation step.</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><=</span> eccBlock<span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
polynomial<span style='color:#808030; '>[</span>i<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> GALOIS_LOG<span style='color:#808030; '>[</span>polynomial<span style='color:#808030; '>[</span>i<span style='color:#808030; '>]</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Append ECC to data buffer.</span>
k <span style='color:#808030; '>=</span> x<span style='color:#800080; '>;</span>
y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><</span> neccBlock1<span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
appendData<span style='color:#808030; '>(</span>y<span style='color:#808030; '>,</span> dataBlock<span style='color:#808030; '>,</span> k<span style='color:#808030; '>,</span> eccBlock<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
y <span style='color:#808030; '>+=</span> dataBlock<span style='color:#800080; '>;</span>
k <span style='color:#808030; '>+=</span> eccBlock<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><</span> neccBlock2<span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
appendData<span style='color:#808030; '>(</span>y<span style='color:#808030; '>,</span> dataBlock <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> k<span style='color:#808030; '>,</span> eccBlock<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
y <span style='color:#808030; '>+=</span> dataBlock <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
k <span style='color:#808030; '>+=</span> eccBlock<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Interleave blocks.</span>
y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><</span> dataBlock<span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>j <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> j <span style='color:#808030; '><</span> neccBlock1<span style='color:#800080; '>;</span> j<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
eccBuffer<span style='color:#808030; '>[</span>y<span style='color:#808030; '>++</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> stringBuffer<span style='color:#808030; '>[</span>i <span style='color:#808030; '>+</span> j <span style='color:#808030; '>*</span> dataBlock<span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>j <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> j <span style='color:#808030; '><</span> neccBlock2<span style='color:#800080; '>;</span> j<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
eccBuffer<span style='color:#808030; '>[</span>y<span style='color:#808030; '>++</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> stringBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>neccBlock1 <span style='color:#808030; '>*</span> dataBlock<span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> i <span style='color:#808030; '>+</span> <span style='color:#808030; '>(</span>j <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>dataBlock <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>j <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> j <span style='color:#808030; '><</span> neccBlock2<span style='color:#800080; '>;</span> j<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
eccBuffer<span style='color:#808030; '>[</span>y<span style='color:#808030; '>++</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> stringBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>neccBlock1 <span style='color:#808030; '>*</span> dataBlock<span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> i <span style='color:#808030; '>+</span> <span style='color:#808030; '>(</span>j <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>dataBlock <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><</span> eccBlock<span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>j <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> j <span style='color:#808030; '><</span> neccBlock1 <span style='color:#808030; '>+</span> neccBlock2<span style='color:#800080; '>;</span> j<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
eccBuffer<span style='color:#808030; '>[</span>y<span style='color:#808030; '>++</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> stringBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> i <span style='color:#808030; '>+</span> j <span style='color:#808030; '>*</span> eccBlock<span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
stringBuffer <span style='color:#808030; '>=</span> eccBuffer<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Pack bits into frame avoiding masked area.</span>
x <span style='color:#808030; '>=</span> y <span style='color:#808030; '>=</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
k <span style='color:#808030; '>=</span> v <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// inteleaved data and ECC codes.</span>
m <span style='color:#808030; '>=</span> <span style='color:#808030; '>(</span>dataBlock <span style='color:#808030; '>+</span> eccBlock<span style='color:#808030; '>)</span> <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>neccBlock1 <span style='color:#808030; '>+</span> neccBlock2<span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> neccBlock2<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><</span> m<span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
t <span style='color:#808030; '>=</span> stringBuffer<span style='color:#808030; '>[</span>i<span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>j <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> j <span style='color:#808030; '><</span> <span style='color:#008c00; '>8</span><span style='color:#800080; '>;</span> j<span style='color:#808030; '>++</span><span style='color:#808030; '>,</span> t <span style='color:#808030; '><<=</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#008000; '>0x80</span> <span style='color:#808030; '>&</span> t<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span>x <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> y<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Find next fill position.</span>
<span style='color:#800000; font-weight:bold; '>do</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>v<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
x<span style='color:#808030; '>--</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
x<span style='color:#808030; '>++</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>k<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>!==</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
y<span style='color:#808030; '>--</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
x <span style='color:#808030; '>-</span><span style='color:#808030; '>=</span> <span style='color:#008c00; '>2</span><span style='color:#800080; '>;</span>
k <span style='color:#808030; '>=</span> <span style='color:#808030; '>!</span>k<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>===</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
x<span style='color:#808030; '>--</span><span style='color:#800080; '>;</span>
y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>9</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>!==</span> width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
y<span style='color:#808030; '>++</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
x <span style='color:#808030; '>-</span><span style='color:#808030; '>=</span> <span style='color:#008c00; '>2</span><span style='color:#800080; '>;</span>
k <span style='color:#808030; '>=</span> <span style='color:#808030; '>!</span>k<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '>===</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
x<span style='color:#808030; '>--</span><span style='color:#800080; '>;</span>
y <span style='color:#808030; '>-</span><span style='color:#808030; '>=</span> <span style='color:#008c00; '>8</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
v <span style='color:#808030; '>=</span> <span style='color:#808030; '>!</span>v<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>while</span> <span style='color:#808030; '>(</span>isMasked<span style='color:#808030; '>(</span>x<span style='color:#808030; '>,</span> y<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Save pre-mask copy of frame.</span>
stringBuffer <span style='color:#808030; '>=</span> frameBuffer<span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>slice</span><span style='color:#808030; '>(</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
t <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>
y <span style='color:#808030; '>=</span> <span style='color:#008c00; '>30000</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Using `for` instead of `while` since in original Arduino code if an early mask was *good</span>
<span style='color:#696969; '>// enough* it wouldn't try for a better one since they get more complex and take longer.</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> k <span style='color:#808030; '><</span> <span style='color:#008c00; '>8</span><span style='color:#800080; '>;</span> k<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#696969; '>// Returns foreground-background imbalance.</span>
applyMask<span style='color:#808030; '>(</span>k<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
x <span style='color:#808030; '>=</span> checkBadness<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Is current mask better than previous best?</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>x <span style='color:#808030; '><</span> y<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
y <span style='color:#808030; '>=</span> x<span style='color:#800080; '>;</span>
t <span style='color:#808030; '>=</span> k<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Don't increment `i` to a void redoing mask.</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>t <span style='color:#808030; '>===</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>)</span> <span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Reset for next pass.</span>
frameBuffer <span style='color:#808030; '>=</span> stringBuffer<span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>slice</span><span style='color:#808030; '>(</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Redo best mask as none were *good enough* (i.e. last wasn't `t`).</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>t <span style='color:#808030; '>!==</span> k<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
applyMask<span style='color:#808030; '>(</span>t<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Add in final mask/ECC level bytes.</span>
y <span style='color:#808030; '>=</span> FINAL_FORMAT<span style='color:#808030; '>[</span>t <span style='color:#808030; '>+</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>(</span>eccLevel <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#808030; '><<</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Low byte.</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> k <span style='color:#808030; '><</span> <span style='color:#008c00; '>8</span><span style='color:#800080; '>;</span> k<span style='color:#808030; '>++</span><span style='color:#808030; '>,</span> y <span style='color:#808030; '>></span><span style='color:#808030; '>>=</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>&</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>1</span> <span style='color:#808030; '>-</span> k<span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '><</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#008c00; '>8</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> k<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#008c00; '>8</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '>+</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// High byte.</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>k <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> k <span style='color:#808030; '><</span> <span style='color:#008c00; '>7</span><span style='color:#800080; '>;</span> k<span style='color:#808030; '>++</span><span style='color:#808030; '>,</span> y <span style='color:#808030; '>></span><span style='color:#808030; '>>=</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>y <span style='color:#808030; '>&</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#008c00; '>8</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>width <span style='color:#808030; '>-</span> <span style='color:#008c00; '>7</span> <span style='color:#808030; '>+</span> k<span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>k<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span><span style='color:#008c00; '>6</span> <span style='color:#808030; '>-</span> k<span style='color:#808030; '>)</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
frameBuffer<span style='color:#808030; '>[</span><span style='color:#008c00; '>7</span> <span style='color:#808030; '>+</span> width <span style='color:#808030; '>*</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Finally, return the image data.</span>
<span style='color:#800000; font-weight:bold; '>return</span> frameBuffer<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// qr.js setup</span>
<span style='color:#696969; '>// -----------</span>
<span style='color:#696969; '>// Build the publicly exposed API.</span>
<span style='color:#800000; font-weight:bold; '>var</span> qr <span style='color:#808030; '>=</span> <span style='color:#800080; '>{</span>
<span style='color:#696969; '>// Constants</span>
<span style='color:#696969; '>// ---------</span>
<span style='color:#696969; '>// Current version of `qr`.</span>
VERSION<span style='color:#800080; '>:</span> <span style='color:#0000e6; '>'1.1.3'</span><span style='color:#808030; '>,</span>
<span style='color:#696969; '>// QR functions</span>
<span style='color:#696969; '>// ------------</span>
<span style='color:#696969; '>// Generate the QR code using the data provided and render it on to a `<canvas>` element. </span>
<span style='color:#696969; '>// If no `<canvas>` element is specified in the argument provided a new one will be created and</span>
<span style='color:#696969; '>// used. </span>
<span style='color:#696969; '>// ECC (error correction capacity) determines how many intential errors are contained in the QR</span>
<span style='color:#696969; '>// code.</span>
canvas<span style='color:#800080; '>:</span> <span style='color:#800000; font-weight:bold; '>function</span><span style='color:#808030; '>(</span>data<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
data <span style='color:#808030; '>=</span> normalizeData<span style='color:#808030; '>(</span>data<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Module size of the generated QR code (i.e. 1-10).</span>
<span style='color:#800000; font-weight:bold; '>var</span> size <span style='color:#808030; '>=</span> data<span style='color:#808030; '>.</span>size <span style='color:#808030; '>>=</span> <span style='color:#008c00; '>1</span> <span style='color:#808030; '>&&</span> data<span style='color:#808030; '>.</span>size <span style='color:#808030; '><=</span> <span style='color:#008c00; '>10</span> <span style='color:#800080; '>?</span> data<span style='color:#808030; '>.</span>size <span style='color:#800080; '>:</span> <span style='color:#008c00; '>4</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Actual size of the QR code symbol and is scaled to 25 pixels (e.g. 1 = 25px, 3 = 75px).</span>
size <span style='color:#808030; '>*=</span> <span style='color:#008c00; '>25</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// `<canvas>` element used to render the QR code.</span>
<span style='color:#800000; font-weight:bold; '>var</span> cvs <span style='color:#808030; '>=</span> data<span style='color:#808030; '>.</span>canvas <span style='color:#808030; '>||</span> createCanvas<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Retreive the 2D context of the canvas.</span>
<span style='color:#800000; font-weight:bold; '>var</span> c2d <span style='color:#808030; '>=</span> cvs<span style='color:#808030; '>.</span>getContext<span style='color:#808030; '>(</span><span style='color:#0000e6; '>'2d'</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Ensure the canvas has the correct dimensions.</span>
c2d<span style='color:#808030; '>.</span>canvas<span style='color:#808030; '>.</span>width <span style='color:#808030; '>=</span> size<span style='color:#800080; '>;</span>
c2d<span style='color:#808030; '>.</span>canvas<span style='color:#808030; '>.</span>height <span style='color:#808030; '>=</span> size<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Fill the canvas with the correct background colour.</span>
c2d<span style='color:#808030; '>.</span>fillStyle <span style='color:#808030; '>=</span> data<span style='color:#808030; '>.</span>background <span style='color:#808030; '>||</span> <span style='color:#0000e6; '>'#fff'</span><span style='color:#800080; '>;</span>
c2d<span style='color:#808030; '>.</span>fillRect<span style='color:#808030; '>(</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> size<span style='color:#808030; '>,</span> size<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Determine the ECC level to be applied.</span>
eccLevel <span style='color:#808030; '>=</span> ECC_LEVELS<span style='color:#808030; '>[</span><span style='color:#808030; '>(</span>data<span style='color:#808030; '>.</span>level <span style='color:#808030; '>&&</span> data<span style='color:#808030; '>.</span>level<span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>toUpperCase</span><span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>||</span> <span style='color:#0000e6; '>'L'</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Generate the image frame for the given `value`.</span>
<span style='color:#800000; font-weight:bold; '>var</span> frame <span style='color:#808030; '>=</span> generateFrame<span style='color:#808030; '>(</span>data<span style='color:#808030; '>.</span>value <span style='color:#808030; '>||</span> <span style='color:#0000e6; '>''</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
c2d<span style='color:#808030; '>.</span>lineWidth <span style='color:#808030; '>=</span> <span style='color:#008c00; '>1</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Determine the *pixel* size.</span>
<span style='color:#800000; font-weight:bold; '>var</span> px <span style='color:#808030; '>=</span> size<span style='color:#800080; '>;</span>
px <span style='color:#808030; '>/=</span> width<span style='color:#800080; '>;</span>
px <span style='color:#808030; '>=</span> <span style='color:#797997; '>Math</span><span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>floor</span><span style='color:#808030; '>(</span>px<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Draw the QR code.</span>
c2d<span style='color:#808030; '>.</span>clearRect<span style='color:#808030; '>(</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> size<span style='color:#808030; '>,</span> size<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
c2d<span style='color:#808030; '>.</span>fillStyle <span style='color:#808030; '>=</span> data<span style='color:#808030; '>.</span>background <span style='color:#808030; '>||</span> <span style='color:#0000e6; '>'#fff'</span><span style='color:#800080; '>;</span>
c2d<span style='color:#808030; '>.</span>fillRect<span style='color:#808030; '>(</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> px <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>width <span style='color:#808030; '>+</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>)</span><span style='color:#808030; '>,</span> px <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>width <span style='color:#808030; '>+</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
c2d<span style='color:#808030; '>.</span>fillStyle <span style='color:#808030; '>=</span> data<span style='color:#808030; '>.</span>foreground <span style='color:#808030; '>||</span> <span style='color:#0000e6; '>'#000'</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>var</span> i<span style='color:#808030; '>,</span> j<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>i <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> i<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>j <span style='color:#808030; '>=</span> <span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> j <span style='color:#808030; '><</span> width<span style='color:#800080; '>;</span> j<span style='color:#808030; '>++</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>frame<span style='color:#808030; '>[</span>j <span style='color:#808030; '>*</span> width <span style='color:#808030; '>+</span> i<span style='color:#808030; '>]</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
c2d<span style='color:#808030; '>.</span>fillRect<span style='color:#808030; '>(</span>px <span style='color:#808030; '>*</span> i<span style='color:#808030; '>,</span> px <span style='color:#808030; '>*</span> j<span style='color:#808030; '>,</span> px<span style='color:#808030; '>,</span> px<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>return</span> cvs<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span><span style='color:#808030; '>,</span>
<span style='color:#696969; '>// Generate the QR code using the data provided and render it on to a `<img>` element. </span>
<span style='color:#696969; '>// If no `<img>` element is specified in the argument provided a new one will be created and</span>
<span style='color:#696969; '>// used. </span>
<span style='color:#696969; '>// ECC (error correction capacity) determines how many intential errors are contained in the QR</span>
<span style='color:#696969; '>// code.</span>
image<span style='color:#800080; '>:</span> <span style='color:#800000; font-weight:bold; '>function</span><span style='color:#808030; '>(</span>data<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
data <span style='color:#808030; '>=</span> normalizeData<span style='color:#808030; '>(</span>data<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// `<canvas>` element only which the QR code is rendered.</span>
<span style='color:#800000; font-weight:bold; '>var</span> cvs <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>this</span><span style='color:#808030; '>.</span>canvas<span style='color:#808030; '>(</span>data<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// `<img>` element used to display the QR code.</span>
<span style='color:#800000; font-weight:bold; '>var</span> img <span style='color:#808030; '>=</span> data<span style='color:#808030; '>.</span>image <span style='color:#808030; '>||</span> createImage<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Apply the QR code to `img`.</span>
img<span style='color:#808030; '>.</span>src <span style='color:#808030; '>=</span> cvs<span style='color:#808030; '>.</span>toDataURL<span style='color:#808030; '>(</span>data<span style='color:#808030; '>.</span>mime <span style='color:#808030; '>||</span> DEFAULT_MIME<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
img<span style='color:#808030; '>.</span>height <span style='color:#808030; '>=</span> cvs<span style='color:#808030; '>.</span>height<span style='color:#800080; '>;</span>
img<span style='color:#808030; '>.</span>width <span style='color:#808030; '>=</span> cvs<span style='color:#808030; '>.</span>width<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>return</span> img<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span><span style='color:#808030; '>,</span>
<span style='color:#696969; '>// Generate the QR code using the data provided and render it on to a `<canvas>` element and</span>
<span style='color:#696969; '>// save it as an image file. </span>
<span style='color:#696969; '>// If no `<canvas>` element is specified in the argument provided a new one will be created and</span>
<span style='color:#696969; '>// used. </span>
<span style='color:#696969; '>// ECC (error correction capacity) determines how many intential errors are contained in the QR</span>
<span style='color:#696969; '>// code. </span>
<span style='color:#696969; '>// If called in a browser the `path` property/argument is ignored and will simply prompt the</span>
<span style='color:#696969; '>// user to choose a location and file name. However, if called within node.js the file will be</span>
<span style='color:#696969; '>// saved to specified path. </span>
<span style='color:#696969; '>// A `callback` function must be provided which will be called once the saving process has</span>
<span style='color:#696969; '>// started. If an error occurs it will be passed as the first argument to this function,</span>
<span style='color:#696969; '>// otherwise this argument will be `null`.</span>
save<span style='color:#800080; '>:</span> <span style='color:#800000; font-weight:bold; '>function</span><span style='color:#808030; '>(</span>data<span style='color:#808030; '>,</span> path<span style='color:#808030; '>,</span> callback<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
data <span style='color:#808030; '>=</span> normalizeData<span style='color:#808030; '>(</span>data<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>switch</span> <span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>typeof</span> path<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>case</span> <span style='color:#0000e6; '>'function'</span><span style='color:#800080; '>:</span>
callback <span style='color:#808030; '>=</span> path<span style='color:#800080; '>;</span>
path <span style='color:#808030; '>=</span> <span style='color:#0f4d75; '>null</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>case</span> <span style='color:#0000e6; '>'string'</span><span style='color:#800080; '>:</span>
data<span style='color:#808030; '>.</span>path <span style='color:#808030; '>=</span> path<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#696969; '>// Callback function is required.</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>typeof</span> callback <span style='color:#808030; '>!==</span> <span style='color:#0000e6; '>'function'</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>throw</span> <span style='color:#800000; font-weight:bold; '>new</span> TypeError<span style='color:#808030; '>(</span><span style='color:#0000e6; '>'Invalid callback type: '</span> <span style='color:#808030; '>+</span> <span style='color:#800000; font-weight:bold; '>typeof</span> callback<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>var</span> completed <span style='color:#808030; '>=</span> <span style='color:#0f4d75; '>false</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// `<canvas>` element only which the QR code is rendered.</span>
<span style='color:#800000; font-weight:bold; '>var</span> cvs <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>this</span><span style='color:#808030; '>.</span>canvas<span style='color:#808030; '>(</span>data<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Simple function to try and ensure that the `callback` function is only called once.</span>
<span style='color:#800000; font-weight:bold; '>function</span> done<span style='color:#808030; '>(</span>error<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>!</span>completed<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
completed <span style='color:#808030; '>=</span> <span style='color:#0f4d75; '>true</span><span style='color:#800080; '>;</span>
callback<span style='color:#808030; '>(</span>error<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>inNode<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
writeFile<span style='color:#808030; '>(</span>cvs<span style='color:#808030; '>,</span> data<span style='color:#808030; '>,</span> done<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
download<span style='color:#808030; '>(</span>cvs<span style='color:#808030; '>,</span> data<span style='color:#808030; '>,</span> done<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span><span style='color:#808030; '>,</span>
<span style='color:#696969; '>// Generate the QR code using the data provided and render it on to a `<canvas>` element and</span>
<span style='color:#696969; '>// save it as an image file. </span>
<span style='color:#696969; '>// If no `<canvas>` element is specified in the argument provided a new one will be created and</span>
<span style='color:#696969; '>// used. </span>
<span style='color:#696969; '>// ECC (error correction capacity) determines how many intential errors are contained in the QR</span>
<span style='color:#696969; '>// code. </span>
<span style='color:#696969; '>// If called in a browser the `path` property/argument is ignored and will simply prompt the</span>
<span style='color:#696969; '>// user to choose a location and file name. However, if called within node.js the file will be</span>
<span style='color:#696969; '>// saved to specified path.</span>
saveSync<span style='color:#800080; '>:</span> <span style='color:#800000; font-weight:bold; '>function</span><span style='color:#808030; '>(</span>data<span style='color:#808030; '>,</span> path<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
data <span style='color:#808030; '>=</span> normalizeData<span style='color:#808030; '>(</span>data<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>typeof</span> path <span style='color:#808030; '>===</span> <span style='color:#0000e6; '>'string'</span><span style='color:#808030; '>)</span> data<span style='color:#808030; '>.</span>path <span style='color:#808030; '>=</span> path<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// `<canvas>` element only which the QR code is rendered.</span>
<span style='color:#800000; font-weight:bold; '>var</span> cvs <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>this</span><span style='color:#808030; '>.</span>canvas<span style='color:#808030; '>(</span>data<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>inNode<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
writeFileSync<span style='color:#808030; '>(</span>cvs<span style='color:#808030; '>,</span> data<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
download<span style='color:#808030; '>(</span>cvs<span style='color:#808030; '>,</span> data<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span><span style='color:#808030; '>,</span>
<span style='color:#696969; '>// Generate the QR code using the data provided and render it on to a `<canvas>` element before</span>
<span style='color:#696969; '>// returning its data URI. </span>
<span style='color:#696969; '>// If no `<canvas>` element is specified in the argument provided a new one will be created and</span>
<span style='color:#696969; '>// used. </span>
<span style='color:#696969; '>// ECC (error correction capacity) determines how many intential errors are contained in the QR</span>
<span style='color:#696969; '>// code.</span>
toDataURL<span style='color:#800080; '>:</span> <span style='color:#800000; font-weight:bold; '>function</span><span style='color:#808030; '>(</span>data<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
data <span style='color:#808030; '>=</span> normalizeData<span style='color:#808030; '>(</span>data<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>return</span> <span style='color:#800000; font-weight:bold; '>this</span><span style='color:#808030; '>.</span>canvas<span style='color:#808030; '>(</span>data<span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>toDataURL<span style='color:#808030; '>(</span>data<span style='color:#808030; '>.</span>mime <span style='color:#808030; '>||</span> DEFAULT_MIME<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span><span style='color:#808030; '>,</span>
<span style='color:#696969; '>// Utility functions</span>
<span style='color:#696969; '>// -----------------</span>
<span style='color:#696969; '>// Run qr.js in *noConflict* mode, returning the `qr` variable to its previous owner. </span>
<span style='color:#696969; '>// Returns a reference to `qr`.</span>
noConflict<span style='color:#800080; '>:</span> <span style='color:#800000; font-weight:bold; '>function</span><span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
root<span style='color:#808030; '>.</span>qr <span style='color:#808030; '>=</span> previousQr<span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>return</span> <span style='color:#800000; font-weight:bold; '>this</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span><span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Support</span>
<span style='color:#696969; '>// -------</span>
<span style='color:#696969; '>// Export `qr` for node.js and CommonJS.</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>typeof</span> exports <span style='color:#808030; '>!==</span> <span style='color:#0000e6; '>'undefined'</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
inNode <span style='color:#808030; '>=</span> <span style='color:#0f4d75; '>true</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>typeof</span> module <span style='color:#808030; '>!==</span> <span style='color:#0000e6; '>'undefined'</span> <span style='color:#808030; '>&&</span> module<span style='color:#808030; '>.</span>exports<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
exports <span style='color:#808030; '>=</span> module<span style='color:#808030; '>.</span>exports <span style='color:#808030; '>=</span> qr<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
exports<span style='color:#808030; '>.</span>qr <span style='color:#808030; '>=</span> qr<span style='color:#800080; '>;</span>
<span style='color:#696969; '>// Import required node.js modules.</span>
Canvas <span style='color:#808030; '>=</span> require<span style='color:#808030; '>(</span><span style='color:#0000e6; '>'canvas'</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#797997; '>Image</span> <span style='color:#808030; '>=</span> Canvas<span style='color:#808030; '>.</span><span style='color:#797997; '>Image</span><span style='color:#800080; '>;</span>
fs <span style='color:#808030; '>=</span> require<span style='color:#808030; '>(</span><span style='color:#0000e6; '>'fs'</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>typeof</span> define <span style='color:#808030; '>===</span> <span style='color:#0000e6; '>'function'</span> <span style='color:#808030; '>&&</span> define<span style='color:#808030; '>.</span>amd<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
define<span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>function</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
<span style='color:#800000; font-weight:bold; '>return</span> qr<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>else</span> <span style='color:#800080; '>{</span>
<span style='color:#696969; '>// In non-HTML5 browser so strip base functionality.</span>
<span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span><span style='color:#808030; '>!</span>root<span style='color:#808030; '>.</span>HTMLCanvasElement<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
overrideAPI<span style='color:#808030; '>(</span>qr<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
root<span style='color:#808030; '>.</span>qr <span style='color:#808030; '>=</span> qr<span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span><span style='color:#808030; '>)</span><span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>this</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
</pre>
<br/>
2. use the following HTML file (contains the demo for rendering based on QR size)
<pre>
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> <!-- Set viewport. -->
<style type="text/css">
html {
font-family: "Courier New", Courier, monospace;
padding: 15px 15px 15px 15px;
background-color: #FFFFD7;
-webkit-font-smoothing:antialiased !important;
-moz-osx-font-smoothing:grayscale !important;
-moz-box-sizing: border-box !important;
box-sizing: border-box !important;
text-shadow:0 0 1px #E5E5E5; /*IE*/
text-shadow:0 0 1px rgba(0, 0, 0, 0.1);
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
text-size-adjust: 100%;
}
em {
background-color: rgba(64, 255, 59, .8);
box-shadow: 3px 3px 3px rgba(0, 0, 0, .4);
padding-left: 5px;
padding-right: 5px;
}
#value_data {
width: 50%;
padding: 5px 5px 5px 5px;
font-size: 1.5em;
word-break: break-all;
min-height: 50px;
position: fixed;
right:50px;
float: left;
box-shadow: 20px 20px 20px rgba(0,0,0,.4);
border-radius: 10px;
}
#value_data, #value_data:focus, #value_data:active{
border:1px solid rgba(0,0,0,.4);
outline:none rgba(0,0,0,.0);
}
</style>
</head>
<body>
<textarea id="value_data">otpauth://totp/foo:alice@google.com?secret=JBSWY3DPEHPK3PXP&customer=bar</textarea>
<script src="qr.js"></script>
<div class="content"></div>
<script>
window.run_variations = function () {
"use strict";
var
content_container = document.querySelector(".content"),
get_oauth, get_qr_defaults, get_qr,
body = document.getElementsByTagName("body")[0],
value_obj = document.getElementById("value_data"),
ecc_levels = ["L", "M", "Q", "H"], ecc_level,
items_max,
i;
//---------------
//prototyping
Array.prototype.nPush = function () {
Array.prototype.push.apply(this, arguments);
return this;
};
Object.prototype.nExtend = function (obj) {
var key;
for (key in obj) {
if (obj.hasOwnProperty(key)) {
this[key] = obj[key];
}
}
return this;
};
get_oauth = function () {
return "http://www.google.com";
};
get_qr = function (qrdetails) {
var div, img;
div = document.createElement("div");
img = document.createElement("img");
div.appendChild(img);
qrdetails = {}
.nExtend({ // default
"value": get_oauth(),
"size": 4,
"background": "#fff",
"level": "L",
"mime": "image/png"
})
.nExtend(qrdetails)
.nExtend({ // overwrite with changes, and add new attributes
"image": img // add image
});
qr.image(qrdetails);
div.innerHTML += []
.nPush("<br/>")
.nPush("- value:").nPush(" ").nPush(qrdetails.value).nPush("<br/>")
.nPush("- size:").nPush(" ").nPush(qrdetails.size - 1).nPush("<br/>")
.nPush("- background:").nPush(" ").nPush(qrdetails.background).nPush("<br/>")
.nPush("- level:").nPush(" ").nPush(qrdetails.level).nPush("<br/>")
.nPush("- mime:").nPush(" ").nPush(qrdetails.mime).nPush("<br/>")
.nPush("<br/>")
.nPush("<br/>")
.join("");
div.innerHTML += "<br/>";
return div;
};
//---------------------------
content_container.innerHTML = "";
content_container.innerHTML = "<br/><hr/>";
//variations matrix - QR size
content_container.innerHTML += '<h2 name="qrsize">Variations On <em>QR Sizes</em> <br/>' +
"<small>(1=25px, 2=50px, 3=75px, 4=100px, 5=125px, 6=150px, 7=175px, 8=200px, 9=225px)</small></h2>";
for (i = 2; i <= 10; i += 1) {
content_container.appendChild(get_qr({
'value': value_obj.value || "",
'size': i
}));
}
content_container.innerHTML += "<hr/><hr/><br/>";
//variations matrix - QR ECC
content_container.innerHTML += "<h2 id='qrecc'>Variations On <em>QR ECC (Error Correction Code) Levels</em> <br/>" +
"<small>(L,M,Q,H : 7%,15%,25%,30% loss covered by backup codewords)</small></h2>";
for (i = 0; i < ecc_levels.length; i += 1)
content_container.appendChild(get_qr({
'value': value_obj.value || "",
'level': ecc_levels[i]
}));
content_container.innerHTML += "<hr/><hr/><br/>";
//variations matrix - QR size x ECC
items_max = 5;
content_container.innerHTML += "<h2>" + items_max + " Random Variations On both <em>QR Sizes</em> + <em>QR ECC (Error Correction Code) Levels</em></h2>";
for (i = 0; i < items_max; i += 1) {
content_container.innerHTML += (i + 1).toString() + "/" + items_max + "<br/>";
content_container.appendChild(get_qr({
'value': (value_obj.value || ""),
'size': (~~(Math.random() * 9) + 2),
'level': (ecc_levels[~~(Math.random() * ecc_levels.length)])
}));
}
};
//first time
run_variations.call(window);
document.querySelector("#value_data").onkeyup = function (ev) {
setTimeout(function () {
window.run_variations.call(window);
}, 10);
};
</script>
</body>
</html>
</pre>
| 209.779402 | 1,330 | 0.628393 | kor_Hang | 0.313367 |
db6f220b7316bedf4899b219f9277972100fe66f | 2,372 | md | Markdown | data/2012/04/2012-04-22-kyoto-clj-1.md | bouzuya/blog.bouzuya.net | d5e643990b8e9721ae09c18f99334a898d83fcb8 | [
"MIT"
] | 6 | 2016-05-02T21:31:41.000Z | 2018-01-15T04:48:01.000Z | data/2012/04/2012-04-22-kyoto-clj-1.md | bouzuya/blog.bouzuya.net | d5e643990b8e9721ae09c18f99334a898d83fcb8 | [
"MIT"
] | 56 | 2015-05-18T04:57:25.000Z | 2021-07-22T20:17:27.000Z | data/2012/04/2012-04-22-kyoto-clj-1.md | bouzuya/blog.bouzuya.net | d5e643990b8e9721ae09c18f99334a898d83fcb8 | [
"MIT"
] | 2 | 2016-06-15T04:06:11.000Z | 2016-10-18T13:36:55.000Z | 『[kyoto.clj#1 -Clojure勉強会-](http://atnd.org/events/27149)』に参加した。その感想などを書く。
## 会場の環境
雨で気温も低く、天候はお世辞にも良くなかった。
[フリュー株式会社](http://www.furyu.jp/)の京都事業所を会場として使わせていただいた。
会場の位置は京都駅から徒歩5分であり、分かりやすい位置にある。文句なしの立地である。文句をつけるとすれば、鍵がかかっていて[@kuchitama](http://twitter.com/kuchitama/)さんに開けてもらえないと入れなかったことや、机がなくひざの上での作業になったことが挙げられるが、そもそも会場を提供してくださるだけでも感謝しないといけない。
ちなみにフリュー株式会社はプリクラの機械とかをつくったりしている会社らしい。色々やっているようだ。プリクラは撮る機会がないので分からないが、まあ機会があればスマイルマークの機械を意識したい。
## 発表内容
発表以前に主催者が遅れるというトラブルが発生した。発表開始までにおとずれる謎の沈黙。みなさんパソコンを触っている様子。ぼくはひたすらプログラミングClojureのサンプルを動かしていた。勉強会の会場で勉強して何が悪い!
結局、主催者不在のまま、発表をはじめていくことに……。
### [@kuchitama](http://twitter.com/kuchitama/)さんの発表
ビルドツールleiningenについて。
- JavaでいうところのMavenのようなもの
- プロジェクトの作成やビルドやテストを動かすほか、ライブラリの依存関係を解決
- Mavenリポジトリにもアクセスできる
- Clojureなしでも動作する(Clojureの環境を構築できる)
leiningenについては、実際に試してみてレポートを書きたい。
### [@tnoda\_](http://twitter.com/tnoda_)さんの発表
書籍『[Clojure Programming](http://amazon.jp/o/ASIN/1449394701/bouzuya-22)』について。
- O'Reillyのまわしものではない(1円も貰っていない)
- Clojure Programmingは良い教科書である
- 良い教科書は知識が構造化される
- 関数型言語の経験がない人のClojureのスタートにおすすめ
- 『[Programming Clojure](http://amazon.jp/o/ASIN/4274067890/bouzuya-22)』も関数型言語の経験があるなら良いかも
- 英語(Programmingができないネイティブよりはできる日本人の方が読みやすく感じるだろう、とか)
内容とは関係ないけれど『Programming Clojure』と『Clojure Programming』とが紛らわしい。
英語は心底苦手なので自信がないけれど、『Clojure Programming』積んで(?)みようかな。
### 主催者[@sawam\_\_\_](http://twitter.com/sawam___)さんの発表
ClojureでAndroidプログラミングについて。ごめんなさい。前提知識が足りなさすぎて理解できませんでした。Javaよりもスッキリ書ける点はという問いに「そんなに利点はない、でも楽しい』とのこと。Javaと比較したらClojureで書くだけでも短くはなると思うのだけれど、どうなんでしょう。
### その他
追加でイベントの告知をされていたけれど、聞き流してしまった。ごめんなさい。
## 懇親会
タイムテーブル上はコーディングタイムになっていたけれど、割愛して、お茶会に。
- 自己紹介
- 1年以上使われている方は11人いて1人
- 業務で使われているとか
- どんな環境で?
- Emacs: 9 ([MACLIDE](http://mclide.in-progress.com)(これじゃなかったらごめんなさい)に期待される方含む)
- Vim: 2
- ドキュメントが英語でつらい
- 日本語化プロジェクトとかいいかも
- 変更に追いつけないだろうからやめた方が良い
- 英語読めるようになった方が良い
- 英語の文書の読み方について
- 今後どうするのか
- 一人、一分、スライド一枚でも良いので発表すべき(敷居を下げられる)
- この会場だと鍵が大変なので、別の場所を→(次回は「株式会社はてな」かも)
ほかにも色々話してたはずだけど、忘れてしまった。
## 個人的な感想とか
- Keep: 勉強会に端末を持っていく(前回の経験が活きた)
- Keep: 懇親会に参加する(人とのつながりを作ることを目的として良い)
- Keep: 報告を書く
- Problem: 名刺を渡されたが持っていなかった
- Problem: 発表しなかった
- Problem: 予習しなさすぎ
- Problem: 人の話を聴いていない
- Try: 名刺は持っていく
- Try: 何か発表できるようにする
- Try: 事前に予習する
- Try: ブログにClojureのことを書いていく
- Try: きちんと聞く、そして忘れない
- Other: Clojureがマイナー言語だとよく分かった
- Other: やる気が出た
60 min.
| 25.782609 | 182 | 0.798904 | jpn_Jpan | 0.925806 |
db6fa3dd434a51ec656485f6be1d4892e365957a | 1,302 | md | Markdown | README_zh-TW.md | jinan-tw/pcrd-tw-webhook-crawler | ce15a6d2fd1f538aa96fce293e9d120fc54c5613 | [
"MIT"
] | 5 | 2020-12-18T06:12:33.000Z | 2021-12-23T14:28:05.000Z | README_zh-TW.md | jinan-tw/pcrd-tw-webhook-crawler | ce15a6d2fd1f538aa96fce293e9d120fc54c5613 | [
"MIT"
] | null | null | null | README_zh-TW.md | jinan-tw/pcrd-tw-webhook-crawler | ce15a6d2fd1f538aa96fce293e9d120fc54c5613 | [
"MIT"
] | 3 | 2021-01-20T07:34:53.000Z | 2021-03-25T11:27:56.000Z | # PCRD-TW-webhook-crawler
> PCRD-TW-webhook-crawler 將從[超異域公主連結RE:DIVE 台灣官方網站](http://www.princessconnect.so-net.tw/news)進行爬蟲解析,抓取最新的公告並透過webhook發佈到Discord上
# 開始使用
## 環境需求
- Python 3.8.0+ (https://www.python.org/)
- 需要安裝在requirements.txt中額外的套件
## 安裝方式
若要執行PCRD-TW-webhook-crawler,需要安裝額外的套件,使用終端機至此專案的資料夾中下此指令:
```
pip install -r requirements.txt
```
## 設定
用任意的文字編輯器開啟 "pcrd_news.py",在
```py
webhook_links = []
```
插入Discord的webhook連結,如下:
```py
webhook_links = [ 'https://discordapp.com/api/webhooks/.../...']
```
如果您有超過一個連結需要加入,請使用逗號分隔:
```py
webhook_links = [ 'https://discordapp.com/api/webhooks/.../...',
'https://discordapp.com/api/webhooks/.../...'
]
```
## 使用方式
使用終端機至專案資料夾執行此指令:
```
python pcrd_news.py
```
或
```
python3 pcrd_news.py
```
您也可以透過已經寫好的腳本來每天執行爬蟲
首先,在`pcrd_news_crawler.bat`中, 將 `YOUR_PROJECT_FOLDER_PATH` 文字用此專案資料夾的絕對路徑取代掉
```
cd /d YOUR_PROJECT_FOLDER_PATH
python pcrd_news.py
REM pause
```
接著,在`launch_bat.vbs`中,同樣把 `YOUR_PROJECT_FOLDER_PATH\pcrd_news_crawler.bat`的 `YOUR_PROJECT_FOLDER_PATH` 也取代掉
`\pcrd_news_crawler.bat`要留著
按下`開始 + R`, 輸入“taskschd.msc“ 開啟 **工作排程器** 或是Windows搜尋工作排程器
新增一個工作,在"觸發程序"中設定排程,公主連結的公告通常都在工作日的中午12點以及下午5點做更新,切記不要過於頻繁執行此程式
在"動作"的分頁,新增包含 launch_bat.vbs 的絕對路徑在程式或指令碼欄位內,按下確定即可
設定完後,只要電腦不關閉,此排程應會正常執行並推送通知到您設定的連結
| 21.7 | 129 | 0.731951 | yue_Hant | 0.981727 |
db70c9a2762126332560956fb153f1a738714b1a | 255 | markdown | Markdown | _posts/2020-01-29-workalong.markdown | UBC-R-Study-group/studyGroup | 9afa27e74f84de890ac3e888c9f907ccff50a25f | [
"Apache-2.0"
] | 22 | 2018-09-12T20:14:53.000Z | 2021-02-17T17:26:48.000Z | _posts/2020-01-29-workalong.markdown | UBC-R-Study-group/studyGroup | 9afa27e74f84de890ac3e888c9f907ccff50a25f | [
"Apache-2.0"
] | 126 | 2018-09-11T15:56:50.000Z | 2021-11-27T19:04:14.000Z | _posts/2020-01-29-workalong.markdown | UBC-R-Study-group/studyGroup | 9afa27e74f84de890ac3e888c9f907ccff50a25f | [
"Apache-2.0"
] | 15 | 2018-09-11T22:34:11.000Z | 2021-06-17T23:30:34.000Z | ---
title: Workalong Session
text: Come to ask questions or chat with fellow programmers
location: Koerner Library, UBC, Room 548-552
link: https://github.com/UBC-R-Study-group/studyGroup/issues/87
date: 2020-01-29
startTime: '13:00'
endTime: '14:00'
---
| 25.5 | 63 | 0.74902 | yue_Hant | 0.225941 |
db7221ad2e591522f0115f96fd5d3064406fee49 | 458 | md | Markdown | README.md | AMARTYA2020/Weather_Data_Analysis | fe36de01b4b9e6ac02463dbbd7b7ef4f7c25087e | [
"MIT"
] | 2 | 2020-12-02T04:21:51.000Z | 2021-12-06T14:27:29.000Z | README.md | AMARTYA2020/Weather_Data_Analysis | fe36de01b4b9e6ac02463dbbd7b7ef4f7c25087e | [
"MIT"
] | null | null | null | README.md | AMARTYA2020/Weather_Data_Analysis | fe36de01b4b9e6ac02463dbbd7b7ef4f7c25087e | [
"MIT"
] | null | null | null | # Weather_Data_Analysis
Weather Data analysis is a project build on python programming language...This project gives major emphasis upon analyzing a CSV dataset consisting approx 9K tuples/Rows
In this project till 40 lines of code the logic codes behind analysis is explained along with comments for easy understanding of codes and based upon these logic analysis code
there are 11 solved questions along with other alternative codes in the form of comment
| 91.6 | 175 | 0.834061 | eng_Latn | 0.999207 |
db7341a2188f9f6d5e82224456a0cd79ec106434 | 242 | md | Markdown | README.md | orange-pm/orange | 73ecd22a8448d56ecf3a98558eac62a8d6245d2f | [
"MIT"
] | null | null | null | README.md | orange-pm/orange | 73ecd22a8448d56ecf3a98558eac62a8d6245d2f | [
"MIT"
] | null | null | null | README.md | orange-pm/orange | 73ecd22a8448d56ecf3a98558eac62a8d6245d2f | [
"MIT"
] | null | null | null | # Orange
Orange Package Manager's core.
Orange Package Manager is a package manager manager. It allows you to install packages using a wide range of sources, especially useful when a package may not be part of your OS' default package list.
| 48.4 | 200 | 0.797521 | eng_Latn | 0.998093 |
db73e9835970f5fa920479fed29624ff943eff89 | 5,029 | md | Markdown | README.md | FintanK/angular-2-reference-typescript | ced334652f2b0d6bf580157b8b1d7c26882dd74e | [
"Apache-2.0"
] | null | null | null | README.md | FintanK/angular-2-reference-typescript | ced334652f2b0d6bf580157b8b1d7c26882dd74e | [
"Apache-2.0"
] | null | null | null | README.md | FintanK/angular-2-reference-typescript | ced334652f2b0d6bf580157b8b1d7c26882dd74e | [
"Apache-2.0"
] | null | null | null | # Angular 2 Reference App
Another reference app for my Angular 2 Development. I have created different Angular components for UI elements.
- Angular 2 uses Typescript (a typed superset of JS which compiles to JS at runtime on any platform).
## Typescript
TypeScript is a free and open source programming language developed and maintained by Microsoft.
It is a strict superset of JavaScript, and adds optional static typing and class-based object-oriented programming to the language. Anders Hejlsberg, lead architect of C# and creator of Delphi and Turbo Pascal, has worked on the development of TypeScript. TypeScript may be used to develop JavaScript applications for client-side or server-side (Node.js) execution.
TypeScript is designed for development of large applications and transcompiles to JavaScript. As TypeScript is a superset of JavaScript, any existing JavaScript programs are also valid TypeScript programs.
TypeScript supports definition files that can contain type information of existing JavaScript libraries, much like C/C++ header files can describe the structure of existing object files. This enables other programs to use the values defined in the files as if they were statically typed TypeScript entities. There are third-party header files for popular libraries like jQuery, MongoDB, and D3.js. TypeScript headers for the Node.js basic modules are also available, allowing development of Node.js programs within TypeScript.
The TypeScript compiler is itself written in TypeScript, transcompiled to JavaScript and licensed under the Apache 2 License.
TypeScript is included as a first-class programming language in Microsoft Visual Studio 2013 Update 2 and later, beside C# and other Microsoft languages. An official extension allows Visual Studio 2012 to support TypeScript as well.
Command line tool
> tsc
https://www.typescriptlang.org/docs/tutorial.html
## Installing the Angular 2 CLI Tool
> npm install -g angular-cli
You can check your installation by running..
> ng version
CLI tool reference https://cli.angular.io/reference.pdf
## Creating a new project
> ng new angular-reference-app
> cd angular-reference-app
> ng serve
## Example CLI Commands
### Generate a new component
> ng generate component my-new-component
### Generate a new directive
> ng generate directive my-new-directive
### Generate a new pipe
> ng generate pipe my-new-pipe
### Generate a new service
> ng generate service my-new-service
### Generate a new class
> ng generate class my-new-class
### Generate a new interface
> ng generate interface my-new-interface
### Generate a new enum
> ng generate enum my-new-enum
### Running Tests
Run all end-to-end tests using protractor.
> ng e2e
Run unit tests with Karma
> ng test
### Angular 2 Dependencies
A complete reference of Angular 2 classes can be seen at this link. They are all grouped by component.
https://angular.io/docs/ts/latest/api/
Some example Angular Dependencies out of the box
- common
- compiler
- core
- platform-browser
- platform-browser-dynamic
- router
Others
Systems.js - Allows you to import files and modules https://github.com/systemjs/systemjs
ES6 Shim - Allows older Javascript engines to be ECMAScript 6 comptaible https://www.npmjs.com/package/es6-shim
RXJS - Reactive Architecture libraries for more asynchronous applications. RxJS = Observables + Operators + Schedulers. http://reactivex.io/rxjs/
Reflect-metadata - Nice syntax when adding metadata to classes (uses annotations instead) http://stackoverflow.com/questions/30539571/can-anyone-explain-what-es7-reflect-metadata-is-all-about#_=_
Zone.js - Javascript is asynchronous in that tasks are not always run one right after the other (e.g. setTimeout) and you can't just put a timer at the start and put one at the end because another function to be executed might be delayed. This is where zone.js comes in, your code can be executed within defined zones which is useful for things like debugging, testing and profiling. https://github.com/angular/zone.js/
Clang Format - Formatting tool for your code which can also be used with GIT http://clang.llvm.org/docs/ClangFormat.html
### Configuration Files
src/tsconfig.json - TypeScript compiler configuration.. You will be able to see that our typescript compiler will convert all our code to ES5 for best browser compatibility. Sourcemaps are also turned on so that we can see the original files in the browser when optimizing our JS.
typings.json - TypesScript declaration files.
.editorconfig - Helps with code formatting in common IDEs
Note: JS sourcemap files are a way to map a combined/minified file back to their original state.
### Notes
- When adding a component to the main app component it must be added as a directive.
- Visual Studio Code is a great editor to use for native typescript support.
- Good plugins available to other IDE and editors like Atom, Sublime, IntelliJ IDE and others.
### Resources
Angular 2 Quickstart on Github https://github.com/angular/quickstart
| 41.221311 | 526 | 0.790416 | eng_Latn | 0.994318 |
db744e1fcf8c7d7f20d793af277309eb9282070f | 768 | md | Markdown | README.md | raulcodes/Now-Playing | 5f9f05d92cb173eff9f0b615d3a56a4a8677b256 | [
"MIT"
] | 3 | 2018-12-01T21:10:26.000Z | 2020-06-12T22:25:20.000Z | README.md | raulcodes/Now-Playing | 5f9f05d92cb173eff9f0b615d3a56a4a8677b256 | [
"MIT"
] | 7 | 2021-01-28T19:39:54.000Z | 2022-03-25T18:35:01.000Z | README.md | raulcodes/Now-Playing | 5f9f05d92cb173eff9f0b615d3a56a4a8677b256 | [
"MIT"
] | null | null | null | # Now Playing
A Spotify Music Visualizer written in electron for MacOS. This application will display the currently playing song's album art in a stylized way. **You must have the MacOS Spotify desktop app open for this to function**
## Development
1. git clone this repository
2. `npm install`
3. `npm start`
4. To run webpack after changes, `npm run build`
## Built With
* [spotify-node-applescript](https://github.com/andrehaveman/spotify-node-applescript) - Applescripts used to communicate with Spotify
* [Electron](https://electronjs.org/) - Cross-platform desktop application framework
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
## Acknowledgments
* @bongani-m for logo design
| 32 | 219 | 0.757813 | eng_Latn | 0.973231 |
db7464c673e7c4a42f2b03370ac699de863b07f1 | 48 | md | Markdown | README.md | GalaIO/gala-resources | 595a15e0422050f1b7e91eeac7e09c54d4da8cd9 | [
"MIT"
] | null | null | null | README.md | GalaIO/gala-resources | 595a15e0422050f1b7e91eeac7e09c54d4da8cd9 | [
"MIT"
] | 1 | 2020-10-25T15:24:35.000Z | 2020-10-25T15:24:35.000Z | README.md | GalaIO/gala-resources | 595a15e0422050f1b7e91eeac7e09c54d4da8cd9 | [
"MIT"
] | null | null | null | # gala-resources
some resources for gala coder~
| 16 | 30 | 0.791667 | eng_Latn | 0.845913 |
db750a70d908612edfbec7b71e0817112c348c91 | 19,914 | md | Markdown | fabric/28919-29127/29072.md | hyperledger-gerrit-archive/fabric-gerrit | 188c6e69ccb2e4c4d609ae749a467fa7e289b262 | [
"Apache-2.0"
] | 2 | 2021-01-08T04:06:04.000Z | 2021-02-09T08:28:54.000Z | fabric/28919-29127/29072.md | cendhu/fabric-gerrit | 188c6e69ccb2e4c4d609ae749a467fa7e289b262 | [
"Apache-2.0"
] | null | null | null | fabric/28919-29127/29072.md | cendhu/fabric-gerrit | 188c6e69ccb2e4c4d609ae749a467fa7e289b262 | [
"Apache-2.0"
] | 4 | 2019-12-07T05:54:26.000Z | 2020-06-04T02:29:43.000Z | <strong>Project</strong>: fabric<br><strong>Branch</strong>: master<br><strong>ID</strong>: 29072<br><strong>Subject</strong>: code hygiene: rm unused ledger APIs<br><strong>Status</strong>: MERGED<br><strong>Owner</strong>: Senthilnathan N - cendhu@gmail.com<br><strong>Assignee</strong>:<br><strong>Created</strong>: 1/31/2019, 11:33:45 AM<br><strong>LastUpdated</strong>: 2/27/2019, 12:18:49 PM<br><strong>CommitMessage</strong>:<br><pre>code hygiene: rm unused ledger APIs
This CR removes the following three unused APIs
from the ledger interface:
(1) PurgePrivateData()
(2) Prune()
(3) PrivateDataMinBlockNum()
Change-Id: I7383023766d5094fddb2540ef216dbb9ba341e9e
Signed-off-by: senthil <cendhu@gmail.com>
</pre><h1>Comments</h1><strong>Reviewer</strong>: Senthilnathan N - cendhu@gmail.com<br><strong>Reviewed</strong>: 1/31/2019, 11:33:45 AM<br><strong>Message</strong>: <pre>Uploaded patch set 1.</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 1/31/2019, 11:37:08 AM<br><strong>Message</strong>: <pre>Patch Set 1:
Build Started https://jenkins.hyperledger.org/job/fabric-verify-build-checks-x86_64/9628/</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 1/31/2019, 11:38:44 AM<br><strong>Message</strong>: <pre>Patch Set 1:
Starting verify build</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 1/31/2019, 11:44:24 AM<br><strong>Message</strong>: <pre>Patch Set 1: F2-DocBuild+1 F1-VerifyBuild+1
Succeeded, Run IntegrationTest, Run UnitTest</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 1/31/2019, 11:45:17 AM<br><strong>Message</strong>: <pre>Patch Set 1:
Build Successful
https://jenkins.hyperledger.org/job/fabric-verify-build-checks-x86_64/9628/ : SUCCESS (skipped)
Logs: https://logs.hyperledger.org/production/vex-yul-hyp-jenkins-3/fabric-verify-build-checks-x86_64/9628</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 1/31/2019, 11:53:44 AM<br><strong>Message</strong>: <pre>Patch Set 1:
Build Started https://jenkins.hyperledger.org/job/fabric-verify-unit-tests-x86_64/8535/ (1/2)</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 1/31/2019, 11:53:53 AM<br><strong>Message</strong>: <pre>Patch Set 1:
Build Started https://jenkins.hyperledger.org/job/fabric-verify-integration-tests-x86_64/5209/ (2/2)</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 1/31/2019, 11:55:09 AM<br><strong>Message</strong>: <pre>Patch Set 1:
Starting unit tests</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 1/31/2019, 11:55:15 AM<br><strong>Message</strong>: <pre>Patch Set 1:
Starting Integration tests</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 1/31/2019, 12:21:14 PM<br><strong>Message</strong>: <pre>Patch Set 1: F3-UnitTest+1
Succeeded</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 1/31/2019, 12:33:32 PM<br><strong>Message</strong>: <pre>Patch Set 1: F3-IntegrationTest+1
Succeeded</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 1/31/2019, 12:34:23 PM<br><strong>Message</strong>: <pre>Patch Set 1:
Build Successful
https://jenkins.hyperledger.org/job/fabric-verify-unit-tests-x86_64/8535/ : SUCCESS (skipped)
Logs: https://logs.hyperledger.org/production/vex-yul-hyp-jenkins-3/fabric-verify-unit-tests-x86_64/8535
https://jenkins.hyperledger.org/job/fabric-verify-integration-tests-x86_64/5209/ : SUCCESS (skipped)
Logs: https://logs.hyperledger.org/production/vex-yul-hyp-jenkins-3/fabric-verify-integration-tests-x86_64/5209</pre><strong>Reviewer</strong>: Manish Sethi - manish.sethi@gmail.com<br><strong>Reviewed</strong>: 1/31/2019, 8:11:12 PM<br><strong>Message</strong>: <pre>Patch Set 1: Code-Review+2</pre><strong>Reviewer</strong>: Christopher Ferris - chris.ferris@gmail.com<br><strong>Reviewed</strong>: 2/26/2019, 1:31:07 PM<br><strong>Message</strong>: <pre>Patch Set 1: Code-Review+2
really should have a JIRA but going to merge regardless. FAB-1686 seems relevant</pre><strong>Reviewer</strong>: Christopher Ferris - chris.ferris@gmail.com<br><strong>Reviewed</strong>: 2/26/2019, 1:31:50 PM<br><strong>Message</strong>: <pre>Removed Code-Review+2 by Christopher Ferris <chris.ferris@gmail.com>
</pre><strong>Reviewer</strong>: Christopher Ferris - chris.ferris@gmail.com<br><strong>Reviewed</strong>: 2/26/2019, 1:32:04 PM<br><strong>Message</strong>: <pre>Patch Set 1:
needs a rebase</pre><strong>Reviewer</strong>: Senthilnathan N - cendhu@gmail.com<br><strong>Reviewed</strong>: 2/26/2019, 1:34:35 PM<br><strong>Message</strong>: <pre>Patch Set 1:
Chris, will do by tomorrow.</pre><strong>Reviewer</strong>: Senthilnathan N - cendhu@gmail.com<br><strong>Reviewed</strong>: 2/27/2019, 1:50:37 AM<br><strong>Message</strong>: <pre>Uploaded patch set 2.</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 1:53:07 AM<br><strong>Message</strong>: <pre>Patch Set 2:
Build Started https://jenkins.hyperledger.org/job/fabric-verify-build-checks-x86_64/10751/</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 1:53:42 AM<br><strong>Message</strong>: <pre>Patch Set 2:
Starting verify build</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 2:00:09 AM<br><strong>Message</strong>: <pre>Patch Set 2: F2-DocBuild+1 F1-VerifyBuild+1
Succeeded, Run IntegrationTest, Run UnitTest</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 2:00:52 AM<br><strong>Message</strong>: <pre>Patch Set 2:
Build Successful
https://jenkins.hyperledger.org/job/fabric-verify-build-checks-x86_64/10751/ : SUCCESS (skipped)
Logs: https://logs.hyperledger.org/production/vex-yul-hyp-jenkins-3/fabric-verify-build-checks-x86_64/10751</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 2:02:20 AM<br><strong>Message</strong>: <pre>Patch Set 2:
Build Started https://jenkins.hyperledger.org/job/fabric-verify-unit-tests-x86_64/9463/ (1/2)</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 2:02:52 AM<br><strong>Message</strong>: <pre>Patch Set 2:
Starting unit tests</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 2:03:05 AM<br><strong>Message</strong>: <pre>Patch Set 2:
Build Started https://jenkins.hyperledger.org/job/fabric-verify-integration-tests-x86_64/6235/ (2/2)</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 2:03:31 AM<br><strong>Message</strong>: <pre>Patch Set 2:
Starting Integration tests</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 2:31:56 AM<br><strong>Message</strong>: <pre>Patch Set 2: F3-UnitTest+1
Succeeded</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 2:41:11 AM<br><strong>Message</strong>: <pre>Patch Set 2: F3-IntegrationTest+1
Succeeded</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 2:41:50 AM<br><strong>Message</strong>: <pre>Patch Set 2:
Build Successful
https://jenkins.hyperledger.org/job/fabric-verify-unit-tests-x86_64/9463/ : SUCCESS (skipped)
Logs: https://logs.hyperledger.org/production/vex-yul-hyp-jenkins-3/fabric-verify-unit-tests-x86_64/9463
https://jenkins.hyperledger.org/job/fabric-verify-integration-tests-x86_64/6235/ : SUCCESS (skipped)
Logs: https://logs.hyperledger.org/production/vex-yul-hyp-jenkins-3/fabric-verify-integration-tests-x86_64/6235</pre><strong>Reviewer</strong>: David Enyeart - enyeart@us.ibm.com<br><strong>Reviewed</strong>: 2/27/2019, 10:07:12 AM<br><strong>Message</strong>: <pre>Patch Set 2: Code-Review+2</pre><strong>Reviewer</strong>: Manish Sethi - manish.sethi@gmail.com<br><strong>Reviewed</strong>: 2/27/2019, 10:21:08 AM<br><strong>Message</strong>: <pre>Patch Set 2:
Senthil, Can you make sure that you have latest version of counterfeiter on your machine. when I run go generate on my machine I get a different output.</pre><strong>Reviewer</strong>: Manish Sethi - manish.sethi@gmail.com<br><strong>Reviewed</strong>: 2/27/2019, 10:21:27 AM<br><strong>Message</strong>: <pre>Patch Set 2:
`go get -u github.com/maxbrunsfeld/counterfeiter`</pre><strong>Reviewer</strong>: David Enyeart - enyeart@us.ibm.com<br><strong>Reviewed</strong>: 2/27/2019, 10:23:01 AM<br><strong>Message</strong>: <pre>Removed Code-Review+2 by David Enyeart <enyeart@us.ibm.com>
</pre><strong>Reviewer</strong>: Senthilnathan N - cendhu@gmail.com<br><strong>Reviewed</strong>: 2/27/2019, 10:23:19 AM<br><strong>Message</strong>: <pre>Patch Set 2:
sure.. pain of using external tools.</pre><strong>Reviewer</strong>: Senthilnathan N - cendhu@gmail.com<br><strong>Reviewed</strong>: 2/27/2019, 10:31:40 AM<br><strong>Message</strong>: <pre>Uploaded patch set 3.</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 10:34:36 AM<br><strong>Message</strong>: <pre>Patch Set 3:
Build Started https://jenkins.hyperledger.org/job/fabric-verify-build-checks-x86_64/10828/</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 10:35:04 AM<br><strong>Message</strong>: <pre>Patch Set 3:
Starting verify build</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 10:41:12 AM<br><strong>Message</strong>: <pre>Patch Set 3: F2-DocBuild+1 F1-VerifyBuild+1
Succeeded, Run IntegrationTest, Run UnitTest</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 10:41:54 AM<br><strong>Message</strong>: <pre>Patch Set 3:
Build Successful
https://jenkins.hyperledger.org/job/fabric-verify-build-checks-x86_64/10828/ : SUCCESS (skipped)
Logs: https://logs.hyperledger.org/production/vex-yul-hyp-jenkins-3/fabric-verify-build-checks-x86_64/10828</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 10:44:29 AM<br><strong>Message</strong>: <pre>Patch Set 3:
Build Started https://jenkins.hyperledger.org/job/fabric-verify-unit-tests-x86_64/9538/ (1/2)</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 10:44:58 AM<br><strong>Message</strong>: <pre>Patch Set 3:
Starting unit tests</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 10:45:02 AM<br><strong>Message</strong>: <pre>Patch Set 3:
Build Started https://jenkins.hyperledger.org/job/fabric-verify-integration-tests-x86_64/6312/ (2/2)</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 10:45:31 AM<br><strong>Message</strong>: <pre>Patch Set 3:
Starting Integration tests</pre><strong>Reviewer</strong>: Manish Sethi - manish.sethi@gmail.com<br><strong>Reviewed</strong>: 2/27/2019, 10:47:29 AM<br><strong>Message</strong>: <pre>Patch Set 3: Code-Review+2
All red looks really nice :-)</pre><strong>Reviewer</strong>: Manish Sethi - manish.sethi@gmail.com<br><strong>Reviewed</strong>: 2/27/2019, 10:49:11 AM<br><strong>Message</strong>: <pre>Patch Set 3:
> sure.. pain of using external tools.
yes, wish this would be in out build image...</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 11:12:05 AM<br><strong>Message</strong>: <pre>Patch Set 3: F3-UnitTest+1
Succeeded</pre><strong>Reviewer</strong>: David Enyeart - enyeart@us.ibm.com<br><strong>Reviewed</strong>: 2/27/2019, 11:22:21 AM<br><strong>Message</strong>: <pre>Patch Set 3: Code-Review+2</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 11:33:35 AM<br><strong>Message</strong>: <pre>Patch Set 3: F3-IntegrationTest+1
Succeeded</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 11:34:17 AM<br><strong>Message</strong>: <pre>Patch Set 3:
Build Successful
https://jenkins.hyperledger.org/job/fabric-verify-unit-tests-x86_64/9538/ : SUCCESS (skipped)
Logs: https://logs.hyperledger.org/production/vex-yul-hyp-jenkins-3/fabric-verify-unit-tests-x86_64/9538
https://jenkins.hyperledger.org/job/fabric-verify-integration-tests-x86_64/6312/ : SUCCESS (skipped)
Logs: https://logs.hyperledger.org/production/vex-yul-hyp-jenkins-3/fabric-verify-integration-tests-x86_64/6312</pre><strong>Reviewer</strong>: David Enyeart - enyeart@us.ibm.com<br><strong>Reviewed</strong>: 2/27/2019, 11:51:56 AM<br><strong>Message</strong>: <pre>Change has been successfully merged by David Enyeart</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 11:54:36 AM<br><strong>Message</strong>: <pre>Patch Set 3:
Build Started https://jenkins.hyperledger.org/job/fabric-merge-x86_64/5762/ (1/2)</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 11:55:36 AM<br><strong>Message</strong>: <pre>Patch Set 3:
Build Started https://jenkins.hyperledger.org/job/fabric-merge-end-2-end-x86_64/4447/ (2/2)</pre><strong>Reviewer</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Reviewed</strong>: 2/27/2019, 12:18:49 PM<br><strong>Message</strong>: <pre>Patch Set 3:
Build Failed
https://jenkins.hyperledger.org/job/fabric-merge-end-2-end-x86_64/4447/ : FAILURE (skipped)
Logs: https://logs.hyperledger.org/production/vex-yul-hyp-jenkins-3/fabric-merge-end-2-end-x86_64/4447
https://jenkins.hyperledger.org/job/fabric-merge-x86_64/5762/ : SUCCESS (skipped)
Logs: https://logs.hyperledger.org/production/vex-yul-hyp-jenkins-3/fabric-merge-x86_64/5762</pre><h1>PatchSets</h1><h3>PatchSet Number: 1</h3><blockquote><strong>Type</strong>: REWORK<br><strong>Author</strong>: Senthilnathan N - cendhu@gmail.com<br><strong>Uploader</strong>: Senthilnathan N - cendhu@gmail.com<br><strong>Created</strong>: 1/31/2019, 11:33:45 AM<br><strong>UnmergedRevision</strong>: [91df3e51972f1455774c586f273a66cca9d4a6c9](https://github.com/hyperledger-gerrit-archive/fabric/commit/91df3e51972f1455774c586f273a66cca9d4a6c9)<br><br><strong>Approver</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Approved</strong>: 1/31/2019, 11:44:24 AM<br><strong>Type</strong>: F1-VerifyBuild<br><strong>Value</strong>: 1<br><br><strong>Approver</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Approved</strong>: 1/31/2019, 11:44:24 AM<br><strong>Type</strong>: F2-DocBuild<br><strong>Value</strong>: 1<br><br><strong>Approver</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Approved</strong>: 1/31/2019, 12:33:32 PM<br><strong>Type</strong>: F3-IntegrationTest<br><strong>Value</strong>: 1<br><br><strong>Approver</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Approved</strong>: 1/31/2019, 12:21:14 PM<br><strong>Type</strong>: F3-UnitTest<br><strong>Value</strong>: 1<br><br><strong>Approver</strong>: Manish Sethi - manish.sethi@gmail.com<br><strong>Approved</strong>: 1/31/2019, 8:11:12 PM<br><strong>Type</strong>: Code-Review<br><strong>Value</strong>: 1<br><br></blockquote><h3>PatchSet Number: 2</h3><blockquote><strong>Type</strong>: REWORK<br><strong>Author</strong>: Senthilnathan N - cendhu@gmail.com<br><strong>Uploader</strong>: Senthilnathan N - cendhu@gmail.com<br><strong>Created</strong>: 2/27/2019, 1:50:37 AM<br><strong>UnmergedRevision</strong>: [81ddf32bc4fb300523043eb39cde3eedf31a62e3](https://github.com/hyperledger-gerrit-archive/fabric/commit/81ddf32bc4fb300523043eb39cde3eedf31a62e3)<br><br><strong>Approver</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Approved</strong>: 2/27/2019, 2:00:09 AM<br><strong>Type</strong>: F1-VerifyBuild<br><strong>Value</strong>: 1<br><br><strong>Approver</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Approved</strong>: 2/27/2019, 2:00:09 AM<br><strong>Type</strong>: F2-DocBuild<br><strong>Value</strong>: 1<br><br><strong>Approver</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Approved</strong>: 2/27/2019, 2:41:11 AM<br><strong>Type</strong>: F3-IntegrationTest<br><strong>Value</strong>: 1<br><br><strong>Approver</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Approved</strong>: 2/27/2019, 2:31:56 AM<br><strong>Type</strong>: F3-UnitTest<br><strong>Value</strong>: 1<br><br></blockquote><h3>PatchSet Number: 3</h3><blockquote><strong>Type</strong>: REWORK<br><strong>Author</strong>: Senthilnathan N - cendhu@gmail.com<br><strong>Uploader</strong>: Senthilnathan N - cendhu@gmail.com<br><strong>Created</strong>: 2/27/2019, 10:31:40 AM<br><strong>GitHubMergedRevision</strong>: [3560587b9d57b8b112acecf86c9a322ee73c91cd](https://github.com/hyperledger-gerrit-archive/fabric/commit/3560587b9d57b8b112acecf86c9a322ee73c91cd)<br><br><strong>Approver</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Approved</strong>: 2/27/2019, 10:41:12 AM<br><strong>Type</strong>: F1-VerifyBuild<br><strong>Value</strong>: 1<br><br><strong>Approver</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Approved</strong>: 2/27/2019, 10:41:12 AM<br><strong>Type</strong>: F2-DocBuild<br><strong>Value</strong>: 1<br><br><strong>Approver</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Approved</strong>: 2/27/2019, 11:33:35 AM<br><strong>Type</strong>: F3-IntegrationTest<br><strong>Value</strong>: 1<br><br><strong>Approver</strong>: Hyperledger Jobbuilder - jobbuilder@jenkins.hyperledger.org<br><strong>Approved</strong>: 2/27/2019, 11:12:05 AM<br><strong>Type</strong>: F3-UnitTest<br><strong>Value</strong>: 1<br><br><strong>Approver</strong>: Manish Sethi - manish.sethi@gmail.com<br><strong>Approved</strong>: 2/27/2019, 10:47:29 AM<br><strong>Type</strong>: Code-Review<br><strong>Value</strong>: 1<br><br><strong>Approver</strong>: David Enyeart - enyeart@us.ibm.com<br><strong>Approved</strong>: 2/27/2019, 11:22:21 AM<br><strong>Type</strong>: Code-Review<br><strong>Value</strong>: 1<br><br><strong>MergedBy</strong>: David Enyeart<br><strong>Merged</strong>: 2/27/2019, 11:51:56 AM<br><br></blockquote> | 135.469388 | 4,740 | 0.761776 | kor_Hang | 0.468009 |
db753f517e7e90dd4edf9b505bccc44ec218d53a | 153,900 | md | Markdown | README.md | alexanderbeat/KC-Housing-Price-Prediction | 08166c0501683111f660c95d6e71f8bab825bb04 | [
"MIT"
] | null | null | null | README.md | alexanderbeat/KC-Housing-Price-Prediction | 08166c0501683111f660c95d6e71f8bab825bb04 | [
"MIT"
] | null | null | null | README.md | alexanderbeat/KC-Housing-Price-Prediction | 08166c0501683111f660c95d6e71f8bab825bb04 | [
"MIT"
] | null | null | null |
# Final Project Submission
Please fill out:
* Student name: alex beat
* Student pace: self paced / part time / full time: part time
* Scheduled project review date/time: na
* Instructor name: James Irving
* Blog post URL: https://medium.com/@jonathonalexander/software-engineer-or-data-scientist-3493360685d8
* Video of 5-min Non-Technical Presentation: na
# TABLE OF CONTENTS
*Click to jump to matching Markdown Header.*<br><br>
<font size=4rem>
- [Introduction](#INTRODUCTION)<br>
- **[OBTAIN](#OBTAIN)**<br>
- **[SCRUB](#SCRUB)**<br>
- **[EXPLORE](#EXPLORE)**<br>
- **[MODEL](#MODEL)**<br>
- **[iNTERPRET](#iNTERPRET)**<br>
- [Conclusions/Recommendations](#CONCLUSIONS-&-RECOMMENDATIONS)<br>
</font>
___
## PROCESS CHECKLIST
1. **[OBTAIN](#OBTAIN)**
- Import data, inspect, check for datatypes to convert and null values
- Display header and info.
- Drop any unneeded columns, if known (`df.drop(['col1','col2'],axis=1,inplace=True`)
<br><br>
2. **[SCRUB](#SCRUB)**
- Recast data types, identify outliers, check for multicollinearity, normalize data**
- Check and cast data types
- [ ] Check for #'s that are store as objects (`df.info()`,`df.describe()`)
- when converting to #'s, look for odd values (like many 0's), or strings that can't be converted.
- Decide how to deal weird/null values (`df.unique()`, `df.isna().sum()`)
- `df.fillna(subset=['col_with_nulls'],'fill_value')`, `df.replace()`
- [ ] Check for categorical variables stored as integers.
- May be easier to tell when you make a scatter plotm or `pd.plotting.scatter_matrix()`
- [ ] Check for missing values (df.isna().sum())
- Can drop rows or colums
- For missing numeric data with median or bin/convert to categorical
- For missing categorical data: make NaN own category OR replace with most common category
- [ ] Check for multicollinearity
- Use seaborn to make correlation matrix plot
- Good rule of thumb is anything over 0.75 corr is high, remove the variable that has the most correl with the largest # of variables
- [ ] Normalize data (may want to do after some exploring)
- Most popular is Z-scoring (but won't fix skew)
- Can log-transform to fix skewed data
3. **[EXPLORE](#EXPLORE)**
- [ ] Check distributions, outliers, etc**
- [ ] Check scales, ranges (df.describe())
- [ ] Check histograms to get an idea of distributions (df.hist()) and data transformations to perform.
- Can also do kernel density estimates
- [ ] Use scatter plots to check for linearity and possible categorical variables (`df.plot("x","y")`)
- categoricals will look like vertical lines
- [ ] Use `pd.plotting.scatter_matrix(df)` to visualize possible relationships
- [ ] Check for linearity.
4. **[MODEL](#MODEL)**
- **Fit an initial model:**
- Run an initial model and get results
- **Holdout validation / Train/test split**
- use sklearn `train_test_split`
5. **[iNTERPRET](#iNTERPRET)**
- **Assessing the model:**
- Assess parameters (slope,intercept)
- Check if the model explains the variation in the data (RMSE, F, R_square)
- *Are the coeffs, slopes, intercepts in appropriate units?*
- *Whats the impact of collinearity? Can we ignore?*
<br><br>
- **Revise the fitted model**
- Multicollinearity is big issue for lin regression and cannot fully remove it
- Use the predictive ability of model to test it (like R2 and RMSE)
- Check for missed non-linearity
- **Interpret final model and draw >=3 conclusions and recommendations from dataset**
# INTRODUCTION
> Explain the point of your project and what question you are trying to answer with your modeling.
The purpose of this project is to clean, explore, and model this dataset with a multivariate linear regression to predict the sale price of houses as accurately as possible.
# OBTAIN
```python
# OBTAIN
# Import data, inspect, check for datatypes to convert and null values
# Display header and info.
# Drop any unneeded columns, if known (df.drop(['col1','col2'],axis=1,inplace=True)
```
```python
!pip install -U fsds_100719
from fsds_100719.imports import *
```
Requirement already up-to-date: fsds_100719 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (0.4.45)
Requirement already satisfied, skipping upgrade: tzlocal in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from fsds_100719) (2.0.0)
Requirement already satisfied, skipping upgrade: pprint in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from fsds_100719) (0.1)
Requirement already satisfied, skipping upgrade: IPython in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from fsds_100719) (7.8.0)
Requirement already satisfied, skipping upgrade: ipywidgets in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from fsds_100719) (7.5.1)
Requirement already satisfied, skipping upgrade: missingno in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from fsds_100719) (0.4.2)
Requirement already satisfied, skipping upgrade: scipy in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from fsds_100719) (1.3.1)
Requirement already satisfied, skipping upgrade: scikit-learn in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from fsds_100719) (0.21.2)
Requirement already satisfied, skipping upgrade: pandas in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from fsds_100719) (0.25.1)
Requirement already satisfied, skipping upgrade: pandas-profiling in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from fsds_100719) (2.3.0)
Requirement already satisfied, skipping upgrade: wordcloud in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from fsds_100719) (1.6.0)
Requirement already satisfied, skipping upgrade: numpy in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from fsds_100719) (1.16.5)
Requirement already satisfied, skipping upgrade: pyperclip in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from fsds_100719) (1.7.0)
Requirement already satisfied, skipping upgrade: matplotlib in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from fsds_100719) (3.1.1)
Requirement already satisfied, skipping upgrade: seaborn in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from fsds_100719) (0.9.0)
Requirement already satisfied, skipping upgrade: pytz in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from tzlocal->fsds_100719) (2019.2)
Requirement already satisfied, skipping upgrade: backcall in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from IPython->fsds_100719) (0.1.0)
Requirement already satisfied, skipping upgrade: appnope; sys_platform == "darwin" in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from IPython->fsds_100719) (0.1.0)
Requirement already satisfied, skipping upgrade: traitlets>=4.2 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from IPython->fsds_100719) (4.3.2)
Requirement already satisfied, skipping upgrade: decorator in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from IPython->fsds_100719) (4.4.0)
Requirement already satisfied, skipping upgrade: jedi>=0.10 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from IPython->fsds_100719) (0.15.1)
Requirement already satisfied, skipping upgrade: pexpect; sys_platform != "win32" in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from IPython->fsds_100719) (4.7.0)
Requirement already satisfied, skipping upgrade: pickleshare in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from IPython->fsds_100719) (0.7.5)
Requirement already satisfied, skipping upgrade: setuptools>=18.5 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from IPython->fsds_100719) (41.2.0)
Requirement already satisfied, skipping upgrade: pygments in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from IPython->fsds_100719) (2.4.2)
Requirement already satisfied, skipping upgrade: prompt-toolkit<2.1.0,>=2.0.0 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from IPython->fsds_100719) (2.0.9)
Requirement already satisfied, skipping upgrade: ipykernel>=4.5.1 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from ipywidgets->fsds_100719) (5.1.2)
Requirement already satisfied, skipping upgrade: widgetsnbextension~=3.5.0 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from ipywidgets->fsds_100719) (3.5.1)
Requirement already satisfied, skipping upgrade: nbformat>=4.2.0 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from ipywidgets->fsds_100719) (4.4.0)
Requirement already satisfied, skipping upgrade: joblib>=0.11 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from scikit-learn->fsds_100719) (0.13.2)
Requirement already satisfied, skipping upgrade: python-dateutil>=2.6.1 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pandas->fsds_100719) (2.8.0)
Requirement already satisfied, skipping upgrade: jinja2>=2.8 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pandas-profiling->fsds_100719) (2.10.1)
Requirement already satisfied, skipping upgrade: confuse>=1.0.0 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pandas-profiling->fsds_100719) (1.0.0)
Requirement already satisfied, skipping upgrade: htmlmin>=0.1.12 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pandas-profiling->fsds_100719) (0.1.12)
Requirement already satisfied, skipping upgrade: phik>=0.9.8 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pandas-profiling->fsds_100719) (0.9.8)
Requirement already satisfied, skipping upgrade: astropy in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pandas-profiling->fsds_100719) (3.2.3)
Requirement already satisfied, skipping upgrade: pillow in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from wordcloud->fsds_100719) (6.1.0)
Requirement already satisfied, skipping upgrade: cycler>=0.10 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from matplotlib->fsds_100719) (0.10.0)
Requirement already satisfied, skipping upgrade: kiwisolver>=1.0.1 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from matplotlib->fsds_100719) (1.1.0)
Requirement already satisfied, skipping upgrade: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from matplotlib->fsds_100719) (2.4.2)
Requirement already satisfied, skipping upgrade: ipython_genutils in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from traitlets>=4.2->IPython->fsds_100719) (0.2.0)
Requirement already satisfied, skipping upgrade: six in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from traitlets>=4.2->IPython->fsds_100719) (1.12.0)
Requirement already satisfied, skipping upgrade: parso>=0.5.0 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from jedi>=0.10->IPython->fsds_100719) (0.5.1)
Requirement already satisfied, skipping upgrade: ptyprocess>=0.5 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pexpect; sys_platform != "win32"->IPython->fsds_100719) (0.6.0)
Requirement already satisfied, skipping upgrade: wcwidth in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->IPython->fsds_100719) (0.1.7)
Requirement already satisfied, skipping upgrade: jupyter-client in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from ipykernel>=4.5.1->ipywidgets->fsds_100719) (5.3.3)
Requirement already satisfied, skipping upgrade: tornado>=4.2 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from ipykernel>=4.5.1->ipywidgets->fsds_100719) (6.0.3)
Requirement already satisfied, skipping upgrade: notebook>=4.4.1 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from widgetsnbextension~=3.5.0->ipywidgets->fsds_100719) (5.7.8)
Requirement already satisfied, skipping upgrade: jsonschema!=2.5.0,>=2.4 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from nbformat>=4.2.0->ipywidgets->fsds_100719) (3.0.2)
Requirement already satisfied, skipping upgrade: jupyter_core in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from nbformat>=4.2.0->ipywidgets->fsds_100719) (4.5.0)
Requirement already satisfied, skipping upgrade: MarkupSafe>=0.23 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from jinja2>=2.8->pandas-profiling->fsds_100719) (1.1.1)
Requirement already satisfied, skipping upgrade: pyyaml in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from confuse>=1.0.0->pandas-profiling->fsds_100719) (5.1.2)
Requirement already satisfied, skipping upgrade: numba>=0.38.1 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from phik>=0.9.8->pandas-profiling->fsds_100719) (0.46.0)
Requirement already satisfied, skipping upgrade: pytest-pylint>=0.13.0 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from phik>=0.9.8->pandas-profiling->fsds_100719) (0.14.1)
Requirement already satisfied, skipping upgrade: pytest>=4.0.2 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from phik>=0.9.8->pandas-profiling->fsds_100719) (5.3.0)
Requirement already satisfied, skipping upgrade: nbconvert>=5.3.1 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from phik>=0.9.8->pandas-profiling->fsds_100719) (5.5.0)
Requirement already satisfied, skipping upgrade: pyzmq>=13 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from jupyter-client->ipykernel>=4.5.1->ipywidgets->fsds_100719) (18.1.0)
Requirement already satisfied, skipping upgrade: Send2Trash in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets->fsds_100719) (1.5.0)
Requirement already satisfied, skipping upgrade: prometheus-client in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets->fsds_100719) (0.7.1)
Requirement already satisfied, skipping upgrade: terminado>=0.8.1 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets->fsds_100719) (0.8.2)
Requirement already satisfied, skipping upgrade: pyrsistent>=0.14.0 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets->fsds_100719) (0.14.11)
Requirement already satisfied, skipping upgrade: attrs>=17.4.0 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets->fsds_100719) (19.1.0)
Requirement already satisfied, skipping upgrade: llvmlite>=0.30.0dev0 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from numba>=0.38.1->phik>=0.9.8->pandas-profiling->fsds_100719) (0.30.0)
Requirement already satisfied, skipping upgrade: pylint>=1.4.5 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pytest-pylint>=0.13.0->phik>=0.9.8->pandas-profiling->fsds_100719) (2.4.4)
Requirement already satisfied, skipping upgrade: importlib-metadata>=0.12; python_version < "3.8" in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pytest>=4.0.2->phik>=0.9.8->pandas-profiling->fsds_100719) (0.17)
Requirement already satisfied, skipping upgrade: py>=1.5.0 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pytest>=4.0.2->phik>=0.9.8->pandas-profiling->fsds_100719) (1.8.0)
Requirement already satisfied, skipping upgrade: packaging in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pytest>=4.0.2->phik>=0.9.8->pandas-profiling->fsds_100719) (19.2)
Requirement already satisfied, skipping upgrade: more-itertools>=4.0.0 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pytest>=4.0.2->phik>=0.9.8->pandas-profiling->fsds_100719) (7.0.0)
Requirement already satisfied, skipping upgrade: pluggy<1.0,>=0.12 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pytest>=4.0.2->phik>=0.9.8->pandas-profiling->fsds_100719) (0.12.0)
Requirement already satisfied, skipping upgrade: bleach in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from nbconvert>=5.3.1->phik>=0.9.8->pandas-profiling->fsds_100719) (1.5.0)
Requirement already satisfied, skipping upgrade: defusedxml in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from nbconvert>=5.3.1->phik>=0.9.8->pandas-profiling->fsds_100719) (0.6.0)
Requirement already satisfied, skipping upgrade: testpath in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from nbconvert>=5.3.1->phik>=0.9.8->pandas-profiling->fsds_100719) (0.4.2)
Requirement already satisfied, skipping upgrade: pandocfilters>=1.4.1 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from nbconvert>=5.3.1->phik>=0.9.8->pandas-profiling->fsds_100719) (1.4.2)
Requirement already satisfied, skipping upgrade: mistune>=0.8.1 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from nbconvert>=5.3.1->phik>=0.9.8->pandas-profiling->fsds_100719) (0.8.4)
Requirement already satisfied, skipping upgrade: entrypoints>=0.2.2 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from nbconvert>=5.3.1->phik>=0.9.8->pandas-profiling->fsds_100719) (0.3)
Requirement already satisfied, skipping upgrade: mccabe<0.7,>=0.6 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pylint>=1.4.5->pytest-pylint>=0.13.0->phik>=0.9.8->pandas-profiling->fsds_100719) (0.6.1)
Requirement already satisfied, skipping upgrade: isort<5,>=4.2.5 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pylint>=1.4.5->pytest-pylint>=0.13.0->phik>=0.9.8->pandas-profiling->fsds_100719) (4.3.21)
Requirement already satisfied, skipping upgrade: astroid<2.4,>=2.3.0 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from pylint>=1.4.5->pytest-pylint>=0.13.0->phik>=0.9.8->pandas-profiling->fsds_100719) (2.3.3)
Requirement already satisfied, skipping upgrade: zipp>=0.5 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from importlib-metadata>=0.12; python_version < "3.8"->pytest>=4.0.2->phik>=0.9.8->pandas-profiling->fsds_100719) (0.5.1)
Requirement already satisfied, skipping upgrade: html5lib!=0.9999,!=0.99999,<0.99999999,>=0.999 in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from bleach->nbconvert>=5.3.1->phik>=0.9.8->pandas-profiling->fsds_100719) (0.9999999)
Requirement already satisfied, skipping upgrade: typed-ast<1.5,>=1.4.0; implementation_name == "cpython" and python_version < "3.8" in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from astroid<2.4,>=2.3.0->pylint>=1.4.5->pytest-pylint>=0.13.0->phik>=0.9.8->pandas-profiling->fsds_100719) (1.4.0)
Requirement already satisfied, skipping upgrade: wrapt==1.11.* in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from astroid<2.4,>=2.3.0->pylint>=1.4.5->pytest-pylint>=0.13.0->phik>=0.9.8->pandas-profiling->fsds_100719) (1.11.2)
Requirement already satisfied, skipping upgrade: lazy-object-proxy==1.4.* in /anaconda3/envs/learn-env/lib/python3.6/site-packages (from astroid<2.4,>=2.3.0->pylint>=1.4.5->pytest-pylint>=0.13.0->phik>=0.9.8->pandas-profiling->fsds_100719) (1.4.3)
```python
import statsmodels.api as sm
from statsmodels.formula.api import ols
import statsmodels.formula.api as smf
```
## Import data, inspect, display header and info.
```python
pd.set_option('display.max_columns',0)
```
```python
df = pd.read_csv('kc_house_data.csv')
display(df.head())
display(df.info())
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>id</th>
<th>date</th>
<th>price</th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>floors</th>
<th>waterfront</th>
<th>view</th>
<th>condition</th>
<th>grade</th>
<th>sqft_above</th>
<th>sqft_basement</th>
<th>yr_built</th>
<th>yr_renovated</th>
<th>zipcode</th>
<th>lat</th>
<th>long</th>
<th>sqft_living15</th>
<th>sqft_lot15</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>7129300520</td>
<td>10/13/2014</td>
<td>221900.0</td>
<td>3</td>
<td>1.00</td>
<td>1180</td>
<td>5650</td>
<td>1.0</td>
<td>NaN</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1180</td>
<td>0.0</td>
<td>1955</td>
<td>0.0</td>
<td>98178</td>
<td>47.5112</td>
<td>-122.257</td>
<td>1340</td>
<td>5650</td>
</tr>
<tr>
<td>1</td>
<td>6414100192</td>
<td>12/9/2014</td>
<td>538000.0</td>
<td>3</td>
<td>2.25</td>
<td>2570</td>
<td>7242</td>
<td>2.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>2170</td>
<td>400.0</td>
<td>1951</td>
<td>1991.0</td>
<td>98125</td>
<td>47.7210</td>
<td>-122.319</td>
<td>1690</td>
<td>7639</td>
</tr>
<tr>
<td>2</td>
<td>5631500400</td>
<td>2/25/2015</td>
<td>180000.0</td>
<td>2</td>
<td>1.00</td>
<td>770</td>
<td>10000</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>6</td>
<td>770</td>
<td>0.0</td>
<td>1933</td>
<td>NaN</td>
<td>98028</td>
<td>47.7379</td>
<td>-122.233</td>
<td>2720</td>
<td>8062</td>
</tr>
<tr>
<td>3</td>
<td>2487200875</td>
<td>12/9/2014</td>
<td>604000.0</td>
<td>4</td>
<td>3.00</td>
<td>1960</td>
<td>5000</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>5</td>
<td>7</td>
<td>1050</td>
<td>910.0</td>
<td>1965</td>
<td>0.0</td>
<td>98136</td>
<td>47.5208</td>
<td>-122.393</td>
<td>1360</td>
<td>5000</td>
</tr>
<tr>
<td>4</td>
<td>1954400510</td>
<td>2/18/2015</td>
<td>510000.0</td>
<td>3</td>
<td>2.00</td>
<td>1680</td>
<td>8080</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>1680</td>
<td>0.0</td>
<td>1987</td>
<td>0.0</td>
<td>98074</td>
<td>47.6168</td>
<td>-122.045</td>
<td>1800</td>
<td>7503</td>
</tr>
</tbody>
</table>
</div>
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 21597 entries, 0 to 21596
Data columns (total 21 columns):
id 21597 non-null int64
date 21597 non-null object
price 21597 non-null float64
bedrooms 21597 non-null int64
bathrooms 21597 non-null float64
sqft_living 21597 non-null int64
sqft_lot 21597 non-null int64
floors 21597 non-null float64
waterfront 19221 non-null float64
view 21534 non-null float64
condition 21597 non-null int64
grade 21597 non-null int64
sqft_above 21597 non-null int64
sqft_basement 21597 non-null object
yr_built 21597 non-null int64
yr_renovated 17755 non-null float64
zipcode 21597 non-null int64
lat 21597 non-null float64
long 21597 non-null float64
sqft_living15 21597 non-null int64
sqft_lot15 21597 non-null int64
dtypes: float64(8), int64(11), object(2)
memory usage: 3.5+ MB
None
## Check for repeat rows
```python
#check for repeat rows
df['id'].value_counts()
```
795000620 3
1825069031 2
2019200220 2
7129304540 2
1781500435 2
..
7812801125 1
4364700875 1
3021059276 1
880000205 1
1777500160 1
Name: id, Length: 21420, dtype: int64
```python
# drop repeat rows based on 'id'
df.drop_duplicates(subset='id', inplace=True)
df['id'].value_counts()
```
2911700010 1
5450300010 1
5104511600 1
1160000115 1
686530110 1
..
2115510470 1
2922701305 1
6071600370 1
526059224 1
1777500160 1
Name: id, Length: 21420, dtype: int64
## Check for null vals
```python
# check for null values and how many
display(df.isna().any())
display(df.isna().sum())
```
id False
date False
price False
bedrooms False
bathrooms False
sqft_living False
sqft_lot False
floors False
waterfront True
view True
condition False
grade False
sqft_above False
sqft_basement False
yr_built False
yr_renovated True
zipcode False
lat False
long False
sqft_living15 False
sqft_lot15 False
dtype: bool
id 0
date 0
price 0
bedrooms 0
bathrooms 0
sqft_living 0
sqft_lot 0
floors 0
waterfront 2353
view 63
condition 0
grade 0
sqft_above 0
sqft_basement 0
yr_built 0
yr_renovated 3804
zipcode 0
lat 0
long 0
sqft_living15 0
sqft_lot15 0
dtype: int64
### Fix waterfront nulls
```python
#waterfront with null value
df.loc[df['waterfront'].isna()]
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>id</th>
<th>date</th>
<th>price</th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>floors</th>
<th>waterfront</th>
<th>view</th>
<th>condition</th>
<th>grade</th>
<th>sqft_above</th>
<th>sqft_basement</th>
<th>yr_built</th>
<th>yr_renovated</th>
<th>zipcode</th>
<th>lat</th>
<th>long</th>
<th>sqft_living15</th>
<th>sqft_lot15</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>7129300520</td>
<td>10/13/2014</td>
<td>221900.0</td>
<td>3</td>
<td>1.00</td>
<td>1180</td>
<td>5650</td>
<td>1.0</td>
<td>NaN</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1180</td>
<td>0.0</td>
<td>1955</td>
<td>0.0</td>
<td>98178</td>
<td>47.5112</td>
<td>-122.257</td>
<td>1340</td>
<td>5650</td>
</tr>
<tr>
<td>10</td>
<td>1736800520</td>
<td>4/3/2015</td>
<td>662500.0</td>
<td>3</td>
<td>2.50</td>
<td>3560</td>
<td>9796</td>
<td>1.0</td>
<td>NaN</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>1860</td>
<td>1700.0</td>
<td>1965</td>
<td>0.0</td>
<td>98007</td>
<td>47.6007</td>
<td>-122.145</td>
<td>2210</td>
<td>8925</td>
</tr>
<tr>
<td>23</td>
<td>8091400200</td>
<td>5/16/2014</td>
<td>252700.0</td>
<td>2</td>
<td>1.50</td>
<td>1070</td>
<td>9643</td>
<td>1.0</td>
<td>NaN</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1070</td>
<td>0.0</td>
<td>1985</td>
<td>NaN</td>
<td>98030</td>
<td>47.3533</td>
<td>-122.166</td>
<td>1220</td>
<td>8386</td>
</tr>
<tr>
<td>40</td>
<td>5547700270</td>
<td>7/15/2014</td>
<td>625000.0</td>
<td>4</td>
<td>2.50</td>
<td>2570</td>
<td>5520</td>
<td>2.0</td>
<td>NaN</td>
<td>0.0</td>
<td>3</td>
<td>9</td>
<td>2570</td>
<td>0.0</td>
<td>2000</td>
<td>NaN</td>
<td>98074</td>
<td>47.6145</td>
<td>-122.027</td>
<td>2470</td>
<td>5669</td>
</tr>
<tr>
<td>55</td>
<td>9822700295</td>
<td>5/12/2014</td>
<td>885000.0</td>
<td>4</td>
<td>2.50</td>
<td>2830</td>
<td>5000</td>
<td>2.0</td>
<td>NaN</td>
<td>0.0</td>
<td>3</td>
<td>9</td>
<td>2830</td>
<td>0.0</td>
<td>1995</td>
<td>0.0</td>
<td>98105</td>
<td>47.6597</td>
<td>-122.290</td>
<td>1950</td>
<td>5000</td>
</tr>
<tr>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
<tr>
<td>21578</td>
<td>5087900040</td>
<td>10/17/2014</td>
<td>350000.0</td>
<td>4</td>
<td>2.75</td>
<td>2500</td>
<td>5995</td>
<td>2.0</td>
<td>NaN</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>2500</td>
<td>0.0</td>
<td>2008</td>
<td>0.0</td>
<td>98042</td>
<td>47.3749</td>
<td>-122.107</td>
<td>2530</td>
<td>5988</td>
</tr>
<tr>
<td>21582</td>
<td>8956200760</td>
<td>10/13/2014</td>
<td>541800.0</td>
<td>4</td>
<td>2.50</td>
<td>3118</td>
<td>7866</td>
<td>2.0</td>
<td>NaN</td>
<td>2.0</td>
<td>3</td>
<td>9</td>
<td>3118</td>
<td>0.0</td>
<td>2014</td>
<td>0.0</td>
<td>98001</td>
<td>47.2931</td>
<td>-122.264</td>
<td>2673</td>
<td>6500</td>
</tr>
<tr>
<td>21586</td>
<td>844000965</td>
<td>6/26/2014</td>
<td>224000.0</td>
<td>3</td>
<td>1.75</td>
<td>1500</td>
<td>11968</td>
<td>1.0</td>
<td>NaN</td>
<td>0.0</td>
<td>3</td>
<td>6</td>
<td>1500</td>
<td>0.0</td>
<td>2014</td>
<td>0.0</td>
<td>98010</td>
<td>47.3095</td>
<td>-122.002</td>
<td>1320</td>
<td>11303</td>
</tr>
<tr>
<td>21587</td>
<td>7852140040</td>
<td>8/25/2014</td>
<td>507250.0</td>
<td>3</td>
<td>2.50</td>
<td>2270</td>
<td>5536</td>
<td>2.0</td>
<td>NaN</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>2270</td>
<td>0.0</td>
<td>2003</td>
<td>0.0</td>
<td>98065</td>
<td>47.5389</td>
<td>-121.881</td>
<td>2270</td>
<td>5731</td>
</tr>
<tr>
<td>21595</td>
<td>291310100</td>
<td>1/16/2015</td>
<td>400000.0</td>
<td>3</td>
<td>2.50</td>
<td>1600</td>
<td>2388</td>
<td>2.0</td>
<td>NaN</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>1600</td>
<td>0.0</td>
<td>2004</td>
<td>0.0</td>
<td>98027</td>
<td>47.5345</td>
<td>-122.069</td>
<td>1410</td>
<td>1287</td>
</tr>
</tbody>
</table>
<p>2353 rows × 21 columns</p>
</div>
```python
# fix waterfront nulls by making nulls into 0.0 for nonwaterfront
df['waterfront'].fillna(0.0, inplace=True)
df.isna().sum()
```
id 0
date 0
price 0
bedrooms 0
bathrooms 0
sqft_living 0
sqft_lot 0
floors 0
waterfront 0
view 63
condition 0
grade 0
sqft_above 0
sqft_basement 0
yr_built 0
yr_renovated 3804
zipcode 0
lat 0
long 0
sqft_living15 0
sqft_lot15 0
dtype: int64
### Fix view nulls
```python
# number of value counts of 'view'. There's 63 null vals in 'view', time to fill them in as 0
df['view'].value_counts()
```
0.0 19253
2.0 956
3.0 505
1.0 329
4.0 314
Name: view, dtype: int64
```python
df['view'].fillna(0.0, inplace=True)
df.isna().sum()
```
id 0
date 0
price 0
bedrooms 0
bathrooms 0
sqft_living 0
sqft_lot 0
floors 0
waterfront 0
view 0
condition 0
grade 0
sqft_above 0
sqft_basement 0
yr_built 0
yr_renovated 3804
zipcode 0
lat 0
long 0
sqft_living15 0
sqft_lot15 0
dtype: int64
### Fix yr_renovated nulls
```python
#looking for nulls in yr renovated, seeing that median looks strange
df['yr_renovated'].describe()
```
count 17616.000000
mean 83.847241
std 400.436625
min 0.000000
25% 0.000000
50% 0.000000
75% 0.000000
max 2015.000000
Name: yr_renovated, dtype: float64
```python
df.loc[df['yr_renovated'].isna()]
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>id</th>
<th>date</th>
<th>price</th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>floors</th>
<th>waterfront</th>
<th>view</th>
<th>condition</th>
<th>grade</th>
<th>sqft_above</th>
<th>sqft_basement</th>
<th>yr_built</th>
<th>yr_renovated</th>
<th>zipcode</th>
<th>lat</th>
<th>long</th>
<th>sqft_living15</th>
<th>sqft_lot15</th>
</tr>
</thead>
<tbody>
<tr>
<td>2</td>
<td>5631500400</td>
<td>2/25/2015</td>
<td>180000.0</td>
<td>2</td>
<td>1.00</td>
<td>770</td>
<td>10000</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>6</td>
<td>770</td>
<td>0.0</td>
<td>1933</td>
<td>NaN</td>
<td>98028</td>
<td>47.7379</td>
<td>-122.233</td>
<td>2720</td>
<td>8062</td>
</tr>
<tr>
<td>12</td>
<td>114101516</td>
<td>5/28/2014</td>
<td>310000.0</td>
<td>3</td>
<td>1.00</td>
<td>1430</td>
<td>19901</td>
<td>1.5</td>
<td>0.0</td>
<td>0.0</td>
<td>4</td>
<td>7</td>
<td>1430</td>
<td>0.0</td>
<td>1927</td>
<td>NaN</td>
<td>98028</td>
<td>47.7558</td>
<td>-122.229</td>
<td>1780</td>
<td>12697</td>
</tr>
<tr>
<td>23</td>
<td>8091400200</td>
<td>5/16/2014</td>
<td>252700.0</td>
<td>2</td>
<td>1.50</td>
<td>1070</td>
<td>9643</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1070</td>
<td>0.0</td>
<td>1985</td>
<td>NaN</td>
<td>98030</td>
<td>47.3533</td>
<td>-122.166</td>
<td>1220</td>
<td>8386</td>
</tr>
<tr>
<td>26</td>
<td>1794500383</td>
<td>6/26/2014</td>
<td>937000.0</td>
<td>3</td>
<td>1.75</td>
<td>2450</td>
<td>2691</td>
<td>2.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>1750</td>
<td>700.0</td>
<td>1915</td>
<td>NaN</td>
<td>98119</td>
<td>47.6386</td>
<td>-122.360</td>
<td>1760</td>
<td>3573</td>
</tr>
<tr>
<td>28</td>
<td>5101402488</td>
<td>6/24/2014</td>
<td>438000.0</td>
<td>3</td>
<td>1.75</td>
<td>1520</td>
<td>6380</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>790</td>
<td>730.0</td>
<td>1948</td>
<td>NaN</td>
<td>98115</td>
<td>47.6950</td>
<td>-122.304</td>
<td>1520</td>
<td>6235</td>
</tr>
<tr>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
<tr>
<td>21576</td>
<td>1931300412</td>
<td>4/16/2015</td>
<td>475000.0</td>
<td>3</td>
<td>2.25</td>
<td>1190</td>
<td>1200</td>
<td>3.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>1190</td>
<td>0.0</td>
<td>2008</td>
<td>NaN</td>
<td>98103</td>
<td>47.6542</td>
<td>-122.346</td>
<td>1180</td>
<td>1224</td>
</tr>
<tr>
<td>21577</td>
<td>8672200110</td>
<td>3/17/2015</td>
<td>1090000.0</td>
<td>5</td>
<td>3.75</td>
<td>4170</td>
<td>8142</td>
<td>2.0</td>
<td>0.0</td>
<td>2.0</td>
<td>3</td>
<td>10</td>
<td>4170</td>
<td>0.0</td>
<td>2006</td>
<td>NaN</td>
<td>98056</td>
<td>47.5354</td>
<td>-122.181</td>
<td>3030</td>
<td>7980</td>
</tr>
<tr>
<td>21579</td>
<td>1972201967</td>
<td>10/31/2014</td>
<td>520000.0</td>
<td>2</td>
<td>2.25</td>
<td>1530</td>
<td>981</td>
<td>3.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>1480</td>
<td>50.0</td>
<td>2006</td>
<td>NaN</td>
<td>98103</td>
<td>47.6533</td>
<td>-122.346</td>
<td>1530</td>
<td>1282</td>
</tr>
<tr>
<td>21581</td>
<td>191100405</td>
<td>4/21/2015</td>
<td>1580000.0</td>
<td>4</td>
<td>3.25</td>
<td>3410</td>
<td>10125</td>
<td>2.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>10</td>
<td>3410</td>
<td>?</td>
<td>2007</td>
<td>NaN</td>
<td>98040</td>
<td>47.5653</td>
<td>-122.223</td>
<td>2290</td>
<td>10125</td>
</tr>
<tr>
<td>21583</td>
<td>7202300110</td>
<td>9/15/2014</td>
<td>810000.0</td>
<td>4</td>
<td>3.00</td>
<td>3990</td>
<td>7838</td>
<td>2.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>9</td>
<td>3990</td>
<td>0.0</td>
<td>2003</td>
<td>NaN</td>
<td>98053</td>
<td>47.6857</td>
<td>-122.046</td>
<td>3370</td>
<td>6814</td>
</tr>
</tbody>
</table>
<p>3804 rows × 21 columns</p>
</div>
```python
# there are loads of 0 vals in yr renovated in addition to the nulls
df['yr_renovated'].value_counts()
```
0.0 16876
2014.0 73
2003.0 31
2013.0 31
2007.0 30
...
1934.0 1
1971.0 1
1954.0 1
1950.0 1
1944.0 1
Name: yr_renovated, Length: 70, dtype: int64
```python
# fill na vals with 0 because there's a large amount already showing 0, just to get rid of na vals
df['yr_renovated'].fillna(0.0, inplace=True)
df.isna().sum()
```
id 0
date 0
price 0
bedrooms 0
bathrooms 0
sqft_living 0
sqft_lot 0
floors 0
waterfront 0
view 0
condition 0
grade 0
sqft_above 0
sqft_basement 0
yr_built 0
yr_renovated 0
zipcode 0
lat 0
long 0
sqft_living15 0
sqft_lot15 0
dtype: int64
## Check for datatypes to convert
```python
df.info()
```
<class 'pandas.core.frame.DataFrame'>
Int64Index: 21420 entries, 0 to 21596
Data columns (total 21 columns):
id 21420 non-null int64
date 21420 non-null object
price 21420 non-null float64
bedrooms 21420 non-null int64
bathrooms 21420 non-null float64
sqft_living 21420 non-null int64
sqft_lot 21420 non-null int64
floors 21420 non-null float64
waterfront 21420 non-null float64
view 21420 non-null float64
condition 21420 non-null int64
grade 21420 non-null int64
sqft_above 21420 non-null int64
sqft_basement 21420 non-null object
yr_built 21420 non-null int64
yr_renovated 21420 non-null float64
zipcode 21420 non-null int64
lat 21420 non-null float64
long 21420 non-null float64
sqft_living15 21420 non-null int64
sqft_lot15 21420 non-null int64
dtypes: float64(8), int64(11), object(2)
memory usage: 3.6+ MB
```python
# there's a boatload of ?s as objects in this column
df['sqft_basement'].value_counts()
```
0.0 12717
? 452
600.0 216
500.0 206
700.0 205
...
20.0 1
935.0 1
588.0 1
1284.0 1
3000.0 1
Name: sqft_basement, Length: 304, dtype: int64
```python
df.loc[df['sqft_basement'] == '?']
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>id</th>
<th>date</th>
<th>price</th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>floors</th>
<th>waterfront</th>
<th>view</th>
<th>condition</th>
<th>grade</th>
<th>sqft_above</th>
<th>sqft_basement</th>
<th>yr_built</th>
<th>yr_renovated</th>
<th>zipcode</th>
<th>lat</th>
<th>long</th>
<th>sqft_living15</th>
<th>sqft_lot15</th>
</tr>
</thead>
<tbody>
<tr>
<td>6</td>
<td>1321400060</td>
<td>6/27/2014</td>
<td>257500.0</td>
<td>3</td>
<td>2.25</td>
<td>1715</td>
<td>6819</td>
<td>2.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1715</td>
<td>?</td>
<td>1995</td>
<td>0.0</td>
<td>98003</td>
<td>47.3097</td>
<td>-122.327</td>
<td>2238</td>
<td>6819</td>
</tr>
<tr>
<td>18</td>
<td>16000397</td>
<td>12/5/2014</td>
<td>189000.0</td>
<td>2</td>
<td>1.00</td>
<td>1200</td>
<td>9850</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>4</td>
<td>7</td>
<td>1200</td>
<td>?</td>
<td>1921</td>
<td>0.0</td>
<td>98002</td>
<td>47.3089</td>
<td>-122.210</td>
<td>1060</td>
<td>5095</td>
</tr>
<tr>
<td>42</td>
<td>7203220400</td>
<td>7/7/2014</td>
<td>861990.0</td>
<td>5</td>
<td>2.75</td>
<td>3595</td>
<td>5639</td>
<td>2.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>9</td>
<td>3595</td>
<td>?</td>
<td>2014</td>
<td>0.0</td>
<td>98053</td>
<td>47.6848</td>
<td>-122.016</td>
<td>3625</td>
<td>5639</td>
</tr>
<tr>
<td>79</td>
<td>1531000030</td>
<td>3/23/2015</td>
<td>720000.0</td>
<td>4</td>
<td>2.50</td>
<td>3450</td>
<td>39683</td>
<td>2.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>10</td>
<td>3450</td>
<td>?</td>
<td>2002</td>
<td>0.0</td>
<td>98010</td>
<td>47.3420</td>
<td>-122.025</td>
<td>3350</td>
<td>39750</td>
</tr>
<tr>
<td>112</td>
<td>2525310310</td>
<td>9/16/2014</td>
<td>272500.0</td>
<td>3</td>
<td>1.75</td>
<td>1540</td>
<td>12600</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>4</td>
<td>7</td>
<td>1160</td>
<td>?</td>
<td>1980</td>
<td>0.0</td>
<td>98038</td>
<td>47.3624</td>
<td>-122.031</td>
<td>1540</td>
<td>11656</td>
</tr>
<tr>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
<tr>
<td>21442</td>
<td>3226049565</td>
<td>7/11/2014</td>
<td>504600.0</td>
<td>5</td>
<td>3.00</td>
<td>2360</td>
<td>5000</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1390</td>
<td>?</td>
<td>2008</td>
<td>0.0</td>
<td>98103</td>
<td>47.6931</td>
<td>-122.330</td>
<td>2180</td>
<td>5009</td>
</tr>
<tr>
<td>21447</td>
<td>1760650900</td>
<td>7/21/2014</td>
<td>337500.0</td>
<td>4</td>
<td>2.50</td>
<td>2330</td>
<td>4907</td>
<td>2.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>2330</td>
<td>?</td>
<td>2013</td>
<td>0.0</td>
<td>98042</td>
<td>47.3590</td>
<td>-122.081</td>
<td>2300</td>
<td>3836</td>
</tr>
<tr>
<td>21473</td>
<td>6021503707</td>
<td>1/20/2015</td>
<td>352500.0</td>
<td>2</td>
<td>2.50</td>
<td>980</td>
<td>1010</td>
<td>3.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>980</td>
<td>?</td>
<td>2008</td>
<td>0.0</td>
<td>98117</td>
<td>47.6844</td>
<td>-122.387</td>
<td>980</td>
<td>1023</td>
</tr>
<tr>
<td>21519</td>
<td>2909310100</td>
<td>10/15/2014</td>
<td>332000.0</td>
<td>4</td>
<td>2.50</td>
<td>2380</td>
<td>5737</td>
<td>2.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>2380</td>
<td>?</td>
<td>2010</td>
<td>0.0</td>
<td>98023</td>
<td>47.2815</td>
<td>-122.356</td>
<td>2380</td>
<td>5396</td>
</tr>
<tr>
<td>21581</td>
<td>191100405</td>
<td>4/21/2015</td>
<td>1580000.0</td>
<td>4</td>
<td>3.25</td>
<td>3410</td>
<td>10125</td>
<td>2.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>10</td>
<td>3410</td>
<td>?</td>
<td>2007</td>
<td>0.0</td>
<td>98040</td>
<td>47.5653</td>
<td>-122.223</td>
<td>2290</td>
<td>10125</td>
</tr>
</tbody>
</table>
<p>452 rows × 21 columns</p>
</div>
```python
#in order to simplify the prob of ?s in sqft basement, along with it being in object dtype, drop column completely.
df.drop('sqft_basement', axis=1, inplace=True)
df.head()
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>id</th>
<th>date</th>
<th>price</th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>floors</th>
<th>waterfront</th>
<th>view</th>
<th>condition</th>
<th>grade</th>
<th>sqft_above</th>
<th>yr_built</th>
<th>yr_renovated</th>
<th>zipcode</th>
<th>lat</th>
<th>long</th>
<th>sqft_living15</th>
<th>sqft_lot15</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>7129300520</td>
<td>10/13/2014</td>
<td>221900.0</td>
<td>3</td>
<td>1.00</td>
<td>1180</td>
<td>5650</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1180</td>
<td>1955</td>
<td>0.0</td>
<td>98178</td>
<td>47.5112</td>
<td>-122.257</td>
<td>1340</td>
<td>5650</td>
</tr>
<tr>
<td>1</td>
<td>6414100192</td>
<td>12/9/2014</td>
<td>538000.0</td>
<td>3</td>
<td>2.25</td>
<td>2570</td>
<td>7242</td>
<td>2.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>2170</td>
<td>1951</td>
<td>1991.0</td>
<td>98125</td>
<td>47.7210</td>
<td>-122.319</td>
<td>1690</td>
<td>7639</td>
</tr>
<tr>
<td>2</td>
<td>5631500400</td>
<td>2/25/2015</td>
<td>180000.0</td>
<td>2</td>
<td>1.00</td>
<td>770</td>
<td>10000</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>6</td>
<td>770</td>
<td>1933</td>
<td>0.0</td>
<td>98028</td>
<td>47.7379</td>
<td>-122.233</td>
<td>2720</td>
<td>8062</td>
</tr>
<tr>
<td>3</td>
<td>2487200875</td>
<td>12/9/2014</td>
<td>604000.0</td>
<td>4</td>
<td>3.00</td>
<td>1960</td>
<td>5000</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>5</td>
<td>7</td>
<td>1050</td>
<td>1965</td>
<td>0.0</td>
<td>98136</td>
<td>47.5208</td>
<td>-122.393</td>
<td>1360</td>
<td>5000</td>
</tr>
<tr>
<td>4</td>
<td>1954400510</td>
<td>2/18/2015</td>
<td>510000.0</td>
<td>3</td>
<td>2.00</td>
<td>1680</td>
<td>8080</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>1680</td>
<td>1987</td>
<td>0.0</td>
<td>98074</td>
<td>47.6168</td>
<td>-122.045</td>
<td>1800</td>
<td>7503</td>
</tr>
</tbody>
</table>
</div>
```python
# then create entire new column, based on sqft basement being the difference of sqft living and sqft above
df['sqft_basement'] = df['sqft_living'] - df['sqft_above']
df.head()
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>id</th>
<th>date</th>
<th>price</th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>floors</th>
<th>waterfront</th>
<th>view</th>
<th>condition</th>
<th>grade</th>
<th>sqft_above</th>
<th>yr_built</th>
<th>yr_renovated</th>
<th>zipcode</th>
<th>lat</th>
<th>long</th>
<th>sqft_living15</th>
<th>sqft_lot15</th>
<th>sqft_basement</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>7129300520</td>
<td>10/13/2014</td>
<td>221900.0</td>
<td>3</td>
<td>1.00</td>
<td>1180</td>
<td>5650</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1180</td>
<td>1955</td>
<td>0.0</td>
<td>98178</td>
<td>47.5112</td>
<td>-122.257</td>
<td>1340</td>
<td>5650</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>6414100192</td>
<td>12/9/2014</td>
<td>538000.0</td>
<td>3</td>
<td>2.25</td>
<td>2570</td>
<td>7242</td>
<td>2.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>2170</td>
<td>1951</td>
<td>1991.0</td>
<td>98125</td>
<td>47.7210</td>
<td>-122.319</td>
<td>1690</td>
<td>7639</td>
<td>400</td>
</tr>
<tr>
<td>2</td>
<td>5631500400</td>
<td>2/25/2015</td>
<td>180000.0</td>
<td>2</td>
<td>1.00</td>
<td>770</td>
<td>10000</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>6</td>
<td>770</td>
<td>1933</td>
<td>0.0</td>
<td>98028</td>
<td>47.7379</td>
<td>-122.233</td>
<td>2720</td>
<td>8062</td>
<td>0</td>
</tr>
<tr>
<td>3</td>
<td>2487200875</td>
<td>12/9/2014</td>
<td>604000.0</td>
<td>4</td>
<td>3.00</td>
<td>1960</td>
<td>5000</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>5</td>
<td>7</td>
<td>1050</td>
<td>1965</td>
<td>0.0</td>
<td>98136</td>
<td>47.5208</td>
<td>-122.393</td>
<td>1360</td>
<td>5000</td>
<td>910</td>
</tr>
<tr>
<td>4</td>
<td>1954400510</td>
<td>2/18/2015</td>
<td>510000.0</td>
<td>3</td>
<td>2.00</td>
<td>1680</td>
<td>8080</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>1680</td>
<td>1987</td>
<td>0.0</td>
<td>98074</td>
<td>47.6168</td>
<td>-122.045</td>
<td>1800</td>
<td>7503</td>
<td>0</td>
</tr>
</tbody>
</table>
</div>
```python
# sqft basement is a new column containing ints
df.info()
```
<class 'pandas.core.frame.DataFrame'>
Int64Index: 21420 entries, 0 to 21596
Data columns (total 21 columns):
id 21420 non-null int64
date 21420 non-null object
price 21420 non-null float64
bedrooms 21420 non-null int64
bathrooms 21420 non-null float64
sqft_living 21420 non-null int64
sqft_lot 21420 non-null int64
floors 21420 non-null float64
waterfront 21420 non-null float64
view 21420 non-null float64
condition 21420 non-null int64
grade 21420 non-null int64
sqft_above 21420 non-null int64
yr_built 21420 non-null int64
yr_renovated 21420 non-null float64
zipcode 21420 non-null int64
lat 21420 non-null float64
long 21420 non-null float64
sqft_living15 21420 non-null int64
sqft_lot15 21420 non-null int64
sqft_basement 21420 non-null int64
dtypes: float64(8), int64(12), object(1)
memory usage: 3.6+ MB
```python
# move sqft basement column back to original position
df = df[['id', 'date', 'price', 'bedrooms', 'bathrooms', 'sqft_living',
'sqft_lot', 'floors', 'waterfront', 'view', 'condition', 'grade',
'sqft_above', 'sqft_basement', 'yr_built', 'yr_renovated', 'zipcode', 'lat', 'long',
'sqft_living15', 'sqft_lot15']]
df.head()
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>id</th>
<th>date</th>
<th>price</th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>floors</th>
<th>waterfront</th>
<th>view</th>
<th>condition</th>
<th>grade</th>
<th>sqft_above</th>
<th>sqft_basement</th>
<th>yr_built</th>
<th>yr_renovated</th>
<th>zipcode</th>
<th>lat</th>
<th>long</th>
<th>sqft_living15</th>
<th>sqft_lot15</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>7129300520</td>
<td>10/13/2014</td>
<td>221900.0</td>
<td>3</td>
<td>1.00</td>
<td>1180</td>
<td>5650</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1180</td>
<td>0</td>
<td>1955</td>
<td>0.0</td>
<td>98178</td>
<td>47.5112</td>
<td>-122.257</td>
<td>1340</td>
<td>5650</td>
</tr>
<tr>
<td>1</td>
<td>6414100192</td>
<td>12/9/2014</td>
<td>538000.0</td>
<td>3</td>
<td>2.25</td>
<td>2570</td>
<td>7242</td>
<td>2.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>2170</td>
<td>400</td>
<td>1951</td>
<td>1991.0</td>
<td>98125</td>
<td>47.7210</td>
<td>-122.319</td>
<td>1690</td>
<td>7639</td>
</tr>
<tr>
<td>2</td>
<td>5631500400</td>
<td>2/25/2015</td>
<td>180000.0</td>
<td>2</td>
<td>1.00</td>
<td>770</td>
<td>10000</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>6</td>
<td>770</td>
<td>0</td>
<td>1933</td>
<td>0.0</td>
<td>98028</td>
<td>47.7379</td>
<td>-122.233</td>
<td>2720</td>
<td>8062</td>
</tr>
<tr>
<td>3</td>
<td>2487200875</td>
<td>12/9/2014</td>
<td>604000.0</td>
<td>4</td>
<td>3.00</td>
<td>1960</td>
<td>5000</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>5</td>
<td>7</td>
<td>1050</td>
<td>910</td>
<td>1965</td>
<td>0.0</td>
<td>98136</td>
<td>47.5208</td>
<td>-122.393</td>
<td>1360</td>
<td>5000</td>
</tr>
<tr>
<td>4</td>
<td>1954400510</td>
<td>2/18/2015</td>
<td>510000.0</td>
<td>3</td>
<td>2.00</td>
<td>1680</td>
<td>8080</td>
<td>1.0</td>
<td>0.0</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>1680</td>
<td>0</td>
<td>1987</td>
<td>0.0</td>
<td>98074</td>
<td>47.6168</td>
<td>-122.045</td>
<td>1800</td>
<td>7503</td>
</tr>
</tbody>
</table>
</div>
# SCRUB
```python
# Recast data types, identify outliers, check for multicollinearity, normalize data**
# Check and cast data types
# Check for #'s that are store as objects (df.info(),df.describe())
# when converting to #'s, look for odd values (like many 0's), or strings that can't be converted.
# Decide how to deal weird/null values (df.unique(), df.isna().sum())
# df.fillna(subset=['col_with_nulls'],'fill_value'), df.replace()
# Check for categorical variables stored as integers.
# May be easier to tell when you make a scatter plotm or pd.plotting.scatter_matrix()
# Check for missing values (df.isna().sum())
# Can drop rows or colums
# For missing numeric data with median or bin/convert to categorical
# For missing categorical data: make NaN own category OR replace with most common category
# Check for multicollinearity
# Use seaborn to make correlation matrix plot
# Good rule of thumb is anything over 0.75 corr is high, remove the variable that has the most correl with the largest # of variables
# Normalize data (may want to do after some exploring)
# Most popular is Z-scoring (but won't fix skew)
# Can log-transform to fix skewed data
```
```python
# reviewing describe to see 33 max value for bedrooms looks weird
# year renovated has min val as zero, so we'll take a look at that
# it looks like there's a few categorical variables we can touch on
display(df.describe().round(3))
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>id</th>
<th>price</th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>floors</th>
<th>waterfront</th>
<th>view</th>
<th>condition</th>
<th>grade</th>
<th>sqft_above</th>
<th>sqft_basement</th>
<th>yr_built</th>
<th>yr_renovated</th>
<th>zipcode</th>
<th>lat</th>
<th>long</th>
<th>sqft_living15</th>
<th>sqft_lot15</th>
</tr>
</thead>
<tbody>
<tr>
<td>count</td>
<td>2.142000e+04</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
<td>21420.000</td>
</tr>
<tr>
<td>mean</td>
<td>4.580940e+09</td>
<td>540739.304</td>
<td>3.374</td>
<td>2.118</td>
<td>2083.133</td>
<td>15128.038</td>
<td>1.496</td>
<td>0.007</td>
<td>0.234</td>
<td>3.411</td>
<td>7.663</td>
<td>1791.170</td>
<td>291.962</td>
<td>1971.093</td>
<td>68.957</td>
<td>98077.874</td>
<td>47.560</td>
<td>-122.214</td>
<td>1988.384</td>
<td>12775.718</td>
</tr>
<tr>
<td>std</td>
<td>2.876761e+09</td>
<td>367931.110</td>
<td>0.925</td>
<td>0.769</td>
<td>918.808</td>
<td>41530.797</td>
<td>0.540</td>
<td>0.082</td>
<td>0.765</td>
<td>0.650</td>
<td>1.172</td>
<td>828.693</td>
<td>442.876</td>
<td>29.387</td>
<td>364.552</td>
<td>53.477</td>
<td>0.139</td>
<td>0.141</td>
<td>685.537</td>
<td>27345.622</td>
</tr>
<tr>
<td>min</td>
<td>1.000102e+06</td>
<td>78000.000</td>
<td>1.000</td>
<td>0.500</td>
<td>370.000</td>
<td>520.000</td>
<td>1.000</td>
<td>0.000</td>
<td>0.000</td>
<td>1.000</td>
<td>3.000</td>
<td>370.000</td>
<td>0.000</td>
<td>1900.000</td>
<td>0.000</td>
<td>98001.000</td>
<td>47.156</td>
<td>-122.519</td>
<td>399.000</td>
<td>651.000</td>
</tr>
<tr>
<td>25%</td>
<td>2.123537e+09</td>
<td>322500.000</td>
<td>3.000</td>
<td>1.750</td>
<td>1430.000</td>
<td>5040.000</td>
<td>1.000</td>
<td>0.000</td>
<td>0.000</td>
<td>3.000</td>
<td>7.000</td>
<td>1200.000</td>
<td>0.000</td>
<td>1952.000</td>
<td>0.000</td>
<td>98033.000</td>
<td>47.471</td>
<td>-122.328</td>
<td>1490.000</td>
<td>5100.000</td>
</tr>
<tr>
<td>50%</td>
<td>3.904921e+09</td>
<td>450000.000</td>
<td>3.000</td>
<td>2.250</td>
<td>1920.000</td>
<td>7614.000</td>
<td>1.500</td>
<td>0.000</td>
<td>0.000</td>
<td>3.000</td>
<td>7.000</td>
<td>1560.000</td>
<td>0.000</td>
<td>1975.000</td>
<td>0.000</td>
<td>98065.000</td>
<td>47.572</td>
<td>-122.230</td>
<td>1840.000</td>
<td>7620.000</td>
</tr>
<tr>
<td>75%</td>
<td>7.308900e+09</td>
<td>645000.000</td>
<td>4.000</td>
<td>2.500</td>
<td>2550.000</td>
<td>10690.500</td>
<td>2.000</td>
<td>0.000</td>
<td>0.000</td>
<td>4.000</td>
<td>8.000</td>
<td>2220.000</td>
<td>560.000</td>
<td>1997.000</td>
<td>0.000</td>
<td>98117.000</td>
<td>47.678</td>
<td>-122.125</td>
<td>2370.000</td>
<td>10086.250</td>
</tr>
<tr>
<td>max</td>
<td>9.900000e+09</td>
<td>7700000.000</td>
<td>33.000</td>
<td>8.000</td>
<td>13540.000</td>
<td>1651359.000</td>
<td>3.500</td>
<td>1.000</td>
<td>4.000</td>
<td>5.000</td>
<td>13.000</td>
<td>9410.000</td>
<td>4820.000</td>
<td>2015.000</td>
<td>2015.000</td>
<td>98199.000</td>
<td>47.778</td>
<td>-121.315</td>
<td>6210.000</td>
<td>871200.000</td>
</tr>
</tbody>
</table>
</div>
## Drop unnecessary cols to simplify.
```python
#dropping pointless columns for ease of analysis
# drop id, date, view, soft above and basement,
df_basic = df.drop(['id','date','view','sqft_above','sqft_basement'], axis=1)
df_basic.head()
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>price</th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>floors</th>
<th>waterfront</th>
<th>condition</th>
<th>grade</th>
<th>yr_built</th>
<th>yr_renovated</th>
<th>zipcode</th>
<th>lat</th>
<th>long</th>
<th>sqft_living15</th>
<th>sqft_lot15</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>221900.0</td>
<td>3</td>
<td>1.00</td>
<td>1180</td>
<td>5650</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1955</td>
<td>0.0</td>
<td>98178</td>
<td>47.5112</td>
<td>-122.257</td>
<td>1340</td>
<td>5650</td>
</tr>
<tr>
<td>1</td>
<td>538000.0</td>
<td>3</td>
<td>2.25</td>
<td>2570</td>
<td>7242</td>
<td>2.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1951</td>
<td>1991.0</td>
<td>98125</td>
<td>47.7210</td>
<td>-122.319</td>
<td>1690</td>
<td>7639</td>
</tr>
<tr>
<td>2</td>
<td>180000.0</td>
<td>2</td>
<td>1.00</td>
<td>770</td>
<td>10000</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>6</td>
<td>1933</td>
<td>0.0</td>
<td>98028</td>
<td>47.7379</td>
<td>-122.233</td>
<td>2720</td>
<td>8062</td>
</tr>
<tr>
<td>3</td>
<td>604000.0</td>
<td>4</td>
<td>3.00</td>
<td>1960</td>
<td>5000</td>
<td>1.0</td>
<td>0.0</td>
<td>5</td>
<td>7</td>
<td>1965</td>
<td>0.0</td>
<td>98136</td>
<td>47.5208</td>
<td>-122.393</td>
<td>1360</td>
<td>5000</td>
</tr>
<tr>
<td>4</td>
<td>510000.0</td>
<td>3</td>
<td>2.00</td>
<td>1680</td>
<td>8080</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>1987</td>
<td>0.0</td>
<td>98074</td>
<td>47.6168</td>
<td>-122.045</td>
<td>1800</td>
<td>7503</td>
</tr>
</tbody>
</table>
</div>
```python
display(df.shape)
display(df_basic.shape)
```
(21420, 21)
(21420, 16)
## Check for categorical variables stored as integers.
```python
df_basic.columns
```
Index(['price', 'bedrooms', 'bathrooms', 'sqft_living', 'sqft_lot', 'floors',
'waterfront', 'condition', 'grade', 'yr_built', 'yr_renovated',
'zipcode', 'lat', 'long', 'sqft_living15', 'sqft_lot15'],
dtype='object')
```python
#checking plots for categorical columns
import matplotlib.pyplot as plt
%matplotlib inline
fig, axes = plt.subplots(nrows=1, ncols=4, figsize=(16,3))
for xcol, ax in zip(list(df_basic)[1:5], axes):
df_basic.plot(kind='scatter', x=xcol, y='price', ax=ax, alpha=0.4, color='b')
plt.tight_layout()
```
![png](output_45_0.png)
```python
# something is weird with sqft lot, looks like there are a lot of outliers.
```
```python
#checking plots for categorical columns
fig, axes = plt.subplots(nrows=1, ncols=4, figsize=(16,3))
for xcol, ax in zip(list(df_basic)[5:9], axes):
df_basic.plot(kind='scatter', x=xcol, y='price', ax=ax, alpha=0.4, color='b')
plt.tight_layout()
```
![png](output_47_0.png)
```python
#checking plots for categorical columns
fig, axes = plt.subplots(nrows=1, ncols=4, figsize=(16,3))
for xcol, ax in zip(list(df_basic)[9:13], axes):
df_basic.plot(kind='scatter', x=xcol, y='price', ax=ax, alpha=0.4, color='b')
plt.tight_layout()
```
![png](output_48_0.png)
```python
# yr renovated seems categorical but that's bc of the zero vals throwing off the graph incrementally.
# zip code is categorical
```
```python
#checking plots for categorical columns
fig, axes = plt.subplots(nrows=1, ncols=4, figsize=(16,3))
for xcol, ax in zip(list(df_basic)[13:15], axes):
df_basic.plot(kind='scatter', x=xcol, y='price', ax=ax, alpha=0.4, color='b')
plt.tight_layout()
```
![png](output_50_0.png)
```python
# sqft lot15 seems to have a lot of outliers.
```
```python
# categories - don’t log these - (use one hot c shortcut)
# waterfront - already in 1 and 0’s
# condition
# zipcode
# yr_built
# yr renovated
# numerical
# bedrooms (need to filter)
# bathrooms (need to filter)
# floors
# grade (ordinal category so can keep numeric - need to scale though)
# soft living (need to filter)
# soft lot (need to filter)
# lat (maybe to filter, will check after first model)
# long (maybe to filter, will check after first model)
# sqft lot 15 (need to filter)
```
```python
# list to look over:
# need to change list of categories, will try model before and after to compare.
# sqft lot, looks like there are a lot of outliers
# yr renovated seems categorical but that's bc of the zero vals throwing off the graph incrementally.
# sqft lot15 seems to have a lot of outliers.
```
### When converting to #'s, look for odd values (like many 0's), or strings that can't be converted.
```python
# # year renovated has min val as zero, so we'll take a look at that
# df.plot(kind='scatter', x='yr_renovated', y='price', alpha=0.4, color='b');
```
```python
# df.head(20)
```
```python
# sorted(df['yr_renovated'].unique())
```
```python
# df.loc[df['yr_renovated'] > 0]. describe()
```
```python
# # we are going to put yr renovated into bins and then into categories
# df['yr_renovated'].describe()
```
### Bin/convert yr_renovated to categorical.
```python
# # First, create bins based on the values observed. 5 values will result in 4 bins
# bins = [-1, 1930, 1950 , 1970, 1990, 2010, 2020]
# # Use pd.cut()
# bins_yr_renovated = pd.cut(df['yr_renovated'], bins)
```
```python
# # Using pd.cut() returns unordered categories. Transform this to ordered categories
# bins_yr_renovated = bins_yr_renovated.cat.as_ordered()
# bins_yr_renovated.head()
```
```python
# # Inspect the result
# bins_yr_renovated.value_counts().plot(kind='bar')
```
```python
# # Replace the existing 'yr_renovated' column
# df['yr_renovated']=bins_yr_renovated
```
```python
# df.head()
```
```python
# # label encode yr renovated for regression
# # [(-1, 1930] < (1930, 1950] < (1950, 1970] < (1970, 1990] < (1990, 2010] < (2010, 2020]]
# # 0 = never renovated, 1=1930-50, 2=1950-70, 3=1970-90, 4=1990-2010, 5=2010-present
# df['yr_renovated'] = df['yr_renovated'].cat.codes
```
```python
# # 0 = never renovated, 1=1930-50, 2=1950-70, 3=1970-90, 4=1990-2010, 5=2010-present
# df['yr_renovated'].value_counts()
```
```python
# # notice the difference now compared to the previous renovated scatter. much more organized.
# df.plot(kind='scatter', x='yr_renovated', y='price', alpha=0.4, color='b');
```
## Check for multicollinearity.
### Create heatmap for collinearity check.
```python
fig, axes = plt.subplots(figsize=(13,13))
sns.heatmap(df_basic.corr().round(3), center=0, square=True, ax=axes, annot=True);
axes.set_ylim(len(df_basic.corr()),-0.5,+0.5)
```
(16, -0.5)
![png](output_71_1.png)
Sqft_living15 seems to have a bit of correlation with sqft_living and with grade and since those two predictors already are fairly correlated, I'll drop sqft_living15.
## Drop cols affecting multicollinearity.
```python
df_basic.drop('sqft_living15', axis=1, inplace=True)
```
```python
df_basic.head()
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>price</th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>floors</th>
<th>waterfront</th>
<th>condition</th>
<th>grade</th>
<th>yr_built</th>
<th>yr_renovated</th>
<th>zipcode</th>
<th>lat</th>
<th>long</th>
<th>sqft_lot15</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>221900.0</td>
<td>3</td>
<td>1.00</td>
<td>1180</td>
<td>5650</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1955</td>
<td>0.0</td>
<td>98178</td>
<td>47.5112</td>
<td>-122.257</td>
<td>5650</td>
</tr>
<tr>
<td>1</td>
<td>538000.0</td>
<td>3</td>
<td>2.25</td>
<td>2570</td>
<td>7242</td>
<td>2.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1951</td>
<td>1991.0</td>
<td>98125</td>
<td>47.7210</td>
<td>-122.319</td>
<td>7639</td>
</tr>
<tr>
<td>2</td>
<td>180000.0</td>
<td>2</td>
<td>1.00</td>
<td>770</td>
<td>10000</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>6</td>
<td>1933</td>
<td>0.0</td>
<td>98028</td>
<td>47.7379</td>
<td>-122.233</td>
<td>8062</td>
</tr>
<tr>
<td>3</td>
<td>604000.0</td>
<td>4</td>
<td>3.00</td>
<td>1960</td>
<td>5000</td>
<td>1.0</td>
<td>0.0</td>
<td>5</td>
<td>7</td>
<td>1965</td>
<td>0.0</td>
<td>98136</td>
<td>47.5208</td>
<td>-122.393</td>
<td>5000</td>
</tr>
<tr>
<td>4</td>
<td>510000.0</td>
<td>3</td>
<td>2.00</td>
<td>1680</td>
<td>8080</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>1987</td>
<td>0.0</td>
<td>98074</td>
<td>47.6168</td>
<td>-122.045</td>
<td>7503</td>
</tr>
</tbody>
</table>
</div>
# EXPLORE
```python
# EXPLORE
# Check distributions, outliers, etc**
# Check scales, ranges (df.describe())
# Check histograms to get an idea of distributions (df.hist()) and data transformations to perform.
# Can also do kernel density estimates
# Use scatter plots to check for linearity and possible categorical variables (df.plot("x","y"))
# categoricals will look like vertical lines
# Use pd.plotting.scatter_matrix(df) to visualize possible relationships
# Check for linearity.
```
## Check distributions for normality.
```python
# Normalize data (may want to do after some exploring)
df_basic.hist(figsize=(10,10));
```
![png](output_79_0.png)
```python
# normalization thoughts:
# the only continuous variables I have are sqft living, sqft lot, living 15, lot 15.
# The rest are basically categorical. Not sure if those need to be normalized.
```
## Data transformations 1 - Z-scoring.
```python
def find_outliers(col):
"""Use scipy to calcualte absoliute Z-scores
and return boolean series where True indicates it is an outlier
Args:
col (Series): a series/column from your DataFrame
Returns:
idx_outliers (Series): series of True/False for each row in col
Ex:
>> idx_outs = find_outliers(df['bedrooms'])
>> df_clean = df.loc[idx_outs==False]"""
from scipy import stats
z = np.abs(stats.zscore(col))
idx_outliers = np.where(z>3,True,False)
return pd.Series(idx_outliers,index=col.index)
```
### Normalize data by filtering outliers with z-scores.
```python
df_outliers = pd.DataFrame()
cols_to_clean = ['bedrooms','bathrooms','sqft_living','sqft_lot','sqft_lot15']
for col in cols_to_clean:
df_outliers[col] = find_outliers(df_basic[col])
df_outliers.head()
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>sqft_lot15</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>False</td>
<td>False</td>
<td>False</td>
<td>False</td>
<td>False</td>
</tr>
<tr>
<td>1</td>
<td>False</td>
<td>False</td>
<td>False</td>
<td>False</td>
<td>False</td>
</tr>
<tr>
<td>2</td>
<td>False</td>
<td>False</td>
<td>False</td>
<td>False</td>
<td>False</td>
</tr>
<tr>
<td>3</td>
<td>False</td>
<td>False</td>
<td>False</td>
<td>False</td>
<td>False</td>
</tr>
<tr>
<td>4</td>
<td>False</td>
<td>False</td>
<td>False</td>
<td>False</td>
<td>False</td>
</tr>
</tbody>
</table>
</div>
```python
test_outs = df_outliers.any(axis=1)
```
```python
np.sum(test_outs)
```
838
```python
df_cleaned = df_basic.loc[test_outs==False]
df_cleaned.describe().round(3)
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>price</th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>floors</th>
<th>waterfront</th>
<th>condition</th>
<th>grade</th>
<th>yr_built</th>
<th>yr_renovated</th>
<th>zipcode</th>
<th>lat</th>
<th>long</th>
<th>sqft_lot15</th>
</tr>
</thead>
<tbody>
<tr>
<td>count</td>
<td>20582.000</td>
<td>20582.000</td>
<td>20582.000</td>
<td>20582.000</td>
<td>20582.000</td>
<td>20582.000</td>
<td>20582.000</td>
<td>20582.000</td>
<td>20582.000</td>
<td>20582.000</td>
<td>20582.000</td>
<td>20582.000</td>
<td>20582.000</td>
<td>20582.000</td>
<td>20582.000</td>
</tr>
<tr>
<td>mean</td>
<td>519332.688</td>
<td>3.342</td>
<td>2.076</td>
<td>2017.215</td>
<td>10290.621</td>
<td>1.488</td>
<td>0.006</td>
<td>3.415</td>
<td>7.609</td>
<td>1970.639</td>
<td>67.885</td>
<td>98078.944</td>
<td>47.561</td>
<td>-122.218</td>
<td>9456.817</td>
</tr>
<tr>
<td>std</td>
<td>307890.682</td>
<td>0.861</td>
<td>0.711</td>
<td>803.745</td>
<td>12044.713</td>
<td>0.540</td>
<td>0.076</td>
<td>0.651</td>
<td>1.106</td>
<td>29.431</td>
<td>361.807</td>
<td>53.688</td>
<td>0.138</td>
<td>0.138</td>
<td>9421.736</td>
</tr>
<tr>
<td>min</td>
<td>78000.000</td>
<td>1.000</td>
<td>0.500</td>
<td>370.000</td>
<td>520.000</td>
<td>1.000</td>
<td>0.000</td>
<td>1.000</td>
<td>3.000</td>
<td>1900.000</td>
<td>0.000</td>
<td>98001.000</td>
<td>47.156</td>
<td>-122.512</td>
<td>651.000</td>
</tr>
<tr>
<td>25%</td>
<td>319950.000</td>
<td>3.000</td>
<td>1.500</td>
<td>1410.000</td>
<td>5000.000</td>
<td>1.000</td>
<td>0.000</td>
<td>3.000</td>
<td>7.000</td>
<td>1951.000</td>
<td>0.000</td>
<td>98033.000</td>
<td>47.474</td>
<td>-122.331</td>
<td>5035.250</td>
</tr>
<tr>
<td>50%</td>
<td>445000.000</td>
<td>3.000</td>
<td>2.250</td>
<td>1890.000</td>
<td>7497.000</td>
<td>1.000</td>
<td>0.000</td>
<td>3.000</td>
<td>7.000</td>
<td>1974.000</td>
<td>0.000</td>
<td>98070.000</td>
<td>47.573</td>
<td>-122.237</td>
<td>7500.000</td>
</tr>
<tr>
<td>75%</td>
<td>630000.000</td>
<td>4.000</td>
<td>2.500</td>
<td>2500.000</td>
<td>10200.000</td>
<td>2.000</td>
<td>0.000</td>
<td>4.000</td>
<td>8.000</td>
<td>1996.000</td>
<td>0.000</td>
<td>98118.000</td>
<td>47.679</td>
<td>-122.132</td>
<td>9799.250</td>
</tr>
<tr>
<td>max</td>
<td>3640000.000</td>
<td>6.000</td>
<td>4.250</td>
<td>4830.000</td>
<td>137214.000</td>
<td>3.500</td>
<td>1.000</td>
<td>5.000</td>
<td>13.000</td>
<td>2015.000</td>
<td>2015.000</td>
<td>98199.000</td>
<td>47.778</td>
<td>-121.315</td>
<td>93825.000</td>
</tr>
</tbody>
</table>
</div>
```python
df_cleaned.head()
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>price</th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>floors</th>
<th>waterfront</th>
<th>condition</th>
<th>grade</th>
<th>yr_built</th>
<th>yr_renovated</th>
<th>zipcode</th>
<th>lat</th>
<th>long</th>
<th>sqft_lot15</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>221900.0</td>
<td>3</td>
<td>1.00</td>
<td>1180</td>
<td>5650</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1955</td>
<td>0.0</td>
<td>98178</td>
<td>47.5112</td>
<td>-122.257</td>
<td>5650</td>
</tr>
<tr>
<td>1</td>
<td>538000.0</td>
<td>3</td>
<td>2.25</td>
<td>2570</td>
<td>7242</td>
<td>2.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1951</td>
<td>1991.0</td>
<td>98125</td>
<td>47.7210</td>
<td>-122.319</td>
<td>7639</td>
</tr>
<tr>
<td>2</td>
<td>180000.0</td>
<td>2</td>
<td>1.00</td>
<td>770</td>
<td>10000</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>6</td>
<td>1933</td>
<td>0.0</td>
<td>98028</td>
<td>47.7379</td>
<td>-122.233</td>
<td>8062</td>
</tr>
<tr>
<td>3</td>
<td>604000.0</td>
<td>4</td>
<td>3.00</td>
<td>1960</td>
<td>5000</td>
<td>1.0</td>
<td>0.0</td>
<td>5</td>
<td>7</td>
<td>1965</td>
<td>0.0</td>
<td>98136</td>
<td>47.5208</td>
<td>-122.393</td>
<td>5000</td>
</tr>
<tr>
<td>4</td>
<td>510000.0</td>
<td>3</td>
<td>2.00</td>
<td>1680</td>
<td>8080</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>1987</td>
<td>0.0</td>
<td>98074</td>
<td>47.6168</td>
<td>-122.045</td>
<td>7503</td>
</tr>
</tbody>
</table>
</div>
### Showing bedrooms before and after filter.
```python
# 'bedrooms','bathrooms','sqft_living','sqft_lot','yr_built','sqft_lot15'
```
```python
plt.figure(figsize=(12, 5))
ax1 = plt.subplot(1, 2, 1)
df_basic.plot(x='bedrooms', y='price', ax=ax1, kind='scatter')
ax1.set_title("bedrooms before filter")
ax2 = plt.subplot(1, 2, 2)
df_cleaned.plot(x='bedrooms', y='price', ax=ax2, kind='scatter')
ax2.set_title('bedrooms after filter')
plt.subplots_adjust(wspace=0.4)
```
![png](output_91_0.png)
```python
# so it looks like my bedrooms are filtered from 1 to 6 bedrooms now
```
### Showing bathrooms before and after filter.
```python
plt.figure(figsize=(12, 5))
ax1 = plt.subplot(1, 2, 1)
df_basic.plot(x='bathrooms', y='price', ax=ax1, kind='scatter')
ax1.set_title("bathrooms before filter")
ax2 = plt.subplot(1, 2, 2)
df_cleaned.plot(x='bathrooms', y='price', ax=ax2, kind='scatter')
ax2.set_title('bathrooms after filter')
plt.subplots_adjust(wspace=0.4)
```
![png](output_94_0.png)
```python
# it looks like the z score filter put my bathroom range from .5 to 4.5. sweet.
```
### Showing sqft living area before and after filter.
```python
plt.figure(figsize=(12, 5))
ax1 = plt.subplot(1, 2, 1)
df_basic.plot(x='sqft_living', y='price', ax=ax1, kind='scatter')
ax1.set_title("square foot living area before filter")
ax2 = plt.subplot(1, 2, 2)
df_cleaned.plot(x='sqft_living', y='price', ax=ax2, kind='scatter')
ax2.set_title('square foot living area after filter')
plt.subplots_adjust(wspace=0.4)
```
![png](output_97_0.png)
```python
#it looks like the zscore filtered my sqft living from about 500 to 4800
```
### Showing sqft lot before and after filter.
```python
plt.figure(figsize=(12, 5))
ax1 = plt.subplot(1, 2, 1)
df_basic.plot(x='sqft_lot', y='price', ax=ax1, kind='scatter')
ax1.set_title("square foot lot area before filter")
ax2 = plt.subplot(1, 2, 2)
df_cleaned.plot(x='sqft_lot', y='price', ax=ax2, kind='scatter')
ax2.set_title('square foot lot area after filter')
plt.subplots_adjust(wspace=0.4)
```
![png](output_100_0.png)
```python
# it looks like the zscore filtered my sqft lot from 0 to 140000, way better than the outlier 1.6 million
```
### Showing sqft lot 15 before and after filter.
```python
plt.figure(figsize=(12, 5))
ax1 = plt.subplot(1, 2, 1)
df_basic.plot(x='sqft_lot15', y='price', ax=ax1, kind='scatter')
ax1.set_title("square foot lot area 15 before filter")
ax2 = plt.subplot(1, 2, 2)
df_cleaned.plot(x='sqft_lot15', y='price', ax=ax2, kind='scatter')
ax2.set_title('square foot lot area 15 after filter')
plt.subplots_adjust(wspace=0.4)
```
![png](output_103_0.png)
### Check model normality after zscore filter outliers.
```python
df_cleaned.hist(figsize=(9,9));
```
![png](output_105_0.png)
## Create model.
### Create model with data as is, not accounting for categorical data.
First we create a model with variables as is, filtered but not accounting for some data needing to be categorized. Following up with a model below that will show the difference in output based on creating categorical variables where necessary.
```python
# create model using list of predictors by typing them all out.
outcome = 'price'
x_cols = ['bedrooms', 'bathrooms', 'sqft_living', 'sqft_lot', 'floors',
'waterfront', 'condition', 'grade', 'yr_built', 'yr_renovated',
'zipcode', 'lat', 'long', 'sqft_lot15']
predictors = '+'.join(x_cols)
formula = outcome + '~' + predictors
model = ols(formula=formula, data=df_cleaned).fit()
model.summary()
```
<table class="simpletable">
<caption>OLS Regression Results</caption>
<tr>
<th>Dep. Variable:</th> <td>price</td> <th> R-squared: </th> <td> 0.676</td>
</tr>
<tr>
<th>Model:</th> <td>OLS</td> <th> Adj. R-squared: </th> <td> 0.676</td>
</tr>
<tr>
<th>Method:</th> <td>Least Squares</td> <th> F-statistic: </th> <td> 3062.</td>
</tr>
<tr>
<th>Date:</th> <td>Fri, 06 Dec 2019</td> <th> Prob (F-statistic):</th> <td> 0.00</td>
</tr>
<tr>
<th>Time:</th> <td>17:56:55</td> <th> Log-Likelihood: </th> <td>-2.7772e+05</td>
</tr>
<tr>
<th>No. Observations:</th> <td> 20582</td> <th> AIC: </th> <td>5.555e+05</td>
</tr>
<tr>
<th>Df Residuals:</th> <td> 20567</td> <th> BIC: </th> <td>5.556e+05</td>
</tr>
<tr>
<th>Df Model:</th> <td> 14</td> <th> </th> <td> </td>
</tr>
<tr>
<th>Covariance Type:</th> <td>nonrobust</td> <th> </th> <td> </td>
</tr>
</table>
<table class="simpletable">
<tr>
<td></td> <th>coef</th> <th>std err</th> <th>t</th> <th>P>|t|</th> <th>[0.025</th> <th>0.975]</th>
</tr>
<tr>
<th>Intercept</th> <td> 7.406e+06</td> <td> 2.53e+06</td> <td> 2.931</td> <td> 0.003</td> <td> 2.45e+06</td> <td> 1.24e+07</td>
</tr>
<tr>
<th>bedrooms</th> <td>-3.063e+04</td> <td> 1854.500</td> <td> -16.514</td> <td> 0.000</td> <td>-3.43e+04</td> <td> -2.7e+04</td>
</tr>
<tr>
<th>bathrooms</th> <td> 3.359e+04</td> <td> 2997.685</td> <td> 11.205</td> <td> 0.000</td> <td> 2.77e+04</td> <td> 3.95e+04</td>
</tr>
<tr>
<th>sqft_living</th> <td> 153.6617</td> <td> 3.041</td> <td> 50.524</td> <td> 0.000</td> <td> 147.700</td> <td> 159.623</td>
</tr>
<tr>
<th>sqft_lot</th> <td> 0.1952</td> <td> 0.177</td> <td> 1.101</td> <td> 0.271</td> <td> -0.152</td> <td> 0.543</td>
</tr>
<tr>
<th>floors</th> <td> 1.66e+04</td> <td> 2910.874</td> <td> 5.703</td> <td> 0.000</td> <td> 1.09e+04</td> <td> 2.23e+04</td>
</tr>
<tr>
<th>waterfront</th> <td> 6.804e+05</td> <td> 1.64e+04</td> <td> 41.612</td> <td> 0.000</td> <td> 6.48e+05</td> <td> 7.12e+05</td>
</tr>
<tr>
<th>condition</th> <td> 2.922e+04</td> <td> 2088.975</td> <td> 13.986</td> <td> 0.000</td> <td> 2.51e+04</td> <td> 3.33e+04</td>
</tr>
<tr>
<th>grade</th> <td> 1.139e+05</td> <td> 1843.140</td> <td> 61.807</td> <td> 0.000</td> <td> 1.1e+05</td> <td> 1.18e+05</td>
</tr>
<tr>
<th>yr_built</th> <td>-2680.7818</td> <td> 64.270</td> <td> -41.711</td> <td> 0.000</td> <td>-2806.756</td> <td>-2554.808</td>
</tr>
<tr>
<th>yr_renovated</th> <td> 28.4692</td> <td> 3.566</td> <td> 7.983</td> <td> 0.000</td> <td> 21.479</td> <td> 35.459</td>
</tr>
<tr>
<th>zipcode</th> <td> -469.1360</td> <td> 29.099</td> <td> -16.122</td> <td> 0.000</td> <td> -526.172</td> <td> -412.100</td>
</tr>
<tr>
<th>lat</th> <td> 5.757e+05</td> <td> 9520.914</td> <td> 60.468</td> <td> 0.000</td> <td> 5.57e+05</td> <td> 5.94e+05</td>
</tr>
<tr>
<th>long</th> <td> -1.29e+05</td> <td> 1.17e+04</td> <td> -11.010</td> <td> 0.000</td> <td>-1.52e+05</td> <td>-1.06e+05</td>
</tr>
<tr>
<th>sqft_lot15</th> <td> -1.2844</td> <td> 0.230</td> <td> -5.580</td> <td> 0.000</td> <td> -1.736</td> <td> -0.833</td>
</tr>
</table>
<table class="simpletable">
<tr>
<th>Omnibus:</th> <td>11149.879</td> <th> Durbin-Watson: </th> <td> 1.992</td>
</tr>
<tr>
<th>Prob(Omnibus):</th> <td> 0.000</td> <th> Jarque-Bera (JB): </th> <td>185029.575</td>
</tr>
<tr>
<th>Skew:</th> <td> 2.238</td> <th> Prob(JB): </th> <td> 0.00</td>
</tr>
<tr>
<th>Kurtosis:</th> <td>16.990</td> <th> Cond. No. </th> <td>2.05e+08</td>
</tr>
</table><br/><br/>Warnings:<br/>[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.<br/>[2] The condition number is large, 2.05e+08. This might indicate that there are<br/>strong multicollinearity or other numerical problems.
```python
# You'll notice that our R2 value is 0.676 which is eh.
# The P value for sqft_lot is at 0.271, well above the accepted 0.05 so that may have some issues with collinearity.
# We can check the heat map on that one again.
# Our skew is 2.2.
# Kurtosis is 16.99.
# Condition is 205,000,000
```
### Create model using numerical and categorical predictors.
In order to be sure our categorical variables are not being used in regression as values instead of labels, we will use stats to use a C() operator which will essentially one hot those specific variables
```python
# create model using list of predictors by typing them all out.
# removed sqft lot
outcome = 'price'
x_cols = ['bedrooms', 'bathrooms', 'sqft_living', 'floors',
'C(waterfront)', 'condition', 'grade', 'yr_built', 'yr_renovated',
'C(zipcode)', 'lat', 'long', 'sqft_lot15']
predictors = '+'.join(x_cols)
formula = outcome + '~' + predictors
model = smf.ols(formula=formula, data=df_cleaned).fit()
model.summary()
```
<table class="simpletable">
<caption>OLS Regression Results</caption>
<tr>
<th>Dep. Variable:</th> <td>price</td> <th> R-squared: </th> <td> 0.798</td>
</tr>
<tr>
<th>Model:</th> <td>OLS</td> <th> Adj. R-squared: </th> <td> 0.797</td>
</tr>
<tr>
<th>Method:</th> <td>Least Squares</td> <th> F-statistic: </th> <td> 998.5</td>
</tr>
<tr>
<th>Date:</th> <td>Fri, 06 Dec 2019</td> <th> Prob (F-statistic):</th> <td> 0.00</td>
</tr>
<tr>
<th>Time:</th> <td>17:56:56</td> <th> Log-Likelihood: </th> <td>-2.7286e+05</td>
</tr>
<tr>
<th>No. Observations:</th> <td> 20582</td> <th> AIC: </th> <td>5.459e+05</td>
</tr>
<tr>
<th>Df Residuals:</th> <td> 20500</td> <th> BIC: </th> <td>5.465e+05</td>
</tr>
<tr>
<th>Df Model:</th> <td> 81</td> <th> </th> <td> </td>
</tr>
<tr>
<th>Covariance Type:</th> <td>nonrobust</td> <th> </th> <td> </td>
</tr>
</table>
<table class="simpletable">
<tr>
<td></td> <th>coef</th> <th>std err</th> <th>t</th> <th>P>|t|</th> <th>[0.025</th> <th>0.975]</th>
</tr>
<tr>
<th>Intercept</th> <td> -1.94e+07</td> <td> 5.68e+06</td> <td> -3.414</td> <td> 0.001</td> <td>-3.05e+07</td> <td>-8.26e+06</td>
</tr>
<tr>
<th>C(waterfront)[T.1.0]</th> <td> 7.24e+05</td> <td> 1.32e+04</td> <td> 54.863</td> <td> 0.000</td> <td> 6.98e+05</td> <td> 7.5e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98002]</th> <td> 3.082e+04</td> <td> 1.27e+04</td> <td> 2.433</td> <td> 0.015</td> <td> 5989.164</td> <td> 5.57e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98003]</th> <td>-1.959e+04</td> <td> 1.13e+04</td> <td> -1.734</td> <td> 0.083</td> <td>-4.17e+04</td> <td> 2560.321</td>
</tr>
<tr>
<th>C(zipcode)[T.98004]</th> <td> 6.869e+05</td> <td> 2.13e+04</td> <td> 32.296</td> <td> 0.000</td> <td> 6.45e+05</td> <td> 7.29e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98005]</th> <td> 2.829e+05</td> <td> 2.26e+04</td> <td> 12.539</td> <td> 0.000</td> <td> 2.39e+05</td> <td> 3.27e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98006]</th> <td> 2.556e+05</td> <td> 1.86e+04</td> <td> 13.774</td> <td> 0.000</td> <td> 2.19e+05</td> <td> 2.92e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98007]</th> <td> 2.142e+05</td> <td> 2.33e+04</td> <td> 9.173</td> <td> 0.000</td> <td> 1.68e+05</td> <td> 2.6e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98008]</th> <td> 2.34e+05</td> <td> 2.22e+04</td> <td> 10.542</td> <td> 0.000</td> <td> 1.9e+05</td> <td> 2.78e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98010]</th> <td> 1.126e+05</td> <td> 2.04e+04</td> <td> 5.526</td> <td> 0.000</td> <td> 7.26e+04</td> <td> 1.52e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98011]</th> <td> 8.329e+04</td> <td> 2.9e+04</td> <td> 2.874</td> <td> 0.004</td> <td> 2.65e+04</td> <td> 1.4e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98014]</th> <td> 1.284e+05</td> <td> 3.35e+04</td> <td> 3.834</td> <td> 0.000</td> <td> 6.28e+04</td> <td> 1.94e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98019]</th> <td> 8.651e+04</td> <td> 3.16e+04</td> <td> 2.733</td> <td> 0.006</td> <td> 2.45e+04</td> <td> 1.49e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98022]</th> <td> 5.917e+04</td> <td> 1.79e+04</td> <td> 3.305</td> <td> 0.001</td> <td> 2.41e+04</td> <td> 9.43e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98023]</th> <td>-5.078e+04</td> <td> 1.04e+04</td> <td> -4.862</td> <td> 0.000</td> <td>-7.12e+04</td> <td>-3.03e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98024]</th> <td> 1.651e+05</td> <td> 3.07e+04</td> <td> 5.383</td> <td> 0.000</td> <td> 1.05e+05</td> <td> 2.25e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98027]</th> <td> 1.699e+05</td> <td> 1.91e+04</td> <td> 8.899</td> <td> 0.000</td> <td> 1.32e+05</td> <td> 2.07e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98028]</th> <td> 7.449e+04</td> <td> 2.82e+04</td> <td> 2.643</td> <td> 0.008</td> <td> 1.92e+04</td> <td> 1.3e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98029]</th> <td> 2.107e+05</td> <td> 2.18e+04</td> <td> 9.675</td> <td> 0.000</td> <td> 1.68e+05</td> <td> 2.53e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98030]</th> <td> 6512.4171</td> <td> 1.25e+04</td> <td> 0.519</td> <td> 0.603</td> <td>-1.81e+04</td> <td> 3.11e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98031]</th> <td> 1.07e+04</td> <td> 1.31e+04</td> <td> 0.818</td> <td> 0.413</td> <td>-1.49e+04</td> <td> 3.63e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98032]</th> <td>-1.583e+04</td> <td> 1.5e+04</td> <td> -1.052</td> <td> 0.293</td> <td>-4.53e+04</td> <td> 1.37e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98033]</th> <td> 3.318e+05</td> <td> 2.42e+04</td> <td> 13.726</td> <td> 0.000</td> <td> 2.84e+05</td> <td> 3.79e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98034]</th> <td> 1.64e+05</td> <td> 2.6e+04</td> <td> 6.319</td> <td> 0.000</td> <td> 1.13e+05</td> <td> 2.15e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98038]</th> <td> 6.028e+04</td> <td> 1.43e+04</td> <td> 4.207</td> <td> 0.000</td> <td> 3.22e+04</td> <td> 8.84e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98039]</th> <td> 1.039e+06</td> <td> 3.07e+04</td> <td> 33.886</td> <td> 0.000</td> <td> 9.79e+05</td> <td> 1.1e+06</td>
</tr>
<tr>
<th>C(zipcode)[T.98040]</th> <td> 4.74e+05</td> <td> 1.87e+04</td> <td> 25.302</td> <td> 0.000</td> <td> 4.37e+05</td> <td> 5.11e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98042]</th> <td> 2.016e+04</td> <td> 1.21e+04</td> <td> 1.664</td> <td> 0.096</td> <td>-3585.111</td> <td> 4.39e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98045]</th> <td> 1.578e+05</td> <td> 2.7e+04</td> <td> 5.836</td> <td> 0.000</td> <td> 1.05e+05</td> <td> 2.11e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98052]</th> <td> 2.066e+05</td> <td> 2.47e+04</td> <td> 8.366</td> <td> 0.000</td> <td> 1.58e+05</td> <td> 2.55e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98053]</th> <td> 2.087e+05</td> <td> 2.67e+04</td> <td> 7.818</td> <td> 0.000</td> <td> 1.56e+05</td> <td> 2.61e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98055]</th> <td> 3.46e+04</td> <td> 1.47e+04</td> <td> 2.356</td> <td> 0.018</td> <td> 5813.545</td> <td> 6.34e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98056]</th> <td> 9.312e+04</td> <td> 1.6e+04</td> <td> 5.806</td> <td> 0.000</td> <td> 6.17e+04</td> <td> 1.25e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98058]</th> <td> 2.23e+04</td> <td> 1.39e+04</td> <td> 1.601</td> <td> 0.109</td> <td>-4998.813</td> <td> 4.96e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98059]</th> <td> 9.31e+04</td> <td> 1.57e+04</td> <td> 5.912</td> <td> 0.000</td> <td> 6.22e+04</td> <td> 1.24e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98065]</th> <td> 1.5e+05</td> <td> 2.47e+04</td> <td> 6.070</td> <td> 0.000</td> <td> 1.02e+05</td> <td> 1.98e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98070]</th> <td>-3.527e+04</td> <td> 2.06e+04</td> <td> -1.711</td> <td> 0.087</td> <td>-7.57e+04</td> <td> 5124.702</td>
</tr>
<tr>
<th>C(zipcode)[T.98072]</th> <td> 1.199e+05</td> <td> 2.9e+04</td> <td> 4.139</td> <td> 0.000</td> <td> 6.31e+04</td> <td> 1.77e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98074]</th> <td> 1.717e+05</td> <td> 2.34e+04</td> <td> 7.344</td> <td> 0.000</td> <td> 1.26e+05</td> <td> 2.18e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98075]</th> <td> 2.002e+05</td> <td> 2.24e+04</td> <td> 8.933</td> <td> 0.000</td> <td> 1.56e+05</td> <td> 2.44e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98077]</th> <td> 1.037e+05</td> <td> 3.03e+04</td> <td> 3.420</td> <td> 0.001</td> <td> 4.42e+04</td> <td> 1.63e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98092]</th> <td>-2.187e+04</td> <td> 1.15e+04</td> <td> -1.897</td> <td> 0.058</td> <td>-4.45e+04</td> <td> 723.783</td>
</tr>
<tr>
<th>C(zipcode)[T.98102]</th> <td> 3.837e+05</td> <td> 2.47e+04</td> <td> 15.526</td> <td> 0.000</td> <td> 3.35e+05</td> <td> 4.32e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98103]</th> <td> 2.551e+05</td> <td> 2.33e+04</td> <td> 10.939</td> <td> 0.000</td> <td> 2.09e+05</td> <td> 3.01e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98105]</th> <td> 3.95e+05</td> <td> 2.39e+04</td> <td> 16.517</td> <td> 0.000</td> <td> 3.48e+05</td> <td> 4.42e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98106]</th> <td> 8.766e+04</td> <td> 1.71e+04</td> <td> 5.117</td> <td> 0.000</td> <td> 5.41e+04</td> <td> 1.21e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98107]</th> <td> 2.553e+05</td> <td> 2.4e+04</td> <td> 10.640</td> <td> 0.000</td> <td> 2.08e+05</td> <td> 3.02e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98108]</th> <td> 7.371e+04</td> <td> 1.88e+04</td> <td> 3.921</td> <td> 0.000</td> <td> 3.69e+04</td> <td> 1.11e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98109]</th> <td> 4.215e+05</td> <td> 2.45e+04</td> <td> 17.200</td> <td> 0.000</td> <td> 3.74e+05</td> <td> 4.7e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98112]</th> <td> 5.19e+05</td> <td> 2.19e+04</td> <td> 23.656</td> <td> 0.000</td> <td> 4.76e+05</td> <td> 5.62e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98115]</th> <td> 2.626e+05</td> <td> 2.37e+04</td> <td> 11.063</td> <td> 0.000</td> <td> 2.16e+05</td> <td> 3.09e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98116]</th> <td> 2.408e+05</td> <td> 1.92e+04</td> <td> 12.574</td> <td> 0.000</td> <td> 2.03e+05</td> <td> 2.78e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98117]</th> <td> 2.358e+05</td> <td> 2.4e+04</td> <td> 9.804</td> <td> 0.000</td> <td> 1.89e+05</td> <td> 2.83e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98118]</th> <td> 1.343e+05</td> <td> 1.67e+04</td> <td> 8.028</td> <td> 0.000</td> <td> 1.02e+05</td> <td> 1.67e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98119]</th> <td> 3.975e+05</td> <td> 2.33e+04</td> <td> 17.079</td> <td> 0.000</td> <td> 3.52e+05</td> <td> 4.43e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98122]</th> <td> 2.716e+05</td> <td> 2.07e+04</td> <td> 13.097</td> <td> 0.000</td> <td> 2.31e+05</td> <td> 3.12e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98125]</th> <td> 1.432e+05</td> <td> 2.57e+04</td> <td> 5.576</td> <td> 0.000</td> <td> 9.29e+04</td> <td> 1.94e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98126]</th> <td> 1.466e+05</td> <td> 1.75e+04</td> <td> 8.354</td> <td> 0.000</td> <td> 1.12e+05</td> <td> 1.81e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98133]</th> <td> 8.865e+04</td> <td> 2.65e+04</td> <td> 3.340</td> <td> 0.001</td> <td> 3.66e+04</td> <td> 1.41e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98136]</th> <td> 2.021e+05</td> <td> 1.79e+04</td> <td> 11.262</td> <td> 0.000</td> <td> 1.67e+05</td> <td> 2.37e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98144]</th> <td> 2.201e+05</td> <td> 1.93e+04</td> <td> 11.415</td> <td> 0.000</td> <td> 1.82e+05</td> <td> 2.58e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98146]</th> <td> 8.646e+04</td> <td> 1.6e+04</td> <td> 5.393</td> <td> 0.000</td> <td> 5.5e+04</td> <td> 1.18e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98148]</th> <td> 3.49e+04</td> <td> 2.14e+04</td> <td> 1.632</td> <td> 0.103</td> <td>-7005.690</td> <td> 7.68e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98155]</th> <td> 8.542e+04</td> <td> 2.76e+04</td> <td> 3.091</td> <td> 0.002</td> <td> 3.12e+04</td> <td> 1.4e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98166]</th> <td> 5.278e+04</td> <td> 1.46e+04</td> <td> 3.614</td> <td> 0.000</td> <td> 2.42e+04</td> <td> 8.14e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98168]</th> <td> 3.846e+04</td> <td> 1.55e+04</td> <td> 2.488</td> <td> 0.013</td> <td> 8158.190</td> <td> 6.88e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98177]</th> <td> 1.625e+05</td> <td> 2.77e+04</td> <td> 5.869</td> <td> 0.000</td> <td> 1.08e+05</td> <td> 2.17e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98178]</th> <td> 2.663e+04</td> <td> 1.59e+04</td> <td> 1.670</td> <td> 0.095</td> <td>-4626.592</td> <td> 5.79e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98188]</th> <td> 1.642e+04</td> <td> 1.62e+04</td> <td> 1.012</td> <td> 0.312</td> <td>-1.54e+04</td> <td> 4.82e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98198]</th> <td> 2536.1823</td> <td> 1.22e+04</td> <td> 0.207</td> <td> 0.836</td> <td>-2.14e+04</td> <td> 2.65e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98199]</th> <td> 3.213e+05</td> <td> 2.28e+04</td> <td> 14.115</td> <td> 0.000</td> <td> 2.77e+05</td> <td> 3.66e+05</td>
</tr>
<tr>
<th>bedrooms</th> <td>-2.092e+04</td> <td> 1490.173</td> <td> -14.038</td> <td> 0.000</td> <td>-2.38e+04</td> <td> -1.8e+04</td>
</tr>
<tr>
<th>bathrooms</th> <td> 1.627e+04</td> <td> 2403.522</td> <td> 6.768</td> <td> 0.000</td> <td> 1.16e+04</td> <td> 2.1e+04</td>
</tr>
<tr>
<th>sqft_living</th> <td> 158.5773</td> <td> 2.456</td> <td> 64.556</td> <td> 0.000</td> <td> 153.763</td> <td> 163.392</td>
</tr>
<tr>
<th>floors</th> <td>-8253.4262</td> <td> 2465.115</td> <td> -3.348</td> <td> 0.001</td> <td>-1.31e+04</td> <td>-3421.605</td>
</tr>
<tr>
<th>condition</th> <td> 2.38e+04</td> <td> 1690.950</td> <td> 14.075</td> <td> 0.000</td> <td> 2.05e+04</td> <td> 2.71e+04</td>
</tr>
<tr>
<th>grade</th> <td> 7.723e+04</td> <td> 1551.250</td> <td> 49.789</td> <td> 0.000</td> <td> 7.42e+04</td> <td> 8.03e+04</td>
</tr>
<tr>
<th>yr_built</th> <td>-1004.8356</td> <td> 56.648</td> <td> -17.738</td> <td> 0.000</td> <td>-1115.871</td> <td> -893.800</td>
</tr>
<tr>
<th>yr_renovated</th> <td> 22.0582</td> <td> 2.840</td> <td> 7.768</td> <td> 0.000</td> <td> 16.492</td> <td> 27.624</td>
</tr>
<tr>
<th>lat</th> <td> 1.033e+05</td> <td> 5.8e+04</td> <td> 1.783</td> <td> 0.075</td> <td>-1.03e+04</td> <td> 2.17e+05</td>
</tr>
<tr>
<th>long</th> <td>-1.299e+05</td> <td> 4.21e+04</td> <td> -3.087</td> <td> 0.002</td> <td>-2.12e+05</td> <td>-4.74e+04</td>
</tr>
<tr>
<th>sqft_lot15</th> <td> 0.5823</td> <td> 0.127</td> <td> 4.570</td> <td> 0.000</td> <td> 0.333</td> <td> 0.832</td>
</tr>
</table>
<table class="simpletable">
<tr>
<th>Omnibus:</th> <td>12915.892</td> <th> Durbin-Watson: </th> <td> 1.983</td>
</tr>
<tr>
<th>Prob(Omnibus):</th> <td> 0.000</td> <th> Jarque-Bera (JB): </th> <td>410916.210</td>
</tr>
<tr>
<th>Skew:</th> <td> 2.513</td> <th> Prob(JB): </th> <td> 0.00</td>
</tr>
<tr>
<th>Kurtosis:</th> <td>24.305</td> <th> Cond. No. </th> <td>7.95e+07</td>
</tr>
</table><br/><br/>Warnings:<br/>[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.<br/>[2] The condition number is large, 7.95e+07. This might indicate that there are<br/>strong multicollinearity or other numerical problems.
```python
# In this model there is an R2 value of 0.798. Much better fit.
# The P values in 'zipcode' 98003, 98030-98032, 98042, 98058, 98070, 98092,
# 98178, 98188, 98198 all are well over 0.05.
# This could be because of lack of data from housing in those zipcodes.
# Our skew is up to 2.5, from 2.2 in the last model. Interesting.
# Kurtosis is up to 24.3 from 16.99 in the last model.
# The condition number is down to 79,500,000 from 205,000,000 in the last model.
```
From the results of both models, there was a clear improvement overall in ability to predict housing prices. My next thoughts would be to drop some of the columns causing multicollinearity in addition to scaling some of the data units to match up better.
## Data transformations 2 - feature scaling.
### Normalize with min max feature scaling to manage the difference in magnitude.
We are going to look at features that have units of measure that are very different from most of the other variables and look at scaling them to match better for a better fit model. One of the ways we can do this is by using min max scaling to adjust the magnitude of the units down to range 0-1.
```python
# Take a look at the histogram to show the difference in magnitude of our numerical features.
df_cleaned.hist(figsize=(12,12));
```
![png](output_119_0.png)
```python
# The features we'll want to scale will be:
# bathroom, bedrooms, condition, floors, grade, lat, long, sqft living, sqft lot, sqft lot 15
```
```python
df_cleaned.head()
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>price</th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>floors</th>
<th>waterfront</th>
<th>condition</th>
<th>grade</th>
<th>yr_built</th>
<th>yr_renovated</th>
<th>zipcode</th>
<th>lat</th>
<th>long</th>
<th>sqft_lot15</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>221900.0</td>
<td>3</td>
<td>1.00</td>
<td>1180</td>
<td>5650</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1955</td>
<td>0.0</td>
<td>98178</td>
<td>47.5112</td>
<td>-122.257</td>
<td>5650</td>
</tr>
<tr>
<td>1</td>
<td>538000.0</td>
<td>3</td>
<td>2.25</td>
<td>2570</td>
<td>7242</td>
<td>2.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1951</td>
<td>1991.0</td>
<td>98125</td>
<td>47.7210</td>
<td>-122.319</td>
<td>7639</td>
</tr>
<tr>
<td>2</td>
<td>180000.0</td>
<td>2</td>
<td>1.00</td>
<td>770</td>
<td>10000</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>6</td>
<td>1933</td>
<td>0.0</td>
<td>98028</td>
<td>47.7379</td>
<td>-122.233</td>
<td>8062</td>
</tr>
<tr>
<td>3</td>
<td>604000.0</td>
<td>4</td>
<td>3.00</td>
<td>1960</td>
<td>5000</td>
<td>1.0</td>
<td>0.0</td>
<td>5</td>
<td>7</td>
<td>1965</td>
<td>0.0</td>
<td>98136</td>
<td>47.5208</td>
<td>-122.393</td>
<td>5000</td>
</tr>
<tr>
<td>4</td>
<td>510000.0</td>
<td>3</td>
<td>2.00</td>
<td>1680</td>
<td>8080</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>1987</td>
<td>0.0</td>
<td>98074</td>
<td>47.6168</td>
<td>-122.045</td>
<td>7503</td>
</tr>
</tbody>
</table>
</div>
```python
df_cleaned.shape
```
(20582, 15)
```python
df_scaled = df_cleaned.copy()
df_scaled.shape
```
(20582, 15)
```python
# bathroom, bedrooms, condition, floors, grade, lat, long, sqft living, sqft lot, sqft lot 15
```
```python
# this loops through the cols needing to be scaled
# applies equation for min max scaling and adds new col to dataframe
scale = ['bedrooms','bathrooms','condition','floors','grade','sqft_living', 'sqft_lot', 'lat', 'long', 'sqft_lot15']
for col in scale:
x = df_scaled[col]
scaled_x = (x - min(x)) / (max(x) - min(x))
df_scaled['scaled_' + col] = scaled_x
df_scaled.head()
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>price</th>
<th>bedrooms</th>
<th>bathrooms</th>
<th>sqft_living</th>
<th>sqft_lot</th>
<th>floors</th>
<th>waterfront</th>
<th>condition</th>
<th>grade</th>
<th>yr_built</th>
<th>yr_renovated</th>
<th>zipcode</th>
<th>lat</th>
<th>long</th>
<th>sqft_lot15</th>
<th>scaled_sqft_living</th>
<th>scaled_sqft_lot</th>
<th>scaled_lat</th>
<th>scaled_long</th>
<th>scaled_sqft_lot15</th>
<th>scaled_bedrooms</th>
<th>scaled_bathrooms</th>
<th>scaled_condition</th>
<th>scaled_floors</th>
<th>scaled_grade</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>221900.0</td>
<td>3</td>
<td>1.00</td>
<td>1180</td>
<td>5650</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1955</td>
<td>0.0</td>
<td>98178</td>
<td>47.5112</td>
<td>-122.257</td>
<td>5650</td>
<td>0.181614</td>
<td>0.037529</td>
<td>0.571498</td>
<td>0.213033</td>
<td>0.053652</td>
<td>0.4</td>
<td>0.133333</td>
<td>0.5</td>
<td>0.0</td>
<td>0.4</td>
</tr>
<tr>
<td>1</td>
<td>538000.0</td>
<td>3</td>
<td>2.25</td>
<td>2570</td>
<td>7242</td>
<td>2.0</td>
<td>0.0</td>
<td>3</td>
<td>7</td>
<td>1951</td>
<td>1991.0</td>
<td>98125</td>
<td>47.7210</td>
<td>-122.319</td>
<td>7639</td>
<td>0.493274</td>
<td>0.049176</td>
<td>0.908959</td>
<td>0.161236</td>
<td>0.074999</td>
<td>0.4</td>
<td>0.466667</td>
<td>0.5</td>
<td>0.4</td>
<td>0.4</td>
</tr>
<tr>
<td>2</td>
<td>180000.0</td>
<td>2</td>
<td>1.00</td>
<td>770</td>
<td>10000</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>6</td>
<td>1933</td>
<td>0.0</td>
<td>98028</td>
<td>47.7379</td>
<td>-122.233</td>
<td>8062</td>
<td>0.089686</td>
<td>0.069352</td>
<td>0.936143</td>
<td>0.233083</td>
<td>0.079539</td>
<td>0.2</td>
<td>0.133333</td>
<td>0.5</td>
<td>0.0</td>
<td>0.3</td>
</tr>
<tr>
<td>3</td>
<td>604000.0</td>
<td>4</td>
<td>3.00</td>
<td>1960</td>
<td>5000</td>
<td>1.0</td>
<td>0.0</td>
<td>5</td>
<td>7</td>
<td>1965</td>
<td>0.0</td>
<td>98136</td>
<td>47.5208</td>
<td>-122.393</td>
<td>5000</td>
<td>0.356502</td>
<td>0.032774</td>
<td>0.586939</td>
<td>0.099415</td>
<td>0.046676</td>
<td>0.6</td>
<td>0.666667</td>
<td>1.0</td>
<td>0.0</td>
<td>0.4</td>
</tr>
<tr>
<td>4</td>
<td>510000.0</td>
<td>3</td>
<td>2.00</td>
<td>1680</td>
<td>8080</td>
<td>1.0</td>
<td>0.0</td>
<td>3</td>
<td>8</td>
<td>1987</td>
<td>0.0</td>
<td>98074</td>
<td>47.6168</td>
<td>-122.045</td>
<td>7503</td>
<td>0.293722</td>
<td>0.055306</td>
<td>0.741354</td>
<td>0.390142</td>
<td>0.073540</td>
<td>0.4</td>
<td>0.400000</td>
<td>0.5</td>
<td>0.0</td>
<td>0.5</td>
</tr>
</tbody>
</table>
</div>
The scale columns are added to the existing dataframe and can then be applied into the model the same as the previous columns, just in place of the originals to show the difference in model performance.
### Check hist to show new scaled data.
```python
df_scaled.hist(figsize=(12,12));
```
![png](output_128_0.png)
# MODEL
## Create model.
Next we create an updated model that has the scaled numerical features with similar magnitudes to rest of the data in place of previous ones. The features we scaled were 'bedrooms','bathrooms','condition','floors','grade','sqft_living', 'sqft_lot', 'lat', 'long', 'sqft_lot15'.
```python
df_scaled.columns
```
Index(['price', 'bedrooms', 'bathrooms', 'sqft_living', 'sqft_lot', 'floors',
'waterfront', 'condition', 'grade', 'yr_built', 'yr_renovated',
'zipcode', 'lat', 'long', 'sqft_lot15', 'scaled_sqft_living',
'scaled_sqft_lot', 'scaled_lat', 'scaled_long', 'scaled_sqft_lot15',
'scaled_bedrooms', 'scaled_bathrooms', 'scaled_condition',
'scaled_floors', 'scaled_grade'],
dtype='object')
```python
# create model using list of predictors by typing them all out.
outcome = 'price'
x_cols = ['scaled_bedrooms', 'scaled_bathrooms', 'scaled_sqft_living','scaled_sqft_lot', 'scaled_floors',
'C(waterfront)', 'scaled_condition', 'scaled_grade', 'yr_built', 'yr_renovated',
'C(zipcode)', 'scaled_lat', 'scaled_long', 'scaled_sqft_lot15']
predictors = '+'.join(x_cols)
formula = outcome + '~' + predictors
model = smf.ols(formula=formula, data=df_scaled).fit()
model.summary()
```
<table class="simpletable">
<caption>OLS Regression Results</caption>
<tr>
<th>Dep. Variable:</th> <td>price</td> <th> R-squared: </th> <td> 0.798</td>
</tr>
<tr>
<th>Model:</th> <td>OLS</td> <th> Adj. R-squared: </th> <td> 0.798</td>
</tr>
<tr>
<th>Method:</th> <td>Least Squares</td> <th> F-statistic: </th> <td> 990.4</td>
</tr>
<tr>
<th>Date:</th> <td>Fri, 06 Dec 2019</td> <th> Prob (F-statistic):</th> <td> 0.00</td>
</tr>
<tr>
<th>Time:</th> <td>18:19:16</td> <th> Log-Likelihood: </th> <td>-2.7283e+05</td>
</tr>
<tr>
<th>No. Observations:</th> <td> 20582</td> <th> AIC: </th> <td>5.458e+05</td>
</tr>
<tr>
<th>Df Residuals:</th> <td> 20499</td> <th> BIC: </th> <td>5.465e+05</td>
</tr>
<tr>
<th>Df Model:</th> <td> 82</td> <th> </th> <td> </td>
</tr>
<tr>
<th>Covariance Type:</th> <td>nonrobust</td> <th> </th> <td> </td>
</tr>
</table>
<table class="simpletable">
<tr>
<td></td> <th>coef</th> <th>std err</th> <th>t</th> <th>P>|t|</th> <th>[0.025</th> <th>0.975]</th>
</tr>
<tr>
<th>Intercept</th> <td> 1.622e+06</td> <td> 1.12e+05</td> <td> 14.436</td> <td> 0.000</td> <td> 1.4e+06</td> <td> 1.84e+06</td>
</tr>
<tr>
<th>C(waterfront)[T.1.0]</th> <td> 7.258e+05</td> <td> 1.32e+04</td> <td> 55.088</td> <td> 0.000</td> <td> 7e+05</td> <td> 7.52e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98002]</th> <td> 3.343e+04</td> <td> 1.27e+04</td> <td> 2.642</td> <td> 0.008</td> <td> 8633.900</td> <td> 5.82e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98003]</th> <td>-1.746e+04</td> <td> 1.13e+04</td> <td> -1.547</td> <td> 0.122</td> <td>-3.96e+04</td> <td> 4658.281</td>
</tr>
<tr>
<th>C(zipcode)[T.98004]</th> <td> 6.9e+05</td> <td> 2.12e+04</td> <td> 32.490</td> <td> 0.000</td> <td> 6.48e+05</td> <td> 7.32e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98005]</th> <td> 2.831e+05</td> <td> 2.25e+04</td> <td> 12.570</td> <td> 0.000</td> <td> 2.39e+05</td> <td> 3.27e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98006]</th> <td> 2.572e+05</td> <td> 1.85e+04</td> <td> 13.883</td> <td> 0.000</td> <td> 2.21e+05</td> <td> 2.94e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98007]</th> <td> 2.158e+05</td> <td> 2.33e+04</td> <td> 9.257</td> <td> 0.000</td> <td> 1.7e+05</td> <td> 2.61e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98008]</th> <td> 2.356e+05</td> <td> 2.22e+04</td> <td> 10.633</td> <td> 0.000</td> <td> 1.92e+05</td> <td> 2.79e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98010]</th> <td> 1.148e+05</td> <td> 2.03e+04</td> <td> 5.644</td> <td> 0.000</td> <td> 7.49e+04</td> <td> 1.55e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98011]</th> <td> 8.425e+04</td> <td> 2.89e+04</td> <td> 2.911</td> <td> 0.004</td> <td> 2.75e+04</td> <td> 1.41e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98014]</th> <td> 1.274e+05</td> <td> 3.34e+04</td> <td> 3.811</td> <td> 0.000</td> <td> 6.19e+04</td> <td> 1.93e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98019]</th> <td> 8.694e+04</td> <td> 3.16e+04</td> <td> 2.752</td> <td> 0.006</td> <td> 2.5e+04</td> <td> 1.49e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98022]</th> <td> 5.959e+04</td> <td> 1.79e+04</td> <td> 3.334</td> <td> 0.001</td> <td> 2.46e+04</td> <td> 9.46e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98023]</th> <td>-4.849e+04</td> <td> 1.04e+04</td> <td> -4.649</td> <td> 0.000</td> <td>-6.89e+04</td> <td> -2.8e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98024]</th> <td> 1.63e+05</td> <td> 3.06e+04</td> <td> 5.322</td> <td> 0.000</td> <td> 1.03e+05</td> <td> 2.23e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98027]</th> <td> 1.714e+05</td> <td> 1.91e+04</td> <td> 8.994</td> <td> 0.000</td> <td> 1.34e+05</td> <td> 2.09e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98028]</th> <td> 7.428e+04</td> <td> 2.81e+04</td> <td> 2.640</td> <td> 0.008</td> <td> 1.91e+04</td> <td> 1.29e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98029]</th> <td> 2.122e+05</td> <td> 2.17e+04</td> <td> 9.758</td> <td> 0.000</td> <td> 1.7e+05</td> <td> 2.55e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98030]</th> <td> 7902.1660</td> <td> 1.25e+04</td> <td> 0.631</td> <td> 0.528</td> <td>-1.66e+04</td> <td> 3.24e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98031]</th> <td> 1.047e+04</td> <td> 1.3e+04</td> <td> 0.802</td> <td> 0.422</td> <td>-1.51e+04</td> <td> 3.6e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98032]</th> <td> -1.41e+04</td> <td> 1.5e+04</td> <td> -0.938</td> <td> 0.348</td> <td>-4.36e+04</td> <td> 1.54e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98033]</th> <td> 3.335e+05</td> <td> 2.41e+04</td> <td> 13.818</td> <td> 0.000</td> <td> 2.86e+05</td> <td> 3.81e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98034]</th> <td> 1.65e+05</td> <td> 2.59e+04</td> <td> 6.367</td> <td> 0.000</td> <td> 1.14e+05</td> <td> 2.16e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98038]</th> <td> 6.219e+04</td> <td> 1.43e+04</td> <td> 4.347</td> <td> 0.000</td> <td> 3.41e+04</td> <td> 9.02e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98039]</th> <td> 1.043e+06</td> <td> 3.06e+04</td> <td> 34.079</td> <td> 0.000</td> <td> 9.83e+05</td> <td> 1.1e+06</td>
</tr>
<tr>
<th>C(zipcode)[T.98040]</th> <td> 4.765e+05</td> <td> 1.87e+04</td> <td> 25.475</td> <td> 0.000</td> <td> 4.4e+05</td> <td> 5.13e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98042]</th> <td> 2.074e+04</td> <td> 1.21e+04</td> <td> 1.715</td> <td> 0.086</td> <td>-2965.436</td> <td> 4.44e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98045]</th> <td> 1.582e+05</td> <td> 2.7e+04</td> <td> 5.861</td> <td> 0.000</td> <td> 1.05e+05</td> <td> 2.11e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98052]</th> <td> 2.075e+05</td> <td> 2.47e+04</td> <td> 8.416</td> <td> 0.000</td> <td> 1.59e+05</td> <td> 2.56e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98053]</th> <td> 2.086e+05</td> <td> 2.66e+04</td> <td> 7.828</td> <td> 0.000</td> <td> 1.56e+05</td> <td> 2.61e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98055]</th> <td> 3.5e+04</td> <td> 1.47e+04</td> <td> 2.387</td> <td> 0.017</td> <td> 6260.707</td> <td> 6.37e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98056]</th> <td> 9.437e+04</td> <td> 1.6e+04</td> <td> 5.894</td> <td> 0.000</td> <td> 6.3e+04</td> <td> 1.26e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98058]</th> <td> 2.352e+04</td> <td> 1.39e+04</td> <td> 1.691</td> <td> 0.091</td> <td>-3742.898</td> <td> 5.08e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98059]</th> <td> 9.438e+04</td> <td> 1.57e+04</td> <td> 6.003</td> <td> 0.000</td> <td> 6.36e+04</td> <td> 1.25e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98065]</th> <td> 1.512e+05</td> <td> 2.47e+04</td> <td> 6.128</td> <td> 0.000</td> <td> 1.03e+05</td> <td> 2e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98070]</th> <td>-3.618e+04</td> <td> 2.06e+04</td> <td> -1.758</td> <td> 0.079</td> <td>-7.65e+04</td> <td> 4153.309</td>
</tr>
<tr>
<th>C(zipcode)[T.98072]</th> <td> 1.164e+05</td> <td> 2.89e+04</td> <td> 4.024</td> <td> 0.000</td> <td> 5.97e+04</td> <td> 1.73e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98074]</th> <td> 1.735e+05</td> <td> 2.33e+04</td> <td> 7.434</td> <td> 0.000</td> <td> 1.28e+05</td> <td> 2.19e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98075]</th> <td> 2.007e+05</td> <td> 2.24e+04</td> <td> 8.971</td> <td> 0.000</td> <td> 1.57e+05</td> <td> 2.45e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98077]</th> <td> 1.021e+05</td> <td> 3.03e+04</td> <td> 3.374</td> <td> 0.001</td> <td> 4.28e+04</td> <td> 1.61e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98092]</th> <td>-1.949e+04</td> <td> 1.15e+04</td> <td> -1.693</td> <td> 0.090</td> <td> -4.2e+04</td> <td> 3074.716</td>
</tr>
<tr>
<th>C(zipcode)[T.98102]</th> <td> 3.862e+05</td> <td> 2.47e+04</td> <td> 15.652</td> <td> 0.000</td> <td> 3.38e+05</td> <td> 4.35e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98103]</th> <td> 2.573e+05</td> <td> 2.33e+04</td> <td> 11.048</td> <td> 0.000</td> <td> 2.12e+05</td> <td> 3.03e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98105]</th> <td> 3.979e+05</td> <td> 2.39e+04</td> <td> 16.662</td> <td> 0.000</td> <td> 3.51e+05</td> <td> 4.45e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98106]</th> <td> 8.935e+04</td> <td> 1.71e+04</td> <td> 5.224</td> <td> 0.000</td> <td> 5.58e+04</td> <td> 1.23e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98107]</th> <td> 2.574e+05</td> <td> 2.4e+04</td> <td> 10.746</td> <td> 0.000</td> <td> 2.1e+05</td> <td> 3.04e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98108]</th> <td> 7.616e+04</td> <td> 1.88e+04</td> <td> 4.058</td> <td> 0.000</td> <td> 3.94e+04</td> <td> 1.13e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98109]</th> <td> 4.245e+05</td> <td> 2.45e+04</td> <td> 17.349</td> <td> 0.000</td> <td> 3.77e+05</td> <td> 4.73e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98112]</th> <td> 5.225e+05</td> <td> 2.19e+04</td> <td> 23.847</td> <td> 0.000</td> <td> 4.8e+05</td> <td> 5.65e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98115]</th> <td> 2.649e+05</td> <td> 2.37e+04</td> <td> 11.181</td> <td> 0.000</td> <td> 2.18e+05</td> <td> 3.11e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98116]</th> <td> 2.435e+05</td> <td> 1.91e+04</td> <td> 12.734</td> <td> 0.000</td> <td> 2.06e+05</td> <td> 2.81e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98117]</th> <td> 2.382e+05</td> <td> 2.4e+04</td> <td> 9.920</td> <td> 0.000</td> <td> 1.91e+05</td> <td> 2.85e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98118]</th> <td> 1.37e+05</td> <td> 1.67e+04</td> <td> 8.196</td> <td> 0.000</td> <td> 1.04e+05</td> <td> 1.7e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98119]</th> <td> 4.004e+05</td> <td> 2.32e+04</td> <td> 17.231</td> <td> 0.000</td> <td> 3.55e+05</td> <td> 4.46e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98122]</th> <td> 2.743e+05</td> <td> 2.07e+04</td> <td> 13.248</td> <td> 0.000</td> <td> 2.34e+05</td> <td> 3.15e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98125]</th> <td> 1.449e+05</td> <td> 2.56e+04</td> <td> 5.652</td> <td> 0.000</td> <td> 9.47e+04</td> <td> 1.95e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98126]</th> <td> 1.492e+05</td> <td> 1.75e+04</td> <td> 8.513</td> <td> 0.000</td> <td> 1.15e+05</td> <td> 1.84e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98133]</th> <td> 8.992e+04</td> <td> 2.65e+04</td> <td> 3.393</td> <td> 0.001</td> <td> 3.8e+04</td> <td> 1.42e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98136]</th> <td> 2.046e+05</td> <td> 1.79e+04</td> <td> 11.420</td> <td> 0.000</td> <td> 1.69e+05</td> <td> 2.4e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98144]</th> <td> 2.227e+05</td> <td> 1.93e+04</td> <td> 11.566</td> <td> 0.000</td> <td> 1.85e+05</td> <td> 2.6e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98146]</th> <td> 8.836e+04</td> <td> 1.6e+04</td> <td> 5.520</td> <td> 0.000</td> <td> 5.7e+04</td> <td> 1.2e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98148]</th> <td> 3.756e+04</td> <td> 2.13e+04</td> <td> 1.759</td> <td> 0.079</td> <td>-4283.572</td> <td> 7.94e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98155]</th> <td> 8.681e+04</td> <td> 2.76e+04</td> <td> 3.146</td> <td> 0.002</td> <td> 3.27e+04</td> <td> 1.41e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98166]</th> <td> 5.477e+04</td> <td> 1.46e+04</td> <td> 3.756</td> <td> 0.000</td> <td> 2.62e+04</td> <td> 8.33e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98168]</th> <td> 3.944e+04</td> <td> 1.54e+04</td> <td> 2.556</td> <td> 0.011</td> <td> 9193.964</td> <td> 6.97e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98177]</th> <td> 1.645e+05</td> <td> 2.76e+04</td> <td> 5.952</td> <td> 0.000</td> <td> 1.1e+05</td> <td> 2.19e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98178]</th> <td> 2.933e+04</td> <td> 1.59e+04</td> <td> 1.842</td> <td> 0.065</td> <td>-1880.634</td> <td> 6.05e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98188]</th> <td> 1.89e+04</td> <td> 1.62e+04</td> <td> 1.166</td> <td> 0.243</td> <td>-1.29e+04</td> <td> 5.07e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98198]</th> <td> 4188.9410</td> <td> 1.22e+04</td> <td> 0.343</td> <td> 0.732</td> <td>-1.97e+04</td> <td> 2.81e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98199]</th> <td> 3.24e+05</td> <td> 2.27e+04</td> <td> 14.255</td> <td> 0.000</td> <td> 2.79e+05</td> <td> 3.69e+05</td>
</tr>
<tr>
<th>scaled_bedrooms</th> <td>-1.032e+05</td> <td> 7440.518</td> <td> -13.872</td> <td> 0.000</td> <td>-1.18e+05</td> <td>-8.86e+04</td>
</tr>
<tr>
<th>scaled_bathrooms</th> <td> 6.19e+04</td> <td> 8999.099</td> <td> 6.879</td> <td> 0.000</td> <td> 4.43e+04</td> <td> 7.95e+04</td>
</tr>
<tr>
<th>scaled_sqft_living</th> <td> 7.006e+05</td> <td> 1.1e+04</td> <td> 63.876</td> <td> 0.000</td> <td> 6.79e+05</td> <td> 7.22e+05</td>
</tr>
<tr>
<th>scaled_sqft_lot</th> <td> 1.592e+05</td> <td> 1.93e+04</td> <td> 8.267</td> <td> 0.000</td> <td> 1.21e+05</td> <td> 1.97e+05</td>
</tr>
<tr>
<th>scaled_floors</th> <td>-1.963e+04</td> <td> 6153.900</td> <td> -3.189</td> <td> 0.001</td> <td>-3.17e+04</td> <td>-7562.947</td>
</tr>
<tr>
<th>scaled_condition</th> <td> 9.668e+04</td> <td> 6755.092</td> <td> 14.313</td> <td> 0.000</td> <td> 8.34e+04</td> <td> 1.1e+05</td>
</tr>
<tr>
<th>scaled_grade</th> <td> 7.721e+05</td> <td> 1.55e+04</td> <td> 49.854</td> <td> 0.000</td> <td> 7.42e+05</td> <td> 8.02e+05</td>
</tr>
<tr>
<th>yr_built</th> <td> -977.5412</td> <td> 56.652</td> <td> -17.255</td> <td> 0.000</td> <td>-1088.583</td> <td> -866.499</td>
</tr>
<tr>
<th>yr_renovated</th> <td> 22.2541</td> <td> 2.835</td> <td> 7.850</td> <td> 0.000</td> <td> 16.697</td> <td> 27.811</td>
</tr>
<tr>
<th>scaled_lat</th> <td> 6.622e+04</td> <td> 3.6e+04</td> <td> 1.841</td> <td> 0.066</td> <td>-4284.602</td> <td> 1.37e+05</td>
</tr>
<tr>
<th>scaled_long</th> <td>-1.559e+05</td> <td> 5.03e+04</td> <td> -3.100</td> <td> 0.002</td> <td>-2.54e+05</td> <td>-5.73e+04</td>
</tr>
<tr>
<th>scaled_sqft_lot15</th> <td>-5.277e+04</td> <td> 1.76e+04</td> <td> -3.006</td> <td> 0.003</td> <td>-8.72e+04</td> <td>-1.84e+04</td>
</tr>
</table>
<table class="simpletable">
<tr>
<th>Omnibus:</th> <td>12906.466</td> <th> Durbin-Watson: </th> <td> 1.985</td>
</tr>
<tr>
<th>Prob(Omnibus):</th> <td> 0.000</td> <th> Jarque-Bera (JB): </th> <td>413238.519</td>
</tr>
<tr>
<th>Skew:</th> <td> 2.508</td> <th> Prob(JB): </th> <td> 0.00</td>
</tr>
<tr>
<th>Kurtosis:</th> <td>24.371</td> <th> Cond. No. </th> <td>3.13e+05</td>
</tr>
</table><br/><br/>Warnings:<br/>[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.<br/>[2] The condition number is large, 3.13e+05. This might indicate that there are<br/>strong multicollinearity or other numerical problems.
```python
# The R2 value is still at 0.798 so that's good.
# Our skew is still 2.5.
# Kurtosis is still 24.3.
# The condition number is down to 313,000 from 79,500,000 in the last model.
```
### Look at heat map again with new numbers.
```python
fig, axes = plt.subplots(figsize=(13,13))
sns.heatmap(df_scaled.corr().round(3), center=0, square=True, ax=axes, annot=True);
axes.set_ylim(len(df_scaled.corr()),-0.5,+0.5)
```
(25, -0.5)
![png](output_136_1.png)
```python
# it seems like grade is somewhat correlated so maybe I could drop that column,
# or I can try scaling it to see if that changes anything.
```
### New model with only specific coeffs to compare.
```python
# create model using best coeffs list of predictors by typing them all out.
outcome = 'price'
x_cols = ['bedrooms', 'bathrooms', 'scaled_sqft_living','scaled_sqft_lot',
'C(waterfront)',
'C(zipcode)', 'scaled_lat', 'scaled_long']
predictors = '+'.join(x_cols)
formula = outcome + '~' + predictors
model = smf.ols(formula=formula, data=df_scaled).fit()
model.summary()
```
<table class="simpletable">
<caption>OLS Regression Results</caption>
<tr>
<th>Dep. Variable:</th> <td>price</td> <th> R-squared: </th> <td> 0.771</td>
</tr>
<tr>
<th>Model:</th> <td>OLS</td> <th> Adj. R-squared: </th> <td> 0.770</td>
</tr>
<tr>
<th>Method:</th> <td>Least Squares</td> <th> F-statistic: </th> <td> 906.1</td>
</tr>
<tr>
<th>Date:</th> <td>Fri, 06 Dec 2019</td> <th> Prob (F-statistic):</th> <td> 0.00</td>
</tr>
<tr>
<th>Time:</th> <td>19:38:21</td> <th> Log-Likelihood: </th> <td>-2.7416e+05</td>
</tr>
<tr>
<th>No. Observations:</th> <td> 20582</td> <th> AIC: </th> <td>5.485e+05</td>
</tr>
<tr>
<th>Df Residuals:</th> <td> 20505</td> <th> BIC: </th> <td>5.491e+05</td>
</tr>
<tr>
<th>Df Model:</th> <td> 76</td> <th> </th> <td> </td>
</tr>
<tr>
<th>Covariance Type:</th> <td>nonrobust</td> <th> </th> <td> </td>
</tr>
</table>
<table class="simpletable">
<tr>
<td></td> <th>coef</th> <th>std err</th> <th>t</th> <th>P>|t|</th> <th>[0.025</th> <th>0.975]</th>
</tr>
<tr>
<th>Intercept</th> <td> 1.387e+04</td> <td> 1.74e+04</td> <td> 0.797</td> <td> 0.426</td> <td>-2.03e+04</td> <td> 4.8e+04</td>
</tr>
<tr>
<th>C(waterfront)[T.1.0]</th> <td> 7.605e+05</td> <td> 1.4e+04</td> <td> 54.367</td> <td> 0.000</td> <td> 7.33e+05</td> <td> 7.88e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98002]</th> <td> 3.702e+04</td> <td> 1.35e+04</td> <td> 2.749</td> <td> 0.006</td> <td> 1.06e+04</td> <td> 6.34e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98003]</th> <td> 4580.8726</td> <td> 1.2e+04</td> <td> 0.381</td> <td> 0.703</td> <td> -1.9e+04</td> <td> 2.82e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98004]</th> <td> 7.432e+05</td> <td> 2.26e+04</td> <td> 32.877</td> <td> 0.000</td> <td> 6.99e+05</td> <td> 7.87e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98005]</th> <td> 3.386e+05</td> <td> 2.4e+04</td> <td> 14.125</td> <td> 0.000</td> <td> 2.92e+05</td> <td> 3.86e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98006]</th> <td> 3.205e+05</td> <td> 1.97e+04</td> <td> 16.262</td> <td> 0.000</td> <td> 2.82e+05</td> <td> 3.59e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98007]</th> <td> 2.652e+05</td> <td> 2.48e+04</td> <td> 10.684</td> <td> 0.000</td> <td> 2.17e+05</td> <td> 3.14e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98008]</th> <td> 2.731e+05</td> <td> 2.36e+04</td> <td> 11.572</td> <td> 0.000</td> <td> 2.27e+05</td> <td> 3.19e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98010]</th> <td> 1.228e+05</td> <td> 2.17e+04</td> <td> 5.667</td> <td> 0.000</td> <td> 8.04e+04</td> <td> 1.65e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98011]</th> <td> 8.093e+04</td> <td> 3.08e+04</td> <td> 2.623</td> <td> 0.009</td> <td> 2.05e+04</td> <td> 1.41e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98014]</th> <td> 1.154e+05</td> <td> 3.57e+04</td> <td> 3.237</td> <td> 0.001</td> <td> 4.55e+04</td> <td> 1.85e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98019]</th> <td> 6.728e+04</td> <td> 3.37e+04</td> <td> 1.998</td> <td> 0.046</td> <td> 1262.751</td> <td> 1.33e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98022]</th> <td> 9.439e+04</td> <td> 1.9e+04</td> <td> 4.963</td> <td> 0.000</td> <td> 5.71e+04</td> <td> 1.32e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98023]</th> <td>-3.314e+04</td> <td> 1.11e+04</td> <td> -2.983</td> <td> 0.003</td> <td>-5.49e+04</td> <td>-1.14e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98024]</th> <td> 1.649e+05</td> <td> 3.26e+04</td> <td> 5.050</td> <td> 0.000</td> <td> 1.01e+05</td> <td> 2.29e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98027]</th> <td> 1.956e+05</td> <td> 2.03e+04</td> <td> 9.629</td> <td> 0.000</td> <td> 1.56e+05</td> <td> 2.35e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98028]</th> <td> 6.764e+04</td> <td> 3e+04</td> <td> 2.255</td> <td> 0.024</td> <td> 8852.904</td> <td> 1.26e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98029]</th> <td> 2.562e+05</td> <td> 2.31e+04</td> <td> 11.071</td> <td> 0.000</td> <td> 2.11e+05</td> <td> 3.02e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98030]</th> <td> 1.306e+04</td> <td> 1.33e+04</td> <td> 0.978</td> <td> 0.328</td> <td>-1.31e+04</td> <td> 3.92e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98031]</th> <td> 2.13e+04</td> <td> 1.39e+04</td> <td> 1.532</td> <td> 0.126</td> <td>-5957.666</td> <td> 4.86e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98032]</th> <td> 6938.8385</td> <td> 1.6e+04</td> <td> 0.433</td> <td> 0.665</td> <td>-2.45e+04</td> <td> 3.83e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98033]</th> <td> 3.594e+05</td> <td> 2.57e+04</td> <td> 13.975</td> <td> 0.000</td> <td> 3.09e+05</td> <td> 4.1e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98034]</th> <td> 1.688e+05</td> <td> 2.76e+04</td> <td> 6.111</td> <td> 0.000</td> <td> 1.15e+05</td> <td> 2.23e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98038]</th> <td> 6.285e+04</td> <td> 1.52e+04</td> <td> 4.124</td> <td> 0.000</td> <td> 3.3e+04</td> <td> 9.27e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98039]</th> <td> 1.108e+06</td> <td> 3.26e+04</td> <td> 33.996</td> <td> 0.000</td> <td> 1.04e+06</td> <td> 1.17e+06</td>
</tr>
<tr>
<th>C(zipcode)[T.98040]</th> <td> 5.501e+05</td> <td> 1.99e+04</td> <td> 27.688</td> <td> 0.000</td> <td> 5.11e+05</td> <td> 5.89e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98042]</th> <td> 3.278e+04</td> <td> 1.29e+04</td> <td> 2.544</td> <td> 0.011</td> <td> 7521.821</td> <td> 5.8e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98045]</th> <td> 1.835e+05</td> <td> 2.88e+04</td> <td> 6.376</td> <td> 0.000</td> <td> 1.27e+05</td> <td> 2.4e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98052]</th> <td> 2.364e+05</td> <td> 2.63e+04</td> <td> 8.998</td> <td> 0.000</td> <td> 1.85e+05</td> <td> 2.88e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98053]</th> <td> 2.024e+05</td> <td> 2.84e+04</td> <td> 7.124</td> <td> 0.000</td> <td> 1.47e+05</td> <td> 2.58e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98055]</th> <td> 4.094e+04</td> <td> 1.56e+04</td> <td> 2.621</td> <td> 0.009</td> <td> 1.03e+04</td> <td> 7.16e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98056]</th> <td> 1.028e+05</td> <td> 1.7e+04</td> <td> 6.030</td> <td> 0.000</td> <td> 6.94e+04</td> <td> 1.36e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98058]</th> <td> 4.47e+04</td> <td> 1.48e+04</td> <td> 3.016</td> <td> 0.003</td> <td> 1.56e+04</td> <td> 7.38e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98059]</th> <td> 1.023e+05</td> <td> 1.68e+04</td> <td> 6.102</td> <td> 0.000</td> <td> 6.94e+04</td> <td> 1.35e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98065]</th> <td> 1.449e+05</td> <td> 2.63e+04</td> <td> 5.516</td> <td> 0.000</td> <td> 9.34e+04</td> <td> 1.96e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98070]</th> <td>-5.621e+04</td> <td> 2.17e+04</td> <td> -2.584</td> <td> 0.010</td> <td>-9.88e+04</td> <td>-1.36e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98072]</th> <td> 1.253e+05</td> <td> 3.08e+04</td> <td> 4.065</td> <td> 0.000</td> <td> 6.49e+04</td> <td> 1.86e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98074]</th> <td> 2.194e+05</td> <td> 2.49e+04</td> <td> 8.822</td> <td> 0.000</td> <td> 1.71e+05</td> <td> 2.68e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98075]</th> <td> 2.454e+05</td> <td> 2.38e+04</td> <td> 10.295</td> <td> 0.000</td> <td> 1.99e+05</td> <td> 2.92e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98077]</th> <td> 1.361e+05</td> <td> 3.22e+04</td> <td> 4.228</td> <td> 0.000</td> <td> 7.3e+04</td> <td> 1.99e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98092]</th> <td> 2987.3534</td> <td> 1.23e+04</td> <td> 0.244</td> <td> 0.808</td> <td>-2.11e+04</td> <td> 2.7e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98102]</th> <td> 4.605e+05</td> <td> 2.61e+04</td> <td> 17.625</td> <td> 0.000</td> <td> 4.09e+05</td> <td> 5.12e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98103]</th> <td> 2.918e+05</td> <td> 2.47e+04</td> <td> 11.823</td> <td> 0.000</td> <td> 2.43e+05</td> <td> 3.4e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98105]</th> <td> 4.598e+05</td> <td> 2.53e+04</td> <td> 18.171</td> <td> 0.000</td> <td> 4.1e+05</td> <td> 5.09e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98106]</th> <td> 8.355e+04</td> <td> 1.82e+04</td> <td> 4.588</td> <td> 0.000</td> <td> 4.79e+04</td> <td> 1.19e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98107]</th> <td> 2.885e+05</td> <td> 2.54e+04</td> <td> 11.351</td> <td> 0.000</td> <td> 2.39e+05</td> <td> 3.38e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98108]</th> <td> 8.103e+04</td> <td> 2e+04</td> <td> 4.059</td> <td> 0.000</td> <td> 4.19e+04</td> <td> 1.2e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98109]</th> <td> 4.911e+05</td> <td> 2.59e+04</td> <td> 18.941</td> <td> 0.000</td> <td> 4.4e+05</td> <td> 5.42e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98112]</th> <td> 6.012e+05</td> <td> 2.32e+04</td> <td> 25.963</td> <td> 0.000</td> <td> 5.56e+05</td> <td> 6.47e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98115]</th> <td> 2.945e+05</td> <td> 2.52e+04</td> <td> 11.693</td> <td> 0.000</td> <td> 2.45e+05</td> <td> 3.44e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98116]</th> <td> 2.81e+05</td> <td> 2.03e+04</td> <td> 13.845</td> <td> 0.000</td> <td> 2.41e+05</td> <td> 3.21e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98117]</th> <td> 2.647e+05</td> <td> 2.55e+04</td> <td> 10.378</td> <td> 0.000</td> <td> 2.15e+05</td> <td> 3.15e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98118]</th> <td> 1.493e+05</td> <td> 1.77e+04</td> <td> 8.415</td> <td> 0.000</td> <td> 1.15e+05</td> <td> 1.84e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98119]</th> <td> 4.659e+05</td> <td> 2.46e+04</td> <td> 18.931</td> <td> 0.000</td> <td> 4.18e+05</td> <td> 5.14e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98122]</th> <td> 3.356e+05</td> <td> 2.19e+04</td> <td> 15.319</td> <td> 0.000</td> <td> 2.93e+05</td> <td> 3.79e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98125]</th> <td> 1.484e+05</td> <td> 2.73e+04</td> <td> 5.437</td> <td> 0.000</td> <td> 9.49e+04</td> <td> 2.02e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98126]</th> <td> 1.664e+05</td> <td> 1.86e+04</td> <td> 8.933</td> <td> 0.000</td> <td> 1.3e+05</td> <td> 2.03e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98133]</th> <td> 9.373e+04</td> <td> 2.82e+04</td> <td> 3.323</td> <td> 0.001</td> <td> 3.84e+04</td> <td> 1.49e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98136]</th> <td> 2.32e+05</td> <td> 1.9e+04</td> <td> 12.189</td> <td> 0.000</td> <td> 1.95e+05</td> <td> 2.69e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98144]</th> <td> 2.52e+05</td> <td> 2.04e+04</td> <td> 12.335</td> <td> 0.000</td> <td> 2.12e+05</td> <td> 2.92e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98146]</th> <td> 8.141e+04</td> <td> 1.7e+04</td> <td> 4.780</td> <td> 0.000</td> <td> 4.8e+04</td> <td> 1.15e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98148]</th> <td> 3.439e+04</td> <td> 2.27e+04</td> <td> 1.512</td> <td> 0.131</td> <td>-1.02e+04</td> <td> 7.9e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98155]</th> <td> 8.686e+04</td> <td> 2.94e+04</td> <td> 2.956</td> <td> 0.003</td> <td> 2.93e+04</td> <td> 1.44e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98166]</th> <td> 6.964e+04</td> <td> 1.55e+04</td> <td> 4.492</td> <td> 0.000</td> <td> 3.92e+04</td> <td> 1e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98168]</th> <td> 2.133e+04</td> <td> 1.64e+04</td> <td> 1.299</td> <td> 0.194</td> <td>-1.08e+04</td> <td> 5.35e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98177]</th> <td> 1.872e+05</td> <td> 2.94e+04</td> <td> 6.361</td> <td> 0.000</td> <td> 1.3e+05</td> <td> 2.45e+05</td>
</tr>
<tr>
<th>C(zipcode)[T.98178]</th> <td> 2.435e+04</td> <td> 1.69e+04</td> <td> 1.437</td> <td> 0.151</td> <td>-8868.176</td> <td> 5.76e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98188]</th> <td> 1.615e+04</td> <td> 1.73e+04</td> <td> 0.935</td> <td> 0.350</td> <td>-1.77e+04</td> <td> 5e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98198]</th> <td> 9747.5611</td> <td> 1.3e+04</td> <td> 0.749</td> <td> 0.454</td> <td>-1.58e+04</td> <td> 3.53e+04</td>
</tr>
<tr>
<th>C(zipcode)[T.98199]</th> <td> 3.697e+05</td> <td> 2.42e+04</td> <td> 15.299</td> <td> 0.000</td> <td> 3.22e+05</td> <td> 4.17e+05</td>
</tr>
<tr>
<th>bedrooms</th> <td>-2.869e+04</td> <td> 1550.649</td> <td> -18.499</td> <td> 0.000</td> <td>-3.17e+04</td> <td>-2.56e+04</td>
</tr>
<tr>
<th>bathrooms</th> <td> 1.436e+04</td> <td> 2204.755</td> <td> 6.512</td> <td> 0.000</td> <td> 1e+04</td> <td> 1.87e+04</td>
</tr>
<tr>
<th>scaled_sqft_living</th> <td> 9.958e+05</td> <td> 9842.679</td> <td> 101.170</td> <td> 0.000</td> <td> 9.76e+05</td> <td> 1.02e+06</td>
</tr>
<tr>
<th>scaled_sqft_lot</th> <td> 1.788e+05</td> <td> 1.37e+04</td> <td> 13.100</td> <td> 0.000</td> <td> 1.52e+05</td> <td> 2.06e+05</td>
</tr>
<tr>
<th>scaled_lat</th> <td> 9.701e+04</td> <td> 3.83e+04</td> <td> 2.532</td> <td> 0.011</td> <td> 2.19e+04</td> <td> 1.72e+05</td>
</tr>
<tr>
<th>scaled_long</th> <td>-2.368e+05</td> <td> 5.34e+04</td> <td> -4.436</td> <td> 0.000</td> <td>-3.41e+05</td> <td>-1.32e+05</td>
</tr>
</table>
<table class="simpletable">
<tr>
<th>Omnibus:</th> <td>12337.671</td> <th> Durbin-Watson: </th> <td> 1.989</td>
</tr>
<tr>
<th>Prob(Omnibus):</th> <td> 0.000</td> <th> Jarque-Bera (JB): </th> <td>361817.188</td>
</tr>
<tr>
<th>Skew:</th> <td> 2.375</td> <th> Prob(JB): </th> <td> 0.00</td>
</tr>
<tr>
<th>Kurtosis:</th> <td>22.984</td> <th> Cond. No. </th> <td> 673.</td>
</tr>
</table><br/><br/>Warnings:<br/>[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
```python
from scipy import stats
plt.style.use('ggplot')
f = 'price~bedrooms'
f2 = 'price~bathrooms'
f3 = 'price~scaled_sqft_living'
f4 = 'price~scaled_sqft_lot'
f5 = 'price~condition'
f6 = 'price~grade'
model = smf.ols(formula=f, data=df_scaled).fit()
model2 = smf.ols(formula=f2, data=df_scaled).fit()
model3 = smf.ols(formula=f3, data=df_scaled).fit()
model4 = smf.ols(formula=f4, data=df_scaled).fit()
model5 = smf.ols(formula=f5, data=df_scaled).fit()
model6 = smf.ols(formula=f6, data=df_scaled).fit()
resid1 = model.resid
resid2 = model2.resid
resid3 = model3.resid
resid4 = model4.resid
resid5 = model5.resid
resid6 = model6.resid
fig = sm.graphics.qqplot(resid1, dist=stats.norm, line='45', fit=True)
fig = sm.graphics.qqplot(resid2, dist=stats.norm, line='45', fit=True)
fig = sm.graphics.qqplot(resid3, dist=stats.norm, line='45', fit=True)
fig = sm.graphics.qqplot(resid4, dist=stats.norm, line='45', fit=True)
fig = sm.graphics.qqplot(resid5, dist=stats.norm, line='45', fit=True)
fig = sm.graphics.qqplot(resid6, dist=stats.norm, line='45', fit=True)
```
![png](output_140_0.png)
![png](output_140_1.png)
![png](output_140_2.png)
![png](output_140_3.png)
![png](output_140_4.png)
![png](output_140_5.png)
# iNTERPRET
### bedroom vs bathroom
```python
# bedrooms -28,690
# bathrooms 14,360
# according to my previous model the bathrooms have a bigger coeff and more positive relationship with price.
# An additional bedroom is associated with a -28,690 decrease in price.
# An additional bathroom is associated with a 14,360 increase in price.
df_scaled.plot(kind='scatter', x='bedrooms', y='price', alpha=0.4, color='b')
df_scaled.plot(kind='scatter', x='bathrooms', y='price', alpha=0.4, color='b');
```
![png](output_143_0.png)
![png](output_143_1.png)
### sqft living vs sqft lot
```python
# scaled_sqft_living 9.958e+05
# scaled_sqft_lot 1.788e+05
# according to model my sqft living area is more significant
# A 1% "unit" increase in sqft living is associated with a 9.9% "unit" increase in price.
# A 1% "unit" increase in sqft lot is associated with a 1.7% "unit" increase in price.
df_scaled.plot(kind='scatter', x='sqft_living', y='price', alpha=0.4, color='b')
df_scaled.plot(kind='scatter', x='sqft_lot', y='price', alpha=0.4, color='b');
```
![png](output_145_0.png)
![png](output_145_1.png)
### Waterfront property
```python
# waterfront coeff 760,500
# having a property on a waterfront equates to an increase in price of about 760,500
df_scaled.plot(kind='scatter', x='waterfront', y='price', alpha=0.4, color='b')
```
<matplotlib.axes._subplots.AxesSubplot at 0x1c256a2588>
![png](output_147_1.png)
### Latitude and Longitude
```python
# scaled_lat 9.701e+04
# scaled_long -2.368e+05
# city center latitude 47.608013 : 1% closer to city center = 9.7% increase in price
# city center longitude -122.335167 : 1% closer to city center = 2.3% increase in price
df_scaled.plot(kind='scatter', x='lat', y='price', alpha=0.4, color='b')
df_scaled.plot(kind='scatter', x='long', y='price', alpha=0.4, color='b')
```
<matplotlib.axes._subplots.AxesSubplot at 0x1c30c710f0>
![png](output_149_1.png)
![png](output_149_2.png)
# CONCLUSIONS & RECOMMENDATIONS
> Best predictors for house pricing:
- # of bathrooms (recommend adding a bathroom to your home)
- square footage of living area (recommend finding most sqft you can afford)
- find a property on the waterfront
- find a property closer to city center
```python
```
| 28.197142 | 309 | 0.528187 | kor_Hang | 0.194741 |
db755ad1a5da9afa1d2396592a10aed81203daac | 181 | md | Markdown | README.md | losttech/IO.Links | f9c96a4dc3e01c4b84e5e9411ff438869c890c0d | [
"MIT"
] | 2 | 2020-04-29T04:41:21.000Z | 2021-02-05T23:40:07.000Z | README.md | losttech/IO.Links | f9c96a4dc3e01c4b84e5e9411ff438869c890c0d | [
"MIT"
] | null | null | null | README.md | losttech/IO.Links | f9c96a4dc3e01c4b84e5e9411ff438869c890c0d | [
"MIT"
] | null | null | null | # LostTech.IO.Links
Symbolic and hardlink management
[![IO.Links on NuGet](https://img.shields.io/nuget/v/LostTech.IO.Links.svg)](https://www.nuget.org/packages/LostTech.IO.Links)
| 36.2 | 126 | 0.762431 | yue_Hant | 0.636288 |
db760e8d63b36d71470ddc637e02a9f8e311e2ef | 1,264 | md | Markdown | README.md | Alipsa/sas-reader | 4d784b5ce08fdd838ff383f58e6cf64bd3c443d3 | [
"MIT"
] | null | null | null | README.md | Alipsa/sas-reader | 4d784b5ce08fdd838ff383f58e6cf64bd3c443d3 | [
"MIT"
] | null | null | null | README.md | Alipsa/sas-reader | 4d784b5ce08fdd838ff383f58e6cf64bd3c443d3 | [
"MIT"
] | null | null | null | # sas-reader
Renjin R package for reading sas7Bdat files into a data.frame.
## Usage
add the following dependency to your pom.xml
```xml
<dependency>
<groupId>se.alipsa</groupId>
<artifactId>sas-reader</artifactId>
<version>1.0.0</version>
</dependency>
```
Regular releases are available on maven central so no additional settings are required.
If you want to use a snapshot however, you need to add the following repository to your repositories section
```xml
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
```
Then in your R code simply load the package and use it as follows:
```r
library('se.alipsa:sas-reader')
df <- readSas7bdat(paste0(getwd(), "/cattle.sas7bdat"))
```
### Notes
Dates are converted to either `Date` or `POSIXct` depending on the format defined for the column in SAS.
## 3:rd Party dependencies
### org.renjin:renjin-script-engine
The R platform this package is for. GNU General Public License v2.0
### com.epam:parso
Parses sas7bdat files. Apache License 2.0
### org.slf4j:slf4j-api
Logging library. MIT Licence
| 27.478261 | 108 | 0.719937 | eng_Latn | 0.960847 |
6fff840f85968de6bd2e210ddad7ff8f84ba9060 | 1,370 | md | Markdown | src/DialogBase/README.md | rbuggin/skin-react | a34d4869994769afd67e132ece7bba4e4e798168 | [
"MIT"
] | 1 | 2020-07-31T05:07:39.000Z | 2020-07-31T05:07:39.000Z | src/DialogBase/README.md | rbuggin/skin-react | a34d4869994769afd67e132ece7bba4e4e798168 | [
"MIT"
] | null | null | null | src/DialogBase/README.md | rbuggin/skin-react | a34d4869994769afd67e132ece7bba4e4e798168 | [
"MIT"
] | null | null | null | # DialogBase
## DialogBase Usage
```react
<DialogBase
open
a11yClosetext = "Close DialogBase"
onCloseBtnClick={ handleCloseBtnClick }>
<h1>Hello World</h1>
</DialogBase>
```
## Attributes
Name | Type | Stateful | Required | Description
--- | --- | --- | --- | ---
`tag` | div' or 'span | No | No | ---
`open` | Boolean | Yes | No | Whether drawer is open.
`type` | String | No | No | Can be "" / "" / ""
`classPrefix` | drawer or toast or dialog | No | No | "" (default) / modifies the base prefix for all Skin classes in the component
`focus` | String | No | No | An id for an element which will receive focus when the drawer opens (defaults to close button).
`windowClass` | String | No | No | "" (default) / modifies the base prefix for all Skin classes in the component
`header` | String | No | No | element placeholder
`footer` | String | No | No | element placeholder
`isModal` | Boolean | No | No | Whether drawer is model.
`top` | --- | --- | --- | ---
`buttonPosition` | top or right or bottom or left | --- | --- | ---
`a11yCloseText`| String | No | Yes | A11y text for close button and mask.
`baseEl` | aside or | No | No | modify the tag be "div" (default) / "" / ""
`transitionEl` | root or | No | No | modify the tag be "div" (default) / "" / ""
## Events
Event | Data | Description
`onCloseBtnClick` | --- | --- | --- | ---
| 35.128205 | 131 | 0.612409 | eng_Latn | 0.877752 |
b500f5cf7c66baf1160e54a2798f07d5668d5b4e | 4,027 | md | Markdown | _posts/2018-06-25-meow-wolf.md | bhudgens/blog | db63e3c58957633e56da2d93689ece24c25827f2 | [
"MIT"
] | null | null | null | _posts/2018-06-25-meow-wolf.md | bhudgens/blog | db63e3c58957633e56da2d93689ece24c25827f2 | [
"MIT"
] | 3 | 2018-07-31T23:14:09.000Z | 2021-06-22T20:41:57.000Z | _posts/2018-06-25-meow-wolf.md | bhudgens/blog | db63e3c58957633e56da2d93689ece24c25827f2 | [
"MIT"
] | null | null | null | ---
title: Meow Wolf House of Eternal Return
author: Alexis Jackson
header:
image: /assets/images/cover/IMG_2965.jpg
caption: The mystical forest inside Meow Wolf
categories:
- General
tags:
- Meow Wolf
- Activities
- Santa Fe
- New Mexico
---
Ben sent me a link a couple of weeks ago and said "Let's go here". Today we did just that and stepped into the alternate dimension that is [Meow Wolf House of Eternal Return](https://meowwolf.com/santa-fe/about/).
The first thing you notice when pulling up to the museum is the large red robot smelling a flower in the parking lot. Well, maybe the second thing you notice after seeing how crowded the parking lot is. At noon on a Monday the line for general admission was out the door, and the inside was packed. You can pre-purchase tickets if you would like to skip said line. We didn't bother because the lady outside manning the line had some pretty terrible dad jokes to entertain with. And by terrible I mean awesome.
<figure class="align-center">
<img src="{{ site.url }}{{ site.baseurl }}/assets/images/article/IMG_6439.jpg" alt="">
<figcaption>The big red robot and his flower.</figcaption>
</figure>
Everywhere you look once inside the doors there is something to see. Even the front lobby has art on the ceilings and walls to view while waiting to go to the main attraction. Admission was $25/person, and you have the option of paying $1 extra for a pair of "light enhancing" glasses. We both decided to get a pair and are glad we did. These glasses are very similar to the paper 3D glasses you get at some theaters or with a code reader toy. If you put them on in any of the rooms with blacklights they "enhance" the colors of the neon lights. Donning them in the arcade behind the house inside gives the walls a 3D appearance.
Once you have paid your admission and have your glasses you are directed down a dark hallway that leads into the museum attraction. Once you go through the door at the end of said hallway the Selig house is right up front. This is where the rest of the attraction spans from. You can choose to simply explore everything inside at leisure or investigate the mystery surrounding the Selig family.
We spent two hours inside and in that time we were able to see every room inside the museum. But just seeing every room was not quite enough. If you can spare the time, I would recommend spending a day here. Nearly everything inside is interactive. You are encouraged to push buttons and touch the walls and anything that glows (which is pretty much everything).
In our two hours inside we did not start the mystery story. The house itself was the most crowded part of the museum. It also happened to be where it was blatantly obvious that not everyone showers or wears deodorant. Don't be that guy. But DO be the one that goes in every door and crawls through every portal. There is so much to see at Meow Wolf. Don't forget to look up either! They have covered every inch of the place with something to wonder at. Push the buttons, feel the walls, and touch things. You never know what will make a noise or do something. :)
<figure class="align-center">
<img src="{{ site.url }}{{ site.baseurl }}/assets/images/article/IMG_9857.jpg" alt="">
<figcaption>The Selig family house.</figcaption>
</figure>
<figure class="align-center">
<img src="{{ site.url }}{{ site.baseurl }}/assets/images/article/IMG_4200.jpg" alt="">
<figcaption>Black and white reality.</figcaption>
</figure>
<figure class="align-center">
<img src="{{ site.url }}{{ site.baseurl }}/assets/images/article/IMG_5151.jpg" alt="">
<figcaption>Glowy tree ally.</figcaption>
</figure>
<figure class="align-center">
<img src="{{ site.url }}{{ site.baseurl }}/assets/images/article/IMG_8311.jpg" alt="">
<figcaption>An ice box portal.</figcaption>
</figure>
<figure class="align-center">
<img src="{{ site.url }}{{ site.baseurl }}/assets/images/article/IMG_2950.jpg" alt="">
<figcaption>Inside of the ice caves.</figcaption>
</figure> | 71.910714 | 629 | 0.754656 | eng_Latn | 0.998822 |
b502296e113c552442b83d9f3660391577699450 | 5,786 | md | Markdown | README.md | mattlewis92/htmlhint-loader | 87e0ac1f2e3febff942ed1ea6707e40fc322b515 | [
"MIT"
] | 14 | 2015-07-20T11:08:46.000Z | 2018-04-10T11:03:09.000Z | README.md | mattlewis92/htmlhint-loader | 87e0ac1f2e3febff942ed1ea6707e40fc322b515 | [
"MIT"
] | 14 | 2016-07-05T05:23:14.000Z | 2018-03-07T19:05:47.000Z | README.md | thedaviddias/htmlhint-loader | 87e0ac1f2e3febff942ed1ea6707e40fc322b515 | [
"MIT"
] | 10 | 2016-03-03T18:06:05.000Z | 2018-05-10T18:33:17.000Z | <h1 align="center">
<br>
HTMLHint Loader
<br>
</h1>
<h4 align="center">A Webpack loader for HTMLHint</h4>
<p align="center">
<a href="https://travis-ci.org/htmlhint/htmlhint-loader">
<img src="https://img.shields.io/travis/htmlhint/htmlhint-loader.svg" alt="Travis Build Status">
</a>
<a href="https://codecov.io/gh/htmlhint/htmlhint-loader">
<img src="https://codecov.io/gh/htmlhint/htmlhint-loader/branch/master/graph/badge.svg" alt="Codecov">
</a>
<a href="https://www.npmjs.com/package/htmlhint-loader">
<img src="https://img.shields.io/npm/dm/htmlhint-loader.svg" alt="NPM count">
</a>
<img src="https://badgen.net/badge/license/MIT/green" alt="MIT Licence" />
<a href="https://discord.gg/nJ6J9CP">
<img src="https://img.shields.io/badge/chat-on%20discord-7289da.svg" alt="Chat">
</a>
<a href="http://roadmap.htmlhint.io/roadmap">
<img src="https://img.shields.io/badge/check-our%20roadmap-EE503E.svg" alt="Chat">
</a>
</p>
<p align="center">
<a href="#install">How To Use</a> • <a href="/CONTRIBUTING.md">Contributing</a> • <a href="http://roadmap.htmlhint.io/">Roadmap</a> • <a href="https://htmlhint.io">Website</a>
</p>
## Table of Contents
- **[Install](#install)**
- **[Usage](#usage)**
- **[Options](#options)**
## Install
```
npm install htmlhint-loader
```
## Usage
```javascript
module.exports = {
module: {
rules: [{
enforce: 'pre',
test: /\.html/,
loader: 'htmlhint-loader',
exclude: /node_modules/
}]
}
}
```
### Options
You can directly pass some [htmlhint rules](https://github.com/thedaviddias/HTMLHint/wiki/Rules) by
- Adding a query string to the loader for this loader usage only
```javascript
module.exports = {
module: {
rules: [{
enforce: 'pre',
test: /\.html/,
loader: 'htmlhint-loader?{tagname-lowercase: true}',
exclude: /node_modules/
}]
}
}
```
- Adding a `htmlhint` entry in your webpack loader options:
```javascript
module.exports = {
module: {
rules: [{
enforce: 'pre',
test: /\.html/,
loader: 'htmlhint-loader',
exclude: /node_modules/,
options: {
configFile: 'path/.htmlhintrc'
}
}]
}
}
```
#### `configFile`
A path to a json file containing the set of htmlhint rules you would like applied to this project. *By default all rules are turned off and it is up to you to enable them.*
Example file:
```javascript
{
"tagname-lowercase": true,
"attr-lowercase": true,
"attr-value-double-quotes": true
}
```
#### `formatter` (default: a function that pretty prints any warnings and errors)
The function is called with an array of messages direct for htmlhint and must return a string.
#### `emitAs` (default: `null`)
What to emit errors and warnings as. Set to `warning` to always emit errors as warnings and `error` to always emit warnings as errors. By default the plugin will auto detect whether to emit as a warning or an error.
#### `failOnError` (default `false`)
Whether to force webpack to fail the build on a htmlhint error
#### `failOnWarning` (default `false`)
Whether to force webpack to fail the build on a htmlhint warning
#### `customRules`
Any custom rules you would like added to htmlhint. Specify as an array like so:
```javascript
module.exports = {
module: {
rules: [{
enforce: 'pre',
test: /\.html/,
loader: 'htmlhint-loader',
exclude: /node_modules/,
options: {
customRules: [{
id: 'my-rule-name',
description: 'Example description',
init: function(parser, reporter) {
//see htmlhint docs / source for what to put here
}
}]
}
}]
}
}
```
#### `rulesDir`
You can add a path to a folder containing your custom rules.
See below for the format of the rule, it is not the same as HTMLHINT - you can pass a value to a rule.
```javascript
// webpack config
module.exports = {
module: {
rules: [{
enforce: 'pre',
test: /\.html/,
loader: 'htmlhint-loader',
exclude: /node_modules/,
options: {
rulesDir: path.join(__dirname, 'rules/'),
'my-new-rule': 'this is pass to the rule (option)'
}
}]
}
}
```
```javascript
// rules/myNewRule.js
const id = 'my-new-rule';
module.exports = {
id,
rule: function(HTMLHint, option /* = 'this is pass to the rule (option)' */) {
HTMLHint.addRule({
id,
description: 'my-new-rule',
init: () => {
//see htmlhint docs / source for what to put here
}
});
}
};
```
##### `outputReport` (default: `false`)
Write the output of the errors to a file, for example a checkstyle xml file for use for reporting on Jenkins CI
The `filePath` is relative to the webpack config: output.path
The use of [name] is supported when linting multiple files.
You can pass in a different formatter for the output file, if none is passed in the default/configured formatter will be used
```javascript
module.exports = {
module: {
rules: [{
enforce: 'pre',
test: /\.html/,
loader: 'htmlhint-loader',
exclude: /node_modules/,
options: {
outputReport: {
filePath: 'checkstyle-[name].xml',
formatter(messages) {
// convert messages to a string that will be written to the file
return messagesFormattedToString;
}
}
}
}]
}
}
```
## Licence
Project initially created by [@mattlewis](https://github.com/mattlewis92) and transferred to the [HTMLHint](https://github.com/htmlhint) organization.
<a href="https://htmlhint.io"><img src="https://raw.githubusercontent.com/htmlhint/htmlhint/develop/src/img/htmlhint.png" alt="Logo HTMLHint" width="65"></a>
[MIT License](./LICENSE)
| 25.60177 | 215 | 0.634808 | eng_Latn | 0.592739 |
b502af3cb9e0db3a526749a53288eb3fbc8891b0 | 1,525 | md | Markdown | CHANGELOG.md | TommasoAmici/gatsby-source-bgg | c32fe616cbbd8af09425b88872c5b8b0ac17f9f4 | [
"MIT"
] | 1 | 2021-05-26T08:11:29.000Z | 2021-05-26T08:11:29.000Z | CHANGELOG.md | TommasoAmici/gatsby-source-bgg | c32fe616cbbd8af09425b88872c5b8b0ac17f9f4 | [
"MIT"
] | 7 | 2021-05-28T12:58:59.000Z | 2021-11-09T10:04:45.000Z | CHANGELOG.md | TommasoAmici/gatsby-source-bgg | c32fe616cbbd8af09425b88872c5b8b0ac17f9f4 | [
"MIT"
] | null | null | null | # Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [1.1.1] - 2021-10-24
### Fixed
- removed `gatsby` from direct dependencies
## [1.1.0] - 2021-10-24
### Added
- added support for Gatsby v4
- report number of nodes created and time taken when building
## [1.0.9] - 2021-06-28
### Fixed
- API may return a single object and not an array for suggested number of players poll ([#15](https://github.com/TommasoAmici/gatsby-source-bgg/issues/15))
## [1.0.8] - 2021-05-29
### Fixed
- Subsequent builds would fail unless the cache was cleaned every time between them ([#3](https://github.com/TommasoAmici/gatsby-source-bgg/issues/3))
## [1.0.7] - 2021-05-28
### Changed
- node IDs are now generated from games IDs instead of their name
## [1.0.6] - 2021-05-25
### Changed
- `&#10;` in descriptions are now replaced with newlines
### Fixed
- An error would occur if only one item was in a collection
## [1.0.5] - 2021-05-24
### Changed
- Removed `gatsby-source-filesystem` as a direct dependency, it is now a peer dependency
## [1.0.2] - 2021-05-24
### Fixed
- postinstall script to set up husky git hooks would run and fail when installing from npm registry
## [1.0.0] - 2021-05-24
### Added
- Can import any user board games collection with detailed information for every game
| 22.426471 | 155 | 0.699672 | eng_Latn | 0.987935 |
b503fd9436f433f84b0a6390a0272284de22b5d2 | 3,800 | md | Markdown | content/blog/2021-05-04t15-23-54-378z-pengertian-dan-manfaat-tidur.md | ubhe96/ntn-boilerplate | 103ade4228a4ce2ae1b163cc66b47b75d63f5f2b | [
"MIT"
] | null | null | null | content/blog/2021-05-04t15-23-54-378z-pengertian-dan-manfaat-tidur.md | ubhe96/ntn-boilerplate | 103ade4228a4ce2ae1b163cc66b47b75d63f5f2b | [
"MIT"
] | 92 | 2021-06-27T14:59:07.000Z | 2022-03-28T03:11:13.000Z | content/blog/2021-05-04t15-23-54-378z-pengertian-dan-manfaat-tidur.md | ubhe96/ntn-boilerplate | 103ade4228a4ce2ae1b163cc66b47b75d63f5f2b | [
"MIT"
] | null | null | null | ---
createdAt: 2021-05-04T15:23:54.378Z
title: Pengertian dan Manfaat Tidur
description: Pengertian dan manfaat tidur
---
Tidur menjadi istilah yang sering kita dengar yang kita katakan bahkan setiap hari. Misalnya, "Tadi malam, aku tidak bisa tidur nyenyak karena dia khawatir tentang presentasi hari ini" atau "Aku sangat mengantuk dan aku ingin tidur atau" Sepertinya aku harus membuat secangkir kopi sebelum melanjutkan pekerjaan " . Tidur, Tidur dan tidur, semua orang harus membicarakannya. Jadi, apa yang tidak mengerti tidur? Dan bagaimana maksudmu tidur nyenyak?
Arti tidur adalah perilaku fisiologis yang umumnya dilakukan oleh semua makhluk hidup, baik di semua spesies hewan maupun manusia. Bagaimana definisi tidur berdasarkan para ahli? Banyak ahli sepakat bahwa tidur adalah situasi di mana kesadaran rangsangan lingkungan berkurang. Harap dicatat bahwa [doa tidur katolik](https://bersamakristus.org/doa-tidur-katolik/) tidak sama dengan koma, hibernasi, bahkan kematian. Mengapa demikian? Memang, kondisi tidur memungkinkan individu untuk dengan cepat kembali sadar hanya tiga keadaan lainnya.
Bagaimana dengan memahami tidur yang baik? Tidur yang baik adalah suatu kondisi di mana individu menanggapi kualitas dan kuantitas tidur itu sendiri. Misalnya, orang dewasa direkomendasikan untuk tidur selama tujuh hingga delapan jam sehari.
Jika orang dewasa telah mengisi jumlah tidur yang dibutuhkan dan dalam tujuh hingga delapan jam sehari, ia benar-benar tidur nyenyak, orang yang bersangkutan merasakan tidur dengan baik dan berkualitas.
Ada beberapa langkah yang perlu kita lamar untuk tidur yang baik, bahkan lebih baik daripada tidur sebelumnya. Pertama-tama, kita harus mengalokasikan sedikit waktu bagi tubuh kita untuk menjadi lebih santai. Cobalah untuk menenangkan setidaknya satu jam sebelum tidur. Jika sebelum bekerja, coba tabungkan file dan matikan laptop atau komputer kami terlebih dahulu. Matikan TV dan objek pencahayaan lainnya yang perlu kita amankan sebelum tidur.
Jika kolega pembaca merasa lapar atau haus, makan makanan ringan atau minum teh panas sebelum tidur tidak penting! Selain itu, ada orang di mana-mana sebelum tidur, mereka selalu mandi dengan air panas sehingga tubuh mereka menjadi lebih santai dan tenang. Ada juga mereka yang telah membaca beberapa lembar membaca buku-buku seperti kanton tidur sehingga semangat mereka menjadi lebih damai, Anda juga dapat menulis atau memikirkan hal-hal positif yang terjadi dalam sehari. Intinya, lakukan hal-hal yang membuat kita bahagia, damai, santai dan tenang sebelum tidur.
Langkah kedua, kita harus mematikan semua lampu cahaya dari kamar tidur. Kita mungkin tahu beberapa kolega dewan karir suka tidur dengan lampu-lampu ruangan yang tersisa, bukan? Namun, menurut penelitian yang dilakukan oleh American Journal of Epidemiology, Light dapat mengurangi produksi hormon melatonin yang cenderung mengganggu metabolisme tubuh kita. Studi lain juga menunjukkan bahwa ketika sebuah ruangan menjadi gelap, tubuh manusia akan bekerja dengan baik saat istirahat. Ini karena tubuh manusia dirancang untuk merasa lelah ketika gelap dan bangun ketika cahaya mulai bersinar. Misalnya, sinar matahari yang mulai menyelinap ke tirai kamar kami. Dengan cara ini, matikan lampu kamar Anda, ponsel, dan barang elektronik lainnya.
Ketiga, perhatikan waktu tidur yang baik. Artinya, tidur yang berkualitas dapat dicapai ketika kita tidak tidur terlalu banyak di malam hari atau apa yang sering kita sebut istilah itu tetap terlambat. Langkah terakhir, pastikan tempat tidur atau kasur tempat tidur kami benar-benar bersih dan rapi. Ini sangat penting, kolega. Terutama jika kolega dari pembaca memiliki beberapa penyakit alergi seperti asma. Wow, kebersihan ruangan dan tempat tidur harus menjadi perhatian utama. | 190 | 740 | 0.828684 | ind_Latn | 0.985353 |
b5054c12f97d35519cd2ee5472996aba1b903151 | 3,762 | md | Markdown | README.md | takahirox/glTF-Blender-IO-materials-variants | 2080a89bfa8989aea3df898ccbee9098fa18db18 | [
"Apache-2.0"
] | 42 | 2021-03-08T08:40:53.000Z | 2022-03-28T17:53:44.000Z | README.md | takahirox/glTF-Blender-IO-materials-variants | 2080a89bfa8989aea3df898ccbee9098fa18db18 | [
"Apache-2.0"
] | 11 | 2021-03-08T13:07:20.000Z | 2022-03-22T16:57:02.000Z | README.md | takahirox/glTF-Blender-IO-materials-variants | 2080a89bfa8989aea3df898ccbee9098fa18db18 | [
"Apache-2.0"
] | 5 | 2021-03-09T09:46:54.000Z | 2021-12-28T14:58:15.000Z | # glTF-Blender-IO-materials-variants
**glTF-Blender-IO-materials-variants** is a [Blender](https://www.blender.org/) addon for [glTF `KHR_materials_variants` extension](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_variants) on top of [`glTF-Blender-IO`](https://github.com/KhronosGroup/glTF-Blender-IO) addon.
## Compatible Blender version
>= 2.93.2
## How to install
### Ensure the `glTF-Blender-IO` addon is installed and enabled
Ensure the `glTF-Blender-IO` addon is installed and enabled in your Blender because the `glTF-Blender-IO-materials_variants` addon works on top of it. You can check it by Edit -> Preferences -> Add-ons -> "glTF 2.0" in the search bar. The `glTF-Blender-IO` addon should be listed as `Import-Export: glTF 2.0 format`. It should be installed and enabled by default.
![Ensure glTF-Blender-IO is installed and enabled](https://user-images.githubusercontent.com/7637832/110406787-a41f3f80-8037-11eb-9e12-163aafd5f08e.png)
### Download the zip archived source code
Download the zip archived source code from the [Releases](https://github.com/takahirox/glTF-Blender-IO-materials-variants/releases).
![Download the zip archived source code from the Releases](https://user-images.githubusercontent.com/7637832/110403357-d29a1c00-8031-11eb-993f-d977fb3c681f.png)
### Install `glTF-Blender-IO-materials-variants` addon
Install the `glTF-Blender-IO-materials-variants` addon to your Blender via Edit -> Preferences -> Add-ons -> Install -> Select the downloaded file
![Edit -> Preferences](https://user-images.githubusercontent.com/7637832/110405180-062a7580-8035-11eb-839a-f5008a992f92.png)
![Add-ons -> Install](https://user-images.githubusercontent.com/7637832/110405413-70dbb100-8035-11eb-9860-3f4867427246.png)
![Select the downloaded file](https://user-images.githubusercontent.com/7637832/110405696-d039c100-8035-11eb-9aff-71ba105187c3.png)
### Ensure the addon is installed and enabled.
Ensure the addon is installed and enabled. You can easily find the addon by inputting "KHR_materials_variants" in the search bar.
![Ensure the addon is enabled](https://user-images.githubusercontent.com/7637832/110406566-4db20100-8037-11eb-9cf2-4a73fcf676bd.png)
## Features
The addon enables to import, export, and edit support the [glTF `KHR_materials_variants` extension](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_variants) in Blender.
## How to use
The addon adds the "Materials Variants" panel to the Object property. You can add, remove, and edit the variants (alternate) materials for an mesh object in the panel. And the addon imports the `KHR_materials_variants` extension to the panel.
![Materials Variants panel](https://user-images.githubusercontent.com/7637832/110414708-3f6ae180-8045-11eb-86f6-cbf5a2848388.png)
The addon also imports the `KHR_materials_variants` extension materials into the material slots of a mesh object.
![Import to the material slots](https://user-images.githubusercontent.com/7637832/110414597-003c9080-8045-11eb-871b-ce758886c1aa.png)
The addon exports (not only an active material but also) the variants materials, and exports the variants materials configurations as `KHR_materials_variants` extension to the exported glTF.
![Export as KHR_materials_variants extension](https://user-images.githubusercontent.com/7637832/110416635-e43aee00-8048-11eb-92b5-aa74ec41f2f9.png)
## Limitations
Currently the addon allows to set variant materials per a mesh object but it should allow it per a vertex_group of a mesh object similar to that the Blender allows to assign a material per a vertex_group of a mesh object [#4](https://github.com/takahirox/glTF-Blender-IO-materials-variants/issues/4)
| 62.7 | 364 | 0.793195 | eng_Latn | 0.756385 |
b506fe5d45ea2b68a159361d9ca232c7b19234e6 | 6,295 | md | Markdown | context/README.md | study-only/go-source-note | 3dc2f11602f9199ce782f3507169b43734d17d72 | [
"MIT"
] | null | null | null | context/README.md | study-only/go-source-note | 3dc2f11602f9199ce782f3507169b43734d17d72 | [
"MIT"
] | null | null | null | context/README.md | study-only/go-source-note | 3dc2f11602f9199ce782f3507169b43734d17d72 | [
"MIT"
] | 1 | 2020-11-11T11:19:44.000Z | 2020-11-11T11:19:44.000Z | # 上下文
## 依赖类型
- `net.Error`
```go
// An Error represents a network error.
type Error interface {
error
Timeout() bool // Is the error a timeout?
Temporary() bool // Is the error temporary?
}
```
## 变量
```go
var (
Canceled = errors.New("context canceled")
DeadlineExceeded = deadlineExceededError{} // deadlineExceededError实现了`net.Error`
background = new(emptyCtx) // emptyCtx实现了`Context`
todo = new(emptyCtx)
)
```
## 类型
```go
// 上下文
type Context interface {
// 上下文超时信息。
//
// 上下文未设置结束时间时返回`ok`=false
Deadline() (deadline time.Time, ok bool)
// 上下文管道(用于标识是否结束)。
//
// 如果该上下文不可被取消,返回`nil`
Done() <-chan struct{}
// 上下文结束原因
//
// 如果上下文未结束,返回nil。
// 如果上下文结束,返回非空error(`Canceled`/`DeadlineExceeded`)
Err() error
// 获取上下文变量(使用`context.WithValue`带上)。
Value(key interface{}) interface{}
}
// 上下文取消函数
//
// 调用`CancelFunc`将取消所有子上下文,将自己从父上下文中移除,并停止关联计时器。
// 取消失败将导致子上下午泄漏,指导父上下文或计时器到期。
type CancelFunc func()
```
## 函数
- `Backgroud() Context`
返回不可取消上下文`background`
- `TODO() Context`
返回不可取消上下文`todo`
- `WithCancel(parent Context) (ctx Context, cancel CancelFunc)`
复制父上下,并生成一个可取消的上下文。该上下文当父上下文结束,或`CancelFunc`被执行时被取消。
- `WithDeadline(parent Context, d time.Time) (Context, CancelFunc)`
复制父上下,并生成一个可带截止时间的上下文。该上下文当父上下文结束,`CancelFunc`被执行或到期时被取消。
- `WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc)`
复制父上下,并生成一个可带超时时间的上下文。该上下文当父上下文结束,或`CancelFunc`被执行或超时时被取消。
- `WithValue(parent Context, key, val interface{}) Context`
复制父上下,并生成一个可带参数的上下文。
`key`参数不应当使用任何基本类型,以避免冲突。而应当使用用户自己的类型。
## 源码解读
### `WithCancel`上下文实现
```go
// 绑定子上下文的取消到父上下文
func propagateCancel(parent Context, child canceler) {
done := parent.Done()
if done == nil {
return // 父上下文永远不会被取消,无需绑定
}
select {
case <-done:
// 父上下文已经取消,无需绑定
child.cancel(false, parent.Err())
return
default:
}
if p, ok := parentCancelCtx(parent); ok {
// 获取到父上下文的`*cancelCtx`。 通过给父上下文添加子上下文的方式,实现绑定。
// `*cancelCtx`在关闭时,会同时取消子上下文。
p.mu.Lock()
if p.err != nil {
// 父上下文已经取消,取消子上下文
child.cancel(false, p.err)
} else {
if p.children == nil {
p.children = make(map[canceler]struct{})
}
p.children[child] = struct{}{}
}
p.mu.Unlock()
} else {
// 如果父上下文无`*cancelCtx`,使用协程方式实现绑定监听`
// 当父上下文被取消后,取消子上下文。
atomic.AddInt32(&goroutines, +1)
go func() {
select {
case <-parent.Done():
child.cancel(false, parent.Err())
case <-child.Done():
}
}()
}
}
// 获取父上下文的`*cancelCtx`
func parentCancelCtx(parent Context) (*cancelCtx, bool) {
done := parent.Done()
if done == closedchan || done == nil {
// 如果已经取消,或者永远不会被取消,返回错误。
return nil, false
}
p, ok := parent.Value(&cancelCtxKey).(*cancelCtx)
if !ok {
// 如果不存在`*cancelCtx`返回错误
return nil, false
}
p.mu.Lock()
ok = p.done == done // 判断parent.Done()是否被封装过。
p.mu.Unlock()
if !ok {
// 如果`parent.Done()`已经被封装过(使用不同的`done`管道),返回错误
return nil, false
}
return p, true
}
// 将子上下文从从父上下文移除
func removeChild(parent Context, child canceler) {
p, ok := parentCancelCtx(parent)
if !ok {
return
}
p.mu.Lock()
if p.children != nil {
delete(p.children, child)
}
p.mu.Unlock()
}
// 当自身被取消,将同时取消所有子上下文
type cancelCtx struct {
Context
mu sync.Mutex // 保护以下字段
done chan struct{} // 延迟赋值,由第一次取消关闭
children map[canceler]struct{} // 第一次取消后,设置为nil
err error // 第一次取消后,设置为非空
}
// 关闭`c.done`,取消所有子上下文,而且如果`removeFromParent`为真,将自己从父上下文移除。
func (c *cancelCtx) cancel(removeFromParent bool, err error) {
if err == nil {
panic("context: internal error: missing cancel error")
}
c.mu.Lock()
if c.err != nil {
c.mu.Unlock()
return // 已经被取消
}
// 设置`c.err`及`c.done`
c.err = err
if c.done == nil {
c.done = closedchan
} else {
close(c.done)
}
// 取消所有子上下文
for child := range c.children {
// NOTE: acquiring the child's lock while holding parent's lock.
child.cancel(false, err)
}
c.children = nil
c.mu.Unlock()
if removeFromParent {
// 将自身从父上下文移除
removeChild(c.Context, c)
}
}
```
## `WithDeadline`上下文实现
```go
func WithDeadline(parent Context, d time.Time) (Context, CancelFunc) {
if cur, ok := parent.Deadline(); ok && cur.Before(d) {
// 已经到期
return WithCancel(parent)
}
c := &timerCtx{
cancelCtx: newCancelCtx(parent),
deadline: d,
}
// 绑定到父上下文
propagateCancel(parent, c)
dur := time.Until(d)
if dur <= 0 {
// 已过期,取消
c.cancel(true, DeadlineExceeded)
return c, func() { c.cancel(false, Canceled) }
}
c.mu.Lock()
defer c.mu.Unlock()
if c.err == nil {
// 使用定时器定时取消
c.timer = time.AfterFunc(dur, func() {
c.cancel(true, DeadlineExceeded)
})
}
return c, func() { c.cancel(true, Canceled) }
}
type timerCtx struct {
cancelCtx
timer *time.Timer // Under cancelCtx.mu.
deadline time.Time
}
func (c *timerCtx) cancel(removeFromParent bool, err error) {
// 取消父上下文
c.cancelCtx.cancel(false, err)
if removeFromParent {
// 将自己从父上下文的子上下文列表中移除
removeChild(c.cancelCtx.Context, c)
}
c.mu.Lock()
if c.timer != nil {
// 关闭定时器
c.timer.Stop()
c.timer = nil
}
c.mu.Unlock()
}
```
## `WithValue`上下文实现
```go
func WithValue(parent Context, key, val interface{}) Context {
if key == nil {
panic("nil key")
}
if !reflectlite.TypeOf(key).Comparable() {
panic("key is not comparable")
}
return &valueCtx{parent, key, val}
}
type valueCtx struct {
Context
key, val interface{}
}
func (c *valueCtx) Value(key interface{}) interface{} {
if c.key == key {
// 如果`key`相等,返回上下文
return c.val
}
// 尝试从父上下文获取
return c.Context.Value(key)
}
``` | 21.195286 | 88 | 0.573789 | yue_Hant | 0.426131 |
b507fc87861754a714bcfa7a36d947e63f702852 | 69 | md | Markdown | README.md | Pr-uz/SymbolSelect-master | d27f0505636eacbd134a26bafe41901c1b2fce4a | [
"MIT"
] | null | null | null | README.md | Pr-uz/SymbolSelect-master | d27f0505636eacbd134a26bafe41901c1b2fce4a | [
"MIT"
] | null | null | null | README.md | Pr-uz/SymbolSelect-master | d27f0505636eacbd134a26bafe41901c1b2fce4a | [
"MIT"
] | null | null | null | Symbol Select regular module for KTaNE
An original idea by Pruz. :D
| 17.25 | 38 | 0.782609 | eng_Latn | 0.609545 |
b508dce01cd59558708f6fd9d0910545dd1012a6 | 764 | md | Markdown | README.md | gfjalar/fiftytwo | e4d91157ddeaa2f8b28dfa41e9325fef03f6c67b | [
"MIT"
] | null | null | null | README.md | gfjalar/fiftytwo | e4d91157ddeaa2f8b28dfa41e9325fef03f6c67b | [
"MIT"
] | null | null | null | README.md | gfjalar/fiftytwo | e4d91157ddeaa2f8b28dfa41e9325fef03f6c67b | [
"MIT"
] | null | null | null | # fiftytwo[[52](http://piotrgalar.com/fiftytwo)]
Fiftytwo is a tuner using WebAudio API for audio manipulation and ReactJS for
the view. It implements Philip McLeod's MPM algorithm for pitch
detection. It is being used and tested mainly with guitar and ukulele.
### 52
The tuner was named after
['the world's loneliest whale'](http://en.wikipedia.org/wiki/52-hertz_whale)
which calls at a very unusual frequency of 52Hz.
### MPM
Special thanks to Philip McLeod for
[a smarter way to detect pitch](http://miracle.otago.ac.nz/tartini/papers/A_Smarter_Way_to_Find_Pitch.pdf).
### TODO
* use FFT to speed up the pitch detection
* tune config(cutoffs etc.) for more acurate results
* allow in-browser config manipulation
* add info box for denied microphone access
| 36.380952 | 107 | 0.776178 | eng_Latn | 0.978025 |
b5091b899c257fc8bbe548dd15409cf8318963a0 | 2,154 | md | Markdown | docs/index.md | An-nym-us/Gunderson-Resume | b3a61b6d78a3cdb2cede2c52936e8e5be003fe28 | [
"MIT"
] | null | null | null | docs/index.md | An-nym-us/Gunderson-Resume | b3a61b6d78a3cdb2cede2c52936e8e5be003fe28 | [
"MIT"
] | null | null | null | docs/index.md | An-nym-us/Gunderson-Resume | b3a61b6d78a3cdb2cede2c52936e8e5be003fe28 | [
"MIT"
] | null | null | null | ---
layout: cv
title: Gunderson Resume
---
# Jonathan Gunderson
<div id="webaddress">
<a href="https://jonathangunderson290148457.wordpress.com/">Personal Website</a>
| <a href="https://www.linkedin.com/in/jonathan-gunderson-005208194/">LinkedIn</a>
| <a href="https://github.com/An-nym-us?tab=repositories">GitHub</a>
</div>
## Skills, Certificates, Software Experience
- Proficient Programing languages- C++, Python, SQL
- Limited Experience languages- JavaScript, Clojure, Excel VBA
- Epic Games, Unreal Engine 3D Game Engine (C++ and Blueprints)
- Systems Solid Works 3D CAD (Professional Level Certificate)
- Autodesk Inventor 3D CAD Softw
###
## Higher Education
_Dates of Attendance:_ '2019-2023'
- Brigham Young University Idaho, Rexburg, ID
- Assigned Major - Software Engineering
## Lower Education and Awards
_Sun Prairie High School Sun Prairie, WI:_ '2014 - 2017'
##### Graduated student, 3.72GPA
## School Positions & Awards
- Lead Mechanical & Electrical Engineer for the Formula High School Race Team
- Acquired Eagle Scout Rank from The Boy Scouts of America
- Obtained the Martin Luther King Jr. Academic award
- Earned Additional Educational Scholarships
##
## Experience
###
## Proselyting Missionary & Technology Specialist
_The Church of Jesus Christ of Latter-day Saints:_ '2017 - 2019'
__Chicago, IL & Des Moines, IA__
#### Duties
- Door to door proselyting
- Perform reoccurring trainings for large audiences
- 24/7 tech-support for 130+ full-time proselyting missionaries
- Develop resources guides on how to utilize cellular devices and church developed applications
###
## Tack Welder & Metal Finisher
_Robbins Manufacturing:_ 'July of 2017'
__Fall River, WI__
#### Duties
- Assemble fabricated products and apply temporary welds
- Finalize metal products before entering the painting process
###
### IT Specialist
_Sun Prairie Area School District:_ 'June of 2016 (Summer Job)'
___Sun Prairie, WI___
#### Duties-
- Install, and Repair Computer Systems and Laptop
- Organize, Catalog, Large inventories of Laptops to all students of the Sun Prairie School District
<!-- ### Footer
Last updated: May 2013 -->
| 29.108108 | 100 | 0.756267 | eng_Latn | 0.80706 |
b50adc5bc4793ef96ba1861b77047b389322bea4 | 4,311 | md | Markdown | content/en/pages/2000-stakes-social/how-to-onboard-polygon.md | dev-protocol/docs.devprotocol.xyz_ | 362dacfd0d6aeb56bfcecab7402c33e7196d6a15 | [
"MIT"
] | 2 | 2021-07-25T16:34:17.000Z | 2021-10-22T00:23:12.000Z | content/en/pages/2000-stakes-social/how-to-onboard-polygon.md | dev-protocol/docs.devprotocol.xyz_ | 362dacfd0d6aeb56bfcecab7402c33e7196d6a15 | [
"MIT"
] | 35 | 2021-06-09T02:18:11.000Z | 2022-03-16T14:37:24.000Z | content/en/pages/2000-stakes-social/how-to-onboard-polygon.md | dev-protocol/docs.devprotocol.xyz_ | 362dacfd0d6aeb56bfcecab7402c33e7196d6a15 | [
"MIT"
] | 14 | 2021-07-04T18:22:03.000Z | 2022-02-11T09:17:53.000Z | ---
title: How to Onboard Polygon's Dev Protocol
date: 2021-11-02
permalink: /{{ locale }}/stakes-social/onboard-guide-polygon/index.html
eleventyNavigation:
key: Onboard Guide Polygon
parent: stakes-social
order: 2800
title: Onboard Guide Polygon
---
## What is Polygon
Launched in 2017 originally as Matic network as an universal blockchain scaling solution, then it was rebranded in early 2021 as Polygon, focusing on being a scaling solution for Ethereum. Since it’s rebranding and change of focus, it has had tremendous success, with solid projects like Uniswap, Aave, OpenSea and upcoming games like Aavegotchi running on the Polygon network.
With the increasing gas fees on Ethereum mainnet, users and developers started looking to find a robust scaling solution. Polygon has been adopted by many, mainly because of its advantages over Ethereum mainnet, being significantly cheaper and faster.
Note1: Even today Matic and Polygon are sometimes used interchangeably, so don’t get confused when you see it.
Note2: MATIC is the token that pays for the gas fees on the Polygon network, so please have some MATIC in your wallet at all times on the Polygon network to pay for all the transactions.
## Add Polygon Network to your Wallet
You will need to add Polygon network to your favorite wallet. The easiest way to do it is to go to
Chainlist and type in “Polygon”, connect your wallet to “Polygon Mainnet”, make sure the chainID is 137.
If you don’t want to go through the Chainlist route you can also add it manually in your wallet. To do that, open your wallet and click on the Network selection button at the top.
![Image 1](/content/{{ locale }}/images/stakes.social/polygon-guide/image1.png)
Click on ‘Custom RPC’ at the end of the list. This will open the page below, which will allow you to add the Polygon (MATIC) network to your wallet. Just enter all the details as it is in this image and you will be good to go.
![Image 2](/content/{{ locale }}/images/stakes.social/polygon-guide/image2.png)
## Using the Polygon bridge
Go to the Polygon Bridge, connect your wallet, then you will be able to send tokens from the Ethereum mainnet to the Polygon network.
https://wallet.polygon.technology/bridge
![Image 3](/content/{{ locale }}/images/stakes.social/polygon-guide/image3.png)
Just type in the amount of tokens that you want to send to the Polygon network and click on Transfer to do so.
Note: remember that gas fees on the Polygon network are paid with MATIC.
There is a YouTube guide if you still don’t feel comfortable transferring assets between chains:
https://www.youtube.com/playlist?list=PLslsfan1R_z0Epvnqsj29V1LBAh99dzu9
Make sure you get some MATIC for the onboarding fee costs, it shouldn’t be too much since Polygon is very cheap compared to the Ethereum mainnet.
## Onboarding
Go to stakes.social, remember to change your network to Polygon, you can do that directly through your wallet or by clicking on the three dots menu on the top right corner of the page.
![Image 4](/content/{{ locale }}/images/stakes.social/polygon-guide/image4.png)
By clicking on the menu, you will be able to check in what network you are connected to and be able to select another one and change it.
![Image 5](/content/{{ locale }}/images/stakes.social/polygon-guide/image5.PNG)
Now on the same menu, click on the Create button (1) , you will be redirected to the Create an Asset page (2) where you will be asked to submit an application. Fill in the forms (3) and submit, after that, you will be asked to approve it with the signature button and your application will be completed.
![Image 6](/content/{{ locale }}/images/stakes.social/polygon-guide/image6.png)
If you already have a project onboarded on any other network please do the process again for the Polygon network.
## Screening Process
We kindly ask for a week for the team to evaluate the project on the screening process. We will let you know the results via e-mail so please change the filtering setup for your mailbox to receive an email from “@devprotocol.xyz”.
If you have any questions, please follow the onboarding guide below, or contact us on Discord.
https://docs.devprotocol.xyz/en/stakes-social/onboard-guide/
| 56.723684 | 378 | 0.764092 | eng_Latn | 0.996171 |
b50af2429f61b6ba22fd78306e8313b6e8743aa1 | 10 | md | Markdown | README.md | ramyaed/Sgdv | 8b18eb133226e89faa8a4e917f05e5dc88b82451 | [
"Apache-2.0"
] | null | null | null | README.md | ramyaed/Sgdv | 8b18eb133226e89faa8a4e917f05e5dc88b82451 | [
"Apache-2.0"
] | null | null | null | README.md | ramyaed/Sgdv | 8b18eb133226e89faa8a4e917f05e5dc88b82451 | [
"Apache-2.0"
] | null | null | null | # Sgdv
Gs
| 3.333333 | 6 | 0.6 | swe_Latn | 0.469999 |
b50b31cc6d84475922f1828bec6b1c593419fcfc | 260 | md | Markdown | docs/README.md | hyoo/p3_web | 183a9bc96f8f3b6341851f70e895cc1667a4fe59 | [
"MIT"
] | 5 | 2017-09-18T19:35:48.000Z | 2018-08-02T14:50:55.000Z | docs/README.md | hyoo/p3_web | 183a9bc96f8f3b6341851f70e895cc1667a4fe59 | [
"MIT"
] | 99 | 2016-05-04T17:10:08.000Z | 2021-09-01T02:18:17.000Z | docs/README.md | hyoo/p3_web | 183a9bc96f8f3b6341851f70e895cc1667a4fe59 | [
"MIT"
] | 22 | 2016-04-20T20:36:29.000Z | 2020-04-30T01:05:47.000Z | # UI Development Documentation
###### Table of Contents
- [Contributing Code (new developers)](https://github.com/PATRIC3/p3_web/blob/master/CONTRIBUTING.md)
- [Adding/Updating SVG Icons](https://github.com/PATRIC3/p3_web/blob/master/docs/adding-icons.md)
| 28.888889 | 101 | 0.757692 | yue_Hant | 0.78182 |
b50bbd4d33cc87cbae8734ca0b583d320b7a533e | 1,145 | md | Markdown | DownloadTileCacheSample/README.md | alpascual/arcgis-runtime-samples-ios | 9df191515499db3eb4f3a2164001bbd5ff5f0e23 | [
"Apache-2.0"
] | 1 | 2017-07-14T09:24:49.000Z | 2017-07-14T09:24:49.000Z | DownloadTileCacheSample/README.md | alpascual/arcgis-runtime-samples-ios | 9df191515499db3eb4f3a2164001bbd5ff5f0e23 | [
"Apache-2.0"
] | null | null | null | DownloadTileCacheSample/README.md | alpascual/arcgis-runtime-samples-ios | 9df191515499db3eb4f3a2164001bbd5ff5f0e23 | [
"Apache-2.0"
] | null | null | null | ##Download Tile Cache Sample
This sample shows how to extract a tile package for offline use from a supporting ArcGIS map service. This sample uses a [modified World Street Map service](http://sampleserver6.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer) containing only a few scale levels for demo purposes. If you have subscription to ArcGIS online, you can download tiles from ArcGIS Online Basemaps on [tiledbasemaps.arcgis.com](http://tiledbasemaps.arcgis.com)
![Initial Scene](image.png "Initial Scene")
![](image2.png)
![](image3.png)
###Using the sample
1. Zoom into an area for which you want to download tiles.
2. Specify how many scale levels you want to download by tapping on the **+** button. You will see details about the scale range selected based on the number of levels you specify. The range starts from the map's current scale and can potentially go up to the maximum allowed by the layer.
3. Tap on the **Estimate** to get an estimate of how large the cache might be.
4. Tap on the **Download** button to download the tiles. When the download completes the tile cache will be loaded in the map.
| 67.352941 | 455 | 0.774672 | eng_Latn | 0.993198 |
b50bc3f4aa4c6d5817c9088344b52f12869d0898 | 488 | md | Markdown | changelog.md | uu-cubitt/graph | 38a55dc839a92b68b1757f6e267ef64aa0f44ac7 | [
"FTL",
"RSA-MD"
] | 1 | 2017-04-16T21:33:41.000Z | 2017-04-16T21:33:41.000Z | changelog.md | uu-cubitt/graph | 38a55dc839a92b68b1757f6e267ef64aa0f44ac7 | [
"FTL",
"RSA-MD"
] | 2 | 2016-01-30T21:25:14.000Z | 2016-04-30T07:20:54.000Z | changelog.md | uu-cubitt/graph | 38a55dc839a92b68b1757f6e267ef64aa0f44ac7 | [
"FTL",
"RSA-MD"
] | null | null | null | # Changelog
# 1.0.2
- Updated documentation
# 1.0.1
- Updated common dependency
## 1.0.0
- Support for Hierarchical graphs [(Issue #1)](https://github.com/uu-cubitt/graph/issues/1)
- Switched to scenario based tests
- Updated to typescript 1.8.9
- Switched from (deprecated) TSD to Typings
- Implemented Travis CI
- Use tslint
## 0.6.1
- Fixed typo in package.json
## 0.6.0
- Rename ```fromJSON``` to ```deserialize```
- Rename ```toJSON``` to ```serialize```
## 0.5.0
- Initial setup
| 23.238095 | 91 | 0.684426 | eng_Latn | 0.776279 |
b50c240e0779671c5a2b1986f8fcbc52b705f745 | 879 | md | Markdown | README.md | GasparVardanyan/gcrypt | 5fd2ceb9b1de3fb4473a3075d11b353ab2231af8 | [
"MIT"
] | 2 | 2020-02-13T01:47:54.000Z | 2020-02-13T01:48:00.000Z | README.md | GasparVardanyan/gcrypt | 5fd2ceb9b1de3fb4473a3075d11b353ab2231af8 | [
"MIT"
] | null | null | null | README.md | GasparVardanyan/gcrypt | 5fd2ceb9b1de3fb4473a3075d11b353ab2231af8 | [
"MIT"
] | 1 | 2021-04-26T18:03:33.000Z | 2021-04-26T18:03:33.000Z | _
/ /
____________ _ _ / /
/ ____/ ____/____/ / / /___ / /____________________
/ / __/ / / ___/ / / / __ \/ _______Gaspar's cryptographic
/ /_/ / /___/ / / /_/ / /_/ / /_ tool.
\____/\____/ / \__, / .___/\__/
/ / / / / _____________________________________________
/_/ ___/ / / https://github.com/GasparVardanyan/gcrypt
/____/_/ _____ _________
___ \ / /__ '___
51mP13, 53cUR3, \ V / |_ \
p3rf0rM4nc3 \ / | _/
/ / | |
| |
/|\ BlackArch Linux /|\
https://www.blackarch.org/crypto.html
| 46.263158 | 74 | 0.331058 | yue_Hant | 0.996985 |
b50c45d128a0576e98b7e3536798ba8f191031ac | 2,162 | md | Markdown | docs/framework/wcf/samples/ws-binding.md | lucieva/docs.cs-cz | a688d6511d24a48fe53a201e160e9581f2effbf4 | [
"CC-BY-4.0",
"MIT"
] | 1 | 2018-12-19T17:04:23.000Z | 2018-12-19T17:04:23.000Z | docs/framework/wcf/samples/ws-binding.md | lucieva/docs.cs-cz | a688d6511d24a48fe53a201e160e9581f2effbf4 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | docs/framework/wcf/samples/ws-binding.md | lucieva/docs.cs-cz | a688d6511d24a48fe53a201e160e9581f2effbf4 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | ---
title: Vazby WS
ms.date: 03/30/2017
ms.assetid: 629945b2-d771-46d7-a87b-5df3b2e460da
ms.openlocfilehash: 11480b91c6ac6a5501029dfdf10cd81d3fa18820
ms.sourcegitcommit: 15109844229ade1c6449f48f3834db1b26907824
ms.translationtype: MT
ms.contentlocale: cs-CZ
ms.lasthandoff: 05/07/2018
ms.locfileid: "33804911"
---
# <a name="ws-binding"></a>Vazby WS
Tato část obsahuje příklady vysvětlující vazby služby systému Windows ve Windows Communication Foundation (WCF).
## <a name="in-this-section"></a>V tomto oddílu
[Tok transakcí WS](../../../../docs/framework/wcf/samples/ws-transaction-flow.md)
Demonstruje použití transakce koordinované klienta a nastavení klienta a serveru pro protokol WS-Atomic Transactions nebo OleTransactions toku transakcí.
[Vazba protokolu HTTP při federaci WS 2007](../../../../docs/framework/wcf/samples/ws-2007-federation-http-binding.md)
Demonstruje použití <xref:System.ServiceModel.WS2007FederationHttpBinding>.
[WS Dual Http](../../../../docs/framework/wcf/samples/ws-dual-http.md)
Ukazuje, jak nakonfigurovat `WSDualHttpBinding` vazby.
[Kódování MTOM](../../../../docs/framework/wcf/samples/mtom-encoding.md)
Demonstruje použití kódování s WSHttpBinding zprávy zpráva přenosu optimalizace mechanismus (MTOM).
[WSHttpBinding](../../../../docs/framework/wcf/samples/wshttpbinding.md)
Ukazuje, jak implementovat typické služby a typické klienta pomocí WCF.
[Spolehlivá relace WS](../../../../docs/framework/wcf/samples/ws-reliable-session.md)
Demonstruje použití spolehlivé relace.
[Zabezpečení přenosu WS](../../../../docs/framework/wcf/samples/ws-transport-security.md)
Demonstruje použití protokolu SSL zabezpečení přenosu s <xref:System.ServiceModel.WSHttpBinding> vazby.
[Vazby zabezpečení zpráv](../../../../docs/framework/wcf/samples/message-security-binding.md)
Ukazuje použití zabezpečení zpráv ve WCF.
[Přenos WS s přihlašovacími údaji zprávy](../../../../docs/framework/wcf/samples/ws-transport-with-message-credential.md)
Tento příklad znázorňuje použití přenosu zabezpečení SSL v kombinaci s pověření klienta provádí ve zprávě.
| 51.47619 | 156 | 0.749769 | ces_Latn | 0.984405 |
b50ceadfdb3c471f2b2fa3f3a29143543c31b12e | 792 | md | Markdown | content/featured/Haywire/index.md | Jventoo/Portfolio | 16d5de0b1c813e6ea22b8268dce37fc65910a329 | [
"MIT"
] | null | null | null | content/featured/Haywire/index.md | Jventoo/Portfolio | 16d5de0b1c813e6ea22b8268dce37fc65910a329 | [
"MIT"
] | null | null | null | content/featured/Haywire/index.md | Jventoo/Portfolio | 16d5de0b1c813e6ea22b8268dce37fc65910a329 | [
"MIT"
] | null | null | null | ---
date: '3'
title: 'Haywire'
cover:
github: 'https://drive.google.com/file/d/1rwOtVybU68o4uXnEKV75pfpOh8FDyy1R/view?usp=sharing'
external: 'https://www.artstation.com/artwork/VgzJBZ'
videoSourceURL: https://www.youtube.com/embed/OqQskd0We78
videoTitle: 'Haywire Finale'
tech:
- C++
- Blueprints
- Unreal Engine 4
showInProjects: true
---
Haywire was my science fiction atmospheric horror submission for the 2020 Moon Jam. <a href="https://drive.google.com/file/d/1rwOtVybU68o4uXnEKV75pfpOh8FDyy1R/view?usp=sharing">Demo available here</a>
Responsive yet restrictive player interactions, scripted and diverse sound cues, carefully crafted lighting, and frightening enemies leave the player consistently on edge throughout the experience but never feeling unjustly punished or lost.
| 44 | 241 | 0.792929 | eng_Latn | 0.789239 |
b50dcc2282174b2d6959a47aa4cb23144ba484d4 | 9,406 | md | Markdown | articles/finance/general-ledger/electronic-messaging-work-with-em.md | MicrosoftDocs/Dynamics-365-Operations.tr-tr | 60fbe90cb8d4cfcd775d48c394e827a7795cfe27 | [
"CC-BY-4.0",
"MIT"
] | 4 | 2020-05-18T17:15:00.000Z | 2022-03-02T03:46:26.000Z | articles/finance/general-ledger/electronic-messaging-work-with-em.md | MicrosoftDocs/Dynamics-365-Operations.tr-tr | 60fbe90cb8d4cfcd775d48c394e827a7795cfe27 | [
"CC-BY-4.0",
"MIT"
] | 8 | 2017-12-08T15:55:56.000Z | 2019-04-30T11:46:11.000Z | articles/finance/general-ledger/electronic-messaging-work-with-em.md | MicrosoftDocs/Dynamics-365-Operations.tr-tr | 60fbe90cb8d4cfcd775d48c394e827a7795cfe27 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | ---
title: Elektronik mesajlar işlevselliği ile çalışmak
description: Bu konu, Elektronik iletiler (EM) işlevinin nasıl kullanılacağı hakkında bilgi sağlar.
author: liza-golub
ms.date: 07/07/2021
ms.topic: article
ms.prod: ''
ms.technology: ''
audience: Application User
ms.reviewer: ''
ms.search.region: Global
ms.author: elgolu
ms.search.validFrom: 2021-06-24
ms.dyn365.ops.version: 10.0.21
ms.openlocfilehash: 8fd2301808f7eaec2ea9c01a66f030f527f461a36b3cb8aabddcfbf414f06d2a
ms.sourcegitcommit: 42fe9790ddf0bdad911544deaa82123a396712fb
ms.translationtype: HT
ms.contentlocale: tr-TR
ms.lasthandoff: 08/05/2021
ms.locfileid: "6779920"
---
# <a name="work-with-the-electronic-messages-functionality"></a>Elektronik mesajlar işlevselliği ile çalışmak
[!include [banner](../includes/banner.md)]
Mesaj düzeyinde çalışıyorsanız, **Elektronik mesajlar** sayfası (**Vergi** \> **Sorgular ve raporlar** \> **Elektronik mesajlar** \> **Elektronik mesajlar**) daha yararlıdır. Veri koleksiyonu veya ileti öğesi düzeyinde çalışıyorsanız **Elektronik mesaj öğeleri** sayfası (**Vergi** \> **Sorgular ve raporlar** \> **Elektronik iletiler** \> **Elektronik ileti öğeleri**) daha yararlıdır.
## <a name="electronic-messages"></a>Elektronik iletiler
**Elektronik mesajlar** sayfası, rolünüze dayalı olarak kullanabileceğiniz işlemleri sunar. Güvenlik rolleri bu işlemenin kurulumundaki işlemler ile ilişkilendirilmiştir. Kullanabileceğiniz her işleme için sayfa size bunlarla ilişkili elektronik mesajlar ve bilgiler gösterir.
**Mesajlar** FastTab'i, seçilen işleme için elektronik mesajlar gösterir. Seçilen mesajın ve önceden tanımlanmış işlemenin durumuna bağlı olarak, kılavuzun üstündeki düğmeleri kullanarak bazı eylemleri gerçekleştirebilirsiniz:
- **Yeni** - Bu düğme, **Mesaj oluştur** türünün eylemleri ile ilişkilendirilmiştir.
- **Sil** - Bu düğme, **Silmeye izin ver** onay kutusu seçili mesajın geçerli durumu için seçiliyse kullanılabilir olur.
- **Veri topla** - Bu düğme, **Kayıtları doldur** türü eylemleriyle ilişkilendirilmiştir.
- **Rapor oluştur** - Bu düğme, **Elektronik raporlama dışa aktarma mesajı** nın eylemleri ile ilişkilendirilmiştir.
- **Rapor gönder** - Bu düğme, **Web hizmeti** türünün eylemleri ile ilişkilendirilmiştir.
- **Yanıt içe aktar** - Bu düğme, **Elektronik raporlama içe aktarma** türünün eylemleriyle ilişkilendirilmiştir.
- **Güncelleştirme durumu** - Bu düğme, **Mesaj düzeyi kullanıcı işleme** türünün eylemleri ile ilişkilendirilmiştir.
- **Mesaj öğeleri** - **Elektronik mesaj öğeleri** sayfasını açın.
**Eylem günlüğü** FastTab'i, seçilen mesaj için yürütülmüş olan tüm eylemler hakkında bilgileri gösterir. Bir eylem bir hataya sebep olursa, hata hakkındaki bilgi kılavuzdaki ilgili satıra eklenir. Hata hakkındaki bilgiyi görüntülemek için kılavuzdaki satırı seçin ve sonra sayfanın sağ üst köşesindeki **Ek** düğmesini seçin (ataş simgesi).
**Mesaj ek alanları** FastTab'i işleme kurulumunda mesajlar için tanımlanmış tüm ek alanları gösterir. Hızlı sekme ayrıca bu ek alanların değerlerini de gösterir.
**Mesaj öğeleri** FastTab'i, seçilen mesaj ile ilişkili tüm mesaj öğelerini gösterir. Seçilen mesajın öğesinin durumuna bağlı olarak, kılavuzun üstündeki düğmeleri kullanarak bazı eylemleri gerçekleştirebilirsiniz:
- **Sil** - Bu düğme, **Silmeye izin ver** onay kutusu seçili mesaj öğesinin geçerli durumu için seçiliyse kullanılabilir olur.
- **Güncelleştirme durumu** - Bu düğme, **Kullanıcı işleme** türünün eylemleri ile ilişkilendirilmiştir.
- **Orijinal belge** - Seçilen mesaj öğesi için orijinal belgeyi gösteren bir sayfa açın.
Bir ileti için halihazırda oluşturulan ve alınan raporlar bu iletiye eklenmiştir. Hata hakkındaki ekleri görüntülemek için iletiyi seçin ve sonra sayfanın sağ üst köşesinde bulunan **Ek** düğmesini seçin (ataş simgesi).
![Ek düğmesi](media/attachment-icon.png)
**Ekler** sayfası, seçilen mesaj ile ilişkili tüm ekleri gösterir. Bir dosyayı görüntülemek için soldaki listeden seçin ve sonra Eylem Panosunda **Aç** öğesini seçin.
![Aç düğmesi](media/open-button.png)
Bir mesaj için önceden çalıştırılmış belirli bir eylemle ilişkili ekleri gözden geçirebilirsiniz. **Elektronik iletiler** sayfasında, **İletiler** hızlı sekmesinde iletiyi seçin. **Eylem günlüğü** hızlı sekmesinde, eylemi seçin ve sonra sayfanın sağ üst köşesinde **Ek** düğmesini (ataş simgesi) seçin.
Tüm işlemi veya belirli bir eylemi Eylem Panosunda **İşlemeyi yürüt** seçeneğini işaretleyerek çalıştırabilirsiniz.
## <a name="electronic-message-items"></a>Elektronik ileti maddeleri
**Elektronik ileti öğeleri** sayfası, tüm ileti öğelerini ve her bir ileti öğesi için çalıştırılmış eylemleri sunar. Ayrıca, sayfa ileti öğeleri için tanımlanmış ek alanları ve bu ek alanların değerlerini de gösterir.
Aşağıdaki tablo, **Mesaj öğeleri** sekmesindeki alnları açıklar.
<table>
<thead>
<tr>
<th>Alan</th>
<th>Tanım</th>
</tr>
</thead>
<tbody>
<tr>
<td>İşleniyor</td>
<td>Mesaj öğesini oluşturmak için kullanılmış olan işlemin adı.</td>
</tr>
<tr>
<td>İleti maddesi</td>
<td>Mesaj öğesinin kimlik kodu. Bu kimlik kodu otomatik olarak, <b>Genel muhasebe parametreleri</b> sayfasında tanımlanmış olan <b>İleti öğesi</b> numara serisine göre atanır.</td>
</tr>
<tr>
<td>İleti maddesi tarihi</td>
<td>Mesaj öğesinin oluşturulduğu tarih.</td>
</tr>
<tr>
<td>İleti maddesi türü</td>
<td>Mesaj öğesinin türü. Çeşitli mesaj öğesi türleri aynı işlem için ayarlanabilir (örneğin, <b>Gelen faturalar</b> ve <b>Giden faturalar</b>). Bu alan bir fatura İleti öğeleri tablosuna bir fatura eklendiğinde otomatik olarak ayarlanabilir.</td>
</tr>
<tr>
<td>İleti maddesi durumu</td>
<td><p>Mesaj öğesinin gerçek durumu. Kullanılabilir durumlar, mesaj öğesinin türüne göre farklılık gösterir. Burada bazı örnekler verilmiştir:</p>
<ul>
<li><b>Doldurulan</b> - Bir kayıt Mesaj öğeleri tablosuna eklendi.</li>
<li><b>Değerlendirilen</b> - Ek öznitelikler mesaj öğesi için hesaplandı.</li>
<li><b>Bildirilen</b> - Mesaj öğesi rapora başarıyla eklendi.</li>
<li><b>Dışarıda bırakılan</b> - Bu durum bazı ileti öğelerini rapor dışa aktarılmadan önce dışarıda bırakmanız gerektiğinde faydalı olabilir.</li>
</ul>
</td>
</tr>
<tr>
<td>İletim tarihi</td>
<td>Oluşturulan bir raporu otomatik olarak sistem dışına aktaran bir işleme için mesaj öğesinin aktarıldığı tarih.</td>
</tr>
<tr>
<td>Belge numarası</td>
<td>Bu alan otomatik olarak, kayıtları doldur eyleminin kurulumuna dayalı olarak ayarlanır. Bu alan bir fatura İleti öğeleri tablosuna bir fatura eklendiğinde otomatik olarak ayarlanabilir.</td>
</tr>
<tr>
<td>Hesap numarası</td>
<td>Bir müşteri veya satıcının hesap numarası (veya başka bir alan değeri, Kayıtları doldur eyleminde tanımlanmış olan alana dayanarak). Bu alan bir fatura İleti öğeleri tablosuna bir fatura eklendiğinde otomatik olarak ayarlanabilir.</td>
</tr>
<tr>
<td>İleti</td>
<td>Mesajın numarası. Bu numara otomatik olarak, <b>Genel muhasebe parametreleri</b> sayfasında tanımlanmış olan <b>İleti</b> numara serisine göre atanır.</td>
</tr>
<tr>
<td>İleti durumu</td>
<td>Elektronik mesajın gerçek durumu.</td>
</tr>
<tr>
<td>Sonraki eylem</td>
<td>Mesaj öğesinin geçerli durumu için başlatılabilecek sonraki eylemler.</td>
</tr>
</tbody>
</table>
**Ek alanlar** sekmesi, seçilen mesaj öğesi için ek alanları ve bunların değerlerini gösterir.
### <a name="run-processing"></a>İşlemeyi başlat
Eylem Panosunda **İşlemeyi yürüt** öğesini seçerek ileti öğeleri için işlemeyi çalıştırın. Belirli bir eylemi yürütmek için **İşlemeyi çalıştır** iletişim kutusunda, **Eylemi seç** seçeneğini **Evet** olarak ayarlayın ve sonra bir eylem seçin. Tüm işlemeyi çalıştırmak için **Eylem seç** seçeneğini **Hayır** olarak ayarlayın.
### <a name="generate-report"></a>Rapor oluştur
Eylem bölmesinde, **Rapor oluştur**'u seçin. Bu düğme, **Elektronik raporlama dışa aktarma** türünün eylemleri ile ilişkilendirilmiştir.
### <a name="update-status"></a>Durumu güncelleştir
**Durumu güncelleştir** öğesini Eylem Panosu üzerinde seçerek bir veya birden fazla ileti öğesinin durumunu güncelleştirin. **Durumu güncelleştir** iletişim kutusunda, güncelleştirilerek mesaj öğelerini seçmek için **Dahil edilecek kayıtlar** FastTab'i kullanın. Seçim kriterini doğru tanımladığınızdan emin olun çünkü mesaj öğesi durumları bu kriterler, seçilen eylemin başlangıç durumu ve belirttiğiniz **Yeni durum** değeri doğrultusunda güncelleştirilecektir. Bir durum güncelleştirmesi tamamlandıktan sonra, hangi öğelerin güncelleştirildiğini belirlemek güç olacaktır. Bu nedenle, durum güncelleştirmesini geri almak zor olacaktır.
### <a name="electronic-messages"></a>Elektronik iletiler
Seçilen ileti öğesi ile ilişkili bir elektronik iletiyi görüntülemek için Eylem Panosunda **Elektronik iletiler** öğesini seçin.
Belirli bir ileti öğesine ilişkin özel dosyaları da gözden geçirebilirsiniz. İleti öğesinin **İleti** alanını seçin veya Eylem Panosunda **Elektronik iletiler** öğesini seçin. **Elektronik ileti** sayfasında, dosyalarının gözden geçileceği iletiyi seçin ve sayfanın sağ üst köşesindeki **Ek** düğmesini (ataş simgesi) seçin.
**Ekler** sayfası, ileti ile ilişkili tüm ekleri gösterir. Bir dosyayı görüntülemek için soldaki listeden seçin ve sonra Eylem Panosunda **Aç** öğesini seçin.
### <a name="original-document"></a>Özgün belge
Seçilen ileti öğesi için orijinal belgeyi açmak için Eylem Panosunda **Orijinal belge** öğesini seçin.
| 59.531646 | 637 | 0.784074 | tur_Latn | 0.999866 |
b50efaecfc0b793085bd898e6ec1acb0b074facd | 5,283 | md | Markdown | README.md | md100play/HopHacks | e5bf14a8962ec20d4e8aa37a704b733d3c1dba08 | [
"CC-BY-3.0",
"MIT"
] | null | null | null | README.md | md100play/HopHacks | e5bf14a8962ec20d4e8aa37a704b733d3c1dba08 | [
"CC-BY-3.0",
"MIT"
] | null | null | null | README.md | md100play/HopHacks | e5bf14a8962ec20d4e8aa37a704b733d3c1dba08 | [
"CC-BY-3.0",
"MIT"
] | null | null | null | # OpenTrckr
**In the last year, the instances of cases of the Zika virus have exploded, and unfortunately the demographic that is the worst affected is pregnant women and their unborn children. Zika has been linked to an increase in the rate of the birth defect known as [microcephaly](http://www.cdc.gov/ncbddd/birthdefects/microcephaly.html) - a very small head and brain size.**
## Motivation
In developing nations with large populations it is quite challenging for governments/medical authorities/non-profit organizations to deploy assistance to populations afflicted with the Zika virus. There is also a lack of a database which holds information regarding occurences of the disease. OpenTrckr's motivation is to resolve this problem.
Opentrckr provides live access to data regarding user reported instances of the disease, stagnant water bodies and location of medical camps - crucial information to both victims and organizations alike.
## Functionality
With real time data visualizations rendered using the awesome CartoDB API.
![Map of CartoDB visualization](https://raw.githubusercontent.com/shivtools/HopHacks/master/markdown/map.png)
Users are able to zoom in and out and keep track of the following:
* **Cases of Zika occurences** - thereby warning pregnant women and other vulnerable populations of where the disease is prevalent.
* **Stagnant water bodies** - that could potentially breed mosquitoes. This feature is useful for government organizations to conveniently deploy resources to spray these water bodies early and efficiently.
* **Location of medical facilities** - non-profit organizations and governmental organizations that are providing access to victims afflicted with Zika. Mitigates the effort and risk of searching for resources and thereby being exposed to mosquitoes.
OpenTrckr makes use of Google Maps' API to render a user's current coordinates. If current coordinates are not correct (which is unlikely), the user is allowed to place a crosshair wherever they'd like. Checks have been installed to make sure that a user *cannot* add more than one tag in a 24 hour period in a 2 mile radius. This check was installed to make sure that a user cannot spam the app with false tags (making our data more authentic).
![Google Maps](https://raw.githubusercontent.com/shivtools/HopHacks/master/markdown/googlemaps.png)
OpenTrckr demonstrates its ultimate usefulness with its ability to alert agencies that need to reach out to areas in need of help, but the lack of staff and comprehensive data on Zika victims prevents them from efficiently reaching victims on time. Geo-tags are present on the map in clusters, and this makes rendering a single set of coordinates (to alert an agency with) problematic. An example can of a cluster is demonstrated below.
![Cluster](https://raw.githubusercontent.com/shivtools/HopHacks/master/markdown/clusters.png)
OpenTrckr makes use of a *data clustering algorithm* known as **[Density-based spatial clustering of applications with noise (DBSCAN)](https://en.wikipedia.org/wiki/DBSCAN)** to narrow down on a single set of coordinates that best represents the cluster. A visual representation of this clustering algorithm is represented below.
![DBSCAN algorithm](https://upload.wikimedia.org/wikipedia/commons/1/1b/Kernel_Machine.png).
Based on the set of coordinates rendered by the clustering algorithm, OpenTrckr tweets this set of coordinates (latitude and logitude) to a relevant organization which can deploy help to the affected region accordingly. For now, we will only be tweeting our own Twitter Handle to prevent any undue panic!
![Sample tweets](https://raw.githubusercontent.com/shivtools/HopHacks/master/markdown/twitter.png)
## Our Stack
OpenTrckr is a [Node.js](https://nodejs.org/en/)/[Express app](http://expressjs.com/en/guide/using-middleware.html) that uses [Jade](http://jade-lang.com/) as its templating engine. [CartoDB](https://cartodb.com/) is used for data visualizations (using PostgreSQL queries). Our geolocation data is provided by [Google Maps](https://developers.google.com/maps/), Tweets are tweeted using the Twitter API. Login authentications are done using the Facebook/Gmail/Instagram/Github/LinkedIn/Twitter APIs.
## Developers
Our awesome team consists of 3 current University of Richmond undergrads, [Alexandru Pana](https://github.com/FFMMM), [Michael Dombrowski](https://github.com/MikeDombo), [Shiv Toolsidass (Myself :) )](https://github.com/shivtools) and [Otega Owho-Ovuakporie](https://github.com/otegaoo) of Lincoln University, PA. We came to [HopHacks](http://hophacks.com/), consumed far too much redbull/junk food and coded the weekend away - a wonderful experience overall! We hope that you find OpenTrckr useful and that our app will benefit people. We plan on extending the functionality of the app in the future - more to come!
## Citations
* [10 Essential Facts about the Zika virus](http://www.everydayhealth.com/news/10-essential-facts-about-zika-virus/)
* [DBSCAN algorithm visual](https://upload.wikimedia.org/wikipedia/commons/1/1b/Kernel_Machine.png)
## License:
Create Commons License. Feel free to fork this repo and improve upon our existing codebase - that pull request is a click (and a code review *wink*) away!
| 91.086207 | 617 | 0.795381 | eng_Latn | 0.989918 |
b50f92c3fd3dc5884a38faf3cb7d8f58c4330e44 | 64 | md | Markdown | README.md | rcarrillocruz/puppet-bifrost | f3ed063a7e6a2aabdf79b6888718ad71dada15aa | [
"Apache-2.0"
] | null | null | null | README.md | rcarrillocruz/puppet-bifrost | f3ed063a7e6a2aabdf79b6888718ad71dada15aa | [
"Apache-2.0"
] | null | null | null | README.md | rcarrillocruz/puppet-bifrost | f3ed063a7e6a2aabdf79b6888718ad71dada15aa | [
"Apache-2.0"
] | null | null | null | # puppet-bifrost
Puppet module to install and configure Bifrost
| 21.333333 | 46 | 0.828125 | eng_Latn | 0.775974 |
b5100c3e079c0775d85d645640c128c6b165c892 | 3,228 | md | Markdown | intl.en-US/User Guide/Spark/Diagnose a Spark on MaxCompute job.md | m9395/odps | 2a6df6429ad0141a31f697c171baf868f58b3684 | [
"MIT"
] | null | null | null | intl.en-US/User Guide/Spark/Diagnose a Spark on MaxCompute job.md | m9395/odps | 2a6df6429ad0141a31f697c171baf868f58b3684 | [
"MIT"
] | null | null | null | intl.en-US/User Guide/Spark/Diagnose a Spark on MaxCompute job.md | m9395/odps | 2a6df6429ad0141a31f697c171baf868f58b3684 | [
"MIT"
] | null | null | null | # Diagnose a Spark on MaxCompute job {#concept_263782 .concept}
This topic describes how to diagnose a Spark on MaxCompute job based on the job log. You can use LogView or the Spark Web UI to check whether a Spark on MaxCompute job is submitted or run.
## Background information {#section_58m_vcp_4ho .section}
When you submit a Spark on MaxCompute job by running the `spark-submit` script, MaxCompute creates an instance and adds instance information to the LogView log.
Specifically, you can submit a Spark on MaxCompute job through running the following`spark-submit`script:
``` {#codeblock_ptt_kpx_imm}
cd $SPARK_HOME
bin/spark-submit --master yarn-cluster --class SparkPi /tmp/spark-2.x-demo/target/AliSpark-2.x-quickstart-1.0-SNAPSHOT-shaded.jar
```
After the job is submitted, MaxCompute creates an instance and adds the instance information to the LogView log as follows:
``` {#codeblock_tya_hmb_2ji}
19/01/05 20:36:47 INFO YarnClientImplUtil: logview url: http://logview.odps.aliyun.com/logview/?h=http://service.cn.maxcompute.aliyun.com/api&p=qn_beijing&i=xxx&token=xxx
If the job is submitted, the logged information includes but is not limited to the following:
19/01/05 20:37:34 INFO Client:
client token: N/A
diagnostics: N/A
ApplicationMaster host: 11.220.xxx.xxx
ApplicationMaster RPC port: 30002
queue: queue
start time: 1546691807945
final status: SUCCEEDED
tracking URL: http://jobview.odps.aliyun.com/proxyview/jobview/?h=http://service.cn.maxcompute.aliyun-inc.com/api&p=project_name&i=xxx&t=spark&id=application_xxx&metaname=xxx&token=xxx
```
**Note:** When you run a Spark on MaxCompute task in DataWorks, a similar log is created.
## Diagnose a Spark on MaxCompute job by using LogView {#section_1jp_5nc_ofs .section}
1. Open a browser. Then use LogView to view the basic information about your Spark on MaxCompute job, a cupid-type task.
![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/217830/156404375347096_en-US.jpg)
2. On the**Fuxi Jobs**tab in the upper pane, find the task named**master-0**in the**TaskName**column. Then, in the lower pane, click the**ALL**tab.
![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/217830/156404375447097_en-US.jpg)
3. On the **TempRoot** tab, find the log you want to view, and click the icon in the **StdOut** column. Then you can view the log details generated by SparkPi.
![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/217830/156404375447098_en-US.jpg)
## Diagnose a Spark on MaxCompute job by using the Spark Web UI {#section_e1m_v1q_tv6 .section}
If the log for a Spark on MaxCompute job contains a tracking URL, the job is submitted to the MaxCompute cluster. Both the Spark Web UI and the History Server use this tracking URL.
1. Open a browser and enter the tracking URL in the address bar to track your Spark on MaxCompute job.
![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/217830/156404375447099_en-US.jpg)
2. Find the driver you want to view, and then click **stdout** in the **Logs** column.
![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/217830/156404375447100_en-US.jpg)
| 52.064516 | 188 | 0.763011 | eng_Latn | 0.704994 |
b5118e522dc94f218436670d4c063751c9a8bed9 | 1,394 | md | Markdown | regions/north-carolina-triangle.md | artlung/noke.us | 3a7f248d1792e98fbc882e4e5ad405032f332e07 | [
"BSD-3-Clause"
] | null | null | null | regions/north-carolina-triangle.md | artlung/noke.us | 3a7f248d1792e98fbc882e4e5ad405032f332e07 | [
"BSD-3-Clause"
] | null | null | null | regions/north-carolina-triangle.md | artlung/noke.us | 3a7f248d1792e98fbc882e4e5ad405032f332e07 | [
"BSD-3-Clause"
] | null | null | null | ---
tags: ['cities']
name: North Carolina Triangle
milesAway: 170
symbol: rdu
---
* **BarCamp RDU**
* site: <http://barcamprdu.wordpress.com/>
* site: <http://barcamp.org/BarCampRDU>
* date: October 23, 2010
* **Triangle Game Conference:**
* site: <http://www.trianglegameconference.com/>
* **Triangle Android Meetup**
* site: <http://www.meetup.com/TriDroid/>
* twitter: <http://twitter.com/TriDroid>
* **Ignite Raleigh**
* site: <http://www.ignitetriangle.com/>
* twitter: <http://twitter.com/igniteraleigh>
* **Triangle Zope and Python Users Group (TriZPUG)**
* site: <http://trizpug.org/>
* site: <http://www.meetup.com/trizpug/>
* **Triangle JavaScript**
* site: <http://www.meetup.com/Triangle-JavaScript/>
* **Triangle Drupal Users' Group**
* site: <http://www.meetup.com/triDUG/>
* **Triad Web Meetup**
* site: <http://www.meetup.com/triadweb/>
* **Research Triangle Park Area Technical User and Special Interest Groups**
* note: _excellent list of RTP groups_
* site: <http://www.pobox.com/~burnett/triangle/groups.html>
* **Developer Day Durham**
* site: <http://developer-day.com/events/2010-durham.html>
* date: February 27, 2010
* twitter: http://twitter.com/developer_day
* **WWW2010 Raleigh: 19th International World Wide Web Conference**
* twitter: <http://twitter.com/www2010/>
* site: <http://www2010.org/>
* date: April 26-30, 2010 | 35.74359 | 76 | 0.67934 | yue_Hant | 0.909551 |
b5121b5f3da4859ba7a3425af672e51a37adc7d9 | 1,764 | md | Markdown | README.md | mdnurakmal/cloud-resume-challenge-infra | bd79c8a4811ac27dac79a3dacfe760aada7c3df3 | [
"MIT"
] | null | null | null | README.md | mdnurakmal/cloud-resume-challenge-infra | bd79c8a4811ac27dac79a3dacfe760aada7c3df3 | [
"MIT"
] | null | null | null | README.md | mdnurakmal/cloud-resume-challenge-infra | bd79c8a4811ac27dac79a3dacfe760aada7c3df3 | [
"MIT"
] | null | null | null | # cloud-resume-challenge-infra
IaC Repository for GCP Cloud Resume Challenge
https://dev.to/mdnurakmal/gcp-cloud-resume-challenge-355g
# Usage
Usage after creating new GCP project and enable billing.
- Enable Cloud Build API, Cloud Source Repositories API
- Connect all 3 github repository to CSR
- - Create Cloud Build Trigger for each repository
- Set Cloud Build service account to Owner (Only for learning , Fine-grained access control for better security)
- Manually run all triggers on all repo or push to every repository
The following task/resources requires user intervention to create them.
- Reserve Static IP Address , Create Zone with custom domain in Cloud DNS
- Create Google managed SSL Certificate
- Create Load Balancer and Configure (Backend service, Backend Bucket)
# Reference
- https://cloud.google.com/iam/docs/service-agents
- https://cloud.google.com/functions/docs/writing/http#functions_http_cors_auth-python
- https://stackoverflow.com/questions/56919391/is-there-a-way-to-set-imagepullpolicy-for-cloud-run-service
- https://cloud.google.com/build/docs/configuring-builds/substitute-variable-values
- https://github.com/GoogleCloudPlatform/cloud-builders
- https://medium.com/google-cloud/terraform-plan-in-pull-requests-with-gcp-cloud-build-603790a2b734
- https://davidstanke.medium.com/mastering-google-cloud-build-config-syntax-8c3024607daf
# Learning Notes
Why there is CORS error
- Unable to use variable in terraform backend block ?
- https://github.com/hashicorp/terraform/issues/13022
- How to secure api ? using auth ?
- Why static page is still using cached data even when CDN on load balancing is disabled
- required permissions (cloud storage for firebase admin , firebase admin , firestore agent, storage admin)
| 44.1 | 112 | 0.798186 | eng_Latn | 0.538191 |
b5125a8e7e0d853cb0607be7220071f486b0f361 | 356 | md | Markdown | README.md | MarkosKon/react-spring-scroll-gatsby | 095d507510365106d8d06710e1ef71d3d8edb1af | [
"MIT"
] | 4 | 2020-05-03T22:12:24.000Z | 2021-09-15T13:21:34.000Z | README.md | MarkosKon/react-spring-scroll-gatsby | 095d507510365106d8d06710e1ef71d3d8edb1af | [
"MIT"
] | 20 | 2021-03-09T20:38:26.000Z | 2022-02-12T22:55:14.000Z | README.md | MarkosKon/react-spring-scroll-gatsby | 095d507510365106d8d06710e1ef71d3d8edb1af | [
"MIT"
] | null | null | null | # Reveal animations
Reveal animations with `react-visibility-sensor` and `react-spring` in Gatsby.
## Related post
[Reveal animations on scroll with react-spring](https://markoskon.com/scroll-reveal-animations-with-react-spring/)
## Solutions
Both solutions use `react-visibility-sensor`
- `master` (a solution with CSS transitions)
- `react-spring`
| 23.733333 | 114 | 0.766854 | eng_Latn | 0.71373 |
b514473e24d9ea568f0405c36f493732a1541c2b | 233 | md | Markdown | random_snippets/random_choices/README.md | nanthony007/youtube | 05c3b7db7cc7be95936997c0732d62f0e31a6627 | [
"MIT"
] | null | null | null | random_snippets/random_choices/README.md | nanthony007/youtube | 05c3b7db7cc7be95936997c0732d62f0e31a6627 | [
"MIT"
] | null | null | null | random_snippets/random_choices/README.md | nanthony007/youtube | 05c3b7db7cc7be95936997c0732d62f0e31a6627 | [
"MIT"
] | null | null | null | # Random Choices
This folder has a snippet on how to randomly choice an item from a list/array in both Python and Golang.
To run the python file:
```python random_choice.py```
To run the golang file:
```go run random_choice.go```
| 23.3 | 104 | 0.742489 | eng_Latn | 0.978848 |
b514a87803c70bb9762c7c1d4731c2f25a2e9243 | 956 | md | Markdown | _posts/Blender/2022-01-27-Blender-0.7-Shading.md | jeremyytann/jeremyytann.github.io | a8ea0e2c87cd8a39101c7ede819c6ed950236a7d | [
"MIT"
] | null | null | null | _posts/Blender/2022-01-27-Blender-0.7-Shading.md | jeremyytann/jeremyytann.github.io | a8ea0e2c87cd8a39101c7ede819c6ed950236a7d | [
"MIT"
] | null | null | null | _posts/Blender/2022-01-27-Blender-0.7-Shading.md | jeremyytann/jeremyytann.github.io | a8ea0e2c87cd8a39101c7ede819c6ed950236a7d | [
"MIT"
] | null | null | null | ---
title: Blender 0.7 — 阴影 Shading
date: 2022-01-27 15:02:00 +0800
categories: [Notes, Blender]
tags: [Blender]
img_path: /assets/img/Blender/Blender-0.7
---
在**阴影模式(Shading)**里,**节点(Nodes)**的执行顺序是**由左到右**的。
### **Add-on — Node Wrangler**
在**设置(Preferences)**的**插件(Add-ons)**里,开启**Node: Node Wrangler**。
此插件可以让我们在节点界面,按下**Ctrl+Shift+LMB**浏览该节点的渲染效果。
---
### **节点 Node**
这里仅包含我学习过程中有使用到的节点。
**纹理坐标(Texture Coordinate)**— 此节点可校正物体表面的纹理变形问题。
**噪波纹理(Noise Texture)**— 此节点可实现物体表面的噪波纹理。
**颜色渐变(ColorRamp)**— 此节点可实现物体表面的颜色渐变效果。
**凹凸(Bump)**— 此节点可为物体表面添加凹凸元素。
**混合RGB(MixRGB)**— 此节点可将两个颜色合二为一。
**图像纹理(Image Texture)**— 此节点可以将图像转换为纹理贴到物体表面。
**叠加(Overlay)**— 此节点可以将两个不同的颜色/纹理进行叠加处理。
<br>
![](before-noise-texture.png){: style="border-radius: 5%"}
以上是**添加噪波纹理及凹凸前的渲染图**。
<br>
![](after-noise-texture.png){: style="border-radius: 5%"}
以上是**添加噪波纹理及凹凸后的渲染图**。
<br>
![](screenshot-1.png){: style="border-radius: 5%"}
以上是**添加噪波纹理及凹凸的实际操作界面**,以供参考。
| 17.703704 | 64 | 0.672594 | yue_Hant | 0.529926 |
b516d27f2b780d98f52e30a9e9eb4b8ef4a8e08a | 56 | md | Markdown | README.md | diegoefe/WifiList | 61ee171c03df41fdd287aa42265897d8d0cccfa7 | [
"MIT"
] | null | null | null | README.md | diegoefe/WifiList | 61ee171c03df41fdd287aa42265897d8d0cccfa7 | [
"MIT"
] | null | null | null | README.md | diegoefe/WifiList | 61ee171c03df41fdd287aa42265897d8d0cccfa7 | [
"MIT"
] | null | null | null | # WifiList
Lists available WiFi networks in mobile apps
| 18.666667 | 44 | 0.821429 | eng_Latn | 0.900669 |
b51715a2d1b3a20ea580511214da674a8406d537 | 236 | md | Markdown | includes/tlasharptla-uispy-md.md | Dodozz/docs.it-it | f34c4bb1e8afb7492f8512359d32a9156c9c768d | [
"CC-BY-4.0",
"MIT"
] | null | null | null | includes/tlasharptla-uispy-md.md | Dodozz/docs.it-it | f34c4bb1e8afb7492f8512359d32a9156c9c768d | [
"CC-BY-4.0",
"MIT"
] | null | null | null | includes/tlasharptla-uispy-md.md | Dodozz/docs.it-it | f34c4bb1e8afb7492f8512359d32a9156c9c768d | [
"CC-BY-4.0",
"MIT"
] | null | null | null | ---
ms.openlocfilehash: 3ac4238aadaa453d4d5b9994c55d9ef0636e73bf
ms.sourcegitcommit: 8699383914c24a0df033393f55db3369db728a7b
ms.translationtype: MT
ms.contentlocale: it-IT
ms.lasthandoff: 05/15/2019
ms.locfileid: "65672025"
---
UI Spy
| 23.6 | 60 | 0.834746 | yue_Hant | 0.213796 |
b517f3b36949b815eac2f7951a3f55d47bc54f00 | 73 | md | Markdown | operators/pxc-operator/app-readme.md | nuevesolutions/charts | cda9c428cfde74b91ac44353d14a85939d0f8200 | [
"MIT"
] | 10 | 2019-07-09T12:38:18.000Z | 2020-06-30T06:31:43.000Z | operators/pxc-operator/app-readme.md | codejamninja/rancher2-kubedb | 8530a5c1ef996188dd582c1be97c807392c9cd19 | [
"MIT"
] | 32 | 2019-04-21T10:13:34.000Z | 2020-12-16T11:03:26.000Z | operators/pxc-operator/app-readme.md | codejamninja/rancher2-kubedb | 8530a5c1ef996188dd582c1be97c807392c9cd19 | [
"MIT"
] | 17 | 2019-07-01T14:04:29.000Z | 2020-05-19T11:35:19.000Z | # pxc-operator
> percona kubernetes operator for percona xtradb cluster
| 18.25 | 56 | 0.808219 | eng_Latn | 0.245529 |
b517f5678daa7bdd54ee2745aae2d5fdbc6f2efe | 4,916 | md | Markdown | products/wso2_ESB/product_features/features/proxy_services/secure_proxy/secure_with_localentry_policy/README.md | rmsamitha/wso2-qa-artifacts | c0a5ff78e40a62a1cf86c8f39aae2149f5112f86 | [
"Apache-2.0"
] | 7 | 2015-04-30T08:47:55.000Z | 2022-02-17T14:21:19.000Z | products/wso2_ESB/product_features/features/proxy_services/secure_proxy/secure_with_localentry_policy/README.md | rmsamitha/wso2-qa-artifacts | c0a5ff78e40a62a1cf86c8f39aae2149f5112f86 | [
"Apache-2.0"
] | 62 | 2015-08-31T04:30:09.000Z | 2018-04-04T15:15:30.000Z | products/wso2_ESB/product_features/features/proxy_services/secure_proxy/secure_with_localentry_policy/README.md | rmsamitha/wso2-qa-artifacts | c0a5ff78e40a62a1cf86c8f39aae2149f5112f86 | [
"Apache-2.0"
] | 85 | 2015-03-24T11:34:28.000Z | 2020-09-11T10:48:55.000Z | # Securing Proxy Services using policies added as Local Entries
**Description:-** This test case coveres the scenario of invoking a Proxy service which is secured using a policy stored as a Local Entry in ESB.
**Pre-Conditions:-**
* An WSO2 ESB service should be up and running
**How to test the scenario:-**
* Add the content given under <localEntry> tag of server-policy.xml
OR
drop the server-policy.xml to $ESB_HOME/repository/deployment/server/synapse-configs/default/local-entries folder and let it hotdeploy.
* Create a proxy service with the configuration given in SecPolicyWithLocalEntryProxy.xml
* Once deployed, secure the proxy service with the server-policy.xml Local entry policy so that the configuration looks like what's given below
```python
<proxy name="SecPolicyWithLocalEntryProxy"
transports="https"
startOnLoad="true"
trace="disable">
<description/>
<target>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
<outSequence>
<send/>
</outSequence>
</target>
<policy key="server-policy"/>
<parameter name="ScenarioID">scenario1</parameter>
<enableSec/>
</proxy>
```
* Now invoke the proxy service with the correct credentials. You can also use the given soapUI project - SecPolicyWithLocalEntryProxy-soapui-project.xml and invoke the proxy service.
Once invoked, you should get the expected response from ESB.
## Refer below for the entire synapse configuration used in this sample
```python
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry provider="org.wso2.carbon.mediation.registry.WSO2Registry">
<parameter name="cachableDuration">15000</parameter>
</registry>
<proxy name="SecPolicyWithLocalEntryProxy"
transports="https"
startOnLoad="true"
trace="disable">
<description/>
<target>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
<outSequence>
<send/>
</outSequence>
</target>
<policy key="server-policy"/>
<parameter name="ScenarioID">scenario1</parameter>
<enableSec/>
</proxy>
<localEntry key="server-policy">
<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="UTOverTransport">
<wsp:ExactlyOne>
<wsp:All>
<sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate="true"/>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Lax/>
</wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:TransportBinding>
<rampart:RampartConfig xmlns:rampart="http://ws.apache.org/rampart/policy">
<rampart:encryptionUser>useReqSigCert</rampart:encryptionUser>
<rampart:timestampPrecisionInMilliseconds>true</rampart:timestampPrecisionInMilliseconds>
<rampart:timestampTTL>300</rampart:timestampTTL>
<rampart:timestampMaxSkew>300</rampart:timestampMaxSkew>
<rampart:tokenStoreClass>org.wso2.carbon.security.util.SecurityTokenStore</rampart:tokenStoreClass>
<rampart:nonceLifeTime>300</rampart:nonceLifeTime>
</rampart:RampartConfig>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<description/>
</localEntry>
<sequence name="fault">
<log level="full">
<property name="MESSAGE" value="Executing default 'fault' sequence"/>
<property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
<property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
</log>
<drop/>
</sequence>
<sequence name="main">
<in>
<log level="full"/>
<filter source="get-property('To')" regex="http://localhost:9000.*">
<send/>
</filter>
</in>
<out>
<send/>
</out>
<description>The main sequence for the message mediation</description>
</sequence>
</definitions>
``` | 37.815385 | 182 | 0.600488 | eng_Latn | 0.548833 |
b5183ce164d3d4395abc6e80fb3964efd934d571 | 35 | md | Markdown | markdown/python/anaconda/hydrogen.md | hdknr/annotated-django | 5843908dd6586a54b92d974f45049fa87e64db8b | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | markdown/python/anaconda/hydrogen.md | hdknr/annotated-django | 5843908dd6586a54b92d974f45049fa87e64db8b | [
"PSF-2.0",
"BSD-3-Clause"
] | 55 | 2016-02-27T06:02:24.000Z | 2021-11-01T07:53:20.000Z | markdown/python/anaconda/hydrogen.md | hdknr/annotated-django | 5843908dd6586a54b92d974f45049fa87e64db8b | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | https://github.com/nteract/hydrogen | 35 | 35 | 0.828571 | yue_Hant | 0.286013 |
b5187a359b9dcf216e4d52638d8f9fc8187d728d | 921 | md | Markdown | src/shirts/3.md | JoAlfie/FAW | 828edde81a64bf3620d3d5de3496d8525ba475d0 | [
"MIT"
] | null | null | null | src/shirts/3.md | JoAlfie/FAW | 828edde81a64bf3620d3d5de3496d8525ba475d0 | [
"MIT"
] | null | null | null | src/shirts/3.md | JoAlfie/FAW | 828edde81a64bf3620d3d5de3496d8525ba475d0 | [
"MIT"
] | null | null | null | ---
number: 3
title_en: "1976-79 Away"
title_cy: "1976-79 Oddi Cartref"
subtitle_en: "Ian Edwards #9 LS v Malta 25/10/78 (Edwards scored 4 goals in this game)"
subtitle_cy: "Ian Edwards #9 LS v Malta 25/10/78 (Sgoriodd Edwards 4 gôl yn y gêm hon)"
desc_en: "It’s rare for a team to have dream shirts for both the home and away varieties, but the away Admiral jersey was equally as popular amongst fans. The iconic design but using the colours in reverse complement each other perfectly. Both shirts are refenced in later designs within this exhibition."
desc_cy: "Mae’n anghyffredin i dîm gael crysau cartref ac oddi cartref cyfareddol ar yr un pryd, ond roedd crys oddi cartref Admiral yr un mor boblogaidd ymhlith cefnogwyr. Mae’r dyluniad eiconig, ond gyda’r lliwiau i’r gwrthwyneb, yn ategu ei gilydd yn berffaith. Cyfeirir at y ddau grys mewn dyluniadau diweddarach o fewn yr arddangosfa hon."
image: "./03.png"
---
| 83.727273 | 344 | 0.774159 | cym_Latn | 0.989565 |
b51968b6fa8007f48a764424cf77c7f575aadfd9 | 29 | md | Markdown | CHANGELOG.md | gkrizek/antmonitor | 9dfd8f6d48b144511ecccb926364e51e7dbcd67f | [
"MIT"
] | 4 | 2018-07-14T19:39:53.000Z | 2021-12-02T15:27:50.000Z | CHANGELOG.md | gkrizek/antmonitor | 9dfd8f6d48b144511ecccb926364e51e7dbcd67f | [
"MIT"
] | 2 | 2018-01-15T06:43:33.000Z | 2018-01-15T20:24:42.000Z | CHANGELOG.md | gkrizek/antmonitor | 9dfd8f6d48b144511ecccb926364e51e7dbcd67f | [
"MIT"
] | 4 | 2018-01-14T08:10:19.000Z | 2022-02-25T07:10:31.000Z | ## 0.1.0 (TBD)
- Nothing yet
| 9.666667 | 14 | 0.551724 | eng_Latn | 0.422582 |
b51a4fa8ee04e0ea67081f60b25c77b31ab98710 | 746 | md | Markdown | _posts/2017/2017-02-26-normative-do-not-call-super-constructor-when-thisbindingstatus-is-already-initialized-by-bterlson-pull-request-762-tc39-ecma262.md | mysticatea/ecmascript-daily.github.com | b6e3ad08040ec416a2628155d2393fa239ae6ee0 | [
"MIT"
] | 70 | 2015-12-25T17:17:51.000Z | 2022-02-15T21:55:06.000Z | _posts/2017/2017-02-26-normative-do-not-call-super-constructor-when-thisbindingstatus-is-already-initialized-by-bterlson-pull-request-762-tc39-ecma262.md | mysticatea/ecmascript-daily.github.com | b6e3ad08040ec416a2628155d2393fa239ae6ee0 | [
"MIT"
] | 16 | 2015-12-26T16:41:21.000Z | 2020-02-19T07:10:43.000Z | _posts/2017/2017-02-26-normative-do-not-call-super-constructor-when-thisbindingstatus-is-already-initialized-by-bterlson-pull-request-762-tc39-ecma262.md | mysticatea/ecmascript-daily.github.com | b6e3ad08040ec416a2628155d2393fa239ae6ee0 | [
"MIT"
] | 10 | 2016-08-08T12:49:21.000Z | 2021-08-20T11:57:07.000Z | ---
layout: news
title: >-
Normative: do not call super constructor when ThisBindingStatus is already
initialized by bterlson · Pull Request #762 · tc39/ecma262
item-url: 'https://github.com/tc39/ecma262/pull/762'
date: '2017-02-26T13:30:32Z'
tags:
- ECMAScript
- spec
- issue
related:
- title: evil-ctor.js
url: 'https://gist.github.com/bakkot/66b515f402b8cdbf3e405f8509ad3525'
- title: >-
AWB: I would be happy with that but part of my grand compromise on how we
figured this out in the last two weeks of ES2015, included this error.
url: >-
https://github.com/littledan/tc39-notes/blob/master/es7/2017-01/jan-24.md#discussing-not-calling-super-multiple-times
---
Make `super();super();` throwing error.
| 33.909091 | 123 | 0.713137 | eng_Latn | 0.852542 |
b51a9ba4ef95bab75dd2786392ca4f126db9f2c6 | 674 | md | Markdown | faq/job-announcement/KSAs.md | timmytimj/Help | dfc934116db91976566b7545a26727db4d60efe1 | [
"CC0-1.0"
] | null | null | null | faq/job-announcement/KSAs.md | timmytimj/Help | dfc934116db91976566b7545a26727db4d60efe1 | [
"CC0-1.0"
] | null | null | null | faq/job-announcement/KSAs.md | timmytimj/Help | dfc934116db91976566b7545a26727db4d60efe1 | [
"CC0-1.0"
] | null | null | null | ---
permalink: /faq/job-announcement/KSAs/
layout: article
section: faq
title: What are KSAs?
breadcrumb: Knowledge, Skills, and Abilities (KSAs)
category: job-announcement
tags: [Knowledge, Skills, Abilities, KSA]
---
Knowledge, Skills, and Abilities (KSAs), or Competencies are the attributes required to perform a job and are generally demonstrated through qualifying experience, education, or training. Knowledge is a body of information applied directly to the performance of a function. Skill is an observable competence to perform a learned psychomotor act. Ability is competence to perform an observable behavior or a behavior that results in an observable product. | 61.272727 | 454 | 0.804154 | eng_Latn | 0.998822 |
b51bcf98e302f9bdf00525056a43df0375f0300e | 2,846 | md | Markdown | README_CN.md | aliyun/logstash-input-logservice | 99be800eb3de6f79f21023455169fcb5c1907189 | [
"MIT"
] | 8 | 2019-06-03T02:20:49.000Z | 2021-06-16T08:44:08.000Z | README_CN.md | aliyun/logstash-input-logservice | 99be800eb3de6f79f21023455169fcb5c1907189 | [
"MIT"
] | 7 | 2020-02-05T16:56:13.000Z | 2022-01-04T16:34:52.000Z | README_CN.md | aliyun/logstash-input-logservice | 99be800eb3de6f79f21023455169fcb5c1907189 | [
"MIT"
] | 5 | 2019-06-30T16:06:02.000Z | 2021-12-22T06:04:00.000Z | # Logstash 日志服务 Input 插件
本插件作为[Logstash](https://github.com/elastic/logstash)的input插件,提供从日志服务拉取(消费)日志的功能。
### 功能特性
* 支持分布式协同消费:可配置多台服务器同时消费某一Logstore。
* 高性能:基于Java ConsumerGroup实现,单核消费速度可达20MB/s。
* 高可靠:消费进度保存到服务端,宕机恢复后会从上一次checkpoint处自动恢复。
* 自动负载均衡:根据消费者数量自动分配Shard,消费者增加/退出后会自动Rebalance。
### 使用方式:
以下示例为配置Logstash消费某一个Logstore并将日志打印到标准输出:
```
input {
logservice{
endpoint => "your project endpoint"
access_id => "your access id"
access_key => "your access key"
project => "your project name"
logstore => "your logstore name"
consumer_group => "consumer group name"
consumer_name => "consumer name"
position => "end"
checkpoint_second => 30
include_meta => true
consumer_name_with_ip => true
}
}
output {
stdout {}
}
```
分布式并发消费的配置:
````
例如某Logstore有10个shard,
每个shard数据流量1M/s,
每台机器处理的能力为3M/s,
可分配5台服务器,
每个服务器设置相同的consumer_group和consumer_name,consumer_name_with_ip字段设置为true。
这种情况每台服务器会分配到2个Shard,分别处理2M/s的数据。
````
### Logstash 日志服务 Input 配置参数
本插件提供以下配置参数
|参数名|参数类型|是否必填|备注|
|:---:|:---:|:---:|:---|
|endpoint|string|是|日志服务项目所在的endpoint,详情请参考[endpoint列表](https://help.aliyun.com/document_detail/29008.html)|
|access_id|string|是|阿里云Access Key ID,需要具备ConsumerGroup相关权限,详情请参考[consumer group](https://help.aliyun.com/document_detail/28998.html)|
|access_key|string|是|阿里云Access Key Secret,需要具备ConsumerGroup相关权限,详情请参考[consumer group](https://help.aliyun.com/document_detail/28998.html)|
|project|string|是|日志服务项目名|
|logstore|string|是|日志服务日志库名|
|consumer_group|string|是|消费组名|
|consumer_name|string|是|消费者名,同一个消费组内消费者名,必须不能重复,否则会出现未定义行为|
|position|string|是|消费位置,可选项为 `begin`(从日志库写入的第一条数据开始消费)、`end`(从当前时间点开始消费) 和 `yyyy-MM-dd HH:mm:ss`(从指定时间点开始消费)|
|checkpoint_second|number| 否|每隔几秒 checkpoint 一次,建议10-60秒,不能低于10秒,默认30秒|
|include_meta|boolean| 否|传入日志是否包含meta,Meta包括日志source、time、tag、topic,默认为 true|
|consumer_name_with_ip|boolean| 否|消费者名是否包含ip地址,默认为 true,分布式协同消费下必须设置为true|
## 安装插件
- 安装 日志服务 input 插件
```sh
logstash-plugin install logstash-input-sls
```
- 启动 Logstash
```bash
logstash -f logstash.conf
```
## 性能基准测试
### 测试环境
- 处理器 : Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz,4 Core
- 内存 : 8GB
- 环境 : Linux
### Logstash配置
```
input {
logservice{
endpoint => "cn-hangzhou.log.aliyuncs.com"
access_id => "***"
access_key => "***"
project => "test-project"
logstore => "logstore1"
consumer_group => "consumer_group1"
consumer => "consumer1"
position => "end"
checkpoint_second => 30
include_meta => true
consumer_name_with_ip => true
}
}
output {
file {
path => "/dev/null"
}
}
```
### 测试过程
- 使用Java Producer向logstore发送数据,分别达到每秒发送2MB、4MB、8MB、16MB、32MB数据。
- 每条日志约500字节,包括10个Key&Value对。
- 启动Logstash,消费logstore中的数据并确保消费延迟没有上涨(消费速度能够跟上生产的速度)。
### 测试结果
| 流量(MB/S) |处理器占用(%) | 内存占用(GB) |
| :---: | :---: | :---: |
|32|170.3|1.3|
|16|83.3|1.3|
|8|41.5|1.3|
|4|21.0|1.3|
|2|11.3|1.3| | 22.768 | 138 | 0.720661 | yue_Hant | 0.337559 |
b51be745469c531126cf69f6db757f0ae8ed970d | 366 | md | Markdown | contract-test/contract/docs/testnet.md | evgenykuzyakov/oysterpack-near-stake-token | 86a01e80f57780fa755bbc09e55b91714c0751d4 | [
"MIT"
] | 13 | 2020-12-08T05:57:23.000Z | 2021-11-10T11:39:46.000Z | contract-test/contract/docs/testnet.md | evgenykuzyakov/oysterpack-near-stake-token | 86a01e80f57780fa755bbc09e55b91714c0751d4 | [
"MIT"
] | 8 | 2020-12-11T06:51:34.000Z | 2021-01-26T18:17:45.000Z | contract-test/contract/docs/testnet.md | evgenykuzyakov/oysterpack-near-stake-token | 86a01e80f57780fa755bbc09e55b91714c0751d4 | [
"MIT"
] | 2 | 2021-02-12T21:45:27.000Z | 2021-04-08T11:03:57.000Z | export CONTRACT_TEST=dev-1609182856595-2170806
near call stake.oysterpack.testnet unregister_account --accountId $CONTRACT_TEST
near view $CONTRACT_TEST ping
near call $CONTRACT_TEST test_account_registration_workflow --accountId oysterpack.testnet --args '{"stake_token_contract":"stake.oysterpack.testnet"}'
1000000000000 1 TGAS
17374630679850
48958982322329 | 33.272727 | 151 | 0.846995 | kor_Hang | 0.449979 |
b51c291fc788695d8a17efa6ce83dbff79a13911 | 1,317 | md | Markdown | docs/partials/guide.md | ProfessorManhattan/eslint-config | 1e707d8df07263aa5cde79a545a66273b3794a4b | [
"MIT"
] | 1 | 2022-03-16T10:59:26.000Z | 2022-03-16T10:59:26.000Z | docs/partials/guide.md | ProfessorManhattan/eslint-config-strict-mode | 33b4df4b2ab38f1219d04ac8bd611dff5a5140cc | [
"MIT"
] | null | null | null | docs/partials/guide.md | ProfessorManhattan/eslint-config-strict-mode | 33b4df4b2ab38f1219d04ac8bd611dff5a5140cc | [
"MIT"
] | null | null | null | ## Usage
To make use of this configuration, you need to first install the configuration in your Node.js project:
```shell
npm install --save-dev eslint-config-strict-mode
```
After that, you need to include a reference to the package in your `package.json`:
```json
{
"name": "mynpmpackage",
"version": "0.0.1",
...
"eslintConfig": {
"extends": "eslint-config-strict-mode"
}
}
```
You can override the settings that are provided by the plugin by including additional rules in your `package.json`. For instance, if you wanted to turn off a rule named `max-len`, your `package.json` would look something like this:
```json
{
"name": "mynpmpackage",
"version": "0.0.1",
...
"eslintConfig": {
"extends": "eslint-config-strict-mode",
"rules": {
"max-len": "off"
}
}
}
```
## Plugins
The following ESLint plugins are included in this configuration:
{{ plugins.eslint }}
Most of the items in the chart above are plugins used for extending the core functionality of ESLint. These all start off with `eslint-plugin-`. However, there are a few items that begin with `eslint-formatter-`. These allow you to change the format that ESLint reports with. You can, for instance, run the following to change the format of the results:
```shell
eslint --format pretty --fix .
```
| 26.877551 | 353 | 0.694761 | eng_Latn | 0.99681 |
b51d1cebf090f0e4cbea2cb2fb69704402b98589 | 570 | md | Markdown | docs/pages/custom-logic-abap.md | rajagupta20/address-manager-with-sfsf | efcefd888fa456c23b699b405392984e332d1c2d | [
"Apache-2.0"
] | 54 | 2018-05-28T15:08:25.000Z | 2022-01-11T15:14:19.000Z | docs/pages/custom-logic-abap.md | rajagupta20/address-manager-with-sfsf | efcefd888fa456c23b699b405392984e332d1c2d | [
"Apache-2.0"
] | 29 | 2018-08-07T15:10:42.000Z | 2021-08-24T09:01:17.000Z | docs/pages/custom-logic-abap.md | rajagupta20/address-manager-with-sfsf | efcefd888fa456c23b699b405392984e332d1c2d | [
"Apache-2.0"
] | 74 | 2018-05-29T09:10:58.000Z | 2022-02-27T18:57:40.000Z | ---
layout: default
title: ABAP Source Code for Custom Logic
---
# ABAP Source Code for Custom Logic
You can find the ABAP source code of the examples for custom business logic (Chapter 19) at the following places:
* Chapter 19.8: [Custom logic for business partner validation](https://github.com/SAP/cloud-s4-sdk-book/blob/master/docs/assets/abap/19_1_bp_custom_validation_logic.abap)
* Chapter 19.9: [Custom logic for calling an external service](https://github.com/SAP/cloud-s4-sdk-book/blob/master/docs/assets/abap/19_2_cbl_bpsocialmediaaccounts_check_account.abap)
| 63.333333 | 183 | 0.798246 | yue_Hant | 0.428619 |
b51d226fd71f0703de61cc860bc4ccaeadb291e8 | 659 | md | Markdown | sound-mode/README.md | NickM-27/Nick-Nack-Tasker-Plugin-Docs | 14ef46a211a53fa8922a2acd7f50e50a9de589af | [
"Apache-2.0"
] | 5 | 2020-11-05T05:20:22.000Z | 2022-02-04T13:50:54.000Z | sound-mode/README.md | Faiiev/Nick-Nack-Tasker-Plugin-Docs | 14ef46a211a53fa8922a2acd7f50e50a9de589af | [
"Apache-2.0"
] | 2 | 2019-11-19T19:59:50.000Z | 2020-01-23T20:50:12.000Z | sound-mode/README.md | Faiiev/Nick-Nack-Tasker-Plugin-Docs | 14ef46a211a53fa8922a2acd7f50e50a9de589af | [
"Apache-2.0"
] | 5 | 2019-11-22T01:02:38.000Z | 2020-11-05T05:32:31.000Z | # Sound Mode Tasker Plugin
[Download](https://play.google.com/store/apps/details?id=com.nick.mowen.soundplugin)
## Actions
### Smart Sound Mode
The smart sound mode allows intelligently switching between silent and ring modes, whichever one isn't currently active.
[Example / Walkthrough](./smart/README.md)
### Sound Mode
Sound mode allows setting any of silent / vibrate / ringer on any device.
[Example / Walkthrough](./sound/README.md)
### Sound Profile
Sound profiles allow setting all / any of the different sound modes as well as volume levels and more in one action instead of needing multiple.
[Example / Walkthrough](./profile/README.md)
| 28.652174 | 145 | 0.758725 | eng_Latn | 0.971589 |