text:
# Find Sequences With Point Mutations (SNPs)

Write a Python program called `commoner.py` that takes exactly two positional arguments which should be text files that you will read and find words that are found to be in common. The program should also accept a `-m|--min_len` option (integer) which is the minimum length for a word to be included (so that we can avoid common short words like articles and "I", etc.) as well as a `-n|--hamming_distance` (integer) value that is the maximum allowed Hamming (edit) distance to consider two words to be the same. There should also be two options for debugging, one `-d|--debug` that turns on logging into a `-l|--logfile` option that defaults to `.log`. Lastly, the program should have a `-t|--table` option that indicates the output should be formatted into an ASCII table using the `tabulate` module (https://pypi.org/project/tabulate/); the default output (that is, without `-t`) should be tab-delimited text.

If there are no words found to be in common, print "No words in common." If there are words, print a header line with "word1," "word2", and "distance" as the column names. Then print each of the words, sorted by the pairs, along with their Hamming distances.

If either of the file inputs are not files, exit with an error and appropriate message. You could use the file handle `type` to `argparse` for the two file inputs as the test does not check for a specific error message. You also do not need to log the names of the input files, so there's that.

If the `--distance` is less than 0, exit with an error and message `--distance "{}" must be > 0`.

## Logging

The logging tests do not look for specific messages, only that a non-empty log is created using a given name when `--debug` is present. You can use the same logging code from earlier assignments.

````
$ ./commoner.py
usage: commoner.py [-h] [-m int] [-n int] [-l str] [-d] [-t] FILE FILE
commoner.py: error: the following arguments are required: FILE
$ ./commoner.py -h
usage: commoner.py [-h] [-m int] [-n int] [-l str] [-d] [-t] FILE FILE

Find common words

positional arguments:
  FILE                  Input files

optional arguments:
  -h, --help            show this help message and exit
  -m int, --min_len int
                        Minimum length of words (default: 0)
  -n int, --hamming_distance int
                        Allowed Hamming distance (default: 0)
  -l str, --logfile str
                        Logfile name (default: .log)
  -d, --debug           Debug (default: False)
  -t, --table           Table output (default: False)
$ ./commoner.py data/fox.txt data/fox.txt
word1	word2	distance
brown	brown	0
dog	dog	0
fox	fox	0
jumps	jumps	0
lazy	lazy	0
over	over	0
quick	quick	0
the	the	0
$ ./commoner.py data/fox.txt data/fox.txt -t
+---------+---------+------------+
| word1   | word2   |   distance |
|---------+---------+------------|
| brown   | brown   |          0 |
| dog     | dog     |          0 |
| fox     | fox     |          0 |
| jumps   | jumps   |          0 |
| lazy    | lazy    |          0 |
| over    | over    |          0 |
| quick   | quick   |          0 |
| the     | the     |          0 |
+---------+---------+------------+
$ ./commoner.py -t data/american.txt data/british.txt -m 5 -n 1
+-----------+-----------+------------+
| word1     | word2     |   distance |
|-----------+-----------+------------|
| about     | about     |          0 |
| analyze   | analyse   |          1 |
| faults    | faults    |          0 |
| forgot    | forgot    |          0 |
| generally | generally |          0 |
| improve   | improve   |          0 |
| license   | licence   |          1 |
| merits    | merits    |          0 |
| night     | night     |          0 |
| organize  | organise  |          1 |
| ourselves | ourselves |          0 |
| pretense  | pretence  |          1 |
| recognize | recognise |          1 |
| thoughts  | thoughts  |          0 |
| which     | which     |          0 |
| without   | without   |          0 |
+-----------+-----------+------------+
$ ./commoner.py data/american.txt data/british.txt -m 5 -n 1 | column -t
word1      word2      distance
about      about      0
analyze    analyse    1
faults     faults     0
forgot     forgot     0
generally  generally  0
improve    improve    0
license    licence    1
merits     merits     0
night      night      0
organize   organise   1
ourselves  ourselves  0
pretense   pretence   1
recognize  recognise  1
thoughts   thoughts   0
which      which      0
without    without    0
````

## Testing

This test suite is going to mix unit tests *inside* your `commoner.py` program with integration tests in `test.py`. You will need to copy your `dist` function from `13-hamm` and add this (probably just after the `dist` function):

````
def test_dist():
    """dist ok"""

    tests = [('foo', 'boo', 1), ('foo', 'faa', 2), ('foo', 'foobar', 3),
             ('TAGGGCAATCATCCGAG', 'ACCGTCAGTAATGCTAC',
              9), ('TAGGGCAATCATCCGG', 'ACCGTCAGTAATGCTAC', 10)]

    for s1, s2, n in tests:
        d = dist(s1, s2)
        assert d == n
````

You will also need to define a function `def uniq_words(file, min_len):` that takes a file -- or open file handle! -- and a minimum length. Paste this test below your function definition:

````
def test_uniq_words():
    """Test uniq_words"""

    s1 = '?foo, "bar", FOO: $fa,'
    s2 = '%Apple.; -Pear. ;bANAna!!!'

    assert uniq_words(io.StringIO(s1), 0) == set(['foo', 'bar', 'fa'])

    assert uniq_words(io.StringIO(s1), 3) == set(['foo', 'bar'])

    assert uniq_words(io.StringIO(s2), 0) == set(['apple', 'pear', 'banana'])

    assert uniq_words(io.StringIO(s2), 4) == set(['apple', 'pear', 'banana'])

    assert uniq_words(io.StringIO(s2), 5) == set(['apple', 'banana'])
````

Note that this test is mocking the idea of a file handle; that is, the source for the words will be a file(handle), but for purposes of the test I just want to pass something that can pretend to be a filehandle. Notice how we can use a `for` loop over an `io.String` just like we can an `open` file:

````
>>> import io
>>> file = io.StringIO('foo\nbar baz\nquux!')
>>> for i, line in enumerate(file):
...   print(i, line, end='')
...
0 foo
1 bar baz
2 quux!
````

Lastly define a `def common(words1, words2, distance):` function that takes two lists of words and a maximum Hamming distance and returns a list of tuples containing the two words and the actual distance between the two words if that distance is less than or equal to the maximum allowed. Copy this function just below it.

````
def test_common():
    w1 = ['foo', 'bar', 'quux']
    w2 = ['bar', 'baz', 'faa']

    assert common(w1, w2, 0) == [('bar', 'bar', 0)]

    assert common(w1, w2, 1) == [('bar', 'bar', 0), ('bar', 'baz', 1)]

    assert common(w1, w2, 2) == [('bar', 'bar', 0), ('bar', 'baz', 1),
                                 ('bar', 'faa', 2), ('foo', 'faa', 2)]
````

Once you have written the above functions, I don't think it's helping too much to show you my logic:

````
words1 = uniq_words(fh1, args.min_len)
words2 = uniq_words(fh2, args.min_len)
common_words = common(words1, words2, distance)
````

I think it would help you to think about first getting a unique set of words of the correct length from each file. Then use those words to find the ones in common. Were we not concerned about the Hamming distance, we could use a `set` for the words and do `words1.intersection(words2)`, but we have to instead to a pair-wise comparison of every `word1` to every `word2`! That is most easily accomplished by using `itertools.product`.

## Test Suite

The Makefile's `test` target is `pytest -v commoner.py test.py`. Notice how it's looking in both your `commoner.py` program for `test_` functions as well as the `test.py`. Again, the point here is to build small, testable functions inside your program and integrate the tests directly into the program. Then `test.py` is used to ensure that the *user interface* works; that is, your program generates a usage, it emits error codes on errors, it honors the expected flags and arguments, etc.


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

### Description

In BIG-IP versions 15.0.0-<IP_ADDRESS>, 14.1.0-<IP_ADDRESS>, 13.1.0-<IP_ADDRESS>, 12.1.0-<IP_ADDRESS>, a Cross-Site Scripting (XSS) vulnerability exists in an undisclosed page of the BIG-IP Configuration utility.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/ARPSyndicate/cvemon
- https://github.com/Live-Hack-CVE/CVE-2020-5903
- https://github.com/developer3000S/PoC-in-GitHub
- https://github.com/hectorgie/PoC-in-GitHub
- https://github.com/ltvthang/CVE-2020-5903
- https://github.com/nomi-sec/PoC-in-GitHub
- https://github.com/soosmile/POC

license: MIT

repository: trickest/cve

branch_name: refs/heads/main

extension: md

gha_language: HTML

gha_license_id: MIT

license_type: permissive

repo_name: trickest/cve


text:
# Cats Blender Plugin (0.10.0)

A tool designed to shorten steps needed to import and optimize models into VRChat.
Compatible models are: MMD, XNALara, Mixamo, Source Engine, Unreal Engine, DAZ/Poser, Blender Rigify, Sims 2, Motion Builder, 3DS Max and potentially more

With Cats it takes only a few minutes to upload your model into VRChat.
All the hours long processes of fixing your models are compressed into a few functions!

So if you enjoy how this plugin saves you countless hours of work consider supporting us through Patreon:

[![](https://i.imgur.com/BFIald5.png)](https://www.patreon.com/catsblenderplugin)

Master branch: ![](https://api.travis-ci.org/michaeldegroot/cats-blender-plugin.svg?branch=master)

Development branch: ![](https://api.travis-ci.org/michaeldegroot/cats-blender-plugin.svg?branch=development)

## Features
 - Optimizing model with one click!
 - Creating lip syncing
 - Creating eye tracking
 - Automatic decimation
 - Creating custom models easily
 - Creating texture atlas
 - Creating root bones for Dynamic Bones
 - Optimizing materials
 - Translating shape keys, bones, materials and meshes
 - Merging bone groups to reduce overall bone count
 - Protecting your avatars from game cache ripping
 - Auto updater

*More to come!*

## Website
Check our website to report errors, suggestions or make comments!
https://catsblenderplugin.com

## Requirement

 - Blender 2.79 **(run as administrator)**
   - mmd_tools is **no longer required**! Cats comes pre-installed with it!

## Installation
 - Download the plugin: [Cats Blender Plugin](https://github.com/michaeldegroot/cats-blender-plugin/archive/master.zip)
 - Install the the addon in blender like so:

![](https://i.imgur.com/eZV1zrs.gif)

 - Check your 3d view and there should be a new menu item called **CATS** ....w00t

![](https://i.imgur.com/ItJLtNJ.png)

 - If you need help figuring out how to use the tool:

[![VRChat - Cat's Blender Plugin Overview](https://img.youtube.com/vi/0gu0kEj2xwA/0.jpg)](https://www.youtube.com/watch?v=0gu0kEj2xwA)

[![VRChat - Importing an MMD to VRChat Megatutorial!](https://img.youtube.com/vi/7P0ljQ6hU0A/0.jpg)](https://www.youtube.com/watch?v=7P0ljQ6hU0A)

## Code contributors:
 - Hotox
 - Shotariya
 - Neitri
 - Kiraver

## Model
![](https://i.imgur.com/dYYAfb4.png)

This tries to completely fix your model with one click.

##### Import/Export Model
- Imports a model of the selected type with the optimal settings
- Exports a model as an .fbx with the optimal settings

##### Fix Model
- Fixes your model automatically by:
  - Reparenting bones
  - Removing unnecessary bones
  - Renaming and translating objects and bones
  - Mixing weight paints
  - Rotating the hips
  - Joining meshes
  - Removing rigidbodies, joints and bone groups
  - Removing bone constraints
  - Deleting unused vertex groups
  - Using the correct shading
  - Making it compatible with Full Body Tracking

 **special thanks to @ProfessorSnep#0001, @Mimi#4114, @persia#0123 and @Gallium#7020 <3 <3**

##### Start Pose Mode
- Lets you test how bones will move.

##### Pose to Shape Key
- Saves your current pose as a new shape key.

##### Apply as Rest Pose
- Applies the current pose position as the new rest position

## Model Options

![](https://i.imgur.com/jPcDvaW.png)

##### Translation
- Translate certain entities from any japanese to english.
This uses an internal dictionary and Google Translate.

##### Separate by material / loose parts
- Separates a mesh by materials or loose parts

##### Join meshes
- Joins all meshes together

##### Delete Zero Weight Bones
- Cleans up the bones hierarchy, deleting all bones that don't directly affect any vertices

##### Delete Constraints
- Removes constrains between bones causing specific bone movement as these are not used by VRChat

##### Merge Weights
- Deletes the selected bones and adds their weight to their respective parents

##### Recalculate Normals
- Makes normals point inside of the selected mesh
- Don't use this on good looking meshes as this can screw them up

##### Flip Normals
- Flips the direction of the faces' normals of the selected mesh.

##### Apply Transformations
- Applies the position, rotation and scale to the armature and its meshes.

##### Remove Doubles
- Merges duplicated faces and vertices of the selected meshes.

## Custom Model Creation

![](https://i.imgur.com/epkhkmy.png)
![](https://i.imgur.com/04O63q1.png)

**This makes creating custom avatars a breeze!**

##### Merge Armatures
- Merges the selected armature into the selected base armature.
- **How to use:**
  - Use "Fix Model" on both armatures
    - Select the armature you want to fix in the list above the Fix Model button
    - Ignore the "Bones are missing" warning if one of the armatures is incomplete (e.g hair only)
    - If you don't want to use "Fix Model" make sure that the armature follows the CATS bone structure (https://i.imgur.com/F5KEt0M.png)
    - DO NOT delete any main bones by yourself! CATS will merge them and deletes all unused bones afterwards
  - Move the mesh (and only the mesh!) of the merge armature to the desired position
    - You can use Move, Scale and Rotate
    - CATS will position the bones according to the mesh automatically
    - If you want multiple objects from the same model it is often better to duplicate the armature for each of them and merge them individually
  - Select the base armature and the armature you want to merge into the base armature in the panel
  - If CATS can't detect the bone structure automatically: select a bone you want to attach the new armature to
    - E.g.: For a hair armature select "Head" as the bone
  - Press the "Merge Armatures" button -> Done!

##### Attach Mesh to Armature
- Attaches the selected mesh to the selected armature.
- **How to use:**
  - Move the mesh to the desired position
    - You can use Move, Scale and Rotate
    - INFO: The mesh will only be assigned to the selected bone
    - E.g.: A jacket won't work, because it requires multiple bones.
    - E.g.: A ring on a finger works perfectly, because the ring only needs one bone to move with (the finger bone)
  - Select the base armature and the mesh you want to attach to the base armature in the panel
  - Select the bone you want to attach the mesh to in the panel
  - Press the "Attach Mesh" button -> Done!

##### Support us:
- We worked hard on this feature. If you like it consider supporting us, it helps a lot!

[![](https://i.imgur.com/BFIald5.png)](https://www.patreon.com/catsblenderplugin)

## Decimation

![](https://i.imgur.com/vozxKy9.png)

**Decimate your model automatically.**

##### Save Decimation
- This will only decimate meshes with no shape keys.

##### Half Decimation
- This will only decimate meshes with less than 4 shape keys as those are often not used.

##### Full Decimation
- This will decimate your whole model deleting all shape keys in the process.

##### Custom Decimation
- This will let you choose which meshes and shape keys should not be decimated.

## Eye Tracking
![](https://i.imgur.com/yw8INDO.png)
![](https://i.imgur.com/VHw73zM.png)

**Eye tracking is used to artificially track someone when they come close to you.**
It's a good idea to check the eye movement in the testing tab after this operation to check the validity of the automatic eye tracking creation.

##### Disable Eye Blinking
- Disables eye blinking. Useful if you only want eye movement.

##### Disable Eye Movement
- Disables eye movement. Useful if you only want blinking. **IMPORTANT:** Do your decimation first if you check this!

##### Eye Movement Speed
- Configure eye movement speed

## Visemes (Lip Sync)
![](https://i.imgur.com/muM2PTS.png)

**Mouth visemes are used to show more realistic mouth movement in-game when talking over the microphone.**
The script generates 15 shape keys from the 3 shape keys you specified. It uses the mouth visemes A, OH and CH to generate this output.

## Bone parenting

![](https://i.imgur.com/mgadT4R.png)

**Useful for Dynamic Bones where it is ideal to have one root bone full of child bones.**
This works by checking all bones and trying to figure out if they can be grouped together, which will appear in a list for you to choose from. After satisfied with the selection of this group you can then press 'Parent bones' and the child bones will be parented to a new bone named RootBone_xyz

##### To parent
- List of bones that look like they could be parented together to a root bone. Select a group of bones from the list and press "Parent bones"

##### Refresh list
- Clears the group bones list cache and rebuild it, useful if bones have changed or your model

##### Parent bones
- Starts the parent process

## Texture atlas
![](https://i.imgur.com/F8nlBlI.png)

**Texture atlas is the process of combining multiple textures into one to save processing power to render one's model**
If you are unsure about what to do with the margin and angle setting, then leave it default. The most important setting here is texture size and target mesh.

##### Target mesh
The mesh that you want to create an atlas from

##### Texture size
Lower for faster bake time, higher for more detail.

##### Margin
Margin to reduce bleed of adjacent islands

##### Angle
Lower for more projection groups, higher for less distortion

##### Area Weight
Weight projections vector by faces with larger areas

##### One Texture Material
Texture baking and multiple textures per material can look weird in the end result. Check this box if you are experiencing this.
**If any experienced Blender user can tell me how to fix this more elegantly please do let us know!**

## Bone merging

![](https://i.imgur.com/FXwOvho.png)

**Lets you reduce overall bone count in a group set of bones.**
This works by checking all bones and trying to figure out if they can be grouped together, which will appear in a list for you to choose from. After satisfied with the selection of this group you can then set a percentage value how much bones you would like to merge together in itself and press 'Merge bones'

##### Refresh list
- Clears the group bones list cache and rebuild it, useful if bones have changed or your model

##### Merge bones
- Starts the merge process

## Copy Protection

![](https://i.imgur.com/5qP5bCT.png)

**Can protect your avatars from being ripped from the game cache.**
Game cache rips in most common cases do not include blendshapes and shaders.
This method will make it much harder for people that try to steal your avatar through ripping from cache.

**We managed to fix the lighting bugs! Therefore the randomization options are not needed anymore.**

#### How to setup:

1. Do all the modifications to your model in Blender before you follow the next steps!
   This option should be the last one you do in Blender before exporting!
2. You won't be able to see the mesh of your model inside the Unity bone mapping screen (it will be garbled mess, but only in there).
   Because of that, if you need to actually see your models mesh (e.g. for straightening the fingers for VR), follow the extra steps below.
   If you don't need to see the mesh (e.g. for unassigning the jaw bone) skip to step 2.
     - Export your model from Blender without enabling the protection
     - Load it up in Unity and configure it in the bone mapping screen and press "Done"
     - In Blender: Click the "Enable Protection" button and export your model
     - Then, except for just dragging the fbx into Unity, you need to go into the folder where this Unity project is located
       and then replace the unprotected fbx with the protected one.
       That way your configurations will be kept.
     - Skip to step 5
3. In Blender: Click the "Enable Protection" button
4. Export it to Unity by either using the "Export" button within Cats or set the fbx export option by yourself:
   Geometries > Smoothing > Set to "Face"
5. In Unity: Set the value of the blendshape 'Basis Original' to 100 like so:
   https://i.imgur.com/RlrGTvV.gif
6. To fix any lighting issues select your .fbx and then select "Import" as the Tangents option here:

   ![](https://i.imgur.com/SqynQzw.png)
7. Because (for some odd reason) the protection increases your bounding box it could be too big to upload your model.
   If the VRCSDK complains about your model being too large, edit your bounding box back to normal here:
   (this option is below the blendshape list from above)

   ![](https://i.imgur.com/4NrfVOr.png)
8.

People that try to steal your avatar will then only see a box of mangled waifu trash instead of your original character.

  **special thanks to @zarniwoop#6081**

## Shape Key

![](https://i.imgur.com/LgFK4KO.png)

**Apply Shape Key as Basis**
- Applies the selected shape key as the new Basis and creates a reverted shape key from the selected one.

## Update Plugin

![](https://i.imgur.com/ltcTRlR.png)

**This plugin has an auto updater.**
It checks for a new version automatically once every day.

## Changelog

#### 0.10.0
- **Translations:**
  - Greatly improved translations by using a new internal dictionary
    - Much better shape key translation
    - Example: No more Ah, Your and There but Ah, Oh and Ch
  - Greatly improved translation speed by storing the google translations locally
    - This local google dictionary gets reset every 30 days to stay updated with new translations
  - Added "Translate Everything" button
  - No longer removes rigidbodies and joints
    - Only Fix Model removes them now
- **Model:**
  - Join meshes now applies all transforms
  - Added new Apply Transforms button
  - Added new Remove Doubles button
    - More precise than doing it manually but removes less vertices overall
    - A little extra button at the end lets you remove doubles like you would do manually
  - Fixed files with capital letters in the file extension not importing correctly
  - Fixed "Separate by Loose Parts" creating multiple extremely small meshes
    - This makes "Separate by Loose Parts" actually useful and not a laggy mess
- **Visemes:**
  - Shape Keys Mix Intensity slider is back
  - Increased the range of the intensity slider
- **Shapekeys:**
  - Greatly improved "Apply Shapekey as Basis"
  - Shape keys added to the Basis can be reverted now
- **Credits:**
  - Added a patchnotes button
- **General:**
  - Slightly reduced startup time
  - Updated mmd_tools
  - Fixed some typos
  - Fixed multiple bugs

#### 0.9.0
- **Model:**
  - Added a new "Apply as Rest Pose" button
    - This will apply the current pose position as the new rest position
  - Added a new "Join Selected Meshes" button
  - Fix Model now combines similar materials (toggleable)
    - This automatically increases the performance for most models
  - Moved the Fix Model options into a new settings dialog
    - Open this by clicking the wrench icon next to the Fix Model button
  - Import Model now can import all the models with one button
  - Added option to Keep End Bones
  - Improved support for Source Engine models
  - Backface culling is now deactivated again
  - Fixed random important bones disappearing for no reason
- **Translation:**
  - Fixed the SSL error
    - This fixes a lot of instances where translations would not work
- **Custom Model:**
  - Greatly improved the combine process and drastically reduced the amount of errors
    - Armature transform getting reset is now very rare
    - Much more user friendly
  - Improved tolerances to allow minimal armature rotations
  - Getting an error while attaching a mesh doesn't create a new armature anymore
  - Error messages are now much more persistent
- **Shapekeys:**
  - Fixed "Apply Shapekey as Basis" not setting the basis for newly created shape keys
- **General**
  - Various optimizations
  - Improved error messages
  - Fixed bugs all over the place

#### 0.8.1
- **Model:**
  - Now straightens up the head bone
  - Fixed bone morphs not converting correctly
  - Fixed bones rotating the mesh twice as far
  - Fixed eye rotation testing no longer working after changing the eye movement scale
  - Fixed some shading issues after fixing the model
- **General:**
  - Updated mmd_tools

Read the full changelog [here](https://github.com/michaeldegroot/cats-blender-plugin/releases).

## Roadmap
 - MOAR updates on the armature code
 - Texture translation should have an option to rename the filename also
 - Automatic lower lid creation for eye tracking
 - Manual bone selection button for root bones
 - Full body tracking proportion adjustments

## Feedback
Do you love this plugin or have you found a bug?
Post a response in this thread or send your feedback to the official discord server of the plugin for real-time communication: https://discord.gg/f8yZGnv and look for people with the developer role ;)

## Support us
If you enjoy how this plugin saves you countless hours of work consider supporting us through Patreon:

[![](https://i.imgur.com/BFIald5.png)](https://www.patreon.com/catsblenderplugin)

repository: RoxyBoxxy/cats-blender-plugin

branch_name: refs/heads/master

repo_name: RoxyBoxxy/cats-blender-plugin


text:
simple_memcache_client
======================

a really simple memcache client to play with socket and threading pool

## Installation

Add this line to your application's Gemfile:

    gem 'simple_memcache_client'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install simple_memcache_client

## Usage

You just need instanciate a client and you can do get and set.

```
require 'simple_memcache_client'

client = SimpleMemcacheClient.new('localhost')
client.set('foo', 'bar', 1)
client.set('bar', 'baz')
puts client.get('foo')
puts client.get('bar')
client.close
```

You can define a pool of socket you want.

```
require 'simple_memcache_client'

client = SimpleMemcacheClient.new('localhost', 11211, 10)
500.times do |i|
  threads << Thread.new do
    client.set('foo', 'bar', 1)
    client.set('bar', 'baz')
    puts client.get('foo')
    puts client.get('bar')
  end
end
client.close
```

Only 10 sockets are connect to memecached

## Test

There are some test attach to this project. You can launch it by

```
rake spec
```

## Contributing

1. Fork it ( http://github.com/<my-github-username>/simple_memcache_client/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
# node-examples

##Installation
To run these examples, you will first need to install [node.js](https://nodejs.org/download/) on your laptop or server.  You will also need mongo installed on your machine.  (You can alternatively access a mongo database somewhere on your network, but in that case you'll need to modify the config.js file accordingly).

Next, clone the repository into a directory on your server, change into that directory, and run

```js
git clone https://github.com/davehorton/node-examples.git
cd node-examples
npm install
```

at that point you can run the application by doing:

```js
DEBUG=* node app.js
```
> Note: the 'DEBUG=*' is not necessary, but will print out debug messages from the various modules that are used, as well as any debug messages that you may add to the code.  Some of these messages might give you a better understanding/visualization of how the middleware is processing your request, thus I recommend it for this example.

## Structure of the demo

This is a simple demo that consists of two mongo collections: a Users collection and Greetings collections.  Users have one or more Greetings, and Greetings represent audio files that are played from the User's voicemail service.  When saving a Greeting, we need to not only update the database, but also transcode the provided audio file and store it in a folder somewhere.

> This is a simple example with many shortcuts; for instance, we transcode to gsm format for no particular reason other than to be able to invoke the sox utility, and we also store the audio files on local disk whereas in a production app we would probably want to store them in shared, redundant, and network-accessible storage of some kind.

## Quick overview of the code structure

app.js in the root directory is the main file that kicks everything off.  We'll come back to that file later, and take a more detailed look but it basically connects to mongo and configures express, which is the middleware framework used to handle the HTTP requests. Don't worry about understanding everything it does at this point, though.

In the lib/models directory we have files that each map to a collection in the mongo database (except for index.js).  Have a look at user.js and greeting.js -- they will be pretty easy to understand.  The index.js file exists just so that you can add files to this directory as you create new models in the database and they are automatically made available to the rest of the code.

Somewhat similarly, in the lib/routes directory we have a set of HTTP routes and associated logic (and an index.js file to make it easy to bring them all into the app, and let you add new routes easily).  Have a look at ./lib/routes/user.js, as it is pretty easy to understand.  You can quickly get the sense that here we have the logic to respond to REST requests for the User resouce: HTTP GET, POST, PUT, and DELETE are all handled here.  You'll see the code is very simple, and there isn't a lot of it.

## Simple asynchronous behavior

Let's keep looking at ./lib/routes/user.js.  It provides a good example of the basic asynchronous programming pattern.  In this case, we are going to retrieve, insert, update or delete Users in the mongo database, and we don't want the node.js event thread blocked while we are waiting for mongo to respond to our requests.

So if you look at how we retrieve a user from the database (in response to an HTTP GET request), the code looks like this:

```js
// lib/routes/user.js

//retrieve a user by id
router.get('/user/:id', function(req, res, next){
  User.findById( req.params.id, function(err, user){
    if( err ) return next(err) ;
    res.json(user) ;
  }) ;
}) ;
```

First of all, notice that the code is pretty simple.  A few lines of code to provide part of a REST API for retrieving a resource.

Second, notice the asynchronous pattern: we make an asychronous request (User.findById), and provide a callback function to be invoked when that request is completed.  In between the invocation of the request and its completion, we are not blocking waiting for it and instead node.js is handling other requests.  Our callback is invoked by nodejs when the results are available.

The signature of the callback function is pretty standard: by convention, the first argument is always an error object (a null value, if no error has occurred), followed by any data returned from the operation.

Stepping back a bit further, the 'router.get' method is [expressjs](http://expressjs.com) middleware framework for managing HTTP requests.  We define 'routes', which are HTTP URL patterns (they can be simple, as in this example, or more complex regex patterns) and associate the code we want invoked when we receive a request on that route.

Our route callback (function(req,res,next)) is passed a 'req' object that represents the HTTP request (we can access this to get things like query args, headers, etc), a 'res' object that represents the HTTP response we will generate (we can access this to send our response, set an HTTP status code, attach headers to the response object, etc), and a 'next' function.

The 'next' function is provided because express middleware can be arranged in a sort of filter chain, where each middleware in the chain can choose to either:

+ do nothing, and pass control to the next middleware (by invoking the 'next()' function),
+ generate a response to the request (in which case the response stops propagating up the middleware chain), or
+ generate an error, and punt the error up the chain to be dealt with by a special middleware error handler (by invoking 'next(error)').

In the case above, as long as there was no error retrieving the user, we are generating a response to the request where the response will consist of a JSON document (returned in an HTTP 200 OK).

Also note that the route contains a template parameter, :id, which represents a user id passed in the uri (i.e. the actual HTTP request would look something like HTTP GET /user/5515ec8b7e3e7fb73dbc44d9, where the '5515ec8b7e3e7fb73dbc44d9' represents the _id field in the mongo User collection).  The template parameters we put in the route pattern are available to use in the req.params object, as shown above

## Time to have fun

So let's fire up this app and add some data.

### Adding a user

Since we don't have a GUI built, we'll use curl to exercise the API.

In one terminal window, start the application (DEBUG=* node app.js) -- by default, it will create an HTTP server listening on port 3000.  In a second terminal window, do the following:

```bash
 curl -H "Content-Type: application/json" -d '{"username":"xyz","password":"xyz", "first_name":"Dave", "last_name": "Horton", "token":"1234567890"}' http://localhost:3000/user
```

If the user is successfully added, our service will respond with the added user object:

```bash
{"__v":0,"username":"xyz","password":"xyz","first_name":"Dave","last_name":"Horton","token":"1234567890","_id":"55160819a26a6c27419d3920","date_created":"2015-03-28T01:47:05.185Z","greeting_ids":[]}
```

Note that it has assigned a unique id in the User collection in mongo (the '_id' property), initialized it with an empty set of greetings, and defaulted the 'date_created' property to the current time.

### Retrieving a user

Now that we have a user in our database, let's turn around and retrieve a list of users:

```bash
$curl --request GET http://localhost:3000/users
[{
    "_id":"55160819a26a6c27419d3920",
    "username":"xyz",
    "password":"xyz",
    "first_name":"Dave",
    "last_name":"Horton",
    "token":"1234567890",
    "__v":0,
    "date_created":"2015-03-28T01:47:05.185Z",
    "greeting_ids":[]
}]
```
> Note: if you are following along with these operations on your own machine, you will get different mongo id values, and will need to substitute your ids in at the appropriate places in the operations that follow.

> Also, for readability sake I have formatted the JSON output from the response a bit above with line breaks and indentation; you won't see those in the actual responses that are returned in your terminal session.

That query retrieved a list of all users -- of which there is currently only one.  If we want to retrieve a user by id, we can do that because we added a route specifically for that in lib/routes/user.js:

```bash
$curl --request GET http://localhost:3000/user/55160819a26a6c27419d3920

{"_id":"55160819a26a6c27419d3920","username":"xyz","password":"xyz","first_name":"Dave","last_name":"Horton","token":"1234567890","__v":0,"date_created":"2015-03-28T01:47:05.185Z","greeting_ids":[]}
```

Let's add a second user:

```bash
$curl -H "Content-Type: application/json" -d '{"username":"abc","password":"abc","first_name":"Ed", "last_name": "Robbins", "token":"foobar"}' http://localhost:3000/user

{"__v":0,"username":"abc","password":"abc","first_name":"Ed","last_name":"Robbins","token":"foobar","_id":"55160d30f43e193542fb0019","date_created":"2015-03-28T02:08:48.301Z","greeting_ids":[]}
```

Now let's query by first name

```bash
$curl --request GET http://localhost:3000/users?first_name=Ed

[{"_id":"55160d30f43e193542fb0019","username":"abc","password":"abc","first_name":"Ed","last_name":"Robbins","token":"foobar","__v":0,"date_created":"2015-03-28T02:08:48.301Z","greeting_ids":[]}]
```

In that scenario were were using the route which is defined to have optional query args:

```js
// lib/routes/user.js

//retrieve users, optionally with query
router.get('/users?*', function getAll(req, res, next) {
  User.find(req.query, function (err, users) {
    if (err) return next(err);
    res.json( users );
  });
});
```

The 'req.query' property is an object which contains key-value pairs for the query args provided in the URI.  In this case, we can simply pass those query args directly into our mongo query to further filter the results.

Now lets delete Ed:

```bash
$curl -X DELETE http://localhost:3000/user/55160d30f43e193542fb0019

{"_id":"55160d30f43e193542fb0019","username":"abc","password":"abc","first_name":"Ed","last_name":"Robbins","token":"foobar","__v":0,"date_created":"2015-03-28T02:08:48.301Z","greeting_ids":[]}
```
Our REST API for deleting a User removes the user from mongo and returns us the deleted user.  If we query for users with first name 'Ed' now, we'll see there aren't any.

Let's update our existing Dave user, and give him a new password:

```bash
$curl -H 'Content-Type: application/json' -X PUT -d '{"password":"aaa"}' http://localhost:3000/user/55160819a26a6c27419d3920

{"_id":"55160819a26a6c27419d3920","username":"xyz","password":"aaa","first_name":"Dave","last_name":"Horton","token":"1234567890","__v":0,"date_created":"2015-03-28T01:47:05.185Z","greeting_ids":[]}
```

## More complex asynchronous behavior

Now, I grant you, the examples above were simple.  Asynchronous programming can become more complex when you have multiple asynchronous operations that are interdependent and concurrent.  However, that is where the [async](https://github.com/caolan/async) library can be a big help.

Let's turn to look at lib/routes/greeting.js, where things get a bit more complicated.  Now, when a user wants to add a greeting, we need to do several things:

1. Update the database with the new greeting (add it to the Greeting collection, and also add a reference to that greeting in the User's list of greetings)

2. Upload the audio file to the server

3. Transcode the audio file (in this case, we are going to arbitrarily transcode it to gsm format).

4. Save the transcoded file in a folder somewhere, and make sure the database entry has the name of that location.

Furthermore, want to do some of that in parallel -- we should be able to start the transcoding operation and the database insert at the same time, since they don't depend on each other.  The transcoding is going to be the lengthiest part of the operation, so there is no reason to delay starting it while we wait for a database insert to complete.

Most importantly, we don't want to block the nodejs event loop while the expensive transcoding operation is going on: we'll fork a new process for that, and be notified asynchronously when it is complete.

So, with those requirements, here is the code that does it:

```js
// lib/routes/greeting.js

router.post('/user/:id/greeting', function( req, res, next){
    var name = req.body.name;
    var file = req.files.greeting ;

    //generate a timestamped file name for the stored greeting
    var originalName = req.files.greeting.originalname ;
    var filename = originalName.slice(0, originalName.lastIndexOf('.')) +
        '-' + moment.utc().format('YYYYMMDDHHmmssSSS') + '.gsm' ;
    var newFilename = path.join( greetingPath, filename) ;

    //update the database and do the transcoding in parallel
    async.parallel([
            function updateDatabase( callback ) {
                var greeting = new Greeting({
                    name: name,
                    folder_location: newFilename
                }) ;

                //save the greeting...
                greeting.save( function(err, greeting){
                    if( err ) return callback(err) ;

                    //..and add it to the User's array of greetings
                    User.findByIdAndUpdate( req.params.id,
                        {$push: {greeting_ids: greeting._id}},
                        function(err, user){
                            callback(err, user) ;
                    }) ;
                }) ;
            },
            function transcodeGreeting( callback ) {
                //create the file...
                fs.open( newFilename, 'w', function(err){
                    if( err ) return next(err) ;

                    //..and have sox transcode into it to gsm
                    execFile('sox', [req.files.greeting.path, '-t', 'gsm', '-r', '8k', newFilename], function(err) {
                        callback(err) ;
                     }) ;
                }) ;
            }
        ], function(err, results){
            //when we get here, both operations have completed
            if( err ) return next( err ) ;
            res.json(results[0]) ; //return the user
    }) ;
});
```
Before we try it out, notice a couple of things:

+ We're handling a multi-part body in a POST request.  The POST body has been nicely parsed for us into a javascript object that represents the data provided in the provided form variables (remember: the POST request contained the data in url-encoded strings, but we get to access them easily as properties in the 'req.body' object).  We got that done for us for free by the [multer](https://github.com/expressjs/multer) middleware we included in the main app.js file.

+ The uploaded file has been automatically saved in a temp directory and made available to us with information including the original filename and so forth.

+ The 'updateDatabase' and 'transcodeGreeting' functions happen in parallel, and both are asynchronous (i.e. neither blocks the nodejs event thread).  This is what makes nodejs scale so well -- every I/O operation (network or local) is asynchronous, freeing nodejs to service other requests.

OK, let's try it out, using a PCMU wave file that is four minutes long.

```bash
$curl -F "name=primary_greeting" -F<EMAIL_ADDRESS>http://localhost:3000/user/55160819a26a6c27419d3920/greeting

{"_id":"55160819a26a6c27419d3920","username":"xyz","password":"aaa","first_name":"Dave","last_name":"Horton","token":"1234567890","__v":0,"date_created":"2015-03-28T01:47:05.185Z","greeting_ids":["551613e5f43e193542fb001a"]}
```
If we switch back to the console that node.js is running in, we can see from the DEBUG logging that the operation took a little under 900 milliseconds.  Not bad, considering almost all of that was the time for the external 'sox' utility to do the transcoding.

```bash
POST /user/55160819a26a6c27419d3920/greeting 200 869.691 ms - 224
```
Let's make sure the database has been properly updated, by querying that user and retrieving his greetings:

```bash
$curl --request GET http://localhost:3000/user/55160819a26a6c27419d3920/greetings

[{"_id":"551613e5f43e193542fb001a",
    "name":"primary_greeting",
    "folder_location":"/Users/dhorton/beachdog-enterprises/beachdog-networks/git/node-examples/recordings/transcoded/long_moh_clip-20150328023725543.gsm",
    "__v":0,
    "date_created":"2015-03-28T02:37:25.545Z"
}]
```
Great.  We have the audio file location in the database, associated with the user, and if we check that location we can see the file is there and has been transcoded into gsm.

## Authentication

Our REST API might be used from a web GUI, where a user would authenticate with a username and password, or perhaps we might want to expose it to API users, who would authenticate using something like OAuth and a token of some kind.

Nodejs and express middleware lend themselves nicely to managing authentication, because we can simply create some middleware that gets executed early in the middleware stack that will either authenticate the user, or return a 401 Unauthorized.

Let's create a simple REST resource that we intend to expose to API users, and protect it with Bearer authentication in the Authorization header.

### Passport middleware

[Passport](http://passportjs.org/) is a nodejs module that provides a very flexible authentication handling.  First, we include in in our app.js, and the put it into our middleware stack.

```js
var passport = require('passport') ;
var tokenAuth = require('./lib/middleware/authentication') ;

....

passport.use( tokenAuth ) ;

//common middleware we want to apply to all requests
app.use(logger('dev'));
app.use('/api', passport.initialize());

```

First we require'd the module, to make it available.  Then we called 'passport.use' and passed in our own bit of code that is needed to determine whether the API user passed in a valid token.

Next, we included passport in our middleware stack (i.e. app.use).  Note, however, that we are only including this middleware for uri requests that begin with '/api'.  That is because for GUI users we use a different form of authentication (username/password authentication).  We only want to use this token-based authentication for API users.

OK, now we need to write the code that will determine whether a valid token has been provided in the Authorization header.  In the case of our simple demo, we have a 'token' property in our User collection that we will use for this, so our function looks like this:

```js
//  lib/middleware/authentication.js

var mongoose = require('mongoose');
var passport = require('passport') ;
var BearerStrategy = require('passport-http-bearer').Strategy;
var models = require('../models') ;
var User = mongoose.model('User');
var debug = require('debug')('node-examples') ;

module.exports = new BearerStrategy({}, function(token, done) {
    debug('attempting to retrieve user with token: %s', token) ;
    User.findByToken( token, function(err, user){
        if( err ) return done( err ) ;
        if( !user ) return done( null, false) ;
        debug('found a user: ', user) ;
        return done( null, user ) ;
    });
}) ;
```

Pretty straightforward.  We are passed the token that Passport scarfed out for us, and we do a look up in the User collection by the token to see if we can find a user associated with that token.

But wait! Where did that 'User.findByToken' function come from?

That is a static method that we added to the User schema via mongoose in lib/models/user.js:

```js
// lib/models/user.js

//create a User.findByToken method
schema.statics.findByToken = function (token, cb) {
  this.findOne({ token: token }, cb);
```

Mongoose has the nice feature of allowing us to add static or instance methods to collections and documents.

Now, finally, let's put up an API endpoint.

```js
//  lib/routes/api.js

//retrieve user, optionally with query
router.get('/users?*',
    passport.authenticate('bearer', { session: false }), //middleware - api requires authentication
    function (req, res, next) {

        // if we get here, the request was authenticated
        User.find(req.query, function (err, users) {
            if (err) return next(err);
            res.json( users );
        });
});
```
Note the difference from our earlier routes.  After we provide the uri pattern to match, we provide a middleware function that will be called before our route logic.  We tell passport to protect our endpoint by authenticating using the Bearer method.  This is what will call our authentication middleware, and if the token is not valid a 401 Unauthorized will be returned and our API endpoint logic will not be called.

Let's test it out: first, using an invalid token:

```js
$curl --header "authorization: Bearer 123456789" --include --request GET http://localhost:3000/api/users

HTTP/1.1 401 Unauthorized
X-Powered-By: Express
WWW-Authenticate: Bearer realm="Users", error="invalid_token"
Date: Sat, 28 Mar 2015 02:50:11 GMT
Connection: keep-alive
Transfer-Encoding: chunked
```

OK, now using a valid token:

```js
$curl --header "authorization: Bearer<PHONE_NUMBER>" --include --request GET http://localhost:3000/api/users
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 528
ETag: W/"210-1396e08a"
Date: Sat, 28 Mar 2015 03:07:43 GMT
Connection: keep-alive

[{"_id":"5515ec8b7e3e7fb73dbc44d9","__v":0,"date_created":"2015-03-27T23:49:31.883Z","greeting_ids":[]},{"_id":"5515ec9e7e3e7fb73dbc44da","username":"xyz","password":"xyz","first_name":"Dave","last_name":"Horton","token":"1234567890","__v":0,"date_created":"2015-03-27T23:49:50.307Z","greeting_ids":[]},{"_id":"55160819a26a6c27419d3920","username":"xyz","password":"aaa","first_name":"Dave","last_name":"Horton","token":"1234567890","__v":0,"date_created":"2015-03-28T01:47:05.185Z","greeting_ids":["551613e5f43e193542fb001a"]}]
```

It worked!

## Benchmarks

Let's see how our greeting upload REST API does with a little load thrown at it.  For this test, we'll use a shorter 10-second greeting prompt that we want to upload, transcode, and store.  Let's see how fast nodejs/express handle a single POST first:

```js
 curl -F "name=primary_greeting" -F<EMAIL_ADDRESS>http://localhost:3000/user/55188d0de8c91bf87f02d998/greeting

{"__v":0,"name":"primary_greeting","folder_location":"/Users/dhorton/beachdog-enterprises/beachdog-networks/git/node-examples/recordings/transcoded/conf_welcome-20150329235345344.gsm","_id":"55189089b7d19fca88fe5bc6","date_created":"2015-03-29T23:53:45.344Z"}
```

Looking in our other terminal window, we can see that it took 52 milliseconds.  Again, much of that time would be the transcoding operation that is taking place outside of nodejs.
```js
POST /user/55188d0de8c91bf87f02d998/greeting 200 52.970 ms - 259
```

The 52 ms seems reasonable, given the fact we have a transcoding operation taking up much of that.  But what happens when we throw multiple transactions at the server at the same time -- do response times rapidly increase, or are we able to hold in that neighborhood for some level of requests per second.

To find out, kill the 'node' process that is running (if any), change into the 'benchmarking' folder, and run the 'make' command.  This will use apache benchmark to throw 1,000 greeting upload requests at the server from 4 client threads simultaneously.  It will be uploading the same 10-second conference greeting that we just tested with.

> Note: each time the benchmark runs it drops the existing data from the User and Greeting collections before running the test in order to have a clean start. If you added test data beforehand, it will be gone after running the benchmarks.

```js
cd benchmarks/
make
```

The benchmark will run and then print out the results.  On my MacBook Pro, we got the following:
```js
Time taken for tests:   10.480 seconds
Complete requests:      1000
Failed requests:        0
Requests per second:    95.42 [#/sec] (mean)
Time per request:       52.402 [ms] (mean)

Percentage of the requests served within a certain time (ms)
  50%     51
  66%     53
  75%     55
  80%     56
  90%     61
  95%     66
  98%     76
  99%     85
 100%    126 (longest request)
 ```
Looks good! -- the mean response time was 51.55 ms; no appreciable change from a single request. We handled 95 requests per second, and the scatter chart showing the variations in response times is not large -- 95% of all responses received in 66 ms or less.

## For more information

+ [nodejs](https://nodejs.org/api/)
+ [express](http://expressjs.com/)
+ [async](https://github.com/caolan/async)
+ [mongoose](http://mongoosejs.com/)
+ [expressjs Router tutorial](https://scotch.io/tutorials/learn-to-use-the-new-router-in-expressjs-4)
+ [multer multipart/form-data handling](https://github.com/expressjs/multer)

repository: davehorton/node-examples

repo_name: davehorton/node-examples


text:
## GitBlog - 1

### Adding files
* add files to git with a specific extension
```bash
# adding .py files
git add *.py
```

* if the files are inside a directory

```bash
git add models/\*.py

# or simply

git add models/*.py
```
### Removing files with clean
* remove all files that are not tracked by git
```bash
# If you want to see which untracked files will be removed before removing then you can run this command.

git clean -dn

# remove files by
git clean -df
```
### Removing files with rm
* to delete your tracked files
```bash
git rm <file-path>

# if file is in staging area
git rm <file-path> -f
```

* to delete file from git repository but not from the file system

```bash
git rm --cached <file-path>
```

## Working with branches
You can create a branch locally as long as you have a cloned version of the repo.

* From your terminal window, list the branches on your repository.
```bash
git branch

* master
 ```
This output indicates there is a single branch, the `master` and the `asterisk` indicates it is currently active.

* Create a new `feature branch` in the repository

```bash
git branch <feature_branch>
```

* Switch to the `feature branch` to work on it.

```bash
git checkout <feature_branch>
# You can list the branches again with the git branch command.
```

* Commit the change to the `feature branch`:
```bash
git add .
git commit -m "adding a change from the feature branch"
```

* Switch back to the `master branch`.
```bash
git checkout master
```

* Push the `feature branch`:
```bash
$ git push origin <feature_branch>
```

### Altering branch name
* alter current branch name
```bash
git branch -m <new-branch-name>
```

* alter given branch name
```bash
git branch -m <old-branch-name> <new-branch-name>
```

*Note* : If you’ve already pushed the `branch` with old name, then there are a couple of extra steps required. You need to delete the `old branch` from the `remote` and push up the new one.

```bash
git push <remote-name> --delete <old-branch-name>

# change the name of the branch
git branch -m <new-branch-name>

# push changes
git push <remote-name> <new-branch-name>

# if local branch name doesn’t match with the name of remote repository branch name, then

git push <remote-name> <local-branch-name>:<remote-branch-name>
```

repository: rusty-electron/snippet-blog

path: /1. DEC18/gitblog-1.md

repo_name: rusty-electron/snippet-blog


text:
# aml-comments
Extension of the [2017 AgreementMakerLight](https://github.com/AgreementMakerLight/AML-Project) ontology alignment system that considers entity comments.

This variant of AML is intended to be used in situations where more than one target entity may be related to a single entity in the source ontology.

To leverage comments in the matching process, we modified the AML Lexicon to store comments in addition to entity labels. We then created a CommentMatcher class. The match method in this class iterates through all of the comments in the source ontology and identifies entities in the target ontology whose names are mentioned in the comment. Relationship strength is based on the number of words in common between the comment and the entity name, divided by the number of words in the comment.

Other changes that were made include:

Changed the GUI code to allow thresholds as low as 0.0

Modified those matchers that only add a relation between x and y to the alignment if neither x nor y are already involved in a mapping with higher similarity. The string and neighborhood similarity matchers were the only ones that fell into this category. For the string matcher, blocks beginning at lines 111, 174, 186 and 213 were commented out, while for the neighborhood similarity matcher the comments began at lines 85 and 98.

Changed ManualMatcher.java so that all matches are always added, when hierarchical mode is in use, rather than limiting the alignment to 1-to-1 (lines 85, 97, 108, and 117)

Commented out the filtering and repair functionality in ManualMatcher.java (lines 123-157)

Added a method called saveAll to Alignment.java that allows us to save AML output in the format needed for the evaluation of complex correspondences and made this available through the GUI by modifying AMLMenuBar.java at line 36 and AlignmentFileChooser.java

repository: mcheatham/aml-comments

repo_name: mcheatham/aml-comments


text:
# hackrf_sna

[![CMake](https://github.com/Netdex/hackrf_sna/workflows/CMake/badge.svg)](https://github.com/Netdex/hackrf_sna/actions?query=workflow%3ACMake)

`This project is a work-in-progress.`

Scalar network analyzer using a mix and match of the following components:
- HackRF
- RTL2832 based receiver
- Directional coupler/RF bridge/return loss bridge
- Noise source
- Signal generator (HackRF/rpitx)

To get phase information you would need a full-duplex transceiver or another HackRF (and tie their clocks together).
I have none of those, so I'll leave that for the future.

## Road map
- Spectrum analyzer
    - RTL2832/HackRF
- Filter/amp analysis (two-port)
- VSWR/return loss analysis (multi-port)

- Scalar network analysis
    - Noise source reference
        - Noise generator -> DUT -> HackRF/RTL2832
    - Tracking generator reference
        - HackRF/rpitx/... -> DUT -> HackRF/RTL2832

- Antenna analysis using RF Bridge/return loss bridge/directional coupler

## Known Issues
### Debug build crashes on startup
SoapySDR has ABI incompatibility on Windows between Debug and Release builds.
Since your PothosSDR release was probably built in Release mode, you must
build this project with RelWithDebInfo or Release modes, or build SoapySDR in
Debug mode.

### Program crashes intermittently during device enumeration
It seems like [at least one of the SoapySDR modules is
buggy](https://github.com/pothosware/SoapyRTLSDR/issues/38). My guess is that
there is some contention with LibUSB between multiple support modules. A
stopgap measure is to disable all modules you do not need, you can do this on
Windows by going to `C:\Program Files\PothosSDR\lib\SoapySDR\modules0.8` and
deleting/moving DLLs which are not necessary for your setup.

## Build
This project requires
[PothosSDR](https://github.com/pothosware/PothosCore/wiki/Downloads)
installed on your machine, which provides support libraries for various SDR
hardware and SoapySDR. For the exact list of dependencies required, see the
[CI
configuration](https://github.com/Netdex/hackrf_sna/blob/master/.github/workflows/cmake.yml).

To build, execute the following commands:
```bash
git clone --recurse-submodules https://github.com/netdex/hackrf_sna.git
cd hackrf_sna
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release -j $(nproc) # or %NUMBER_OF_PROCESSORS% on Windows
```


text:
ws-server
=========

[![npm](https://img.shields.io/npm/v/ws-server.svg)](http://www.npmjs.com/package/ws-server)
[![Travis CI Build Status](https://travis-ci.org/lrc-se/bth-ws-server.svg?branch=master)](https://travis-ci.org/lrc-se/bth-ws-server)
[![Scrutinizer Build Status](https://scrutinizer-ci.com/g/lrc-se/bth-ws-server/badges/build.png?b=master)](https://scrutinizer-ci.com/g/lrc-se/bth-ws-server/build-status/master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/lrc-se/bth-ws-server/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/lrc-se/bth-ws-server/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/lrc-se/bth-ws-server/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/lrc-se/bth-ws-server/?branch=master)

A simple Web Sockets server module for Node.js based on [ws](https://www.npmjs.com/package/ws), for use in server applications.

Dependencies
------------

- ws
- tap *(development)*
- eslint *(development)*
- npm-run-all *(development)*

Check out the `ws` documentation to better understand the information given below, specifically with regard to `ws.Server` construction options and event listener arguments.

Installation
------------

    $ npm install ws-server

Usage
-----

Import the module in your project:

```javascript
const wsServer = require("ws-server");
```

### Configuration

The resulting reference is a factory function which returns a new server object:

```javascript
const server = wsServer(serverOptions, config);
```

This function takes two configuration objects as arguments, where the first is passed to the constructor of the underlying `ws.Server` instance (but see notes below).
The second object configures the returned server instance and has the following properties:

```javascript
{
    timeout,            // ping timeout in milliseconds
    protocolHandler,    // subprotocol selection handler (see note below)
    connectionHandler,  // connection handler
    messageHandler,     // message reception handler
    errorHandler,       // error handler
    closeHandler        // disconnection handler
}
```

All properties are optional, as is the `config` object itself (but the server won't be of much use if no handlers are registered).

*__NOTE:__ The `clientTracking` property in the `ws.Server` constructor options will always be set to `true` regardless of its value in `serverOptions`.*

#### Subprotocol selection

If `protocolHandler` is a function reference it will be used as the subprotocol selection routine for the connection,
following the format defined by `ws.Server`.

*__NOTE:__ If present, the value of this property will overwrite the `handleProtocols` value in the `serverOptions` argument,
and it has been included in the `config` object to keep all handler references in one place.*

#### Event handlers

The rest of the handler function references will, when present, be registered as listeners for the corresponding WebSocket events.
`messageHandler`, `errorHandler` and `closeHandler` will be called with the same arguments as the underlying event listeners as per the WebSocket implementation,
*with the addition of* an additional argument called `client` (see below). `connectionHandler` will be called with the `client` object as its sole argument.

##### The `client` object

This object is constructed when a connection is first established and has the following properties:

```javascript
{
    socket,     // active socket instance (WebSocket)
    request     // original request (http.IncomingMessage)
}
```

As such, this object lets the registered handler functions access both the socket that triggered the event in question *and* the HTTP request that opened the connection in the first place.
The `client` object is a singleton tied to individual connections and thereby also functions as a container for client-specific data the application wishes to maintain,
since any properties added to it will be available in all subsequent handler invocations. If you're building a chat system, for example, this would be a good place to store the user's nickname.

#### Ping timeouts

If the `timeout` property is present, a ping/pong cycle with the specified interval will be started for all connected clients.
If a pong is not received before the next ping is to be sent out, the client in question is forcibly disconnected.
To keep track of this, `ws-server` adds a `pingPending` property to all open sockets when ping is enabled,
which means that the disconnection handler can determine whether the connection was closed because of a ping timeout by checking if `code == 1006 && client.socket.pingPending`.

### Methods and properties

The server instance exposes the following members:

#### `broadcast(data, exclude)`

Broadcasts a message to all connected clients. If present, the `exclude` argument signifies a socket instance to exclude from the broadcast
(such as the writer of a chat message who shouldn't get it back in turn).

#### `broadcastJSON(data, exclude)`

Same as the above, but converts `data` to a JSON string first.

#### `sendJSON(socket, data)`

Convenience function to send JSON-ified `data` to a specific `socket`.

#### `server`

This property holds a reference to the underlying `ws.Server` instance.

Example
-------

```javascript
"use strict";

const wsServer = require("ws-server");
const http = require("http");

let httpServer = http.createServer();
let server = wsServer({ server: httpServer }, {
    timeout: 60000,

    connectionHandler: function(client) {
        console.log("Connection opened:", client.request.connection.remoteAddress);
    },

    messageHandler: function(data, client) {
        console.log(`Message from ${client.request.connection.remoteAddress}:`, data);
    },

    closeHandler: function(code, reason, client) {
        console.log("Connection closed:", client.request.connection.remoteAddress, code, reason);
    }
});

httpServer.listen(process.env.PORT || 80);
```

Tests
-----

A test suite using [Node Tap](http://www.node-tap.org/) is included in the repo together with [ESLint](https://eslint.org/) for linting:

```bash
$ npm run lint      # run linter
$ npm run tap       # run test suite
$ npm test          # both of the above, in sequence
```

The test suite will generate a coverage report in HTML format in *build/coverage*. To get a Clover report instead, run:

    $ npm run tap-clover

Set the `WS_PORT` environment variable to change the port the test suite uses (defaults to 1701).

About
-----

**Type:** School project @[BTH](https://www.bth.se/)
**License:** MIT
**Author:**<EMAIL_ADDRESS>

repository: lrc-se/bth-ws-server

repo_name: lrc-se/bth-ws-server


text:
---
author: Aniket
title: The Bones of HTML5
layout: post
type: post
category: essay
tags:
  - Bones
  - html5
  - Wordpress
---

## Introduction

The father and mother of wrongly named articles is this! For sure! Trust me on that.

No, I am not writing about HTML5′s architecture!

This article is about a WordPress theme framework called "Bones" and how it uses HTML5. The holistic view about it. The good, the better and the best (and a itsy bitsy orc-like things)

BTW, I recommend you read my short article on [HTML5 Semantics and Good Coding Practices](http://www.aniketpant.com/posts/html5-semantics-and-good-coding-practices).

## What is Bones?

[Bones](http://themble.com/bones/) is a WordPress theme framework developed by [Eddie Machado](http://themble.com/). Twist it and turn it the way you want. Highly flexible it is!
I use it for my website and speak about it nearly every time I talk to any WordPress developer or whenever I give a talk.

Bones is available in 3 flavors -

1.  [A WordPress framework](https://github.com/eddiemachado/bones)
2.  [A responsive version of the framework](https://github.com/eddiemachado/bones-responsive)
3.  [HTML version](https://github.com/eddiemachado/bones-html)

The size is super-tiny, only **248kb**.

## **Here is how Bones uses HTML5**

### Navigation

Let's start with the navigation bar that is your menu bar is not enclosed in div's with id's like #navigation or #top-menu but uses nav element to do the job.

Code:

```html
<nav role="navigation">
  <?php bones_main_nav(); // Adjust using Menus in WordPress Admin ?>
</nav>
```

### In terms of posts

Bones uses HTML5 the way it's supposed to be. The use of div's has been greatly reduced and the code is highly semantic.

Let me explain this with an example.
Take a look at the code below. It is a snippet from the index.php.

```html
<article id="post-<?php the_ID(); ?>" php="" post_class="" clearfix="">role="article">
  <header>
    <h1>
      <?php _e("Posted", "bonestheme"); ?><time datetime="<?php echo the_time('Y-m-j'); ?>" pubdate=""><?php the_time('F jS, Y'); ?></time> <?php the_author_posts_link(); ?> & <?php _e("filed under", "bonestheme"); ?> <?php the_category(', '); ?>.</h1>
      </header>
      <!-- end article header -->
      <section><?php the_content(_e('<span-->Read more on "'.the_title('', '', false).'" »', "bonestheme")); ?></section>
      <!-- end article section -->
      <footer>
      <?php the_tags('<span-->Tags: ', ', ', ''); ?></footer>
      <!-- end article footer --></article>
      <!-- end article -->
```

Okay, please ignore the class h2 with the h1. I'll get to the un-semantic part later.

Apart from that minor error mentioned above, you can notice that an article is being used to for each post generated using the **mighty** loop. Each post will be enclosed in an article tag. The article tag in turn has it's very own header, footer and section. This is how **semantics** roll!

The `<header>` contains the post title of each post and also the meta information of the post. The meta is also used very correctly by enclosing the time of the post in a time tag. From the header we move to the section.

The `<section>` is used because it is closely related to the article but not so close to the other articles or the page as such.

Then the `<footer>` tag. This harbors your tags of the post.

Similarly the comment listing and the other pages also use a similar format for displaying the content. The comments are enclosed in a unordered list. And each list element contains an article with header, section and footer inside.

### Microdata

New attributes like itemscope and itemprop have been implemented in the latest update of Bones. These are from the current working draft of [microdata](http://www.w3.org/TR/html5/microdata.html).

This is the way they are being used in page.php.

```html
<article id="post-<?php the_ID(); ?>" php="" post_class="" clearfix="">role="article" itemscope itemtype="http://schema.org/BlogPosting">
  <header>
    <h1></h1>
    <?php _e("Posted", "bonestheme"); ?><time datetime="<?php echo the_time('Y-m-j'); ?>" pubdate=""><?php the_time('F jS, Y'); ?></time> <?php _e("by", "bonestheme"); ?> <?php the_author_posts_link(); ?>.</header>
    <!-- end article header -->
    <section itemprop="articleBody"><?php the_content(); ?></section>
    <!-- end article section -->
    <footer><?php the_tags('<br>Tags: ', ', ', ' '); ?></footer>
      <!-- end article footer --></article>
      <!-- end article -->
```

Notice itemscope and itemtype attributes in the article. The BlogPosting schema is being used in the itemtype too. Also, you will notice itemprop inside the section which has the value "articleBody".

## Sidebar

The sidebar is one area where some changes can be made. A better way to understand this is by looking at this code snippet.

```php
<?php

function bones_register_sidebars() {
    register_sidebar(array(
            'id' => 'sidebar1',
            'name' => 'Sidebar 1',
            'description' => 'The first (primary) sidebar.',
            'before_widget' =></pre>
            <div id="%1$s">',
            'after_widget' => '</div><pre>',
            'before_title' => '</pre><h4>',
            'after_title' => '</h4><pre>'
            ));
}

?>
```

This code registers the sidebar but places div's around each widget. Instead of using div's, a good option would be to go ahead with using aside's. Semantic!

This is the *orc* blood I warned you about.

## The Functions

Bones makes use of a core function file called as bones.php
The features are:

### Theme Support

*   Post thumbnails
*   Custom backgrounds
*   Automatic Feed Links
*   Post formats

### Footer Links

Bones provides with a function to include links in the footer of your site. Quite useful for making sitemaps.

### Bones Related posts

This is interesting. This function looks for related posts by checking on tags of the other posts.
Very simple to do but it comes by default, so good for us!

### Page Navigation

A pagination thingy for you. Use this function to generate a numeric page navigation for your archives.

 One is normalize.css and the other is style.css

You can make out from the names of the two about what they do, so I will talk about the best parts about the stylesheet.

### The modified 960.gs

Eddie has changed 960.gs into a flexible grid system. By flexible I mean that you can change the value of the container and the grids will change accordingly. Makes things really easy. You can see the change below.

```css
#container, .wrap {
  width: 940px;
  margin: 0 auto;
  padding: 0 10px;
}
/* layout options ( all have margins right & left of 2.1276596%) */
.col60 { width: 6.3829787%; } /* width 60px / grid_1 */
.col140 { width: 14.893617%; } /* width 140px / grid_2 */
.col220 { width: 23.404255%; } /* width 220px / grid_3 */
.col300 { width: 31.914894%; } /* width 300px / grid_4 */
.col380 { width: 40.425532%; } /* width 380px / grid_5 */
.col480 { width: 51.06383%; } /* width 480px / grid_6 */
.col540 { width: 57.446809%; } /* width 540px / grid_7 */
.col620 { width: 65.957447%; } /* width 620px / grid_8 */
.col700 { width: 74.468085%; } /* width 700px / grid_9 */
.col780 { width: 82.978723%; } /* width 780px / grid_10 */
.col860 { width: 91.489362%; } /* width 860px / grid_11 */
.col940 { width: 100.0%; } /* width 940px / grid_12 */
```

### Media Queries

All media queries are already there, all you need to do is write them your way.

Eddie has even made a responsive version of bones. That version is recommended if you are looking for a responsive design.

## The Un-Semantic Part

The only place where I have noted some problems regarding the CSS being un-semantic is the use of classes like h1, h2, h3 and the rest.

But the reason for that is very simple and logical. You post title is h1, and it is too large as such so you go ahead and put a class h2 to reduce the size and the line height. The consecutive headings in your post can be put as h2, h3 and so on and yet your code is semantic as the headings are logical.

The other way to have done it would have been associating the class of the article with h1 and similarly the other elements would have been styled. Eddie didn't do that.

It's just a *different approach*.

## The Bottom Line

The good part is that it is always in development and people contribute to it!

So many features packed together into a small theme which can be extended as much as possible. Truly a development framework made for developers. You can see the repository on GitHub over [here](https://github.com/eddiemachado/bones).

If you liked the post, please upvote on HN. Here's the link to the [discussion](http://news.ycombinator.com/item?id=3315583).

If you are going to try it out then, like Eddie writes in the stylesheet.

**Happy Developing!**


text:
# Theoretical Background

The Python course is a practical introduction to the tools and methods in the Phases Research Lab.
These readings and problems will guide you through the technical background required for success.

Since this course is a sister course to the Python course, some of the readings intentionally overlap.

Aside from the background section, each section should be more or less self-contained.
You are intended to proceed through each section in order, reading the chapter and completing the problems at the end.
The problems are specifically selected for things that will be useful to know, so it is in your best interest to complete them.

The selected readings were chosen because they were thought to offer the clearest explanation of the key topic.
One book cannot be all to all readers, so alternate resources are listed at the end of each section.

## Materials science background

Start here if you do not have a background knowledge of materials science.

1. Materials Science and Engineering: An Introduction, Callister and Rethwisch.
    - Chapter 2. Problem 2.21
    - Chapter 3. Problems 3.3, 3.5, 3.23, 3.34, 3.35
    - Chapter 4. Problems 4.4, 4.7
    - Chapter 5. Problems 5.3, 5.7, 5.13, 5.20, 5.27
    - Chapter 6. Problems 6.3, 6.10, 6.49
    - Chapter 9. Problems 9.2, 9.4, 9.7, 9.10, 9.13, 9.32, 9.52
    - Chapter 10. Problems 10.1, 10.2, 10.14, 10.15
    - Chapter 19. Problems 19.4, 19.6, 19.9, 19.12

### Other resources:

- Physical Metallurgy Principles, Abbaschian, Abbaschian, Reed-Hill.

## Thermodynamics

1. Phase Transformations in Metals and Alloys, Porter and Easterling (2nd edition is best).
    - Chapter 1. Problems (2nd edition): 1.1, 1.6, 1.7
2. Computational Thermodynamics of Materials, Liu and Wang.
    - Chapter 1. Problems 3, 5, 10
    - Chapter 2. Problems 1, 4, 8, 14
    - Chapter 3. Problems 8, 9, 16, 18
    - Chapter 6.

### Other resources:

- Introduction to the Thermodynamics of Materials, Gaskell. Undergraduate level thermodynamics textbook
- Phase Equilibria, Phase Diagrams and Phase Transformations, Hillert. Graduate level thermodynamics textbook

repository: mdruger/prl-onboard

repo_name: mdruger/prl-onboard


text:
# alli

Lists all open issues in your GitHub repositories

## Usage

1. (Optional **) Set GitHub personal authentication token ([create one here](https://github.com/settings/applications)) as `GH_TOKEN_ALLI` in your environment variables.
2. Build and run: `go run alli.go`
3. Enter in username (and optionally save username to `~/.alli` for quicker execution later)

** Optional because you may continue unauthenticated but will be rate limited much more heavily by GitHub.

### Example output
```bash
# ~/alli [git:master o] $ go run alli.go
Yay! Using authentication token!
Using saved username: ryanseys

ryanseys/alli
#5 Add explanation of this repo
#1 Use go-github library
```

## License

MIT © Ryan Seys

repository: ryanseys/alli

repo_name: ryanseys/alli


text:
# Abstractive Text Summarization

This project aims to generate abstractive summary of  Indian news by finetuning PEGASUS pretrained model.

repository: sgauravm/TextSummarization-NLP

repo_name: sgauravm/TextSummarization-NLP


text:
pyAtlasBoneSegmentation
=======================

# Overview

This software was developed as part of my Biomedical Engineering Masters [thesis].

The program tries to automatically segment user defined bone groups (skull, spine, tibia, ...) from a fused CT/Nuclear Image dataset. This allows for easy analysis of radionuclide uptake in each bone group.

Check out the [demo video].

## Detailed Overview

### Purpose

Preclinical imaging analyzes large quantities of data to draw generalized conclusions. Manual analysis of each dataset is time consuming process. Automation, even partial animation, alleviates this bottleneck and can increase throughput in the lab.

### Background
[CT], [SPECT], and [PET] are 3D imaging technologies. SPECT and PET are collectively refereed to as Nuclear Imaging, or NI.

![Sagittal image of CT, NI, fused CT/NI](images/fused example.PNG)

The figure above shows a CT, NI, and then NI overlaid on the CT. NI is used to capturing physiological information, but doesn't provide much information about anatomical location. CT can be combined with the NI image to provide that anatomical reference.

### Software
The software requires three components.
  * Articulated Atlas
  * CT dataset
  * NI dataset (that can be fused with the CT dataset)

#### Articulated Atlas
The Articulated Atlas is comprised of STL files, each representing a bone group, and an XML file that describes the relationships between the bones by joint type and location. The [MOBY Mouse] project was used as the atlas for development. An XML file for this project can be found at *atlases/MOBY_package/MOBY Atlas.xml*. The actual STL files for the MOBY project must be requested from the MOBY mouse authors. If you choose to make your own atlas, you can use the XML file as a format guide.

#### CT/NI Datasets
The CT and NI datasets are provided in separate DICOM files. with the following fields:
* pixel_array
    * 3 dimensional volume of scan data
* RescaleSlope and RescaleIntercept
    *  slope and intercept to change to Hounsfield units
*  SliceThickness
    *  thickness of each axial slice

# How to use the software

## Prerequisites
  * Python 2.7
  * numpy
  * scipy
  * PySide
  * PyOpenGl
  * lxml
  * pydicom
  * cgkit
  * mlabwrap
  * nlopt

## Segmenting
  1. Start the user interface, from the _src_ directory run
```
python pyAtlasSegmentation.py
```
  1. Press Automate to start the automation process.
  1. Choose the XML file for the atlas you want to use (ex. *atlases/MOBY_package/MOBY Atlas.xml*)
  1. Choose a CT DICOM file (ex. *dicom/test/TEST_1-10_CT.dcm*)
  1. Choose the corresponding NI DICOM file (ex. *dicom/test/TEST_1-10_SPECT.dcm*)
  1. Watch the magic happen (slowly). The alignment method uses nonlinear optimization from matlab. If you don't have matlab, then you need to change the optimization algorithm by passing some keywords to the ICP object, set minimizeMethod='custom' and optionally set optAlg to a nlopt optimization routine, if not specified, it defaults to nlopt.GN_CRS2_LM

[thesis]:http://scholarworks.gvsu.edu/theses/19/
[CT]:http://en.wikipedia.org/wiki/X-ray_computed_tomography
[SPECT]:http://en.wikipedia.org/wiki/SPECT
[PET]:http://en.wikipedia.org/wiki/Positron_emission_tomography
[MOBY Mouse]:http://www.jhttonline.jhu.edu/TechnologyDetail.aspx?TechID=4282CAE3-A4B3-4FFB-BDA6-628E0E554CE1
[demo video]:https://www.dropbox.com/s/anmisr9qetuxdor/Software%20Automated%20Animation.avi

repository: zlinzju/pyAtlasBoneSegmentation

repo_name: zlinzju/pyAtlasBoneSegmentation


text:
# alex-control

[![npm version](https://img.shields.io/npm/v/alex-control.svg?style=flat)](https://www.npmjs.com/package/alex-control)

A command line util to control alex playback.

#### Warning

This tool uses the not documented API used by the alex web app.
To use this API a session cookie is required. For now the only way to get the cookie is to login to https://alexa.amazon.com and
copy the value of the `Cookie` header of any request into the file `~/.alexa-cookie` (see [issue](https://github.com/mawi12345/alex-control/issues/1) for more information).

#### Help

    Usage: alexa-control [options] <action> [args...]

    Options:

      -V, --version        output the version number
      -d, --device <name>  select a echo device
      -c, --cookie <file>  alexa web cookie file
      -h, --help           output usage information

    Actions:

      list             list all echo devices
      info             prints info of echo devices
      play             resume playback
      pause            pause playback
      next             play next title
      previous         play previous title
      volume [level]   set volume level [0-100]
      tunein [name]    plays tunein station


text:
Usage in Lumen
===

A few minor additions have to be made to allow this to work with the Lumen framework.

While some might find it odd to use view methods odd in an API framework, there is the need if your app renders things
pretty error pages, confirmation pages or formatted emails.

bootstrap/app.php
---
Since Lumen does not use View normally, the alias must be created to allow DbView to function.

```php
...
$app->withFacades(true, [
    'Illuminate\Support\Facades\View'          => 'View',
    'Flynsarmy\DbBladeCompiler\Facades\DbView' => 'DbView'
]);

// Only include the confiuration if you have created a custom version in /config
$app->configure('db-blade-compiler');

$app->register(Flynsarmy\DbBladeCompiler\DbBladeCompilerServiceProvider::class);
...
```

config/db-blade-compiler.php
---
The configuration file is only needed if you need to change the default behavior of the compiler.

Out of the box the compiler uses `storage_path('app/db-blade-compiler/views')` for it's cache directory. Since this does
not exist and Lumen uses `storage_path('framework/views')` as it's view cache directory, I changed the setting in the
configuration file.
```php
...
	'storage_path' => storage_path('framework/views')
...
```


text:
---
name: Executive Director Hugh
rarity: 5
series: pic
memory_alpha:
bigbook_tier: 4
events: 17
in_portal: true
date: 23/04/2020
obtained: Event
mega: true
published: true
---

Like the faceless drone he used to be, Hugh is the definition of "solid but unspectacular." Thankfully, his skill set is just rare enough and his voyage total is just high enough to give him value relative to the many, many other SCI/CMD cards out there.

His event count doesn't leap off the page, but if we had to guess, it certainly looks like the Borg trait has as good a chance as any trait of landing future weekend work, along with landing him a collection spot that no longer needs legendaries to complete, but is a nice bonus.

As for the rest, pitiful auxiliary rolls pull down a #12 SCI proficiency that can net a 45% crit bonus in Gauntlet, so his viability there will vary wildly depending on your existing options, and the less said about his non-event ship ability, the better, though a bit of shield repair will make him a marginally useful warm body for Skirmish purposes.

We had hopes that Hugh would be the answer to some of the unicorn skill combos still left to be filled in the game (CMD/MED/ENG, among others) but, alas, Hugh can't always get what you want.

repository: ineffyble/website

gha_language: TypeScript

repo_name: ineffyble/website


text:
# Contact Form Logs plugin for Craft CMS

Plugin to extend the use of the [Contact Form](https://github.com/craftcms/contact-form) plugin by logging records of all emails sent from the CMS

## Installation

To install Contact Form Logs, follow these steps:

1. Download & unzip the file and place the `contactformlogs` directory into your `craft/plugins` directory
2.  -OR- do a `git clone ???` directly into your `craft/plugins` folder.  You can then update it with `git pull`
3.  -OR- install with Composer via `composer require /contactformlogs`
4. Install plugin in the Craft Control Panel under Settings > Plugins
5. The plugin folder should be named `contactformlogs` for Craft to see it.  GitHub recently started appending `-master` (the branch name) to the name of the folder for zip file downloads.

Contact Form Logs works on Craft 2.4.x and Craft 2.5.x.

## Contact Form Logs Overview

This plugin is used to log submissions from the Craft Contact Form.
It also creates an area in the CMS for viewing sent messages and provides variables for browsing messages in the front-end.
Contact Form Logs provides the ability to log multiple forms on a site by adding an optional `form` field.

## Configuring Contact Form Logs

You can change the name/label for Contact Form Logs within the Plugin settings by updating the `Known As` field.

## Using Contact Form Logs

Visting the Contact Form Logs area of the CMS will provide a list of messages posted through the Contact Form plugin.
These can be filtered by clicking on the form name shown in the Form column.
Message details can be viewed by clicking on the email subject.

### Extending Contact Form

There are two additional functions that can be used.

1. You can add a 'form' input to your forms which means you can differentiate the logs available for different forms on your site
2. There are two new fields available: `firstName` and `lastName` if you need to capture these separately (rather than simply `fromName`). Contact Form Logs will concatenate these for the purposes of the Contact Form plugin but store these as separate fields.

### Variables available

You can use `{% set logs = craft.contactformlogs.logs( ) %}` to fetch all message logs available or filter these by defining a criteria to filter against, for example `{% set vars = { form: 'Contact Form } %}` then `{% set logs = craft.contactformlogs.logs( vars ) %}`. For each log entry the following variables are available:

* `log.form` String
*  `log.fromName` String
*  `log.fromEmail` String
*  `log.toEmail` String
*  `log.subject` String
*  `log.message` String
*  `log.htmlMessage` HTML String
*  `log.messageFields` JSON object
*  `log.status` String (either `holding` or `sent`)
*  `log.timestamp` - a DateTime object

## How it works

The Contact Form plugin doesn't have a post send hook so the logs are recorded in a two-step process.
On the `contactForm.beforeSend` event the plugin detects a submisssion from the Contact Form plugin, modifies any fields (eg merges firstName and lastName into a single fullName field) and stores the message with a status of holding.
Then, on the `email.onSendEmail` event the plugin checks to see if a message has been logged in the last ten minutes that matches the status and sender email and changes any records to `sent` as well as update the record for the subject of the message (this is to deal with the Contact Form dynamically generates subject if variables are present).

## Contact Form Logs Roadmap

* Logs sorting
* Abstract `contactForm.beforeSend` and `email.onSendEmail` hooks into a separate service

Brought to you by [@cole007](http://ournameismud.co.uk/)
Log Icon via Noun Project from [Ben Davis, RO](https://thenounproject.com/search/?q=logs&i=828711)


text:
# ChimeraRemove
# Language: R
# Input: RDS
# Output: PREFIX
# Tested with: PluMA 1.1, R 4.0.0
# dada2_1.18.0

Remove chimeras from a set of sequences.

The plugin takes as input an R object of merged sequences, as a list.

It will output the same sequences with all chimeras removed, and also as a table of sequences, using the user-specified prefix:
prefix.merger1.rds: Merged sequences
prefix.seqtab.rds: Sequence table


text:
# GitHub PR Scraper
Scrapes PRs for Jira tickets and prints results into the developer console

**[VIEW RAW](https://raw.githubusercontent.com/AlliedPayment/github-scraper/master/scraper.js)**

## How To

- Open a PR whose commits logs contain JIRA ticket references used for smart commits.
- Open dev tools (`F12` or `Ctrl + Shift + i`)
- Copy scraper.js to clipboard
- Paste scraper.js into console
- Press `Enter` to execute
- Copy list of tickets that are printed to the console

***NOTE: CHROME ONLY***

if you want to save console output to file
`right click` in console and `Save As`

### Usages

#### Basic Usage
***Scrapes the DOM for keys***
``` js
var keys = ['abp', 'ABP', 'Abp', 'aBp', 'aBP', 'ABp'];
var scaper = new Scraper(keys);
scaper.scrape();
scaper.print();
```

#### AdHoc Usage
***Scrapes the provided input***
``` js
var toBeScraped = 'Some string that may contain JIRA tickets like ABP-1234 or ABP-3210'
var keys = ['abp', 'ABP', 'Abp', 'aBp', 'aBP', 'ABp'];
var scaper = new Scraper(keys);
scaper.scrape(toBeScraped);
scaper.print();

// will print ABP-1234 && ABP-3210 to the console
```

repository: ap-cerrid/github-scraper

repo_name: ap-cerrid/github-scraper


text:
# Overview

A C++ implementation of gRPC

# To start using gRPC C++

In the C++ world, there's no universally accepted standard for managing project dependencies.
Therefore, gRPC supports several major build systems, which should satisfy most users.

## bazel

We recommend using Bazel for projects that use gRPC as it will give you the best developer experience
(easy handling of dependencies that support bazel & fast builds).

To add gRPC as a dependency in bazel:
1. determine commit SHA for the grpc release you want to use
2. Use the [http_archive](https://docs.bazel.build/versions/master/be/workspace.html#http_archive) bazel rule to include gRPC source
  ```
  http_archive(
      name = "com_github_grpc_grpc",
      urls = [
          "https://github.com/grpc/grpc/archive/YOUR_GRPC_COMMIT_SHA.tar.gz",
      ],
      strip_prefix = "grpc-YOUR_GRPC_COMMIT_SHA",
  )

  load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")

  grpc_deps()
  ```

NOTE: currently bazel is only supported for building gRPC on Linux.

## make

Currently the default choice for building on UNIX based systems is `make`.

To install gRPC for C++ on your system using `make`, follow the [Building gRPC C++](../../BUILDING.md)
instructions to build from source and then install locally using `make install`.
This also installs the protocol buffer compiler `protoc` (if you don't have it already),
and the C++ gRPC plugin for `protoc`.

WARNING: After installing with `make install` there is no easy way to uninstall, which can cause issues
if you later want to remove the grpc and/or protobuf installation or upgrade to a newer version.

## cmake

`cmake` is the default build option on Windows, but also works on Linux, MacOS. `cmake` has good
support for crosscompiling and can be used for targeting Android platform.

If your project is using cmake, there are several ways to add gRPC dependency.
- install gRPC via cmake first and then locate it with `find_package(gRPC CONFIG)`. [Example](../../examples/cpp/helloworld/CMakeLists.txt)
- via cmake's `ExternalProject_Add` using a technique called "superbuild". [Example](../../examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt)
- add gRPC source tree to your project (preferrably as a git submodule) and add it to your cmake project with `add_subdirectory`. [Example](../../examples/cpp/helloworld/CMakeLists.txt)

## Packaging systems

There's no standard packaging system for C++. We've looked into supporting some (e.g. Conan and vcpkg) but we are not there yet.
Contributions and community-maintained packages for popular packaging systems are welcome!

## Examples & Additional Documentation

You can find out how to build and run our simplest gRPC C++ example in our
[C++ quick start](../../examples/cpp).

For more detailed documentation on using gRPC in C++ , see our main
documentation site at [grpc.io](https://grpc.io), specifically:

* [Overview](https://grpc.io/docs/): An introduction to gRPC with a simple
  Hello World example in all our supported languages, including C++.
* [gRPC Basics - C++](https://grpc.io/docs/tutorials/basic/c.html):
  A tutorial that steps you through creating a simple gRPC C++ example
  application.
* [Asynchronous Basics - C++](https://grpc.io/docs/tutorials/async/helloasync-cpp.html):
  A tutorial that shows you how to use gRPC C++'s asynchronous/non-blocking
  APIs.

# To start developing gRPC C++

For instructions on how to build gRPC C++ from source, follow the [Building gRPC C++](../../BUILDING.md) instructions.

repository: dropbox/grpc

repo_name: dropbox/grpc


text:
# Learning-Tutorials
All my learning paths will be stored in this Tutorial

Folders

## Python
This folder includes notes and learning Material on Python

## DSInterview

This Folder includes DS Interview Questions + Answers and resources to learn more

## Blogs
1. [EDA](http://blog.districtdatalabs.com/data-exploration-with-python-1)
2. Jupyter note book collections : https://github.com/jupyter/jupyter/wiki/A-gallery-of-interesting-Jupyter-Notebooks#other-publications-and-conference-abstracts-that-explicitly-use-the-notebook
3. https://medium.com/@yaelg/product-manager-pm-step-by-step-tutorial-building-machine-learning-products-ffa7817aa8ab
4. [NLP](https://github.com/anebz/papers)

repository: Jean-njoroge/Learning-Tutorials

repo_name: Jean-njoroge/Learning-Tutorials