text:
---
layout: project
title: Firefly
date: Oct 2016
thumbnail: /res/img/projects/firefly-thumb.jpg
thumbnail_size: full-img
client: HACKATHON
client_name: HackRU Fall 2016
role: Python & C developer. Circuit designer.
platforms: Raspberry Pi, Hardware tool
status: Complete
featured: True
desc: A new method of light painting. Upload images into the Firefly and "print" them out into a long exposure photograph.
---

As one heavily involved in CS and tech, I've learned to communicate logically and diagraphically, but beautiful code still makes for terrible conversation. I wanted to try an art project and explore other creative pastimes, so what better way is there than to intersect art with technology to create something new and meaningful?

So, I created something called Firefly. It’s a new form of light painting. Before we dig into how it works and what it does and the process of making it, we’ll need to take a step back and see what light painting is in the first place:

When you take a normal picture with a DSLR camera, the shutter opens to allow light into the camera's sensor for a brief instant, and then slams shut. This is the mechanical clicking sound you hear when you take photos.

In a long exposure photo, the shutter is open for an extended period of time, and all the light recorded during that period is combined into one picture. Bright, moving objects become more visible, while dark moving objects start to disappear. Automobile headlights and stars transform into streaks. Flowing rivers and waterfalls turn into glowing clouds.

Light painting is a photographic technique where you take a long exposure photograph and wave around sources of light to create your artwork.

That's Picasso painting a centaur. I have a hard time seeing it too.

There’s a few problems with it however. It's difficult to master and you're limited by drawing out each and every single line of light by hand. As a result, everything seems very hand-drawn or roughly drawn out. Also, expert light painters require a large set of expensive custom tools.

So instead of using all these tools, what if we had a rather long stick with a row of LEDs instead? We can upload an image to this stick, and as we hold it upright, walk around, and move the stick through 3D space, it'll sequentially display each pixel-column of the image on the LEDs.

For instance, to print out the green circle below, the Firefly would start with the right-edge column of pixels and progress to the left.

Input:

Process:

Result:

The code for the Firefly was initially only written in Python, but I realized that part of it had to be written in C to make performance as efficient as possible. The Pi had to read an image and control 288 LEDs simultaneously;if there was any lag, the images would be ruined.

The resolution and brightness of the Firefly were surprisingly fairly high, and my friends and I were able to create GIFs and pictures in well-lit rooms.

It took 26 tries to get this pic right.

The Firefly definitely made it possible to create light images that were impossible to normally create. It was like a printer as traditional light painting was the pen. Or like how photography is to painting. While the Firefly loses the aesthetics of more organic and three-dimensional hand drawn shapes, it's interesting to think about what new possibilities can be achieved. For instance, can the Firefly be used to implement datasets into artwork?

I had a ton of fun messing around with the Firefly with friends and seeing what we could create. If you'd like to see more photos, you can check out the album here. The DevPost page is also right here. The Firefly won the Best Hardware Hack category at HackRU.

gha_language: SCSS


text:
# most common words

Given a paragraph and a list of banned words, return the most frequent word that is not in the list of banned words.  It is guaranteed there is at least one word that isn't banned, and that the answer is unique.

Words in the list of banned words are given in lowercase, and free of punctuation.  Words in the paragraph are not case sensitive.  The answer is in lowercase.

### Example:

#### Input:
paragraph = "Bob hit a ball, the hit BALL flew far after it was hit."
banned = ["hit"]
#### Output: "ball"

#### Explanation:
"hit" occurs 3 times, but it is a banned word.
"ball" occurs twice (and no other word does), so it is the most frequent non-banned word in the paragraph.
Note that words in the paragraph are not case sensitive,
that punctuation is ignored (even if adjacent to words, such as "ball,"),
and that "hit" isn't the answer even though it occurs more because it is banned.

## Note:

* 1 <= paragraph.length <= 1000.
* 1 <= banned.length <= 100.
* 1 <= banned[i].length <= 10.
* The answer is unique, and written in lowercase (even if its occurrences in paragraph may have uppercase symbols, and even if it is a proper noun.)
* paragraph only consists of letters, spaces, or the punctuation symbols !?',;.
* There are no hyphens or hyphenated words.
* Words only consist of letters, never apostrophes or other punctuation symbols.

看懂题目意思，直接开始。不过，还是lee215的算法比较好：

```python
class Solution:
    def mostCommonWord(self, paragraph: str, banned: List[str]) -> str:
        ban = set(banned)
        words = re.findall(r'\w+', paragraph.lower())
        return collections.Counter(w for w in words if w not in ban).most_common(1)[0][0]
```

license: MIT

repository: hanleilei/leetcode

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: hanleilei/leetcode


text:
# utilities-bundle
Usefull symfony code. That applicable to any web-project. Project created to reuse code between different symfony
projects. Feature added than required.

### Mail cluster
To enable mail cluster add service with ClusterMailer:

    app.mailer:
        class:                      Multifinger\UtilitiesBundle\Service\ClusterMailer
        arguments<EMAIL_ADDRESS>%multifinger_mail_nodes%]

optionally add whitelist:

    app.mailer:
    ...
        calls:
            - [setWhitelist<EMAIL_ADDRESS>
or blacklist:

    app.mailer:
    ...
        calls:
            - [setBlacklist, [some@email, another@email]]

use this service as usual Swift_Mailer (currently only send method supported)

repository: multifinger/utilities-bundle

repo_name: multifinger/utilities-bundle


text:
---
slug: /en/interfaces/http
sidebar_position: 19
sidebar_label: HTTP Interface
---

# HTTP Interface

The HTTP interface lets you use ClickHouse on any platform from any programming language in a form of REST API. The HTTP interface is more limited than the native interface, but it has better language support.

By default, `clickhouse-server` listens for HTTP on port 8123 (this can be changed in the config).
HTTPS can be enabled as well with port 8443 by default.

If you make a `GET /` request without parameters, it returns 200 response code and the string which defined in [http_server_default_response](../operations/server-configuration-parameters/settings.md#server_configuration_parameters-http_server_default_response) default value “Ok.” (with a line feed at the end)

``` bash
$ curl 'http://localhost:8123/'
Ok.
```

Sometimes, `curl` command is not available on user operating systems. On Ubuntu or Debian, run `sudo apt install curl`. Please refer this [documentation](https://curl.se/download.html) to install it before running the examples.

Web UI can be accessed here: `http://localhost:8123/play`.

![Web UI](../images/play.png)

In health-check scripts use `GET /ping` request. This handler always returns “Ok.” (with a line feed at the end). Available from version 18.12.13. See also `/replicas_status` to check replica's delay.

``` bash
$ curl 'http://localhost:8123/ping'
Ok.
$ curl 'http://localhost:8123/replicas_status'
Ok.
```

Send the request as a URL ‘query’ parameter, or as a POST. Or send the beginning of the query in the ‘query’ parameter, and the rest in the POST (we’ll explain later why this is necessary). The size of the URL is limited to 1 MiB by default, this can be changed with the `http_max_uri_size` setting.

If successful, you receive the 200 response code and the result in the response body.
If an error occurs, you receive the 500 response code and an error description text in the response body.

When using the GET method, ‘readonly’ is set. In other words, for queries that modify data, you can only use the POST method. You can send the query itself either in the POST body or in the URL parameter.

Examples:

``` bash
$ curl 'http://localhost:8123/?query=SELECT%201'
1

$ wget -nv -O- 'http://localhost:8123/?query=SELECT 1'
1

$ echo -ne 'GET /?query=SELECT%201 HTTP/1.0\r\n\r\n' | nc localhost 8123
HTTP/1.0 200 OK
Date: Wed, 27 Nov 2019 10:30:18 GMT
Connection: Close
Content-Type: text/tab-separated-values; charset=UTF-8
X-ClickHouse-Server-Display-Name: clickhouse.ru-central1.internal
X-ClickHouse-Query-Id: 5abe861c-239c-467f-b955-8a201abb8b7f
X-ClickHouse-Summary: {"read_rows":"0","read_bytes":"0","written_rows":"0","written_bytes":"0","total_rows_to_read":"0","peak_memory_usage":"0"}

1
```

As you can see, `curl` is somewhat inconvenient in that spaces must be URL escaped.
Although `wget` escapes everything itself, we do not recommend using it because it does not work well over HTTP 1.1 when using keep-alive and Transfer-Encoding: chunked.

``` bash
$ echo 'SELECT 1' | curl 'http://localhost:8123/' --data-binary @-
1

$ echo 'SELECT 1' | curl 'http://localhost:8123/?query=' --data-binary @-
1

$ echo '1' | curl 'http://localhost:8123/?query=SELECT' --data-binary @-
1
```

If part of the query is sent in the parameter, and part in the POST, a line feed is inserted between these two data parts.
Example (this won’t work):

``` bash
$ echo 'ECT 1' | curl 'http://localhost:8123/?query=SEL' --data-binary @-
Code: 59, e.displayText() = DB::Exception: Syntax error: failed at position 0: SEL
ECT 1
, expected One of: SHOW TABLES, SHOW DATABASES, SELECT, INSERT, CREATE, ATTACH, RENAME, DROP, DETACH, USE, SET, OPTIMIZE., e.what() = DB::Exception
```

By default, data is returned in [TabSeparated](formats.md#tabseparated) format.

You use the FORMAT clause of the query to request any other format.

Also, you can use the ‘default_format’ URL parameter or the ‘X-ClickHouse-Format’ header to specify a default format other than TabSeparated.

``` bash
$ echo 'SELECT 1 FORMAT Pretty' | curl 'http://localhost:8123/?' --data-binary @-
┏━━━┓
┃ 1 ┃
┡━━━┩
│ 1 │
└───┘
```

The POST method of transmitting data is necessary for `INSERT` queries. In this case, you can write the beginning of the query in the URL parameter, and use POST to pass the data to insert. The data to insert could be, for example, a tab-separated dump from MySQL. In this way, the `INSERT` query replaces `LOAD DATA LOCAL INFILE` from MySQL.

**Examples**

Creating a table:

``` bash
$ echo 'CREATE TABLE t (a UInt8) ENGINE = Memory' | curl 'http://localhost:8123/' --data-binary @-
```

Using the familiar INSERT query for data insertion:

``` bash
$ echo 'INSERT INTO t VALUES (1),(2),(3)' | curl 'http://localhost:8123/' --data-binary @-
```

Data can be sent separately from the query:

``` bash
$ echo '(4),(5),(6)' | curl 'http://localhost:8123/?query=INSERT%20INTO%20t%20VALUES' --data-binary @-
```

You can specify any data format. The ‘Values’ format is the same as what is used when writing INSERT INTO t VALUES:

``` bash
$ echo '(7),(8),(9)' | curl 'http://localhost:8123/?query=INSERT%20INTO%20t%20FORMAT%20Values' --data-binary @-
```

To insert data from a tab-separated dump, specify the corresponding format:

``` bash
$ echo -ne '10\n11\n12\n' | curl 'http://localhost:8123/?query=INSERT%20INTO%20t%20FORMAT%20TabSeparated' --data-binary @-
```

Reading the table contents. Data is output in random order due to parallel query processing:

``` bash
$ curl 'http://localhost:8123/?query=SELECT%20a%20FROM%20t'
7
8
9
10
11
12
1
2
3
4
5
6
```

Deleting the table.

``` bash
$ echo 'DROP TABLE t' | curl 'http://localhost:8123/' --data-binary @-
```

For successful requests that do not return a data table, an empty response body is returned.

## Compression {#compression}

You can use compression to reduce network traffic when transmitting a large amount of data or for creating dumps that are immediately compressed.

You can use the internal ClickHouse compression format when transmitting data. The compressed data has a non-standard format, and you need `clickhouse-compressor` program to work with it. It is installed with the `clickhouse-client` package. To increase the efficiency of data insertion, you can disable server-side checksum verification by using the [http_native_compression_disable_checksumming_on_decompress](../operations/settings/settings.md#settings-http_native_compression_disable_checksumming_on_decompress) setting.

If you specify `compress=1` in the URL, the server will compress the data it sends to you. If you specify `decompress=1` in the URL, the server will decompress the data which you pass in the `POST` method.

You can also choose to use [HTTP compression](https://en.wikipedia.org/wiki/HTTP_compression). ClickHouse supports the following [compression methods](https://en.wikipedia.org/wiki/HTTP_compression#Content-Encoding_tokens):

- `gzip`
- `br`
- `deflate`
- `xz`
- `zstd`
- `lz4`
- `bz2`
- `snappy`

To send a compressed `POST` request, append the request header `Content-Encoding: compression_method`.
In order for ClickHouse to compress the response, enable compression with [enable_http_compression](../operations/settings/settings.md#settings-enable_http_compression) setting and append `Accept-Encoding: compression_method` header to the request. You can configure the data compression level in the [http_zlib_compression_level](../operations/settings/settings.md#settings-http_zlib_compression_level) setting for all compression methods.

:::info
Some HTTP clients might decompress data from the server by default (with `gzip` and `deflate`) and you might get decompressed data even if you use the compression settings correctly.
:::

**Examples**

``` bash
# Sending compressed data to the server
$ echo "SELECT 1" | gzip -c | \
  curl -sS --data-binary @- -H 'Content-Encoding: gzip' 'http://localhost:8123/'
```

``` bash
# Receiving compressed data archive from the server
$ curl -vsS "http://localhost:8123/?enable_http_compression=1" \
    -H 'Accept-Encoding: gzip' --output result.gz -d 'SELECT number FROM system.numbers LIMIT 3'
$ zcat result.gz
0
1
2
```

```bash
# Receiving compressed data from the server and using the gunzip to receive decompressed data
$ curl -sS "http://localhost:8123/?enable_http_compression=1" \
    -H 'Accept-Encoding: gzip' -d 'SELECT number FROM system.numbers LIMIT 3' | gunzip -
0
1
2
```

## Default Database {#default-database}

You can use the ‘database’ URL parameter or the ‘X-ClickHouse-Database’ header to specify the default database.

``` bash
$ echo 'SELECT number FROM numbers LIMIT 10' | curl 'http://localhost:8123/?database=system' --data-binary @-
0
1
2
3
4
5
6
7
8
9
```

By default, the database that is registered in the server settings is used as the default database. By default, this is the database called ‘default’. Alternatively, you can always specify the database using a dot before the table name.

The username and password can be indicated in one of three ways:

1.  Using HTTP Basic Authentication. Example:

<!-- -->

``` bash
$ echo 'SELECT 1' | curl 'http://user:password@localhost:8123/' -d @-
```

2.  In the ‘user’ and ‘password’ URL parameters (*We do not recommend using this method as the parameter might be logged by web proxy and cached in the browser*). Example:

<!-- -->

``` bash
$ echo 'SELECT 1' | curl 'http://localhost:8123/?user=user&password=password' -d @-
```

3.  Using ‘X-ClickHouse-User’ and ‘X-ClickHouse-Key’ headers. Example:

<!-- -->

``` bash
$ echo 'SELECT 1' | curl -H 'X-ClickHouse-User: user' -H 'X-ClickHouse-Key: password' 'http://localhost:8123/' -d @-
```

If the user name is not specified, the `default` name is used. If the password is not specified, the empty password is used.
You can also use the URL parameters to specify any settings for processing a single query or entire profiles of settings. Example:http://localhost:8123/?profile=web&max_rows_to_read=1000000000&query=SELECT+1

For more information, see the [Settings](../operations/settings/index.md) section.

``` bash
$ echo 'SELECT number FROM system.numbers LIMIT 10' | curl 'http://localhost:8123/?' --data-binary @-
0
1
2
3
4
5
6
7
8
9
```

For information about other parameters, see the section “SET”.

Similarly, you can use ClickHouse sessions in the HTTP protocol. To do this, you need to add the `session_id` GET parameter to the request. You can use any string as the session ID. By default, the session is terminated after 60 seconds of inactivity. To change this timeout, modify the `default_session_timeout` setting in the server configuration, or add the `session_timeout` GET parameter to the request. To check the session status, use the `session_check=1` parameter. Only one query at a time can be executed within a single session.

You can receive information about the progress of a query in `X-ClickHouse-Progress` response headers. To do this, enable [send_progress_in_http_headers](../operations/settings/settings.md#settings-send_progress_in_http_headers). Example of the header sequence:

``` text
X-ClickHouse-Progress: {"read_rows":"2752512","read_bytes":"240570816","total_rows_to_read":"8880128","peak_memory_usage":"4371480"}
X-ClickHouse-Progress: {"read_rows":"5439488","read_bytes":"482285394","total_rows_to_read":"8880128","peak_memory_usage":"13621616"}
X-ClickHouse-Progress: {"read_rows":"8783786","read_bytes":"819092887","total_rows_to_read":"8880128","peak_memory_usage":"23155600"}
```

Possible header fields:

- `read_rows` — Number of rows read.
- `read_bytes` — Volume of data read in bytes.
- `total_rows_to_read` — Total number of rows to be read.
- `written_rows` — Number of rows written.
- `written_bytes` — Volume of data written in bytes.

Running requests do not stop automatically if the HTTP connection is lost. Parsing and data formatting are performed on the server-side, and using the network might be ineffective.
The optional ‘query_id’ parameter can be passed as the query ID (any string). For more information, see the section “Settings, replace_running_query”.

The optional ‘quota_key’ parameter can be passed as the quota key (any string). For more information, see the section “Quotas”.

The HTTP interface allows passing external data (external temporary tables) for querying. For more information, see the section “External data for query processing”.

## Response Buffering {#response-buffering}

You can enable response buffering on the server-side. The `buffer_size` and `wait_end_of_query` URL parameters are provided for this purpose.
Also settings `http_response_buffer_size` and `http_wait_end_of_query` can be used.

`buffer_size` determines the number of bytes in the result to buffer in the server memory. If a result body is larger than this threshold, the buffer is written to the HTTP channel, and the remaining data is sent directly to the HTTP channel.

To ensure that the entire response is buffered, set `wait_end_of_query=1`. In this case, the data that is not stored in memory will be buffered in a temporary server file.

Example:

``` bash
$ curl -sS 'http://localhost:8123/?max_result_bytes=4000000&buffer_size=3000000&wait_end_of_query=1' -d 'SELECT toUInt8(number) FROM system.numbers LIMIT 9000000 FORMAT RowBinary'
```

Use buffering to avoid situations where a query processing error occurred after the response code and HTTP headers were sent to the client. In this situation, an error message is written at the end of the response body, and on the client-side, the error can only be detected at the parsing stage.

### Queries with Parameters {#cli-queries-with-parameters}

You can create a query with parameters and pass values for them from the corresponding HTTP request parameters. For more information, see [Queries with Parameters for CLI](../interfaces/cli.md#cli-queries-with-parameters).

### Example {#example}

``` bash
$ curl -sS "<address>?param_id=2&param_phrase=test" -d "SELECT * FROM table WHERE int_column = {id:UInt8} and string_column = {phrase:String}"
```

### Tabs in URL Parameters

Query parameters are parsed from the "escaped" format. This has some benefits, such as the possibility to unambiguously parse nulls as `\N`. This means the tab character should be encoded as `\t` (or `\` and a tab). For example, the following contains an actual tab between `abc` and `123` and the input string is split into two values:

```bash
curl -sS "http://localhost:8123" -d "SELECT splitByChar('\t', 'abc      123')"
```

```response
['abc','123']
```

However, if you try to encode an actual tab using `%09` in a URL parameter, it won't get parsed properly:

```bash
curl -sS "http://localhost:8123?param_arg1=abc%09123" -d "SELECT splitByChar('\t', {arg1:String})"
Code: 457. DB::Exception: Value abc	123 cannot be parsed as String for query parameter 'arg1' because it isn't parsed completely: only 3 of 7 bytes was parsed: abc. (BAD_QUERY_PARAMETER) (version <IP_ADDRESS>9 (official build))
```

If you are using URL parameters, you will need to encode the `\t` as `%5C%09`. For example:

```bash
curl -sS "http://localhost:8123?param_arg1=abc%5C%09123" -d "SELECT splitByChar('\t', {arg1:String})"
```

```response
['abc','123']
```

## Predefined HTTP Interface {#predefined_http_interface}

ClickHouse supports specific queries through the HTTP interface. For example, you can write data to a table as follows:

``` bash
$ echo '(4),(5),(6)' | curl 'http://localhost:8123/?query=INSERT%20INTO%20t%20VALUES' --data-binary @-
```

ClickHouse also supports Predefined HTTP Interface which can help you more easily integrate with third-party tools like [Prometheus exporter](https://github.com/ClickHouse/clickhouse_exporter).

Example:

- First of all, add this section to server configuration file:

<!-- -->

``` xml
<http_handlers>
    <rule>
        <url>/predefined_query</url>
        <methods>POST,GET</methods>
        <handler>
            <type>predefined_query_handler</type>
            <query>SELECT * FROM system.metrics LIMIT 5 FORMAT Template SETTINGS format_template_resultset = 'prometheus_template_output_format_resultset', format_template_row = 'prometheus_template_output_format_row', format_template_rows_between_delimiter = '\n'</query>
        </handler>
    </rule>
    <rule>...</rule>
    <rule>...</rule>
</http_handlers>
```

- You can now request the URL directly for data in the Prometheus format:

<!-- -->

``` bash
$ curl -v 'http://localhost:8123/predefined_query'
*   Trying ::1...
* Connected to localhost (::1) port 8123 (#0)
> GET /predefined_query HTTP/1.1
> Host: localhost:8123
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 28 Apr 2020 08:52:56 GMT
< Connection: Keep-Alive
< Content-Type: text/plain; charset=UTF-8
< X-ClickHouse-Server-Display-Name: i-mloy5trc
< Transfer-Encoding: chunked
< X-ClickHouse-Query-Id: 96fe0052-01e6-43ce-b12a-6b7370de6e8a
< X-ClickHouse-Format: Template
< X-ClickHouse-Timezone: Asia/Shanghai
< Keep-Alive: timeout=3
< X-ClickHouse-Summary: {"read_rows":"0","read_bytes":"0","written_rows":"0","written_bytes":"0","total_rows_to_read":"0","peak_memory_usage":"0"}
<
# HELP "Query" "Number of executing queries"
# TYPE "Query" counter
"Query" 1

# HELP "Merge" "Number of executing background merges"
# TYPE "Merge" counter
"Merge" 0

# HELP "PartMutation" "Number of mutations (ALTER DELETE/UPDATE)"
# TYPE "PartMutation" counter
"PartMutation" 0

# HELP "ReplicatedFetch" "Number of data parts being fetched from replica"
# TYPE "ReplicatedFetch" counter
"ReplicatedFetch" 0

# HELP "ReplicatedSend" "Number of data parts being sent to replicas"
# TYPE "ReplicatedSend" counter
"ReplicatedSend" 0

* Connection #0 to host localhost left intact

* Connection #0 to host localhost left intact
```

As you can see from the example if `http_handlers` is configured in the config.xml file and `http_handlers` can contain many `rules`. ClickHouse will match the HTTP requests received to the predefined type in `rule` and the first matched runs the handler. Then ClickHouse will execute the corresponding predefined query if the match is successful.

Now `rule` can configure `method`, `headers`, `url`, `handler`:
- `method` is responsible for matching the method part of the HTTP request. `method` fully conforms to the definition of [method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) in the HTTP protocol. It is an optional configuration. If it is not defined in the configuration file, it does not match the method portion of the HTTP request.

- `url` is responsible for matching the URL part of the HTTP request. It is compatible with [RE2](https://github.com/google/re2)’s regular expressions. It is an optional configuration. If it is not defined in the configuration file, it does not match the URL portion of the HTTP request.

- `headers` are responsible for matching the header part of the HTTP request. It is compatible with RE2’s regular expressions. It is an optional configuration. If it is not defined in the configuration file, it does not match the header portion of the HTTP request.

- `handler` contains the main processing part. Now `handler` can configure `type`, `status`, `content_type`, `response_content`, `query`, `query_param_name`.
    `type` currently supports three types: [predefined_query_handler](#predefined_query_handler), [dynamic_query_handler](#dynamic_query_handler), [static](#static).

    - `query` — use with `predefined_query_handler` type, executes query when the handler is called.

    - `query_param_name` — use with `dynamic_query_handler` type, extracts and executes the value corresponding to the `query_param_name` value in HTTP request parameters.

    - `status` — use with `static` type, response status code.

    - `content_type` — use with any type, response [content-type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type).

    - `response_content` — use with `static` type, response content sent to client, when using the prefix ‘file://’ or ‘config://’, find the content from the file or configuration sends to client.

Next are the configuration methods for different `type`.

### predefined_query_handler {#predefined_query_handler}

`predefined_query_handler` supports setting `Settings` and `query_params` values. You can configure `query` in the type of `predefined_query_handler`.

`query` value is a predefined query of `predefined_query_handler`, which is executed by ClickHouse when an HTTP request is matched and the result of the query is returned. It is a must configuration.

The following example defines the values of [max_threads](../operations/settings/settings.md#settings-max_threads) and `max_final_threads` settings, then queries the system table to check whether these settings were set successfully.

:::note
To keep the default `handlers` such as` query`, `play`,` ping`, add the `<defaults/>` rule.
:::

Example:

``` xml
<http_handlers>
    <rule>
        <url><![CDATA[/query_param_with_url/\w+/(?P<name_1>[^/]+)(/(?P<name_2>[^/]+))?]]></url>
        <methods>GET</methods>
        <headers>
            <XXX>TEST_HEADER_VALUE</XXX>
            <PARAMS_XXX><![CDATA[(?P<name_1>[^/]+)(/(?P<name_2>[^/]+))?]]></PARAMS_XXX>
        </headers>
        <handler>
            <type>predefined_query_handler</type>
            <query>SELECT value FROM system.settings WHERE name = {name_1:String}</query>
            <query>SELECT name, value FROM system.settings WHERE name = {name_2:String}</query>
        </handler>
    </rule>
    <defaults/>
</http_handlers>
```

``` bash
$ curl -H 'XXX:TEST_HEADER_VALUE' -H 'PARAMS_XXX:max_threads' 'http://localhost:8123/query_param_with_url/1/max_threads/max_final_threads?max_threads=1&max_final_threads=2'
1
max_final_threads   2
```

:::note
In one `predefined_query_handler` only supports one `query` of an insert type.
:::

### dynamic_query_handler {#dynamic_query_handler}

In `dynamic_query_handler`, the query is written in the form of parameter of the HTTP request. The difference is that in `predefined_query_handler`, the query is written in the configuration file. You can configure `query_param_name` in `dynamic_query_handler`.

ClickHouse extracts and executes the value corresponding to the `query_param_name` value in the URL of the HTTP request. The default value of `query_param_name` is `/query` . It is an optional configuration. If there is no definition in the configuration file, the parameter is not passed in.

To experiment with this functionality, the example defines the values of [max_threads](../operations/settings/settings.md#settings-max_threads) and `max_final_threads` and `queries` whether the settings were set successfully.

Example:

``` xml
<http_handlers>
    <rule>
    <headers>
        <XXX>TEST_HEADER_VALUE_DYNAMIC</XXX>    </headers>
    <handler>
        <type>dynamic_query_handler</type>
        <query_param_name>query_param</query_param_name>
    </handler>
    </rule>
    <defaults/>
</http_handlers>
```

``` bash
$ curl  -H 'XXX:TEST_HEADER_VALUE_DYNAMIC'  'http://localhost:8123/own?max_threads=1&max_final_threads=2&param_name_1=max_threads&param_name_2=max_final_threads&query_param=SELECT%20name,value%20FROM%20system.settings%20where%20name%20=%20%7Bname_1:String%7D%20OR%20name%20=%20%7Bname_2:String%7D'
max_threads 1
max_final_threads   2
```

### static {#static}

`static` can return [content_type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type), [status](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) and `response_content`. `response_content` can return the specified content.

Example:

Return a message.

``` xml
<http_handlers>
        <rule>
            <methods>GET</methods>
            <headers><XXX>xxx</XXX></headers>
            <url>/hi</url>
            <handler>
                <type>static</type>
                <status>402</status>
                <content_type>text/html; charset=UTF-8</content_type>
                <response_content>Say Hi!</response_content>
            </handler>
        </rule>
        <defaults/>
</http_handlers>
```

``` bash
$ curl -vv  -H 'XXX:xxx' 'http://localhost:8123/hi'
*   Trying ::1...
* Connected to localhost (::1) port 8123 (#0)
> GET /hi HTTP/1.1
> Host: localhost:8123
> User-Agent: curl/7.47.0
> Accept: */*
> XXX:xxx
>
< HTTP/1.1 402 Payment Required
< Date: Wed, 29 Apr 2020 03:51:26 GMT
< Connection: Keep-Alive
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Keep-Alive: timeout=3
< X-ClickHouse-Summary: {"read_rows":"0","read_bytes":"0","written_rows":"0","written_bytes":"0","total_rows_to_read":"0","peak_memory_usage":"0"}
<
* Connection #0 to host localhost left intact
Say Hi!%
```

Find the content from the configuration send to client.

``` xml
<get_config_static_handler><![CDATA[<html ng-app="SMI2"><head><base href="http://ui.tabix.io/"></head><body><div ui-view="" class="content-ui"></div><script src="http://loader.tabix.io/master.js"></script></body></html>]]></get_config_static_handler>

<http_handlers>
        <rule>
            <methods>GET</methods>
            <headers><XXX>xxx</XXX></headers>
            <url>/get_config_static_handler</url>
            <handler>
                <type>static</type>
                <response_content>config://get_config_static_handler</response_content>
            </handler>
        </rule>
</http_handlers>
```

``` bash
$ curl -v  -H 'XXX:xxx' 'http://localhost:8123/get_config_static_handler'
*   Trying ::1...
* Connected to localhost (::1) port 8123 (#0)
> GET /get_config_static_handler HTTP/1.1
> Host: localhost:8123
> User-Agent: curl/7.47.0
> Accept: */*
> XXX:xxx
>
< HTTP/1.1 200 OK
< Date: Wed, 29 Apr 2020 04:01:24 GMT
< Connection: Keep-Alive
< Content-Type: text/plain; charset=UTF-8
< Transfer-Encoding: chunked
< Keep-Alive: timeout=3
< X-ClickHouse-Summary: {"read_rows":"0","read_bytes":"0","written_rows":"0","written_bytes":"0","total_rows_to_read":"0","peak_memory_usage":"0"}
<
* Connection #0 to host localhost left intact
<html ng-app="SMI2"><head><base href="http://ui.tabix.io/"></head><body><div ui-view="" class="content-ui"></div><script src="http://loader.tabix.io/master.js"></script></body></html>%
```

Find the content from the file send to client.

``` xml
<http_handlers>
        <rule>
            <methods>GET</methods>
            <headers><XXX>xxx</XXX></headers>
            <url>/get_absolute_path_static_handler</url>
            <handler>
                <type>static</type>
                <content_type>text/html; charset=UTF-8</content_type>
                <response_content>file:///absolute_path_file.html</response_content>
            </handler>
        </rule>
        <rule>
            <methods>GET</methods>
            <headers><XXX>xxx</XXX></headers>
            <url>/get_relative_path_static_handler</url>
            <handler>
                <type>static</type>
                <content_type>text/html; charset=UTF-8</content_type>
                <response_content>file://./relative_path_file.html</response_content>
            </handler>
        </rule>
</http_handlers>
```

``` bash
$ user_files_path='/var/lib/clickhouse/user_files'
$ sudo echo "<html><body>Relative Path File</body></html>" > $user_files_path/relative_path_file.html
$ sudo echo "<html><body>Absolute Path File</body></html>" > $user_files_path/absolute_path_file.html
$ curl -vv -H 'XXX:xxx' 'http://localhost:8123/get_absolute_path_static_handler'
*   Trying ::1...
* Connected to localhost (::1) port 8123 (#0)
> GET /get_absolute_path_static_handler HTTP/1.1
> Host: localhost:8123
> User-Agent: curl/7.47.0
> Accept: */*
> XXX:xxx
>
< HTTP/1.1 200 OK
< Date: Wed, 29 Apr 2020 04:18:16 GMT
< Connection: Keep-Alive
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Keep-Alive: timeout=3
< X-ClickHouse-Summary: {"read_rows":"0","read_bytes":"0","written_rows":"0","written_bytes":"0","total_rows_to_read":"0","peak_memory_usage":"0"}
<
<html><body>Absolute Path File</body></html>
* Connection #0 to host localhost left intact
$ curl -vv -H 'XXX:xxx' 'http://localhost:8123/get_relative_path_static_handler'
*   Trying ::1...
* Connected to localhost (::1) port 8123 (#0)
> GET /get_relative_path_static_handler HTTP/1.1
> Host: localhost:8123
> User-Agent: curl/7.47.0
> Accept: */*
> XXX:xxx
>
< HTTP/1.1 200 OK
< Date: Wed, 29 Apr 2020 04:18:31 GMT
< Connection: Keep-Alive
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Keep-Alive: timeout=3
< X-ClickHouse-Summary: {"read_rows":"0","read_bytes":"0","written_rows":"0","written_bytes":"0","total_rows_to_read":"0","peak_memory_usage":"0"}
<
<html><body>Relative Path File</body></html>
* Connection #0 to host localhost left intact
```

repository: ClickHouse/ClickHouse

repo_name: ClickHouse/ClickHouse


text:
***Adding Device Steps***
- Sync "src/ttn/lopy-dev-eui" on LoPy (to be used as Gateway) and note the Device EUI shown
    Eg: 8 bytes of hex "AABBCCDD00FFFE00"
- Open Applications [page](https://console.thethingsnetwork.org/applications/) in TTN Console
- Click on the appropriate application
- Click on "register device" under "DEVICES" section
- Enter following values for the corresponding fields:
    - "Device ID" : Any numerical string, eg:<PHONE_NUMBER>317
    - "Device EUI" : Device EUI in HEX read above, eg: AABBCCDD00FFFE00
    - "App Key" and "App EUI" : leave as is
- Click "Register"
- "DEVICES" screen will be displayed
- Click on the newly added device adn config data for this device is shown
- Based on Activation method, following steps need to be taken
    - For ABP
        - Click "Settings"
        - Navigate to "Activation Method" and click on "ABP"
        - ABP paramters such as "Device Address", "Network Session Key" and "App Session Key" are now shown
        - **Note**: Ensure "Frame Counter Checks" is unticked (else TTN will drop packets when frame counters don't match, eg: after a restart of end-node)
        - Click "Save"
    - For OTAA
        - TODO

repository: bhargavbhat/lopy

repo_name: bhargavbhat/lopy


text:
pirate-live
===========

again, something related with TV series. Sorry.

## it does not work!
As is your browser the one who needs to connect to different domains (calendar site and pirateabay), you have to enable cross site calls. [See this link](https://blog.nraboy.com/2014/08/bypass-cors-errors-testing-apis-locally/)

## Try it
Online version... [Visit it](http://angel-git.github.io/pirate-live/)

![screen](screenshot.png)

repository: angel-git/pirate-live

repo_name: angel-git/pirate-live


text:
StreetviewSequence.js
=====================

StreetviewSequence allows you to create Street View panorama and route-stepped image sequences.

* [Demo](http://useallfive.github.io/StreetviewSequence.js/demo.html)
* [Docs](http://useallfive.github.io/StreetviewSequence.js/parentScope.StreetviewSequence.html)

### Stationary panorama looking up
```javascript
var panorama = StreetviewSequence('#panorama', {
    duration: 1500,
    location: new google.maps.LatLng(40.720032, -73.988354),
    pitchSkewEnd: 90,
    width: 585,
    height: 325,
    loop: true
});

panorama.done(function (player) {
    player.play();
});
```

### Route
```javascript
var directionsService = new google.maps.DirectionsService();
var directionsRoute = directionsService.route({
    destination: new google.maps.LatLng(33.8974391098385,-116.6136966801696),
    origin: new google.maps.LatLng(33.9063,-116.56344000000001),
    travelMode: google.maps.TravelMode.DRIVING
}, function (DirectionsResult, DirectionsStatus) {
    var routeSequence = StreetviewSequence('#route', {
        route: DirectionsResult,
        duration: 5000,
        loop: true,
        width: 585,
        height: 325
    });

    routeSequence.done(function(player) {
        player.play();
    });
});
```

### Reporting load progress
```javascript
var panorama = StreetviewSequence('#panorama', {
    duration: 1500,
    location: new google.maps.LatLng(40.720032, -73.988354),
    pitchSkewEnd: 90,
    width: 585,
    height: 325,
    loop: true
});

panorama.progress(function (p) {
    console.log('%f% loaded', p);
});

panorama.done(function (player) {
    player.play();
});
```


text:
# Fixing "NO PUBKEY" in Parrot security OS.

Incase your parrot security OS is not updating while you try updating it through:
```bash
sudo apt update
```

Go to /etc/apt/sources.list.d/parrot.list:
```bash
sudo nano /etc/apt/sources.list.d/parrot.list
```

Update the contents to the ones below as written in https://parrot.org/docs:
```
# parrot repository
# this file was automatically generated by parrot-mirror-selector
deb https://deb.parrot.sh/parrot/ rolling main contrib non-free
#deb-src https://deb.parrot.sh/parrot/ rolling main contrib non-free
deb https://deb.parrot.sh/parrot/ rolling-security main contrib non-free
#deb-src https://deb.parrot.sh/parrot/ rolling-security main contrib non-free
```

Then try updating the pc again using:
```bash
sudo apt update
```

It will result to an error saying *NO PUBKEY B56FFA946EB1660A* or possibly give you another pubkey other than *B56FFA946EB1660A* .
TO add this key,do this:
```bash
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B56FFA946EB1660A
```
Something similar should be executed:
```bash
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.QTeppiINUh --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 gpg: requesting key 437D05B5 from hkp server keyserver.ubuntu.com gpg: key 437D05B5: public key "Ubuntu Archive Automatic Signing Key " imported gpg: Total number processed: 1 gpg: imported: 1
```

keyserver.ubuntu.com is the server you will be using.
Now you can run:
```bash
sudo apt update
```
or
```bash
sudo parrot-upgrade
```

It will now update your packages and repos.

Great day ahead!

branch_name: refs/heads/main


text:
## Bayesian Optimization With Symmetry Relaxation Algorithm (BOWSR)

The BOWSR app is designed for obtaining near-equilibrium crystal structures via
Bayesian optimization and graph deep learning energy model without expensive
DFT. The current implementation is compatible with energy evaluators
for [MEGNet](https://github.com/materialsvirtuallab/megnet)
, [CGCNN](https://github.com/txie-93/cgcnn), and [VASP](https://www.vasp.at).

# Algorithm

The BOWSR algorithm parametrizes each crystal based on the independent lattice
parameters and atomic coordinates based on its space group. The potential
energy surface is then approximated by initializing a set of training
observations and energies from the ML energy model. Bayesian optimization is
then used to iteratively propose lower energy geometries based on prior
observations.

![BOWSR algorithm](../../../resources/bowsr_algo.png)

Figure 1. Bayesian Optimization With Symmetry Relaxation (BOWSR) algorithm.

# Usage

By default, the current implementation uses the pre-trained graph models
in [MEGNet-2019](https://github.com/materialsvirtuallab/megnet/tree/master/mvl_models/mp-2019.4.1)
and [CGCNN-2018](https://github.com/txie-93/cgcnn/tree/master/pre-trained).
Please visit the [notebooks directory](../../../notebooks/bowsr/bowsr) for Jupyter
notebooks with more detailed code example.

|                                       |                                                                                |                                                                                |                                                                                |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **BOWSR with MEGNet as energy model** | [![Binder]](https://mybinder.org/v2/gh/materialsvirtuallab/maml/master?labpath=notebooks/bowsr/megnet_example.ipynb) | [![View on GitHub]](https://github.com/materialsvirtuallab/maml/blob/master/notebooks/bowsr/megnet_example.ipynb) | [![Open in Google Colab]](https://colab.research.google.com/github/materialsvirtuallab/maml/blob/master/notebooks/bowsr/megnet_example.ipynb) |
| **BOWSR with CGCNN as energy model**  | [![Binder]](https://mybinder.org/v2/gh/materialsvirtuallab/maml/master?labpath=notebooks/bowsr/cgcnn_example.ipynb)  | [![View on GitHub]](https://github.com/materialsvirtuallab/maml/blob/master/notebooks/bowsr/cgcnn_example.ipynb)  | [![Open in Google Colab]](https://colab.research.google.com/github/materialsvirtuallab/maml/blob/master/notebooks/bowsr/cgcnn_example.ipynb)  |

[Binder]: https://mybinder.org/badge_logo.svg
[View on GitHub]: https://img.shields.io/badge/View%20on-GitHub-darkblue?logo=github
[Open in Google Colab]: https://colab.research.google.com/assets/colab-badge.svg

## Dependencies

Upgrade pip and install dependencies.

```python
pip install --upgrade pip
pip install maml megnet tensorflow
```

## Minimal Usage

### Imports

Import the necessary modules:

```python
from pymatgen.core.structure import Structure
from pymatgen.core.periodic_table import get_el_sp
from maml.apps.bowsr.model.megnet import MEGNet
# from maml.apps.bowsr.model.cgcnn import CGCNN
from maml.apps.bowsr.optimizer import BayesianOptimizer
```

## MEGNet, Pymatgen, and Helper Function

Instantiate a MEGNet (or CGCNN) model and load a `pymatgen` `Structure` from a CIF file:

```python
model = MEGNet() # or `model = CGCNN()`
structure = Structure.from_file("<my-file>.cif")
```

We use a helper function for the expected radius based on the sum of radii of two elements:

```python
def expected_cutoff(struct):
    if struct.composition.num_atoms==1:
        return 2*struct.composition.elements[0].atomic_radius
    return sum([e.atomic_radius for e in sorted(struct.composition.elements, key=lambda x: x.atomic_radius)[:2]])
```

## Optimization

Finally, instantiate and run the optimizer:

```python
compressed_optimizer = BayesianOptimizer(
    model=model,
    structure=structure,
    relax_coords=True,
    relax_lattice=True,
    use_symmetry=True,
    seed=42
)

compressed_optimizer.set_bounds()
compressed_optimizer.optimize(n_init=100, n_iter=100, alpha=0.026 ** 2)
```

## Relaxed Structure

To retrieve the relaxed structure:

```python
cutoff_distance = max(round(expected_cutoff(compressed_optimizer.structure) * 0.6, 2), 1.1)
relaxed, _ = compressed_optimizer.get_optimized_structure_and_energy(cutoff_distance=cutoff_distance)
print(relaxed)
```

```txt
Full Formula (Sr1 Ti1 O3)
Reduced Formula: SrTiO3
abc   :   3.976834   3.976834   3.976834
angles:  90.000000  90.000000  90.000000
Sites (5)
  #  SP      a    b    c
---  ----  ---  ---  ---
  0  Sr    0    0    0
  1  Ti    0.5  0.5  0.5
  2  O     0.5  0    0.5
  3  O     0    0.5  0.5
  4  O     0.5  0.5  0
```

repository: materialsvirtuallab/maml

gha_language: Jupyter Notebook

repo_name: materialsvirtuallab/maml


text:
# Tree-LSTM
This is a re-implementation of the following paper:

> [**Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks**](http://arxiv.org/abs/1503.00075)
> *Kai Sheng Tai, Richard Socher, and Christopher Manning*.

The provided implementation can achieve a test accuracy of 51.72 which is comparable with the result reported in the original paper: 51.0(±0.5).

## Dependencies
* MXNet nightly build
* requests
* nltk

```bash
pip install mxnet --pre
pip install requests nltk
```

## Data
The script will download the [SST dataset] (http://nlp.stanford.edu/sentiment/index.html) and the GloVe 840B.300d embedding automatically if `--use-glove` is specified (note: download may take a while).

## Usage
```
DGLBACKEND=mxnet python3 train.py --gpu 0
```

## Speed Test

See https://docs.google.com/spreadsheets/d/1eCQrVn7g0uWriz63EbEDdes2ksMdKdlbWMyT8PSU4rc .

## Note
The code can work with MXNet 1.5.1

repository: dmlc/dgl

gha_language: Python

repo_name: dmlc/dgl


text:
fh-reportingclient -- The FeedHenry Reporting Client
===============================================

[![npm package](https://nodei.co/npm/fh-reportingclient.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/fh-reportingclient/)

[![Build status](https://img.shields.io/travis/feedhenry/fh-reportingclient/master.svg?style=flat-square)](https://travis-ci.org/feedhenry/fh-reportingclient)
[![Dependency Status](https://img.shields.io/david/feedhenry/fh-reportingclient.svg?style=flat-square)](https://david-dm.org/feedhenry/fh-reportingclient)
[![Known Vulnerabilities](https://snyk.io/test/npm/fh-reportingclient/badge.svg?style=flat-square)](https://snyk.io/test/npm/fh-reportingclient)

|                 | Project Info  |
| --------------- | ------------- |
| License:        | Apache License, Version 2.0  |
| Build:          | npm  |
| Documentation:  | http://docs.feedhenry.com/v3/api/cloud_api.html  |
| Issue tracker:  | https://issues.jboss.org/projects/FH/summary  |
| Mailing list:   | [feedhenry-dev](https://www.redhat.com/archives/feedhenry-dev/) ([subscribe](https://www.redhat.com/mailman/listinfo/feedhenry-dev))  |
| IRC:            | [#feedhenry](https://webchat.freenode.net/?channels=feedhenry) channel in the [freenode](http://freenode.net/) network.  |

## DESCRIPTION

The Feedhenry Reporting Client is a client library for Node.js applications that allows messages to be sent to a Feedhenry Reporting Server. (Formerly called a Messaging Server)

There's currently only one function available:

* `logMessage(topic, msg, callback)` - log messages for a particular topic

## Dependencies

The Reporting Client currently relies on the following being installed on a host:

* node.js

* npm (the Node Package Manager)

The Reporting Client currently operates it 2 ways:

1. send a message to the Reporting Server for storage. (And eventual aggregation into a metrics report)
2. save the message in a file. (Which is expected to be batch imported into the Reporting Server, similar to the way that Millicore is currently operating)

## Installation

The Reporting Client is deployed by adding a dependency to your projects package.json file.

## Running and Configuration

To use the Reporting Client you should add a dependency in your project to the latest build of fh-reportingclient.
Within the code of your application, require the module, call the constructor - passing appropriate values, then call the `logMessage()` function where you want to log a message.

If there are errors sending to msgServer, the message will be saved to recoveryfile.  Messages are always sent to msgServer and backupFile.  If any or all of msgServer, recoveryFiles, backupFiles are not present in the config, the library will not attempt to send messages there, e.g. if msgServer is specifed, but not recoveryFiles or backupFiles, then the library will attempt to sen the message to the message server, but not save it to disk.

The parameters, "host" and "cluster", must be specified

Example:

    var reporting = require('fh-reporting');
    var config = {
      host: "dub1app1b",
      cluster: "dub1",
      msgServer: {
        logMessageURL: "http://some_internet_reporting_server_address:443/msg/TOPIC"
      },
      recoveryFiles: {
        fileName: "/mnt/some/path/recoveryFiles.log"
      },
      backupFiles: {
        fileName: "/mnt/some/path/backupMessages.log"
      }
    };

    var reportingClient = new reporting.Reporting(config);

    reportingClient.logMessage("topicHello", {id: 27, text: "Hello World"});

    // if desired a callback can be passed to accept results, but this will be of limited use to most applications
    reportingClient.logMessage("topicHello", {id: 27, text: "Hello World"} , function (err, results) {
      console.log("results: " + results[0].handler + ", " + results[0].result.body);
    });

repository: feedhenry/fh-reportingclient

gha_language: JavaScript

repo_name: feedhenry/fh-reportingclient


text:
---
layout: sidebar-right
title: 'Meet the Author: Val McDermid'
date: 2019-05-21
author: brandon-king
category: meet-the-author
excerpt: "Queen of Crime Val McDermid talks about the evolution of the genre and her writing process, and encourages you to say hello to her at Slaughter in Southwold."
featured-image: /images/featured/featured-val-mcdermid-740.jpg
featured-alt: "Val McDermid"
breadcrumb: meet-the-author
---

![Val McDermid](/images/featured/featured-val-mcdermid-740.jpg)

Val McDermid, known as the Queen of Crime, is one of the biggest names in crime writing. Her novels have been translated into 40 languages, over 15 million copies of her books have been sold worldwide, and she has won and been nominated for several awards over her 30-year career.

Val's books include four main series: Lindsay Gordon, Kate Brannigan, Tony Hill and Carol Jordan, and Karen Pirie. Her latest novel is [Broken Ground](https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/ENQ/OPAC/BIBENQ?BRN=2510124) and her next book, How the Dead Speak, is due out in August. You can see Val in person at [Slaughter in Southwold](/slaughter/) in June.

## 1. Who were your literary heroes and influences are you were growing up?

An eclectic mix that included Robert Louis Stevenson, the Chalet School books, Agatha Christie, the Moomintrolls and Batman comics.

## 2. What have been the biggest changes in the crime genre since Lindsay Gordon first appeared in the 1980s?

The genre has burst its banks and expanded in all directions. Crime novels in the UK used to be village mysteries or Home Counties police procedurals, but now they encompass all sorts of storytelling, every social stratum and a wide range of investigators. Any story you want to tell can fit in the broad church of crime.

## 3. Broken Ground is your most recent Karen Pirie novel. What was that like to write?

More or less like the previous 32... It started with a small idea that I played with over a couple of years, experimenting in my head with what might fit with it and how it might play out. And figuring out whose stories fitted in and how.

 But I grit my teeth and somehow make it to the end.

## 4. What is on your list of books to read at the moment?

[Ali Smith's Spring](https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/ENQ/OPAC/BIBENQ?BRN=2523345), [Helen Fitzgerald's Worst Case Scenario](https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/ENQ/OPAC/BIBENQ?BRN=2545061) and [Haylen Beck's Lost You](https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/ENQ/OPAC/BIBENQ?BRN=2563841).

## 5. Do you have a message for your many readers in Suffolk?

Don't be shy about saying hello when you come to get your book signed!

## 6. You are visiting Suffolk in June for Slaughter in Southwold. Can you give us a small taster of what to expect?

I think you should be telling me what to expect! Me, I'll be talking about my work with my usual enthusiasm.

## 7. You have been interviewed many times. Can you tell us something your readers may not know about you?

My first broadcast quiz show was Television Top of the Form in 1969.

repository: suffolklibraries/sljekyll

repo_name: suffolklibraries/sljekyll


text:
# Workshop

Today you will be TDD'ing a shopping cart.

## Getting started

1. Clone this repository: `git clone git@github.com:dburriss/TestingWorkshop.git`
1. In this directory (the *workshop* directory) you will find starter projects for [C#](csharp/) ,[F#](fsharp/), and [JS](js/). Pick which is your preferred language and open it in your favorite editor.

## Instructions

1. Implement each feature before you move onto the next one (do not read ahead)
1. You can ask colleagues or the instructor for help at any time
1. You must have a failing test for any new code you write
1. Try implement each feature in the most simple way possible
1. Do not forget to go back and refactor once a test is passing

## Assignment

Your team has been tasked with creating a new shopping cart experience. As this is a critical section of the website, as a team you have decided to TDD it as you have heard it lowers the occurrences of defects.

*Basic definition of a product model:*

```
data Product = {
    Id:unique identifier
    Code:6 letter alphanumeric
    Description:text
    Amount:number with decimal
    Version:integer
}
```

### Part 1

Warming up. Implementing the basic cart functionality.

1. As a customer I want to be able to add a product to my shopping cart so that I can carry on shopping and pay for it later
1.  As a customer I want to be able to be able to increment the quantity of any item in my cart
1. As a customer I want to be able to be able to decrement the quantity of any item in my cart
1. As a customer I want to be able to be able to set the quantity of any item in my cart
1. As a customer I want to be able to be able to see the total value of the current items in my cart

### Part 2

Dealing with dependencies. We want visibility on what is happening on the cart. We want any changes to the contents of the cart to be logged. Ise `ILogger` in your cart implementation to send a log when products are added and removed. We also want to be able to see when exceptions occur.

1. As a business analyst I want to be able to scrape the log files to the see what products were added and removed from carts so that I can analyze user behavior.
1. As a developer I want to know what exceptions are happening in my cart so I can implement fixes for defects that block checkout.

### Part 3

Dealing with change. There is an external API that allows you as a developer to POST a list of products to with quantities. You will get back the discounts that apply to the Product Lines as well as those applying to the cart as a whole.

*Definition of Discounts model*

```
data ItemDiscount = (PercentagePerProduct is percentage) OR (PercentagePerProductLine is percentage)

data ItemDiscountResult = {
    ProductId:unique identifier
    Discount: ItemDiscount
}

data CartDiscountResult is percentage

data Discount = ItemDiscountResult OR CartDiscountResult

data DiscountResult is list of Discount
```

1. As a customer I want any discounts that apply to items in my cart to reflect in the item price and total price
1. As a customer I want to see the amount of the discount on a Product Line so I know how much I am saving per line
1. As a customer I want to see the amount of the discount due to the total contents of my cart so I know how much I am saving in total

repository: dburriss/TestingWorkshop

repo_name: dburriss/TestingWorkshop


text:
---
hrs_structure:
  division: '2'
  volume: '9'
  title: '24'
  chapter: 435E
  section: '435E-17'
type: hrs_section
tags:
  - Business
menu:
  hrs:
    identifier: HRS_0435E-0017
    parent: HRS0435E
    name: 435E-17 Minimum indemnity level
weight: 34050
title: Minimum indemnity level
full_title: 435E-17 Minimum indemnity level
---
**§435E-17 Minimum indemnity level.** Each participating member shall be covered by such interindemnity arrangement for not less than $100,000 for each claim and not less than $300,000 annual aggregate of professional negligence, with the terms and conditions of such coverage to be specified in the trust agreement. [L 1977, c 182, pt of §1]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# Automation Architecture

*How you would integrate the scripts into a CI/CD environment.
These can include integration with Cloud Based services or locally and describe why the choices made.*

### Why Pipeline on Jenkins: ###

- Is well know that Jenkins is the most popular tool for CI/CD and also is highly customizable, this project contains Java and Maven so would perfectly fits on a Jenkins pipeline using a well developed Jenkinsfile that would do code checkout on GitHub, manage both API and UI tests in order to run in different nodes, and also to improve this would be add a feature to setup cron time jobs to schedule all this tests.

 Things nice to add:

 - Parameters, to escalated the variety of test cases.
 - There is a lot of incredible report plugins that is valuable (Allure is great)
 - Manage on Jenkinsfile script to send email alerts if any job fails

### Why Cloud Based: ###

- Considering that we already have our Jenkins (master) up an running, lets face this scenario: if you want to add some tests in the flow, this can become quite a huge infrastructure and also hard to maintain. To provide a modern, and scalable solution for that, Kubernetes would be my choice: Jenkins can run tasks on different agent nodes while kube-plugin enable the possibility to create these nodes dynamically and also run many build plans in parallel.

- And the awesome part: an agent node is created only for the task execution and deleted afterwards, so a pod (one or more container) execute a unique task limited in time. Which means: the container go up do this job and then get down, without no need to maintain an infrastructure idle.

- A nice & smoothly infrastructure draft: first we have our Jenkins Master (with all the plugins needed installed: git, reports, K8S), and this can be easily scalable using slaves (on that Manage Nodes config!).

##### A very simplified diagram draft with my idea #####

repository: marinalb/white-prompt-qa

repo_name: marinalb/white-prompt-qa


text:
# Usage

To understand usage for this `nested_workspace`, see the top-level
[`cloudbuild.yaml`](https://github.com/GoogleCloudPlatform/cloud-builders/blob/master/go/cloudbuild.yaml)
for the `go` builder, which builds this nested workspace.

(Search for `nested_workspace` in that file.)

repository: GoogleCloudPlatform/cloud-builders

gha_language: Go

repo_name: GoogleCloudPlatform/cloud-builders


text:
## these are the notes for my fabulous project ##

- UP API uses OAUTH 2.0 protocol
- client_id and client_secret is assigned to each application
- developer requests authorization from user to obtain access token to use on future requests.
  - each token has an expiration time (one year) and the dev can use multiple times.

## goals ##

- leveling up character
- evolving a charaacter
- adding stats.

## emulator ##

- react-native init
- globally intall react-native
- can't use react-native-app
- can't use geni-motion
- need expo which i can't use without react native app

## schedule ##

- thursday:
  - deploy site                             - finished
  - create app in jawbone                   - finished
  - get client_ info for the app            - finished
  - understand how to access routes         - finished
  - set up login on home page               - finsihed
  - figure out home background img          - finished

  saturday:
  - progressive web app?
  - flesh out user home component
  - integrate necessary info to user home
  - get cardiomon pic to render
  - get cardiomon stats routes

  ## BEWARE ##

  - login id collisions: https://stackoverflow.com/questions/29321659/jawbone-up-api-oauth-and-access-tokens

repository: alexzobi/stackathon

repo_name: alexzobi/stackathon


text:
## Use Cases

[Banking Fraud](https://github.com/aws-samples/amazon-sagemaker-architecting-for-ml/blob/master/Writeups/Banking%20Fraud.md)

[Recommendation Engine](https://github.com/aws-samples/amazon-sagemaker-architecting-for-ml/blob/master/Writeups/Recommendation%20Engine.md)

[Predictive Maintainance](https://github.com/aws-samples/amazon-sagemaker-architecting-for-ml/blob/master/Writeups/Predictive_Maintenance.md)

[Predicting Airline Delays using SparkML & Sagemaker](https://github.com/aws-samples/amazon-sagemaker-architecting-for-ml/blob/master/Writeups/SageMaker%20%2B%20Spark.md)

[NLP Text Classification](https://github.com/aws-samples/amazon-sagemaker-architecting-for-ml/blob/master/Writeups/NLP:%20Text%20Classification.md)

## License

This library is licensed under the MIT-0 License. See the LICENSE file.

repository: githubmg/ai-ml-bb

gha_license_id: NOASSERTION

repo_name: githubmg/ai-ml-bb


text:
title:          The Unofficial GitHub Release Button
description:    A dynamic last release button for any GitHub repository with version number and tarball link.
author:         Pierre Cassat

----

Contents
--------

-   [Tests](#tests)
-   [Usage](#usage)
-   [Available options](#available-options)
-   [Known issues](#known-issues)
-   [Open source](#open-source)

----

Tests
-----

Most of these tests are made to the [original *github-release-btn* repository](https://github.com/piwi/github-release-btn).

Click on the links below to update the above button dynamically:

-   default test
-   test with green color
-   test with red color
-   test with custom color
-   test with red color with a custom title
-   test with zipball link
-   test with HTML link
-   test with repository link
-   test with no link
-   test with 'strict' mode
-   test with 'metadata' mode
-   test with 'type=no.v.prefix'
-   test with 'type=with.a.very.long.*'
-   test on a repository with no realease or tag

----

Usage
-----

The base URL of the button is `https://ghrb.herokuapp.com/github-release-btn`.

You can use the button in an `iframe`, which will keep the link to the tarball or the original repository:

```html
<iframe src="https://ghrb.herokuapp.com/github-release-btn?user=piwi&repo=github-release-btn"
    frameborder="0" scrolling="0"
    width="190px" height="20px">
</iframe>
```

You can also embed the button as a simple image, to let you choose to surround it in a custom link:

```html
<img src="https://ghrb.herokuapp.com/github-release-btn?user=piwi&repo=github-release-btn"
    alt="last release" />
```

NOTE - The image notation allows to be used in [a markdown](http://daringfireball.net/projects/markdown/syntax) content easily:

    # simple image
    ![alt](https://ghrb.herokuapp.com/github-release-btn?user=piwi&repo=github-release-btn)
    # image linked to the releases' page
    [![alt](https://ghrb.herokuapp.com/github-release-btn?user=piwi&repo=github-release-btn)](https://github.com/piwi/github-release-btn/releases)

----

Available options
-----------------

You can (or must) use the following options as URL parameters to customize
your rendering:

-   `user` (**required**): the GitHub user name
-   `repo` (**required**): the GitHub repository name
-   `type` (*optional, defaults to "`default`"*): the release type to match
    -   `type=default`: will match last version number like `(v)X.Y.Z(-STATE)`
    -   `type=strict`: will match last version number like `(v)X.Y.Z`
    -   `type=metadata`: will match last version number like `(v)X.Y.Z-STATE` ("state" required)
    -   `type=STRING`: will match last version number like `(v)X.Y.Z-STRING`
-   `color` (*optional, defaults to "`blue`"*): the button color
    -   `color=blue`: blue button
    -   `color=green`: green button
    -   `color=red`: red button
    -   `color=XXXXXX`: custom colored button
-   `link` (*optional, defaults to "`tarball`"*): the button link URL
    -   `link=tarball`: direct link to download a *tar.gz* archive of the release
    -   `link=zipball`: direct link to download a *zip* archive of the release
    -   `link=html`: link to the release's page on GitHub
    -   `link=repo`: link to the repository's homepage on GitHub
    -   `link=none`: no link around the button
-   `title` (*optional, defaults to `last release`*): the title of the button (its left part)

----

Known issues
------------

The button has a dynamic width depending on the text inside each part of it.
As you can't really guess this width, you must find a way to let the browser adapt the size
of the *image* or *iframe* to its content. This can be done quite easily for an image, with
a smart `style` attribute like `<img style="max-width:100%;" ...` but is more difficult for
an iframe. In this case, you may adjust its width dynamically using javascript or set up a
full page width frame.

I use a fixed width of 190 pixels in the examples of this page as it seems to fit most cases.

----

Open source
-----------

The unofficial GitHub Release Button is open source, available on [GitHub](http://github.com/)
for downloading, forking and contributing. It is coded as a PHP app freely hosted
and deployed by [Heroku](http://heroku.com/).

View it on GitHub

repository: e-picas/github-release-btn

repo_name: e-picas/github-release-btn


text:
# lstm-parser
Transition based dependency parser with state embeddings computed by LSTM RNNs

#### Required software

 * A C++ compiler supporting the [C++11 language standard](https://en.wikipedia.org/wiki/C%2B%2B11)
 * [Boost](http://www.boost.org/) libraries
 * [Eigen](http://eigen.tuxfamily.org) (newer versions strongly recommended)
 * [CMake](http://www.cmake.org/)

#### Checking out the project for the first time

The first time you clone the repository, you need to sync the `cnn/` submodule.

    git submodule init
    git submodule update

#### Build instructions

    mkdir build
    cd build
    cmake .. -DEIGEN3_INCLUDE_DIR=/path/to/eigen
    make -j2

#### Pretrained models

TODO

#### Citation

If you make use of this software, please cite the following:

    @inproceedings{dyer:2015acl,
      author={Chris Dyer and Miguel Ballesteros and Wang Ling and Austin Matthews and Noah A. Smith},
      title={Transition-based Dependeny Parsing with Stack Long Short-Term Memory}
      booktitle={Proc. ACL},
      year=2015,
    }

#### License

This software is released under the terms of the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).

repository: miguelballesteros/lstm-parser

repo_name: miguelballesteros/lstm-parser


text:
# Composition Lines

In this project, there are a number of common compositional line views,
such as the golden spiral line, the gold style line, the well pattern line,
and so on.

## FibonacciView
Fibonacci Golden Spiral View

![demo_show](./screenshots/show.png)

## other
not born now

# LICENCE
Copyright 2017 Jianguo Yang

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

repository: lgyjg/CompositionLines

repo_name: lgyjg/CompositionLines


text:
# JABC HR Solution

This is a working repository for Team OECM's JABC HR Solution. This README will document major components of this solution. If you are a maintainer of this repository, please remember to keep this document up-to-date with important latest changes.

## Contributing

Features are to be developed in branches off of master, and merged into master with the approval of _at least_ one external reviewer. When you have branched off of master, please remember to pull master often to mitigate the risk of merge conflicts. A basic Git workflow for development of the JABC HR solution is as follows

1. Create a feature branch off of master in the format [initials]/[JIRA issue number]. For example, the associated branch name for a developer named "Paul Carter" who is assigned the ticket JA-12 (write unit tests for database facade) would be `pc/JA-12`.
2. Once you have completed the feature to your satisfaction, please make a pull request with the title [Jira Issue number]: [brief description], and tag all team members for review. For example, the pull request title for the branch `pc/JA-12` would be "JA-12: write unit tests for DBFacade".
3. Do _not_ merge branches into master without the approval of at least one other team member.

## Requirements

[Docker](https://www.docker.com/get-started) and [Yarn](https://yarnpkg.com/lang/en/docs/install/) should be installed on your machine.

## Backend
1. Run `yarn build` from the root directory to compile TypeScript source files.
2. Run `yarn start` from the root directory to start the server.
3. The server will be listening on port 8080.

#### Grunt
If you want to use grunt while developing the backend, run:
`grunt serve` this will:
1. Watch the ts files, recompile when changes
2. Watch the js files, restart the server when changes
Note: you will probably need to install grunt cli globally, `npm install -g grunt-cli`

## Frontend
1. Run `yarn build` from the root of `frontend/` to compile React source files.
2. Run `yarn start` from directory to start client.
3. The client will exist on port 3000.

## Docker compose
1. Run `docker-compose up` from the root directory to start the system.
2. You should be able to access the JABC system on `localhost:3000`

## Database
To run database as a standalone
Developing requires `docker` for desktop and `mysql` shell client to create a local database container.
Should use docker for mac instead of docker toolbox if possible.
Using docker for mac will cause the VM to be created using localhost as address.

```sh
brew cask install docker
# Note: You'll need to open up the Docker app Homebrew installed to set it up
```

After installing the tools, at the db directory of this repository, run:
```sh
# Initialize images
docker-compose build
```
To start a stopped database or create new database instance, run:
```sh
# Initialize images
docker-compose up -d
```

To get a fresh copy of database, run this script at db while container is up and running:
```sh
./resetdb.sh
```

Alternatively, you can just destroy current containers and rebuild from image:
```sh
# destroys current copy of database
docker-compose down
# starts new containers using images
docker-compose up -d
```

Access database through phpmyadmin at localhost:80, using jabc_db, root, root

Here are some useful commands:
```sh
docker images # to see your images
docker rmi    # to remove a image
docker ps -a  # to see all your containers
```


text:
---
ID: 38
post_title: Clock in terminal
author: Jonathan Carroll
post_date: 2012-11-16 14:00:02
post_excerpt: ""
layout: post
permalink: http://jcarroll.com.au/2012/11/16/38/
published: true
---
Here's a little bash code that adds a clock to the upper right part of your terminal...

<!--more-->

[sourcecode language="bash" padlinenumbers="3"]

clock() {
while sleep 1;
do
   tput sc;
   tput cup 0 $(($(tput cols)-29));
   echo -n " $(date)";
   tput rc;
done &;
}

[/sourcecode]


text:
# polly
Polymorphic Volume Scheduling

![polly](images/polly.png)

## Overview
`Polly` implements a centralized storage scheduling service that integrates with popular `container schedulers` of different application platforms for containerized workloads. It is an open source framework that supports use of external storage, with scheduled containerized workloads, at scale. It can be used to centralize the control of creating, mapping, snapshotting and deleting persistent data volumes on a multitude of storage platforms.

## Key Features
- Configure services to interface with schedulers and groups of container runtimes
- Restrict existing volumes and new volumes to services
- Centralized control and distribution of storage resources
- Offer based mechanism for advertising storage to container schedulers
- Framework supporting direct integration to any container scheduler, storage orchestrator, and storage platform
- Basic Volume Management capabilities

## What it does
Container runtime schedulers need to be integrated with every aspect of available hardware resources, including persistent storage. When requesting resources for an application the scheduler gets offers for CPU, RAM _and_ disk.

To be able to offer persistent storage in a scalable way, the application and container scheduler needs awareness of the available resources from the underlying storage infrastructure.

## Example workflow

1. An application requires highly available storage with a specific set of policies applied
1. The scheduler receives a request to start the application
3. The scheduler checks with Polly or already has an off from Polly for storage resources
4. Polly requests the volume(s) to be mapped to the container
5. Scheduler issues request to start the container with persistent storage
6. Container runtime orchestrates process of starting container and attaching persistent storage

## Container runtime scheduler support
 - Docker Swarm
 - Mesos
 - Kubernetes
 - Cloud Foundry

## Cloud platform support
- AWS EC2 (EBS)
- Google Compute Engine
- OpenStack
 - Private Cloud
 - Public Cloud (RackSpace, and others)

## Storage platform support
 - EMC ScaleIO
 - XtremIO
 - VMAX
 - Isilon
 - VirtualBox
 - Others

## libStorage
Polly makes use of the open source storage plugin framework [libStorage](https://github.com/emccode/libstorage) to enable storage orchestrator tools and container runtimes to make requests of storage. Any storage platform that has a driver implementation for the libStorage framework will work with Polly.

repository: proudh/polly

repo_name: proudh/polly


text:
# Multple Teams

The objective of this project is to allow users to acces multiple Microsoft Teams accounts automatically, without using multible browsers.

# Dependencies

* [Python 3.6 +](https://www.python.org/downloads/)
* [ChromeDriver](https://github.com/ultrafunkamsterdam/undetected-chromedriver): ``pip3 install undetected-chromedriver``

# How to use

* Update the `credentials.json` file adding the credentials for the accounts you want to login
* Run the software by using the following command: `python3 multiple-teams.py`

you can also create aliases (linux) or shortcuts (windows) to make the software easier to use on a daily basis.

repository: FelipeLuz/Multple-Teams

repo_name: FelipeLuz/Multple-Teams


text:
# Acknowledgements
This application makes use of the following third party libraries:

## CrittercismSDK

See http://www.crittercism.com/terms-services/
Generated by CocoaPods - https://cocoapods.org

extension: markdown


text:
Best Practices for Portable Code {#codeguidelines}
========

# Source Code Line Endings #
 All source code line endings should be in "Unix" style "\n". Every text editor understands these line endings on every platform **except** the "Notepad" application on Windows.

# Use of Tabs #
Spaces should be used instead of hard tabs. This helps file portability across different editors. DREAM.3D uses a standard whereby all indents  use two spaces.

#  Always Use an Include Guard #
Always use an "include guard" in your headers:

    #ifndef _MY_HEADER_H_
    #define _MY_HEADER_H_

    Your Code Goes Here

    #endif

Include guards are _#define_ preprocessor directives used in header files that ensure
the header is only ever included **once** during the compiling process for a
given source file. If these guards are not included, it is up to the programmer to make sure that headers are only included a single time, which can become tedious or impossible in some situations with larger projects.

# Use Only ANSI-C99 Integer Types #
The ANSI-C99 standard defines typedefs for 8, 16, 32 and 64 bit integer types. These should be used if possible. Platform specific types such as **int64** and ambiguous types such as

    long int
    signed long int
    unsigned long int

should be avoided at all costs. This usage is important since the number of bytes that a "long" variable occupies will change depending on CPU type and compiler used. This can have an impact on many important operations, such as pointer arithmetic and binary file IO. All Unix  systems have a *stdint.h*  file included with the compiler that defines the proper types. The Microsoft Visual Studio Compiler does not have this file included. There are lots of examples of creating one on the internet. An exemplar file is  also included with the Electronic Imaging software distribution that is generated using CMake.

## C99 Integer Types ##
    int8_t    8  Bit Singed Integer
    uint8_t   8  Bit UnSinged Integer
    int16_t   16 Bit Singed Integer
    uint16_t  16 Bit UnSinged Integer
    int32_t   32 Bit Singed Integer
    uint32_t  32 Bit UnSinged Integer
    int64_t   64 Bit Singed Integer
    uint64_t  64 Bit UnSinged Integer

# Special Constants #
NULL should be used in conjunction with only raw pointers and 0 (zero) should be used in conjunction with numeric values:

    int* value = NULL; // Good
    int* value = 0; // Bad

    int i = 0; // Good
    int i = NULL; // Bad

# Variable Initialization #
*Never* rely on the compiler to initialize variables or pointers for you. Always initialize your variables before first use:

    int i; // Bad, unless this is pure "C" then you have NO choice
    i = 0; // Good. The variable has a known starting value
    float* f = NULL; // Good (if the compiler will let you do this)
    char buffer[512]; // Allocation of char buffer but will be filled with junk
    memset(buffer, 0, 512); // Good. Splat Zeros across the array

## Rationale ##
Initializing your own variables ensures that you are starting from a known state when execution of the code reaches that point. Subtle bugs can occur if you do not initialize your variables and then perform checks on them to see if they are valid. A classic example is the following:

    int* ptr;
    if (!ptr) { initializePointer(ptr); }

When compiled in Debug on *some* compilers this will execute as you would expect. The problems come when the code is compiled in *Release* mode. The _ptr_ variable will **NOT** be set to _NULL_ but instead some random memory address, which can cause problems because the initialization code that should have been running will be skipped due to the conditional _if (!ptr) _ will be true. Remembering to always initialize variables avoids these issues.

# Array Initialization #

    define MY_ARRAY_SIZE  10;
    int array[10];              // Good - Will compile on all platforms
    int array[MY_ARRAY_SIZE];   // Good - Will compile on all platforms
    const int size = 10;
    int array[size];            // Bad - Will NOT compile on all platforms

An array is declared as *datatype name[constant-size]* and groups one or more instances of a data type into  one addressable place. Constant-size may be an expression,  but the expression must evaluate to a constant.

# The Dereference operator `*` and the Address-Of Operator `&` Should Be Directly Connected with the Type-Specifier #

    int32*   p; // Correct
    int32   *p; // Incorrect
    int32*   p, q; // Probably error

The _int32*  p;_ form emphasizes type over syntax while the _int32 *p;_ form emphasizes syntax over type. Although both forms are equally valid C++, the heavy emphasis on types in C++ suggests that _int32* p;_ is the preferable form.

# Never Assume CPU Capabilities #
When writing code, never assume that a CPU has a specific capability such as SSE. Use a _#define_ block to either test for the capability at runtime or write a generic version of your code will work on any machine and then write the specific implementation of the code that is bracketed by a _#ifdef_ block.

    #ifdef HAS_SSE_3
      SSE3 specific code
    #else
       Generic Code or error message stating the cpu is missing the functionality
    #endif

# Copyright & License Information #
Always include a copyright and/or license block at the start of **every** source file. It is good practice to document in the source code any copyright or licensing restrictions in every file that you write. An example license block is shown below.

    ///////////////////////////////////////////////////////////////////////////////
    //
    //  Copyright (c) 2007, 2013 Michael A. Jackson for BlueQuartz Software
    //  All rights reserved.
    //  BSD License: http://www.opensource.org/licenses/bsd-license.html
    //
    ///////////////////////////////////////////////////////////////////////////////

    More stringent notices can also be written into the source code.
    /***************************************************************************
    **
    ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    ** All rights reserved.
    ** Contact: Nokia Corporation<EMAIL_ADDRESS>    **
    ** This file is part of the QtCore module of the Qt Toolkit.
    **
    ** $QT\_BEGIN\_LICENSE:LGPL$
    ** Commercial Usage
    ** Licensees holding valid Qt Commercial licenses may use this file in
    ** accordance with the Qt Commercial License Agreement provided with the
    ** Software or, alternatively, in accordance with the terms contained in
    ** a written agreement between you and Nokia.
    **
    ** GNU Lesser General Public License Usage
    ** Alternatively, this file may be used under the terms of the GNU Lesser
    ** General Public License version 2.1 as published by the Free Software
    ** Foundation and appearing in the file LICENSE.LGPL included in the
    ** packaging of this file.  Please review the following information to
    ** ensure the GNU Lesser General Public License version 2.1 requirements
    ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    **
    ** In addition, as a special exception, Nokia gives you certain additional
    ** rights.  These rights are described in the Nokia Qt LGPL Exception
    ** version 1.1, included in the file LGPL\_EXCEPTION.txt in this package.
    **
    ** GNU General Public License Usage
    ** Alternatively, this file may be used under the terms of the GNU
    ** General Public License version 3.0 as published by the Free Software
    ** Foundation and appearing in the file LICENSE.GPL included in the
    ** packaging of this file.  Please review the following information to
    ** ensure the GNU General Public License version 3.0 requirements will be
    ** met: http://www.gnu.org/copyleft/gpl.html.
    **
    ** If you have questions regarding the use of this file, please contact
    ** Nokia at<EMAIL_ADDRESS>    ** $QT\_END\_LICENSE$
    **
    ***************************************************************************/

# Always Implement the "Big Three" in C++ Classes #
When writing C++ classes the programmer will always define the "Big Three" which are defined as:

- copy constructor
- copy assignment operator
- destructor

The programmer should **never** allow the compiler to implement these methods. This will happen if they are not explicitly defined in the class declaration. Further more if the destructor is declared _public_ then it **will** have the **virtual** modifier applied to the declaration.

    class A
    {
      public:
         A();
         virtual ~A();
      private:
       A(const A&);               //Copy Constructor Not Implemented
       void operator=(const A&);  //Copy Assignment Not Implemented
    };

Note that with C++11, programmers now have the ability to inform the compiler which of these operations can be constructed by default and which can be ignored using the `default` and `delete` keywords.

# String Constants #
String constants in C++ should be declared as:

    const std::string MyFile("SomeFile.dat");

Like constants should be grouped into a namespace.

    namespace MyConstants {
        const std::string MyFile("SoimeFile");
    }

When using ANSI C one should use a char* for constant strings:

    const char* MyFile "SomeFile.dat";
    const char MyFile[5] = { 'a', '.', 'd', 'a', 't'};

Using this type of approach allows for quicker code updates when constant values need to be changed.

branch_name: refs/heads/develop


text:
# TMDb Movie Search

## Tools
Key tools used in this React project are:

| Tool             | Description   |
| :-------------:|--------------|
| [React](http://facebook.github.io/react/index.html) | A JavaScript library for building user interfaces |
| [Typeahead.js](https://twitter.github.io/typeahead.js/) | A flexible JavaScript library that provides a strong foundation for building robust typeaheads |
| [Bloodhound](https://github.com/twitter/typeahead.js/blob/master/doc/bloodhound.md) | Bloodhound is the typeahead.js suggestion engine |
| [Bootstrap](http://getbootstrap.com/) | Build responsive, mobile-first projects on the web with the world's most popular front-end component library |
| [SASS](http://sass-lang.com/) | 	Sass is the most mature, stable, and powerful professional grade CSS extension language in the world |
| [Browserify](http://browserify.org/) | Browserify lets you `require('modules')` in the browser by bundling up all of your dependencies |
| [Babel](https://babeljs.io/) | Use next generation JavaScript, today |
| [Gulp](http://gulpjs.com/) | Gulp is a toolkit for automating painful or time-consuming tasks in your development workflow |

# Development

```
$ npm install
$ gulp watch
```

# Deployment

```
$ gulp build
```

# What?
MDb Movie Searcher с использованием стека из библиотеки [React](http://facebook.github.io/react/index.html) и стека технлогий Twitter's [typeahead.js](https://twitter.github.io/typeahead.js/) + [Bloodhound](https://github.com/twitter/typeahead.js/blob/master/doc/bloodhound.md)


text:
# Mandelbrot
A Mandelbrot renderer using my DX11 framework (https://github.com/RyanTorant/FrameDX), with both GPU and CPU implementations.
It features x2 AA, either by using groupshared memory on the GPU implementation, or AVX for the CPU implementation.
The GPU implementation can use either single or double precision, the CPU one runs always at double precision.

## Results on my system
Running on a Xeon E5-2683v3 and a GTX 980 Ti I'm getting the following FPS, for the starting configuration

| Renderer        | FPS           |
| ------------- |:-------------:|
| CPU     | 179 |
| GPU (SP)     | 1839      |
| GPU (DP) | 218      |

DP is so slow on consumer NVidia cards that my CPU (ok, it's a 14c/28t CPU, but still a CPU) catches up with it, and even passes it, depending on where you are on the fractal.

## Why do this?
For fun! Besides, while small, it's quite complete as a project, you get compute shaders with memory sharing, SIMD programming, and general DX11 stuff.

repository: ldotn/Mandelbrot

repo_name: ldotn/Mandelbrot


text:
# Radio Button for iOS
Pretty simple class that extends standard UIButton functionality.
Default and selected states can be configured for every button.

![Demo](https://raw.github.com/onegray/RadioButton-ios/data/demo.gif)

#### Super easy to use
It does not need any central manager. Just link the buttons right in Interface Builder:

![Demo](https://raw.github.com/onegray/RadioButton-ios/data/linking.gif)

Alternatively group the buttons using single line of code:

	radio1.groupButtons = @[radio1, radio2, radio3];

Select any button, and all other button in the same group become deselected automatically:

	radio2.selected = YES; // radio1 and radio3 become deselected

Any button from the group knows which one is selected:

	RadioButton* r1 = radio1.selectedButton;
	RadioButton* r2 = radio2.selectedButton;
	RadioButton* r3 = radio3.selectedButton;
	NSAssert (r1==r2 && r2==r3, @"Must be equal");

And a helpful method to select button by tag:

	[radio1 setSelectedWithTag:kTagRadio3];

#### Resources
[sample.zip](https://github.com/onegray/RadioButton-ios/archive/sample.zip) - Sample app
[radio-res-ios.zip](https://raw.github.com/onegray/RadioButton-ios/data/radio-res-ios.zip) - Radio Button images used in the sample

#### License
RadioButton is available under the MIT license - fork, modify and use however you want.


text:
# Mooncoin [MOON]
http://mooncoin.info/

<!--| ![Mooncoin](http://bit.ly/moonlogo) |-->
![Mooncoin](https://raw.githubusercontent.com/mooncoin-project/mooncoin-landann/mooncoin/src/qt/res/icons/bitcoin.png)

## What is Mooncoin?
Mooncoin is like Bitcoin, but based on Litecoin, and aimed to take you TO THE MOON!
http://mooncoin.info/

## IRC
irc.freenode.net Channel: #mooncoin

## License
Mooncoin is released under the terms of the MIT license. See [COPYING](COPYING)
for more information or see http://opensource.org/licenses/MIT.

## Development and Contributions
Developers work in their own trees, then submit pull requests when they think
their feature or bug fix is ready.

Mooncoin 1.871.1.0 ![minkiz.co](http://minkiz.co/img/assets/minkiz.png)

### Linux wallet
![Mooncoin](https://raw.githubusercontent.com/mooncoin-project/mooncoin-landann/mooncoin/src/qt/res/src/linux-wallet.png)

### Windows wallet
![Mooncoin](https://raw.githubusercontent.com/mooncoin-project/mooncoin-landann/mooncoin/src/qt/res/src/win-wallet.png)

### Mac wallet
![Mooncoin](https://raw.githubusercontent.com/mooncoin-project/mooncoin-landann/mooncoin/src/qt/res/src/mac-wallet.png)

## Frequently Asked Questions

### How many Mooncoins exist?
As of the time of this writing, approximately 117 billion MOON have been issued. Sometime in the next five to seven years, there will be roughly 384,400,000,000 coins in existence, which is roughly one coin for every millimeter of distance from the Earth TO THE MOON!

### Mooncoin details
Scrypt Proof of Work

90 second block targets with Kimoto's Gravity Well to discipline the difficulty adjustments per block.

Random block rewards:

| Block range | # MOON Reward |
|:------------|--------:|
|1 - 100,000 | 0 - 2,000,000|
|**100,001** - **200,000** | **0 - 1,000,000**|
|200,001 - 250,000 | 0 - 600,000|
|250,001 - 300,000 | 0 - 350,000|
|300,001 - 350,000 | 0 - 175,000|
|350,001 - 375,000 | 0 - 100,000|
|375,001 - 384,400 | 0 - 50,000|

All future blocks are a fixed 29531 MOON.

repository: mooncoin-project/mooncoin-landann

branch_name: refs/heads/mooncoin

repo_name: mooncoin-project/mooncoin-landann