text:
---
layout: post
title: How I see Android design guideline
date: 2013-10-30 23:48:54 +0800
comments: true
categories: [android, ui]
---

To make a good Android app, the design is important for sure, but is following the design guideline enough? I am a developer not a designer, but still want to share some thoughts on current design guideline.

## Current design guideline is not complete

Mobile app design changes very fast. To make the app stand out, people put lots of effort to stay on top of the design trends, they improve existing UI, and sometimes create new. And when the public accepted that design, it may become part of the design guideline. For example, navigation drawer (sliding menu) and pull to refresh. The drawer is now in the design guideline and is even supported in support library. Pull to refresh is still new but you can see that Google have their own twist and is using in gmail and google plus app.

## Case studies

Here are some apps that I think they are in a good direction of expanding the design guideline.

### Dropbox

I like the way they put the tab in actionbar and combined with the app logo. You can say it does not follow the design guideline, but in my opinion, it works better, and as long as the style consistent with the Holo theme, I would say it is a good design. However, I don't like they put the second level tab in the bottom, may be they can try using other style of indicator.

### Flickr

Another UI I want to talk about is the slide up panel. I dont see many people discussing it, is it not popular? Not really. Google plus and Flickr are using it already. Comparing to navigate to another view, using gesture to drag out another view sometimes gives better user experience, you dont lose your current view and you have a chance to abort the action (slide out a little bit and close it back).

While I write this article, I found that there is a new "Photo" app from Google in my application list, what supprised me is, the new share dialog. Beside the share dialog and action bar share provider, Google created a new share interface with the slide up panel. I like it.

### (Google) Play Music

The fading action bar is very impressive and definitely will be a trend. In the app, it has transparent action bar so you can see the whole image, and when you scroll down, it fade in to solid color to make the bars stand out. For more detail, Cyril Mottier wrote a good [article](http://cyrilmottier.com/2013/05/24/pushing-the-actionbar-to-the-next-level/) on this.

And beside fading, [blur effect](http://nicolaspomepuy.fr/?p=18) is also coming. I think it is still quite computation heavy in some lower end device, but it should not stop you using it :p

## Keep changing

Design guideline will keep changing. Limiting yourself in the guideline does not mean your app is good,
sometime you need to study your users and expand the guideline yourself.
Developer/designer should not be afraid to use UI that is not in design guideline, as long as it is good, it will be in the guideline.

### Futher reading

* [New in Android(KitKat)](http://developer.android.com/design/patterns/new.html)
* [Google's Android Apps Look Boring - And It's a Good Thing](http://www.androiduipatterns.com/2013/09/googles-android-apps-look-boring-and.html)
* [Four Android App Design Guidelines You Should Break](http://www.fastcolabs.com/3012752/four-android-app-design-guidelines-you-should-break)
    * (I dont agree on some of his points, may write another post on this)
* <https://github.com/ManuelPeinado/FadingActionBar>
* <https://github.com/ManuelPeinado/GlassActionBar>
* <https://github.com/umano/AndroidSlidingUpPanel>

repository: billynyh/random-coding

repo_name: billynyh/random-coding


text:
# Views and Authorization Chapter

In this chapter the notions of UML in the context of database relation creation is covered.
Graded assignments include two (2) quiz sets as well as one (1) exercise set solutions of
which are provided below.

## Quiz

The first quiz is about how basic views work while the second is about authorization and
are both graded. The solutions for this quizzes can be found by following the links below

 1. [Views quiz][1]
 2. [Authorization quiz][2].

## Exercises

The answers for this chapter's exercises can be found [here][3].

[1]: view_qz.md
[2]: auth_qz.md
[3]: view_auth_ex.md

license: MIT

url: https://raw.githubusercontent.com/andylamp/stanford_dbclass/cfdbfb7b095baccc1ea3563b2614e3087c4b3239/12 - views and authorization/README.md

path: /12 - views and authorization/README.md

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
title: "7.4.1 Alerts List"
excerpt: ""
permalink: /docs/en/7.4.1/
redirect_from:
  - /theme-setup/
toc: false
toc_sticky: false
sidebar:
  nav: "en"
---

---

An alert occurs when the occurrence condition in the following list continues for the duration time.

* AlertManager

| Alarm ID | **ALM-001** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | AlertmanagerDown |
| duration | 5minute |
| occurrence condition | Alertmanager Occurs when metrics can not be collected |
| Action | Check Prometheus logs and Alertmanager logs and events. If necessary, restart the Pod. |

| Alarm ID | **ALM-002** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | AlertmanagerFailedReload |
| duration | 10minute |
| occurrence condition | When setting change of Alertmanager, it occurs when setting re-read operation fails |
| Action | Check the log of the pod to fix the configuration error of ConfigMap. |

* ETCD3

| Alarm ID | **ETC-001** |
| :--- | :--- |
| Severity | **critical** |
| Alarm Name | InsufficientMembers |
| duration | 3minute |
| occurrence condition | Occurs when ETCD metrics can not be collected |
| Action | Check the status of the ETCD cluster. Check Prometheus's log and its node's etc status. |

| Alarm ID | **ETC-002** |
| :--- | :--- |
| Severity | **critical** |
| Alarm Name | NoLeader |
| duration | 1minute |
| occurrence condition | Occurs when there is no ETCD reader |
| Action | Check the status of the ETCD cluster. Disk Latency may be a problem, so run the following command on all nodes of the ETCD cluster. \([ETCD Tuning](https://coreos.com/etcd/docs/latest/tuning.html#disk)\)
 ``$ sudo ionice -c2 -n0 -p `pgrep etcd` `` |

| Alarm ID | **ETC-003** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | HighNumberOfLeaderChanges |
| duration | Immediately |
| occurrence condition | If there are more than 3 reader changes in the last hour |
| Action | Check the status of the ETCD cluster. Disk Latency may be a problem, so run the following command on all nodes of the ETCD cluster. \([ETCD Tuning](https://coreos.com/etcd/docs/latest/tuning.html#disk)\)
 ``$ sudo ionice -c2 -n0 -p `pgrep etcd` `` |

| Alarm ID | **ETC-004** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | HighNumberOfFailedGRPCRequests |
| duration | 10minute |
| occurrence condition | If more than 1% of gRPC method calls fail within the last 5 minutes |
| Action | Increase the bandwidth of ETCD clusters and Kubernetes clusters, or Sacale-Up clusters. |

| Alarm ID | **ETC-005** |
| :--- | :--- |
| Severity | **critical** |
| Alarm Name | HighNumberOfFailedGRPCRequests |
| duration | 5minute |
| occurrence condition | If more than 5% of gRPC method calls fail within the last 5 minutes |
| Action | Increase the bandwidth of ETCD clusters and Kubernetes clusters, or Sacale-Up clusters. |

| Alarm ID | **ETC-006** |
| :--- | :--- |
| Severity | **critical** |
| Alarm Name | GRPCRequestsSlow |
| duration | 10minute |
| occurrence condition | If the 99th percentile of the gRPC method request latency over the last 5 minutes is greater than 150ms |
| Action | Increase the bandwidth of ETCD clusters and Kubernetes clusters, or Sacale-Up clusters. |

| Alarm ID | **ETC-007** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | HighNumberOfFailedHTTPRequests |
| duration | 10minute |
| occurrence condition | If more than 1% of requests for HTTP endpoints fail within the last 5 minutes |
| Action | Increase the bandwidth of ETCD clusters and Kubernetes clusters, or Sacale-Up clusters. |

| Alarm ID | **ETC-008** |
| :--- | :--- |
| Severity | **critical** |
| Alarm Name | HighNumberOfFailedHTTPRequests |
| duration | 5minute |
| occurrence condition | If more than 5% of requests for HTTP endpoints fail within the last 5 minutes |
| Action | Increase the bandwidth of ETCD clusters and Kubernetes clusters, or Sacale-Up clusters. |

| Alarm ID | **ETC-009** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | HTTPRequestsSlow |
| duration | 10minute |
| occurrence condition | If the 99th percentile of the HTTP request latency during the last 5 minutes is greater than 150ms |
| Action | Increase the bandwidth of ETCD clusters and Kubernetes clusters, or Sacale-Up clusters. |

| Alarm ID | **ETC-010** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | EtcdMemberCommunicationSlow |
| duration | 10minute |
| occurrence condition | If the 99th percentile of the communication wait time between members in the last 5 minutes is greater than 150ms |
| Action | ETCD Increase the bandwidth of the cluster or scale up the cluster. |

| Alarm ID | **ETC-011** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | HighNumberOfFailedProposals |
| duration | Immediately |
| occurrence condition | If there are more than 5 failed raft protocol requests in the last hour.
 \(RAFT Protocol is ETCD Synchronization Protocol \). |
| Action | The [ETCD metric document](https://github.com/coreos/etcd/blob/master/Documentation/metrics.md/) says that ETCD cluster downtime is getting longer due to temporary electoral failure or lack of members. Check if there is a reader or an abandoned ETCD member |

| Alarm ID | **ETC-012** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | HighFsyncDurations |
| duration | 10minute |
| occurrence condition | If the 99th percentile of the wal fsync duration for the last 5 minutes is greater than 500ms (wal fsync: Called when saving to disk before applying log entries.) |
| Action | According to the [ETCD metrics document](https://github.com/coreos/etcd/blob/master/Documentation/metrics.md/), there is a problem with the disk. |

| Alarm ID | **ETC-013** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | HighCommitDurations |
| duration | 10minute |
| occurrence condition | If the 99th percentile of the last 5 minutes is greater than 250ms, then backend commit is the incremental snapshot commit of the most recent change to the disk. |
| Action | According to the [ETCD metrics document](https://github.com/coreos/etcd/blob/master/Documentation/metrics.md/), there is a problem with the disk. |

* General

| Alarm ID | **GEN-001** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | TargetDown |
| duration | 10minute |
| occurrence condition | Occurs when metric gathering is not possible. Indicates which operation failed. |
| Action | Check the Prometheus log and the logs and events of the pod corresponding to the job. |

| Alarm ID | **GEN-002** |
| :--- | :--- |
| Severity | ~~none~~ |
| Alarm Name | DeadMansSwitch |
| duration | Immediately |
| occurrence condition | DeadMansSwitch notification. |
| Action | The alarm is not notified to the user. |

| Alarm ID | **GEN-003** |
| :--- | :--- |
| Severity | **critical** |
| Alarm Name | TooManyOpenFileDescriptors |
| duration | 10minute |
| occurrence condition | Occurs when file descriptor usage is over 95% |
| Action | Change the limit value of the node. (Requires restart of node) |

| Alarm ID | **GEN-004** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | FdExhaustionClose |
| duration | 10minute |
| occurrence condition | If the file descriptor depletion is predicted within 4 hours using simple linear regression |
| Action | Check the logs and events of the corresponding pod. If necessary, change the limit value of the node. (Requires restart of node) |

| Alarm ID | **GEN-005** |
| :--- | :--- |
| Severity | **critical** |
| Alarm Name | FdExhaustionClose |
| duration | 10minute |
| occurrence condition | If the file descriptor depletion is predicted within 1 hours using simple linear regression |
| Action | Check the logs and events of the corresponding pod. If necessary, change the limit value of the node. (Requires restart of node) |

* Kube-ApiServer

| Alarm ID | **KAS-001** |
| :--- | :--- |
| Severity | **critical** |
| Alarm Name | K8SApiserverDown |
| duration | 5minute |
| occurrence condition | kube-apiserver Occurs when metrics can not be collected |
| Action | Check Prometheus logs and kube-apiserver logs and events. If necessary, restart the Pod. |

| Alarm ID | **KAS-002** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | K8SApiServerLatency |
| duration | 10minute |
| occurrence condition | If the 99th percentile of the waiting time for the last 10 minutes is greater than 1s |
| Action | If it continues to occur, the master node is added. |

* Kube-ControllerManager

| Alarm ID | **KCM-001** |
| :--- | :--- |
| Severity | **critical** |
| Alarm Name | K8SControllerManagerDown |
| duration | 5minute |
| occurrence condition | kube-controller-manager Occurs when metrics can not be collected |
| Action | Check Prometheus logs and kube-controller-manager logs and events. If necessary, restart the Pod. |

* Kube-Scheduler

| Alarm ID | **KSC-001** |
| :--- | :--- |
| Severity | **critical** |
| Alarm Name | K8SSchedulerDown |
| duration | 5minute |
| occurrence condition | If kube-scheduler metrics can not be collected |
| Action | Check Prometheus logs and kube-scheduler logs and events. If necessary, restart the Pod. |

* Kube-State-Metrics

| Alarm ID | **KSM-001** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | DeploymentGenerationMismatch |
| duration | 15minute |
| occurrence condition | Occurs when generation set in Deployment differs from collected generation |
| Action | Check the logs and events of the deployment. If necessary, redistribute Deployment. |

| Alarm ID | **KSM-002** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | DeploymentReplicasNotUpdated |
| duration | 15minute |
| occurrence condition | Occurs when the number of replicas set in the deployment is different from the number of replicas in the changed or available state. |
| Action | Check the logs and events of Deployment and Pod because Deployment fix is not reflected. |

| Alarm ID | **KSM-003** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | DaemonSetRolloutStuck |
| duration | 15minute |
| occurrence condition | Occurs when there are pods whose status is not Ready in DaemonSet |
| Action | Check the Daemonset and Pod logs and events. |

| Alarm ID | **KSM-004** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | K8SDaemonSetsNotScheduled |
| duration | 10minute |
| occurrence condition | Occurs when the number of running pods is smaller than the number of pods to be executed in DaemonSet. |
| Action | Check the Daemonset and Pod logs and events. Verify that the node that is not deployed is healthy. If the master node is isolated, make sure that the daemonset has tolerance settings. |

| Alarm ID | **KSM-005** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | DaemonSetsMissScheduled |
| duration | 10minute |
| occurrence condition | Occurs when an improperly scheduled pod is encountered in DaemonSet |
| Action | Check the Daemonset and Pod logs and events. |

| Alarm ID | **KSM-006** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | PodFrequentlyRestarting |
| duration | 10minute |
| occurrence condition | Occurs when the number of pod restarts is more than 5 times in the last hour |
| Action | Check the logs and events of the corresponding pod. Restart the Pod if necessary. |

* Kubelet

| Alarm ID | **KBL-001** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | K8SNodeNotReady |
| duration | 1hours |
| occurrence condition | Occurs when the Node state is not Ready |
| Action | Check the status and events of that node. Connect to the node via ssh and check the status of the kubelet. |

| Alarm ID | **KBL-002** |
| :--- | :--- |
| Severity | **critical** |
| Alarm Name | K8SManyNodesNotReady |
| duration | 1minute |
| occurrence condition | Occurs when the percentage of nodes that are not Ready is more than 20% across the cluster |
| Action | Check the status and events of the nodes. Connect to the node via ssh and check the status of the kubelet. |

| Alarm ID | **KBL-003** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | K8SKubeletDown |
| duration | 1hours |
| occurrence condition | Occurs when kubelet metrics are not collected over 3% across the cluster |
| Action | Check the Prometheus log and its node status and events. Connect to the node via ssh and check the status of the kubelet. |

| Alarm ID | **KBL-004** |
| :--- | :--- |
| Severity | **critical** |
| Alarm Name | K8SKubeletDown |
| duration | 1hours |
| occurrence condition | Occurs when more than 10% kubelet metrics are not collected across the cluster |
| Action | Check the Prometheus logs and their status and events. Connect to the node via ssh and check the status of the kubelet. |

| Alarm ID | **KBL-005** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | K8SKubeletTooManyPods |
| duration | Immediately |
| occurrence condition | Occurs when the number of pods placed in the Node exceeds 100 (the limit is 110) |
| Action | If the limit value is reached, no more pod generation is possible. If the state of other nodes is checked as well, the node is added. |

* Node

| Alarm ID | **NOD-001** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | NodeExporterDown |
| duration | 10minute |
| occurrence condition | NodeExporter occurs when metrics can not be collected |
| Action | Check the Prometheus logs and NodeExporter logs and events. If necessary, restart the Pod. |

| Alarm ID | **NOD-002** |
| :--- | :--- |
| Severity | **critical** |
| Alarm Name | K8SNodeOutOfDisk |
| duration | Immediately |
| occurrence condition | Occurs when the Node state is OutOfDisk. |
| Action | The disk of the node is expanded. |

| Alarm ID | **NOD-003** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | K8SNodeMemoryPressure |
| duration | Immediately |
| occurrence condition | Occurs when the Node state is MemoryPressure |
| Action | The memory of the node is expanded. |

| Alarm ID | **NOD-004** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | K8SNodeDiskPressure |
| duration | Immediately |
| occurrence condition | Occurs when Node Status is DiskPressure |
| Action | Free up disk space by removing logs, unused dodkcer image, and pv backup from the node. If it continues to occur, the disk of the corresponding node is added. |

| Alarm ID | **NOD-005** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | NodeCPUUsage |
| duration | 30minute |
| occurrence condition | Node Average CPU usage in the last 5 minutes exceeds 90% |
| Action | Increase the CPU of the node. |

| Alarm ID | **NOD-006** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | NodeMemoryUsage |
| duration | 30minute |
| occurrence condition | Node memory usage exceeds 90% |
| Action | The memory of the node is expanded. |

* Prometheus

| Alarm ID | **PRM-001** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | PrometheusFailedReload |
| duration | 10minute |
| occurrence condition | Prometheus changes settings, re-read settings |
| Action | Check the log of the pod to fix the configuration error of ConfigMap. |

* Cocktail

| Alarm ID | **CKT-001** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | PvLowRequestDisk |
| duration | 30minute |
| occurrence condition | PV is over 80% of the requested disk size |
| Action | Increase the size of PV. However, you must redistribute the server. |

| Alarm ID | **CKT-002** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | PvLowTotalDisk |
| duration | 30minute |
| occurrence condition | Occurs when PV is mounted on a disk and its usage exceeds 80%. |
| Action | Check the status of the mounted disk and remove unused PV. If necessary, expand the disk. |

| Alarm ID | **CKT-003** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | PodCPULimitUsage |
| duration | 30minute |
| occurrence condition | Occurs when the CPU utilization exceeds 90% of the Resource Limit setting value |
| Action | Change the CPU Limit value of the Deployment if it continues to occur |

| Alarm ID | **CKT-004** |
| :--- | :--- |
| Severity | warning |
| Alarm Name | PodMemoryLimitUsage |
| duration | 30minute |
| occurrence condition | Occurs when memory usage exceeds 90% of Resource Limit setting value |
| Action | Change Memory Limit value of Deployment if it continues to occur |

gha_language: JavaScript

gha_license_id: MIT


text:
# java-services

Rest services using Java

## Tutorial link

https://spring.io/guides/gs/spring-boot/

## Careful

Remember add dependencies to use annotations and every implementation in springboot framework in build.gradle

'''
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
'''

## Gradle commands

'''
// Refresh dependencies
./gradlew build --refresh-dependencies
// Runs the application
./gradlew bootRun
// Run the tests
./gradlew test
'''

## Spring Boot Token based Authentication with Spring Security & JWT

[Spring Boot Token based Authentication with Spring Security & JWT](https://bezkoder.com/spring-boot-jwt-authentication/)

## MySQL

[commands](http://g2pc1.bu.edu/~qzpeng/manual/MySQL%20Commands.htm)

command

'''shell
mysql -u root -p
'''

## Logout storing token in a black list cache

We can log out storing the token on the black list cache.

When a user performs logout action, the client should call a server API and in this API will add this token into the blocklist sections either in the cache Redis or database. So the validating token process you check if the token is in blocklist or not.

[JWT logout](https://blog.usejournal.com/springboot-how-to-invalidate-jwt-token-such-as-logout-or-reset-all-active-tokens-73f55289d47b)

repository: israelramosm/java-services

repo_name: israelramosm/java-services


text:
---
title: "Statistics for Software Use"
linkTitle: "Software Use Statistics"
description: >
  "How to get statistics on the number of downloads for software projects
---

It can be helpful to know how frequently your software is being downloaded to assess it's use and report on its impact. Below are instructions for how to do this for different languages. Keep in mind that downloads can be influenced by automated testing systems if they install the software from the central repository.

## R

These instructions get downloads from the cloud CRAN mirror. This is a minimum estimate of total downloads.

* Install the [`cranlogs` package](https://github.com/r-hub/cranlogs) `install.packages("cranlogs")`
* Run the `cran_downloads` function with your package name and date ranges if desired

```r
downloads = cranlogs::cran_downloads(packages = c("portalr"), from = "2020-02-26", to = "2020-08-16")
total_downloads = sum(downloads$count)
```

## Python

Python packages are often distributed using both PyPI and conda so you might need to get download statistics for both.

### PyPI

* Setup a Google BigQuery account
* Run a version of this query where with additional modifications as necessary

```Python
SELECT COUNT(*) downloads
FROM `the-psf.pypi.downloads2020*`
WHERE file.project='retriever'
```

### Conda

* Install the [`condastats` package](https://www.anaconda.com/blog/get-python-package-download-statistics-with-condastats) `conda install -c conda-forge condastats`
* From the command line run a version of the following command

```bash
condastats overall retriever --start_month 2020-01 --end_month 2020-08
```

repository: weecology/weecology-wiki

branch_name: refs/heads/main

repo_name: weecology/weecology-wiki


text:
# SHOW PARTITIONS {#concept_p2t_cdm_zgb .concept}

## Overview {#section_p5k_ll3_ygb .section}

```
SHOW PARTITIONS FROM table [ WHERE ... ] [ ORDER BY ... ] [ LIMIT ... ]
```

## Description {#section_fym_ml3_ygb .section}

Lists the partitions of a table. You can use the `WHERE` clause to filter conditions, use `ORDER BY` to sort results, and use LIMIT to limit the size of a result set. These clauses are used in the same way as `SELECT`.

## Examples {#section_phk_nl3_ygb .section}

```
--- List all the partitions of the table "orders"
SHOW PARTITIONS FROM orders;

--- List all the partitions of the table "orders" starting from year 2013 until now and sort the partitions by year
SHOW PARTITIONS FROM orders WHERE ds >= '2013-01-01' ORDER BY ds DESC;

--- List the recent partitions of the table "orders"
SHOW PARTITIONS FROM orders ORDER BY ds DESC LIMIT 10;
```

url: https://raw.githubusercontent.com/yiwei00000/emapreduce/46dce169501216f0e2d089dd12e8346c18d1bb31/intl.en-US/Open Source Components /Presto/Instructions/SQL manual/SQL statements/SHOW PARTITIONS.md

filename: SHOW PARTITIONS.md


text:
# Recipe-app-api
## Source code for recipe app api.

A fully functioning REST API using:

 - Python
 - Django / Django-REST-Framework
 - Docker / Docker-Compose
 - Test Driven Development

## Getting started

To start project, run:

```
docker-compose up
```
The API will then be available at http://<IP_ADDRESS>:8000

## Endpoints

### Manage users
 - /api/user/create
 - /api/user/token
 - /api/user/me

### Manage recipes
- /api/recipe/tags
- /api/recipe/ingredients
- /api/recipe/recipe
- /api/recipe/recipe/id/
- /api/recipe/id/upload-image

repository: khabdrick/recipe-app-api

gha_language: Python

repo_name: khabdrick/recipe-app-api


text:
# UnixZipper

[![Latest Stable Version](https://poser.pugx.org/dimsav/unix-zipper/v/stable.png)](https://packagist.org/packages/dimsav/unix-zipper) [![Build Status](https://travis-ci.org/laravel/framework.png)](https://travis-ci.org/dimsav/unix-zipper)

A simple zip compression library for Unix operating systems.
UnixZipper is ideal for creating backups of your projects in unix servers.

## Features
1. Easy to use
2. Password protection
2. Tested for stability

## How does it work

Here is a simple example. Feel free to check the tests to see the class in action.

```php
// Instantiate the class
$zipper = new UnixZipper();

// Add absolute paths of directories or files for compression
$zipper->add('/absolute/path/to/some/directory');
$zipper->add('/absolute/path/to/file.txt');

// Exclude directories and files
$zipper->exclude('/absolute/path/to/some/directory');
$zipper->exclude('/absolute/path/to/some/file.txt');

// Add a password if you wish
$zipper->setPassword('my_password');

// The path of the file that will be generated
// If the given path doesn't exist, it will be created automatically.
$zipper->setDestination('/file/after/compression/test.zip');

// Do the magic
$zipper->compress();
```

Since version 1.2, you can set a base path, and provide the files to be compressed relatively.

```php
$zipper = new UnixZipper();

// Set base path
$zipper->setAbsolutePathAsBase('/absolute/projects');

// Add relative paths of directories or files for compression
$zipper->add('project-1');     // /absolute/projects/project-1
$zipper->add('logs/file.txt'); // /absolute/projects/logs/file.txt

$zipper->setDestination('/file/after/compression/test.zip');

// Compress
$zipper->compress();
```

## Why unix

The reason I chose to make this package unix-only is because I wanted to rely
on the system's zip function, that offers stability and flexibility. It also
offers the possibility to exclude directories recursively, a feature I couldn't
find in other php classes.

## Installation

Install using composer:

1. Add `"dimsav/unix-zipper": "1.*"` to your composer.json file
2. Run `composer update`

## Dependencies

The only requirements are:
* executing the code on a unix system
* composer for installing/autoloading

repository: dimsav/unix-zipper

repo_name: dimsav/unix-zipper


text:
# Changelog

All notable changes to `angular4-paystack` will be documented in this file

## 2.3.0 - 13:12:18
### Added
- Paystack script is imported dynamically

## 2.2.0 - 12:10:18
### Added
- Channels to options
- paymentInit event

## 2.1.0 - 2018-04-17
### Added
- Angular4Paystack directive
### Bug Fixes
- Fixed issue when more than one popup shows when user clicks on button more than once

## 2.0.0 - 2017-12-02
### Added
- You can now use the paystack inline embed in your angular application
- Added tests
### Changed
- updated README to show how to use the paystack inline embed and little fixes
### Removed
- Text input (`(text)`) is no longer supported for the `angular4-paystack` component. Check README for details

## 1.2.1 - 2017-10-04
### Changed
- updated readme to show that a callback is compulsory
- corrected `@angular/core` version in peerDependency

## 1.2.0 - 2017-09-22
### Changed
- text input `(text)` is now deprecated
- added example section
- updated readme

## 1.1.0 - 2017-09-21
### Changed
- Updated ReadMe and
### Removed
- removed unecessary packaged file
### Fixed
- Some minor bugs

## 1.0.0 - 2017-09-20
- Initial release


text:
# tryer

[![Build status](https://gitlab.com/philbooth/tryer/badges/master/pipeline.svg)](https://gitlab.com/philbooth/tryer/pipelines)
[![Package status](https://img.shields.io/npm/v/tryer.svg)](https://www.npmjs.com/package/tryer)
[![Downloads](https://img.shields.io/npm/dm/tryer.svg)](https://www.npmjs.com/package/tryer)
[![License](https://img.shields.io/npm/l/tryer.svg)](https://opensource.org/licenses/MIT)

Because everyone loves a tryer!
Conditional
and repeated
function invocation
for node
and browser.

* [Say what?](#say-what)
* [What size is it?](#what-size-is-it)
* [How do I install it?](#how-do-i-install-it)
* [How do I use it?](#how-do-i-use-it)
  * [Loading the library](#loading-the-library)
  * [Calling the exported function](#calling-the-exported-function)
  * [Examples](#examples)
* [How do I set up the dev environment?](#how-do-i-set-up-the-dev-environment)
* [What license is it released under?](#what-license-is-it-released-under)

## Say what?

Sometimes,
you want to defer
calling a function
until a certain
pre-requisite condition is met.
Other times,
you want to
call a function
repeatedly
until some post-requisite condition
is satisfied.
Occasionally,
you might even want
to do both
for the same function.

To save you writing
explicit conditions
and loops
on each of those occasions,
`tryer` implements
a predicate-based approach
that hides the cruft
behind a simple,
functional interface.

Additionally,
it allows you to easily specify
retry intervals
and limits,
so that your code
doesn't hog the CPU.
It also supports
exponential backoff
of retry intervals,
which can be useful
when handling
indefinite error states
such as network failure.

## What size is it?

5.6 kb unminified with comments, 1.1 kb minified, 0.5 kb minified + gzipped.

## How do I install it?

Via npm:

```
npm i tryer --save
```

Or if you just want the git repo:

```
git clone git@gitlab.com:philbooth/tryer.git
```

## How do I use it?

### Loading the library

If you are running in
Node.js
or another CommonJS-style
environment,
you can `require`
tryer like so:

```javascript
const tryer = require('tryer');
```

It also the supports
the AMD-style format
preferred by Require.js.

If you are
including `tryer`
with an HTML `<script>` tag,
or neither of the above environments
are detected,
it will be exported globally as `tryer`.

### Calling the exported function

`tryer` is a function
that can be invoked to
call other functions
conditionally and repeatedly,
without the need for
explicit `if` statements
or loops in your own code.

`tryer` takes one argument,
an options object
that supports
the following properties:

* `action`:
  The function that you want to invoke.
  If `action` returns a promise,
  iterations will not end
  until the promise is resolved or rejected.
  Alternatively,
  `action` may take a callback argument, `done`,
  to signal that it is asynchronous.
  In that case,
  you are responsible
  for calling `done`
  when the action is finished.
  If `action` is not set,
  it defaults to an empty function.

* `when`:
  A predicate
  that tests the pre-condition
  for invoking `action`.
  Until `when` returns true
  (or a truthy value),
  `action` will not be called.
  Defaults to
  a function that immediately returns `true`.

* `until`:
  A predicate
  that tests the post-condition
  for invoking `action`.
  After `until` returns true
  (or a truthy value),
  `action` will no longer be called.
  Defaults to
  a function that immediately returns `true`.

* `fail`:
  The error handler.
  A function
  that will be called
  if `limit` falsey values
  are returned by `when` or `until`.
  Defaults to an empty function.

* `pass`:
  Success handler.
  A function
  that will be called
  after `until` has returned truthily.
  Defaults to an empty function.

* `limit`:
  Failure limit,
  representing the maximum number
  of falsey returns from `when` or `until`
  that will be permitted
  before invocation is deemed to have failed.
  A negative number
  indicates that the attempt
  should never fail,
  instead continuing
  for as long as `when` and `until`
  have returned truthy values.
  Defaults to `-1`.

* `interval`:
  The retry interval,
  in milliseconds.
  A negative number indicates
  that each subsequent retry
  should wait for twice the interval
  from the preceding iteration
  (i.e. exponential backoff).
  The default value is `-1000`,
  signifying that
  the initial retry interval
  should be one second
  and that each subsequent attempt
  should wait for double the length
  of the previous interval.

### Examples

```javascript
// Attempt to insert a database record, waiting until `db.isConnected`
// before doing so. The retry interval is 1 second on each iteration
// and the call will fail after 10 attempts.
tryer({
  action: () => db.insert(record),
  when: () => db.isConnected,
  interval: 1000,
  limit: 10,
  fail () {
    log.error('No database connection, terminating.');
    process.exit(1);
  }
});
```

```javascript
// Attempt to send an email message, optionally retrying with
// exponential backoff starting at 1 second. Continue to make
// attempts indefinitely until the call succeeds.
let sent = false;
tryer({
  action (done) {
    smtp.send(email, error => {
      if (! error) {
        sent = true;
      }
      done();
    });
  },
  until: () => sent,
  interval: -1000,
  limit: -1
});
```

```javascript
// Poll a device at 30-second intervals, continuing indefinitely.
tryer({
  action: () => device.poll().then(response => handle(response)),
  interval: 30000,
  limit: -1
});
```

## How do I set up the dev environment?

The dev environment relies on
[Chai],
[JSHint],
[Mocha],
[please-release-me],
[spooks.js] and
[UglifyJS].
The source code is in
`src/tryer.js`
and the unit tests are in
`test/unit.js`.

To install the dependencies:

```
npm i
```

To run the tests:

```
npm t
```

To lint the code:

```
npm run lint
```

To regenerate the minified lib:

```
npm run minify
```

## What license is it released under?

[MIT](COPYING)

[chai]: http://chaijs.com/
[jshint]: http://jshint.com/
[mocha]: http://mochajs.org/
[please-release-me]: https://gitlab.com/philbooth/please-release-me
[spooks.js]: https://gitlab.com/philbooth/spooks.js
[uglifyjs]: http://lisperator.net/uglifyjs/
[license]: COPYING


text:
# concurrent-couch-follower
a couch follower wrapper that you can use to be sure you don't miss any documents even if you process them asynchronously.

```js
var changes = require('concurrent-couch-follower')
var someAction = require(.....)

var dataHandler = function(data, done) {
    someAction(data, function() {
      done()
    })
}

var configOptions = {
  db: 'https://url.to.couchdb/registry/_changes',
  include_docs:true,
  sequence:'.sequence',
  now:false,
  concurrency:5
}

changes(dataHandler, configOptions)
```

API
---

### `changes(handler,options)`

- handler = function(change,done)
 is a function that is called for every document
 - change, the change from couchdb {seq:sequence,doc:the document,....}
 - done, you must call this function when you are done processing the document.

- options
  a config object as passed to `changes-stream` but including these additional properties.
  - `db`, the connection string url pointing to the CouchDB registry to be followed.
  - `sequence`, the name of the file to persist the sequence id, if this is a function this is passed as a persist function to concurrent-seq-file.
  - `concurrency`, the maximum number of documents to process at a time.
  - the `changes-stream` property `since` is populated by the value of the sequence file and cannot be set from outside except if `now` is set to `true`.
  - `now`, if `true`, set the `changes-stream` property `since` to "now" (instead of 0) on the first start (before `.sequence` has been created)
  - `since` only used, but is required, if you are using a custom backend to save the sequence ids. when you pass a function as sequence.

-  `stream = changes(handle,options)`
    - `stream` , return value is a readable object stream of `data` passed back with `done(err,data)`

- `stream.sequence()`
    - returns current sequence id saved to disk. useful for logging.

- WARNING! `stream.end()`
    - this calls destroy on the changes-stream and the through instead of properly ending them.
    - this triggers a "premature close" error from `changes-stream` and is something that just has to be worked on. bind `error` or use `end-of-stream`

more examples
-------------

save the sequence ids in a database.

```js
var changes = require('concurrent-couch-follower')
var someAction = require(.....)

var dataHandler = function(data, done) {
    someAction(data, function() {
      done()
    })
}

loadSequenceFromDB(function(err,sequence){
  var configOptions = {
    db: 'https://url.to.couchdb/registry/_changes',
    include_docs:true,
    sequence:function(seq,cb){
      saveInDB(seq,cb)
    },
    since:sequence,
    concurrency:5
  }

  changes(dataHandler, configOptions)
})
```

license: ISC

repository: suhaibmujahid/concurrent-couch-follower

repo_name: suhaibmujahid/concurrent-couch-follower


text:
# kotlinx-io benchmarks

The module consists of benchmarks aimed to track performance of kotlinx-io implementation.

Currently, the suite includes benchmarks on:
- the core Buffer API usage: read/write primitive types, arrays, UTF8 strings;
- basic `peek` usage;
- segment pooling performance.

The suite doesn't include benchmarks for more complex APIs inherited from Okio as these APIs are subject to change.
Such benchmarks will be added later along with corresponding changes in the library.

repository: Kotlin/kotlinx-io

gha_language: Kotlin

repo_name: Kotlin/kotlinx-io


text:
# Description
Consider integer numbers from `0` to `n - 1` written down along the circle in such a way that the distance between any two neighbouring numbers is equal (note that `0` and `n - 1` are neighbouring, too).

Given `n` and `firstNumber`, find the number which is written in the radially opposite position to `firstNumber`.

**Example**

For `n = 10` and `firstNumber = 2`, the output should be
`circleOfNumbers(n, firstNumber) = 7`.

![](https://codefightsuserpics.s3.amazonaws.com/tasks/circleOfNumbers/img/example.png?_tm=1490625697098)

**Input/Output**

*   **[time limit] 4000ms (js)**

*   **[input] integer n**

    A positive **even** integer.

    _Guaranteed constraints:_
    `4 ≤ n ≤ 20`.

*   **[input] integer firstNumber**

    _Guaranteed constraints:_
    `0 ≤ firstNumber ≤ n - 1`.

*   **[output] integer**

path: /arcade/intro/30 - circleOfNumbers.md

filename: 30 - circleOfNumbers.md


text:
# XamlRichMenuMaker
XamlRichMenuMaker is a rich menu creation tool for LINE chat bot, which designs rich menus using XAML.

## Visual Studio Extension Tool

This tool has been released as an extension of Visual Studio.

- Visual Studio Marketplace
  https://marketplace.visualstudio.com/items?itemName=pierre3.xrmm100

## Usage

### Creating an XAML Ritch Menu Maker project

- Click [File]>[New]>[Project] in the Visual Studio menu bar, select [LINE Ritch Menu Maker] in the [Create New Project] dialog, and click [Next].

![image001](./images/image001.PNG)

- Enter a project name and click "Create" to create the XAML Ritch Menu Maker project.
- Once the project has been created, go to the menu [Build] > [Build Solution] and run the build only once.

### Setting up a BOT account
Set up a BOT account to use the Rich Menu.

- In Solution Explorer, click on "appsettings.json" to open the edit screen.
- Enter the "Channel Access Token" of the LINE Bot in the `ChannelAccessToken` field.
- In the `DebugUserId` field, enter your own user ID, which can be found in the Other section of the Basic Channel Settings page of LINE Developers under Your user ID (optional).

```json
{
    "AppSettings": {
        "ChannelAccessToken": "+CiR37Hw0xxxxxxxxxxxxxxxxxxxxx",
        "DebugUserId": "U28aa2xxxxxxxxxxxxxxxxxxxxx"
    }
}
```

### Designing a rich menu in the XAML editor

#### Create a rich menu definition file (XAML)

- Right-click on the "RichMenuDefs" folder in Solution Explorer
- In the menu that appears, click [Add] > [New item...]
- Select "LINE Rich Menu Definition (XAML)" in the Add New Item dialog, enter a file name and click "Add".

![image002](./images/image002.PNG)

The following XAML files will be created. Edit this to design a rich menu.

```xml
<local:RichMenuDefsControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:XamlRichMenuMaker;assembly=XamlRichMenuMaker"
             xmlns:system="clr-namespace:System;assembly=System.Runtime"
             mc:Ignorable="d"
             d:DesignHeight="1000 "d:DesignWidth="2600">
    <UserControl.Resources>.
        <system:Double x:Key="RichMenuWidth">2500</system:Double>
        <system:Double x:Key="RichMenuShortHeight">843</system:Double>
        <system:Double x:Key="RichMenuNormalHeight">1686</system:Double>
    </UserControl.Resources>

    <Grid Width="{StaticResource RichMenuWidth}"
                  Height="{StaticResource RichMenuShortHeight}">
        <Grid x:Name="menu_body" Background="LightGray">
            <local:RichMenuProperties.Settings>
                <local:RichMenuSettings Name="" ChatBarText="" Selected="True"/>
            </local:RichMenuProperties.Settings>

            <! -- Design your rich menu layout here.

        </Grid>
    </Grid>
</local:RichMenuDefsControl>

```

#### Setting the Rich Menu

##### Setting the height of the rich menu
The size of the rich menu is specified by the width and height of the outermost grid.
When the file is created, the height of the Short size is specified. If you want to create a large rich menu, change the height to `RichMenuNormalHeight`.

```xml
<Grid Width="{StaticResource RichMenuWidth}"
      Height="{StaticResource RichMenuNormalHeight}">
</Grid>
```

##### Setting the entire rich menu

The grid control tagged `x:Name=menu_body` will be saved as a rich menu image.
Set the following values for this Grid.

- Specify the background color of Grid in the Background property of Grid.
- You can specify various settings of menu registration in attached property RichMenuProperties.
Items to be specified include the following

  - Name: Rich menu name
  - ChatBarText: The text displayed in the menu bar below the LINE chat screen
  - Selected: True if the rich menu is displayed by default.

#### Designing the look of a rich menu
The appearance of the rich menu is designed by placing the controls in the Grid `menu_body`.

From here, we'll use SampleMenu.xml in the RichMenuDefs folder of the project we created as an example.

![image003](./images/image003.PNG)

Define two button areas with Grid, add an icon image with Image control, and set the caption of the button with TextBlock.

```xml
<! -- Create two columns and set the ratio of the width of the first to the second to 2:1 -->
<Grid.ColumnDefinitions>
    <ColumnDefinition Width="2*"/>
    <ColumnDefinition/>
</Grid.ColumnDefinitions>

<! -- image and caption of the first button -->
<Image Source=". /Resources/cat.png"
            VerticalAlignment="Top"
            Margin="0,150,0,0" Width="420" Height="420"/>
<TextBlock Margin="0,0,0,0,80" VerticalAlignment="Bottom"
                HorizontalAlignment="Center"
                FontSize="80">
        Hello! LINE BOT!
</TextBlock>

<! -- image and caption for the second button -->
<Image Grid.Column="1" Source=". /Resources/web.png"
            VerticalAlignment="Top"
            Margin="236.333,180,237,0" Width="360" Height="360"/>
<TextBlock Grid.Column="1" Margin="0,0,0,0,80" VerticalAlignment="Bottom"
                HorizontalAlignment="Center"
                FontSize="80">Web Site
</TextBlock>
```

##### Action area setting
Next, we define an area in the rich menu that acts as a button (= action area). There are two items to define

- Bounds: coordinates of the action area
- Action: The action to be taken when an area is tapped.

Bounds uses the coordinates of the control tagged with x:Name="area_{n}" (where n is a number from 1 to 20).
In the sample example, the Rectangle control is also used to display the boundaries of the buttons, but you can use other controls as well.

Action for tapping an area is defined by setting the attached property RichMenuProperties.Action to the above control.

```xml
<! -- Action Area 1 -->
<Rectangle x:Name="area_1"
        Stroke="DarkGray" StrokeThickness="4">
    <local:RichMenuProperties.Action>
        <local:RichMenuAction Type="Postback" Label="Hello!" Data="Hello!" Text="Hello! LINE BOT!" />
    </local:RichMenuProperties.Action>
</Rectangle>
```

The following four types of actions can be specified

- Postback
- Message
- URI
- Datetimepicker

Please refer to the following for the setting items required for each action.
[Action Object: Messaging API Reference](https://developers.line.biz/ja/reference/messaging-api/#action-objects)

### Creating a rich menu using the Messaging API
Once you're done designing in XAML, you can use the LINE Messaging API to create a rich menu.

Press [Ctrl]+[F5] to run the application.
When the application is launched, the rich menu image designed in XAML and the JSON content sent to the LINE side using the Messaging API will be displayed, as shown below.

![image004](./images/image004.PNG)

Confirm the content and click the "Create Rich Menu" button if it is OK.

#### Checking a created or registered rich menu

When you open the combo box on the right side of the [Create Rich Menu] button, you will see the already registered Rich Menu ID (a string starting with "richmenu-") under the rich menu name (XAML file name) defined in the XAML file.

![image005](./images/image005.PNG)

By selecting these, you can check the contents of the rich menu (image, JSON).

In addition, the following operations are available for the selected rich menu.

- [Set Default Rich Menu]: Set as default rich menu for Bot account
- [Link to User]: associate it with the LINE user for debugging (specified as DebugUserId in appsettings.json)
- [Unlink from User]: Remove the association from the LINE user for debugging
- [Delete Rich Menu]: Delete the rich menu.

gha_language: C#


text:
# Contributing to Workday Credentials

This repository is owned and controlled by [Workday Credentials](https://credentials.workday.com/).

We are not accepting contributions at this time.

repository: workdaycredentials/credwallet

gha_language: Go

repo_name: workdaycredentials/credwallet


text:
---
meta:
  - name: "og:title"
    content: "Changelog - Goyave"
  - name: "twitter:title"
    content: "Changelog - Goyave"
  - name: "title"
    content: "Changelog - Goyave"
---

# Changelog

[[toc]]

## v2.10.x

### v2.10.1

- Changed the behavior of `response.File()` and `response.Download()` to respond with a status 404 if the given file doesn't exist instead of panicking.
- Improved error handling:
    - `log.Panicf` is not used anymore to print panics, removing possible duplicate logs.
    - Added error checks during automatic migrations.
    - `goyave.Start()` now exits the program with the following error codes:
        - `2`: Panic (server already running, error when loading language files, etc)
        - `3`: Configuration is invalid
        - `4`: An error occurred when opening network listener
        - `5`: An error occurred in the HTTP server

This change will require a slightly longer `main` function but offers better flexibility for error handling and multi-services.

``` go
if err := goyave.Start(route.Register); err != nil {
	os.Exit(err.(*goyave.Error).ExitCode)
}
```

- Fixed a bug in `TestSuite`: HTTP client was re-created everytime `getHTTPClient()` was called.
- Fixed testing documentation examples that didn't close http response body.
- Documentation meta improvements.
- Protect JSON requests with `maxUploadSize`.
- The server will now automatically return `413 Payload Too Large` if the request's size exceeds the `maxUploadSize` defined in configuration.
- The request parsing middleware doesn't drain the body anymore, improving native handler compatibility.
- Set a default status handler for all 400 errors.
- Fixed a bug preventing query parameters to be parsed when the request had the `Content-Type: application/json` header.
- Added a dark theme for the documentation. It can be toggled by clicking the moon icon next to the search bar.

### v2.10.0

- Added router `Get`, `Post`, `Put`, `Patch`, `Delete` and `Options` methods to register routes directly without having to specify a method string.
- Added [placeholder](./advanced/localization.html#placeholders) support in regular language lines.

## v2.9.0

- Added [hidden fields](./basics/database.html#hidden-fields).
- Entirely removed Gorilla mux. This change is not breaking: native middleware still work the same.

## v2.8.0

- Added a built-in logging system.
    - Added a middleware for access logs using the Common Log Format or Combined Log Format. This allows custom formatters too.
    - Added three standard loggers: `goyave.Logger`, `goyave.AccessLogger` and `goyave.ErrLogger`
- Fixed bug: the gzip middleware now closes underlying writer on close.

## v2.7.x

### v2.7.1

- Changed MIME type of `js` and `mjs` files to `text/javascript`. This is in accordance with an [IETF draft](https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/) that treats application/javascript as obsolete.
- Improved error handling: stacktrace wasn't relevant on unexpected panic since it was retrieved from the route's request handler therefore not including the real source of the panic. Stacktrace retrieval has been moved to the recovery middleware to fix this.

### v2.7.0

- Added `Request.Request()` accessor to get the raw `*http.Request`.
- Fixed a bug allowing non-core middleware applied to the root router to be executed when the "Not Found" or "Method Not Allowed" routes were matched.
- Fixed a bug making route groups (sub-routers with empty prefix) conflict with their parent router when two routes having the same path but different methods are registered in both routers.
- Added [chained writers](./basics/responses.html#chained-writers).
- Added [gzip compression middleware](./basics/middleware.html#gzip).
- Added the ability to register route-specific middleware in `Router.Static()`.

## v2.6.0

- Custom router implementation. Goyave is not using gorilla/mux anymore. The new router is twice as fast and uses about 3 times less memory.
- Now redirects to configured protocol if request scheme doesn't match.
- Added [named routes](./basics/routing.html#named-routes).
- Added `Route.GetFullURI()` and `Route.BuildURL()` for dynamic URL generation.
- Added `helper.IndexOfStr()` and `helper.ContainsStr()` for better performance when using string slices.
- Moved from GoDoc to [pkg.go.dev](https://pkg.go.dev/github.com/System-Glitch/goyave/v2).
- Print errors to stderr.

## v2.5.0

- Added an [authentication system](./advanced/authentication.html).
- Various optimizations.
- Various documentation improvements.
- Added `dbMaxLifetime` configuration entry.
- Moved from Travis CI to Github Actions.
- Fixed a bug making duplicate log entries on error.
- Fixed a bug preventing language lines containing a dot to be retrieved.
- Fixed `TestSuite.GetJSONBody()` not working with structs and slices.
- Added `TestSuite.ClearDatabaseTables()`.
- Added `Config.Has()` and `Config.Register()` to check for the existence of a config entry and to allow custom config entries valdiation.
- Added `Request.BearerToken()`.
- Added `Response.HandleDatabaseError()` for easier database error handling and shorter controller handlers.

## v2.4.x

### v2.4.3

- Improved string validation by taking grapheme clusters into consideration when calculating length.
- `lang.LoadDefault` now correctly creates a fresh language map and clones the default `en-US` language. This avoids the default language entries to be overridden permanently.

### v2.4.2

- Don't override `Content-Type` header when sending a file if already set.
- Fixed a bug with validation message placeholder `:values`, which was mistakenly using the `:value` placeholder.

### v2.4.1

- Bundle default config and language in executable to avoid needing to deploy `$GOROOT/pkg/mod/github.com/!system-!glitch/goyave/` with the application.

### v2.4.0

- Added [template rendring](./basics/responses.html#response-render).
- Fixed PostgreSQL options not working.
- `TestSuite.Middleware()` now has a more realistic behavior: the finalization step of the request life-cycle is now also executed. This may require your tests to be updated if those check the status code in the response.
- Added [status handlers](./advanced/status-handlers.html).

## v2.3.0

- Added [CORS options](./advanced/cors.html).

## v2.2.x

### v2.2.1

- Added `domain` config entry. This entry is used for url generation, especially for the TLS redirect.
- Don't show port in TLS redirect response if ports are standard (80 for HTTP, 443 for HTTPS).

### v2.2.0

- Added [testing API](./advanced/testing.html).
- Fixed links in documentation.
- Fixed `models` package in template project. (Changed to `model`)
- Added [`database.ClearRegisteredModels`](./basics/database.html#database-clearregisteredmodels)

## v2.1.0

- `filesystem.GetMIMEType` now detects `css`, `js`, `json` and `jsonld` files based on their extension.
- Added maintenance mode.
    - Can be [toggled at runtime](./advanced/multi-services.html#maintenance-mode).
    - The server can be started in maintenance mode using the `maintenance` config option. (Defaults to `false`)
- Added [advanced array validation](./basics/validation.html#validating-arrays), with support for n-dimensional arrays.
- Malformed request messages can now be localized. (`malformed-request` and `malformed-json` entries in `locale.json`)
- Modified the validator to allow [manual validation](./basics/validation.html#manual-validation).

## v2.0.0

- Documentation and README improvements.
- In the configuration:
    - The default value of `dbConnection` has been changed to `none`.
    - The default value of `dbAutoMigrate` has been changed to `false`.
- Added [request data accessors](./basics/requests.html#accessors).
- Some refactoring and package renaming have been done to better respect the Go conventions.
    - The `helpers` package have been renamed to `helper`
- The server now shuts down when it encounters an error during startup.
- New [`validation.GetFieldType`](./basics/validation.html#validation-getfieldtype) function.
- Config and Lang are now protected with a `sync.RWMutex` to avoid data races in multi-threaded environments.
- Greatly improve concurrency.
- Config can now be reloaded manually.
- Added the [`Trim`](./basics/middleware.html#trim) middleware.
- `goyave.Response` now implements `http.ResponseWriter`.
    - All writing functions can now return an error.
- Added the [`NativeHandler`](./basics/routing.html#native-handlers) compatibility layer.
- Fixed a bug preventing the static resources handler to find `index.html` if a directory with a depth of one was requested without a trailing slash.
- Now panics when calling `Start()` while the server is already running.


text:
# Graphql Query Layout

## Graphql Objects

## Query.StockSearch
This is the query command that is used to query all of the Time Series endpoints of the Alpha Vantage API.
### Args
1. Type (NonNull GraphQLString)
This is used as a selector to indicate the Alpha Vantage API endpoint that you wish to query. Supported Types are:
* TIME_SERIES_INTRADAY
* TIME_SERIES_DAILY
* TIME_SERIES_DAILY_ADJUSTED
* TIME_SERIES_WEEKLY
* TIME_SERIES_WEEKLY_ADJUSTED
* TIME_SERIES_MONTHLY
* TIME_SERIES_MONTHLY_ADJUSTED
* "" (Blank used when querying Batch Quotes endpoint)
2. StockSymbol (GraphQLString)
This is the stock that you are wishing to query. Use this in all cases of Query.StockSearch except Batch Quotes
3. Stocks (GraphQLList)
This is the list of stocks you wish to query in a Batch query.
4. Interval (GraphQLString)
This is a string that is used when querying the "TIME_SERIES_INTRADAY" Type. It is used to select the interval that you wish for data points to be spread out. Supported options are:

## Query.StockSearch Objects
### Query.StockSearch.MetaData
This is a object that is devoted to providing metadata to the person querying. Metadata queryable fields are listed below:
* Information: Provides basic information about what the Alpha Vantage API is returning.
* LastRefreshed: Provides the date/time that Alpha Vantage last refreshed that data being returned.
* OutputSize: Provides the option that was selected for the Size of the API output.
* TimeZone: Provides the time zone that time data is being provided.
* Notes: Provides information such as the origin of the realtime quote data.
### Query.StockSearch.TimeSeries
Data container object for Alpha Vantage Time Series API returns.
### Query.TimeSeries.Dates (GraphQLList)
This is an array that provides a list of data objects. They contain a Date key and a Value Key
### Query.TimeSeries.Dates[{Date}] (GraohQLString)
Provides the Date that the given data point is from.
### Query.TimerSeries.Dates[{Value}] (GraohQLObject)
Provides stock data. Fields that are supported include:
* Open: Provides the stocks open price.
* Close: Provides the stocks closing price.
* High: Provides the stocks daily high price.
* Low: Provides the stocks daily low price.
* AdjustedClose: The stocks adjusted close price.
* DividendAmount: The amount of dividend paid on given date.
* SplitCoefficient: The Split Coefficient of the stock.
* Volume: Number of stocks traded on given day.
* Price: The current price of the selected stock.
* Symbol: The symbol of the given stock.
* TimeStamp: The time that this data point was recorded.

## Query.ForeignExchange
This is the query to gather foreign exchange data
### args
(Use 3 letter codes United States Dollar = USD)
* To: The currency that currency is being converted to.
* From: The country that currency is being converted from.
### fields
* FromCurrencyCode: The 3 letter code that the currency is being converted from.
* FromCurrencyName: The name of the currency being converted from.
* ToCurrencyCode:   The 3 letter code that the currency is being converted to.
* ToCurrencyName:   The name of the currency being converted to.
* ExchangeRate: The rate of exchange between the two currencies.
* LastRefreshed: The last time this data was refreshed by Alpha Vantage.
* TimeZone: The time zone that time data is based on.


text:
/*
 * Copyright (c) 2017 ObjectLabs Corporation
 * Distributed under the MIT license - http://opensource.org/licenses/MIT
 *
 * Written with<EMAIL_ADDRESS> * Documentation: https://mongodb.github.io/node-mongodb-native/
 * A Node script connecting to a MongoDB database given a MongoDB Connection URI.
 * https://github.com/mongolab/mongodb-driver-examples/blob/master/nodejs/nodeSimpleExample.js
*/

const mongodb = require('mongodb');

// Create seed data

let seedData = [
  {
    decade: '1970s',
    artist: 'Debby Boone',
    song: 'You Light Up My Life',
    weeksAtOne: 10
  },
  {
    decade: '1980s',
    artist: 'Olivia Newton-John',
    song: 'Physical',
    weeksAtOne: 10
  },
  {
    decade: '1990s',
    artist: 'Mariah Carey',
    song: 'One Sweet Day',
    weeksAtOne: 16
  }
];

// Standard URI format: mongodb://[dbuser:dbpassword@]host:port/dbname

let uri = 'mongodb://user:pass@host:port/dbname';

mongodb.MongoClient.connect(uri, function(err, client) {

  if(err) throw err;

  /*
   * Get the database from the client. Nothing is required to create a
   * new database, it is created automatically when we insert.
   */

  let db = client.db('dbname')

  /*
   * First we'll add a few songs. Nothing is required to create the
   * songs collection; it is created automatically when we insert.
   */

  let songs = db.collection('songs');

   // Note that the insert method can take either an array or a dict.

  songs.insert(seedData, function(err, result) {

    if(err) throw err;

    /*
     * Then we need to give Boyz II Men credit for their contribution
     * to the hit "One Sweet Day".
     */

    songs.update(
      { song: 'One Sweet Day' },
      { $set: { artist: 'Mariah Carey ft. Boyz II Men' } },
      function (err, result) {

        if(err) throw err;

        /*
         * Finally we run a query which returns all the hits that spend 10 or
         * more weeks at number 1.
         */

        songs.find({ weeksAtOne : { $gte: 10 } }).sort({ decade: 1 }).toArray(function (err, docs) {

          if(err) throw err;

          docs.forEach(function (doc) {
            console.log(
              'In the ' + doc['decade'] + ', ' + doc['song'] + ' by ' + doc['artist'] +
              ' topped the charts for ' + doc['weeksAtOne'] + ' straight weeks.'
            );
          });

          // Since this is an example, we'll clean up after ourselves.
          songs.drop(function (err) {
            if(err) throw err;

            // Only close the connection when your app is terminating.
            client.close(function (err) {
              if(err) throw err;
            });
          });
        });
      }
    );
  });
});


text:
# Azure for Students Starter (via Microsoft Imagine)
Some students in certain institutions cannot sign up for Azure for Students without first registering with Microsoft Imagine (this is probably something to do with the way the academic institution identifies the students in their system, but I'm not sure why it happens). You should only follow these instructions if the Azure for Students instructions did not work for you (the only students I've encountered this issue have @ulster.ac.uk addresses, but there could be other students affected in same way).

Thanks to **Richard Ryan** who figured out this workaround (edited slightly):
1. Open an InPrivate or InCognito browser window (to clear your cookies and previous sign-ins)
1. Navigate to [Microsoft Imagine](https://imagine.microsoft.com/en-us/account)
   1. Click on Create a Microsoft Imagine Profile

   ![Account page](./images/pic1.png)

   1.	Follow account setup instructions and ensure to use your university or college account. In the example below, we used an @ulster.ac.uk account to complete the steps. Change the answers to suit your own country/college, these are an example:
        1. Country or Region – **Ireland**
        1. Imagine Compete Country – **Ireland**
        1. Graduation Date – **June 2019**
        1. School Level – **College/Undergrad**
        1. School Name – **Ulster University**

        ![New account page](./images/pic2.png)

   1. Go to [Microsoft Imagine Catalog](https://imagine.microsoft.com/en-us/catalog)
        1. Select **Microsoft Azure for Students Starter**

        ![Azure for Students Starter](./images/pic3.png)

        1. Register for Azure for Students Starter and you should be presented with the Azure Portal
        1. Once at the Azure portal, click the Directory + Subscription button on the top right of the screen and check Azure for Student Starter is listed
    1. Open a new tab [Azure for Students](https://azure.microsoft.com/en-ie/free/students/) and Click **Activate Now**

On returning to the Azure Portal dashboard you should see two subscriptions now (ensure you're using Azure for Students, not Azure for Students Starter, as the former comes with credits you can spend on advancecd features).

![Subscriptions](./images/pic4.png)


text:
---
layout: page
title: "Gruber’s Apple Watch Series 3 Review"
subheadline: ""
teaser: ""
author: Morgan
categories:
  - apple
image:
    title:
    homepage:
    thumb:
    caption:
    caption_url:
breadcrumb: true
---

> With the addition of cellular networking in Series 3, Apple Watch gains something essential: independence. It’s not just a cool feature. It’s aimed smack dab in the middle of the two things people like best about Apple Watch: notifications and fitness. When are you separated from your iPhone? When you’re exercising. What do you miss most when you’re away from your phone? Messages and phone calls.

Phone anxiety is a weird, and, for me at least, irrational thing. I know that mankind survived for millennia without the ability to communicate with each other out of earshot. But once you get used to having your phone with you at all times, you get used to feeling that if anyone needs you, they can get you.

Apple Watch Series 3 with cellular networking completely alleviates this anxiety.

I was waffling between getting the cellular or non-cellular version of Series 3. Now I’m convinced - it’s gotta be cellular.

[[via Daring Fireball](https://daringfireball.net/2017/09/apple_watch_series_3)]

---

Typed on Git2Go


text:
Discourse Mobile
---

Native iOS and Android app for Discourse

### Getting Started

```
npm init

// https://facebook.github.io/react-native/docs/getting-started.html
react-native run-ios
react-native run-android
```

### Using Storybook

In two separate terminals:

```
npm run storybook-ios
react-native run-ios
```

and then `open http://localhost:7007`

repository: technicallyrite/DiscourseMobile

repo_name: technicallyrite/DiscourseMobile


text:
# timecamp-scripts
Automatize the working hours in Timecamp

## Instructions for `default.js`

1. Add your API KEY from Timecamp.
2. Add the TASK ID in which you want to apply.
3. Add the js code in a bookmark ([Bookmarklet](https://en.wikipedia.org/wiki/Bookmarklet)), and then open it in a new tab.
4. Timecamp website should load, click again the bookmark and follow instrucctions.

If you want to set a normal workday from 9 to 13 and 14 to 18, just press "OK.
If not, type NO and fill the required information.

## Instructions for `default.py`

1. Create a .env file in the top directory containing:
```
API_TOKEN = "here your api token"
TASK_JORNADA_LABORAL = "here the task id"
```
2. Install the requirements
```
pip install -r requirements.txt
```
3. Execute the script for the initial and end dates to submit (both included). This will create a 4h task in the
   morining plus 4h in the afternoon. Example:
```
python default.py 2021-02-08 2021-02-12
```

repository: thoyo/timecamp-scripts

repo_name: thoyo/timecamp-scripts


text:
## How to migrate AWS Lambda Functions between AWS accounts
### Export the Lambda Function deployment package .zip file
1. Sign in with the source AWS account
1. Enter Lambda Function Admin UI: Services > Lambda Function
1. Export the Lambda Function deployment package zip file: Services > Lamda Function > Actions > Export function > Download deployment package

### Import the Lambda Function deployment package .zip file
1. Sign in with the destination AWS account
1. Enter Lambda Function Admin UI: Services > Lambda Function
1. Create a Lambda Function: Create function
1. Create API Gateway with REST API and Open with API key): Lambda > Functions > pedestrain-counter > Desinger > Add trigger > API Gateway
1. Upload Function package zip file: Lambda > Functions > pedestrain-counter > Function code > Code entry type > Upload a .zip file

repository: CityofEdmonton/pedestrian-counter

repo_name: CityofEdmonton/pedestrian-counter


text:
###

# [Progressive Web Application](http://gokulkrishh.github.io/demo-progressive-web-app/)

*A demo for progressive web application with features like offline, push notifications, background sync etc,*

### [Live](http://gokulkrishh.github.io/demo-progressive-web-app/)

### Installation

#### `Step 1` - clone the repo

```bash
$ git clone https://github.com/gokulkrishh/demo-progressive-web-app
```

#### `Step 2` - cd in the repo

```bash
$ cd demo-progressive-web-app
```

#### `Step 3` - install dependencies

```bash
$ npm install
```

#### `Step 4` - run application

```bash
$ npm run start
```

In browser, open [http://localhost:3000](http://localhost:3000)

## Main Features

- [x] - App Shell Architecture

- [x] - Service Worker + [Navigation Preload](https://mattto.github.io/sw/demo/navigation-preload/) ([Origin Trial](https://docs.google.com/forms/d/e/1FAIpQLSfO0_ptFl8r8G0UFhT0xhV17eabG-erUWBDiKSRDTqEZ_9ULQ/viewform?fbzx=-8349956695398695000))

- [x] - Add to Home Screen, Splash Screen, Browser Mode, Notify user if site is updated etc,

- [x] - Offline Support

- [x] - Online/Offline Events

- [x] - Fetch API

- [x] - Push Notifications

- [x] - Background Sync

- [x] - Web Share API

### Get started with PWA Development

- [Codelabs](https://pwa.tips/codelabs)

### List of Progressive Web Apps

- [PWA Rocks](https://pwa.rocks)

### References

- [Google Developer Site](https://developers.google.com/web/progressive-web-apps)

- [Web Share API](https://developers.google.com/web/updates/2016/10/navigator-share)

- [Navigation Preload](https://developers.google.com/web/updates/2017/02/navigation-preload)

#### License

MIT © [Gokulakrishnan](https://github.com/gokulkrishh)

  If you found a bug or some improvments, feel free to raise an issue and send a PR!

"# ehrazhasan.github.io"

gha_language: PHP


text:
## Next
* follow the tutorial, learn how to debug and program in JavaScript

## http-server on Windows
* install Node.js
* npm install http-server -g

## OpenGL / WebGL
* Remember, inside the vertexShader, the 3D paint math has to be model -> view -> projection from going from right to the left.
* above means:     gl_Position = projection * view * model * vec4(position, 1.0f);

## Phone Lighting
* Ambient
* Diffuse
* Specular

## XMLHttpRequest
* The XMLHttpRequest object is used to exchange data with a server behind the scenes.

### With XMLHttpRequest, you can:
* Update a web page without reloading the page
* Request data from a server after the page has loaded
* Receive data from a server after the page has loaded
* Send data to a server in the background

## Bower
* Bower can manage components that contain HTML, CSS, JavaScript, fonts or even image files.
* $ npm install -g bower
* inside destination folder, Git Bash:  $ bower install async

## Windows PowerShell (http-server.cmd)
is a shell developed by Microsoft for purposes of task automation and configuration management. This powerful shell is based on the .NET framework and it includes a command-line shell and a scripting language.

## Windows PowerShell ISE
ISE stands for Integrated Scripting Environment, and it is a graphical user interface that allows you to easily create different scripts without having to type all the commands in the command line.

## JavaScript
* JavaScript is immediatly loaded as soon as the browser sees it.
* Could be put inside <body> tag, it's immediatly executed
* So that the js could be loaded after the canvas element.
* If putting the js inside <head> tag, there won't be any guarantee which one is called first.
* Everything is 64bit floating point precision, whereas opengl expects 32bit

repository: SenonLi/SenWebGL

repo_name: SenonLi/SenWebGL


text:
# GoodyTwoSpoons by Gatsby + Netlify

[![Netlify Status](https://api.netlify.com/api/v1/badges/b654c94e-08a6-4b79-b443-7837581b1d8d/deploy-status)](https://app.netlify.com/sites/gatsby-starter-netlify-cms-ci/deploys)

**Note:** This site uses a starter that uses [Gatsby v2](https://www.gatsbyjs.org/blog/2018-09-17-gatsby-v2/).

It follows the [JAMstack architecture](https://jamstack.org) by using Git as a single source of truth, and [Netlify](https://www.netlify.com) for continuous deployment, and CDN distribution.

## Features

- A simple landing page with blog functionality built with Netlify CMS
- Blazing fast loading times thanks to pre-rendered HTML and automatic chunk loading of JS files
- Uses `gatsby-image`
- Separate components for everything
- Netlify deploy configuration
- Netlify function support, see `lambda` folder
- Perfect score on Lighthouse for SEO, Accessibility and Performance (wip:PWA)
- ..and more

## Prerequisites

- Node (I recommend using v12.13.0 or higher)
- [Gatsby CLI](https://www.gatsbyjs.org/docs/)
- [Netlify CLI](https://github.com/netlify/cli)

### Access Locally

Pulldown a local copy of the Github repository

```
$ git clone https://github.com/[GITHUB_USERNAME]/[REPO_NAME].git
$ cd [REPO_NAME]
$ npm
$ npm start
```

This uses the new [Netlify Dev](https://www.netlify.com/products/dev/?utm_source=blog&utm_medium=netlifycms&utm_campaign=devex) CLI feature to serve any functions you have in the `lambda` folder.

## Getting Started (Without Netlify)

```
$ gatsby new [SITE_DIRECTORY_NAME] https://github.com/netlify-templates/gatsby-starter-netlify-cms/
$ cd [SITE_DIRECTORY_NAME]
$ npm run build
$ npm run serve
```

repository: lockhartmb/goodytwospoons-gatsby

repo_name: lockhartmb/goodytwospoons-gatsby


text:
[![pipeline status](https://gitlab.com/viniarck/podcaststore-flask/badges/master/pipeline.svg)](https://gitlab.com/viniarck/podcaststore-flask/commits/master)

# podcaststore-flask

This is a back-end API written in Python with Flask and sqlalchemy to allow users to access a podcast store. In this podcast store, there are podcasts, tracks, users, tags, and users should be able to express a reaction to any track. This back-end is not completed yet, but it was reimplemented in Flask to be compared with [podcaststore-django](https://www.github.com/viniarck/podcaststore-django).

### Database UML diagram

Based on the [API and back-end requirements](./docs/api_requirements.md), the following UML relational diagram will be implemented:

![uml](./docs/schema.png)

repository: viniarck/podcaststore-flask

repo_name: viniarck/podcaststore-flask


text:
# Node Sandbox

> A good place to start out if you'd like to quickly experiment with features

### Getting Started

Simply clone down the repository, then run the npm install command.

* Clone the repository
* Navigate the the directory
* Run `npm install` in the directory

### Running the tests

Use the `npm test` command on the terminal to run tests


text:
# Ninjara Bot (Python version)

Telegram bot which retrieves allows you to check user's timeline, post to user's timeline, search tweets with given query, check friends of user

#### Why bot is called Ninjara? :)

Ninjara is a character from **ARMS**. He is an expert in ninja fighting style. He is known as the "Student of Stealth."
And he is ***cool*** guy

## Getting started

Clone the repository to your local machine and set enviroment variable **NINJARA_TELEGRAMTOKEN** to your actual bot's token that you can get from [@BotFather](t.me/BotFather) using **/newbot** command

## Built with

* [Telegram](https://telegram.org/)
* [Telegram API](https://core.telegram.org/bots/api)
* [Telegram Bot Python Library](https://github.com/python-telegram-bot/python-telegram-bot)
* [Tweepy](http://www.tweepy.org/)

## Author

Bot created by Aleksandr Logvinenko as a exam project in Python (ICS0015 course)

## License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/Oxxyg33n/NinjaraBot/blob/master/LICENSE) file for details


text:
# employee-tracker

Created an app that employees can be entered and updated through the command line. These entries are stored in a mysql database and can also be viewed.

https://drive.google.com/file/d/1OHTJso2MIQBfYu-h_P4oSAxOe6zfGuTj/view


text:
## Function: SB-DEBUG:PRINT-BACKTRACE
[![package](https://img.shields.io/badge/Package-SB--DEBUG-5f9ea0.svg?style=social&colorA=999999)](../) [![type](https://img.shields.io/badge/Type-Function-5f9ea0.svg?style=social&colorA=999999)](../#function) [![github](https://img.shields.io/badge/GitHub-View_the_source-5f9ea0.svg?style=social&colorA=999999&logo=github)](https://github.com/sbcl/sbcl/blob/master/src/code/debug.lisp/)

> Print a listing of the call stack to STREAM, defaulting to *DEBUG-IO*.
>
> COUNT is the number of frames to backtrace, defaulting to
> *BACKTRACE-FRAME-COUNT*.
>
> START is the number of the frame the backtrace should start from.
>
> FROM specifies the frame relative to which the frames are numbered. Possible
> values are an explicit SB-DI:FRAME object, and the
> keywords :CURRENT-FRAME, :INTERRUPTED-FRAME, and :DEBUGGER-FRAME. Default
> is :DEBUGGER-FRAME.
>
> :CURRENT-FRAME
> specifies the caller of PRINT-BACKTRACE.
>
> :INTERRUPTED-FRAME
> specifies the first interrupted frame on the stack (typically the frame
> where the error occured, as opposed to error handling frames) if any,
> otherwise behaving as :CURRENT-FRAME.
>
> :DEBUGGER-FRAME
> specifies the currently debugged frame when inside the debugger, and
> behaves as :INTERRUPTED-FRAME outside the debugger.
>
> If PRINT-THREAD is true (default), backtrace is preceded by printing the
> thread object the backtrace is from.
>
> If PRINT-FRAME-SOURCE is true (default is false), each frame is followed by
> printing the currently executing source form in the function responsible for
> that frame, when available. Requires the function to have been compiled at
> DEBUG 2 or higher. If PRINT-FRAME-SOURCE is :ALWAYS, it also reports "no
> source available" for frames for which were compiled at lower debug settings.
>
> METHOD-FRAME-STYLE (defaulting to *METHOD-FRAME-STYLE*), determines how frames
> corresponding to method functions are printed. Possible values
> are :MINIMAL, :NORMAL, and :FULL. See *METHOD-FRAME-STYLE* for more
> information.
>
> If EMERGENCY-BEST-EFFORT is true then try to print as much information as
> possible while navigating and ignoring possible errors.

### Lambda list
```cl
(&key stream sb-debug::start sb-debug::from count sb-debug::print-thread
 sb-debug::print-frame-source sb-debug::method-frame-style sb-debug::emergency-best-effort)
```

repository: Chemophile/sb-docs

repo_name: Chemophile/sb-docs


text:
# Cronartium harknessii E. Meinecke, 1920 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Phytopathology 10: 282 (1920)

#### Original name
Cronartium harknessii E. Meinecke, 1920

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Pucciniomycetes/Pucciniales/Cronartiaceae/Endocronartium/Endocronartium harknessii/ Syn. Cronartium harknessii/README.md

repo_name: mdoering/backbone


text:
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/PainsGames/ComputerCraftMiner)

# ComputerCraftMiner
Repo for Computer Craft miners.

# Quick install for Computers
```wget https://raw.githubusercontent.com/PainsGames/ComputerCraftMiner/main/src/update.lua update.lua```

repository: PainsGames/ComputerCraftMiner

repo_name: PainsGames/ComputerCraftMiner


text:
# Hashtables

Implement a Hashtable Class with the following methods:

## Challenge

In computing, a hash table (hash map) is a data structure that implements an associative array abstract data type, a structure that can map keys to values. A hash table uses a hash function to compute an index, also called a hash code, into an array of buckets or slots, from which the desired value can be found.

## Approach & Efficiency

add:
BigO = O(n)

get:
BigO = O(n)

contains:
BigO = O(n)

hash:
BigO = O(1)

## API

add
Arguments: key, value
Returns: nothing
This method should hash the key, and add the key and value pair to the table, handling collisions as needed.
get
Arguments: key
Returns: Value associated with that key in the table
contains
Arguments: key
Returns: Boolean, indicating if the key exists in the table already.
hash
Arguments: key
Returns: Index in the collection for that key


text:
# Attachments journal file

## Structure

The attachments journal file contains data on the following format:

        attachment;id

## Example file

```
10015;2231232
10015-thumb;2231233
```

repository: cris-b/jira-azuredevops-migrator

repo_name: cris-b/jira-azuredevops-migrator


text:
php-javascript-constants
========================

A simple tool for porting PHP constant classes to javascript constant objects

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

### As a dependency

Run `composer require pamiris/javascript-constants`

-- or --

Add the following line to your composer.json:

```json
{
  "require": {
    "pamiris/javascript-constants": "*"
  }
}
```

Usage
------------------
To get the executable javascript to define the object, pass the classname and an optional target name into the tool; then include the resulting js inside a script tag on your template:

```php
<?php
//src/myprocject/controller.php

...
use Pamiris\JavascriptConstants\Mapper as ConstantMapper;

...
function someAction()
{
  $jsConstants = ConstantMapper::getJavascriptObject('MyNamespace\MyClass');
  $this->renderTemplate('mypage',[
    ...
    'scriptContent' => $jsConstants
  ]);
```

```twig
{# /myproject/page.html.twig #}
{% extends base.html.twig %}
{% block javascripts %}

<script>{{ scriptContent | raw }}</script>
{% endblock %}
```

TODO
-------------------
Add Twig extension and bundle to auto-configure.

Notes
-------------------
This requires ES2015, which is supported in [most broswers](http://caniuse.com/#search=const). Safari will let you overwrite the objects, Chrome and Firefox will not.

License
--------------------
PHP JavascriptConstants is licensed under the MIT License - see the LICENSE file for details.

repository: pamiris/php-javascript-constants

repo_name: pamiris/php-javascript-constants


text:
# ThanatosDecryptor

ThanatosDecryptor is an executable program that attempts to decrypt certain files encrypted by the Thanatos malware.

File types currently supported include:
+ Image: .gif, .tif, .tiff, .jpg, .jpeg, .png
+ Video: .mpg, .mpeg, .mp4, .avi
+ Audio: .wav
+ Document: .doc, .docx, .xls, .xlsx, .ppt, .pptx, .pdf, .odt, .ods, .odp, .rtf
+ Other: .zip, .7z, .vmdk, .psd, .lnk

In order to decrypt files as quickly as possible, ThanatosDecryptor should be run on the original machine infected with the malware, and against the original .THANATOS files that it created.

ThanatosDecryptor has been tested against versions 1 and 1.1 of the malware.  Known malware sample hashes include:

55aa55229ea26121048b8c5f63a8b6921f134d425fba1eabd754281ca6466b70
97d4145285c80d757229228d13897820d0dc79ab7aa3624f40310098c167ae7e
8df0cb230eeb16ffa70c984ece6b7445a5e2287a55d24e72796e63d96fc5d401
bad7b8d2086ac934c01d3d59af4d70450b0c08a24bc384ec61f40e25b7fbfeb5
02b9e3f24c84fdb8ab67985400056e436b18e5f946549ef534a364dff4a84085
fe1eafb8e31a84c14ad5638d5fd15ab18505efe4f1becaa36eb0c1d75cd1d5a9

## Thanatos Overview

When run, the Thanatos malware looks for files recursively in the following directories:

+ Desktop
+ Documents
+ Downloads
+ Favourites
+ Music
+ OneDrive
+ Pictures
+ Videos

For each file found, the malware derives an encryption key from the number of milliseconds that the infected computer has been running (via a call to [GetTickCount](https://msdn.microsoft.com/en-us/library/windows/desktop/ms724408%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396)), encrypts the file using 256-bit AES encryption, and then discards the encryption key.

It would be practically impossible to brute-force guess the 256-bit AES encryption key directly, but since the malware derives this key from the system uptime (a 32-bit value) the key is effectively 32-bits in length.  On the virtual machine that I tested on, around 100,000 key derivations and AES decryption operations (on one AES block worth of data, needed for decryption success verification) could be performed every second, meaning in the worst case it would take around 12 hours to successfully guess the key *if the system uptime value was random*.  The system uptime is not random, though.  The maximum number of milliseconds you can store in a 32-bit value comes out to be 49.7 days worth, and many people tend to shutdown or hibernate their computers before then (or let them sleep from time to time).  Thus, the system uptime at time of infection is likely to be a fairly low value - starting at 0 and guessing your way up is a decent approach.

A further optimization is enabled by the fact that the system uptime is written to the Windows Event Logs around once per day.  Also, the malware does not modify the .THANATOS file creation dates, so with this information the search space can be reduced to approx. the number of milliseconds within the 24 hours before infection.  At 100k attempts per second, it would take around 14 minutes to guess the key under these conditions.

## ThanatosDecryptor Operation

When run, ThanatosDecryptor first searches the directories listed above for files with the .THANATOS file extension.  Once found, the original file extension (which is preserved by the malware in the file name write before .THANATOS) is compared with the list of file types supported by ThanatosDecryptor.  If the file type is one supported, the file gets queued for decryption.

ThanatosDecryptor also parses the Windows Event Log for the daily uptime messages and uses the encrypted file time metadata to determine a starting value for decryption.  This value is used to derive an encryption key, an AES decryption operation is done against the file contents, and the resulting byte are compared against values known to be at the beginning of those file types.  If the comparison is unsuccessful, increments the seed and tries this process again.  Otherwise, the file is decrypted and written out with the original file name.

Finally, once one file has been successfully encrypted, ThanatosDecryptor uses the SEED value from that decryption attempt as a starting point for decryption attempts against follow-on files (since they are all likely to be very similar).

# Running the Program

Download the latest ThanatosDecryptor.exe file from the Release directory and run it on the infected system as the user that had his/her files encrypted.

# Building

Visual Studios is required for building.  Visual Studio 2017 Community Edition works for me!

To build ThanatosDecryptor from source, clone this repo, cd into the ThanatosDecryptor directory, and from the 'Developer Command Prompt for VS 2017' that ships with Visual Studio 2017, run the following command:

```
msbuild ThanatosDecryptor.vcxproj /p:Configuration=Release /p:Platform=Win32
```

It's easiest to find the Developer Command Prompt using the Windows Start Menu search box.

## Example Output
```
Found the following files able to be decrypted:
C:\Users\zelda\Desktop\testfiles\test.7z.THANATOS
C:\Users\zelda\Desktop\testfiles\Test.doc.THANATOS
C:\Users\zelda\Desktop\testfiles\Test.docx.THANATOS
C:\Users\zelda\Desktop\testfiles\test.gif.lnk.THANATOS
[...]
C:\Users\zelda\Desktop\testfiles\test.xlsx.THANATOS
C:\Users\zelda\Desktop\testfiles\test.zip.THANATOS

Beginning decryption attempt
Attempting to decrypt C:\Users\zelda\Desktop\testfiles\test.7z.THANATOS

Tried 393288 seed values thus far
Successful decryption verification!  Seed: 516031
Successfully wrote decrypted file to: C:\Users\zelda\Desktop\testfiles\test.7z
Attempting to decrypt C:\Users\zelda\Desktop\testfiles\Test.doc.THANATOS
Overriding calculated SEED value for previously successful SEED value (minus 60 secs): 516031

Tried 8257 seed values thus far
Successful decryption verification!  Seed: 516031
Successfully wrote decrypted file to: C:\Users\zelda\Desktop\testfiles\Test.doc
Attempting to decrypt C:\Users\zelda\Desktop\testfiles\Test.docx.THANATOS
Overriding calculated SEED value for previously successful SEED value (minus 60 secs): 516031

Tried 8257 seed values thus far
Successful decryption verification!  Seed: 516031
Successfully wrote decrypted file to: C:\Users\zelda\Desktop\testfiles\Test.docx
Attempting to decrypt C:\Users\zelda\Desktop\testfiles\test.gif.lnk.THANATOS
Overriding calculated SEED value for previously successful SEED value (minus 60 secs): 516031

Tried 8257 seed values thus far
Successful decryption verification!  Seed: 516046
Successfully wrote decrypted file to: C:\Users\zelda\Desktop\testfiles\test.gif.lnk
Attempting to decrypt C:\Users\zelda\Desktop\testfiles\test.gif.THANATOS
Overriding calculated SEED value for previously successful SEED value (minus 60 secs): 516046

[...]

Attempting to decrypt C:\Users\zelda\Desktop\testfiles\test.xlsx.THANATOS
Overriding calculated SEED value for previously successful SEED value (minus 60 secs): 516062

Tried 8226 seed values thus far
Successful decryption verification!  Seed: 8ca3e
Successfully wrote decrypted file to: C:\Users\zelda\Desktop\testfiles\test.xlsx
Attempting to decrypt C:\Users\zelda\Desktop\testfiles\test.zip.THANATOS
Overriding calculated SEED value for previously successful SEED value (minus 60 secs): 516062

Tried 8226 seed values thus far
Successful decryption verification!  Seed: 8ca3e
Successfully wrote decrypted file to: C:\Users\zelda\Desktop\testfiles\test.zip
Press any key to exit
```

Note how some files were encrypted using the same Seed value - according to the GetTickCount man page, the uptime has a resolution of between 10ms and 16ms, which means that it can take between 10-16 ms for another call to GetTickCount to return a different value.

## TODO

This program could be improved in the following ways:
+ Add support for more file types
+ Make the program multi-threaded
+ Add a mode that allows the user to supply the SEED to use for decrypting arbitrary files
+ Using file timestamps we can reconstruct the order in which '.THANATOS' files were created.  This means that for an unsupported file existing between two supported file types that share a Seed value, we can assume that Seed was also used for the unsupported file and decrypt with that (and bypass decryption verification).

repository: BinaryReaper/ThanatosDecryptor

repo_name: BinaryReaper/ThanatosDecryptor