text:
# Rocketchat modern client

[![Build Status](https://travis-ci.org/daniel-sc/rocketchat-modern-client.svg?branch=master)](https://travis-ci.org/daniel-sc/rocketchat-modern-client)
[![Coverage Status](https://coveralls.io/repos/github/daniel-sc/rocketchat-modern-client/badge.svg?branch=master)](https://coveralls.io/github/daniel-sc/rocketchat-modern-client?branch=master)

This project aims to provide a simple java client for the [Rocket.Chat](https://rocket.chat) live chat api.
The current focus is on ease of usability and solid core functionality over complete method coverage (PRs always welcome!).

## Read first
Make sure you have at least some rough understanding of [CompletableFuture](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html)
and [RxJava](https://github.com/ReactiveX/RxJava) as these are used heavily for the client api.

## Setup
Just include the client as Maven dependency in your `pom.xml` via:

```xml
<dependency>
    <groupId>com.github.daniel-sc</groupId>
    <artifactId>rocketchat-modern-client</artifactId>
    <version>0.0.5</version>
</dependency>
```

## Usage

Get subscriptions/rooms:
```java
try(RocketChatClient client = new RocketChatClient("wss://demo.rocket.chat:443/websocket", USERNAME, PASSWORD)) {
    List<Subscription> subscriptions = client.getSubscriptions().join();
}
```

Send message:
```java
try(RocketChatClient client = new RocketChatClient(URL, USERNAME, PASSWORD)) {
    ChatMessage msg = client.sendMessage("Your message", roomId).join();
}
```

Stream/read messages:
```java
try(RocketChatClient client = new RocketChatClient(URL, USERNAME, PASSWORD)) {
    Observable<ChatMessage> msgStream = client.streamRoomMessages(roomId).join();
    msgStream.forEach(msg -> System.out.println("received msg: " + msg));
    // block thread until you got enough messages.. (or don't use try-with and close client explicitly)
    msgStream.dispose();
}
```

## Websocket API
This client ships with [Tyrus](https://github.com/tyrus-project/tyrus)
websocket reference implementation.

If you like, you can replace the websocket library with any
other JSR-356 compliant implementation of [WebSocket Server API](https://mvnrepository.com/artifact/javax.websocket/javax.websocket-api).
Just update your `pom.xml` as follows:
```xml
<dependency>
    <groupId>com.github.daniel-sc</groupId>
    <artifactId>rocketchat-modern-client</artifactId>
    <version>0.0.5</version>
    <exclusions>
        <exclusion>
            <groupId>org.glassfish.tyrus.bundles</groupId>
            <artifactId>tyrus-standalone-client-jdk</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>some.websocket-api.impl</groupId>
    <artifactId>some.websocket-api.impl</artifactId>
    <version>VERSION</version>
</dependency>
```

## Run integration tests
```bash
mvn clean install -Pintegration-test
```


text:
Layer Structure Exporter (Photoshop Script)
===========================================

Export your Photoshop document layer structure to text or markdow format. Simple as that!

## Install

This is a script. There's no installation needed for using it.

You can use script by selecting `"File" > "Scripts" > "Browse..."` and select script your file.

> Notice that Photoshop doesn't work by drag and drop script files over it as Illustrator does.

## How to Use

Just run script file and you have two different export options. Select one and exported file found from same folder as you active document exist.

#### Text Tree Format

```
LayerStructureExporter_Example.psd Layer Structure Exporter

GUI Screenshot
Logo
   |-- Text and Icon
   |   |-- PS Icon
   |   |-- Layer Structure Exporter
   |-- Lines
   |-- Bar
Back
   |-- Back Text Elements
   |   |-- Text File Tree
   |   |-- Text File Text
   |   |-- Markdown Export
   |   |-- Markdown Text
   |-- Background White
```

![Gif](https://www.dropbox.com/s/gd4io0egdwcwx1x/LayerStructureExporter_Examle_Text.gif?raw=1)

#### Markdown Format

```
##LayerStructureExporter_Example.psd Layer Structure Exporter

* GUI Screenshot
* **Logo**
	* **Text and Icon**
		* PS Icon
		* Layer Structure Exporter
	* Lines
	* Bar
* **Back**
	* **Back Text Elements**
		* Text File Tree
		* Text File Text
		* Markdown Export
		* Markdown Text
	* Background White
```

![Example](https://github.com/Creatide/PS_Layer-Structure-Exporter/blob/master/README/LayerStructureExporter_Examle_Text.gif)

#### Features

| Option | Description |
| --- | --- |
| Text Tree | Export "Text Tree View" style formatted text document. |
| Markdown | Export Markdown style formatted text document. |

## About
This isn't going to be number one Photoshop script in the world. Maybe the last one :) But I've done it anyway for experinmental case. Even it's experimental someone still could need it.

## Author
[Creatide](http://creatide.com) / [Sakari Niittymaa](http://niittymaa.com)

## Licence
The MIT License (MIT)
Copyright (c) 2016 Creatide / Sakari Niittymaa

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# 02-LOGIC

# 1)

## ***Truth table***

| **Dec. equivalent** | **B[1:0]** | **A[1:0]** | **B is greater than A** | **B equals A** | **B is less than A** |
| :-: | :-: | :-: | :-: | :-: | :-: |
| 0  | 0 0 | 0 0 | 0 | **1** | 0 |
| 1  | 0 0 | 0 1 | 0 | 0 | **1** |
| 2  | 0 0 | 1 0 | 0 | 0 | **1** |
| 3  | 0 0 | 1 1 | 0 | 0 | **1** |
| 4  | 0 1 | 0 0 | **1** | 0 | 0 |
| 5  | 0 1 | 0 1 | 0 | **1** | 0 |
| 6  | 0 1 | 1 0 | 0 | 0 | **1** |
| 7  | 0 1 | 1 1 | 0 | 0 | **1** |
| 8  | 1 0 | 0 0 | **1** | 0 | 0 |
| 9  | 1 0 | 0 1 | **1** | 0 | 0 |
| 10 | 1 0 | 1 0 | 0 | **1** | 0 |
| 11 | 1 0 | 1 1 | 0 | 0 | **1** |
| 12 | 1 1 | 0 0 | **1** | 0 | 0 |
| 13 | 1 1 | 0 1 | **1** | 0 | 0 |
| 14 | 1 1 | 1 0 | **1** | 0 | 0 |
| 15 | 1 1 | 1 1 | 0 | **1** | 0 |

# 2)
## ***Karnaugh maps***

### *The K-map for the "equals" function*
|           |           |         |  **A1,A0**  |           |           |
| :-:       | :-:       | :-:     | :-:         | :-:       | :-:       |
|           |           | ***0 0*** | ***0 1***     | ***1 1***   | ***1 0***   |
|           | ***0 0***  | **1**   | 0           | 0         | 0         |
| **B1,B0** |  ***0 1***  | 0       | **1**       | 0         |  0        |
|           | ***1 1***   | 0       | 0           | **1**     | 0         |
|           | ***1 0***   | 0       | 0           | 0         | **1**     |

### *The K-map for the "graeter than" function*
|           |           |         |  **A1,A0**  |           |           |
| :-:       | :-:       | :-:     | :-:         | :-:       | :-:       |
|           |           | ***0 0*** | ***0 1***     | ***1 1***   | ***1 0***   |
|           | ***0 0***   | 0   | 0           | 0         | 0         |
| **B1,B0** |  ***0 1***  | **1**        | 0       | 0         |  0        |
|           | ***1 1***   | **1**        | **1**            | 0    | **1**         |
|           | ***1 0***   | **1**        | **1**            | 0         | 0     |

#### Simplified SoP form of the "greater than" function :
#### GreaterSoP = B1./A1 + /A1./A0.B0 + /A0.B1.B0
##### '/' -> negation

### *The K-map for the "less than" function*
|           |           |         |  **A1,A0**  |           |           |
| :-:       | :-:       | :-:     | :-:         | :-:       | :-:       |
|           |           | ***0 0*** | ***0 1***     | ***1 1***   | ***1 0***   |
|           | ***0 0***   | **0**   | 1           | 1         | 1         |
| **B1,B0** |  ***0 1***  | **0**       | **0**       | 1         |  1        |
|           | ***1 1***   | **0**       | **0**            | **0**     | **0**          |
|           | ***1 0***   | **0**       | **0**            | 1         | **0**     |

#### Simplified PoS form of the "less than" function :
#### LessPoS = (A1+A0).(/B1+/B2).(A1+/B1).(A1+/B0).(A0+/B1)
##### '/' -> negation

# 3)

### ***VHDL Code (design.vhd)***

```VHDL
library ieee;
use ieee.std_logic_1164.all;

entity comparator_4bit is
    port(
        a_i           : in  std_logic_vector(4 - 1 downto 0);
		b_i           : in  std_logic_vector(4 - 1 downto 0);

        							-- COMPLETE ENTITY DECLARATION
		B_greater_A_o : out std_logic;
        B_equals_A_o  : out std_logic;

        B_less_A_o    : out std_logic       -- B is less than A
    );
end entity comparator_4bit;

architecture Behavioral of comparator_4bit is
begin
    B_greater_A_o 	 <= '1' when (b_i > a_i) else '0';
    B_equals_A_o 	 <= '1' when (b_i = a_i) else '0';
    B_less_A_o		 <= '1' when (b_i < a_i) else '0';

end architecture Behavioral;

```

### ***VHDL Code (testbench.vhd)***

```VHDL
library ieee;
use ieee.std_logic_1164.all;

------------------------------------------------------------------------
-- Entity declaration for testbench
------------------------------------------------------------------------
entity tb_comparator_4bit is
    -- Entity of testbench is always empty
end entity tb_comparator_4bit;

-----------------------------------------------------------------------
-- Architecture body for testbench
------------------------------------------------------------------------
architecture testbench of tb_comparator_4bit is

    -- Local signals
    signal s_a       : std_logic_vector(4 - 1 downto 0);
    signal s_b       : std_logic_vector(4 - 1 downto 0);
    signal s_B_greater_A : std_logic;
    signal s_B_equals_A  : std_logic;
    signal s_B_less_A    : std_logic;

begin
    -- Connecting testbench signals with comparator_2bit entity (Unit Under Test)
    uut_comparator_4bit : entity work.comparator_4bit
        port map(
            a_i           => s_a,
            b_i           => s_b,
            B_greater_A_o => s_B_greater_A,
            B_equals_A_o  => s_B_equals_A,
            B_less_A_o    => s_B_less_A
        );

    --------------------------------------------------------------------
    -- Data generation process
    --------------------------------------------------------------------
    p_stimulus : process
    begin
        -- Report a note at the begining of stimulus process
        report "Stimulus process started" severity note;

        -- First test values
        s_b <= "0000"; s_a <= "0000"; wait for 100 ns;
                -- Expected output
        assert ((s_B_greater_A = '0') and (s_B_equals_A = '1') and (s_B_less_A = '0'))
        -- If false, then report an error

        report "Test failed for input combination: 0000, 0000" severity error;

        -- Second test values
        s_b <= "0000"; s_a <= "0001"; wait for 100 ns;
                -- Expected output
        assert ((s_B_greater_A = '0') and (s_B_equals_A = '0') and (s_B_less_A = '1'))
        -- If false, then report an error

        report "Test failed for input combination: 0000, 0001" severity error;

        -- Third test values
        s_b <= "0000"; s_a <= "0010"; wait for 100 ns;
                -- Expected output
        assert ((s_B_greater_A = '0') and (s_B_equals_A = '0') and (s_B_less_A = '1'))
        -- If false, then report an error

        report "Test failed for input combination: 0000, 0010" severity error;

        -- Fourth test values
        s_b <= "0000"; s_a <= "0100"; wait for 100 ns;
                -- Expected output
        assert ((s_B_greater_A = '0') and (s_B_equals_A = '0') and (s_B_less_A = '1'))
        -- If false, then report an error

        report "Test failed for input combination: 0000, 0100" severity error;

        -- Fifth test values
        s_b <= "1000"; s_a <= "0000"; wait for 100 ns;
                -- Expected output
        assert ((s_B_greater_A = '1') and (s_B_equals_A = '0') and (s_B_less_A = '0'))
        -- If false, then report an error

        report "Test failed for input combination: 1000, 0000" severity error;

        -- Sixth test values
        s_b <= "1000"; s_a <= "0100"; wait for 100 ns;
                -- Expected output
        assert ((s_B_greater_A = '1') and (s_B_equals_A = '0') and (s_B_less_A = '0'))
        -- If false, then report an error

        report "Test failed for input combination: 1000, 0100" severity error;

        -- Seventh test values
        s_b <= "0010"; s_a <= "0100"; wait for 100 ns;
                -- Expected output
        assert ((s_B_greater_A = '0') and (s_B_equals_A = '0') and (s_B_less_A = '1'))
        -- If false, then report an error

        report "Test failed for input combination: 0010, 0100" severity error;

        -- Eighth test values
        s_b <= "1000"; s_a <= "1000"; wait for 100 ns;
                -- Expected output
        assert ((s_B_greater_A = '0') and (s_B_equals_A = '1') and (s_B_less_A = '0'))
        -- If false, then report an error

        report "Test failed for input combination: 1000, 1000" severity error;

        -- Ninth test values
        s_b <= "1100"; s_a <= "0100"; wait for 100 ns;
                -- Expected output
        assert ((s_B_greater_A = '1') and (s_B_equals_A = '0') and (s_B_less_A = '0'))
        -- If false, then report an error

        report "Test failed for input combination: 1100, 0100" severity error;

         -- Tenth test values
        s_b <= "0110"; s_a <= "0011"; wait for 100 ns;
                -- Expected output
        assert ((s_B_greater_A = '1') and (s_B_equals_A = '1') and (s_B_less_A = '0'))
        -- If false, then report an error
        report "Test failed for input combination: 0110, 0011" severity error;

        -- Report a note at the end of stimulus process
        report "Stimulus process finished" severity note;
        wait;
    end process p_stimulus;

end architecture testbench;

```

### Simulator console output:
![alt text](https://github.com/xsedla1l/Digital-electronics-1/blob/main/Labs/02-logic/Images02/logic2.png)

### Reported error:
![alt text](https://github.com/xsedla1l/Digital-electronics-1/blob/main/Labs/02-logic/Images02/logic1.png)

### Link to EDA Playground
[EDA Playground](https://www.edaplayground.com/x/8QkY)

branch_name: refs/heads/main


text:
# About

## Cite us

We are currently working on the Deeplodocus paper. However, if you use Deeplodocus for your projects, feel free to cite us by using the following bibtex.

```
@article{leroywestlake2019deeplodocus,
title={Deeplodocus : The Framework keeping your head above water}, author={A. Leroy, S. Westlake and al.},
year={2019},
howpublished={\url{https://deeplodocus.org}}
}
```

repository: amelgrenier/deeplodocus

gha_license_id: MIT

repo_name: amelgrenier/deeplodocus


text:
React Redux Starter Kit
=======================

[![Join the chat at https://gitter.im/davezuko/react-redux-starter-kit](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/davezuko/react-redux-starter-kit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/davezuko/react-redux-starter-kit.svg?branch=master)](https://travis-ci.org/davezuko/react-redux-starter-kit?branch=master)
[![dependencies](https://david-dm.org/davezuko/react-redux-starter-kit.svg)](https://david-dm.org/davezuko/react-redux-starter-kit)
[![devDependency Status](https://david-dm.org/davezuko/react-redux-starter-kit/dev-status.svg)](https://david-dm.org/davezuko/react-redux-starter-kit#info=devDependencies)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)

> ### 启用eslint semi(分号规则)并修复项目中的文件
> npm install 成功以后, 修改 `.eslintrc` 中 `semi` 规则,由 `never` 更改为 `always`, 然后运行 `npm run lint:fix` -- 就是这么简单! 另外利用同样的方法, 可以根据你的需要自行修改了或扩展 `.eslingrc` 规则, 并运行 `npm run lint:fix`,它会根据你的设置自动修复一些不符合规则的`js`

This starter kit is designed to get you up and running with a bunch of awesome new front-end technologies, all on top of a configurable, feature-rich webpack build system that's already setup to provide hot reloading, CSS modules with Sass support, unit testing, code coverage reports, bundle splitting, and a whole lot more.

The primary goal of this project is to remain as **unopinionated** as possible. Its purpose is not to dictate your project structure or to demonstrate a complete sample application, but to provide a set of tools intended to make front-end development robust, easy, and, most importantly, fun. Check out the full feature list below!

环境需求
------------

* node `^4.2.0`
* npm `^3.0.0`

功能特点
--------

* [React](https://github.com/facebook/react) (`^0.14.0`)
  * Includes react-addons-test-utils (`^0.14.0`)
* [Redux](https://github.com/rackt/redux) (`^3.0.0`)
  * react-redux (`^4.0.0`)
  * redux-devtools
    * use `npm run dev:nw` to display them in a separate window.
  * redux-thunk middleware
* [react-router](https://github.com/rackt/react-router) (`^2.0.0`)
* [react-router-redux](https://github.com/rackt/react-router-redux) (`^3.0.0`)
* [Webpack](https://github.com/webpack/webpack)
  * [CSS modules!](https://github.com/css-modules/css-modules)
  * sass-loader
  * postcss-loader with cssnano for style autoprefixing and minification
  * Bundle splitting for app and vendor dependencies
  * CSS extraction during builts that are not using HMR (like `npm run compile`)
  * Loaders for fonts and images
* [Koa](https://github.com/koajs/koa) (`^2.0.0-alpha`)
  * webpack-dev-middleware
  * webpack-hot-middleware
* [Karma](https://github.com/karma-runner/karma)
  * Mocha w/ chai, sinon-chai, and chai-as-promised
  * [Airbnb's Enzyme](https://github.com/airbnb/enzyme) with [chai-enzyme](https://github.com/producthunt/chai-enzyme)
  * PhantomJS
  * Code coverage reports
* [Babel](https://github.com/babel/babel) (`^6.3.0`)
  * [babel-plugin-transform-runtime](https://www.npmjs.com/package/babel-plugin-transform-runtime) so transforms aren't inlined
  * [babel-preset-react-hmre](https://github.com/danmartinez101/babel-preset-react-hmre) for:
    * react-transform-hmr (HMR for React components)
    * redbox-react (visible error reporting for React components)
  * [babel-plugin-transform-react-constant-elements](https://babeljs.io/docs/plugins/transform-react-constant-elements/) save some memory allocation
  * [babel-plugin-transform-react-remove-prop-types](https://github.com/oliviertassinari/babel-plugin-transform-react-remove-prop-types) remove `PropTypes`
* [ESLint](http://eslint.org)
  * Uses [Standard Style](https://github.com/feross/standard) by default, but you're welcome to change this!
  * Includes separate test-specific `.eslintrc` to support chai assertions

如何开始
---------------

```shell
$ git clone https://github.com/davezuko/react-redux-starter-kit.git
$ cd react-redux-starter-kit
$ npm install                   # 安装 ./package.json 中列出的 node 模块
$ npm start                     # 编译并运行
```

创建一个新项目
----------------------

创建一个空的新项目,请按照下面的步骤操作

```shell
$ git checkout -b <your-project-name> new-project
$ npm install                   # There are a few npm dependencies in this branch that aren't in master
$ npm run make:project          # Make your new project
$ rm -rf .git && git init       # Start a new git repository
```

用法
-----

在开始详细介绍 **npm script** 之前, 我们先来做个大概介绍吧:

* 实时开发———— 运行 **npm start** ,启动一个开发服务器.
* 编译项目———— 运行 **npm run compile**.
* 环境部署———— 运行 **npm run deploy**

**注意:** 本项目使用了 [debug](https://github.com/visionmedia/debug) , 它会提升调试体验. For convenience, all of messages are prefixed with `app:*`. If you'd like to to change what debug statements are displayed, you can override the `DEBUG` environment variable via the CLI (e.g. `DEBUG=app:* npm start`) or tweak the npm scripts (`betterScripts` in `package.json`).

 此命令用于部署
* `npm run lint`- 对所有 `.js` 文件进行代码质量及规则检测.
* `npm run lint:fix` - 进行代码质量及规则检测 并尝试修复不符合规范的所有 `.js`. [请参考此文](http://eslint.org/docs/user-guide/command-line-interface.html#fix).

**注意:** 关于特定环境部署 ,首先确认你指定了 `NODE_ENV` 环境变量, 只有指定了环境变量, webpack 才会加载正确的编译配置. 例如: `NODE_ENV=production npm run compile` 调用 `~/build/webpack/_production.js` 的配置然后编译.

### 配置

项目基本配置位于 `~/config/_base.js`. 你可以重新定义 `src` 和 `dist` 目录, 调整编译设置, 增加或捆绑第三方依赖库, 等等. For the most part, you should be able to make changes in here **without ever having to touch the webpack build configuration**. If you need environment-specific overrides, create a file with the name of target `NODE_ENV` prefixed by an `_` in `~/config` (see `~/config/_production.js` for an example).

通用配置:

* `dir_src` - 客户端源码目录
* `dir_dist` - 编译后的输出目录
* `server_host` - Koa server 的主机名或ip
* `server_port` - Koa server 的服务端口
* `compiler_css_modules` - whether or not to enable CSS modules
* `compiler_devtool` - what type of source-maps to generate (set to `false`/`null` to disable)
* `compiler_vendor` - packages to separate into to the vendor bundle

目录结构
---------

```
.
├── bin                      # 构建/启动 脚本
├── build                    # All build-related configuration
│   └── webpack              # Environment-specific configuration files for webpack
├── config                   # 项目配置
├── server                   # Koa application (uses webpack middleware)
│   └── main.js              # 服务端程序的入口点
├── src                      # 源码目录
│   ├── components           # 常击倒 React 组件目录 (generally Dumb components)
│   ├── containers           # 提供上下文环境的组件目录 (例 如. Redux Provider)
│   ├── layouts              # 布局类组件目录
│   ├── redux                # Redux-specific pieces
│   │   ├── modules          # Collections of reducers/constants/actions
│   │   └── utils            # Redux-specific helpers
│   ├── routes               # 路由定义目录
│   ├── static               # 静态资源目录 (not imported anywhere in source code)
│   ├── styles               # Application-wide styles (generally settings)
│   ├── views                # Components that live at a route
│   └── main.js              # 应用程序的入口点
└── tests                    # 单元测试
```

### Components(组件) vs Views(视图) vs Layouts(布局)

**首先明确一点**: Components, Views, Layouts 全部都是组件,之所以这样划分是根据组件的职能不同, 这样看起来会更明确,当然你也可以添加新的分类,比如: Forms

这种区别可能不是对你很重要，这里稍做解释: 一个布局 **Layout** 描述了整个页面的结构, 比如 fixed navigation, viewport, sidebar, footer. 大多数应用只有一种布局, 保持这些组件独立看起来会更清析. **Views** 组件就是 `route` (路由)要渲染的内容, 一般会在 **Layout** 组件内部渲染.

Webpack
-------

### 合并打包第三方库
通过修改 `~/config/_base.js` 中 `compiler_vendor` 项, 你可以定义哪些第三方库将被合并打包 . 默认情况下以下第三方库将合并为一个`verdor.js`:

```js
[
  'history',
  'react',
  'react-redux',
  'react-router',
  'react-router-redux',
  'redux'
]
```

### Webpack Root Resolve
Webpack is configured to make use of [resolve.root](http://webpack.github.io/docs/configuration.html#resolve-root), which lets you import local packages as if you were traversing from the root of your `~/src` directory. Here's an example:

```js
// 当前文件: ~/src/views/some/nested/View.js

// 一般这样导入:
import SomeComponent from '../../../components/SomeComponent'

// 也可以这样导入:
import SomeComponent from 'components/SomeComponent' // Hooray!
```

### 全局设置

这些全局变量在作何地方都可以访问. 如果你想修改他们的话, 我可以修改`~/config/_base.js`文件中的 `globals`项. 添加一个新的全局变量时需同时修改 `~/.eslintrc`.

* `process.env.NODE_ENV` - the active `NODE_ENV` when the build started
* `__DEV__` - True when `process.env.NODE_ENV` is `development`
* `__PROD__` - True when `process.env.NODE_ENV` is `production`
* `__TEST__` - True when `process.env.NODE_ENV` is `test`
* `__DEBUG__` - True when `process.env.NODE_ENV` is `development` and cli arg `--no_debug` is not set (`npm run dev:no-debug`)
* `__BASENAME__` - [npm history basename option](https://github.com/rackt/history/blob/master/docs/BasenameSupport.md)

服务端
------

这个工具包封装了`Koa`做为服务器. 需要注意的是这个服务器的目的是通过 `webpack-dev-middleware` 和 `webpack-hot-middleware` 进行热替换. 如果你想用自己的 koa server 替换内建的 koa server,提供 `api` 服务或想实现`isomorphic`同构/universal rendering 等等,请看 [webpack-dev-server](https://github.com/webpack/webpack-dev-server). 内建的 koa server 请不要用于生产环境. 如你你正在部署生产环境, 请看一下[the deployment section](#deployment).

风格样式
------

`.scss` 和 `.css` 类型的文件全都被支持,请看 [CSS Modules](https://github.com/css-modules/css-modules). 导入以后, 样式会先被 [PostCSS](https://github.com/postcss/postcss)处理,它会自动压缩并添加一些前辍, 在生产环境会自动转换成 `.css` 文件

**NOTE:** If you're importing styles from a base styles directory (useful for generic, app-wide styles), you can make use of the `styles` alias, e.g.:

```js
// current file: ~/src/components/some/nested/component/index.jsx
import 'styles/core.scss' // this imports ~/src/styles/core.scss
```

Furthermore, this `styles` directory is aliased for sass imports, which further eliminates manual directory traversing; this is especially useful for importing variables/mixins.

Here's an example:

```scss
// current file: ~/src/styles/some/nested/style.scss
// what used to be this (where base is ~/src/styles/_base.scss):
@import '../../base';

// can now be this:
@import 'base';
```

单元测试
-------

To add a unit test, simply create a `.spec.js` file anywhere in `~/tests`. Karma will pick up on these files automatically, and Mocha and Chai will be available within your test without the need to import them.

Coverage reports will be compiled to `~/coverage` by default. If you wish to change what reporters are used and where reports are compiled, you can do so by modifying `coverage_reporters` in `~/config/_base.js`.

部署
----------

Out of the box, this starter kit is deployable by serving the `~/dist` folder generated by `npm run compile` (确认你已指定了目标环境变量 `NODE_ENV`). This project does not concern itself with the details of server-side rendering or API structure, since that demands an opinionated structure that makes it difficult to extend the starter kit. However, if you do need help with more advanced deployment strategies, here are a few tips:

如果你想用 `nginx` 提供服务, 确保主目录为 `~/dist/index.html` file and 让 react-router 通过 rest服务获取数据. 通过扩展内建的 koa server 可以提供 `api` 服务或其它一些你想要的功能, 是否要这样做这完全取决于你.

已知问题
---------------

### `npm run dev:nw` produces `cannot read location of undefined.`

This is most likely because the new window has been blocked by your popup blocker, so make sure it's disabled before trying again.

Reference: [issue 110](https://github.com/davezuko/react-redux-starter-kit/issues/110)

### Babel 的问题

Running into issues with Babel? Babel 6 can be tricky, please either report an issue or try out the [stable v0.18.1 release](https://github.com/davezuko/react-redux-starter-kit/tree/v0.18.1) with Babel 5. If you do report an issue, please try to include relevant debugging information such as your node, npm, and babel versions.

### Internationalization Support

In keeping with the goals of this project, no internationalization support is provided out of the box. However, [juanda99](https://github.com/juanda99) has been kind enough to maintain a fork of this repo with internationalization support, [check it out!](https://github.com/juanda99/react-redux-starter-kit)

### 执行编译时编辑器的cpu占用过高

While this is common to any sizable application, it's worth noting for those who may not know: if you happen to notice higher CPU usage in your editor after compiling the application, you may need to tell your editor not to process the dist folder. For example, in Sublime you can add:

```
	"folder_exclude_patterns": [".svn",	".git",	".hg", "CVS",	"node_modules",	"dist"]
```

repository: alpar/react-redux-starter-kit-chinese

repo_name: alpar/react-redux-starter-kit-chinese


text:
# probable-octo-broccoli

## Table of Contents
 - [Running the Project](Running)
 - [API Documentation](API)
 - [File Structure](Structure)
 - [Logs Examples](Logs)
 ## Running
   1. Install Docker for Windows or Docker for Mac [DOCKER INSTALLATION GUIDE](https://docs.docker.com/install/)

   2. Open a command prompt at the root of the application's folder.

   3. Run `docker-compose build`

   4. Run `docker-compose up`

   5. Run `docker ps -aqf "name=ITAU_SERVER_APP"` and note the ID of the Node container

   6. Run `docker exec -it <nodeContainerID> sh` (replace <nodeContainerID> with the proper ID) to sh into the container

   7. Run `npm run generate-mongo` to seed the MongoDB database

   8. Type `exit` to leave the sh session

   9. Navigate to http://localhost:3000 to try the api or to localhost:6660/metrics to see the metrics execution for the api

  or
   2. Run `sh run.sh`

   3. Run `docker ps -aqf "name=ITAU_SERVER_APP"` and note the ID of the Node container

   4. Run `docker exec -it <nodeContainerID> sh` (replace <nodeContainerID> with the proper ID) to sh into the container

   5. Run `npm run generate-mongo` to seed the MongoDB database

   6. Type `exit` to leave the sh session

   7. Navigate to http://localhost:3000 to try the api or to localhost:6660/metrics to see the metrics execution for the api

 ## API
   [API DOCUMENTATION](https://documenter.getpostman.com/view/10126655/SzYaVy4T?version=latest)
   [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/b5496213dbf511c47691)
   ### Get All Breeds
   #### Request

   `GET api/v1/cats/breed/`

        curl -i -H 'Accept: application/json' localhost:3000/api/v1/cats/breed
   #### Response

        HTTP/1.1 200 OK
        Date: Thu, 24 Feb 2011 12:36:30 GMT
        Status: 200 OK
        Connection: close
        Content-Type: application/json
        Content-Length: 2
        X-Response-Time: 143.004ms
        [
          {
                 "id": "abys",
                 "name": "Abyssinian"
           }
        ]
 ### Get a specific Breed

 #### Request
 `GET api/v1/cats/breed/{breed_name}`

     curl -i -H 'Accept: application/json' localhost:3000/api/v1/cats/breed/abys

 #### Response

     HTTP/1.1 200 OK
     Date: Thu, 24 Feb 2011 12:36:30 GMT
     Status: 200 OK
     Connection: close
     Content-Type: application/json
     Content-Length: 36
     X-Response-Time: 143.004ms
     {
         "temperament": [
             "Active",
             "Energetic",
             "Independent",
             "Intelligent",
             "Gentle"
         ],
         "photos": [
             "https://cdn2.thecatapi.com/images/3ut.jpg",
             "https://cdn2.thecatapi.com/images/4ra.gif",
             "https://cdn2.thecatapi.com/images/MTk5NDY0MQ.jpg"
         ],
         "_id": "5e86cb69660ef459caf0f932",
         "id": "abys",
         "__v": 0,
         "description": "The Abyssinian is easy to care for, and a joy to have in your home. They’re affectionate cats and love both people and other animals.",
         "name": "Abyssinian",
         "origin": "Egypt"
     }
 ### Get all breeds with a specific temperament

  #### Request
  `GET api/v1/cats/breed/temperament/{temperament_name}`

      curl -i -H 'Accept: application/json' localhost:3000/api/v1/cats/breed/temperament/Friendly

  #### Response

      HTTP/1.1 200 OK
      Date: Thu, 24 Feb 2011 12:36:30 GMT
      Status: 200 OK
      Connection: close
      Content-Type: application/json
      Content-Length: 36
      X-Response-Time: 143.004ms
      [
          {
              "id": "bamb",
              "name": "Bambino"
          },
          {
              "id": "buri",
              "name": "Burmilla"
          },
          {
              "id": "lihu",
              "name": "Dragon Li"
          },
          {
              "id": "hbro",
              "name": "Havana Brown"
          },
          {
              "id": "lape",
              "name": "LaPerm"
          },
          {
              "id": "ocic",
              "name": "Ocicat"
          },
          {
              "id": "raga",
              "name": "Ragamuffin"
          },
          {
              "id": "ragd",
              "name": "Ragdoll"
          },
          {
              "id": "sphy",
              "name": "Sphynx"
          }
       ]
  ### Get all breeds from a specific origin

    #### Request
    `GET api/v1/cats/breed/origin/{origin_name}`

        curl -i -H 'Accept: application/json' localhost:3000/api/v1/cats/breed/origin/Canada

    #### Response

        HTTP/1.1 200 OK
        Date: Thu, 24 Feb 2011 12:36:30 GMT
        Status: 200 OK
        Connection: close
        Content-Type: application/json
        Content-Length: 36
        X-Response-Time: 143.004ms
        [
            {
                "id": "cymr",
                "name": "Cymric"
            },
            {
                "id": "sphy",
                "name": "Sphynx"
            },
            {
                "id": "tonk",
                "name": "Tonkinese"
            }
        ]

 ## Structure
 ### CODE STRUCTURE
 ```
 probable-octo-broccoli
 ├── node_modules => folder with all node dependencies.
 ├── src => source code for the application.
 └──├── api => folder with classes that deal with all the api`s used.
    ├── config => folder with all the configuration object used in all the project.
    ├── controller => folder that deals with all the logic of the endpoint.
    ├── enums => all the enums and constants.
    ├── model => classes that projects the object validation for the api.
    ├── util => todos os utils da aplicacao.
    ├── routes => all the endpoint routes for the application
    ├── app.js => class that has all the configuration for the server
    ├── generateDatabase.js => class capabale for generating the seed for the mongo database
    ├── init.js => class responsible for initiate the node server
 ├── .dockerignore => file responsible for excluding files for the build of the container
 ├── .eslintrc.js => lint configuration file for node.
 ├── .gitignore => file responsible for excluding certain files and folder for git
 ├── docker-compose.yml => file responsible for getting everything together.
 ├── Dockerfile => file responsible building the image of the server apllication
 ├── package.json => file responsible for all the packages and dependencies of the project.
 └── package-lock.json => file generated by npm (node package manager)
 ```
### Architecture
   ![Architecture](https://miro.medium.com/max/2208/1*oaqKLJhk2EkoRy5tycN41w.png)
   Basically, we have a mongodb cluster running on port 27017, and our server is running on port 3000 and our exposed metrics for the api is running at port 6660, all that inside the container.
    We Then use the Docker Compose Network link to make both Mongo Cluster and Server to communicate to each other :

    ```

        version: "3"
        services:
          server:
            container_name: ITAU_SERVER_APP
            restart: always
            build: .
            ports:
              - "3000:3000"
              - "666:666"
            links:   <==  LINKS BOTH MONGO AND SERVER TO THE SAME NETWORK
              - mongo
          mongo:
            container_name: MONGODB
            image: 'mongo'
            ports:
              - "27017:27017"
    ```

 ## Logs
   For the LOGS, i decided to go with [Loggy](https://www.loggly.com/), since loggly has a free plan usage and a well documented and highly active community of mainters of their libraries.
   HERE`S A EXAMPLES, SHOWING THE LOGS OF BOTH SERVER AND MONGO_CLUSTER IN REAL-TIME:
   ![LIVE LOGS](images/Screenshot_20.png)

repository: ArchanjoJr/probable-octo-broccoli

gha_language: JavaScript

repo_name: ArchanjoJr/probable-octo-broccoli


text:
# GEOGRAPICS FE

Geograpics is an app that takes your photos

## FEATURES

  1. instagram social auth login

  2. display map with geo-location markers of photos from instagram account
    * pop-up with larger display of photo taken at marker location
    * map has zoom control with compass for direction

  3. profile icon
    * logout and placeholder text for future updates

## TESTS

  1. __What We Chose__
    * Jest, Enzyme, and Cypress

  2. __Why We Chose__
    * Jest is a widely adopted testing framework used for testing React applications. It acts as a test runner, assertion library, mocking library, and comes bundled with Create-React-App for ease of use. It serves as an excellent test-runner which Enzyme utilizes to assert, manipulate, and traverse a React Components’ output. Enzyme is a JavaScript Testing utility for React that makes it easier to render a component (or multiple components), find elements, and interact with elements during testing. Its primary purpose when used alongside Jest is to provide additional functionality.

  3. __Test Command__
    * yarn run test

repository: bwpeck/geograpics-fe

repo_name: bwpeck/geograpics-fe


text:
# PsiQuaSP
## Permutation symmetry for identical Quantum Systems Package

PsiQuaSP is a library that enables easy and quick setup of quantum optical Lindblad quantum master equation simulations for PETSc and SLEPc.
The main feature of the library is the ability to treat permutationally symmetric many multi-level system setups with polynomial instead of exponential complexity.
The methodology of this approach is described in:

 + [M. Richter, M. Gegg, TS. Theuerholz and A. Knorr, Phys. Rev. B 91, 035306 (2015)](https://doi.org/10.1103/PhysRevB.91.035306)

 + [M. Gegg and M. Richter, New. J. Phys. 18, 043037 (2016)](https://doi.org/10.1088/1367-2630/18/4/043037)

 + [M. Gegg and M. Richter, Sci. Rep. 7, 16304 (2017)](https://doi.org/10.1038/s41598-017-16178-8)

The library only provides setup functions for the master equation and the program output, the computing stage is solely done by the PETSc and SLEPc packages.
PETSc and SLEPc are state of the art sparse linear algebra and differential equations packages that are continuously improved.
This makes PsiQuaSP computations very fast and efficient and automatically enables the user to employ the latest and fastest solution algorithms.
PsiQuaSP uses a vectorized form of the Lindblad equation, treating density matrices as vectors and Liouville superoperators as matrices.
This enables the library to directly interface to the entirety of the PETSc/SLEPc linear algebra and time integration methods.
The PETSc matrices are sparse by default, making PsiQuaSP very storage efficient. PETSc and SLEPc support MPI distributed memory parallelism, thus providing good scalabiltiy of the library.
PETSc/SLEPc also provide interfaces to a large variety of additional, external packages, e.g. serial and parallel, sparse and dense linear algebra packages such as LAPACK, ARPACK, MUMPS, etc.
or graph paritioning libraries for optimal parallel performance such as METIS/PARMETIS, SCOTCH, etc. Thus PETSc/SLEPc provides an incredibly rich and versatile toolbox for all sorts of differential
equation/linear algebra computations and PsiQuaSP is designed in a way that provides the user with maximal flexibility in the choice of the solution methods.

Installation instructions can be found in the INSTALL.md file.

### Documentation
PsiQuaSP uses Doxygen commenting by Dimitri van Heesch, http://www.stack.nl/~dimitri/doxygen/. Install doxygen and run

`doxygen Doxyfile`

in the PsiQuaSP folder. The doxumentation will be build into the `doc/` folder.
Example codes introducing a large portion of the features of PsiQuaSP are in the `example/` folder.

### Team
PsiQuaSP Team: Michael Gegg and Marten Richter

Theoretical, algorithmic, and numerical concepts and strategies: Michael Gegg and Marten Richter

Implementation: Michael Gegg

repository: modmido/psiquasp

repo_name: modmido/psiquasp


text:
# vici-recordings2cloud
This script moves ViciDial recordings into the Google Cloud Storage

## How to
1. Copy example config file.
```
cp vici-config.example.php vici-config.php
```
2. Edit config file to setup your Google Cloud Storage bucket
3. Set up a cron job
```
*/15 * * * *   export CLOUDSDK_PYTHON=/usr/local/bin/python2.7 && /usr/bin/php PATH/vici-recordings2cloud.php
```


text:
# Initiating and Planning Projects

# About this Course
The courses in the Introduction to Project Management Principles and Practices Specialization are a recommended precursor to UCI's Applied Project Management Certificate. Successful projects require careful upfront planning. In this course, you’ll learn the key roles and responsibilities of the project manager and project team. You’ll also learn to answer some key questions upfront to help you meet project objectives: What will this project accomplish? Why is this project important? Who benefits from this project? How will we plan for successful outcomes?

# Upon completing this course, you will be able to:
* Identify the key characteristics of a project
* Identify primary project constraints
* Define the role and responsibilities of the project manager
* Identify Project Organizational Structures
* Understand the definition of a Project Stakeholder
* Identify project stakeholders
* Identify information needs of the project stakeholders
* Define responsibility for managing stakeholder and controlling stakeholder engagement
* Define the purpose of using a project charter
* Summarize the key elements of a project plan
* Identify common sources of conflict within a project environment
* Describe the difference between authority and influence

# This course is part of multiple programs
This course can be applied to multiple Specializations or Professional Certificates programs. Completing this course will count towards your learning in any of the following programs:
- Project Management Principles and Practices Specialization (Enrolled) [https://www.coursera.org/specializations/project-management]
- Project Management & Other Tools for Career Development Specialization [https://www.coursera.org/specializations/project-management-success]

# WHAT YOU WILL LEARN
- Identify project stakeholders
- Define the role and responsibilities of the project manager
- Summarize the key elements of a project plan
- Anticipate common sources of conflict within a project environment

# SKILLS GAINED
* Project Management
* Project
* Planning
* Project Planning

# Instructor
Margaret Meloni, MBA, PMP

Instructor, University of California, Irvine

Division of Continuing Education

# University of California, Irvine
Since 1965, the University of California, Irvine has combined the strengths of a major research university with the bounty of an incomparable Southern California location. UCI’s unyielding commitment to rigorous academics, cutting-edge research, and leadership and character development makes the campus a driving force for innovation and discovery that serves our local, national and global communities in many ways.

path: /01-Initiating and Planning Projects/Readme.md


text:
# NinjaKit
yet another greasemonkey

## Install
- Chrome

    [https://chrome.google.com/webstore/detail/gpbepnljaakggeobkclonlkhbdgccfek](https://chrome.google.com/webstore/detail/gpbepnljaakggeobkclonlkhbdgccfek)

- Safari

    [http://ss-o.net/safari/extension/NinjaKit.safariextz](http://ss-o.net/safari/extension/NinjaKit.safariextz)

- Opera

    coming soon...

## Hacking
### Safari
The extension is built and installed from within Safari itself, using the Develop menu and the Extension Builder. For more information, see [Apple's guide](https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/UsingExtensionBuilder/UsingExtensionBuilder.html#//apple_ref/doc/uid/TP40009977-CH2-SW1) on the subject.

## License
- [MIT License](http://os0x.mit-license.org/)

[![endorse](http://api.coderwall.com/os0x/endorsecount.png)](http://coderwall.com/os0x)


text:
---
layout: post
title: Bible exchange Features: Current and Comming
---

## Contents

1. [Public Features](#biblefeatures "Bible Features")
2. [Member Features](#memberfeatures "Member Features")

## Public Features

Public features are all Bible exchange features accessible to anyone with a browser and internet connection. No registration is required to access these features.

## Bible

### Bible Reading

### Bible Verse Cross References

### Bible Search

## Member Features


text:
# Restrict Editing

This constraint attribute rule evaluates the user from edit tracking and an table to determine if the user can edit a feature of this type.

## Use cases

In a electric network, only certain editors are allow to modify certain features.

## Workflow

Using ArcGIS Pro, use the Add Attribute Rule geoprocessing tool to define this rule on a feature class and optionally on a subtype in that feature class.  Use the following values when defining the rule, the other options are not required or depend on your situation.

  - **Rule Type:** Constraint
  - **Triggering Events:** Insert, Delete or Update

## Expression Template

This constraint attribute rule evaluates the user from edit tracking and an table to determine if the user can edit a feature of this type.
An example with using this rule is included in the [Example](./restrict_editing.zip).
To demonstrate, open and add both the class and table to the map.  The rules is configured on update.  Only Bob and Frank are allowed to edit.

```js
var fc = 'ElectricDevice';
var uac_fs = FeatureSetByName($datastore, 'UAC', ['featureClass', 'assetGroupCode', 'assetTypeCode', 'UAC'], false);
var sql = "featureClass = '" + fc + "' AND " + 'assetGroupCode = ' + $feature.assetgroup + ' AND ' + 'assetTypeCode = ' + $feature.assettype
var result = Filter(uac_fs, sql);
if (count(result) == 0) {
    return true;
}
var row = First(result);
var valid_users = Split(row['UAC'], ';');
var cleaned_users = [];
for (var i in valid_users) {
    cleaned_users[count(cleaned_users)] = Trim(valid_users[i]);
}
if (IndexOf(cleaned_users, $feature.updatedby) >= 0) {
    return True;
}

return {'errorMessage': 'You are not allowed modify/create/delete this feature'};

```

repository: gdherbert/arcade-expressions

repo_name: gdherbert/arcade-expressions


text:
# Interacting with Text Files

UNIX and some of the commong scripting languages (Python, Perl, Ruby) are adept at interacting with and processing text files.

Reminder that  **more** and **less* are ways to read these files one page at a time

**grep** allows for searching for a text string in one or multiple files. There are powerful expressions that can be used.

`-A[N]` - display N lines after a match
`-B[N]` - display N lines before a match
`-P`    - support powerful perl / python regular expression syntax
`-c`    - return the count of the number of lines that match
`-v`    - only report lines that don't match

```bash
grep -c "\texon\t" data/genomic/Ncrassa.gff
grep -c "\tmRNA\t" data/genomic/Ncrassa.gff
10815
```

# Text Editors

**nano** also try **pico** - these are super simple text editors with build in menus. Useful on the command line.

**vi** - One of the most powerful editors. It has a lot of built-in commands to remember which require some mastery. Most common question is how to exit -- use 'ESC' and then type ":q" - the `:` is part of telling vi you are sending it a command. `q` means quite and `wq` means write and quit.

There are many useful built in commands
   - use `/` to search for a term.
   - use `:s/x/y/` to replace all instances of `x` on a line with `y`
   - use `:s/x/y/g` to globally replace all instances of x with y on a line

**emacs** - A powerful graphical or command-line editor. There are graphical menus.

   - Try `emacs -nw` to run emacs without graphical window. Useful on a command-line only login interface.
   - Graphical windows make it easy to switch back and forth between command line.
   - When you start up graphical emacs put it in the background by typing the `&` at end.
  So
  ```Bash
  emacs myfile.sh &
  ```

# Formatted printing

On bash can can use the **echo** and **printf** commands to print messages. These can be sent to the screen or to the

**printf** can be used
```
printf "%-10s hello\n" "ab" # left formatted
printf "%10s hello\n" "ab" # right formatted
printf "%.2f formatted float\n" "12.333334"
printf "%.2f\tformatted float\n" "12.333334"

$ printf "%.2e formatted scientific\n" "120000.1"
1.20e+05 formatted scientific
```

gha_language: Shell


text:
---
id: perspective
title: Perspective
---

Even though this is a text-based game, think of it as two-dimensional where you
are viewing the level's floor from overhead.

Each level is always rectangular in shape and is made up of a number of squares.
At the edge of the level there are walls, you can't move there. You can move to
any other square (including the stairs) that isn't already occupied by another
unit. Only one unit can be on a given square at a time.

Here is an example of a level's floor map and key:

```
╔════╗
║C s>║
║ S s║
║C @ ║
╚════╝

> = stairs
@ = Spartacus (20 HP)
s = Sludge (12 HP)
S = Thick Sludge (24 HP)
C = Captive (1 HP)
```

repository: opencollective/warriorjs

repo_name: opencollective/warriorjs


text:
# Code gallery

This page gives an overview of the code gallery. Compared to the tutorials, these programs
do not focus on teaching Ferrite, but rather focus on showing how Ferrite can be used "in
the wild".

!!! note "Contribute to the gallery!"
    Most of the gallery is user contributed. If you use Ferrite, and have something you want
    to share, please contribute to the gallery! This could, for example, be your research
    code for a published paper, some interesting application, or just some nice trick.

---

#### [Helmholtz equation](../helmholtz/)

Solves the Helmholtz equation on the unit square using a combination of Dirichlet and
Neumann boundary conditions and the method of manufactured solutions.

*Contributed by*: Kristoffer Carlsson ([@KristofferC](https://github.com/KristofferC)).

---

#### [Nearly incompressible hyperelasticity](../quasi_incompressible_hyperelasticity/)

This program combines the ideas from [Tutorial 3: Incompressible
elasticity](../../tutorials/incompressible_elasticity/) and [Tutorial 4:
Hyperelasticity](../../tutorials/incompressible_elasticity/) to construct a mixed element
solving three-dimensional displacement-pressure equations.

*Contributed by*: Bhavesh Shrimali ([@bhaveshshrimali](https://github.com/bhaveshshrimali)).

---

#### [Ginzburg-Landau model energy minimization](../landau/)

A basic Ginzburg-Landau model is solved.
[ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl) is used to compute the
gradient and hessian of the energy function. Multi-threading is used to parallelize the
assembly procedure.

*Contributed by*: Louis Ponet ([@louisponet](https://github.com/louisponet)).

---

#### [Topology optimization](../topology_optimization/)

Topology optimization is shown for the bending problem by using a SIMP material model. To
avoid numerical instabilities, a regularization scheme requiring the calculation of the
Laplacian is imposed, which is done by using the grid topology functionalities.

*Contributed by*: Mischa Blaszczyk ([@blaszm](https://github.com/blaszm)).

gha_language: Julia

gha_license_id: NOASSERTION


text:
# KidsWords

KidsWords is an international collaborative research project on the early language development of children growing up in New Zealand.
One of the aims of the project is to establish normative data for the New Zealand adaptation of the
*MacArthur-Bates Communicative Development Inventory: Words & Sentences* (PDF version available above). Another aim is to examine factors thought to be associated with children's early vocabulary and grammatical development.

Over 2,500 parents of toddlers between 16 and 30 months of age, from every region of New Zealand, participated and data were collected online at kidswords.org (website no longer active).

The purpose of this repository is to make our data analyses transparent and reproducible. To that end, text-based R scripts and data files (CSV format) will be placed here as they become available.

![](images/gcrq_vocab_comb.jpg)

### Research Team

* Thomas Klee, The University of Hong Kong
* Stephanie F Stokes, The University of Hong Kong
* Elaine Reese, University of Otago
* Rune Jørgensen, University of Southern Denmark
* Dorthe Bleses, Aarhus University
* William J Gavin, Colorado State University
* Nuttanan Witchitaksorn, Auckland University of Technology

### Funding

Funding was provided by the [Marsden Fund of the Royal Society of New Zealand](http://royalsociety.org.nz/programmes/funds/marsden/) (UOC 1003) to Thomas Klee, Stephanie F Stokes and Catherine Moran, University of Canterbury, and by the [MacArthur-Bates CDI Advisory Board](https://mb-cdi.stanford.edu/board.html).

![](images/CMDS1836_Kids_Word_Banner.jpg)

license: Unlicense

repository: thomasklee/KidsWords

repo_name: thomasklee/KidsWords


text:
# BSS Lecture Codes
## Reza Sameni
## Emory University Department of Biomedical Informatics

A short lecture of blind-source separation algorithms with practical examples in Matlab
### BMI 500 Week 11 Assignment
### Student Name: Gulay Bengu Ulukaya
### Student Email<EMAIL_ADDRESS>***
### Question 1
#### Part A
Below is the calculation of the eigenvalues and eigenvectors of the matrix 𝐶 = (5 1;1 2) by mathematical derivation.
The first image shows the calculation of eigenvalues of this matrix to be 1.6972 and 5.3028.
The second image shows the calculation of eigenvectors of this matrix to be [-(-3+sqrt(13))/2 1] and (3+sqrt(13))/2 1].
These are the null space vectors derived from each eigenvalue of this matrix.

![image](https://user-images.githubusercontent.com/61863714/140797215-66fdf257-21e4-4b58-9f17-1fdfe76e85e3.png)
![image](https://user-images.githubusercontent.com/61863714/140797251-1eedf3bc-cee6-44a3-af27-48c8e29abe79.png)

#### Part B
Below is the calculation of the eigenvalues and eigenvectors of the matrix 𝐶 = (5 1;1 2) by MATLAB function eig().
The columns of V present eigenvectors of A. The diagonal matrix D contains eigenvalues.

![image](https://user-images.githubusercontent.com/61863714/140797943-f5446c9a-0ea3-4851-be13-deac4ebdc244.png)

From the diagonal matrix D, we can visually confirm that the manual and MATLAB computations of the two eigenvalues are equal to be 1.6972 and 5.3028.
However, we need to confirm that the eigenvectors from MATLAB, [0.2898 -0.9571] and [-0.9571 -0.2898], are within the null space vectors that are manually calculated. The confirmation is below:

![image](https://user-images.githubusercontent.com/61863714/140797310-90d3a714-3f0b-4038-9117-b4da195dd91c.png)

From this calculation, we can conclude that the MATLAB calculated eigenvectors are within the manually calculated null space vectors.
***
### Question 2
#### Part A
I have manipulated the Ex02 m. file to calculate the eigenvalues and eigenvectors of the matrix 𝐶 = (5 1;1 2) by using the Power Method.
The screenshot of the edited script is below:

![image](https://user-images.githubusercontent.com/61863714/140798950-b4db21e9-f07f-4aa3-a709-c3631c2a2121.png)

The result is below:

![image](https://user-images.githubusercontent.com/61863714/140799091-f19289d2-efc6-4bcb-a308-52f3ea9643c4.png)

From this calculation, we can conclude that by using the Power Method with 100 iterations calculated eigenvectors, [0.2898 -0.9571] and [-0.9571 -0.2898], and eigenvalues, 1.6972 and 5.3028, are the same as the eig() function.

#### Part B
I have manipulated the Ex02 m. file to calculate the eigenvalues and eigenvectors of the matrix 𝐶 = (5 1;1 2) by using the Power Method.
The screenshot of the edited script is below:

![image](https://user-images.githubusercontent.com/61863714/140799255-8f709e27-276a-4656-800a-8d02b53db099.png)

The resulting leading eigenvalue and two entries of the principal vector for each of the first 20 iterations of the Power Method are in a table below:

![image](https://user-images.githubusercontent.com/61863714/140800383-7890b761-c2f0-4a22-9b40-2a8a649ad245.png)

Plot of the leading eigenvalue and two entries of the principal vector for each of the first 20 iterations of the Power Method are plotted below:

![image](https://user-images.githubusercontent.com/61863714/140800613-4a7d9ccd-d4af-4029-8edc-4a5fc3febf6f.png)
***
### Question 3
#### Part A
I have revised (by change of parameters or input signals and adding comments) and rerun the MATLAB sample m-files Ex01 to Ex05 from the BSS lecture repository.
The edited m-files Ex01 to Ex05 are commited to this fork.

#### Part B
#### Ex01
testPCA method in this Matlab script is used to reduce components from the original data and compressing the data by extracting the most prominent features to best represent the data. Depending on the PCA threshold, the reduced component signal gets closer or further away from the original data. The method calculates covariance matrix, and gets all eigenvalues and eigenvectors, while eventually keeping the most descriptive eigenvalues. Functionality of this function, PCA in general, is that by using the most representative features, we can get a signal very close to the original signal for efficiency in computing.
#### Ex02
This script calculates the eigenvalues and eigenvectors of a matrix by using the power method. As the number of iterations increase, the result from the power function gets closer to the actual eigenvalues and eigenvectors of the matrix, and at some iteration converges to these values. After convergence, the power method approximation of all values remain constant, no matter how many more iterations are performed. Functionality of this function arises from its efficiency, especially compared to the eig() function in Matlab. However, excessive iterations after convergence can reduce this efficiency.
#### Ex03
This script runs three different methods for independent component analysis, which are FactICA, SOBI and JADE and by applying these methods on an EEG dataset, compares the results. Independent component analysis is an essential method for compressing signals by extracting dominant features and keeping the compressed signal close to the original signal with all features, while increasing efficiency. The independent component analysis results from all three methods looks similar when comparing the most important features, where in the top ranks the order changes but the selected signals are the same. And the resulting compressed data is very similar to the original data.
#### Ex04
This script is used to remove electrooculographic (EOG) signals from EEG signals. EOG signals are treated as noise and JADE and NSCA methods are used for this procedure and results are compared. The script assumes that the electrode is picking up both EEG and EOG signals and their independence from each other. The script separates the signal from electrodes into different components, removes detected EOG and reconstructs a de-noised signal with the intended EEG signal.  The component selection for EOG is critical because when done right it is de-noising the EEG signal however with incorrectly selected components, it can remove essential parts of the EEG signal. The script also plots the reconstructed signals when JADE is utilized and when NSCA is utilized. We can see that there are differences between the two methods, so we can conclude that this is a delicate process and the optimal method should be used to remove the intended signals.
#### Ex05
This script is from OSET/testPrograms. The input data is ECG monitoring of fetus by having electrodes on the mother’s stomach. However, the input data has signals from both the fetus and the mother. The algorithm aims to separate fetal signals from the maternal signals. Many methods are used for blind source separation such as PCA, ICA, PiCA, FastICA, JADE and SOBI. The results from the signals all look similar to each other. It is difficult to assess which method provides the best separated fetal ECG, but from the plots it seems like PiCA method shows the least noisy signal compared to others.

***
### Question 4
#### Part A
Paper selected: Lee, T. W., & Lewicki, M. S. (2002). Unsupervised image classification, segmentation, and enhancement using ICA mixture models. IEEE Trans Image Process, 11(3), 270-279. https://doi.org/10.1109/83.988960

This paper works on learning algorithms of blind source separation by independent component analysis mixture model. Methods are benchmarked on real world data sets and also synthetically produced data sets. These data sets are classified using blind source separation by independent component analysis mixture model and accuracy of classification is measured to benchmark the method.

Blind source separation by independent component analysis is a currently used method for processing signals like medical signals and enhancing speech. The aim for this method is to make the variables less statistically dependent from each other by finding a linear nonorthogonal coordinate system and re-structuring the data.

Independent component analysis is limited in the way that it assumes independence of sources. However, by implementing mixture models, the stress on this assumption is reduced. In independent component analysis mixture model, the data is categorized into separate classes and then independent component analysis is applied. This means that after separation into these mutually exclusive classes, data in each class separately is assumed to have been generated by a linear combination of independent and non-Gaussian sources.

Independent component analysis mixture model pseudo-code based on (Lee & Lewicki, 2002):

•	Assume data are independent and generated by mixture density model

•	Calculate joint density

•	Separation into mutually exclusive classes

•	Calculate mixture density

•	Compute log-likelihood for each class

•	Compute probability of each class given the data vector

•	Adapt basis functions and bias terms for each class using gradient ascent

•	Adaptation with mixture density model is applied, proceed with unsupervised classification

Resource:
Lee, T. W., & Lewicki, M. S. (2002). Unsupervised image classification, segmentation, and enhancement using ICA mixture models. IEEE Trans Image Process, 11(3), 270-279. https://doi.org/10.1109/83.988960


text:
# Game of Life
Game of Life is a ReactJS app built for [a freeCodeCamp project](https://www.freecodecamp.com/challenges/build-the-game-of-life).

## Demo
[ReactJS Game of Life - Demo](https://reactjs-game-of-life.herokuapp.com/)

### Boilerplate
https://github.com/StephenGrider/ReduxSimpleStarter

repository: laniywh/game-of-life

repo_name: laniywh/game-of-life


text:
# Ping-Play

This is a sample app for the
[Composable and streamable Play apps](http://www.slideshare.net/brikis98/composable-and-streamable-play-apps) talk at
[Ping Conference 2014](http://www.ping-conf.com/). A recording of the talk, which includes live coding demos with this sample app, is available on [ustream](http://www.ustream.tv/recorded/42801129).

The code shows some examples of how to:

1. Compose standalone endpoints (controllers) to build a more complex page from simpler parts
2. A prototype of [Facebook's BigPipe](https://www.facebook.com/note.php?note_id=389414033919) for Play: that is,
tools to break a page into "pagelets" and stream each pagelet to the browser as soon as the data is available.

This is just prototype code, intended for demonstration and education. There are no tests, so I wouldn't recommend
tossing it directly into production :)

# How to run the app

This is a standard [Play Framework](http://www.playframework.com/) app, built on Play 2.3.3. To run it,
[install Play](http://www.playframework.com/download) and do `activator run`.

# How to browse the code

The main example code to look at:

1. `app/controllers/Wvyp` and `app/controllers/Wvyu` are examples of simple, standalone modules.
2. `app/controllers/Aggregator` shows how these modules can be combined to build a more complicated module.
3. `app/controllers/WvypStream` shows how to stream the contents of a module using a BigPipe approach.
4. `app/ui` a reusable library for composing modules and streaming HTML.

# License

This code is available under the MIT license. See the LICENSE file for more info.

repository: tpresthus/ping-play

repo_name: tpresthus/ping-play


text:
# Cloud Bigtable

[Cloud Bigtable](https://cloud.google.com/bigtable/docs/overview) is a fully managed, high performance NoSQL database service for large analytical and operational workloads.

Fast access to extremly large datasets (>terabytes, petabytes) while updating these datasets continuouesly.

HBase - opensource implementation based on Bigtable paper

Began as the storage system for the __web search index__ at Google

Designed to handle large amounts of replicated, rapidly changing data and can be queried quickly wiht high concurrency (high throughput), while maintaining string consistency throughput.

A sparse, distributed, persistent, multi-dimentional sorted map (can go back in time)

Rebalances data

It supports HBase API for access and native compatibility with Hadoop systems.

## Design goals

* Large amount of (replicated) data
* Low latency, high throughput (millions of queries per second)
* Rapidly changing data
* History of data changes
* Strong consistency
* Row-level transactions (does not need ttransactional semantics across multiple rows)
* Subset selection

## Features

* Scale to billions of rows and thousands of columns (petabytes of data).
* Each row has a key that is indexed.
* Ideal for storing very large amounts of single-keyed data.
* High read and write throughput at very low latency (great for MapReduce operations).
* Simple administration handling upgrades and restarts transparently.
* Cluster resizing without downtime.
* Sparse storage where empty cells do not take up any space.
* Data is encrypted in-flight and at rest.
* Supports Role based ACLs.
* Data access can be through Application API, Streaming, or Batch Processing.
* Integrates with Cloud Dataflow and Cloud Dataproc.
* On-premise to cloud base operations supported.
* Can use Hadoop to both export and reimport data using Google Cloud Dataproc - a managed Hadoop service

## When to Use

Use Bigtable when you need very high throughput and scalability for non-structured key/value data where each value is typically less than 10 MB.

Bigtable also excels for:

* MapReduce operations.
* Stream processing / analytics.
* Machine learning applications.

* Terabytes or more data
* Usage sustained over a long period of time
* Tens to hundreds of thousands of queries per second
* Basic access to data - lookups and simple scan across keys

## Architecture

Instances, clusters, nodes, tablets (can be combined, split, and moved to other nodes)

## Limitations

* No secondary indexes (no "where")
* No multirow transactional semantics
* Have to think ahead about what type of questions you will want to ask about your data
* Have to choose row-key carefully to maintain performance
* Need to choose schema carelfully
* Costly - minimum $1400 per month (vs $30 minimum for Cloud SQL)

## Pricing

compute + storage + network

## ELI5

What is HBase?

> HBase is an open-source, non-relational, distributed database modeled after Google's Bigtable and is written in Java. It is developed as part of Apache Software Foundation's Apache Hadoop project and runs on top of HDFS (Hadoop Distributed File System), providing Bigtable-like capabilities for Hadoop. That is, it provides a fault-tolerant way of storing large quantities of sparse data.

_Credit [Wikipedia](https://en.wikipedia.org/wiki/Apache_HBase)_

repository: srujbop/notes-google-cloud-architect

path: /Storage/Cloud Bigtable.md

filename: Cloud Bigtable.md

gha_language: PowerShell

repo_name: srujbop/notes-google-cloud-architect


text:
# User API
The SDK will help the user to get User Authorization status and unlink the user from the client

# Integration

## Installation

```groovy
#To install the API client library to your local repository, simply execute:
gradle install
#Maven: Add this dependency to your project's POM:
<dependency>
    <groupId>jp.ne.paypay</groupId>
    <artifactId>paypayopa</artifactId>
    <version>1.0.1</version>
    <scope>compile</scope>
</dependency>
#Gradle: Add this dependency to your project's build file:
compile "jp.ne.paypay:paypayopa:1.0.1"
```
### Build your Client
Build your client by adding your API Key and Secret like defined below. We enable API Authentication using HMAC, however the SDK will take care of the authentication by itself. [Click here](https://www.paypay.ne.jp/opa/doc/v1.0/pending_payments#tag/Api-Authentication) if you want to know more about the authentication.
```java
    ApiClient apiClient = new Configuration().getDefaultApiClient();
    apiClient.setProductionMode(false); //true for production and false for sandbox. Default is sandbox
    apiClient.setApiKey("YOUR_API_KEY");
    apiClient.setApiSecretKey("YOUR_API_SECRET");
    apiClient.setAssumeMerchant("YOUR_MERCHANT_KEY");
```

### Get User Authorization Status
To get the current authorization status of the user, use the following method with the parameter below

| Field  | Required  |Type   | Description  |
|---|---|---|---|
|userAuthorizationId   |  Yes |string <= 64 characters  |The PayPay user reference id returned by the user authorization flow  |

```java

// Calling the method to get user authorization status
UserApi userApi = new UserApi(apiClient);
UserAuthorizationStatus response = userApi.getUserAuthorizationStatus("userAuthorizationId");
// Printing if the method call was SUCCESS
System.out.println(response.getResultInfo().getCode());

```
Did you get **SUCCESS** in the print statement above, if yes then the API execution has happened correctly.

For details of all the request and response parameters , check our [API Documentation guide](https://www.paypay.ne.jp/opa/doc/v1.0/continuous_payments#operation/getUserAuthorizationStatus).

### Unlink User
So you want to unlink the user from the client, use the following method with the parameter below

| Field  | Required  |Type   | Description  |
|---|---|---|---|
|userAuthorizationId   |  Yes |string <= 64 characters  |The PayPay user reference id returned by the user authorization flow  |

```java
// Calling the method to unlink the user from the client
UserApi userApi = new UserApi(apiClient);
NotDataResponse response = userApi.unlinkUser("userAuthorizationId");
// Printing if the method call was SUCCESS
System.out.println(response.getResultInfo().getCode());
```
Did you get **SUCCESS** in the print statement above, if yes then the API execution has happened correctly.

For details of all the request and response parameters , check our [API Documentation guide](https://www.paypay.ne.jp/opa/doc/v1.0/continuous_payments#operation/unlinkUser).

### Response code list

**Get user authorization status**

|Status	|CodeId	|Code	|Message|
|---|---|---|---|
|401	||	INVALID_USER_AUTHORIZATION_ID	|The specified user authorization ID is invalid.|

**Unlink User**

|Status	|CodeId	|Code	|Message|
|---|---|---|---|
|401	||	INVALID_USER_AUTHORIZATION_ID	|The specified user authorization ID is invalid.|

repository: javidlulu/paypayopa-sdk-java

repo_name: javidlulu/paypayopa-sdk-java


text:
# GraphTune

GraphTune is an effective and lightweight runtime system, which can be integrated into existing distributed graph processing systems. The user only needs to make a minor extension to existing system via simply inserting a few lightweight APIs provided by GraphTune, and then the system can obtain much higher throughput brought by GraphTune. No modification is needed for graph applications.

Integrated with existing graph processing systems
------------

To efficiently load the shared graph data, Access() replaces the original data load operation of existing system. Sync() replaces its original grab operation for synchronous processing of the chunks. Regularize() replaces its communication operation to achieve the optimized communication. Note that, to obtain the active chunks before each iteration, GetActiveChunks() is also provided, because this operation is used by some systems to skip the processing of inactive chunks. In the following part, we take D-Galois as an example to show how to execute the CGP jobs on the D-Galois integrated with GraphTune.

Dependencies
------------

D-Galois-T (i.e., the version of D-Galois integrated with GraphTune) depends on the following software:

- A modern C++ compiler compliant with the C++-17 standard (gcc >= 7, Intel >= 19.0.1, clang >= 7.0)
- CMake (>= 3.13)
- Boost library (>= 1.58.0, we recommend building/installing the full library)
- libllvm (>= 7.0 with RTTI support)
- libfmt (>= 4.0)
- Doxygen (>= 1.8.5) for compiling documentation as webpages or latex files
- PAPI (>= <IP_ADDRESS> ) for profiling sections of code
- Vtune (>= 2017 ) for profiling sections of code
- MPICH2 (>= 3.2) if you are interested in building and running distributed system
  applications in Galois
- Eigen (3.3.1 works for us) for some matrix-completion app variants

Compiling
------------

To build D-Galois-T, certain CMake flags must be specified:

`cmake ${GALOIS_ROOT} -DGALOIS_ENABLE_DIST=1`

Once CMake is successfully completed, you can build the `concurrent_jobs` and `Preprocessing` with the following command:

`make -j`

Preprocessing
------------

We first store the graph in a binary format called *D-Galois-T graph file*  (`.gr` file extension). Other formats such as edge-list can be
converted to `.gr` format with the tool `graph-convert` provided in D-Galois-T.
You can build graph-convert as follows:

```Shell
cd $BUILD_DIR
make graph-convert
./tools/graph-convert/graph-convert --help
```
Then, the graph is preprocessed for D-Galois-T as follows:

`GALOIS_DO_NOT_BIND_THREADS=1 mpirun -n=<# of processes> -hosts=<machines to run on> ./Preprocessing <input graph> -partition=<partitioning policy>`

Running Applications
------------
We can submmit the CGP jobs to D-Galois-T according to the real trace as follows:

`GALOIS_DO_NOT_BIND_THREADS=1 mpirun -n=<# of processes> -hosts=<machines to run on> ./concurrent_jobs <input graph> <number of submissions> <trace>`

repository: TACO-GraphTune/GraphTune

repo_name: TACO-GraphTune/GraphTune


text:
# fluentd for debugging

## Setup

```sh
$ bundle install
```

## Run

```sh
$ bundle exec foreman start
```

Then fluentd runs on `http://<IP_ADDRESS>:8888`

repository: giginet/CCFluentdLogger

repo_name: giginet/CCFluentdLogger


text:
# OpenBCI SD File Converter

Processing sketch to convert OpenBCI generated files written to microSD card from HEX to Decimal. Written in Processing. [www.processing.org](www.processing.org)

### Follow the prompt to select a file. The result will be saved in the `OBCI_Data` folder inside the sketch folder.


text:
% Record And Play Input Events

![](arcadeCabinet.png)

If you have noticed in an arcade, games automatically playing. This howto will show how it could be done.

---

Use this code to record input events and save to files.

**In main.c**

---

**Find:**

~~~ {.c}
// executes only just after startup
void afterStartup()
{

}
~~~

**And replace with:**

~~~ {.c}
#define REC 1
#define PLAY 2

int recOrPlay = REC;
char *readWriteAccess;
FILE *keyDownFilePtr;
FILE *keyUpFilePtr;
FILE *keyPressFilePtr;

// executes only just after startup
void afterStartup()
{
   if (recOrPlay == REC)
   readWriteAccess = "w+b";

   if (recOrPlay == PLAY)
   readWriteAccess = "r+b";

   if (recOrPlay)
   {
      keyDownFilePtr = fopen("keyDown.dat", readWriteAccess);
      keyUpFilePtr = fopen("keyUp.dat", readWriteAccess);
      keyPressFilePtr = fopen("keyPress.dat", readWriteAccess);
   }
}
~~~

---

**Find:**

~~~ {.c}
// executes just before shutdown
void beforeShutdown()
{

}
~~~

**And replace with:**

~~~ {.c}
// executes just before shutdown
void beforeShutdown()
{
   if (recOrPlay)
   {
      fclose(keyPressFilePtr);
      fclose(keyUpFilePtr);
      fclose(keyDownFilePtr);
   }
}
~~~

---

**Find:**

~~~ {.c}
   #include "initialize.c"
~~~

**And replace with:**

~~~ {.c}
   #include "initialize.c"

   if (recOrPlay == REC)
   {
      eventRecToFile((void **)keyDown, 256, keyDownFilePtr);
      eventRecToFile((void **)keyUp, 256, keyUpFilePtr);
      eventRecToFile((void **)keyPress, 256, keyPressFilePtr);
   }

   if (recOrPlay == PLAY)
   {
      eventPlayFromFile((void **)keyDown, 256, keyDownFilePtr);
      eventPlayFromFile((void **)keyUp, 256, keyUpFilePtr);
      eventPlayFromFile((void **)keyPress, 256, keyPressFilePtr);
   }
~~~

---

Compile and run.

---

---

Use this code to play input events that were saved to files.

---

**Find:**

~~~ {.c}
int recOrPlay = REC;
~~~

**And replace with:**

~~~ {.c}
int recOrPlay = PLAY;
~~~

---

Compile and run.

---

This can be setup to replay exactly the same over and over which makes it useful for debugging.

---


text:
+++
# Date this page was created.
date = 2017-01-01T00:00:00

# Project title.
title = "How Polycentric is Urban China?"

# Project summary to display on homepage.
summary = "We quantified the degree of polycentric urban development at both **intra-urban** and **inter-urban** levels in China with the U.S. Oak Ridge National Laboratory (ORNL)'s [LandScan](https://landscan.ornl.gov/) dataset."

# Optional image to display on homepage (relative to `static/img/` folder).
image_preview = "PUR_CN.png"

# Tags: can be used for filtering projects.
# Example: `tags = ["machine-learning", "deep-learning"]`

tags = ["polycentric_urban_development","China"]

# Optional external URL for project (replaces project detail page).
external_link = ""

# Does the project detail page use math formatting?
math = false

+++
**Polycentric urban development** refers to different forces causing multiple previously close-by but independent urban sub-divisions to become a larger and more integrated **urban system**. **Polycentricity** is oftentimes deemed a desirable urban form, generating greater agglomeration externalities as well as facilitating the achievement of social, economic, and environmental goals. Polycentric urban development has been observed and analyzed at various geographical scales, including the **intra-urban** (e.g., Central Business Districts (CBDs), edge cities, and satellite towns within a city), and **inter-urban** (e.g., the ‘Pearl River Delta’ mega-city region) scales.

Despite much insightful work on polycentric urban development in China, there is a lack of systematic comparison at either scale. Therefore, in this project, we identified polycentric urban structure and quantified the degree of polycentricity in China at both **intra-urban** scale (i.e., [318 Chinese cities]({{< ref "publication/2016_LANDUP.md" >}})) and **inter-urban** scale (i.e., [22 City-Regions]({{< ref "publication/2018_EPB.md" >}})) using detailed gridded population data, [U.S. Oak Ridge National Laboratory (ORNL)'s LandScan](https://landscan.ornl.gov/) dataset.

***

##### Intra-urban Polycentricity
![Chinese cities at prefecture level and above.](/img/LAND2016.jpg)
Chinese cities at prefecture level and above.

- Over 90% of cities have four or fewer intra-urban (sub)centers.
![hist_N](/img/land2016_N.png)

- Higher degree of polycentricity is found in **mountainous** cities.

- Polycentricity is positively associated with GDP per capita in **Eastern** China.

- Identified patterns of centers in a number of cities are largely consistent with corresponding master plans, for example, Shanghai and Beijing.
![shanghai](/img/land2016_sh.png)
![beijing](/img/land2016_bj.png)

***

##### Inter-urban Polycentricity: Polycentric Urban Regions (PURs)
![Polycentric Urban Regions (PURs) in China](/img/PUR_CN.png)

PUR|Full Name|Major Cities|Area*
---|---------|------------|----
BTH|Beijing-Tianjin-Hebei|Beijing, Tianjin|18.27
CSX|Central Shanxi|Taiyuan|2.79
CIM|Central Inner Mongolia|Hohhot|13.19
LDP|Liaodong Peninsula|Shenyang, Dalian|12.76
HAC|Harbin-Changchun|Harbin, Changchun|18.53
YRD|Yangtze River Delta|Shanghai, Nanjing, Hangzhou|10.05
CAH|Central Anhui|Hefei|8.63
EFJ|Eastern Fujian|Fuzhou, Xiamen (Amoy)|5.5
NJX|Northern Jiangxi|Nanchang|5.78
SDP|Shandong Peninsula|Jinan, Qingdao (Tsingtao)|7.39
CPL|Central Plain|Zhengzhou|5.68
EHB|Eastern Hubei|Wuhan|5.09
EHN|Eastern Hunan|Changsha|2.81
PRD|Pearl River Delta|Guangzhou, Shenzhen|5.47
SGX|Southern Guangxi|Nanning|4.26
CHC|Chengdu-Chongqing|Chengdu, Chongqing|26.65
CGZ|Central Guizhou|Guiyang|10.46
CYN|Central Yunnan|Kunming|9.45
GZP|Guanzhong Plain|Xi’an|5.54
LAX|Lanzhou-Xining|Lanzhou, Xining|6.85
NNX|Northern Ningxia|Yinchuan|4.07
TSM|Tianshan Mountains|Urumqi|9.56
*Area is in 10,000 sq. km*

***

- A typology of Chinese PURs is presented based on the average **intra-urban** polycentricity and **inter-urban** polycentricity, where there is only **limited** levels of association between inter-urban and inter-urban polycentricity.
![scatter](/img/epb2017_scatter.png)

- The **Yangtze River Delta** (see below) and **Pearl River Delta** have high levels of both **intra-urban** and **inter-urban** polycentricity.
![YRD](/img/epb2017_yrd.png)

- Most PURs in **Central** and **Western** China are characterized by a
primate urban system and low levels of inter-urban polycentricity, for example, the Central Guizhou (CGZ) PUR:
![CGZ](/img/epb2017_cgz.png)

***

##### References
- Xingjian Liu, **Mingshu Wang**. (2016).[How polycentric is urban China and why? A case study of 318 cities.]({{< ref "publication/2016_LANDUP.md" >}}) *Landscape and Urban Planning*, *151*, 10-20 (equal contribution).
- Xingjian Liu, Ben Derudder, **Mingshu Wang**. (2018). [Polycentric urban development in China: A multi-scale analysis.]({{< ref "publication/2018_EPB.md" >}}) *Environment and Planning B: Urban Analytics and City Science*, *45*(5), 953-972. [DOI](https://doi.org/10.1177/2399808317690155).


text:
## Versioned Query Engine
{:#versioned-query-engine}

In this section we introduce the versioned query engine that consists of the OSTRICH store and the Comunica framework.
We discuss these two parts separately in the following sections.

### OSTRICH

OSTRICH is the implementation of a [compressed RDF archive indexing technique](cite:cites ostrich) that offers efficient
triple pattern queries *in*, *between*, and *over* different versions.
In order to achieve efficient querying for these different query types,
OSTRICH uses a hybrid storage technique that is a combination of *individual copies*, *change-based* and *timestamp-based* storage.
The initial dataset version is stored as a fully materialized and immutable snapshot.
This snapshot is stored using [HDT](cite:cites hdt), which is a highly compressed, binary RDF representation.
All other versions are deltas, i.e., lists of triples that need to be removed and lists of triples that need to be added.
These deltas are relative to the initial version, but merged in a timestamp-based manner to reduce redundancies between each version.
In order to offer optimization opportunities to query engines that use this store,
OSTRICH offers efficient cardinality estimation, streaming results and efficient offset support.

### Comunica

[Comunica](cite:cites comunica) is a highly modular Web-based SPARQL query engine platform.
Its modularity enables federated querying over heterogeneous interfaces, such as [SPARQL endpoints](cite:cites spec:sparqlprot),
[Triple Pattern Fragments (TPF) entrypoints](cite:cites ldf) and plain RDF files.
New types of interfaces and datasources can be supported by implementing an additional software component
and plugging it into a publish-subscribe-based system through an external semantic configuration file.

In order to support _versioned_ SPARQL querying over an OSTRICH backend,
we [implemented](https://github.com/rdfostrich/comunica-actor-rdf-resolve-quad-pattern-ostrich){:.mandatory}
a module for resolving triple patterns with a versioning context against an OSTRICH dataset.
Furthermore, as versions within the SPBv benchmark are represented as *named graphs*,
we rewrite these queries in a [separate module](https://github.com/rdfostrich/comunica-actor-query-operation-contextify-version){:.mandatory}
to OSTRICH-compatible queries *in*, *between*, or *over* different versions as a pre-processing step.
Finally, we provide a [default Comunica configuration and script](https://github.com/rdfostrich/comunica-actor-init-sparql-ostrich){:.mandatory}
to use these modules
together with the existing Comunica modules as a SPARQL engine.
These three modules will be explained in more detail hereafter.

#### OSTRICH Module

OSTRICH enables versioned triple pattern queries *at*, *between*, and *for* different versions.
These query types are respectively known as _Version Materialization (VM)_, _Delta Materialization (DM)_ and _Version Querying (VQ)_.
In the context the SPBv benchmark, only the first two query types (VM and DM) are evaluated,
which is why only support for these two are implemented in the OSTRICH module at the time of writing.

The OSTRICH Comunica module consists of an actor that enables VM and DM triple pattern queries against a given OSTRICH store,
and is registered to Comunica's `rdf-resolve-quad-pattern` bus.
This actor will receive messages consisting of a triple pattern and a context.
This actor expects the context to either contain VM or DM information, and a reference to an OSTRICH store.
For VM queries, a version identifier must be provided in the context.
For DM queries, a start and end version identifier is expected.

The `rdf-resolve-quad-pattern` bus expects two types of output:

1. A stream with matching triples.
2. An estimated count of the number of matching triples.

As OSTRICH enables streaming triple pattern query results and corresponding cardinality estimation for all query types,
these two outputs can be trivially provided using the [JavaScript bindings for OSTRICH](https://github.com/rdfostrich/ostrich-node){:.mandatory}.

#### Versioned Query Rewriter Module

The SPBv benchmark represents versions as *named graphs*.
[](#spbv-vm) and [](#spbv-dm) respectively show examples of VM and DM queries in this representation.
Our second module is responsible for rewriting such named-graph-based queries into context-based queries that the OSTRICH module can accept.

<figure id="spbv-vm" class="listing">
````/code/vm.txt````
<figcaption markdown="block">
Version Materialization query for the `?s ?p ?o` pattern in version `http://graph.version.4` in SPV's named graph representation.
</figcaption>
</figure>

<figure id="spbv-dm" class="listing">
````/code/dm.txt````
<figcaption markdown="block">
Delta Materialization query for the `?s ?p ?o` pattern to get all additions between version
`http://graph.version.1` and `http://graph.version.4` in SPV's named graph representation.
</figcaption>
</figure>

In order to transform VM named-graph-based queries,
we detect `GRAPH` clauses, and consider them to be identifiers for the VM version.
Our rewriter unwraps the pattern(s) inside this `GRAPH` clause,
and attaches a VM version context with the detected version identifier.

For transforming DM named-graph-based queries,
`GRAPH` clauses with corresponding `FILTER`-`NOT EXISTS`-`GRAPH` clauses for the same pattern in the same scope are detected.
The rewriter unwraps the equal pattern(s),
and constructs a DM version context with a starting and ending version identifier.
The starting version is always the _smallest_ of the two graph URIs,
and the ending version is the _largest_, assuming lexicographical sorting.
If the graph URI from the first pattern is _larger_ than the second graph URI, then the DM queries only additions.
In the other case, only deletions will be queried.

#### SPARQL Engine

The Comunica platform allows SPARQL engines to be created based on a semantic configuration file.
By default, Comunica has a large collection of modules to create a default SPARQL engine.
For this work, we adapted the default configuration file where we added our OSTRICH and rewriter modules.
This allows complete versioned SPARQL querying, instead of only versioned triple pattern querying, as supported by OSTRICH.
This engine is available on the [npm package manager](https://www.npmjs.com/package/@comunica/actor-init-sparql-ostrich){:.mandatory} for direct usage.