text:
# SOFTWARE ENGINEERING IN JAVA

## Session 20 (18/12/2018)

- Project creation for API application
- Rebase / merge explanation
- Reseting commits
- See the amount of branches and the differences between the master
- Resolving merge conflicts in API Application

### Notes

#### Project creation

We created a new [project for the API application][1] in order to track the tasks using [kanban method][9].

#### Calculator Frontend

Roger was explaining to me how to use `rebase` and the difference with `merge` for the [calculator-frontend repository][2].

He was also explaining to me why he used an initial commit called `Initial codebase` on a branch called `delete-me-after-review` as the begining of the history. He did that in order to he could raise this [Pull Request (PR) from master against that branch][3] and to compare seeing all changes I did in master, being able to do comments, but with the caveat to couldn't make reviews because was himself who created that branch and raised the PR as he states:

>I had to create an empty commit at the beginning of the git history in order to be able to do a complete PR against the entire codebase.
>
>If you're interested here's what I did to enable this:
>
>```bash
>git checkout --orphan delete-me-after-review
>git commit --allow-empty -m "Empty commit for reviewing purposes"
>git push -u origin delete-me-after-review
>git checkout master
>git rebase delete-me-after-review
>git push -f
>```

At the end, `delete-me-after-review` branch wasn't neccesary since I applied all changes asked in that branch's PR in another branch I had created called `frontend-bs4`, so I [merged that branch into master][4] (master was only different to the empty branch for 1 commit - the merge one). And the empty branch could be deleted:

```bash
[jaar@port-staff calculator-frontend]$ git status
On branch frontend-bs4
Your branch is up to date with 'origin/frontend-bs4'.
...
        modified:   index.html
        modified:   public/scripts/calculator.js
        modified:   public/stylesheets/calculator.css

[jaar@port-staff calculator-frontend]$ git branch -a
* frontend-bs4
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/delete-me-after-review
  remotes/origin/frontend-bs4
  remotes/origin/master

[jaar@port-staff calculator-frontend]$ git add . ; git commit -m 'Apply sugesstions in PR #2 #3'; git push
[frontend-bs4 182e403] Apply sugesstions in PR #2 #3
 3 files changed, 10 insertions(+), 56 deletions(-)
...
To github.com:javarb/calculator-frontend.git
   081423d..182e403  frontend-bs4 -> frontend-bs4
```

#### API

Several operation were made in order to apply the last changes in the most sequential and ordered way into Git history

First we looked in the commits history:

```bash
[jaar@port-staff api]$ git log
commit 2ebf8f787a2bae16f20e97ff4c663fbb6eecdc09 (HEAD -> bugsnag-integration, origin/bugsnag-integration)
Author: Javier Arboleda<EMAIL_ADDRESS>Date:   Mon Dec 3 16:47:42 2018 -0500

    Removing BugSnag test

commit c00c06b022cff888cd320e19e322597e8bb116bd
Author: Javier Arboleda<EMAIL_ADDRESS>Date:   Sun Dec 2 13:59:46 2018 -0500

    Bugsnag integration
...
```

And check for the state of the repo for pending changes for commit:

```bash
[jaar@port-staff api]$ git status
On branch bugsnag-integration
Your branch is up to date with 'origin/bugsnag-integration'.
...
        modified:   build.gradle
        modified:   src/main/java/co/org/osso/api/CalculatorController.java
        modified:   src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java
```

In order to decide what to commit, we look in the differences between our current content and the last commit. So as is showed next, a least 3 different subjects are mixed into our differences to commit: Bugsnag integration, application logics and testing HTTP endpoints.

Then, even if we could just make a commit and get out quickly with this, the best solution should be to commit selectively depending on the subject:

```bash
[jaar@port-staff api]$ git diff
diff --git a/build.gradle b/build.gradle
index 87c18ed..9d011ed 100644
--- a/build.gradle
+++ b/build.gradle
@@ -28,9 +28,9 @@ dependencies {
        compile('org.springframework.boot:spring-boot-starter-actuator')
        compile('org.springframework.boot:spring-boot-starter-data-mongodb')
        compile('org.springframework.boot:spring-boot-starter-web')
+       compile 'com.bugsnag:bugsnag-spring:3.+'
        runtime('org.springframework.boot:spring-boot-devtools')
        testCompile('org.springframework.boot:spring-boot-starter-test')
        testCompile('de.flapdoodle.embed:de.flapdoodle.embed.mongo')
-       compile 'com.bugsnag:bugsnag-spring:3.+'
-
+       testCompile('org.apache.httpcomponents:httpclient:4.5.5')
 }

diff --git a/src/main/java/co/org/osso/api/CalculatorController.java b/src/main/java/co/org/osso/api/CalculatorController.java
index 6c53162..a2e2218 100644
--- a/src/main/java/co/org/osso/api/CalculatorController.java
+++ b/src/main/java/co/org/osso/api/CalculatorController.java
@@ -28,6 +28,7 @@ public class CalculatorController {
     }

     @GetMapping("/factorial/{number}")
+    // JSON that contains a biginteger
     public BigInteger getFactorial(@PathVariable("number") int number){
         return calculator.getFactorial(number);
     }
+++ b/src/main/java/co/org/osso/api/CalculatorController.java
@@ -28,6 +28,7 @@ public class CalculatorController {
     }

     @GetMapping("/factorial/{number}")
+    // JSON that contains a biginteger
     public BigInteger getFactorial(@PathVariable("number") int number){
         return calculator.getFactorial(number);
     }

diff --git a/src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java b/src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java
index fa172d1..a0fdd36 100644
--- a/src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java
+++ b/src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java
@@ -1,16 +1,41 @@
 package co.org.osso.api;

+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.HttpResponse;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.util.EntityUtils;
 import org.junit.Assert;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.web.server.LocalServerPort;
+import org.springframework.test.context.junit4.SpringRunner;

+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import java.math.BigInteger;
 import java.util.Arrays;
 import java.util.List;

+@RunWith(SpringRunner.class)
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
 public class ApiApplicationCalculatorTests {

     Calculator target = new Calculator();

+    @LocalServerPort
+    int port;
+
     @Test
     public void checkCalculatorFibonacci(){
         List<Integer> expected = Arrays.asList(1,1,2,3,5);
@@ -59,4 +84,62 @@ public class ApiApplicationCalculatorTests {
             Assert.assertTrue(re.getMessage().contains("Error:"));
         }
     }
+
+    // look at databasic, this is the same mapper
+    private ObjectMapper mapper() {
+        final ObjectMapper mapper = new ObjectMapper();
+        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+        return mapper;
+    }
+
+    private String serialise(final Object object) throws JsonProcessingException {
+        return mapper().writeValueAsString(object);
+    }
+
+    // HttpUriRequest is an interface parent of HttpPost
+    // If I inline http method, what is there, comes to here
+    HttpResponse send(final HttpUriRequest req) throws IOException {
+        return http().execute(req);
+    }
+
+    HttpPost post(final String path, Object payload) throws JsonProcessingException, UnsupportedEncodingException {
+        String uri = uri(path);
+        final HttpPost req = new HttpPost(uri);
+        req.setEntity(new StringEntity(serialise(payload)));
+        req.setHeader("Accept", "application/json");
+        req.setHeader("Content-type", "application/json");
+        return req;
+    }
+
+    private CloseableHttpClient http() {
+        return HttpClientBuilder.create()
+                .build();
+    }
+
+    private String uri(final String path) {
+        return baseUrl() + path;
+    }
+
+    private String baseUrl() {
+        return "http://localhost:" + port + "/";
+    }
+
+    @Test
+    public void testPost() throws Exception{
+        Book book = new Book();
+        book.setTitle("one");
+        book.setYear("2018");
+        HttpPost req = post("/api/book", book);
+        HttpResponse res = send(req);
+        Book bookResponse = deserialise(res, Book.class);
+        Assert.assertEquals("one", bookResponse.getTitle());
+        Assert.assertNotNull(bookResponse.getBookID());
+    }
+
+    // read about generic (try to understand this can be a little advanced)
+    <T> T deserialise(final HttpResponse res, final Class<T> type) throws IOException {
+        return mapper().readValue(EntityUtils.toString(res.getEntity()), type);
+    }
+
+
}
```

For select among the code to commit, we add to partially using `add -p` git flag which suggest code chunks to add (we can split more or select manually if we want). We begin adding code related to Bugsnag integration so we have to be located in the corresponding branch:

```bash
[jaar@port-staff api]$ git branch
  api-basics
  api-calculator
  api-calculator-fix-bug
* bugsnag-integration
  master

[jaar@port-staff api]$ git add -p
diff --git a/build.gradle b/build.gradle
index 87c18ed..9d011ed 100644
--- a/build.gradle
+++ b/build.gradle
@@ -28,9 +28,9 @@ dependencies {
        compile('org.springframework.boot:spring-boot-starter-actuator')
        compile('org.springframework.boot:spring-boot-starter-data-mongodb')
        compile('org.springframework.boot:spring-boot-starter-web')
+       compile 'com.bugsnag:bugsnag-spring:3.+'
        runtime('org.springframework.boot:spring-boot-devtools')
        testCompile('org.springframework.boot:spring-boot-starter-test')
        testCompile('de.flapdoodle.embed:de.flapdoodle.embed.mongo')
-       compile 'com.bugsnag:bugsnag-spring:3.+'
-
+       testCompile('org.apache.httpcomponents:httpclient:4.5.5')
 }
Stage this hunk [y,n,q,a,d,s,e,?]? y

diff --git a/src/main/java/co/org/osso/api/CalculatorController.java b/src/main/java/co/org/osso/api/CalculatorController.java
index 6c53162..a2e2218 100644
--- a/src/main/java/co/org/osso/api/CalculatorController.java
+++ b/src/main/java/co/org/osso/api/CalculatorController.java
@@ -28,6 +28,7 @@ public class CalculatorController {
     }

     @GetMapping("/factorial/{number}")
+    // JSON that contains a biginteger
     public BigInteger getFactorial(@PathVariable("number") int number){
         return calculator.getFactorial(number);
     }
Stage this hunk [y,n,q,a,d,e,?]? n

diff --git a/src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java b/src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java
index fa172d1..a0fdd36 100644
--- a/src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java
+++ b/src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java
@@ -1,16 +1,41 @@
 package co.org.osso.api;

+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.HttpResponse;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.util.EntityUtils;
 import org.junit.Assert;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.web.server.LocalServerPort;
+import org.springframework.test.context.junit4.SpringRunner;

+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import java.math.BigInteger;
 import java.util.Arrays;
 import java.util.List;

+@RunWith(SpringRunner.class)
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
 public class ApiApplicationCalculatorTests {

     Calculator target = new Calculator();

+    @LocalServerPort
+    int port;
+
     @Test
     public void checkCalculatorFibonacci(){
         List<Integer> expected = Arrays.asList(1,1,2,3,5);
Stage this hunk [y,n,q,a,d,j,J,g,/,s,e,?]? n
@@ -59,4 +84,62 @@ public class ApiApplicationCalculatorTests {
             Assert.assertTrue(re.getMessage().contains("Error:"));
         }
     }
+
+    // look at databasic, this is the same mapper
+    private ObjectMapper mapper() {
+        final ObjectMapper mapper = new ObjectMapper();
+        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+        return mapper;
+    }
+
+    private String serialise(final Object object) throws JsonProcessingException {
+        return mapper().writeValueAsString(object);
+    }
+
+    // HttpUriRequest is an interface parent of HttpPost
+    // If I inline http method, what is there, comes to here
+    HttpResponse send(final HttpUriRequest req) throws IOException {
+        return http().execute(req);
+    }
+
+    HttpPost post(final String path, Object payload) throws JsonProcessingException, UnsupportedEncodingException {
+        String uri = uri(path);
+        final HttpPost req = new HttpPost(uri);
+        req.setEntity(new StringEntity(serialise(payload)));
+        req.setHeader("Accept", "application/json");
+        req.setHeader("Content-type", "application/json");
+        return req;
+    }
+
+    private CloseableHttpClient http() {
+        return HttpClientBuilder.create()
+                .build();
+    }
+
+    private String uri(final String path) {
+        return baseUrl() + path;
+    }
+
+    private String baseUrl() {
+        return "http://localhost:" + port + "/";
+    }
+
+    @Test
+    public void testPost() throws Exception{
+        Book book = new Book();
+        book.setTitle("one");
+        book.setYear("2018");
+        HttpPost req = post("/api/book", book);
+        HttpResponse res = send(req);
+        Book bookResponse = deserialise(res, Book.class);
+        Assert.assertEquals("one", bookResponse.getTitle());
+        Assert.assertNotNull(bookResponse.getBookID());
+    }
+
+    // read about generic (try to understand this can be a little advanced)
+    <T> T deserialise(final HttpResponse res, final Class<T> type) throws IOException {
+        return mapper().readValue(EntityUtils.toString(res.getEntity()), type);
+    }
+
+
 }
Stage this hunk [y,n,q,a,d,K,g,/,e,?]? n
```

Now we're commiting and pushing to that branch

```bash
[jaar@port-staff api]$ git commit -m 'Minor change'; git push
[bugsnag-integration 3e3245d] Minor change
 ...
   2ebf8f7..3e3245d  bugsnag-integration -> bugsnag-integration
```

Following we use `git show` to see details about our last commit:

```bash
[jaar@port-staff api]$ git show
commit 3e3245de5df8c3bf21805709e5ff80be255e3344 (HEAD -> bugsnag-integration, origin/bugsnag-integration)
Author: Javier Arboleda<EMAIL_ADDRESS>Date:   Tue Dec 18 11:54:18 2018 -0500

    Minor change

diff --git a/build.gradle b/build.gradle
index 87c18ed..9d011ed 100644
--- a/build.gradle
+++ b/build.gradle
@@ -28,9 +28,9 @@ dependencies {
        compile('org.springframework.boot:spring-boot-starter-actuator')
        compile('org.springframework.boot:spring-boot-starter-data-mongodb')
        compile('org.springframework.boot:spring-boot-starter-web')
+       compile 'com.bugsnag:bugsnag-spring:3.+'
        runtime('org.springframework.boot:spring-boot-devtools')
        testCompile('org.springframework.boot:spring-boot-starter-test')
        testCompile('de.flapdoodle.embed:de.flapdoodle.embed.mongo')
-       compile 'com.bugsnag:bugsnag-spring:3.+'
-
+       testCompile('org.apache.httpcomponents:httpclient:4.5.5')
 }
```

Here, we made a mistake by mixing some content about the HTTP integration tests which will be solved in next steps.

At this point we also changed to the HTTP integration tests corresponding branch and pushed that branch to sync the remote tree:

```bash
[jaar@port-staff api]$ git checkout -b http-integration-tests
M       src/main/java/co/org/osso/api/CalculatorController.java
M       src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java
Switched to a new branch 'http-integration-tests'

[jaar@port-staff api]$ git push
fatal: The current branch http-integration-tests has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin http-integration-tests

[jaar@port-staff api]$     git push --set-upstream origin http-integration-tests
Total 0 (delta 0), reused 0 (delta 0)
remote:
remote: Create a pull request for 'http-integration-tests' on GitHub by visiting:
remote:      https://github.com/javarb/api/pull/new/http-integration-tests
remote:
To github.com:javarb/api.git
 * [new branch]      http-integration-tests -> http-integration-tests
Branch 'http-integration-tests' set up to track remote branch 'http-integration-tests' from 'origin'.
```

Now, in order to fix our mistake, we came back to the previous branch (`bugsnag-integration`):

```bash
[jaar@port-staff api]$ git checkout -
M       src/main/java/co/org/osso/api/CalculatorController.java
M       src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java
Switched to branch 'bugsnag-integration'
Your branch is up to date with 'origin/bugsnag-integration'.

[jaar@port-staff api]$ git show
commit 3e3245de5df8c3bf21805709e5ff80be255e3344 (HEAD -> bugsnag-integration, origin/http-integration-tests, origin/bugsnag-integration, http-integration-tests)
Author: Javier Arboleda<EMAIL_ADDRESS>Date:   Tue Dec 18 11:54:18 2018 -0500

    Minor change
...
```

Also, we could see in that branch some of the changes were pending (the other subject changes):

```bash
[jaar@port-staff api]$ git status
On branch bugsnag-integration
Your branch is up to date with 'origin/bugsnag-integration'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   src/main/java/co/org/osso/api/CalculatorController.java
        modified:   src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java

no changes added to commit (use "git add" and/or "git commit -a")
```

As we want to clean our tree but keep the record of the changes made, we use [`git stash`][6]:

```bash
[jaar@port-staff api]$ git stash
Saved working directory and index state WIP on bugsnag-integration: 3e3245d Minor change

[jaar@port-staff api]$ git status
On branch bugsnag-integration
Your branch is up to date with 'origin/bugsnag-integration'.

nothing to commit, working tree clean

```

Now as we wanted just to add the content related with Bugsnag integration, we reset our previous commit because as was said, we made a mistake adding the whole chunk with something about testing HTTP endpoints:

```bash
[jaar@port-staff api]$ git reset HEAD~
Unstaged changes after reset:
M       build.gradle

[jaar@port-staff api]$ git status
On branch bugsnag-integration
Your branch is behind 'origin/bugsnag-integration' by 1 commit, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   build.gradle

no changes added to commit (use "git add" and/or "git commit -a")
```

As we can see following we are as in the beggining (the changes are stashed):

```bash
[jaar@port-staff api]$ git log
commit 2ebf8f787a2bae16f20e97ff4c663fbb6eecdc09 (HEAD -> bugsnag-integration)
Author: Javier Arboleda<EMAIL_ADDRESS>Date:   Mon Dec 3 16:47:42 2018 -0500

    Removing BugSnag test

commit c00c06b022cff888cd320e19e322597e8bb116bd
Author: Javier Arboleda<EMAIL_ADDRESS>Date:   Sun Dec 2 13:59:46 2018 -0500

    Bugsnag integration
...

[jaar@port-staff api]$ git diff
diff --git a/build.gradle b/build.gradle
index 87c18ed..9d011ed 100644
--- a/build.gradle
+++ b/build.gradle
@@ -28,9 +28,9 @@ dependencies {
        compile('org.springframework.boot:spring-boot-starter-actuator')
        compile('org.springframework.boot:spring-boot-starter-data-mongodb')
        compile('org.springframework.boot:spring-boot-starter-web')
+       compile 'com.bugsnag:bugsnag-spring:3.+'
        runtime('org.springframework.boot:spring-boot-devtools')
        testCompile('org.springframework.boot:spring-boot-starter-test')
        testCompile('de.flapdoodle.embed:de.flapdoodle.embed.mongo')
-       compile 'com.bugsnag:bugsnag-spring:3.+'
-
+       testCompile('org.apache.httpcomponents:httpclient:4.5.5')
 }
```

Notice the 2nd `+` sign, this is what we wanted to put in another commit. So we again add partially, but this time spliting again the suggestion to choose only what we want:

```bash
[jaar@port-staff api]$ git add -p
diff --git a/build.gradle b/build.gradle
index 87c18ed..9d011ed 100644
--- a/build.gradle
+++ b/build.gradle
@@ -28,9 +28,9 @@ dependencies {
        compile('org.springframework.boot:spring-boot-starter-actuator')
        compile('org.springframework.boot:spring-boot-starter-data-mongodb')
        compile('org.springframework.boot:spring-boot-starter-web')
+       compile 'com.bugsnag:bugsnag-spring:3.+'
        runtime('org.springframework.boot:spring-boot-devtools')
        testCompile('org.springframework.boot:spring-boot-starter-test')
        testCompile('de.flapdoodle.embed:de.flapdoodle.embed.mongo')
-       compile 'com.bugsnag:bugsnag-spring:3.+'
-
+       testCompile('org.apache.httpcomponents:httpclient:4.5.5')
 }
Stage this hunk [y,n,q,a,d,s,e,?]? s
Split into 2 hunks.
@@ -28,6 +28,7 @@
        compile('org.springframework.boot:spring-boot-starter-actuator')
        compile('org.springframework.boot:spring-boot-starter-data-mongodb')
        compile('org.springframework.boot:spring-boot-starter-web')
+       compile 'com.bugsnag:bugsnag-spring:3.+'
        runtime('org.springframework.boot:spring-boot-devtools')
        testCompile('org.springframework.boot:spring-boot-starter-test')
        testCompile('de.flapdoodle.embed:de.flapdoodle.embed.mongo')
Stage this hunk [y,n,q,a,d,j,J,g,/,e,?]? y
@@ -31,6 +32,5 @@
        runtime('org.springframework.boot:spring-boot-devtools')
        testCompile('org.springframework.boot:spring-boot-starter-test')
        testCompile('de.flapdoodle.embed:de.flapdoodle.embed.mongo')
-       compile 'com.bugsnag:bugsnag-spring:3.+'
-
+       testCompile('org.apache.httpcomponents:httpclient:4.5.5')
 }
Stage this hunk [y,n,q,a,d,K,g,/,e,?]? s^C

```

If we check differences between our last commit and the content added, now we can see only bugsnag content is showed:

```bash
[jaar@port-staff api]$ git diff
diff --git a/build.gradle b/build.gradle
index 87c18ed..59083be 100644
--- a/build.gradle
+++ b/build.gradle
@@ -28,9 +28,8 @@ dependencies {
        compile('org.springframework.boot:spring-boot-starter-actuator')
        compile('org.springframework.boot:spring-boot-starter-data-mongodb')
        compile('org.springframework.boot:spring-boot-starter-web')
+       compile 'com.bugsnag:bugsnag-spring:3.+'
        runtime('org.springframework.boot:spring-boot-devtools')
        testCompile('org.springframework.boot:spring-boot-starter-test')
        testCompile('de.flapdoodle.embed:de.flapdoodle.embed.mongo')
-       compile 'com.bugsnag:bugsnag-spring:3.+'
-
 }

```

We push it but as we had made a push before we are behind the remote branch:

```bash
[jaar@port-staff api]$ git add . ; git commit -m 'minor change'; git push
[bugsnag-integration 9c04af9] minor change
 1 file changed, 1 insertion(+), 2 deletions(-)
To github.com:javarb/api.git
 ! [rejected]        bugsnag-integration -> bugsnag-integration (non-fast-forward)
error: failed to push some refs to 'git@github.com:javarb/api.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
```

Then, we forced it:

```bash
[jaar@port-staff api]$ git add . ; git commit -m 'minor change'; git push --force
On branch bugsnag-integration
Your branch and 'origin/bugsnag-integration' have diverged,
and have 1 and 1 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

nothing to commit, working tree clean
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 298 bytes | 298.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To github.com:javarb/api.git
 + 3e3245d...9c04af9 bugsnag-integration -> bugsnag-integration (forced update)
```

Now if we compare the local content with last commit we can see the HTTP tests content pending:

```bash
[jaar@port-staff api]$ git diff
diff --git a/build.gradle b/build.gradle
index 59083be..9d011ed 100644
--- a/build.gradle
+++ b/build.gradle
@@ -32,4 +32,5 @@ dependencies {
        runtime('org.springframework.boot:spring-boot-devtools')
        testCompile('org.springframework.boot:spring-boot-starter-test')
        testCompile('de.flapdoodle.embed:de.flapdoodle.embed.mongo')
+       testCompile('org.apache.httpcomponents:httpclient:4.5.5')
 }
```

We tried to return to previous branch `http-integration-tests`, but couldn't at this time:

```bash
[jaar@port-staff api]$ git checkout -
error: Your local changes to the following files would be overwritten by checkout:
        build.gradle
Please commit your changes or stash them before you switch branches.
Aborting
```

For some reason we needed to revert the last commit and return to the previous (but seems is the same last one):

```bash
[jaar@port-staff api]$ git reset --hard
HEAD is now at 9c04af9 minor change

[jaar@port-staff api]$ git log
commit 9c04af9ed94577a563ab314b8fd26063f74b46a9 (HEAD -> bugsnag-integration, origin/bugsnag-integration)
Author: Javier Arboleda<EMAIL_ADDRESS>Date:   Tue Dec 18 15:00:55 2018 -0500

    minor change

commit 2ebf8f787a2bae16f20e97ff4c663fbb6eecdc09
Author: Javier Arboleda<EMAIL_ADDRESS>Date:   Mon Dec 3 16:47:42 2018 -0500

    Removing BugSnag test

commit c00c06b022cff888cd320e19e322597e8bb116bd
Author: Javier Arboleda<EMAIL_ADDRESS>Date:   Sun Dec 2 13:59:46 2018 -0500

    Bugsnag integration
...
```

Now the work tree was clean and we can change of branch:

```bash
[jaar@port-staff api]$ git status
On branch bugsnag-integration
Your branch is up to date with 'origin/bugsnag-integration'.

nothing to commit, working tree clean

[jaar@port-staff api]$ git checkout -
Switched to branch 'http-integration-tests'
Your branch is up to date with 'origin/http-integration-tests'.
[jaar@port-staff api]$ git status
On branch http-integration-tests
Your branch is up to date with 'origin/http-integration-tests'.

nothing to commit, working tree clean
```

We popped up what we had stashed in a previous step:

```bash
[jaar@port-staff api]$ git stash pop
On branch http-integration-tests
Your branch is up to date with 'origin/http-integration-tests'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   src/main/java/co/org/osso/api/CalculatorController.java
        modified:   src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java

no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (599d46570d4af1869dc965e21c00c08d06670899)
```

We inspected what was pending:

```bash
[jaar@port-staff api]$ git diff
diff --git a/src/main/java/co/org/osso/api/CalculatorController.java b/src/main/java/co/org/osso/api/CalculatorController.java
index 6c53162..a2e2218 100644
--- a/src/main/java/co/org/osso/api/CalculatorController.java
+++ b/src/main/java/co/org/osso/api/CalculatorController.java
@@ -28,6 +28,7 @@ public class CalculatorController {
diff --git a/src/main/java/co/org/osso/api/CalculatorController.java b/src/main/java/co/org/osso/api/CalculatorController.java
index 6c53162..a2e2218 100644
--- a/src/main/java/co/org/osso/api/CalculatorController.java
+++ b/src/main/java/co/org/osso/api/CalculatorController.java
@@ -28,6 +28,7 @@ public class CalculatorController {
     }

     @GetMapping("/factorial/{number}")
+    // JSON that contains a biginteger
     public BigInteger getFactorial(@PathVariable("number") int number){
         return calculator.getFactorial(number);
     }
diff --git a/src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java b/src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java
index fa172d1..a0fdd36 100644
--- a/src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java
+++ b/src/test/java/co/org/osso/api/ApiApplicationCalculatorTests.java
@@ -1,16 +1,41 @@
 package co.org.osso.api;

+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.HttpResponse;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.util.EntityUtils;
```

And then we added:

```bash
[jaar@port-staff api]$ git add . ; git commit -m "Add HTTP verbs Integration test"; git push
[http-integration-tests c6fe812] Add HTTP verbs Integration test
 2 files changed, 84 insertions(+)
Enumerating objects: 31, done.
Counting objects: 100% (31/31), done.
Delta compression using up to 4 threads
Compressing objects: 100% (8/8), done.
Writing objects: 100% (17/17), 2.53 KiB | 863.00 KiB/s, done.
Total 17 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
To github.com:javarb/api.git
   3e3245d..c6fe812  http-integration-tests -> http-integration-tests
```

Fetch to sync local master with remote master and tree of remote braches locally:

```bash
[jaar@port-staff api]$ git fetch
remote: Enumerating objects: 2, done.
remote: Counting objects: 100% (2/2), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 2 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (2/2), done.
From github.com:javarb/api
   f77c479..37c4a2d  master     -> origin/master

[jaar@port-staff api]$ git branch -a
  api-basics
  api-calculator
  api-calculator-fix-bug
  bugsnag-integration
* http-integration-tests
  master
  remotes/origin/api-basics
  remotes/origin/api-calculator
  remotes/origin/api-calculator-fix-bug
  remotes/origin/bugsnag-integration
  remotes/origin/http-integration-tests
  remotes/origin/master
```

Also we added the flag `-p` (`prune`) to the `fetch` command in order to sync deleting, and so avoid to see locally remote branches that doesn't existed remotely:

```bash
[jaar@port-staff api]$ git fetch -p
From github.com:javarb/api
 - [deleted]         (none)     -> origin/api-basics

[jaar@port-staff api]$ git branch -a
  api-basics
  api-calculator
  api-calculator-fix-bug
  bugsnag-integration
* http-integration-tests
  master
  remotes/origin/api-calculator
  remotes/origin/api-calculator-fix-bug
  remotes/origin/bugsnag-integration
  remotes/origin/http-integration-tests
  remotes/origin/master
```

Now we added and pushed some content about an application specific bug fix to the corresponding branch:

```bash
[jaar@port-staff api]$ git checkout api-calculator-fix-bug
Switched to branch 'api-calculator-fix-bug'
Your branch is up to date with 'origin/api-calculator-fix-bug'.
```

And merge from remote master in order to integrate the last changes merged into master, into our current branch:

```bash
[jaar@port-staff api]$ git merge origin/master
Auto-merging src/main/java/co/org/osso/api/Calculator.java
CONFLICT (content): Merge conflict in src/main/java/co/org/osso/api/Calculator.java
Automatic merge failed; fix conflicts and then commit the result.
```

As Automatic merge cannot be done, some conflicts must be fixed manually:

```bash
[jaar@port-staff api]$ git status
On branch api-calculator-fix-bug
Your branch is up to date with 'origin/api-calculator-fix-bug'.
...
Changes to be committed:

        modified:   build.gradle
        new file:   src/main/java/co/org/osso/api/BugsnagConfig.java
        modified:   src/main/java/co/org/osso/api/CalculatorController.java

Unmerged paths:
  (use "git add <file>..." to mark resolution)

        both modified:   src/main/java/co/org/osso/api/Calculator.java
```

After the conflicts has been fixed, then we add, commit and push:

```bash
[jaar@port-staff api]$ git add . ; git commit;
[api-calculator-fix-bug 9607af3] Merge remote-tracking branch 'origin/master' into api-calculator-fix-bug

[jaar@port-staff api]$ git push
Enumerating objects: 28, done.
Counting objects: 100% (28/28), done.
Delta compression using up to 4 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (10/10), 776 bytes | 388.00 KiB/s, done.
Total 10 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
To github.com:javarb/api.git
   ed9586c..9607af3  api-calculator-fix-bug -> api-calculator-fix-bug
```

Finally that branch is [merged to master][10] and deleted.

The only branch that remain still is `http-integration-tests`.

### Resources

- [Git checkout -][5]
- [Git stash][6]
- [Merging vs Rebasing][7]
- [Kanban definition][9]
- [Domain Specific Languages books][8]

[1]: https://github.com/javarb/api/projects/1
[2]: https://github.com/javarb/calculator-frontend
[3]: https://github.com/javarb/calculator-frontend/pull/2
[4]: https://github.com/javarb/calculator-frontend/pull/3
[5]: http://marcgg.com/blog/2015/10/18/git-checkout-minus/
[6]: https://git-scm.com/docs/git-stash
[7]: https://www.atlassian.com/git/tutorials/merging-vs-rebasing
[8]: https://martinfowler.com/books/dsl.html
[9]: https://en.wikipedia.org/wiki/Kanban
[10]: https://github.com/javarb/api/pull/4

repository: kinbiko/mentoring

gha_language: Java

repo_name: kinbiko/mentoring


text:
---
id: meeting-minutes-20200610
title: 2020.6.10 Agenda
sidebar_label: 2020.6.10
---

## Logistics
### Day & Time
* Wednesday, June 10th. 11am ET

## Attendees
* Shaun Aston (GS)

### Roll Call

### Housekeeping
* Approve [6/3 Meeting minutes](https://github.com/finos/alloy/blob/master/meeting-minutes/commodities-ref-data-wg/2020.6.3-commod-wg-meeting.md)

## Agenda

### Agenda item #1
Review proposed CDM changes to support Fixed payments over multiple periods (Ted/ISDA)

### Agenda item #2
Review and agree updated WG roadmap items (All)

### AOB

### Action Items

repository: db-tillpau/alloy

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: db-tillpau/alloy


text:
# vue-class-component

> ECMAScript / TypeScript decorator for class-style Vue components.

[![npm](https://img.shields.io/npm/v/vue-class-component.svg)](https://www.npmjs.com/package/vue-class-component)

### Usage

**Required**: [ECMAScript stage 1 decorators](https://github.com/wycats/javascript-decorators/blob/master/README.md).
If you use Babel, [babel-plugin-transform-decorators-legacy](https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy) is needed.
If you use TypeScript, enable `--experimentalDecorators` flag.

> It does not support the stage 2 decorators yet since mainstream transpilers still transpile to the old decorators.

Note:

1. `methods` can be declared directly as class member methods.

2. Computed properties can be declared as class property accessors.

3. Initial `data` can be declared as class properties ([babel-plugin-transform-class-properties](https://babeljs.io/docs/plugins/transform-class-properties/) is required if you use Babel).

4. `data`, `render` and all Vue lifecycle hooks can be directly declared as class member methods as well, but you cannot invoke them on the instance itself. When declaring custom methods, you should avoid these reserved names.

5. For all other options, pass them to the decorator function.

### Example

Following is the example written in Babel. If you are looking for TypeScript version, [it's in the example directory](example/App.vue).

``` vue
<template>
  <div>
    <input v-model="msg">
    <p>prop: {{propMessage}}</p>
    <p>msg: {{msg}}</p>
    <p>helloMsg: {{helloMsg}}</p>
    <p>computed msg: {{computedMsg}}</p>
    <button @click="greet">Greet</button>
  </div>
</template>

<script>
import Vue from 'vue'
import Component from 'vue-class-component'

@Component({
  props: {
    propMessage: String
  }
})
export default class App extends Vue {
  // initial data
  msg = 123

  // use prop values for initial data
  helloMsg = 'Hello, ' + this.propMessage

  // lifecycle hook
  mounted () {
    this.greet()
  }

  // computed
  get computedMsg () {
    return 'computed ' + this.msg
  }

  // method
  greet () {
    alert('greeting: ' + this.msg)
  }
}
</script>
```

You may also want to check out the `@prop` and `@watch` decorators provided by [vue-property-decorators](https://github.com/kaorun343/vue-property-decorator).

### Using Mixins

vue-class-component provides `mixins` helper function to use [mixins](https://vuejs.org/v2/guide/mixins.html) in class style manner. By using `mixins` helper, TypeScript can infer mixin types and inherit them on the component type.

Example of declaring a mixin:

``` js
// mixin.js
import Vue from 'vue'
import Component from 'vue-class-component'

// You can declare a mixin as the same style as components.
@Component
export class MyMixin extends Vue {
  mixinValue = 'Hello'
}
```

Example of using a mixin:

``` js
import Component, { mixins } from 'vue-class-component'
import MyMixin from './mixin.js'

// Use `mixins` helper function instead of `Vue`.
// `mixins` can receive any number of arguments.
@Component
export class MyComp extends mixins(MyMixin) {
  created () {
    console.log(this.mixinValue) // -> Hello
  }
}
```

### Create Custom Decorators

You can extend the functionality of this library by creating your own decorators. vue-class-component provides `createDecorator` helper to create custom decorators. `createDecorator` expects a callback function as the 1st argument and the callback will receive following arguments:

- `options`: Vue component options object. Changes for this object will affect the provided component.
- `key`: The property or method key that the decorator is applied.
- `parameterIndex`: The index of a decorated argument if the custom decorator is used for an argument.

Example of creating `NoCache` decorator:

``` js
// decorators.js
import { createDecorator } from 'vue-class-component'

export const NoCache = createDecorator((options, key) => {
  // component options should be passed to the callback
  // and update for the options object affect the component
  options.computed[key].cache = false
})
```

``` js
import { NoCache } from './decorators'

@Component
class MyComp extends Vue {
  // the computed property will not be cached
  @NoCache
  get random () {
    return Math.random()
  }
}
```

### Adding Custom Hooks

If you use some Vue plugins like Vue Router, you may want class components to resolve hooks that they provides. For that case, `Component.registerHooks` allows you to register such hooks:

```js
// class-component-hooks.js
import Component from 'vue-class-component'

// Register the router hooks with their names
Component.registerHooks([
  'beforeRouteEnter',
  'beforeRouteLeave',
  'beforeRouteUpdate' // for vue-router 2.2+
])
```

```js
// MyComp.js
import Vue from 'vue'
import Component from 'vue-class-component'

@Component
class MyComp extends Vue {
  // The class component now treats beforeRouteEnter
  // and beforeRouteLeave as Vue Router hooks
  beforeRouteEnter () {
    console.log('beforeRouteEnter')
  }

  beforeRouteLeave () {
    console.log('beforeRouteLeave')
  }
}
```

Note that you have to register the hooks before component definition.

```js
// main.js

// Make sure to register before importing any components
import './class-component-hooks'

import Vue from 'vue'
import MyComp from './MyComp'

new Vue({
  el: '#app',
  components: {
    MyComp
  }
})
```

### Caveats of Class Properties

vue-class-component collects class properties as Vue instance data by instantiating the original constructor under the hood. While we can define instance data like native class manner, we sometimes need to know how it works.

#### `this` value in property

If you define an arrow function as a class property and access `this` in it, it will not work. This is because `this` is just a proxy object to Vue instance when initializing class properties:

```js
@Component
class MyComp extends Vue {
  foo = 123

  bar = () => {
    // Does not update the expected property.
    // `this` value is not a Vue instance in fact.
    this.foo = 456
  }
}
```

You can simply define a method instead of a class property in that case because Vue will bind the instance automatically:

```js
@Component
class MyComp extends Vue {
  foo = 123

  bar () {
    // Correctly update the expected property.
    this.foo = 456
  }
}
```

#### `undefined` will not be reactive

To take consistency between the decorator behavior of Babel and TypeScript, vue-class-component does not make a property reactive if it has `undefined` as initial value. You should use `null` as initial value or use `data` hook to initialize `undefined` property instead.

```js
@Component
class MyComp extends Vue {
  // Will not be reactive
  foo = undefined

  // Will be reactive
  bar = null

  data () {
    return {
      // Will be reactive
      baz: undefined
    }
  }
}
```

### Build the Example

``` bash
$ npm install && npm run example
```

### Questions

For questions and support please use the [the official forum](http://forum.vuejs.org) or [community chat](https://chat.vuejs.org/). The issue list of this repo is **exclusively** for bug reports and feature requests.

### License

[MIT](http://opensource.org/licenses/MIT)

license: MIT

gha_language: JavaScript


text:
###### tags: `Crawler ReadMe Ref.`

## How to run ACE with **Source Code**

Run ACE through IntelliJ IDEA:
1. Install Java JDK, Intellij, Maven (can be installed by Intellij), graphviz, and adb.
2. Download or clone ACE source code into the directory `ACE`.
3. Open Intellij and import the project under the `ACE` directory.
    - Click 'Import Project', 'OK', and 'Maven'; use default value for the rest of the settings.
5. Please follow the [step 4](https://hackmd.io/MiyfbKDNTTuOqdE0oLOqkQ) of "How to run ACE with Executable jar" to set the ACE configurations.
6. Execute 'main.java' to start ACE.

url: https://raw.githubusercontent.com/Thunder7Lightening/tmp/992a12ab2f4efb422636779fd045990fce2ea27d/ReadMe Reference/How to run ACE with Source Code.md

filename: How to run ACE with Source Code.md


text:
# MariaDB Galera Docker Container

This is default mariadb docker container configured into galera mode.

## Settings
Set `BOOTSTRAP=on` for the node which bootstraps the cluster.

## Problems
This has slight problem that when the bootstrap node wasn't last man standing other nodes won't join without manually interference:

```
WSREP: gcs/src/gcs_group.cpp:group_post_state_exchange():321: Reversing history: 6987 -> 6986, this member has applied 1 more events than the primary component.Data loss is possible. Aborting.
```

Maybe the galera state could be stored elsewhere so that last man standing could always bootstrap the cluster after cluster failure.

## Building
```
$ docker build -t onnimonni/mariadb-galera .
```

## Running
```
$ docker run --name some-mariadb -e MYSQL_ROOT_PASSWORD=my-secret-pw -d onnimonni/mariadb-galera
```

## Debugging
```
$ docker exec -it some-mariadb bash
$ root@1698dcb92c7b mysql --password=$MYSQL_ROOT_PASSWORD
```

## LICENSE
MIT

repository: devgeniem/docker-mariadb-galera

repo_name: devgeniem/docker-mariadb-galera


text:
# Manage authentication

[auth0](https://auth0.com) provides authentication for all hubs here. It can
be configured with many different [connections](https://auth0.com/docs/identityproviders)
that users can authenticate with - such as Google, GitHub, etc.

So we want to manage authentication by:

1. Explicitly listing the type of connection we want for this hub, via
   `auth0.connection`. Currently common ones are `google-oauth2` for Google &
   `github` for GitHub. *Users* of the hub will use this method to log in to
   the hub.

   You can set the auth0 connector for a hub with:

   ```yaml
   auth0:
      connection: google-oauth2
   ```

   Theoretically, every provider in [this list](https://auth0.com/docs/connections/identity-providers-social)
   is supported. However, we've currently only tested this with Google
   (`google-oauth2`) and GitHub (`github`)

2. Explicitly list *admin users* for a given hub. These admin users will be the
   only ones allowed to log in to begin with. They can use the JupyterHub
   admin interface (available from their hub control panel) to explicitly allow
   more users into the hub. This way, we don't need to be involved in explicitly
   allowing users into hubs.

   In the admin interface, admin users can add users via a username appropriate
   for the auth connector used. For GitHub, it's the username. For Google Auth,
   it's the email address.

   You can set the admin interfaces for a hub like this:

   ```yaml
   config:
     jupyterhub:
       auth:
         # will be renamed allowedlist in future JupyterHub
         whitelist:
           users:
             # WARNING: THESE USER LISTS MUST MATCH (for now)
             -<EMAIL_ADDRESS>             -<EMAIL_ADDRESS>         admin:
           users:
             # WARNING: THESE USER LISTS MUST MATCH (for now)
             -<EMAIL_ADDRESS>             -<EMAIL_ADDRESS>   ```

```{admonition} Switching auth
Switching authentication for a pre-existing hub will simply create new usernames. Any pre-existing users will no longer be able to access their accounts (although administrators will be able to do so). If you have pre-existing users and want to switch the hub authentication, rename the users to the new auth pattern (e.g. convert github handles to emails).
```

repository: balajialg/pilot-hubs

repo_name: balajialg/pilot-hubs


text:
# Changelog

UniWindowController (UniWinC)
https://github.com/kirurobo/UniWindowController

<!---
How to write the changelog.
https://keepachangelog.com/ja/1.0.0/
--->

## [v0.8.0] - 2020-12-27
### Added
- Fullscreen demo.
- Set to bottommost. (Experimental)

## [v0.7.0] - 2020-12-07
### Added
- Support Unity Package Manager.

### Changed
- Restructured folders.

## [v0.6.0] - 2020-12-06
### Added
- Files dropping for Mac and Windows.
- Prepare fit to monitor property.

### Changed
- macOS 10.12 and below is no longer supported.
- "Maximized" keyword was renamed to "Zoomed".

repository: Avatarchik/UniWindowController

repo_name: Avatarchik/UniWindowController


text:
Aiuto [![Gem Version](https://badge.fury.io/rb/aiuto.svg)](https://badge.fury.io/rb/aiuto)
==================================

Aiuto means "help" in Italian. This is a gem to help you to search Ruby helpers on Google by filtering on specific websites.

Install the gem with:

```
gem install aiuto
```

Then try it with:

```
aiuto Ruby is awesome
```

YEAH! Google is open and there are only Ruby blogs, forums and similia. No pages about stones and jewels!

## Which websites do you use for filtering?

This is the list of websites used in the gem.
However by default only the websites under "blog", "git", "docs" and "social" are used by default.

```ruby
{
  blog: ["rubyflow.com", "medium.com", "rubylearning.com",
    "rubyinside.com", "yehudakatz.com", "sitepoint.com/ruby",
    "afreshcup.com", "rubyguides.com", "justinweiss.com",
    "sandimetz.com", "guides.railsgirls.com"],
  git:  ["github.com", "gitlab.com"],
  docs: ["ruby-doc.org", "devdocs.io/ruby", "rubydoc.info",
    "guides.rubyonrails.org"],
  social: ["stackoverflow.com/questions/tagged/ruby",
    "ruby-forum.com", "reddit.com/r/ruby", "reddit.com/r/rails"],
  utility: ["ruby.libhunt.com"],
  rails: ["opensourcerails.com", "guides.rubyonrails.org",
    "reddit.com/r/rails",
    "stackoverflow.com/questions/tagged/ruby-on-rails"],
  beginner: ["eloquentruby.com",
    "pragprog.com/book/ruby4/programming-ruby-1-9-2-0",
    "ruby.learncodethehardway.org/book",
    "http://mislav.uniqpath.com/poignant-guide/",
    "https://www.manning.com/books/rails-4-in-action",
    "railstutorial.org/book"],
  advanced: ["patshaughnessy.net", "confidentruby.com",
    "pragprog.com/book/ager/exceptional-ruby", "rubyfu.net"]
}
```

If you want to use different filters you can use "-f" followed by the filter you want to use.
Like this:

```
aiuto Rails is awesome -f rails beginner
```

In this case we filter by using the websites in the group "rails" and "beginner".

## Do you have other commands like "-f" ?

Yes! I provide ```-no``` to remove all the filters, and ```-r``` to remove the word "ruby" from the search.

Futher I add ```aiuto --help``` for helps on the terminal and ```aiuto --list``` for returning the above list.

## Hey! I want to use DuckDuckGo or other filters

Please create issue or do some pull requests for any idea you have.
I am more than welcome to improve this gem with your help. :smile:

repository: StefanoMartin/Aiuto

repo_name: StefanoMartin/Aiuto


text:
# A Gulp Configuration Demo
> gulp basic configuration

## Usage
```bash
git clone
npm install
```

### For production
For production, we got uglify, env here.
Enjoy coding!!!
```bash
npm build
```

### For local development
For local development, we got local server, lint here

```bash
npm start
```

repository: horrylala/gulp-configuration

repo_name: horrylala/gulp-configuration


text:
# Lecanora actaea Nyl. SPECIES

#### Status
SYNONYM

#### According to
Index Fungorum

#### Published in
Flora, Jena 56: 290 (1873)

#### Original name
Lecanora actaea Nyl.

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Ramalinaceae/Lecania/Lecania actaea/ Syn. Lecanora actaea/README.md

repo_name: mdoering/backbone


text:
---
author: Arun Manivannan
date: '2007-03-14 01:27:49'
layout: post
comments: true
slug: adobe-flex-and-java
status: publish
title: Adobe Flex and Java
wordpress_id: '163'
? ''
: - adobe flex
  - java
  - Uncategorized
---

Adobe Flex is out and is already making ripples across the RIA world.
Recently, the book [Adobe Flex & Java][1] is also ready and is already
available online. Will grab a copy of the book and will let you know how it
is.

As of now, I am using [Adobe Flex 2 : Training from the Source][2]. Lots of
impressive code samples.

Also see : [Is Adobe Flex really the future of the Web?][3]

   [1]: http://websphere.sys-con.com/read/344360.htm

   [2]: http://www.adobe.com/devnet/flex/articles/tfs_excerpts.html

   [3]: http://www.arunma.com/2007/03/22/is-adobe-flex-really-the-future-of-
the-web/

repository: arunma/blog

extension: markdown

repo_name: arunma/blog


text:
# Universal Chess Interface

Small wrapper for interacting with uci compliant chess engines.
[Godoc](https://godoc.org/github.com/dolegi/uci)

# Usage
Import library
```go
import "github.com/dolegi/uci"
```
Create a new engine
```go
eng, _ := uci.NewEngine("path-to-engine")
```
Set options
```go
eng.SetOption("Ponder", false)
eng.SetOption("Threads", "2")
```
Check if ready
```go
eng.IsReady()
```
Create a new game, use full algorithmic positioning and assign white
```go
eng.NewGame(uci.NewGameOpts{uci.ALG, uci.W})
```
Set the moves after start position
```go
eng.Position("e2e4")
```
Find best move
```go
resp := eng.Go(uci.GoOpts{MoveTime: 100})
fmt.Println(resp.Bestmove)
```

See example folder for a working example. Run with `go run example/main.go <path-to-uci-engine>`

# Missing features
- [ ] go infinite + stop
- [ ] ponderhit
- [ ] debug mode
- [ ] register

# References
- [UCI reference documention](https://www.shredderchess.com/chess-info/features/uci-universal-chess-interface.html)
- [Stockfish](https://github.com/official-stockfish/Stockfish)

repository: dolegi/uci

gha_language: Go

gha_license_id: MIT

repo_name: dolegi/uci


text:
# Configure BookInfo Application, Channels, Subscriptions, and Placement Rules in OCM

## Finish this readme

run `kubectl apply -k .` in this directory from your terminal.

# Expected Result
1. Deployable at `payload.yaml` will be:

- should NOT be promoted to channel `cm-delivery-ch`, which has a annotation
  promotion gate `dev: pass`. In other words, there sholdn't be a duplicate
  deployable at `delivery` namespace

- should be promoted to channel `ns`, which doesn't have any promotion gate.
  Therefore in ch-ns namespace there should be a duplicate deployable of this
  one

2. A subscription will be created at spoke cluster(which is marked as production)
3. Within the subsription's namespace, there should be configmap, which is a
   child of the Deployable at step-1

gha_language: Shell


text:
# Represent Postcodes

[Represent](https://represent.opennorth.ca/) is the open database of Canadian elected officials and electoral districts. It provides a [REST API](https://represent.opennorth.ca/api/) to boundary, representative, and postcode resources.

This repository provides an API to postal codes. API documentation is available at [represent.opennorth.ca/api/](https://represent.opennorth.ca/api/#postcode).

The [represent-canada](https://github.com/opennorth/represent-canada) repository provides a master Django project, and points to packages which add boundary, representative, and map features.

## Adding data

Load postal code centroids with:

    python manage.py loadpostcodes

Load postal code concordances with:

    python manage.py loadpostcodeconcordance --help

## Bugs? Questions?

Please submit bug reports, feature requests, and feedback to [represent-canada](https://github.com/opennorth/represent-canada).

Released under the MIT license

repository: opennorth/represent-postcodes

repo_name: opennorth/represent-postcodes


text:
# 3DStorytellling

## Build steps
1. Make sure to have *bower*
    * Use your favorite package manager or grab *npm* from [here][2]
    * Use *npm* to install *bower*: ```npm install -g bower```
2. Install dependencies: ```bower install```
3. Adjust the fields in buildcfg/root.
    * *ROOT* is where the project will be deployed
    * *ROLE* is the URL of the ROLE SDK
    * *LAS* is the las2peer node with the CAE backend behind it (no trailing /)
    * *Y* should be the URL of the same Yjs websocket connector, which SyncMeta uses (no trailing /)
4. Run ./deploy.sh
   The exported widgets will be located under html/


text:
# Outdoor-Lighting-Controller

## Description

This is the hardware (PCB) and the software (ESPHome configuration) for a Home Assistant-based motion-lights controller. ESPHome is used to interface with Home Assistant, which is responsible for controlling the lights and motion alerts, etc.

## Instructions

1. Download the board files from GitHub Release.
2. Order the needed parts ([parts list below](#parts-list)).
    1. I used [JLCPCB](jlcpcb.com) for the PCB; it cost me $2 (+ shipping) for 5 boards.
3. Assemble all parts on the PCB.
4. [Install ESPHome](https://esphome.io/guides/getting_started_command_line.html#getting-started-with-esphome).
5. Create the secrets file from the template.
6. Connect the ESP-01 to the programming adapter.
7. Run `esphome lights.yaml compile` to compile the firmware.
8. Run `esphome lights.yaml upload` to upload the newly-compiled firmware.
9. Place the ESP-01 in the PCB, paying attention to the direction of where it points

## Parts List

-   1x Custom designed Circuit Board
-   1x 8 channel Relay Board (any generic one will work as long as it supports the needed power for your lights)
-   1x MCP23017 I2C IO Expander (**IC1**)
-   1x ESP-01 module with programmer (**U1**)
-   1x [D24V10F3 Voltage Regulator](https://www.pololu.com/product/2830) (powers ESP-01) (**VR1**)
-   1x [D24V10F5 Voltage Regulator](https://www.pololu.com/product/2831) (powers the motion sensors and MCP23017) (**VR2**)
-   _up to_ 8x PIR motion sensor
-   _up to_ 8x lights and a way to power them
    -   I used 12 Volt DC LED lights and a 120VAC --> 12VDC power supply
-   jumper wires to connect the Relay Board to the PCB (either individual wires or a 1x10 cable works)
-   2x 1x10 male header (**RELAYS and J1**)
-   1x 2x4 female header (alternatively, 2 rows of 1x4 would work too) (**socket for ESP-01**)
-   1x 2-pin 3.5mm screw terminal blocks (**J2**)
-   1x 10-pin 2.54mm (0.1 in) screw terminal blocks (**PIRS**)
-   1x SPDT on/off switch (**S1**)
-   1x 10K ohm resistor (**R1**)
-   _optional_: 1x LED (**D1**) and 1x 330 ohm resistor (**R2**)
-   1x 5K ohm resistor (I used a 5.2K ohm resistor I had lying around) (**R3**)
-   1x safe casing that prevents access to 120VAC power
-   1x server running Home Assistant for automating the lights in reaction to the motion sensors

## Notes

-   If ESPHome is not working properly (either not installing or not compiling), you can upload the binary in the GitHub Release using another uploading tool, such as `esptool`.
-   I tested this with ESPHome v1.15.3.

## [Schematics](assets/Schematic.pdf)

## Credits

-   [ESPHome](esphome.io)
-   [Home Assistant](home-assistant.io)
-   [Sparkfun's EAGLE libraries](https://github.com/sparkfun/SparkFun-Eagle-Libraries)

repository: SConaway/Outdoor-Lighting-Controller

repo_name: SConaway/Outdoor-Lighting-Controller


text:
## FlowAnalyzer

Initial brushstrokes for analyzing sources to sinks flow.
Given code, source, sink

1. Using `esprima` we generate the Abstract Syntax Tree (AST) for the given JavaScript code

### The flow logic for assignments:

1. When a variable declaration or assignment is encountered, we check whether the RHS is in the given list of 'Sources' and update '_taggedNames' with it.
2. If its not we check whether the RHS is in the list of already existing '_taggedNames' and update the references accordingly.
3. Finally, when a sink is encountered on the LHS, we check whether the RHS is in the list of 'Sources' or a value in '_taggedNames'.

### The flow logic for function calls:

1. When a variable declaration or assignment is encountered, we check whether the RHS is in the given list of 'Sources' and update '_taggedNames' with it.
2. If its not we check whether the RHS is in the list of already existing '_taggedNames' and update the references accordingly.
3. Finally, when a sink is encountered as a function call, we check whether one of the arguments or the callee name itself is in the list of 'Sources' or a value in '_taggedNames'.

repository: skepticfx/esflow

repo_name: skepticfx/esflow


text:
# XrmPowerControls.XrmMetadataAutoComplete
PCF control for metadata autocomplete in D365, Dataverse(CDS) Environments

This control can be used to provide autocomplete functionality for CRM metadata and store them in text fields.

### Usage

![alt text](https://github.com/sabrish/XrmPowerControls.XrmMetadataAutoComplete/blob/master/XrmPowerControls.XrmMetadataAutoComplete.gif?raw=true)

Parameters used in the control are:
* **AutoCompleteMetaDataType**: This is of type Enum. The suppored values are
  * _Entity_
  * _Attributes_
  * _Lookup_
  * _SystemViews_ - Will have [ViewName]-{CRMID}-[View GUID] format to cope with views with same name
  * _BusinessProcessFlows_
* **Filter Entity Field By Entities Associated To**: Only applies if the AutoCompleteMetaDataType is set to Entity. It will filter entity field auto complete list By entities associated to entity entered in this property.
* **Related Entity**: Only applies if the AutoCompleteMetaDataType is set to anything other than Entity. It will filter the autocomplete list to contain only metatadata values related to this entity.

__Note and Thanks__
* to the PCF Autocompelte project by Sriram Balaji - https://github.com/srirambalajigit as I used his project https://github.com/srirambalajigit/PCFControls/tree/master/Autocomplete/Autocomplete as a reference when building my first PCF control.
* to my colleague Durgaprasad Katarti - https://github.com/durgaprasadkatari for updating it to use FluentUI

gha_language: TypeScript


text:
---
published: true
title: Unstripping Stripped Binaries
tags: reverse debug binary
---
> What I really want is to take the names and types I’ve figured out from my disassembler, and make them visible to gdb. - [a simple solution to this](http://lock.cmpxchg8b.com/symbols.html) / [HN](https://news.ycombinator.com/item?id=32603382)

see also
- [decomp2dbg](https://github.com/mahaloz/decomp2dbg) - a generic API for decompiler-to-debugger symbol syncing.
- [Ghidra2Dwarf](https://github.com/cesena/ghidra2dwarf) - a ghidra plugin that allows to exports informations (such as functions, decompiled code, types) from ghidra to dwarf sections inside ELF binaries.


text:
# UNISURF: Unifying Neural Implicit Surfaces and Radiance Fields for Multi-View Reconstruction
## Project Page | [Paper](http://www.cvlibs.net/publications/Oechsle2021ICCV.pdf) | [Supplementary](http://www.cvlibs.net/publications/Oechsle2021ICCV_supplementary.pdf) | [Video](https://www.youtube.com/watch?v=WXUfHvZge0E)

Neural implicit 3D representations have emerged as a powerful paradigm for reconstructing surfaces from multi-view images and synthesizing novel views. Unfortunately, existing methods such as DVR or IDR require accurate per-pixel object masks as supervision. At the same time, neural radiance fields have revolutionized novel view synthesis. However, NeRF's estimated volume density does not admit accurate surface reconstruction. Our key insight is that implicit surface models and radiance fields can be formulated in a unified way, enabling both surface and volume rendering using the same model. This unified perspective enables novel, more efficient sampling procedures and the ability to reconstruct accurate surfaces without input masks. We compare our method on the DTU, BlendedMVS, and a synthetic indoor dataset. Our experiments demonstrate that we outperform NeRF in terms of reconstruction quality while performing on par with IDR without requiring masks.

If you find our code or paper useful, please cite as

    @INPROCEEDINGS{Oechsle2021ICCV,
      author = {Michael Oechsle and Songyou Peng and Andreas Geiger},
      title = {UNISURF: Unifying Neural Implicit Surfaces and Radiance Fields for Multi-View Reconstruction},
      booktitle = {International Conference on Computer Vision (ICCV)},
      year = {2021}
    }

## Installation

First you have to make sure that you have all dependencies in place.
The simplest way to do so, is to use [anaconda](https://www.anaconda.com/).

You can create an anaconda environment called `unisurf` using
```
conda env create -f environment.yaml
conda activate unisurf
```
Next, compile the extension modules.
You can do this via
```
python setup.py build_ext --inplace
```

## TODOs

branch_name: refs/heads/main


text:
# HotFolderUpload

This PowerShell script allows you to upload files from a folder to Aprimo DAM. The script can be executed manually or you could use a service such as the Windows Task Scheduler. This script is not executed in the Azure environment but runs on a local server.

For the upload, the script will use the MO REST API (for authentication) and the Aprimo DAM REST API.

Transfers occur over HTTP and will be limited by the upload bandwidth you have available. If you have concerns about ingesting large sets (>10GB) of assets, please contact your Aprimo representative to discuss ingestion options.

repository: shobharaniT/HotFolderUpload

repo_name: shobharaniT/HotFolderUpload


text:
## Project: Build a Traffic Sign Recognition Program
Goal

•	Build deep convolution neuron network to classify traffic sign images

•	Achieve test accuracy larger than 0.93

Dataset Exploration
---
This project includes three datasets: training, validation, and testing datasets, and the size of each dataset is shown in the table.
Training	Validation	Testing
34799	4410	12630
For each single RBG image, the size is 32 pixels by 32 pixels.  Three sample images are shown below;

![](examples/s1.PNG)
![](examples/s2.PNG)
![](examples/s3.PNG)
![](examples/s4.PNG)
The total category number of traffic sign images is 43, the distribution of each traffic sign category for training dataset is shown below:

![](examples/train.PNG)
Data Preprocessing
Several data preprocessing methods are employed before the training process.
	Normalize traffic sign images.  For each image, divide each pixel value by 255, to make pixel values are in the range [0, 1]
	Subtract the mean for each image, to make sure the images have zero mean
	Convert the RGB images to grayscale images based on the following equation:
(R+G+B)/3
Data Augmentation
From the training data category distribution plot, different categories have large unbalanced data size.  So, data augmentation is employed to balance the data set and more data set will also make the training model more robust.
	Translation to the left, shift images to the left top corner with range [1, 8] pixel numbers for both x and y direction
	Translation to the right, shift images to the right bottom corner with range [1, 8] pixel numbers for both x and y direction
	Image tilt, tilt range is [-10, 10] degree
Each image randomly chooses one of transforms from the above three options and save the original and augmented data.  Each category should have at least 800 images.  The new training data and label information is saved as pickle file.  The new distribution plot of training dataset is shown below:

![](examples/train_aug.PNG)
Model Architecture
Two model architectures are used during the training process.

  The output top 5 softmax probabilities for each image are shown below:
Top 5 predictions for each image:

Speed limit (60 km/h)	Right-of-way at the next intersection	General caution	Speed limit (30 km/h)	Road work

3	11	18	1	25

5	30	26	0	22

16	28	25	2	29

33	37	27	4	11

15	27	11	5	20
Corresponding probability for top 5 predictions for each image

Speed limit (60 km/h)	Right-of-way at the next intersection	General caution	Speed limit (30 km/h)	Road work

1.00000000e+00	1.00000000e+00	1.00000000e+00	1.00000000e+00	1.00000000e+00

7.22670469e-15	5.23105472e-16	7.04281078e-11	9.17219981e-11	1.34532814e-16

4.62976575e-20	1.58270256e-21	3.17348822e-14	6.18408802e-15	4.51197136e-20

4.94732605e-21	3.70903307e-24	1.79705595e-14	2.64603934e-16	3.33177042e-20

4.30839042e-21	8.41800328e-27	1.47142858e-16	1.22935831e-17	1.70197468e-20


text:
# Poll Maubot
A plugin for [maubot](https://github.com/maubot/maubot) that creates a poll in a riot room and allows users to vote

## Usage
'!poll new  "Question" "Choice1" "Choice2" "Choice3"' - Creates a new poll with given (at least 1) choices

'!poll vote choice' - Has user vote for given choice (int). Users can only vote once per poll

'!poll results' - Displays the results from the poll

'!poll close' - Ends the poll

## Wish List
- Add user configuration to only allow certain users to create polls
- Add auto-timing ability
- Add ability to run multiple polls at once

repository: bertiebaggio/PollMaubot

repo_name: bertiebaggio/PollMaubot


text:
# bbcolor

Simple module to provide color output in a terminal for python scripts. All
other tools seemed to roll their own, so I thought I'd make it a little more
formal.

## Synopsys

```python
import bbcolor
bbc = bbcolor.bbcolor()
bbc.set_fd(160)
bbc.set_bg(50)
bbc.set_style('bold')
bbc.pr('Hello, World!')
```

For more detailed information, see the docstrings/inline-python help

## Features/Notes

- **IMPORTANT** -- This module *assumes* 256-color-capable terminal, if
  connected to one at all. It does no **TERM**/termcap checking to ensure the
  terminal supports this.
- Simple, quick color output control via a minimal API
- Caching of the more complex parsing/ANSI-escapes
- Easy enable/disable via the *use_color()* method
- Checks if *stdout* is a tty for whether to use color


text:
# Kinetikeys Chorder

Kinetikeys Chorder (aka Kinetikeys-Concept1) is a wearable, wireless, mechanical chording keyboard with one main goal in mind:

**Allow You To Type While Walking**

![](readme/KinetikeysChorder.jpg)

# Work-in-Progress!
I'll be updating the repo in the upcoming days with more detailed information. If you're reading this, it's quite likely that you're coming from the [Reddit thread](https://www.reddit.com/r/MechanicalKeyboards/comments/j3jyt3/type_while_walking_are_you_thinking_about_this_too/).

I uploaded the STL files for the left hand. You can already 3D print and use them as-is.

### Parts / Materials
* 3D Printer (or access to one)
* 2 x [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062) microcontrollers
* 2 x [LiPoly 3.7v 350mAh](https://www.adafruit.com/product/2750) batteries
* 10 x [Kailh Choc Low-Profile](https://novelkeys.xyz/collections/switches/products/kailh-low-profile-switches?variant=3747939680296) switches
* 16 x [M2.5 screws](https://www.amazon.com/HVAZI-Metric-Stainless-Socket-Assortment/dp/B07F14J7X8)
* [Thin wire](https://www.amazon.com/StrivedayTM-Flexible-Silicone-electronic-electrics/dp/B01KQ2JNLI) to connect the switches to the microcontroller
* [Grip adhesive tape](https://www.amazon.com/Meister-StickElite-Professional-Porous-Athletic/dp/B06W9M7J2P)
* Optional: [Terminal Block Kit](https://www.adafruit.com/product/3173) for Feather
* Optional: 5-wire block connector (for all ground wires)

### Build Guide
1. Print all the STL files using regular PLA
![](readme/build1parts.jpg)

2. Solder the terminal block to the microcontroller. If you have a different preference on how to connect the wires to your microcontroller (e.g dupont connectors), go ahead and use that. Ideally don't solder the wires directly to the board. This would allow you to:
   * Reuse the board later on
   * solder the wires to the switches far enough from the PLA

![](readme/build2terminalblock.jpg)

3. Connect the battery to the microcontroller. Place it nicely under the controller and use screws to connect the microcontroller to the Main Body

![](readme/build3battery.jpg)

4. Prepare all the 5 switches by attaching 2 wires to each one. In my example, the black wires go directly to the microcontroller pins, and the yellow wires all connect together to ground. I always start with wires a little longer than necessary and trim them before the final connection

![](readme/build4switches.jpg)

5. Insert all the switches to their designated sockets in the Main Body

![](readme/build5wiring.jpg)

6. For each switch, attach the black wire to the microcontroller and the other one to the joint ground. You could also wire the ground by pasing a single wire from one switch to the other, and then attach the final one to the ground pin, but that would require you to solder very close to the PLA.
   * Solder all 5 ground wires together, or use a 5-wire block connector
   * Connect a single wire from all joined ground wires, to the GND pin on the microcontroller
   * I used pins A0-A4 for the left hand, and pins 9-13 for the right hand. For each hand respectively, these are the pins farther from the switches, giving more wiggle room with the wires

![](readme/build6wiring.jpg)

7. Attach the keycaps to the switches
8. Use two M2.5 screws to attach the Hand Rest to the Main Body

![](readme/build7keycaps.jpg)

9. Put the Hand Strap in water of about 160 degrees F or 70 degrees C for a few seconds until it softens and quickly pull it out of the water and mold around you hand (just the 4 fingers in front of the thumb). It should be snuggly and comfotable, with a firm, yet not tight grip.
10. Attach the Hand Strap to the Hand Rest using 2 screws, washers and flush nuts

11. Attach the Cover (note: I need to redesign the way it connects to the main body. In the meanwhile, use some additional adhesive tape to secure it to place.
12. Wrap the hand-strap in adhesive tape so that it feels nicer and more secure on your hand
13. Flash the firmware (It's an Arduino-compatible [PlatformIO](https://platformio.org/) project.

Alright! You're ready to go! Customize the keymap to your liking (right now it's just a dummy a-z mapping for testing). I'll add mine in the upcoming days.

# Previous Work
Check out my previous attempt at a wearable keyboard: [Kinetikeys-Concept0](https://github.com/liorgonnen/kinetikeys-concept0).

repository: liorgonnen/kinetikeys-chorder

repo_name: liorgonnen/kinetikeys-chorder


text:
---
layout: default
title: "FOSDEM <3 Ruby"
subtitle: "The #1 Ruby language devroom at FOSDEM"
---

### [Call for proposals now open!](/cfp.html)

The Ruby devroom at [FOSDEM](http://fosdem.org) is a focused developer room
around the Ruby programming language and the open source projects which
implement it. While the Ruby community does have a number of regional
conferences devoted to its use, opportunities for those interested in the "how
it works" of Ruby interpreters and virtual machines are practically
non-existent. The goal of this developer room is to discuss:

* The current state of the Ruby language
* Techniques employed by various VMs and their effectiveness
* Upcoming Ruby language features, and the challenges/benefits that they provide
* Tools and practices used to certify Ruby language conformity and performance
* Costs and Opportunities provided by the multitude of implementations

### Involved projects

* [JRuby](http://jruby.org)
* [Ruby (MRI)](https://www.ruby-lang.org/)
* [RubyTruffle](http://www.chrisseaton.com/rubytruffle/)
* [Rubinius (Ruby on Ruby)](http://rubini.us/)

## Why we're here

While many Ruby developers attend FOSDEM, the Ruby open source community has
generally been underrepresented in the technical content of the event. With the
Ruby devroom not only would the Ruby community become more plugged into the
FOSDEM experience, but FOSDEM would be hosting Ruby-oriented content that is
both unique and very technical. Considering the broad interest in dynamic and
interpreted languages, the Ruby devroom will also provide compelling technical
content interesting to members of the Python, Perl, JavaScript, Smalltalk, LLVM
and Java communities. There is quite some interest in the topic, as the
overcrowded Java dev room if  [Charles Oliver
Nutter's](https://github.com/headius) talk on JRuby in the FOSDEM 2014 Free
Java devroom is any indication.

Considering the number of notable Ruby implementations, listed below, there
should be more than enough highly interesting and technical content!

* Ruby (MRI, the original C-based VM)
* JRuby (Ruby on the JVM)
* Rubinius (Ruby on Ruby)
* Topaz (Ruby on RPython, the toolkit that PyPy built)
* RubyTruffle (JRuby using Oracle's Truffle compiler)
* RubyMotion (Ruby on top of Apple's Objective-C/Cocoa foundation)
* Maglev (Ruby on the GemStone Smalltalk VM)
* Opal (A working Ruby to JavaScript transpiler)
* mruby (lightweight, embedded Ruby)

## When and Where

The Ruby devroom takes place on Saturday, the 4th February 2017, in the room K.4.201, [building K](https://fosdem.org/2017/schedule/buildings/#k), on the
[Solbosch Campus, Université Libre de Bruxelles](https://goo.gl/maps/52tGkVuKJZS2).

## Who we are

{% include committee.md %}

## Code of Conduct

We dedicate ourselves to making everyone feel welcome and at home. Our
[Code of Conduct](coc.html) offers some guidelines to ensure this for both
attendees and speakers. The organizers are available to anyone who is anything
less than completely comfortable.

## How could you support the devroom?

If you'd like to help the Ruby devroom to welcome speakers from all around the
world, [you do it via sponsorship](sponsorship.html).

## Previous Editions

* [2016](https://archive.fosdem.org/2016/schedule/track/ruby/) and [videos](videos.html)
* [2015](https://archive.fosdem.org/2015/schedule/track/ruby/)

gha_language: CSS


text:
# yfinance REST API

yfinance REST API is a REST API built in Python using the Flask framework. yfinance REST API is an extesion of the yfinance project hosted at https://github.com/ranaroussi/yfinance

## Getting Started

Install dependencies
```sh
cd /path/to/yfinance-rest-api
pip install -r requirements.txt
```

Build stocks collection
```sh
export MONGO_URL=<YOUR_MONGO_CONNECTION_URL>
python setup.py --build
```

Run app
```sh
export FLASK_APP=app
export FLASK_ENV=development
export MONGO_URL=<YOUR_MONGO_CONNECTION_URL>
export NEWS_API_KEY<YOUR_NEWS_API_KEY>
flask run
```

(Optional) Run stocks collection calculated analysis
```sh
export MONGO_URL=<YOUR_MONGO_CONNECTION_URL>
python setup.py --run_analysis
```

(Optional) Unset any previous stocks collection calculated analysis
```sh
export MONGO_URL=<YOUR_MONGO_CONNECTION_URL>
python setup.py --unset_analysis
```

## Usage

| Name                  | HTTP Verb  | API Endpoint                                                     | Purpose                                 |
| --------------------- | ---------- | ---------------------------------------------------------------- | --------------------------------------- |
| Ping                  | GET        | /api/v1/system/ping                                              | Check if API is alive                   |
| Tickers               | GET        | /api/v1/finance/stocks/tickers                                   | Get list of tickers                     |
| Search                | GET        | /api/v1/finance/stocks/search?q=A&limit=25                       | Search for stocks by ticker             |
| Most Popular          | GET        | /api/v1/finance/stocks/most-popular                              |  Get a list of the most popular stocks  |
| Fast Moving           | GET        | /api/v1/finance/stocks/fast-moving?sort=percentage.asc&limit=100 | Get a list of the fastest moving stocks |
| Info                  | GET        | /api/v1/finance/stocks/info?ticker=F                             | Get stock info                          |
| Historical            | GET        | /api/v1/finance/stocks/historical?ticker=DIS&period=5d           | Get stock historical market data        |
| Dividends             | GET        | /api/v1/finance/stocks/dividends?ticker=MSFT                     | Get stock dividends                     |
| Splits                | GET        | /api/v1/finance/stocks/splits?ticker=FB                          | Get stock splits                        |
| Financials            | GET        | /api/v1/finance/stocks/financials?ticker=TSLA&term=1y            | Get stock financials                    |
| Major Holders         | GET        | /api/v1/finance/stocks/major-holders?ticker=JNJ                  | Get stock major holders                 |
| Institutional Holders | GET        | /api/v1/finance/stocks/institutional-holders?ticker=V            | Get stock institutional holders         |
| Balance Sheet         | GET        | /api/v1/finance/stocks/balance-sheet?ticker=AAPL&term=quarter    | Get stock balance sheet                 |
| Cashflow              | GET        | /api/v1/finance/stocks/cashflow?ticker=GOOG&term=quarter         | Get stock cashflow                      |
| Earnings              | GET        | /api/v1/finance/stocks/earnings?ticker=AMZN&term=quarter         | Get stock earnings                      |
| Sustainability        | GET        | /api/v1/finance/stocks/sustainability?ticker=WMT                 | Get stock sustainability                |
| Recommendations       | GET        | /api/v1/finance/stocks/recommendations?ticker=BAC                | Get stock recommendations               |
| Calendar              | GET        | /api/v1/finance/stocks/calendar?ticker=MA                        | Get stock calendar                      |
| ISIN                  | GET        | /api/v1/finance/stocks/isin?ticker=HD                            | Get stock isin                          |
| Options Expirations   | GET        | /api/v1/finance/stocks/options-expirations?ticker=NKE            | Get stock options expirations           |
| Calls                 | GET        | /api/v1/finance/stocks/calls?ticker=CRM&date=2021-08-24          | Get stock calls                         |
| Puts                  | GET        | /api/v1/finance/stocks/puts?ticker=NFLX&date=2021-08-25          | Get stock puts                          |
| News Everything       | GET        | /api/v1/finance/news?q=$MSFT                                     | Search millions of articles             |

## Built With

* [Flask](https://flask.palletsprojects.com)
* [PyMongo](https://pymongo.readthedocs.io)
* [yfinance](https://github.com/ranaroussi/yfinance)
* [News API](https://newsapi.org/)

## License

This project is licensed under the MIT license.

repository: ap-t/yfinance-rest-api

repo_name: ap-t/yfinance-rest-api


text:
The `dice` plugin simulates throwing dice with an arbitrary number of sides, such as the ones of Role Playing Games.

It lets you

* roll the dice (for example toss heads or tails in the chat)
* study the various probabilities related to some dice rollings

*Dice Roll Definitions* are written as

    <number of dice> D <number of sides> + <added constant>

### Just roll some dice

Simply use the `roll` option:

![dice](doc/dice_roll_def.png)

### See distribution

Use `!!dice dist` or just `!!dice`:

![dice](doc/dice_dist_def.png)

### Estimate the probability to reach a threshold or fall on a given value

![dice](doc/dice_dist_def_scalar.png)

### Compare two distributions

![dice](doc/dice_dist_def_def.png)

repository: TommyTeaVee/miaou

repo_name: TommyTeaVee/miaou


text:
## static-ffmpeg

Docker image with
[ffmpeg](https://ffmpeg.org/ffmpeg.html) and
[ffprobe](https://ffmpeg.org/ffprobe.html)
built as hardened static PIE binaries with no external dependencies that can be
used with any base image.

See [Dockerfile](Dockerfile) for versions used. In general, master **should** have the
latest stable version of ffmpeg and below libraries.
Versions are kept up to date automatically using [bump](https://github.com/wader/bump).

### Usage

Use `mwader/static-ffmpeg` from Docker Hub or build image yourself.

In Dockerfile
```Dockerfile
COPY --from=mwader/static-ffmpeg:6.0 /ffmpeg /usr/local/bin/
COPY --from=mwader/static-ffmpeg:6.0 /ffprobe /usr/local/bin/
```

Run directly
```sh
docker run -i --rm -u $UID:$GROUPS -v "$PWD:$PWD" -w "$PWD" mwader/static-ffmpeg:6.0 -i file.wav file.mp3
docker run -i --rm -u $UID:$GROUPS -v "$PWD:$PWD" -w "$PWD" --entrypoint=/ffprobe mwader/static-ffmpeg:6.0 -i file.wav
```

As shell alias
```sh
alias ffmpeg='docker run -i --rm -u $UID:$GROUPS -v "$PWD:$PWD" -w "$PWD" mwader/static-ffmpeg:6.0'
alias ffprobe='docker run -i --rm -u $UID:$GROUPS -v "$PWD:$PWD" -w "$PWD" --entrypoint=/ffprobe mwader/static-ffmpeg:6.0'
```

### Libraries

- fontconfig
- gray
- iconv
- lcms2
- libaom
- libaribb24
- libass
- libbluray
- libdav1d
- libdavs2
- libfdk-aac
- libfreetype
- libfribidi
- libgme
- libgsm
- libkvazaar
- libmodplug
- libmp3lame
- libmysofa
- libopencore
- libopenjpeg
- libopus
- librabbitmq
- librav1e
- librtmp
- librubberband
- libshine
- libsnappy
- libsoxr
- libspeex
- libsrt
- libssh
- libsvtav1
- libtheora
- libtwolame
- libuavs3d
- libvidstab
- libvmaf
- libvo-amrwbenc
- libvorbis
- libvpx
- libwebp
- libx264
- libx265 (multilib with support for 10 and 12 bits)
- libxavs2
- libxml2
- libxvid
- libzimg
- openssl
- and all native ffmpeg codecs, formats, filters etc.

### Files in the image

- `/ffmpeg` ffmpeg binary
- `/ffprobe` ffprobe binary
- `/doc` Documentation
- `/versions.json` JSON file with build versions of ffmpeg and libraries.
- `/etc/ssl/cert.pem` CA certs to make `-tls_verify 1 -ca_file /etc/ssl/cert.pem` work if running image directly

### Tags

`latest` Latest master build.

`MAJOR.MINOR.PATCH[-BUILD]` Specific version of FFmpeg with the features that was in master at the time of tagging.
`-BUILD` means that was an additional build with that version to add of fix something.

### Security

Binaries are built with various hardening features but it's *still a good idea to run them
as non-root even when used inside a container*, especially so if running on input files that
you don't control.

### Known issues and tricks

#### Multi-arch and arm64

Since version 5.0.1-3 dockerhub images are multi-arch amd64 and arm64 images.

#### Copy out binaries from image

This will copy `ffmpeg` and `ffprobe` to the current directory:
```
docker run --rm -v "$PWD:/out" $(echo -e 'FROM alpine\nCOPY --from=mwader/static-ffmpeg:latest /ff* /\nENTRYPOINT cp /ff* /out' | docker build -q -)
```

#### Quickly see what versions an image was built with

```
docker run --rm mwader/static-ffmpeg -v quiet -f data -i versions.json -map 0:0 -c text -f data -
```

#### I see `Name does not resolve` errors for hosts that should resolve

This could happen if the hostname resolve to more IP-addresses than can fit in [DNS UDP packet](https://www.rfc-editor.org/rfc/rfc791)
(probably 512 bytes) causing the response to be truncated. Usually clients should then switch
to TCP and redo the query but [musl libc](https://www.musl-libc.org) does not currently support [DNS over TCP](https://wiki.musl-libc.org/functional-differences-from-glibc.html#Name-Resolver/DNS).

### TLS

Binaries are built with TLS support but, by default, ffmpeg currently do
not do certificate verification. To enable verification you need to run
ffmpeg with `-tls_verify 1` and `-ca_file /path/to/cert.pem`.

- Alpine Linux at `/etc/ssl/cert.pem`
- Debian/Ubuntu install the `ca-certificates` package at it will be available at `/etc/ssl/certs/ca-certificates.crt`.

### Docker Hub images

Multi-arch dockerhub images are built using [pldin601/build-multiarch-on-aws-spots](https://github.com/pldin601/build-multiarch-on-aws-spots). See [build-multiarch.yml](.github/workflows/build-multiarch.yml) for config. Thanks to [@pldin601](https://github.com/pldin601) for making this possible.

### Contribute

Feel free to create issues or PRs if you have any improvements or encounter any problems.
Please also consider making a [donation to the FFmpeg project](https://ffmpeg.org/donations.html)
or to other projects used by this image if you find it useful.

Please also be mindful of the license limitations used by libraries this project uses and your own
usage and potential distribution of such.

### TODOs and possible things to add

- Add libplacebo, chromaprint, etc. ...
- Add libjxl support once in stable
- Add xeve/xevd support once in stable
- Add acceleration support (GPU, CUDA, ...)
- Add *.a *.so libraries, headers and pkg-config somehow

repository: wader/static-ffmpeg

gha_language: Dockerfile

repo_name: wader/static-ffmpeg


text:
# sign

## Name

*sign* - adds DNSSEC records to zone files.

## Description

The *sign* plugin is used to sign (see RFC 6781) zones. In this process DNSSEC resource records are
added. The signatures that sign the resource records sets have an expiration date, this means the
signing process must be repeated before this expiration data is reached. Otherwise the zone's data
will go BAD (RFC 4035, Section 5.5). The *sign* plugin takes care of this.

Only NSEC is supported, *sign* does *not* support NSEC3.

*Sign* works in conjunction with the *file* and *auto* plugins; this plugin **signs** the zones
files, *auto* and *file* **serve** the zones *data*.

For this plugin to work at least one Common Signing Key, (see coredns-keygen(1)) is needed. This key
(or keys) will be used to sign the entire zone. *Sign* does *not* support the ZSK/KSK split, nor will
it do key or algorithm rollovers - it just signs.

*Sign* will:

 *  (Re)-sign the zone with the CSK(s) when:

     -  the last time it was signed is more than a 6 days ago. Each zone will have some jitter
        applied to the inception date.

     -  the signature only has 14 days left before expiring.

    Both these dates are only checked on the SOA's signature(s).

 *  Create RRSIGs that have an inception of -3 hours (minus a jitter between 0 and 18 hours)
    and a expiration of +32 (plus a jitter between 0 and 5 days) days for every given DNSKEY.

 *  Add NSEC records for all names in the zone. The TTL for these is the negative cache TTL from the
    SOA record.

 *  Add or replace *all* apex CDS/CDNSKEY records with the ones derived from the given keys. For
    each key two CDS are created one with SHA1 and another with SHA256.

 *  Update the SOA's serial number to the *Unix epoch* of when the signing happens. This will
    overwrite *any* previous serial number.

There are two ways that dictate when a zone is signed. Normally every 6 days (plus jitter) it will
be resigned. If for some reason we fail this check, the 14 days before expiring kicks in.

Keys are named (following BIND9): `K<name>+<alg>+<id>.key` and `K<name>+<alg>+<id>.private`.
The keys **must not** be included in your zone; they will be added by *sign*. These keys can be
generated with `coredns-keygen` or BIND9's `dnssec-keygen`. You don't have to adhere to this naming
scheme, but then you need to name your keys explicitly, see the `keys file` directive.

A generated zone is written out in a file named `db.<name>.signed` in the directory named by the
`directory` directive (which defaults to `/var/lib/coredns`).

## Syntax

~~~
sign DBFILE [ZONES...] {
    key file|directory KEY...|DIR...
    directory DIR
}
~~~

*  **DBFILE** the zone database file to read and parse. If the path is relative, the path from the
   *root* plugin will be prepended to it.
*  **ZONES** zones it should be sign for. If empty, the zones from the configuration block are
   used.
* `key` specifies the key(s) (there can be multiple) to sign the zone. If `file` is
   used the **KEY**'s filenames are used as is. If `directory` is used, *sign* will look in **DIR**
   for `K<name>+<alg>+<id>` files. Any metadata in these files (Activate, Publish, etc.) is
   *ignored*. These keys must also be Key Signing Keys (KSK).
*  `directory` specifies the **DIR** where CoreDNS should save zones that have been signed.
   If not given this defaults to `/var/lib/coredns`. The zones are saved under the name
   `db.<name>.signed`. If the path is relative the path from the *root* plugin will be prepended
   to it.

Keys can be generated with `coredns-keygen`, to create one for use in the *sign* plugin, use:
`coredns-keygen example.org` or `dnssec-keygen -a ECDSAP256SHA256 -f KSK example.org`.

## Examples

Sign the `example.org` zone contained in the file `db.example.org` and write the result to
`./db.example.org.signed` to let the *file* plugin pick it up and serve it. The keys used
are read from `/etc/coredns/keys/Kexample.org.key` and `/etc/coredns/keys/Kexample.org.private`.

~~~ txt
example.org {
    file db.example.org.signed

    sign db.example.org {
        key file /etc/coredns/keys/Kexample.org
        directory .
    }
}
~~~

Running this leads to the following log output (note the timers in this example have been set to
shorter intervals).

~~~ txt
[WARNING] plugin/file: Failed to open "open /tmp/db.example.org.signed: no such file or directory": trying again in 1m0s
[INFO] plugin/sign: Signing "example.org." because open /tmp/db.example.org.signed: no such file or directory
[INFO] plugin/sign: Successfully signed zone "example.org." in "/tmp/db.example.org.signed" with key tags "59725" and<PHONE_NUMBER> SOA serial, elapsed 9.357933ms, next: 2019-08-02T22:27:45.270Z
[INFO] plugin/file: Successfully reloaded zone "example.org." in "/tmp/db.example.org.signed" with serial<PHONE_NUMBER>
~~~

Or use a single zone file for *multiple* zones, note that the **ZONES** are repeated for both plugins.
Also note this outputs *multiple* signed output files. Here we use the default output directory
`/var/lib/coredns`.

~~~ txt
. {
    file /var/lib/coredns/db.example.org.signed example.org
    file /var/lib/coredns/db.example.net.signed example.net
    sign db.example.org example.org example.net {
        key directory /etc/coredns/keys
    }
}
~~~

This is the same configuration, but the zones are put in the server block, but note that you still
need to specify what file is served for what zone in the *file* plugin:

~~~ txt
example.org example.net {
    file var/lib/coredns/db.example.org.signed example.org
    file var/lib/coredns/db.example.net.signed example.net
    sign db.example.org {
        key directory /etc/coredns/keys
    }
}
~~~

Be careful to fully list the origins you want to sign, if you don't:

~~~ txt
example.org example.net {
    sign plugin/sign/testdata/db.example.org miek.org {
        key file /etc/coredns/keys/Kexample.org
    }
}
~~~

This will lead to `db.example.org` be signed *twice*, as this entire section is parsed twice because
you have specified the origins `example.org` and `example.net` in the server block.

Forcibly resigning a zone can be accomplished by removing the signed zone file (CoreDNS will keep
on serving it from memory), and sending SIGUSR1 to the process to make it reload and resign the zone
file.

## See Also

The DNSSEC RFCs: RFC 4033, RFC 4034 and RFC 4035. And the BCP on DNSSEC, RFC 6781. Further more the
manual pages coredns-keygen(1) and dnssec-keygen(8). And the *file* plugin's documentation.

Coredns-keygen can be found at
[https://github.com/coredns/coredns-utils](https://github.com/coredns/coredns-utils) in the
coredns-keygen directory.

Other useful DNSSEC tools can be found in [ldns](https://nlnetlabs.nl/projects/ldns/about/), e.g.
`ldns-key2ds` to create DS records from DNSKEYs.

## Bugs

`keys directory` is not implemented.

repository: coredns/coredns

repo_name: coredns/coredns


text:
This class determines how long consumed resources like Snacks will last by simulating resource consumption and simulating running converters like soil recyclers and snacks processors. It is designed to allow for an arbitrary number of resource production chains and an arbitrary number of consumed resources. Conditions: The only inputs allowed into the system are those consumed by kerbals. Ex: kerbals eat Snacks and produce Soil. Resources aboard the vessel that aren't directly involved in resource consumption are fixed. Ex: Resource harvesters that produce Ore aren't accounted for. Running simulations is computationally expensive. This class should be run in a thread.

## Methods

### CreateSimulator(ShipConstruct)
Creates a simulator from the supplied ship construct
> #### Parameters
> **ship:** A ShipConstruct to simulate

> #### Return value
> A SimSnacks simulator

### CreateSimulator(ProtoVessel)
Creates a simulator from the proto vessel
> #### Parameters
> **protoVessel:** The unloaded vessel to query for resources and converters.

> #### Return value
> A SimSnacks simulator.

### CreateSimulator(Vessel)
Creates a simulator from a loaded vessel
> #### Parameters
> **vessel:** The Vessel object to query for resources and converters.

> #### Return value
> A SimSnacks simulator.

gha_language: C#


text:
# Ebook Manager
[![Build Status](https://travis-ci.org/davidhaw/Ebook-Manager.svg?branch=cli)](https://travis-ci.org/davidhaw/Ebook-Manager)

How to Use and Install:

1. Download Dependencies and run with java:

 * First use Maven to install all dependencies.
 * Then run javac Main.java in it's folder.

2: Download the .exe run it:
 * This feature is coming soon and the .exe will be realeased once a fleshed out and feature ready version of the program exists.

repository: davidhaw/Ebook-Manager

repo_name: davidhaw/Ebook-Manager