text:
# Blist API Wrapper for Python

## Table of contents

1. [Getting started](#getting-started)
2. [Installing](#installing)
3. [Creating a `Blist` instance](#creating-a-blist-instance)
4. [Using webhooks](#using-webhooks)
5. [Reference](#reference)

## Getting started

This is the documentation for the Blist API wrapper written in Python. You'll want to make sure to check out the [table of contents](#table-of-contents) for information on installing and getting the Blist API wrapper working correctly. You need to be using [discord.py](https://github.com/Rapptz/discord.py) and be using the bot commands extension in your project to be able to use this API wrapper.

## Installing

**It is assumed that you have basic knowledge of using the command line and using PyPi (`pip`).**

1. Create a [virtual environment](https://docs.python.org/3/tutorial/venv.html) for installing the package and then proceed to activate the virtual environment.
2. Run `pip install -U blistpy`. This will install everything required to make the package work.
3. Congratulations, you've completed the installation of the Blist API wrapper.

## Creating a `Blist` instance

Import the Blist wrapper by putting `import blist` at the top of your main bot file. This will import the wrapper into the file so you can start using it.

Once you have imported the wrapper, you need to create an instance of `Blist`. `Blist` takes a `Bot` or `AutoShardedBot` instance and your Blist API token. It should look something like below. You can omit `token="your blist token"` if you don't need to make any authorized requests.

```py
import blist

blist_api = blist.Blist(bot, token="your blist token")
```

It's time to begin making requests. Check out the [reference](#reference) for a full list of methods.

## Using webhooks

In Blist, webhooks are used to send a request to your server whenever your bot is upvoted. This can be utilized in many ways, usually for vote locking without having to constantly poll the server to see if someone has upvoted the bot.

You can easily setup a webhook server by using the included server. The code below creates an instance of `WebhookServer` and runs it. Once you run it, whenever a user upvotes your bot, an `on_blist_vote` event will be fired containing the user ID of the user and the time they upvoted it.

### Run webhook server

```py
import blist

blist_api = blist.Blist(bot, token="your blist token")

webhook = blist.WebhookServer(blist_api)

await webhook.run()
```

### Receive vote event

```py
# Outside of a cog

@bot.event
async def on_blist_vote(user_id, time):
    # process upvote
    pass

# Inside of a cog

@commands.Cog.listener()
async def on_blist_vote(self, user_id, time):
    # process upvote
    pass
```

### Close webhook server

```py
import blist

blist_api = blist.Blist(bot, token="your blist token")

webhook = blist.WebhookServer(blist_api)

await webhook.run()

await webhook.close()
```

## Reference

### `blist.Blist(bot, token=None)`

Client interface for interacting with the entire Blist API.

**Parameters**

+ **bot** (`commands.Bot`) — Discord bot instance to be used with the API.
+ **token** (Optional[`str`]) — Blist API token. This isn't required if you do not need authorization.

---

### `await blist.Blist.fetch_bot(bot_id=None)`

*This method is a coroutine.*

Fetches information about a bot. Does not require authorization.

**Parameters**

+ **bot_id** (Optional[`int`]) — The ID of the bot to fetch information about. Defaults to the current bot.

**Raises**

`blist.errors.UnknownBot` — The bot was not found on the list.

**Returns**

|Attribute|Type|Description|
|---|---|---|
|id|`int`|Bot ID|
|name|`str`|Name of the bot|
|main_owner|`int`|ID of the main owner of the bot|
|owners|`str`|The secondary bot owner IDs|
|library|`str`|The library the bot was programmed in|
|website|`str`|Link to the bot's website|
|github|`str`|Link to the bot's GitHub repository|
|short_description|`str`|Short description of the bot|
|long_description|`str`|Long description of the bot|
|prefix|`str`|The bot's prefix|
|invite_url|`str`|Link to the invite URL of the bot|
|support_server|`str`|The bot's support guild invite code|
|tags|List[`str`]|List of the bot's tags on the Blist website|
|monthly_votes|`int`|Amount of votes the bot has gotten within a month|
|total_votes|`int`|Amount of votes the bot has gotten in all time|
|certified|`bool`|Whether the bot is certified on the Blist website|
|vanity_url|`str`|The vanity URL to the bot on the Blist website|
|server_count|`int`|Amount of guilds the bot is in|
|shard_count|`int`|Amount of shards the bot is using|
|add_date|`datetime.datetime`|The date the bot was added to the Blist website|
|invites|`int`|Amount of times the bot has been invited from the Blist website|
|page_views|`int`|Amount of views the bot's page has received|
|donate_url|`str`|Link to the bot's donate page|
|avatar_hash|`str`|The bot's avatar hash|
|privacy_policy_url|`str`|Link to the bot's privacy policy URL|
|status|`str`|The bot's current status|

**Return Type**

`blist.models.Bot`

---

### `await blist.Blist.post_bot_stats()`

*This method is a coroutine.*

Posts bot statistics to the Blist website. Requires authorization.

**Raises**

`blist.errors.InvalidData` — Invalid guild or shard count sent to the server. Normally, you will not receive this.

`blist.errors.InvalidAuthorization` — Invalid token provided or you did not specify a token.

`blist.errors.UnknownBot` — The bot was not found on the list.

---

### `await blist.Blist.fetch_user_info(user_id)`

*This method is a coroutine.*

Fetches information about a user. Does not require authorization.

**Parameters**

+ **user_id** (`int`) — The ID of the user to fetch information about.

**Raises**

`blist.errors.InvalidData` — The user ID must be an `int`.

`blist.errors.UnknownUser` — The user's account was not found on the list.

Fetches monthly and total votes. This also returns users who have voted for your bot. Requires authorization.

**Raises**

`blist.errors.InvalidAuthorization` — Invalid token provided or you did not specify a token.

`blist.errors.UnknownBot` — The bot was not found on the list.

**Returns**

**`blist.models.Votes`**

|Attribute|Type|Description|
|---|---|---|
|monthly|`int`|Amount of votes the bot has gotten within a month|
|total|`int`|Amount of votes the bot has gotten in all time|
|votes|List[`blist.models.Vote`]|List of users who have voted for your bot and the time they did so|

**`blist.models.Vote`**

|Attribute|Type|Description|
|---|---|---|
|userid|`int`|The ID of the user who voted|
|time|`datetime.datetime`|The timestamp of when the user voted|

**Return Type**

`blist.models.Votes`

---

### `await blist.Blist.fetch_bot_reviews()`

*This method is a coroutine.*

Fetches the reviews a bot has recieved. Requires authorization.

**Raises**

`blist.errors.InvalidAuthorization` — Invalid token provided or you did not specify a token.

`blist.errors.UnknownBot` — The bot was not found on the list.

**Returns**

**`blist.models.Reviews`**

|Attribute|Type|Description|
|---|---|---|
|reviews|List[`blist.models.Review`]|List of reviews on the bot. Contains the feedback, whether it is recommended and the time|

**`blist.models.Review`**

|Attribute|Type|Description|
|---|---|---|
|feedback|`str`|The way the reviewing user felt about the bot|
|recommended|`bool`|Whether the reviewing user recommends the bot to other users|
|time|`datetime.datetime`|The timestamp of when the user left the review|

**Return Type**

`blist.models.Reviews`

---

### `await blist.Blist.close()`

*This method is a coroutine.*

Disallows the `blist.Blist` instance from being used to make anymore requests to the API.

**Note:** You must run this when stopping your bot.

---

### `blist.WebhookServer(blist, port=8000)`

*This method has been disabled until further notice.*

Server for receiving upvote events and dispatching them.

**Parameters**

+ **blist** (`blist.Blist`) — An instance of `Blist`. You **must** have an API token specified.
+ **port** (`int`) — The port to run the server on. Defaults to `8000`.

**Dispatch Event**

`on_blist_vote`

**Dispatch Parameters**

+ **user_id** (`int`) — The ID of the user who upvoted the bot.
+ **time** (`datetime.datetime`) — The timestamp of when the user upvoted the bot.

---

### `await blist.WebhookServer.run()`

*This method has been disabled until further notice.*

*This method is a coroutine.*

Starts the webhook server and allows it to serve requests.

**Note:** You do not need to run this method in a task, everything is handled for you.

---

### `await blist.WebhookServer.close()`

*This method has been disabled until further notice.*

*This method is a coroutine.*

Stops the webhook server and disallows it from serving requests.

**Note:** You must run this when stopping your bot if the server is currently running.

gha_language: Python


text:
Scalate Samples
===============

Scalate sample applications, including [scalate-sample](scalate-sample), a sample web application which contains
a number of example templates.

#### Usage:
Maven is required to build the sample applications. To run a sample application, from the application's directory
run the `mvn jetty:run` command, then open the sample homepage.

#### Note:
This plugin was separated from the main [scalate repository][1] in March 2015.

[1]: https://github.com/scalate/scalate

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# E-commerce Back End

 [![License](https://img.shields.io/badge/License-ISC-yellow.svg)](https://opensource.org/licenses/ISC)

  ## Description

  working Express.js API and configure it to use Sequelize to interact with a MySQL database..

  ## Table of Contents

  If your README is very long, add a table of contents to make it easy for users to find what they need.

  * [Installation](#installation)
  * [Usage](#usage)
  * [License](#license)
  * [Contributing](#contributing)
  * [Tests](#tests)
  * [Questions](#Questions)

  ## Installation

  Clone the repository.

  ## Usage

  Follow the instructions in the following video.

  [![Watch the video](./img/insomnia.PNG)](https://drive.google.com/file/d/108zWtd1UAflFvr083VVZzM03RgkqQDPO/view)

  ## License

  Licensed under the ISC license.

  ## Contributing

  Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

  ## Tests

  In the terminal run: npm start

  ## Questions

  If you have any further questions contact me on github or my email:

  [NIKO09ES](https://github.com/NIKO09ES)

  [nicolasesquivelruiz@gmail.com](mailto:nicolasesquivelruiz@gmail.com)

license: ISC


text:
---
layout:     post
title:      "A Primitive CryptoCurrency Trading Strategy"
subtitle:   "I investigate some mildly outdated cryptocurrency data and implement a primitive trading strategy."
date:       2018-02-18 12:00:00
author:     "Clint Howard"
category: Portfolio
tags: [python, data, finance]
comments: True
---
# CryptoCurrency Data Analysis & Primitive Trading

Dataset: https://www.kaggle.com/natehenderson/top-100-cryptocurrency-historical-data

This post is purely for fun/demonstrative purposes... nobody should actually take any investment advice or purchase cryptocurrency based on primitive trading strategies/analysis.

```python
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import glob
import datetime as dt

import seaborn as sns

import warnings
warnings.filterwarnings('ignore')
```

```python
path =r'D:\Downloads\Coding\Datasets\CryptoCurrencyHistoricalData' # use your path
allFiles = glob.glob(path + "/*.csv")
frame = pd.DataFrame()
list_ = []
for file_ in allFiles:
    df = pd.read_csv(file_, delimiter=";")
    list_.append(df)
frame = pd.concat(list_)
```

```python
close_df = pd.merge(list_[0].iloc[:,[0,4]], list_[1].iloc[:,[0,4]], how = "outer", on="Date")

for i in range(2,len(list_)):
    close_df = pd.merge(close_df, list_[i].iloc[:,[0,4]], how = "outer", on="Date")

names = []
for i in range(0, len(allFiles)):
    names.append(allFiles[i].split(path+"\\")[1].split(".csv")[0])
names.insert(0, "Date")
close_df.columns = names
close_df = close_df.fillna(0)

close_df.Date[96] = '18/08/2017'
close_df.Date[672] = '18/08/2016'
close_df.Date[827] = '18/08/2015'
close_df.Date[1192] = '18/08/2014'
close_df.Date[1557] = '18/08/2013'

close_df.set_index("Date", inplace=True)
close_df.index = pd.to_datetime(close_df.index, format="%d/%m/%Y")
close_df.sort_index(ascending=True, inplace=True)
```

```python
mcap_df = pd.merge(list_[0].iloc[:,[0,6]], list_[1].iloc[:,[0,6]], how = "outer", on="Date")

for i in range(2,len(list_)):
    mcap_df = pd.merge(mcap_df, list_[i].iloc[:,[0,6]], how = "outer", on="Date")

mcap_df.columns = names

mcap_df.Date[96] = '18/08/2017'
mcap_df.Date[672] = '18/08/2016'
mcap_df.Date[827] = '18/08/2015'
mcap_df.Date[1192] = '18/08/2014'
mcap_df.Date[1557] = '18/08/2013'

mcap_df.set_index("Date", inplace=True)
mcap_df.index = pd.to_datetime(mcap_df.index)
```

Not unexpectedly, the price profiles of most cryptocurrencies are quite similar...virtually nothing for a while and then explosive growth.

```python
close_df.loc[:,np.max(close_df, axis=0) < 200].plot(figsize=(10,10))
plt.legend(loc="center right", bbox_to_anchor=[1.5, 0.5],
           ncol=2,title="CryptoCurrency")
plt.ylabel("Currency Price (/USD)")
plt.show()
```

![png](/img/cryptotrade_6_0.png)

```python
close_df.loc[:,np.max(close_df, axis=0) > 100].plot(figsize=(10,10))
plt.legend(loc="center right", bbox_to_anchor=[1.2, 0.5],
           ncol=1,title="CryptoCurrency")
plt.ylabel("Currency Price (/USD)")
plt.show()
```

![png](/img/cryptotrade_7_0.png)

```python
temp_df = pd.concat([close_df['bitcoin'], close_df.loc[:, close_df.columns != 'bitcoin'].shift(1)])
```

Also not unexpected, we observe some very strong correlation across a large cross-section of the cryptocurrency markets.

```python
corr = temp_df.corr()

mask = np.zeros_like(corr, dtype=np.bool)
mask[np.triu_indices_from(mask)] = True

fig, ax = plt.subplots(figsize=(20,15))
cmap = sns.diverging_palette(220, 10, as_cmap=True)

sns.heatmap(corr, mask=mask)
plt.show()
```

![png](/img/cryptotrade_10_0.png)

# Basic Trading Strategy
Here we implement a pretty basic trading strategy, where we look at the difference in BTC prices over a certain time-horizon and  either buy/sell depending on the direction.

The basic premise is:
* Calculate 10d and 40d average BTC price.
* Choose some target delta between Price_Diff = Price(10d) - Price(40d), and whenever Price_Diff > delta we buy, and when the delta closes we sell.

```python
btc = pd.DataFrame(close_df['bitcoin'], index=close_df.index)
btc.columns = ["bitcoin"]
btc['10d'] = np.round(btc["bitcoin"].rolling(window=10).mean(),2)
btc['40d'] = np.round(btc["bitcoin"].rolling(window=40).mean(),2)
```

```python
btc[['bitcoin','10d','40d']].plot(grid=True,figsize=(8,5))
plt.show()
```

![png](/img/cryptotrade_13_0.png)

We compare our strategy against a simple buy and hold approach. Naturally given the volatility in bitcoin and the astronomical growth, we'd expect that the buy and hold would be incredibly difficult to beat... especially if we started to take into account transaction costs (and potential FX issues if purchasing via a non-USD currency).

Given the huge shift in prices of BTC, we also would prefer to have a dynamically adjusting delta... as using a constant one over even a 6-12 month period will likely result in poor outcomes.

```python
btc = btc[btc.index > pd.datetime(2017,1,1)]
btc['10-40'] = btc['10d'] - btc['40d']
X =  50
btc['Stance'] = np.where(btc['10-40'] > X, 1, 0)
btc['Stance'] = np.where(btc['10-40'] < X, -1, btc['Stance'])
btc['Stance'].value_counts()

btc['Stance'].plot(lw=1.5,ylim=[-1.1,1.1])
plt.show()

btc['Market Returns'] = np.log(np.float64(btc['bitcoin'] / btc['bitcoin'].shift(1)))
btc['Strategy'] = btc['Market Returns'] * btc['Stance'].shift(1)

btc[['Market Returns','Strategy']].cumsum().plot(grid=True,figsize=(8,5))

plt.show()

```

![png](/img/cryptotrade_15_0.png)

![png](/img/cryptotrade_15_1.png)

### Optimisation
As above, we see that our strategy substantially underperforms the simple buy and hold strategy. Now for fun, we can generalise our approach and do some basic optimisation/variable mining.

```python
def annualised_sharpe(returns, N=252):
    return np.sqrt(N) * (returns[~np.isnan(returns)].mean() / returns[~np.isnan(returns)].std())

def bitcoin_sim(btc, shift_time, price_tol, forecast_length):
    btc['diff'] = btc["bitcoin"] - btc["bitcoin"].shift(shift_time)

    btc['Stance'] = np.where(btc['diff'] < -3*price_tol, -1, 0)
    btc['Stance'] = np.where(btc['diff'] > price_tol, 1, btc['Stance'])
   # btc['Stance'].value_counts()

    #btc['Stance'].plot(lw=1.5,ylim=[-1.1,1.1])
    #plt.show()

    btc['Market Returns'] = np.log(np.float64(btc['bitcoin'] / btc['bitcoin'].shift(1)))
    btc['Strategy'] = btc['Market Returns'] * btc['Stance'].shift(forecast_length)

    #btc[['Market Returns','Strategy']].cumsum().plot(grid=True,figsize=(8,5))

    return (btc['Strategy'].cumsum().tail(1), annualised_sharpe(btc['Strategy']))

```

```python
bitcoin_sim(btc, 1, 1, 1)
```

    (Date
     2017-11-22    0.220979
     Name: Strategy, dtype: float64, 0.24081979662549807)

```python
shift_time = np.linspace(1, 200, 10, dtype=int)
price_tol = np.linspace(-200, 300, 10, dtype=int)
#forecast_length = np.linspace(1, 30, 5, dtype=int)

results_pnl = np.zeros((len(shift_time), len(price_tol)))
results_sharpe = np.zeros((len(shift_time), len(price_tol)))

market_returns = btc['Market Returns'].cumsum().tail(1)
market_sharpe = annualised_sharpe(btc['Market Returns'])

for i, shift_t in enumerate(shift_time):
    for j, price_t in enumerate(price_tol):
        pandl, risk = bitcoin_sim(btc, shift_t, price_t, 1)
        results_pnl[i, j] = pandl - market_returns
        results_sharpe[i, j] = risk - market_sharpe
```

```python
max(results_pnl.flatten())
```

    0.16149115817834314

```python
sns.kdeplot(pd.DataFrame(results_pnl), shade=True)
plt.show()
```

![png](/img/cryptotrade_21_0.png)

```python
sns.kdeplot(pd.DataFrame(results_sharpe), shade=True)
plt.show()
```

![png](/img/cryptotrade_22_0.png)

We can take the results out of the above... and look at what the returns profile looks now. We see that our strategy does quite well early on but has substantially lagged the market. Nonetheless, we have a decent framework for investigating very primitive and basic trading strategies.

```python
price_diff_time = 5
price_tol = 50
forecast_horizon = 2

btc['diff'] = btc["bitcoin"] - btc["bitcoin"].shift(price_diff_time)

btc['Stance'] = np.where(btc['diff'] < -3*price_tol, -1, 0)
btc['Stance'] = np.where(btc['diff'] > price_tol, 1, btc['Stance'])
btc['Stance'].value_counts()

btc['Stance'].plot(lw=1.5,ylim=[-1.1,1.1])
plt.show()

btc['Market Returns'] = np.log(np.float64(btc['bitcoin'] / btc['bitcoin'].shift(1)))
btc['Strategy'] = btc['Market Returns'] * btc['Stance'].shift(forecast_horizon)

btc[['Market Returns','Strategy']].cumsum().plot(grid=True,figsize=(8,5))

plt.show()

```

![png](/img/cryptotrade_24_0.png)

![png](/img/cryptotrade_24_1.png)

A key feature of a trading strategy that needs to be considered is both turnover and the flowon effect into transaction costs. As expected, because we're using a small delta we our executing A LOT of buy/sell orders... and naturally we would expect our underperformance to be even worse.

So in conclusion... most people would have likely been better off just buying and holding BTC as opposed to trying to trade based off of any form of technical analysis.

```python
plt.plot(btc.index, btc['bitcoin'], label="Close Price")
plt.plot(btc.ix[btc.Stance == 1]['bitcoin'].index, btc.ix[btc.Stance == 1]['bitcoin'], '^', markersize=10, color='g')
plt.plot(btc.ix[btc.Stance == -1]['bitcoin'].index, btc.ix[btc.Stance == -1]['bitcoin'], 'v', markersize=10, color='r')
plt.plot(btc.index, btc["diff"], label="pricediff")
plt.show()
```

![png](/img/cryptotrade_26_0.png)

## Extra data to explore

```python
from ggplot import *
```

```python
df = pd.read_csv(r"D:\Downloads\crypto-markets.csv")
df.date = pd.to_datetime(df.date)
```

```python
df.head()
```

      slug
      symbol
      name
      date
      ranknow
      open
      high
      low
      close
      volume
      market
      close_ratio
      spread

      0
      bitcoin
      BTC
      Bitcoin
      2013-04-28
      1
      135.30
      135.98
      132.10
      134.21
      0
      1500520000
      0.5438
      3.88

      1
      bitcoin
      BTC
      Bitcoin
      2013-04-29
      1
      134.44
      147.49
      134.00
      144.54
      0
      1491160000
      0.7813
      13.49

      2
      bitcoin
      BTC
      Bitcoin
      2013-04-30
      1
      144.00
      146.93
      134.05
      139.00
      0
      1597780000
      0.3843
      12.88

      3
      bitcoin
      BTC
      Bitcoin
      2013-05-01
      1
      139.00
      139.89
      107.72
      116.99
      0
      1542820000
      0.2882
      32.17

      4
      bitcoin
      BTC
      Bitcoin
      2013-05-02
      1
      116.38
      125.60
      92.28
      105.21
      0
      1292190000
      0.3881
      33.32

```python

ggplot(aes(x='date', y='close', color='name'), data=df[df.ranknow <= 10]) + geom_line()
```

![png](/img/cryptotrade_31_0.png)

    <ggplot:<PHONE_NUMBER>37)>

```python
* Shifted correlation i.e. what happens to price of other currencies in days after bitocin has large increases
```

license: MIT


text:
## This is a code snippet that requires jQuery (I know, I hate using it too!)

For when you need to inspect event objects returned in a mobile device, but do not have the ability to utilize Monaca's
USB debugging since it requires a constant WiFi connection and I kept getting an error even though the device was paired to the pc.

The code is not commented and was heavily modified from the source :  http://www.codeproject.com/Articles/24549/How-to-Inspect-a-JavaScript-Object

The function requires 4 options and is called as such:

`document.getElementById('log').innerHTML = inspect(obj, maxLevels, level, val)` just have an empty `div` with an id of log or whatever for the function to pass the data.

`obj` is the object you are passing in to be inspected

`maxlevels` is how deep you want it to go.  Just note that going beyond 4 puts some serious drain on the device.

`level` is the starting point of inspection and should pretty much always be 0 unless you want to start deeper in your object.

`val` is if you want to show the value held in the object.  This should pretty much always be false as setting it to true can also drain your device.

Be forewarned though, this code can generate some very unique warnings in the console because it is resource intensive.  Sometimes, once triggered, it can take several seconds before returning results.  Patience is a must.

One final warning, I highly recommend putting the function call in an if statement to insure it can only be ran once.

repository: munsterlander/Onsen-Examples

gha_language: HTML

gha_license_id: MIT

repo_name: munsterlander/Onsen-Examples


text:
---
layout: default
title: Computing Etymologies | About
---

# About Computing Etymologies

Contributors
- [Erty Seidohl](https://erty.me)

## Contribute

Consider contributing to this project! Instructions are on [the Github](https://github.com/ertyseidohl/computing-etymologies).

Also consider joining the Computing Etymologies Discord: [![Discord Chat](https://img.shields.io/discord/732473346867986442.svg)](https://discord.gg/uN2AAr8).

If you're not familiar with Github or unsure how to contribute, please feel free to ask in the Discord!

repository: hyfen/computing-etymologies

repo_name: hyfen/computing-etymologies


text:
# basic-auth

## NOTES

1. authentication vs authorization
2. make sing in and sign up system

## Provided Link

- repo action -->> [repo action](https://github.com/sultan-elayan/basic-auth/actions)
- PR -->> [PR](https://github.com/sultan-elayan/basic-auth/pull/1)
- heroku deployment -->> [heroku deployment](https://sultan-basic-auth.herokuapp.com/)

## MUL

![MUL](LAB-06.jpeg)

repository: sultan-elayan/basic-auth

branch_name: refs/heads/main

gha_language: JavaScript

repo_name: sultan-elayan/basic-auth


text:
## To run....

- `git clone https://github.com/abhirockzz/javaee8-jaxrs-server-async-pipeline.git`
- `mvn clean install` - will create `booking.war` in `target`
- Create Docker image - `docker build -t <tag> .`
- Run ! `docker run --rm --name javaee8-jaxrs-server-async-pipeline -it -p 8080:8080 <tag>`
- what's your Docker host IP ? `docker-machine ip` e.g. <IP_ADDRESS>

## Test it...

- `curl http://<docker_host_ip>:8080/booking/cabs/abhi`
- hold on... 3-5 seconds
- you should see a message like this - `Your driver is john doe and OTP is 1234`

That's it..

gha_language: Java


text:
---
layout: default
---

# 1997-01-27 - Re: it aint successful until someone loses his temper <g>

## Header Data

From<EMAIL_ADDRESS>(Dr.Dimitri Vulis KOTM)

To<EMAIL_ADDRESS>Message Hash: 9916f00f263dd3e26cd79b0ce92dc1ebd187b44a64522adf11e7aee77e109a9a

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1997-01-27 01:30:30 UTC

Raw Date: Sun, 26 Jan 1997 17:30:30 -0800 (PST)

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Dr.Dimitri Vulis KOTM)
Date: Sun, 26 Jan 1997 17:30:30 -0800 (PST)
To<EMAIL_ADDRESS>Subject: Re: it aint successful until someone loses his temper <g>
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Paul Penrod<EMAIL_ADDRESS>writes:

> Well, I see that you could'nt leave well enough alone... :-)
>
> Since Snow decided to jump into your face on this one, I might as well
> throw my $0.02 on the table as well. Funny how my trashcan stays very empty
> these days now that cypherpunks is in my bit bucket...

I suggest you subscribe to cypherpunks-unedited. It may go away, but
for now it's much more interesting than the censored version.

> Frankly, it does not surprise me that homosexuality is yet another
> pointless off-topic to be discussed on the list.

Thanks to the moderation, only one side of the issue gets aired anyway.

> >> +Thank God for AIDS.

Amen.

> >>         when AIDS was relatively obscure, I always dismissed AIDS as
> >>     God's response to homosexuality (and other crimes against nature);
> >>     i.e. -settlement by a just God.
> >
> >     I almost threw a dumb ass redneck of a ship in the middle of the ocean
> >for a comment like this.
...
> This politically correct bullshit response is just symptomatic of someone
> who is uncomfortable with the position taken for expediency's sake and is
> trying to justify to himself the course taken.

The "politically correct" homosexuals, like snow and gilmore and sandfart
consider (violent) action to be a reasonable response to speech they don't like
(e.g. "homophobic") - not "more speech". Someone says something you disagree
with on a mailing list? Unsubscribe him! Ban him from the list! Institute
moderation to auto-discard everything he says! Curiously, African-American
children are taught that violence is a correct response to "racist" speech.

ObEbonics: "Dot's right, judge, I shot da mothafucka cuz he call me a nigga!"

When they run out of things to say, they start pulling plugs,
unsubscribing people, and "moderating"...

> >     1) If homosexuality is a "choice", why would anyone choose that
> lifestyle
> >where the averge life expectancy is in the 40's, that causes so much pain
> >among ones family, and so much conflict with the rest of society.

 You adopt a knee-jerk position that reinforces
> >your deliberate isolationism.  The name caller or the recipient. My vote goes
> to the name caller, as he assumes this to be a debate of fact, when in
> essence he's expressed only his opinion on the matter and not bothered to
> show teacher his homework (the dog ate it - so give me an "A" anyway 'cause
> I deserve it). ;->

And when the namecalling doesn't work, they respond with violence.

---

Dr.Dimitri Vulis KOTM
Brighton Beach Boardwalk BBS, Forest Hills, N.Y.: +1-718-261-2013, 14.4Kbps

{% endraw %}
```

## Thread

+ Return to [January 1997](/archive/1997/01)

+ Return to<EMAIL_ADDRESS>(Dr.Dimitri Vulis KOTM)](/authors/dlv_at_bwalk_dm_com_dr_dimitri_vulis_kotm_)"

+ _Unknown thread root_
  + 1997-01-27 (Sun, 26 Jan 1997 17:30:30 -0800 (PST)) - Re: it aint successful until someone loses his temper <g> -<EMAIL_ADDRESS>(Dr.Dimitri Vulis KOTM)_


text:
# QClient.js

> Node.js API wrapper for Aplo's Q API

__IMPORTANT:__ The current 0.0.2 release includes support for a single API endpoint. It is not production ready. Hold tight until we launch in about a week for full support for all API endpoints along with a well tested, well documented API client.

## What is Q?

Q, not to be confused with the Node.js promise library, is our internal insurance quoting API that we've decided to open up publicly. Q provides endpoints for generating "raw" insurance quotes, personalized quotes including ACA/Obamacare subsidies, and the ability to check for active insurance agent licenses.

To use Q you'll need to [sign up for an account and generate an API Client ID and Secret Token](https://q.aploquote.com).

## Installation

Installation is simple through npm: `npm install qclient`

## Usage

...

## Available Endpoints

### "Raw" Quotes

### Subsidy Estimates

### License Verification

## Contributing and Development

### Branching Strategy

### Testing

__You'll get extra points if you contribute to our test suite. We really take notice of that.__

## License

Q is licensed under the MIT license. You may have unlimited use of it for personal or commercial purposes, free of charge, with no strings attached. You can change it and share it or keep those changes to yourself. You could make money off this code. You can basically do anything you want so long as its legal and doesn't hurt anyone.  That's all.

```
The MIT License (MIT)

Copyright (c) 2015 Bill Patrianakos
Copyright (c) 2015 Aplo, LLC (https://aploquote.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

repository: ddakoda/q-node

repo_name: ddakoda/q-node


text:
## supernode version

Show the current version of supernode

### Synopsis

Display the version and build information of Dragonfly supernode, including GoVersion, OS, Arch, Version, BuildDate and GitCommit.

```
supernode version [flags]
```

### Examples

```
supernode version  0.4.1
  Git commit:     6fd5c8f
  Build date:     20190717-15:57:52
  Go version:     go1.12.10
  OS/Arch:        linux/amd64

```

### Options

```
  -h, --help   help for version
```

### SEE ALSO

* [supernode](supernode.md)	 - the central control server of Dragonfly used for scheduling and cdn cache

repository: antsystem/Dragonfly

branch_name: refs/heads/feat/antsystem

gha_language: Go

repo_name: antsystem/Dragonfly


text:
GoMobileDetect
==============

[![GoDoc](https://godoc.org/github.com/Shaked/gomobiledetect?status.png)](https://godoc.org/github.com/Shaked/gomobiledetect)
[![Build Status](https://travis-ci.org/Shaked/gomobiledetect.png?branch=master)](https://travis-ci.org/Shaked/gomobiledetect)
[![Coverage Status](https://coveralls.io/repos/Shaked/gomobiledetect/badge.png)](https://coveralls.io/r/Shaked/gomobiledetect)

### Description

GoMobileDetect is a lightweight package imported from PHP for detecting mobile devices including tablets.

The package is imported from [MobileDetect](http://www.mobiledetect.net) which was originally written in PHP.

### Installation

    $ go get github.com/Shaked/gomobiledetect

### Updates

#### Version 1.2.0

- Now supports using ```Http.Handler``` implementation. See [examples](https://github.com/Shaked/gomobiledetect/tree/master/examples)

#### Version 1.0.0
- The package name had been changed to *mobiledetect*.

#### Version 0.2.0
- This version introduces a new method ```IsKey(key int)```. This method is faster than the ```Is(key string)```. All keys can be found [here](https://github.com/Shaked/gomobiledetect/blob/maps-to-lists/rules.go#L4)

- The ```Is(key string)``` has been changed to support both ```string``` and ```int``` using the ```interface{}```.

#### Benchmarking

##### Version 0.1.2
```
BenchmarkIsMobile       2000       1001884 ns/op
ok      github.com/Shaked/gomobiledetect    7.091s
```

##### Version 0.2.0
```
BenchmarkIsMobile     100000         19278 ns/op
ok      github.com/Shaked/gomobiledetect    7.448s
```

### Usage

There are different ways of using the package:

- [Basic usage](examples/app.go)
- [Basic router implementation](examples/router.go)
- [Handler interface implementation](examples/app_handler.go)
- [Mux interface implementation](examples/app_mux.go)

### License

Go Mobile Detect is an open-source script released under [MIT License](http://www.opensource.org/licenses/mit-license.php).

repository: Shaked/gomobiledetect

repo_name: Shaked/gomobiledetect


text:
#Socres

Stands for SOCial RESponsibility.

Everyone is socially responsible and everyone has the opportunity to contribute to the world, the environment in which we live and work. Each in their own way.

This repository has several project containing a set of building blocks for building your typical business application.

[![Build status](https://ci.appveyor.com/api/projects/status/ek97x5yray3psxxj?svg=true)](https://ci.appveyor.com/project/Socres/socres)

### Source
- The Src folder contains the Socres solution. This solution has the projects with all the different building blocks.
	- [FakingEasy](src/Socres.FakingEasy/README.md)
	- [Web.Mvc](src/Socres.Web.Mvc/README.md)

### Samples
- The sample folder contains the SocresSample solution. This solution has projects with sample code for all the different building blocks.

repository: FvdG/Socres

repo_name: FvdG/Socres


text:
# ng2-autocomplete-component

# Installation
```js
npm install ng2-autocomplete-component
```

## Install & run the sample application (usage demo)

    cd examples/systemjs
    npm install
    npm start

Then access [http://localhost:3000](http://localhost:3000)

## Usage

### import AutoComplete components and AutoCompleteConfig class

```js
import {AutoComplete, AutoCompleteConfig} from 'ng2-autocomplete-component/components';
```

### initalize AutoCompleteConfig class

for autocomplete data from rest api (GET)

```js
let apiUrl = 'http://localhost:3000/data/api-response.json';
let minCharsForSearch = 1;
let placeholder = 'search..';//min amount of chars before autocomplete mayches results
let responseApiKey = 'id';//a reference to the key for example api response [{"id":1,"name":"USA"}, {..}]
let responseApiText = 'name';//a reference to the text for example api response [{"id":1,"name":"USA"}, {..}]
//init config class
this.autocompleteConfigAPISource = new AutoCompleteConfig(apiUrl, minCharsForSearch, placeholder, responseApiKey, responseApiText);
```

for autocomplete data from Array

```js
let dataArray = [{"id":1,"name":"USA"}, {"id":1,"name":"UK"}, {"id":1,"name":"Italy"}];
let minCharsForSearch = 1;
let placeholder = 'search..';//min amount of chars before autocomplete mayches results
let responseApiKey = 'id';//a reference to the key for example api response [{"id":1,"name":"USA"}, {..}]
let responseApiText = 'name';//a reference to the text for example api response [{"id":1,"name":"USA"}, {..}]
//init config class
this.autocompleteConfigAPISource = new AutoCompleteConfig(dataArray, minCharsForSearch, placeholder, responseApiKey, responseApiText);
```

### put component in template
```js
template: `
        <hr>
        <h1>ng2-autocomplete - data source form rest API (GET)</h1>
        <!-- *** you must put #id on component to get the result back -->
        <autocomplete #myAutoCompleteId [config]="autocompleteConfigAPISource"></autocomplete>
        <h4>* you need to leave field to see which term selected</h4>
        <!-- use selected value using component id -->
        <h2>RESULT SELECTED: </h2>{{myAutoCompleteId.term.value}}
    `
```


text:
#reveal-media-crawler

A large-scale media crawler based on the BUbiNG crawler

#BUbiNG resources

* [BUbiNG Maven dependency]
* [BUbiNG research group]
* [BUbiNG overview and configuration guidelines]

#Notes

* Teardown MorphiaManager on Agent shutdown
* Replace simmo.jar with the maven dependency once available

[BUbiNG maven dependency]:https://oss.sonatype.org/#nexus-search;quick~bubing
[BUbiNG research group]:http://law.di.unimi.it/
[BUbiNG overview and configuration guidelines]:http://law.di.unimi.it/software/bubing-docs/overview-summary.html

repository: MKLab-ITI/reveal-media-crawler

repo_name: MKLab-ITI/reveal-media-crawler


text:
---
layout: default
title: Code of Conduct
permalink: /conduct/
---

# Code of Conduct

## The Quick Version

The Dayton Data Visualization meetup is dedicated to providing a harassment-free experience for everyone, regardless of gender, gender identity and expression, age, sexual orientation, disability, physical appearance, body size, race, ethnicity, religion (or lack thereof), or technology choices. We do not tolerate harassment of meetup participants in any form. Sexual language and imagery is not appropriate for any meetup venue, including talks, workshops, parties, Twitter and other online media. Participants violating these rules may be sanctioned or expelled from the group without a refund at the discretion of the meetup  organizers.

Participants asked to stop any harassing behavior are expected to comply immediately.

Sponsors are also subject to the anti-harassment policy. In particular, sponsors should not use sexualized images, activities, or other material. Staff (including volunteers) should not use sexualized clothing/uniforms/costumes, or otherwise create a sexualized environment.

If a participant engages in harassing behavior, the meetup organizers may take any action they deem appropriate, including warning the offender or expulsion from the event with no refund.

If you are being harassed, notice that someone else is being harassed, or have any other concerns, please contact a meetup organizer immediately
([Michael Bowman](mailto:bowmanmc@gmail.com).

Meetup staff will be happy to help participants contact venue security or local law enforcement, provide escorts, or otherwise assist those experiencing harassment to feel safe for the duration of the event. We value your attendance.

We expect participants to follow these rules at all Dayton Data Visualization-related social events.

This code of conduct was adapted from
[http://confcodeofconduct.com](http://confcodeofconduct.com),
with hat tips to
[http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy](http://www.ashedryden.com/blog/codes-of-conduct-101-faq)
and
[http://www.ashedryden.com/blog/codes-of-conduct-101-faq](http://www.ashedryden.com/blog/codes-of-conduct-101-faq).
If you have questions or
concerns about our policy, feel free to contact the Dayton Data Visualization meetup
organizers or suggest edits at
[https://github.com/daytondv/www.daytondv.org](https://github.com/daytondv/www.daytondv.org).

gha_language: CSS


text:
# Optimize-Pullet-Project

Optimize the palette and pseudo-tint the image

Additional information can be found in the docx file. It is presented in Ukrainian.

## Demonstration

![screen 0](https://raw.githubusercontent.com/Voossu/Optimize-Pullet-Project/master/Images/screen_0.png)

![screen 1](https://raw.githubusercontent.com/Voossu/Optimize-Pullet-Project/master/Images/screen_1.png)

![screen 2](https://raw.githubusercontent.com/Voossu/Optimize-Pullet-Project/master/Images/screen_2.png)

repository: Voossu/Optimize-Pullet-Project

repo_name: Voossu/Optimize-Pullet-Project


text:
---
layout: post
title: "Generic Django attachment widgets"
categories: [blog, django]
tags: [django]
---

 * [django-attachments in
 pypi](http://pypi.python.org/pypi/django-attachments/0.3.1), my choice.
 Current version is a lot simpler than its previous one.
 * [akaihola's attachments](https://github.com/akaihola/django-attachments)


text:
# MEAN Stack (Angular 5) CRUD Web Application Example

To run locally:

* Clone this repo
* Run `npm install`
* Run `npm start`

By defualt it launches on 3000 port.

use the below URL to connect
# http://localhost:3000

# Notes
    - Start Mongo Server on your local


text:
title:: Tweet/This 1 Tiny Time Managem...
author:: [[@dickiebush on Twitter]]
full-title:: "This 1 Tiny Time Managem..."
type:: [[TweetURL]]
source:: https://twitter.com/dickiebush/status/1542528394927263745

- # [[Highlights]]
	- > This 1 tiny time management tip has helped me write *every day* for 500 days in a row.

	  Here's how to use it (no matter how busy you are): ([View Tweet](https://twitter.com/dickiebush/status/1542528394927263745))
	- > Let's start with some truth:

	  If you don't set your own constraints, the world will set them for you.

	  And here's my hunch:

	  If you're reading this thread, you have ambitious goals.

	  And those goals require big chunks of focused time and attention.

	  So here's a question for you: ([View Tweet](https://twitter.com/dickiebush/status/1542528399851274240))
	- > Over the last month, how many blocks of focused time and attention have you spent on those goals?

	  Chances are, the number is far lower than you'd like.

	  Because intruding on that time is a never-ending stream of competing distractions.

	  The solution?

	  • Unreachable.
	  • No distractions.
	  • Fully off the grid.
	  • Defended ruthlessly.

	  Just you and your work for a dedicated period of time.

	  Now, how do you find that time – especially if you're busy? ([View Tweet](https://twitter.com/dickiebush/status/1542528410081120257))
	- > To find your Sacred Hours, ask yourself these 2 questions:

	  • What time of day am I most productive?

	  • What time of day can I be least responsive?

	  The overlap are your Sacred Hours.

	  And unique to every person's Sacred Hours:

	  • The time
	  • The duration

	  Here's what I mean:

	  ![](https://pbs.twimg.com/media/FWgpa83WYAEuAXr.png) ([View Tweet](https://twitter.com/dickiebush/status/1542528417756848128))
	- > For some, it might be 3 hours every morning.

	  For others, it might be 15 minutes 2x per day during their commute.

	  But no matter who you are & how hectic your calendar is, you can find this time.

	  Once you choose them, there is 1 crucial step to get the most out of them: ([View Tweet](https://twitter.com/dickiebush/status/1542528423083524096))
	- > With your Sacred Hours chosen, you have to *defend them* ruthlessly.

	  And the best way to do this is to send yourself a calendar invite.

	  Treat this hour as a meeting with yourself – that you can't cancel!

	  Completed daily for a long period of time, these sessions compound.

	  ![](https://pbs.twimg.com/media/FWgpbsjXoAAlexm.jpg) ([View Tweet](https://twitter.com/dickiebush/status/1542528431849619457))
	- > Now, a few quick tips to get the most out of your Sacred Hours:

	  Design your workplace like an airplane cabin.

	  • One task
	  • One screen
	  • No distractions
	  • Music downloaded
	  • Phone on airplane mode

	  There's a reason people get their best writing done on airplanes! ([View Tweet](https://twitter.com/dickiebush/status/1542528438590128128))
	- > As for what you work on, do not waste your Sacred Hours on any kind of shallow, monotonous work.

	  Your Sacred Hours are for the creative, high-leverage, needle-moving work.

	  Define what that work is – then, show up ready to execute on it every day during your Sacred Hours. ([View Tweet](https://twitter.com/dickiebush/status/1542528443841142784))
	- > Now, I used my Sacred Hours to build a daily writing habit.

	  Because personally, I think writing every day is *the* highest-leverage habit you can develop.

	  And this framework has helped over 4,000 people start writing every day inside Ship 30 for 30:

	  https://t.co/JJNKZQKb75 ([View Tweet](https://twitter.com/dickiebush/status/1542528448794697728))
	- > But no matter your goal, finding & using your Sacred Hours will make reaching them inevitable.

	  So ask yourself these 2 questions:

	  • What time of day am I most productive?

	  • What time of day can I be least responsive?

	  Pick time from that overlap.

	  Then, get to work.

	  ![](https://pbs.twimg.com/media/FWgpdMJX0AERlMK.png) ([View Tweet](https://twitter.com/dickiebush/status/1542528456478572545))
	- > If you found this helpful, I'd appreciate if you jumped back to the top tweet and retweeted it so more people can learn about Sacred Hours ⏳

	  Here's the link:
	  https://t.co/RHzNaDxhVo ([View Tweet](https://twitter.com/dickiebush/status/1542533005121568768))
	- > For more writing frameworks like this:

	  1. Follow me @dickiebush for weekly threads on Thursdays at 10 AM EST

	  2. Join over 35,000 readers of The Digital Writing Compass – weekly digital writing templates & frameworks every Monday at 10 AM EST

	  https://t.co/Azt18H5NAl ([View Tweet](https://twitter.com/dickiebush/status/1542557800349548548))

url: https://raw.githubusercontent.com/logseq/docs/22e1fa3ad0211313eca152c35f6d51eef636bc0e/pages/Tweet___This 1 Tiny Time Managem...___.md

repository: logseq/docs

gha_language: Clojure

repo_name: logseq/docs


text:
---
layout: post
title: Week 13 - Design Expo, EECS 494 Showcase, and Final Reflection
---

With this final devlog, I go over the Design Expo and the EECS 494 + EMU Showcase. I discuss the feedback I received over both events and their implications. Finally, I reflect on the project as a whole.

## The Fall 2020 CoE Design Expo

The College of Engineering Design Expo was on Thursday, December 3rd. Over the four hour period of the event, a total of two people showed up to my presentation. This was very disheartening, to say the least, however the two people who did come showed a fair bit of interest in my research. I suspect the reason for the low attendence was due to the College of Engineering not announcing or advertising the event in any capacity. However, it is what it is.

The slides I presented at the event can be see [here](https://docs.google.com/presentation/d/1zl-6EEp7SOEROw0jPdHHJ6FFgav-9bWAdp_aZMvI5_o/edit?usp=sharing). They should be fairly straightforward to follow and contain many visuals. Hopefully, anyone who stumbles across this research in the future can find them helpful.

## The Fall 2020 EECS 494 + EMU Showcase

Austin suggested we submit our research projects to the EECS 494 + EMU Showcase if we wanted to them to get more attention. As my research involved making an enjoyable game using machine learning, this was the perfect opportunity to see how "fun" my game really was. As such, I presented my project on Tuesday, December 8th at the showcase. I got a fair bit of people to check it out and play my game. Some were even nice enough to give me feedback.

**Noteworthy Comments:**
- "I had a lot of fun reading through your slides and figuring out the game based on that! Really like the concept, and would not have been able to tell that the AI was ML based if I didn't know it already... You did a great job, love the aesthetics."

- "This was a really interesting game and made me learn new ways to avoid the birds each play. It's an ambitious project to make enemies that get better at the game as you do, but it turned out well. Sort of a temple run style game that's really hard."

- "Really cool game and great tutorial. I can see this game can be made into a endless game like temple run. I really like the idea to have bird drinking your nectar while you run. The behavior of the birds are also great and realistic."

Based on those and other comments, I'd say that the prototype game was a success. It was fun enough that people enjoyed it and the ML Agents were competent enough that people couldn't even tell they were machine learning based.

## Final Reflection

Looking back on this project, I can say although it had some rough periods, it was generally a success. I can look back at this project and say I am proud of what I was able to accomplish during the span of a semester. I was able to accomplish the goals I laid out for myself.

**Accomplished Project Goals:**
1. I managed to create a fun and engaging game that used machine learning agents as a central game mechanic.
   - Many individuals found the game interesting and fun. Some even went as far as to say they wouldn't have known the game used machine learning agents if it wasn't mentioned.
   - I managed to show the possibility and feasibility of such a task.
2. I documented the entire process along the way.
   - I covered everything from initial training to a final playable game.
   - I documented the problems I faced and the solutions I discovered along the way.
3. I created a guide for making an ML Agent centered game from scratch.
   - I presented a straight forward approach to get from learning to use Unity ML Agents Toolkit to a final game using complex agents as a central game mechanic.
   - I covered tips for avoiding general issues.
   - I described an approach to make more complex agents.
4. I provided paths to further research.
   - I briefly covered some avenues for future research discussing their benefits to academia and the difficulty and creative/intellectual freedoms involved.

In the process, I learned more about machine learning and created a game I'm happy to show to others. I can say I contributed to academia and the machine learning field. As such, I think it's safe to close the door on Project Talos.

Thank you for everyone who helped along the way. This wouldn't have been possible without you.

repository: OsamahAnsari/ProjectTalos

repo_name: OsamahAnsari/ProjectTalos


text:
---
layout: post
title: Assertion message trick
---

Here is a simple trick to print a message when an assertion is violated. Assuming you have the following assertion:

```c++
assert(foo != nullptr);
```

You then just append the message you want to print to the check with a logical conjunction like this:

```c++
assert(foo != nullptr && "Usually due to not calling bar()");
```

Now, when this assertion fails the following message is printed:

```
Assertion `foo != nullptr && "Usually due to not calling bar()"' failed.
```


text:
# stack-slice

Experimental Mir slice structure that allows for static length arrays
to be used rather than dynamic data structures.

With help from Snarwin from the D Language Code Club Discord server.

Still being worked on.


text:
# HKDSE ICT SBA Report

- [HKDSE ICT SBA Report](#hkdse-ict-sba-report)
- [Objective](#objective)
- [Design and Implementation](#design-and-implementation)
  - [Program Functions Overview](#program-functions-overview)
  - [Crucial Features](#crucial-features)
  - [Program Functions Detailed](#program-functions-detailed)
    - [Graphical User Interface (GUI)](#graphical-user-interface-gui)
      - [Home Page](#home-page)
      - [Navigation System (App Drawer)](#navigation-system-app-drawer)
      - [Event Details Page](#event-details-page)
      - [Accounts Page, Login Page and Registration Page](#accounts-page-login-page-and-registration-page)
        - [Accounts Page (Not Logged In)](#accounts-page-not-logged-in)
        - [Login Page](#login-page)
        - [Register Page](#register-page)
        - [Accounts Page (Logged In)](#accounts-page-logged-in)
      - [AI ChatBot Help Desk](#ai-chatbot-help-desk)
  - [Implementation](#implementation)
    - [Overview](#overview)
    - [Dataflow](#dataflow)
    - [Advantages](#advantages)
    - [Pascal HTTP Server](#pascal-http-server)
      - [Intentional Disabled Features](#intentional-disabled-features)
      - [Use of classes](#use-of-classes)
      - [Use of Custom APIs](#use-of-custom-apis)
- [Testing and Evaluation](#testing-and-evaluation)
  - [Data Validation](#data-validation)
    - [Server](#server)
    - [Client](#client)
  - [Custom Pascal Stack Tracer](#custom-pascal-stack-tracer)
    - [On](#on)
    - [Off](#off)
- [Learning Process Reflection](#learning-process-reflection)

# Objective
**Event Ticketing System** (ETS) aims to
- provide users with ease when booking and reserving tickets for their favourite events
- provide users with a great **user experience** (UX) with the help of a **graphical user interface** (GUI)
- allow **multi-user support** for booking tickets

The Purpose of ETS is to
- allow users to search and discover for events easily
- allow easy ticketing booking and reservation
- allow event organisers to generate analysis report based on their events

# Design and Implementation
## Program Functions Overview
- Show all events
  - events are listed out on the home page of the program
- Registration and Login
  - New users can register
  - Old users can login
- Joining events
  - Participators are able to join events
  - If the event is full, they will automatically be queued on the waiting list, and will automatically be moved to joined when space is available
- Creating Events
  - Organisers can create events by the help of a form
- Amendments of events
  - Organisers can edit event details later via the Created Events Page

## Crucial Features
- Database
  - Database used in ETS is one custom made from scratch, using a `NoSQL` document-orientated data structure
  - Database files are stored as `json` files

- User Authentication
  - Users are authenticated using a username or email with a password
  - Passwords are not stored directly inside the custom database system, passwords are
    1. first **salted**
    2. and then **hashed**
  - Server authenticate users by salting and hashing input password and compared to the original salted password
  - This uses various concepts in cryptography

- Custom Stack Tracer
  - Since Pascal doesn't really support runtime stacktrace, the custom stack tracer allows developers to view where went wrong easily

## Program Functions Detailed
### Graphical User Interface (GUI)
#### Home Page

<!-- ![alt text][ets-pages-home-mobile-dark] -->
![alt text][ets-pages-home-desktop-dark]

#### Navigation System (App Drawer)
- App drawer
  - is present on the left side of the screen for non-mobile users
  - is accessible via the menu icon on the top left of the screen for mobile users

![alt text][ets-app_drawer-mobile-dark]
![alt text][ets-app_drawer-desktop-dark]

#### Event Details Page
This page shows event details and allow participants to select tickets and join

![alt text][ets-pages-event_details-desktop-1-dark]
![alt text][ets-pages-event_details-desktop-2-dark]

#### Accounts Page, Login Page and Registration Page
Accounts page lets users view their account details if logged in, else, login and register button is shown
##### Accounts Page (Not Logged In)

![alt text][ets-pages-account-desktop-dark]

##### Login Page

![alt text][ets-pages-login-desktop-dark]

##### Register Page

![alt text][ets-pages-register-desktop-dark]

##### Accounts Page (Logged In)

![alt text][ets-pages-account_logged_in-desktop-dark]

#### AI ChatBot Help Desk
This chat screen allows users to ask help from an AI ChatBot, This ChatBot uses machine learning to map user's dynamic questions to fixed answers
![alt text][ets-chatbot-mobile-dark]

## Implementation
### Overview
Event Ticketing System consist of two parts
1. Server (Backend)
   - ETS Rest API (Written in `objectpascal`)
   - ChatBot Rest API (Written in `javascript`)
   - HTTP & HTTPS Web/Proxy Server (Written in `javascript`)
2. Client (Frontend)
   - Web (Written in `dart`, `html`, `scss`, `javascript`)
   - Android (Written in `dart`)
   - Windows (Written in `javascript`)
   - MacOS (Written in `javascript`)

### Dataflow
1. User request responses from HTTP & HTTPS Web/Proxy Server
2. Server responses with resources

### Advantages
- Most ICT SBA Projects doesn't support multi-user since the program is only available to one user, if copied to another machine, they won't share the same resources
- Our Event Ticketing System uses client and server concepts so multiple clients can connect to the same server, allowing multi-user support
- Since our server is based on Rest APIs with `cross origin` enabled, any other developers can use the API to create their own frontend with our backend server

### Pascal HTTP Server
#### Intentional Disabled Features
To prevent double booking, the ETS Rest API HTTP Server has multi-thread disabled, i.e. one request at a time.

#### Use of classes
On the server, all everything queried from the custom database are collections of documents or just documents.
Users, Events, Tickets, etc are classes extending from collections, while
User, Event, Ticket, etc are classes extending from documents.

This prevents double written codes, all Users, Events, Tickets, etc inherits functions from the collection bases class,
same applies for User, Event, Ticket, etc

#### Use of Custom APIs
1. FeliStorageAPI
   - All queries from database, the code looks nicer and easier to maintain

2. FeliFileAPI
   - All reading and writing of files is simplified to just using this API

# Testing and Evaluation
## Data Validation
### Server
All new users and events are validated before inserting into database to prevent invalid requests
### Client
TextFields will automatically validate when submit buttons are pressed. Respective errors are displayed directly below the TextField for easy reading

## Custom Pascal Stack Tracer
This custom build stack tracer allows developers to trace procedures and functions easily during development

### On
![alt text][stack_tracer-on]
### Off
![alt text][stack_tracer-off]

# Learning Process Reflection

<!-- TODO: Complete Learning Process Reflection -->

------
> Notes to self:
> Screenshots are captured at 800x800/400x800 pixels with device pixel ratio of 1.0

[ets-app_drawer-mobile-dark]: images/ets-app_drawer-mobile-dark.png "ETS App Drawer Mobile"
[ets-app_drawer-desktop-dark]: images/ets-app_drawer-desktop-dark.png "ETS App Drawer Desktop"
[ets-pages-home-mobile-dark]: images/ets-pages-home-mobile-dark.png "ETS Home Mobile"
[ets-pages-home-desktop-dark]: images/ets-pages-home-desktop-dark.png "ETS Home Desktop"
[ets-pages-event_details-desktop-1-dark]: images/ets-pages-event_details-desktop-1-dark.png "ETS Event Details"
[ets-pages-event_details-desktop-2-dark]: images/ets-pages-event_details-desktop-2-dark.png "ETS Event Details"
[ets-pages-account-desktop-dark]: images/ets-pages-account-desktop-dark.png "ETS Account"
[ets-pages-login-desktop-dark]: images/ets-pages-login-desktop-dark.png "ETS Login"
[ets-pages-register-desktop-dark]: images/ets-pages-register-desktop-dark.png "ETS Register"
[ets-pages-account_logged_in-desktop-dark]: images/ets-pages-account_logged_in-desktop-dark.png "ETS Accounts Logged in"
[ets-chatbot-mobile-dark]: images/ets-chatbot-mobile-dark.png "ETS AI ChatBot"

[stack_tracer-on]: images/stack_tracer-on.png "Stack Tracer turned on"
[stack_tracer-off]: images/stack_tracer-off.png "Stack Tracer turned off"


text:
---
title: "TLS"
linkTitle: "TLS"
weight: 2
description: |
  Setting up TLS to Traefik Ingress
---

It integrates with your existing infrastructure components and configures itself
automatically and dynamically. Traefik handles advanced ingress deployments
including mTLS of TCP with SNI and UDP. Operators define rules for routing
traffic to downstream systems through Kubernetes `Ingress` objects or more
specific `Custom Resource Definitions`. K8ssandra supports deploying
`IngressRoute` objects as part of a deployment to expose metrics, repair, and
Cassandra interfaces.


text:
# css-grids

This is a small project I put together after watching a [YouTube video](https://youtu.be/7kVeCqQCxlk) featuring [Morten Rand-Hendriksen](https://mor10.com/) discussing css grids and their usefulness.

This code is largely based on [this codepen](https://codepen.io/mor10/pen/NjeqyX).

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Acknowledgments

* [Mor10](https://github.com/mor10)

repository: ironic-name/css-grids

repo_name: ironic-name/css-grids


text:
### [Reducing Dishes](https://leetcode.com/problems/reducing-dishes)

A chef has collected data on the satisfaction level of his n dishes. Chef can cook any dish in 1 unit of time.

Like-time coefficient of a dish is defined as the time taken to cook that dish including previous dishes multiplied by its satisfaction level i.e. time[i] * satisfaction[i].

Return the maximum sum of like-time coefficient that the chef can obtain after dishes preparation.

Dishes can be prepared in any order and the chef can discard some dishes to get this maximum value.

Example 1:

Input: satisfaction = [-1,-8,0,5,-9]
Output: 14
Explanation: After Removing the second and last dish, the maximum total like-time coefficient will be equal to (-1*1 + 0*2 + 5*3 = 14).
Each dish is prepared in one unit of time.

Example 2:

Input: satisfaction = [4,3,2]
Output: 20
Explanation: Dishes can be prepared in any order, (2*1 + 3*2 + 4*3 = 20)

Example 3:

Input: satisfaction = [-1,-4,-5]
Output: 0
Explanation: People do not like the dishes. No dish is prepared.

Constraints:

n == satisfaction.length

1 <= n <= 500

-1000 <= satisfaction[i] <= 1000

gha_language: C


text:
LDDCollada
====

**LDDCollada** is a command-line application for converting a LEGO Digital Designer `.lxf` or `.lxfml` file to a COLLADA `.dae` scene.

**LDDCollada.Mac** is a Xamrin.Mac GUI for LDDCollada

**LDDCollada.Shared** is where the main conversion logic lives.

Options
----

**Generate Blank Duplicates of Decal Bricks**: Does what it says on the tin. Any bricks with decals will be accompanied by a copy of that brick without any decals in the output file.

**Copy Textures to Output**: Copies decal textures to the output folder. If not selected, the output `.dae` file will reference the original decal textures in the extracted `db.lif` folder.

**Fill Textures with Material Color**: Creates copies of all decal textures used, but with the background color of whatever material they are applied to. This is useful because the decal textures are transparent, so they can be applied on any background color, but this means they look like holes in the model. Only valid when Copy Textures to Output is activated.

**Flip Texture Coordinates Vertically**: Flips the Y component of texture coordinates (`y` becomes `1 - y`). This is required because different graphics programs treat texture coordinates differently.

Usage
----

**LDDCollada** is use like a normal command-line tool (mostly). Invoke it with the filenames of the input LDD models as command-line arguments, like so:
`LDDCollada.exe "my model.lxf" "my other model.lfxml"`
Or, if you are on Windows, drag the models you want to convert onto the `LDDCollada.exe` file.
It will try to read the location of the extracted `db.lif` directory from the `LDDCollada.ini` file. If it cannot be found, LDDCollada will open a folder browser so you can pick where the extracted `db.lif` folder is, and this will be saved to the `.ini`.
Currently, LDDCollada assumes that each of the Options listed above are **Enabled**. In the future, these should be specified as flags. PRs welcome.

**LDDCollada.Mac** is a standard Cocoa application (but C#).
Specify the extracted `db.lif` folder (if it isn't auto-detected in the default location), input file, Options (see above), and click Convert to pick an output filename and perform the conversion.

repository: epicabsol/LDDCollada

repo_name: epicabsol/LDDCollada


text:
# Kubestr

## What is it?

Kubestr is a collection of tools to discover, validate and evaluate your kubernetes storage options.

As adoption of kubernetes grows so have the persistent storage offerings that are available to users. The introduction of [CSI](https://kubernetes.io/blog/2019/01/15/container-storage-interface-ga/) (Container Storage Interface) has enabled storage providers to develop drivers with ease. In fact there are around a 100 different CSI drivers available today. Along with the existing in-tree providers, these options can make choosing the right storage difficult.

Kubestr can assist in the following ways-
- Identify the various storage options present in a cluster.
- Validate if the storage options are configured correctly.
- Evaluate the storage using common benchmarking tools like FIO.

[![asciicast](https://asciinema.org/a/7iJTbWKwdhPHNWYV00LIgx7gn.svg)](https://asciinema.org/a/7iJTbWKwdhPHNWYV00LIgx7gn)

## Using Kubestr
### To install the tool -
- Ensure that the kubernetes context is set and the cluster is accessible through your terminal. (Does [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) work?)
- Download the latest release [here](https://github.com/kastenhq/kubestr/releases/latest).
- Unpack the tool and make it an executable `chmod +x kubestr`.

### To discover available storage options -
- Run `./kubestr`

### To run an FIO test -
- Run `./kubestr fio -s <storage class>`
- Additional options like `--size` and `--fiofile` can be specified.
- For more information visit our [fio](https://github.com/kastenhq/kubestr/blob/master/FIO.md) page.

### To check a CSI drivers snapshot and restore capabilities -
- Run `./kubestr csicheck -s <storage class> -v <volume snapshot class>`

## Roadmap
- In the future we plan to allow users to post their FIO results and compare to others.

gha_language: Rust


text:
# Name

*piflash* - Raspberry Pi SD-flashing script with safety checks to avoid erasing the wrong device

# Synopsis

    piflash [--verbose] [--resize] [--config conf-file] input-file output-device

    piflash [--verbose] --sdsearch

    piflash --version

# Featured article

"Getting started with PiFlash: Booting your Raspberry Pi on Linux"

by Ian Kluft at OpenSource.com

March 15, 2019

# Description

PiFlash writes (or "flashes") an SD card for a Raspberry Pi. It includes safety checks so that it can only erase and write to an SD card, not another device on the system. The safety checks are probably of most use to beginners. For more advanced users (like the author) it also has the convenience of flashing directly from the file formats downloadable from raspberrypi.org without extracting a .img file from a zip/gz/xz file.

## User documentation

* [PiFlash program usage and installation](https://metacpan.org/pod/distribution/PiFlash/bin/piflash)
* [Online resources for PiFlash](https://metacpan.org/pod/distribution/PiFlash/doc/resources.pod)
  * [Where to download Raspberry Pi bootable images](https://metacpan.org/pod/distribution/PiFlash/doc/resources.pod#Where-to-download-Raspberry-Pi-bootable-images)
  * [Presentations and Articles](https://metacpan.org/pod/distribution/PiFlash/doc/resources.pod#Presentations-and-Articles)
* [PiFlash release on CPAN](https://metacpan.org/release/PiFlash)
* [PiFlash source code on GitHub](https://github.com/ikluft/piflash)

PiFlash documentation is available as Unix man-pages and as Perl POD (Plain Old Documentation).
Once installed, you can run `man` or `perldoc` from a shell to read the documentation:

    % man piflash

or

    % perldoc piflash

## Developer documentation

* [PiFlash](https://metacpan.org/pod/PiFlash) - Raspberry Pi SD-flashing script with safety checks to avoid erasing the wrong device
* [PiFlash::Command](https://metacpan.org/pod/PiFlash::Command) - process/command running utilities for piflash
* [PiFlash::Hook](https://metacpan.org/pod/PiFlash::Hook) - named dispatch/hook library for PiFlash
* [PiFlash::Inspector](https://metacpan.org/pod/PiFlash::Inspector) - PiFlash functions to inspect Linux system devices to flash an SD card for Raspberry Pi
* [PiFlash::MediaWriter](https://metacpan.org/pod/PiFlash::MediaWriter) - write to Raspberry Pi SD card installation with scriptable customization
* [PiFlash::Object](https://metacpan.org/pod/PiFlash::Object) - object functions for PiFlash classes
* [PiFlash::Plugin](https://metacpan.org/pod/PiFlash::Plugin) - plugin extension interface for PiFlash
* [PiFlash::State](https://metacpan.org/pod/PiFlash::State) - PiFlash::State class to store configuration, device info and program state

## Participation in PiFlash

See the [Contributing to PiFlash](CONTRIBUTING.md) docs.

* [Code of Conduct](CONTRIBUTING.md#code-of-conduct)
* [Submitting an issue](CONTRIBUTING.md#submitting-an-issue)
* [Submitting a Pull Request](CONTRIBUTING.md#submitting-a-pull-request)

When reporting a bug, please include the full output using the --verbose option. That will include all of the
program's state information, which will help understand the bigger picture what was happening on your system.
Feel free to remove information you don't want to post in a publicly-visible bug report - though it's helpful
to add "[redacted]" where you removed something so it's clear what happened.

For any SD card reader hardware which piflash fails to recognize (and therefore refuses to write to),
please describe the hardware as best you can including name, product number, bus (USB, PCI, etc),
any known controller chips.

repository: ikluft/piflash

gha_language: Perl

repo_name: ikluft/piflash


text:
# HISTORY (How it happened)

## Early

1. SushiToken Deployed
2. MasterChef Deployed
3. SushiToken Ownership Transfered to MasterChef
4. TimeLock Deployed
5. SushiFactory Deployed
6. SushiRouter Deployed
7. Migrator Deployed

## Pre-migration

Incentivised pools for Uniswap LP tokens were added by Master Chef to encourage locking liquidity into the platform before eventual migration of those Uniswap LP tokens to SushiSwap SLP tokens.

## Migration

...

## Post-migration

...

branch_name: refs/heads/canary


text:
# vscode-snippets
My snippets

## Install
macOS

```sh
ln -s $PWD/*.json ~/Library/Application\ Support/Code/User/snippets/
```

or

```sh
cp $PWD/*.json ~/Library/Application\ Support/Code/User/snippets/
```

## Thanks
All snippets are generated by [pawelgrzybek/snippet-generator](https://github.com/pawelgrzybek/snippet-generator)

repository: morishin/vscode-snippets

repo_name: morishin/vscode-snippets


text:
# Setup  (aka pre-requisites)

- Install Yarn
- Install React Native - https://facebook.github.io/react-native/docs/getting-started.html
- Create a new project via `react-native init ArtistExample`

# Verifying your install

- `cd ArtistExample`
- Run `yarn run jest` to verify specs

# Starting out

- Run `yarn start`

* Explain packager
* What is going on with the Transpile and Compile ?
* What parts are iOS compiled, and what is JS transpiled?

- Run `react-native run-ios` to launch the project

### Tada - it's your 1st RN app

That's it. Let's look at some real code. Browse the source code.

### Relay

[Emission Relay Setup](https://github.com/artsy/emission/commit/c6660fe505f38491f4a1d23dc7f41a2baec5657d)

We're using Relay, this will take a bit of setup.

- Add relay - `yarn add react-relay@https://github.com/alloy/relay/releases/download/v0.9.3/react-relay-0.9.3.tgz`
- Add babel-relay-plugin - `yarn add babel-relay-plugin@https://github.com/alloy/relay/releases/download/v0.9.3/babel-relay-plugin-0.9.3.tgz`

Then the schema into a data folder:

- `mkdir data`
- `curl https://raw.githubusercontent.com/artsy/emission/master/data/schema.graphql > data/schema.graphql`
- `curl https://raw.githubusercontent.com/artsy/emission/master/data/schema.js > data/schema.js`
- `curl https://raw.githubusercontent.com/artsy/emission/master/data/schema.json > data/schema.json`

Then hook up the plugin:
- Add `"plugins": ["./data/schema"],` to `.babelrc`.

### First edit

- Turn on Live Reloading and HMR
- Turn BG white

Magic, it does it in real-time.

### Making components

- Make `lib`, `lib/artists` and `lib/artists/artist.js`
- Move `ArtistExample` Component from `index.ios.js` to `lib/artists/artist.js`
- Change the class to `Artist`, and edit the title to reflect a different component
- Go back and nuke most of the `index.ios.js` make it just refer to `Artist``

  ```js
  import Artist from "./lib/artist/artist"

  export default class ArtistExample extends Component {
    render() {
      return (
        <Artist />
      );
    }
  }
  ```

### Relay Setup

Explain there are three useful bits parts of Relay:

- Routes
- Root Container
- createContainer

We will talk about them as we go on, but first we need to tell Relay where Metaphysics is. So we need to set up a network layer:

```js
import Relay from 'react-relay'

const metaphysicsURL = 'https://metaphysics-staging.artsy.net'

Relay.injectNetworkLayer(
  new Relay.DefaultNetworkLayer(metaphysicsURL, {
    headers: {
      'X-XAPP-Token': "[go to staging.artsy.net and do `sd.ARTSY_XAPP_TOKEN` in console]",
    }
  })
)
```

Next we need to create a Relay Route, this _doesnt_ directly represent a URL representation, but it often can/does.
E.g. in our case this will represent `/artist/:artistID`.

 - create `lib/artist/route.js` add

  ```js
  import Relay from 'react-relay'

  export default  class ArtistRoute extends Relay.Route {
    static queries = {
      artist: (component, params) => Relay.QL`
        query {
          artist(id: $artistID) {
            ${component.getFragment('artist', params)}
          }
        }
      `,
    };

    static paramDefinitions = {
      artistID: { required: true },
    };

    static routeName = 'ArtistRoute';
  }
  ```

- Hook this up inside `index.ios.js`, add an import, and create instance of Route:

  ```js
  import ArtistRoute from "./lib/artist/route"

  const glennRoute = new ArtistRoute({
    artistID: "glenn-brown"
  })
  ```

  Then change the components render function:

  ```js
  export default class ArtistExample extends Component {
     render = () => <Relay.RootContainer Component={Artist} route={glennRoute} />
  }
  ```

See error, that means it's trying to access a Relay Component, and we have a React component. Let's make it a Relay Component:

- Remove the `export default` from the `Artist` class in `lib/artist/artist.js`

- Add Relay fragment

```js
export default Relay.createContainer(Artist, {
  fragments: {
    artist: () => Relay.QL`
      fragment on Artist {
        _id
        id
        name
      }
    `,
  }
})
```

```js
class Artist extends Component {
  render() {
    const title = `Hello, I am ${this.props.artist.name}`
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>{title}</Text>
      </View>
    );
  }
}
```

Tada! :tada:

---

Prove the Relay concept by adding `years` to GraphQL and add this to the render function:

```js
class Artist extends Component {
  render() {
    const title = `Hey ${this.props.artist.name}`
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>{title}</Text>
        <Text style={styles.welcome}>{this.props.artist.years}</Text>
      </View>
    );
  }
}
```

### Looking Stylish!

OK, we now have the minimum we need - we got API data coming in as props. Now we want to make it look pretty.

- Add `mkdir assets`, and `mkdir assets/fonts`

```sh
curl -L https://github.com/artsy/Artsy-OSSUIFonts/raw/master/Pod/Assets/EBGaramond12-Italic.ttf > assets/EBGaramond12-Italic.ttf
curl -L https://github.com/artsy/Artsy-OSSUIFonts/raw/master/Pod/Assets/EBGaramond12-Regular.ttf > assets/EBGaramond12-Regular.ttf
curl -L https://github.com/artsy/Artsy-OSSUIFonts/raw/master/Pod/Assets/texgyreadventor-bold.ttf > assets/texgyreadventor-bold.ttf
```

- edit `package.json`

```
 "rnpm": {
    "assets": ["./assets"]
  }
```

- run `react-native link`, restart iOS app, by killing it.
- run `react-native run-ios`

- Add custom styles to the two bits of info on screen:

```jsx
<Text style={styles.title}>{this.props.artist.name.toUpperCase()}</Text>
<Text style={styles.subtitle}>{this.props.artist.years}</Text>
```

```js
const styles = StyleSheet.create({
  container: {
    flex: 1,
    marginTop: 20,
    alignItems: 'center',
    backgroundColor: 'white',
  },
  title: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
    fontFamily: "TeXGyreAdventor-Regular"
  },
  subtitle: {
    textAlign: 'center',
    color: '#333333',
    fontFamily: 'EBGaramond12-Regular',
    marginBottom: 5,
  },
});
```

And that is our styles. Covering all of the major use cases of React Native for us.

repository: TribeMedia/Relay-Artist-Example

repo_name: TribeMedia/Relay-Artist-Example


text:
[[Threat Hunting]]
## Hunting for Metasploit
#metasploit  by default uses port `4444` and `5555` for meterpreter sessions. You can find these using #Powershell.
Following example is for port `4444`.

To hunt for open ports with PowerShell we will be using the PowerShell module [[Get-WinEvent]] along with [[XPath Query|XPath queries]]. We can use the same #XPath queries that we used in the rule to filter out events from `NetworkConnect` with `DestinationPort`. See [[Windows - Event Logs]]
```powershell
Get-WinEvent -Path <Path to Log> -FilterXPath '*/System/EventID=3 and */EventData/Data[@Name="DestinationPort"] and */EventData/Data=4444'
```

We can break this command down by its filters to see exactly what it is doing. It is first filtering by `Event ID 3` which is the network connection ID. It is then filtering by the data name in this case `DestinationPort` as well as the specific port that we want to filter. We can adjust this syntax along with our events to get exactly what data we want in return.

## Hunting Mimikatz
To detect abnormal #LSASS behavior (see [[Windows - lsass.exe]]), indicative of #Mimikatz, you can use [[Get-WinEvent]] and [[XPath Query]].
```powershell
Get-WinEvent -Path <Path to Log> -FilterXPath '*/System/EventID=10 and */EventData/Data[@Name="TargetImage"] and */EventData/Data="C:\Windows\system32\lsass.exe"'
```

## Hunting Common Back Connect Ports
Event ID from [[Sysmon#ID 3 Network Connection]]
Used in relation to #RATs and #C2 servers. Using  [[Get-WinEvent]] and [[XPath Query]].
```powershell
Get-WinEvent -Path <Path to Log> -FilterXPath '*/System/EventID=3 and */EventData/Data[@Name="DestinationPort"] and */EventData/Data=<Port>'`
```

## Hunting Evasion Techniques

### Detecting Alternate Data Streams
Using [[Sysmon#Alternate Data Streams]|Sysmon Hunting ADS] config file and Event ID 15, you can easily detect using PowerShell.

```powershell
Get-WinEvent -Path <Path to Log> -FilterXPath '*/System/EventID=15'
```

### Detecting Injection via Remote Thread Creation
Using [[Sysmon#Injection|Sysmon Hunting Injection]] config using Event ID 8.

```powershell
Get-WinEvent -Path <Path to Log> -FilterXPath '*/System/EventID=8'
```

repository: semi-Colin/CyberSecVault

path: /Hunting with PowerShell.md

filename: Hunting with PowerShell.md

repo_name: semi-Colin/CyberSecVault


text:
# STATUS

We are applying for the Reusable and Available badges.

In this artifact, we provide an organized database, software tools, detailed instructions, and other relevant materials to support reusablilty and availability of our study. They are available via Github. We placed it on a publicly accessible repository:  `https://github.com/mlapistudy/ICSE2021_421`

Our organized database includes 360 non-trivial applications using ML-APIs and their anti-patterns, which includes detailed categorization and explanation. It can be reused for the manual study in Section IV-VI. In addition, it can help future research to further tackle ML API misuses.

The source code of our tools are provided with instructions in `install.md` and their `readme.md` files. They can be used to repurpose the study in Section VII.


text:
---
title: Events
permalink: /community/events
---

### Smart Nation & U 2021

Themed “Reclaiming our Lives with Tech”, Smart Nation & U 2021 put together a series of panel discussions, roadshows and free online courses to support Singaporeans as they leverage technology to emerge stronger from the effects of COVID-19.

Find out more about the event [here](/media-hub/press-releases/Smart-Nation-&-U-2021).

![Alt text for image on Isomer site](/images/community/snu-02.jpeg)

![Alt text for image on Isomer site](/images/community/snu-01.jpeg)

### SkillsFuture Month X Smart Nation 2021

The hybrid SkillsFuture Month X Smart Nation 2021 event comprises two physical roadshows and a series of free digital skills webinars. Together, the roadshows and webinars seek to engage citizens, especially those without prior tech experience or training, to:

* learn about digital skills that are in demand
* identify training opportunities and skills gaps,
* pick up digital and tech skills to help them find jobs and opportunities in the ICT sector.

Find out more about the event [here](/media-hub/press-releases/skillsfuture-month-smart).

![Alt text for image on Isomer site](/images/community/sn-skillsfuture-01.jpeg)

![Alt text for image on Isomer site](/images/community/sn-skillsfuture-02.jpeg)

repository: anushagovtech/smartnationsg

repo_name: anushagovtech/smartnationsg


text:
# Scapi
 Raspberry PI connector for SCADA

SCAPI is a command line tool which runs on Raspberry Pi devices and communicates through TCP/IP with Micset scada application (http://www.micset.net) It allows reading/writing IO GPIO ports and some periferials.

#Requirements
QT Editor, WiringPi

repository: enizvk/Scapi

repo_name: enizvk/Scapi


text:
# City2BA
[![docs.rs](https://docs.rs/city2ba/badge.svg)](https://docs.rs/city2ba)

A collection of tools for generating synthetic bundle adjustment datasets.

Datasets can either be generated programatically via the library or using the included executables. When using `SnavelyCamera`s, the coordinate system is -z forward, y up.

```bash
# Generate a problem from a 3D model
city2ba generate test_scene.obj problem.bal --cameras 100 --points 200

# Add noise to the problem
city2ba noise problem.bal problem_noised.bal --drift-strength 0.001 --rotation-std 0.0001

# Generate a problem using a city block grid
city2ba synthetic problem.bal --blocks 4

# Convert a problem to a format for visualization
city2ba ply problem.bal problem.ply
```

## Installation

First install embree (available at [https://github.com/embree/embree](https://github.com/embree/embree)). Then install cargo to build the code and dependencies ([https://rustup.rs](https://rustup.rs) is the easiest way to get cargo).

To install the latest stable version run:
```bash
EMBREE_DIR=/path/to/embree/lib cargo install city2ba
```
Make sure to point `EMBREE_DIR` to the `lib` directory inside of the directory
where you installed embree.

To build the latest version run:
```bash
git clone https://github.com/tkonolige/city2ba.git
cd city2ba
EMBREE_DIR=/path/to/embree/lib cargo install --path .
```
Make sure to point `EMBREE_DIR` to the `lib` directory inside of the directory
where you installed embree.

The `city2ba` binary is installed into `$HOME/.cargo/bin`. In order to run the
binary you will need to add this directory to your `PATH` (you can do this with
`export PATH="$HOME/.cargo/bin:$PATH"`, you may want to add this to your
`.bashrc` or equivalent).

A simple scene is provided in `test_scene.obj` for you to experiment with. You can download it from [https://github.com/tkonolige/city2ba/raw/master/test_scene.obj](https://github.com/tkonolige/city2ba/raw/master/test_scene.obj).

## Development

Build City2BA locally with:
```bash
git clone https://github.com/tkonolige/city2ba.git
cd city2ba
cargo build --release # release mode is recommended for performance
```
Run tests with:
```bash
cargo test
```
Executables can be run with:
```bash
cargo --release ARGS GO HERE
```

## Contributing and Support

Please use the GitHub issue tracker to report issues, ask questions, and submit patches.


text:
Zend Z-Ray Installer for Laravel Homestead
==========================================
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

> Zend [Z-Ray][1] Installer for Laravel Homestead.
> Simple shell script that automatically installs the Zend [Z-Ray][1] with no user interaction required on a Laravel Homestead box.

## Pre-Requisites

- [Laravel Homestead][2] configured and running.

## Installation

**1.** SSH into your Laravel Homestead Box (`homestead ssh`)

**2.** Just fire the following command:

```
$ curl -sSL http://lk.gd/zray-install | bash
```

**3.**  Edit Homestead File `homestead edit` and add under `cpus` directive:

```yaml
ports:
    - send: 10081
      to: 10081
```

**4.** Restart and Provision Homestead:

```cli
homestead halt
homestead up --provision
```

That's it, Now open any of your homestead site and you should start seeing the Z-Ray Bar at the bottom of the page. You can access the admin panel for any of your homestead site by visiting the admin port `10081`. Example: `http://example.vm:10081/`

> **NOTE:** If Z-Ray does not load and you are getting a 500 error in your browser console, it may be necessary to re-apply the permissions to the Z-Ray folder:

```
homestead ssh
sudo chown -R vagrant:vagrant /opt/zray
```

## Additional information

Any issues, please [report here](https://github.com/irazasyed/zray-installer/issues)

Inspired to create this script by this [tutorial](https://laravel-news.com/2015/08/installing-zend-z-ray-on-homestead/) by [Mike Bronner](https://laravel-news.com/author/mikebronner/)

## Contributions

Contributions are always welcome, Please create a PR.

## License

[MIT](LICENSE) © [Syed Irfaq R.](http://lk.gd/irazasyed)

[1]: http://www.zend.com/en/products/server/z-ray
[2]: http://laravel.com/docs/homestead


text:
# About

Repository for server implementation examples. Read book `Working with TCP sockets` most of the exaples based on it.
Implemented few approaches:
- Simple server `ruby simple.rb`. Accept connection and perform all requests for particular user. All other connections wait. Blocking example.
- Threaded server `ruby thread.rb`. Spawn new thread for each client connection. Example of GIL influence.
- Process server `ruby process.rb`. Spawn new process (duplicate current) for each client connection. Output looks like `threaded` approach but GIL not affecting it.
- Process pool server `ruby process_pool.rb`. Spawn N processes in the setup process and handle process exception exits with re-spawning new one. Works like `process server`
- Thread server `ruby thread_pool.rb`. Spawn N threads un setup and accept each same as `thread` example. Simple implementation without re-spawning threads.
- Reactor server `ruby reactor.rb`. Most intresting example with non-blocking approach. Aka Thin (nodejs) core principle.

For testing purposes created simple threaded client for making requests.
`ruby client.rb -c 10 -n 10 -r 1000 -w 10000`
- `c` number of concurrent threads
- `n` number of requests within each thread. Requests performed withoud dropping connection.
- `r` size of request header. Make sense to specify size more than 16kb to fill accept buffers.
- `w` size of responce header. Number could be bigger to see partitioning on server side because write buffers quite bigger then read ones.

# Server output

Usual server log will looks like this (example from `thread.rb`):
`+  +  + ..|.||..||...|||..|.|.||.|.|..||...|.|||..|.|.|.|.|.|.|| - .|.| -  - `

Client where run with:
`ruby client.rb -n 10 -c 3`

Output has different colors for each client connection.

Where:
- `+` client establish connection
- `-` client disconnects
- `.` server read chunk of message (or full message)
- `|` server write response (or its part)

# Protocol

Main protocol looks like regular http but big data chunks placed to header values.
This used because of reducing logic for looking `Content-length` value and read this amount of data. Using Header only approach gives us defined protocol message end border. Http header separated by `\r\n\r\n` and this combination is uqnique inside message.

### Request
Request message looks like:
```
GET / HTTP/1.0\r\n
Simple-Header-Size: 10\r\n
Simple-Header: aaaaaaaaaa\r\n
\r\n
```
Empty request will close connection on a server side. Quite simple approach, just check each request body before processing response.

### Response

Response message:
```
HTTP/1.1 200 OK\r\n
Content-Type: text/plain\r\n
Simple-Header-Response: aaaaaaaaaa\r\n
\r\n
```

Where `Simple-Header-Response` value is generated by server using number from request `Simple-Header-Size`

# Licence

MIT


text:
2021-09-13: Development Meeting
===============================
Kacper, Mike L, Mike H, Craig, Tim

Agenda
------
* Updates
* Recorded Runs UI preview ([name=Mike L])
    * WIP - rename/remove buttons exist, but need to use different endpoints at the top-level (see existing rename/delete version)
    * WIP - rename/remove should not be allowed outside of the top level
    * BUG - Names shouldn't be required. looking into backend solution. Possibly a bug in Girder itself and their swagger parsing/generation?
    * Would be nice to show Run Status next to each Run - see [RunStatus](https://github.com/whole-tale/wt_versioning/blob/master/server/constants.py#L24-L30)

Updates
-------

* Kacper
    * Uploading generic data/zip files as involatile data - https://github.com/whole-tale/girder_wholetale/pull/502
    * https://hackmd.io/KQ9TzJ7zSrqzaeYGX9ClSQ

* Mike L
    * Updated [Recorded Runs PR](https://github.com/whole-tale/ngx-dashboard/pull/205) to extend Run > Files, added screenshots
        * Added "Tale Versions" nav to view / browse versions
        * Added "Recorded Runs" nav to view / browse runs
        * WIP for rename/remove
        * Added to header, but need to fix file path
        * Added buttons to launch a new Recorded Run
            * Remove name dialog once param is optional

* Mike H

* Craig
    * Supplement planning meetings
    * StataBuildPack draft changes
        * Desktop environment
        * `install.do` support
    * Updated staging for supplement

* Tim
    * Now have bpftrace program that monitors the full lifecycle of Linux processes.  It's small and looks like an awk script:
        ```
        #!/usr/bin/env bpftrace

        BEGIN {
            printf("------------------ Starting bpftrace -------------------\n");
            printf("\n");
            printf("  TIME(us)    EVENT   PROCESS  PROGRAM NAME     DETAILS\n");
            printf("  --------    -----   -------  ------------     -------\n");
        }

        tracepoint:syscalls:sys_exit_clone /args->ret != 0/ {
            printf("%10u    %-6s %8d  %-15s  child=%d\n", elapsed/1000, "start",
                   pid, comm, args->ret);
        }

        tracepoint:syscalls:sys_enter_execve {
            printf("%10u    %-6s %8d  %-15s  argv=", elapsed/1000, "exec", pid, comm);
            join(args->argv);
        }

        tracepoint:sched:sched_process_exit {
            printf("%10u    %-6s %8d  %-15s \n", elapsed/1000, "exit", pid, comm);
        }

        END {
            printf("\n------------------ Exiting bpftrace -------------------\n");
        }
        ```
    * Output when monitoring the `date` command issued at the bash prompt:
        ```
        $ time sudo ./scripts/watch_process_lifecycle.bt
        Attaching 5 probes...
        ------------------ Starting bpftrace -------------------

        TIME(us)    EVENT   PROCESS  PROGRAM NAME     DETAILS
        --------    -----   -------  ------------     -------
         1599700    clone    121947  bash             child=128934
         1599930    exec     128934  bash             argv=date
         1601748    exit     128934  date
        ------------------ Exiting bpftrace -------------------
        ```
    * Less than 30% overhead vs a 25x slowdown for ReproZip on the Jupyter notebook I'm using to stress test recording of traces.
    * Negligible overhead if don't monitor process exits (ReproZip does not).
    * Is compiled and runs in the Linux kernel--so can run the bpftrace program in one container and processes you want to monitor in another--no need to give special capabilities to the latter (i.e. the WT user's tale).
    * Also have a working script that shows how to start a bpftrace program in background, wait for it start recording, run some other script, and then shutdown the bpftrace program--will still see all targeted events in the kernel, not just child processes.
    * Can collect trace in kernel and output back to user space afterwards; can output as triples directly.
    * Will look into recording I/O this week; then interprocess communication (e.g. pipes between parent and child processes such as a Jupyter cell gathering stdout from an external command).

repository: whole-tale/wt-design-docs

repo_name: whole-tale/wt-design-docs


text:
# SIMMER
Use chemical and protein Similarity to Identify MicrobioMe Enzymatic Reactions.

Bustion AE, Nayak RR, Agrawal A, Turnbaugh PJ, Pollard KS. 2023. SIMMER employs similarity algorithms to accurately identify human gut microbiome species and enzymes capable of known chemical transformations. Elife 12. doi:10.7554/eLife.82401

This tool can be used directly on the web at https://simmer.pollard.gladstone.org/. To query more than ten input reactions at a time, or to consider more than one closest MetaCyc reaction, please read on for use of the command-line tool.

![alt text](https://github.com/aebustion/SIMMER/blob/main/Figure1.png?raw=true)

Raise an issue or email<EMAIL_ADDRESS>if you encounter any problems. This code is still getting actively updated.

## Precomputed Data
This can be downloaded from https://simmer.pollard.gladstone.org//SIMMER_files.tar.gz

`$ wget https://simmer.pollard.gladstone.org//SIMMER_files.tar.gz`\
Once unzipped, the relevant files are located in <your_filepath>/usr/share/nginx/projects/simmer/SIMMER-website/SIMMER_files

(This precomputed data takes up ~18G once unzipped. If space is a constraint, please use the webtool version of SIMMER available at https://simmer.pollard.gladstone.org/.

These files contain all the precomputed data needed to run any SIMMER queries:
* precomputed hmmsearch results (tsvs and fastas) of the UHGG database
* fingerprints and pairwise tanimoto similarity matrix for all MetaCyc fingerprints
* dictionaries needed to link chemical and protein data

## Conda environment
To run command-line SIMMER, the user will need the appropriate conda environment.

`$ conda env create --file SIMMER_local.yml`\
`$ source activate SIMMER_local`

If "ResolvePackageNotFound" error is returned, you can manually create the SIMMER env and install the following packages:

`$ conda install -c conda-forge rdkit`\
`$ conda install -c conda-forge scipy`

If for some reason an error such as ModuleNotFoundError: No module named 'module_name' occurs when running SIMMER, please find and install the relevant package from [anaconda](https://anaconda.org/).

Once ready to run SIMMER, use\
`$ conda activate SIMMER_local`\
`$ python3 SIMMER.py -h`\
example commands are at the end of this README.

 ## Input format
 If the user has more than a few queries, they will want to input their queries as a tsv or csv file organized as seen in the multiple_queries_example.csv and as seen here:

| reaction | left_comp | right_comp | left_smiles | right_smiles |
| -------- | --------- | ---------- | ----------- | ------------ |
| DM1 | brivudine | bromovinyluracil | OC[C@H]1O[C@H](C[C@@H]1O)N1C=C(\C=C\Br)C(=O)NC1=O | Br\C=C\C1=CNC(=O)NC1=O |
| DM2 | gemcitabine | 2′, 2′-difluorodeoxyuridine | NC1=NC(=O)N(C=C1)[C@@H]1O[C@H](CO)[C@@H](O)C1(F)F.O.[H+]  | OC[C@H]1O[C@@H](N2C=CC(=O)NC2=O)C(F)(F)[C@@H]1O.[NH4+] |
| DM3 | foo | bar | C1=CC=C2C(=C1)C(=NO2)CS(=O)(=O)N  | O=C(CS(=O)(N)=O)C1=CC=CC=C1O |

 Notes:
 * The user can enter any text into the left_comp and right_comp columns (as seen in the DM3 example), but for the reaction column **must identify a query using 'DM' followed by any alphanumeric character** (SIMMER distinguishes queries from its database of MetaCyc reactions by 'seeing' the DM label).
 * If the query includes multiple substrates and/or products (as seen in the DM2 example), their respective SMILES **must be separated by a '.'**
 * SIMMER can process either canonical or isomeric SMILES; the MetaCyc database uses isomeric SMILES where available.

 ## Output
 After running a SIMMER query, the user will obtain five files in about ~10-13 seconds:
 * DM_distance_ranked_rxns.txt (a file containing all MetaCyc reactions' euclidean distances to the input query, sorted from closest to farthest)
 * DM_EC_predictions.tsv (a tsv file containing SIMMER's predicted EC numbers for the query reaction)
 * DM_enzyme_predictions.fasta (a fasta file containing all predicted bacterial enzymes in the human gut capable of the query reaction)
 * DM_enzyme_predictions.tsv (a  tsv file summarizing all predicted bacterial enzymes in the human gut capable of the query reaction)
 * coming soon: DM_enzyme_predictions.png (a tree representation of the above predicted bacterial enzymes in the human gut)

 ## Run an example query using command line SIMMER tool
To see all argument options:\
`$ python3 SIMMER.py -h`

to run for a single query at a time (follow command line prompts to input the query):\
`$ python3 SIMMER.py -i <path_to>/SIMMER_files -o <path_to_output_directory>`

or to run with multiple queries in tsv or csv format (try using multiple_queries_example.csv as an example):\
`$ python3 SIMMER.py -i <path_to>/SIMMER_files -o <path_to_output_dir> -q <path_to_query_df>`

Additionally, the user may wish to see which microbiome enzymes may be associated with a MetaCyc reaction of interest (i.e. Reverse SIMMER):\
`$ python3 metacyc_microbiome_homologs.py -i <path_to>/SIMMER_files -o <path_to_output_dir> -q RXN-11469`

repository: aebustion/SIMMER

repo_name: aebustion/SIMMER


text:
#NetAddressKeyboard

An iOS keyboard, that supports entering ip-values IPv4 and IPv6 to the UITextField for written in Objective-C for iOS7+.

## Installing and Usage

  - copy the **library** files to the project
  - set it to the *UITextField's inputView* in *-viewDidLoad* (or where you find it most suitable)
  - for IPv4:
aTextField.inputView = [[INNetAddressKeyboard alloc] initWithTextField:textModeServerAddress keyboardLayout:INNetAddressKeyboardIPv4];
  - for IPv6:
aTextField.inputView = [[INNetAddressKeyboard alloc] initWithTextField:textModeServerAddress keyboardLayout:INNetAddressKeyboardIPv6];
  - make it better
  - enjoy!

## Screenshots

|IPv6|IPv4|
|---|---|
|![IPv6](ipkeyboard-ipv6@2x.png)|![IPv4](ipkeyboard-ipv4@2x.png)|

## Thanks

The keyboard implementation is based on Hex Keyboard of doofyus/HexKeyboard to use it for IP addresses.
https://github.com/doofyus/HexKeyboard