text:
Solr
=========

This role allows you to configure a [Solr](http://lucene.apache.org/solr/) service on your system.

It mainly wraps the generic-service role to ease its use.

Role Variables
--------------

The main variable of this role is `solr`.

Those variables are herited from `generic-service` :

Variable | Default value |Description
---------|---------------|--------------
`subpath` | Mandatory | Contains the name of the top-level directory inside the tar/zip, or the relative path in which the application is already extracted
`source_file` | None | If this parameter is given, a tar/zip file at this path will be copied and extracted to the server
`source_url` | None | If this parameter is given, a tar/zip file at this path will be downloaded and extracted to the server
`source_checksum` | None | The "ALG:VALUE" checksum, example : sha1:671608f9df6e44e379d78362557b8ec0659145d9
`config_directories`| None | This parameter contains configuration directories that should be copied into the Solr instance

Those variables are specific to this role :

Variable | Default value |Description
---------|---------------|--------------
`needed_libraries` | None | If this parameter is given, the list of libraries URL it contains will be downloaded and add to Solr libraries

Additional variables you can define for this role, outside the `solr` one, are :

Variable | Default value |Description
---------|---------------|--------------
`solr_service_name` | solr | The name you want to give the application. By default it will be used to name the system service and the systems users
`solr_java_version` | 7 | The java version to be installed
`solr_java_impl` | openjdk | The java implementation to be installed (possible values: **openjdk** or **oraclejdk**)

Requirements
------------

As stated earlier, this role heavily uses the `generic-service` role.

```yaml
- src: git@git.smile.fr:ansible/generic-service.git
  scm: git
- src: git@git.smile.fr:ansible/solr.git
  scm: git
```

Example Playbook
----------------

Simple example to install Solr 5.2.1 with openjdk version 7 :
```yaml
- hosts: all
  roles:
    - role: solr
```

Here is how to quickly bootstrap a new Solr instance:

```yaml
- hosts: servers
  roles:
    - role: solr
      solr:
        source_url: http://www-eu.apache.org/dist/lucene/solr/6.3.0/solr-6.3.0.tgz
        source_checksum: sha1:8e11c1d7af0ac516f6a2e7e1a486d216cc9944b8
        subpath: solr-6.3.0
        needed_libraries:
          - http://search.maven.org/remotecontent?filepath=mysql/mysql-connector-java/5.1.26/mysql-connector-java-5.1.26.jar
      solr_java_version: 8
```

Note
----

For SolR 4.X, the example folder is copied in the server folder in which the solr service will be executed.

Solr installation can be check by browsing URL **http://serveraddress:8983/solr/**

License
-------

BSD

repository: chapeaute/playbooks

branch_name: refs/heads/main

repo_name: chapeaute/playbooks


text:
# tpch-spark

TPC-H queries implemented in Spark using the Frovedis DataFrame APIs.
Tested under Spark 3.1.2 and SBT 1.4.7

### Generating tables

```
./01_dbgen.sh
```
which generates tables with extension `.tbl` with scale 1 (default) for a total of rougly 1GB size across all tables
and moved them inside the input directory used by the scala programs.

For different size tables you can provide the 'scale' option as first argument of the script:
```
./01_dbgen.sh 10
```
will generate roughly 10GB of input data.

### Running

There are two 'src' directories:

- src-frovedis: queries with frovedis dataframe APIs
- src-spark:    queries with spark dataframe APIs

The default symbolic link, 'src' points to the 'src-frovedis' directory
to build and execute queries with frovedis dataframe APIs.

If you need to build and execute queries with spark dataframe APIs,
please re-link 'src' to point to the 'src-spark' directory.

The below script can be used to build and execute the target 'src':

```
./02_compile_and_run.sh
```

Default QID=0, which means all the queries would be executed in order.
If you need a specific query to be executed, modify the value of QID before executing the above script.

Make sure you set the INPUT_DIR and OUTPUT_DIR in `TpchQuery` class before compiling to point to the
location of the input data (specially when scale factor is other than default)
and where the output should be saved.

### Report Creation

'src-frovedis' contains line-of-codes to profile each of the following sections
during individual query execution:

- time for spark-to-frovedis data transfer
- time for query processsing by frovedis (on VE)
- time for result conversion (frovedis-to-spark dataframe)

During the exeution of the above script, if you redirect the stderr logs in some file as follows:

```
./02_compile_and_run.sh 2> stderr
```

Then the below script can be used to generate a report, 'eval.csv' containing
times for each individual sections mentioned above for each execueted query:

```
./03_get_report.sh stderr
```

repository: frovedis/frovedis

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: frovedis/frovedis


text:
# Creating websites with [Django](http://djangoproject.com)

## Introduction:

[Django](http://djangoproject.com) is a web framework written in Python. It is a high-level framework that saves you the hassle of low-level web development so that you can focus on what really matters instead of reinventing the wheel. On Django's website, they call it:
> *The web framework for perfectionists with deadlines.*

And that really is the case because Django makes it super easy to create the backend of your web application very quickly. Python has other frameworks like [Flask](https://www.palletsprojects.com/p/flask/), [Tornado](https://www.tornadoweb.org/en/stable/), etc. but Django has gained a huge amount of popularity. A few key features of Django are as follows:

- Quick prototyping
- Built-in [ORM](https://en.wikipedia.org/wiki/Object-relational_mapping) (Object Relational Mapper)
- A beautiful admin panel, out of the box
- Built-in authentication and authorization
- Powerful web forms

and many more!

Now its time to install Django on your computer.

## Installation:

I'll assume that you have [Python](https://www.python.org/) and [pip](https://pypi.org/project/pip/) installed on your system and they are added to your PATH variable. The latest version of Django is `3.0.2` at the time of writing this tutorial and that's the one we are going to use.

To install Django, write this command in your terminal/prompt:
```
$ pip install django
```

If everything goes well, you should be able to run the following commands to verify your Django installation.

```
$ python
```
```python
>>> import django
>>> django.__version__
'3.0.2'
```

Fantastic work installing Django on your computer. Now let's go ahead and create a website using ```django-admin```. It is basically a command-line utility used to create *django projects* and to do few other things. You don't have to worry too much about this as we'll come back to this later. For now, just run the following command in terminal/prompt:

```
$ django-admin startproject myproject .
```

The directory structure should look like this:
- myproject/
  - ```__init__.py```
  - ```asgi.py```
  - ```settings.py```
  - ```urls.py```
  - ```wsgi.py```
- ```manage.py```

If you feel confused after seeing so many files, please don't. I understand that starting with Django can feel somewhat tedious, but I promise it all will make sense later.

Fire up the terminal and run the following command:

```
$ python manage.py runserver
```

You'll see an output similar to this:

```
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).

You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
January 14, 2020 - 01:45:59
Django version 3.0.2, using settings 'myproject.settings'
Starting development server at http://<IP_ADDRESS>:8000/
Quit the server with CTRL-BREAK.
```

Now open your favorite browser and go to the following URL: [http://<IP_ADDRESS>:8000/](http://<IP_ADDRESS>:8000/)

You will see a page like this:

![Django Welcome Screen](https://github.com/sarmadgulzar/beginning-django/raw/master/images/01.png)

Great work so far. Now, let me briefly explain the files in ```myproject``` folder and ```manage.py``` file.

### ```manage.py```
Just like ```django-admin```, it is a command-line tool to do different things like, for example, starting a server we just did above using:

```
$ python manage.py runserver
```

Later on, we'll see many more things that we can do using ```manage.py```.

### ```myproject/__init__.py```
This empty file is just there to treat ```myproject``` folder as a *module*.

### ```myproject/settings.py```
This file contains settings for the Django project. A few important ones are ```DEBUG```, ```INSTALLED_APPS```, ```DATABASES``` etc. We'll discuss them in detail later.

### ```myproject/urls.py```
These are the routes for our web applications. Only URLs defined inside this file will be accessible.

### ```myproject/asgi.py``` and ```myproject/wsgi.py```
These files are used when we deploy our application to the web server on the cloud so no need to worry about them just yet.

## Creating  a Hello World page:
Now that you have a basic understanding of how Django works, let's create a simple application that prints ```"Hello World"``` on our home page.

Open the ```myproject/urls.py```, it should look similar to this:

```python
from django.contrib import admin
from django.urls import path

urlpatterns = [
    path('admin/', admin.site.urls),
]
```

Let's add a few things, so it looks like this:

```python
from django.contrib import admin
from django.urls import path
from django.http import HttpResponse # new line

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', lambda request: HttpResponse("Hello World")), # new line
]
```

Now when you go back to the browser, you'll see this page:

![Hello World Page](https://github.com/sarmadgulzar/beginning-django/raw/master/images/02.png)

That way easy, no?

Okay, that ```lambda``` expression looks weird. Let's create a separate file called ```views.py``` to contain our views.

Now our directory structure will look like this:
- myproject/
  - ```__init__.py```
  - ```asgi.py```
  - ```settings.py```
  - ```urls.py```
  - ```views.py```
  - ```wsgi.py```
- ```manage.py```

Now update the ```views.py``` file so it looks like this:

```python
from django.http import HttpResponse

def index(request):
    return HttpResponse("Hello World")

```

and ```urls.py``` will look like this:

```python
from django.contrib import admin
from django.urls import path

from .views import index

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', index),
]

```

Now go back to the browser and refresh the page. You'll see the same results. But now our code is much cleaner, isn't?

To give you an idea about how *URLs* work in Django. Change ```views.py``` as follows:

```python
from django.http import HttpResponse

def index(request):
    return HttpResponse("Hello World")

# new lines
def bye(request):
    return HttpResponse("Goodbye World")

```

and ```urls.py```:

```python
from django.contrib import admin
from django.urls import path

from .views import index, bye # updated line

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', index),
    path('bye/', bye), # new line
]

```

Now go back to the browser and type http://<IP_ADDRESS>:8000/bye/ in the URL box and hit enter.

You'll see something like this:

![Goodbye World Page](https://github.com/sarmadgulzar/beginning-django/raw/master/images/03.png)

Now you'll start to feel this pattern that how URLs defined in ```urls.py``` are mapped to the functions in ```views.py```.

Well, that concludes our introduction to Django. Stay tuned for the next part and until then, Happy Pythoning :heart:

license: MIT

repository: sarmadgulzar/beginning-django

repo_name: sarmadgulzar/beginning-django


text:
---
title: "Chocolatey"
linkTitle: "Chocolatey"
weight: 3
type: docs
description: >
    Install Kubectl for Windows using Chocolatey
---

- For [Chocolatey](https://chocolatey.org/) users:

```bash
choco install kubernetes-cli
```

repository: kubernetes-sigs/cli-experimental

gha_language: Go

repo_name: kubernetes-sigs/cli-experimental


text:
desktopJS and [Glue42](https://glue42.com/ "Glue42")
======================================================

Steps to run:
0. Make sure you have ```node``` & ```npm``` installed
1. Download and install [latest Glue42 Enterprise 3.9]("Download link")
2. Clone https://github.com/Tick42/desktopJS
3. Start desktop JS
```bat
cd desktopJS && npm i && npm run bootstrap && npm run build && npm start
```
4.Put the `desktopjs-glue42.json` in `%localappdata%\Tick42\GlueDesktop\config\apps`
5. Enable `auto-injection` in `%localappdata%\Tick42\GlueDesktop\config\system.json`
```json
   "autoInjectAPI": {
            "enabled": true,
            "version": "5.*",
            "autoInit": true
        },
```
5. Start Glue42 Desktop and open the 'desktopJS Glue42' application (it should be on the top of the list)

gha_language: TypeScript


text:
# SSSFTPD

An SFTP server that stores files on S3.

## Setup

* Create a key with `ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key`

* Add your public key to `~/.ssh/authorized_users`

* Run the server `make deps app shell

### AWS

Add standard `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environmental variables in order to access S3.

Set `AWS_BUCKET` for the bucket to use for SSH keys and uploaded files.

#### Users

Users go into `$AWS_BUCKET/credentials/$USER/id_rsa.pub`

Create `$AWS_BUCKET/uploads/$USER` directory for their specific files.

## Configuration

Configuration is provided by a config file defining the SFTP servers to run

```
[{sssftp, [
    {servers, [
        [{port, 8989}, {aws_bucket, "sssftpd-test"}]
    ]}]}].
```

Multiple port/bucket combinations can be used.

In addition to `port` and `aws_bucket` are `role` and `external_id`. `role` and `external_id` will be used if defined to assume a role from another account.

repository: philipcristiano/sssftp

gha_language: Erlang

repo_name: philipcristiano/sssftp


text:
# Link to CommonDataModel
- [VISIT_OCCURRENCE](https://github.com/OHDSI/CommonDataModel/wiki/VISIT_OCCURRENCE)

# Source Tables (mimic)

## [admissions](https://mimic.physionet.org/mimictables/admissions/)

- some informations from admissions are populated elsewhere (religion, ethnicity, deathtime) respectiveley in (observation, person/observation, death)
- emergency information have been extracted
- when the admissions is emergency, then
	- the admission start datetime becomes the emergency start datetime
	- that emergency stay is added to transfers (in the `visit_detail` table)
- `visit_type_concept_id` is always equals to 44818518 (visit derived from EHR)
- `visit_concept_id` is either equals to 9201 (inpatient visit) or 262 (emergency room and inpatient visit) to unplanned medical care (urgent care)
- in mimic when patient is organ donor, patient died twice. In omop format
        - a new admission category is created as Patient died (concept_id = 4216643)
        - a new discharge category is created as Organ donor (concept_id = 4022058)

# Mapping used

## [visit_source_concept_id](https://github.com/MIT-LCP/mimic-omop/blob/master/extras/concept/admission_type_to_concept.csv)

- it maps mimic admission type to omop admission type

## [admitting_source_concept_id](https://github.com/MIT-LCP/mimic-omop/blob/master/extras/concept/admission_location_to_concept.csv)

- it maps mimic location admission type to omop location admission type

## [discharge_type_to_concept](https://github.com/MIT-LCP/mimic-omop/blob/master/extras/concept/discharge_location_to_concept.csv)

- it maps mimic location discharge type to omop location discharge type

# Examples

## Number of admissions

``` sql
SELECT COUNT(distinct visit_occurrence_id) AS num_admission_count
FROM visit_occurrence;
```
| num_admission_count |
|---------------------|
|               58976|

## Number of dead patients in hospital

``` sql
SELECT count(distinct visit_occurrence_id) AS dead_hospital_count
FROM visit_occurrence
WHERE discharge_to_concept_id = 4216643;                          -- concept.concept_name = 'Patient died'
```
| dead_hospital_count |
|---------------------|
|                5854|

## % of dead patients in hospital

``` sql
WITH tmp AS
(
  SELECT COUNT(distinct d.visit_occurrence_id) AS dead
       , COUNT(distinct t.visit_occurrence_id) AS total
  FROM visit_occurrence t
  LEFT JOIN
  (
        SELECT visit_occurrence_id
        FROM visit_occurrence
        WHERE discharge_to_concept_id = 4216643                   -- concept.concept_name = 'Patient died'

  ) d USING (visit_occurrence_id)

)
SELECT dead, total, dead * 100 / total as percentage FROM tmp;
```
| dead | total | percentage |
|------|-------|------------|
| 5854 | 58976 |          9|

## explanation of the `visit_type_concept_id`

``` sql
-- one one type for visit_occurrence
SELECT distinct concept_name, visit_type_concept_id AS concept_id
FROM visit_occurrence v
JOIN concept c ON v.visit_type_concept_id = c.concept_id;
```
|         concept_name          | concept_id |
|-------------------------------|------------|
| Visit derived from EHR record |   44818518|

## explanation of `visit_source_concept_id`

``` sql
SELECT distinct visit_source_value, concept_name, visit_source_concept_id AS concept_id
FROM visit_occurrence v
JOIN concept c ON v.visit_source_concept_id = c.concept_id;
```
| visit_source_value |             concept_name             | concept_id |
|--------------------|--------------------------------------|------------|
| NEWBORN            | Newborn                              |     444104|
| EMERGENCY          | Emergency hospital admission         |    4079617|
| URGENT             | Hospital admission, urgent, 48 hours |    4331002|
| ELECTIVE           | Hospital admission, elective         |    4314435|

## explanation of `admitting_source_concept_id`

``` sql
SELECT distinct admitting_source_value, concept_name, admitting_source_concept_id AS concept_id
FROM visit_occurrence v
JOIN concept c ON v.admitting_source_concept_id = c.concept_id;
```
|  admitting_source_value   |       concept_name        | concept_id |
|---------------------------|---------------------------|------------|
| TRANSFER FROM HOSP/EXTRAM | Inpatient Hospital        |       8717|
| TRANSFER FROM SKILLED NUR | Skilled Nursing Facility  |       8863|
| EMERGENCY ROOM ADMIT      | Emergency Room - Hospital |       8870|
| DEAD/EXPIRED              | Patient died              |    4216643|    -- organ donor
| CLINIC REFERRAL/PREMATURE | Office                    |       8940|
| HMO REFERRAL/SICK         | Office                    |       8940|
| PHYS REFERRAL/NORMAL DELI | Office                    |       8940|
| TRSF WITHIN THIS FACILITY | Inpatient Hospital        |       8717|
| TRANSFER FROM OTHER HEALT | Other Inpatient Care      |       8892|

## explanation of the `discharge_to_concept_id`

``` sql
SELECT distinct discharge_to_source_value, concept_name, discharge_to_concept_id  as concept_id
FROM visit_occurrence v
JOIN concept c ON v.discharge_to_concept_id = c.concept_id;
```
| discharge_to_source_value |                 concept_name                  | concept_id |
|---------------------------|-----------------------------------------------|------------|
| HOME HEALTH CARE          | Home                                          |       8536|
| DISC-TRAN CANCER/CHLDRN H | Inpatient Hospital                            |       8717|
| HOSPICE-MEDICAL FACILITY  | Hospice                                       |       8546|
| LONG TERM CARE HOSPITAL   | Inpatient Long-term Care                      |       8970|
| HOME                      | Home                                          |       8536|
| ICF                       | Skilled Nursing Facility                      |       8863|
| SHORT TERM HOSPITAL       | Skilled Nursing Facility                      |       8863|
| REHAB/DISTINCT PART HOSP  | Skilled Nursing Facility                      |       8863|
| SNF                       | Skilled Nursing Facility                      |       8863|
| DEAD/EXPIRED              | Patient died                                  |    4216643|
| HOME WITH HOME IV PROVIDR | Home                                          |       8536|
| DISCH-TRAN TO PSYCH HOSP  | Psychiatric Facility-Partial Hospitalization  |       8913|
| SNF-MEDICAID ONLY CERTIF  | Skilled Nursing Facility                      |       8863|
| HOSPICE-HOME              | Hospice                                       |       8546|
| LEFT AGAINST MEDICAL ADVI | Patient self-discharge against medical advice |    4021968|
| ORGAN DONOR ACCOUNT       | Organ donor                                   |    4022058|

## Distribution of length of stay in hospital
``` sql
SELECT percentile_25
       , median
       , percentile_75
       , MIN( EXTRACT(EPOCH FROM visit_end_datetime  - visit_start_datetime)/60.0/60.0/24.0    )    AS minimum
       , MAX( EXTRACT(EPOCH FROM visit_end_datetime  - visit_start_datetime)/60.0/60.0/24.0  )    AS maximum
       , CAST(AVG(  EXTRACT(EPOCH FROM visit_end_datetime  - visit_start_datetime)/60.0/60.0/24.0  ) AS INTEGER)   AS mean
       , STDDEV( EXTRACT(EPOCH FROM visit_end_datetime  - visit_start_datetime)/60.0/60.0/24.0    ) AS stddev
  FROM
  (SELECT MAX( CASE WHEN( percentile = 1    ) THEN los END    ) AS percentile_25
        , MAX( CASE WHEN( percentile = 2    ) THEN los END    ) AS median
        , MAX( CASE WHEN( percentile = 3    ) THEN los END    ) AS percentile_75
    FROM
       ( SELECT counter.los, counter.nb_los
              , FLOOR( CAST( SUM( nb_los    ) OVER( ORDER BY los ROWS UNBOUNDED PRECEDING    ) AS DECIMAL    )
                     / CAST( SUM( nb_los   ) OVER( ORDER BY los ROWS BETWEEN UNBOUNDED PRECEDING
                                                                        AND UNBOUNDED FOLLOWING    )  AS DECIMAL    )
                     * 4
                        ) + 1
          as percentile
          FROM
             ( SELECT EXTRACT(EPOCH FROM visit_end_datetime  - visit_start_datetime)/60.0/60.0/24.0 as los, count(*) AS nb_los
                FROM visit_occurrence
                GROUP BY EXTRACT(EPOCH FROM visit_end_datetime  - visit_start_datetime)/60.0/60.0/24.0
               ) as counter
         ) as p
     WHERE percentile <= 3
  ) as percentile_table, visit_occurrence
  GROUP BY percentile_25, median, percentile_75;
```
| percentile_25 | median  |  percentile_75   |      minimum       |     maximum      | mean |      stddev      |
|---------------|---------|------------------|--------------------|------------------|------|------------------|
|       3.84375 | 6.59375 | 11.8868055555556 | -0.905555555555556 |<PHONE_NUMBER>66667 |   10 | 12.4700360442866|

repository: MIT-LCP/mimic-omop

gha_language: PLpgSQL

gha_license_id: MIT

repo_name: MIT-LCP/mimic-omop


text:
---
layout: post
title:  Face Detection using OpenCV in Python
author: Lewis Gavin
comments: true
tags:
- data science
- deep learning
- python
---

![Face Detection with OpenCV](https://www.lewisgavin.co.uk/images/facedetection.jpg)

I've recently been on a journey to learn more about Deep Learning. I started off with an *Intro to Deep Learning* course on Udacity. If, like me, you are just starting out with Data Science techniques and don't have a heavy mathematical background, I would avoid this course until you have a little more experience.

With this in mind, I wanted to start off lighter and simpler. I wanted a way to introduce myself to Deep Learning but in a fun way. To do this I decided on the "Hello World" of Deep Learning: Image Recognition. I wanted to see if I could build an application that could recognise my face. Here's how I approached it using **Python** and a bunch of really cool libraries.

In part 1 I will be doing simple face detection and moving onto the more complicated aspects in further posts.

## 1. Install OpenCV

As with most tutorials, a good starting point is to ensure you've got your environment set up. This was one of the most time consuming things. To prevent you getting bored with setup after setup without seeing anything tangible, there is something fun to do after this install.

Download and install [OpenCV](http://opencv.org/) for your OS of choice (and of course ensure you have Python installed too). Theres a version 2.x and 3.x. I installed version 3.x.

No we can go ahead and follow a simple example from the OpenCV website to try and detect faces within your own supplied images.

## 2. Detecting your own face in an image

Create yourself a fresh directory and within it, place an image of yourself or a celebrity. There can be more than one person in the photo, but for this example I just used a simple photo of myself.

We also need to copy in our Haar Cascades metadata file for detecting faces. The OpenCV download folder from the previous step contains a bunch of these for detecting different things such as eyes, ears etc. We want to detect the whole face so we will be using the `haarcascade_frontalface_default.xml`. I found this within the following folder:

`<open cv install dir>/opencv/opencv-3.2.0/data/haarcascades/`

Now we have our test image and our Haar Cascade file, we need to write a python application to detect the face. It's a relatively simple application that looks as follows - again the core of this code was taken from the OpenCV website:

~~~python
import cv2
import sys

# get paths for the image and haar cascade
imagePath = sys.argv[1]
cascPath = sys.argv[2]

# Create the haar cascade
faceCascade = cv2.CascadeClassifier(cascPath)

# Read the image and convert to gray
image = cv2.imread(imagePath)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

# now we can try to detect faces
faces = faceCascade.detectMultiScale(
    gray,
    scaleFactor=1.1,
    minNeighbors=5,
    minSize=(30, 30),
    flags = cv2.CASCADE_SCALE_IMAGE
)

# Draw a rectangle around the faces and display on screen
for (x, y, w, h) in faces:
    cv2.rectangle(image, (x, y), (x+w, y+h), (0, 255, 0), 2)

cv2.imshow("Faces found", image)
cv2.waitKey(0)
cv2.destroyAllWindows()

~~~

I saved this in a file named `facerec.py`. Run it with the following command to pass in firstly your test image, and then the Cascade file. **Note: If you are using OpenCV version 2.x then you might need to replace `flags=cv2.CASCADE_SCALE_IMAGE` with `flags=cv2.cv.CV_HAAR_SCALE_IMAGE`.**

~~~bash
python facerec.py me.jpg haarcascade_frontalface_default.xml
~~~

I got the following output:

![Face detection example](https://www.lewisgavin.co.uk/images/me_face_detect.jpg)

## Wrap up

As you can see, in very few lines of code, you can build an image detection application that is generic enough to detect a whole range of things. The only modification is the xml metadata file supplied at runtime.

In the next posts I will be looking at facial feature alignment so that even pictures with faces at an angle can be aligned to have the core features: eyes, noes and mouth nicely centered. I will then be looking at using this output to train a Deep Learning Model.


text:
---
title: "NSF Science Academy students get hands-on look at RENCI visualization systems"
slug: nsf-science-academy-students
spotlight: false
publish_date: 2009-07-08
author: subers
featuredImage: null
groups:
    -
projects:
    -
people:
    -
teams:
    -
collaborations:
    -
tags:
    - ["Bennett Academy","Social Computing Room","visualization"]
---

[vimeo 5495510]

What better way is there to understand information visualization systems than a first-hand demonstration at the RENCI engagement center at UNC Chapel Hill?

Twenty-two female students attending the National Science Foundation (NSF) Summer Science Academy at Bennett College for Women in Greensboro visited RENCI in the Manning Information Technology Services building on Friday, June 27 for a guided tour. The event was part of the Academy’s objective to prepare students through course work, computer projects, laboratory experiences, and enrichment activities for success in college mathematics and science courses.

“We were delighted to have a chance to have our students visit RENCI,” said Margaret Curtis, executive director for the Bennett College NSF Historically Black Colleges and Universities Undergraduate Program (HBCU-UP). “Many of the young ladies commented about how much they enjoyed learning about RENCI and advanced technology, such as the dome and the life-sized simulation of a courtroom displayed in the Social Computing Room.”

The tour featured RENCI’s Social Computing Room, Showcase Dome Room and Tele-immersion Room, all designed to encourage multidisciplinary collaboration for research and education.

“The systems are in daily use at RENCI for researcher purposes,” said Eric Knisley, RENCI 3D visualization researcher. “We host many tour groups during the year, focusing on young people like the NSF Academy students, to make them aware of the presence of high tech systems and how to incorporate them into their own lives and careers.”

The NSF Summer Science Academy is a residential, five-week intensive program that enables students to earn seven college credits in mathematics and science. The Academy began June 13 and includes young women who are rising high school seniors as well as incoming Bennett freshmen for Fall 2009. The geographical diversity of the group reflects the composition of Bennett’s student body, with representatives from Maryland, Texas, North Carolina and other states. Other activities for the students included a trip to the North Carolina Museum of Natural Sciences in Raleigh and to SciWorks, a science museum in Winston-Salem.

repository: stephsuber/renci-website

gha_language: JavaScript

repo_name: stephsuber/renci-website


text:
[![npm version](https://badge.fury.io/js/react-native-star-rating.svg)](https://badge.fury.io/js/react-native-star-rating)

[![NPM](https://nodei.co/npm/react-native-star-rating.png?downloads=true)](https://nodei.co/npm/react-native-star-rating/)

# React Native Star Rating Component

> A React Native component for generating and displaying interactive star ratings. Compatible with both iOS and Android.

## Table of Contents

1. [Installation](#installation)
1. [Usage](#usage)
  1. [Props](#props)
  1. [General Star Example](#general-star-example)
  1. [Custom Star Example](#custom-star-example)
1. [Roadmap](#roadmap)
1. [Contributing](#contributing)

## Installation

1. install react-native-star-rating and its dependeices
```sh
npm install react-native-star-rating --save
```
or
```sh
yarn add react-native-star-rating
```
2. link `react-native-vector-icons`
please refer to [react-native-vector-icons installation guide](https://github.com/oblador/react-native-vector-icons#installation)

## Usage

### Props

|Prop|Type|Description|Required|Default|
|---|---|---|---|---|
|**`activeOpacity`**|`number`|Number between 0 a 1 to determine the opacity of the button.|`No`|`0.2`|
|**`animation`**|`string`|Add an animation to the stars when upon selection. Refer to [react-native-animatable](https://github.com/oblador/react-native-animatable) for the different animation types.|`No`|`undefined`|
|**`buttonStyle`**|`ViewPropTypes.style`|Style of the button containing the star.|`No`|*`{}`*|
|**`containerStyle`**|`ViewPropTypes.style`|Style of the element containing the star rating component.|`No`|*`{}`*|
|**`disabled`**|`bool`|Sets the interactivity of the star buttons. |`No`|`false`|
|**`emptyStar`**|`string` or image `object`|The name of the icon to represent an empty star. Refer to [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons). Also can be a image object, both {uri:xxx.xxx} and require('xx/xx/xx.xxx').|`No`|`star-o`|
|**`emptyStarColor`**|`string`|Color of an empty star. |`No`|`gray`|
|**`fullStar`**|`string` or image `object`|The name of the icon to represent a full star. Refer to [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons). Also can be a image object, both {uri:xxx.xxx} and require('xx/xx/xx.xxx').|`No`|`star`|
|**`fullStarColor`**|`string`|Color of a filled star. |`No`|`black`|
|**`halfStar`**|`string` or image `object`|The name of the icon to represent an half star. Refer to [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons).  Also can be a image object, both {uri:xxx.xxx} and require('xx/xx/xx.xxx').|`No`|`star-half-o`|
|**`halfStarColor`**|`string`|Color of a half-filled star. Defaults to `fullStarColor`.|`No`|`undefined`|
|**`halfStarEnabled`**|`bool`|Sets ability to select half stars|`No`|`false`|
|**`iconSet`**|`string`|The name of the icon set the star image belongs to. Refer to [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons).  |`No`|`FontAwesome`|
|**`maxStars`**|`number`|The maximum number of stars possible. |`No`|`5`|
|**`rating`**|`number`|The current rating to show.  |`No`|`0`|
|**`reversed`**|`bool`|Renders stars from right to left|`No`|`false`|
|**`selectedStar`**|`function`|A function to handle star button presses. |`Yes`|*`() => {}`*|
|**`starSize`**|`number`|Size of the star. |`No`|`40`|
|**`starStyle`**|`ViewPropTypes.style`|Style to apply to the star. |`No`|*`{}`*|

For the `emptyStar`, `fullStar`, `halfStar`, and `iconSet` props, please refer to the [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons) package for the valid `string` names for the star icons. When selecting the icon `string` names, you must remember to remove the font family name before the first hyphen. For example, if you want to use the `ion-ios-star` from the Ionicon font set, you would set the `fullStar` prop to `ios-star` and the `iconSet` to `Ionicons`.

For the `animation` prop, please refer to the [react-native-animatable](https://github.com/oblador/react-native-animatable) package for valid `string` names for the different animations available.

### General Star Example

The following example will render 3.5 stars out of 5 stars using the `star-o` for the empty star icon, `star-half-o` for the half star icon, and `star` for the full star icon from the `FontAwesome` icon set in black color.

```js
import StarRating from 'react-native-star-rating';

class GeneralStarExample extends Component {

  constructor(props) {
    super(props);
    this.state = {
      starCount: 3.5
    };
  }

  onStarRatingPress(rating) {
    this.setState({
      starCount: rating
    });
  }

  render() {
    return (
      <StarRating
        disabled={false}
        maxStars={5}
        rating={this.state.starCount}
        selectedStar={(rating) => this.onStarRatingPress(rating)}
      />
    );
  }
}

export default GeneralStarExample
```

### Custom Star Case

The following example will render 2.5 stars out of 7 stars using the `ios-star-outline` for the empty star icon, `ios-star-half` for the half star icon, and `ios-star` for the full star icon from the `Ionicons` icon set in red color.

```js
import StarRating from 'react-native-star-rating';

class CustomStarExample extends Component {

  constructor(props) {
    super(props);
    this.state = {
      starCount: 2.5
    };
  }

  onStarRatingPress(rating) {
    this.setState({
      starCount: rating
    });
  }

  render() {
    return (
      <StarRating
        disabled={false}
        emptyStar={'ios-star-outline'}
        fullStar={'ios-star'}
        halfStar={'ios-star-half'}
        iconSet={'Ionicons'}
        maxStars={7}
        rating={this.state.starCount}
        selectedStar={(rating) => this.onStarRatingPress(rating)}
        fullStarColor={'red'}
      />
    );
  }
}

export default CustomStarExample
```

## Running the ExampleApp (WIP)

Navigate to the root of the ExampleApp and install the dependencies

```sh
cd ExampleApp && npm install
```

Run the app on the iOS simulator.

```sh
npm run ios
```

## Development Setup (WIP)

Be sure to have `create-react-native-app` installed.

```sh
npm install -g create-react-native-app
```

Create a development app in the root folder.

```sh
create-react-native-app DevelopmentApp
```

Going into the development app and clone this repo.

```sh
cd DevelopmentApp && git clone https://github.com/djchie/react-native-star-rating.git
```

Go into the `react-native-star-rating` directory and start developing!

```sh
cd react-native-star-rating
```

## Roadmap

View the project roadmap [here](https://github.com/djchie/react-native-star-rating/issues)

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.

repository: moondoglimited/mobile

repo_name: moondoglimited/mobile


text:
# JSON Marshaler Go Example

This example constructs basic Go types with the json.Marshaler implementation that removes empty fields from the resulting JSON.

The generated code was generated with the following command:

```sh
ecsgen generate --source-file "ecs_flat.yml" --output-plugin="gostruct" --opt-gostruct-package-name="main" --opt-gostruct-output-dir="." --opt-gostruct-marshal-json
```

To run the example, `cd` into the directory and run:

```sh
go run *.go | jq .
```

The result is:

```json
{
  "@timestamp": "2020-04-01T16:10:33.039405-07:00",
  "ecs": {
    "version": "1.5.0"
  },
  "labels": {
    "foo": "bar"
  },
  "server": {
    "nat": {
      "ip": "<IP_ADDRESS>"
    }
  },
  "tags": [
    "production",
    "env2"
  ]
}
```


text:
---
title: Looking Skyward
subtitle: One Step Closer to the End
layout: default
date: 2018-07-25
pretty-date: July 25, 2018
img: looking-skyward2.JPG
thumbnail: looking-skyward1.jpg
author: Ivan Zankov
author-url: #

post-par1: Hello again, good readers! I start this post with a round of applause for my mates back up in Kiruna who just earlier this week endured the IPR! With it being Wednesday as I write this, we have passed it. But did we pass it - that’s the question. The presentation is now history, but what of its implications? Well, a couple of authors before me say there is a hint of good news in the air, so no sense in repeating what they said. We can hope for that pass however - let’s hope.

post-par2: But aside from that, I also read from other authors that the tests and construction are coming along quite well. Before the presentation this week, we each had our revision tasks for the SED, and I learned how to configure PDFs within a PDF. No joke, I never did this before, so there was some fun in that novelty. Of course with LaTeX, we also had to deal with correctly coded footnotes displaying incorrectly.

post-par3: But now, we are drawing ever closer to the final leg of the mission before launch - where we will all be back in September working around the clock! Considering how we may be so busy then, I take a moment every few nights to gaze at the night sky through my telescope and enjoy the slow-moving sights of our galaxy.
---

repository: rexusbexus/tubular

branch_name: refs/heads/gh-pages

extension: markdown

repo_name: rexusbexus/tubular


text:
# Context-React-Scripts

This package is a custom template for create-react-app. It includes basic folder structure for components, pages, and hooks/context. It also contains an example context hook and custom hook.

## Usage

run ```create-react-app [your-app-name-here] --scripts-version context-react-scripts```

## react-scripts(default readme)

This package includes scripts and configuration used by [Create React App](https://github.com/facebook/create-react-app).<br>
Please refer to its documentation:

- [Getting Started](https://facebook.github.io/create-react-app/docs/getting-started) – How to create a new app.
- [User Guide](https://facebook.github.io/create-react-app/) – How to develop apps bootstrapped with Create React App.

repository: mcarreon/create-react-app-context

repo_name: mcarreon/create-react-app-context


text:
# Advancements React [![Build Status](https://travis-ci.org/dnguyensr/advancements-react.svg?branch=master)](https://travis-ci.org/dnguyensr/advancements-react) [![Coverage Status](https://coveralls.io/repos/github/dnguyensr/advancements-react/badge.svg?branch=master)](https://coveralls.io/github/dnguyensr/advancements-react?branch=master)

This project is a rebuild of [TroopAdvancements](https://github.com/dnguyensr/TroopAdvancements) and [advancements](https://github.com/dnguyensr/advancements) which are Boy Scouts advancements tracking web applications. This build shifts the purpose of the application to a quick overview of troop advancements scoped to troop, patrols, and individuals from the a full fledged advancements tracker that duplicated traditional tracking methods of the Boy Scout Handbook.

## Environment

### Ruby/Rails version

* Ruby 2.4.0
* Rails 5.1.1

### System dependencies

This project uses webpacker which requires:

* Node.js 6.4.0+
* Yarn

Foreman is required to run the rails server and webpack-dev-server concurrently

* Foreman

### App dependencies

Devise: The Devise gem is currently being used to handle user authentication. JSON web tokens will be included in a future branch.

### Configuration

Text Editor: An EditorConfig plug-in is required for most text editors to conform to coding styles defined in the editorconfig file.

### Development

To run the rails server and webpack-dev-server concurrently:
Run `foreman start`

repository: dnguyensr/advancements-react

gha_language: Ruby

repo_name: dnguyensr/advancements-react


text:
# React Development Environment

In order for React to be processed by the browser, the JSX needs to be transpiled into regular JavaScript.  There are several methods of doing this (Gulp/Grunt tasks, bundlers, etc.) and we'll look at a popular bundler, [Webpack](https://webpack.github.io/).  Webpack also provides some useful services such as script aggregation and injection which we can use to our advantage.

## Setup

First step is setting up npm for the project and pulling in React and Webpack along with the dependencies they'll need for transpilation:
```bash
$ npm init
$ npm install --save react react-dom
$ npm install --save-dev babel-core babel-loader babel-preset-react html-webpack-plugin webpack
```

Since Webpack will be creating our output, we'll need separate directories for the working code and the output code.  I generally name these directories `src` and `dist` but you can pick a naming scheme that works for you.
```bash
$ mkdir src dist
```

## Configuration

With the folder structure set up, create a file named `webpack.config.js` in the root of your project and open it for editing.  Within that file we'll be exporting an object containing configuration data for Webpack:

```javascript
'use strict';

module.exports = {
  entry: [
    './src/app.js'
  ],
  module: {
    loaders: [
      {
        test: /\.js$/,
        loader: 'babel-loader',
        include: `${__dirname}/src`
      }
    ]
  },
  output: {
    filename: 'packed.js',
    path: `${__dirname}/dist`
  }
};
```

To break down what's going on in the configuration object:
- **entry** - an array of files Webpack will be including.  These can be your own files (as shown) with the full path to the files, or they can be Node modules, in which case only the module name is needed.
- **module** - contains the loaders
  - **loaders** - an array of objects, each defining a loader that manipulates specific files or types of files
    - **test** - a regex that defines what files to run the loader on. In this case, all files that end in `.js`
    - **loader** - the module name of the loader to use
    - **include** - directory in which to look for files matching the `test` regex to manipulate. The `__dirname` variable evaluates to the current directory i.e. the root of your project
- **output** - object defining Webpack's output post manipulations
  - **filename** - the name to use for the Webpacked file
  - **path** - the location to output the packed file

We'll also need to configure Babel to know that it's working with React, otherwise it will choke the first time it sees a `<` in our JSX.  In the root of your project create a `.babelrc` file containing the following configuration object:
```javascript
{
  presets: [
    'react'
  ]
}
```

## A Quick Test
To make sure our configuration up to this point is correct, we can write a simple React component and make sure it transpiles properly.  In the `src` directory, create `app.js`:
```javascript
'use strict';

const React = require('react'),
      ReactDOM = require('react-dom'),
      Hello = () => <h1>Hello World!</h1>;

ReactDOM.render(<Hello />, document.getElementById('content'));
```

In the root of your project, run `webpack`, you should see output similar to this:
```bash
$ webpack
Hash: 0c22e9f0817fae5babe0
Version: webpack 1.13.3
Time: 294ms
    Asset     Size  Chunks             Chunk Names
packed.js  1.62 kB       0  [emitted]  main
   [0] multi main 28 bytes {0} [built]
    + 1 hidden modules
```

If you then look in the `dist` folder, there should be a `packed.js` file.  The file contains all of React & ReactDOM (brought in by the `require` statements) along with the simple component we wrote which was transpiled from JSX to JavaScript.

## Script Injection
Since we're already using webpack for transpiling and aggregating our JS, we can take advantage of `html-webpack-plugin` to automatically inject our packed code into our HTML.  First step is installing the npm module:
```bash
$ npm install html-webpack-plugin --save-dev
```

Post-install we include and configure the plugin at the top of the `webpack.config.js` file:
```javascript
const HtmlPlugin = require('html-webpack-plugin'),
      HtmlPluginConfig = new HtmlPlugin({
        template: `${__dirname}/src/index.html`,
        filename: 'index.html',
        inject: 'body'
      });
```
- **template** - the path to the HTML file used as the base for injection.
- **filename** - the name of the file Webpack will output post-injection.
- **inject** - the site in the HTML where the script will be injected.

Post-configuration, we only need to include the plugin in the Webpack pipeline:
```javascript
'use strict';

const HtmlPlugin = require('html-webpack-plugin'),
      HtmlPluginConfig = new HtmlPlugin({
        template: `${__dirname}/src/index.html`,
        filename: 'index.html',
        inject: 'body'
      });

module.exports = {
  entry: [
    'whatwg-fetch',
    './src/app.js'
  ],
  module: {
    loaders: [
      {
        test: /\.js$/,
        loader: 'babel-loader',
        include: `${__dirname}/src`
      }
    ]
  },
  output: {
    filename: 'packed.js',
    path: `${__dirname}/dist`
  },
  plugins: [HtmlPluginConfig]
};
```

With `webpack.config.js` complete, we can check that our Webpack pipeline results in the expected output.  Next step is to add a minimal `index.html` in the `src` directory:
```html
<!DOCTYPE html>

<html>
  <head>
    <title>React & Webpack</title>
  </head>
  <body>
    <div id="content"></div>
  </body>
</html>
```
Now running `webpack` in the root of the project should result in output like this:
```bash
$ webpack
Hash: f4a259286e4068f5a7b7
Version: webpack 1.13.3
Time: 855ms
     Asset       Size  Chunks             Chunk Names
 packed.js     156 kB       0  [emitted]  main
index.html  194 bytes          [emitted]
   [0] multi main 40 bytes {0} [built]
    + 35 hidden modules
Child html-webpack-plugin for "index.html":
        + 3 hidden modules
```
You should end up with a `index.html` and `packed.js` file in your `dist` folder.  Now you can `cd` into `dist`, start up `http-server`, navigate to the served-up page in your browser of choice, and you should see a friendly **Hello World!** message.

Your local React development environment is now configured.  As it can get tedious to run `webpack` after every change to your HTML or React components, you can set Webpack to watch for changes and automatically generate its output on any change to the files it affects with:
```bash
$ webpack --watch
```

## Further Reading
Webpack can do much more than just transpile JSX to JavaScript, such as transpile your Sass to CSS, minify and uglify your code for production, etc.  You can read up more on the various loaders and plugins available for Webpack to incorporate that functionality into your workflow.
- [About Webpack loaders](https://webpack.github.io/docs/loaders.html)
- [List of Webpack loaders](https://webpack.github.io/docs/list-of-loaders.html)
- [About Webpack plugins](https://webpack.github.io/docs/plugins.html)
- [List of Webpack plugins](https://webpack.github.io/docs/list-of-plugins.html)

repository: NewEvolution/react-resources

repo_name: NewEvolution/react-resources


text:
# Plugins

Plugins are rules and sets of rules built by the community that support methodologies, toolsets, *non-standard* CSS features, or very specific use cases. Their *package* names are prefixed with "stylelint". Their *rule* names are namespaced so that they do not clash with stylelint's core rules.

## Methodologies

-   [`stylelint-selector-bem-pattern`](https://github.com/davidtheclark/stylelint-selector-bem-pattern): Specify a BEM pattern for selectors (incorporates [postcss-bem-linter](https://github.com/postcss/postcss-bem-linter)).

## Non-standard syntax

### Packs

-   [`stylelint-scss`](https://github.com/kristerkari/stylelint-scss): A collection of SCSS specific linting rules for stylelint.

### Individual rules

-   [`stylelint-declaration-use-variable`](https://github.com/sh-waqar/stylelint-declaration-use-variable): Specify properties for which a SCSS variable must be used.

## Toolkits

### Primer

-   [`stylelint-selector-no-utility`](https://github.com/primer/stylelint-selector-no-utility): Disallow Primer utility classes within complex selectors.


text:
---
layout: post
title: 2013-12-09 General Assembly
---

## Agenda ##
   - Opening and Welcome
   - Appointment of the meeting chairperson
   - Appointment of the minute taker
   - Establishment of the quorum
   - Approval of the agenda
   - Report by the members of the executive board and discussion
     - Review change in statutes:  [[igsn:revision2013|draft statutes]] ([[igsn:statutes2011|statutes of 2011]])
       - New Translation, English version: {{:igsn:igsn_ev_statutes-en_diff_20130607.pdf|}} (German version sent in by email 6/13/2013)
     - New Applications for IGSN e.V. [[igsn:statutes#membership|membership]]
       - RPI: {{:igsn:igsn_rpi_application20131119.pdf|}}
       - CSIRO: {{:igsn:csiro-final-application-letter-131121.pdf|}}
       - WHOI: {{:igsn:whoi_igsn_application.pdf|}}
     - Recent and Upcoming Events
       - Townhall on Physical Samples
       - EGU deadline middle January
       - Webinar on IGSN for Mineral Physical community (recent interaction at an EarthCube workshop)
     - Budget proposal for 2014: update on plan - Potsdam Feb 2014
   - Discussion Topics
     - Membership of Agencies and Affiliates
     - Increasing International Participation
     - Endorsement from Standards Organizations
     - Biological Community
     - NASA involvement
   - Miscellaneous

## Minutes ##
   - Please see the PDF link: {{:igsn:igsn_ev_131209.pdf|}}

gha_language: CSS

gha_license_id: NOASSERTION


text:
# Storages

The platform abstracts away implementation details of various storages and focuses on key properties, which enables wrapping different storages into common interfaces.

## Types of storages

The platform recognizes three most important types of storages:
 * commit-log
 * random access storage
 * batch storage

We will describe the key properties of these three type below.

### Commit log
A commit log is a type of write-once-read-many storage. The key properties are, that it consists of immutable records, that can only be appended and have associated timestamp. Such records are called _events_. A commit log is thus an **unordered** sequence of events and thus forms a _partitioned event stream_.

Proxima platform further restricts this to _partitioned event stream of upserts_.
This is due to the requirement that every event in the event stream refers to a particular _(key, attribute)_ pair, thus every event describes a change of value (or insertion of new value) of particular attribute of particular entity at given timestamp. These proparties were defined in [Data model]({{< relref "/book/datamodel" >}}) and are constituents of **StreamElement** (see [javadoc](https://proxima.datadriven.cz/javadoc/latest/cz/o2/proxima/core/storage/StreamElement.html)), a commit log is therefore a stream of StreamElements.

A commit log, being a stream of upserts, can be reduced to table, via the _table-stream duality_ (see [Data model]({{< relref "/book/datamodel" >}}). We can create a table from the stream of upserts by _applying_ the upserts to the initial state of the table. Provided the commit log implementation (e.g. [Apache Kafka](https://kafka.apache.org/)) is able to hold all most recent updates to any key-attributes, then we can reconstruct a table from the stream by reading all the updates and applying each individual update to initially empty table. A commit log that has this property is called a _state commit log_, because it is able to hold the state (and modifications over time) of attributes.

Main purpose of a commit log is to persist all changes to the data stored in the platform and then eventually consistently propagate those to rest of the storages in the platform. Therefore this storage is often called _primary_ storage, while the other storages are often referred to as _replicas_ (see [Replication]({{< relref "/book/replication" >}})).

### Random access storage
A typical example of a random access storage is a NoSQL database, whose data can be accessed via random _get_ and _list_ requests. Such storage is an implementation of table, which can be derived from commit log by applying the upserts to the random access storage.

A typical requirements for a random access storage are as follows:
 * efficient lookup of key-attribute pairs
 * ability to list attributes (columns) based on prefix
 * ability to retrieve attributes of particular key (row) lexicographically ordered

The typical implementations of random access storage are:
 * [Apache Cassandra](https://cassandra.apache.org/_/index.html)
 * [Apache HBase](https://hbase.apache.org/)
 * [Google BigTable](https://cloud.google.com/bigtable)
 * many more

The main purpose of a random access database is to enable efficient serving of data stored in the platform to users.

### Batch storage
A batch storage serves as a durably persisted commit log. The purpose of such persistence is to be able to reprocess historical events that might not be present in the commit log itself, due to log rotation. Therefore the batch storage holds upserts partitioned by enitty and _time windows_ (e.g. one hour, one day). Every such time window of upserts is packed into single file (a blob), which is then uploaded on the batch storage and is not further mutable.

A typical implementations of batch storage are:
 * [Apache Hadoop HDFS](https://hadoop.apache.org/)
 * [Google Cloud Storage](https://cloud.google.com/storage)
 * [Amazon S3](https://aws.amazon.com/s3/)
 * [MinIO](https://min.io/)

Because the upserts are partitioned based on time windows, the batch storage is able to efficiently provide upserts only for a specific time interval and it is therefore not necessary to process all upserts at once.

## Mapping of attributes to storages

Attributes are mapped on various types of storages via a concept called _attribute family_. Each attribute family consists of a set of attributes of a single entity. Each of these attributes is then declared to be stored in a given type of storage - either a _commit log_, _random access storage_ or a _batch storage_. Let's see how to define such attribute family (`entities` are taken from [Data model]({{< relref "/book/datamodel" >}})):
```
# entities defined in data model
entities {
  user {
    attributes { ... }
  }
  product {
    attributes { ... }
  }
  event {
    attributes { ... }
  }
}

attributeFamilies {

  user-commit-log {
    entity: user
    attributes: [ "*" ]
    type: primary
    storage: "kafka://kafka-broker:9092/user-topic"
    access: commit-log
  }

  user-random-access {
    entity: user
    attributes: [ "details", "preferences" ]
    type: replica
    storage: "cassandra://cassandra-seed:9042/user_table?primary=user"
    access: random-access
  }

  user-events-random-access {
    entity: user
    attributes: [ "event.*" ]
    type: replica
    storage: "cassandra://cassandra-seed:9042/user_event_table?primary=user&secondary=stamp"
    access: random-access
  }

  product-commit-log {
    entity: product
    attributes: [ "*" ]
    type: primary
    storage: "kafka://kafka-broker:9092/product-topic"
    access: [ commit-log, state-commit-log ]
  }

  event-commit-log {
    entity: event
    attributes: [ "*" ]
    type: primary
    storage: "kafka://kafka-broker:9092/event-topic"
    access: commit-log
  }

}
```

This configuration defines 5 attribute families. Three attribute families - namely `user-commit-log`, `user-random-access` and `user-events-random-access` define families for entity `user`. The first one - `user-commit-log` is the _primary_ storage of all attributes of this entity (defined by the wildcard character `*`). The family is mapped onto Kafka topic `user-topic` that is defined in cluster which can be accessed using `kafka-broker:9042` endpoint. Note that the form of URI that identifies the storage (Apache Kafka, address of endpoint and name of topic) is defined by an appropriate IO module, that has to be added to the classpath during runtime. One of the possible modules is `cz.o2.proxima:proxima-direct-io-kafka`, which is part of the Direct Data operator. We will talk more about the details in chapter [Data operators]({{< relref "/book/operators" >}}).

The next attribute family is `user-random-access` which defines additional storage for attributes `details` and `preferences` of entity `user`. The primary family for these attributes is already defined, so this family has to be marked as `replica`. The family will use Apache Cassandra for storage, which will be accessed by seed `cassandra-seed:9042` and the data will be stored in table `user_table`. Note again, that how this will map onto the specific storage has to be defined by a dependency, in this case this could be `cz.o2.proxima:proxima-direct-io-cassandra`, which also defines how to construct the tables. In the default setting, the table should be defined with three columns - `user`, `details` and `preferences`. These columns will then map on key (name) of the entity user, and the respective attributes. The actual details of specific IO modules will be documented separately.

The last attribute family of `user` entity is `user-events-random-access`, which is another `replica` family with Apache Cassandra as storage. In this case, the family will store a _wildcard attribute_. Such attribute has to store the _suffix_ of the attribute to be able to restore it on reads. The `event.*` can represent a set of attributes that are distinguished by timestamp, so a valid option might be `event.1234567890000`, which defines an event that occured at timestamp<PHONE_NUMBER>000. Therefore the definition of the storage URI contains names `primary` and `secondary` columns, that will hold the key and suffix of the attribute, respecively.

The last two families - namely `product-commit-log` and `event-commit-log` - define two primary families for entities `product` and `event`, respectively. Note that every attribute of each entity has to have a primary attribute family, otherwise parsing the configuration results in an error.

## Selecting what to replicate

A replica attribute family might also specify an optional `filter`, which will then replicate only updates that match the filtering logic. This can be declared as in the following example configuration:
```
    # store incoming events to user's history
    user-event-history-store {
      entity: event
      attributes: [ "data" ]
      storage: "cassandra://"${cassandra.seed}/${cassandra.user-event-table}/
      # this is filtering condition, we want to select only some events
      filter: cz.o2.proxima.example.EventHistoryFilter
      type: replica
      # do not use this family for reading, we are using it for export only
      access: write-only
    }
```

The filter must implement [StorageFilter](https://proxima.datadriven.cz/javadoc/latest/cz/o2/proxima/core/storage/StorageFilter.html) interface.

With this high-level description of entities and attribute families, we are ready to see how will this definition by actually used to access the data and to ensure eventual consistency between primary and replica storages. Let's first see the latter described in [Replication]({{< relref "/book/replication" >}}).

gha_language: Java


text:
# :wolf: react-native-storybook-template

> Fully Featured React Native Storybook template for a quick start with loading stories and many quality of life improvements.

## :star: Features

- Usage directly within the [React Native CLI](https://github.com/react-native-community/cli)
- Consistent with the React Native Typescript template
- Ability to load new stories via yarn command
- Silences annoying metro bundler warnings
- Adds helpful code snippets for UI Theme switching (`src/index.tsx`) and using symlinked deps (`metro.config.js`)

## :arrow_forward: Usage

> I have only published to github, but the RN-CLI does not allow namespaced packages... I will publish directly to NPM in the future. For now, the command below using the repo URL works fine.

```sh
npx react-native init Storybook --template https://github.com/maxcwolf/react-native-storybook-template
```

### Note on the legacy CLI

There seems to be quite some confusion about the legacy CLI. This template only works with the new CLI. Make sure you have uninstalled the legacy `react-native-cli` first (`npm uninstall -g react-native-cli`), for the below command to work. If you wish to not use `npx`, you can also install the new CLI globally (`npm i -g @react-native-community/cli` or `yarn global add @react-native-community/cli`).

Further information can be found here: <https://github.com/react-native-community/cli#about>

## :bookmark: License

This project is [MIT](LICENSE) licensed.


text:
![GitHub](https://img.shields.io/github/license/JustinWeicht/19-budget-tracker)

  # 19-budget-tracker

  ## Description
  This application can be used to help keep track of the user's expenses. The user can use this application offline and still have their expenses saved.

  ## Table of Contents
  * [Installation](#installation)
  * [Usage](#usage)
  * [License](#license)
  * [Testing](#testing)
  * [Questions](#questions)

  ## Installation
  - Clone this repository
  - Open a terminal in the root of the folder then run  npm install from the command line
  - Lastly, run npm start and navigate to localhost:3001 in an internet browser

  ## Usage
  Deployed application on Heroku: https://module-19-budget-tracker.herokuapp.com/

  ## License
  This application uses the MIT license.

  ## Testing
  No packages were used to test this application.

  ## Questions
  Created by: [JustinWeicht](https://github.com/JustinWeicht)

  If you have questions regarding this application, please contact me at: [justinweicht11@gmail.com](justinweicht11@gmail.com)


text:
---
title: Adjusting Entries
description: Know about adjusting entries.
tags:
  - accounting
  - adjusting-entries
lastmod: 2021-04-26T00:40:06-05:00
publishdate: 2021-04-26T00:40:06-05:00
coverImageUrl: ""
coverGifUrl: ""
---

## Table of contents

## What are adjusting entries?

---

Adjusting journal entries are used to **record transactions that have occurred but have not yet been appropriately recorded in accordance with the accrual method of accounting**. This ususally happens at the end of an accounting period. Adjusting journal entries can also refer to financial reporting that corrects a mistake made previously in the accounting period.  The most common types of adjusting journal entries are `accruals`, `deferrals`, and `estimates`.

## Deferred revenues and expenses

---

You have to ask the right question in order to recognize deferred expenses or revenues.

### Deferred expenses

---

Question: Are there any `assets` that have been used up this period and should be expensed?

> **Examples**
>
> - Prepaid Rent
> - Prepaid Insurance
> - Depreciation or Amortization

```text
Journal Entry:
Debit Expense
    Credit Prepaid Asset
```

### Deferred revenues

---

Question: Are there any `liabilities` that have been fulfilled by delivery of goods/services that should be recognized as revenue?

> **Example**
>
> - Unearned rental revenue
> - Deferred subscription revenue

```text
Journal Entry:
Debit Unearned Revenue Liability
    Credit Revenue
```

## Accured revenues and expenses

---

You have to ask the right question in order to recognize accured expenses or revenues.

### Accured expenses

---

Question: Have any `expenses accumulated` during the period that have not yet been recorded?

> **Example**
>
> - Income taxes payable
> - Interest payable
> - Salaires and wages payable

```text
Journal Entry:
Debit Expense
    Credit Payable Liability
```

### Accured revenues

---

Question: Have any `revenues accumulated` during the period that have not yet been recorded?

> **Example**
>
> - Interest Receivable
> - Rent Receivable

```text
Journal Entry:
Debit Receivable Asset
    Credit Revenue
```

## Depreciation and Amortization

---

Allocate the original cost of a long lived asset over its useful life and it is the total cost of asset to the revenues it generates over its period of use.

> **Terminology**
>
> - Tangible assets (physical assets) require depreciation
> - Intangible assets (abstract assets) require amortization

### Amount Procedure

---

Depreciation is not deducted from the tangible asset account, rather its recorded in a `Contra Asset Account (XA)` called `Accumulated Depreciation` which has credit balance and is subtracted from PP&E on the balance sheet to get the `net book value`. Amortization is often (but not always) deducted directly from the intangible asset account.

### Straight-line Depreciation

---

> - Depreciation Expense = (Original Cost - Salvage Value) / Useful Life

![](https://media.giphy.com/media/3o85xt2wuVPYxIZxpS/giphy.gif)

repository: AkashSDas/notesflow

repo_name: AkashSDas/notesflow


text:
## Install

- Requires python 3.6+
```
pip install formulapy
```

## Usage

- process file : `formulapy file <filename> [--w]`

  **If `--w` is set, the file would be overwritten**.

- process text : `formulapy text <text>`

```
cmd> formulapy file test.py
from formulapy import tex

def Σ(arr):
    pass

cmd> formulapy text "tex[A,'cap',B,'cap',C]"
A∩B∩C
```

repository: thautwarm/formulapy

repo_name: thautwarm/formulapy


text:
## _The Gauntlet_

#### _Legend says:_
> Use all of your skills to survive the gauntlet.

#### _Goals:_
+ _Your hero must survive_
+ _Defeat all 4 ogres_
+ _Under 6 statements_

#### _Topics:_
+ **Basic Sintax**
+ **Arguments**
+ **Variables**
+ **While Loops**

#### _Items we've got (- or need):_
+ Simple boots
+ _Optional: Elementals codex 1+_
+ _Optional: Emperor's gloves_

#### _Solutions:_
+ **[JavaScript](theGauntlet.js)**
+ **[Python](the_gauntlet.py "Top-10: 4.2s")**

#### _Rewards:_
+ 21-41 xp
+ 27-55 gems

#### _Victory words:_
+ _YOU DON'T NEED THE ARMOR._

___

### _HINTS_

![](img/the_gauntlet.jpeg)

This level only needs **four** commands in a while-true loop.

With your powers of looping and variables, it should be no sweat to take down all these munchkins. In fact, with the **while-true loop**, you can do it in just five lines of code:

1. one to start the while-true loop,
2. one to move to where you can see an enemy,
3. one to store the nearest enemy into a variable,
4. and two to attack,
5. because munchkins take two hits with your current sword

___

repository: ripssr/Code-Combat

repo_name: ripssr/Code-Combat


text:
<!-- Thank you for contributing!

     Read more about how you can contribute in our contribution guide:
     https://github.com/augerai/a2ml/blob/master/CONTRIBUTING.md
-->

_Provide a description of what has been changed_

### Checklist

- [ ] Documentation has been added to relevant sections in the `docs/` directory
- [ ] Issue(s) exist for this PR and are referenced below (e.g. "Fixes #32")
- [ ] Tests have been added

Fixes #

gha_language: Python


text:
# Test.It.While.Hosting.Your.Service
A Testing framework that hosts your service during test execution and let you write BDD like test specifications.

The old deprecated windows service test project can be found here: https://github.com/Fresa/Test.It.While.Hosting.Your.Windows.Service

[![Build status](https://ci.appveyor.com/api/projects/status/v2shbr85puf808l1?svg=true)](https://ci.appveyor.com/project/Fresa/test-it-while-hosting-your-service)

[![Build history](https://buildstats.info/appveyor/chart/Fresa/test-it-while-hosting-your-service)](https://ci.appveyor.com/project/Fresa/test-it-while-hosting-your-service/history)

## Why?
This library helps you simplify writing integration tests for your service. It will bootstrap, start and host your service in memory while giving you handles to interact with the service making it possible to mock integration points to isolate the service during testing. This way you are no longer dependent on 3rd party installations when you run your application, and you no longer need to do tricky cleanup sessions before and after your tests, everything is done in memory and erased as soon as the test finishes.

## What's an Integration Test?
Good question! When it comes do different testing approches and terms, they tend to differ among us developers. In this context an integration test is a test that let you probe your 3rd party integration points while the application is running.

**Example:**
You have a service that receives commands from a message queue, aggregates events from a event store, applies domain logics, generate events which are stored in the event store and sent out on the message queue. The process looks something like this:
1. Receive command from message queue
2. Load a domain object by fetching events from an event store.
3. Apply domain logic based on the state of the domain object and the command being executed and generate new events.
4. Store events in the event store.
5. Send the new events onto the message queue.

So here we have two integration points:
1. The event store (let's say PostgreSQL)
2. The Message Queue (let's say RabbitMQ)

During a continues integration process, your build server probably runs tests. If it were to run an integration test, it would need to host the service and have control over a PostgreSQL and a RabbitMQ instance. These would be hard to control in an orderly fashion, specially during parallel testing.

In comes Test.It.While.Hosting.Your.Service to save the day!

## Download
https://www.nuget.org/packages/Test.It.While.Hosting.Your.Service/

[![NuGet Badge](https://buildstats.info/nuget/Test.It.While.Hosting.Your.Service)](https://www.nuget.org/packages/Test.It.While.Hosting.Your.Service/)

## Release Notes
**1.1.0** Changed the definition and name of the IServiceConfiguration to IServiceHostStarter

## Getting Started
tl;dr:
Runnable example available here: https://github.com/Fresa/Test.It.While.Hosting.Your.Service/blob/master/tests/Test.It.While.Hosting.Your.Service.Tests/When_testing_a_service.cs

### Setting Up Your First Test
It all begins by you creating a test class which will inherit `ServiceSpecification`. This specification defines how to configure, build, start and host your service and at the same time create a communication channel between your test and the hosted service and control the whole test process. All without forcing you into a certain test framework, ofcourse.

The `ServiceSpecification` requires an implementation of the `IServiceHostStarter` as generic parameter. You may roll your own configuration, or you can use the `DefaultServiceHostStarter` which will work in most cases. If you go for the latter it will need an application builder as generic parameter, i.e. you need to implement `IServiceBuilder`. `IServiceBuilder` will tell the hosting framework how to start your application.

You need to specify a test configurer in your implementation of the `IServiceBuilder`. The test configurer will let you reconfigure your application during startup so you can overwrite the 3rd party integration client registration for example. You will need an implementation of the `IServiceContainer` interface to achive this. I highly recommend using an IOC/DI container (my favorite is SimpleInjector, https://simpleinjector.org/), but you are free to roll your own service container, see [`SimpleServiceContainer`](https://github.com/Fresa/Test.It.While.Hosting.Your.Service/blob/master/tests/Test.It.While.Hosting.Your.Service.Tests/SimpleServiceContainer.cs).

Now, in your test, you will have a `Client` property available where you can control the service. It only exposes a `Disconnect` method, which you at most cases do not need to use, because the `ServiceSpecification` will handle shutdown when your test has finished.

### BDD
`ServiceSpecification` uses a BDD style for arranging your test. You can read more about BDD here: https://en.wikipedia.org/wiki/Behavior-driven_development

#### Given
`ServiceSpecification` exposes a method called `Given` which is overridable. This is where you set up your test. It exposes the `IServiceContainer` of your application, where you can override behaviour like the client implementation to your 3rd party applications (see Best Practices).

#### When
`ServiceSpecification` also exposes a method called `When`. This is where you execute some method exposed by any of your integration points for example.

#### Then
This is your test method. This is where you assert what ever you expect to happen.

### Best Practices
When reconfiguring your application during startup, please be advised that doing to much reconfiguring will heavy alter your application behaviour and you might no longer test any relevant functionality of the service. Keep the reconfiguration to a minimum to be sure to test as much as possible of the soon to be live functionality. Try to reconfigure your 3rd party dependecy systems as close to the network level as possible to assure you keep the reconfiguration to a minimum.


text:
# pdf-sign-check
A java / spring boot application to help you check your signed pdf documents. You upload the PDF file and you'll get its signing information. For more info on digital signing PDFs visit: https://developers.itextpdf.com/content/itext-7-digital-signatures-pdf. Please notice that this is a highly specialized app; if you need it you'll know it!

## Rationale

The organization I work for is a heavy user of signed PDF documents mainly for verification, timestamping and non-repudiation. Actually, all the internal correspondance is done using signed PDF documents and also many internal applications use signed PDF documents confirm various actions. This application offers a REST API so that other apps can easily test if a document is properly signed or not (and get some of the details of the signature). A common workflow is the following:

1. The user does some action in an Application X
1. The Application X generates a PDF document / receipt of that action
1. The user downloads the PDF document and signs it using his USB key
1. The user uploads the signed PDF document
1. Application X uses this project (pdf-sign-check) to make sure that the uploaded document is properly signed and has the correct details (for example signed by the correct user, some documents may need more than one signature etc)

One thing that may seem strange to people not familiar with digital signatures are steps 2-3-4: Why the user needs  to download the PDF document, sign it externally and re-upload it so it could be checked? Unfortunately signing PDF documents is possible only through client-side application (Adobe Acrobat, JSignPDF, custom client side apps etc) the whole download pdf - sign it - re-upload it is necessary.

## Installation

This is a spring boot application thus you should follow the instructions of the spring boot project: https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html. The app doesn't have any external dependencies like databases etc, you just upload the PDF and get the response, nothing is saved or triggered.

## Runing it in development

You can run the project using maven:

```
mvn spring-boot:run -DaddResources=True -Drun.addResources=True
```

You can then visit the application at http://<IP_ADDRESS>:8081 to see the (really simple) web interface or call it through the REST API. Properties can be configured through ``src/main/resources/application.properties``.

## Usage

Using the API:

```
curl -X POST http://<IP_ADDRESS>:8081/ -F<EMAIL_ADDRESS>-F json=on
```
or with python requests:

```
r =  requests.post('http://localhost:8081', files = {'file': file.read(), }, data={'json': 'on'} )
```

Or just visit the site and use the web interface.


text:
# Berkshelf
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/RiotGames/berkshelf)

Manage a Cookbook or an Application's Cookbook dependencies

## Installation

    $ gem install berkshelf

## Usage

See [berkshelf.com](http://berkshelf.com) for up-to-date usage instructions.

# Contributing

## Running tests

### Install prerequisites

Install the latest version of [Bundler](http://gembundler.com)

    $ gem install bundler

Clone the project

    $ git clone git://github.com/RiotGames/berkshelf.git

and run:

    $ cd berkshelf
    $ bundle install

Bundler will install all gems and their dependencies required for testing and developing.

### Running unit (RSpec) and acceptance (Cucumber) tests

Simply copy the `spec/knife.rb.sample` to `spec/knife.rb`, and point it at a
chef server. Berkshelf tests may upload and destroy cookbooks on your chef
server, so be sure to configure a server safe for this task.

    $ bundle exec guard start

See [here](https://github.com/tdegrunt/vagrant-chef-server-bootstrap) for a
quick way to get a testing chef server up.

# Authors and Contributors

* Josiah Kiehl<EMAIL_ADDRESS>* Jamie Winsor<EMAIL_ADDRESS>* Erik Hollensbe<EMAIL_ADDRESS>* Michael Ivey<EMAIL_ADDRESS>

repository: lastobelus/berkshelf

repo_name: lastobelus/berkshelf


text:
# dotSpace

A visualisation of paintings in three dimensional RGB space.

Each pixel from a 24-bit colour image of a painting is converted into a set of three coordinates.
The coordinates represent the colour information within each of the the red, green and blue channels.

This colourspace mapping may or may not be completely representative of the original painting.
[Colour representation and reproducibility](https://en.wikipedia.org/wiki/Color_space) is a complex topic, and capturing
the true colour of an object is heavily dependent on imaging conditions, equipment used as well as how the image is ultimately stored digitally.

Paintings themselves are not immune to changes in colour.  Pigments can fade or darken over time, while paper and canvas discolour as they age. Varnishes on a painting can also add tints to paintings as they turn yellow or darken.  Hence an old painting today can look very different from when it was first painted.

repository: origamiwolf/dotSpace

repo_name: origamiwolf/dotSpace


text:
---
title: Absinthe and Treachery
description: How's the weather in Patagonia?
date: 2022-03-19
tags:
  - books
  - life
layout: entry.njk
---
About a month or so into the new year, I saw this guy at the climbing gym with a massive paperback with him. He was reading between climbs.

Upon my inquiry, it became clear that this book, whatever the hell it was, had kept him at attention the whole time, and had even compelled him to bring it along. The book was called [The Spy and the Traitor](https://www.goodreads.com/book/show/37542581-the-spy-and-the-traitor). I asked him if he would recommend it, and then watched for his reaction. He smiled and said he would recommend it. I added it to my list.

Fast forward to the middle of March, where I find myself in a tempest of grown-up tasks and responsibilities, and finally see that the book is available on the public library's catalogue. So I check it out in audiobook format, and started it on a Friday.

By Sunday, I was done. About 14-15 hours of gruelling, fast-paced espionage and what not! Too much fun I think. Now I'm on the third book by the same author! Whew.

Anyway, this was the first post I published after successfully connecting adding CMS functionality to this site! Courtesy of [NetlifyCMS](https://netlifycms.org).

license: ISC

gha_language: SCSS

gha_license_id: ISC


text:
[![noswpatv3](http://zoobab.wdfiles.com/local--files/start/noupcv3.jpg)](https://ffii.org/donate-now-to-save-europe-from-software-patents-says-ffii/)
[![noswpatv3](http://zoobab.wdfiles.com/local--files/start/noupcv3.jpg)](https://ffii.org/donate-now-to-save-europe-from-software-patents-says-ffii/)
Features
======

An USB to JTAG Converter firmware running on CH552T, with some Gowin Quirks.

Issues
--------------

Serial port is working but with some limitation. Because the CPU is running at 16MHz, generate 115200 baudrate is not possible. The fastest standard baudrate is 57600, you can use 125000 and up to 1Mbps baudrate.

Pin layout
--------------

P1.0 - TMS

P1.4 & P1.7 - TCK

P1.5 - TDI

P1.6 - TDO

P3.0 - RXD

P3.1 - TXD

Boards
--------------

Sipeed Lichee Tang Nano.

Build
--------------

It requires make, sdcc and binutils.

If you got all of them, enter the src directory, and type "make" to generate binary file.

Programming
--------------

By WinchipHead's official WCHISPTOOL or LibreCH551 from rgwan. New chip with bootloader version > 2.30 may not working with librech551, it needs some fix.

License
--------------

MIT

Authors
--------------

Kongou Hikari<EMAIL_ADDRESS>


text:
[Emulators](emulation) in Alphabetical order

## Open Source Active Projects

* [AzerothCore](http://www.azerothcore.org): Fully Support for Wrath of the Lich King (3.3.5a)

* [CMangos](https://github.com/cmangos): Support for multiple expansions

* [Mangos](https://www.getmangos.eu/): Support for multiple expansions

* [TrinityCore](https://www.trinitycore.org): Support for multiple expansions

repository: Muaenn/wiki-en

repo_name: Muaenn/wiki-en


text:
# Geo Distance Range Filter

> More info about geo distance range filter is in the [official elasticsearch docs][1]

Filters documents that exists within a range from a specific point.

## Simple example

```JSON
{
    "filtered" : {
        "query" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_distance_range" : {
                "from" : "200km",
                "to" : "400km",
                "pin.location" : {
                    "lat" : 40,
                    "lon" : -70
                }
            }
        }
    }
}
```

And now the query via DSL:

```php
$geoDistanceRangeFilter = new GeoDistanceRangeFilter(
    'pin.location',
    ['from' => '200km', 'to' => '400km'],
    ['lat' => 40, 'lon' => -70]
);

$search = new Search();
$search->addFilter($geoDistanceRangeFilter);

$queryArray = $search->toArray();
```

[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-range-filter.html

repository: emgiezet/ElasticsearchDSL

repo_name: emgiezet/ElasticsearchDSL


text:
# 2. Getting Started
To start with Toungette, just download the library from
packagist with:\
`composer require oviedev/toungette`
\
\
**NOTE:** you also need to add `"minimum-stability": "rc"` to your `composer.json`. That's
because simplehtmldom doesn't have a stable release yet (at least on packagist), and you
will get an error, while downloading Toungette
\
Now, if you want to translate a single page, create 3 files.
`schem.json`, `index.tounge` and `index.php`.
\
\
[< Back](whatistoungette.md) | [Next >](basics.md)

repository: OvieDev/toungette

repo_name: OvieDev/toungette


text:
---
layout: post
title: Scientist vacancy in AMPRI Bhopal last date 8th April-2016
date: 2016-03-07 04:48
comments: true
tags:  CSIR Institute MP Online Scientist
archive: false
---
Applications are invited form young and energetic Indians for the following posts  of Scientists in AMPRI Bhopal :

- Scientist Gr.IV(2) :  08 posts, Pay Band : PB-3 Rs. 15600 - 39100 Grade Pay Rs. 6600, Age : 32 years as on 30/7/2009

**How to Apply** : Apply online at AMPRI website from 05/03/2016 to 08/04/2016 only. Take print out of the system generated registration form and sent on or before 25/04/2016.

Details and online application form is available at <http://www.ampri.res.in>

repository: anchalrani/getopportunity

repo_name: anchalrani/getopportunity


text:
# Security Policy

 We are not responsible for any losses that happened by use of our software.
* Make sure to always download our project from original source

 About the security

* Project is open source (code is visible and checked by everyone)
* Community trusted (Many use our software without an issue)
* Well tested (We make sure everything works right and that is secure before pushing an update)
* We make sure there is no active issues (In case of an issue we push an patch as soon as possible (currently there was only one or two issues with newly added features that got fixed asap)
* We keep the project updated
* In case of any major issues we will post an disclaimer and mark the project unsafe as soon as possible

About the information security check the [Privacy Policy](https://github.com/OSL-Works/Steam-Card-Bot-PRO/blob/master/.github/PRIVACY.md)

## Trusted Versions

 We do not recommend use of the past releases. (They exist for changes comparison and history of the code itself)

| Version | Supported          |
| ------- | ------------------ |
| Latest release / Master Branch  | :white_check_mark: |
| Past releases   | :x:                |

## Reporting a Vulnerability

To report an issue or vulnerability make sure to open an issue here on github or create an ticket on discord server explaining the problem.

repository: Refloow/Steam-Card-Bot-PRO

repo_name: Refloow/Steam-Card-Bot-PRO


text:
---
title: Functional Programming in Scala Chapters 1 & 2
author: Ben Kolera
twitter: benkolera
slides: https://github.com/benkolera/talk-fp-in-scala-1-2
ytid: Sj12uS1Oc48
event: 227857530
---
This is the first instalment of following through the FP in Scala book as part
of our meetups.

Chapter 1 introduces the essence of functional programming and why we should
care about it.

Chapter 2 is a crash course in scala syntax that will get you up and running
ready to play for the next chapters.

The book has exercises in it: we're going to have time at the hack night for
people to come in, work on and get help if they need it.

If you are planning to follow along, I'd highly recommend buying the (e)book
and reading along: you'll learn better if you read and watch the talks.

repository: bfpg/talks

repo_name: bfpg/talks


text:
# kafka_consumer_group_exporter

![Build](https://github.com/GuillaumeWaignier/kafka_consumer_group_exporter/workflows/Build/badge.svg)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=GuillaumeWaignier_kafka_consumer_group_exporter&metric=alert_status)](https://sonarcloud.io/dashboard?id=GuillaumeWaignier_kafka_consumer_group_exporter)

JMX exporter for Kafka Consumer Group Offset

## Usage (Command line)

```bash
./bin/consumer-offset-exporter.sh ./config/config.properties
```

The kafka configuration file correspond to the standard kafka [admin client config](https://kafka.apache.org/documentation/#adminclientconfigs).

_Exemple of configuration file_

```properties
bootstrap.servers=localhost:9092
retries=5
```

_Export metric with prometheus_

[JMX exporter](https://github.com/prometheus/jmx_exporter) can be used to export metrics for Prometheus.

```bash
export java_option=-javaagent:/jmx_prometheus_javaagent-0.11.0.jar=8080:/config/prometheus-exporter.yml
./bin/consumer-offset-exporter.sh ./config/config.properties
```

## Usage (Docker)

```bash
docker run -e KAFKAEXPORTER_BOOTSTRAP_SERVERS=kafkaip:9092 -p 8080:8080 ianitrix/kafka-consumer-group-exporter:v0.0.2
```

_Environment variables_

All kafka configuration is done with environment variables prefixed with **KAFKAEXPORTER_**

All dot is replaced by underscore and the variable name must be in upper case.

## Helm

You can use the helm chart to deploy it into Kubernetes cluster.
See [the documentation](https://github.com/GuillaumeWaignier/kafka_consumer_group_exporter_helm_charts).

## Compute lag with prometheus

You need to already collect the log end offset by using the kafka broker metric.

```yaml
- record: kafka_lag
  expr: sum(max(kafka_log_end_offset) by (partition, topic) - on (topic, partition) group_right kafka_consumer_consumeroffset) by (topic, groupid)
```

If the expression does not work, carefully check the metric:
- kafka_log_end_offset: check its name and the properties names corresponding to *partition* and *topic*
- kafka_consumer_consumeroffset: check its name and the properties names corresponding to *topic* and *groupid*

### Log Level

You can set log level with environment variable: **LOG_LEVEL**
Allowed value are: **DEBUG**, **INFO**, **WARN**, **ERROR**

```bash
export LOG_LEVEL=INFO
```


text:
---
layout: post
title: "FINAL PROJECT!! React/Redux"
date: "2020-01-25 10:53:48 -0800"
---

Github:
[client](https://github.com/DarrelJames/calorie-tracker-client)
[backend](https://github.com/DarrelJames/calorie-tracker-api)

I created a calorie tracker that'll track the foods you consumed on a daily basis and persist your data into Rails API.

I started off by creating the backend by generating a rails app with the `--api` flag. Also with deployment in mind, I specified which database to use by adding `-d postgresql`. So the final command to create the app is:

`rails new NAME --api -d postgresql`

For user Authentication I used JSON web tokens. I used devise to handle the creation of user and tokens. I followed a video tutorial by a Flatiron instructor [here](https://youtu.be/qjtht03t7z4)

After getting authentication going and stubbed out all the model resources. I generated my react app by running

`npx create-react-app NAME`

Libraries Used:
* [axios](https://github.com/axios/axios): Used to make http requests to API
* [moment](https://github.com/moment/moment): Mainly formatting
* [react-redux](https://react-redux.js.org/): State container
* [redux-form](https://redux-form.com/8.2.2/): Easily connect forms to store and have tons more features, Instant validations for example
* [redux-thunk](https://github.com/reduxjs/redux-thunk): dispatch asynchronously
* [react-datepicker](https://reactdatepicker.com/): Simple Date picker, used to select log by date

I really enjoyed building this app with react. React makes it really easy to get going. Having a solid file structure makes the development process fluid. That was something I struggled with in my last project, JS/Rails. I definitely will go back and learn more about vanilla javascript design patterns.