text:
JsonUnit [![Apache License 2](https://img.shields.io/badge/license-ASF2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.txt) [![Build Status](https://travis-ci.org/lukas-krecan/JsonUnit.png?branch=master)](https://travis-ci.org/lukas-krecan/JsonUnit) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.javacrumbs.json-unit/json-unit/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.javacrumbs.json-unit/json-unit)
========

JsonUnit is a library that simplifies JSON comparison in tests.

- [APIs](#apis)
  * [AssertJ integration](#assertj)
  * [Hamcrest matchers](#hamcrest)
  * [Spring MVC assertions](#spring)
  * [Spring WebTestClient](#spring-web-client)
  * [Spring REST client assertions](#spring-client)
  * [Vintage APIs](#vintage)
- [Features](#features)
  * [JsonPath support](#jsonpath)
  * [Ignoring values](#ignorevalues)
  * [Ignoring elements](#ignoreelements)
  * [Ignoring paths](#ignorepaths)
  * [Regular expressions](#regexp)
  * [Type placeholders](#typeplc)
  * [Custom matchers](#matchers)
  * [Options](#options)
  * [Array indexing](#arrayIndexing)
  * [Numerical comparison](#numbers)
  * [Escaping dots](#dots)
  * [Lenient parsing of expected value](#lenient-parsing-of-expected-value)
  * [Jackson Object Mapper customization](#jackson-object-mapper-customization)
- [Release notes](#release-notes)

# APIs
There are several different APIs you can use. They all have more or less the same features, just the usage is
slightly different.

## AssertJ integration
The recommended API is AssertJ integration which combines the power of JsonUnit and AssertJ.

```java
import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson;
import static net.javacrumbs.jsonunit.assertj.JsonAssertions.json;

...

// compares two JSON documents (note lenient parsing of expected value)
assertThatJson("{\"a\":1, \"b\":2}").isEqualTo("{b:2, a:1}");

// objects are automatically serialized before comparison
assertThatJson(jsonObject).isEqualTo("{\n\"test\": 1\n}");

// AssertJ map assertions (numbers are converted to BigDecimals)
assertThatJson("{\"a\":1}").isObject().containsEntry("a", BigDecimal.valueOf(1));

// Type placeholders
assertThatJson("{\"a\":1, \"b\": {\"c\" :3}}")
    .isObject().containsValue(json("{\"c\" :\"${json-unit.any-number}\"}"));

// AssertJ string assertion
assertThatJson("{\"a\": \"value\"")
    .node("a").isString().isEqualTo("value");

// AssertJ array assertion
assertThatJson("{\"a\":[{\"b\": 1}, {\"c\": 1}, {\"d\": 1}]}")
    .node("a").isArray().contains(json("{\"c\": 1}"));

// Can ignore array order
assertThatJson("{\"a\":[{\"b\": 1}, {\"c\": 1}, {\"d\": 1}]}")
    .when(Option.IGNORING_ARRAY_ORDER).node("a").isArray()
    .isEqualTo(json("[{\"c\": 1}, {\"b\": 1} ,{\"d\": 1}]"));

// custom matcher
assertThatJson("{\"test\":-1}")
    .withConfiguration(c -> c.withMatcher("positive", greaterThan(valueOf(0))))
    .isEqualTo("{\"test\": \"${json-unit.matches:positive}\"}");

// and
assertThatJson("{\"test\":{\"a\":1, \"b\":2, \"c\":3}}").and(
    a -> a.node("test.a").isEqualTo(1),
    a -> a.node("test.b").isEqualTo(2)
);

// JsonPath support
assertThatJson(json)
    .inPath("$.store.book")
    .isArray()
    .contains(json(
        "            {\n" +
            "                \"category\": \"reference\",\n" +
            "                \"author\": \"Nigel Rees\",\n" +
            "                \"title\": \"Sayings of the Century\",\n" +
            "                \"price\": 8.96\n" +
            "            }"
    ));
```

JsonUnit tries to be clever when parsing the expected value. If the value can be parsed as valid JSON, it's
parsed so. If it can't be parsed, it's considered to be just a string to be compared. It usually works,
but it can lead to unexpected situations, usually with primitive values like numbers and booleans.

```java
// This test does NOT pass. "1" is parsed as JSON containing number 1, the actual value is a string.
assertThatJson("{\"id\":\"1\", \"children\":[{\"parentId\":\"1\"}]}")
    .inPath("children[*].parentId")
    .isArray()
    .containsOnly("1");

// You have to wrap the expected value by `JsonAssertions.value()`
// to prevent parsing
assertThatJson("{\"id\":\"1\", \"children\":[{\"parentId\":\"1\"}]}")
    .inPath("children[*].parentId")
    .isArray()
    .containsOnly(value("1"));

// "true" is valid JSON so it gets parsed to primitive `true`
// Have to wrap it to JsonAssertions.value() in order to make sure it's not parsed
assertThatJson("{\"root\":[\"true\"]}").node("root").isArray().containsExactly(value("true"));
```

On the other hand, if you want to make sure that the expected value is parsed as JSON, use `JsonAssertions.json()`.

### Kotlin support
Following Kotlin API is supported (notice different import)

```kotlin
// Kotlin
import net.javacrumbs.jsonunit.assertj.assertThatJson

assertThatJson("""{"root":{"a":1, "b": 2}}""") {
    isObject
    node("root.a").isEqualTo(1)
    node("root.b").isEqualTo(2)
}
```

To use AssertJ integration, import

```xml
<dependency>
    <groupId>net.javacrumbs.json-unit</groupId>
    <artifactId>json-unit-assertj</artifactId>
    <version>3.0.0</version>
    <scope>test</scope>
</dependency>
```
For more examples see [the tests](https://github.com/lukas-krecan/JsonUnit/blob/master/tests/test-base/src/main/java/net/javacrumbs/jsonunit/test/base/AbstractAssertJTest.java).

## Hamcrests matchers
You use Hamcrest matchers in the following way

```java
import static net.javacrumbs.jsonunit.JsonMatchers.*;
import static org.junit.Assert.*;
import static net.javacrumbs.jsonunit.core.util.ResourceUtils.resource;
...

assertThat("{\"test\":1}", jsonEquals("{\"test\": 1}"));
assertThat("{\"test\":1}", jsonPartEquals("test", 1));
assertThat("{\"test\":[1, 2, 3]}", jsonPartEquals("test[0]", 1));

assertThat("{\"test\":{\"a\":1, \"b\":2, \"c\":3}}",
    jsonEquals("{\"test\":{\"b\":2}}").when(IGNORING_EXTRA_FIELDS));

// Can use other Hamcrest matchers too
assertThat("{\"test\":1}", jsonPartMatches("test", is(valueOf(1))))

assertThat("{\"test\":1}", jsonEquals(resource("test.json")));
```

To use import
```xml
<dependency>
    <groupId>net.javacrumbs.json-unit</groupId>
    <artifactId>json-unit</artifactId>
    <version>3.0.0</version>
    <scope>test</scope>
</dependency>
```

For more examples see [the tests](https://github.com/lukas-krecan/JsonUnit/blob/master/tests/test-base/src/main/java/net/javacrumbs/jsonunit/test/base/AbstractJsonMatchersTest.java).

## Spring MVC assertions
JsonUnit supports Spring MVC test assertions. For example

```java
import static net.javacrumbs.jsonunit.spring.JsonUnitResultMatchers.json;
...

mockMvc.perform(get("/sample").andExpect(
    json().isEqualTo("{\"result\":{\"string\":\"stringValue\", \"array\":[1, 2, 3],\"decimal\":1.00001}}")
);
mockMvc.perform(get("/sample").andExpect(
    json().node("result.string2").isAbsent()
);
mockMvc.perform(get("/sample").andExpect(
    json().node("result.array").when(Option.IGNORING_ARRAY_ORDER).isEqualTo(new int[]{3, 2, 1})
);
mockMvc.perform(get("/sample").andExpect(
    json().node("result.array").matches(everyItem(lessThanOrEqualTo(valueOf(4))))
);
```

Following Kotlin DSL is supported:

```kotlin
mockMvc.get(path).andExpect {
    jsonContent {
        node("root").isEqualTo(CORRECT_JSON)
    }
}
```

Inside `jsonContent` you have access to all AssertJ API capabilities as described [here](#assertj).

To use import
```xml
<dependency>
    <groupId>net.javacrumbs.json-unit</groupId>
    <artifactId>json-unit-spring</artifactId>
    <version>3.0.0</version>
    <scope>test</scope>
</dependency>
```

For more examples see [the tests](https://github.com/lukas-krecan/JsonUnit/blob/master/json-unit-spring/src/test/java/net/javacrumbs/jsonunit/spring/testit/MockMvcTest.java).

## Spring WebTestClient
To integrate with Spring WebTest client do

```java
import static net.javacrumbs.jsonunit.spring.WebTestClientJsonMatcher.json;
...

client.get().uri(path).exchange().expectBody().consumeWith(
    json().isEqualTo("{\"result\":{\"string\":\"stringValue\", \"array\":[1, 2, 3],\"decimal\":1.00001}}")
);
client.get().uri(path).exchange().expectBody().consumeWith(
    json().node("result.string2").isAbsent()
);
client.get().uri(path).exchange().expectBody().consumeWith(
    json().node("result.array").when(Option.IGNORING_ARRAY_ORDER).isEqualTo(new int[]{3, 2, 1})
);
client.get().uri(path).exchange().expectBody().consumeWith(
    json().node("result.array").matches(everyItem(lessThanOrEqualTo(valueOf(4))))
);
```

For Kotlin, you can use our bespoke DSL

```kotlin
import net.javacrumbs.jsonunit.spring.jsonContent
...
client.get().uri(path).exchange().expectBody()
    .jsonContent {
        isEqualTo(CORRECT_JSON)
    }
```

Import
```xml
<dependency>
    <groupId>net.javacrumbs.json-unit</groupId>
    <artifactId>json-unit-spring</artifactId>
    <version>3.0.0</version>
    <scope>test</scope>
</dependency>
```

For more examples see [the tests](https://github.com/lukas-krecan/JsonUnit/blob/master/json-unit-spring/src/test/java/net/javacrumbs/jsonunit/spring/testit/WebTestClientTest.java).

## Spring REST client assertions

```java
import static net.javacrumbs.jsonunit.spring.JsonUnitRequestMatchers.json;
...
mockServer.expect(requestTo(URI))
      .andExpect(json().isEqualTo(json))
      .andRespond(withSuccess(jsonResponse, MediaType.APPLICATION_JSON_UTF8));
```

To use import
```xml
<dependency>
    <groupId>net.javacrumbs.json-unit</groupId>
    <artifactId>json-unit-spring</artifactId>
    <version>3.0.0</version>
    <scope>test</scope>
</dependency>
```

For more examples see [the tests](https://github.com/lukas-krecan/JsonUnit/blob/master/json-unit-spring/src/test/java/net/javacrumbs/jsonunit/spring/testit/ClientTest.java).

# Features
JsonUnit support all this features regardless of API you use.

## JsonPath support
You can use JsonPath navigation together with JsonUnit. It has native support in AssertJ integration so you can do something like this:

```java
// AssertJ style
assertThatJson(json)
    .inPath("$.store.book")
    .isArray()
    .contains(json(
        "            {\n" +
            "                \"category\": \"reference\",\n" +
            "                \"author\": \"Nigel Rees\",\n" +
            "                \"title\": \"Sayings of the Century\",\n" +
            "                \"price\": 8.96\n" +
            "            }"
    ));
```

For the other API styles you have to first import JsonPath support module
```xml
<dependency>
    <groupId>net.javacrumbs.json-unit</groupId>
    <artifactId>json-unit-json-path</artifactId>
    <version>3.0.0</version>
    <scope>test</scope>
</dependency>
```

and then use instead of actual value

```xml
import static net.javacrumbs.jsonunit.jsonpath.JsonPathAdapter.inPath;

...
// Fluent assertions
assertThatJson(inPath(json, "$.store.book[*].author"))
    .when(Option.IGNORING_ARRAY_ORDER)
    .isEqualTo("['J. R. R. Tolkien', 'Nigel Rees', 'Evelyn Waugh', 'Herman Melville']");
```

## Ignoring values
Sometimes you need to ignore certain values when comparing. It is possible to use `${json-unit.ignore}` or `#{json-unit.ignore}`
placeholder like this

```java
// AssertJ API
assertThatJson("{\"a\":1}")
    .isEqualTo(json("{\"a\":\"${json-unit.ignore}\"}"));
```
Please note that the assertion will fail if the `test` element is missing in the actual value.

## Ignoring elements
If the element needs to be ignored completely you can use `${json-unit.ignore-element}`
placeholder.

```java
// AssertJ API
assertThatJson("{\"root\":{\"test\":1, \"ignored\": null}}")
      .isEqualTo("{\"root\":{\"test\":1, \"ignored\": \"${json-unit.ignore-element}\"}}");
```

The assertion will not fail if the element is missing in the actual value.

## Ignoring paths

`whenIgnoringPaths` configuration option makes JsonUnit ignore the specified paths in the actual value. If the path
matches, it's completely ignored. It may be missing, null or have any value. Also `when(paths(...), thenIgnore()` can be used.

```java
// AssertJ style
assertThatJson("{\"root\":{\"test\":1, \"ignored\": 1}}")
    .whenIgnoringPaths("root.ignored"))
    .isEqualTo("{\"root\":{\"test\":1}}");

// Hamcrest matcher
assertThat(
  "{\"root\":{\"test\":1, \"ignored\": 2}}",
  jsonEquals("{\"root\":{\"test\":1, \"ignored\": 1}}").whenIgnoringPaths("root.ignored")
);
```

Array index placeholder
```java
assertThatJson("[{\"a\":1, \"b\":2},{\"a\":1, \"b\":3}]")
    .whenIgnoringPaths("[*].b")
    .isEqualTo("[{\"a\":1, \"b\":0},{\"a\":1, \"b\":0}]");
```
Please note that if you use JsonPath, you should start the path to be ignored by `$`
Also note that `whenIgnoringPaths` method supports full JsonPath syntax only in AssertJ API, all the other flavors support only
exact path or array index placeholder as described above.

JsonPath with whenIgnoringPaths example:
```java
// AssertJ API
assertThatJson("{\"fields\":[" +
        "{\"key\":1, \"name\":\"AA\"}," +
        "{\"key\":2, \"name\":\"AB\"}," +
        "{\"key\":3, \"name\":\"AC\"}" +
    "]}")
    .whenIgnoringPaths("$.fields[?(@.name=='AA')].key")
    .isEqualTo("{\"fields\":[" +
        "{\"key\":2, \"name\":\"AA\"}," +
        "{\"key\":2, \"name\":\"AB\"}," +
        "{\"key\":3, \"name\":\"AC\"}" +
    "]}");
```

## Regular expressions
It is also possible to use regular expressions to compare string values

```java
assertThatJson("{\"test\": \"ABCD\"}")
    .isEqualTo("{\"test\": \"${json-unit.regex}[A-Z]+\"}");
```

For matching just part of the string, you can use this (we have to escape twice, once for Java, once for JSON)
```java
assertThatJson("{\"test\": \"This is some text followed by: ABCD, followed by this\"}")
            .isEqualTo("{\"test\": \"${json-unit.regex}^\\\\QThis is some text followed by: \\\\E[A-Z]+\\\\Q, followed by this\\\\E$\"}");
```

Since this is quite hard to write, you can implement an expression builder like
[this](https://github.com/lukas-krecan/JsonUnit/commit/75d68ef1852ade004e93ca42d676f4b996631974#diff-642a52fede8473f98c5a7b25f34c6bd68f33160cf22733127f7f7f13f3cb2fc6R713).

## Type placeholders
If you want to assert just a type, but you do not care about the exact value, you can use any-* placeholder like this

```java
assertThatJson("{\"test\":\"value\"}")
    .isEqualTo("{test:'${json-unit.any-string}'}");

assertThatJson("{\"test\":true}")
    .isEqualTo("{\"test\":\"${json-unit.any-boolean}\"}");

assertThatJson("{\"test\":1.1}")
    .isEqualTo("{\"test\":\"${json-unit.any-number}\"}");

```

You can also use hash instead of string `#{json-unit.any-string}` for example if you are using language with string interpolation
like Kotlin.

## Custom matchers
In some special cases you might want to use your own matcher in the expected document.
```java
 assertThatJson("{\"test\":-1}")
             .withMatcher("positive", greaterThan(valueOf(0)))
             .isEqualTo("{\"test\": \"${json-unit.matches:positive}\"}");
```

In even more special cases, you might want to parametrize your matcher.
```java
 Matcher<?> divisionMatcher = new DivisionMatcher();
 assertThatJson("{\"test\":5}")
    .withMatcher("isDivisibleBy", divisionMatcher)
    .isEqualTo("{\"test\": \"${json-unit.matches:isDivisibleBy}3\"}");

 private static class DivisionMatcher extends BaseMatcher<Object> implements ParametrizedMatcher {
     private BigDecimal param;

     public boolean matches(Object item) {
         return ((BigDecimal)item).remainder(param).compareTo(ZERO) == 0;
     }

     public void describeTo(Description description) {
         description.appendValue(param);
     }

     @Override
     public void describeMismatch(Object item, Description description) {
         description.appendText("It is not divisible by ").appendValue(param);
     }

     public void setParameter(String parameter) {
         this.param = new BigDecimal(parameter);
     }
 }
```
If you need a matcher with more than one parameter, you can implement it
like [this](https://stackoverflow.com/a/66183629/277042).

## Options

There are multiple options how you can configure the comparison

**TREATING_NULL_AS_ABSENT** - fields with null values are equivalent to absent fields. For example, this test passes

```java
assertThatJson("{\"test\":{\"a\":1, \"b\": null}}")
    .when(TREATING_NULL_AS_ABSENT)
    .isEqualTo("{\"test\":{\"a\":1}}");
```

**IGNORING_ARRAY_ORDER** - ignores order in arrays

```java
assertThatJson("{\"test\":[1,2,3]}")
    .when(IGNORING_ARRAY_ORDER)
    .isEqualTo("{\"test\":[3,2,1]}");
```

**IGNORING_EXTRA_ARRAY_ITEMS** - ignores unexpected array items
```java
assertThatJson("{\"test\":[1,2,3,4]}")
    .when(IGNORING_EXTRA_ARRAY_ITEMS)
    .isEqualTo("{\"test\":[1,2,3]}");

assertThatJson("{\"test\":[5,5,4,4,3,3,2,2,1,1]}")
    .when(IGNORING_EXTRA_ARRAY_ITEMS, IGNORING_ARRAY_ORDER)
    .isEqualTo("{\"test\":[1,2,3]}");
```

**IGNORING_EXTRA_FIELDS** - ignores extra fields in the compared value

```java
assertThatJson("{\"test\":{\"a\":1, \"b\":2, \"c\":3}}")
    .when(IGNORING_EXTRA_FIELDS)
    .isEqualTo("{\"test\":{\"b\":2}}");
```

**IGNORE_VALUES** - ignores values and compares only types

```java
assertThatJson("{\"a\":2,\"b\":\"string2\"}")
    .when(paths("a", "b"), then(IGNORING_VALUES))
    .isEqualTo("{\"a\":1,\"b\":\"string\"}");
```

It is possible to combine options.

```java
assertThatJson("{\"test\":[{\"key\":3},{\"key\":2, \"extraField\":2},{\"key\":1}]}")
    .when(IGNORING_EXTRA_FIELDS, IGNORING_ARRAY_ORDER)
    .isEqualTo("{\"test\":[{\"key\":1},{\"key\":2},{\"key\":3}]}");
```

In Hamcrest assertion you can set the option like this

```java
assertThat("{\"test\":{\"a\":1, \"b\":2, \"c\":3}}",
    jsonEquals("{\"test\":{\"b\":2}}").when(IGNORING_EXTRA_FIELDS));
```

You can define options locally (for specific paths) by using `when(path(...), then(...))`:
```java
// ignore array order for [*].a
// AssertJ
assertThatJson("{\"test\":{\"a\":1,\"b\":2,\"c\":3}}").when(paths("test.c"), then(IGNORING_VALUES))
    .isEqualTo("{\"test\":{\"a\":1,\"b\":2,\"c\":4}}");
// ignore array order everywhere but [*].b
assertThatJson("[{\"b\":[4,5,6]},{\"b\":[1,2,3]}]")
    .when(IGNORING_ARRAY_ORDER)
    .when(path("[*].b"), thenNot(IGNORING_ARRAY_ORDER))
    .isEqualTo("[{\"b\":[1,2,3]},{\"b\":[4,5,6]}]");
// ignore extra fields in the object "a"
assertThatJson("{\"a\":{\"a1\":1,\"a2\":2},\"b\":{\"b1\":1,\"b2\":2}}")
    .when(path("a"), then(IGNORING_EXTRA_FIELDS))
    .isEqualTo("{\"a\":{\"a1\":1},\"b\":{\"b1\":1}}"))
// ignore extra array items in the array
assertThatJson("{\"a\":[1,2,3]}")
    .when(path("a"), then(IGNORING_EXTRA_ARRAY_ITEMS))
    .isEqualTo("{\"a\":[1,2]}");
// Hamcrest
assertThat("{\"test\":{\"a\":1,\"b\":2,\"c\":3}}",
    jsonEquals("{\"test\":{\"a\":1,\"b\":2,\"c\":4}}").when(path("test.c"), then(IGNORING_VALUES)));

```
Note that **TREATING_NULL_AS_ABSENT** and **IGNORING_VALUES** require exact paths to ignored fields:
```java
// ignoring number and str
assertThatJson("{\"a\":2,\"b\":\"string2\"}")
    .when(paths("a", "b"), then(IGNORING_VALUES))
    .isEqualTo("{\"a\":1,\"b\":\"string\"}");
// treat null B as absent B
assertThatJson("{\"A\":1,\"B\":null}")
    .when(path("B"), then(TREATING_NULL_AS_ABSENT))
    .isEqualTo("{\"A\":1}");
```
All other options require paths to objects or arrays where values or order should be ignored.

## Array indexing
You can use negative numbers to index arrays form the end
```java
assertThatJson("{\"root\":{\"test\":[1,2,3]}}")
    .node("root.test[-1]").isEqualTo(3);
```

## Numerical comparison
Numbers are by default compared in the following way:

* If the type differs, the number is different. So 1 and 1.0 are different (int vs. float). This does not apply when Moshi is used since it [parses all numbers as Doubles](https://github.com/square/moshi/issues/192).
* Floating number comparison is exact, down to the scale - 1.0 and 1.00 are considered to be different.

You can change this behavior by setting tolerance. If you set tolerance to `0` two numbers are considered equal if they are
equal mathematically even though they have different type or precision (`a.compareTo(b) == 0`)).

```java
assertThatJson("{\"test\":1.00}").node("test").withTolerance(0).isEqualTo(1);
```

If you set tolerance to non-zero value, the values are considered equal if `abs(a-b) < tolerance`.
```java
assertThatJson("{\"test\":1.00001}").node("test").withTolerance(0.001).isEqualTo(1);
```

Or you can use Hamcrest matcher

```java
import static java.math.BigDecimal.valueOf;
...
assertThatJson("{\"test\":1.10001}").node("test")
    .matches(closeTo(valueOf(1.1), valueOf(0.001)));
```

If you are interested why 1 and 1.0 are treated as different numbers please read this [comment](https://github.com/lukas-krecan/JsonUnit/issues/229#issuecomment-623882801).

If you want to have special handling of numerical values, you can inject your own number comparator.

```java
assertThatJson("{\"a\":1.0}")
    .withConfiguration(c -> c.withNumberComparator(numberComparator))
    .isEqualTo("{\"a\":1.00}");
```

## Escaping dots
Sometimes you have dots in JSON element names, and you need to address those elements. It is possible to escape dots like this

```java
assertThatJson("{\"name.with.dot\": \"value\"}").node("name\\.with\\.dot").isStringEqualTo("value");
```

## Lenient parsing of expected value
Writing JSON string in Java is huge pain. JsonUnit parses expected values leniently, so you do not have to quote keys,
and you can use single quotes instead of double quotes. Please note that the actual value being compared is parsed in strict mode.

```java
assertThatJson("{\"a\":\"1\", \"b\":2}").isEqualTo("{b:2, a:'1'}");
```

## Jackson Object Mapper customization
If you need to customize Jackson 2 Object Mapper, you can do using [SPI](https://docs.oracle.com/javase/tutorial/sound/SPI-intro.html).
Implement `net.javacrumbs.jsonunit.providers.Jackson2ObjectMapperProvider`.

```java
public class Java8ObjectMapperProvider implements Jackson2ObjectMapperProvider {
    private final ObjectMapper mapper;

    private final ObjectMapper lenientMapper;

    public Java8ObjectMapperProvider() {
        mapper = new ObjectMapper().registerModule(new JavaTimeModule());
        mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);

        lenientMapper = new ObjectMapper().registerModule(new JavaTimeModule());
        lenientMapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
        lenientMapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
        lenientMapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
    }

    @Override
    public ObjectMapper getObjectMapper(boolean lenient) {
        return lenient ? lenientMapper : mapper;
    }
}
```

and register it in `META-INF/services/net.javacrumbs.jsonunit.providers.Jackson2ObjectMapperProvider`.
See [this example](https://github.com/lukas-krecan/JsonUnit/commit/8dc7c884448c7373886dcf3b0eabfecf47c0710b).

## Logging

Although the differences are printed out by the assert statement, sometimes you use JsonUnit with other libraries like
[Jadler](https://github.com/jadler-mocking/jadler) that do not print the differences between documents. In such case, you can switch on the
logging. JsonUnit uses [SLF4J](http://www.slf4j.org/). The only thing you need to do is to configure your logging
framework to log `net.javacrumbs.jsonunit.difference` on DEBUG level.

## Selecting underlying library

JsonUnit is trying to cleverly match which JSON library to use. In case you need to change the default behavior, you can
use `json-unit.libraries` system property. For example `-Djson-unit.libraries=jackson2,gson`
or `System.setProperty("json-unit.libraries", "jackson2");`. Supported values are gson, json.org, moshi, jackson2

Licence
-------
JsonUnit is licensed under [Apache 2.0 licence](https://www.apache.org/licenses/LICENSE-2.0).

Release notes
=============
## 3.0.0 (2023-07-05)
* Requires Java 17
* Requires Spring 5.2 (when used with Spring)
* `Options` class hidden
* Deprecated methods and classes removed
* Dependency upgrades

## 2.38.0 (2023-05-22)
* Support for NumberComparator
* Dependency updates

## 2.37.0 (2023-03-23)
* Make custom matcher regexp DOTALL (#617)
* Dependency updates

## 2.36.1 (2023-01-29)
* #595 Fix slf4j dependency
* Dependency updates

## 2.36.0 (2022-10-05)
* Support for `node` method in JsonMapAssert #560
* Fixed number parsing in Jackson, so it works as [intended](https://github.com/lukas-krecan/JsonUnit#numbers) (see https://github.com/lukas-krecan/JsonUnit/issues/564 for details)
* Dependency updates

## 2.35.0 (2022-05-06)
* Special handling of numeric values in containsEntry #512
* Dependency updates

## 2.34.0 (2022-04-12)
* Prevent re-parsing of a value #502
* Dependency updates

## 2.33.0 (2022-04-02)
* Fixed #493 comparison of Tuples from extracting function

## 2.32.0 (2022-02-17)
* Fixed #474 ClassCastException in isArray()

## 2.31.0 (2022-02-07)
* Replaced JsonObjectAssert by JsonAssert

## 2.30.0 (2022-02-06)
* Parent type of JsonObjectAssert changed to AbstractAssert

## 2.29.0 (2022-02-05)
* #465 fixed assertion on array of objects. May introduce some backward incompatibility when using `isArray().element(i)`.
* Dependency updates

## 2.28.0

* Automatically register available Jackson 2 modules
* Dependency updates

## 2.27.0

* Made compatible with AssertJ 3.20.x - due to braking changes in AssertJ this version also **requires** AssertJ 3.20.x
  and higher.

## 2.26.0

* Fixed `containsEntries` in AssertJ object assert. This required to change the return type of `isObject()` method which
  may be an incompatible change for tests which store the result in a variable.

## 2.25.0

* Hamcrest matcher made compatible with Rest Assured #338
* Various library upgrades

## 2.24.0

* Fix OSGi configuration
* AssertJ updated to 3.19.0

## 2.23.0

* Better error message for multiple matches in isAbsent check
* Various library upgrades

## 2.22.1

* Better exception message in case of JSON that can not be parsed

## 2.22.0

* Support for Spring WebTestClient

## 2.21.0

* Fixed Kotlin AssertJ bundle #299

## 2.20.0
* assertThatJson accepts null as the actual value

## 2.19.0
* opentest4j made optional #276
* updated all dependencies

## 2.18.1
* Fix multiple `when` method application #234

## 2.18.0
* Support for URI assertions

## 2.17.0
* Do not append tolerance with zero value to diff message (thanks @valfirst)

## 2.16.2
* Fix regex issues on older Androids #227 (thanks @Sirrah)

## 2.16.1
* Add missing Kotlin classes to distribution Jars

## 2.16.0
* Kotlin DSL for AssertJ API

## 2.15.0
* Spring DSL Koltin support
* JUnit upgraded to 5.6.0

## 2.14.0
* Allow differentiating between number and integer

## 2.13.1
* Fix Jackson2NodeFactory thread safety issue in usage of ServiceLoader (thanks @cnauroth)

## 2.13.0
* Recompiled with AssertJ 3.15.0 to fix https://github.com/lukas-krecan/JsonUnit/issues/216
* (Not)Null annotations added
* Spring dependency updated to 5.2.3.RELEASE

## 2.12.0
* Updated dependencies
* Jackson node is not reparsed when compared #214

## 2.11.1
* Parse content as UTF-8 in Spring MVC test if not specified otherwise #212

## 2.11.0
* Fix Kotlin 'Inaccessible type' warning in when-path (@Vladiatro)
* Load resources as UTF-8 (@bencampion)

## 2.10.0
* Support for PathOptions
* AssertJ - support for chaining assertions in the same root
* Support for json-path in AssertJ `whenIgnoringPaths`

## 2.9.0
* Hamcrest upgraded to 2.1
* AssertJ dependency upgraded to 3.12.3 (requires AssertJ > 3.10.0)

## 2.8.1
* hamcrest-core dependency marked as required

## 2.8.0
* #185 JsonUnitRequestMatchers for client-side REST testing
* Support for array (non)emptiness in Fluent assert

## 2.7.0
* Support for Johnzon (requires 1.1.12) (thanks to elexx)

## 2.6.3
* Ignoring paths even when present in expected value #182

## 2.6.2
* Fixed AssertionErrors messages in MultipleFailuresError #181

## 2.6.1
* Path with backspaces matching fixed #176

## 2.6.0
* ${json-unit.ignore-elements} introduced

## 2.5.1
* Array comparison optimization

## 2.5.0
* Fix bug and performance issues in array comparison
* Performance optimizations

## 2.4.0
* Introduced JsonAssertions.value()
* Fixed AssertJ withFailMessage

## 2.3.0
* Support for Jackson 2 ObjectMapper customization
* Some AbstractObjectAssert marked as unsupported

## 2.2.0
* Using opentest4j
* Refactored exception reporting

## 2.1.1
* Better exception reporting
* Fixed invalid Automatic-Module-Name

## 2.0.3
* Fixed missing node handling with JsonPath
* Fixed some complex AsserJ comaprisons

## 2.0.2
* Fixed #144 (AssertJ object handling)

## 2.0.1
* Support for # instead of $ in placeholders

## 2.0.0.RC5
* More expressive Spring assertions (isNull, isNotNull, isTrue, isFalse)

## 2.0.0.RC4
* AssertJ - fix bug with '%' in error message
* Removed support for Jackson 1

## 2.0.0.RC3
* Support for and() in AssertJ assert
* asNumber() in AssertJ added
* Allow description before inPath() in AssertJ

## 2.0.0.RC2
* Fixed JsonPath bug #132
* Fixed AssertJ number comparison with Jackson 2 #130
* Fixed AssertJ asString() #131

## 2.0.0.RC1
* Depends on Java 8
* Some deprecated APis removed
* Introduces AssertJ module
* Introduces JsonPath module

Please do not hesitate to report issues.

## 1.31.0
* Introduced DifferenceContext into DifferenceListener

## 1.30.0
* Introduced DifferenceListener
* Array comparison reports extra/missing elements when comparing with array order preserved.

## 1.29.1
* Fixed error in JsonFluentAssert.ofLength error message
* Fixed matcher handling when comparing arrays #111

## 1.29.0
* [*] placeholder works even when ignoring array order

## 1.28.2
* Fixing matcher pattern

## 1.28.1
* Fixing NPE when accessing element of nonexistent array

## 1.28.0
* Support for [*] placeholder in ignored path

## 1.27.0
* Better array comparison and error messages

## 1.26.0
* IDE friendly error messages
* isStringEqualTo is chainable (thanks to @gsson)
* Dropped support of Java 5
* Automatic module names added

## 1.25.1
* Support for Jackson BinaryNode

## 1.25.0
* Support for ignoring paths whenIgnoringPaths()

## 1.24.0
* Support for parametres in custom matchers ${json-unit.matches:matcherName}param

## 1.23.0
* Support for custom matchers ${json-unit.matches:matcherName}

## 1.22.0
* Support for Moshi

## 1.21.0
* Better diff reporting for unordered arrays with single difference

## 1.20.0
* Negative array indexes added (thanks [roxspring](https://github.com/roxspring))

## 1.19.0
* isArray().thatContains(...) fluent assert added

## 1.18.0
* Resource reading helper added

## 1.17.0
* System property to specify JSON libraries to be used

## 1.16.1
* Array pattern accepts non-word characters

## 1.16.0
* isAbsent and isPresent checks take TREAT_NULL_AS_ABSENT into account

## 1.15.0
* Dependency on slf4j made optional

## 1.14.1
* Preferring org.json library to process JSONArray

## 1.14.0
* Support for org.json library
* Fix: Element out of array bounds is treated as missing

## 1.13.0
* Support for any-* placeholders

## 1.12.1
* Single quote values in expected String allowed

## 1.12.0
* Lenient parsing of expected values

## 1.11.0
* Option setting methods made deprecated if called after assertion in JsonFluentAssert
* JsonFluentAssert constructors made private. Please file an issue if you need them.

## 1.10.0
* Added support for IGNORING_EXTRA_ARRAY_ITEMS

## 1.9.0
* Made compatible with Jackson 1.4

## 1.8.0
* OSGi support thanks to @amergey

## 1.7.0
* Support for Spring MVC tests assertions

## 1.6.1
* Gson nodes are not reconverted

## 1.6.0
* Added support for Hamcrest matchers

## 1.5.6
* Fixed handling of empty value in the expected parameter

## 1.5.5
* Support for dot in node name

## 1.5.4
* Added isObject method to fluent assertions

## 1.5.3
* Jackson 1 is preferred if the serialized class contains Jackson1 annotation

## 1.5.2
*  Added support for regular expressions

## 1.5.1
* isStringEqualTo() added to fluent assertions
* isArray  added to fluent assertions

## 1.5.0
* One runtime now supports Jackson 1.x, Jackson 2.x and Gson
* Internal JsonUnit class changed in backwards incompatible way

## 1.3.0 + 0.3.0
* Options renamed
* assertJsonNot* asserts added
* Support for online configuration in Hamcrest and standard asserts added

## 1.2.0 + 0.2.0
* Error messages changed a bit when comparing structures
* Refactoring of internal classes
* Support for ignoring array order
* Support for ignoring values
* Support for ignoring extra fields

## 1.1.6 + 0.1.6
* Treat null as absent added

## 1.1.5 + 0.1.5
* Absence/presence tests added

## 1.1.4 + 0.1.4
* Path to array in root fixed

## 1.1.3 + 0.1.3
* Numeric comparison tolerance added

## 1.1.2 + 0.1.2
* jsonStringEquals and jsonStringPartEquals added

## 1.1.1 + 0.1.1
* Generics in JsonMatchers fixed

## 1.1.0 + 0.1.0
* Simplified API
* Invalid JSONs in String comparison quoted
* Runtime incompatible (compile-time compatible) changes

## 1.0.0
* Switched to Jackson 2.x
* Fluent JsonAssert renamed to JsonFluentAssert

## 0.0.16
* Fluent assertions made framework independent.

## 0.0.15
* Switched from FEST to AssertJ

## 0.0.14
* Modules refactored
* Added support for FEST assert

## 0.0.13
* Logging categories changed

## 0.0.12
* Added logging

## 0.0.11
* Ignore placeholder "${json-unit.ignore}" added

## 0.0.10
* Text differences are closed in quotes

## 0.0.9
* Matchers added

## 0.0.7
* Made Java 5 compatible

## 0.0.6
* assertJsonPartStructureEquals added

## 0.0.5
* assertJsonPartEquals added

## 0.0.4
* Better error messages in case of different types

## 0.0.3
* Support for array types and other oddities in root

## 0.0.2
* Support for nulls

repository: lukas-krecan/JsonUnit

gha_language: Java

repo_name: lukas-krecan/JsonUnit


text:
# python-symbiflow-v2x

[![Documentation Status](https://readthedocs.org/projects/python-symbiflow-v2x/badge/?version=latest)](https://python-symbiflow-v2x.readthedocs.io/en/latest/?badge=latest) [![Build Status](https://travis-ci.com/SymbiFlow/python-symbiflow-v2x.svg?branch=master)](https://travis-ci.com/SymbiFlow/python-symbiflow-v2x)

Tool for converting specialized annotated Verilog models into XML needed for
[Verilog to Routing flow](https://docs.verilogtorouting.org/en/latest/arch/reference/).

Documentation can be found at https://python-symbiflow-v2x.readthedocs.io/en/latest/

license: ISC

branch_name: refs/heads/master

extension: md

gha_license_id: ISC

license_type: permissive


text:
### Usage
---
#### CMakeLists.txt
To compile an EOSIO smart contract with CMake you'll need a CMake file. The template `CMakeLists.txt` in the examples folder is a good boilerplate.

For example:

In `CMakeLists.txt`:
```
cmake_minimum_required(VERSION 3.5)
project(test_example VERSION 1.0.0)

find_package(vex.cdt)

add_contract( test test test.cpp )
```

In `test.cpp`:

```
#include <eosiolib/eosio.hpp>
using namespace eosio;

CONTRACT test : public eosio::contract {
public:
   using contract::contract;

   ACTION testact( name test ) {
   }
};

EOSIO_DISPATCH( test, (testact) )
```

To manually compile the source code, use [`eosio-cpp/eosio-cc`](/tools/eosio-cpp.html) and [`eosio-ld`](/tools/eosio-ld.html) as if it were __clang__ and __lld__. All the includes and options specific to EOSIO and CDT are baked in.

license: MIT


text:
# Highway Path Planning

![Highway_Path_Planning_10X_gif](results/Highway_Path_Planning_10X.gif)

## Overview
In this project I will `Design a path planner that is able to create smooth, safe paths for the car to follow along a 3 lane highway with traffic by using localization, sensor fusion, and map data`. The main codes are in the "src/" directory.

## Project Introduction
### Goals
In this project my goal is to safely navigate around a virtual highway with other traffic that is driving +-10 MPH of the 50 MPH speed limit. The car's localization and sensor fusion data has been provided. There is also a sparse map list of waypoints around the highway. The car should try to go as close as possible to the 50 MPH speed limit, which means passing slower traffic when possible, note that other cars will try to change lanes too. The car should avoid hitting other cars at all cost as well as driving inside of the marked road lanes at all times, unless going from one lane to another. The car should be able to make one complete loop around the 6946m highway. Since the car is trying to go 50 MPH, it should take a little over 5 minutes to complete 1 loop. Also the car should not experience total acceleration over 10 m/s^2 and jerk that is greater than 10 m/s^3.

#### The map of the highway is in data/highway_map.txt
Each waypoint in the list contains  [x,y,s,dx,dy] values. x and y are the waypoint's map coordinate position, the s value is the distance along the road to get to that waypoint in meters, the dx and dy values define the unit normal vector pointing outward of the highway loop.

The highway's waypoints loop around so the frenet s value, distance along the road, goes from 0 to 6945.554.

### Simulator.
You can download the Udacity Term3 Simulator for this project from the [releases tab (https://github.com/udacity/self-driving-car-sim/releases/tag/T3_v1.2).

To run the simulator on Mac/Linux, first make the binary file executable with the following command:
```shell
sudo chmod u+x {simulator_file_name}
```

## How to Build and Run this project

1. Clone this repo.
2. Install uWebSockets: `install-ubuntu.sh` for case of ubuntu
3. Run the simulator: `./term3_sim.x86_64`
4. Compile and Run the path planning: `./run`

Here is the data provided from the Simulator to the C++ Program

#### Main car's localization Data (No Noise)

["x"] The car's x position in map coordinates

["y"] The car's y position in map coordinates

["s"] The car's s position in frenet coordinates

["d"] The car's d position in frenet coordinates

["yaw"] The car's yaw angle in the map

["speed"] The car's speed in MPH

#### Previous path data given to the Planner

//Note: Return the previous list but with processed points removed, can be a nice tool to show how far along
the path has processed since last time.

["previous_path_x"] The previous list of x points previously given to the simulator

["previous_path_y"] The previous list of y points previously given to the simulator

#### Previous path's end s and d values

["end_path_s"] The previous list's last point's frenet s value

["end_path_d"] The previous list's last point's frenet d value

#### Sensor Fusion Data, a list of all other car's attributes on the same side of the road. (No Noise)

["sensor_fusion"] A 2d vector of cars and then that car's [car's unique ID, car's x position in map coordinates, car's y position in map coordinates, car's x velocity in m/s, car's y velocity in m/s, car's s position in frenet coordinates, car's d position in frenet coordinates.

## Details

1. The car uses a perfect controller and will visit every (x,y) point it recieves in the list every .02 seconds. The units for the (x,y) points are in meters and the spacing of the points determines the speed of the car. The vector going from a point to the next point in the list dictates the angle of the car. Acceleration both in the tangential and normal directions is measured along with the jerk, the rate of change of total Acceleration. The (x,y) point paths that the planner recieves should not have a total acceleration that goes over 10 m/s^2, also the jerk should not go over 50 m/s^3. (NOTE: As this is BETA, these requirements might change.

2. There will be some latency between the simulator running and the path planner returning a path, with optimized code usually its not very long maybe just 1-3 time steps. During this delay the simulator will continue using points that it was last given, because of this its a good idea to store the last points you have used so you can have a smooth transition. previous_path_x, and previous_path_y can be helpful for this transition since they show the last points given to the simulator controller with the processed points already removed. You would either return a path that extends this previous path or make sure to create a new path that has a smooth transition with this last path.

## Tips

A really helpful resource for doing this project and creating smooth trajectories was using http://kluge.in-chemnitz.de/opensource/spline/, the spline function is in a single hearder file is really easy to use.

---

## Dependencies

* cmake >= 3.5
  * All OSes: [click here for installation instructions](https://cmake.org/install/)
* make >= 4.1
  * Linux: make is installed by default on most Linux distros
  * Mac: [install Xcode command line tools to get make](https://developer.apple.com/xcode/features/)
  * Windows: [Click here for installation instructions](http://gnuwin32.sourceforge.net/packages/make.htm)
* gcc/g++ >= 5.4
  * Linux: gcc / g++ is installed by default on most Linux distros
  * Mac: same deal as make - [install Xcode command line tools]((https://developer.apple.com/xcode/features/)
  * Windows: recommend using [MinGW](http://www.mingw.org/)
* [uWebSockets](https://github.com/uWebSockets/uWebSockets)
  * Run either `install-mac.sh` or `install-ubuntu.sh`.
  * If you install from source, checkout to commit `e94b6e1`, i.e.
    ```
    git clone https://github.com/uWebSockets/uWebSockets
    cd uWebSockets
    git checkout e94b6e1
    ```

## Model Explantion For Generating Paths

### Prediction
The prediction module uses a map and data from sensor fusion to generate predictions for what all other dynamic objects in view are likely to do.
For example, if the front/back car is changing lane or braking.

### Behavior Planning
In this part, we decide what is best to do. It means both safety and efficiency. On the safty side, the car should be keep a distance from other cars, no matter it's keeping lane or changing lane. For efficiency, the car should stay in a lane where the traffic flows fast enough.
The car behave has five states:
1.staying in the left lane
2.the middle lane,
3.the right lane,
4.left lane change,
5.right lane change.

Not all states can transition to all other states directly. Apparently, there's no way to make a left lane change if it's aleady in the left most lane; otherwise, it will have to cross the double yellow line and that's very dangerous. Also, if it's in the left most lane, it's not possible to be in the right most lane in the next time step.
In my implementation, the car constantly check the (potential) time to catch up with the cars in front for all the lanes. If a left lane change or right lane change can potentially increase the time, and it's safe to do so, then it will make a lane change. The creteria for safety is defined as "no car in parallel positions".

### Path Generation
This part deals with the trajectory calculation based on the speed and lane output from the behavior, car coordinates and past path points. The trajectories generated should be smooth enough, otherwise the jerk will exceed the maximum allowed value. I used the points left in the last time step and a couple of new points obtained from behavior planning as pivots. These pivots are input into the "spline" lib to generate a smooth trajectory. Also, I used coordinates transformation to make the work easier. The transformation was applied both between car fixed coordinate system and world coordinate system, and between world coordinate system and Frenet coordinate system (Please see the top video).

## Code Style

[Google's C++ style guide](https://google.github.io/styleguide/cppguide.html).

References:
---
https://classroom.udacity.com/nanodegrees

http://kluge.in-chemnitz.de/opensource/spline/

https://github.com/nlohmann/json

https://github.com/udacity/CarND-Path-Planning-Project

https://markbroerkens.github.io/CarND-Path-Planning-Project/

https://github.com/udacity/self-driving-car-sim/releases/tag/T3_v1.2

How Referencing This Project
---
If you like my code and you want to use it in your project, please refer it like this:

`Amani, Sajjad. "Practical highway path planning of a vehicle in Traffic using localization, sensor fusion, and map data." GitHub, 8 December 2019, https://github.com/Sj-Amani/Highway-Path-Planning`

repository: Sj-Amani/Highway-Path-Planning

repo_name: Sj-Amani/Highway-Path-Planning


text:
# What is this project?

This is a living project that tries to demonstrate the the principles of Clean Architure using Command-Query Responsibility Segregation, domain events, and in-process messaging.

At a high level, it's an Api written in Asp.Net Core that allows us to interact with playing cards.

![alt text](https://get.pxhere.com/photo/deck-bicycle-pattern-ace-card-brand-illustration-design-calligraphy-games-playing-card-magic-cards-1068201.jpg "Logo Title Text 1")

I try to structure the project such that it involves a commonly understood domain (everyone understands how to interact with a deck of cards), but also employs domain concepts that are less trivial than 'todo lists' and the typical Northwind relation database examples.

Currently, the project is being migrated from some old code, and is currently in transition with a different database backend, and moving to Azure Pipelines CI with Docker.

I maintain this as a living project, and it takes dependencies on top-notch libraries that I've been using in production software for years.

repository: Andrew-Brad/DeckOfCards

gha_language: C#

gha_license_id: MIT

repo_name: Andrew-Brad/DeckOfCards


text:
# Cicu

[![Build Status](https://travis-ci.org/groe/cicu.png?branch=master)](http://travis-ci.org/groe/cicu)

Custom ICU rulesets for collation in ruby - requires libicu

## Installation

Make sure libicu is installed:

    $ sudo apt-get install libicu-dev

Add this line to your application's Gemfile:

    gem 'cicu'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install cicu

## Usage

Create a ruleset

```ruby
ruleset = Cicu::Ruleset.new("[normalization on] & b < a < c")
```

Sort an array

```ruby
ary = %w( a b c ba bb bc )
sorted_ary = ruleset.sort_by { |el| ruleset.sort_key(el) }
# => "["b", "bb", "ba", "bc", "a", "c"]"
```

Get the sort key for a string

```ruby
ruleset.sort_key("abc")
# => "*\x04)*\x05\x01\a\x01\a"
```

You can store sort keys in a database column to use them in `ORDER BY` queries. Make sure to use a column type that supports binary strings (e.g. MySQLs [VARBINARY](http://dev.mysql.com/doc/refman/5.7/en/binary-varbinary.html)).

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

repository: groe/cicu

repo_name: groe/cicu


text:
# Model Predictive Contouring Control for Collision Avoidance in Unstructured Dynamic Environments

This repository contains the code for the paper:

**Model Predictive Contouring Control for Collision Avoidance in Unstructured Dynamic Environments**

Bruno Brito,
Boaz Floor,
Laura Ferranti,
Javier Alonso-Mora

Accepted in [RA-L + IROS 2019].

This paper proposed a local planning approach based on Model Predictive Contouring Control (MPCC) to safely navigate a mobile robot in dynamic, unstructured environments.
Our local MPCC relies on an upper bound of the Minkowski sum of a circle and an ellipse to safely avoid dynamic obstacles and a set of convex regions in free space to avoid static obstacles.
We compared our design with three baseline approaches (classical MPC, Dynamic Window, and CADRL). The experimental results demonstrate that our method outperforms the baselines in static and dynamic environments. Moreover, the light implementation of our design shows the scalability of our method up to six agents and allowed us to run all algorithms on-board. Finally, we showed the applicability of our design to more complex robots by testing the design in simulation using the model of an autonomous car.
As future work, we intend to expand our approach for crowded scenarios, by accounting for the interaction effects between the robot and the other agents.
Please click in the image to see our video.

If you find this code useful in your research then please cite:
```
@article{britolmpcc,
  title={Model Predictive Contouring Control for Collision Avoidance in Unstructured Dynamic Environments},
  author={Bruno Brito, Boaz Floor, Laura Ferranti and Javier Alonso-Mora},
  year={2019},
  publisher={RA-L - IEEE Robotics and Automation Society}
}
```

The authors would like to thank Wilko Schwarting for sharing its Matlab implementation of the MPCC controller as described in:
```
@article{schwarting2017parallel,
  title={Parallel autonomy in automated vehicles: Safe motion generation with minimal intervention},
  author={Schwarting, Wilko and Alonso-Mora, Javier and Paull, Liam and Karaman, Sertac and Rus, Daniela},
  year={2017},
  publisher={Institute of Electrical and Electronics Engineers (IEEE)}
}
```
## Software Requirements
* ROS installation
* Ubuntu
* Pedestrian Simulator: pedsim_ros: https://github.com/bbrito/pedsim_ros
    * Branch: four_persons

## Instalation instructions
This set of instructions were only tested for Ubuntu16 with ROS-Kinetic. Additionally, we assume that you already have a complete ROS installation.
* Please follow the following instructions:
```
sudo apt-get install ros-kinetic-jackal-control ros-kinetic-jackal-gazebo ros-kinetic-jackal-simulator ros-kinetic-jackal-description ros-kinetic-jackal-desktop ros-kinetic-jackal-navigation ros-kinetic-jackal-viz
sudo apt install ros-kinetic-people-msgs
cd [workspace]/src
git clone https://github.com/bbrito/pedsim_ros.git -b four_persons
git clone https://github.com/spencer-project/spencer_messages.git
git clone https://github.com/srl-freiburg/spencer_tracking_rviz_plugin.git
git clone https://github.com/tud-amr/amr-lmpcc.git
cc ../
rosdep install --from-paths src --ignore-src -r -y
catkin_make
source devel/setup.bash
```

## Solver code
Repository: https://github.com/bbrito/acado/blob/four_persons/examples/ocp/bioreactor.cpp

## Running LMPCC
* Simulation Environment

        1. Start Jackal Gazebo Simulation
            * roslaunch jackal_gazebo jackal_world.launch
        2. Start Pedestrian Simulator
            * roslaunch pedsim_simulator corridor.launch
* Start lmpcc_obstacle_feed

        1. roslaunch lmpcc_obstacle_feed lmpcc_obstacle_feed.launch

*Start lmpcc controller

        1. roslaunch lmpcc lmpcc.launch

* Start rqt_reconfigure

        1. rosrun rqt_reconfigure rqt_reconfigure
        2. Click on the lmpcc parameters to start the robot motion by press the enable_output button
        3. Click on the lmpcc parameters to start planning by pressing the plan button

## Troubleshooting
* If you get the following error:
```
lmpcc_controller.h:146:63: fatal error: static_collision_avoidance/collision_free_polygon.h: No such file or directory
```
Try to compile again using catkin_make several times. Sometimes catkin fails to compile the diferent packages in the right order.

repository: tud-amr/amr-lmpcc

gha_language: C

repo_name: tud-amr/amr-lmpcc


text:
fooddragon
==========

An app for ordering food online.

Used as a base project to teach a GA Web Development Immersive class.

```ruby
  rake secret
```

Create a file config/secrets.yml and put

```
development:
  secret_key_base: <RAKE_SECRET_SHA>
```

```ruby
  rake db:create
  rake db:migrate
```

repository: sherifready/fooddragon

repo_name: sherifready/fooddragon


text:
---
speaker: Tamas Darvas (University of Maryland)
title: "Existence of twisted Kahler-Einstein metrics in big classes"
date: 21 September, 2022
time: 6:30 pm
series: "Geometry & Topology Seminar"
venue: Microsoft Teams (online)
website: https://math.iisc.ac.in/~vvdatar/gt_2022_Aug.html
---

We prove existence of twisted Kähler-Einstein metrics in big cohomology classes, using a divisorial stability condition.
In particular, when -K_X is big, we obtain a uniform Yau-Tian-Donaldson existence theorem for Kähler-Einstein metrics.
To achieve this, we build up from scratch the theory of Fujita-Odaka type delta invariants in the transcendental big setting,
using pluripotential theory. This is joint work with Kewei Zhang.

repository: siddhartha-gadgil/DeptWeb

gha_language: HTML

repo_name: siddhartha-gadgil/DeptWeb


text:
I haven't opened a robotics textbook, let alone a textbook, in years, that's why this page is bare.
Professor Peter Corke compiled a list of [his favorite robotics books](https://petercorke.com/resources/interesting-books/), you might want to check that out.

# Electronics
- Practical Electronics for Inventors, Paul Scherz
- The Art of Electronics, Paul Horowitz

# Algorithms
- The Algorithm Design Manual, Steven Skien
- Algorithms, Robert Sedgewick and Kevin Wayne
- Grokking Algorithms, Aditya Bhargava

# Artifical Intelligence
-  Artificial Intelligence: A Modern Approach, Stuart Russell and Peter Norvig

# Engineering
- Mechanisms and Dynamics of Machinery, Hamilton Horth Mabie
- Vector Mechanics for Engineers: Statics and Dynamics, Ferdinand P. Beer et al

# Misc
- The Unofficial LEGO Technic Builder's Guide, 2nd Edition, Pawel Sariel Kmiec
- Any book by Yoshihito Isogawa

license: Unlicense


text:
---
layout:     post
title:      英语介词
subtitle:   英语
date:       2018-03-02 12:00:00
author:     StarKing
header-img: img/post-hd-l-1.jpg
tags:
    - English
    - 语言
---

# on 的表意:在...上(有接触的)

| 表示位置 | On the table/ on top of the cupboard |
| --- | --- |
| 表示在...表面上 | On the ceiling/ on the wall |
| 表示支撑 |  Lie on his back/raise himself on his elbows
| 表示随身 | Carry money on me |
| 表示广播 | On the radio/ on the television |
| 表示事件 |  On the topic/on the event

# In 的表意:在...中/里面

| 表示位置 | in his car/in a hotel |
| --- | --- |
| 表示作品中 | in the book/play |
| 表示时间 |  in the evening/the last month
| 表示状态 | in trouble/anger |
| 表示方式 | in English |
| 表示穿着 |  In a suit and tie

# At 的表意:在(一个点)

| 表示地点/场所 | at a restaurant/ home/ school/ college |
| --- | --- |
| 表示在旁边 | at the door/the table |
| 表示距离，角度 |  at certain distance/at an angle
| 表示时间 | at 3 pm |
| 表示年龄 | at the age of seventeen |
| 表示数字 |  at a speed/ level/ frequency/ price
| 表示动作对象 |  look at/ smile at/gesture at/ work at

# Of 的表意:的

| 表示特征 | the age of the women/ the aim of the course |
| --- | --- |
| 表示从属地点 | Bank of China the Prince of Wales |
| 表示数量 |  a piece of paper billions of dollars
| 表示动作 | building of flats /reduction of supply |

# for 的表意:为了...

| 表示利益 |enough for you/ easy for him/ a table for two |
| --- | --- |
| 表示工作 | work for a company/ write for a film |
| 表示代替 | book a ticket for you
| 表示情感 |  I am happy/ sorry for you. |
| 表示目的 | for sale/rent/use |
| 表示原因 |  for the reason/ for doing this
| 表示时间 |  for a few minutes/ for a month
| 表示距离 |  or a few miles/for several feet

# by 的表意:依靠

| 人 | He was brought up by his grandparents. |
| --- | --- |
| 手段 |We travel by car./ He did it by doing so. |
| 巧合 | I met him by chance./I opened the letter by mistake.
| 表示时间 | By the end of the week |

# with 的表意:伴随

| 人 | Stay with his father |
| --- | --- |
| 表示手段 | Write with a pen/treat him with the drug |
| 携带 |   Go home with money.
| 表示特征 | Someone with blue eyes|
| 生病 | In bed with flu |
| 表示情绪 |   Angry with him/happy with the decision

# from 的表意:从

| 表示来源 | A gift from his wife/from Beijing|
| --- | --- |
| 数字减少| Three from six leaves three |
| 表示远离 |  Away from home/absent from the house
| 表示距离 | How far is it from here? / 4 miles from the station|
| 表示事件 | From 9 am/ from 1922 |
| 表示材质 |   The bread is made from white flour.

# to 的表意:去/到

| 地点 | drive to Florida/my journey to Beijing|
| --- | --- |
| 时间| go to a party/ come to dinner |
| 方向 |  go to the right/ fly to the north
| 对象 | give it to me/offer jobs to the unemployed|
| 表示观点 | it was clear to me/it is impossible to do |

# as 的表意:作为

| 表示身份 | As a football player|
| --- | --- |
| 表示手段| She sings as a bird.|


text:
# OpenSCAD extrude a DXF file made with Inkscape HOWTO

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/DXF_Extrusion
http://repraprip.blogspot.fr/2011/05/inkscape-to-openscad-dxf-tutorial.html

1. in a new Inkscape document, create a "star" shape
2. select the "star" object an convert it to a path (Maj + Ctrl + C)
3. rename the layer to "root" (Layer -> Rename layer...)
4. resize the document (Maj + Ctrl + D)
5. save as as dxf file (choose the "Desktop Cutting Plotter (*.dxf)" file format)

repository: jeremiedecock/snippets

gha_language: Python

repo_name: jeremiedecock/snippets


text:
# phaser-webpack-babel-eslint-setup

## **General Notes**
The purpose of this repo is to provide a checklist of steps for a basic setup for a project with phaser, eslint, webpack, and babel. The end product of this is a phaser 'game' with a title screen that contains a button that starts the main game scene.

This project was influenced by a couple of tutorials:
- [A Modern Web Development Setup For Phaser 3](https://snowbillr.github.io/blog//2018-04-09-a-modern-web-development-setup-for-phaser-3/)
- [Getting Started in Phaser 3 (ES6) – Create a Boomdots game](http://codetuto.com/2018/02/getting-started-phaser-3-es6-create-boomdots-game//)

Unfortunately, even though these tutorials are fairly recent, there are are some things in both that have been deprecated in relation to webpack and babel. Also, I wanted a reference that covered the 'what' more than the 'why'. If you want to understand why things are done the way they are, I encourage you to go through both tutorials as well as reading the 'getting started' portions of the following documentation.

- [eslint](https://eslint.org/)
- [webpack](https://webpack.js.org/)
- [babel](https://babeljs.io/)
- [phaser](https://phaser.io/)

At the time of writing, the versions of the project dependencies are what is listed in the package.json file.

You can either fork this repo and modify it to suit your needs or follow the steps below.

___
## **Steps**

**Initialize npm**

- `npm init -y`

**Install Dependencies**

- `npm i phaser @babel/polyfill`

**Install Dev Dependencies**

- `npm i -D eslint webpack webpack-cli webpack-dev-server style-loader css-loader file-loader @babel/core @babel/cli @babel/preset-env babel-loader`

**Eslint Setup**

- `eslint --init`
- I choose to use a popular style guide (airbnb) and say yes when it asks if I want to install dependencies now. It will install eslint-config-airbnb-base and eslint-plugin-import.
- Update .eslintrc.json with "env" and "globals" fields.

**Webpack Setup**

- remove "main" field from package.json
- add "private" field to package.json => `"private": true,`
- `mkdir src dist`
- `touch src/index.js`
- `touch dist/index.html`
- `touch webpack.config.js`
- paste code from this repo into dist/index.html
- paste code from this repo into src/index.js
- paste code from this repo into webpack.config.js
- add scripts to package.json
  ```
  "build": "webpack",
  "dev": "webpack-dev-server"
  ```

**Babel Setup**

- `touch babel.config.js`
- paste code into babel.config.js
- This project uses babel-loader which allows some of the presets to be set right in the webpack.config.js. I'm not sure if it makes the babel.config.js unnecessary.

**Phaser Setup**

- `mkdir scenes`
- `touch scenes/TitleScene.js`
- `touch scenes/GameScene.js`
- paste code from this repo into TitleScene.js
- paste code from this repo into GameScene.js

**Build and Serve**

- `npm run dev`
- navigate to localhost:8080 in your browser to see the game


text:
# XBB (xPack Build Box)

The xPack Build Box is an elaborated build environment focused on
obtaining repeatable and consistent results while building applications
on GNU/Linux and macOS.

It does so by compiling all tools
required for the package builds, from sources, in a separate folder.

By strictly controlling the versions of the compiled sources, it is
possible to create build environments that use about the same tools
on both GNU/Linux (Intel and Arm) and macOS, helping to obtain
consistent results.

## Overview

There are two types of builds:

- local/native builds, intended for development and running on the local
  machine (see the `ubuntu` folder)
- distribution builds, intended for xPack binary distributions and running
  on most modern machines

The main use cases of XBBs are distribution builds, but they can be used
for native builds as well.

Generally, xPack binaries are available for the following platforms:

- Windows 32-bit
- Windows 64-bit
- GNU/Linux Intel 32-bit (ldd >= 2.15)
- GNU/Linux Intel 64-bit (ldd >= 2.15)
- GNU/Linux Arm 32-bit (ldd >= 2.23)
- GNU/Linux Arm 64-bit (ldd >= 2.23)
- macOS (Intel, 64-bit, >= 10.10)

For a repetitive and controllable build process, the Windows and GNU/Linux
binaries are built using several Docker images (Intel/Arm, 32/64-bit).

The current version 3.2; older images are deprecated and should not be used
for newer projcts.

- `ilegeul/ubuntu:amd64-12.04-xbb-v3.2`
- `ilegeul/ubuntu:i386-12.04-xbb-v3.2`
- `ilegeul/ubuntu:arm64v8-16.04-xbb-v3.2`
- `ilegeul/ubuntu:arm32v7-16.04-xbb-v3.2`

The Intel images are based on Ubuntu 12.04 (ldd 2.15), and the Arm images are
based on Ubuntu 16.04 (ldd 2.23); the resulting GNU/Linux binaries
should run on most modern distributions.

The Windows executables are created with **mingw-w64 v7.0.0** and
**mingw-w64 GCC 9.3**, available from the same Docker images; and should
run on Windows 10 and most modern Windows versions.

The macOS binaries are generated on a macOS 10.10.5, plus a set of new
GNU tools, installed in a separate folder.

### TeX

All images include the TeX tools (from 2018); on GNU/Linux, they are
installed in the system folders; on macOS, similarly to
XBB, they are installed in a custom folder (`${HOME}/opt/texlive`).

## Docker specifics

As with any Docker builds, the XBB builds run completely inside Docker
containers, which start afresh each time they are instantiated.

To pass the folder with the build scripts in and the results out,
it is usual to use a `Work` folder, for example:

```console
$ docker run -it --volume "${HOME}/Work:/Host/Work" ilegeul/ubuntu:amd64-12.04-xbb-v3.2
root@831bc35faf9f:/# ls -l /Host/Work
total 175320
drwxr-xr-x  14 root root       448 Mar  7 19:47 arm-none-eabi-gcc-9.2.1-1.2
drwxr-xr-x 144 root root      4608 Mar  9 13:15 cache
drwxr-xr-x  34 root root      1088 Mar 26 11:22 openocd-0.10.0-14
drwxr-xr-x  12 root root       384 Oct 30 19:00 riscv-none-embed-gcc-8.3.0-1.1
```

In this simple configuration, the builds run with root permissions; with
more elaborate configurations it is possible to start the Docker images
with user rights, but they are beyound the scope of this document.

## How to use the XBB tools

Both on GNU/Linux and macOS, the XBB tools are installed in separate
folders, and are fully distinct from the system tools.

To access them, the application should update the `PATH` to prefer
the newer XBB tools.

Scripts defining some helper functions are available.

### GNU/Linux

The `xbb_activate` function can be called either for the entire lifespan
of the script, or, for a better isolation, in inner shells when the new
tools are really needed.

```bash
source "/opt/xbb/xbb-source.sh"
...
(
  xbb_activate

  ...
  ./configure
  make
)
```

### macOS

For macOS the recommended use case is similar, except the XBB tools
are installed in the user HOME folder:

```bash
source "${HOME}/opt/xbb/xbb-source.sh"
...
(
  xbb_activate

  ...
)
```

## The `xbb-source.sh` script

The build environment includes a helper script, `xbb-source.sh`,
which should be included
with `source` by the build scripts, to define more bash functions to
the shell.

These functions are used to extend the environment with resources available
in the XBB folders.

The `xbb_activate` function is used to extend the `PATH` with folders
in the XBB folders, in front of existing
folders, so that **the XBB executables are preferred over the system ones**.

## The `pkg-config-verbose` script

While running the configuration step, it is sometimes useful to trace
how `pkg-config` identifies resources to be used during the build.

The standard `pkg-config` does not have an option to increase verbosity.

The workaround is to use a separate script that displays the received command
and the response on the stderr stream.

This script is not specific to XBB, and can be used with any build.

For this, copy the file into `.../xbb/bin` or any other folder present
in the PATH and pass the script name via the environment.

```console
$ chmod +x /opt/xbb/bin/pkg-config-verbose
$ export PKG_CONFIG=pkg-config-verbose
```

## C++ Standards Support in GCC

https://gcc.gnu.org/projects/cxx-status.html

## End-of-support schedule

According to the
[CentOS schedule](https://en.wikipedia.org/wiki/CentOS#End-of-support_schedule),
version 6 will be supported up to Nov. 2020.

However, RHEL releases have a longer
[life cycle](https://access.redhat.com/support/policy/updates/errata/#Life_Cycle_Dates)
and RHEL6 end of extended life-cycle support is 2024.

Due to maintenance issues, starting with XBB v3.1, support for CentOS/RHEL 6
is discontinued.

However support for RHEL 7 is very important, and will be preserved for
as long as possible. In practical terms, the ldd version must be
2.17 or lower.

## 32-bit support

Existing support for 32-bit builds will be preserved for the moment,
but might be dropped in one of the future version; for consistency
reasons, it is expected to continue to generate 32-bit binares
as long as Node.js still supports them via the
[unofficial builds](https://unofficial-builds.nodejs.org/download/).

## Arm binaries

Support for Arm binaries was added in v3.1, in early 2020.

The supported architectures are:

- `arm64v8` - the ARMv8 64-bit architecture Aarch64
- `arm32v7` - the ARMv7 32-bit architecture with hardware float (armhf)

## Distro versions

To better decide whch versions to support, below is a list of existing versions.

The names are in fact docker image names, and can be used directly to query
the `ldd --version`:

```console
$ docker run -it <image> ldd --version
```

### [Debian](https://en.wikipedia.org/wiki/Debian_version_history)

- `debian:6` - squeeze - 2011-2016, 2.11.3, kernel 2.6.32
- `debian:7` - wheezy - 2013-2016, 2.13, kernel 3.2
- `debian:8` - jessie - 2015-2018, 2.19, kernel 3.16
- `debian:9` - stretch - 2017-2020, 2.24, kernel 4.9.0-6 (first with arm64)
- `debian:10` - buster - 2019-2022, 2.28, kernel 4.19.0-6

### [Ubuntu](https://en.wikipedia.org/wiki/Ubuntu_version_history)

- `ubuntu:10.04` - lucy - 2010-2015, 2.11.1
- `ubuntu:12.04` - precise - 2012-2019, 2.15, kernel **3.2** <--- Intel Linux choice
- `ubuntu:14.04` - trusty - 2014-2022, 2.19, kernel 3.16
- `ubuntu:16.04` - xenial - 2016-2024, 2.23, kernel 4.4 <--- Arm Linux choice
- `ubuntu:18.04` - bionic - 2018-2028, 2.27, kernel 4.15
- `ubuntu:20.04` - focal - 2020-2-30, 2.31, kernel 5.4

### [RHEL](https://access.redhat.com/support/policy/updates/errata/#Life_Cycle_Dates)

- `registry.access.redhat.com/rhel6` - 2.12 <--- no longer supported
- `registry.access.redhat.com/rhel7` - 2.17, kernel 3.10 <--- supported

### [CentOS](https://en.wikipedia.org/wiki/CentOS)

- `centos:6` - 2011-2020, 2.12 <--- no longer supported
- `centos:7` - 2014-2024, 2.17, kernel 3.10 <--- must be supported
- `centos:8` - 2019-2029, 2.28, kernel 4.18

### [Fedora](https://en.wikipedia.org/wiki/Fedora_version_history)

- `fedora:20` - 2013-12, 2.18, kernel 3.11 <-- Intel
- `fedora:21` - 2014-12, 2.20, kernel 3.17
- `fedora:22` - 2015-05, 2.21, kernel 4.0
- `fedora:23` - 2015-11, 2.22, kernel 4.2
- `fedora:24` - 2016-06, 2.23, kernel 4.5 <-- Arm
- `fedora:25` - 2016-11, 2.24, kernel 4.8
- `fedora:26` - 2017-07,
- `fedora:27` - 2017-11, 2.26, kernel 4.13
- `fedora:28` - 2018-05,
- `fedora:29` - 2018-10, 2.28, kernel 4.18
- `fedora:30` - 2019-05,
- `fedora:31` - 2019-10, 2.30, kernel 5.3
- `fedora:32` - 2020-04, 2.20, kernel 5.6

## Credits

The xPack Build Box is inspired by the
[Holy Build Box](https://github.com/phusion/holy-build-box)

## Maintainer info

A shortcut to clone the repo is:

```console
$ curl -L --fail https://raw.githubusercontent.com/xpack/xpack-build-box/master/git-clone.sh | bash -
```

which is the equivalent of:

```console
$ rm -rf ~/Downloads/xpack-build-box.git
$ git clone --recurse-submodules https://github.com/xpack/xpack-build-box.git \
  ~/Downloads/xpack-build-box.git
```

If you missed the submodules:

```console
$ git submodule update --init
```

## TODO

Things to be considered for future versions:

- use automake 1.16.2
- add gdb (for macOS)
- add doxygen
- cleanup `man` folder
- investigate why isl_test_cpp fails
- gnutls requires several other libs
- gnutls certificates folder

- build nodejs

Fixed

- -D_FILE_OFFSET_BITS=64 for 32-bit machine
- libtool to use xbb gcc, not bootstrap
- rename gcc-xbb, gcc-xbs
- link gcc, cc, g++, c++
- add objc, objc++, fortran support to gcc
- build Python 3 in bootstrap
- guille (1 test disabled)
- autogen (1 test disabled)
- add bash

## Conclusions

For Intel Linux, to preserve support for older distributions,
the **Ubuntu 12 (precise)** (2.15) distribution was selected;
the resulting binaries should also run on RHEL 7 or newer;
support for RHEL 6 was discontinued.

For Arm binaries, the base distribution is **Ubuntu 16.04 LTS (xenial)**,
(2.23); the resulting binaries should run on all Raspberry Pi class
machines, or larger.

repository: Mi-AIoT/xpack-build-box

repo_name: Mi-AIoT/xpack-build-box


text:
---
layout: post
title: actionlist
subtitle: Sets welcome module settings
categories: warnings
tags: [warnings]
---

`Syntax: shisa welcomeset`

## Subcommands:

**bot** Special welcome for bots

**embed** Set various embed options

**goodbye** Manage goodbye messages

**greeting** Manage welcome messages

**whisper** Sets whether or not a DM is sent to the new user

```
Type shisa help <command> for more info on a command. You can also type shisa help <category> for more info on a category.
```

branch_name: refs/heads/main


text:
# PostCSS Text Decoration Shorthand [][PostCSS]

[<img alt="npm version"<EMAIL_ADDRESS>height="20">][npm-url] [][css-url] [][cli-url] [][discord]

[PostCSS Text Decoration Shorthand] lets you use `text-decoration` as a shorthand following the [Text Decoration Specification].

```pcss
.example {
	text-decoration: wavy underline purple 25%;
}

/* becomes */

.example {
	text-decoration: underline;
	text-decoration: underline wavy purple;
	text-decoration-thickness: calc(0.01em * 25);
	text-decoration: wavy underline purple 25%;
}
```

## Usage

Add [PostCSS Text Decoration Shorthand] to your project:

```bash
npm install postcss @csstools/postcss-text-decoration-shorthand --save-dev
```

Use it as a [PostCSS] plugin:

```js
const postcss = require('postcss');
const postcssTextDecorationShorthand = require('@csstools/postcss-text-decoration-shorthand');

postcss([
	postcssTextDecorationShorthand(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
```

[PostCSS Text Decoration Shorthand] runs in all Node environments, with special
instructions for:

- [Node](INSTALL.md#node)
- [PostCSS CLI](INSTALL.md#postcss-cli)
- [PostCSS Load Config](INSTALL.md#postcss-load-config)
- [Webpack](INSTALL.md#webpack)
- [Next.js](INSTALL.md#nextjs)
- [Gulp](INSTALL.md#gulp)
- [Grunt](INSTALL.md#grunt)

## Options

### preserve

The `preserve` option determines whether the original notation
is preserved. By default, it is preserved.

```js
postcssTextDecorationShorthand({ preserve: false })
```

```pcss
.example {
	text-decoration: wavy underline purple 25%;
}

/* becomes */

.example {
	text-decoration: underline;
	text-decoration: underline wavy purple;
	text-decoration-thickness: calc(0.01em * 25);
}
```

[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
[css-url]: https://cssdb.org/#text-decoration-shorthand
[discord]: https://discord.gg/bUadyRwkJS
[npm-url]: https://www.npmjs.com/package/@csstools/postcss-text-decoration-shorthand

[PostCSS]: https://github.com/postcss/postcss
[PostCSS Text Decoration Shorthand]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-text-decoration-shorthand
[Text Decoration Specification]: https://drafts.csswg.org/css-text-decor-4/#text-decoration-property

repository: csstools/postcss-plugins

gha_language: CSS

repo_name: csstools/postcss-plugins


text:
# Liquid.Entities

### Liquid.Entities.Entity

```csharp
[System.Serializable]
public struct Entity : IEquatable<Entity> {
    public static readonly Entity Null = default;

    public readonly int index;

    public readonly int version;
}
```

### Entity.Identifier

```csharp
public ulong Identifier { get; }
```

Returns a unique 64 bit identifier which combines the version and index for the entity.

---

### Liquid.Entities.World

```csharp
public partial class World : MonoBehaviour {
    public const int EntityMax = 8192;

    public const int ComponentMax = EntityMask.Length; // 128
}
```

### World.Update

```csharp
public void Update();
```

The default MonoBehaviour update loop for a World. You can define an Update() function in a world MonoBehaviour to override this function.

### World.OnDestroy

```csharp
public void OnDestroy();
```

The default MonoBehaviour OnDestroy function for a World. This will call `DestroySystems()` which will call `Unload(world)` for each system. You can define `OnDestroy()` in a world to override this function.

### World.InstantiateEntity

```csharp
public void InstantiateEntity();
```

Create a new entity in the world with a new GameObject and an Active component.

```csharp
public void InstantiateEntity(GameObject prefab);
```

Creates a new GameObject entity from a prefab. All components from the prefab will be packed in the entity returned, and can be unpacked like any other component.

> Note: This function uses reflection to call the correct generic `Pack` function for each component, use the generic version of this function to avoid reflection.

### World.InstantiateInactiveEntity

```csharp
public Entity InstantiateInactiveEntity();
```

Creates a new inactive entity in the world and instantiates a new GameObject for the entity. The entity will need to have active set before it can be used by systems. Useful to create entities without initializing them.

> Note: Inactive entities still exist in the world and can have components added to them.

### World.MakeEntity

```csharp
public Entity MakeEntity();
```

Creates a new entity in the world with an Active component.

### World.MakeInactiveEntity

```csharp
public Entity MakeInactiveEntity();
```

Creates a new inactive entity in the world. The entity will need to have active set before it can be used by systems. Useful to create entities without initializing them. > Note: Inactive entities still exist in the world and can have components added to them.

### World.ConvertEntity

```csharp
public Entity ConvertEntity(GameObject go);
```

Convert a GameObject to an entity by packing references to all components in the GameObject.

### World.DestroyEntity

```csharp
public void DestroyEntity(Entity entity);
```

Destroy an entity and all of its components.

### World.GetMask

```csharp
public EntityMask GetMask(Entity entity);
```

Returns the entity mask.

### World.Pack

```csharp
public T Pack<T>(Entity entity) where T : Component;
```

Adds a component and associates an entity with the component.

Unlike the original `Pack(entity, component)` the component will also be created and added to the `GameObject` related to the entity.

```csharp
public ref T Pack<T>(Entity entity, T component);
```

Adds or replaces a component and associates an entity with the component. This function can be used with pure entities.

> Note: When using this function with GameObject entities, make sure you pass the component returned from `GameObject.AddComponent` to this function. Otherwise use the `Pack(entity)` overload instead which also adds the component to the GameObject.

Adding components will invalidate the cache. The number of cached views is *usually* approximately equal to the number of systems, so this operation is not that expensive but you should avoid doing it every frame. This does not apply to 're-packing' components (see note below).

> Note: If the entity already has a component of the same type, the old component will be replaced. Replacing a component with a new instance is *much* faster than calling `Remove` and then `Pack` which would result in the cache being rebuilt twice. Replacing a component does not invalidate the cache and is cheap operation.

### World.Unpack

```csharp
public ref T Unpack<T>(Entity entity)
```
Returns a component of the given type associated with an entity. This function will only check if the component does not exist for an entity if assertions are enabled, otherwise it is unchecked. Use `Contains` if you need to verify the existence of a component before removing it. This is a cheap operation.

This function returns a reference to a component in the packed array. The reference may become invalid after `Remove` is called since `Remove` may move components in memory. This only applies to 'struct' components.

Using `ref` is only necessary when modifying `struct` or 'Pure' components.

```csharp
ref var a = ref world.Unpack<A>(entity1);
a.x = 5; // a is a valid reference and x will be updated.

var b = world.Unpack<B>(entity1); // copy B
world.Remove<B>(entity2);
b.x = 5;
world.Pack(entity1, b); // Ensures b will be updated in the array

ref var c = reg world.Unpack<C>(entity1);
world.Remove<C>(entity2);
c.x = 5; // may not update c.x in the array
```

If you plan on holding the reference it is better to copy the component and then pack it again if you have modified the component. Re-packing a component is a cheap operation and will not invalidate. the cache.

> Do not store this reference between frames such as in a member variable, store the entity instead and call unpack each frame. This operation is designed to be called multiple times per frame so it is very fast, there is no need to `cache` a component reference in a member variable.

### World.Contains

```csharp
public bool Contains<T>(Entity entity);
```

```csharp
public bool Contains(Entity entity, Type component);
```

Returns true if a component of the given type is associated with an entity. This is a cheap operation.

### World.Remove

```csharp
public void Remove<T>(Entity entity);
```

Removes a component from an entity. Removing components invalidates the cache.

This function will only check if the component does not exist for an entity if assertions are enabled, otherwise it is unchecked. Use `Contains` if you need to verify the existence of a component before removing it.

### World.SetActive

```csharp
public void SetActive(Entity entity, bool active);
```

Adds or removes an Active component. If the entity is a GameObject, GameObject.SeActive is also called.

### World.View

```csharp
public List<Entity> View(EntityMask mask, bool includeInactive = false);
```

Returns all entities that have all requested components. By default only entities with an `Active` component are matched unless `includeInactive` is true.

```csharp
foreach (var entity in View<A, B, C>()) {
    ref var a = Unpack<A>(entity);
    // ...
}
```

The first call to this function will build a cache with the entities that contain the requested components, subsequent calls will return the cached data as long as the data is still valid. If a cache is no longer valid, this function will rebuild the cache by applying all necessary diffs to make the cache valid.

The cost of rebuilding the cache depends on how many diff operations are needed. Any operation that changes whether an entity should be in this cache (does the entity have all requested components?) counts as a single Add or Remove diff. Functions like `Remove`, `MakeEntity`, `Pack`, `DestroyEntity` may cause a cache to be invalidated. Functions that may invalidate the cache are documented.

### World.ViewOne

```csharp
public Entity? ViewOne<T>(bool includeInactive = false);
```
Returns the **first** entity that contains all components requested. Views always keep entities in the order that the entity was added to the view, so `ViewOne()` will reliabily return the same entity that matches the constraints unless the entity was destroyed or has had one of the required components removed.

The returned optional will have no value if no entities exist with all requested components.

### World.UnpackOne

```csharp
public ret T UnpackOne<T>(bool includeInactive = false);
```

Finds the first entity with the requested component and unpacks the component requested. This is convenience function for getting at a single component in a single entity.

```csharp
ref var camera = world.UnpackOne<Camera>();

// is equivalent to
var entity = world.ViewOne<Camera>().Value;
ref var camera = world.Unpack<Camera>(entity);
```

Unlike `view_one()` this function will panic if no entities with the requested component were matched. Only use this function if not matching any entity should be an error, if not use `view_one()` instead.

### World.UnsafeViewAll

```csharp
public List<Entity> UnsafeViewAll();
```

Returns all entities in the world. Entities returned may be inactive. > Note: Calling `DestroyEntity()` will invalidate the iterator, use `View<>(true)` to get all entities without having `DestroyEntity()` invalidate the iterator.

### World.Each

```csharp
public void Each<T0>(V<T0> fn, bool includeInactive = false);

// + overloads
```

```csharp
public void Each<T0>(VI<Entity, T0> fn, bool includeInactive = false);

// + overloads
```

### World.MakeSystem

```csharp
public T MakeSystem<T>() where T : EntitySystem, new();
```

Creates and adds a system to the world. This function calls `System::load` to initialize the system.

> Systems are not unique. 'Duplicate' systems, that is different instances of the same system type, are allowed in the world.

```csharp
public T MakeSystem<T>(T system) where T : EntitySystem;
```

Adds a system to the world. This function calls `System.Load` to initialize the system.

### World.MakeSystemBefore

```csharp
public T MakeSystemBefore<Before, T>() where T : EntitySystem, new() where Before : EntitySystem;
```

Adds a system to the world before another system if it exists. `Before` is an existing system. `T` is the system to be added before an existing system.

### World.GetSystem

```csharp
public T GetSystem<T>() where T : EntitySystem;
```

Returns the first system that matches the given type. System returned will be `null` if it is not found.

### World.GetAllSystems

```csharp
public void GetAllSystems<T>(List<T> systems) where T : EntitySystem;
```

Returns all systems that match the given type. Systems returned will not be null.

### World.DestroySystem

```csharp
public void DestroySystem(EntitySystem system)
```

System must not be null. Do not destroy a system while the main update loop is running as it could invalidate the system iterator, consider checking if the system should run or not in the system update loop instead.

### World.DestroyAllSystems

```csharp
public void DestroyAllSystems()
```

Destroy all systems in the world.

### World.Systems

```csharp
public List<EntitySystem> Systems();
```

Systems returned will not be null.

### World.RegisterComponent

```csharp
public void RegisterComponent<T>();
```

Components will be registered on their own if a new type of component is added to an entity. There is no need to call this function unless you are doing something specific that requires it.

### World.FindOrRegisterComponent

```csharp
public ComponentType FindOrRegisterComponent<T>();
```

Registers a component type if it does not exist and returns it. Components are registered automatically so there is usually no reason to call this function.

### World.CollectUnusedEntities

```csharp
public void CollectUnusedEntities();
```

Recycles entity ids so that they can be safely reused. This function exists to ensure we don't reuse entity ids that are still present in some cache even though the entity has been destroyed. This can happen since cache operations are done in a 'lazy' manner.

This function should be called at the end of each frame.

### World.UpdateSystems

```csharp
public void UpdateSystems()
```

Default system update loop. Calls update on all systems in the world. For more control over the update loop, use `Systems()` to get a list of all systems in the world.

### World.DrawSystems

```csharp
public void DrawSystems();
```
Default system draw loop. Calls draw all systems in the world. For more control over the draw loop, use `Systems()` to get a list of all systems in the world.

This function should only be called after all systems have been updated in the MonoBehaviour Update() loop.

### World.Bind

```csharp
public void Bind<Event>(Func<Event, bool> fn);
```

Adds a function to receive events of type Event.

```csharp
public void Bind<Event>(Func<World, Event, bool> fn);
```

Adds a function to receive events of type Event. The function will also be passed the instance of the world it is bound to.

### World.Emit

```csharp
public void Emit<Event>(in Event e);
```

Emits an event to all event handlers. If a handler function in the chain returns true then the event is considered handled and will not propagate to other listeners.

### World.ClearEventChannels

```csharp
public void ClearEventChannels();
```

Clears all event channels.

---

### Liquid.Entities.ComponentArray

> Note: This class is mostly an implementation detail

```csharp
public class ComponentArray<T> : IComponentArray {}
```

### ComponentArray.Count

```csharp
public int Count { get; }
```

Returns the number of valid components in the packed array.

### ComponentArray.Read

```csharp
public ref T Read(Enity entity);
```

Returns a component of type T given an Entity.

> Note: References returned by this function are only guaranteed to be valid during the frame in which the component was read, after that the component may become invalidated. Don't hold reference.

### ComponentArray.ReadData

```csharp
public object ReadData(Entity entity);
```

Returns the component for a given entity boxed in a reference object. This is useful for debugging.

### ComponentArray.Write

```csharp
public ref T Write(Entity entity, T component);
```

Set a component in the packed array and associate an entity with the component.

### ComponentArray.Remove

```csharp
public void Remove(Entity entity);
```

Invalidate this component type for an entity. This function will always succeed, even if the entity does not contain a component of this type.

> References returned by `Read` may become invalid after remove is called.

### ComponentArray.Copy

```csharp
public vois Copy(Entity dst, Enitty src);
```

Copy component to `dst` from `src`. If the component is a  reference object this will only copy the component reference.

### ComponentArray.Contains

```csharp
public bool Contains(Entity entity);
```

Returns true if the entity has a component of type T.

---

### Liquid.Entities.EventChannel

> Note: This class is mostly an implementation detail

```csharp
public class EventChannel<Event> : IEventChannel {}
```

### EventChannel.Bind

```csharp
public void Bind(Func<Event, bool> fn);
```

Adds a function as an event handler

### EventChannel.Emit

```csharp
public void Emit(in Event e);
```

Emits an event to all event handlers

---

# Liquid.Rendering

### Liquid.Rendering.Position

```csharp
public struct Position {
    public float3 Value;
}
```

---

### Liquid.Rendering.Rotation

```csharp
public struct Rotation {
    public quaternion Value;
}
```

---

### Liquid.Rendering.Scale

```csharp
public struct Scale {
    public float3 Value;
}
```
---

### Liquid.Rendering.LocalToWorld

```csharp
public struct Position {
    public float4x4 Value;
}
```

Transformation matrix for an entity. If the entity has any of either a Position, Rotation or Scale component the LocalToWorld matrix will be populated by the LocalToWorldSystem.

---

### Liquid.Rendering.RenderMesh

```csharp
public struct RenderMesh {
    // The mesh to draw.
    public Mesh mesh;

    // The material used to draw the mesh.
    public Material material;

    // Which layer to use.
    public int layer;

    // If null the mesh will be drawn by all cameras.
    public Camera camera;

    // Which sunset of the mesh to draw, only applies to meshes that have
    // several materials
    public int subMesh;

    // Additional material properties to apply onto the material before
    // the mesh is drawn.
    public MaterialPropertyBlock properties;

    // Determines whether the mesh can cast shadows.
    public ShadowCastingMode castShadows;

    // Determines whether the mesh can receive shadows.
    public bool receiveShadows;
}
```

A container component for a mesh and material to be rendered.

---

### Liquid.Rendering.LocalToWorldSystem

```csharp
public class LocalToWorldSystem : EntitySystem {}
```

Populates a `LocalToWorld` matrix component using values from the Position, Rotation and Scale components. If an entity does not have the Position, Rotation or Scale components this system will not modify the `LocalToWorld` matrix so that the matrix can be set directly.

> This system is added by the `MeshRendererSystem` and does not need to be
added manually.

---

### Liquid.Rendering.MeshRendererSystem

```csharp
public class MeshRendererSystem : EntitySystem {}
```

A simple rendering system using `Graphics.DrawMesh` for each entity with a `RenderMesh` and a `LocalToWorld` component.

repository: stillwwater/liquidecs

repo_name: stillwwater/liquidecs


text:
---
layout: single
title: "Intro to Vector Data & Shapefiles in R"
authors: [Leah Wasser]
contributors: [NEON Data Skills]
dateCreated: 2016-09-25
lastModified: 2016-11-29
packagesLibraries: [raster, rgdal, sp]
category: [course-materials]
excerpt: "This tutorial introduces the vector spatial data format, stored in
shapefile format."
permalink: course-materials/spatial-data/about-shapefiles
class-lesson: ['intro-spatial-data-r']
sidebar:
  nav:
nav-title: 'vector intro'
author_profile: false
comments: false
order: 2
---

# Goals / Objectives

After reading this post, you will:

* Understand the key files associated with a shapefile: shp, dbf, shx.

### Install R Packages

* **raster:** `install.packages("raster")`
* **rgdal:** `install.packages("rgdal")`

****

### Additional Resources

* Wikipedia article on

GIS file formats.

# Types of Spatial Data

Spatial data are represented in different ways and are stored using different structures and within different file formats. In this tutorial, we will focus on vector data - data that are composed of points, lines and/or polygons.

## Vector Data - Points, Lines, Polygons

Vector data, are often used to store elements on the earth's surface that
can be described using discrete shapes or locations. Examples of this include:

 * The path or centerline of a road
 * The location of a study area.
 * Plot locations,
 * Boundaries of states, countries, census areas,
 * Water body boundaries (lakes and oceans).

Vector data are composed of discrete geometric locations (x, y values) known as
**vertices** that define the "shape" or location of the spatial object. The organization
of the vertices determines the type of vector that we are working
with: **point**, **line** or **polygon**.

 There are 3 types of vector objects: points, lines or
    polygons. Each vector object type has a different structure.
    Image Source: National Ecological Observatory Network (NEON)

* **Points:** Each individual point is defined by a **single x, y coordinate**.
There can be many points in a vector point file. Examples of point data include:
	+ sampling locations,
	+ the location of individual trees or
	+ the location of plots.
* **Lines:** Lines are composed of **many (at least 2) vertices that
are connected**. For instance, a road or a stream may be represented by a line.
This line is composed of a series of segments, each "bend" in the road or stream
represents a vertex that has defined `x, y` location.
* **Polygons:** A polygon consists of **3 or more vertices that are connected
and "closed"**. Occasionally, a polygon can have a hole in the middle of it
(like a doughnut), this is something to be aware of but not an issue we will
deal with in this tutorial series. Objects often represented by polygons
include:
	+ outlines of plot boundaries,
	+ lakes,
	+ oceans and
	+ states or country boundaries.

 **Data Tip:** A shapefile will only contain **one
type of vector data**: points, lines or polygons.
{: .notice}

```r

# load libraries required to work with spatial data
library(raster) # commands to view metadata from vector objects
library(rgdal) # library of common GIS functions

# Open shapefile
roads_HARV <- readOGR("NEON-DS-Site-Layout-Files/HARV","HARV_roads")
## OGR data source with driver: ESRI Shapefile
## Source: "NEON-DS-Site-Layout-Files/HARV", layer: "HARV_roads"
## with 13 features
## It has 15 fields

# view slots available for the object
slotNames(roads_HARV)
## [1] "data"        "lines"       "bbox"        "proj4string"

# view all methods available for that object
# methods(class = class(roads_HARV))
```

## Stucture of a Lines Feature

If we are working with a shapefile containing **line** data, then each line
consists of 2 or more vertices that are connected. We can view each set of coordinates
for that object using `R`.

```r

# view the coordinates for each vertex, for the last feature in the spatial object
roads_HARV@lines[13]
## [[1]]
## An object of class "Lines"
## Slot "Lines":
## [[1]]
## An object of class "Line"
## Slot "coords":
##           [,1]    [,2]
##  [1,] 732479.6 4713107
##  [2,] 732485.9 4713115
##  [3,] 732498.2 4713148
##  [4,] 732496.7 4713211
##  [5,] 732487.1 4713259
##  [6,] 732486.9 4713279
##  [7,] 732488.9 4713322
##  [8,] 732491.1 4713349
##  [9,] 732504.8 4713377
## [10,] 732528.3 4713443
## [11,] 732533.0 4713476
## [12,] 732528.8 4713506
## [13,] 732522.0 4713534
## [14,] 732509.9 4713569
## [15,] 732496.6 4713604
## [16,] 732479.4 4713639
## [17,] 732463.5 4713670
## [18,] 732454.0 4713697
## [19,] 732439.3 4713734
## [20,] 732428.8 4713763
## [21,] 732416.5 4713816
## [22,] 732414.5 4713829
## [23,] 732413.4 4713845
## [24,] 732415.0 4713879
## [25,] 732416.5 4713905
## [26,] 732421.4 4713932
## [27,] 732427.6 4713961
## [28,] 732437.7 4713996
## [29,] 732449.0 4714027
## [30,] 732465.3 4714068
## [31,] 732474.8 4714085
## [32,] 732485.4 4714097
## [33,] 732500.5 4714110
## [34,] 732517.8 4714122
## [35,] 732544.8 4714135
## [36,] 732565.0 4714153
## [37,] 732624.9 4714162
## [38,] 732682.9 4714177
## [39,] 732764.1 4714184
## [40,] 732843.3 4714200
## [41,] 732915.8 4714219
## [42,] 732991.7 4714236
## [43,] 733067.5 4714255
## [44,] 733106.4 4714260
## [45,] 733170.0 4714259
## [46,] 733239.0 4714246
## [47,] 733295.5 4714217
##
##
##
## Slot "ID":
## [1] "12"

# view the coordinates for the last feature in the spatial object
roads_HARV@lines[14]
## [[1]]
## NULL
```

## Challenge

* Why didn't `roads_HARV@lines[14]` return any vertex coordinates?

## Spatial Data Attributes

Each object in a shapefile, is called a `feature`. Each `feature` has one or
more `attributes` associated with it.

Shapefile attributes are similar to fields or columns in a spreadsheet. Each row
in the spreadsheet has a set of columns associated with it that describe the row
element. In the case of a shapefile, each row represents a spatial object - for
example, a road, represented as a line in a line shapefile, will have one "row"
of attributes associated with it. These attributes can include different types
of information that describe shapefile `features`. Thus, a road,
may have a name, length, number of lanes, speed limit, type of road and other
attributes stored with it.

Each spatial feature in an R spatial object has the same set of
    associated attributes that describe or characterize the feature.
    Attribute data are stored in a separate *.dbf file. Attribute data can be
    compared to a spreadsheet. Each row in a spreadsheet represents one feature
    in the spatial object.
    Image Source: National Ecological Observatory Network (NEON)

```r
# view all attributes for a spatial object
# note, the code below just looks at the first 3 features
head(roads_HARV@data, 3)
##   OBJECTID_1 OBJECTID       TYPE             NOTES MISCNOTES RULEID
## 0         14       48 woods road Locust Opening Rd      <NA>      5
## 1         40       91   footpath              <NA>      <NA>      6
## 2         41      106   footpath              <NA>      <NA>      6
##            MAPLABEL SHAPE_LENG             LABEL BIKEHORSE RESVEHICLE
## 0 Locust Opening Rd  1297.3571 Locust Opening Rd         Y         R1
## 1              <NA>   146.2998              <NA>         Y         R1
## 2              <NA>   676.7180              <NA>         Y         R2
##   RECMAP Shape_Le_1                            ResVehic_1
## 0      Y  1297.1062    R1 - All Research Vehicles Allowed
## 1      Y   146.2998    R1 - All Research Vehicles Allowed
## 2      Y   676.7181 R2 - 4WD/High Clearance Vehicles Only
##                    BicyclesHo
## 0 Bicycles and Horses Allowed
## 1 Bicycles and Horses Allowed
## 2 Bicycles and Horses Allowed
```

In the map below of the Harvard Forest field site, there are different features
that are stored as different spatial object types. Check out the NEON / Data
Carpentry
[*Introduction to Working with Vector Data in R* tutorial series]({{ site.basurl }}/tutorial-series/vector-data-series/) to learn more about making these types
of maps in `R`.

The map above is created using both point and linevector data
    layers.

## Challenge: Shapefiles

Have a look at the map above:  **Study Plots by Soil Type**. What is the minimum number of
shapefiles that are required to create this map? How do you know?

### Vector Data in .CSV Format

The shapefile format is one (very common) way to store vector data. However,
you may encounter is in other formats. For example, sometimes, point data are
stored as a Comma Separated Value (.CSV) format.

Check out the NEON / Data Carpentry tutorial on
[converting from .csv to a Shapefile in R.](http://neondataskills.org/Vector 04: Convert from .csv to a Shapefile in R).


text:
# Making a release

Replace `v1.23` with the new version in the commands/examples below.

## For the Pull Request

- Update `CHANGELOG.md`, replace `## Unversioned` with `## v1.23` and add a new empty `## Unversioned` section above `## v1.23`.
- Look through the changelog entries of this version, and reorder any entries so the most important changes are at the top of each category
- Update `pajbot/constants.py` with the new version

## After the Pull Request has been accepted

- Tag the release: `git tag v1.23 -am "v1.23"`
- Push the tag: `git push --tags`
- Update the `stable` branch to point to the new release: `git checkout stable && git merge --ff-only v1.23`

repository: sgaweda/troybot

repo_name: sgaweda/troybot