text:
---
layout: post
title: "[Training and Results] Deep Convolutional Generative Adversarial Networks on CelebA Dataset using PyTorch C++ API"
date: 2020-02-23
desc: "In this blog, we discuss training a DCGAN on CelebA dataset using PyTorch C++ API"
keywords: "Blog, PyTorch, C++, Libtorch, OpenCV"
categories: [Blog, PyTorch, OpenCV]
tags: [Blog, PyTorch, OpenCV]
blog: [PyTorch]
published: true
excerpt_separator:
images:
  - url: /assets/Cover-DCGAN-2.jpg
icon: icon-html
---

It's been around 5 months since I released my last blog on DCGAN Review and Implementation using PyTorch C++ API and I've missed writing blogs badly! Straight the to the point, I'm back!

But before we start, the PyTorch C++ Frontend has gone through several changes and thanks to the awesome contributors around the world, it resembles the Python API more than it ever did! Since a lot of things have changed, I have also updated my previous blogs (tested on 1.4 Stable build).

## What has changed?

There have been major changes in the PyTorch C++ Frontend API (Libtorch) and we'll be discussing some of them which were related to our implementation on DCGAN. Let's see, what parts of our code have changed in the recent Libtorch version. Well, the frontend API of PyTorch in C++ resembles closely to Python now:

For what concerns our code on DCGAN, quoting the author (Will Feng) of PR #28917:

> In Conv{1,2,3}dOptions:
    - with_bias is renamed to bias.
    - input_channels is renamed to in_channels.
    - output_channels is renamed to out_channels.
    - The value of transposed doesn't affect the behavior of Conv{1,2,3}d layers anymore. Users should migrate their code to use ConvTranspose{1,2,3}d layers instead.

So, starting first, we need to change `with_bias` to `bias` in our model definitions. The generator class in DCGAN uses Transposed Convolutions, and that's why we need to migrate from `torch::nn::Conv2dOptions` class to `torch::nn::ConvTranspose2dOptions` (this is because using `.transposed(true/false)` does not work anymore on `torch::nn::Conv2dOptions`).

That is all for the changes we needed to make. To make it easy to track changes and use the code I wrote, I've made the project public on GitHub. Feel free to file an issue in case you hit a bug/error.

Time to talk about results!

## Results

The aim of this blog is to get DCGAN running on our celebA dataset using PyTorch C++ Frontend API. I'm in no way aiming to produce the best possible results. I trained the DCGAN network on celebA dataset for 10 epochs. In order to visualize results, for every checkpoint (where we save our models), we pass a sample noise image (64 images here) to the generator and save the output:

```cpp
// equivalent to using torch.no_grad() in Python
auto options = torch::TensorOptions().device(device).requires_grad(false);

// netG is our sequential generator network
// args.nz = 100 in my case
torch::Tensor samples = netG->forward(torch::randn({64, args.nz, 1, 1}, options));
// save the output
torch::save(samples, torch::str("dcgan-sample-", ++checkpoint_counter, ".pt"));
```

Once we have the saved output, we can load the file and produce output (find the `display_samples.py` file in the GitHub repo for this blog). Here is how the output looks like, after 10 epochs of training:

And how about an animation?

Isn't this amazing?

That's it for this blog. See you around! :)

repository: krshrimali/not-existing

repo_name: krshrimali/not-existing


text:
# Self-Bot-Discord

------------------------------------------------------------
### ability

-Alldm

-Ascii

-kiss

-Time

-typing

-weather

-joinv

------------------------------------------------------------
#### Libraries participating in this project

-discord.js-self

-quick.db

-weather-js

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

# Install

-Download and Install [node.js](https://nodejs.org/en/download/)

 -Download the file using the following command

```
git clone <link>
```

 -Use the following commands to go into the file and install the required libraries

```
cd <File location>

npm install

```

 -Enter the config.json file and change the following
```css
   "botstat":{
        "tokenbot":" ",
        "prefix":"md!",
        "botID":" ",
        "ownerID":" ",

```

 -And after doing all the work and saving the information using the following command, you turn on the Bot

```
node .
```

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

## How Find account API token

Hold the (Ctrl + Shift + I) keys inside the Discord app

Then go to the (Network) tab in the page that opens

And press the (Ctrl + R) key and search for the word api in the search field

Go to the option in the science name list

Then go to the Headers tab and at the bottom of your token list is your account

Copy it and paste it in the config.json file

Example for token API : {mfa.jxxxSfsexxxBtHUrsixxxw1MD2XedIuwexxxFh7fdTAQsFxxx8Wkrjfwmxxxl5zvxxxhFkxxygwjdxxxaNp}

license: MIT

repository: almadrasa/Self-Bot-Discord

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: almadrasa/Self-Bot-Discord


text:
##Bodhi Tools
[Bodhi Tools](https://tools.hotschedules.io/) is a launch pad destination for Bodhi Users. Bodhi Tools allows a user to navigate to Bodhi Types, Bodhi Query, and to the Bodhi API documentation. Bodhi Tools will be continually updated with new features and releases to enhance the Bodhi experience.

- Bodhi Tools are for users with administrator privileges, first login:

	![Tools_login](/images/Tools_login.png?raw=true "")

- Bodhi Tools allows admistrators to access Bodhi Shop, Bodhi Store Manager, Bodhi Types, Bodhi Query, and Bodhi API Docs:

	![Tools_1](/images/Tools_1.png?raw=true "")

repository: bodhi-space/slate

branch_name: refs/heads/master

gha_language: JavaScript

repo_name: bodhi-space/slate


text:
# InterMine Server Documentation

Documentation for the [InterMine](http://intermine.org) project.

## Documentation

The HTML documentation is generated from Markdown docs, using the static site generator called [Docusaurus](https://v2.docusaurus.io/).

## Building locally

You should build locally before you push, to make sure your changes are correct. You will need **nodejs** (version >= 10.15.1) and **yarn** (version >= 1.5) installed.

Building the docs:

```bash
cd im-docs
yarn install
yarn start
```

## Deployment

This repository uses GitHub Actions to automatically deploy any changes pushed to the master branch to GitHub Pages. The website is deployed to: http://intermine.org/im-docs/

If you wish to deploy manually for some reason, you can use the below command considering you have commit access to the repository.

```console
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
```

repository: intermine/im-docs

gha_license_id: MIT

repo_name: intermine/im-docs


text:
[<<< Previous question <<<](0102.md)   Question ID#0103.md   [>>> Next question >>>](0104.md)
---

What is the result of the following code?
```php
function foo() {
    return array_sum(func_get_args());
}
$x = foo(1,2,3);
echo ($x ?? 'x');
```

- [ ] A) 6
- [ ] B) x
- [ ] C) 6??x
- [ ] D) A parse error because ?? operator does not exist in PHP7

Answer

  Answer: A

repository: alceanicu/zce

gha_language: TypeScript

repo_name: alceanicu/zce


text:
---
author: kubu4
comments: true
date: 2009-11-11 03:18:45+00:00
layout: post
slug: sequencing-lake-trout-hrm
title: Sequencing - Lake Trout HRM
wordpress_id: 798
author:
  - kubu4
categories:
  - Miscellaneous
tags:
  - high resolution melt curve
  - HRM
  - lake trout
  - Sanger sequencing
---

This is a second submission of 12 individuals from 8 primer sets. The previous sequencing run was botched because I used the combined primer plate instead of a single (forward or reverse) primer for submission.

[Sequence log](https://docs.google.com/spreadsheet/ccc?key=0AtV_gF766XZAcHljOFBWd3pLTUJwbUxkdkg1OGdCY3c&usp=sharing)

repository: RobertsLab/sams-notebook

extension: markdown

gha_language: Shell

repo_name: RobertsLab/sams-notebook


text:
# Meteor to-do list Tutorial

*to-do* is a meteor application written based on the tutorial on learning Meteor. The web site followed is https://www.meteor.com/tutorials/blaze/creating-an-app


text:
# Infrastructure As Code

Infrastructure As Code (IaC) gives us a way to manage the provisioning of our infrastructure resources as code. Making our deployment and configuration process of physical and virtual equipment faster and reliably repeatable. Typically there are two types of IaC, declarative (functional) and imperative (procedural). We will discuss the differences in more depth shortly.

## Basic Pub Sub Model

<img src="../../assets/pub-sub.png">

=== "CloudFormation"
    ```yaml linenums="1"
    Resources:
        myTopic:
            Type: 'AWS::SNS::Topic'
            Properties:
                TopicName: my-cool-topic
        myQueue:
            Type: 'AWS::SQS::Queue'
            Properties:
                QueueName: my-cool-queue
                UpdateReplacePolicy: Delete
                DeletionPolicy: Delete
        mySnsSubscription:
            Type: 'AWS::SNS::Subscription'
            Properties:
                Protocol: sqs
                TopicArn: !Ref myTopic
                Endpoint: !GetAtt
                    - myQueue
                    - Arn
        mylambdaServiceRole:
            Type: 'AWS::IAM::Role'
            Properties:
                AssumeRolePolicyDocument:
                    Statement:
                    - Action: 'sts:AssumeRole'
                        Effect: Allow
                        Principal:
                        Service: lambda.amazonaws.com
                    Version: 2012-10-17
                ManagedPolicyArns:
                    - !Join
                    - ''
                    - - 'arn:'
                        - !Ref 'AWS::Partition'
                        - ':iam::aws:policy/service-role/AWSLambdaBasicExecutionRole'
        mylambdaServiceRoleDefaultPolicy:
            Type: 'AWS::IAM::Policy'
            Properties:
                PolicyDocument:
                    Statement:
                    - Action:
                        - 'sqs:ReceiveMessage'
                        - 'sqs:ChangeMessageVisibility'
                        - 'sqs:GetQueueUrl'
                        - 'sqs:DeleteMessage'
                        - 'sqs:GetQueueAttributes'
                        Effect: Allow
                        Resource: !GetAtt
                        - myQueue
                        - Arn
                    Version: 2012-10-17
                PolicyName: mylambdaServiceRoleDefaultPolicy
                Roles:
                    - !Ref mylambdaServiceRole
        mylambda:
            Type: 'AWS::Lambda::Function'
            Properties:
                Code:
                    S3Bucket: !Ref WHATEVER_BUCKET_YOU_UPLOADED_LAMBDA_TO
                    S3Key: !Ref KEY_TO_REFERENCE_LAMBDA
                Role: !GetAtt
                    - mylambdaServiceRole
                    - Arn
                Environment:
                    Variables:
                    QUEUE_ARN: !GetAtt
                        - myQueue
                        - Arn
                    QUEUE_NAME: !GetAtt
                        - myQueue
                        - QueueName
                Handler: empty-queue.handler
                Runtime: python3.8
                DependsOn:
                    - mylambdaServiceRoleDefaultPolicy
                    - mylambdaServiceRole
        mylambdaSqsEvent:
            Type: 'AWS::Lambda::EventSourceMapping'
            Properties:
                FunctionName: !Ref mylambda
                EventSourceArn: !GetAtt
                    - myQueue
                    - Arn
    ```

=== "Terraform"
    ```json linenums="1"
    terraform {
        required_providers {
            aws = {
            source = "hashicorp/aws"
            version = "3.58.0"
            }
        }
    }

    provider "aws" {
        region = "us-east-2"
    }

    resource "aws_sns_topic" "user_updates" {
        name = "user-updates-topic"
    }

    resource "aws_sqs_queue" "terraform_queue" {
        name                      = "terraform-example-queue"
    }

    resource "aws_sns_topic_subscription" "user_updates_sqs_target" {
        topic_arn = "arn:aws:sns:us-west-2:432981146916:user-updates-topic"
        protocol  = "sqs"
        endpoint  = "arn:aws:sqs:us-west-2:432981146916:terraform-queue-too"
    }

    resource "aws_iam_role" "iam_for_lambda" {
        name = "iam_for_lambda"

        assume_role_policy = <<EOF
        {
        "Version": "2012-10-17",
        "Statement": [
            {
            "Action": "sts:AssumeRole",
            "Principal": {
                "Service": "lambda.amazonaws.com"
            },
            "Effect": "Allow",
            "Sid": ""
            }
        ]
        }
        EOF
    }

    resource "aws_lambda_function" "test_lambda" {
        filename      = "empty-queue.py"
        function_name = "handler"
        role          = aws_iam_role.iam_for_lambda.arn
        handler       = "empty-queue.handler"

        source_code_hash = filebase64sha256("lambda_function_payload.zip")

        runtime = "nodejs12.x"

        environment {
                variables = {
                foo = "bar"
            }
        }
    }
    ```

=== "CDK"
    ```typescript linenums="1"
    import * as path from 'path';
    import * as lambda from '@aws-cdk/aws-lambda';
    import * as lambdaEventSources from '@aws-cdk/aws-lambda-event-sources';
    import * as sns from '@aws-cdk/aws-sns';
    import * as sqs from '@aws-cdk/aws-sqs';
    import * as cdk from '@aws-cdk/core';

    export class PubSubModel extends cdk.Stack {
    constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
        super(scope, id, props);

        let myTopic = new sns.Topic(this, 'my-topic', {
            topicName: 'my-cool-topic',
        });

        let myQueue = new sqs.Queue(this, 'my-sqs-queue', {
            queueName: 'my-cool-queue',
        });

        new sns.Subscription(this, 'my-sns-subscription', {
            topic: myTopic,
            protocol: sns.SubscriptionProtocol.SQS,
            endpoint: myQueue.queueArn,
        });

        let myLambda = new lambda.Function(this, 'my-lambda', {
            runtime: lambda.Runtime.PYTHON_3_8,
            handler: 'empty-queue.handler',
            code: lambda.Code.fromAsset(
                path.join(__dirname, './lambda_scripts'),
                {
                exclude: ['**', '!empty-queue.py'],
                },
            ),
            environment: {
                QUEUE_ARN: myQueue.queueArn,
                QUEUE_NAME: myQueue.queueName,
            },
        });

        myQueue.grantConsumeMessages(myLambda);
        myLambda.addEventSource(new lambdaEventSources.SqsEventSource(myQueue));
    }
    }
    ```

=== "Lambda Code"
    ```python linenums="1"
    import json
    import logging
    import os
    import boto3
    from __future__ import print_function

    SUCCESS = "SUCCESS"
    FAILED = "FAILED"
    QUEUE_ARN = os.getenv('QUEUE_ARN')
    QUEUE_NAME = os.getenv('QUEUE_NAME')
    LOGGER = logging.getLogger(__name__)
    LOGGER.setLevel(logging.DEBUG)

    sqs = boto3.resource('sqs')

    def handler(event, context):
        LOGGER.info("Recieved event: " + json.dumps(event, indent=2))
        for record in event['Records']:
            print("test")
            payload = record["body"]
            print(str(payload))

    ```

repository: hasanaburayyan/aws-cdk-presentation

repo_name: hasanaburayyan/aws-cdk-presentation


text:
---
layout: default
title: AsNoTrackingWithIdentityResolution
nav_order: 2
has_children: false
parent: ORM-Specific Features
grand_parent: Features
---

# AsNoTrackingWithIdentityResolution

Compatible with:

- [EF Core](https://www.nuget.org/packages/Ardalis.Specification.EntityFrameworkCore/)

The `AsNoTrackingWithIdentityResolution` feature applies this method to the resulting query executed by[EF Core](https://docs.microsoft.com/en-us/ef/core/change-tracking/identity-resolution#identity-resolution-and-queries). It is not supported by EF 6.

> No-tracking queries can be forced to perform identity resolution by using `AsNoTrackingWithIdentityResolution<TEntity>(IQueryable<TEntity>)`. The query will then keep track of returned instances (without tracking them in the normal way) and ensure no duplicates are created in the query results.

## Example

The following example shows how to add `AsNoTrackingWithIdentityResolution` to a specification:

```csharp
public class CustomerByNameReadOnlySpec : Specification<Customer>
{
  public CustomerByNameReadOnlySpec(string name)
  {
    Query.Where(x => x.Name == name)
      .AsNoTrackingWithIdentityResolution()
      .OrderBy(x => x.Name)
        .ThenByDescending(x => x.Address);
    }
}
```

**Note:** It's a good idea to note when specifications use `AsNoTracking` (or `AsNoTrackingWithIdentityResolution`) so that consumers of the specification will not attempt to modify and save entities returned by queries using the specification. The above specification adds `ReadOnly` to its name for this purpose.

repository: ardalis/ApiEndpoints

gha_language: C#

repo_name: ardalis/ApiEndpoints


text:
---
layout: projects
title: Projects
permalink: /projects/
projects:
  - title: Route53 Dynamic DNS Client
    link: https://github.com/kylelaker/dynamic-route53-rs/
    description: >-
        A client for dynamically updating a Route 53 Resource Record. Includes
        a systemd timer and service definition to simplify deployment and setup.
  - title: JMU Parking Data Download
    link: https://github.com/kylelaker/aws-jmu-parking/
    description: >-
        Downloads the latest
        [parking information](https://www.jmu.edu/cgi-bin/parking_get_sign_data.cgi)
        from JMU and stores it in an S3 bucket using a Lambda function.
  - title: Update Checker
    link: https://github.com/kylelaker/updatechecker/
    description: >-
        Creates an AWS Lambda function to check for updates for various
        software and sends a notification if a new version is discovered,
        including the version number, URL, and SHA1 hash.
  - title: xorlist
    link: https://github.com/kylelaker/xorlist/
    description: >-
        An implementation of an xorlist (doubly linked list with xor'ed
        pointers to adjacent elements) in C.
  - title: baddybox
    link: https://github.com/kylelaker/baddybox/
    description: >-
        A tool built for JMU's Cyber Defense Club that performs random unwanted
        actions when chosen utilties on a target system are executed. It
        pretends to look like busybox.
  - title: JMU CS VM
    link: https://github.com/jmunixusers/cs-vm-build
    description: >-
        A project I work on with
        [JMU Unix Users Group](https://www.jmunixusers.org)
        to configure student virtual machines for the coursework using Ansible.
---

These are some of the projects that I have created or contributed to. For a full list, view my [GitHub profile](https://github.com/kylelaker/)


text:
# The ResTZ Framework
ResTZ is an extensible REST client framework written in Java.

ResTZ was written for three main reasons:

 - There's a huge amount of shared code as far as REST clients concern (e.g., connection pool management, serialization, oauth token expiration, etc...).
In Jive Software, we integrate with almost every known enterprise service out there, and this kind of framework saves us a lot of time and effort.
 - We want to be able to share the REST APIs themselves without depending on a specific HttpClient version.
 - Apache tends to break the API of HttpClient across versions (even minor versions), so unless you provision it as a [boundary](http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=tmm_pap_title_0?ie=UTF8&qid=1409902638&sr=1-1) (which is actually as difficult as writing ResTZ) - the larger your code base is, the more impossible it gets to merge that change in.

## Getting Started

Add the any one of the ResTZ HttpClient connectors as a maven dependency to your project
```xml
<dependency>
	<groupId>com.jivesoftware.boundaries.restz</groupId>
	<artifactId>restz-hc435</artifactId>
	<version>1.2-RELEASE</version>
</dependency>
```

> **Note:**
>
> You may now remove the HttpClient dependency from your project.
> The right version of it is already included within the `restz-hc###` connector.

Create any kind of HttpClient connection pool, configure it in any way you want
```java
HttpClientConnectionManager connectionPool = new PoolingHttpClientConnectionManager();
```

Create an `ExecutorFactory` with that connection pool
```java
ExecutorFactory executorFactory = new HC435ExecutorFactory(connectionPool);
```

That it.
We've got everything we need to start making rest calls.

Now let's say we have a POST endpoint at *http://mydomain:8080/restz/test* that receives an entity named TestRequest and returns an entity named TestResponse, we'll need to:
```java
Executor executor = executorFactory.get();

RequestBuilder requestBuilder = new RequestBuilder("http://mydomain:8080/restz/test", HttpVerb.POST)
	.setEntity(testRequest);

ResTZ restz = new ResTZ(executor);
TestResponse testResponse = restz.execute(requestBuilder, TestResponse.class);
```

ResTZ will handle serialization back and forth.

## ResponseReadingStrategy

ResTZ is built in a way that understands your needs.
It'll deserialize the response to whatever class you'd want, but it'll also understand that if you ask for `InputStream`, then it means just that - return the response stream as it is. If you want it to convert the response to `String` that's fine as well. If you need the response to be deserialized, but you also want the HTTP status or perhaps some of the headers, then simply ask for `ResponseEntity<T>`. If you're not entirely sure what the response is, then just ask for a raw `Response`.

The component that is responsible for this is called `ReponseReadingStrategy`.
ResTZ comes with a couple of such predefined strategies that enables you some real level of flexibility.

If you want, you can of course create your own `ReponseReadingStrategy` and pass it along as a parameter to the `ResTZ` executor.

## Layers

Layers are somewhat smart extension points to the ResTZ framework.

Currently, we have two different types of layers:

 - `ExecutionWrapperLayer` which has before and after execution methods, so you can add any special headers just before the request is sent, globally to the API.
 - `RecoverableFailureLayer` which is a smart mechanism for detecting failures, deal with them and then automatically retry the original request (e.g., as in OAuth token expiration)

ResTZ comes with a small set of predefined layers that deal with OAuth & Basic authentications.

### OAuth Layer

OAuth is a great example of a layer that is both `ExecutionWrapperLayer` and `RecoverableFailureLayer`, because:

1. You need to add the `Authorization: BEARER access_token` header before every execution.
2. You need to deal with **HTTP 401 Unauthorized** and refresh the token when it expires.
3. Retry the original request if it has failed because of token expiration.

When dealing with a certain REST API that supports OAuth you should:

1. Inherit from either `BasicOAuth2Layer` or `AbstractOAuth2Layer<C, T>`.
2. Add your implementation to a `LayerCollection`.
3. Pass that layer collection to the `ResTZ` executor whenever needed.

## Good to Know
We've gathered a list of important things you should be aware of, before you start using ResTZ in your project:

Aspect   		 | Know that..
---------------- | -----------
Threading		 | `Executor` cannot execute multiple requests simultaneously, because **`Executor` isn't thread-safe**. It can, however, execute multiple consequent requests. This is why we only call `ExecutorFactory.get()` once at the beginning of every sequence of requests.
Async   		 | Async operations aren't supported yet. This will be addressed in the near future, but for the time being, you must handle async requests manually (e.g., by running the `ResTZ` executor in a side-thread).
DateFormat		 | The default `ResponseReadingStrategy` and its default `Serializer` component are set to parse and format `Date` fields according to  ISO-8601 ([RFC-3339](https://www.ietf.org/rfc/rfc3339.txt)) standard. For example, the moment of **Nov 05 08:15:30 AM EST 1994** will match both **1994-11-05T08:15:30-05:00** and **1994-11-05T13:15:30Z**.
`ResTZ` Overrides	| The `ResTZ`'s constructor accepts optional `LayerCollection` and/or `ResponseReadingStrategy` that will affect every request it executes. Those can be overridden on per-execution basis.
Request Overrides	| It often happens that we want to configure a timeout for the entire connection pool and at the same time, to be able to override it for a specific request. In such a case, we'd need to inherit from the connector's `HC###ExecutorFactory` and add another `get(long timeout)` method ourselves.

## Roadmap

Next releases of ResTZ will focus on the following features:

Feature | Description
------- | -----------
Async | Adding support for async operations using `Future<T>`.
Batch | Adding a mechanism for executing a sequence of requests, possibly depended one on another.

repository: jivesoftware/restz-framework

repo_name: jivesoftware/restz-framework


text:
# Go vs Java
This repository contains the examples of my meetup talk Go vs Java.
I like both, Go and Java, and I try to be as unbiased as possible.

## POSIX
Package POSIX contains implementations of fundamental programs in C, Go, and Java.
The purpose of this directory is to demonstrate how suited the languages are for developing simple command line tools.

repository: christianhujer/go-vs-java

repo_name: christianhujer/go-vs-java


text:
WizyTówka 5
===

Simple PHP-written content management system for small websites. Currently in development. Licensed on 3-clause BSD license.

The repository is divided into four separate directories:

* `code` — main code directory; only files from here are needed to build releases and run this application;
* `tests` — unit tests, based on PHP Unit framework;
* `docs` — documentation files, written in Polish using Markdown files; there is no inline code documentation;
* `others` — additional files: command line utility scripts, some configuration files, artworks.

The user interface supports Polish only as this project is indented to be used by Polish websites.

The application requires PHP 7.1 or newer. SQLite, MySQL and PostgreSQL databases are supported. Tested on Linux and FreeBSD, with Apache and nginx. Other parts of this repository can require the newest PHP version. Unit tests require xdebug extension.


text:
# Exercise 5
## Structs, unions and bitfields

Reading: Chapter 5 of *Head First C*, Chapter 5 of *Think OS*, and
[this paper about generating random floating-point
values](http://allendowney.com/research/rand/downey07randfloat.pdf)

1) In this directory, read over `rand.c` and `test1.c`, then
compile and run `test1.c`.  It should generate 10000 random numbers
between 0 and 1.

2) If you pipe the output from `test1.c` into `check_uniform.py`, it should
plot the CDF of the values generated by `test1.c`.  If the values
are uniformly distributed from 0 to 1, the result should be a straight
line.

3) Repeat this test with `test2.c` to confirm that the values generated
by `my_random_float` have the right distribution.

4) Read through `time_rand.c`, then compile and run it.  Which
random number generator is the fastest?

Here's the output that I got:

```
256.000000 ms 	 dummy
812.000000 ms 	 dummy2
824.000000 ms 	 random_float
888.000000 ms 	 my_random_float
2032.000000 ms 	 my_random_float2
```

If the `dummy` functions don't count, then it looks like the standard algorithm is the fastest by about 64 ms.

5) Fill in the body of `my_random_double` to generate random doubles,
rather than floats.  Test it to see if it
returns numbers uniformly distributed from 0 to 1.

So... I think I did the calculations correctly (how many bits to allocate for the exponent, and how many for the coefficient), but I couldn't get `my_random_double` to return anything but 0's. Some theories:

```
    while (1) {
        x = rand();
        if (x == 0) {
            exp -= 63;
        } else {
            break;
        }
    }
```

This code maybe isn't generating enough random bits? I should have 63 random bits, but I think this code only generates up to 32 (because that's what `rand()` does).

```
    mant = x >> 12;
    b.i = (exp << 52) | mant;
```

Alternatively, I think maybe this code just isn't shifting the bits by the correct amount.

6) Modify `time_rand.c` to compare `my_random_double` and
`random_double`.  Which is faster?

Here's the output that I get now:

```
832.000000 ms 	 random_double
2020.000000 ms 	 my_random_double
```

The standard algorithm is still way faster, it seems.

7) Check in your modified version of `rand.c` and `time_rand.c`.

## Object-oriented C

1) In this directory you should find

*  find_track.c: A solution from `ex02.5`.

*  find_track_oo.c: An outline of an object-oriented solution, which you will fill in.

Compile and run `find_track.c`, just to make sure it still works.

2) Compile and run find_track_oo.c.  It should compile and run, but
not find any tracks.

3) Fill in the bodies of the empty functions and get find_track_oo.c working.

4) Check `find_track_oo.c` in to the repo.

repository: YehEmily/ExercisesInC

repo_name: YehEmily/ExercisesInC


text:
# Tiny Engine

[![npm](https://img.shields.io/npm/v/nativescript-tinyengine.svg)](https://github.com/Upd4ting/nativescript-tinyengine) [![npm license](https://img.shields.io/npm/l/nativescript-tinyengine.svg)](https://github.com/Upd4ting/nativescript-tinyengine)

A little 2d game engine for nativescript.

## Installation

```javascript
tns plugin add nativescript-tinyengine
```

## Screenshots

![Screenshot](https://i.gyazo.com/6a5f01f95c2bdbbeb4dd80e848443c0a.gif)

## Usage

First in your `XML` you need to add a `GridLayout`

```xml
<GridLayout id="container" width="300" height="300" backgroundColor="lightgreen">

</GridLayout>
```

then in your `typescript` file import everything required

```typescript
import { World, Entity, Vector2, OBB, CollisionResponse, Shape, Component, CircleShape, CubeShape, ImageShape } from 'nativescript-tinyengine';
```

now you just need to instantiate a World object on your GridLayout and start using this library. Here is a basic code.

```typescript
let container: LayoutBase = page.getViewById("container");

let world: World = new World(container, 300, 300);

let cubeEntity: Entity = new Entity(new Vector2(0, 50), new Vector2(0, 0), 45, new CubeShape(20, 20, '#FFFFFF'));
world.addEntity(cubeEntity);

setInterval(function () { world.tick(); }, 20);
```

## Documentation

You can find the documentation of the library [here](https://upd4ting.github.io/nativescript-tinyengine/)

## Components / Collisions

`Component` is an interface that you can implements. This interface has the following methods:

-	`onStart(entity: Entity)` Called before the first frame update of the attached entity.
-	`onUpdate(entity: Entity, deltatTime: number)` Called at each frame update of the attached entity.
-	`onCollide(collider: Entity, collided: Entity)` Called when the attached entity collide with an other entity.
-	`onDestroy(entity: Entity)` Called when the attached entity is destroyed.
-	`getClassName(): string` You need to return your class name in this method.

Components can be attached throught the `addComponent<T extends Component>(type: (new () => T))` of the Entity class.

Each entity got a property `collisionResponse` which can be set to `NONE` or `COLLIDE`. That's how are handled collision. If you want to have something custom, put the collision response to `NONE` and do your custom logic into `onCollide(collider: Entity, collided: Entity)` of a component.

## License

Apache License Version 2.0, May 2019


text:
### Testing Tools

- [JMeter](https://github.com/apache/jmeter)

- [Siege](https://github.com/JoeDog/siege)

Siege is an http load tester and benchmarking utility

- webbench

- apachebench ab

- [locust](https://github.com/locustio/locust/)

Scalable user load testing tool written in Python. https://locust.io/ 这个工具看上去非常棒.

- [goreplay](https://github.com/buger/goreplay)

GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes. https://goreplay.org

可以考虑替代 tcpcopy

- tcpcopy

- [wrk](https://github.com/wg/wrk)

Modern HTTP benchmarking tool. 纯压力测试可以考虑使用

- [http_bench](https://github.com/linkxzhou/http_bench)

使用 go 写的简单的 http bench

- https://github.com/awesome-soft/awesome-devops/blob/master/README.md#bench-test

repository: shniu/middleware-eco

repo_name: shniu/middleware-eco


text:
# ChainerRL
[![Build Status](https://travis-ci.org/chainer/chainerrl.svg?branch=master)](https://travis-ci.org/chainer/chainerrl)
[![Coverage Status](https://coveralls.io/repos/github/chainer/chainerrl/badge.svg?branch=master)](https://coveralls.io/github/chainer/chainerrl?branch=master)
[![Documentation Status](https://readthedocs.org/projects/chainerrl/badge/?version=latest)](http://chainerrl.readthedocs.io/en/latest/?badge=latest)
[![PyPI](https://img.shields.io/pypi/v/chainerrl.svg)](https://pypi.python.org/pypi/chainerrl)

ChainerRL is a deep reinforcement learning library that implements various state-of-the-art deep reinforcement algorithms in Python using [Chainer](https://github.com/chainer/chainer), a flexible deep learning framework.

![Breakout](assets/breakout.gif)
![Humanoid](assets/humanoid.gif)
![Grasping](assets/grasping.gif)
![Atlas](examples/atlas/assets/atlas.gif)

## Installation

ChainerRL is tested with 3.5.1+. For other requirements, see [requirements.txt](requirements.txt).

ChainerRL can be installed via PyPI:
```
pip install chainerrl
```

It can also be installed from the source code:
```
python setup.py install
```

Refer to [Installation](http://chainerrl.readthedocs.io/en/latest/install.html) for more information on installation.

## Getting started

You can try [ChainerRL Quickstart Guide](examples/quickstart/quickstart.ipynb) first, or check the [examples](examples) ready for Atari 2600 and Open AI Gym.

For more information, you can refer to [ChainerRL's documentation](http://chainerrl.readthedocs.io/en/latest/index.html).

## Algorithms

| Algorithm | Discrete Action | Continous Action | Recurrent Model | Batch Training | CPU Async Training |
|:----------|:---------------:|:----------------:|:---------------:|:--------------:|:------------------:|
| DQN (including DoubleDQN etc.) | ✓ | ✓ (NAF) | ✓ | ✓ | x |
| Categorical DQN | ✓ | x | ✓ | ✓ | x |
| Rainbow | ✓ | x | ✓ | ✓ | x |
| IQN | ✓ | x | ✓ | ✓ | x |
| DDPG | x | ✓ | ✓ | ✓ | x |
| A3C  | ✓ | ✓ | ✓ | ✓ (A2C) | ✓ |
| ACER | ✓ | ✓ | ✓ | x | ✓ |
| NSQ (N-step Q-learning) | ✓ | ✓ (NAF) | ✓ | x | ✓ |
| PCL (Path Consistency Learning) | ✓ | ✓ | ✓ | x | ✓ |
| PPO  | ✓ | ✓ | ✓ | ✓ | x |
| TRPO | ✓ | ✓ | ✓ | ✓ | x |
| TD3 | x | ✓ | x | ✓ | x |
| SAC | x | ✓ | x | ✓ | x |

Following algorithms have been implemented in ChainerRL:
- [A2C (Synchronous variant of A3C)](https://openai.com/blog/baselines-acktr-a2c/)
  - examples: [[atari (batched)]](examples/atari/train_a2c_ale.py) [[general gym (batched)]](examples/gym/train_a2c_gym.py)
- [A3C (Asynchronous Advantage Actor-Critic)](https://arxiv.org/abs/1602.01783)
  - examples: [[atari reproduction]](examples/atari/reproduction/a3c) [[atari]](examples/atari/train_a3c_ale.py) [[general gym]](examples/gym/train_a3c_gym.py)
- [ACER (Actor-Critic with Experience Replay)](https://arxiv.org/abs/1611.01224)
  - examples: [[atari]](examples/atari/train_acer_ale.py) [[general gym]](examples/gym/train_acer_gym.py)
- [Asynchronous N-step Q-learning](https://arxiv.org/abs/1602.01783)
  - examples: [[atari]](examples/atari/train_nsq_ale.py)
- [Categorical DQN](https://arxiv.org/abs/1707.06887)
  - examples: [[atari]](examples/atari/train_categorical_dqn_ale.py) [[general gym]](examples/gym/train_categorical_dqn_gym.py)
- [DQN (Deep Q-Network)](https://storage.googleapis.com/deepmind-media/dqn/DQNNaturePaper.pdf) (including [Double DQN](https://arxiv.org/abs/1509.06461), [Persistent Advantage Learning (PAL)](https://arxiv.org/abs/1512.04860), Double PAL, [Dynamic Policy Programming (DPP)](http://www.jmlr.org/papers/volume13/azar12a/azar12a.pdf))
  - examples: [[atari reproduction]](examples/atari/reproduction/dqn) [[atari]](examples/atari/train_dqn_ale.py) [[atari (batched)]](examples/atari/train_dqn_batch_ale.py) [[flickering atari]](examples/atari/train_drqn_ale.py) [[general gym]](examples/gym/train_dqn_gym.py)
- [DDPG (Deep Deterministic Policy Gradients)](https://arxiv.org/abs/1509.02971) (including [SVG(0)](https://arxiv.org/abs/1510.09142))
  - examples: [[mujoco reproduction]](examples/mujoco/reproduction/ddpg) [[mujoco]](examples/mujoco/train_ddpg_gym.py) [[mujoco (batched)]](examples/mujoco/train_ddpg_batch_gym.py)
- [IQN (Implicit Quantile Networks)](https://arxiv.org/abs/1806.06923)
  - examples: [[atari reproduction]](examples/atari/reproduction/iqn) [[general gym]](examples/gym/train_iqn_gym.py)
- [PCL (Path Consistency Learning)](https://arxiv.org/abs/1702.08892)
  - examples: [[general gym]](examples/gym/train_pcl_gym.py)
- [PPO (Proximal Policy Optimization)](https://arxiv.org/abs/1707.06347)
  - examples: [[mujoco reproduction]](examples/mujoco/reproduction/ppo) [[atari]](examples/atari/train_ppo_ale.py) [[mujoco]](examples/mujoco/train_ppo_gym.py) [[mujoco (batched)]](examples/mujoco/train_ppo_batch_gym.py)
- [Rainbow](https://arxiv.org/abs/1710.02298)
  - examples: [[atari reproduction]](examples/atari/reproduction/rainbow)
- [REINFORCE](http://www-anw.cs.umass.edu/~barto/courses/cs687/williams92simple.pdf)
  - examples: [[general gym]](examples/gym/train_reinforce_gym.py)
- [SAC (Soft Actor-Critic)](https://arxiv.org/abs/1812.05905)
  - examples: [[mujoco reproduction]](examples/mujoco/reproduction/soft_actor_critic)
- [TRPO (Trust Region Policy Optimization)](https://arxiv.org/abs/1502.05477) with [GAE (Generalized Advantage Estimation)](https://arxiv.org/abs/1506.02438)
  - examples: [[mujoco]](examples/mujoco/train_trpo_gym.py)
- [TD3 (Twin Delayed Deep Deterministic policy gradient algorithm)](https://arxiv.org/abs/1802.09477)
  - examples: [[mujoco reproduction]](examples/mujoco/reproduction/td3)

Following useful techniques have been also implemented in ChainerRL:
- [NoisyNet](https://arxiv.org/abs/1706.10295)
  - examples: [[Rainbow]](examples/atari/reproduction/rainbow) [[DQN/DoubleDQN/PAL]](examples/atari/train_dqn_ale.py)
- [Prioritized Experience Replay](https://arxiv.org/abs/1511.05952)
  - examples: [[Rainbow]](examples/atari/reproduction/rainbow) [[DQN/DoubleDQN/PAL]](examples/atari/train_dqn_ale.py)
- [Dueling Network](https://arxiv.org/abs/1511.06581)
  - examples: [[Rainbow]](examples/atari/reproduction/rainbow) [[DQN/DoubleDQN/PAL]](examples/atari/train_dqn_ale.py)
- [Normalized Advantage Function](https://arxiv.org/abs/1603.00748)
  - examples: [[DQN]](examples/gym/train_dqn_gym.py) (for continuous-action envs only)
- [Deep Recurrent Q-Network](https://arxiv.org/abs/1507.06527)
  - examples: [[DQN]](examples/atari/train_drqn_ale.py)

## Visualization

ChainerRL has a set of accompanying [visualization tools](https://github.com/chainer/chainerrl-visualizer) in order to aid developers' ability to understand and debug their RL agents. With this visualization tool, the behavior of ChainerRL agents can be easily inspected from a browser UI.

## Environments

Environments that support the subset of OpenAI Gym's interface (`reset` and `step` methods) can be used.

## Contributing

Any kind of contribution to ChainerRL would be highly appreciated! If you are interested in contributing to ChainerRL, please read [CONTRIBUTING.md](CONTRIBUTING.md).

## License

[MIT License](LICENSE).

## Citations

To cite ChainerRL in publications:

```
@InProceedings{fujita2019chainerrl,
  author = {Fujita, Yasuhiro and Kataoka, Toshiki and Nagarajan, Prabhat and Ishikawa, Takahiro},
  title = {ChainerRL: A Deep Reinforcement Learning Library},
  booktitle = {Workshop on Deep Reinforcement Learning at the 33rd Conference on Neural Information Processing Systems},
  location = {Vancouver, Canada},
  month = {December},
  year = {2019}
}
```

repository: VictorGardi/CustomerBehaviour

repo_name: VictorGardi/CustomerBehaviour


text:
# JavaScript-Game-VTU

## How to start
1. Change the "node" version to 12.19.0 and the "npm" version to 6.14.8 (use "nvm" to change the node version)
2. Install the required packages by writing in terminal -> "npm install"
3. To start the application:
    1. On developer mode write in terminal -> "npm run develop"
    2. On production mode write in terminal -> "npm run production"

repository: PetarKTodorov/JavaScript-Game-VTU

repo_name: PetarKTodorov/JavaScript-Game-VTU


text:
# rumors-deploy
Deployment scripts for g0v rumors project

## Configuration

We provides 2 versions of docker-compose.yml:
- `docker-compose.sample.yml`: Minimal setup to get all Cofacts service running on a single computer.
- `docker-compose.production.yml`: The actual setup (with secrets redacted) that is running on cofacts.g0v.tw . The differences are:
    - We run productin LINE bot service on heroku, thus there is no `line-bot` and `redis` in `docker-compose.production.yml`
    - Additionally, `nginx` is added as a reverse-proxy and serves https certificates.

Before moving to next step, you are expected to create your own `docker-compose.yml` using the above mentioned file as reference.

Explanation of each environment variables are in `.env.sample` of the corresponding [repository](https://github.com/cofacts/).

## Prerequisites

1. docker & docker-compose
2. git

## Deploy steps

0. `su` to appropriate user (for instance, `docker`)
1. Clone this repo on production server
2. Make necessary changes to `docker-compose.yml` and files in `volumes/`
3. `docker-compose up -d`

If you want ot run the whole cofacts on the laptop, you may find this note useful:
http://bit.ly/run-cofacts

## Updating any image

After image change:
```
$ docker-compose pull <name>
$ docker-compose up --no-deps -d <name>
```

After changings file in `volumes/`:

```
$ docker-compose restart <name>
```

where `<name>` can be `nginx`, `site`, `api` and `db`.

## Crontab setup

`crontab -e` and add:
```
0 0 1 * * docker run --rm -v /var/www/cofacts:/var/www/cofacts -v /etc/letsencrypt:/etc/letsencrypt -v /etc/ssl/certs:/etc/ssl/certs -v /var/log:/var/log certbot/certbot certonly --webroot -w /var/www/cofacts -d cofacts.g0v.tw -m <your@email> --agree-tos --non-interactive >> /var/log/cron.log 2>&1
5 0 1 * * docker run --rm -v /var/www/cofacts:/var/www/cofacts -v /etc/letsencrypt:/etc/letsencrypt -v /etc/ssl/certs:/etc/ssl/certs -v /var/log:/var/log certbot/certbot certonly --webroot -w /var/www/cofacts -d cofacts-api.g0v.tw -m <your@email> --agree-tos --non-interactive >> /var/log/cron.log 2>&1
0 1 1 * * cd /home/docker/rumors-deploy; /usr/local/bin/docker-compose restart nginx >> /var/log/cron.log 2>&1
5 0 * * * cd /home/docker/rumors-deploy; /usr/local/bin/docker-compose exec -T api node build/scripts/cleanupUrls.js >> /var/log/cron.log 2>&1
```

## Available Scripts

There are some handy scripts under `scripts/` directory:

### `check-url-resolver.sh`

Prints URL resolver stat from currently running url-resolver

### `update-line-bot-token.sh`

You should [install jq](https://stedolan.github.io/jq/download/) first.
sudo apt-get install jq

Use `heroku authorizations:create` to create a token that [expires at a specific time or never expires](https://help.heroku.com/PBGP6IDE/how-should-i-generate-an-api-key-that-allows-me-to-use-the-heroku-platform-api).

Get `CHANNEL_ID`, `CHENNEL_SECRET` form [line developer console](https://developers.line.biz/console/).

Get `APP_NAME` form heroku.

repository: nonumpa/rumors-deploy

repo_name: nonumpa/rumors-deploy


text:
# Pop

A Pop component is a Component that abstracts logic related to mounting and auto-positioning the child component to the DOM, relative to it's original target element.

This component is powered by [Popper.js](https://popper.js.org/) the evolution of [Drop](../Drop).

## Components

The Toolbar component is comprised of smaller components:

* [Arrow](./docs/Arrow.md)
* [Manager](./docs/Manager.md)
* [Popper](./docs/Popper.md)
* [Reference](./docs/Reference.md)

repository: etangreal/hsds-react

repo_name: etangreal/hsds-react


text:
# Locale Middleware for Vulcan Proxy
The Locale Middleware for the Unique USA API Gateway will set headers on the requests before passing them on to their final desitnation.

These headers are:

    Accept-Language
    Accept-Currency

The values for the headers will be driven by the configuration, which is a YAML file. These values will be mapped by domain, and that domain is expected to be in the `Origin` header of the request

## Install
```
go get github.com/uniqueusa/vulcan-locale
```

## Usage
This presumes you have built new `vulcand` and `vctl` binaries per [the instructions](http://vulcanproxy.com/middlewares.html#example-auth-middleware). Basically, you should be able to add `github.com/skookum/vulcan-cors` to your registry and build your `vulcand` and `vctl` binaries.

1. Create a YAML file of your domains with their locales and currencies:
```
esalerugs.com:
  locales:
    - en_US
  currencies:
    - usd
irugs.ch:
  locales:
    - en_GB
    - de_DE
    - fr_FR
    - nl_NL
  currencies:
    - eur
    - franc
irugs.sk:
  locales:
    - sk_SK
  currencies:
    - eur
irugs.ca:
  locales:
    - en_US
  currencies:
    - cad
```

2. Add the middleware
```
vctl locale upsert -id=locale_middleware-f someFrontend -configFile=yourYaml.yml --vulcan=http://yourvulcanhost
```
(`-id` can be whatever you want to call the instance of the middleware)

3. Make requests!

### Remove
```
vctl locale rm -id locale_middeware -f someFrontend --vulcan=http://yourvulcanhost
```

## Contributing
1. Write tests
2. Write code
3. Run tests until they pass
4. Run `codeclimate analyze` and fix suggestions
5. Issue PR

repository: uniqueusa/vulcan-locale

repo_name: uniqueusa/vulcan-locale


text:
---
id: async
title: Async producers & createDraft / finishDraft
sidebar_label: Async produce / createDraft
---

    egghead.io lesson 11: Creating _async_ producers (and why you shouldn’t)

    Hosted on egghead.io

It is allowed to return Promise objects from recipes. Or, in other words, to use `async / await`. This can be pretty useful for long running processes, that only produce the new object once the promise chain resolves. Note that `produce` itself (even in the curried form) will return a promise if the producer is async. Example:

```javascript
import produce from "immer"

const user = {
	name: "michel",
	todos: []
}

const loadedUser = await produce(user, async function(draft) {
	draft.todos = await (await window.fetch("http://host/" + draft.name)).json()
})
```

_Warning: please note that the draft shouldn't be 'leaked' from the async process and stored else where. The draft will still be revoked as soon as the async process completes._

## `createDraft` and `finishDraft`

`createDraft` and `finishDraft` are two low-level functions that are mostly useful for libraries that build abstractions on top of immer. It avoids the need to always create a function in order to work with drafts. Instead, one can create a draft, modify it, and at some time in the future finish the draft, in which case the next immutable state will be produced. We could for example rewrite our above example as:

```javascript
import {createDraft, finishDraft} from "immer"

const user = {
	name: "michel",
	todos: []
}

const draft = createDraft(user)
draft.todos = await (await window.fetch("http://host/" + draft.name)).json()
const loadedUser = finishDraft(draft)
```

Note: `finishDraft` takes a `patchListener` as second argument, which can be used to record the patches, similarly to `produce`.

_Warning: in general, we recommend to use `produce` instead of the `createDraft` / `finishDraft` combo, `produce` is less error prone in usage, and more clearly separates the concepts of mutability and immutability in your code base._

repository: pbadenski/immer

repo_name: pbadenski/immer


text:
# xAP Level I Driver

----
:!:

**This driver is not not available anymore from version 1.1.0**
:!:
----

**Available for:** Windows, Linux

**Driver for Windows** vscpl1_xapdrv.dll (vscpl1_xapdrv.lib)
**Driver for Linux** vscpl1_xapdrv.so

This is a driver that make the VSCP/CANAL daemon behaves like a xAP server or client. If no other server is detected when the driver is loaded it will start up in server mode. If a server is detected it will start up in client mode and connect to that server.

As this is a driver only Level I events will be transferred between VSCP and xAP.

## Parameter String

    uid;port

where

##### uid

is the ID for this device. Use a different ID for every device. Defaults to 9598.

##### port

Port is the xAP port and defaults to 3639.

## Flags

Not used at the moment.

##  Status return

Not used at the moment.

\\
----
{{  ::copyright.png?600  |}}

```
```Grodans Paradis AB```
```

repository: grodansparadis/vscp-graphics

repo_name: grodansparadis/vscp-graphics


text:
# Fitness Tracker
Easily reach fitness goals more quickly by tracking workout progress using this app.

## Table of Contents
1. [Description](#description)
2. [Screenshots](#screenshots)
3. [Deployed Application](#deployed-application)
4. [License](#license)

## Description
This is a fitness tracking app utilizing a Mongo database with a Mongoose Schema and routes handles with Express. Users are able to add exercises to a previous workout plan, add new exercises to a new worklout plan, and view the combined weight of multiple exercises on the stats page.

## Screenshots

### Index displaying Last Workout Data
![Screenshot Index](https://github.com/lhooper921/fitnessTracker/blob/main/public/images/screenshotIndex.PNG)

### Workout Dashboard
![Screenshot Dashboard](https://github.com/lhooper921/fitnessTracker/blob/main/public/images/screenshot1.PNG)

### Add Exercise Page
![Screenshot Add Exercise Page](https://github.com/lhooper921/fitnessTracker/blob/main/public/images/screenshot2.PNG)

### Resistance Form

![Screenshot Resistance Form](https://github.com/lhooper921/fitnessTracker/blob/main/public/images/screenshot3.PNG)

## Deployed Application

https://gory-pumpkin-85153.herokuapp.com/

## License

MIT License

Copyright (c) [2020] [Lauren Hooper]

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

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

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


text:
Checklists are Awesome!
-----------------------

Everybody loves checklists, and now you can have them in Manuscript.

 - Start a new checklist on the sidebar of the case view
 - Add, change, reorganize, delete, and complete items easily

![Create a Checklist from scratch](https://cdn.glitch.com/3ac0c3f6-40e7-4fd1-be5e-348efc28126f%2Fchecklist%20from%20empty.gif?1512877547974) ![Create a Checklist from a Template](https://cdn.glitch.com/3ac0c3f6-40e7-4fd1-be5e-348efc28126f%2Fchecklist%20from%20template.gif?1512877548183)

Embeddable in Manuscript using public/customization.js. Just fill in the matching .env values on lines 5 and 6 and paste into the js section of a [customization](http://help.fogcreek.com/11209/applying-client-side-style-and-script-customizations?manuscript=1). No need for any css in the customization

Helpful hints:

 - Changed your mind? To delete a checklist, remove all the items
 - Have a common checklist for many cases? Create named templates by visiting /checklist/<your template name>, add your items, and then click the "Save as Template" button
 - Remix this app for complete control over, well, everything! :)

Made by Fog Creek
-----------------

\ ゜o゜)ノ

[Project icon](https://www.flaticon.com/free-icon/checklist-square-interface-symbol-of-rounded-corners_39862) made by Freepik from [www.flaticon.com](https://www.flaticon.com)


text:
# udp-multicast
A simple c++ library to send and receive udp multicast. Goal of this library is to provide a cleaner interface for sending and receiving UDP Multicast data. This code is tested with a gcc compiler in linux and can be modified to work with windows or any other operating system with miniamal changes.

Multicast is a kind of UDP traffic similar to BROADCAST, but only hosts that have explicitly requested to receive this kind     of traffic will get it.

This means that you have to JOIN a multicast group if you want to receive traffic that belongs to that group.
IP addresses in the range <IP_ADDRESS> to <IP_ADDRESS> ( Class D addresses) belongs to multicast.
No host can have this as IP address, but every machine can join a multicast address group.

Multicast traffic is only UDP (not reliable).
Multicast migth be 1 to many or 1 to none.
Not all networks are multicast enabled (Some routers do not forward Multicast).

Range Start Address     Range End Address           Description

<IP_ADDRESS>               <IP_ADDRESS>                 Reserved for special “well-known” multicast addresses.

<IP_ADDRESS>               <IP_ADDRESS>             Globally-scoped (Internet-wide) multicast addresses.

<IP_ADDRESS>               <IP_ADDRESS>             Administratively-scoped (local) multicast addresses.

repository: rajatprasun/udp-multicast

repo_name: rajatprasun/udp-multicast


text:
# Requests for Data

In this chapter we will be playing with some real life data and making some [http requests](https://www.tutorialspoint.com/http/http_requests.htm).
This is a rather common part for modern applications,
so you probably might have done something similar in your previous programming adventures.

Performing this sort of tasks is something Clojure is really amazing at,
so I want to show you some of the better parts of our favorite language.

Some of the documentation for the tools we will be using is a bit lengthy or tricky,
so we'll get you started with them.
We will show you the ropes of it,
as well as point you to right direction for the future readings.

## Our project - Reddit Analyser

More specifically we will be building a small application that fetches data from Reddit.
We will be analyzing the data for [Clojure subreddit](https://www.reddit.com/r/Clojure/).

Our solution will have following requirements:

1. Get 100 most recent posts from /r/Clojure from Reddit.

2. Print out only the good posts that have score higher than 25.

3. Print out the average score of a post.

4. Print out the number of posts per author.

5. Print out total score of each author.

6. Print out all links posted

7. Software can be requested to perform all the requested operations based on arguments given to it.

## Clojurians Community

Since we will scratched Reddit in this chapter,
I'll use that as an opportunity to talk a little bit about Clojure Community.

Clojure has very friendly and welcoming community.
When in doubt it is smart to ask for help,
rather than bang your head endlessly against the wall.
Some places are better for asking for help than others.
Instead of shouting to the wind I would recommend using following options:

### [/r/Clojure in Reddit](https://www.reddit.com/r/Clojure/)

If you are not familiar with this /r/Clojure I strongly recommend following it.
Not only is it a great source for latest Clojure news,
but there are lot of great discussions regarding the language and its ecosystem.

### [Clojurians Slack](http://clojurians.net/)

Another great media for Clojure is Clojurians Slack.
There you have numerous channels for discussion and many friendly and helpful fellow Clojurians to help you.
Additionally many Clojure's Core team members also participate to discussions regularly here.

There is also a dedicated beginners channel that you might wanna checkout!

### [Clojure User Groups](https://clojure.org/community/user_groups)

There are many Clojure user groups.
You can find more a bout them from the link above.
If such an old-school approach suits you better you might want to check them out.

## [1. HTTP Requests](1-http-requests.md)

We will learn how to make http requests in Clojure using clj-http library

## [2. Filtering Data](2-filtering-data.md)

We will learn about predicates and filters with real world data.

## [3. Reducing Complexity](3-reducing-complexity.md)

We will learn about reduce and how to effectively iterate data with it.

## [4. Reducing with Our Rules](4-reducing-with-our-rules.md)

We will learn how to use our own functions with reduce to create more custom fit solutions.

## [5. Partial Meetings](5-partial-meetings.md)

We will learn about partial and how to make use of it.

## [6. Give Me Links](6-give-me-links.md)

We will combine skills we learned in this section and before to get list of all the links posted to Reddit.

## [7. Console UI](7-console-ui.md)

We will build a console UI with recursion.

## [8. Function with No Name](8-function-with-no-name.md)

We learn about Anonymous Functions in Clojure and how to get rid of unnecessary helper functions.

## [9. Meet threading](9-meet-threading-macros.md)

We learn of threading macros and how to use the to simplify our code.

gha_language: Clojure


text:
# Dynatrace OneAgent

## Overview

This bundle of advanced actions allows you to integrate [NeoLoad](https://www.neotys.com/neoload/overview) and Dynatrace OneAgent to improve the analysis of a load testing test.

This bundle has the following actions:

* **DynatraceEvents**
  Links a load testing event to all services used by an Application monitored by Dynatrace

* **DynatraceMonitoring**
    * **Dynatrace -> NeoLoad**: Retrieve Infrastructure and Services metrics from DynaTrace and insert them in NeoLoad External Datas so that
      you can correlate NeoLoad and DynaTrace metrics within NeoLoad.
    * **NeoLoad -> Dynatrace**: Send the global statistics of the test to Dynatrace OneAgent so that it can be used as custom metrics
      in Dynatrace dashboards.

| Property | Value |
| -----| -------------- |
| Maturity | Experimental |
| Author   | Neotys Partner Team |
| License  | [BSD Simplified](https://www.neotys.com/documents/legal/bsd-neotys.txt) |
| NeoLoad  | 6.1 (Enterprise or Professional Edition w/ Integration & Advanced Usage and NeoLoad Web option required)|
| Requirements | NeoLoad Web SaaS subscription |
| Bundled in NeoLoad | No
| Download Binaries | See the [latest release](https://github.com/Neotys-Labs/Dynatrace/releases/latest)

## Installation

1. Download the [latest release](https://github.com/Neotys-Labs/Dynatrace/releases/latest)
1. Read the NeoLoad documentation to see [How to install a custom Advanced Action](https://www.neotys.com/documents/doc/neoload/latest/en/html/#25928.htm)

## Set-up

Once installed, how to use in a given NeoLoad project:

1. Create a User Path “Dynatrace”
1. Insert DynatraceEvents in the ‘End’ block.
1. Insert DynatraceMonitoring in the ‘Actions’ block.
1. Create a Population “Dynatrace” that contains 100% of User Path “Dynatrace”
1. In the Runtime section, select your scenario, select the “Dynatrace” population and define a constant load of 1 user.

## Parameters for Dynatrace Events

| Name             | Description |
| -----            | ----- |
| Dynatrace_ID     |  Id of your saas dynatrace environment (http://<id>.live.dynatrace.com) |
| Dynatrace_API_KEY| API key of your dynatrace account |
| Tags (optional)  | Dynatrace Tags of the services used by your SUT |
| EventStatus      |: status sent to dynatrace : START or STOP |
| Dynatrace_Managed_Hostname (Optional) | Hostname of your dynatrace managed environment |

## Parameters for Dynatrace Monitoring

Tip: Get NeoLoad API information in NeoLoad preferences: Project Preferences / REST API.

| Name             | Description |
| -----            | ----- |
| Dynatrace_ID     |  Id of your saas dynatrace environment (http://<id>.live.dynatrace.com) |
| Dynatrace_API_KEY| API key of your dynatrace account |
| Tags (optional)  | Dynatrace Tags of the services used by your SUT |
| EventStatus      |: status sent to dynatrace : START or STOP |
| Dynatrace_Managed_Hostname (Optional) | Hostname of your dynatrace managed environment |
| NeoLoadAPIHost   | IP address or Host of the DataExchange API |
| NeoLoadAPIport   | Port of the NL DataExchange API   |
| NeoLoadKeyAPI    | API key of the DataExchange API   |

## Status Codes

* NL-DynatraceMonitoring_ERROR: Issue while monitoring dynatrace
* NL-DynatraceEvent_ERROR: Error while sending the event to dynatrace

repository: neotys-rd/Dynatrace

repo_name: neotys-rd/Dynatrace


text:
# Contributing

## How to Contribute

This repository is built for the purpose of encouraging your contributions, big or small. Want to improve the website? Have an Idea? PRs are welcome!

Suggested way to contribute :

* Fork the project in GitHub
* Clone your forked repo locally
* Add your name to README.md
* Commit and push to your forked repository
* Create a PR from your fork to the main repo in GitHub
* Add a title and submit for review

### Your name on the README.md

* Add your name and social media to the README.md in the Guestbook section using this example:

````
### Your Name
 - [Link 1](https://www.example.com)
 - [Link 2](https://www.example.com)
 - [Link 3](https://www.example.com)
````

license: Unlicense

repository: mscraftsman/hacktoberfest-mauritius

gha_license_id: Unlicense

repo_name: mscraftsman/hacktoberfest-mauritius


text:
+++
draft = false

title = "Neural Networks Trained to Solve Differential Equations Learn General Representations"

# Date first published.
date = 2018-07-02

# Authors. Comma separated list, e.g. `["Bob Smith", "David Jones"]`.
authors = ["Martin Magill","Faisal Qureshi","Hendrick W. de Haan"]

# Publication type.
# Legend:
# 0 = Uncategorized
# 1 = Conference proceedings
# 2 = Journal
# 3 = Work in progress
# 4 = Technical report
# 5 = Book
# 6 = Book chapter
publication_types = ["3"]

# Publication name and optional abbreviated version.
publication = "Currently available on arXiv"
publication_short = ""

# Abstract and optional shortened version.
abstract = "We introduce a technique based on the singular vector canonical correlation analysis (SVCCA) for measuring the generality of neural network layers across a continuously-parametrized set of tasks. We illustrate this method by studying generality in neural networks trained to solve parametrized boundary value problems based on the Poisson partial differential equation. We find that the first hidden layer is general, and that deeper layers are successively more specific. Next, we validate our method against an existing technique that measures layer generality using transfer learning experiments. We find excellent agreement between the two methods, and note that our method is much faster, particularly for continuously-parametrized problems. Finally, we visualize the general representations of the first layers, and interpret them as generalized coordinates over the input domain."
abstract_short = "We studied the internal structure of deep neural networks trained to solve a parametrized family of boundary value problems. Using the SVCCA, we showed that the first layers reliably discover generalized coordinates over the input domain. These representations are general over a range of problem parameters."

# Featured image thumbnail (optional)
image_preview = "denns-generality-thumbnail.png"

# Is this a selected publication? (true/false)
selected = true

# Projects (optional).
#   Associate this publication with one or more of your projects.
#   Simply enter the filename (excluding '.md') of your project file in `content/project/`.
#   E.g. `projects = ["deep-learning"]` references `content/project/deep-learning.md`.
projects = []

# Links (optional).
url_pdf = ""
url_preprint = "https://arxiv.org/abs/1807.00042"
url_code = ""
url_dataset = ""
url_project = ""
url_slides = ""
url_video = ""
url_poster = ""
url_source = ""

# Custom links (optional).
#   Uncomment line below to enable. For multiple links, use the form `[{...}, {...}, {...}]`.
# url_custom = [{name = "Custom Link", url = "http://example.org"}]

# Does the content use math formatting?
math = true

# Does the content use source code highlighting?
highlight = true

# Featured image
# Place your image in the `static/img/` folder and reference its filename below, e.g. `image = "example.jpg"`.
[header]
#image = "denns-generality-thumbnail.png"
#caption = "The first 27 of 192 canonical components from the first layers of trained networks. The first 9 span the general representation learned consistently across random initializations and varying problem parameters."

+++

repository: mpcmagill/academic-kickstart

repo_name: mpcmagill/academic-kickstart


text:
## Cyber Naysh Chat  [![CircleCI](https://circleci.com/gh/dylanburati/CNChat.svg?style=svg)](https://circleci.com/gh/dylanburati/CNChat)

CNChat is a simple end-to-end encrypted chat application.
The server runs on Java and can accept any number of clients.
The client is written in JavaScript, and is intended to run in the browser.

In order to allow users to create conversations with offline users, the server
needs to read from a database of cryptographic keys, which each user provides with
two public keys and two *wrapped* private keys when they register.

The documentation goes in depth on [the key exchange protocol](https://dylanburati.github.io/CNChat/key-exchange.html) used, [how to run the ChatServer](https://dylanburati.github.io/CNChat/server.html), and [how to run the ChatClient](https://dylanburati.github.io/CNChat/client.html).

repository: dylanburati/CNChat

gha_language: Java

repo_name: dylanburati/CNChat


text:
---
title: 			"Sass/SCSS"
description: 	"CSS preprocessor."
proficiency:	4
identifier:		"home"
---

## What is it?
[Sass](http://sass-lang.com/) is another CSS preprocessor framework with built in features such as mixins, variables and functions.

## What is it like?
Fast, powerful, elegant and well documented. I use this for all projects I am working on in conjunction with the [Bourbon.io toolset](http://bourbon.io/).

## Projects
{{% categorised_projects taxonomy="frameworks" term="Sass" %}}


text:
------

**Blade on steroids** unlocks the full power of blade components.

If you find this package helpful, please consider sponsoring the maintainer:
- Sandro Gehri: **[github.com/sponsors/gehrisandro](https://github.com/sponsors/gehrisandro)**

> **Attention:** This package is still in early development.

## Table of Contents
- [Get Started](#get-started)
- [Configuration](#configuration)
- [Contributing](#contributing)

## Get Started
> **Requires [Laravel 10](https://github.com/laravel/laravel)**

First, install `Blade on steroids` via the [Composer](https://getcomposer.org/) package manager:

```bash
composer require gehrisandro/blade-on-steroids
```

Next, publish the configuration file:

```bash
php artisan vendor:publish --provider="BladeOnSteroids\BladeOnSteroidsServiceProvider"
```

This will create a `config/blade-on-steroids.php` configuration file in your project, which you can modify to your needs
using environment variables. For more information, see the [Configuration](#configuration) section:

## Configuration

> TODO

## Contributing

Thank you for considering contributing to `Blade on steroids`! The contribution guide can be found in the [CONTRIBUTING.md](CONTRIBUTING.md) file.

---

`Blade on steroids` is an open-sourced software licensed under the **[MIT license](https://opensource.org/licenses/MIT)**.

repository: gehrisandro/blade-on-steroids

repo_name: gehrisandro/blade-on-steroids


text:
#Market_Risk_Management_of_Stock_Market_Trends_and_Dynamic_Portfolio_Allocation:

In this project we used Market Risk Management with Time Series Prediction of Stock Market Trends:
ARMA, ARIMA, GARCH regression models and RNN for time series analysis and prediction of short-term tends in stock prices.
Also the model is trained so that it can be used for short-term trading decisions based on projected market trends Dataset(extracted from Quandl):
Amazon (AMZ),
BP,
Ford,
Apple,
Abbot Laboratory daily historical stock data from 1979- 2017


text:
# Honeybee

Honeybee is a reference architecture for automated testing of APIs using .NET Core.

## Design

Honeybee is designed specifically for rapid automation. This allows for more time to be spent on having a wide variety of tests versus spending time on setup for every new test. Honeybee achieves this by using a base class for shared methods, as well as using FluentAssertions for human-readable assertions for a variety of scenarios.

## Performance

Honeybee sacrifices performance for easy automation and readable design. Because our API calls may modify a database, and may overwrite data, we typically run our tests serially rather than in parallel to allow the tests to be completely independent of one another. This is only a recommendation and it is possible to set tests up to be run in parallel, but it is recommended to reset any back-end data storage back to some base state before every test that writes to that data. This data reset can be done in the constructor of the base class as that is run before each individual test.

## Setup

1.  Clone the repository
2.  Open the solution in Visual Studio (optional if you know what you're doing)
3.  Build the project
4.  Done.

It's that easy. From there, you **should** probably modify the tests, base class, and models to fit something closer to your needs.

## Dependencies & Reasoning

### xUnit

The unit testing framework xUnit is used because of its flexibility with Theory's and its built in test isolation with one object per test method. This means that fields are re-initialized after every test, which aids in test isolation.

### Fluent Assertions

Fluent Assertions was chosen because of its easy readability and extensive built in functionality. It allows one line assertions to verify complex situations in a much more understandable way than the built in assertions library.

### RestSharp

RestSharp was chosen because of how easily it is able to handle authentication. It also has automatic serialization and easy extensibility to allow easy deserialization.

## Adapting Honeybee for your own project

### Honeybee.Test.Common

- `appsettings.local.json`
  - Store tokens, keys, etc., here that you don't want checked into source control
  - Should be in the root of Honeybee.Test.Common
- `Models/`
  - For every high level model, we have them named with the schema:
    `{Action}{Object}{Response/Request}Model`
    For example, the class that would be POST-ed to create a new Order would be called:
    `CreateOrderRequestModel`
- `BaseApi_Test.cs`
  - The project is currently configured to run all tests serially, remove `[Collection("Sequential")]` to run all tests in parallel. Or, if there are groups of tests which **can** be run parallel to your main API tests, you can create another base class that extends `BaseApi_Test.cs` with a different collection name.
  - This contains the setup and teardown methods. (Constructor and `Dispose()` methods respectively)
  - This is also where base API calls are defined. (`CreateUser()` and `GetUser()`)
    - We put the API calls in base class methods so that you can add/change authentication in one place as the project progresses.
- `Extensions.cs`
  - Define common extension methods here.
  - The only extension method currently defined is `DeserializeContent<T>()`.
    - `response.DeserializeContent<CreateUserResponseModel>()` is more readable than
      `JsonConvert.Deserialize<CreateUserResponseModel>(response.Content)`

### Honeybee.Test.Api

This is where the bulk of your code will go. Assuming the base class is configured correctly, preemptive automation should be fairly easy. There are a few samples in the project directory that highlight how easy it is to write new tests for your API. Remember, the goal of Honeybee is to be human-readable and quickly-writeable. This means that, not including initialization of models, tests can be just a few lines long and still test complex functionality.

**Some tests are currently failing.** This is because regres does not handle errors in a way you might expect. I configured the sample tests to something more realistic, but expect failing tests if you run what we've got without modification.

repository: jacobwaller/Honeybee

repo_name: jacobwaller/Honeybee


text:
---
layout: default
---

# 1998-09-18 - atheism (was: RE: Democracy... (fwd)) (fwd)

## Header Data

From: Jim Choate<EMAIL_ADDRESS>To<EMAIL_ADDRESS>(Cypherpunks Distributed Remailer)

Message Hash: 84de0e109e03bcdf539e9ffe71a10bbfb47f652bb596d882ed5e86f1bd5ade8e

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1998-09-18 23:59:07 UTC

Raw Date: Sat, 19 Sep 1998 07:59:07 +0800

## Raw message

```
{% raw  %}From: Jim Choate<EMAIL_ADDRESS>Date: Sat, 19 Sep 1998 07:59:07 +0800
To<EMAIL_ADDRESS>(Cypherpunks Distributed Remailer)
Subject: atheism (was: RE: Democracy... (fwd)) (fwd)
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text

Forwarded message:

> From<EMAIL_ADDRESS>> Date: Sat, 19 Sep 1998 11:24:32 +0200
> Subject: atheism (was: RE: Democracy... (fwd))

>      Not all philosophies are religions.

If we are talking philosophies of the range to include 'natural philosophy'
(ie physics) then you are correct. Fortunately, this attempt at shifting the
topic of discussion away from personal or individual philosophies relating
to the relationship between individuals, God, and the cosmos  won't work.

This is called a straw-man. Pick an argument that you want to (dis)prove but
don't know how. Then pick a similar but non-identical (or fail to prove the
identity) which one knowns how to (dis)prove. Finaly claim that the second
easier (since it is (dis)provable) problem is identical to the first.

>  Asserting so is an attempt
> to make one or both of the terms meaningless.

And trying to change the subject of discourse is as well. A philosophy is a
set of beliefs, period. In this particular case we are discussing personal
or individual philosophies and from definition and practice they are
identical. Religion after all is nothing more than a set of beliefs and
therefore falls under 'personal philosophy'.

Just remember this, it's your ugly baby.

>      There are two forms of atheism (visit alt.atheism.moderated for
> an unending discussion).  "Strong" atheists state that they "believe
> that god does not exist."  "Weak" atheists state that they "do not
> believe that god exists."

Changing the side on which the 'do not' resides doesn't change the meaning.
These two sentences are identical in content and meaning.

I belive god does not exist

I do not believe god exists

or,

^(A) = (^A)

>      Do you believe in leprechauns, because there is no proof that
> they don't exist?  Do you believe in the Hindu pantheon?

Whether I believe in them makes no difference to their existance (you really
really need to quit taking drugs).  They run around asking "Do you believe in
aliens?" when the question that needs asking is "How do we prove aliens have
been here?", and in many cases they take the two to be equivalent.

Hindu pantheon is a different form of Pantheism that I practice. I don't
agree with many of the points that Hindu, Aztec, Buddhist, New Age, etc.
pantheist practice, it's too anthropocentric for my taste and in the case
of New Age Pantheism (gag) they've simply given transcendance a new form.
And I further believe that the Hindu practice of sweeping ants out of ones
way and wearing a veil to inhibit bug inhalation is taking it too far the
other way (though I respect and practice the spirit of their actions).

Respect does not mean subserviance.

>      Without reason and logic, how do you propose to prove these
> assertions?

I'm not trying to prove anything, you are. I'm just blowing holes in your
reasoning.

>  Reason and logic don't "constrain", they provide a
> framework for discovery.  This framework is unavailable to, and indeed
> actively rejected by, believers in the supernatural.  Any meaningful
> definition of the word "inquiry" presupposes the use of logic.

Ohhhh, supernatural is by definition in this discussion equivalent to
transcendental. I'll say it again, there are two types of religion - those
who believe transcendentalism exists (ie traditional religions) and those
that don't (eg Pantheism). It is not reasonable nor logical to expect the
natural rules of experience to be recognized by the supernatural.

Now I can inquire into many things without using a particular type of logic
(you keep writing as if there is only one form of logic - perhaps this is
the root shortcoming in your reasoning). So trying to say that inquiry is
equivalent to using logic is a misunderstanding of both inquiry and logic.

The question that you are skirting around is:

If God exists and created the universe, does this imply that it is
constrained by that creation?

You can answer that question with three answers:

Yes	Pantheism and some other forms of pagan religions

No	Traditional religions

?	Agnostic (if you'd like to know,
        Nihilism (if you believe the question is irrelevant),
        etc.

>      All faith-based assertions are by definition irrational.  Mystics
> frequently speak of transcendence as if the word denotes a concept
> with a particular meaning, but never provide a coherent definition.
> Perhaps you'll surprise me?

Transcendence is the belief that there is something more than the earthly
veil. In other words, if you practice a transcendantal religion then by
definition you believe in a ghost-in-the-machine of one form or another.

If you like you can think of it as one set of religions believes there is
purpose and reason in existance whereas others believe that it is all random
dice (and yes that is a broad brush I'm painting with).

    ____________________________________________________________________

                            The seeker is a finder.

                                     Ancient Persian Proverb

       The Armadillo Group       ,::////;::-.          James Choate
       Austin, Tx               /:'///// ``::>/|/<EMAIL_ADDRESS>       www.ssz.com            .',  ||||    `/( e\<PHONE_NUMBER>
                           -====~~mm-'`-```-mm --'-
    --------------------------------------------------------------------

{% endraw %}
```

## Thread

+ Return to [September 1998](/archive/1998/09)

+ Return to "[Jim Choate <ravage@EINSTEIN.ssz.com>](/authors/jim_choate_ravage_at_einstein_ssz_com_)"
+ Return to "[pjm@spe.com](/authors/pjm_at_spe_com)"

+ 1998-09-18 (Sat, 19 Sep 1998 07:59:07 +0800) - atheism (was: RE: Democracy... (fwd)) (fwd) - _Jim Choate<EMAIL_ADDRESS>  + 1998-09-20 (Sun, 20 Sep 1998 16:06:35 +0800) - [atheism (was: RE: Democracy... (fwd)) (fwd)](/archive/1998/09/e29d19d70795c72c55d877dba6694a0cb00657491d0f93bef9f61dc8032180a5) -<EMAIL_ADDRESS>


text:
# mongodbs

This module allows your server to connect to multiple mongodb databases.

For every database instance connected it will create facilities to access data with basic CRUD operations (see **Methods Facility** section [below](#facility)).

Current features are:

* create connection(s) using a JSON configuration file
* create data CRUD methods using a JSON configuration file
* put database instance(s) into the express request

Database instance(s) will be optionally available in req.dbs[dbName]

### Dependencies

* mongodb
* assert

### Configure

Install module in your server

```
npm install --save mongodbs
```

Create a /path/to/conf.json configuration file like the following.

###### conf.json
```

[
  {
    "dbName": "myMongoDB",
    "dbHost": "localhost:27017/",
    "dbOptions": {
      poolSize: 10
    },
    "models": {
      "items": {
        "findOne": {
          "_id": "_id"
        },
        "find": {
          "name": "name",
          "category": "cat"
        },
        "updateOne": {
          "_id": "_id",
        },
        "update": {
          "name": "name"
        },
        "insert": {},
        "insertOne": {},
        "deleteOne": {
          "_id": "_id",
        },
        "delete": {
          "name": "name"
        }
      }
    }
  },
  ...
]
```
For a detailed explanation of conf params, please see the sections [Configuration details](#conf_det) and [Methods Facility](#facility) below.

Have a look at the json.sample files, you'll find examples of valid configurations
* **mongo.json.sample**
* **mongo-replicaSet.json.sample**
* **mongo-shards.json.sample**

### Setup

Import in your server main file and initialize it

###### index.js
```
const express = require('express');
const mongo = require('mongodbs');
...

// you can set some options (see options.json.sample as reference)
const options = {
  ...
};
...

const app = express();
const mongodbs = await mongo(app, '/path/to/conf.json', options);
...

const port = 8080; // your port for this server
app.listen(port, () => console.log(`my awesome server is listening on port ${port}`));
```

or

```
const app = express();
mongo(app, '/path/to/conf.json', options)
.then(mongodbs => {
  ...
  const port = 8080; // your port for this server
  app.listen(port, () => console.log(`my awesome server is listening on port ${port}`));
});
```

### Use

If you set options, and set addDbsToReq to true (_default_) then in your routes you'll have

###### myRoute.js
```
app.get('/', (req, res, next) => {
  const db = req.dbs.myMongoDB;
  const coll = db.collection('myCollection');

  // here you can perform mongodb CRUD operations as usual
});
```

If you want you can also use the response outware by adding it as the latest middleware of a route, and adding a `mongoResponse` object to the `res` express object

###### myController.js
```
const myController = (req, res, next) => {
  // do stuffs
  res.mongoResponse = {
    statusCode: 200,
    data: { ... }
  };
  next();
};
```

###### myRoute.js
```
const out = require('mongodbs').response;

app.get('/', myController, out);
```

The `out` middleware will send the response back to the client.

### Configuration details

Here is the list of valid configuration parameters:
* dbName (_String_) – the name of database you'll be connected to
* dbHost (_String_ or _Array_) – the host(s) your mongo instance is running on

Notes:
 * a connection string must follow the rules of official mongodb (see [mongodb - URI Connection Settings](http://mongodb.github.io/node-mongodb-native/3.0/reference/connecting/connection-settings/) for details)
 * if you set an array of hosts, the **replicaSet** param must be set as well
* replicaSet (_String_) – the replicaSet name for your mongo connection
* dbOptions (_Object_) – the options for your mongo connection (see [mongodb - URI Connection Settings](http://mongodb.github.io/node-mongodb-native/3.0/reference/connecting/connection-settings/) for details)
* models (_Object_) – the configuration for methods facility (see next section for details)

### Methods Facility

The module takes your models settings from the _conf.json_ file.

It examines the "models" entry for every database configuration and build access methods facility for you.

This is the reference of a "models" entry.

```
{
  "collection": {
    "method": {
      "name": "field"
    }
  }
}
```
where
* **collection** represents the collection in your DB you'll be querying with the created methods

* **method** is one of the CRUD operations

_Permitted values here are: **delete**, **deleteOne**, **find**, **findOne**, **insert**, **insertOne**, **update** and **updateOne**
(Each one does what you expect it does)_
* **name** is the value used for the method named
* **field** is the field name you would to query for in the collection

you'll find the generated methods like the following

_dbs.databaseName.models.collection.methodName_

Note that:
* a method not permitted will be ignored
* the `method + name` formula will be camel-cased (_**findOne** + **_id** becomes **findOneById**_)
* any value for the **insert** method will be ignored (_current version_)

#### Example
Given the [conf.json](#conf) above you'll have these methods:
* findOneById
* findByName
* findByCategory
* updateOneById
* updateByName
* insert
* insertOne
* deleteOneById
* deleteByName

Note that:
* insert and insertOne methods differs for args they expect to receive

insert expect ad array of multiple object, insertOne a single object.

For example in your app you can use these facilities by doing this
```
const out = require('mongodbs').response;

const myController = (req, res, next) => {
  try {
    const items = await req.dbs.myMongoDB.models.items.findByName(req.params.name);
    res.mongoResponse = {
      statusCode: items.length ? 200 : 204,
      data: items
    };
    next();
  } catch(e) {
    res.status(500).send(e);
  }
};

app.get('/items/:name', myController, out);
```

### Tests

By default the only enabled test is for the models methods facility.

You can edit the `package.json` file to enable the tests for replicaSet and shards. In this case be sure your mongo servers are configured and running accordingly with **mongo-replicaSet.json.sample** and **mongo-shards.json.sample** files.

### Roadmap

* CRUD combined operations
* aggregations
* cursors facility

### Changelog

##### v1.1.0

* Add support for replicaSet
* Add support for sharding
* Add support for mongo connect options

##### v1.0.0

* Created facility methods to perform basic CRUD operations over the database.
* Added the `addDbsToReq` option to optionally add the database instances into the express request.
* Added tests of the facility methods created by the module.
* `connect` and `use` methods are now deprecated.

##### v0.5.0

* Added the possibility to use **mongodbs** by passing your `app` express and a json configuration file. This behaviour is the same as what you would obtain by the calls to `connect` an `use` in sequence (*v0.4*).
* Added response outware.
* `connect` and `use` methods are not deprecated yet.

repository: emiliomerella/mongodbs

repo_name: emiliomerella/mongodbs


text:
# Deployment

Automatic deployment is implemented via Cmake install. The deployment path has to be provided as Cmake variable **SHAPE_DEPLOY** to configuration  phase, e.g.:

```
cmake -G "Visual Studio 15 2017 Win64" -DSHAPE_DEPLOY:PATH=<PATH> .
```

The PATH can be arbitrary absolute path. If not provided it is set to `<SHAPE_PATH>/build/deploy` by default.
As all projects depend on Shape and uses Cmake command `find_package(shape)` to get it, the deploy directory is provided to each component configuration via **shape_DEPLOY** global variable. The variable can be referred in component's CMakeLists.txt to be deployed by install. It is recommended to use generator specific name in deploy path to avoid mixing of binaries provided by different compilators. For example: `C:/shape/deploy/VS15_2017_x64`

Deployment can be shared by more projects based on Shape or can be dedicated just for one project. It is suitable e.g. if a project or projects group depends on specific Shape version.

## Deploy CMake support functions

To structure Deploy in uniform way use predefined CMake functions in `shape/cmake/ShapeComponentDeclaration.cmake`

- `function(DeployShapeComponent componentName)` to deploy component's binary
- `function(DeployShapeConfiguration cfgName)` to deploy runtime configuration
- `function(DeployShapeConfigurationStartUp executable cfgName)` to deploy StartUp script
- `function(ConfigureMsvcProject executable cfgName)` to modify MSVC project user setup. It applies only if `vcxproj.user`
doesn't already exists to avoid previous manual setup overwrite.
- `DeployShapeConfigurationTest(executable cfgName)` to deploy test based on cfgName configuration

## Deploy tree structure
Typical deployment build by recommended Cmake functions looks like:

deploy
- **generator1** used cmake generator
  - **Debug** build configuration
    - **project1** project name
     - **bin** shared libs
     - **lib** static libs
     - **runcfg** predefined runtime configurations
       - **cfg1** configuration
- generator2
 - ...

repository: logimic/shape

repo_name: logimic/shape