text:
---
title: Zend Expressive + Doctrine integration - now even easier!
tags: [php, zend, expressive, doctrine, zf]
---

# Introduction

Zend Expressive is the new framework on the block, and it's super easy to get up and running with it. On many applications, before long, you'll need to start integrating with a database. My go-to solution, because I'm very familiar with it, is Doctrine. I've already written a guide to [set up Doctrine into a Zend Expressive application](http://www.jamestitcumb.com/posts/integrating-doctrine-expressive), but now there's an even easier way of doing this, courtesy of the efforts of [Ben Scholzen](https://twitter.com/dasprid).

I'd like to introduce you to his new binding library, [dasprid/container-interop-doctrine](https://github.com/DASPRiD/container-interop-doctrine), and show you how to get started with this very simple-to-use set of factories.

# Set up a Zend Expressive application

First up, we're going to start from absolute scratch with this project, so we'll start out with a blank canvas using the Zend Expressive skeleton application. As per the [Expressive instructions](https://github.com/zendframework/zend-expressive-skeleton), we simply have to:

~~~ .bash
$ composer create-project zendframework/zend-expressive-skeleton doctrine-test
~~~

When I set up, I accepted all the default options, except I did not opt to install Whoops error handler:

 * Full skeleton
 * FastRoute
 * Zend ServiceManager
 * No template engine
 * No error handler

Now we're set up, don't forget to descend into your new project directory for the rest of the commands.

~~~ .bash
$ cd doctrine-test
~~~

# Install container-interop-doctrine

Because Ben is a neat guy, he put his library on Packagist, which makes it super easy to install with Composer:

~~~ .bash
$ composer require dasprid/container-interop-doctrine
~~~

Let's also do a quick sanity check, to ensure everything is working as we'd expect. Fire up a temporary PHP server using the following:

~~~ .bash
$ php -S <IP_ADDRESS>:8080 -t public/ public/index.php
~~~

If you now open up [http://localhost:8080/](http://localhost:8080/) in your browser, you should see some JSON output indicating everything works:

~~~ .json
{"welcome":"Congratulations! You have installed the zend-expressive skeleton application.","docsUrl":"zend-expressive.readthedocs.org"}
~~~

If you see this, we're looking good, and can go on to start configuring and using container-interop-doctrine.

# Configure container-interop-doctrine

First up we need some configuration, and you'll need an existing MySQL server (or other type of DB that Doctrine supports... take your pick!). I used MySQL, because it was already installed on my machine, so easy to set up. Create your Doctrine configuration in a sensibly named file - to keep things neatly organised, I recommend creating a new file in `config/autoload/doctrine.local.php` specifically for this purpose.

~~~ .php
<?php
return [
    'doctrine' => [
        'connection' => [
            'orm_default' => [
                'params' => [
                    'url' => 'mysql://username:password@localhost/database',
                ],
            ],
        ],
        'driver' => [
            'orm_default' => [
                'class' => \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain::class,
                'drivers' => [
                    'App\Entity' => 'my_entity',
                ],
            ],
            'my_entity' => [
                'class' => \Doctrine\ORM\Mapping\Driver\AnnotationDriver::class,
                'cache' => 'array',
                'paths' => __DIR__ . '/../../src/App/Entity',
            ],
        ],
    ],
];
~~~

For your project, you may wish to also create a `doctrine.local.php.dist` containing a template or example of configuration for other users of your project.

Ben's library container-interop-doctrine has made the set up of the rest of the Doctrine factories super simple by requiring you to only register one single little factory! Head into your `dependencies.global.php` and add a register for the following factory:

~~~ .php
<?php
return [
    'dependencies' => [
        'factories' => [
            'doctrine.entity_manager.orm_default' => \ContainerInteropDoctrine\EntityManagerFactory::class,
        ],
    ],
];
~~~

That's actually all the configuration needed to get this thing up and running! Now we can go ahead and make a very basic example to prove everything works as expected.

# Create an entity

As you might've noticed in the configuration above, we've pointed our entity driver at the `src/App/Entity` folder, where we're going to create a very basic entity - just two fields, id and name. This is what my `src/App/Entity/Foo.php` looks like:

~~~ .php
<?php

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="foo")
 */
class Foo implements \JsonSerializable
{
    /**
     * @ORM\Id
     * @ORM\Column(name="id", type="integer")
     * @ORM\GeneratedValue(strategy="IDENTITY")
     * @var int
     */
    private $id;

    /**
     * @ORM\Column(name="name", type="string", length=32)
     * @var string
     */
    private $name;

    /**
     * Application constructor.
     * @param $name
     */
    public function __construct($name)
    {
        $this->name = $name;
    }

    public function jsonSerialize()
    {
        return [
            'id' => $this->id,
            'name' => $this->name
        ];
    }
}
~~~

I'm not going to mess around too much with the ORM stuff, for now, you can run this script manually to create the appropriate database table.

~~~ .sql
CREATE TABLE `foo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;

INSERT INTO `foo` (`id`, `name`) VALUES
  (1, 'Testing'),
  (2, 'Testing2');
~~~

Naturally, if you're using a different flavour, storage engine, ODM etc., you'll need to adapt this accordingly - this is left as an exercise for the reader.

# Update the HomePageAction and Factory

I'm going to go ahead and hack up the `src/App/Action/HomePageAction.php` now so that it has the pre-configured `EntityManager` injected and ready to go:

~~~ .php
<?php

namespace App\Action;

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\JsonResponse;
use Doctrine\ORM\EntityManager;
use App\Entity\Foo;

class HomePageAction
{
    private $entityManager;

    public function __construct(EntityManager $entityManager)
    {
        $this->entityManager = $entityManager;
    }

    public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
    {
        return new JsonResponse($this->entityManager->find(Foo::class, 1));
    }
}
~~~

And the factory, in `src/App/Action/HomePageFactory.php` needs updating to only inject the Entity Manager:

~~~ .php
<?php

namespace App\Action;

use Interop\Container\ContainerInterface;

class HomePageFactory
{
    public function __invoke(ContainerInterface $container)
    {
        $em = $container->get('doctrine.entity_manager.orm_default');

        return new HomePageAction($em);
    }
}
~~~

Naturally, this is not something I'd do in production, but this is just a demo, and the quickest way to prove the concept. If you're interested, I'd wrap this fetch process into a service class to abstract the Doctrine logic away from your controller action, so that it can work with a consistent internal API, rather than external dependencies.

# That's it! Check it and see it work...

Head back to the browser at [http://localhost:8080/](http://localhost:8080/) and you should see your new updated JSON response:

~~~ .json
{"id":1,"name":"Testing"}
~~~

Change the requested ID in the `HomePageAction` to `2` and you'll see the response change accordingly.

~~~ .json
{"id":2,"name":"Testing2"}
~~~

As you can see, setting up and binding the Doctrine library to a new Zend Expressive application has been made trivially easy - and it probably takes about 10 minutes to set this all up. For a bare-bones, quick and easy, set up this is really ideal in my opinion, and I'd encourage you to look into this route. That said, there's still times when the functionality that the [DoctrineORMModule](https://github.com/doctrine/DoctrineORMModule) is a necessity - for example the ObjectSelect and hydrators for binding to Zend\Form instances and so on. If that's something you think you may need, then you could use the above as a basis, but additionally include DoctrineORMModule for the functionality you require.

# P.S., CLI tools?

One of the powerful features of Doctrine is the CLI tools that allow you to manage schema, create migrations and so on. For this, Ben provides instructions on setting up the CLI tools over on the [README.md](https://github.com/DASPRiD/container-interop-doctrine#using-the-doctrine-cli) - which is something you'll probably want to set up too to take advantage.

repository: asgrim/jamestitcumb

repo_name: asgrim/jamestitcumb


text:
<!---
# This file is part of the ChillDev-Commons.
#
# @license http://mit-license.org/ The MIT license
# @copyright 2015 © by Rafał Wrzeszcz - Wrzasq.pl.
-->

# JSON-RPC dispatcher

[**JSON-RPC**](http://www.jsonrpc.org/specification) dispatcher is an object that handles JSON requests and dispatches them to associated method handlers - it's like the router for you JSON-RPC server. First thing you need to do is to implement method handlers (don't worry about `YourContextType` class, we will discuss that further):

```java
import com.thetransactioncompany.jsonrpc2.JSONRPC2Error;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Response;

import pl.chilldev.commons.jsonrpc.rpc.Dispatcher;

public class CreateUserHandler
    implements
        Dispatcher.RequestHandler<YourContextType>
{
    @Override
    public JSONRPC2Response process(JSONRPC2Request request, YourContextType context)
        throws
            JSONRPC2Error
    {
        try {
            // handle request

            // return valid response
            // true is your response data, can be anything
            return new JSONRPC2Response(true, request.getId());
        } catch (SomeException error) {
            return new JSONRPC2Error(errorCode, error.getMessage());
        }
    }
}
```

All you need to do is to register request handlers for particular method names:

```java
import pl.chilldev.commons.jsonrpc.rpc.Dispatcher;

public class DispatcherFactory
{
    public Dispatcher<YourContextType> createDispatcher()
    {
        Dispatcher<YourContextType> dispatcher = new Dispatcher<>();
        dispatcher.register("createUser", new CreateUserHandler());
        // you can register more method handlers
        return dispatcher;
    }
}
```

That's all you need to do with the dispatcher object. It's usage is quite simple - it just handles the request object by mapping it's request method to registred handlers but it's done internally.

## Method wrappers

But yet, ususally you don't need such low-level response control - response ID must always match current request ID and returned value is usually simply your method call result. So most likely generating response based on your method call is a straight-forward task and there is no reason why you should need to handle it manually every time. For that there are two interfaces with dedicated request handlers - one for methods that generate response result (`pl.chilldev.commons.jsonrpc.rpc.ReturningMethod`) and one for void methods (`pl.chilldev.commons.jsonrpc.rpc.VoidMethod`).

**Note:** If you want to return `NULL` value it's a return value so you should use returning method interface - void-method indicated no response result at all (JSON-RPC response has no `result` property in such case).

These two interfaces are automatically wrapped by dispatcher, so you can still build your dispatcher with just your method objects:

```java
import com.thetransactioncompany.jsonrpc2.JSONRPC2Error;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Response;

import pl.chilldev.commons.jsonrpc.rpc.Dispatcher;
import pl.chilldev.commons.jsonrpc.rpc.ReturningMethod;
import pl.chilldev.commons.jsonrpc.rpc.VoidMethod;

public class DispatcherFactory
{
    public Dispatcher<YourContextType> createDispatcher()
    {
        Dispatcher<YourContextType> dispatcher = new Dispatcher<>();
        dispatcher.register("rawRpcHandler", new PlainCreateUserHandler());
        dispatcher.register("returningMethodName", new MyReturningMethod());
        dispatcher.register("voidMethodName", new MyVoidMethod());
        // you can register more method handlers
        return dispatcher;
    }
}

class MyReturningMethod
    implements
        ReturningMethod<YourContextType>
{
    @Override
    public Object process(JSONRPC2Request request, YourContextType context)
        throws
            JSONRPC2Error
    {
        try {
            // handle request

            // return valid response
            // this is your response data
            // can be anything, returning type enforced by interface is just `java.lang.Object`
            // it will be used directly as response result
            "Hell world";
        } catch (SomeException error) {
            return new JSONRPC2Error(errorCode, error.getMessage());
        }
    }
}

class MyVoidMethod
    implements
        VoidMethod<YourContextType>
{
    @Override
    public void process(JSONRPC2Request request, YourContextType context)
        throws
            JSONRPC2Error
    {
        try {
            // handle request
            // just don't return anything
            // response will be generated with no result automatically
        } catch (SomeException error) {
            return new JSONRPC2Error(errorCode, error.getMessage());
        }
    }
}
```

## Error codes

Additionally, to unify some aspects of errors handling `pl.chilldev.commons.jsonrpc.rpc.ErrorCodes` class provides standard error codes:

Error code | Error code | Exception property | Scenario
--- | --- | --- | ---
`-1` | `CODE_CONNECTION` | `ERROR_CONNECTION` | This error is returned in case of connection error while waiting for the response. It's in fact not returned by the server, but rendered internally to unify error handling strategy against network protocol.

license: MIT

branch_name: refs/heads/develop

extension: md

license_type: permissive


text:
# Reading Notes
## this website is for writing the notes of each day class , for this code 401 we will be talking about JAVA and Data structure .

* Code 102 - Intro to Software Development
* Code 201 - Foundations of Software Development
* Code 301 - Intermediate Software Development
* Code 401 - Advanced Software Development

branch_name: refs/heads/main


text:
# Futures Market

by Andy Freeland

## Getting Started

### Requirements

The Futures Market requires `Django==1.3`, `tornado==2.0`, and `PyYAML`. These can be easily installed with pip: `pip install -r requirements.txt`.

### Running

The Futures Market can be run with the `runserver-dev` script, which uses Django's management command functionality to run the application on port 8000 with the Tornado server. This is fine for testing purposes, but for production use see **Deployment**. To setup a development database, run the `setup-dev` script.

### Usage

- `http://hostname/admin/` will bring you to the admin interface where you can edit objects.
- `http://hostname/` will take you to the interface to create markets.
- `http://hostname/marketname/` will take you to the market manager view.
- `http://hostname/marketname/tradername/` will take you to an individual trader portfolio.

## Data

Data is stored in an SQLite database called futures-market.db. Once the market is running, [YAML](http://en.wikipedia.org/wiki/YAML)-formatted data can be uploaded. An example can be found in `data/carleton.yaml`.

## Deployment

For installing all of the server software, see `docs/server-setup.txt`. Copy `conf/nginx.conf` to `/etc/nginx/nginx.conf`.

nginx can also be configured for multiple processes, with some information about that at <http://www.hyperionreactor.net/blog/running-tornado-production> and <http://www.tornadoweb.org/documentation/overview.html#running-tornado-in-production>.

- Run `setup-production` to setup the database and collect the static files.

- Run `runserver-production` to start the server. `runserver-production` takes an optional port number as an argument and defaults to port 8000. The included nginx.conf is set to listen on ports 8000 and 8001.

The URL prefix in production can be configured in `futures_market/settings_production.py`. This lets you host the market at URLs like `http://hostname/markets/` rather than `http://hostname/`.

## Internals

The Futures Market is built using [Django](https://www.djangoproject.com/) and uses [Tornado](http://www.tornadoweb.org/) as its server. [jQuery](http://jquery.com/) and [flot](http://code.google.com/p/flot/) are used to plot graphs and do refresh the data.

The `futures_market` directory contains the project itself. The only files that matter here are `settings.py`, containing all of the application settings, and `urls.py` which maps urls to applications.

`templates` contains the templates, HTML files using the Django Templating Language.

`market` is the actual market application. `static` contains static files (CSS/JS). The CSS uses the [inuit.css framework](http://csswizardry.com/inuitcss/) with a very small `screen.css` for other styling. `management` contains a `runtornado.py` command for Django's management commands. This wraps the application for serving by the Tornado server.

`models` contains all of the data models for Holding, Market, Order, Stock, Trader.

Of the files in `market`, `urls.py` maps urls to views. `views.py` is where the actual logic of the market lies.

branch_name: refs/heads/master

extension: markdown


text:
---
hrs_structure:
  division: '3'
  volume: '12'
  title: '30'
  chapter: 551E
  section: '551E-61'
type: hrs_section
tags:
  - Property
  - Family
menu:
  hrs:
    identifier: HRS_0551E-0061
    parent: HRS0551E
    name: 551E-61 Uniformity of application and construction
weight: 68195
title: Uniformity of application and construction
full_title: 551E-61 Uniformity of application and construction
---
**PART IV. MISCELLANEOUS PROVISIONS**

**[§551E-61] Uniformity of application and construction.** In applying and construing this chapter, consideration shall be given to the need to promote uniformity of the law with respect to its subject matter among the states that enact it. [L 2014, c 22, pt of §1]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# RabirdTookit Programming Guide

## Pointers

Use uintptr_t to store your point value, it's size will changed during different platform, it will take the less space as possible (We always hungry on memory).

You could always use rShortenPtr() and rLengthenPtr() to convert between the short ptr (for storage) and the long ptr (for using).

You have better use class RRawPointer to manager your pointers for less space wasting.

repository: IfTalenT/ArduinoRabirdTookit

repo_name: IfTalenT/ArduinoRabirdTookit


text:
## Execution mode
Clone this repo and run the project. First go to Docker folder, execute build.sh prueba (build your image with tag "prueba") and then run.sh prueba (run a Docker container with name "prueba", according to the image created before). Finally, with a browser, enter localhost/some_text and see the magic!

In order to stop the container, enter docker stop prueba and check the "Exited" status with docker ps -a.

## Tool
```[Docker]
// Docker
```

## Author
**Raúl González Cruz**
>*Computer Systems Engineering, UDLAP*

repository: raulgonzalezcz/GoServer-with-Docker

repo_name: raulgonzalezcz/GoServer-with-Docker


text:
# Gladiators example - redux-app

A real world example made with [redux-app](https://github.com/alonrbar/redux-app) and [Angular](https://angular.io/).

## Main Page

![Main Page](./assets/screenshots/main-page.PNG?raw=true "Main Page")

## Edit Profile Page

![Edit Profile Page](./assets/screenshots/profile-page.PNG?raw=true "Edit Profile Page")

## The Arena Page

![Arena Page](./assets/screenshots/arena-page.PNG?raw=true "Arena Page")

## Remarks

When reading the source it is recommended to start with the [view model directory](https://github.com/alonrbar/redux-app-examples/tree/master/src/angular/gladiators/viewModel) where all application logic resides.

repository: alonrbar/redux-app-examples

gha_language: TypeScript

repo_name: alonrbar/redux-app-examples


text:
# Contributing

Contributions are welcome! The most valuable contributions, in order of preference, are:

1. Pull requests (whether adding a feature, improving an existing feature, or fixing a bug)
1. Opening an issue (bug reports or feature requests)
1. Fork, star, watch, or share this project on your social networks.

## Pull Requests

Pull requests are definitely welcome. In order to be most useful, please try and make sure that:

* the pull request has a clear description of what it's for (new feature, enhancement, or bug fix)
* the code is clean and understandable
* the pull request would merge cleanly

## Issues

Issues are also very welcome! Please try and make sure that:

* bug reports include stack traces, copied and pasted from your terminal
* feature requests include a clear description of _why_ you want that feature, not just what you want

## Thanks!

Thanks for checking out this project. While you're here, have a look at some of the other tools,
bits and pieces we've created under https://github.com/cevoaustralia

repository: cevoaustralia/aws-google-auth

gha_language: Python

gha_license_id: MIT

repo_name: cevoaustralia/aws-google-auth


text:
feedback.js - Feedback form with screenshot
===========================================

wip... preview available at http://experiments.hertzen.com/jsfeedback/

This script allows you to create feedback forms which include a screenshot, created on the clients browser, along with the form. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page.

## How does it work? ##
The script is based on the html2canvas library, which renders the current page as a canvas image, by reading the DOM and the different styles applied to the elements. This script adds the options for the user to draw elements on top of that image, such as mark points of interest on the image along with the feedback they send.

No plugins, no flash, no interaction needed from the server, just pure JavaScript!

## Options ##

Pass to constructor, e.g.

    Feedback({
        h2cPath:'//cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js',
        url: '/rest/feedback'});

* adapter
* allowTaint
* appendTo
* blackoutClass
* canvas
* closeLabel
* complete
* e
* el
* elements
* feedback
* flashcanvas
* for
* h2cPath - url to html2canvas
* hasOwnProperty
* height
* highlightClass
* if
* iframeDefault
* ignoreElements
* j
* key
* lang - "auto" for autodetect from browser or language code like 'ru_RU'
* length
* letterRendering
* logging
* nextLabel - label on the continue button of the first dialog box
* onparsed
* onpreloaded
* onrendered
* pages - dialogs with user.  defaults to Feedback.Form, Feedback.Screenshot, Feedback.Review
* proxy
* renderer
* svgRendering
* taintTest
* timeout
* url - url to post form data
* useCORS
* useOverflow
* width

## Building feedback.js ##
1. Install gulp and uglifier at the command line if you don't already have it (uglifier is only needed if you are going to compile the minified version)
```bash
    npm install gulp gulp-concat
    npm install gulp-uglify
```

2. Navigate to the feedback.js directory in the terminal and run one of the following
```bash
    gulp build
    gulp build:min
```

## Browser compatibility ##

 - Firefox 3.5+
 - Newer versions of Google Chrome, Safari & Opera
 - IE9

## License ##

feedback.js is released under the MIT license:

* http://www.opensource.org/licenses/MIT


text:
---
layout: post
title: "Help needed, A Backbone blog"
date: 2012-03-19 12:39
comments: true
categories: backbone
---

I'm currently doing my best to learn Backbone and his best practices. I have set up a demo blog application on GitHub ([Backbone-rails-blog](https://github.com/sebastienlachance/backbone-rails-blog)).

So, if you are interested to give me some feedback, tips or check out the development progress, just watch the project to see where things are going and I'll blog the important parts as I move forward.

repository: sebastienlachance/blog

repo_name: sebastienlachance/blog


text:
ERecyclerView
=====

**ERecyclerView** is an implementation of Android RecyclerView with the following features:

* Add header and/or footer views

* Add quick return header and/or footer

* Add pull to refresh header and/or load more footer

* "Inject" additional views between items

* All combinations of options can be used simultaneously.

Usage
-----
**Include to your project**

If using Gradle add jcenter to repositories

        repositories {
            jcenter()
        }

Add to your module dependencies

        dependencies {
            compile 'com.emreeran.erecyclerview:erecyclerview:1.0.9'
        }

**Adding ERecyclerView to your layout**

Just put **ERecyclerView** to the position you wish in your layout

        <com.emreeran.erecyclerview.ERecyclerView
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

Set a ```LayoutManager``` and your implementation of ```RecyclerView.Adapter``` just like any ```RecyclerView```

Properties
--------------
**Refresh header**

Refresh header can be set by calling ```setPullToRefreshView``` which takes a resource id as parameter and an optional
```RefreshViewStateListener```. You can use the available ```TwitterRefreshHeader``` by passing ```TwitterRefreshHeader.getResource()``` and
 ```TwitterRefreshHeader.getListener()``` as parameters.

For refresh operations call ```setOnRefreshListener``` and give your implementation of the
```OnRefreshListener``` as its parameter.

**Load more footer**

Load more footer can be set by calling ```setLoadMoreView``` which takes a resource id as parameter and an optional
`LoadMoreViewStateListener`.  You can use the available ```DefaultLoadMoreFooter``` by passing `DefaultLoadMoreFooter.getResource()
` as parameter.

For load more operations call ```setOnLoadMoreListener```and give your implementation of the
```OnLoadMoreListener``` as ites parameter.

**Quick return views**

Additional header and footer with quick return capability can be added to the layout. These views should be put on top of the
**ERecyclerView** in the layout (See sample application for layout arrangement example). Use ```setQuickReturnHeader``` and
```setQuickReturnFooter``` methods for setting the views as quick return. These methods takes the corresponding views and their
respective heights as parameters. Additionally snap views option can be set by ```setQuickReturnViewsSnapable``` method. Snapping views
 on release, returns its previous state (showing || not showing) if half of its height is not past scrolling, and changes to its next
 state if that threshold is past.

**Headers and footers**

Any number of header or footer views can be added using ```addHeaderView``` and ```addFooterView``` methods respectively.

**Injecting views**

Any number of views can be "injected" in available positions using the ```injectView``` method which takes the view to be injected and
the target position as parameters. The new view will be inserted before the view that is in the target position.

**Acknowledgements**

Quick return functionality is taken from **Etienne Lawlor**'s QuickReturn project https://github.com/lawloretienne/QuickReturn

The general idea and stating point of this project was from **jianghejie**'s XRecyclerView https://github.com/jianghejie/XRecyclerView

Many thanks

**Credits**

Author Emre Eran<EMAIL_ADDRESS>- https://twitter.com/emreeran)

License
-------

        Copyright 2015 Emre Eran

        Licensed under the Apache License, Version 2.0 (the "License");
        you may not use this file except in compliance with the License.
        You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

        Unless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an "AS IS" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.

repository: morristech/ERecyclerView

repo_name: morristech/ERecyclerView


text:
# Installation
> `npm install --save @types/paypal-rest-sdk`

# Summary
This package contains type definitions for paypal-rest-sdk (https://github.com/paypal/PayPal-node-SDK).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/paypal-rest-sdk

Additional Details
 * Last updated: Thu, 01 Aug 2019 23:54:28 GMT
 * Dependencies: @types/node
 * Global values: none

# Credits
These definitions were written by Andrew Throener <https://github.com/trainerbill>, and Barron Wei <https://github.com/barronwei>.

repository: Harpreet-Deol/api

repo_name: Harpreet-Deol/api


text:
---
title: AWS- Elastic Load Balancing-ELB
permalink: /aws/aws-elastic-load-balancing-elb
key: aws-elastic-load-balancing-elb
categories:
- aws
tags:
- aws
---

Elastic Load Balancing (ELB)
============================

Elastic Load Balancing automatically distributes incoming application traffic
across multiple targets, such as Amazon EC2 instances, containers, IP addresses

### Load Balancer Basics

![](media/935b96ff1347b84ec3201a1963de2594.png)

**Sender initiated Load Balancer**
If you're using the type of DNS load balancing , The DNS server responds to a
client request by saying here are all the possible IP addresses you can use for
that host name you're trying to resolve. . Then the client can decide which one
of those IP addresses it to actually wants to use.

**Receiver initiated Load Balancing**
With receiver initiated, it means that the request always goes to one
location, and that receiver, what we call the load balancer, selects the best
target.

![](media/fb98d7e573b3e1f8500ac0cf4575a077.png)

### ELB Types

Elastic Load Balancing offers three types of load balancers that all feature the
high availability, automatic scaling, and robust security necessary to make your
applications fault tolerant.

-   Application load balancer - HTTP/HTTPS , Web Applications

-   Network load balancer - TCP load balancing

-   Classic load balancer - only for legacy use and not for new deployments

**ELB Supported Services**

-   EC2

-   ECS

-   Auto Scaling

-   CloudWatch

-   Route 53

### Lab – Creating a Load Balancer

We already have a website , which is created -**Lab – host website on EC2 server
with Apache Server"**. The website Url is : <http://<IP_ADDRESS>/about.html>.

In this Example we add load balancer to this Website instance.

EC2 Dashboard > left : Load Balancing > Load Balancer > Create load balancer

![](media/97a45477ed9b8db50b63576bbd5fcf4b.png)

We Choose – **Classic Load Balancer**

![](media/eb0ca2295ff7102816909e4842447325.png)

**Create an internal load balancer:** As we want to serve external web traffic,
so we need an external load balancer, not an internal load balancer. Uncheck
this field.

**Security Group** – HTTP, HTTPS request accept from any where

![](media/c8ed3a27adae3bc324253f2981c9142f.png)

Ping Path – Home page path

![](media/876cb66ae206336ceb17a137433b26d5.png)

Add EC2 Instance for load balancing

![](media/166197e54ccfcc73d7360f6c473be7ed.png)

Review the load balancer, and then click on the **Create**

![](media/6a8978543186e7a64d67f49af713fd6d.png)

If we access the created website using above DNS Name :
<http://linuxvm-apachewebsite-loadbal-1493870664.us-east-2.elb.amazonaws.com/>,
It will balance the load, if you get many requests.

![](media/90ee4402cd0193da7132bfd94e1c26ea.png)

filename: 49.AWS-Elastic Load Balancing-ELB.md


text:
## Objectives

For this challenge, you'll be adding some new functionality to a very basic Sinatra+ActiveRecord application. The application in its current form includes:

- a `User` model (along with sign-in and sign-up functionality)
- a `Destination` model (representing a destination that a user might travel to)

Your task is to add the notion of "trips" to the application. A user can have many destinations, and a destination can belong to many users. A "trip" is an association between `User` and `Destination`, and has the following additional *required* attributes:

- duration of the trip (in days)
- a flag tracking whether or not the user has completed the trip or if it is planned for the future

You'll need to provide an interface in the application for users to select the destinations that they would like to visit. How you choose to provide this interface is up to you, but a user should only be able to edit her own trips, not the trips of other users.

Also, the home page of your application should show, for **all users**:
* their destinations
* how long she has spent at the given destination
* whether or not this trip has happened or is still being planned.

For example:

    Name	Destination	Duration of Trip	Completed?

    Marie Curie	Rio de Janeiro (urban)	6 days	yes

    	Berlin (urban)	10 days	no

    Max Born	Great Barrier Reef (rural)	5 days	no

    	Hong Kong (urban)	3 days	no

## Important
**Please run `rake db:drop` before you begin to flush any old databases**
**Do not add additional functionality. Get the requirements completed, then move on to the next challenge.**

## Useful Notes / Tidbits

- What's the [right kind of association](http://guides.rubyonrails.org/association_basics.html#the-has_many-through-association) between `User` and `Destination`?
- Validations on boolean fields [can be tricky](http://stackoverflow.com/questions/10506575/rails-database-defaults-and-model-validation-for-boolean-fields).
- Before implementing a manual way to add new trips for a user, you might try adding some through your `seeds.rb` file.


text:
---
layout: post
title: Joining Conga
date: 2017-07-05
author: Matthew
header-img: "img/headers/code.jpg"
comments: true
excerpt: Today I’d like to announce that I’ve joined Conga. I will be focused on improving the UI/UX and making their breadth of product offerings feel more like on cohesive unit.
---

![Conga](/img/posts/Conga-color.png)

Today I’d like to announce that I’ve joined [Conga](https://getconga.com). I will be focused on improving the UI/UX and making their breadth of product offerings feel more like on cohesive unit. I will again be working with/for many of the same people I did at Tier 3. In fact, most all of the executive leadership team is the same.

![Tier 3 becomes CenturyLink](/img/posts/Tier-3-becomes-CenturyLink.jpg)

I’m excited to get the opportunity to help make the group of Conga products the most user friendly painless Salesforce plugins available. While Salesforce plugs aren’t the sexiest thing they almost always have horrible UI/UX and that is something I am passionate about.

Conga Website: [https://getconga.com](https://getconga.com)

gha_language: JavaScript


text:
<!--
 Copyright 2022 - 2023 Crunchy Data Solutions, Inc.
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

# Definitions

[k8s-names]: https://docs.k8s.io/concepts/overview/working-with-objects/names/

### DNS subdomain

Most resource types require this kind of name. It must be 253 characters or less,
lowercase, and alphanumeric with hyphens U+002D and dots U+002E allowed in between.

- [k8s.io/apimachinery/pkg/util/validation.IsDNS1123Subdomain](https://pkg.go.dev/k8s.io/apimachinery/pkg/util/validation#IsDNS1123Subdomain)

### DNS label

Some resource types require this kind of name. It must be 63 characters or less,
lowercase, and alphanumeric with hyphens U+002D allowed in between.

Some have a stricter requirement to start with an alphabetic (nonnumerical) character.

- [k8s.io/apimachinery/pkg/util/validation.IsDNS1123Label](https://pkg.go.dev/k8s.io/apimachinery/pkg/util/validation#IsDNS1123Label)
- [k8s.io/apimachinery/pkg/util/validation.IsDNS1035Label](https://pkg.go.dev/k8s.io/apimachinery/pkg/util/validation#IsDNS1035Label)

# Labels

[k8s-labels]: https://docs.k8s.io/concepts/overview/working-with-objects/labels/

Label names must be 317 characters or less. The portion before an optional slash U+002F
must be a DNS subdomain. The portion after must be 63 characters or less.

Label values must be 63 characters or less and can be empty.

Both label names and values must be alphanumeric with hyphens U+002D, underscores U+005F,
and dots U+002E allowed in between.

- [k8s.io/apimachinerypkg/util/validation.IsQualifiedName](https://pkg.go.dev/k8s.io/apimachinery/pkg/util/validation#IsQualifiedName)
- [k8s.io/apimachinerypkg/util/validation.IsValidLabelValue](https://pkg.go.dev/k8s.io/apimachinery/pkg/util/validation#IsValidLabelValue)

# Annotations

[k8s-annotations]: https://docs.k8s.io/concepts/overview/working-with-objects/annotations/

Annotation names must be 317 characters or less. The portion before an optional slash U+002F
must be a DNS subdomain. The portion after must be 63 characters or less and alphanumeric with
hyphens U+002D, underscores U+005F, and dots U+002E allowed in between.

Annotation values may contain anything, but the combined size of *all* names and values
must be 256 KiB or less.

- [https://pkg.go.dev/k8s.io/apimachinery/pkg/api/validation.ValidateAnnotations](https://pkg.go.dev/k8s.io/apimachinery/pkg/api/validation#ValidateAnnotations)

# Specifics

The Kubernetes API validates custom resource metadata.
[Custom resource names are DNS subdomains](https://releases.k8s.io/v1.23.0/staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresource/validator.go#L60).
It may be possible to limit this further through validation. This is a stated
goal of [CEL expression validation](https://docs.k8s.io/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation-rules).

[ConfigMap names are DNS subdomains](https://releases.k8s.io/v1.23.0/pkg/apis/core/validation/validation.go#L5618).

[CronJob names are DNS subdomains](https://docs.k8s.io/concepts/workloads/controllers/cron-jobs/)
but must be [52 characters or less](https://releases.k8s.io/v1.23.0/pkg/apis/batch/validation/validation.go#L281).

[Deployment names are DNS subdomains](https://releases.k8s.io/v1.23.0/pkg/apis/apps/validation/validation.go#L632).

[Job names are DNS subdomains](https://releases.k8s.io/v1.23.0/pkg/apis/batch/validation/validation.go#L86).
When `.spec.completionMode = Indexed`, the name must be shorter (closer to 61 characters, it depends).
When `.spec.manualSelector` is unset, its Pods get (and must have) a "job-name" label, limiting the
name to 63 characters or less.

[Namespace names are DNS labels](https://releases.k8s.io/v1.23.0/pkg/apis/core/validation/validation.go#L5963).

[PersistentVolumeClaim (PVC) names are DNS subdomains](https://releases.k8s.io/v1.23.0/pkg/apis/core/validation/validation.go#L2066).

[Pod names are DNS subdomains](https://releases.k8s.io/v1.23.0/pkg/apis/core/validation/validation.go#L3443).
The strategy for [generating Pod names](https://releases.k8s.io/v1.23.0/pkg/registry/core/pod/strategy.go#L62) truncates to 63 characters.
The `.spec.hostname` field must be 63 characters or less.

PodDisruptionBudget (PDB)

[ReplicaSet names are DNS subdomains](https://releases.k8s.io/v1.23.0/pkg/apis/apps/validation/validation.go#L655).

Role

RoleBinding

[Secret names are DNS subdomains](https://releases.k8s.io/v1.23.0/pkg/apis/core/validation/validation.go#L5515).

[Service names are DNS labels](https://docs.k8s.io/concepts/services-networking/service/)
that must begin with a letter.

ServiceAccount (subdomain)

[StatefulSet names are DNS subdomains](https://docs.k8s.io/concepts/workloads/controllers/statefulset/),
but its Pods get [hostnames](https://releases.k8s.io/v1.23.0/pkg/apis/core/validation/validation.go#L3561)
so it must be shorter (closer to 61 characters, it depends). Its Pods also get a "controller-revision-hash"
label with [11 characters appended](https://issue.k8s.io/64023), limiting the name to 52 characters or less.

repository: CrunchyData/postgres-operator

gha_language: Go

repo_name: CrunchyData/postgres-operator


text:
# Hex0r

Hex0r is some simple javascript that shows a hex viewer for binary or non-binary data.

# Example

![alt tag](http://raw.github.com/gratajik/Hex0r/master/help/example_screenshot.PNG)

# Options

All parameters should be on a div of class "hex04window".  Data attributes are used to control it.

Example
```` html
<div class="hex0rwindow" data-row-width="16" data-word-size="1" data-row-break="8"
        data-trim="true" data-base64="true" data-caption="Hex0r Example - base 64 file"
        data-highlights="" data-show-line-nums="true">
       Some data to show in the viewer
</div>
````

*  **row_width** The number of bytes to show per row
*  **word-size** The word size to show. Allows you to show the binary data in 1, 2 or 4 (or more) byte groups.
*  **row-break** Break between groups
*  **trim** Trim whitespace
*  **base64** Base 64 decode the data in the div (if false, will show exactly that is in the div)
*  **caption** The bottom caption for the viewer
*  **highlights** Highlight areas of the viewer hex
*  **show-line-nums** Determines parts of the binary data to be highlighted. This string takes the format of a comma separated list of values where each highlight is a tuple of 4 values: start_offset:end_offset:color:description. For example, here is a single highlight:
4:20:#F4FA58:This is an interesting part
And here is a list of two highlights:
4:20:#F4FA58:This is an interesting part,36:56:#54FAF8:This is another interesting part

# Usage

Take a look at hex04_example.html for the sample.

You will need to include jquery
``` html
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
````

Include the style sheet
``` html
<link rel="stylesheet" type="text/css" href="hex0r.css" />
````

Create a **div** for class **hex04rwindow**, fill out the params, and, inside the div, include the data you would like to show the viewer.  Any number of viewers can be on a page.

``` html
<div class="hex0rwindow" data-row-width="16" data-word-size="1" data-row-break="8"
    data-trim="true" data-base64="true" data-caption="Hex0r Example - base 64 file, with highlighting"
    data-highlights="16:17:#F4FA58:Initial value of SP register,128:152:#54FAF8:Portable Executable signature and header"
    data-show-line-nums="true" title="">
    /9j/4AAQSkZJRgABAQEASABIAAD/4RzmRXhpZgAATU0AKgAAAAgADAEPAAIAAAAJ AAAAngEQAAIAAAAQAAAAqAESAAMAAAABAAEAAAEaAAUAAAABAAAAuAEbAAUAAAAB
    AAAAwAEoAAMAAAABAAIAAAExAAIAAAAvAAAAyAEyAAIAAAAUAAAA+AITAAMAAAAB AAIAAIKYAAIAAAAFAAABDIdpAAQAAAABAAABEsSlAAcAAAAcAAAEkAAABKxGVUpJ
    RklMTQAARmluZVBpeCBGNDU1ICAgAAAAAEgAAAABAAAASAAAAA==
</div>
```


text:
# Max13/Monobullet [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/max13/Monobullet/master/LICENSE)

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

`Monobullet` is simply a [`Pushbullet`](http://pushbullet.com) handler for [Monolog](https://github.com/Seldaek/monolog). It will send you (or someone else, or many people) a push when your app logs something.

It includes a nice formatter for when logging an `Exception` and its stack.

For the record, `Pushbullet` is a platform allowing you to send a push to one or multiple devices using the mobile app, the web app or REST APIs.

## Installation

You can install the latest version with:

    $ composer require max13/monobullet

### Laravel 5.2 and above/similars

Add these lines to your `config/services.php`:

```php
'monobullet' => [
    'token' => 'YOUR PUSHBULLET TOKEN',
    'name' => 'NAME OF YOUR APP',
    'recipients' => 'email',
    'level' => Monolog\Logger::INFO,
    'propagate' => true,
    'env' => ['staging', 'production'],
],
```

Here are the variables references:

* `token`: Your Pushbullet api token.
* `name`: The name of your app, will be used to make the push's title.
* `recipients`: Can either be 1 email address, or an array of email addresses.
* `level`: Minimum level to take care. The default is `Monolog\Logger:INFO`.
* `propagate`: When `false`, if a record is handled, it won't be propagated to other handlers.
* `env`: Can either be 1 environment name (like `production`) or an array of environment name.

Then, add this line to Laravel's `config/app.php`, inside the `providers` array:

```php
    Monobullet\MonobulletServiceProvider::class,
```

/!\ Note that when using Service Provider, `Monobullet` will be set on the top of the `Monolog's` handlers, so the `bubble` parameter is important. After that you're good to go!

### Other frameworks

Put this wherever your framework's doc is telling you to do (`parameters` references are above):

```php
use Monobullet\PushbulletHandler;
// or: use Monobullet\Handler;
use Monolog\Logger;

$logger = new Logger('NAME'); // Will be used as the title of the push
$logger->pushHandler(new PushbulletHandler('PUSHBULLET_TOKEN', $recipients, $level = Logger::INFO, $bubble = false));
$logger->info('This is just a test log'); // You will receive a push saying this content
```

## Issues/PRs/Questions

Feel free to open an issue if you need anything. The same way, don't hesitate to send PRs ;)

When sending a PR, don't forget to add your name in the "Contributors" section of this README.

## Authors

Currently, I'm the only author of this package:

* Adnan RIHAN

## Contributors

* None (yet)


text:
# TransposedConv1D

A 1-D transposed convolution layer (e.g. temporal transposed convolution over images).

``` swift
@frozen public struct TransposedConv1D<Scalar: TensorFlowFloatingPoint>: Layer
```

This layer creates a convolution filter that is transpose-convolved with the layer input
to produce a tensor of outputs.

## Inheritance

[`Layer`](/Layer)

## Nested Type Aliases

### `Activation`

The element-wise activation function type.

``` swift
public typealias Activation = @differentiable (Tensor<Scalar>) -> Tensor<Scalar>
```

## Initializers

### `init(filter:bias:activation:stride:padding:)`

Creates a `TransposedConv1D` layer with the specified filter, bias,
activation function, strides, and padding.

``` swift
public init(filter: Tensor<Scalar>, bias: Tensor<Scalar>? = nil, activation: @escaping Activation = identity, stride: Int = 1, padding: Padding = .valid)
```

#### Parameters

  - filter: - filter: The 3-D convolution kernel.
  - bias: - bias: The bias vector.
  - activation: - activation: The element-wise activation function.
  - strides: - strides: The strides of the sliding window for spatial dimensions.
  - padding: - padding: The padding algorithm for convolution.

### `init(filterShape:stride:padding:activation:useBias:filterInitializer:biasInitializer:)`

Creates a `TransposedConv1D` layer with the specified filter shape, strides, padding, and
element-wise activation function. The filter tensor is initialized using Glorot uniform
initialization with the specified generator. The bias vector is initialized with zeros.

``` swift
public init(filterShape: (Int, Int, Int), stride: Int = 1, padding: Padding = .valid, activation: @escaping Activation = identity, useBias: Bool = true, filterInitializer: ParameterInitializer<Scalar> = glorotUniform(), biasInitializer: ParameterInitializer<Scalar> = zeros())
```

#### Parameters

  - filterShape: - filterShape: The shape of the 3-D convolution kernel.
  - strides: - strides: The strides of the sliding window for spatial dimensions.
  - padding: - padding: The padding algorithm for convolution.
  - activation: - activation: The element-wise activation function.
  - generator: - generator: The random number generator for initialization.

## Properties

### `filter`

The 1-D convolution kernel.

``` swift
var filter: Tensor<Scalar>
```

### `bias`

The bias vector.

``` swift
var bias: Tensor<Scalar>
```

### `activation`

The element-wise activation function.

``` swift
let activation: Activation
```

### `stride`

The strides of the sliding window for spatial dimensions.

``` swift
let stride: Int
```

### `padding`

The padding algorithm for convolution.

``` swift
let padding: Padding
```

### `paddingIndex`

The paddingIndex property allows us to handle computation based on padding.

``` swift
let paddingIndex: Int
```

### `useBias`

Note: `useBias` is a workaround for TF-1153: optional differentiation support.

``` swift
let useBias: Bool
```

## Methods

### `callAsFunction(_:)`

Returns the output obtained from applying the layer to the given input.

``` swift
@differentiable public func callAsFunction(_ input: Tensor<Scalar>) -> Tensor<Scalar>
```

#### Parameters

  - input: - input: The input to the layer.

#### Returns

The output.


text:
# Changelog

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.6.0 - [Unreleased]

- Upgrade to mill 0.10.0

## 0.4.1

### Changed

- The scalaxb compiler is now run in a forked jvm
  instead of running in the same process as mill.

- You can customize the scalaxb dependency by
  overriding `scalaxbIvyDeps`

## [0.4.0]

### Changed
- Upgrade mill to 0.7.x and Scala 2.12.11

## [0.3.0]

### Changed
- Upgrade scalaxb to 1.7.3

## [0.2.0]

### Changed
- Upgrade mill to 0.6.x

## [0.1.0] - 2019-06-27

### Changed
- Upgraded to Mill 0.4.1 and Scala 2.12.8

## [0.0.4] - 2018-11-20

### Added
- This CHANGELOG file

### Changed
- Upgrade to Mill 0.3.5
- Use `os-lib` instead of `ammonite.ops._`
- Make build time versions easier to manage.
  Scala and mill versions are managed from `.tool-versions` file.
  The VERSION specifies this project's version number.

[Unreleased]: https://github.com/vic/mill-scalaxb/compare/0.4.1...HEAD
[0.4.1]: https://github.com/vic/mill-scalaxb/compare/0.3.0...0.4.1
[0.4.0]: https://github.com/vic/mill-scalaxb/compare/0.3.0...0.4.0
[0.3.0]: https://github.com/vic/mill-scalaxb/compare/0.2.0...0.3.0
[0.2.0]: https://github.com/vic/mill-scalaxb/compare/0.1.0...0.2.0
[0.1.0]: https://github.com/vic/mill-scalaxb/compare/0.0.4...0.1.0
[0.0.4]: https://github.com/vic/mill-scalaxb/compare/0.0.3...0.0.4

repository: vic/mill-scalaxb

gha_language: Scala

repo_name: vic/mill-scalaxb


text:
# kw_cache

[![Build Status](https://app.travis-ci.com/alex-kalanis/kw_cache.svg?branch=master)](https://app.travis-ci.com/github/alex-kalanis/kw_cache)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/alex-kalanis/kw_cache/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/alex-kalanis/kw_cache/?branch=master)
[![Latest Stable Version](https://poser.pugx.org/alex-kalanis/kw_cache/v/stable.svg?v=1)](https://packagist.org/packages/alex-kalanis/kw_cache)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.3-8892BF.svg)](https://php.net/)
[![Downloads](https://img.shields.io/packagist/dt/alex-kalanis/kw_cache.svg?v1)](https://packagist.org/packages/alex-kalanis/kw_cache)
[![License](https://poser.pugx.org/alex-kalanis/kw_cache/license.svg?v=1)](https://packagist.org/packages/alex-kalanis/kw_cache)
[![Code Coverage](https://scrutinizer-ci.com/g/alex-kalanis/kw_cache/badges/coverage.png?b=master&v=1)](https://scrutinizer-ci.com/g/alex-kalanis/kw_cache/?branch=master)

Cache content across the KWCMS. Use storage interfaces or directly volume. Contains a simple support
for semaphores as remote flags for cache re-generating.

## PHP Installation

```
{
    "require": {
        "alex-kalanis/kw_cache": "2.0"
    }
}
```

(Refer to [Composer Documentation](https://github.com/composer/composer/blob/master/doc/00-intro.md#introduction) if you are not
familiar with composer)

## PHP Usage

1.) Use your autoloader (if not already done via Composer autoloader)

2.) Set storage(s) which will be used by cache.

3.) Connect the "kalanis\kw_cache\*" into your app. Extends it for setting your case.

4.) Just call it


text:
---
title: "Step 4: Actual building time"
date: "2020-12-04"
---

Now that the most important part of the project is done, the website, it's time to get cracking on the details of the project: building the gingerbread house. The first thing that needed to be done was repairing the mess I made earlier, so the parts had to be glued back together with frosting in order to get the mosaic effect I so desperately desired. It held up surprisingly well, however the result of the glued together parts looked less like a mosaic pattern and more like a bad painting made by spiderman.

Having all the parts repaired, it was time for the assembly. Turns out it's kinda tricky when doing it alone, so I had to take some help from some cups, a glass, a jar with garlic and a box of black beans to make sure the parts stayed in place while the icing hardened.

I figured that the house looked a bit boring, being just brown and white.

repository: MichaelEnzell/gatsby-hello-world

repo_name: MichaelEnzell/gatsby-hello-world


text:
`ews-js-api-browser`
==================
## Exchange Web Service in JavaScript/TypeScript. For ionic/electron/Outlook Add-In (mail apps) and other browser process.

built for ionic, electron and Outlook Add-In (mail apps) from https://github.com/gautamsi/ews-javascript-api
based on<EMAIL_ADDRESS>

> 0.2.0 brings changes from<EMAIL_ADDRESS>(use<EMAIL_ADDRESS>or `@next` tag)

> 0.1.0 adds support for Outlook Mail Apps/Add-ins

## installing (for ionic/cordova)
`npm install ews-js-api-browser`

## building
install typescript globally `npm install -g typescript`
then run `tsc` or `npm run build` from command prompt
run `npm run build:outlook` (windows only) to build for Outlook Add-in/Mail apps.

## use in Ionic/cordova

npm install works, use loaders like webpack. use in ionic/electron/webview, open issues at original repo. if you are using plain js/ts in cordova, see last section for this.

`ionic serve` will have CORS issue, You want to test in emulator directly. You can also enable CORS in Chrome (chrome based browsers) by installing plugin from chrome web store [Allow-Control-Allow-Origin: *](https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi)

this may affect other browser based process. electron does not have this issue

webpack uglify hangs and ultimately logs following error for me, probably due to very large file, I will see if I can fix this without making single file, ultimately current implementation loads all file so not much difference.

```
<--- Last few GCs --->

[107880:000002A361520F20]    16262 ms: Mark-sweep 1393.6 (1448.1) -> 1393.5 (1415.1) MB, 280.1 / 0.0 ms  last resort
[107880:000002A361520F20]    16472 ms: Mark-sweep 1393.5 (1415.1) -> 1393.5 (1415.1) MB, 209.9 / 0.0 ms  last resort

<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 000000E5FE6A66A1 <JS Object>
    1: RegExpReplace [native regexp.js:~356] [pc=000002C27BC3C9A4](this=000002255C9F2D61 <JS RegExp>,z=000000160878A0C1 <Very long string[3071091]>,ak=000000E5FE6C15A1 <String[1]\: \n>)
    2: 000003B7485C9C21 <Symbol: Symbol.replace>(aka [Symbol.replace]) [native regexp.js:1] [pc=000002C27C3AD329](this=000002255C9F2D61 <JS RegExp>,z=000000160878A0C1 <Very long string[3071091]>,ak=000000E5FE6...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
```

## How to for Outlook Apps
### Working with modules
If you are using webpack/requirejs, just install using npm and configure loaders appropriately. dependency needed: base64-js, moment-timezone & uuid. moment is also needed as dependency to moment-timezone.
Follow examples from `ews-jsvascript-api`
### Working without module loaders
see next section

# Working with plain js/ts (no module loaders/bundlers)
you have to copy `dist/outlook/ExchangeWebService.js` (and `dist/outlook/ExchangeWebService.d.ts` if you need typing support in typescript) to your project/scripts directory, include ExchangeWebService.js in html file (`<script>` tag). This exposes a global namespace `EwsJS`.

> for outlook add-ins/mail apps, configure for outlook by caling    call `EwsJS.ConfigureForOutlook()` inside `Office.initialize`.

specific example on how to use this way.

```ts
// The Office initialize function must be run each time a new page is loaded.
  Office.initialize = function (reason) {
      EwsJS.ConfigureForOutlook(); // only needed in outlook add-ins, not needed for other browser based process
    $(document).ready(function () {
      var element = document.querySelector('.ms-MessageBanner');
      messageBanner = new fabric.MessageBanner(element);
      messageBanner.hideBanner();
      loadProps();
      EwsJS.EwsLogging.DebugLogEnabled = false;
      var exch = new EwsJS.ExchangeService(EwsJS.ExchangeVersion.Exchange2013);
      exch.Credentials = new EwsJS.WebCredentials("user","password"); // any fake stuff needed, it is not used properly
      exch.Url = new EwsJS.Uri("https://outlook.office365.com/Ews/Exchange.asmx"); // anything valid url

      EwsJS.Folder.Bind(exch, new EwsJS.FolderId(EwsJS.WellKnownFolderName.MsgFolderRoot))
        .then(function (root) {
          return root.FindFolders(new EwsJS.FolderView(100));
        }).then(function (subfolders) {
          subfolders.Folders.forEach(function (f) {
              console.log(f.DisplayName + " : " + f.FolderClass + " : " + f.TotalCount); // just logging here, do what you want.
          });
      }).catch(function (err) {
          console.log("Error occurred");
          console.log(err);
      });
    });
  };
```

repository: gautamsi/ews-js-api-browser

repo_name: gautamsi/ews-js-api-browser


text:
# From Google Sheets to GitHub

This tool will save public Google Sheets into GitHub repositories

To add a new sheet, send a pull request to modify `spreadsheets.json`

Supported file extensions are `.json`, `.html`, and `.md`.

At the moment, the update is once a day.


text:
---
layout: post
title: Wiki Pocket
thumbnail-path: "img/wikipocket.png"
short-description: A markdown wiki SaaS.
project-id: wikipocket
center: true
---

{:.center}
![Screenshot of Wiki Pocket.]({{ site.baseurl }}/img/wikipocket.png)

## Background

Wiki Pocket was developed as part of the [Bloc](https://bloc.io) Ruby on Rails training. It provides users the ability to create Markdown wikis and to share wikis with collaborators.

---

## Challenge

Developing Wiki Pocket presented me with a new challenge in web application development - integrating third party APIs.

[Pocket](http://getpocket.com) is a platform for saving links for later consumption while browsing on a desktop or mobile device. It even integrates with many common apps such as Twitter and Facebook.

Since Wiki Pocket's primary function was to facilitate wiki creation, I designed a user experience that leverages the dynamic bookmarking of Pocket to easily create new Wikis in three easy steps

1. A user finds an interesting link and saves it to Pocket.
2. The user searches for the link in Wiki Pocket, which is connected to their Pocket account.
3. The user creates a new wiki based on the saved link with a single button click.

---

## Solution

The first step in integrating [Pocket's API](https://getpocket.com/developer/) was looking at Pocket's available response types and deciding how to integrate that with my existing model. Being able to retrieve the website titles and URLs from Pocket matched nicely with my Link Model, so I added the calls to the Pocket API from my `LinksController#index` action.

~~~Ruby
class LinksController < ApplicationController
  def index
    # If searching Pocket Links
    if params[:pocket_search]
      @links = []
      @retrieved_links = PocketApi.retrieve({
        :search => params[:pocket_search],
        :sort => 'title'
      })
      @retrieved_links.each do |link_hash, retrieved_link|
        new_link = Link.new(
          user: current_user,
          title: retrieved_link["given_title"],
          url: retrieved_link["given_url"]
        )
        @links << new_link
      end
    # If searching the Links Table
    elsif params[:search]
      @links = Link.search(params[:search])
    # If browsing Links Table
    else
      @links = Link.all
    end
  end
~~~

Now, the `Links#index` view can show either links retrieved from the Pocket API or links from the Links Table, depending on the presence of a `:pocket_search` value in params. Links retrieved from the API are stored in Link objects, but not saved to the database.

In the `Links#index` view, we can show the retrieved links and create a form to save a link from Pocket.

{:.center}
![Screenshot of Wiki Pocket.]({{ site.baseurl }}/img/createwikifromlink.png)

If the user clicks the "Create a New Wiki with this Link." button, a new Wiki record and Link record are created - the new link belongs to the wiki as a reference. The user is then redirected to the `Wikis#edit` view for the newly created wiki.

{:.center}
![Screenshot of Wiki Pocket.]({{ site.baseurl }}/img/newlycreatedwiki.png)

Being able to create a Wiki referencing a bookmark with just a few steps simplifies the user's flow from content discovery to content creation.

## Further development

Creating adding third party services to an app opens up a lot of potential improvements to Wiki Pocket in the future.  In the future, it would be ideal for a user to be able to create an account on Wiki Pocket using their third-party user account.  Since Pocket uses the [OmniAuth](http://intridea.github.io/omniauth/) library for API authentication, this could be done fairly simply.

Also, vital to an app for gathering information, is the abiity to easily share that info.  Integrating social sharing functions to Wiki Pocket would be a great next step.


text:
# Two-Legged OAuth

Copyright 2012 Apigee Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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

This sample shows how use the OAuth 2.0 "client credentials" grant type to return an OAuth
access token for an application based on the application's own credentials. (This is
sometimes called "two-legged OAuth.") It also validates incoming requests using the
OAuth token, and uses an API Product to assign a quota value to each application, and
enforces that quota.

It contains the following policies:

1. An AssignMessage policy to set the "flow.resource.name" variable, which is essential
to API Product processing.
2. An OAuth 2.0 policy to generate the access token on a specific URL.
3. An OAuth 2.0 policy to validate the access token for another URL, and to look
up attributes from the API Product associated with the application.
4. A policy to enforce a quota on the number of API calls based on the values set
in the API Product.

To deploy this sample, use the instructions in README.md in the "setup" directory.

repository: imranqureshi/api-platform-samples

repo_name: imranqureshi/api-platform-samples


text:
<!---
    name: AvScan File System Minifilter Driver
    platform: WDM
    language: cpp
    category: FileSystem
    description: This filter is a transaction-aware file scanner that examines data in files.
    samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=617644
--->

AvScan File System Minifilter Driver
====================================

The AvScan minifilter is a transaction-aware file scanner. This is an example for developers who intend to write filters that examine data in files. Typically, anti-virus products fall into this category.

## Universal Windows Driver Compliant
This sample builds a Universal Windows Driver. It uses only APIs and DDIs that are included in OneCoreUAP.

license: MS-PL

gha_language: C

gha_license_id: MS-PL


text:
# particle-plant-monitor
A simple atmospheric monitor utilizing a Particle Photon, DHT11 temperature sensor, and a capacitive soil moisture sensor.

![setup](setup.jpg)

## Story
I like fresh basil.  Nothing tastes better than pasta or a pizza with fresh basil on top.  Unfortunately I have a lot of hobbies and sometimes forget to look after my basil plant.  (Currently named "Charlie 2.0" as it follows in the footsteps of the original "Charlie".)

To help me better take care of "Charlie 2.0" I decided to put together a little data collection system.  Hopefully I am able to use this data to better predict when I should be watering not only my basil plant, but the others around my apartment as well.

So I cobbled together some parts (with a bit of help from AliExpress), yanked my camping solar panel out of storage, and put it all together.

## Parts
- Particle Photon
- DHT11 Temperature / Humidity sensor
- Capacitive Soil Moisture Sensor "v1.2"
- 18W 5V solar panel

## Setup

### Soil moisture sensor connections
- VCC --> 3.3v
- GND --> GND
- AOUT --> A4

### DHT11 sensor
- VCC --> VIN
- GND --> GND
- DATA --> D2

repository: ckuzma/particle-plant-monitor

repo_name: ckuzma/particle-plant-monitor


text:
Changelog
=========
Version 3.7.1 (2023-08-08)
--------------------------
* Optimized a  queryset in `get_queued()` that doesn't use indexes in Postgres. Thanks @marsha97!
* Removed `date_hierarchy` option which causes admin to load slowly on DBs with a large number of emails. Thanks @selwin!
* Optimized `cleanup_expired_mails()` so that deletes emails in smaller batches. Thanks @marsha97!

Version 3.7.0 (2023-05-30)
--------------------------
* Changed JSON columns to use Django's `JSONField` and drop `jsonfield` dependency. Thanks @jrief!
* Fixed saving HTML emails that have `quoted_printable`. Thanks @gabn88!
* Fixes an issue where emails are rendered without context in Django's admin interface. Thanks @zagl!
* This version no longer supports Django 3.1.

Version 3.6.3 (2022-10-27)
--------------------------
* Fixed an issue where emails may not be rendered with context. Thanks @zagl!
* Fixed a few packaging issues. Thanks @zagl and @adamchainz!
* `send_messages()` now mimics Django's SMTP Backend return value. Thanks @JiriKr!

Version 3.6.2 (2022-10-12)
--------------------------
* Improvement to attachment handling in admin interface. Thanks @petrprikryl!
* Fixed a bug where HTML body is not displayed in admin interface. Thanks @robbieadi!
* Explicitly specify `default_auto_field` to supress migration warnings. Thanks @CirXe0N!
* Fixed a bug where `email.template` is not saved in certain cases. Thanks @franciscobmacedo!

Version 3.6.1 (2022-07-04)
--------------------------
* Support for bleach >= 5.0. Thanks @franciscobmacedo!
* Ensure that `Reply-To` headers are correctly set. Thanks @christophmeissner!
* Add a `Resend` button in admin to easily resend an email. Thanks @domdinicola!

Version 3.6.0 (2021-12-21)
--------------------------
* Support for Django 4.0. Thanks @domdinicola!
* `cleanup_mail` now deletes emails in batches, which is much nicer to DB when deleting millions of emails. Thanks @stevemc4!
* Failure to send an email are now logged as an exception. Thanks @SaturnFromTitan!
* Added `es` locale. Thanks @ahmontero!
* Fixed admin template discovery issue for case-sensitive filesystems. Thanks @fasih!
* Fixes: `SMTPServerDisconnected` error. Thanks @weimens!
* Various maintenance work by @jrief and @mogost.

Version 3.5.3 (2020-12-04)
--------------------------
* Fixed an issue with Celery integration that could cause duplicate emails. Thanks @jrief!

Version 3.5.2 (2020-11-05)
--------------------------
* Fixed an issue where Post Office's admin interface doesn't show. Thanks @christianciu!

Version 3.5.1 (2020-11-03)
--------------------------
* Added missing migration file (some model fields now offer a help text).

Version 3.5.0 (2020-10-31)
--------------------------
* Added the capability to configure retries via `MAX_RETRIES` and `RETRY_INTERVAL` configuration settings. Thanks @Houtmann and @jrief!
* The admin interface has been improved to show previews of emails. If you want HTML emails to be rendered,
  please install `bleach`. Thanks @jrief!
* Add `Message-ID` to the Email model. This allows administrators to trace back emails. Thanks @jrief!
* Added `CELERY_ENABLED` settings. Thanks @elineda!
* Fixes an issue that prevents PDS attachments from being sent. Thanks @patroqueeet!

Version 3.4.1 (2020-05-16)
--------------------------
* Allow `tasks.py` to be imported when Celery is not installed. This allows
  auto-discovery by other task systems such as Huey to succeed.
* Fix duplicate key problem in template editor in Django admin.

Version 3.4.0 (2020-04-13)
--------------------------
* Signals that emails have been put into the queue.
* [Celery](http://www.celeryproject.org/) integration for immediate asynchronous delivery.
* Changed version handling.

Version 3.3.1 (2020-02-28)
--------------------------
* Drop support for Django < 2.2.
* Revert ``jsonfield2`` back to ``jsonfield`` to make upgrade from < 3.3.0 smoother. Thanks @rpkilby!

Version 3.3.0
-------------
* Support for Django 3.0. Thanks @Mogost!
* Drop support for Django < 1.11 and Python < 3.5. Thanks @Mogost!
* Replace unsupported dependency ``jsonfield`` with supported fork ``jsonfield2``. Thanks @Mogost!
* Added `OVERRIDE_RECIPIENTS` for testing purposes. Thanks @Houtmann!
* Improved admin interface. Thanks @ilikerobots and @cwuebbels!

Version 3.2.1
-------------
* Fix #264: Replace unicode elipsis against 3 dots.

Version 3.2.0
-------------
* Drop support for Python-3.3.
* Drop support for Django-1.8 and 1.9.
* Add functionality to attach images as inlines to email body.
* Add special template engine to render HTML emails with inlined images.
* Update German translation strings.

Version 3.1.0 (2018-07-24)
--------------------------
* Improvements to attachments are handled. Thanks @SeiryuZ!
* Added `--delete-attachments` flag to `cleanup_mail` management command. Thanks @Seiryuz!
* I18n improvements. Thanks @vsevolod-skripnik and @delneg!
* Django admin improvements. Thanks @kakulukia!

Version 3.0.4
-------------
* Added compatibility with Django 2.0. Thanks @PreActionTech and @PetrDlouhy!
* Added natural key support to `EmailTemplate` model. Thanks @maximlomakin!

Version 3.0.3
-------------
* Fixed memory leak when multiprocessing is used.
* Fixed a possible error when adding a new email from Django admin. Thanks @ivlevdenis!

Version 3.0.2
-------------
* `_send_bulk` now properly catches exceptions when preparing email messages.

Version 3.0.1
-------------
* Fixed an infinite loop bug in `send_queued_mail` management command.

Version 3.0.0
-------------
* `_send_bulk` now allows each process to use multiple threads to send emails.
* Added support for mimetypes in email attachments. Thanks @clickonchris!
* An `EmailTemplate` can now be used as defaults multiple times in one language. Thanks @sac7e!
* `send_queued_mail` management command will now check whether there are more queued emails to be sent before exiting.
* Drop support for Django < 1.8. Thanks @fendyh!

Version 2.0.8
-------------
* Django 1.10 compatibility fixes. Thanks @hockeybuggy!
* Fixed an issue where Django would sometimes create migration files for post-office. Thanks @fizista!

Version 2.0.7
-------------
* Fixed an issue with sending email to recipients with display name. Thanks @yprez!

Version 2.0.6
-------------
* Fixes Django 1.10 deprecation warnings and other minor improvements. Thanks @yprez!
* Email.subject can now accept up to 989 characters. This should also fix minor migration issues. Thanks @yprez!

Version 2.0.5
-------------
* Fixes more Django 1.8 deprecation warnings.
* `Email.dispatch()` now closes backend connection by default. Thanks @zwack
* Compatibility fixes for Django 1.9. Thanks @yprez!

Version 2.0.2
-------------
* `Email.dispatch()` now closes backend connection by default. Thanks @zwack
* Compatibility fixes for Django 1.9. Thanks @yprez!

Version 2.0.1
-------------
* Fixes migration related packaging issues.
* Fixes deprecation warning in Django 1.8.

Version 2.0
-----------
* Added multi backend support. Now you can use multiple email backends with ``post-office``!
* Added multi language support. Thanks @jrief!

Version 1.1.2
-------------
* Adds Django 1.8 compatibility.

Version 1.1.1
-------------
* Fixes a migration error. Thanks @garry-cairns!

Version 1.1.0
-------------
* Support for Django 1.7 migrations. If you're still on Django < 1.7,
  South migration files are stored in ``south_migrations`` directory.

Version 1.0.0
-------------
* **IMPORTANT**: in older versions, passing multiple ``recipients`` into
  ``mail.send()`` will create multiple emails, each addressed to one recipient.
  Starting from ``1.0.0``, only one email with multiple recipients will be created.
* Added ``LOG_LEVEL`` setting.
* ``mail.send()`` now supports ``cc`` and ``bcc``.
  Thanks Ștefan Daniel Mihăilă (@stefan-mihaila)!
* Improvements to ``admin`` interface; you can now easily requeue multiple emails.
* ``Log`` model now stores the type of exception caught during sending.
* ``send_templated_mail`` command is now deprecated.
* Added ``EMAIL_BACKEND`` setting to the new dictionary-styled settings.

Version 0.8.4
-------------
* ``send_queued_mail`` now accepts an extra ``--log-level`` argument.
* ``mail.send()`` now accepts an extra ``log_level`` argument.
* Drop unused/low cardinality indexes to free up RAM on large tables.

Version 0.8.3
-------------
* ``send_queued_mail`` now accepts ``--lockfile`` argument.
* Lockfile implementation has been modified to use symlink, which is an atomic operation
  across platforms.

Version 0.8.2
-------------
* Added ``CONTEXT_FIELD_CLASS`` setting to allow other kinds of context field serializers.

Version 0.8.1
-------------
* Fixed a bug that causes context to be saved when ``render_on_delivery`` is False

Version 0.8.0
-------------
* Added a new setting ``DEFAULT_PRIORITY`` to set the default priority for emails.
  Thanks Maik Hoepfel (@maikhoepfel)!
* ``mail.send()`` gains a ``render_on_delivery`` argument that may potentially
  result in significant storage space savings.
* Uses a new locking mechanism that can detect zombie PID files.

Version 0.7.2
-------------
* Made a few tweaks that makes ``post_office`` much more efficient on systems with
  large number of rows (millions).

Version 0.7.1
-------------
* Python 3 compatibility fix.

Version 0.7.0
-------------
* Added support for sending attachments. Thanks @yprez!
* Added ``description`` field to ``EmailTemplate`` model to store human readable
  description of templates. Thanks Michael P. Jung (@bikeshedder)!
* Changed ``django-jsonfield`` dependency to ``jsonfield`` for Python 3 support reasons.
* Minor bug fixes.

Version 0.6.0
-------------
* Support for Python 3!
* Added mail.send_many() that's much more performant when sending
  a large number emails

Version 0.5.2
-------------
* Added logging
* Added BATCH_SIZE configuration option

Version 0.5.1
-------------
* Fixes various multiprocessing bugs

Version 0.5.0
-------------
* Email sending can now be parallelized using multiple processes (multiprocessing)
* Email templates are now validated before save
* Fixed a bug where custom headers aren't properly sent

Version 0.4.0
-------------
* Added support for sending emails with custom headers (you'll need to run
  South when upgrading from earlier versions)
* Added support for scheduled email sending
* Backend now properly persist emails with HTML alternatives

Version 0.3.1
-------------
* **IMPORTANT**: ``mail.send`` now expects recipient email addresses as the first
 argument. This change is to allow optional ``sender`` parameter which defaults
 to ``settings.DEFAULT_FROM_EMAIL``
* Fixed a bug where all emails sent from ``mail.send`` have medium priority

Version 0.3.0
-------------
* **IMPORTANT**: added South migration. If you use South and had post-office
  installed before 0.3.0, you may need to manually resolve migration conflicts
* Allow unicode messages to be displayed in ``/admin``
* Introduced a new ``mail.send`` function that provides a nicer API to send emails
* ``created`` fields now use ``auto_now_add``
* ``last_updated`` fields now use ``auto_now``

Version 0.2.1
-------------
* Fixed typo in ``admin.py``

Version 0.2
-----------
* Allows sending emails via database backed templates

Version 0.1.5
-------------
* Errors when opening connection in ``Email.dispatch`` method are now logged


text:
Generate Scondary Analysis Documentation
========================================

A script to make an overview look at the qiime secondary analysis from my [qiime_secondary_analysis.py](https://github.com/gblanchard4/qiime_secondary_analysis).

I created this to make looking at qiime analysis data easier. It can be pretty intimidating to get a zip directory of data. This helps relieve some fear by giving a user an easier interface to navigate the analysis with an enviroment they are familiar with, your favorite web browser.

# Expectations
Right now the script expects a certain folder structure, I will try to generalize it more in the future. Need to catch IOError for ANOSIM folders

```
RootFolder
|
└───/Secondary1
		|->	table_summary.txt
		|
		└───/alpha_diversity
		|		└───/alpha_div_collated
		|		|		└───/[metric]_[category]
		|		|				|─> [category]_boxplots.pdf
		|		|				|─> [category]_stats.txt
		|		└───/alpha_rarefaction_plots
		|				|─> rarefaction_plots.html
		|
		└───/beta_diversity
		|		└───/2d_unweighted_unifrac_plots/
		|		|			|─> *.html
		|		└───/2d_weigthted_uniifrac_plots/
		|		|			|─> *.html
		|		└───/unweighted_unifrac_emperor_pcoa_plot/
		|		|			|─> *.html
		|		└───/weighted_unifrac_emperor_pcoa_plot/
		|		|			|─> *.html
		|		└───/ANOSIM_*_unweighte/
		|		|			|─> anosim_results.txt
		|		└───/ANOSIM_*_weighted/
		|					|─> anosim_results.txt
		|
		└───/taxa_summary
		|		└───/taxa_[category]
		|				└───/taxa_summary_plots
		|						|─> area_charts.html
		|						|─> bar_charts.html
		|
		└───/core_microbiome
				└───core_microbiome_[category]/
						|─> core_otus_[50-100].txt
						|─> core_otus_[50-100].biom
						|─> core_otus_size.pdf

```
# Usage
`html_doc.py -i RootFolder`
This will create a file called `overview.html` in the *RootFolder* and each *SecondaryFolder*
## --noroot
`html_doc.py -i SecondaryFolder --noroot`
If you pass this flag, you can input a single secondary analysis folder


text:
---
title: "Studying Pathom"
date: 2021-09-08T14:44:24+03:00
draft: false
description: ""
tags:
categories: clojure
type: post
url:
author: "Mert Nuhoglu"
output:
  html_document:
    css: styles.css
state: wip

---

# Pathom 3 User Guide

## Article: Getting Started | Pathom 3 id=g12386

[Getting Started | Pathom 3](https://pathom3.wsscode.com/docs/)

``` clojure
clojure -X:project/new :name main/pathom01
```

ref: `/Users/mertnuhoglu/projects/study/clj/ex/study_pathom/pathom01/src/main/pathom01.clj`

## Pathom Tutorial - IP Weather | Pathom 3

[Pathom Tutorial - IP Weather | Pathom 3](https://pathom3.wsscode.com/docs/tutorial)

Run: `clj -X:ip-weather :ip '"<IP_ADDRESS>"'`

ref: `/Users/mertnuhoglu/projects/study/clj/ex/study_pathom/pathom01/src/main/pathom02.clj`

ref: `/Users/mertnuhoglu/projects/study/clj/ex/study_pathom/pathom01/src/main/pathom03.clj`

ref: `/Users/mertnuhoglu/projects/study/clj/ex/study_pathom/pathom01/src/main/pathom04.clj`

``` clojure
  # some specific IP
clj -X:ip-weather :ip '"<IP_ADDRESS>"'
  # => It's currently 8.33C at {:ip "<IP_ADDRESS>"}

  # get from your IP
clj -X:ip-weather :ip "\"$(curl -s ifconfig.me)\""
  # => It's currently ??C at {:ip "YOUR_IP"}
```

![resolver graph](https://pathom3.wsscode.com/assets/images/index-oir-connected-2e85da1a6cfb398486ea5a061f8a3550.png)

### Resolvers

ref: `/Users/mertnuhoglu/projects/study/clj/ex/study_pathom/pathom01/src/main/pathom05.clj`

``` clojure
(def user-birthdays
  {1 1969
   2 1954
   3 1986})

; defresolver is the main option to create new resolvers
(pco/defresolver user-birthday [{:keys [acme.user/id]}]
  {:acme.user/birth-year (get user-birthdays id)})
```

Resolvers represent edges in a graph:

	[user/id] - user/birthday -> [user/birth-year]

![graph2](/Users/mertnuhoglu/gdrive/keynote_resimler/screencapture/scs20210909_130445.jpg)

### Built-in Resolvers

[Built-in Resolvers | Pathom 3](https://pathom3.wsscode.com/docs/built-in-resolvers)

ref: `/Users/mertnuhoglu/projects/study/clj/ex/study_pathom/pathom01/src/main/builtin_resolver01.clj`

### Using defresolver

ref: `/Users/mertnuhoglu/projects/study/clj/ex/study_pathom/pathom01/src/main/pathom06.clj`

### Built-in Resolvers

ref: `/Users/mertnuhoglu/projects/study/clj/ex/study_pathom/pathom01/src/main/builtin_resolver01.clj`

### Smart Maps

ref: `/Users/mertnuhoglu/projects/study/clj/ex/study_pathom/pathom01/src/main/smart_maps01.clj`

### EQL

[EQL | Pathom 3](https://pathom3.wsscode.com/docs/eql)

# Article: Pathom v2 Documentation  id=g12388

[Introduction | Pathom](https://blog.wsscode.com/pathom/v2/pathom/2.2.0/introduction.html)

``` clojure
clojure -X:project/new :name main/pathom02
```

ref: `/Users/mertnuhoglu/projects/study/clj/ex/study_pathom/pathom02/deps.edn`

com.wsscode/pathom {:mvn/version "2.4.0"}

## Introduction

ref: `/Users/mertnuhoglu/projects/study/clj/ex/study_pathom/pathom02/src/main/pathom01.clj`

## How it works

ex: `[:answer-to-everything :answer-plus-one]`

Buradaki her bir atributu tek tek alır parser ve reader'ı çağırır.

Reader bir entry alır.

Entry: propery, join veya ident olabilir.

Pathom, veriyi çıkartmak için bağımlılık çizgesinin (dependency graph) dolaşır. Buna Connect denir. Her resolver, çizgenin bir kenarıdır (edge).

## Connect

[Pathom Connect | Pathom](https://blog.wsscode.com/pathom/v2/pathom/2.2.0/connect.html)

## Resolvers

ex:

``` clojure
(pc/defresolver person-resolver
  [{:keys [database] :as env} {:keys [person/id]}]
  {::pc/input #{:person/id}
   ::pc/output [:person/first-name :person/age]}
  (let [person (my-database/get-person database id)]
    {:person/age        (:age person)
     :person/first-name (:first-name person)}))
```

### Derived Attributes

Hesaplanan atributları resolver içinde tanımlayabilirsin:

``` clojure
(pc/defresolver person-resolver [{:keys [database] :as env} {:keys [person/id]}]
  {::pc/input #{:person/id}
   ::pc/output [:person/first-name :person/last-name :person/full-name :person/age]}
  (let [{:keys [age first-name last-name]} (my-database/get-person database id)]
    {:person/age        age
     :person/first-name first-name
     :person/last-name  last-name
     :person/full-name  (str first-name " " last-name) ; COMPUTED
     ...}))
```

Ancak bu durumda, hepsi bir arada olduğundan, performans açısından gereksiz israf olabilir. Mesela elinde first-name ve last-name vardır, sadece full-name atributuna ihtiyaç duyuyorsundur. Yukarıdaki resolver ile hepsi en baştan hesaplanır. Halbuki iki ayrı resolver yapsak, sadece eksik olan atribut hesaplanır:

``` clojure
(pc/defresolver person-resolver [{:keys [database] :as env} {:keys [person/id]}]
  {::pc/input #{:person/id}
   ::pc/output [:person/first-name :person/last-name :person/age]}
  (let [{:keys [age first-name last-name]} (my-database/get-person database id)]
    {:person/age        age
     :person/first-name first-name
     :person/last-name  last-name}))

(pc/defresolver person-name-resolver [_ {:person/keys [first-name last-name]}]
  {::pc/input #{:person/first-name :person/last-name}
   ::pc/output [:person/full-name]}
  {:person/full-name (str first-name " " last-name)})

```

repository: mertnuhoglu/study

gha_language: HTML

repo_name: mertnuhoglu/study


text:
# Mustache.NETStandard & Mustache.PCL - Logic-less templates for .NET

These libraries are implementations of Mustache logic-less templates specifications.

Mustache.NETStandard is a .NETStandard Class Library for .NETStandard 2.0.

Mustache.PCL is a .NET Portable Class Library for
- .NET Framework 4.6
- ASP.NET Core 1.0
- Windows Universal 10.0

Mustache documentation and specifications can be found at [http://mustache.github.com](http://mustache.github.com).

# Compliance to Mustache specifications
This implementation is compliant to version 1.1.3 (currently this is the last version) of Mustache specifications except for the optional module *lambdas*. Specifications are available at [https://github.com/mustache/spec](https://github.com/mustache/spec).

# NuGet
Mustache.NETStandard is availabe using NuGet at [https://www.nuget.org/packages/Mustache.NETStandard](https://www.nuget.org/packages/Mustache.NETStandard).

Mustache.PCL is availabe using NuGet at [https://www.nuget.org/packages/Mustache.PCL](https://www.nuget.org/packages/Mustache.PCL).

# How to use the library
Here is a code sample to explain how to use this library

    {% raw %}
    const string templateString = @"Hello {{Name}}
    You have just won {{Value}} {{Currency}}!
    {{#InCa}}
    Well, {{TaxedValue}} {{Currency}}, after taxes.
    {{/InCa}}";{% endraw %}

    var data = new
    {
        Name = "Chris",
        Value = 10000,
        TaxedValue = 6000,
        Currency = "dollars",
        InCa = true
    };

    string result = Template.Compile(templateString).Render(data);

The value of result is

    Hello Chris
    You have just won 10000 dollars!
    Well, 6000 dollars, after taxes.

It is possible to use Dictionaries too:

    var data = new Dictionary<string, object>
    {
        {"Name", "Chris"},
        {"Value", "10000"},
        {"TaxedValue", 6000},
        {"Currency", "dollars"},
        {"InCa", true}
    };

If you need partials use method Template.Render(object, Dictionary<string, string>), example:

    var data = new
    {
        Name = "Chris",
        Value = 10000,
        TaxedValue = 6000,
        Currency = "dollars",
        InCa = true
    };

    {% raw %}var partials = new Dictionary<string, string> { { "partial", "Well, {{TaxedValue}} {{Currency}}, after taxes.\r\n" } };

    const string templateString = @"Hello {{Name}}
    You have just won {{Value}} {{Currency}}!
    {{#InCa}}
    {{>partial}}
    {{/InCa}}
    ";{% endraw %}

     string result = Template.Compile(templateString).Render(data, partials);