text:
---
layout: post
title:  "ZFS Root on Kubuntu"
date:   2018-10-29 12:58:29
categories: ZFS
tags:
 - zfs
 - zfsonlinux
 - zfs-root
 - filesystems
 - storage
 - ubuntu
 - kde-neon
 - desktop
---

ZFS is typically used for non-root volumes, but for many situations, it's fully
supported for root volumes as well, allowing it to be used in many of the same
ways that BSD uses it, running full system snapshots, full system restores and
sends via `zfs send`, transparent compession, and the other many benefits of
ZFS.

Note that this guide does NOT work on KDE Neon for the time being.

While it is possible to migrate an existing system to ZFS root, this guide assumes a
clean install.

TODO : make this attribution cleaner.
Based on this guide: https://furneaux.ca/wiki/Ubuntu_ZFS_Root

## Start Live CD

Boot into a live environment with the installer image you wish to install.

Exit the installer, open a terminal.

## Find Disk Info
First, find the root device you wish to install on:

```
$ lsblk

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0   1.6G  1 loop /rofs
loop1    7:1    0  87.9M  1 loop /snap/core/5662
loop2    7:2    0   236M  1 loop /snap/kde-frameworks-5/27
sda      8:0    0 233.8G  0 disk
sdb      8:16   1  28.7G  0 disk /cdrom
├─sdb1   8:17   1   1.7G  0 part
└─sdb2   8:18   1   2.3M  0 part
```

In the example above, your device is `/dev/sda`.

Next, map your logical device name to it's physical name:

```
$ ls -lha /dev/disk/by-id

total 0
drwxr-xr-x 2 root root 160 Oct 29 16:56 .
drwxr-xr-x 7 root root 140 Oct 29 16:56 ..
lrwxrwxrwx 1 root root   9 Oct 29 16:56 ata-APPLE_SSD_SM0256G_S2Z5NY0J474795 -> ../../sda
lrwxrwxrwx 1 root root   9 Oct 29 16:41 usb-APPLE_SD_Card_Reader_000000000820-0:0 -> ../../sdc
lrwxrwxrwx 1 root root   9 Oct 29 16:41 usb-SanDisk_Ultra_4C530001110721100544-0:0 -> ../../sdb
lrwxrwxrwx 1 root root  10 Oct 29 16:41 usb-SanDisk_Ultra_4C530001110721100544-0:0-part1 -> ../../sdb1
lrwxrwxrwx 1 root root  10 Oct 29 16:41 usb-SanDisk_Ultra_4C530001110721100544-0:0-part2 -> ../../sdb2
lrwxrwxrwx 1 root root   9 Oct 29 16:56 wwn-0x5002538900000000 -> ../../sda
```

Find the device name on the left side which points to your device found above. For us, it is
`ata-WDC_WDS500G1B0A-00H9H0_170703801742`, which points to `/dev/sda/`.

## Setup Disk Bootloader

With the disk name found above, we will now setup the partitioning.

First, we'll create the GPT partition table of the device we found. Replace everything
after `/by-id/` with your device name.

```
$ sudo sgdisk -o /dev/disk/by-id/ata-APPLE_SSD_SM0256G_S2Z5NY0J474795

Warning! Mismatched GPT and MBR partition! MBR partition 2, of type 0x83,
has no corresponding GPT partition! You may continue, but this condition
might cause data loss in the future!
The operation has completed successfully.
```

You may see an error about mismatched partitions and data loss - this is
fine, as we are already deleting everything on the disk during install.

  TODO: Add step to delete everything off disk here, it'll get rid of error

  TODO: check to ensure that last paragraph is actually true, and issues
        won't persist after install.

Next, setup GRUB on the partition. As above, replace with your disk ID.

```
$ sudo sgdisk -a1 -n2:34:2047 -t2:EF02 /dev/disk/by-id/ata-APPLE_SSD_SM0256G_S2Z5NY0J474795
```

## Setup Partitions
Next, install gparted to create the partitions. This will require a network connection.

```
sudo apt update && sudo apt install gparted -y
```

Open gparted, find your disk, and create the needed partitions.

 Optionally, a swap partition.
We will omit swap for now.

Finally, we need a temporary install partition to run the installer against, which will
then be deleted and the main data partition expanded. To do this, place a 30G partition
(EXT4) directly after the main data parition, to allow easy resizing afterwards.

Format the UEFI partition to fat32, the data partition to anything (unformatted,
if possible), and tmp install partition to ext4.

Create these partitions using normal methods in gparted, or another partitioning tool.

TODO: add more details here.

TODO: Reword this to be more clear

## Install ZFS Tmp Space

Setup ZFS with the following steps. As usual, replace with your disk id. You can also
replace the hostname var, which will name the dataset the same as the system's hostname,
to make management more easy later.

Start by opening a *root* shell with `sudo su`, then run:

```
hostname="SET SYSTEM HOSTNAME HERE"
apt update
apt install -y zfsutils-linux
zpool create -f -o ashift=12 -O compression=lz4 -O xattr=sa -O mountpoint=none rootpool /dev/disk/by-id/ata-APPLE_SSD_SM0256G_S2Z5NY0J474795
zfs create -V 10G rootpool/tempdisk
zfs create -o mountpoint=none rootpool/ROOT
zfs create -o mountpoint=/ rootpool/ROOT/$hostname
zpool export rootpool
zpool import rootpool -R /mnt
zfs create rootpool/ROOT/$hostname/boot
zfs create rootpool/ROOT/$hostname/etc
zfs create rootpool/ROOT/$hostname/home
zfs create rootpool/ROOT/$hostname/tmp
zfs create rootpool/ROOT/$hostname/usr
zfs create rootpool/ROOT/$hostname/var
zpool set bootfs=rootpool/ROOT/$hostname rootpool
```

TODO: THis step may be wrong, used sd0 device

## Install Kubuntu

Now, install Kubuntu on the /dev/zd0 device (a loopback image file). Do not reboot after install.
The installer may crash during bootloader install. This is subpar but fine.

## Moving Installed System to ZFS Root

After install, copy the data from the tmp partition to the zfs pool

```
mkdir /media/temp &&
mount /dev/zd0p1 /media/temp &&
rsync -aAXvH /media/temp/* /mnt --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}

```

Next, setup the shell to switch running from the mnt dir, so that the ZFS initramfs and grub
can be installed into the copied system.
```
for i in /dev /dev/pts /proc /sys /run; do mount -B $i /mnt$i; done
chroot /mnt
apt install zfs-initramfs -y
grub-install /dev/disk/by-id/ata-APPLE_SSD_SM0256G_S2Z5NY0J474795
```

## Misc Cleanup
Remove any entries in /etc/fstab referencing the previous temporary root filesystem (ext4). Comment
out those lines.

Add "boot=zfs" to /etc/default/grub in GRUB_CMDLINE_LINUX.

Next, run:
```
update-grub
exit
for i in /dev/pts /dev /proc /sys /run; do umount /mnt$i; done
umount /media/temp
```

## Remove Tmp Dataset

Finally, reemove the tmp dataset, snapshot the clean install, and export the pool.

Reboot.

## Alternate steps:

https://github.com/zfsonlinux/zfs/wiki/Ubuntu-18.04-Root-on-ZFS

### Install
sudo apt-add-repository universe -y
sudo apt install --yes debootstrap gdisk zfs-initramfs

### Clear Disk

sgdisk --zap-all /dev/disk/by-id/ata-APPLE_SSD_SM0256G_S2Z5NY0J474795

### Setup partitions (UEFI)
sgdisk     -n3:1M:+512M -t3:EF00 /dev/disk/by-id/ata-APPLE_SSD_SM0256G_S2Z5NY0J474795
sgdisk     -n1:0:0      -t1:BF01 /dev/disk/by-id/ata-APPLE_SSD_SM0256G_S2Z5NY0J474795

### Create Pool - NOT USED

zpool create -o ashift=12 \
      -O atime=off -O canmount=off -O compression=lz4 -O normalization=formD \
      -O xattr=sa -O mountpoint=/ -R /mnt \
      rpool /dev/disk/by-id/ata-APPLE_SSD_SM0256G_S2Z5NY0J474795

### Create Pool - Using

export hostname="by-mac"
sudo zpool create -f -o ashift=12 -O compression=lz4 -O xattr=sa -O mountpoint=none rootpool /dev/disk/by-id/ata-APPLE_SSD_SM0256G_S2Z5NY0J474795
sudo zfs create -V 10G rootpool/tempdisk
sudo zfs create -o mountpoint=none rootpool/ROOT
sudo zfs create -o mountpoint=/ rootpool/ROOT/$hostname
sudo zpool export rootpool
sudo zpool import rootpool -R /mnt
sudo zfs create rootpool/ROOT/$hostname/boot
sudo zfs create rootpool/ROOT/$hostname/etc
sudo zfs create rootpool/ROOT/$hostname/home
sudo zfs create rootpool/ROOT/$hostname/tmp
sudo zfs create rootpool/ROOT/$hostname/usr
sudo zfs create rootpool/ROOT/$hostname/var
sudo zpool set bootfs=rootpool/ROOT/$hostname rootpool

repository: benyanke/docs

branch_name: refs/heads/gh-pages

extension: markdown

gha_language: SCSS

repo_name: benyanke/docs


text:
# threejs-texture-exporter

[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Exports cubemap environment from THREE.CubeCamera into 6 .PNGs

## Usage

[![NPM](https://nodei.co/npm/threejs-texture-exporter.png)](https://www.npmjs.com/package/threejs-texture-exporter)

## License

MIT, see [LICENSE.md](http://github.com/bunnybones1/threejs-texture-exporter/blob/master/LICENSE.md) for details.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# How to compile and run the project
1. Clone the repo to your machine
2. Navigate to the src file in the terminal
3.     javac Battleship.java
4.     java Battleship
5. Enjoy!

# Works cited
- https://www.tutorialspoint.com/java/java_documentation.html
- https://docs.oracle.com/javase/8/docs/technotes/tools/winodws/javadoc.html
- https://www.quora.com/What-function-do-we-use-in-Java-in-place-of-cin-in-C++
- https://www.javatpoint.com/java-char-to-int
- https://beginnersbook.com/2013/12/java-string-charat-method-example/

gha_language: Java

gha_license_id: MIT


text:
---
title : Deadlines
status: draft
---

...

**Topics to cover and ideas**

 - understand that many deadlines are just indications of an arbitrary point in the future when somebody would like to see something done
  - usually deadlines are set without a realistic understanding of the original problem, the resources available and what is the definition of success
 - Being able to hit deadlines is really important in business and life. The better you are at doing this, the more you will be trusted to deliver.
    - What is important is to understand what are deadlines that can be missed, what are deadlines that are completely unrealistic and what are deadlines that HAVE to be meet (usually the ones connected to a specific event that cannot be moved)
    - unrealistic deadlines can cause a lot of damage and prevent a lot of 'important but not urgent' activities (for example not improving the test environment because there isn't time before the next deadline). There are moments where there is a false economy of just focusing on short/medium term activities
 - Solution is to break the problem into small milestones and be flexible (I prefer Kanban to Agile, with Scrumban not a bad alternative)
 - Developers are the ones that actually have the real power to do something about meeting the deadlines, since they are the ones that will actually do the work
 - One of the reasons Agile doesn't work very well is due to the amount of guess work that happens in the sprint planning


text:
# SignalK-iso19848
This plugin is designed to offer the data on the signalk server in a format compatible with ISO 19848

## Use

The plugin provides a few REST endpoints

### GET /signalk/v1/api/iso19848/datachannelist.xml
This is the data channel list mapping shortIDs used in the timeseries format to readable paths

### GET /signalk/v1/api/iso19848/\<path\>
This will return the current values for all signalk paths that start with the path in the URL.
All values are from the self vessel in signalk
leaving path empty will result in all paths being returned

## Development

To install the plugin for development first clone the repository and link the npm module:

```
$ git clone
$ cd signalk-iso19848
$ sudo npm link
```

Then go to the SignalK configuration directory (probably `~/.signalk`)  and link the module again:

```
$ cd .signalk
$ npm link @codekilo/signalk-iso19848
```

gha_language: JavaScript


text:
# Spark-Twitter-Sentiment-Analysis

Sentiment Analysis of a Twitter Topic with Spark Structured Streaming

This project is about Sentiment Analysis of a desired Twitter topic with Apache Spark Structured Streaming, Python modules Tweepy(for streaming twitter) and Afinn(for scores: 0 for neutral , values<0 for negative and values>0 from positive). You can learn sentiment status of a topic that is desired.

Sentiment analysis is used for the interpretation and classification of emotions (positive, negative and neutral) within text data using text analysis techniques. Sentiment analysis allows businesses to identify customer sentiment toward products, brands or services in online conversations and feedback

For example, company can use sentiment analysis to automatically analyze NEGATIVE, NEUTRAL or POSITIVE reviews about their product, and discovered that customers were happy about their pricing but complained a lot about their customer service. Thus sentiment analysis can help to improve the business.

I have developed most common program sentiment analysis using spark streaming analytics on twitter. Please follow below notes:

1) To create twitter API and keys follow this video https://www.youtube.com/watch?v=KPHC2ygBak4

2) Now install tweepy package using command : pip3 install tweepy

Note: tweepy is module for python which streams tweets from twitter. For more details refer documentation http://docs.tweepy.org/en/latest/

3) Install afinn package using command : pip3 install afinn

Note: AFINN sentiment analysis in Python: Wordlist-based approach for sentiment analysis. For more details refer documentation https://pypi.org/project/afinn/

4) Note By default spark runs on python 2.7 version make it to run in python3+ version else above installed packages won't work as we installed using pip3 (which is for python3+). Alternately you can install above packages using pip(for python2+) if you wish to run on python2+ version in spark.

5) first run test_twitter.py file to get a glimpse of twitter streaming.

6) second run stream_tweets.py file for atleast 10 mins to store good amount of tweets for analysis.

7) after 10 mins forcily stop streaming by pressing ctrl+c or ctrl+d whichever works.

8) Now run sparkStreaming.py file for sturctured streaming analytics to do sentiment analysis on the twitter data.


text:
---
description: >-
  A function is lines of code that you call from other places in your code to
  execute certain things. They're used far and wide, mostly when there's code
  you want to execute many times.
---

# Understanding Functions

A function is lines of code that you call from other places in your code to execute certain things. They're used far and wide, mostly when there's code you want to execute many times.

A function takes the following shape, basically:

```javascript
function myFunc(arguments) {
  // function code
}
```

A function may return something, or not. Here's an example of a function that returns a value:

```javascript
function add(a, b) {
  return a + b;
}
```

And here's one that does not return a value, but still executes something:

```javascript
function log(type, message) {
  console.log(`[${type}] ${message}`);
}
```

## Using and Calling Functions

So the 3 previous examples were _defining_ functions, meaning they created functions that can be used later on. Let's see how we can use them in code.

```javascript
const answer = add(2, 2);

log("answer", answer); // [answer] 4
```

Is it that simple? Yes, it really is. Let's break down a few things before we continue.

```javascript
function functionName(argument, otherargument) {
  //function code
  return "Some Value";
}
```

* `function` is the keyword that defines a function. There are other ways to define them, but this is the "classical" way.
* `functionName` is the name of the function itself, how it will be called. so `function add()` will be called as `add()`
* `argument` and `otherargument` are, of course, called the "Arguments" for the function. An Argument's name must not be confused with the Parameters that are sent to the function. That is to say, in the `add()` function, `a` and `b` are the _arguments_ and `2` and `2` are the _parameters_ sent to it.
* `return` is a special keyword that does two very distinct things: first, it returns a value that's after it. So, `return 2;` will return the integer `2` to whatever called that function. Second, it _stops the execution of the function_. This means that anything _after_ a return keyword will not execute. This is useful if you want to stop execution based on a condition. For example:

```javascript
// Stop execution if either arguments are missing:
function add(a, b) {
  if(!a || !b) return false;
  return a + b;
};
```

The above will return `false` if either the `a` or `b` parameter is missing. The `a+b` line will simply never even be executed, which can save a lot of processing power in larger code.

### Optional Arguments

In the previous examples, `a` and `b` were _required_ arguments, meaning that you could not call the add function without both arguments being present (otherwise, they would be `null` and our calculation would fail). You can, however, give a function _optional_ arguments with a default value assigned.

Let's say we want `add()` to increment by 1 only, if the second value is not present, instead of stopping the function. This is done by assigning a default value to `b` when we create the function:

```javascript
function add(a, b = 1) {
  // We're still stopping the function if a is missing)
  if(!a) return false;
  return a + b;
}

console.log(add(5)); // 6
```

repository: eslachance/js-gitbook

branch_name: refs/heads/main

repo_name: eslachance/js-gitbook


text:
conf:{
    "root": "modo",
    "title": "modo.dateFormatter",
    "constructor": false,
    "file": "",
    "key": "ref:dateformatter"
}:conf

#modo.dateFormatter

The dateFormatter object is no creatable element, but attaches itself to the modo core.
It adds methods to the modo core to display times and dates in different formats. It can automatically
correct time offsets across different timezones as well.

The dateFormatter is fully internationalizable - just overwrite the object properties that
 contain the strings dates are constructed from to make dates appear in your locale flavor.

_Pro tip:_ Simply create an object (maybe in a JSON file) that contains your localized properties
and overwrite the original dateFormatter language properties by using underscores extend method:

    _.extend(modo.dateFormatter, myLocalizedObj);

__Heads up:__ This is not a element constructor!

##Properties
|importmarker:properties|
###MONTH_NAMES:Array {.property}
Array of fully written month names. Defaults to:

    ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']

###MONTH_NAMES_SHORT:Array {.property}
Array of short month names. Defaults to:

    ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']

###DAY_NAMES:Array {.property}
Array of fully written day names. Defaults to:

    ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']

###DAY_NAMES_SHORT:Array {.property}
Array of short day names. Defaults to:

    ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']

###SUFFIX:Array {.property}
A suffix string to be appended in some cases. Defaults to:

    ['st', 'nd', 'rd', 'th']

###TODAY:String {.property}
String that represents the word "today". Defaults to `today`.

###YESTERDAY:String {.property}
String that represents the word "yesterday". Defaults to `yesterday`.

###LAST:String {.property}
Micro-Template string for outputs of the `dateToFancyString()` method like "last week" or "last month". Defaults to `last %v`. `%v` is being replaced in that string.

###FUZZY_SECONDS:String {.property}
String that represents a very short timespan. May be returned by `dateToFancyString()`. Defaults to `about a minute ago`.

###NEVER:String {.property}
String that represents a time that has never been there. Usually expression for the unix time `0`.

###REL_UNITS:Array {.property}
Array of time units to be used by different methods. Defaults to:

    ['seconds', 'minutes', 'hours', 'days', 'weeks', 'months', 'years']

###REL_PAST:String {.property}
Micro-Template string for outputs of the `dateToFancyString()` method like "20 seconds ago". Defaults to `%v %u ago`. `%v` is being replaced by the value, `%u` is being replaced by the unit.

###REL_FUTURE:String {.property}
Micro-Template string for outputs of the `dateToFancyString()` method like "in 10 minutes". Defaults to `in %v %u`. `%v` is being replaced by the value, `%u` is being replaced by the unit.

###REL_CURRENT:String {.property}
String that represents the current moment in time. Defaults to `right now`.

###DEFAULT_FORMAT:String {.property}
String that represents the default output format for a full date, if `dateToFancyString()` notices a difference to now that is greater
than one week. Defaults to: `F jS, Y` (renders to: "April 5th, 2015").

###LOCAL_TIMEZONE:Integer {.property}
Automatically set timezone offset. This is the UTC offset in hours, the USER uses on his side.

###REMOTE_TIMEZONE:Integer {.property}
Automatically set timezone offset. This is the UTC offset in hours, the SERVER uses on his side. Defaults
to the same timezone as the user, so no corrections are made. Set this to the servers real timezone to
make the library automatically correct all time output while `normalizeTimezones` is set to `true`.

###normalizeTimezones:Boolean {.property}
Should the library automatically correct time outputs from remote timezone to local timezone? Defaults to `true`.

|endimportmarker:properties|

##Methods
|importmarker:methods|
###convertTimezone(inDate, toOffset, fromOffset):Date {.method}
Takes a date or timestamp and converts it to another timezone.

###dateToFancyString(inDate, dateFormat, options):String {.method}
Takes a date object or timestamp and will return a "fancy" string representation which is most pleasant for users to read. Dates that
are more than 7 days away from the current time will be rendered as a "full" date using the `DEFAULT_FORMAT` property.

Example output:

- 10 minutes ago
- Today, 11:15
- Yesterday, 22:00
- Last tuesday

The following properties can be passed into the method in the `options` object to overwrite the classes default settings:

    {
        normalizeTimezone: true,
        localTimezone: -2,
        remoteTimezone: 2
    }

###dateToRelativeString(datePast, dateNow, options):String {.method}
This creates a "relative" string, as used often in applications and social networks.
Instead of printing out the precise datetime, it comparing the two dates and produces outputs like "x minutes ago".

Also works into the future.

Example output:

- 10 minutes ago
- In 2 weeks
- 3 years ago

The following properties can be passed into the method in the `options` object to overwrite the classes default settings:

    {
        normalizeTimezone: true,
        localTimezone: -2,
        remoteTimezone: 2
    }

###dateToString(format, inDate, options):String {.method}
This outputs a string with a formatted date and follows the [PHP date() specification](http://de2.php.net/manual/en/function.date.php).

The following properties can be passed into the method in the `options` object to overwrite the classes default settings:

    {
        normalizeTimezone: true,
        localTimezone: -2,
        remoteTimezone: 2
    }
|endimportmarker:methods|

repository: BogusCurry/modoJS

repo_name: BogusCurry/modoJS


text:
# Reverse an Array
This JavaScript file includes a method that takes in an array and returns a reversed array

## Challenge
Take an array and reverse it. For instance an array of [1,2,3,4] would then equal [4,3,2,1]

## Approach & Efficiency
The approach was to use a for loop and unshift each element to a new array which would reverse the array.
This Big O space would be O(n) since the the amount of space is in relation to the size of the array.
the Big O time would be O(n) since there is one operation on each index so the bigger the array, the bigger n.

## Solution
![(../assets/reverseArray.jpg)]


text:
# Decoration

## Resources

- [text-decoration-color](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration-color) in Mozilla docs.
- [text-decoration](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration) in Mozilla docs.

## Turn on underline

```css
div {
  text-decoration: underline;
}
```

## Change color of line

If underling is already on.

```css
div {
  text-decoration-color: grey;
}

div:hover {
  text-decoration-color: blue;
}
```

## Turn on underline and set color of the line

```css
div {
  text-decoration:  underline grey;
}
```

repository: korenmiklos/dev-cheatsheets

repo_name: korenmiklos/dev-cheatsheets


text:
# Homebrew Formulae

A [Homebrew
tap](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/brew-tap.md)
for various Cage Data projects and tools.

## Usage

Tap the formula with the following command

    brew tap cagedata/formulae

Then start installing packages with:

    brew cask install ansible-dk

repository: cagedata/homebrew-formulae

repo_name: cagedata/homebrew-formulae


text:
---
layout: page-fullwidth
title: "General CLO"
permalink: "/docs/commandline/general/"
header: no
---

____________________________________________________________

### _Table of Contents_
{:.no_toc}
*  Auto generated table of contents
{:toc}

### _Purpose_
_____________________________________________________________
This page serves to document the command line switches generally applicable to most of the packages in the suite, and to give an idea of the usage cases of certain switches and switch types.

### _Documentation_
_____________________________________________________________
All of the programs have special branches that may be (and sometimes must be) set from command-line switches.

Here is an example:

    lmf cafeas -vns=4 -vnm=5 --rpos=pos

Following unix style, switches always begin with “-”. There are many command-line switches that are specific to a particular main program, while a number of others are common to several or all programs.

Some switches have a single “-” ; some have two (“–”). Those with two tend to control program flow (e.g. --show), while those with a single “-” tend to have an “assignment” function, such as a variables declaration (e.g. -vx=3). Sometimes there is not a clear distinction between the two, e.g. the printout verbosity --pr (see below) accepts either “-” or “–”.

In the example above, “-vns=4 -vnm=5“ assigns variables ns and nm to 4 and 5, respectively, while “--rpos=pos” tells lmf to read site positions from file pos.cafeas.

You can also put these switches in the CMD category in the input file. The function is similar to a command-line argument, but
not identical since the preprocessor has already read the input file before the “CMD” switches are read. Thus the "-v” and “-c” variable declarations may behave somewhat differently.

##### _Switches Common to Most or All Programs_

    --h             lists command-line switches for that program
                    and quits.  (warning: sometimes documentation
                    is slightly out of date)

	--input         same as turning on HELP=T in category IO; see
                    HELP= in the description of the IO category
                    above.

	--show          same as turning on SHOW=T in category IO; see
                    SHOW= in the description of the IO category
                    above.

	--showp         prints out input file after having run through
                    the preprocessor, and exits.  This can be
                    useful because it shows the action of the
                    preprocessor.  When trying to parse a
                    complicated input file, it is often simpler to
                    run it through the preprocessor, and use the
                    output of the preprocessor as the input file

	--pr#1[,#2]     sets print verbosities, overriding any
     -pr#1[,#2]     specification in the input file's IO category.
                    #2 is verbosity for the potential generation
                    segment of code and assumes the value of #1
                    unless specified.  See input-file-style.txt for
                    a description of the verbosity.

	--time=#1[,#2]  prints out a summary of timings in various
                    branches of the code at the close of program
                    execution.  Timings are kept to a nesting level
                    of #1.  If #2 is nonzero, timings are printed
                    `on the fly'

	--iactive       turns on `interactive' mode. This overrides
                    specification of interactive mode this in the
                    ctrl file `IO IACTIV=' See input-file-style.txt
                    for a description of the interactive mode.

	-iactive=no
    --no-iactive    turns off `interactive' mode, overriding
                    specification in the ctrl file.

	-c"name=strn"   declares a character variable and assigns to
                    value `strn'

	-v"name=expr"   declares a numeric variable and assigns to the
                    value of expression `expr'. Be advised that
                    only the first declaration of a variable is
                    used.  Later declarations have no effect.  In
                    addition to the declaration `name=...'  there
                    are assignment operators
                    `*=','/=','+=','-=','^=' modify existing
                    variables, following C syntax, as described in
                    description of category CONST above.

##### _Switches Common To Programs Using Site Information_
Additionally, for any program utilizing site information, the following switches apply

    --rpos=fnam     tells the program to read site positions from
                    file ``fnam'' after the input file has been read.  Data
                    is read following a standard format for 2D arrays.
                    This page more fully describes how site data are read.

	--fixpos[:tol=#]
	--fixpos[:#]    tells the symmetry finder to adjust positions
                    to sites that are ``slightly displaced'', that is that
                    if they were displaced a small amount, would make the
                    basis conform to a group operation.  Optional tolerance
                    specifies the maximum amount of adjustment allowed.
                    Example: lmchk --fixpos:tol=.001

	--sfill=class-  list tells the program to adjust the sphere sizes
                    to space filling.

                    *By default, ``class-list'' is a list of integers.
                    These enumerate class indices for which spheres
                    you wish to resize, eg 1,5,9 or 2:11.
                    For ``class-list'' syntax see here.

                    *A second alternative specification a class-list uses
                    the following:  ``-sfill~style=2~expression''
                    The expression can involve the class index ic and atomic number z.
                    Any class satisfying expression is included in the list.
                    Example: ``-sfill~style=2~ic<6&z==14''

                    *A third alternative specification of a class-list is
                    specifically for unix systems.  The syntax is
                    ``-sfill~style=3~fnam''.  Here "fnam" is a filename
                    with the usual unix wildcards.  For each class,
                    the program makes a system call ``ls fnam | grep
                    class'' and any class which grep finds is
                    included in the list.  Example:
                    ``-sfill~style=3~a[1-6]''


text:
# SPSA-Algorithm
A simple and crude implementation of SPSA algorithm.

The algorithm is taken from book "Lecture Notes in Control and Information Sciences" by S. Bhatnagar, H.L. Prasad, and L.A. Prashanth.

Requirements:
Python 3.
Numpy and matplotlib

repository: regularNN/SPSA-Algorithm

repo_name: regularNN/SPSA-Algorithm


text:
# L10. Potpourri

### Keyboard remapping

* Remap Caps Lock to Ctrl or Escape. We \(the instructors\) highly encourage this setting since Caps Lock has a very convenient location but is rarely used.
* Remapping PrtSc to Play/Pause music. Most OSes have a play/pause key.
* Swapping Ctrl and the Meta \(Windows or Command\) key.

* Open a new terminal or browser window.
* Inserting some specific text, e.g. your long email address or your MIT ID number.
* Sleeping the computer or the displays.

There are even more complex modifications you can configure:

* Remapping sequences of keys, e.g. pressing shift five times toggles Caps Lock.
* Remapping on tap vs on hold, e.g. Caps Lock key is remapped to Esc if you quickly tap it, but is remapped to Ctrl if you hold it and use it as a modifier.
* Having remaps being keyboard or software specific.

Some software resources to get started on the topic:

* macOS - [karabiner-elements](https://pqrs.org/osx/karabiner/), [skhd](https://github.com/koekeishiya/skhd) or [BetterTouchTool](https://folivora.ai/)
* Linux - [xmodmap](https://wiki.archlinux.org/index.php/Xmodmap) or [Autokey](https://github.com/autokey/autokey)
* Windows - Builtin in Control Panel, [AutoHotkey](https://www.autohotkey.com/) or [SharpKeys](https://www.randyrants.com/category/sharpkeys/)
* QMK - If your keyboard supports custom firmware you can use [QMK](https://docs.qmk.fm/) to configure the hardware device itself so the remaps works for any machine you use the keyboard with.

### Daemons


text:
# Challenge 6: Log Queries with KQL and Grafana

[Previous Challenge](./05-Azure-Monitor-For-Containers.md) - **[Home](../README.md)** - [Next Challenge>](./07-Visualizations.md)

## Introduction
understand the Kusto Query Language (KQL) write and save queries, which we can run on our Log Analytics Workspace

## Description

Write a performance query that renders a time chart for the last 4 hours for both of the Web Servers and the SQL Server for the following perf metrics. Save each query to your favorites.
* Processor Utilization: Processor / % Processor Time
* Memory Utilization: Memory / % Committed Bytes In Use
* Disk Utilization (IO): Disk Reads/sec and Disk Writes/sec
* Disk Utilisation (MB/GB): Disk Free Space (% or MB)
* Create a heartbeat query for Web Servers and SQL Server
* Write a performance query that renders a time chart for the last hour of the max percentage CPU usage of the AKS Cluster nodes
- Combine infrastructure and application logs to create a single timeseries chart that includes:
  - CPU usage from the node in your AKS cluster hosting the eshoponweb app
  - Duration of page views on your eshoponweb app hosted on the cluster
  - Save each query to your favorites.
* Deploy Grafana using Web App for Container
* Configure the Azure Monitor Data Source for Azure Monitor, Log Analytics and Application Insights
* Create a CPU Chart with a Grafana variable used to select Computer Name
* Add an Annotation to your chart overlaying Computer Heartbeat

Bonus question:
How can we save our log queries and share them across multiple workspaces?

## Success Criteria
* Grafana dashboards deployed
- Show the above 3 charts
- Show the saved queries

## Learning Resources
- [Getting started with Kusto](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/concepts/)
* [Run Grafana Docker image](http://docs.grafana.org/installation/docker/)
* [Monitor your Azure services in Grafana](https://docs.microsoft.com/en-us/azure/azure-monitor/visualize/grafana-plugin)
* [Log queries in Azure Monitor](https://docs.microsoft.com/en-us/azure/azure-monitor/logs/log-query-overview)
* [Overview of queries](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/)
* [Query best practises](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/best-practices)
* [Query operators](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/queries)
* [Telemetry correlation in Application Insights](https://docs.microsoft.com/en-us/azure/azure-monitor/app/correlation)

repository: chindris-mihai-alexandru/WhatTheHack

repo_name: chindris-mihai-alexandru/WhatTheHack


text:
# Clippy the Second

The dream modbot, assistant, and cake chef for any discord.

## Bot

This bot will hopefully one day grow big and strong enough to let good ol' clippy retire and take his place.

### What is this in?

It be Javacord

### What can Clippy II do that Clippy I could not?

* personal tags for displaying information, full moderatable
* serverwide tags for displaying luckperms info
* fully editable command list that doesn't show everything (thank goodness)
* role on join
* full user mod
* modlogs
* bonus commands for patreons
* some fun commands to ventriloquise with
* embed support to make and display useful embeds both as tags, usertags, and commands
* WolframAplha API connection, allowing for cool questions to get answered
* bot status control
* make cake!! yes finally!
* bot avatar control
* much, much more

## Run-thorugh of Features and Functions

The main class contains a sorted list of listeners and which users can use them.
To modify who can use things, simply change the conditions for the command in the
class that's registered.

The following is a breakdown of each class and its function, sorted in the order
of listing of the directories and files, alphabetically.

## Moderation Commands
### Ban Command
___
Usage: `!ban <user tag> <reason>`.

- If the command has all three components, the
user will be banned. 24 hours of their messages will be deleted.

Who can use it?

- If the person running the command has server permissions to ban users, the bot will comply.
If not, the bot will simply ignore them. A person with staff will not be banned by the bot.

### Kick Command
___
Usage: `!kick <user tag> <reason>`

- If the command has all three components, the mentioned user will be kicked.

Who can use it?

- If the person running the bot has permission to kick users, they will be able to use the bot to do the same.
A person that is staff will not be kicked by the bot.

### Mute Command
___
Usage: `!mute <user tag> <reason>`

- If the command has all three components, the mentioned user will be muted. If a user is not mentioned,
the bot will prompt for a name. If the mentioned user is staff, they will not be muted. If the author cannot
 meet the stated requirements, the bot will say no.

 Who can use it?

 - Anyone with permission to mute members on the server.

 ### Prune Command
 ___
 Usage: `!prune <amount>`

 - Prunes a certain amount of messages, between 2 and 100. Very useful for megaspammers! If the
 command author can kick users from the server, and provides a valid number to prune, the command will work.

 Who can use it?

 - Anyone that can kick users from the server is able to prune.
 ___
 ## Other Commands

 ### Avatar Commands
 ___
 Usage: `!avatar <user tag>`

 - Shows the user's avatar

 Who can use it?

 - People that can ban users from the server.

___

 Usage: `!setavatar <image url>`

 - Sets the avatar of the bot to the url
 ***MUST BE A URL!***

 Who can use it?

 Who can use it?

 - Anyone, in #off-topic or #patreons

 ### Embed Command
 ___
 Usage: `!embed <embed url>`

 - Preferably a gist, or some other unexpiring JSON link. The data will be gotten,
 made into an embed, and sent by the bot.

 Who can use it?

 - Anyone, in #off-topic or anywhere for people who can kick users from the server.

 ### GitHub Command
 ___
 Usage: `!github <username/repo> [issue #]`

 - Shows information about a repository, in the form of an embed. If an issue number is provided
  then information about the specific issue will be provided. There are built-in shortcuts to:

  > - the LP repo (lp, lperms, luckperms)
  > - the LPWeb repo (lpw, lpweb, luckpermsweb)
  > - the VCF repo (vcf, vaultchatformatter)
  > - the ExtraContexts repo (ec, extracontexts)
  > - the api-cookbook (cookbook)
  > - clippy (clippy)

 Who can use it?

 - Anyone, anywhere. Useful for displaying issue information by number, and calling up solutions.

 - `.luck` or `.lucko` will send an embed with something for luck to be proud of :)

 ### JavaDoc Command
 ___
 Usage: `!javadoc [class|method] <search>`

 - Queries the JavaDoc and sends related links, lists
   - (if class is specified) all classes that match the search with all their methods
   - (if method is specified) all methods that match the search with their class name
   - (default) all classes that match the search with their methods and all methods that match the search with their class name

Who can use it?
- Everyone

 ### Inspiration Command
 ___
 Usage: `!inspireme`

 - Will send a link from the inspirobot API, which generates random 'inspirational' sayings and
 sends them in the form of a .jpg link.

 Who can use it?

 -Anyone, in #off-topic, the patreon, or other non-support/LP conversational channels.

 ### Mojang Command
 ___
 Usage: `!mojang`

 - Shows the status of mojang authentication servers from `http://status.mojang.com/check`

 Who can use it?

 - Anyone, anywhere. Useful for checking if a failed mojang authentication error is caused by
 something else when users send a snapshot of the error.

 ### Nickname Command
 ___
 Usage: `!setavatar <image url>`

 - Sets the bot's nickname

 Who can use it?

 - Those that have the `staff` role.

 ### Presence Command
 ___
 Usage: `!presence <WATCHING|PLAYING|STREAMING> <Thing doing> <streaming url>`

 - Sets the bot's activity. If streaming, a `twitch.tv/accountname` or equivalent URL is required to
 direct to.

 Who can use it?

 - Anyone that is has staff role.

 ### RoleReaction Command
 ___
 Usage `!rolepoll`

 - Sends an embed with a message telling users to click the reaction to subscribe. If they click, a
 role is given to them which has no extra permissions and can be pinged with updates.

 Who can use this?

 - Anyone with permission to ban users from the server can use this command.

 ### Say Command
 ___
 Usage: `!say [channel|user] <words>`

 - Sends the words you specify to the channel you are in unless you mention a channel to say them in or a user to DM them to.

 Who can use this?

 - Anyone that can ban users from the server.

 ### SecretCommands Command
 ___
 Usage: `!secretcommands`

 - Lists all registered commands and their descriptions/usages, in a paginated embed.

 Who can use it?

 - Anyone that has permission to ban users from the server.

 ### Spiget Command
 ___
 Usage: `!spiget <query>`

 - Searches SpigotMC resources and lists the top five, with links and ratings to the hundredth decimal
 place.

 Who can use it?

 - Anyone, in #off-topic

 ### Tag Command
 Usage:

 - `!tagset <name> [marker]<contents>` sets a tag. [marker] is optional and can be `<embed>`
 or `<json>` and mark the following url (no spaces) to be made into an embed if json formatted
 embed text is at the address. With no marker, the tag when called will just send the contents
 as a chat message.
 - `tagunset <name>` unsets a tag
 - `!tagname` calls upon the tag
 - `!tagfile` gets the tagfile
 - `!tags` lists all tags
 - `!tagraw` gets a tag's raw content. If this is a url to embed, will send the url.

 Who can use it?

 - Those with permission to kick users can set, unset, tagraw and list. Those that have permission
 to ban users can get the tagfile.

 ### UserTag Command
 ___
 Usage: `!utags`, `!utagset`, `!utagunset`, `!utaginfo`, and `!utw`. Very similar usage to those listed above.
 `!utw` will add a user to the usertag whitelist, which allows individuals to use the utag commands.

 Who can use it?

 - Users who can see the patreons channel and have been added to the whitelist can add user tags.
 Anyone can use them once they are added. Users that own a utag or can kick people from the server
 can remove utags.

 ### WolframAlpha Command
 ___
 Usage: `!wolfram <query>`

 - Searches WolframAlpha for the query and returns the result

 Who can use it?

 - This command can only be used in the patreons, staff, and helpful channels, due in part to it being a fun bonus,
 and also the hard 2000 request/month limit which could be reached if a bunch of people used it
 a bunch.

 ### Xkcd Command
 ___
 Usage: `!xkcd <query>`

 - Searches xkcd for the query.

 Who can use it?

 - This command can only be used in the staff, helpful channels and the patreons channel, as a fun added bonus!
 ___
 ___
 ___

 ## Listeners
 ### AutoMod Listener
 ___
 Listens for a variety of things, acting upon/logging where appropriate.
 - `!pingok` command will trigger the antiping to disable for the channel any mod runs it in, for that mod.
 Users that can kick users or are listed as having a protected role (staff/helpful) are able to run this command.

 - `!fileblacklist <arg>` command will add/remove a filetype to the blacklist, which will be deleted if sent.
 Users that can ban people from the server can add/remove blacklisted extensions.

 - `!addcensor <word/regex>` will add a censored word, which will be deleted and logged if detected.

 Listeners are active for:
 - Censoring
 - File blacklist removal
 - Antiping (Users will be warned several times and then kicked. There is a cooldown so
 it does not last forever)

 ### AutoUpload Listener
 ___
 This listener will get text files and upload them to bytebin

 ### Error Listener
 ___
 This listener will get pastebin service links, scan them, and report on any known LP errors faster than
 any human can with a description and url to relevant wiki section.

 ### ModLog Listeners
 ___
 This listener will log just about everything:
 - Message delete
 - Message edit
 - Bans
 - Kicks
 - New members
 - Leavers
 - Name Changes
 - Nickname Changes
 - Role additions
 - Role removals

 ### Private Listener
 ___
 This listener will get any message beginning with the keyword `topsecret` and send it to the PRIVATE_CHANNEL
 defined in the Constants class. It will also send DMs to the bot to that channel.

 ### Wiki Listener
 ___
 This listener is responsible for all the previous wiki/help commands functioning as normal.

 The `!help` command will show all wiki-labelled commands in an identically-formatted embed.

 The available commands will not change, but not all will be listed in `!help` in order to shorten the list.

 Commands like `!nwc` will still function but will not be visible. The `!help` command information will take
 the URL defined in the listener and scan it for the latest wiki commands.

 If the URL cannot be accessed,
 a backup which is baked into the JAR will be used instead.

 ### Update Listener
 ___
 This listener will gently remind people that Luckperms already works on 1.16 if they
 send a message that contains the keywords "1.16" and "update", among others.

 ### Log Listener, Util, Storage Combo
 ___
 This listener prints the creation of every new message (except those in the logs channel) to a log file, as well as everything Clippy logs. It
 uses a custom format for fitting as much information in as little space as possible. Each log file will fill up
 to approximately 1GB before the bot automatically rotates to a new one, and up to 100 log files will be created.
 After 100 GB of pure text logs accumulate, it's definitely time to zip them up and move them out, to start fresh.

 ___
 ___
 ___
 *Notice: a MANIFEST.MF is included if maven is not something you want to use to build the JAR.*


text:
# SlowServer

[![CircleCI](https://circleci.com/gh/jescholl/slow_server.svg?style=svg)](https://circleci.com/gh/jescholl/slow_server)
[![Code Climate](https://codeclimate.com/github/jescholl/slow_server/badges/gpa.svg)](https://codeclimate.com/github/jescholl/slow_server)
[![Test Coverage](https://codeclimate.com/github/jescholl/slow_server/badges/coverage.svg)](https://codeclimate.com/github/jescholl/slow_server/coverage)

This Gem has two parts, slow_server and slow_client, together they can be used to
test timeouts in various stages of connections.

Currently there are two types of delays supported by both client and server,
initial delay and chunk delay.

Initial delay (--delay) causes both client and server to wait some amount of
seconds after the connection is opened before sending anything.

Chunk delay (--chunk-delay) works together with chunk count (--chunks) to split the
message into chunks and send them one chunk at a time with some delay between.  You
can think of this similar to Chunked Encoding for HTTP, but it's not actually using
Chunked Encoding

## Installation

    $ gem install slow_server

## Usage

###slow_client

slow_client is somewhat similar to slowloris, it has tunable delays for various different phases of connection.

```
$ slow_client --help
Usage: slow_client [OPTIONS] [URI]
    -X, --method METHOD              Request Method                      (default: GET)
    -p, --port NUMBER                Listen Port                         (default: 4000)
    -c, --chunks BYTES               Chunks                              (default: 1)
    -d, --delay SECONDS              Transmission delay after connecting (default: 0)
    -k, --chunk-delay SECONDS        Delay between chunks                (default: 0)
    -v, --version                    Show Version
```

###slow_server

slow_server is the counterpart to slow_client, by default it will respond with the story of The Tortoise and The Hare, but it too has tunable delays.

```
$ slow_server --help
Usage: slow_server [OPTIONS] [RESPONSE]
    -p, --port NUMBER                Listen Port                         (default: 4000)
    -c, --chunks BYTES               Chunks                              (default: 1)
    -d, --delay SECONDS              Transmission delay after connecting (default: 0)
    -k, --chunk-delay SECONDS        Delay between chunks                (default: 0)
    -v, --version                    Show Version
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jscholl/slow_server.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

gha_language: Ruby


text:
# Library
I have used the SafeMath library from Open Zeppelin.
This library is useful for preventing overflows and underflows when a integer is too large or too small.
It is great that SafeMath prevents these issues by default.

Libraries allow us to use the `using` keyword..

The SafeMath library has 4 functions - `add`, `sub`, `mul`, and `div`.

Let’s take a look at the code behind SafeMath:

```
pragma solidity ^0.4.24;

/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
    if (a == 0) {
      return 0;
    }
    c = a * b;
    require(c / a == b, "SafeMath mul failed");
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    return a / b;
  }

  /**
  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    require(b <= a, "SafeMath sub failed");
    return a - b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
    c = a + b;
    require(c >= a, "SafeMath add failed");
    return c;
  }
}

```


text:
# Write your own CSV parser

## Summary

[CSV](https://en.wikipedia.org/wiki/Comma-separated_values) is a table based file format.

Sample CSV File with a first line defining the column names and the rest is the payload of the table

```csv
Name,Age,Gender
Kristy,30,female
Jim,23,male
Andrina,19,female
```

The sample csv file represents the following table:

|    Name |  Age  | Gender |
| ------: | :---: | :----- |
|  Kristy |  30   | female |
|     Jim |  23   | male   |
| Adriana |  19   | female |

Your job is to write a Parser for the CSV format.

## Suggestion for the solution

A string containing a CSV-File can be parsed through a single method `CsvParser.Table parse(String csv)` in the `CsvParser` class.

The result of the parsing is a self-created inner class `CsvParser.Table` which should have the following public interface:

```java
String[] getColumns(); // returns the column names
int rows(); //returns the number of rows
String getValue(String column, int row) // returns the value for the column named "column" at the row "row" (zero-based-numbering)
```

- Read the file content into the `CsvParser.Table` object.
- The instances `CsvParser.Table` have to be **immutable**.
- Don't expose any other public methods as named above.

## Advise

1. Use TDD! :)
2. Follow the tasks above line by line
3. Each task should generate at least one new test or affect an already present test
4. Do not create any mentioned methods until you need them for your tests.
5. Assume all values of the csv file to be a string

## Tasks

1. Given `SampleColumn` to `CsvParser.parse()` it returns a table with colum name that can be read through `Table.getColumns()`
2. Read multiple column names `Name,Age,Gender` and read them through `Table.getColumns()`
3. Given an empty string for csv input should throw an `IllegalArgumentException`
4. Read first data line with single column `int rows()` returns 1
5. Make the data of the first data line accessible through `String getValue(String column, int row)` for 1 column
6. Read multiple colums for single data line
7. Handle multiple data lines and read them through `getValue()`
8. Throw an `IllegalArgumentException` if someone access an illegal row index through `getValue()` (upper and lower bound)
9. Throw an `IllegalArgumentException` if someone access an illegal column name through `getValue()`
10. If any data line has more or less fields than the heading throw a `IllegalArgumentException` while parsing.

repository: jaedle-kata/csv-parser

repo_name: jaedle-kata/csv-parser


text:
# Loqusdb integration

[Loqusdb][loqus] is a tool to keep track of local observation of genomic variants. Local frequencies/observations has been shown to add value to the analysis of genomic data both for rare disease and cancer. Scout integrates with loqusdb by fetching data from a given instance of loqusdb via the CLI. Please note that loqusdb version >= 2.5 needs to be installed.

## Setup

To avoid dependency conflicts loqusdb should be installed in an environment separate from scout.
Install loqudb according to the instructions on the package homepage. This can be done using the same environment or another virtual environment, also the same mongodb process can be used for the loqus database however if large datasets(1000s of whole genomes) are expected it is preferable to keep these separate. In the config `config.py` give the connection information like:

```python
#connection details for LoqusDB MongoDB database
LOQUSDB_SETTINGS = dict(
    binary_path='/path/to/bin/loqusdb',
    config_path=<path/to/loqus/config>
)
```
where the `binary_path` is mandatory and `config_path` is alternative if not connecting to the default (which is `port=27017`, `host=localhost`)

Now scout will display if the variant has been seen in other cases and also will link to these if they exists in the same scout instance.

## Result

Whenever a user clicks on a variant scout will query loqusdb for that variant and display the information given if the loqusdb settings are used as above. There will also be links to the other accessable cases where the variant can be found. A maximum of 10 cases will be displayed, however the total number of observations will be visible in numbers.

[loqus]: https://github.com/moonso/loqusdb

repository: Vijay-Yosi/biostack

repo_name: Vijay-Yosi/biostack


text:
id: bit_modify_3
title: bit modify
name: bit modify 3
url: http://microbit.org/resources/als/bit_modify_3
concept: bit
concept: bit_modify
depends_resource: bit_use_2
updated: March 2018
template: mainpanel
source_form: markdown
pipeline_stage: unstarted
---
WHO WHAT WHY WHERE WHEN HOW

WHO
    User who wants to modify how their bit works.

WHAT
 What must the learner understand prior to this resource?
    How to use their microbit
    What the microbit is (this is implied from above)

 What must the learner understand at the end of this resource?
    They should know where to find the editors
    They should know how to either find or enter a pre-existing piece of
    code and how to modify it
    They should understand that this gives them a hex file.
    They should understand how to get this onto their device.
    Since this is an intro, we'll just get them to change "Hello" to their
    name or similar.
    There should ideally be 2-3 changes done - so that there's a progression
      * A number. (say in a countdown)
      * A string.
       - The user does not need to know it's a string at this point.
       - Indeed the user does not need to know the difference between things
         but does need to know that a number must be in digits, not in
         words.
      * A sequence of instructions.

    This might actually be a progression of examples to work through, and
    these will logically split *LATER* into a collection of smaller
    resources. For now assume this is one resource.

HOW
  What is the relevant "How" question for this resource. Answer it.
  (Probably tells them "how to do this thing")
    How does the user find the editors they want?
    How does the user choose the editor they need?
    How do they modify the code to get it to do something?
    How do they get the resulting hex file from that program
    How do they run a similation? (can they - depends on language)
    How to they run their program on their device.

WHY
  Why do they need to know this ?
    They need to know this in order to start writing their own programs.
    Before they can do that they need to understand how to change programs.

  What is the learner able to do at the end of this resource?
    The user is able to modify a program with some level of confidence.

  Why does this matter to then?
    Unless they have some experience of tinkering with working code, they
    have very little chance of making their own working code.  Knowing they
    are starting from something that is known to work is an important step
    in creating their own work.

WHERE
 HERE: Why do they need to know this ?
    The examples being changed should ideally be embedded in this resource.

 THERE: Where can they find more information?
    There can be links to more resources and more examples going through
    these questions differently. (eg using different media)

WHEN
  When will they find this useful ?
    Immediately after loading an example they may well want to change things
    to work their way. So this will be pretty immediate.

* Write the questions for this resource.                 --> QUESTION OUTLINES WRITTEN
* Write answers for the questions.                       --> ANSWER OUTLINES WRITTEN
* Arranges the answers into a useful interesting order   --> ANSWERS REARRANGED
* Simplify the langange                                 --> LANGUAGE SIMPLIFIED
* CONCEPTS ARISING

repository: sparkslabs/coals

repo_name: sparkslabs/coals


text:
![home](./resources/Capa.png)

  How to Use   |
  Technologies   |
  Author   |
  License

The Podcastr was developed during the Next Level Week 5, promoted by Rocketseat. It's a platform were you can listening the episodes from Podcast "Talk Dev" and see a description about it episode content.

## How to Use
If you want download this folder from this repository just follow this steps below:

1. Copy the url from your browser;
2. Replace the 'tree/main' or 'tree/master' with trunk;

Example:
> https://github.com/User/somerepo/tree/main/folderyouwant

> https://github.com/User/somerepo/trunk/folderyouwant

3.Go to the command Line and just grab the folder with SVN

```sh
    svn checkout https://github.com/User/somerepo/trunk/folderyouwant
```

After download that folder you gonna run the below command to start the application:
```sh
npm install
```
or
```sh
yarn
```
Those command will install and download the required packages to application be able to run correctly.

After that you can choose use npm or yarn to run the application:

```sh
npm run server
```

```sh
npm run dev
```
For users of yarn :

```sh
yarn server
```
and them:
```sh
yarn dev
```

The first command will start mini back-end server and the next command will run the application.
## 🚀 Technologies
This Project was developed using the following technologies:

- HTML
- CSS
- JavaScript
- NodeJS
- React
- Next

## Author

👤 **Alberto Junior**

* Github: [Alberto Júnior](https://github.com/wayfiding)
* LinkedIn: [Alberto Souza](https://linkedin.com/in/alberto-souza)

## 🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check [issues page](Teste).

## Show your support

Give a ⭐ if this project helped you!

## 📝 License
Copyright © 2021 [Alberto Júnior](https://github.com/Wayfiding).

Esse projeto está sob a licença MIT. Veja o arquivo [LICENSE](.github/LICENSE.md) para mais detalhes.

---

Made with ♥ by Rocketseat :wave: [Participe da nossa comunidade!](https://discordapp.com/invite/gCRAFhc)

***
_This README was generated with ❤ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator) and Alberto

repository: Wayfiding/podcastrnext

repo_name: Wayfiding/podcastrnext


text:
# SplitLargeFile

Simple tool for splitting large files. Useful when working with large datasets.

Uses a prerelease version of System.Commandline
    More Info here: https://github.com/dotnet/command-line-api

repository: jamiefutch/SplitLargeFile

repo_name: jamiefutch/SplitLargeFile


text:
# rpm-spec-dependency-analyzer

[![PyPI version](https://badge.fury.io/py/rpm-spec-dependency-analyzer.svg)](https://badge.fury.io/py/rpm-spec-dependency-analyzer)

This is a simple Python3 script that parses a list of SPEC files and
generates a nice graph of the dependencies among them using DOT.

## How to install

```
pip3 install rpm-spec-dependency-analyzer
```

## How to use

```
rpm_spec_dependency_analyzer --output reqgraph.dot /my/spec/folder/*.spec
dot -Tpng reqgraph.dot -o reqgraph.png
```

## Example output

This is the example of the graph generated by [pkgA.spec](examples/pkgA.spec) and by [pkgB.spec](examples/pkgB.spec):

![Example graph](examples/example-graph.png "Example DOT output")

Original .dot source is available [here](examples/example-graph.dot)


text:
# Simple Feed Widget

![GitHub Logo](/images/Feed-Widget.png)

[![N|Solid](https://cldup.com/dTxpPi9lDf.thumb.png)](https://nodesource.com/products/nsolid)

[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/joemccann/dillinger)

  - Url parse
  - Getting resources

### Tech

* [ReactJS] - HTML enhanced for web apps!
* [page-metadata-parser] - Url parser npm package.
* [Bootstrap] - great UI boilerplate for modern web apps
* [node.js] - evented I/O for the backend
* [Express] - fast node.js network app framework [@tjholowaychuk]
* [Concurrently] - Npm package for running React and Node at the same time

### Installation

Install the dependencies and devDependencies and start the server.

```sh
$ cd React-Node-Feed-Widget
$ npm i
$ cd client && npm i
```

To run

```sh
$ npm run dev
```

License
----

MIT

**Free Software, Hell Yeah!**

[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax)

   [ReactJS]: <http://reactjs.org>
   [page-metadata-parser]: <https://www.npmjs.com/package/page-metadata-parser>
   [node.js]: <http://nodejs.org>
   [Bootstrap]: <https://getbootstrap.com/>
   [express]: <http://expressjs.com>
   [Concurrently]: <https://www.npmjs.com/package/concurrently>

repository: w-sr/react-node-rss-feed-widget

repo_name: w-sr/react-node-rss-feed-widget


text:
# Scaffolding example

This example shows a minimal example of how to configure the code scaffolding, if you have some schema available somewhere.

`yarn start` Runs the scaffolder and uses TypeScript to compile the generated sources.

`yarn download` Re-fetches the graphql-schema from the demo endpoint (this might take a while). The schema definition is downloaded from: https://graphql-pokemon.now.sh/


text:
---
layout: workgroup
purpose: The purpose of this workgroup is to define a formal specification for how hardforks will be done on a regular basis going forward.
schedule: Protocol upgrades every six months at Median Time Past timestamps. Code and features to be included in the upgrade will be finalized three months prior to the upgrade.
communication: ['[Telegram Group](https://t.me/joinchat/HCYr50he2qn0A9bSLZWoqg)']
officers: {
  chairperson: '',
  reporter: '',
  coordinator: ''
  }
parties: [
  'Amaury Sechet, @deadalnix, Bitcoin ABC',
  'Chris Pacia<EMAIL_ADDRESS>OpenBazaar',
  'Jason Cox, jasonbcox'
]
permalink: /workgroups/wg-hardforks
group: workgroup
workgroup: wg-hardforks
title: workgroups.workgroups.wg-hardforks.title
---

### Upcoming Dates

* **Feb 15, 2018**—Feature Freeze

* **May 15, 2018**—Hardfork

  _(Timestamp: `1526400000`)_

* **Aug 15, 2018**—Feature Freeze

* **Nov 15, 2018**—Hardfork

  _(Timestamp: `1542300000`)_

### Past Dates

* **Nov 13, 2017**—Hardfork

  _(Timestamp: `1510600000`)_

  [Bitcoin ABC Announcement](https://www.bitcoinabc.org/november)

  [Bitcoin ABC Medium Term Development Plan](https://www.bitcoinabc.org/bitcoin-abc-medium-term-development)

  [nChain Development & Testing Accord](https://nchain.com/en/blog/bitcoin-cash-development-testing-accord/)

{% include sub-list.html group='hardforks' %}

gha_language: CSS


text:
**Open Source Invoicing App for Freelancers & Auto-entrepreneur. 💲📑**

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/clementdlc)

![Screenshot](https://i.imgur.com/1qDPHN4.png)
___

### :rocket: Features

|Features|...                         |
|-------------------------------|-----------------------------|
|`Invoice` |***Planned***|
|`Estimates` |***Planned***|
|`Taxes`|***Planned***|
|`Contracts`|***Planned***|
___

### :cloud: Installation

#### Requirements:
```
NodeJS
MySQL or PostgreSQL server
```

**Only one step :**
```shell
npm run-script lift
```
### :pencil: Production start

Webpack builds the bundle files on `postinstall` and Beam is lifted the same way it's always lifted in production:

```shell
npm run dist
```
___

### :computer: Development

There are multiple ways to run the project in development as sails and webpack-dev-server run independently. The easiest way is to use [Foreman](https://github.com/theforeman/foreman) (`npm install -g foreman`) and run:

```shell
nf start
```

This will start all processes listed in the `Procfile`.

The alternative is to manually run each process in separate terminal windows.

To view Beam app, go to `http://localhost:3000` in your browser.
___

### :round_pushpin: Translate
Help us translate or suggest changes to existing languages if you find any mistakes.

**Here's the  localization platform :** (https://poeditor.com/join/project/zjrG5XDl4i).

---

### :mag_right: Credits

Beam is a product of  [NocturneLab](https://github.com/PHClement)

**Special thanks to:**

- *Zohir Belhaouzia* for the Italian translation.
-   *Your name here ?*

repository: c-delouvencourt/Beam-Invoice

repo_name: c-delouvencourt/Beam-Invoice


text:
vue-nodegui-starter

Clone and run for a quick way to see Vue NodeGui in action.
![demo image](/assets/demo.png)

## To Use

To clone and run this repository you'll need [Git](https://git-scm.com/) and [Node.js](https://nodejs.org/en/download/) (which comes with [npm](http://npmjs.com/)) installed on your computer. From your command line:

```shell
# Clone this repository
git clone https://github.com/nodegui/vue-nodegui-starter
# Install CMake
brew install cmake
# Go into the repository
cd vue-nodegui-starter
# Install dependencies
npm install
# Run the app
npm run dev
```

## Installation & Resources for learning Vue NodeGui

[Documentation](https://vue.nodegui.org/) - all of Vue NodeGui's documentation.
[NodeGui](https://nodegui.org/) - all of NodeGui's documentation.

## Packaging app as a distributable

In order to distribute your finished app, you can use [@nodegui/packer](https://github.com/nodegui/packer)

### Step 1: (_**Run this command only once**_)

```sh
npx nodegui-packer --init MyAppName
```

This will produce the deploy directory containing the template. You can modify this to suite your needs. Like add icons, change the name, description and add other native features or dependencies. Make sure you commit this directory.

### Step 2: (_**Run this command every time you want to build a new distributable**_)

Next you can run the pack command:

```sh
npm run build
```

This will produce the js bundle along with assets inside the `./dist` directory

```sh
npx nodegui-packer --pack ./dist
```

This will build the distributable using @nodegui/packer based on your template. The output of the command is found under the build directory. You should gitignore the build directory.

More details about packer can be found here: https://github.com/nodegui/packer

## License

MIT

repository: eLoyyyyy/vue-nodegui-starter

repo_name: eLoyyyyy/vue-nodegui-starter


text:
# About

Ezored is a C++ multi-platform toolkit template.

Ezored philosophy is: write once and compile anywhere.

When you need add native code to your mobile or desktop application Ezored is your best option because it is ready for it and ready for production without any efforts.

You can "plug" the native code into a new or existing mobile or desktop application.

And don't need write your entire mobile or desktop application in C++, but "plug" only the part that you want write in C++ code.

A good example is when you have a sensive code in Swift or Kotlin (or any other language and platform) that you need write in a native code (C/C++) and call only this native function because is more secure and have a better performance than original language.

Since it is a toolkit template for your project, after download Ezored you need upload to your repository because all C++ code will only make sense to your project after it.

You can use it for free, for any purpose, including commercial purposes.

Feel free to collaborate with Ezored, creating or improving the main project or modules.


text:
# vue-props-validation
Vue props validation logic extracted for nested validation in object and arrays.

## Install

```bash
npm install vue-props-validation
```

## Usage
You can write validations for object attributes and array elements in the Vue syntax way using the validator attribute. You can also validate any other object or array outside vue props.

### Objects validation
```js
import {objectValidator} from 'vue-props-validation';

props: {
  email: String,
  user: {
    type: Object,
    validator: objectValidator({
      id: Number,
      firstName: String,
      lastName: {type: String, required: false},
      age: Number,
    }),
  },
}
```

### Arrays validation
```js
import {arrayValidator} from 'vue-props-validation';

props: {
  names: {
    type: Array,
    validator: arrayValidator(String),
  },
  emails: {
    type: Array,
    validator: arrayValidator({
      type: String,
      validator: email => email.includes('@'),
    }),
  },
}
```

### Combined use of both validators
You can nest validators as much as you want.
```js
import {arrayValidator, objectValidator} from 'vue-props-validation';

props: {
  animals: {
    type: Array,
    validator: arrayValidator({
      type: Object,
      validator: objectValidator({
        id: [String, Number],
        name: String,
        age: Number,
        isCat: Boolean,
        vaccinationDates: {
          type: Array,
          required: false,
          validator: arrayValidator([Date, String, Number]),
        }
      }),
    }),
  },
}
```

### API response validation example
```js
import {arrayValidator, objectValidator} from 'vue-props-validation';

fetch('https://raw.githubusercontent.com/rubnvp/vue-pokedex/master/data/pokemons.json')
  .then(response => response.json())
  .then(pokemons => {
      arrayValidator({ // this will return false and log an error to the console if it fails
        type: Object,
        validator: objectValidator({
          id: Number,
          name: String,
          types: Array,
        }),
      })(pokemons);
  });
```

## Config
### enabled
You can enable or disable all validators in order to skip validations in production enviroments and avoid possible performance issues:
```js
// at main.js
import {setConfig} from 'vue-props-validation';

setConfig({enabled: process.env.NODE_ENV !== 'production'});
```
### logLevel
Also you can choose the log level for validation message errors between:
- `none`: no logs
- `warn`: logs with console.warn
- `error`: logs with console.error (by default)
- `throw`: logs in exceptions
```js
// at main.js
import {setConfig} from 'vue-props-validation';

setConfig({logLevel: 'warn'});
```

## Usage from script tag
You can point to unpkg.com. An object called VueProps with the functions will be added to the global scope.
```html
<script src="https://unpkg.com/vue-props-validation"></script>
```

## Notes
 Remember that vue validators are not executed in production enviroments. Like in Vue, the type can be any native or custom constructor: String, Number, Boolean, Array, Object, Date, Function, Symbol, BigInt, etc. The attribute `default` is not supported in order to avoid mutating props.

## Todo roadmap
- Option for local config to overwrite global config.
- Include a plugin to avoid imports on every component.

repository: TrendingTechnology/vue-props-validation

repo_name: TrendingTechnology/vue-props-validation


text:
# OpenSCAD threads.scad module

This is an efficient OpenSCAD threading library intended primarily to be used
as a component in other designs.  It supports metric compatible internal and
external threads, auger threads, thread tapering, clearance holes, countersunk
holes, recessed holes, hex bolts, nuts, washers, Phillips tips, and long rods
which are extended with threaded joints.  Whenever possible this complies with
metric standards for the defaults of parameters, while providing overrides for
many values.

The core threading routine makes use of list comprehensions to generate the
entire threaded screw as a single polyhedron.  This substantially improves the
rendering speed and robustness over other approaches, decreases the number of
facets necessary, and increases the tactile smoothness of the resulting parts.
This also allows partially tapered screw ends, plus auger and
conventional threads which come to a point.

# threads.scad API

Where parameters are shown with a default of 0 or -1, in many cases this indicates a standard default value will be calculated internally if this is not overridden.

```
// This creates a vertical rod at the origin with external threads.  It uses
// metric standards by default.
module ScrewThread(outer_diam, height, pitch=0, tooth_angle=30, tolerance=0.4, tip_height=0, tooth_height=0, tip_min_fract=0)

// This creates a vertical rod at the origin with external auger-style
// threads.
module AugerThread(outer_diam, inner_diam, height, pitch, tooth_angle=30, tolerance=0.4, tip_height=0, tip_min_fract=0)

// This creates a threaded hole in its children using metric standards by
// default.
module ScrewHole(outer_diam, height, position=[0,0,0], rotation=[0,0,0], pitch=0, tooth_angle=30, tolerance=0.4, tooth_height=0)

// This creates an auger-style threaded hole in its children.
module AugerHole(outer_diam, inner_diam, height, pitch, position=[0,0,0], rotation=[0,0,0], tooth_angle=30, tolerance=0.4)

// This inserts a ClearanceHole in its children.
// The rotation vector is applied first, then the position translation,
// starting from a position upward from the z-axis at z=0.
module ClearanceHole(diameter, height, position=[0,0,0], rotation=[0,0,0], tolerance=0.4)

// This inserts a ClearanceHole with a recessed bolt hole in its children.
// The rotation vector is applied first, then the position translation,
// starting from a position upward from the z-axis at z=0.  The default
// recessed parameters fit a standard metric bolt.
module RecessedClearanceHole(diameter, height, position=[0,0,0], rotation=[0,0,0], recessed_diam=-1, recessed_height=-1, tolerance=0.4)

// This inserts a countersunk ClearanceHole in its children.
// The rotation vector is applied first, then the position translation,
// starting from a position upward from the z-axis at z=0.
// The countersunk side is on the bottom by default.
module CountersunkClearanceHole(diameter, height, position=[0,0,0], rotation=[0,0,0], sinkdiam=0, sinkangle=45, tolerance=0.4)

// This inserts a Phillips tip shaped hole into its children.
// The rotation vector is applied first, then the position translation,
// starting from a position upward from the z-axis at z=0.
module PhillipsTip(width=7, thickness=0, straightdepth=0, position=[0,0,0], rotation=[0,0,0])

// Create a standard sized metric bolt with hex head and hex key.
module MetricBolt(diameter, length, tolerance=0.4)

// Create a standard sized metric countersunk (flat) bolt with hex key drive.
// In compliance with convention, the length for this includes the head.
module MetricCountersunkBolt(diameter, length, tolerance=0.4)

// Create a standard sized metric hex nut.
module MetricNut(diameter, thickness=0, tolerance=0.4)

// Create a convenient washer size for a metric nominal thread diameter.
module MetricWasher(diameter)

// Solid rod on the bottom, external threads on the top.
module RodStart(diameter, height, thread_len=0, thread_diam=0, thread_pitch=0)

// Solid rod on the bottom, internal threads on the top.
// Flips around x-axis after printing to pair with RodStart.
module RodEnd(diameter, height, thread_len=0, thread_diam=0, thread_pitch=0)

// Internal threads on the bottom, external threads on the top.
module RodExtender(diameter, height, thread_len=0, thread_diam=0, thread_pitch=0)

// Produces a matching set of metric bolts, nuts, and washers.
module MetricBoltSet(diameter, length, quantity=1)

// This generates a closed polyhedron from an array of arrays of points,
// with each inner array tracing out one loop outlining the polyhedron.
// pointarrays should contain an array of N arrays each of size P outlining a
// closed manifold.  The points must obey the right-hand rule.  For example,
// looking down, the P points in the inner arrays are counter-clockwise in a
// loop, while the N point arrays increase in height.  Points in each inner
// array do not need to be equal height, but they usually should not meet or
// cross the line segments from the adjacent points in the other arrays.
// (N>=2, P>=3)
// Core triangles:
//   [j][i], [j+1][i], [j+1][(i+1)%P]
//   [j][i], [j+1][(i+1)%P], [j][(i+1)%P]
//   Then triangles are formed in a loop with the middle point of the first
//   and last array.
module ClosePoints(pointarrays)
```

The following functions also provide standard metric values for a given
diameter:  ThreadPitch, HexAcrossFlats, HexAcrossCorners, HexDriveAcrossFlats,
HexDriveAcrossCorners, CountersunkDriveAcrossFlats,
CountersunkDriveAcrossCorners, NutThickness.

# Usage Notes for 3D printing

Good use of this library requires a printer which is properly calibrated for
extrusion width, and which is producing consistent stable parts.  In early
tests, threaded holes (internal threads) of size M2 and higher worked fine with
standard metal bolts.  M3 bolts (external threads) worked under good
conditions, but would be disrupted by small changes in print quality.  M4 and
higher were quite reliable.

The extendable rod functions were added to support printing vertical rods
taller than the available printer height.  Early tests show this works very
well and can be quite sturdy with appropriate infill.  With appropriate plastic
and settings this could probably be used to create fairly long rods.

repository: gluap/threads-scad

repo_name: gluap/threads-scad


text:
# blogdown-hexo

A sample website based on [**blogdown**](https://github.com/rstudio/blogdown) and [Hexo](https://hexo.io). It is briefly documented at https://bookdown.org/yihui/blogdown/hexo.html.

The site was created via `hexo init blogdown-hexo`. I added `.Rprofile`, `R/build.R`, `R/build_one.R`, and a sample post `source/_posts//2015-07-23-r-rmarkdown.Rmd`. The site is built and deployed automatically via [Netlify](https://www.netlify.com). Below are the settings on Netlify:

![hexo-netlify](https://user-images.githubusercontent.com/163582/28689730-2fdbb386-72dc-11e7-83e0-b0bdafed4786.png)

To build and preview the site locally, you need to install **blogdown**:

```r
devtools::install_github("rstudio/blogdown")
blogdown::serve_site()
```


text:
# Changelog
All notable changes to this project will be documented in this file.

## [0.11.0] - 2022-11-25
### Changed
- Support for<EMAIL_ADDRESS>and<EMAIL_ADDRESS>has ended;
- Reduced object allocation count during type checking process;
- Removed useless `Incorrect type` text part from `SmartCore::Initializer::IncorrectTypeError` exception message;
- Updated development dependencies;

## [0.10.0] - 2022-10-04
### Changed
- `SmartCore::Engine::ReadWriteLock` is used instead `SmartCore::Engine::Lock` in order to decrease the count of RubyVM's context switching and useless Mutexes usage;
- reduced `KeyError`-exception flow use cases in some cases inside the framework internals (in order to reduce object allocations under the hood);
- bumped development dependencies;
- bumped core dependencies (in order to use `ReadWiteLock` (and actualize available inner-framework features);

## [0.9.1] - 2022-03-06
### Fixed
- `finalize` now accepts lambdas with arity `-2`. For example `->(a, *b) {}` or `:freeze.to_proc`
  which in `Ruby >= 3` returns lambda with arity equal to `-2`.

## [0.9.0] - 2021-12-19
### Changed
- `:finalize` block is not invoked on the `option` with `optional: true` flag;

## [0.8.0] - 2021-12-04
### Added
- New options for option and param attributes:
  - Support for attribute **aliasing** (`:as` parameter);
    - supports: `option`, `param`;
  - Support for attribute **auto-casting** (`:auto_cast` parameter);
    - supports: `option`, `param`;
  - Support for **mutable** attributes (`:mutable` parameter) with type-validation inside;
    - supports: `option`, `options`, `param`, `params`;
  - Support for **optional** attributes (`:optional` parameter);
    - supports: `option`;
- **SmartCore::Initializer::Configuration**:
  - Configuration setting `strict_options` now works separately "per-class" in all configs manner
    (each class shares the global state but has own state too)
  - Support for per-class/global `:auto_cast` configuration;
    - provides a global/per-class behavior for `:cast` option (`false` by default);
- `options` declaration now supports `privacy` option;
- `params` declaration now supports `privacy` option;

### Changed
- Drop support of<EMAIL_ADDRESS>- `:default` attribute parameter now duplicates the passed value during object instantiation;
- `:default` attribute parameter only works with `option` attribute (`param` can't have `default` parameter now);
- Attribute values generated by `:finalize` are type-validated now too;
- Now lambda-based `:finalize` attributes are being checked for the signature during attribute declaration;
- Some error messages have become more readable;

## Fixed
- `send` method overlaping/rewriting: otions and params named as `send` breaks the internal
  framework-related invocations of the attribute definitioning inside the custom object constructor
  (this name rewrites internal Ruby's `send` method and brokes some things);

## [0.7.0] - 2021-06-23
### Added
- `strict_options` config option for non-strict checking of passed options;

## [0.6.0] - 2021-06-23
### Added
- Validation messages for incorrect attribute types;

## [0.5.0] - 2021-01-18
### Changed
- Updated `smart_types` dependency (`~> 0.4.0`) to guarantee **Ruby@3** compatibility;
- Updated development dependencies;

## [0.4.0] - 2021-01-18
### Added
- Support for **Ruby 3**;

### Changed
- Moved from `TravisCI` to nothing (todo: migrate to `GitHub Actions`).
  Temporary: we must run test cases locally.
- Updated development dependencies;

## [0.3.2] - 2020-07-12
### Fixed
- Deeply inherited entities lose their `__initializer_settings__` entitiy;

## [0.3.1] - 2020-07-12
### Fixed
- Deeply inherited entities lose their class attribute definers;

## [0.3.0] - 2020-07-11
### Added
- `extend_initialization_flow` alias method for `SmartCore::Initializer.ext_init`;
- Access methods to the instance attribute lists (`#__params`, `#__options__`, `#__attributes__`);

### Changed
- Updated development dependencies;

## [0.2.0] - 2020-05-16
### Changed
- **Constructor**: disallow unknown option attributes;

## [0.1.0] - 2020-05-10
- Release :)


text:
---
title: "Real time chatting system"
excerpt: "A full stack chatting web app using React.js Redux Node.js Redis and MongoDB"
date: 2016-06-01
header:
  overlay_color: "#333"
  teaser: /jchat/jchat-chat-page.png

gallery:
  - url: /jchat/jchat-home-page.png
    image_path: /jchat/jchat-home-page.png
    alt: "placeholder image 1"
  - url: /jchat/jchat-signup-page.png
    image_path: /jchat/jchat-signup-page.png
    alt: "placeholder image 2"
  - url: /jchat/jchat-chat-page.png
    image_path: /jchat/jchat-chat-page.png
    alt: "placeholder image 3"

tags:
  - React.js
  - Node.js
  - Redis
  - MongoDB
  - Docker
  - Amazon EC2
  - ECMAScript6
  - Webpack
---

## Motivation

Chatting software are so popular today benefited from fast growing internet technologies.
It's a good try to create a chatting software for my family, my friends and me, without worry some issues like
service availability and message security. So that's why I start to create this chatting web app and take is as good opportunity to explore, learn and practice
some current interesting technologies at 2016. My understanding of software structure and programming skill are deepened and improved by create this project.

## Project Description

It's a full stack real time chatting web app that enable chatting between multiple users, storing chatting history and adding friends.
The functionalities are similar to Facebook messenger in terms of user experience.
Here is the [live demo](https://www.google.com/) and [Github Repo](https://github.com/jiangxiaoyong/JChat)

{% include gallery caption="Screenshots of welcome page, signup page and chatting page." %}

## Project Features
This chatting web app supporting following features:

* Enabled chatting between multiple friends
* Enabled caching both online and offline chatting records
* Enabled adding friend by user email address
* Enabled showing alert of unread message
* Enabled signup and signin
* Enabled authentication by username and password
* Enabled password encryption

## Project technologies stack and use cases
The technologies used by creating this web app and corresponding usage as described below:

### Front end
  * React.js
      * create stateless components of user interface, and compose them to form lager complicated component
  * Redux
      * Predictable state container for react.js stateless components and manager data flows and propagation of change of entire front end web client
  * webpack
      * A module bundler and automation of task runner. It provides codebase splitting into an on demand loaded chunks
        ,extracting common shared chunk, converting ECMAScript 6 syntax into cross browser compatible format and hot module replacement for this web app
  * ECMAScript 6
      * It provides many syntax sugar and modules feature to organize modules and their dependencies

### Back end
  * Node.js
      * Served as http server and handle websocket connections via javascript library Socket.io
  * Redis
      * A high performance NoSQL in-memory data structure store, it is used as PUB/SUB messages broker, and cache of messages and session
  * MongoDB
      * A document-oriented NoSQL to store user information, like username, password, email address and friends list

### Development and deployment
  * Docker
      * A super easy to use contianerization platform to build, ship and run web app. This web app use total three containers, one container for
      each node server, redis and mongoDB NoSQL database

## Project architecture

Architecture overview of this chatting web app

## System design

### User Interface of web client

The front end user interface is build by leveraging React.js and Redux. Thanks to functional programming paradigm encouraging by React.js and Redux,
the state management, propagation of change and data flow become so easily predictable and maintainable. The development and debug tremendously benefit
from the concept of immutable state and pure function of functional programming. This enable me to write less error prone code and easy to test code.
Redux embrace the idea of separating of presentational and container components:

* presentational components
  * They describe how things look. These are normal stateless React component, you give the state, they always show the same results.
    These components must not retain internal state. They are pure functional transforms of their input.
* Container components
  * They describe hwo things work. Compared to presentational components, they are stateful, and their job is to hook up the app's state to React stateless components.
    They manipulate and plugin whatever data into reusable React stateless components. Actually they are wrapper of React components,
    and React components can be reused in different stateful components.

In addition to functional programming, the development of this web app also benefit from another idea of one way data flow.
During development and debugging, where are current data located and where will they flow to are clear visible and predictable.

### Data routing at server side

The server build by Node.js, which intrinsically is good at handling intensive high volume of IO operations. Chatting app is an ideal use case.
This app use Node.js and socket.io to asynchronously handel websocket connections.

Redis control the routing of messages by leveraging Redis PUB/SUB feature. Users subscribe its own user id when connecting to node server,
friends publish their messages to this specific user id, this can guarantee the receiver can always successful receive messages send from friends by this simple mechanism.
Redis also used as cache of chat records. The node server will push each message received to Redis no matter receiver online or offline. These cached messages
will be popped when user login, so they can see their chatting history even when they offline.

### Persistent data

MongoDB provides semi-structured data format to store user information like username, password and friends list. The JSON like semi-structured data format are easy to read
and query compared to relational database that need a lot of table join operations. MongoDB support rich queries, no complex join and easy to scale. That's why MongoDB
is one of the most favorite NoSQL database especially in era of big data and distributed computing.

### Wrap up

Embracing functional programming in front end development is amazing and excited way of problem solving, especially in the development of massive interaction
between users and user interface. Functional programming is more expressive than object-oriented or imperative programming. I will leverage the idea of functional programming
throughout my future programming tasks whenever possible on my initiative.


text:
# aire.zmvm

[![Travis-CI Build
Status](https://travis-ci.org/diegovalle/aire.zmvm.svg?branch=master)](https://travis-ci.org/diegovalle/aire.zmvm)
[![AppVeyor build
status](https://ci.appveyor.com/api/projects/status/c7kg6o68exx0lirg?svg=true)](https://ci.appveyor.com/project/diegovalle/aire-zmvm/branch/master)
[![Coverage
Status](https://img.shields.io/codecov/c/github/diegovalle/aire.zmvm/master.svg)](https://codecov.io/github/diegovalle/aire.zmvm?branch=master)
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)

![](pano-mxc.jpg)

`aire.zmv` is an R package for downloading air quality data from the
Mexico City metro area. This package can download real-time, daily
maximum, minimum, or hourly average data for each of the pollution
measuring stations or geographical zones in the Zona Metropolitana del
Valle de México (greater Mexico City). It also includes the locations of
all the measuring stations and zones, and a function to perform inverse
distance weighting modified to work with wind direction.

## Installation

You can always install the development version from GitHub:

``` r
if (!require(devtools)) {
    install.packages("devtools")
}
devtools::install_github('diegovalle/aire.zmvm')
```

To install the most recent package version from CRAN type:

``` r
install.packages("aire.zmvm")
library(aire.zmvm)
```

Note that the version on CRAN might not reflect the most recent changes
made to this package.

## Usage

Create a time series of ozone levels in ppb from 2009 to 2018 and
highlight the phase I smog alerts.

``` r
## Auto-install required R packages
if (!require("pacman")) install.packages("pacman")
pacman::p_load(aire.zmvm, dplyr, ggplot2, ggseas)

## download pollution data by station in ppb
o3 <- get_station_data(criterion = "MAXIMOS", # Can be one of MAXIMOS (daily maximum),
                                                # MINIMOS (daily minimum),
                                                # or HORARIOS (hourly average)
                       pollutant = "O3", # Can be one of "SO2", "CO", "NOX", "NO2", "NO", "O3",
                                         # "PM10", "PM25", "WSP", "WDR", "TMP", "RH"
                       year = 2009:2018) # A numeric vector, the earliest year allowed is 1986
# Daily max among all base stations
o3_max <- o3 %>%
  group_by(date) %>%
  summarise(max = ifelse(all(is.na(value)),
                         NA,
                         base::max(value, na.rm = TRUE))) %>%
  na.omit()

# ozone threshold for declaring a 'smog alert' and the dates during which they
# were valid
# source: http://www.aire.cdmx.gob.mx/descargas/ultima-hora/calidad-aire/pcaa/pcaa-modificaciones.pdf
contingencia_levels <- data.frame(ppb = c(216, 210, 205,
                                          199, 185, 155, 155),
  start = c(2009, 2009.4973, 2010.4973, 2011.5795,
            2012.6052,  2016.291, 2016.4986),
  end = c(2009.4973, 2010.4945, 2011.4945,
          2012.6025,    2016.2883, 2016.4959, Inf))
max_daily_df <- tsdf(ts(o3_max$max, start = c(2009,1), frequency = 365.25))

contingencia <- o3_max
contingencia$date <- max_daily_df$x
contingencia$contingencia <- case_when(
  contingencia$date > 2012.6052 & contingencia$max > 185 ~ TRUE,
  contingencia$date > 2016.291 & contingencia$max > 155 ~ TRUE,
  TRUE ~ FALSE
)
```

Here’s what the data we just downloaded looks like:

``` r
knitr::kable(head(o3))
```

| date       | station\_code | pollutant | unit | value |
| :--------- | :------------ | :-------- | :--- | ----: |
| 2009-01-01 | ACO           | O3        | ppb  |    67 |
| 2009-01-02 | ACO           | O3        | ppb  |    71 |
| 2009-01-03 | ACO           | O3        | ppb  |   112 |
| 2009-01-04 | ACO           | O3        | ppb  |    91 |
| 2009-01-05 | ACO           | O3        | ppb  |    70 |
| 2009-01-06 | ACO           | O3        | ppb  |    71 |

``` r
ggplot(max_daily_df,
       aes(x = x, y = y)) +
  geom_line(colour = "grey75", alpha = .5) +
  stat_rollapplyr(width = 30, align = "right", color = "#01C5D2") +
  geom_segment(data = contingencia_levels,
               aes(x=start, y=ppb, xend=end, yend=ppb), color="darkred",
               linetype = 2)  +
  geom_point(data=filter(contingencia, contingencia == TRUE),
             aes(x=date, y=max), color = "#999999",
             size = 2, shape = 21, fill = "firebrick3" ) +
  xlab("date") +
  ylab("parts per billion") +
  scale_x_continuous(breaks = c(2011, 2014, 2017)) +
  ggtitle("Maximum daily ozone concentration and 30 day rolling average",
          subtitle = paste0("Red lines indicate the values necessary to ",
                            "activate a phase I smog alert. \nBlue lines are ",
                            "the 30 day rolling average and red dots indicate ",
                            "when the ozone value exceed the one necessary to ",
                            "declare a pollution alert\nData source: SEDEMA")) +
  theme_bw()
```