Skip to content

Commit

Permalink
#297 Restart
Browse files Browse the repository at this point in the history
  • Loading branch information
vssekorin committed Aug 8, 2022
1 parent 758264f commit b1bc9f8
Show file tree
Hide file tree
Showing 169 changed files with 367 additions and 9,897 deletions.
33 changes: 17 additions & 16 deletions .rultor.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
docker:
image: yegor256/java8
image: g4s8/rultor:alpine3.10
architect:
- vssekorin
assets:
settings.xml: vssekorin/secret#cactoos-math/settings.xml
pubring.gpg: vssekorin/secret#pubring.kbx
secring.gpg: vssekorin/secret#pubring.kbx
env:
MAVEN_OPTS: -XX:MaxPermSize=256m -Xmx1g
JAVA_OPTS: -XX:MaxPermSize=256m -Xmx1g
install: |-
sudo gem install pdd
java -version
settings.xml: vssekorin/home#assets/cactoos/settings.xml
pubring.gpg: vssekorin/home#assets/pubring.gpg
secring.gpg: vssekorin/home#assets/secring.gpg
merge:
script: |
pdd -f /dev/null
mvn clean install -Pqulice --errors --settings ../settings.xml
mvn clean site -Psite --errors --settings ../settings.xml
mvn clean
deploy:
script: |
pdd -f /dev/null
mvn clean deploy -Pqulice --errors --settings ../settings.xml
release:
sensitive:
- settings.xml
script: |-
[[ "${tag}" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1
mvn versions:set "-DnewVersion=${tag}"
[[ "${tag}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit -1
gpg --import /home/r/pubring.gpg
gpg --allow-secret-key-import --no-tty --batch --import /home/r/secring.gpg
mvn versions:set "-DnewVersion=${tag}" --settings ../settings.xml
git commit -am "${tag}"
mvn clean deploy -Pqulice --errors --settings ../settings.xml
architect:
- VsSekorin
# note: -Pcactoos is needed to have the gpg and sonar secrets injected
# Sonar is disabled (was -Psonar) because sonarcloud.io only support Java 11+
mvn clean deploy -Pcactoos -Pqulice -Psonatype --errors --settings ../settings.xml
20 changes: 18 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
language: java
sudo: false
jdk:
- openjdk8
cache:
directories:
- $HOME/.m2
script:
- set -e
- pdd --file=/dev/null
- mvn javadoc:javadoc
- mvn clean site -Psite --errors --batch-mode
- mvn clean install -Pqulice --errors --batch-mode
install:
- gem install pdd
- gem install xcop
env:
global:
- MAVEN_OPTS="-Xmx256m"
- JAVA_OPTS="-Xmx256m"
jdk:
- openjdk8
after_success:
- "bash <(curl -s https://codecov.io/bash)"
6 changes: 3 additions & 3 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License
The MIT License (MIT)

Copyright (c) 2017-2019 Vseslav Sekorin
Copyright (c) 2017-2022 Vseslav Sekorin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -14,7 +14,7 @@ in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Expand Down
101 changes: 1 addition & 100 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,6 @@ These are the [design principles](http://www.elegantobjects.org#principles) behi

Java version required: 1.8+.

## Funcs

Please use a `Func<X, Func<Y, Z>>` instead of `BiFunc<X, Y, Z>` ([a little bit about that](https://github.com/google/guava/wiki/IdeaGraveyard#functionspredicates-for-n--2-inputs)).

```java
BiFunc<Integer, Long, Number> bifunc = (fst, snd) -> fst + snd;
Func<Integer, Func<Long, Number>> funcfunc = new BiFuncFunc<>(bifunc);
```

[Partial application](https://en.wikipedia.org/wiki/Partial_application):

```java
Func<Long, Long> func = new PartApply<>(bifunc, 2);
```
This is equivalent to:
```java
Func<Long, Long> func = new BiFuncFunc<>(bifunc).apply(2)
```

## Seq

Natural Number:
```java
new Seq(0, a -> a + 1)
```
Stream of random double greater than or equal to 6 and less than 16:
```java
new Seq(new Random(6, 16), a -> new Random(6, 16))
```

## BiSeq

Fibonacci number:
```java
new BiSeq<>(0, 1, (fst, snd) -> fst + snd)
```

Lucas number:
```java
new BiSeq<>(2, 1, fst -> snd -> snd + fst)
```

## Matrix

Identity matrix 6x6:
Expand All @@ -70,62 +28,6 @@ new MatrixOf<>(
)
```

The product of two matrices:

```java
new MatrixProd<>(
new MatrixOf<>(
new Integer[][]{
{1, 2},
{3, 4},
}
),
new MatrixOf<>(
new Long[][]{
{9L, 8L},
{7L, 6L},
}
),
a -> b -> a * b,
a -> b -> a + b,
0L
)
```

Determinant:

```java
new IntDet<>(
new MatrixOf<>(
new Integer[][]{
{1, 2},
{3, 4},
}
)
)
```

## Scalars

Random number in [2; 4]:
```java
new Random(() -> 2, () -> 4);
```

Factorial of 5:

```java
new ReduceLeft<>(
new Limited<>(
5,
new Seq<>(1, a -> a + 1)
),
fst -> snd -> fst * snd
);
```

Other scalars: `Abs`, `Cbrt`, `Constant`, `Cos`, `Exp`, `FoldLeft`, `FoldRight`, `ReduceLeft`, `ReduceRight`, `Round`, `Sin`, `Sqrt`, `Tan`.

## How to contribute?

Just fork the repo and send us a pull request.
Expand All @@ -139,7 +41,6 @@ mvn clean install -Pqulice
## Contributors

- [@VsSekorin](https://github.com/VsSekorin) as Vseslav Sekorin ([Blog](http://vssekorin.com))
- [@daryaego](https://github.com/daryaego) as Darya Egorova
- [@floreasorin](https://github.com/floreasorin)
- [@alexandrustoica](https://github.com/alexandrustoica) as Alexandru Stoica

Expand All @@ -159,7 +60,7 @@ copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Expand Down
Loading

0 comments on commit b1bc9f8

Please sign in to comment.