text:
---
layout: post
title: "This is How You Win in the NFL....Oh No, This is How You Win...."
excerpt: "Sports"
categories: sports
comments: false
share: true
---

![](https://www.nbcsports.com/bayarea/sites/csnbayarea/files/styles/article_hero_image/public/2018/08/19/shanahanshrugtexansusatsi.jpg?itok=Xl3ZPmZs)

We are now down to the final four of the NFL and every year at this time, everyone tries to come up with the reasons why these four teams made it, why your team didn't make it, and make sweeping conclusions about a very small data set.

This year, these best four teams are all ranked in the top 5 of OVOA (Offense-adjusted Value Over Average....how they come up with this value I do not know. Although I love the effort and sure some smart people are figuring this out, the lack of transparency of any statistical value is one I do not trust) and all have very successful quarterbacks.

Therefore, offense wins titles.

Last year the final four teams were: Vikings, Eagles, Patriots, Jaguars.

Two of these teams were in the OVOA top 5. Three of these four teams had a different starting quarterback at the beginning of the next season. Also three of these four teams had top 5 defenses.

Therefore, defense must win titles.

The point is that there is not one way of winning in the NFL. Having a great QB does not guarantee success (see Aaron Rodgers). Having a great defense does not always ensure playoff success (see the 2018 Bears, the 1999-2001 Tampa Bay Bucs, see the 2014 Cincinnati Bengals, etc). Honestly, the only thing that you can etch in stone in the NFL is that the Patriots are very good, probably due to Belichick understanding that there are many ways to win.

There has been a lot of talk around the Seattle area about the Hawks and their commitment to running the ball. In other words, they run too much.

This may be true, and there is a fantastic article about it on 538 (see the link here) [](https://fivethirtyeight.com/features/you-called-a-run-on-first-down-youre-already-screwed/]).

But there is this growing idea in the NFL that there is only one way to win: by passing.

Yes, all NFL new rules help passing, and we know that passing translates to yards.

But it really is not passing that is winning these games. It is controlling the line of scrimmage.

That is the one thing that all four teams this season and last season do: block on offense and are hard to block on defense.

I say this all the time, so please this weekend ignore QB talk, ignore flashy throws and catches. Watch to see who does what they want to do on a given down; run, pass, or whatever. If it works, ask why.

I bet if you focus on the line, you will have your answer.

gha_language: JavaScript


text:
# wiimmfi-discord
 ![Last Commit](https://img.shields.io/github/last-commit/samcarsonx/wiimmfi-discord)
 ![Commits since last release](https://img.shields.io/github/commits-since/samcarsonx/wiimmfi-discord/latest)
 [![MIT Licence](https://img.shields.io/github/license/samcarsonx/wiimmfi-discord)](https://github.com/samcarsonx/wiimmfi-discord/blob/master/LICENSE)
 [![Forks](https://img.shields.io/github/forks/samcarsonx/wiimmfi-discord)](https://github.com/samcarsonx/wiimmfi-discord/fork)
 [![Stars](https://img.shields.io/github/stars/samcarsonx/wiimmfi-discord)](https://github.com/samcarsonx/wiimmfi-discord/stargazers)
 [![Open Issues](https://img.shields.io/github/issues/samcarsonx/wiimmfi-discord)](https://github.com/samcarsonx/wiimmfi-discord/issues)
 ![Using PyPresence](https://img.shields.io/badge/using-pypresence-00bb88.svg)
 ![Max-used language](https://img.shields.io/github/languages/top/samcarsonx/wiimmfi-discord)

Python 3.6+ rich presence client by **Sam Carson** for the **Wiimmfi servers.** Please reference [their wiki page](http://wiki.tockdom.com/wiki/Wiimmfi) for extra information.

## How to use
Using this is as simple as cloning the repo or heading over to the [releases section](https://github.com/samcarsonx/wiimmfi-discord/releases) and downloading it. Run `python3 main.py` in a terminal and after the first use it will probably say that the config contains default values. That will be covered in the next section:

## Configuration
There are two config files, `friend_codes.py` and `status.py` (they are in py format so loading is as simple as importing)
### friend_codes.py
```
data = [
    {
        "game": "XXXX",
        "friend_code": "XXXX-XXXX-XXXX-XXXX"
    }
]
```
**To edit:**
* change `game` to any ID from [this huge list](https://wiimmfi.de/stat?m=25)
* change `friend_code` to the 16 digit code you have in the specified game.

*Extended functionality is supported for Mario Kart Wii (such as showing current track and amount of players in the room), its code is `RMCJ`.*
*Only hyphens and digits are supported in the friend code.*

### status.py
```
data = {
    "0": "User offline",
    "1": "In the menus",
    "2": "In a room",
    "3": "Searching for opponents",
    "4": "Connecting to private room",
    "5": "Hosting a room",
    "6": "Special brawling"
}
```
**To edit:**
* **keep the key names, such as `"1"` the same**, but the messages can be edited; these are the default values.

*Status 6 is specific for Super Smash Bros Brawl for an unknown reason*

## Roadmap
~~In the future, I plan on re-writing this to make it clearer and faster to use.~~ *No need, already efficient.*

license: MIT

repository: samcarsonx/wiimmfi-discord

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: samcarsonx/wiimmfi-discord


text:
---
layout: post
title: "Whole Process For Deploying Contrail"
date: 2015-03-30 18:20
comments: true
categories:
---
Following are the steps, enjoy them:

```
# First bootstrap the environment.
juju bootstrap --metadata-source ~/.juju/metadata --upload-tools -v --show-log --constraints="mem=3G"

#####################################################
# Machine 0, hold 9 services. 3G mem. trusty
# Memory: 3G
# Service: 10
#####################################################

# Since machine 0 is ready for using, deploy services to this node via following commands:
# Juju-gui is for monitoring the status and the components
# 1. juju-gui
juju deploy --to 0 --repository=/home/Trusty/charms/ local:trusty/juju-gui
# 2. rabbitmq-server
juju deploy --to lxc:0 --repository=/home/Trusty/charms/ local:trusty/rabbitmq-server
# 3. mysql
juju deploy --to lxc:0 --repository=/home/Trusty/charms/ local:trusty/mysql
# 4. keystone
juju deploy --to lxc:0 --repository=/home/Trusty/Code/deployOpenContrail/contrail-deployer/src/charms/ local:trusty/keystone
# 5. openstack-Trustyboard
juju deploy --to lxc:0 --repository=/home/Trusty/Code/deployOpenContrail/contrail-deployer/src/charms/ local:trusty/openstack-Trustyboard

# 6. nova-cloud-controller
juju deploy --to lxc:0 --repository=/home/Trusty/Code/deployOpenContrail/contrail-deployer/src/charms/ local:trusty/nova-cloud-controller --config=/home/Trusty/Code/deploy/nova-cloud-controller-config.yaml
# 7. glance to lxc:0
juju deploy --to lxc:0 --repository=/home/Trusty/Code/deployOpenContrail/contrail-deployer/src/charms/ local:trusty/glance
# 8. contrail-configuration to lxc:0
juju deploy --to lxc:0 --repository=/home/Trusty/Code/deployOpenContrail/contrail-deployer/src/charms/ local:trusty/contrail-configuration
# 9. control-control to lxc:0
juju deploy --to lxc:0 --repository=/home/Trusty/Code/deployOpenContrail/contrail-deployer/src/charms/ local:trusty/contrail-control
# 10. neutron-api to lxc:0
juju deploy --to lxc:0 --repository=/home/Trusty/Code/deployOpenContrail/contrail-deployer/src/charms/ local:trusty/neutron-api --config=/home/Trusty/Code/deploy/neutron-api.yaml

# Now add the first node for nova-compute.
juju set-constraints "mem=900M"
#####################################################
# Machine 1, hold nova-compute service, 2G with nested CPU, trusty
# Memory: 2G
# Service: 1
#####################################################

# Add name specified machine, which memory is 2048M, with cpu nested for kvm
juju add-machine MaasOpenContrail4
# Machine 1 will be added into the Juju environment, deploy nova-compute into this node
juju deploy --to 1 --repository=/home/Trusty/Code/deployOpenContrail/contrail-deployer/src/charms/ local:trusty/nova-compute

#####################################################
# Machine 2, hold neutron-gateway service, 1G , trusty
# Memory: 1G
# Service: 1
#####################################################
# Add neutron-gateway to 1G based machine , it may fail, so you could remove-machine, and re-add again. via `juju destroy-machine 2 --force`
juju add-machine MaasOpenContrail7
juju deploy --to 4 --repository=/home/Trusty/Code/deployOpenContrail/contrail-deployer/src/charms/ local:trusty/quantum-gateway neutron-gateway

#####################################################
# Machine 3, hold cassandra and zookeeper serivce, 4G, precise.
# Memory: 4G
# Service: 2
#####################################################
# First we should change the default deployed system version to precise.
juju set-environment default-series=precise
# Add new machine, whose memory is 4G.
juju add-machine MaasOpenContrail5
# Deploy cassandra to 4G Node
juju deploy --to 5 --repository=/home/Trusty/Code/deployOpenContrail/contrail-deployer/src/charms/ local:precise/cassandra --config=/home/Trusty/Code/deploy/cassandra.yaml
# Also use this machine for deploy a lxc based service, zookeeper, which is also based on precise.
juju deploy --to lxc:5 --repository=/home/Trusty/Code/deployOpenContrail/contrail-deployer/src/charms/ local:precise/zookeeper

# Well, set the default environment from precise to trusty
juju set-environment default-series=trusty

# Finally deploy  neutron-contrail
juju deploy --repository=/home/Trusty/Code/deployOpenContrail/contrail-deployer/src/charms/ local:trusty/neutron-contrail

#####################################################
#####################################################
# Well the deploy is finished, then add relationship
#####################################################
#####################################################
juju add-relation keystone mysql
juju add-relation nova-cloud-controller mysql
juju add-relation nova-cloud-controller rabbitmq-server
juju add-relation nova-cloud-controller glance
juju add-relation nova-cloud-controller keystone
juju add-relation neutron-gateway mysql
juju add-relation neutron-gateway:amqp rabbitmq-server:amqp
juju add-relation neutron-gateway nova-cloud-controller
juju add-relation nova-compute:shared-db mysql:shared-db
juju add-relation nova-compute:amqp rabbitmq-server:amqp
juju add-relation nova-compute glance
juju add-relation nova-compute nova-cloud-controller
juju add-relation glance mysql
juju add-relation glance keystone
juju add-relation openstack-Trustyboard keystone
juju add-relation neutron-api mysql
juju add-relation neutron-api rabbitmq-server
juju add-relation neutron-api nova-cloud-controller
juju add-relation neutron-api:identity-service keystone:identity-service
juju add-relation neutron-api:identity-admin keystone:identity-admin
juju add-relation contrail-configuration:cassandra cassandra:database
juju add-relation contrail-configuration zookeeper
juju add-relation contrail-configuration rabbitmq-server
juju add-relation contrail-configuration keystone
juju add-relation contrail-configuration neutron-gateway
juju add-relation neutron-api contrail-configuration
juju add-relation contrail-control contrail-configuration
juju add-relation nova-compute neutron-contrail
juju add-relation neutron-contrail contrail-control
juju add-relation neutron-contrail neutron-gateway
juju add-relation neutron-contrail contrail-configuration
juju add-relation neutron-contrail keystone

# change the passwd of OpenStack:
juju set keystone admin-password="helloworld"

```

repository: purplepalmdash/NewBlog

extension: markdown

repo_name: purplepalmdash/NewBlog


text:
**Whipped Goat Cheese**
*All herbs and spices are to taste. I did not measure these when making it.*

> ***Ingredients***
> - Goat Cheese
> - Rosemary
> - Flat Parsley
> - Whipping Cream
> - Lavender Oil
> - Honey

> **Instructions**
> - Mince rosemary and flat parlsy.
> - Add goat cheese, rosemary, parsley, and whipping cream into blender.
> - Blend until smooth
> - Mix lavender oil and honey in a bowl.
> - Serve goat cheese a bowl and drizzle lavender honey ontop.
> - You can serve with crudite or crackers.

url: https://raw.githubusercontent.com/zoeeewp/recipes/900e6b83ca4eca2a9f33221ba1ed74581afa89f6/Sides/Dips/Whipped Goat Cheese & Lavender Honey.md

repository: zoeeewp/recipes

branch_name: refs/heads/main

filename: Whipped Goat Cheese & Lavender Honey.md

gha_license_id: MIT

repo_name: zoeeewp/recipes


text:
# Weather App
  This project was built around the Wunderground API, which no longer exists.

  This is my Free Code Camp weather app project.
### Built With
+  HTML
+  CSS
+  Javascript
+  Jquery
+  Angular.js
+  Weather Underground API
+  Bootstrap

### Author
+  Melissa Kepler a.k.a. Missarachnid

### Acknowlegdments
+  Free Code Camp
+  Weather Underground

repository: Missarachnid/fcc-weather-app-angular

repo_name: Missarachnid/fcc-weather-app-angular


text:
# Challenge Summary
create leftJoin function all the values in the first hashmap are returned, and if values exist in the “right” hashmap, they are appended to the result row. If no values exist in the right hashmap, then some flavor of NULL should be appended to the result row.## Challenge Description
Createa a merge Sort Function that take  array
and return sorted array
## Approach & Efficiency
- create left join function
- check that we have two tables
- declare result array
- loop for all item in left hashtable
- push the key and value for each itreation
and value of the same key in the second  right
hash table by get hashTable method into result array
- return result array
### Big O:
- time : O (n)
- spce : O(n)
## Solution
![WB](./cc33.PNG)


text:
# Expense-Tracker
An expense tracking system which can generate reports. You can add your expenses with details such as description, amount, date and time of transaction. You will also be able to update/delete your expenses. You can also generate a report of the total amount you spent per week, as well as filter your expenses given a start and end date.

## Installation and Usage

First make sure you have [Python 2.7](https://www.python.org/download/releases/2.7/), then install [Django 1.10](https://www.djangoproject.com/download/) and clone the project. Then:

```sh
$ cd Expense-Tracker
```

Start the **Django Server**:

```sh
$ python manage.py runserver
```

Open a browser go to the following URL:

```
http://localhost:8000/
```
Sign in using one of the following accounts (These are test accounts used for demo purposes):
* username: bob_admin, password: bob_adminpassword, (Admin User)
* username: john_doe, password: john_doepassword, (Normal User)
* username: will_smith, password: willpassword, (Admin User)
* username: tom_jones, password: tom_jonespassword, (Normal User)

The only difference between admin users and normal users, is that admin users are able to view all saved expenses from all users.

repository: yusuf-musleh/Expense-Tracker

repo_name: yusuf-musleh/Expense-Tracker


text:
##### NPM

You need to install its dependencies:

```bash
# JS file
npm install datatables.net-responsive --save
# CSS file
npm install datatables.net-responsive-dt --save
```
##### angular.json

Add the dependencies in the scripts and styles attributes:

```json
{
  "projects": {
    "your-app-name": {
      "architect": {
        "build": {
          "options": {
            "styles": [
              ...
              "node_modules/datatables.net-responsive-dt/css/responsive.dataTables.css"
            ],
            "scripts": [
              ...
              "node_modules/datatables.net-responsive/js/dataTables.responsive.js"
            ],
            ...
}
```

repository: l-lin/angular-datatables

gha_language: TypeScript

repo_name: l-lin/angular-datatables


text:
---
_id: 5f597aa48946f1002f8bf5d6
title: "RESTful API versioning with ASP.NET Core"
url: 'https://dotnetthoughts.net/restful-web-api-versioning-with-asp-net-core/'
category: articles
slug: 'restful-api-versioning-with-aspnet-core'
user_id: 5a83ce59d6eb0005c4ecda2c
username: 'bill-s'
createdOn: '2020-09-10T01:00:20.105Z'
tags: [asp.net-core]
---

This blog post will discuss about the commonly used API Versioning strategies and how to implement them in ASP.NET Core Web API.

For the demo purposes I am creating an ASP.NET Core WEB API project using dotnet new webapi command. To implement versioning we need to add reference of the Microsoft.AspNetCore.Mvc.Versioning nuget package, which we can do by running ` dotnet add package Microsoft.AspNetCore.Mvc.Versioning` command.

Once the package reference is added, in the ConfigureServices method, Versioning support can be added using AddApiVersioning(); method, like this.

repository: dotnetweekly/dnw-gatsby

repo_name: dotnetweekly/dnw-gatsby


text:
The Acknowledgements
=====================

This solution is wrapping Syncfusion Essential JS 2 library, which is available under separate license.

The license for this code is below.

Essential JS 2 library is available under the Syncfusion Essential Studio program,
and can be licensed either under the Syncfusion Community License Program or
the Syncfusion commercial license.

To be qualified for the Syncfusion Community License Program you must have
a gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD)
per year and have less than five (5) developers in your organization,
and agree to be bound by Syncfusion’s terms and conditions.

Customers who do not qualify for the community license can contact<EMAIL_ADDRESS>for commercial licensing options.

Under no circumstances can you use this product ("aurelia-ej2-plugin") without
(1) either a Community License or a commercial license and (2) without agreeing
and abiding by Syncfusion’s license containing all terms and conditions.

The Syncfusion license that contains the terms and conditions can be found at
https://www.syncfusion.com/content/downloads/syncfusion_license.pdf

branch_name: refs/heads/develop

gha_language: CSS


text:
# react-native-device-check
📱 Native bridge to the iOS DeviceCheck API

## Introduction
DeviceCheck helps identify a particular device (per development account) and authenticate a request's origin. Check out the [Apple Developer Doc](https://developer.apple.com/documentation/devicecheck) for more detail. This module returns the token in base64 ready for serialization.

The API was introduced in iOS 11 and requires a physical device, running on a lower target or simulator will throw an exception.

## Usage

Async/await:
```js
getDeviceToken = async () => {
  try {
    let token = await DeviceCheck.getDeviceToken();
  } catch (error) {
    console.log(error);
  }
}
```

Promise:
```js
getDeviceToken() {
  DeviceCheck.getDeviceToken().then(token =>
    //
  ).catch(err =>
    console.log(err)
  );
}
```

## License
MIT

repository: aco/react-native-device-check

repo_name: aco/react-native-device-check


text:
## Wildcard Practice Exercises

### Getting Started

1. Log onto the server
2. Navigate to the practice directory. You should know where it is from the *Navigating the Filesystem Practice Exercises*!

### Questions

1. List all the fastq files (contain `.fastq.` in the filename) in the data directory.
2. List all the fastq files from Lane 2.
3. List all the gzipped files (files ending in `.gz`) in the practice directory.


text:
---
layout: post
title: "A Simple Method to improve Initialization Robustness for Active Contours driven by Local Region Fitting Energy"
date: 2018-02-28 14:43:00
categories: arXiv_CV
tags: arXiv_CV Segmentation
author: Keyan Ding
mathjax: true
---

* content
{:toc}

##### Abstract
Active contour models based on local region fitting energy can segment images with intensity inhomogeneity effectively, but their segmentation results are easy to error if the initial contour is inappropriate. In this paper, we present a simple and universal method of improving the robustness of initial contour for these local fitting-based models. The core idea of proposed method is exchanging the fitting values on the two sides of contour, so that the fitting values inside the contour are always larger (or smaller) than the values outside the contour in the process of curve evolution. In this way, the whole curve will evolve along the inner (or outer) boundaries of object, and less likely to be stuck in the object or background. Experimental results have proved that using the proposed method can enhance the robustness of initial contour and meanwhile keep the original advantages in the local fitting-based models.

##### Abstract (translated by Google)
基于局部区域拟合能量的主动轮廓模型可以有效地对强度不均匀的图像进行分割，但如果初始轮廓不合适，分割结果容易出错。在本文中，我们提出了一种简单而通用的方法来改善这些局部拟合模型的初始轮廓的鲁棒性。所提出的方法的核心思想是交换轮廓两侧的拟合值，使轮廓内的拟合值在曲线演化过程中始终大于（或小于）轮廓外的值。这样，整条曲线将沿着物体的内部（或外部）边界进化，并且不太可能卡在物体或背景中。实验结果证明，采用该方法可以增强初始轮廓的鲁棒性，同时保持局部拟合模型的原有优势。

##### URL
[http://arxiv.org/abs/1802.10437](http://arxiv.org/abs/1802.10437)

##### PDF
[http://arxiv.org/pdf/1802.10437](http://arxiv.org/pdf/1802.10437)


text:
## Tetris in C
Class project from SW Basic design

---
### Summary
Tetris game in C language  <br>

![](./img/lecture2_2.gif.gif)

repository: ameliacode/Tetris

repo_name: ameliacode/Tetris


text:
# Notes

# Questions to ask when interviewing for a new job

  * What is something you are proud of?
  * How long do you expect someone to need to level up in the problem domain?
  * What fun/team building activities occur?
  * How much travel is necessary and how far?
  * What silos exist within code-bases/development?
  * How much heroic effort have you witnessed at Axon? How much was necessary to achieve a mission?
  * What are the biggest opportunities in the company right now?
  * How much time is dedicated to maintaining tech debt?
  * What advancement opportunities are there for someone in this role?
  * How will you know you've made a good hire?
  * What is something different about working here than other places you've expereienced?
  * Have you witnessed company values being mistreated and if so, which?
  * What do you think needs to be added to the company values? What is missing?
  * What would you tell your best friend about working here?
  * Is there anything you were looking for from me that I didn't get a chance to show you?
  * What is something that most people don't ask about working here but might be surprising?
  * Can you talk me through your last production outage?
  * What would I work on if I am chosen?
  * How automated are your deployments?
  * What do you see as your biggest risk in the next 6-12 months that you can share with me?
  * What part of your code base is a skeleton in your closet?
  * What is a big challenge that team members face when working here?
  * What would you consider to be required reading before working here?
  * What does a TI look like?

  TI response process; who is on the calls; how often do they happen
  Infrastructure / platform (AWS, GCP, Azure)
  Automated infrastructure deployment; ephemeral environments
  Version control system
  Alignment of business services to business domains

---

  1. What are the working hours for this position and the team?
  2. Are people in multiple time zones?
  3. Is this expected to be a 40 hr/week position with any oncall responsibility?
  4. Are there any dress code requirements?
  5. How often is travel required or suggested?
  6. Is there any regular budget for:
      - Conferences
      - Education
      - Home office upkeep
      - Phone or internet service
      - Gym or personal health
  7. Are there annual bonuses?
  8. Is the PTO accrual the same for all tenure levels?

---

  1. Will I be able to use a MacOS workstation?
  2. Do you require team members to sign non-compete agreements?

---

I strongly believe in Positive Psychology; success comes more often as a *result* of being happy rather than waiting for success to be happy.

A feeling of purpose and belonging is essential; without these, people will lose interest and passion for the work and the team.

---

# AWS Certifications (priority)

  1. AWS Certified Developer Associate
  2. AWS Certified Solutions Architect Associate
  3. AWS Certified Solutions Architect Professional
  4. AWS Certified DevOps Engineer Professional


text:
# generic-python-project-template
generic-python-project-template

## ASSIGNMENT

* Use time module to oberve the training time
* Check with sigmoid function at output layer by using single unit, loss function binary_crossentropy
* Observe the starting accuracy of the training

## STEPS -

### STEP 01- Create a repository by using template repository

### STEP 02- Clone the new repository

### STEP 03- Create a conda environment after opening the repository in VSCODE

```bash
conda create --prefix ./env python=3.7 -y
```

```bash
conda activate ./env
```
OR
```bash
source activate ./env
```

### STEP 04- install the requirements
```bash
pip install -r requirements.txt
```

### STEP 06- commit and push the changes to the remote repository


text:
# What is this?
This is an interactive map visualizing the number of criminal court summonses by precinct in New York City.

I chose this as a simple project for me to learn some data visualization using D3.js,
modern front-end tools and techniques like React, Redux, webpack, Babel, npm,
and related topics such as data cleaning and exploratory analysis with Python/pandas.

# See it live
https://nabilhassein.github.io/nyc-summons-precinct-visualization/

# Running locally
After `git clone`-ing this repo, from within the directory:
```
npm install
npm run build
npm run start
```

Then the map should be live on localhost:8080. Let me know if these steps don't work on your machine so I can fix the issue.
Also let me know of any suggestions you have to improve the code. I'm new at this frontend stuff.
Tips about styling, whether inline React or CSS, would be especially appreciated!

# Data sources
- https://data.cityofnewyork.us/Public-Safety/Criminal-Court-Summonses/j8nm-zs7q
- https://raw.githubusercontent.com/dwillis/nyc-maps/master/police_precincts.geojson

# A few useful examples
- https://bl.ocks.org/mbostock/4060606
- https://github.com/maptime-ams/animated-borders-d3js
- https://nicolashery.com/integrating-d3js-visualizations-in-a-react-app/

# Possible future work
- add ability to show/hide all tooltips
- figure out how to show svg titles (used for precinct tooltips) on mobile
- improve use of whitespace on mobile
- add more precinct-based datasets!

gha_language: Jupyter Notebook


text:
# Atomic Deployment Package for Laravel Framework
![run-tests](https://github.com/J-T-McC/laravel-atomic-deployments/workflows/run-tests/badge.svg)
[![StyleCI](https://github.styleci.io/repos/330310979/shield?branch=main)](https://github.styleci.io/repos/330310979?branch=main)
[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)

The purpose of this package is to introduce local zero-downtime deployments into a laravel application.

## Requirements

* Laravel 7 | 8
* PHP ^7.4 | ^8.0

## Installation

```shell script

composer require jtmcc/atomic-deployments

php artisan migrate

php artisan vendor:publish --tag=atm-config

```

## Configuration

#### .env

There are three required environment variables:

1.  **ATM_DEPLOYMENT_LINK**: The symbolic link you will use with your web server, artisan schedules, ...etc
1.  **ATM_BUILD**: The project build folder where you will run composer, any build related logic, update your env
1.  **ATM_DEPLOYMENTS**: The root folder that builds will be deployed to and linked

```dotenv
ATM_DEPLOYMENT_LINK="/var/www/production-site"
ATM_BUILD="/var/www/build-project"
ATM_DEPLOYMENTS="/var/www/deployments"
```

#### config( ...)

```php
return [

    /**
     * Symbolic link to the current deployed build
     * This path will be used for schedules and setting your web root.
     */
    'deployment-link' => env('ATM_DEPLOYMENT_LINK'),

    /**
     * The primary build folder
     * This folder is where all deployments ran and ultimately copied to a deployment directory.
     */
    'build-path' => env('ATM_BUILD'),

    /**
     * Production build directory
     * Builds are copied here and linked for deployment
     * Ensure this directory has the required permissions to allow php and your webserver to run your application here.
     */
    'deployments-path' => env('ATM_DEPLOYMENTS'),

    /**
     * Max number of build directories allowed
     * Once limit is hit, old deployments will be removed automatically after a successful build.
     */
    'build-limit' => 10,

    /**
     * Logic used when creating a deployment directory.
     *
     * Default => git - uses hash for current HEAD
     * Options: [ git, datetime, rand ]
     *
     * If your build does not use git, use rand.
     */
    'directory-naming' => 'git',

    /**
     * Deployment class used.
     *
     * Add custom deployments by implementing @see \JTMcC\AtomicDeployments\Interfaces\DeploymentInterface
     * and adding your class to this config property
     */
    'deployment-class' => \JTMcC\AtomicDeployments\Services\Deployment::class,

    /**
     * Migrate files|folders from the outgoing production build to your new release using a relative path and pattern.
     *
     * @see https://www.php.net/manual/en/function.glob.php
     */
    'migrate' => [
        //        'storage/framework/sessions/*',
    ],

];
```

By default, this package will restrict your project to 10 deployment builds. Once you hit the limit defined in the config,
older deployments will be automatically deleted. Be aware of the size of your project and adjust to meet your needs.

You might find yourself in a situation where you need to migrate files that don't exist in your build project from your
current deployment folder to your new deployment folder. These files/folders can be specified in the migrate config array,
and they will be copied from the outgoing deployment into the new deployment when you run the deploy command.

Once you have configured your env and have deployed a build, you can update your webserver to start routing traffic
to your 'deployment-link' location.

```shell script
# nginx example
root /var/www/production-site/public;

#crontab logic example
php /var/www/production-site/artisan schedule:run
```

## Commands

### atomic-deployments:deploy

#### *options*

- --hash= : Specify a previous deployments commit hash/deploy-dir to deploy
- --directory= : Define your deploy folder name. Defaults to current HEAD hash
- --dry-run : Test and log deployment steps

#### *examples*

Do a dry run to get some feedback on the steps that will be taken
```shell script
php artisan atomic-deployments:deploy --dry-run
```

Deploy current build using the current branch git hash for deployment folder
```shell script
php artisan atomic-deployments:deploy
```

Deploy current build using a custom directory name
```shell script
php artisan atomic-deployments:deploy --directory=deployment_folder
```

Revert linked project back to a previous build
```shell script
php artisan atomic-deployments:deploy ---hash=abc1234
```

### atomic-deployments:list

Prints a table to the console of the currently available builds

#### *examples*

```shell script
php artisan atomic-deployments:list
```

## Events

- DeploymentSuccessful
- DeploymentFailed

## Laravel Forge Example

Here is a basic configuration for use with Forge

#### *Deploy Script*

```shell script
cd /home/forge/your-application.com
git pull origin main
$FORGE_COMPOSER install --no-interaction --prefer-dist --optimize-autoloader --no-dev --no-progress

( flock -w 10 9 || exit 1
    echo 'Restarting FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9>/tmp/fpmlock

if [ -f artisan ]; then
    $FORGE_PHP artisan migrate --force
    $FORGE_PHP artisan optimize:clear
    $FORGE_PHP artisan atomic-deployments:deploy
fi
```

#### *.env*

Build project .env

```dotenv
ATM_DEPLOYMENT_LINK="/home/forge/your-application.com-link"
ATM_BUILD="/home/forge/your-application.com"
ATM_DEPLOYMENTS="/home/forge/deployments/your-application.com"
```

#### *nginx config*

```shell script
root /home/forge/your-application.com-link/public;
```

#### *schedule command*

```shell script
php8.0 /home/forge/your-application.com-link/artisan schedule:run
```

If your application is isolated, you must ensure that your deployments folder has the appropriate permissions to serve
your application for that user.

## License

MIT

repository: maxdgt/laravel-atomic-deployments

repo_name: maxdgt/laravel-atomic-deployments


text:
---
layout: default
---

# 1993-02-11 - Re:  Wired photo shoot at cypherpunks on Saturday

## Header Data

From: Kevin Kelly<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 6c9843aa02adb1011a26027e0b05322d7e408f6889ffbc0a856e9fc234d77dd5

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1993-02-11 03:02:55 UTC

Raw Date: Wed, 10 Feb 93 19:02:55 PST

## Raw message

```
{% raw  %}From: Kevin Kelly<EMAIL_ADDRESS>Date: Wed, 10 Feb 93 19:02:55 PST
To<EMAIL_ADDRESS>Subject: Re:  Wired photo shoot at cypherpunks on Saturday
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Thanks.

{% endraw %}
```

## Thread

+ Return to [February 1993](/archive/1993/02)

+ Return to "[Kevin Kelly <kk@well.sf.ca.us>](/authors/kevin_kelly_kk_at_well_sf_ca_us_)"

+ 1993-02-11 (Wed, 10 Feb 93 19:02:55 PST) - Re:  Wired photo shoot at cypherpunks on Saturday - _Kevin Kelly<EMAIL_ADDRESS>


text:
# Guidance Navigation and Control

The following tutorial will show you how to make a simple program that allows you to send your drone to waypoints. This tutorial uses my API, which has a bunch of high level functions that handle the various flight operations including, takeoff, land, waypoint nav and all the reference frames associated with the navigation. The documentation for these GNC functions are available **[here](GNC_functions_documentation.md)**

### Video Tutorial Part 1 at https://youtu.be/eRAfeC8OFfs

## Make sure you have a text editor
As this is the first tutorial that we will be coding please make sure you have a text editor. My prefered text editor is sublime. You can download it by running the below commands
```
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text
```

## Clone the IQ GNC ROS package

First, we will clone the IQ GNC ROS package. This ROS package comes with my GNC API that will make scripting the drone easy. It will also come with a worked out solution to this tutorial
```
git clone https://github.com/Intelligent-Quads/iq_gnc.git
```

this package contains the file `gnc_functions.hpp`.

## Write a small program to navigate your drone

Once you have cloned the `iq_gnc` package. Create a new file called `square.cpp` in `Mission8_OutOfControls/src`. Then open the file `CMakeLists.txt` and add the following to the bottom.
```
add_executable(square src/square.cpp)
target_link_libraries(square ${catkin_LIBRARIES})
```

First we will include our control functions
```
#include <gnc_functions.hpp>
```
This will allow us to use all of our control functions and structures

Next add the main function and initialize ros
```
int main(int argc, char** argv)
{
	//initialize ros
	ros::init(argc, argv, "gnc_node");
	ros::NodeHandle gnc_node;

	//Rest of code here

}
```

We will then add the function `init_publisher_subscriber()`. This function takes our ros node handle as an input and initializes subcribers that will collect the necessary information from our autopilot. Add the following

```
//initialize control publisher/subscribers
init_publisher_subscriber(gnc_node);
```

we will then add the following functions to handle preflight operations
```
	// wait for FCU connection
	wait4connect();

	//wait for used to switch to mode GUIDED
	wait4start();

	//create local reference frame
	initialize_local_frame();
```
The function `wait4connect()` will loop until the node can communicate with the flight control unit (FCU). Once the connection with the FCU is established then we will use the function `wait4start()` to hold the program until the pilot executes the program by switching the FCU flight mode to GUIDED. This can be done from a ground control stattion (GCS) such as Mission Planner or QGroundControl or from a switch on a radio controller. Finally, once the command to execute the mission is sent, you will use the function `initialize_local_frame()` to create your navigation frame. This function creates the local reference frame based on the starting location of the drone.

Next we will request takeoff. Using the function `takeoff(float takeOffHieght)`. Add
```
	//request takeoff
	takeoff(3);
```

The GNC API contains the structure `gnc_api_waypoint` this structure contains the variables `x y z psi` which you can use to set locations and orientations of your drone.

To make your drone fly in a square specify the following waypoints
```
	//specify some waypoints
	std::vector<gnc_api_waypoint> waypointList;
	gnc_api_waypoint nextWayPoint;
	nextWayPoint.x = 0;
	nextWayPoint.y = 0;
	nextWayPoint.z = 3;
	nextWayPoint.psi = 0;
	waypointList.push_back(nextWayPoint);
	nextWayPoint.x = 5;
	nextWayPoint.y = 0;
	nextWayPoint.z = 3;
	nextWayPoint.psi = -90;
	waypointList.push_back(nextWayPoint);
	nextWayPoint.x = 5;
	nextWayPoint.y = 5;
	nextWayPoint.z = 3;
	nextWayPoint.psi = 0;
	waypointList.push_back(nextWayPoint);
	nextWayPoint.x = 0;
	nextWayPoint.y = 5;
	nextWayPoint.z = 3;
	nextWayPoint.psi = 90;
	waypointList.push_back(nextWayPoint);
	nextWayPoint.x = 0;
	nextWayPoint.y = 0;
	nextWayPoint.z = 3;
	nextWayPoint.psi = 180;
	waypointList.push_back(nextWayPoint);
```

Finally we will add our control loop
```
	//specify control loop rate. We recommend a low frequency to not over load the FCU with messages. Too many messages will cause the drone to be sluggish
	ros::Rate rate(2.0);
	int counter = 0;
	while(ros::ok())
	{
		ros::spinOnce();
		rate.sleep();
		if(check_waypoint_reached() == 1)
		{
			if (counter < waypointList.size())
			{
				set_destination(waypointList[counter].x,waypointList[counter].y,waypointList[counter].z, waypointList[counter].psi);
				counter++;
			}else{
				//land after all waypoints are reached
				land();
			}
		}

	}
	return 0;
}
```
This loop will continually send the requested destination to the FCU via the `set_destination(x, y, z, psi)` function. The loop uses the function `check_waypoint_reached()` to determained when the drone has arrived at the requested destination. The function return 1 or 0. 1 denotes the drone has arrived. Each time the waypoint is reached the vector of waypoints is iterated to request the next waypoint via the variable `counter`. Finally, the drone will land via the land function `land()`

Your program should like like the following
src/controlAPIExample.cpp

```
#include <gnc_functions.hpp>
//include API

int main(int argc, char** argv)
{
	//initialize ros
	ros::init(argc, argv, "gnc_node");
	ros::NodeHandle gnc_node;

	//initialize control publisher/subscribers
	init_publisher_subscriber(gnc_node);

  	// wait for FCU connection
	wait4connect();

	//wait for used to switch to mode GUIDED
	wait4start();

	//create local reference frame
	initialize_local_frame();

	//request takeoff
	takeoff(3);

	//specify some waypoints
	std::vector<gnc_api_waypoint> waypointList;
	gnc_api_waypoint nextWayPoint;
	nextWayPoint.x = 0;
	nextWayPoint.y = 0;
	nextWayPoint.z = 3;
	nextWayPoint.psi = 0;
	waypointList.push_back(nextWayPoint);
	nextWayPoint.x = 5;
	nextWayPoint.y = 0;
	nextWayPoint.z = 3;
	nextWayPoint.psi = -90;
	waypointList.push_back(nextWayPoint);
	nextWayPoint.x = 5;
	nextWayPoint.y = 5;
	nextWayPoint.z = 3;
	nextWayPoint.psi = 0;
	waypointList.push_back(nextWayPoint);
	nextWayPoint.x = 0;
	nextWayPoint.y = 5;
	nextWayPoint.z = 3;
	nextWayPoint.psi = 90;
	waypointList.push_back(nextWayPoint);
	nextWayPoint.x = 0;
	nextWayPoint.y = 0;
	nextWayPoint.z = 3;
	nextWayPoint.psi = 180;
	waypointList.push_back(nextWayPoint);
	nextWayPoint.x = 0;
	nextWayPoint.y = 0;
	nextWayPoint.z = 3;
	nextWayPoint.psi = 0;
	waypointList.push_back(nextWayPoint);

	//specify control loop rate. We recommend a low frequency to not over load the FCU with messages. Too many messages will cause the drone to be sluggish
	ros::Rate rate(2.0);
	int counter = 0;
	while(ros::ok())
	{
		ros::spinOnce();
		rate.sleep();
		if(check_waypoint_reached(.3) == 1)
		{
			if (counter < waypointList.size())
			{
				set_destination(waypointList[counter].x,waypointList[counter].y,waypointList[counter].z, waypointList[counter].psi);
				counter++;
			}else{
				//land after all waypoints are reached
				land();
			}
		}

	}
	return 0;
}

```
## Build code
```
cd ~/catkin_ws
catkin build
source ~/.bashrc
```

## Run example code

```
roslaunch iq_sim runway.launch
# New Terminal
./startsitl.sh
# New Terminal
roslaunch iq_sim apm.launch
# New Terminal
rosrun iq_gnc square
```
NOTE** you can tile gnome terminals by pressing `ctrl + shift + t`

Finally run the mission by changing the flight mode to guided in the MAVproxy terminal by running
```
mode guided
```

You should now have a basic understanding of the functions available for controling your drone. You should be able to use these functions to help you make more complex navigation code.


text:
# LAGU

## Getting Started

Clone the project

```bash
git clone git@github.com:padunk/sirclo-lagu.git
cd sirclo-lagu
```

Install dependencies with yarn or npm

```bash
yarn
```

Run the dev server at `localhost:3000`

```bash
yarn dev
```

**Open new terminal** to run test with Testing Library and Jest

```bash
yarn test
```

## LICENSE

MIT

repository: padunk/sirclo-lagu

repo_name: padunk/sirclo-lagu


text:
---
layout: post
title: Partitioning the collection using LINQ - different approaches, different performance, the same result
excerpt_separator: <!--more-->
---

Another blog post inspired by a [StackOverflow question](http://stackoverflow.com/q/20556678/1163867). This time it’s all about LINQ, performance and a tiny little detail, that really matters. The question itself is about `yield` keyword in VB.NET, but there is another, much more interesting part I’d like to examine. The algorithm quoted in the question is the key.

<!--more-->

The idea is simple. **How to partition a collection into parts with given number of elements in ever part?** Algorithm presented in the question is as easy as the questions seems to be:

```csharp
public IEnumerable<IEnumerable<T>> Partition<T>(IEnumerable<T> source, int size)
{
    if (source == null)
        throw new ArgumentNullException("list");

    if (size < 1)
        throw new ArgumentOutOfRangeException("size");

    int index = 1;
    IEnumerable<T> partition = source.Take(size).AsEnumerable();

    while (partition.Any())
    {
        yield return partition;
        partition = source.Skip(index++ * size).Take(size).AsEnumerable();
    }
}
```

Question is, is the algorithm good and efficient? It returns correct results, that’s for sure. But that’s not the only important part of every algorithm. Unfortunately, I must say that **the algorithm is no good**. To answer why it’s no a good algorithm? I’d like to show you another approach on solving the same problem:

```csharp
public IEnumerable<IEnumerable<T>> Partition<T>(IEnumerable<T> source, int size)
{
    var partition = new List<T>(size);
    var counter = 0;

    using (var enumerator = source.GetEnumerator())
    {
        while (enumerator.MoveNext())
        {
            partition.Add(enumerator.Current);
            counter++;
            if (counter % size == 0)
            {
                yield return partition.ToList();
                partition.Clear();
                counter = 0;
            }
        }

        if (counter != 0)
            yield return partition;
    }
}
```

Is has exactly the same signature and returns exactly the same results. **Why is it better then?** There are couple possible answers:

- because it does no use `Skip`/`Take` methods
- because it has *O(n)* complexity, when the other one is *O(n*log(n))*
- because it iterate over entire collection only once, and the other one does it multiple times

If you look closer, all these actually means the same: **the second method is much faster!** How much? A lot :) Look at the charts. They show execution time depending on number of partitions that need to be created. Source collections have 1000000 elements and they are created using following code:

```csharp
var enumSource = Enumerable.Range(0, size);
var arraySource = enumSource.ToArray();
var listSource = arraySource.ToList();
```

You may wonder why I tried the same algorithm on three different collections. That’s because of how `Skip`/`Take` solution works: it iterates from that beginning of collection every time new partition is requested. It may not be important if your source is static collection (like `Array` or `List`), but it will cause `Enumerable.Range` to generate the collection every time again and again. That’s really not necessary, is it?

Y-axis shows execution time and X-axis shows number of partitions that are being generated. **The difference is huge**, isn’t it? It takes about 6 second to generate 1000 partitions using Skip/Take algorithm and about 40ms to do that with the other one!

I’m writing this post to highlight that if LINQ seems to be really great solution for nearly every collection-related problem and you can get working solution really easily using it, it’s not always really a good and fast solution.

gha_language: SCSS


text:
---
layout: page
permalink: /project_code/
title: Project Code Download
tagline:
tags:
modified: 01-23-2015
comments: true
---

Click [here](/files/project-01-12-2015.tar) to download the newest source code.

Or, you can access the code via [github](https://github.com/WebCoursify/src-code-for-full-stack-web-platform) now!

You'll need to start from this demo project and follow the instructions on course content. By doing so you'll eventually finish this platform. Good luck!

**Update logs**:

01-25-2015: Publish the code to github

01-12-2015: Small updates of template

01-10-2015: Minor update of test code

01-06-2015: Finish the test cases of 5-Topic-User. Among with some other small changes.

12-29-2014: Finish the test cases of *View*. Also change the website theme.


text:
---
slug: '/setting-up-local-ip-address'
title: 'Setting Up a Local IP Address'
---

## Objectives and Overview

This lesson briefly outlines the differences between _dynamic_ and _static_ local IP addresses. Additionally, you'll work through an activity to set a static IP address for your Raspberry Pi.

### Lesson Objectives

- Understand and explain the differences between a dynamic and static local IP address.
- Demonstrate the ability to set a static IP address for a Raspberry Pi.

---

## Static vs. Dynamic Local IP Addresses

When you connect your Pi to the local network - such as the WiFi in your learning environment - your local IP address may be different each time. This is because the IP address is _dynamic_, which means that it changes. In order to have some consistency, you’re going to need to configure it to be static, which means unchanging. This will save you from needing to use `ifconfig` to determine your Pi’s local IP each time you connect to the network. The process is straightforward, so let’s jump in.

## Activity: Setting Up a Static IP Address

You’re going to use the nano editor to make some configuration changes. Using the `nano` command opens a file and allows you to quickly edit it. You’ll be working with an existing file, so this allows you to open the file and make some quick changes.

### Steps:

1.  Open the command prompt on your Pi
2.  Use the following command: `sudo nano /etc/dhcpcd.conf`
    - You need admin access to edit this file, so you have to prefix your command with `sudo`
3.  This opens the _dhcpcd.conf_ file in nano and allows you to edit it
    - The _dhcpcd.conf_ file is the configuration file for the DHCP client — this configuration handles a lot of the resolution of IP address related tasks

The next several steps come from the archived [Raspberry Pi Foundation Networking Lesson: Setting Up a Static Local IP](https://github.com/raspberrypilearning/networking-lessons/blob/master/rpi-static-ip-address.md)

4. Navigate to the end of the _dhcpcd.conf_ file and add the following code:

```
interface eth0

static ip_address=<IP_ADDRESS>/24
static routers=<IP_ADDRESS>
static domain_name_servers=<IP_ADDRESS>

interface wlan0

static ip_address=<IP_ADDRESS>/24
static routers=<IP_ADDRESS>
static domain_name_servers=<IP_ADDRESS>
```

5. Save the file by typing `ctrl + o` and exit nano with `ctrl + x`

Your Pi will now boot to <IP_ADDRESS>.

### Notes About this Activity

The previous activity referenced the Raspberry Pi article. This tutorial contained great explanations and steps for configuring your static local IP address, but it's been archived.

## Wrapping Up

Before moving on to the next lesson, let's make sure to test that your Pi works and that the IP address remains static:

1. Reboot your Pi by typing `sudo reboot` into the terminal
   - This reboots your Pi. Only do this **AFTER** you’ve saved the changes to the _dhcpcd.conf_ file!
2. Open terminal again and enter the command: `ip a`

You should now see the IP address you set in the `eth0:` or `wlan0` entry.


text:
---
title: Weather Observation Station 16
author: HyunMin Kim
date: 2020-05-31 20:00:00 0000
categories: [Hacker Ranker, SQL]
tags: [MySQL, Round, Where, Min]
---

# Weather Observation Station 16

- URL : <https://www.hackerrank.com/challenges/weather-observation-station-16/problem>{:target="_blank"}
- Query the smallest Northern Latitude (LAT_N) from STATION that is greater than 38.7780. Round your answer to 4 decimal places.
- MySQL Solution

```sql
select round(min(lat_n),4)
from station
where lat_n > 38.7780
```


text:
---
layout: post
author: Justin Ball
title: "Heroku Database Tips"
date: 2013-12-13 18:44:50 -0700
tags:
  - Heroku
  - PostGreSQL
---

Even on Heroku where most of the problems of sys ops is taken care of for you, you will occasionally run into
strange database issues that are hard to explain. For me it the database issues showed up as some ugly entries
when I tried to run a rake db:migrate on a deployed database:

2013-12-13T16:57:28.079781+00:00 app[web.1]: PG::IndexCorrupted: ERROR:  index "pg_constraint_conname_nsp_index" contains unexpected zero page at block 0
2013-12-13T16:57:28.079781+00:00 app[web.1]: HINT:  Please REINDEX it.
2013-12-13T16:57:28.079781+00:00 app[web.1]:             FROM pg_attribute attr
2013-12-13T16:57:28.079781+00:00 app[web.1]:             WHERE cons.contype = 'p'
2013-12-13T16:57:28.079781+00:00 app[web.1]:               AND cons.conrelid = '"users"'::regclass
2013-12-13T16:57:28.079781+00:00 app[web.1]:
2013-12-13T16:57:28.079781+00:00 app[web.1]: :             SELECT attr.attname
2013-12-13T16:57:28.079781+00:00 app[web.1]:             INNER JOIN pg_constraint cons ON attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1]
2013-12-13T16:57:28.079781+00:00 app[web.1]: PG::IndexCorrupted: ERROR:  index "pg_constraint_conname_nsp_index" contains unexpected zero page at block 0
2013-12-13T16:57:28.079965+00:00 app[web.1]:             WHERE cons.contype = 'p'
2013-12-13T16:57:28.079781+00:00 app[web.1]: HINT:  Please REINDEX it.
2013-12-13T16:57:28.079965+00:00 app[web.1]:               AND cons.conrelid = '"users"'::regclass
2013-12-13T16:57:28.079965+00:00 app[web.1]: Completed 500 Internal Server Error in 10ms
2013-12-13T16:57:28.079965+00:00 app[web.1]: :             SELECT attr.attname
2013-12-13T16:57:28.079965+00:00 app[web.1]:             FROM pg_attribute attr
2013-12-13T16:57:28.079965+00:00 app[web.1]:             INNER JOIN pg_constraint cons ON attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1]

I was left a bit confused but I got the point that I needed to reindex my database but the question was how? turns out on heroku you can get into
your database with this command:

heroku pg:psql

That was easy. Now to clean up my indexes:

REINDEX DATABASE __Your_DB_Name__

While you're in there you can also clean up:

VACUUM;

You'll need to get your database name from your heroku dashboard. This url will get you there
https://postgres.heroku.com/databases. You'll need to know
what the specific database is and click through to get the name. It's ugly and will look something like 'dusyahwettad'

That should be it, but in case you want to dig around a bit more and see what's going on in your database you can install the pg-extras from:

https://github.com/heroku/heroku-pg-extras

Once those are installed you can do things like..

See the your db bloat:
heroku pg:bloat DATABASE_URL

Check out your vacuum stats:
heroku pg:vacuum_stats DATABASE_URL

And so much more. Check here for more details:
https://devcenter.heroku.com/articles/heroku-postgres-database-tuning


text:
# Repartition

Use **coalesce** if:
- You're writing fewer files than your sPartition count
- You can bear to perform a cache and count operation before your coalesce
- You're writing exactly 1 hPartition

Use **simple repartition** if:
- You're writing exactly 1 hPartition
- You can't use coalesce

Use a **simple repartition by columns** if:
- You're writing multiple hPartitions, but each hPartition needs exactly 1 file
- Your hPartitions are roughly equally sized

Use a **repartition by columns with a random factor** if:
- Your hPartitions are roughly equally sized
- You feel comfortable maintaining a files-per-hPartition variable for this dataset
- You can estimate the number of output hPartitions at runtime or, you can guarantee your default parallelism will always be much larger (~3x) your output file count for any dataset you're writing. Use a repartition by range (with the hash/rand columns) in every other case.

## Reference
- [An In-Depth Look at Spark Partitioning Strategies](https://medium.com/airbnb-engineering/on-spark-hive-and-small-files-an-in-depth-look-at-spark-partitioning-strategies-a9a364f908)

repository: yaravind/learn-spark

gha_language: Scala

repo_name: yaravind/learn-spark


text:
---
templateKey: page
title: History
heading: History
blurb: History of the Miniature American Shepherd
headerImage: >-
  https://res.cloudinary.com/davg7hyp7/image/upload/v1567679092/IMG_0846_jsjkhr.jpg
smallHeader: true
parent: /breed
order: 6
appPath: /history
---

The Miniature American Shepherd is the AKC breed name for the Miniature Australian Shepherds entering AKC. For many years, it has been an AKC policy to no longer accept size varieties of an already established AKC breed. Because the Australian Shepherd is already established within AKC, and because their AKC parent breed club (USASA-United States Australian Shepherd Association) did not wish to recognise the Miniature Australian Shepherd as a legitimate size variety, the Mini Aussie continued to meet roadblocks with regard to AKC recognition.

However, through negotiations between USASA, AKC, and NAMASCUSA (North American Miniature Australian Shepherd Club of the USA--a parent breed club for Miniature Australian Shepherd), an agreement was reached that allowed the Miniature Australian Shepherd to enter AKC under the breed name Miniature American Shepherd, with NAMASCUSA as the parent breed club in AKC (now called MASCUSA--Miniature American Shepherd Club of the USA).

AKC recognition became a reality, with the first Miniature American Shepherds registered into the AKC FSS program in June 2011. These are the same dogs, with the same pedigrees, that were registered as Miniature Australian Shepherds through various other registries previously (NSDR, ASDR, MASCA, NAMASCUSA, IMASC). AKC allowed AKC registered Australian Shepherds to transfer over for a period of three years, if they felt they were better served as a Miniature American Shepherds.

## As of 1st July 2015 The Miniature American Shepherd Breed has moved into the AKC Breed Register under the Herding Group.

repository: ymhr/mascgb-netlify

repo_name: ymhr/mascgb-netlify


text:
# twitter_scraper_selenium

Scrape twitter user info, friendshio and tweets by using selenium. Twitter api is not used.

This project is ment as a exercise to learn a little about selenium scraping.

Not finished, but you can get it to work

**SETUP:**
- Need cromdriver.exe and place it wherever it should for your OS. In windows:  "C:\Python27\Scripts" Folder.
- Create db tables. sbot.twitter.screaper.db.sql_create.txt should work. Not fully tested
- Set get_twitter_scraper_database_string in config.py
- Use methods in sbot.twitter.screaper.controller.scrape.py to scrape information

**WARNING:**
- robot.txt is not followed, this project was only ment as a small scale test
- Exessive use of this project might get you ip banned from twitter for a period bacause it dos not follow robot.txt
	- This might be avoided by adding a few lines to make selenium use diferetn proxies, but exessive scraping of twitter is not the meaning of this project.


text:
# ARRA Grant Revenues As Of COB July 31, 2012

## Dataset

| Name | Value |
| :--- | :---- |
| Catalog | [Link](https://catalog.data.gov/dataset/arra-grant-revenues-as-of-cob-july-31-2012-9a4c3) |
| Metadata | [Link](https://data.mo.gov/api/views/nnrk-hs73) |
| Data: JSON | [100 Rows](https://data.mo.gov/api/views/nnrk-hs73/rows.json?max_rows=100) |
| Data: CSV | [100 Rows](https://data.mo.gov/api/views/nnrk-hs73/rows.csv?max_rows=100) |
| Host | data.mo.gov |
| Id | nnrk-hs73 |
| Name | ARRA Grant Revenues As Of COB July 31, 2012 |
| Attribution | Office of Administration |
| Category | Government Administration |
| Created | 2012-08-07T17:34:30Z |
| Publication Date | 2012-08-07T17:35:12Z |

## Description

Data that shows every dollar received by the State of Missouri to date under the American Reinvestment and Recovery Act of 2009 including the receiving state agency and the federal funding source or program.

## Columns

```ls
| Included | Schema Type    | Field Name      | Name            | Data Type | Render Type |
| ======== | ============== | =============== | =============== | ========= | =========== |
| Yes      | series tag     | agency_name     | Agency Name     | text      | text        |
| Yes      | series tag     | program_name    | Program Name    | text      | text        |
| Yes      | numeric metric | amount_received | Amount Received | money     | money       |
```

## Time Field

```ls
Value = 2012
Format & Zone = yyyy
```

## Data Commands

```ls
series e:nnrk-hs73 d:2012-01-01T00:00:00.000Z t:program_name="AQUACULTURE ASSISTANCE PROGRAM" t:agency_name=AGRICULTURE m:amount_received=111849.21

series e:nnrk-hs73 d:2012-01-01T00:00:00.000Z t:program_name="ENERGY EFFIC/RENEW ENERGY - CONS BLO" t:agency_name=AGRICULTURE m:amount_received=3067501.91

series e:nnrk-hs73 d:2012-01-01T00:00:00.000Z t:program_name="FISH AND WILDLIFE SERVICE" t:agency_name=CONSERVATION m:amount_received=144900
```

## Meta Commands

```ls
metric m:amount_received p:double l:"Amount Received" t:dataTypeName=money

entity e:nnrk-hs73 l:"ARRA Grant Revenues As Of COB July 31, 2012" t:attribution="Office of Administration" t:url=https://data.mo.gov/api/views/nnrk-hs73

property e:nnrk-hs73 t:meta.view v:id=nnrk-hs73 v:category="Government Administration" v:averageRating=0 v:name="ARRA Grant Revenues As Of COB July 31, 2012" v:attribution="Office of Administration"

property e:nnrk-hs73 t:meta.view.owner v:id=wzcj-jrcg v:screenName=John v:displayName=John

property e:nnrk-hs73 t:meta.view.tableauthor v:id=wzcj-jrcg v:screenName=John v:roleName=editor v:displayName=John
```

## Top Records

```ls
| agency_name          | program_name                         | amount_received |
| ==================== | ==================================== | =============== |
| AGRICULTURE          | AQUACULTURE ASSISTANCE PROGRAM       | 111849.21       |
| AGRICULTURE          | ENERGY EFFIC/RENEW ENERGY - CONS BLO | 3067501.91      |
| CONSERVATION         | FISH AND WILDLIFE SERVICE            | 144900          |
| CONSERVATION         | WILDLAND FIRE MANAGEMENT             | 6000000         |
| ECONOMIC DEVELOPMENT | AMERICORPS                           | 823449.04       |
| ECONOMIC DEVELOPMENT | COMMUNITY DEVELOPMENT BLOCK GRANT    | 5724189.08      |
| ECONOMIC DEVELOPMENT | EMPLOYMENT SRVS WAGNER-PEYSER        | 7400054.17      |
| ECONOMIC DEVELOPMENT | NATIONAL EMERG WIA GRANT             | 3063550.73      |
| ECONOMIC DEVELOPMENT | NATIONAL ENDOWMENT OF THE ARTS       | 320200          |
| ECONOMIC DEVELOPMENT | TANF SUMMER YOUTH                    | 14675070.85     |
```

repository: SpellarBot/open-data-catalog

repo_name: SpellarBot/open-data-catalog


text:
---
layout: "post.11ty.js"
title: "Around the Web - 20170526"
date: "2017-05-26"
tags:
  - "Around the Web"
  - "Blog"
  - "Microsoft"
  - "npm"
  - "npm scripts"
  - "Salesforce"
slug: "around-the-web-20170526"
---

And now for somethings to read over the weekend, if you have some spare time that is.

## [The largest Git repo on the planet](https://blogs.msdn.microsoft.com/bharry/2017/05/24/the-largest-git-repo-on-the-planet/)

At Microsoft they modified Git so they could put the source for Windows in a single repo. This cause some interesting problems and here Brian talks about them and how they were addressed.

## [Back from Salesforce World Tour London – I’m feeling pumped!](https://blog.winkelmeyer.com/2017/05/back-from-salesforce-world-tour-london-im-feeling-pumped/)

René Winkelmeyer wrote up a nice little review of the Salesforce World Tour stop in London from the perspective of a Salesforce Employee. <spoiler> he likes the community </spoiler>

## [8 npm Tricks You Can Use to Impress Your Colleagues](https://medium.freecodecamp.com/8-npm-tricks-you-can-use-to-impress-your-colleagues-dbdae1ef5f9e)

Nothing says "Show Off" like using the command line in a point and click world. Learn a few of these and you will be the talk of the water cooler.

## [Kill Google AMP before it KILLS the web](https://www.theregister.co.uk/2017/05/19/open_source_insider_google_amp_bad_bad_bad/)

This might be an opinion piece. That doesn't mean it's wrong.

## [3 Other Front-End Frameworks](https://dev.to/kayis/3-other-front-end-frameworks)

A brief write up on Ember.js, Cycle.js and Skate.js In case you are looking for something other than React, or Angular and want additional opinions on the topic.

## [The Legend of Zelda: Breath of the Wild](https://www.amazon.com/gp/product/B01MS6MO77/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&tag=wipdevelope05-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B01MS6MO77&linkId=2e3ba487cae55c606f6ef0fbfa407cec)

Have you tried The Legend of Zelda: Breath of the Wild yet? I have been enjoying it on the [Nintendo Switch](https://www.amazon.com/gp/product/B01LTHP2ZK/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&tag=wipdevelope05-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B01LTHP2ZK&linkId=b45d99266481adb24e70bb2350064e61).

## Till Next Week

Want to share something? Let me know by leaving a comment below or emailing [brett@wipdeveloper.com](mailto:brett@wipdeveloper.com).

repository: BrettMN/wipdeveloper-wordpress-archive

repo_name: BrettMN/wipdeveloper-wordpress-archive


text:
DynamicHosts
============

Automatic hosts file for OS X
-----------------------------

Setting up new entries in /etc/hosts is a pain.  Apache has mod_vhost_alias, but without some type of wildcard or dynamic DNS support, you still have to setup entries in hosts.

I want my hosts file to automagicly get updated when I create a new directory.

	/var/htdocs/develop.dev/someproject --> http://someproject.develop.dev

With a little help from Apple's [launched](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/launchd.8.html) this script can automate your /etc/hosts file.

See the blog post at [stormes.net](http://www.stormes.net/automatic-etchosts-apples-os/).

#### Quick Start

Step 0:
Backup your original hosts file.

    sudo cp -p /etc/hosts /etc/hosts.org

Step 1:
Copy the dynamic_hosts.php file into /bin.

Step 2:
Set /bin/dynamic_hosts.php to be executable

    sudo chmod a+x /bin/dynamic_hosts.php

Step 3:
Edit the file DynamicHosts.plist and change the two string entries that have "/usr/local/zend/apache2/htdocs/" to the path of your webroot.  You must include the trailing "/".

Step 4:
Copy DynamicHosts.plist to /System/Library/LaunchAgents/

    sudo cp DynamicHosts.plist /System/Library/LaunchAgents/

Step 5:
Start the monitoring.

	sudo launchctl load /System/Library/LaunchAgents/DynamicHosts.plist

Test:
In your webroot create a new directory.  Inside that directory create a directory.

If you cat out your /etc/hosts your new direcotry/sub-directory should appear at the bottom of your hosts file as <IP_ADDRESS> sub-direcotry.directory

Step 6:
Using [mod_vhost_alias](http://httpd.apache.org/docs/2.2/mod/mod_vhost_alias.html) in Apache, it is now possible to create a development website just by createing directories.

license: Unlicense

repository: jstormes/DynamicHosts

repo_name: jstormes/DynamicHosts


text:
<img src="https://github.com/MosesOpiyo/Newslist/blob/master/app/static/Screenshot%20from%202021-09-14%2008-09-30.png?raw=true">

## Newslist

This is a web application that displays news articles from multiple sources to a user. It consumes the NEWS API to get all the requests.

## App Description

The application consumes the NEWS_API to get news from a variety of news sources and according to queries that are passed in via the views.py file, filters the data and brings back only the specified data. This application shows different categories of news on the home page.

## Link to Hosted site

Click the link below to have a look at the site.

"https://habari-kimtandao.herokuapp.com/

## Technologies Used
1. Flask
2. HTML
3. CSS
4. Bootstrap
5. Python
6. Javascipt

## Dependencies
For full functionality of the application install the following:

1. certifi==2021.5.30
2. charset-normalizer==2.0.4
3. click==8.0.1
4. dominate==2.6.0
5. Flask==2.0.1
6. Flask-Bootstrap==<IP_ADDRESS>
7. Flask-Script==2.0.6
8. gunicorn==20.1.0
9. idna==3.2
10. itsdangerous==2.0.1
11. Jinja2==3.0.1
12. MarkupSafe==2.0.1
13. requests==2.26.0
14. urllib3==1.26.6
15. visitor==0.1.3
16. Werkzeug==2.0.1

## Future Improvements

In the future I would like to implements a search functionality where a user can search for any news article of their liking.

## licence

MIT License

Copyright (c) [2021] [Moses Opiyo]

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

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

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

repository: MosesOpiyo/Newslist

repo_name: MosesOpiyo/Newslist


text:
Built with React, webpack, style-loader, css-loader.

* Services model
* Components with separate stylesheets
*

Server built with express.

* DAO model for database calls
* hosts limited segment of public directory from client

To run API and host site:

```
cd server;
npm install --only=prod
npm start
```

To build site's bundle.js:

```
cd client;
npm install --only=prod
npm run build
```

To run tests:
```
cd client;
npm install
npm test;
cd ..
cd server;
npm install
npm test;
```

Test coverage:

Server: http://odderikf.pages.stud.idi.ntnu.no/HelloWorldNews/server/
Client: http://odderikf.pages.stud.idi.ntnu.no/HelloWorldNews/client/

repository: odderikf/sysdevweb

repo_name: odderikf/sysdevweb


text:
##ArangoDB Usage

ArangoDB, a multi-model database, stores all master data. this will
allow fast hierachy lookups and storage.
There are three folders in this directory and they are all mounted to the
ArangoDB container:
- apps_db_system: Contains any ArangoDB Foxx framework micro services.
- arangodbinit: Contains the DB schemas and data to be used to seed the app. Scripts to create initialization are written in Javascript.
- db: Persists container data to the host. All data in the container is deleted if this folder is deleted.

*Note* that the scripts in the arangodbinit folder are only run if the DB is initializing for the first time.
Therefore, to reinitialize the data in the container, the `db` folder and all its contents must be dropped so that they can be recreated automatically.
Dropping the db folder will **delete all data** existing in the database instance.

Currently, the system uses multiple databases in the same ArangoDB instance, but that can be changed by configuring the environment variables associated with each service.

 At this point the system uses the following files to seed data:

 - customer_schema: Setups the database, tables and data for the customer service
 - product_schema: Setups the database, tables and data for the product service

repository: djun/gotempm

repo_name: djun/gotempm


text:
---
title: Episode 49 - Bedtime Stories
subtitle: S03E05 - Bedtime Stories
date: 2020-10-28
season: Season 3
tags: ['episode','season3']
---

Sam has to explain German folklore to Dean. A little girl has to explain to Daddy that Mommy was bad and Penny has to explain to Dan a couple of plot points he missed.

Download: [http://cast.rocks/hosting/27557/Episode-49-Bedtime-Stories.mp3](http://cast.rocks/hosting/27557/Episode-49-Bedtime-Stories.mp3)

<iframe src="https://cast.rocks/player/27557/Episode-49-Bedtime-Stories.mp3?episodeTitle=Episode%2049%20-%20Bedtime%20Stories&podcastTitle=Couple%20of%20Idjits&episodeDate=October%2028th%2C%202020&imageURL=https%3A%2F%2Fcast.rocks%2Fhosting%2F27557%2Ffeeds%2FCAURZ.jpg" style="border: none; min-height: 265px; max-height: 320px; max-width: 558px; min-width: 270px; width: 100%; height: 100%;" scrollbars="no"></iframe>

repository: rc-collins/coupleofidjits

repo_name: rc-collins/coupleofidjits


text:
---
title: Participez.Nanterre.fr
layout: refs
youtubeid: "-JZeOKUIc5Y"
thumbnail: participez-nanterre-fr-screens.png
alt: image-alt
project-date: mars 2016
tag: Public consultation platform
client-url: http://www.nanterre.fr/
project-link: http://participez.nanterre.fr/
client: Ville de Nanterre
locale: en
Categories: featured
date: 2016-09-28 00:00:00 +0000
---

After a 6 month **collaboration with the city of Nanterre**, we created the "participez.nanterre.fr" platform. It was built using open source tools like Drupal, Timeline.js and DemocracyOS. During the month of November 2015, we also organized a [hackathon](http://www.nanterredigital.fr/hackathon/) that aimed at bringing together representatives, citizens, webdesigners and public stakeholders in order to push the process forward.
This platform allows citizens to stay aware and contribute to consultation campaigns, all the while keeping tracks of decision-making processes using the interactive timeline tool.
We helped the city staff with technical aspects as well as strategical project management, team training, mockups and promotional messages for the platform.

“Les Assises de la ville” was the first consultation event to make use of the platform. It gathered 1559 citizens online who made 351 contributions, among which 195 were collective. You can find a report of this campaign [here](https://participez.nanterre.fr/sites/default/files/SynthAssisesPRINT.pdf).
So far, the site has been host to **6 consultation campaigns**.

We were asked to build the second version of the portal. The main functionnality we added is **collaborative mapping** tool that we used for the "[Fiber internet for all](https://participez.nanterre.fr/campagne/fibre-pour-tous)" which allowed to map more than 2000 household who want to have fiber internet and currently don't ! To know more about this collaboration, [check out article](https://medium.com/open-source-politics/how-we-built-a-permanent-agora-in-nanterre-f4e5b019c6b4).

![Budget Participatif]({{ site.baseurl }}/img/fibre-nanterre.png)

branch_name: refs/heads/Foresty


text:
# tic-tac-toe

Source: David K. [@DavidKPiano](https://twitter.com/DavidKPiano)

- App https://codesandbox.io/s/j750nqvo2y
- Puppeteer script https://gist.github.com/davidkpiano/6344c75471d7927fbb7296393c9f9289

## Cypress tests

Use precomputed paths that lead to a draw (16 paths I think, see [cypress/fixtures](cypress/fixtures) folder). Each path is mapped to a test in [cypress/integration/spec.js](cypress/integration/spec.js), and at the end it verifies that "Draw" message appears. To run tests:

- start app from one terminal `npm start`
- start Cypress from another terminal `npx cypress open` and click `spec.js`

A gif how the tests look

![Tic Tac Toe draw test](img/tic.gif)


text:
---
layout: page
title: Books
permalink: /books/
---

In His Hands

    A collection of essays dealing with every stage of the cancer journey from diagnosis to picking up the pieces and finding the new normal.
    It always returns to the central message that God is in control and that even though there is pain in this world, there is also hope.

All is Well

    A collection of poems by a breast cancer survivor, covering all aspects of the cancer journey from diagnosis, through treatment, to recovery and fear of recurrence—but always coming back to the promise that God is in control.

Join Me In the Journey

    Embark on a journey that will celebrate our uniqueness through reflection on who we are, who God is, and why He made us.
    Part my story and part yours, this book is meant to be read and written in over thirty-one days.


text:
# Explot

Explot helps you plot your Elixir data using Python's Matplotlib.

This package does not try to redo Matplotlib (have you seen how big is that thing?) but lets Elixir interface
with Matplotlib to plot the data.

## Installation

```elixir
def deps do
  [{:explot, "~> 0.1.0"}]
end
```

Explot needs your system to have installed Python3 and matplotlib.
Refer to the official [Matplotlib installation guide](http://matplotlib.org/users/installing.html) for details.
If you are able to plot with Python, then you are able to plot with Explot.

## Usage

### Using with Dataframe

Explot is designed to work well with the [Dataframe](https://github.com/JordiPolo/dataframe) package.
Given your data is inside a DataFrame.Frame, you only need to call
```elixir
DataFrame.plot(frame)
```
And the DataFrame module will take care of setting up the plot for you and showing it.

### Using with your own data

Example session:
```elixir
iex(1)> plot = Explot.new
#PID<0.116.0>
iex(2)>  Explot.ylabel(plot, "income")
true
iex(3)>  Explot.xlabel(plot, "years")
true
iex(4)> Explot.title(plot, "rich!!")
true
iex(5)> Explot.add_list(plot, [1000, 1500, 2500, 4500, 8500], "$")
true
iex(6)> Explot.x_axis_labels(plot, ["2012", "2013", "2014", "2015", "2016"])
true
iex(7)> Explot.show(plot)
:ok
```

Will show the following plot:

![](readme_example.png)

## Development

Run tests
```
mix test
```

PRs welcomed!

gha_license_id: NOASSERTION


text:
# Semantic Segmentation
This tutorial will teach you how to use torchsat to train your semantic segmentation model for your satellite project.

## Prepare training data
If your training data is a large image (such as 10000 x 10000 pixels), you can use torchsat command-line tool to crop it into small pictures for training. There are two cases:
1. If your sample labels are vectors, then you can use `ts make_mask_seg` to directly generate small samples that can be directly used for training.
2. If your sample label is a picture, then you can use `ts make_mask_cls` to cut the large satellite image and label image separately.

The final generated train data needs to be organized as follows:
```
    .
    ├── train
    │   ├── image
    │   │   ├── train_1.jpg
    │   │   ├── train_2.jpg
    │   │   ├── ...
    │   └── label
    │       ├── train_1.png
    │       ├── train_2.png
    │       ├── ...
    └── val
        ├── image
        │   ├── val_10.jpg
        │   ├── val_11.jpg
        │   ├── ...
        └── label
            ├── val_10.png
            ├── val_11.png
            ├── ...
```

## Training model
You can use scripts/train_seg.py to train your model.
You can also modify some of them according to your own needs, such as `data augmentation`, `loss function`, `optimzer`, `model`.

```
usage: test.py [-h] [--train-path TRAIN_PATH] [--val-path VAL_PATH]
               [--extensions EXTENSIONS [EXTENSIONS ...]] [--model MODEL]
               [--pretrained PRETRAINED] [--resume PATH]
               [--num-classes NUM_CLASSES] [--in-channels IN_CHANNELS]
               [--device DEVICE] [-b BATCH_SIZE] [--epochs EPOCHS] [--lr LR]
               [--print-freq PRINT_FREQ] [--ckp-dir CKP_DIR]

TorchSat Segmentation Training Script

optional arguments:
  -h, --help            show this help message and exit
  --train-path TRAIN_PATH
                        train dataset path
  --val-path VAL_PATH   validate dataset path
  --extensions EXTENSIONS [EXTENSIONS ...]
                        the train image extension
  --model MODEL         model name. default, unet34
  --pretrained PRETRAINED
                        use ImageNet pretrained params
  --resume PATH         path to latest checkpoint (default: none)
  --num-classes NUM_CLASSES
                        num of classes
  --in-channels IN_CHANNELS
                        input image channels
  --device DEVICE       device
  -b BATCH_SIZE, --batch-size BATCH_SIZE
                        batch size
  --epochs EPOCHS       epochs
  --lr LR               initial learning rate
  --print-freq PRINT_FREQ
                        print frequency
  --ckp-dir CKP_DIR     path to save checkpoint

```

You can also open Tensorboard to view the loss and test accuracy during training.
![](../_static/img/tensorboard-segmentation.png)

Currently supported models are:
- UNet
    - ResNet Backbone: `unet_restnet18`, `unet_resnet34`, `unet_resnet101`

## Inference new image
[TODO]

repository: weiyudaixing/repair

repo_name: weiyudaixing/repair


text:
---
title: Decoupled Days
url: https://decoupleddays.com/
cocUrl: https://decoupleddays.com/code-of-conduct
date: 2019-07-17
endDate: 2019-07-18
location: New York City, New York
byline: The only conference on the future of CMS, headlessCMS, and decoupledCMS.
---

In its third year after a successful debut in 2017, Decoupled Days is a conference for architects, developers, and businesspeople involved in implementing decoupled CMS architectures. The JavaScript and JAMstack track will cover modern JavaScript and its use in decoupled CMS architectures. Topics include universal JavaScript, server-side rendering, Node.js and ES2015 techniques, frameworks and libraries (e.g. Angular, Ember, React, Vue), static site generators (e.g. Gatsby), JAMstack architectures and hosting (e.g. Netlify), and JavaScript modernization efforts in Drupal.

repository: CSS-Tricks/conferences

gha_language: Nunjucks

repo_name: CSS-Tricks/conferences


text:
# Treasure Hunting

Browser-based multiplayer game about solving puzzles in a team.

## Gameplay

### Overview

Two teams of 3 are given a series of puzzles to solve against a ticking clock. The team with the most number of credits at the end wins.

Answering correctly grants you credits which can be used by a team to either get a hint (atmost 1 per 2 questions), extend time limit by a little bit (atmost 1 per question), or life lines (atmost 1 per game).

### Phases

There are two phases to each puzzle in the game:

- Question Phase: The puzzle is presented and the teams are given a set amount of time to talk. In this phase, each team can use their credits for hints, time extensions, or life lines. To purchase any of the abilities with credits, someone must initiate a request to vote for the purchase. Aleast 2 of the 3 members have to vote positively for the purchase to be successful. After this set amount of time is over, the voting phase starts.

- Answer Phase: Each member of a team enters an answer. After everyone is done typing the answer, the typed unique answers are visible to everyone in the team. The answer with majority votes becomes the team's final answer. Depending on the answer being correct or incorrect, the team gets credits and move on.

## Contribution

Contributions make open source fun. This project is very much in infancy so feel free to work on anything and everything.

repository: BaibhaVatsa/treasure-hunting

repo_name: BaibhaVatsa/treasure-hunting


text:
# restendpointget spring-boot server

This is a simple project, it can be used as a template for a huge project.

## Deploy
```
$ mvn spring-boot:run
```
* URL http get request:
```
http://localhost:8080/course
```
* URL http post request
```
http://localhost:8080/register/course

    { "name": "Tom",
	  "chapterCount": 6
    }
```

repository: FoxNeo/spring-boot-project

repo_name: FoxNeo/spring-boot-project


text:
# Noob SNHUbot

[![Build Status](https://travis-ci.com/gsfellis/noob_snhubot.svg?branch=noob_snhubot_2.0)](https://travis-ci.com/gsfellis/noob_snhubot)

A simple Slack bot written in Python for the [snhu_coders](https://snhu_coders.slack.com) Slack workgroup. It's a fun
side project for me and I welcome anyone interested to participate. Contact me on Slack or open an issue if you'd like
to see an enhancement to the bot.

## Getting Started

To get started, [fork](https://help.github.com/en/articles/fork-a-repo) this repository to your own account. From there,
[clone](https://help.github.com/en/articles/cloning-a-repository) your repository to your workstation and begin making
changes. Follow the instructions in the links provided for more details.

### Python Version

The production environment runs `Python 3.6.7`. Keep this in mind while developing as some features from later versions
may not be available in production.

### Installing

It's recommended to use a virtual environment when working on this project to separate the requirements and avoid
conflicts you may have with other projects.

I've used the [venv](https://docs.python.org/3/library/venv.html) module on `Windows 10` for my own development
environment, but other methods like [virtualenv](https://virtualenv.pypa.io/en/latest/) should suffice.

Once you're setup, update your `pip` version and install the packages in the `requirements.txt` file into your
environment:

```bash
pip install -r requirements.txt
```

## Contributing

Be sure to check out our [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for
submitting pull requests to us.

## Current State

Noob SNHUbot loads a series of commands and can execute them when prompted by a user through the Slack channel.  It only
utilizes the Slack Client [RTM API](https://api.slack.com/rtm). The [Events](https://api.slack.com/events) and
[Web](https://api.slack.com/web) APIs have not been utilized, but may be implemented at a later time.

## Functionality

Noob SNHUbot will respond to the following direct messages. To begin a conversation, start a message in the channel
with `@Noob SNHUbot`:

* catalog
  * Uses SNHU Course Catalog Data to fetch details about course subjects and course IDs.
  * catalog `subject` returns a list of Course IDs for the given subject:
    * `catalog Computer Science`
  * catalog `courseID` will return an attachment with catalog data for the course:
    * `catalog CS499`
  * catalog `courseID1 courseID2 courseID3` will return attachments for up to three course IDs.
  * Acceptable formats for course ID are: `ABC-123`, `ABC 123`, or `ABC123`, case insensitive.
* channels
  * Displays a detailed list of channels in the Slack workgroup.
* help
  * Shows a list of known commands.
* it140
  * Gives links to tutorial videos pertaining to course material in IT-140.
  * Requires secondary command to indicate desired topic: `@Noob SNHUbot it140 topic`.
    * Calling the command with no topic, `@Noob SNHUbot it140`, gives a help list with valid topics.
  * Valid secondary commands are:
    * `basics`: gives video links pertaining to Python basics.
    * `dicts`: gives video links pertaining to Python dictionaries.
    * `files`: gives video links pertaining to Python file handling.
    * `functions`: gives video links pertaining to Python functions.
    * `lists`: gives video links pertaining to Python lists.
    * `project`: gives video links pertaining to the various script projects in IT-140.
    * `regex`: gives video links pertaining to regular expressions in Python.
* packtbook
  * Reaches out to the Packtbook Website to display the latest free book of the day.
  * Automatically scheduled to launch at 8:30PM Eastern Time.
  * Supports secondary `request` command:
    * Enabled by adding a `book_requests` section to the mongo configuration as seen below.  Requests can be disabled independently of mongo by simply omitting `book_requests`.
    * `@Noob SNHUbot packtbook request (-a/--add) [list, of, words, "or phrases", here]` adds request words for the requesting user.
    * `@Noob SNHUbot packtbook request (-d/--delete) [list, of, words, "or phrases", here]` deletes the given word(s) from the user's requests.
    * `@Noob SNHUbot packtbook request (-c/--clear)` clears all of the user's requests.
    * `@Noob SNHUbot packtbook request --justforfun` prints out an ugly list of all of the current requests.
    * `@Noob SNHUbot packtbook request --admin` is intended for admin functionality, but is not yet implemented.
    * Words can be separated either by space or comma.  Phrases need to be enclosed by quotes `""`.
  * If requests are enabled in the configuration, users are tagged when books are posted if words in the book's title match a user's request words.
* roll `XdY[±Z]`
  * Rolls X number of Y-Sided dice with a + or - Z modifier!
  * Invalid rolls will respond with _"That roll is not valid. Try `@Noob SNHUbot roll help`"_
  * `roll help` will respond with a help message that explains the syntax with examples
  * Valid rolls respond with a Slack [Attachment](https://api.slack.com/docs/message-attachments) message indicated the
  total value of the roll, what roll is operated on, individual roll values, and the modifier applied
* what is the airspeed velocity of an unladen swallow?
  * A clever joke.
  * Responds with a Youtube video to a Monty Python and the Holy Grail clip.
* what's my name?
  * Simple call and response.
  * Responds with: _"Your name is `<@{name}>`! Did you forget or something?"_

## Modular Commands

Commands are now modular! Command scripts are stored in the `cmds` module.  When loaded, the module
will dynamically load all commands and store them in a series of lists depending on their public flag.
In order to use them, the command script must follow these strict guidelines:

* `command` variable
  * The `command` variable must be defined. It is used to identify the command trigger for the bot.
* `public` variable
  * Boolean value if the command should be publicly callable by users or privately used internally by the bot itself.
* `execute(command, user, bot)`
  * The `execute()` function must be defined with `command`, `user`, and `bot` parameters so the bot can call the
  command.
    * `bot` was added so the command can make references to the bot, such as the bot's `id`, which was pretty common.
  * The `execute()` function must return `response` and `attachment`. These can be set to `None`.

### Command Module Example

```python
command = "test"
public = True

def execute(command, user, bot):
    attachment = None
    response = "This is just an example."

    return response, attachment
```

## Configuration

The preferred method to configure the bot is now YAML. Configuration files can be created and passed as arguments
when launching the application (see next section).

Sample `app.yml`:
```yaml
bot_name:       "Noob SNHUbot"
mail_user<EMAIL_ADDRESS>mail_pass:     "SUPER_SECRET_PASSWORD"
smtp_address:   "smtp.gmail.com"
smtp_port:      465
admin_emails<EMAIL_ADDRESS>```

Sample `slack.yml`:

```yaml
token: xoxb-123456789012-aBcDeFgHiJkLmNoPqRsTuVwXyZ
```

Sample `mongo.yml`:

```yaml
db: my_database
collections:
  conn: conn_log
  cmds: cmd_log
  book_requests: book_requests
hostname: my_db_server
port: 27017
```

## Launching the Bot

With decoupling the Bot, Slack and Mongo tasks, the primary script, `noob_snhubot.py`, contains only that which it needs
to process the primary loop.  Optional command line arguments have been added with the use of the `argparse` library.

```bash
usage: noob_snhubot.py [-h] [-a APP_CONFIG] [-m MONGO_CONFIG]
                       [-c SCHED_CONFIG] [-d DELAY]
                       [-s SLACK_CONFIG | -e SLACK_ENV_VARIABLE]

Launch the Noob SNHUBot application.

optional arguments:
  -h, --help            show this help message and exit
  -a APP_CONFIG, --app_config APP_CONFIG
                        Relative path to Bot Application configuration file.
  -m MONGO_CONFIG, --mongo_config MONGO_CONFIG
                        Relative path to Mongo Database configuration file.
  -c SCHED_CONFIG, --sched_config SCHED_CONFIG
                        Relative path to Scheduler Configuration file.
  -d DELAY, --delay DELAY
                        Sets the delay between RTM reads.
  -s SLACK_CONFIG, --slack_config SLACK_CONFIG
                        Relative path to Slack configuration file.
  -e SLACK_ENV_VARIABLE, --slack_env_variable SLACK_ENV_VARIABLE
                        Environment variable holding the Slack client token.
```

### Examples command execution

```bash
python noob_snhubot.py --app_config config\app.yml --slack_config config\slack.yml --mongo_config config\mongo.yml
python noob_snhubot.py -a config\app.yml -s config\slack.yml -m config\mongo.yml

python noob_snhubot.py -a config\app.yml

python noob_snhubot.py -s config\slack.yml

python noob_snhubot.py -e SLACK_ENV_VARIABLE

python noob_snhubot.py -c config\schedule.yml

python noob_snhubot.py -d 5

python noob_snhubot.py --help
```

## Scheduled Commands

It's here! (No, seriously, I finally did it).

The Scheduler has been greatly improved for Noob_SNHUbot 2.0. It now uses a YAML config file (explained below),
passed to the primary script. Threads will be spun up `10` minutes before a scheduled task, so no more threads hanging
around idle forever. Additionally, `schedule` cleanup will only occur after the time for a scheduled task has passed,
reducing the number of calls to a threads `is_active()` method.

### Scheduler YAML config

The configuration is a series of YAML dictionaries (mappings). Each command to be setup in the scheduler should be the
top-level `key`, and then within that will be three additional mappings `args`, `channel`, and `schedule`.
 - `args` represents additional data passed to the command.
   - For example, the `roll` command takes a dice roll to process, so something like "1d20" can be passed into `args`,
   otherwise, simply leave blank `""`
 - `channel` is the Slack Channel ID that the command output will be sent to. This can be retrieved from the a browser's
 address bar when viewing the Slack channel.
 - `schedule` follows standard `cron` expression time, and will be processed by
 the [`croniter`](https://pypi.org/project/croniter/) library to schedule the command.
   - Basic `cron` syntax is as follows:
```
 ┌───────────── minute (0 - 59)
 │ ┌───────────── hour (0 - 23)
 │ │ ┌───────────── day of the month (1 - 31)
 │ │ │ ┌───────────── month (1 - 12)
 │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
 │ │ │ │ │                                   7 is also Sunday on some systems)
 │ │ │ │ │
 │ │ │ │ │
"* * * * *"   <= String representation of cron schedule
```
 - The `packtbook` schedule, which runs each day at 8:30pm, would be `"30 20 * * *"`
 - See the [`cron Wikipedia page`]((https://en.wikipedia.org/wiki/Cron)) for more details on `cron` scheduling

 Sample `schedule.yml`:

```yaml
"packtbook":
  args:       ""
  channel:    "ABCD12345"
  schedule:   "30 20 * * *"

"roll":
  args:       "1d20"
  channel:    "ABCD12345"
  schedule:   "0 1 27 10 *"
```

gha_language: Python


text:
# PHP Form Builder

## Demo
**Demo Form One**

![demo form one](img/demo-form.png)

**Demo Form Two**

![demo form two](img/demo-form-two.png)

## How to use
1. Import the database table under [db](/db) folder
2. Mock up the form fields, refer to [form-builder-example.php](form-builder-example.php)
3. Display the form use `displayForm` function
4. Add actions in form action file (`next-step.php`)
    - WordPress integration already available, include `wp-include.php` in your action file and call `updateForm` to insert, update or delete form entry.
    - Add customized function to action file to handle form submission.

## Todo
1. Add support for other form field types
2. Add edit, download and delete demo
3. Add permission control
4. Add integration for other applications
5. Add database installation
6. Visualize form builder
7. Convert the form builder to plugin
8. ...

repository: RogerShenAU/php-form-builder

repo_name: RogerShenAU/php-form-builder


text:
# RhinoCameraConvert
Converts Rhino current viewport camera to a (location + rotation) format that Houdini, TouchDesigner, Disguise, etc. uses.

## How to run?
With Rhino open, use the command `RunPythonScript` and choose the `RhinoCameraConvert.py` file. The resutls will be printed in Rhino Command Line.

![Screenshot](RhinoCameraConvert.png)

repository: zhihangfu/RhinoCameraConvert

repo_name: zhihangfu/RhinoCameraConvert