text:
# release CIS RedHat Enterprise Linux 7 Benchmark v3.0.1 - 09-21-2020

# 1.1.3

- [#313](https://github.com/ansible-lockdown/RHEL7-CIS/issues/313)
  thanks to @xiranlyu and community member Tony(whozzyourdaddy)

## 1.1.2

- update to yamllint
- update linting
- update to galaxy workflow
- rule <IP_ADDRESS> moved to block
- readme update and badges
- full module names added

## 1.1.1

- Oracle alignment now works and tested with oracle7.9
- audit alignment benchmark version used to test against
- goss audit version updated
- lint file update
- workflow updates

## Major 1.1

- Upgrade to CIS 3.1.1

## Whats new 1.0.0

- New auditing tool all controlled via defaults main. run on host using [goss](https://github.com/aelsabbahy/goss)
- reorder of rules inline with CIS changes
- If Python3 discovered adds the epel repo to install python-rpm and then disables the repo after installing
- Adding of the goss module to the library path
- Python3 now default for control node (should be backward compatible in setup)
- Grub password no longer created using passlib needs to be supplied as variable
  - assert has been created if rule still enabled and password not changed
- Use of the packages facts module

### Highlights

- rhel7cis_allow_reboot is now an option to reboot at the end of remediation - default false
- linting - including command replaced with shell
- section 1
  - 1.1 rewritten to providing better auditing and output
  - 1.3 sudo no longer required move to section 5
  - 1.4.1 bootloader password reworked
  - other groups changes increased tests
  - more controls for GDM
- section 2
  - reorder of server services
  - rsyncd masked
  - 2.5 - 2.4
- section 3
  - some controls now L2
  - tidy of some rules
  - 3.1 disable ipv6 now via grub 9No longer sysctl
- section 4
  - tidy up
- section 5
  - sudo moved from 1.3 to 5.2
  - Other controls changed numbers
  - ssh kex, mac and ciphers updates
- section 6
  - many control orders changed
  - 6.2.11 create missing home dirs rewritten

## Whats new in 1.0.3

- Thanks to Thulium-Drake
  - 6.1.12 - rework audit (no score) control #204
  - <IP_ADDRESS> regex improvement #202

- Thanks to jlosito
  - 1.2.1& 1.2.2- allow centos gpg key check #215
  - 5.1.1 & 5.2.22 -typo fixes #221
  - <IP_ADDRESS> - idempotence and Inactive whitelist added to defaults main #222
  - 5.5 - Idempotence improvement #213

- <IP_ADDRESS> - Idempotence improvement #217
  - thanks to andreyzher

- 1.5.2 moved grub capture to prelim

- 5.6 ability to supply an sugroup rather than default to wheel
  - thanks to ihotz #234

## Whats new in 1.0.2

- renamed goss library and aligned ansible.cfg file
  - thanks to Thulium-Drake

- selinux variable in defaults main - default enforcing
  - <IP_ADDRESS>-5 now idempotent

## Whats new 1.0.1

- Fixed typos
- Added audit output file permissions

branch_name: refs/heads/devel

gha_language: YAML


text:
# next-with-apollo

![Actions Status](https://github.com/lfades/next-with-apollo/workflows/Node%20CI/badge.svg)

Apollo HOC for Next.js

For `Next v9` use the latest version

For `Next v6-v8` use the version `3.4.0`

For `Next v5` and lower go [here](./README_v1.md) and use the version `1.0`.

## How to use

Install the package with npm

```sh
npm install next-with-apollo
```

or with yarn

```sh
yarn add next-with-apollo
```

> Note: [apollo-boost](https://github.com/apollographql/apollo-client/tree/master/packages/apollo-boost) is used in this example because is the fastest way to create an `ApolloClient`, but is not required. </br>
> Previously this package had some configs to create an `ApolloClient`, those were removed but you can see an example of how to create the same `ApolloClient` by yourself [here](https://github.com/lfades/next-with-apollo/issues/13#issuecomment-390289449).

Create the HOC using a basic setup and [apollo-boost](https://github.com/apollographql/apollo-client/tree/master/packages/apollo-boost):

```js
// lib/withApollo.js
import withApollo from 'next-with-apollo';
import ApolloClient, { InMemoryCache } from 'apollo-boost';
import { GRAPHQL_URL } from '../configs';

export default withApollo(
  ({ ctx, headers, initialState }) =>
    new ApolloClient({
      uri: GRAPHQL_URL,
      cache: new InMemoryCache().restore(initialState || {})
    })
);
```

`withApollo` accepts a function that receives `{ ctx, headers }` in the first render with SSR (Server Side Rendering). This is done to fetch your queries and [hydrate the store](https://dev-blog.apollodata.com/how-server-side-rendering-works-with-react-apollo-20f31b0c7348)
before we send the page to the browser.

`withApollo` will receive `{ initialState }` if the render is happening in the browser, with the following line we're hydrating our cache with the initial state created in the server:

```js
cache: new InMemoryCache().restore(initialState || {});
```

Now let's wrap Next's `App` in `pages/_app.js`:

```js
import App from 'next/app';
import { ApolloProvider } from '@apollo/react-hooks';
import withApollo from '../lib/withApollo';

class MyApp extends App {
  render() {
    const { Component, pageProps, apollo } = this.props;

    return (
      <ApolloProvider client={apollo}>
        <Component {...pageProps} />
      </ApolloProvider>
    );
  }
}

export default withApollo(MyApp);
```

> Note: If using `react-apollo`, you will need to import the `ApolloProvider` from `react-apollo` instead of `@apollo/react-hooks`.

Now every page in `pages/` can use anything from `@apollo/react-hooks` or `react-apollo`. Pages can access the `ApolloClient` too:

```js
Page.getInitialProps = ctx => {
  const apolloClient = ctx.apolloClient;
};
```

**withApollo** can also receive some options as second parameter:

| Key               | Type     | Default  | Note                                                                                |
| ----------------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `getDataFromTree` | `string` | `always` | Should the apollo store be hydrated before the first render?, allowed values are `always`, `never` or `ssr` (don't hydrate on client side navigation) |

Usage example:

```js
export default withApollo(() => new ApolloClient({ uri: GRAPHQL_URL }), {
  getDataFromTree: 'always'
});
```

license: MIT

repository: NazoSnare/next-with-apollo

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: NazoSnare/next-with-apollo


text:
# VPP-L3-BGP routes example

The example demonstrates the capability to retrieve and transport the basic BGP information (prefix/next hop) from the BGP Route Reflector node to the VPP node.
It also demonstates how to connect different Ligato components([VPP-Agent](https://github.com/ligato/vpp-agent), [BGP Agent](https://github.com/ligato/bgp-agent)) to achieve higher goals.

For quick setup and run of this and other examples you can use makefile:
```
make run-examples
```
For explanatory step-by-step procedure, keep reading.

### Architecture & Data flow
![arch](../../docs/imgs/vppl3bgproutesExampleArchitecture.png "VPP L3 BGP routes Example")

The example integrates together all needed parts to achieve the VPP configuration based on the BGP information.
It combines the [VPP-L3-BGP plugin](../../plugins/vppl3bgp), the [VPP-Agent](https://github.com/ligato/vpp-agent)'s [L3 plugin](https://github.com/ligato/vpp-agent/tree/master/plugins/defaultplugins/l3plugin) and the [BGP-Agent](https://github.com/ligato/bgp-agent)'s [GoBGP plugin](https://github.com/ligato/bgp-agent/tree/master/bgp/gobgp). The `L3 plugin` is configured to connect to the VPP and the `GoBGP plugin` to connect to the Route Reflector node.

The data flow starts in the Route Reflector node, where we manually insert the new path into the [Route Reflector node](https://github.com/ligato/bgp-agent/tree/master/docker/gobgp_route_reflector/README.md). Remote GoBGP plugin will be advertized about this new path via standard BGP protocol. Then this information will be translated to the API format that is exposed to all registered watchers of the `GoBGP plugin`. This translation is needed due to possible future plugins that can retrieve the BGP information using other frameworks(exaBGP, Quagga,...) and therefore in different formats.

The `VPP-L3-BGP plugin` is registered as watcher client in the `GoBGP plugin` and will be notified about any new update. The `VPP-L3-BGP plugin` will translate this information into the VPP configuration structures provided by the `L3 plugin` inside the VPP-Agent. From there, the VPP-Agent will handle the rest of data flow down to the VPP.
### Infrastructure setup
To be able to run this example you must setup the infrastructure first. We will use docker containers. This is the docker containers architecture for this example:
![arch](../../docs/imgs/vppl3bgproutesExampleDockerArchitecture.png "docker container architecture of end-to-end BGP Example")

It consist of the [BGP-to-VPP](../../docker/dev_bgp_to_vpp) docker container and the [Route reflector](https://github.com/ligato/bgp-agent/tree/master/docker/gobgp_route_reflector) docker container. In infrastructure setup we will only create images for these containers.

At this point, it is expected that you have:
 * Installed the docker CE (docker engine version >=1.10). If you haven't please install it(for [ubuntu](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) or [other](https://docs.docker.com/engine/installation/)).
 * Properly filled the [GOPATH environment variable](https://github.com/golang/go/wiki/Setting-GOPATH). Installing go is not necessary.
 * Downloaded the [Ligato VPP sample service](https://github.com/ligato/vpp-sample-service). In case of installed go, just run:
```
go get github.com/ligato/vpp-sample-service
```
Change the path to the BGP-to-VPP docker folder
```
cd $GOPATH/src/github.com/ligato/vpp-sample-service/docker/dev_bgp_to_vpp
```
Build the BGP-to-VPP image
```
./build-image.sh
```
or pull already created image from [Dockerhub](https://hub.docker.com/r/ligato/dev-bgp-to-vpp/)
```
./pull-docker.sh
```
Change path to the Route reflector docker folder
```
cd $GOPATH/src/github.com/ligato/vpp-sample-service/vendor/github.com/ligato/bgp-agent/docker/gobgp_route_reflector
```
Build the Route reflector image
```
./build-image-routereflector.sh
```
(Note: Pulling the Route reflector image from [Dockerhub](https://hub.docker.com/r/ligato/gobgp-for-rr/) is possible too, but DockerHub version can differ from version needed for this example)

Now you should see something like this:

```
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
ligato/gobgp-for-rr     v1.24               46711f3237ed        5 seconds ago       973MB
ligato/dev-bgp-to-vpp   v1.5                ee204db901fe        4 minutes ago       4.78GB
```
Process of building of the images has downloaded also other images that served as base images in the creation process. You can delete these base images if you want.

To be able to have static ip addresses for running docker images, we need to create separate network that can be used by docker.
```
./usage_scripts/create-ligato-network-for-docker.sh
```
### Example run
We will need 4 linux terminals. To differentiate commands in terminal we will use different [prompt string](http://www.linuxnix.com/linuxunix-shell-ps1-prompt-explained-in-detail) for each terminal:

`[BGP-to-VPP/vpp-console]$`

* The terminal for the VPP console inside the BGP-to-VPP docker container. We can interact with the VPP here, but also see its new log entries.

`[BGP-to-VPP/example-run]$`

* The terminal for Running go example inside the BGP-to-VPP docker container.

`[route-reflector]$`

* The terminal for running BGP server inside the Route reflector docker container that acts as a Route reflector. This terminal is also for adding the prefix/nexthop information directly to the BGP server(acting like Route reflector) in the Route reflector docker container.

Lets run the example:

1. Start the docker containers, VPP and BGP server.

Change the directory so we can use the BGP-to-VPP docker helper scripts
```
[BGP-to-VPP/vpp-console]$ cd $GOPATH/src/github.com/ligato/vpp-sample-service/docker/dev_bgp_to_vpp/scripts
```
Start the BGP-to-VPP docker container
```
[BGP-to-VPP/vpp-console]$ ./start-bgp-to-vpp.sh
```
Start the VPP inside the BGP-to-VPP docker container
```
[BGP-to-VPP/vpp-console]$ ./start-vpp-interactive.sh
```
Switch to the ```[route-reflector]``` terminal and change the directory so that `start-routereflector.sh` script can find the gobgp configuration
```
[route-reflector]$ cd $GOPATH/src/github.com/ligato/vpp-sample-service
```
Start the route reflector docker container
```
[route-reflector]$ ./vendor/github.com/ligato/bgp-agent/docker/gobgp_route_reflector/usage_scripts/start-routereflector.sh gobgp-client-in-docker
```
2. Run the go code example

Switch to the ```[BGP-to-VPP/example-run]$``` and change the directory so we can use the BGP-to-VPP docker helper scripts
```
[BGP-to-VPP/example-run]$ cd $GOPATH/src/github.com/ligato/vpp-sample-service/docker/dev_bgp_to_vpp/scripts
```
Run the go example (it will be build automatically before running)
```
[BGP-to-VPP/example-run]$ ./run_vpp_l3_bgp_routes_example.sh
```
(Note: The run of the example will take short time to compile and when running it will initially take some time, ~20 seconds, to receive the first BGP information due to the session initialization)

3. Add new route information to the Route reflector
Switch to the ```[route-reflector]``` terminal and change the directory so we can use the route reflector docker helper scripts
```
[route-reflector]$ cd $GOPATH/src/github.com/ligato/vpp-sample-service/vendor/github.com/ligato/bgp-agent/docker/gobgp_route_reflector/usage_scripts/
```
Connect to the bash console inside the Route reflector docker container
```
[route-reflector]$ ./connect-to-routereflector.sh
```
Add new prefix(`<IP_ADDRESS>/24`)/nexthop(`<IP_ADDRESS>`) information to the Route reflector
```
[route-reflector]$ gobgp global rib add -a ipv4 <IP_ADDRESS>/24 nexthop <IP_ADDRESS>
```
(Note: `<IP_ADDRESS>` is the IP address of the VPPs virtual interface)

4. Verify that the prefix/nexthop information did arrive in the VPP
Switch back to the `[BGP-to-VPP/vpp-console]` and list in the VPP console the appropriate configuration (IP Fib configuration)
```
[BGP-to-VPP/vpp-console]$ vpp> show ip fib
```
You should see something like this:
```
...
<IP_ADDRESS>/24
  unicast-ip4-chain
  [@0]: dpo-load-balance: [proto:ip4 index:13 buckets:1 uRPF:12 to:[0:0]]
    [0] [@10]: dpo-load-balance: [proto:ip4 index:12 buckets:1 uRPF:8 to:[0:0]]
          [0] [@3]: arp-ipv4: via <IP_ADDRESS> memif0/1
...
```
Additionally, you can check also the go runtime logs for adding prefix/nexthop in the `[BGP-to-VPP/example-run]` terminal. You should see somthing like this:
```
DEBU[0030] SendStaticRouteToVPP &{65001 <IP_ADDRESS>/24 <IP_ADDRESS>}  loc="vppl3bgp/plugin.go(55)" logger=bgptol3example tag=00000000
INFO[0030] Creating new route <IP_ADDRESS>/24 -> <IP_ADDRESS>  loc="l3plugin/route_config.go(67)" logger=defaultLogger tag=00000000
INFO[0030] Route <IP_ADDRESS>/24-<IP_ADDRESS> registered      loc="l3plugin/route_config.go(92)" logger=defaultLogger tag=00000000
```

repository: Batky/vpp-sample-service

repo_name: Batky/vpp-sample-service


text:
# BoxCraft
A Open Source Versionn of Minecraft adapted from a project named WebCraft

#Features

-QuickStart!

-Easy to use!

-Use on your computer or on a web server!*

-Play with your friends!**

-Open Source

-No Strings Attatched!

-Just BoxCraft!!!

*See Here for details

**Requires web-based server see the startup guide for details!


text:
[**Review #1154 | Rum Review #70 - Helios Rum **]( https://t8ke.review/review-1154-helios-rum/)

**The Schtick:** "It is a dry column using 100% sugar cane in Okinawa.                                                                                +
Characterized by taste and rich flavor of the sugar cane.                                                                                +
HELIOS distillery using sugar cane in Okinawa in 1961                                                                                +
From the rum-making began.                                                                                +
This is Matsuda Tadashi, the founder's "wine in the land sourced is made from crops"                                                                                +
Principle and is the starting point.                                                                                +
"Heliosram" is a wine exactly the origin of the Helios distillery said." For maximum authenticity, I took the Japanese and translated it to English using Google, so here we are.

-----

**Distiller:** Helios

**Bottler:** Helios

**Selection:** N/A

**ABV:**  40% ABV

**Age:** NAS

-----

**Nose:**  Sweet, musty, tomatoes, overripe fruits. Really really really sweet in a rotting fruit way without that big ester punch. Really weird. Light vinegar.

**Taste:** Thin to medium. Really strange. Sweet and earthy, musty and funky. VInegar, tomatoes, banana, odd oerfume note I cant put my finger on.

**Finish:** Short, sweet and funky. Oddly fruity again in a way I can't descripbe

**Overall:** This is super weird and interesting but it's not for me. It's so sweet and pungent in a non estery way that leaves me with the strangest impression.

Thanks for reading!

**Rank: 4**

-----

[WEBSITE](https://t8ke.review) | [SEARCHABLE ARCHIVE](https://t8ke.review/review-archive/) | [SUBREDDIT](https://reddit.com/r/t8kereviews)

-----

Decoded:

**1** | **Disgusting** | So bad I poured it out.

**2** | **Poor** | I wouldn't consume by choice.

**3** | **Bad** | Multiple flaws.

**4** | **Sub-par** | Not bad, but many things I'd rather have.

**5** | **Good** | Good, just fine.

**6** | **Very Good** | A cut above.

**7** | **Great** | Well above average

**8** | **Excellent** | Really quite exceptional.

**9** | **Incredible** | An all time favorite

**10** | **Perfect** | Perfect

----


text:
# Write Concern in Ruby

## Setting the write concern

Write concern is set using the `:safe` option. There are several possible options:

    @collection.save({:doc => 'foo'}, :safe => true)
    @collection.save({:doc => 'foo'}, :safe => {:w => 2})
    @collection.save({:doc => 'foo'}, :safe => {:w => 2, :wtimeout => 200})
    @collection.save({:doc => 'foo'}, :safe => {:w => 2, :wtimeout => 200, :j => true})

The first, `true`, simply indicates that we should request a response from the server to ensure that to errors have occurred. The second, `{:w => 2}`, forces the server to wait until at least two servers have recorded the write. The third does the same but will time out if the replication can't be completed in 200 milliseconds.
Setting a value for `wtimeout` is encouraed.

Finally, the fourth example forces the journal to sync to disk if journaling is enabled.

## Write concern inheritance

The Ruby driver allows you to set write concern on each of four levels: the connection, database, collection, and write operation.
Objects will inherit the default write concern from their parents. Thus, if you set a write concern of `{:w => 1}` when creating
a new connection, then all databases and collections created from that connection will inherit the same setting. See this code example:

    @con = Mongo::Connection.new('localhost', 27017, :safe => {:w => 2})
    @db  = @con['test']
    @collection = @db['foo']
    @collection.save({:name => 'foo'})

    @collection.save({:name => 'bar'}, :safe => false)

Here, the first call to Collection#save will use the inherited write concern, `{:w => 2}`. But notice that the second call
to Collection#save overrides this setting.

repository: masukomi/mobtvse

repo_name: masukomi/mobtvse


text:
# xrates retriever

## Description
Exchange Rates Retriever fetches historical exchange rates for any day since 1999 for all currencies including cryptocurencies. It is simple in use

## Features
- It supports all currencies including cryptocurrencies.
- It can retrieve historical exchange rates for any day since 1999.
- It retrieves mutliple exchange rates for multiple dates in one go.
- The base currency is variable.
- The user can just fill-in the data in the default input file input.txt.

## Installation
- Clone the repository using `git clone https://github.com/thanosa/xrates-retriever.git`
- Install Python 3.X
- Install forex-python with `pip install forex-python`
More details about forex-python:
https://forex-python.readthedocs.io/en/latest/usage.html

## Usage
### Default input file
1. Fill-in the currency pair and the historical dates as in: data\input.txt
2. Execute the application without specifing (input_file_path) (check below)
3. Receive the output from the data\output_(timestamp).txt

### Custom input file
1. Create a new input file as described in: data\input_template.txt
2. Execute the application giving the (input_file_path) as 1st argument (check below)
3. Receive the output from the data\output_(timestamp).txt

### Execution under Linux
- If python is in $PATH variable, execute:
`python xrates_retriever.py (input_file_path)`

example for the default input file
`python xrates_retriever.py`

example for the custom input file
`python xrates_retriever.py data/my_input.txt`

- If python is not in $PATH variable, execute:
`/path/to/python src/xrates_retriever.py (input_file_path)`

example for the default input file
`/path/to/python xrates_retriever.py`

example for the custom input file
`/path/to/python xrates_retriever.py data/my_input.txt`

### Execution under Windows
- If python is in %PATH% variable, execute:
`python xrates_retriever.py (input_file_path)`

example for the default input file
`python xrates_retriever.py`

example for the custom input file
`python xrates_retriever.py data\my_input.txt`

- If python.exe is not in %PATH% variable, execute:
`/path/to/python.exe src/xrates_retriever.py (input_file_path)`

example for the default input file
`/path/to/python.exe xrates_retriever.py`

example for the custom input file
`/path/to/python.exe xrates_retriever.py data\my_input.txt`

## Tests
This is a test in which the default input file is used so there is file argument provided.
There are 9 valid dates that are processed for which the exchange rates are written in the output_20200114_191518.txt

This is a test in which a custom input file is processed.
171 valid historical dates that are retrieved for the USD currency based on EUR.

This is a test in which the custom input_cases.txt input file is processed.
There are 2 valid dates for which the exchange rates are written in the output_20200114_191736.txt
and 3 invalid dates for which "na" is written in the errors_20200114_191736.txt

This is a test in which a wrong currency code has been provided.
The user is informed about the correct date format.
In this case there is no output file produced.

## Contribute
Pull requests, bug reports, and feature requests are welcome.

## License
This software is under MIT licence.

repository: thanosa/xrates-retriever

repo_name: thanosa/xrates-retriever


text:
---
comments: true
date: 2011-10-25 12:35:00
layout: post
slug: building-multiple-visual-studio-project-configurations-with-msbuild
title: Building multiple Visual Studio project configurations with msbuild
wordpress_id: 551
---

I've been cleaning up a lot of projects lately, and one of the things that I really needed to get sorted out was build scripts for everything so that I had a repeatable way of obtaining correct binary builds of all of my dependencies. Typically I would use msbuild or NAnt to define how the code should be built, but I already had Visual Studio project files for the projects in question and I wanted them to be resilient to having the project files messed with in Visual studio.

Since Visual Studio project files are just custom msbuild definitions supplied by Microsoft, we can build them with msbuild on the commandline. I didn't want to do any custom tweaking of the files themselves, since I've had issues with losing my changes when someone decided to mess with the project file. What I really want out of the project file is the list of the files that need to be built. In the future I'm thinking about devising a way to create a wrapper msbuild project that looks at the parts of the Visual Studio file for the source file list and dependencies and defines its own build targets, but I'm too busy to try to get that working for now.

I've had all sorts of issues with trying to tweak msbuild files. Microsoft really came up with a powerful build system, but unfortunately it is hamstrung when trying to work with Visual studio. Some things I wanted to do in the past included getting a version number from the Assemblyinfo.cs file. This turned into a fiasco because of a silly limitation in the scope of property variables within the build targets.

After all of this fiddling I have come to the conclusion that, at least for now, the best way to get msbuild to build a Visual Studio project in a particular way is to manhandle the property settings on the commandline when calling msbuild.

Here is a sample batch file that I use to call msbuild. I want to set the .NET framework version and project configuration (debug/release) along with assertion of some conditional compilation flags used to generate different targeted versions of the code (CRM 4/CRM 2011):

```

set msbuild=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
set PointVersion=1.0.0
set outpathprop=/property:OutputPath=..\release\%PointVersion%\3.5

%msbuild% ^
    /property:Configuration=Debug ^
    /property:TargetFrameworkVersion=v3.5 ^
    %outpathprop%\CRM4\Debug ^
    /p:DefineConstants="CRM4" ^
    CrmQuery\CrmQuery.csproj

```

You can see that I set the output path to include the release version number and the framework version. I could parameterize this even further, but that's an exercise I'll leave to the reader or until I refine this technique next time around. Notice that I define a constant called 'CRM4' which is responsible for triggering some #ifdefs in the code that include CRM4-specific code. The beauty of this script is that now I can just add a section for each configuration that I need to build, run it once and I've got all the debug and release configurations of both CRM4 and 2011 versions of my project.

The file layout that I've chosen is:

```

\release\<version>\<crmversion>\<configuration\

```

Effectively, this build script controls the versioning of the build. I got tired of trying to do this by reading Assemblyinfo.cs, but we'll have to deal with this if we want to build a signed assembly.

The advantage of having a consistent folder structure is that we can now put the built artifacts into an assembly cache and use a dependency management script to copy them to a local lib\ folder under the project directory. We can manage multiple versions of the same assembly and not get completely confused as to which version we are referencing in the project. Let me know about your quick-and-dirty build techniques in the comments!

repository: dnewcome/crmvoyager

extension: markdown

repo_name: dnewcome/crmvoyager


text:
# scripts
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FBenzammour%2Fscripts.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FBenzammour%2Fscripts?ref=badge_shield)

These are all of my scripts that I use on a regular basis to ease task in my everyday life.

### dnsFlush
Flushes DNS and says "DNS flushed"

### pomodoro
Simple pomodoro timer, which counts down the provided time

### googleBlock
Blocks all incoming resources of google, still a WIP
Functionality not given yet.

### battery
Displays current battery percentage

### ip
Displays current IPv4 adress

### javaRun
A utility script used in combination with a assignment generator of my university.

### nowPlaying
Displays what one is currently playing. Either via spotify or another music application you are using s[Source](https://www.tylerewing.co/tmux-now-playing)

### shutdown90
shuts down the computer after 90 mins.

## Git

### gitRecurPull

Pulls all git repos in a folder

### gitCleanUp

Executes `git gc` in all git repos in a folder

Extract of official git page:

> git gc: Cleanup unnecessary files and optimize the local repository

### gitSign

Enables automatic signing in every git repo in your Git folder

## GPG

### photoEncrypt
Encrypts all images in one folder recursively (also in every subdirectory)

### photoDecrypt
Decrypts all images in one folder recursively (also in every subdirectory)

## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FBenzammour%2Fscripts.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FBenzammour%2Fscripts?ref=badge_large)

gha_license_id: MIT


text:
---
hrs_structure:
  division: '4'
  volume: '13'
  title: '32'
  chapter: '612'
  section: 612-18
type: hrs_section
tags:
  - Court
  - Judicial Proceeding
menu:
  hrs:
    identifier: HRS_0612-0018
    parent: HRS0612
    name: 612-18 Trial jury; additional requirements
weight: 26090
title: Trial jury; additional requirements
full_title: 612-18 Trial jury; additional requirements
---
**§612-18 [Trial jury; additional requirements.]** (a) If the court so orders, prospective trial jurors shall be drawn and summoned, and further proceedings had as provided in section 612-17.

(b) In no case shall the trial jurors be chosen other than by lot, nor shall the trial jury be selected from the prospective jurors other than by lot in open court.

(c) The names of prospective jurors to be summoned to sit as a jury, and the contents of juror qualification forms completed by those jurors, shall be made available to the litigants concerned. [L 1973, c 191, pt of §1; am L 1987, c 366, §11; am L 1993, c 159, §4; am L 2007, c 122, §13]

Case Notes

Purpose of subsection (c) is to uphold a criminal defendant's constitutional guarantees of a presumption of innocence and an impartial jury. 83 H. 507, 928 P.2d 1 (1996).

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
[Home](https://oscarkcau.github.io/Icon-Meter/)   [Downloads](downloads.md)    [Screenshots](Screenshots.md)   [Lincense](licensepage.md)

Icon-Meter is a Small notifyicon system performance meter for MS Windows,
running on Microsoft Windows 7 or above using the Microsoft .NET Framework.

I need a small and lightweight system performance meter for my windows tablet thus make a simple application with c#. It displays small notifyicons which visualize the current CPU, memory, disk and network loading in small bars.
Icon Meter has the following features:

* (Version 2.3.2) Add option to show the N most utilized logicial processors in notify icon, add new dark color mode for popup window,
and remove pin button to simplify user input.
* (Version 2.3.1) Visualize individual disk usage, improve preformance in updating popup window, add buttons for moving popup window and accessing control panel & task manager.
* (Version 2.3) Introduce popup window to replace simple tooltip text and display more useful system performance information
* (Version 2.1) Multi-language support (traditional Chinese, simplified Chinese, English and Japanese)
* (Version 2.0) Reimplement using WPF for better support for Windows 10
* Customizable bar colors
* Optionally hide / display bars of memory, disk and network performance
* (Version 1.1) Visualize individual logical processor usage
* Use vertical or horizontal bars
* Autostart when Windows start up
* Quick launch for Task Manager
* Display numerical readings in popup tooltip message when mouse cursor hovers over the meter

## Installation

Download and run the lastest [installer](https://github.com/oscarkcau/Icon-Meter/releases/latest).

## Usage

* Left click the meter icon to show the popup window.
* Right click the meter icon to access the setup dialog (**setup** menu item), or to close the program (**Close** menu item).
* All settings could be found in the setup dialog.
* Double left click the meter to launch the system Task Manager.
* Currently 4 languages (traditional Chinese, simplified Chinese, English and Japanese) are supported, please switch to a new display language of your system to change the language.

repository: oscarkcau/Icon-Meter

gha_language: C#

gha_license_id: NOASSERTION

repo_name: oscarkcau/Icon-Meter


text:
# PyRadio

Command line internet radio player.

Ben Dowling - [http://www.coderholic.com/pyradio](http://www.coderholic.com/pyradio)

## Requirements

* python 2.6+/3.2+
* python-pip
* mpv, mplayer or vlc installed and in your path.
* socat (if you wish to use MPV)

## Installation via pip

This is the simplist method for installing PyRadio.

The first thing is to make sure MPV, MPlayer or VLC are installed and are in the
PATH. To check this, go in your favorite terminal and make sure thiese programs
are launched when you type "mpv", "mplayer" or "cvlc".

#### MacOSX

MPlayer is one of the available packages provided by [Homebrew](https://github.com/Homebrew/homebrew).

But it is not the case of VLC. Nevertheless, pyradio will also work with the binary of the application [VLC](http://www.videolan.org/vlc/download-macosx.html).

You simply can add a symbolic link to the executable as follows (this link must of course be in your PATH):

    ln -s /Applications/VLC.app/Contents/MacOS/VLC cvlc

The second step is to use pip to install the python package:

    pip install pyradio

#### Linux

    pip install pyradio

## Building from source

#### MaxOSX and Linux

    python setup.py build

The second step is to install the build:

    sudo python setup.py install

## Shell commands

    $ pyradio -h

    usage: main.py [--help] [--stations <path>] [--random] [--add] [--list]

    Console radio player

    optional arguments:
    -h, --help            Show this help message and exit.
    -s, --stations <path> Use specified station CSV file.
    -p, --play [play]     Start and play. The value is num station or empty for random.
    -a, --add             Add station to list.
    -l, --list            List of added stations.
    -u, --use-player      Specify which player to use (mpv, mplayer or cvlc).
    -d, --debug           Debug mode (pyradio.log created).
                          To be attached with any bug report.

## Controls

```
Up/Down/j/k/PgUp/PgDown Change station selection.
Enter/Right/l           Play selected station.
-/+ or ,/.              Change volume.
v                       Save volume (mpv and mplayer only).
m                       Mute.
r                       Select and play a random station.
g                       Jump to first station.
<n>G                    Jump to n-th station.
Space/Left/h            Stop/start playing selected station.
Esc/q                   Quit.
```

## Player default volume

### mpv

mpv uses profiles to customize its behavior.

Users can define a profile called "**[pyradio]**" in mpv's configuration file (e.g. *~/.config/mpv/mpv.conf*) and pyradio will use it when playing.

Example:

    volume=100

    [pyradio]
    volume=50

### mplayer

mplayer uses profiles to customize its behavior as well.

Users can define a profile called "**[pyradio]**" in mplayers's configuration file (e.g. *~/.mplayer/config*) and pyradio will use it when playing.

Example:

    volume=100

    [pyradio]
    softvol=yes
    volstep=1
    volume=28

### vlc

vlc by default saves the volume, so no customization is necessary.

repository: feitianyiren/pyradio

repo_name: feitianyiren/pyradio


text:
# MQN for LIS ver2

This software is a python implementation of MQN for LIS ver2.

The original program is LIS ver2 or LIS.
https://github.com/wbap/lis

I modified his program to include MQN unit.
MQN is presented by J. Oh, et al in their literature 'Control of Memory, Active Perception, and Action in Minecraft'.
https://arxiv.org/abs/1605.09128

Requirement and 'how to run' is equivalent to LIS ver2.

Before you excute this code, you have to copy these files to gym_client/examples/agents/ root.

In this code, the time span of memory unit is set to 10. For example, if you want to change this to 20, the constant 'time_span' in several files should be 20, and the constant time_M should be 21.


text:
---
layout: page
title: Page not found
description: Take It Easy, All Are Going to Be Well
keywords: 404
comments: false
permalink: /404.html
---

When you come across to this page, there was possibly two cause

## Link Error

## Other Bad Things Have Happened

I will try to fix it as soon as possible

<!----------------------------------------------------------------
         mm
      /^(  )^\                     Ascii arts included in this page:
      \,(..),/                     - R2D2, provided by: http://www.chris.com/
        V~~V                       - Texts, generated from: http://www.network-science.de/ascii/
                                   http:// cnfeat.github.io

------------------------------------------------------------------>

  <style>
    pre {
          background: none;
          border: none;
    }
  </style>

  <pre>
---x-----mm--
      /^(  )^\
      \,(..),/        Opps...
        V~~V
Opps....
    </pre>

gha_language: HTML


text:
# concrete5.7+ Debugbar
PHP Debugbar for concrete5.7+

Download these files and stick them in a folder named `php_debugbar` in your packages directory

Run `composer install` to download dependencies

Install via your dashboard


text:
### [CVE-2020-7632](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7632)
![](https://img.shields.io/static/v1?label=Product&message=node-mpv&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=Command%20Injection&color=brighgreen)

### Description

node-mpv through 1.4.3 is vulnerable to Command Injection. It allows execution of arbitrary commands via the options argument.

### POC

#### Reference
- https://snyk.io/vuln/SNYK-JS-NODEMPV-564426

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

branch_name: refs/heads/main

repo_name: trickest/cve


text:
# Data Annotation

Dataview is a data index first and foremost, so it supports relatively rich ways of adding metadata to your knowledge
base. Dataview generally operates at the granularity of *markdown pages*, where each page can have an arbitary amount of
complex (numbers, objects, lists) *fields* associated with it. Each *field* is a named value with a certain type
(like "number" or "text"). You can define a *field* for a page in three different ways:

1. **Frontmatter**: Frontmatter is a common Markdown extension which allows for YAML metadata to be added to the top of
   a page. All YAML fields will be available as Dataview fields:
    ```yaml
    ---
    alias: "document"
    last-reviewed: 2021-08-17
    thoughts:
      rating: 8
      reviewable: false
    ---
    ```
2. **Inline Fields**: For those wanting a more natural-looking annotation, Dataview supports "inline" fields, which
   offer a simple `Key:: Value` syntax that you can embed directly in your file:
    ```markdown
    # Markdown Page

    Basic Field:: Value
    **Bold Field**:: Nice!
    ```

3. **Implicit**: Dataview annotates pages with a large amount of metadata automatically, like the day the file was
   created (`file.cday`), any associated dates (`file.day`), links in the file (`file.outlinks`), tags (`file.tags`),
   and so on.

A simple Markdown page which includes both user-defined ways to add metadata:

```markdown
---
duration: 4 hours
reviewed: false
---
# Movie X

**Thoughts**:: It was decent.
**Rating**:: 6
```

## Field Types

All fields in dataview have a *type*, which determines how dataview will render, sort, and operate on that field.
Dataview understands several distinct field types to cover common use cases:

- **Text**: The default catch-all. If a field doesn't match a more specific type, it is just plain text.
    ```
    Example:: This is some normal text.
    ```
- **Number**: Numbers like '6' and '3.6'.
    ```
    Example:: 6
    Example:: 2.4
    Example:: -80
    ```
- **Boolean**: true/false, as the programming concept.
    ```
    Example:: true
    Example:: false
    ```
- **Date**: ISO8601 dates of the general form `YYYY-MM[-DDTHH:mm:ss.nnn+ZZ]`. Everything after the month is optional.
    ```
    Example:: 2021-04-18
    Example:: 2021-04-18T04:19:35.000
    Example:: 2021-04-18T04:19:35.000+06:30
    ```
- **Duration**: Durations of the form `<time> <unit>`, like `6 hours` or `4 minutes`. Common english abbreviations like
  `6hrs` or `2m` are accepted.
    ```
    Example:: 7 hours
    Example:: 4min
    Example:: 16 days
    ```
- **Link**: Plain Obsidian links like `[[Page]]` or `[[Page|Page Display]]`.
    - If you reference a link in frontmatter, you need to quote it, as so: `key: "[[Link]]"`. This is default Obsidian-supported behavior.
    ```
    Example:: [[A Page]]
    Example:: [[Some Other Page|Render Text]]
    ```
- **List**: Lists of other dataview fields. In YAML, these are defined as normal YAML lists; for inline fields, they are
  just comma-separated lists.
    ```
    Example:: 1, 2, 3
    Example:: "yes", "or", "no"
    ```
- **Object**: A map of name to dataview field. These can only be defined in YAML frontmatter, using the normal YAML
  object syntax:
  ```
  field:
    value1: 1
    value2: 2
    ...
  ```

## Implicit Fields

Dataview automatically adds a large amount of metadata to each page:

- `file.name`: The file title (a string).
- `file.folder`: The path of the folder this file belongs to.
- `file.path`: The full file path (a string).
- `file.link`: A link to the file (a link).
- `file.size`: The size (in bytes) of the file (a number).
- `file.ctime`: The date that the file was created (a date + time).
- `file.cday`: The date that the file was created (just a date).
- `file.mtime`: The date that the file was last modified (a date + time).
- `file.mday`: The date that the file was last modified (just a date).
- `file.tags`: An array of all unique tags in the note. Subtags are broken down by each level, so `#Tag/1/A` will be stored in
  the array as `[#Tag, #Tag/1, #Tag/1/A]`.
- `file.etags`: An array of all explicit tags in the note; unlike `file.tags`, does not include subtags.
- `file.inlinks`: An array of all incoming links to this file.
- `file.outlinks`: An array of all outgoing links from this file.
- `file.aliases`: An array of all aliases for the note.

If the file has a date inside its title (of form `yyyy-mm-dd` or `yyyymmdd`), or has a `Date` field/inline field, it also has the following attributes:

- `file.day`: An explicit date associated with the file.

repository: Twotiger/obsidian-dataview

repo_name: Twotiger/obsidian-dataview


text:
# AppWorks Example - AWCache

## Contents
1. [About appworks.js](#about-appworksjs)
2. [About this example app](#about-this-example)
3. [Usage](#usage)
4. [Installation](#installation)

## About appworks.js

appworks.js is a javascript (TypeScript) library for building feature rich, hybrid enterprise apps. The OpenText AppWorks platform provides mobile and desktop clients that support apps that utilize appworks.js.

In a mobile environment the library provides access to on-device technology, and in the desktop environment some features of the underlying host OS (operating system) are exposed.

For more information, see the appworks.js repository: https://github.com/opentext/appworks-js

## About this example

The purpose of the AWCache plugin is to store data, such as JSON, against a key in an on device database and then retrieve this data.

## Usage

#### preloadCache

```javascript
preloadCache()
```

Obtain the data from the persistent cache and store it in memory. Returns a promise.

After you instantiate a new AWCache with the persistent option set to true, you must call the preloadCache method.

It is recommended to only have one instance of AWCache used throughout your app.

Examples
```javascript
// Set the persistent storage to true to store the content until we specifically delete it
var options = {
    usePersistentStorage: true
};

// Ideally a single global instance of AWCache is instantiated.
var cache = new AWCache(options);

// Immediately load the persistent cache into memory
cache.preloadCache().then(
  // Success function
  function() {
      alert("Cache is ready to use");
      alert(getDataFromCache('myKey'));
  },
  // Error function
  function(err) {
      alert("Cache failed to load");
  });

function getDataFromCache(key) {
  return cache.getItem(key);
}
```

#### setExcludedKeys

```javascript
setExcludedKeys(keys: string[])
```

Prevent certain keys from being persisted.

+ __keys__: A string array of keys which will not be persisted along with other keys

Examples
```javascript
// The keys to exclude from persistent storage
var excludedKeys = ['key1', 'key3'];

cache.setExcludedKeys(excludedKeys);

// Some content to store
var content1 = "My Content 1";
var content2 = "My Content 2";
var content3 = "My Content 3";

// Not persisted
cache.setItem('key1', content1).then(function() {}, function(err) {});

// Persisted
cache.setItem('key2', content1).then(function() {}, function(err) {});

// Not persisted
cache.setItem('key3', content1).then(function() {}, function(err) {});
```

#### setItem

```javascript
setItem(key: string, value: any)
```

Write content to the cache with a key. Returns a promise.

+ __key__: The key to store the content against
+ __value__: The content to store

Examples
```javascript
// The key to store the content against
var key = "myKey";
// The content to store
var content = "My Content";

// Store the data with .then called afterwards
cache.setItem(key, content).then(
  // Success function
  function() {
      alert("Content stored against: " + key);
  },
  // Error function
  function(err) {
      alert("Content failed to store against " + key + ": " + err);
  });
```

#### getItem

```javascript
getItem(key: string)
```

Read content from the cache with a key. Returns a string value of the content set against the key, or a blank string if the key is empty or non existent.

+ __key__: The key to read the content from

Examples
```javascript
// The key to read the content from
var key = "myKey";

// Read the content stored against the key.
// If the key does not exists, this will return a blank string.
var content = cache.getItem(key);

alert(content);
```

#### removeItem

```javascript
removeItem(key: string)
```

Delete content from the cache with a key. Returns a promise.

+ __key__: The key (and value) to be delete

Examples
```javascript
// The key to delete the content from
var key = "myKey";

// Call the remove function
cache.removeItem(key).then(
  // Success function
  function(content) {
      alert("Deleted content stored against " + key);
  },
  // Error function
  function(err) {
      alert("Unable to delete content stored against " + key + ": " + err);
  });
```

#### clear

```javascript
clear()
```

Clear all content from the cache. Returns a promise.

Examples
```javascript
// Call the clear function to remove all content
cache.clear().then(
  // Success function
  function(content) {
      alert("Cache cleared");
  },
  // Error function
  function(err) {
      alert("Unable to clear cache: " + err);
  });
}
```

## Installation

This example app contains 3 important objects:
1. app.properties
2. icon.png
3. mobile.zip

#### app.properties
This files defines the app, with the following properties:
+ __displayName__: The display name of the app
+ __description__: A description of the app
+ __version__: The version of the app, e.g. 0.0.1 or 3.4.5 etc
+ __type__: This can be either app or desktop, or both (app,desktop)
+ __awgPlatformVersion__: The target appworks platform, this should be 16
+ __isAvailableOffline__: Allow this app to be used offline, can be true or false

#### icon.png
An icon that represents the app. This will appear in the gateway and on the device. 48x48px is ideal.

#### mobile.zip

This is your web content, such as html, js, css, images and any other assets.
The only essential file in your mobile.zip is index.html, which will be loaded by the appworks webview. Any other files or structure is up to the developer.

##### index.html

When your app is downloaded and installed in an appworks client, the client will place appworks.js, cordova.js and the cordova plugins in the root of your app.

In your html file, please include the following tags before any other javascript tags:

```html
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="appworks.js"></script>
```

#### Zipping and Deploying
1. Zip up the web content into a file named mobile.zip
2. Zip up the following files:
  + app.properties
  + icon.png
  + mobile.zip
3. Name this file in the format:
  + AppName_Version.zip
  + e.g. MyGreatApp_0.0.1.zip
  + __The version number in the filename must match the version number in app.properties__
4. Install the app on the gateway
  + Go to your gateway in a browser
  + sign in
  + go to app installation tab
  + drag and drop MyGreatApp_0.0.1.zip into the box.
  + Once fully deployed, enable the app.

repository: opentext/appworks-js-example-cache

repo_name: opentext/appworks-js-example-cache


text:
# TERMINAL COMPARISON

## MacOS Terminal

TODO

## iTerm

*Pros*

* Lots of configuration knobs

*Cons*

* Too slow to run fullscreen on a 4K monitor
* Clicking iTerm icon in the Dock will move across spaces instead of opening a new iTerm window
* executable has no flags/options so not possible to set up keyboard shortcuts

## Alacritty

*Pros*

* fast enough to run neovim fullscreen on 4K monitor
* executable supports just enough arguments to support launch shortcuts

*Cons*

* Full-screen mode on MacOS (SimpleFullscreen) hides the Menu Bar and Dock which is on another monitor
* Command-~ shortcut to switch windows in the same app doesn't hop between Alacritty windows
* System keyboard shortcuts don't work in Alacritty so you need to duplicate each one into the alacritty.yml file
* Command-clicking a URL doesn't seem to work if the URL is inside a tmux window

## Gnome-terminal

*Pros*

* executable supports enough arguments to support launch shortcuts
* TODO

*Cons*

* TODO

repository: phodge/dotfiles

gha_language: Python

repo_name: phodge/dotfiles


text:
# @feature-hub/core

[![Package Version](https://img.shields.io/npm/v/@feature-hub/core.svg)](https://www.npmjs.com/package/@feature-hub/core)

The core functionality of the Feature Hub.

**This package is part of the
[Feature Hub](https://github.com/sinnerschrader/feature-hub) monorepo.**

## Getting started

Install `@feature-hub/core` as a dependency:

```sh
# Install using Yarn
yarn add @feature-hub/core
```

```sh
# Install using npm
npm install @feature-hub/core
```

---

Copyright (c) 2018 SinnerSchrader Deutschland GmbH. Released under the terms of
the
[MIT License](https://github.com/sinnerschrader/feature-hub/blob/master/LICENSE).

repository: felipegtx/feature-hub

repo_name: felipegtx/feature-hub


text:
## Thrift node.js library

This folder is directly local copy of:
https://github.com/apache/thrift/tree/master/lib/nodejs/lib/thrift

Because offical `thrift` package on npm (https://www.npmjs.com/package/thrift)
does not export anything?!? Also it ships with just core thrift class, we need
some transports & protocols.

- Commit date: 7 Jan 2020
- Commit version: 30ac2598e84928d9af7066b5d3248b7aea4376b2
- Commit title: THRIFT-5003: Websocket Connection in Browsers with nodejs code

### Packages required to be installed

- `node-int64`

### Modifications taken:

- `ws_connection.js` file is truncated, because it requires additional package `isomorphic-ws`.

repository: vadkasevas/stalk-studio

repo_name: vadkasevas/stalk-studio


text:
# Opensource quest

Follow the old people (*caused by closed source*) using the **Linux** pinguin and make them younger (*by going through them*), **pay attention to proprietary enemies blocks (*which do not play a fair play*)**.

Enjoy the game!!!!!!

# Prerequest

Opensource quest is based on **SDL** and some of it's extensions :

    $ sudo apt-get install libsdl2-dev
    $ sudo apt-get install libsdl2-mixer-2.0-0
    $ sudo apt-get install libsdl2-ttf-dev
    $ sudo apt-get install libtinyxml2-dev

## Compilation

> $ make

> $ ./openquest

![Opensource quest](https://github.com/jugurthab/opensource-quest/blob/master/assets/openquest.png)

**Have faith in opensource!!!!!!!!!!!!**

repository: jugurthab/opensource-quest

repo_name: jugurthab/opensource-quest


text:
## Prefer black box over white box testing

- **Black box**: we cannot "see" inside the code being tested - we consider only its input and output. What happens in  between is and magic that we don't need to understand. This makes refactoring easy, as we are free to change the implementation ("what's inside the box"), as long as the output stays the same.
 - **White box**: our test depends upon the implementation, for instance by verifying that a certain method was called. Classes such as directors or orchestrators, which serve only to call other methods, might be good candidates for white box testing, but use only as a last resort. White box tests are brittle and therefore harder to maintain.

Consider the following code:

```c#
public interface IDataProvider
{
    string GetData();
}

public class Sleepy
{
    private readonly IDataProvider _dataProvider;

    public Sleepy(IDataProvider dataProvider)
    {
        _dataProvider = dataProvider;
    }

    public string GetSleepyData()
    {
        return _dataProvider.GetData() + " zzzzzzz";
    }
}
 ```

### Don't

Notice the call to `dataProviderMock.Verify()`.

```c#
[Test]
public void GetSleepyData_MakesSleepy()
{
    var dataProviderMock = new Mock<IDataProvider>();
    dataProviderMock.Setup(x => x.GetData()).Returns("I'm tired");
    var sleepy = new Sleepy(dataProviderMock.Object);

    var result = sleepy.GetSleepyData();

    Assert.AreEqual("I'm tired zzzzzzz", result);
    dataProviderMock.Verify(x => x.GetData(), Times.Once);
}
```

### Do

For this case there is no need to verify the call to the data provider was made. This is an implementation detail that might change in the future, and could therefore cause the test to fail. All we care is that the output is correct for the given input - ie. the zeds were appended. We don't care _how_ this was achieved.

 ```c#
[Test]
public void GetSleepyData_MakesSleepy()
{
    var dataProviderMock = new Mock<IDataProvider>();
    dataProviderMock.Setup(x => x.GetData()).Returns("I'm tired");
    var sleepy = new Sleepy(dataProviderMock.Object);

    var result = sleepy.GetSleepyData();

    Assert.AreEqual("I'm tired zzzzzzz", result);
}
 ```


text:
theme: Olive Green, 8
autoscale: true

# [fit] **Machine Learning as a Service**
## [fit] Learning the art of building data-driven products

# *Workshop @ The Fifth Elephant 2017* - Day 2

*Amit Kapoor*         [amitkaps.com](http://amitkaps.com)
*Anand Chitpothu*     [anandology.com](http://anandology.com)
*Bargava Subramanian* [bargava.com](http://bargava.com)

---

# **The Unicorn Skillset**

- *Data Management*: data ingestion & wrangling
- *Modelling & Prototyping*: statistics, visualisation, machine learning
- *Product Design*: data narrative, dashboards, applications
- *Data Engineering*: data pipelines, cloud infrastructure

---

# **Outline - Day 1**

*Session 1*: **Introduction and Concepts**
- Approach for building ML products
- Problem definition and dataset
- Build your first ML Model (Part 1)

*Session 2*: **Build a Simple ML Service**
- Build your first ML Model (Part 2)
- Concept of ML Service
- Deploy your first ML Service - localhost API

---

# **Outline - Day 1 (contd.)**

*Session 3*: **Build & Evaluate ML Models**
- Feature Engineering
- Build your second ML model
- ML model evaluation (metrics, validation)

*Session 4*: **Practice Session**
- Practice problem overview and data
- Build your ML Model
- Build your API

---

![120%](day1.png)

---

# What went well...
- **Good**: Explanation, informative, depth and breadth
- **Start**: for beginners, to diversified people
- **Well organised** content, presentation, working setup
- **Hands-on**: Coding, Jupyter
- **Firefly**: awesome, great

---

# Even better if...
- Clear doubts **right away** vs. Take more **questions offline**
- **More ML**:  internals, algorithm, evaluation, unsupervised, tuning
- **More Basics**: Stats, Pandas, Visualisation
- **Tough without** w/o ML background: Need to slow down,
Make it simple, More examples / practice time
- **Share Reference** to learn
- **Too Long**: ML, Firefly

---

# **Outline - Day 2**

*Session 6*: **Deploy to cloud**
- Get started with cloud server setup
- Deploy your ML service as cloud API
- Deploy your dashboard as cloud service

*Session 5*: **Build a Simple Application**
- Finish the ML part: "Random Forest"
- Visualisation in Python - Interactive Dashboard
- Create your first dashboard
- Integrate ML model API with dashboard

---

# **Outline - Day 2 (contd.)**

*Session 7*: **Repeatable ML as a Service**
- Build data pipelines
- Update model, API and dashboard
- Schedule ML as as Service process

*Session 8*: **Practice Session & Wrap-up**
- Deploy on cloud - dashboard and API
- Best practices and challenges in building ML service
- Where to go from here

---

# **Schedule**

08:45 to 09:30 : *Check-in & Breakfast*
09:30 to 11:00 : **Session 1**
11:00 to 11:20 : *Coffee break*
11:20 to 13:00 : **Session 2**
13:00 to 14:00 : *Lunch break*
14:00 to 15:40 : **Session 3**
15:40 to 16:00 : *Coffee break*
16:00 to 17:10 : **Session 4**

---

# **ML as a Service (MLaaS) Approach**
```
FRAME  ——← ACQUIRE  ——← REFINE ——←
                                  \
                                TRANSFORM →——
                                    ↑          ↘
                                    |        EXPLORE
                                    ↓          ↗
                                  MODEL   →——
                                  /
INTERACT →——  BUILD →—— DEPLOY →——

```

---

# **MLaaS Approach**

- *Frame*: Problem definition
- *Acquire*: Data ingestion
- *Refine*: Data wrangling
- *Transform*: Feature creation
- *Explore*: Feature selection
- *Model*: Model creation & selection
- *Deploy*: Model deployment
- *Build*: Application building
- *Interact*: User interaction

---

# **MLaaS Approach - Starting Point**

- *Frame*: classification
- *Acquire*: `pandas`
- *Refine*: `pandas`
- *Transform*: `pandas`, `scikit-learn`
- *Explore*: `matplotlib`, `seaborn`, `facet`
- *Model*: `scikit-learn`
- *Deploy*: `firefly-python`, `nginx`, `supervisor`, `gunicorn`
- *Build*: `flask`, `flask-wtf`
- *Interact*: `jupyter`, `local-host`, `cloud-server`

---

# **Where do you go from here**

- Learning journey
- Alternate approaches
- Scaling

---

# **Frame**

- **Toy Problems**
- **Simple Problems**
- Complex Problems
- Business Problems
- Research Problems

---

# **Acquire**

- Scraping (structured, unstructured)
- **Files** (csv, xls, json, xml, pdf, ...)
- Database (sqlite, ...)
- APIs
- Streaming

Libraries: `pandas`, `beautiful soup`, `selenium`, `requests`, `sql-alchemy`, `blaze`, `boto3` etc.

---

# **Refine**
- **Data Cleaning** (inconsistent, missing, ...)
- Data Refining (derive, parse, merge, filter, convert, ...)

Libraries: `pandas`, `spark`

---

# **Transform**
- **Data Transformations** (group by, pivot, aggregate, sample, summarise, ...)
- **Data Encoding** (one-hot encoding, label encoding)

Libraries: `pandas`, `blaze`, `spark`, `dask`

---

# **Explore**
- **Simple Vis** (`matplotlib`, `seaboard`, `pandas`)
- **Multi Dimensional Vis** (`facet`)
- Geographic Vis (`leaflet`, `geoviews`)
- Large Data Vis: Bin - Summarise - Smooth (`datashader`)
- Interactive Vis (`bokeh`, `holoviews`, `altair`, `plotly`)

---

# **Model - Supervised Learning**
- *Continuous*: Regression - Linear, Polynomial, Tree Based Methods - DecisionRegressors
- *Classification* - Logistics Regression, **Tree - Decision Trees, Random Forest, Gradient Boosting**, KNN, SVM, Naive-Bayes. Bayesian Network

libraries: `scikit-learn`, `dask`, `sparkML`, `tensorflow`

---

# **Model - UnSupervised Learning**
- *Continuous*: Clustering & Dimensionality Reduction like PCA, SVD, MDS, K-means
- *Categorical*: Association Analysis

libraries: `scikit-learn`, `dask`, `sparkML`, `tensorflow`

---

# **Model - Advanced / Specialized**
- Network / Graph Analytics
- Optimisation
- Reinforcement Learning / Online Learning
- Deep Learning: `tensorflow`, `pytorch`, `keras`, `caffe`
- Applications:
    - Time Series: `forecast`
    - Text: `nltk`, `spacy`, `gensim`

---

# **Deploy**

- Model Service: `firefly`, `tfserving`, `flask`
- Server Service:  `nginx`, `supervisor`, `docker`
- Model update: `cron`, `dask`, `airflow`, `luigi`

---

# **Build / Interact**

- Dashboard Visualisation / Decision Making Tools
    - Python + Html: `flask`, `flask-wtf`, `django`
    - Only Python: `plotly-dash`, `bowtie`, `bokeh`
- Narrative Visualisation
- Automated Decision Tools

---

# **Learning Resource - ML** (1/3)

- **Beginner** *Python Data Science Handbook* ([Github](https://github.com/jakevdp/PythonDataScienceHandbook)) ([Book](http://shop.oreilly.com/product/0636920034919.do)) - Jake Vanderplas' book is a thorough introduction to doing data science in python from a library perspective - `numpy`, `pandas`, `matplotlib` and `scikit-learn`. The material is very well documented and the notebooks are all available on GitHub.
- **Intermediate** *Introduction to Statistical Learning in R* ([Book](http://www-bcf.usc.edu/~gareth/ISL/)) ([Video](https://www.r-bloggers.com/in-depth-introduction-to-machine-learning-in-15-hours-of-expert-videos/)) ([Github](https://github.com/JWarmenhoven/ISLR-python)) - Hastie and Tibsharani are authors' of many of the algorithms used in Machine Learning. This book is free and even though it has all the applied stuff in R - the concepts are very well explained. To follow along with Python code- just use the GitHub repo link which implements every chapter in Python.

---

# **Learning Resource - ML** (2/3)

- **Intermediate** *Python Machine Learning* ([Book](https://sebastianraschka.com/books.html)) ([Github](https://github.com/rasbt/python-machine-learning-book)) - Sebastian Rashka writes very prolifically on ML and his blog itself is worth reading. This book is an applied book with real life examples and is useful to understand how to scale to larger datasets.
- **Advanced** *Learning from Data* ([Slides](http://work.caltech.edu/telecourse.html)) ([Video](https://www.youtube.com/playlist?list=PLCA2C1469EA777F9A)): Yaser Abu-Mostafaâ€™s course is the best course I have seen on understanding how Machine Learning really works. It is both intuitive as well as bit mathematical. If you are really keen to understand the whole theory of generalisation and how the algorithms really work - you will really like this course.

---

# **Learning Resource - ML** (3/3)

- **Our Teaching Material** ([GitHub](http://github.com/amitkaps/)): We have a fair number of teaching repos on different Machine Learning topics and they are constantly being updated. If you liked this workshop, you may like some of them. We will also be updating [The Art of Data Science](https://github.com/amitkaps/art-data-science),  [HackerMath for ML](https://github.com/amitkaps/hackermath), and [Applied Machine Learning](https://github.com/amitkaps/applied-machine-learning) as we do more workshops in the future. So you can come back later and check it out too.
- Additional Resource:
    - Introduction to Statistics - Hacker's approach: [Think Stats](http://greenteapress.com/thinkstats2/)
    - Statistics - Theoretical Background: [All of Statistics](http://www.stat.cmu.edu/~larry/all-of-statistics/)
    - Statistics - Theoretical Background: [Statistics is Easy](http://www.amazon.com/Statistics-Edition-Synthesis-Lectures-Mathematics/dp/160845570X)
    - Harvard Data Science Course - [CS 109 Course](http://cs109.github.io/2015/)

---

# **Learning Resources - Data Engineering / System / Cloud**

- DevOps
- Data Pipelines
- Cloud Platforms

---

# **Learning Approach** (1/2)

- **Practice, Practice, Practice**: Or to simplify just Practice. Repeat the data science process many times and as much as possible, try to write the code, break things and see how to fix it.
- **Understand the basics**: Always investigate why the algorithms and libraries work the way they do and build an intuition around what is happening in the process.
- **Focus on Data Science Portfolio**: Work on at least 6 - 8 different projects over the next 1 year to build a portfolio of projects across data science topics.
- **Build a public profile**: It could be a blog, a website, GitHub repos - so that people can see what you are doing and connect if they wish.
- **Do projects that interest you**:  You are more likely to stick through the long arduous journey of doing it. It could be in your work domain or it could be sports, economics, politics, public policy etc.

---

# **Learning Approach** (2/2)

- **Understand your learning style**: Are you the hacker kind, who learns best by finding out how things work or do you prefer the structured classroom style learning. This would help you identify better what works for you to learn new concepts.
- **Share what you do and get feedback**: Put yourself out there. It may be a small project, a visualisation, an analysis, using a library, anything. Nothing is too small to share.
- **Find a community of like minded people**:  Most of our learning happens through peers. Build or join a community of peers with whom you can engage, teach and learn. It could be virtual but even better if it is face to face.
- **Find your own rhythm**: Build and do something every day, week or month. Find your own cadence and start creating.

---

# **Future Workshops: https://fifthelephant.in/**

- **Data Science Bootcamp** (5 Sundays in Aug/Sept)
    - The Art of Data Science
    - Data Visualisation for Data Science
    - HackerMath for Machine Learning
    - Applied Machine Learning
    - Full Stack Data Science

- **Deep Learning Bootcamp** (2 Saturday in Sept)
    - DL for Images: CNN
    - DL for Text: Word Embedding, RNN, LSTM

---

# **Feedback Form**

[https://goo.gl/3cpdHE](https://goo.gl/3cpdHE)

---

# [fit] **Machine Learning as a Service**
## [fit] Learning the art of building data-driven products

# *Workshop @ The Fifth Elephant 2017*

*Amit Kapoor*         [amitkaps.com](http://amitkaps.com)
*Anand Chitpothu*     [anandology.com](http://anandology.com)
*Bargava Subramanian* [bargava.com](http://bargava.com)


text:
# Discontinued Project

## Notes

This project is still work in progress.

I'm just playing with react.

## Technologies used
- Kotlin
- Spring Boot 2
- Webflux
- Maven
- Typescript
- React
- Yarn
- Material UI

## Prerequisites

- JDK8 or newer is required
- Maven and Node.js and not required

## Cloning project

```text
git clone https://github.com/shardis/shardis.git
```

## Building project

```text
mvnw clean package
```

## Running project

```text
mvnw spring-boot:run
```
or

```text
mvnw clean package
java -jar shardis-web/target/shardis-web-0.0.1-SNAPSHOT.jar
```

## Running react dev server

Before running react server start backend application

```text
cd shardis-frontend
yarn run start
```

repository: kucharzyk/react-with-cra

repo_name: kucharzyk/react-with-cra


text:
Translating by FSSlc

Best Known Linux Archive / Compress Tools
================================================================================
Sending and receiving large files and pictures over the internet is a headache many times. Compression and decompression tools are meant to address this problem. Lets take a quick overview of a few open source tools that are available to make our jobs simpler.

Tar
gzip, gunzip
bzip2, bunzip2
7-Zip

### Tar ###

Tar is derived from 'Tape archiver' as this was initially used for archiving and storing files on magnetic tapes. It is a GNU software. It can compress a set of files (archives), extract them and manipulate those which already exist. It is useful for storing, backing up and transporting files.  Tar can preserve file and directory structure while creating the archives. Files archived using tar have '.tar' extensions.

Basic Usage

#### a) Creating an archive (c / --create) ####

    tar --create --verbose --file=archive.tar file1 file2 file3

OR

    tar cvf archive.tar file1 file2 file3

![tar cvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-cvf.png)

creating an archive

#### b) Listing an archive ( t / --list) ####

    tar --list archive.tar

![tar tvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-tvf.png)

Listing the contents

#### c) Extracting an archive (x / --extract) ####

    tar xvf archive.tar

    tar xvf archive.tar --wildcards '*.c'  -  extracts files with only *.c extension from the archive.

![tar xvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-xvf.png)

Extracting files

![tar xvf --wildcards](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-wildcard.png)

Extract only the required files

#### d) Updating an archive ( u / --update) ####

    tar uvf archive.tar newfile.c   -    updates the archive by adding newfile.c  if its version is newer than the existing one.

![tar uvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-uvf.png)

Updating an archive

#### e) Delete from an archive (--delete) ####

    tar--delete -f archive.tar file1.c   -     deletes 'file1.c' from the tar ball 'archive.tar'

![tar --delete](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-delete.png)

Deleting files

Refer to [tar home page][1] for its detailed usage

### Gzip / Gunzip ###

Gzip stands for GNU zip. It is a compression utility that is commonly available in Linux operating system. Compressed files have an extension of '*.gz'

**Basic Usage**

#### a) Compressing files ####

    gzip file(s)

Each file gets compressed individually

![gzip](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip.png)

Compress files

This generally deletes the original files after compression. We can keep the original file by using the -c option.

    gzip -c file > file.gz

![gzip-c](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip-c.png)

Keep original files after compressing

We can also compress a group of files into a single file

    cat file1 file2 file3 | gzip > archieve.gz

![gz group](http://blog.linoxide.com/wp-content/uploads/2015/01/gz-group.png)

Compressing a group of files

#### b) Checking compression ratio ####

Compression ratio of the compressed file(s) can be verified using the '-l' option.

    gzip -l archieve.gz

![gzip -l](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip-l.png)

Checking compression ratio

#### c) Unzipping files ####

Gunzip is used for unzipping files. Here also, original files are deleted after decompression. Use the -c option to retain original files.

    gunzip -c archieve.gz

![gunzip -c](http://blog.linoxide.com/wp-content/uploads/2015/01/gunzip-c.png)

Unzipping files

Using '-d' option with gzip command has the same effect of gunzip on compressed files.

More details can be obtained from [gzip home page][2]

### Bzip2 / Bunzip2 ###

[Bzip2][3] is also a compression tool like gzip but can compress files to smaller sizes than that is possible with other traditional tools. But the drawback is that it is slower than gzip.

**Basic Usage**

#### a) File Compression ####

Generally, no options are used for compression and the files to be compressed are passed as arguments. Each file gets compressed individually and compressed files will have the extension 'bz2'.

    bzip2 file1 file2 file3

![bzip2](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2.png)

File Compression

Use '-k' option to keep the original files after compression / decompression.

![bzip2 -k](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2-k.png)

Retaining original files after compression

'-d' option is used for forced decompression.

![bzip2 -d](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2-d.png)

Delete files using -d option

#### b) Decompression ####

    bunzip2 filename

![bunzip2](http://blog.linoxide.com/wp-content/uploads/2015/01/bunzip2.png)

Decompressing files

bunzip2 can decompress files with extensions bz2, bz, tbz2 and tbz. Files with tbz2 and tbz will end up with '.tar' extension after decompression.

    bzip2 -dc performs the function of decompressing files to the stdout

### 7-zip ###

[7-zip][4] is another open source file archiver. It uses 7z format which is a new compression format and provides high-compression ratio. Hence, it is considered to be better than the previously mentioned compression tools. It is available under Linux as p7zip package. The package includes three binaries – 7z, 7za and 7zr. Refer to the [p7zip wiki][5] for differences between these binaries. In this article, we will be using 7zr to explain the usage. Archived files will have '.7z' extension.

**Basic usage**

#### a) Creating an archive ####

    7zr a archive-name.7z file-name(s) / directory-name(s)

![7zr a](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-a.png)

Creating an archive

#### b) Listing an archive ####

    7zr l archive-name.7z

![7zr l](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-l.png)

Listing an archive

#### c) Extracting an archive ####

    7zr e archive-name.7z

![7zr e](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-e.png)

Extracting an archive

#### d) Updating an archive ####

    7zr u archive-name.7z new-file

![7zr u](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-u.png)

Updating an archive

#### e) Deleting files from an archive ####

    7zr d archive-name.7z file-to-be-deleted

![7zr d](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-d.png)

Deleting files

![7zr l](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-d-l.png)

Verifying file deletion

--------------------------------------------------------------------------------

via: http://linoxide.com/tools/linux-compress-decompress-tools/

作者：[B N Poornima][a]
译者：[译者ID](https://github.com/译者ID)
校对：[校对者ID](https://github.com/校对者ID)

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译，[Linux中国](http://linux.cn/) 荣誉推出

[a]:http://linoxide.com/author/bnpoornima/
[1]:http://www.gnu.org/software/tar/
[2]:http://www.gzip.org/
[3]:http://www.bzip.org/
[4]:http://www.7-zip.org/
[5]:https://wiki.archlinux.org/index.php/p7zip

url: https://raw.githubusercontent.com/MrEleven/TranslateProject/5fcce05c1d49e59276e4688c4fb057492635397f/sources/tech/20150211 Best Known Linux Archive or Compress Tools.md

repository: MrEleven/TranslateProject

repo_name: MrEleven/TranslateProject


text:
Random Name Picker (Improved Version)
==================

Simple app that will pick a random name from a list of give names. Will rotate through all the names entered and slowly/eventually pick a winner for the suspense effect if shown on a projector.

Might've gone a bit over the top, but is backed by backbone (with local storage). Uses underscore's shuffle for randomisation. Developed and tested in Chrome (and sort of Firefox) only.

Feel free to change as per your needs :)

How to use
----------
1. Load up `main.html` and you should see the input screen.
1. Enter list of names that will be in the draw
1. Click on 'pick winner' in bottom left hand corner to start the draw

**Notes**

* If you need to pick another name, hover around the far left of the winning name to reveal the remove icon to remove the name from the list - you can now pick another winner
* If you want to clear all the names from the list, click on the 'clear all' in the bottom right hand corner, and click on the new red 'CLEAR ALL' that appears

Entering names via file
------------------
If you want to populate the list of names via values from a file, you can reveal the file upload controls by clicking on the 'file upload' trigger in the bottom right.

The upload file will appear in the top left of the screen. You can toggle the visibility of these controls by clicking on the 'file upload' trigger.

The contents of the file should only contain the names to be uploaded. The names will be separated by commas(,), pipes(|) or enters.

For example, the following are valid:
```
one,two,three,four
```
```
one|two|three|four
```
```
one
two
three
four
```
_Note: I have not focussed on the performance of this app, so upload large files at your own risk!_

License
-------
MIT

repository: medardm/random-name-picker

repo_name: medardm/random-name-picker


text:
MixpanelCppCX
=============

Introduction
------------
MixpanelCppCX is a client for the [Mixpanel](https://mixpanel.com) analytics
service. It has been built to handle the common situations of uploading events
to the service. It supports batching, persisting-to-storage-before-uploading,
and [super properties](https://mixpanel.com/help/reference/javascript#super-properties).

It also supports the [enagement/userprofile API](https://mixpanel.com/help/reference/http#people-analytics-updates).
The official documentation will provide the right detail on how to use this part
API.

It's intended to be consumed by any UWP app — but the original motivation was to
support JavaScript applications.

How to get it
-------------
MixpanelCppCX is published as a NuGET package
([`Codevoid.Utilities.Mixpanel`](https://nuget.org/packages/Codevoid.Utilities.Mixpanel/))
to the NuGET.org feed — just add it to your UWP Project in Visual Studio, and
it'll be available for use in your code.

Things to note
--------------
- Items awaiting to upload are stored in a folder in your applications private
data folder with in local settings. (`%LOCALAPPDATA%\Packages\<PackageIdentity>\LocalState\MixpanelUploadQueue`)
- Items awaiting upload are written to disk after 500ms of idle time, or when
there are 10 or more items in the queue — whichever comes first.
- Items are uploaded in batches of 50, unless one item in the batch fails, then
they're uploaded 1 at a time.
- The queue is paused automatically when being suspended, and resumed when...
resumed.
- This library does automatic session tracking — it starts tracking the session
duration on start, and will automatically end/resume the session based on
suspend/resume events.

Usage
=====

Sending a simple event
----------------------
1. Create an instance of `Codevoid.Utilities.Mixpanel`, and hold on to it.
```
var mixpanelClient = new Codevoid.Utilities.Mixpanel(<Mixpanel API Token>)
```
2. Call, and wait for, `.InitializeAsync()`
3. Call `.Start()` on that instance to start processing the queue.
4. Call `.Track("MyEvent", null)` to log a single event

If you need to send properties with your event you can use `Windows.Foundation.Collections.PropertySet`,
and insert your properties as needed, passing it as the second parameter to
`Track`:
```
var properties = new Windows.Foundation.Colllections.PropertySet();
properties.add("MyProperty", "MyValue");
properties.add("MyOtherProperty", 9);

mixpanelClient.Track("MyOtherEvent", properties);
```

Setting a User Identity
-----------------------
If you want to be able to track your customers across multiple settings, and
correlate the events that a device/customer generates, you need to set an identity
for that user.

You can do that in two ways:
1. Call `GenerateAndSetUserIdentity` and create a GUID identifier
2. Use your own method for generating a unique identifier, and call `SetUserIdentityExplicitly`.

From that point, any events will have that identifier logged.

If you want to check if you have identified this user, you can call `HasUserIdentity`.

Adding a super property
-----------------------
Assuming you have an instance of `MixpanelClient`, you can set super properties
with three data types -- `String`, `Double`, and `Boolean`:
```
mixpanelClient.SetSuperPropertyAsString("PropertyName", "PropertyValue");
mixpanelClient.SetSuperPropertyAsDouble("DoublePropertyName", 3.14);
mixpanelClient.SetSuperPropertyAsBoolean("BooleanPropertyName", false);
```

Once set, the super properties will attached to every event when logged,
automatically. This is useful for tracking against a single user, for example.

Adding a session property
-----------------------
Assuming you have an instance of `MixpanelClient`, you can set session properties
with three data types -- `String`, `Double`, and `Boolean`:
```
mixpanelClient.SetSessionPropertyAsString("PropertyName", "PropertyValue");
mixpanelClient.SetSessionPropertyAsDouble("DoublePropertyName", 3.14);
mixpanelClient.SetSessionPropertyAsBoolean("BooleanPropertyName", false);
```

Once set, the session properties will attached to the session event when the
session ends. This is useful to tracking how often something happened in a session

Updating & Storing User Profiles
--------------------------------
Once you've set the identity of the user, you are able to update the infromation
that Mixpanel has about an identity -- this enables you to perform deeper analysis
of your customer behaviour.

To update & change a profile, you can use the `UpdateProfile` API, and passing
properties to update those values.

```
mixpanelClient.UpdateUserProfile(UserProfileOperation.Set, propertySet);
```

API
===

MixpanelClient(String token) (Constructor)
------------------------------------------
Creates an instance of the class, and uses the supplied token to make the
requests to Mixpanel.

```
var mixpanelClient = new Codevoid.Utilities.MixpanelClient("YOUR TOKEN HERE");
```

### Parameters
`token` — The token passed to the service with your events (required)

## _Properties_ ##
bool AutomaticallyAttachTimeToEvents
------------------------------------
By default, all events have a time attached to them to indicate the order of the
events, even if they're uploaded to the service out of order.

This property allows these to be disabled if you have your own way in which you
set the time.

If you wish to override the time for a single event, include a property named
"time" in the payload.

```
mixpanelClient.AutomaticallyAttachTimeToEvents = false;
```

bool AutomaticallyTrackSessions
------------------------------------
By default, session duration is tracked & sent to the service. The session is
started when Start() is called, and ends either when the app is suspended or
when RestartSession()/Shutdown() is called.

Set this to false to have the session tracking turned off.

```
mixpanelClient.AutomaticallyTrackSessions = false;
```

bool DropEventsForPrivacy
-------------------------

When enabled, and even is tracked, it is immediately dropped, and never uploaded
to the service. Intended to ube used in situations where the consumer offers a
choice to their users about turning off all telemetry logging. With this option
set, you can still call track, but _nothing_ happens - it's immediately dropped.

Note, if you have events queued at this point they'll continue to be processed.

```
mixpanelClient.DropEventsForPrivacy = true;
```

## _Methods_ ##

IAsyncAction InitializeAsync()
------------------------------
Initializes the instance to be ready to process events, but does **not** start
processing them. This gets the queue folder locally, and loads any unsent items
from a previous session.

```
mixpanelClient.InitializeAsync().done(...);
```

bool HasUserIdentity()
----------------------
Checks if a user identity has been set, and if so, returns 'true'.

```
mixpanelClient.HasUserIdentity();
```

void GenerateAndSetUserIdentity()
---------------------------------
Generates a random identifier for a user, and sets it for all future events. Any
existing identity that may or may not be stored will be overwritten.

```
if(!mixpanelClient.HasUserIdentity()) {
    mixpanelClient.GenerateAndSetUserIdentity();
}
```

void SetUserIdentityExplicitl(String identity)
----------------------------------------------
Sets an explicit identifier for a user to be attached to all future events. Any
existing identity will be overwritten.

```
mixpanelClient.SetUserIdentityExplicitly("User1");
```

### Parameters
`identity` - The user Identity be be set for future events.

void Track(String name, IPropertySet properties)
------------------------------------------------
Adds the event with the supplied name & properties (in addition to any super
properties) to the upload queue. It is _not_ sent immediately, and there are no
promises/events to know when it's made it to the service.

```
mixpanelClient.Track("LoggedIn", null);
```

### Parameters
`name` — The name of the event that you are wishing to track

`properties` — The properties & values that are associated with this event.

void UpdateUserProfile(UserProfileOperation operation, IPropertySet properties)
-------------------------------------------------------------------------------
Updates a users profile with the properties provided, applying the operation
supplied. These follow the behaviour documented in Mixpanel's [documentation](https://mixpanel.com/help/reference/http#people-analytics-updates).

### Parameters
`operation` — The type operation to perform with the provided properties.

`properties` — The properties & values to apply with the the provided operation

##### UserProfileOperation
This enumeration maps to the specific operations that mixpanel [allows for user
profile operations](https://mixpanel.com/help/reference/http#people-analytics-updates).

`Set` —  Sets the properties to the values provided, overwriting any that might
already exist. If they don't exist, they're created.

`Set_Once` — If a property already exists, then the value will not be updated.
If it doesn't, it will be created.

`Add` — Adds the numerical values of a property to an existing value, and saves
the result in that property. If the proeprty doesn't exist then it the values
provided are added to 0.

`Append` — Assumes that the values are sets, and appends the set to any existing
values that might be on the service.

`Union` — Assumes the values are sets, and merges the set to any existing values
that might be on the service. If an value in the set is already there, it is not
duplicated.

`Remove` — Assumes values are sets, and removes any items in the set from the
values that might be on the service.

`Unset` — Removes the entire property from the users profile, like it had never
been there.

void ClearUserIdentity()
------------------------
Clears any user identity that might be set, so that future events are no longer
associated with a user.

This should be called after a `ClearSuperProperties` to truely return to a default
state.

void DeleteUserProfile()
------------------------
Asks Mixpanel to delete the information related to the current user identity.
It also clears any local user identity that is stored.

### Parameters
`name` — Name of the event that is being logged (required)

`properties` — Any additional properties you would like to log with this event (optional)

void StartTimedEvent(string name)
---------------------------------
Starts a timing the duration of an event. After this, if an event is tracked
through `Track` with the same name, a `duration` property will be attached to
the event when tracked.

```
mixpanelClient.StartTimedEvent("LoggedIn");
```

void RestartSessionTracking()
---------------------------------
Explicitly starts a restarts session. If there is one already in progress, the
in progress session will be ended, otherwise starts one. Intended to be used in
situations where your session doesn't always match between suspend & resume.
E.g. you want to start a session when someone logs in.

```
mixpanelClient.RestartSessionTracking();
```

### Parameters
`name` — Name of the event that the duration is to be tracked (required)

void SetSessionPropertyAs<Type>(String name, [String/Integer/Double/Boolean] value)
-----------------------------------------------------------------
Sets a session property on the class, that is persisted for the duration of the
session. You can store `string`'s, `integer`'s, `double`'s, and `boolean`'s.
When consuming this, you need to use the named versions of this method:
`SetSessionPropertyAsString` for strings, `SetSessionPropertyAsIntegter` for
integers, `SetSessionPropertyAsDouble` for doubles, and
`SetSessionPropertyAsBoolean` for, obviously, `Booleans`.

```
mixpanelClient.SetSessionProperty("ASessionProperty", "SessionValue");
```

### Parameters
`name` — Name of the property that is to be set (required)
`value` — Value to be set for the supplied name (required)

string/double/bool GetSessionPropertyAsString/Integer/Double/Boolean(string name)
-----------------------------------------------------------------------
Retrieves a value from the session property storage, and returns it to the caller.

Since they're all different only in their return type, and accept the same
parameters, they're named differently based on their datatype.

```
var currentValue = mixpanelClient.GetSessionProperty("ASessionProperty");
```

### Parameters
`name` — Named session property to retrieve.

bool HasSessionProperty(string name)
----------------------------------
Checks if a session property has been set & has a value.

```
if(mixpanelClient.HasSessionProperty("ASessionProperty")) {
    console.log("ASessionProperty has been set");
}
```

`name` — Property to check for being set.

void RemoveSessionProperty(string name)
-------------------------------------
Removes a session property from the set of session properties. If the property isn't
set, then the method returns silently.

```
mixpanelClient.RemoveSessionProperty("ASessionProperty");
```

### Parameters
`name` — Property to remove.

void ClearSessionProperties()
---------------------------
Clears all currently set session properties.

```
mixpanelClient.ClearSessionProperties();
```

void SetSuperPropertyAs<Type>(String name, [String/Integer/Double/Boolean] value)
-----------------------------------------------------------------
Sets a super property on the class, that is persisted across instances. You can
store `string`'s, `int`'s,`double`'s, and `boolean`'s. When consuming this, you
need to use the named versions of this method:
`SetSuperPropertyAsString` for strings, `SetSuperPropertyAsInteger` for integers,
`SetSuperPropertyAsDouble` for doubles, and `SetSuperPropertyAsBoolean` for,
obviously, `Booleans`.

```
mixpanelClient.SetSuperProperty("ASuperProperty", "SuperValue");
```

### Parameters
`name` — Name of the property that is to be set (required)

`value` — Value to be set for the supplied name (required)

string/double/bool GetSuperPropertyAsString/Integer/Double/Boolean(string name)
-----------------------------------------------------------------------
Retrieves a value from the super property storage, and returns it to the caller.

Since they're all different only in their return type, and accept the same
parameters, they're named differently based on their datatype.

```
var currentValue = mixpanelClient.GetSuperProperty("ASuperProperty");
```

### Parameters
`name` — Named super property to retrieve.

bool HasSuperProperty(string name)
----------------------------------
Checks if a super property has been set & has a value.

```
if(mixpanelClient.HasSuperProperty("ASuperProperty")) {
    console.log("ASuperProperty has been set");
}
```

`name` — Property to check for being set.

void RemoveSuperProperty(string name)
-------------------------------------
Removes a super property from the set of super properties. If the property isn't
set, then the method returns silently.

```
mixpanelClient.RemoveSuperProperty("ASuperProperty");
```

### Parameters
`name` — Property to remove.

void ClearSuperProperties()
---------------------------
Clears all currently set super properties, excluding the user identity. To clear
that, call `ClearUserIdentity`.

```
mixpanelClient.ClearSuperProperties();
```

void Start()
------------
Starts processing any events that are queued.

```
mixpanelClient.Start();
```

IAsyncAction PauseAsync()
-------------------------
Drains the queue to storage, and stops processing any events pending upload to
the service.

Once you're ready to process events again, call `Start()`.

```
mixpanelClient.PauseAsync().done(...);
```

IAsyncAction ClearStorageAsync()
--------------------------------
Removes any events that have been queued to storage, but have not been uploaded
to the service yet.

```
mixpanelClient.ClearStorageAsync().done(...);
```

repository: grork/MixpanelClient

repo_name: grork/MixpanelClient