text:
# tCrypt2Go – DIY Your Own Easy-to-Use Encrypted Portable Disk Based on TrueCrypt
Named after TrueCrypt and 'BitLocker To Go', tCrypt2Go – a set of cross-platform lock-and-unlock utilities on top of TrueCrypt to DIY your own encrypted USB thumb drive or hard disk which functions like a purchased encrypted external storage solution in the market – simplifies the user experience of TrueCrypt Portable on removable media/external hard disks by hiding the complexities of TrueCrypt and its options from users, making it easy to lock and unlock an encrypted USB thumb drive or hard disk with as few steps as possible.

With this set of tools, anyone can turn any existing unsecured USB stick or hard disk into one that is more secure, as well as using it with ease and convenience.

**Looking for VeraCrypt?** vCrypt2Go based on VeraCrypt is at https://github.com/wandersick/vcrypt2go/

---

## Introduction

Are you a security-aware person? Have you got a USB thumb drive or external hard drive you wish to use that does not have any built-in encryption features? You could turn it into one that does, with the cross-platform open-source alternative to BitLocker – TrueCrypt (succeeded by VeraCrypt) – but it is not as easy or intuitive to unlock or use as a purchased encrypted external storage solution in the market, because of its feature-rich nature; unlocking is done via an advanced user interface that is more meant for the technically inclined.

## Solution – tCrypt2Go & vCrypt2Go to Simplify and Speed Up Drive Unlocking

 ![](https://lh3.googleusercontent.com/-C6as-jneCKk/WpMFQ-I1zvI/AAAAAAAAB0A/u32KleYXfM0B2ZGY9R-wXRbrViLRaXLxgCHMYCw/s1600/image4)

Named after TrueCrypt and 'BitLocker To Go', tCrypt2Go – a set of open-source and cross-platform lock-and-unlock utilities on top of TrueCrypt enabling users to DIY their own encrypted portable storage which is simple to use as a purchased solution in the market – simplifies the user experience of TrueCrypt Portable on removable media/external hard disks by hiding the complexities of TrueCrypt and its options from users, making it easy to lock and unlock an encrypted USB thumb drive or hard disk with as few steps as possible.

(Likewise, the same applies for the successor of TrueCrypt – VeraCrypt – after which vCrypt2Go is named.)

## List of Features

- Optimize use of portable drives encrypted by TrueCrypt and VeraCrypt
- Easily unlock and lock portable drives with a simplified process, hiding complexities from users
  - To unlock, double-click 'unlock', enter password in a simple user interface, then the unlocked drive is presented to the user; to lock, double-click 'lock', no further action required
  - Easily identify executable icons which look like a lock (unlocked or locked)
- A set of step-by-step installation guides available for encrypting different types of portable drives
- Supports both encrypted partitions and containers (virtual disk files)
- Handles different scenarios – admin or standard user account; with or without TrueCrypt/VeraCrypt preinstalled
- Portable and cross-platform – Windows and Mac OS X (beta)
- Automatic User Account Control elevation to highest privileges available on Windows Vista and later

(Refer to [Technical Overview](https://tech.wandersick.com/2018/02/technical-overview-how-tcrypt2go-and.html) article for limitations.)

## Seeing It in Action

 ![](https://lh3.googleusercontent.com/-jTsk97Y31dM/WpMFT-h-s4I/AAAAAAAAB0I/rtql9AL-joIE7dI0t1Xz351V7iN-lFQLQCHMYCw/s1600/tcrypt2go-vcrypt2go-demo7)

As demonstrated, the goal of tCrypt2Go/vCrypt2Go is to make it seamless and convenient for users to secure and use their portable drive with the provided set of lock-and-unlock utilities. There will be no dialog shown to users other than entering the password for unlocking the protected area (which is a virtual disk file, or container, in the case of a USB thumb drive of removable media type as demonstrated below, or a partition in the case of an external hard disk of a fixed disk type). It works on Windows (stable) and Mac (beta) depending on which file system is chosen (FAT32, NTFS, exFAT) for formatting the protected partition. (For further details, read the Technical Overview article.)

## Requirements

- Hardware: Any unused portable storage (e.g. USB thumb drives, memory cards, external hard disks…)
- Operating System: Any Windows and Mac operating systems supported by TrueCrypt and VeraCrypt, including Windows XP and later, Mac OS 10.6.5 (10.7 for VeraCrypt) and later
  - tCrypt2Go and vCrypt2Go on Windows are stable, but for Mac OS X they are currently in beta as they have yet to be tested in newer OS X versions

## Getting Started

If you are a user who has been offered a USB drive with tCrypt2Go or vCrypt2Go utilities, read the User Guide below to understand how to use it. Put simply, double-click 'unlock', enter password, done; to lock, double-click 'lock', done.

If you are looking for how to set up a drive for use with tCrypt2Go or vCrypt2Go, read ones of the Installation Guides below. There are two options depending on whether you have a  **thumb drive**  or a  **hard disk**.

 ![](https://lh3.googleusercontent.com/-l4r0vdMMGpM/WpMFW9NZYYI/AAAAAAAAB0Q/b6mD3frOOgYkKUu27hMRMKl5QlbmlTfVACHMYCw/s1600/image5)

To learn more about the technical details behind, read the Technical Overview article. Otherwise, feel free to skip to the Installation Guides to implement immediately.

## List of Articles on tCrypt2Go/vCrypt2Go

- **\*You Are Here\***  Introducing tCrypt2Go and vCrypt2Go – Lock-and-Unlock Utilities for TrueCrypt and VeraCrypt Portable
- [Technical Overview – How tCrypt2Go and vCrypt2Go work](https://tech.wandersick.com/2018/02/technical-overview-how-tcrypt2go-and.html)
- [Installation Guide – Setting up tCrypt2Go and vCrypt2Go to Encrypt Portable ](https://tech.wandersick.com/2018/02/installation-guide-setting-up-tcrypt2go_26.html)[**Hard Disks**](https://tech.wandersick.com/2018/02/installation-guide-setting-up-tcrypt2go_26.html)
- [Installation Guide – Setting up tCrypt2Go and vCrypt2Go to Encrypt USB ](https://tech.wandersick.com/2018/02/installation-guide-setting-up-tcrypt2go.html)[**Thumb Drives**](https://tech.wandersick.com/2018/02/installation-guide-setting-up-tcrypt2go.html)
- [User Guide – How to Unlock and Lock Encrypted Drives using tCrypt2Go or vCrypt2Go](https://tech.wandersick.com/2018/02/user-guide-how-to-unlock-and-lock.html)
- [Enhancing and Troubleshooting Common Issues with tCrypt2Go or vCrypt2Go](https://tech.wandersick.com/2018/02/enhancing-and-troubleshooting-common.html)

## Release History

| Ver | Date | Update Description |
| --- | --- | --- |
| 2.1 | 20180302 | Corrected 64-bit executables to 32-bit for better compatibility |
| 2.0 | 20180225 | Added support for VeraCrypt. Change UAC elevation to HighestAvailable. First public release (Mac support is beta) |
| 1.8 | 20130809 | Improved error messages |
| 1.7 | 20130624 | Fixed a use for standard users under XP while TrueCrypt driver is installed - a bug introduced by new code |
| 1.6 | 20130509 | Added more meaningful error messages |
| 1.5 | 20130320 | Fixed an issue for non-admin users where TrueCrypt device driver is installed and UAC is enabled, a UAC prompt would be triggered but users cannot authenticate as they are not admins. They are now redirected to TrueCrypt installation prompt |
| 1.4 | 20130118 | Improved Mac and Windows executables. Checks for admin right and whether TrueCrypt is installed. Prompts user for TrueCrypt setup if required |
| 1.3 | 20130117 | Added hidden file support of Mac OS X |
| 1.2 | 20121211 | New version which uses AutoHotkey (for Windows) |
| 1.1  | 20121105 | Adds Mac OS X support using AppleScript and shell script |
| 1.0  | 20121105 | First private release using Windows batch script |


text:
## WhatToPack

An Android app that recommends clothing to pack for each day of travel based on location and weather factors like temperature, humidity, and precipitation.

#### By _**Mick Sexton**_

### Description

Users can input their travel destination along with dates. These dates should be within the forecastable future. WhatToPack will create a list for each day of what the user should wear based on local weather conditions.

## Prerequisites

You will need the following things properly installed on your computer.

* [Git](https://git-scm.com/)
* Android Studio
* working Android emulator (or device)

## Installation

* Download app from GitHub repo: https://github.com/PioneerX1/whattopack
* Open with Android Studio
* Run app on an emulator or Android device

## Code Specs

|Behavior - Plain English|Input|Output|
|---|---|---|
|User sees a login screen.|User inputs correct email and password for login.|User sees the main activity inviting them to view Github account or proceed for forecast.|
|User sees a register account view.|User inputs their info and taps button to create an account.|User's account is created and they are immediately logged into the main activity.|
|User sees main activity, sees home view stating purpose of WhatToPack.|User taps button Lets Go Already to get started.|User sees Location view, where they input a location, or get ideas for places to go.|
|User sees location view.|User inputs a location like Paris or Alaska and taps Where button.|User then sees the purpose view, asking for their purpose of travel - business, casual, outdoor activity.|
|User sees purpose view.|User selects their purpose and taps the button.|User sees a summary of their input on the results view as well as a 17-day forecast with weather conditions and recommendations of what to wear.|
|User sees the results view.|User taps the Save Trip button.|User's location and trip purpose have been saved for later access.|
|User sees location view.|User taps Need Ideas? button.|User sees the ideas view with a list of possible places and activities.|
|User sees location view.|User taps My Saved Trips button.|User sees a list of trips they have saved.|

## Known Bugs

_No known bugs or issues at this time._

## Support and contact details

_Please contact Mick Sexton at<EMAIL_ADDRESS>for any questions, feedback, or concerns._

## Technologies Used

_Technologies used include Java, Android Studio, XML, and Git_

### License

*This software operates under the MIT license.*

Copyright (c) 2017 **_Mick Sexton_**

##### Internal Developer Notes #####

    Before Day 2:
    - Look into Date picker fragment for Android XML
    - Test DarkSky and AccuWeather with Postman

    Day 1:
    https://github.com/PioneerX1/whattopack.git

    1. Welcome - WhatToPack helps travelers plan for local weather conditions and pack accordingly
    2. What’s your Destination?
    3. What dates will you be there?
    4. **Optional for now — Purpose of trip? (business, casual, outdoor active)
    5. Output(for now just list the destination and dates)

    WhatToPack
    —

    User inputs a location they are traveling to and dates for the trip (must be within API forecast window).
    App recommends what to wear on each day based on temperature, humidity, and precipitation.
    Outputs this data in the form of a list for each day.

    Bonus:
    Recommendations also take into account the activities of user (outdoor hiking vs business meetings).
    App can let users customize based on their individual temperatures (some run hotter or colder).
    App can break down what to wear based on highs or lows of the day (mid-afternoon vs morning vs night).
    Advertising based on clothing needs.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
layout: project
title: Projects
---

### Statistics
- exPrior
- KDE blog post
- Unimodal Density Estimation
- St. Petersberg Paradox

### Data Science
- Do universities help minority students?
- Topic Modeling of r/Bitcoin threads
- Neural Networks project
- SVM project
- Spectral Clustering
- Bagging

### Visualization
- Masters Thesis
- Mobility in Europe during Covid-19
- Starbucks locations in California

### Thoughts
- Data Privacy: Browser Fingerprinting

### Programming
- BST
- TSP: Genetic Algorithm
- R vs Python Data Structures
- OOP in R? S3 Classes
- geostatDB: an R interface for Geostatistical Databases


text:
#Maximum call stack exceeded when installing node modules in homestead on a win10#

The first install of node modules might fail on windows because they can't symlink correctly

To fix it I executed these commands (yes, one is executed twice because the first will crash)

```
npm install --no-bin-links
npm install --no-bin-links
npm rebuild node-sass --no-bin-links
```

repository: andrea-sdl/today-i-learned

repo_name: andrea-sdl/today-i-learned


text:
# Type: Ncname

_Prefix part of CURIE_

URI: [xsd:string](http://www.w3.org/2001/XMLSchema#string)

* [base](https://w3id.org/linkml/base): NCName

* [uri](https://w3id.org/linkml/uri): xsd:string

* [repr](https://w3id.org/linkml/repr): str

## Identifier and Mapping Information

### Schema Source

* from schema: https://w3id.org/oak/text_annotator

repository: INCATools/ontology-access-kit

branch_name: refs/heads/main

gha_language: Jupyter Notebook

repo_name: INCATools/ontology-access-kit


text:
This library allows you to quickly and easily send emails through SendGrid using PHP.

```php
$sendgrid = new SendGrid('username', 'password');
$mail     = new SendGrid\Mail();
$mail->addTo('foo@bar.com')->
       addTo('dude@bar.com')->
       setFrom('me@bar.com')->
       setSubject('Subject goes here')->
       setText('Hello World!')->
       setHtml('<strong>Hello World!</strong>');

$sendgrid->smtp->send($mail);
```

## Installation

The following recommended installation requires [composer](http://getcomposer.org/). If you are unfamiliar with composer see the [composer installation instructions](http://getcomposer.org/doc/01-basic-usage.md#installation).

Add the following to your `composer.json` file:

```json
{
  "require": {
    "sendgrid/sendgrid": "~1.0.0"
  }
}
```

Install sendgrid-php and its dependencies:

```bash
composer install
```

Load sendgrid-php and its dependencies into your project:

```php
require 'vendor/autoload.php';
```

### Alternative Installation

If you choose not to use composer you can do the following alternative installation using git:

```bash
git clone https://github.com/sendgrid/sendgrid-php.git
```

Then require the autoloader from your php script:

```php
require '../path/to/sendgrid-php/SendGrid_loader.php';
```

Finally, install SwiftMailer using pear.

```bash
pear channel-discover pear.swiftmailer.org
pear install swift/swift
```

*Note: If you do not plan on sending using SMTP, you can skip installation of swiftmailer.*

## SendGrid APIs ##

SendGrid provides two methods of sending email: the Web API, and SMTP API.  SendGrid recommends using the SMTP API for sending emails.
For an explanation of the benefits of each, refer to http://docs.sendgrid.com/documentation/get-started/integrate/examples/smtp-vs-rest/.

This library implements a common interface to make it very easy to use either API.

## Pre-Usage ##

Before we begin using the library, its important to understand a few things about the library architecture...

* The SendGrid Mail object is the means of setting mail data. In general, data can be set in three ways for most elements:
  1. set - reset the data, and initialize it to the given element. This will destroy previous data
  2. set (List) - for array based elements, we provide a way of passing the entire array in at once. This will also destroy previous data.
  3. add - append data to the list of elements.

* Sending an email is as simple as :
  1. Creating a SendGrid Instance
  1. Creating a SendGrid Mail object, and setting its data
  1. Sending the mail using either SMTP API or Web API.

## Usage

To begin using this library, initialize the SendGrid object with your SendGrid credentials.

```php
$sendgrid = new SendGrid('username', 'password');
```

Create a new SendGrid Mail object and add your message details.

```php
$mail = new SendGrid\Mail();
$mail->addTo('foo@bar.com')->
       setFrom('me@bar.com')->
       setSubject('Subject goes here')->
       setText('Hello World!')->
       setHtml('<strong>Hello World!</strong>');
```

Send it using the API of your choice (SMTP or Web)

```php
$sendgrid->smtp->send($mail);
```
Or

```php
$sendgrid->web->send($mail);
```

### Port and Hostname ###

For the smtp API you can optionally choose to set the Port and the Hostname.

```php
$sendgrid->smtp->setPort('1234567');
$sendgrid->smtp->setHostname('smtp.dude.com');
```

This is useful if you are using a local relay, as documented in [here](http://sendgrid.com/docs/Integrate/#--Power-Users-and-High-Volume-Senders).

### Categories ###

Categories are used to group email statistics provided by SendGrid.

To use a category, simply set the category name.  Note: there is a maximum of 10 categories per email.

```php
$mail = new SendGrid\Mail();
$mail->addTo('foo@bar.com')->
       ...
       addCategory("Category 1")->
       addCategory("Category 2");
```

### Attachments ###

Attachments are currently file based only, with future plans for an in memory implementation as well.

File attachments are limited to 7 MB per file.

```php
$mail = new SendGrid\Mail();
$mail->addTo('foo@bar.com')->
       ...
       addAttachment("../path/to/file.txt");
```

**Important Gotcha**: `setBcc` is not supported with attachments. This is by design. Instead use multiple `addTo`s. Each user will receive their own personalized email with that setup, and only see their own email.

### Bcc

Use multiple `addTo`s as a superior alternative to `setBcc`.

```php
$mail = new SendGrid\Mail();
$mail->addTo('foo@bar.com')->
       addTo('someotheraddress@bar.com')->
       addTo('another@another.com')->
       ...
```

Standard `setBcc` will hide who the email is addressed to. If you use the multiple addTo, each user will receive a personalized email showing **only* their email. This is more friendly and more personal. Additionally, it is a good idea to use multiple `addTo`s because setBcc is not supported with attachments. This is by design.

So just remember, when thinking 'bcc', instead use multiple `addTo`s.

### From-Name and Reply-To

There are two handy helper methods for setting the From-Name and Reply-To for a
message

```php
$mail = new SendGrid\Mail();
$mail->addTo('foo@bar.com')->
       setReplyTo('someone.else@example.com')->
       setFromName('John Doe')->
       ...
```

### Substitutions ###

Substitutions can be used to customize multi-recipient emails, and tailor them for the user

```php
$mail = new SendGrid\Mail();
$mail->addTo('john@somewhere.com')->
       addTo("harry@somewhere.com")->
       addTo("Bob@somewhere.com")->
       ...
       setHtml("Hey %name%, we've seen that you've been gone for a while")->
       addSubstitution("%name%", array("John", "Harry", "Bob"));
```

### Sections ###

Sections can be used to further customize messages for the end users. A section is only useful in conjunction with a substition value.

```php
$mail = new SendGrid\Mail();
$mail->addTo('john@somewhere.com')->
       addTo("harry@somewhere.com")->
       addTo("Bob@somewhere.com")->
       ...
       setHtml("Hey %name%, you work at %place%")->
       addSubstitution("%name%", array("John", "Harry", "Bob"))->
       addSubstitution("%place%", array("%office%", "%office%", "%home%"))->
       addSection("%office%", "an office")->
       addSection("%home%", "your house");
```

### Unique Arguments ###

Unique Arguments are used for tracking purposes

```php
$mail = new SendGrid\Mail();
$mail->addTo('foo@bar.com')->
       ...
       addUniqueArgument("Customer", "Someone")->
       addUniqueArgument("location", "Somewhere");
```

### Filter Settings ###

Filter Settings are used to enable and disable apps, and to pass parameters to those apps.

```php
$mail = new SendGrid\Mail();
$mail->addTo('foo@bar.com')->
       ...
       addFilterSetting("gravatar", "enable", 1)->
       addFilterSetting("footer", "enable", 1)->
       addFilterSetting("footer", "text/plain", "Here is a plain text footer")->
       addFilterSetting("footer", "text/html", "<p style='color:red;'>Here is an HTML footer</p>");
```

### Headers ###

Headers can be used to add existing sendgrid functionality (such as for categories or filters), or custom headers can be added as necessary.

```php
$mail = new SendGrid\Mail();
$mail->addTo('foo@bar.com')->
       ...
       addHeader("category", "My New Category");
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## Running Tests ##

The existing tests in the `Test` directory can be run using [PHPUnit](https://github.com/sebastianbergmann/phpunit/) with the following command:

````bash
composer update --dev
vendor/bin/phpunit Test/
```

or if you already have PHPUnit installed globally.

```bash
phpunit Test/
```

## Known Issues

* When using the smtp version (which is built on top of swiftmailer), any FROM names with parentheses will have the content of the parentheses stripped out. If this happens please use the web version of the library. Read more about this in [issue #27](https://github.com/sendgrid/sendgrid-php/issues/27).

repository: bryglen/yii-sendgrid

gha_language: PHP

repo_name: bryglen/yii-sendgrid


text:
---
layout: post
comments: true
title: National Income accounting
---

* Why accounting?
  * Provides a formal structure for macro-theory models. In addition to looking at real output, the national income accounts include measures of overall price level.
  * Provides a few numbers with which one can characterize the economy.
* **GDP** (Gross domestic product) is the value of all *final* goods and services produced in the country within a given period.
* Inputs such as labor and capital are called *factors of production* and the payments made to factors, such as wages and interest payments, are called *factor payments*.

* **GDP and GNP**: GNP is GDP along with the receipts from abroad, for example, the profits of Honda in U.S. will be added in the GNP of Japan.
* **GDP and NDP**: The capital wears out, or *depreciates*, while it is being used to produce output. *Net domestic product* (NDP) is equal to GDP minus the depreciation.
* **National income**: Businesses pay *indirect taxes* (taxes on sales, property, and production) that must be subtracted from the NDP before making factor payments. What is left for making factor payments is *national income*.
  * About 3/4th of factor payments are payments to labor and the remainder goes to pay capital. (Labor is the dominant factor payment and GDP is the sum of all factor payments).

## Components of Demand

* Total demand for domestic output is made up of four components:
  1. consumption spending by households (C)
  2. investment spending by businesses and households (I)
  3. government purchases of goods and services (G)
  4. foreign demand for out net exports (NX)
* The *fundamental national income identity* is

$$ Y \equiv C + I + G + NX $$

* Examples of consumption spending by household sector are foods, golf lessons,
* Examples of government purchases of goods and services are spending on national defenses, cost of road paving, salaries of government employees.
  * We refer to government spending on goods and services are *purchases* of goods and services. In addition, government makes *transfer payments* (payments that are made to people without the people providing a current service in exchange). Typical transfer payments are social security benefits and unemployment benefits. Transfer payment are **not** counted as part of GDP and they are not part of current production.
* **Investments**: Investment means additions to the physical stock of capital. Examples are housing construction, building or machinery, construction of factories and offices, addition to a firm's inventories of goods.
  * *Human capital*: is the knowledge and ability to produce that is embodied in labor force. Though investment in education can be regarded as investment in human capital, the official accounts treat personal educational investments as consumption and public educational expenditures as government spending.
* *Convention*: Investment is associated with the business sector's adding to the physical stock of capital, including inventories. All household expenditures (except housing construction) are considered as consumption spending. The total investment is regarded as *gross investment* and *net investment* is gross investment minus depreciation.
* *Net exports*: Accounts for domestic spending on foreign goods and foreign spending on domestic goods. The difference between the exports and imports is called *net exports*.

## Identities

### Simple Economy

* A simple economy is one in which there are no government and foreign sector.
* The value of output is denoted by $Y$, consumption by $C$ and investment spending by $I$.
* Output produced equals output sold, i.e., $Y = C + I$.
* The income, $Y$, will be allocated as savings and the remaining will be consumption. Here $S$ denote private saving. Then $Y = S + C$.
* Combining two equations, we see that $S = I$. In a simple economy, investment is equal to saving.
* In a simple economy, the only way an individual can save is by undertaking an act of physical investment.

### Economy with Government and Foreign trade

* We denote government purchase of goods and services by $G$, and all taxes by $TA$. Transfers to private sector (including interest to public debt) is denoted by $TR$. Net exports (exports minus imports) is $NX$.
* Fundamental identity: $Y = C + I + G + NX$.
* The disposable income (YD) is equal to income plus transfers less taxes, hence $YD = Y + TR - TA$. The disposable income is equal to savings plus consumption. $YD = C + S$.
* We see that

$$ S - I = (G + TR - TA) + NX.$$

* The term $G + TR - TA$ is called *government budget deficit* (BD). $G + TR$ is the total government expenditure. Budget deficit is the excess of government's spending over it's receipts and it is negative of Budget surplus ($BS = TA - (G + TR)$). NX is called trade surplus and when it is negative, it is called trade deficit.
* The identity says that the excess of savings over investment in the private sector is equal to the government budget deficit plus the trade surplus.

## Measuring GDP

* *Final goods and value added*: We insist on final goods so that we can avoid double counting, i.e., the intermediate goods are not considered into. This can also be achieve by finding sum total of value added at each step.
* *Current output*: GDP consists of value of output currently produced. It thus excludes transactions in existing commodities, such as old masters of existing houses (we add construction of houses in GDP, but we do not add change of houses).

### Problems of measurement of GDP

* GDP data are often far from perfect measures of either economic output or welfare.
* Valued added at households are not counted in GDP, things like taking care of own children, etc, have a value of zero.
* The accounts does not subtract anything for environmental pollution and degradation.
* It is difficult to account correctly for improvements in the quality of goods. National income accountants try to adjust for improvements in quality, but the task is not easy.
* There are attempts made to construct an *adjusted GNP* that takes into account some of the difficulties.

## Inflation and Price indices

* **Real GDP** measures changes in physical output in the economy between different time periods by valuing all goods produced at the same prices.
* **Nominal GDP** measures the value of output in a given period in the prices of that period, or at current value of money.

* **Inflation** is the rate of change in prices, and the price level is the cumulation of past inflations. If $P_{t-1}$ represents the price level last year and $P_t$ represent today's price level, then the inflation rate over the past year can be written as $\pi = \frac{P_{t} - P_{t-1}}{P_{t-1}}$. If the inflation rate is negative, one terms it as *deflation*.

### Price indices

* The main price indices are
  * GDP deflator,
  * Consumer price index (CPI),
  * Personal consumption expenditure deflator,
  * Producer price index.

* **GDP deflator**: GDP deflator is the ratio of nominal GDP in a given year to the real GDP of that year.
* **Consumer price index**: Measures the cost of buying a fixed basket of goods and services representative of the purchases of urban customers.
* CPI differs from GDP deflator is three ways:
  * Deflator measures the prices of a much wider group of goods and services than CPI does.
  * CPI measures the cost of a given basket of goods which is the same from year to year, however the basket of goods included in deflator differs from year to year.
  * CPI includes prices of imports, whereas the deflator includes only the prices of goods produces within the country.
* *Personal consumption expenditure deflator* (PCE) measures inflation in consumer purchases bases on the consumption sector of the national income accounts.
* *Producer price index* (PPI), like CPI is a measure of the cost of a given basket of goods. It differs fro CPI by it's coverage; the PPI includes, for example, raw materials and semi-finished goods. PPI is constructed from prices at the level of the first significant commercial transaction.

* **Core inflation**: Prices of certain goods are volatile, suggesting that price changes are often temporary. For this reason, policymakers often concentrate on *core inflation*, which excludes changes to food and energy sector, these measures are often reported for both CPI and PCE deflator.

* **Unemployment**: rate measures the fraction of workforce that is out of work and is looking for job or expecting a recall from layoff.

* **Interest rates**: *Nominal interest rates* lists returns in terms of current value of currency, while *real interest rates* subtract inflation to give return in terms of currency of constant value.

* **Exchange rate**: is the price of foreign currency. Some countries allow exchange rate to float, meaning that price is determined by supply and demand. Other countries fix the value of exchange rate by offering to exchange their currency for dollars at a fixed rate. The exchange rate need not reflect on whether goods are expensive or cheap in the other country.


text:
# FAQ
## On which OS can I use the software?
Microsoft Windows 7/8/8.1/10<br>
Microsoft Windows Server 2008 R2/2012/2012 R2/2016
## On which version of .Net Framework can the software run?
4.5.2 or newer.
## How to install?
See [/docs/INSTALL.md](https://github.com/leonelacs/WordBook/blob/master/docs/INSTALL.md "INSTALL.md")
## Where is the vocabulary library?
/src/WordBook/library.wbf
## What is the format in the vocabulary library file?
Each line contains a vocabulary, its Chinese meaning, its phonetic; they are splitted by a 'tab'(/t).
## Where should the vocabulary library file be?
The directory which contains the executable file.

repository: leonelacs/WordBook

repo_name: leonelacs/WordBook


text:
[MailSlurp JS](../README.md) / InboxDto

# Interface: InboxDto

Representation of a MailSlurp inbox. An inbox has an ID and a real email address. Emails can be sent to or from this email address. Inboxes are either `SMTP` or `HTTP` mailboxes. The default, `HTTP` inboxes, use AWS SES to process emails and are best suited as test email accounts and do not support IMAP or POP3. `SMTP` inboxes use a custom mail server at `mx.mailslurp.com` and support SMTP login, IMAP and POP3. Use the `EmailController` or the `InboxController` methods to send and receive emails and attachments. Inboxes may have a description, name, and tags for display purposes. You can also favourite an inbox for easier searching.

**`Export`**

**`Interface`**

InboxDto

## Table of contents

### Properties

- [createdAt](InboxDto.md#createdat)
- [description](InboxDto.md#description)
- [domainId](InboxDto.md#domainid)
- [emailAddress](InboxDto.md#emailaddress)
- [expiresAt](InboxDto.md#expiresat)
- [favourite](InboxDto.md#favourite)
- [id](InboxDto.md#id)
- [inboxType](InboxDto.md#inboxtype)
- [name](InboxDto.md#name)
- [readOnly](InboxDto.md#readonly)
- [tags](InboxDto.md#tags)
- [userId](InboxDto.md#userid)
- [virtualInbox](InboxDto.md#virtualinbox)

## Properties

### createdAt

• **createdAt**: `Date`

When the inbox was created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`.

**`Memberof`**

InboxDto

___

### description

• `Optional` **description**: `string`

Description of an inbox for labelling and searching purposes

**`Memberof`**

InboxDto

___

### domainId

• `Optional` **domainId**: `string`

ID of custom domain used by the inbox if any

**`Memberof`**

InboxDto

___

### emailAddress

• **emailAddress**: `string`

The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.

**`Memberof`**

InboxDto

___

### expiresAt

• `Optional` **expiresAt**: `string`

Inbox expiration time. When, if ever, the inbox should expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. This is the default behavior unless expiration date is set. If an expiration date is set and the time is reached MailSlurp will expire the inbox and move it to an expired inbox entity. You can still access the emails belonging to it but it can no longer send or receive email.

**`Memberof`**

InboxDto

___

### favourite

• **favourite**: `boolean`

Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering

**`Memberof`**

InboxDto

___

### id

• **id**: `string`

ID of the inbox. The ID is a UUID-V4 format string. Use the inboxId for calls to Inbox and Email Controller endpoints. See the emailAddress property for the email address or the inbox. To get emails in an inbox use the WaitFor and Inbox Controller methods `waitForLatestEmail` and `getEmails` methods respectively. Inboxes can be used with aliases to forward emails automatically.

**`Memberof`**

InboxDto

___

### inboxType

• `Optional` **inboxType**: [`InboxDtoInboxTypeEnum`](../enums/InboxDtoInboxTypeEnum.md)

Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send).

**`Memberof`**

InboxDto

___

### name

• `Optional` **name**: `string`

Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search

**`Memberof`**

InboxDto

___

### readOnly

• **readOnly**: `boolean`

Is the inbox readOnly for the caller. Read only means can not be deleted or modified. This flag is present when using team accounts and shared inboxes.

**`Memberof`**

InboxDto

___

### tags

• `Optional` **tags**: `string`[]

Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.

**`Memberof`**

InboxDto

___

### userId

• `Optional` **userId**: `string`

ID of user that inbox belongs to

**`Memberof`**

InboxDto

___

### virtualInbox

• **virtualInbox**: `boolean`

Virtual inbox can receive email but will not send emails to real recipients. Will save sent email record but never send an actual email. Perfect for testing mail server actions.

**`Memberof`**

InboxDto

repository: mailslurp/mailslurp-client

gha_language: HTML

gha_license_id: MIT

repo_name: mailslurp/mailslurp-client


text:
---
layout: page
location: pages/coding/infra/security/leaf
permalink: /pages/coding/infra/security/Security-Notes
---

## Useful resources

- Article, [Improve your security by talking about gardening](https://rbs-tito.medium.com/improve-your-security-by-talking-about-gardening-c48ea15ae9eb) by Titor Sarrionandia

## GPG

- PGP encryption (“Pretty Good Privacy”)
- A cryptography framework
- GPG = Gnu PGP
- We used this at Samba to decrypt the encrypted secrets repo - there are more notes on how this worked in [Samba Useful Notes](https://github.com/claresudbery/samba/blob/master/Useful-Notes.docx) (accessible to Clare only).

repository: claresudbery/clare-wiki-ably

gha_language: Shell

gha_license_id: NOASSERTION

repo_name: claresudbery/clare-wiki-ably


text:
# gulp-tasks-registrator

> Clean up your Gulpfile by splitting it into small isolated tasks

Gulp tasks registrator.

[![npm version](https://badge.fury.io/js/gulp-tasks-registrator.svg)](https://www.npmjs.com/package/gulp-tasks-registrator)
[![Build Status](https://secure.travis-ci.org/ziflex/gulp-tasks-registrator.svg?branch=master)](http://travis-ci.org/ziflex/gulp-tasks-registrator)

Registrator runs through a given directory and registers found ```.js``` files as gulp tasks.

## Install

```sh

    $ npm install --save-dev gulp-tasks-registrator

```

## Basic Usage

For example, we have this folder structure with our tasks:

````sh

    tasks
        env.js
        build
            scripts
                app.js
                vendors.js
            styles.js

````

Registrator will create tasks using convention - {folder1}:{folderN}:{filename}, ignoring root folder:

* env
* build:styles
* build:scripts:app
* build:scripts:vendors

#### ./gulpfile.js

```javascript

    var path = require('path');
    var $ = require('gulp-load-plugins')(
        pattern: [
            'gulp',
            'gulp-*',
            'gulp.*'
        ]
    );

    require('gulp-tasks-registrator')({
        gulp: $.gulp,
        dir: path.join(__dirname, '/tasks'),
        args: [$]
    });

```

#### ./tasks/env.js
Each file should contain factory function which returns an actual task function.
Factory will receive any arguments that were passed into registrator.

```javascript

    module.exports = function factory($) {
        return task() {
            return $.gulp.src(...)
        };
    };

````

## Grouping tasks
We can group small tasks with, so called, high order tasks, just by setting ```group``` parameter to ```true```.

```javascript

    require('gulp-tasks-registrator')({
        gulp: gulp,
        dir: path.join(__dirname, '/tasks'),
        args: [gulp],
        group: true
    });

```

For example, we have this folder structure with our tasks:

````sh

    tasks
        env.js
        build
            scripts.js
            styles.js
            assets.js

````

Except regular tasks, we will register high order task called ```build```, which will have all nested tasks as dependencies (nested high order tasks included).

It will be the same if we created it manually, like this:

````javascript

    gulp.task('build', ['build:scripts', 'build:styles', 'build:assets'], function(done) {
        done();
    });

````

## Tasks dependencies
Also, since version 0.3.0, it is possible to define dependencies for each tasks:

````javascript

    module.exports = function factory($) {
        const task = task() {
            return $.gulp.src(...)
        };

        task.dependencies = ['task1', 'task2'];

        return task;
    };

````

### API

#### registrator(options)

#### options.gulp
Type: `object`.
Gulp instance.

#### options.dir
Type: `string`.
Full path to task factories directory.

### options.group
Type: `boolean`.
Creates gulp task based on folder name and adds nested tasks as dependencies.
Optional.

#### options.args
Type: `Array<any>`.
Arguments to pass to task factories.
Optional.

#### options.filter
Type: `String|Function`.
RegExp string or a function for tasks filtering.
Task full path is passed as a function argument.
Optional.

#### options.verbose
Type: `boolean`.
Defines whether to push to console logs.
Optional.
Default false.

#### options.panic
Type: `boolean`.
Defines whether to throw error if task registration failed.
Optional.
Default true.

### License

The MIT License (MIT)
Copyright (C) 2015 Tim Voronov

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: ziflex/gulp-tasks-registrator

repo_name: ziflex/gulp-tasks-registrator


text:
GraphQL for .NET - Subscription Transport WebSockets
====================================================

>WARNING: not tested in heavy production use! That said if you are using this in production
>drop me a line to tell me how's it working for you. Maybe I can take this disclaimer off.

[![Build status](https://ci.appveyor.com/api/projects/status/x0nf67vfao60wf7e/branch/master?svg=true)](https://ci.appveyor.com/project/graphql-dotnet-ci/server/branch/master)

Transport compatible with [Apollo](https://github.com/apollographql/subscriptions-transport-ws) subscription protocol.

## Getting started

For just the HTTP middleware:
>`dotnet add package GraphQL.Server.Transports.AspNetCore`

For the WebSocket subscription protocol (depends on above) middleware:
>`dotnet add package GraphQL.Server.Transports.WebSockets`

For the UI middleware/s:
>`dotnet add package GraphQL.Server.Ui.GraphiQL`
>`dotnet add package GraphQL.Server.Ui.Playground`
>`dotnet add package GraphQL.Server.Ui.Voyager`

### Configure

``` csharp
public void ConfigureServices(IServiceCollection services)
{
    services.AddSingleton<ChatSchema>();

    // Add GraphQL services and configure options
    services.AddGraphQL(options =>
    {
        options.EnableMetrics = true;
        options.ExposeExceptions = this.Environment.IsDevelopment();
    })
    .AddWebSockets() // Add required services for web socket support
    .AddDataLoader(); // Add required services for DataLoader support
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    // this is required for websockets support
    app.UseWebSockets();

    // use websocket middleware for ChatSchema at path /graphql
    app.UseGraphQLWebSockets<ChatSchema>("/graphql");

    // use HTTP middleware for ChatSchema at path /graphql
    app.UseGraphQL<ChatSchema>("/graphql");

    // use graphiQL middleware at default url /graphiql
    app.UseGraphiQLServer(new GraphiQLOptions());

    // use graphql-playground middleware at default url /ui/playground
    app.UseGraphQLPlayground(new GraphQLPlaygroundOptions());

    // use voyager middleware at default url /ui/voyager
    app.UseGraphQLVoyager(new GraphQLVoyagerOptions());
}

```

### UserContext and resolvers

`UserContext` of your resolver will be type of `MessageHandlingContext`. You can
access the properties including your actual `UserContext` by using the
`Get<YourContextType>("UserContext")` method. This will read the context from the properties of
`MessageHandlingContext`. You can add any other properties as to the context in
`IOperationMessageListeners`. See the sample for example of injecting `ClaimsPrincipal`.

## Sample

Samples.Server shows a simple Chat style example of how subscription transport is used
with GraphiQL integration.

Here are example queries to get started. Use three browser tabs or better yet windows
to view the changes.

### Subscription 1

Query:

```
subscription MessageAddedByUser($id:String!) {
  messageAddedByUser(id: $id) {
    from { id displayName }
    content
  }
}
```

Variables:

```
{
  "id": "1"
}
```

### Subscription 2

```
subscription MessageAdded {
  messageAdded {
    from { id displayName }
    content
  }
}
```

### Mutation

Query:

```
mutation AddMessage($message: MessageInputType!) {
  addMessage(message: $message) {
    from {
      id
      displayName
    }
    content
  }
}
```

Variables:

```
{
  "message": {
    "content": "Message",
    "fromId": "1"
  }
}
```

repository: mphafimatima/server

branch_name: refs/heads/develop

repo_name: mphafimatima/server


text:
# DomoticPi

My first IoT playground based on Raspberry Pi and the amazing [Nerves](
https://www.nerves-project.org/) platform!

A RaspberryPi Zero Wireless device using a [DS18D20 temperature sensor](
https://cdn-shop.adafruit.com/datasheets/DS18B20.pdf), LEDs, `Phoenix.LiveView`
and OTP features to monitor my freezer temperature never to waste precious venison.

## Electronics

http://fritzing.org/projects/freezer-watch

repository: layeddie/domotic-pi

repo_name: layeddie/domotic-pi


text:
# Photo albums

## Description
You're going to create a gallery application which will allow the user to view their albums as well as the individual photos contained within, as a single page application (SPA).

## Wireframes

![Wireframes](assets/photo-album.png)

## Objectives

### Learning Objectives

After completing this assignment, you should…

* Understand what is the Document Object Model and how it relates to javascript.
* Understand DOM traversal and manipulation utilizing jQuery or native DOM api
* Basic understanding of events.

### Performance Objectives

After completing this assignment, you be able to effectively use

* Use jQuery to traverse up and down the DOM
* Effectively find the correct elements to manipulate, hide, and show
* Basic event binding using jQuery shorthand methods

## Details

### Deliverables

* A repo containing:
  * `index.html`
  * `bower_components/jquery/`
  * `bower.json`
  * `photo-album.js`

### Requirements

* `index.html` is the only page that exists for this assignment
* Must have a minimum of 6 photo albums
* Each photo album must contain at least 3 photos
* Based on the wireframes, you have 3 views.
  - Main Gallery of Albums view
  - Contents of Album view
  - Photo detail view
* jQuery will be used for dom manipulation and traversal
* The jQuery library must be loaded via bower and be included as a dependency via  `bower.json`

## Normal Mode

To complete this assignment:

- The gallery application must be a single web page
- The views must match the wireframe layouts, respectively

## Hard Mode

Do everything in normal mode, but also:

- On the photo detail, allow to navigate to other photos in the same album via a click to the left or right of the photo the user is currently viewing.

repository: boazblake/Course-Guide

repo_name: boazblake/Course-Guide


text:
# Blinky Hello World application

This project is intended to be build with [ARM GCC][arm gcc] toolchain under
[CMake][cmake] project manager.

To generate native makefiles structure, please create *build* folder to not pollyte
your current workspace and launch CMake generation. It is assumed that ARM GCC toolchain path is added to the PATH environment variable.
If not - you could add it with `set` (Windows) or `export` (Unix) command: `export PATH=<path/to/arm-none-eabi/toolchain>:$PATH`.

- Generate MinGW Makefiles
```bash
mkdir cmake-build-debug
cd cmake-build-debug
# Command to generate MinGW Makefiles
cmake .. -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE=../arm-gcc-toolchain.cmake -DCMAKE_BUILD_TYPE=Debug
```
- Generate Unix Makefiles
```bash
mkdir cmake-build-debug
cd cmake-build-debug
# Command to generate MinGW Makefiles
cmake .. -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=../arm-gcc-toolchain.cmake -DCMAKE_BUILD_TYPE=Debug
```
- Generate Ninja build
```bash
mkdir cmake-build-debug
cd cmake-build-debug
# Command to generate MinGW Makefiles
cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=../arm-gcc-toolchain.cmake -DCMAKE_BUILD_TYPE=Debug
```

[arm gcc]: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm
[cmake]: https://cmake.org/

gha_language: C


text:
---
title: User Profile
description: test
---

<%= include('../../_includes/_github', {
  link: 'https://github.com/auth0-samples/auth0-angularjs-sample/tree/master/04-User-Profile',
}) %>_

It is simple to access users' information using the Angular SDK. User profiles can be accessed in 3 ways:

- In config when using redirect mode with the help of events (eg: `loginSuccess`);
- Via controllers when using pop with the help of callbacks
- Using the `getProfile()` method

### Accessing user profile in redirect mode

You can subscribe to custom events which are called at certain phases of the authentication process. One of which is `loginSuccess` which you can use to access a user's profile from its callback function. Redirect modes do not support signin in with callbacks, therefore, this event is the only way to get users' profiles. The event is configured in angular's `config` method using the `authProvider` as a dependency:

```js
/* ===== ./app.js ===== */
app.config(function myAppConfig (authProvider) {
  //Called when login is successful
  authProvider.on('loginSuccess', ['$location', 'profilePromise', 'idToken', 'store', '$rootScope',
  function($location, profilePromise, idToken, store, $rootScope) {
    // Successfully log in
    // Access to user profile and token
    profilePromise.then(function(profile){
      // profile
      $rootScope.redirectModeProfile = profile
    });
    $location.url('/');
  }]);
});
```

The profile is a JavaScript object so you can access its properties. You have the profile data on Angular's scope object so you can bind to your view or do whatever you want with the information:

```html
<!-- ===== ./home/home.html ===== -->
<span>{{redirectModeProfile.name}}</span>
```
### Accessing user profile via controllers

When using popup mode, callbacks can be used to get a user's profile if the authentication is successful:
```js
app.controller('LoginCtrl', function ($scope, auth) {
  /* ===== ./login/login.js ===== */

  $scope.auth = auth;

  $scope.signin = function (){
    auth.signin({popup: true},
      function(profile, idToken){
        $scope.popupModeProfile = profile;
      },
      function(err) {
        $scope.err = err;
      });
  }
});
```

You can bind to view as well:

```html
<!-- ===== ./home/home.html ===== -->
  <p>Profile from controller: {{popupModeProfile.name}}</p>
```

### Accessing user profile with `auth.getProfile()`

At any given time, you can call `getProfile` on `auth` passing in a token as the only argument. The method returns a promise which you can wait to resolve and grab the profile data:

```js
auth.getProfile(token).then(function(profile){
  // Profile can be used from here
})
```

## Storing and retrieving profiles
Auth0 provides a convenient library for Angular called [Angular Storage](https://github.com/auth0/angular-storage) which uses `localStorage` or `sessionStorage` by default and cookies if those are not available to store data on the client (browser). You can refer to the previous step on how to include the script and inject the Angular dependency.

Now update the controller to store the profile as soon as it is retrieved:

```js
/* ===== ./login/login.js ===== */
  // Don't forget to add store as a dependency
app.controller('LoginCtrl', function ($scope, auth, store) {
  // Add auth to $scope object so we can bind to view
  $scope.auth = auth;

  $scope.signin = function (){
    auth.signin({popup: true},
      function(profile, idToken){
        // Store user profile
        store.set('profile', profile);
        $scope.token = idToken;
        $scope.popupModeProfile = profile;
      },
      function(err) {
        $scope.err = err;
      });
  }
});

// ================= OR
/* ===== ./app.js ===== */
app.config(function myAppConfig (authProvider) {
  //Called when login is successful
  authProvider.on('loginSuccess', ['$location', 'profilePromise', 'idToken', 'store', '$rootScope',
  function($location, profilePromise, idToken, store, $rootScope) {
    // Successfully log in
    // Access to user profile and token
    profilePromise.then(function(profile){
      // profile
      $rootScope.redirectModeProfile = profile
    });
    $location.url('/');
  }]);
});
```

You can retrieve any of the stored details as well:

```js
/* ===== ./home/home.js.js ===== */
app.controller('HomeCtrl', ['$scope', 'store', function ($scope, store){
  $scope.popupModeProfile = store.get('profile');
}]);
```

## Authenticating user with profile
Just as you saw above, you can store a user's profile and have access to it from any part of your application. This becomes handy when handling page refresh as there is need to re-authenticate the user. Fortunately, Auth0 makes it easy to authenticate users with their profiles:

```js
.run(['$rootScope', 'auth', 'store', 'jwtHelper', '$''location',
  function($rootScope, auth, store, jwtHelper, $location) {
  // Listen to a location change event
  $rootScope.$on('$locationChangeStart', function() {
    // Grab the user's token
    var token = store.get('token');
    // Check if token was actually stored
    if (token) {
      // Check if token is yet to expire
      if (!jwtHelper.isTokenExpired(token)) {
        // Check if the user is not authenticated
        if (!auth.isAuthenticated) {
          // Re-authenticate with the user's profile
          // Calls authProvider.on('authenticated')
          auth.authenticate(store.get('profile'), token);
        }
      } else {
        // Either show the login page
        // $location.path('/');
        // .. or
        // or use the refresh token to get a new idToken
        auth.refreshIdToken(token);
      }
    }

  });
}])
```

## Checking if user is authenticated or not
One other nice thing that is handy in the SDK is that you can use custom directives to check if a user is authenticated or not in your view:

```html
<p if-user> {{profile.name}} </p>
```

```html
<p if-not-user> Please log in </p>
```

## Recap

- Accessing user profile using events in config
- Accessing user profile in controllers
- Storing user profiles
- Authentication with profiles
- Authentication status directives

repository: akhanukov/docs

repo_name: akhanukov/docs


text:
---
title: "Table-Valued Parameters | Microsoft Docs"
ms.custom: ""
ms.date: "03/30/2017"
ms.prod: ".net-framework"
ms.reviewer: ""
ms.suite: ""
ms.technology:
  - "dotnet-ado"
ms.tgt_pltfrm: ""
ms.topic: "article"
ms.assetid: 370c16d5-db7b-43e3-945b-ccaab35b739b
caps.latest.revision: 5
author: "JennieHubbard"
ms.author: "jhubbard"
manager: "jhubbard"
---
# Table-Valued Parameters
Table-valued parameters provide an easy way to marshal multiple rows of data from a client application to [!INCLUDE[ssNoVersion](../../../../../includes/ssnoversion-md.md)] without requiring multiple round trips or special server-side logic for processing the data. You can use table-valued parameters to encapsulate rows of data in a client application and send the data to the server in a single parameterized command. The incoming data rows are stored in a table variable that can then be operated on by using [!INCLUDE[tsql](../../../../../includes/tsql-md.md)].

 Column values in table-valued parameters can be accessed using standard [!INCLUDE[tsql](../../../../../includes/tsql-md.md)] SELECT statements. Table-valued parameters are strongly typed and their structure is automatically validated. The size of table-valued parameters is limited only by server memory.

> [!NOTE]
>  You cannot return data in a table-valued parameter. Table-valued parameters are input-only; the OUTPUT keyword is not supported.

 For more information about table-valued parameters, see the following resources.

|Resource|Description|
|--------------|-----------------|
|[Table-Valued Parameters (Database Engine)](http://go.microsoft.com/fwlink/?LinkId=98363) in [!INCLUDE[ssNoVersion](../../../../../includes/ssnoversion-md.md)] Books Online|Describes how to create and use table-valued parameters.|
|[User-Defined Table Types](http://go.microsoft.com/fwlink/?LinkId=98364) in [!INCLUDE[ssNoVersion](../../../../../includes/ssnoversion-md.md)] Books Online|Describes user-defined table types that are used to declare table-valued parameters.|
|The [Microsoft SQL Server Database Engine](http://go.microsoft.com/fwlink/?LinkId=120507) section of [CodePlex](http://go.microsoft.com/fwlink/?LinkID=67739)|Contains samples that demonstrate how to use [!INCLUDE[ssNoVersion](../../../../../includes/ssnoversion-md.md)] features and functionality.|

## Passing Multiple Rows in Previous Versions of SQL Server
 Before table-valued parameters were introduced to [!INCLUDE[ssNoVersion](../../../../../includes/ssnoversion-md.md)] 2008, the options for passing multiple rows of data to a stored procedure or a parameterized SQL command were limited. A developer could choose from the following options for passing multiple rows to the server:

-   Use a series of individual parameters to represent the values in multiple columns and rows of data. The amount of data that can be passed by using this method is limited by the number of parameters allowed. [!INCLUDE[ssNoVersion](../../../../../includes/ssnoversion-md.md)] procedures can have, at most, 2100 parameters. Server-side logic is required to assemble these individual values into a table variable or a temporary table for processing.

-   Bundle multiple data values into delimited strings or XML documents and then pass those text values to a procedure or statement. This requires the procedure or statement to include the logic necessary for validating the data structures and unbundling the values.

-   Create a series of individual SQL statements for data modifications that affect multiple rows, such as those created by calling the `Update` method of a <xref:System.Data.SqlClient.SqlDataAdapter>. Changes can be submitted to the server individually or batched into groups. However, even when submitted in batches that contain multiple statements, each statement is executed separately on the server.

-   Use the `bcp` utility program or the <xref:System.Data.SqlClient.SqlBulkCopy> object to load many rows of data into a table. Although this technique is very efficient, it does not support server-side processing unless the data is loaded into a temporary table or table variable.

## Creating Table-Valued Parameter Types
 Table-valued parameters are based on strongly-typed table structures that are defined by using [!INCLUDE[tsql](../../../../../includes/tsql-md.md)] CREATE TYPE statements. You have to create a table type and define the structure in [!INCLUDE[ssNoVersion](../../../../../includes/ssnoversion-md.md)] before you can use table-valued parameters in your client applications. For more information about creating table types, see [User-Defined Table Types](http://go.microsoft.com/fwlink/?LinkID=98364) in [!INCLUDE[ssNoVersion](../../../../../includes/ssnoversion-md.md)] Books Online.

 The following statement creates a table type named CategoryTableType that consists of CategoryID and CategoryName columns:

```
CREATE TYPE dbo.CategoryTableType AS TABLE
    ( CategoryID int, CategoryName nvarchar(50) )
```

 After you create a table type, you can declare table-valued parameters based on that type. The following [!INCLUDE[tsql](../../../../../includes/tsql-md.md)] fragment demonstrates how to declare a table-valued parameter in a stored procedure definition. Note that the READONLY keyword is required for declaring a table-valued parameter.

```
CREATE PROCEDURE usp_UpdateCategories
    (@tvpNewCategories dbo.CategoryTableType READONLY)
```

## Modifying Data with Table-Valued Parameters (Transact-SQL)
 Table-valued parameters can be used in set-based data modifications that affect multiple rows by executing a single statement. For example, you can select all the rows in a table-valued parameter and insert them into a database table, or you can create an update statement by joining a table-valued parameter to the table you want to update.

 The following [!INCLUDE[tsql](../../../../../includes/tsql-md.md)] UPDATE statement demonstrates how to use a table-valued parameter by joining it to the Categories table. When you use a table-valued parameter with a JOIN in a FROM clause, you must also alias it, as shown here, where the table-valued parameter is aliased as "ec":

```
UPDATE dbo.Categories
    SET Categories.CategoryName = ec.CategoryName
    FROM dbo.Categories INNER JOIN @tvpEditedCategories AS ec
    ON dbo.Categories.CategoryID = ec.CategoryID;
```

 This [!INCLUDE[tsql](../../../../../includes/tsql-md.md)] example demonstrates how to select rows from a table-valued parameter to perform an INSERT in a single set-based operation.

```
INSERT INTO dbo.Categories (CategoryID, CategoryName)
    SELECT nc.CategoryID, nc.CategoryName FROM @tvpNewCategories AS nc;
```

## Limitations of Table-Valued Parameters
 There are several limitations to table-valued parameters:

-   You cannot pass table-valued parameters to [CLR user-defined functions](http://msdn.microsoft.com/library/ms131077.aspx).

-   Table-valued parameters can only be indexed to support UNIQUE or PRIMARY KEY constraints. [!INCLUDE[ssNoVersion](../../../../../includes/ssnoversion-md.md)] does not maintain statistics on table-valued parameters.

-   Table-valued parameters are read-only in [!INCLUDE[tsql](../../../../../includes/tsql-md.md)] code. You cannot update the column values in the rows of a table-valued parameter and you cannot insert or delete rows. To modify the data that is passed to a stored procedure or parameterized statement in table-valued parameter, you must insert the data into a temporary table or into a table variable.

-   You cannot use ALTER TABLE statements to modify the design of table-valued parameters.

## Configuring a SqlParameter Example
 <xref:System.Data.SqlClient> supports populating table-valued parameters from <xref:System.Data.DataTable>, <xref:System.Data.Common.DbDataReader> or System.Collections.Generic.IEnumerable\<<xref:Microsoft.SqlServer.Server.SqlDataRecord>> (<xref:System.Collections.Generic.IEnumerable%601>?qualifyHint=False&autoUpgrade=True) objects. You must specify a type name for the table-valued parameter by using the <xref:System.Data.SqlClient.SqlParameter.TypeName%2A> property of a <xref:System.Data.SqlClient.SqlParameter>. The `TypeName` must match the name of a compatible type previously created on the server. The following code fragment demonstrates how to configure <xref:System.Data.SqlClient.SqlParameter> to insert data.

```csharp
// Configure the command and parameter.
SqlCommand insertCommand = new SqlCommand(
    sqlInsert, connection);
SqlParameter tvpParam = insertCommand.Parameters.AddWithValue(
    "@tvpNewCategories", addedCategories);
tvpParam.SqlDbType = SqlDbType.Structured;
tvpParam.TypeName = "dbo.CategoryTableType";
```

```vb
' Configure the command and parameter.
Dim insertCommand As New SqlCommand(sqlInsert, connection)
Dim tvpParam As SqlParameter = _
   insertCommand.Parameters.AddWithValue( _
  "@tvpNewCategories", addedCategories)
tvpParam.SqlDbType = SqlDbType.Structured
tvpParam.TypeName = "dbo.CategoryTableType"

```

 You can also use any object derived from <xref:System.Data.Common.DbDataReader> to stream rows of data to a table-valued parameter, as shown in this fragment:

```csharp
// Configure the SqlCommand and table-valued parameter.
SqlCommand insertCommand = new SqlCommand(
  "usp_InsertCategories", connection);
insertCommand.CommandType = CommandType.StoredProcedure;
SqlParameter tvpParam =
   insertCommand.Parameters.AddWithValue(
   "@tvpNewCategories", dataReader);
tvpParam.SqlDbType = SqlDbType.Structured;
```

```vb
' Configure the SqlCommand and table-valued parameter.
Dim insertCommand As New SqlCommand("usp_InsertCategories", connection)
insertCommand.CommandType = CommandType.StoredProcedure
Dim tvpParam As SqlParameter = _
  insertCommand.Parameters.AddWithValue("@tvpNewCategories", _
  dataReader)
tvpParam.SqlDbType = SqlDbType.Structured

```

## Passing a Table-Valued Parameter to a Stored Procedure
 This example demonstrates how to pass table-valued parameter data to a stored procedure. The code extracts added rows into a new <xref:System.Data.DataTable> by using the <xref:System.Data.DataTable.GetChanges%2A> method. The code then defines a <xref:System.Data.SqlClient.SqlCommand>, setting the <xref:System.Data.SqlClient.SqlCommand.CommandType%2A> property to <xref:System.Data.CommandType>. The <xref:System.Data.SqlClient.SqlParameter> is populated by using the <xref:System.Data.SqlClient.SqlParameterCollection.AddWithValue%2A> method and the <xref:System.Data.SqlClient.SqlParameter.SqlDbType%2A> is set to `Structured`. The <xref:System.Data.SqlClient.SqlCommand> is then executed by using the <xref:System.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A> method.

```csharp
// Assumes connection is an open SqlConnection object.
using (connection)
{
// Create a DataTable with the modified rows.
DataTable addedCategories =
  CategoriesDataTable.GetChanges(DataRowState.Added);

// Configure the SqlCommand and SqlParameter.
SqlCommand insertCommand = new SqlCommand(
    "usp_InsertCategories", connection);
insertCommand.CommandType = CommandType.StoredProcedure;
SqlParameter tvpParam = insertCommand.Parameters.AddWithValue(
    "@tvpNewCategories", addedCategories);
tvpParam.SqlDbType = SqlDbType.Structured;

// Execute the command.
insertCommand.ExecuteNonQuery();
}
```

```vb
' Assumes connection is an open SqlConnection object.
Using connection
   '  Create a DataTable with the modified rows.
   Dim addedCategories As DataTable = _
     CategoriesDataTable.GetChanges(DataRowState.Added)

  ' Configure the SqlCommand and SqlParameter.
   Dim insertCommand As New SqlCommand( _
     "usp_InsertCategories", connection)
   insertCommand.CommandType = CommandType.StoredProcedure
   Dim tvpParam As SqlParameter = _
     insertCommand.Parameters.AddWithValue( _
     "@tvpNewCategories", addedCategories)
   tvpParam.SqlDbType = SqlDbType.Structured

   '  Execute the command.
   insertCommand.ExecuteNonQuery()
End Using
```

### Passing a Table-Valued Parameter to a Parameterized SQL Statement
 The following example demonstrates how to insert data into the dbo.Categories table by using an INSERT statement with a SELECT subquery that has a table-valued parameter as the data source. When passing a table-valued parameter to a parameterized SQL statement, you must specify a type name for the table-valued parameter by using the new <xref:System.Data.SqlClient.SqlParameter.TypeName%2A> property of a <xref:System.Data.SqlClient.SqlParameter>. This `TypeName` must match the name of a compatible type previously created on the server. The code in this example uses the `TypeName` property to reference the type structure defined in dbo.CategoryTableType.

> [!NOTE]
>  If you supply a value for an identity column in a table-valued parameter, you must issue the SET IDENTITY_INSERT statement for the session.

```csharp
// Assumes connection is an open SqlConnection.
using (connection)
{
// Create a DataTable with the modified rows.
DataTable addedCategories = CategoriesDataTable.GetChanges(
    DataRowState.Added);

// Define the INSERT-SELECT statement.
string sqlInsert =
    "INSERT INTO dbo.Categories (CategoryID, CategoryName)"
    + " SELECT nc.CategoryID, nc.CategoryName"
    + " FROM @tvpNewCategories AS nc;"

// Configure the command and parameter.
SqlCommand insertCommand = new SqlCommand(
    sqlInsert, connection);
SqlParameter tvpParam = insertCommand.Parameters.AddWithValue(
    "@tvpNewCategories", addedCategories);
tvpParam.SqlDbType = SqlDbType.Structured;
tvpParam.TypeName = "dbo.CategoryTableType";

// Execute the command.
insertCommand.ExecuteNonQuery();
}
```

```vb
' Assumes connection is an open SqlConnection.
Using connection
  ' Create a DataTable with the modified rows.
  Dim addedCategories As DataTable = _
    CategoriesDataTable.GetChanges(DataRowState.Added)

  ' Define the INSERT-SELECT statement.
  Dim sqlInsert As String = _
  "INSERT INTO dbo.Categories (CategoryID, CategoryName)" _
  & " SELECT nc.CategoryID, nc.CategoryName" _
  & " FROM @tvpNewCategories AS nc;"

  ' Configure the command and parameter.
  Dim insertCommand As New SqlCommand(sqlInsert, connection)
  Dim tvpParam As SqlParameter = _
     insertCommand.Parameters.AddWithValue( _
    "@tvpNewCategories", addedCategories)
  tvpParam.SqlDbType = SqlDbType.Structured
  tvpParam.TypeName = "dbo.CategoryTableType"

  ' Execute the query
  insertCommand.ExecuteNonQuery()
End Using
```

## Streaming Rows with a DataReader
 You can also use any object derived from <xref:System.Data.Common.DbDataReader> to stream rows of data to a table-valued parameter. The following code fragment demonstrates retrieving data from an Oracle database by using an <xref:System.Data.OracleClient.OracleCommand> and an <xref:System.Data.OracleClient.OracleDataReader>. The code then configures a <xref:System.Data.SqlClient.SqlCommand> to invoke a stored procedure with a single input parameter. The <xref:System.Data.SqlClient.SqlParameter.SqlDbType%2A> property of the <xref:System.Data.SqlClient.SqlParameter> is set to `Structured`. The <xref:System.Data.SqlClient.SqlParameterCollection.AddWithValue%2A> passes the `OracleDataReader` result set to the stored procedure as a table-valued parameter.

```csharp
// Assumes connection is an open SqlConnection.
// Retrieve data from Oracle.
OracleCommand selectCommand = new OracleCommand(
   "Select CategoryID, CategoryName FROM Categories;",
   oracleConnection);
OracleDataReader oracleReader = selectCommand.ExecuteReader(
   CommandBehavior.CloseConnection);

 // Configure the SqlCommand and table-valued parameter.
 SqlCommand insertCommand = new SqlCommand(
   "usp_InsertCategories", connection);
 insertCommand.CommandType = CommandType.StoredProcedure;
 SqlParameter tvpParam =
    insertCommand.Parameters.AddWithValue(
    "@tvpNewCategories", oracleReader);
 tvpParam.SqlDbType = SqlDbType.Structured;

 // Execute the command.
 insertCommand.ExecuteNonQuery();
```

```vb
' Assumes connection is an open SqlConnection.
' Retrieve data from Oracle.
Dim selectCommand As New OracleCommand( _
  "Select CategoryID, CategoryName FROM Categories;", _
  oracleConnection)
Dim oracleReader As OracleDataReader = _
  selectCommand.ExecuteReader(CommandBehavior.CloseConnection)

' Configure SqlCommand and table-valued parameter.
Dim insertCommand As New SqlCommand("usp_InsertCategories", connection)
insertCommand.CommandType = CommandType.StoredProcedure
Dim tvpParam As SqlParameter = _
  insertCommand.Parameters.AddWithValue("@tvpNewCategories", _
  oracleReader)
tvpParam.SqlDbType = SqlDbType.Structured

' Execute the command.
insertCommand.ExecuteNonQuery()
```

## See Also
 [Configuring Parameters and Parameter Data Types](../../../../../docs/framework/data/adonet/configuring-parameters-and-parameter-data-types.md)
 [Commands and Parameters](../../../../../docs/framework/data/adonet/commands-and-parameters.md)
 [DataAdapter Parameters](../../../../../docs/framework/data/adonet/dataadapter-parameters.md)
 [SQL Server Data Operations in ADO.NET](../../../../../docs/framework/data/adonet/sql/sql-server-data-operations.md)
 [ADO.NET Managed Providers and DataSet Developer Center](http://go.microsoft.com/fwlink/?LinkId=217917)


text:
<!-- Copyright 2017 the authors. See the 'Copyright and license' section of the
README.md file at the top-level directory of this repository.

Licensed under the Apache License, Version 2.0 (the LICENSE-APACHE file) or
the MIT license (the LICENSE-MIT file) at your option. This file may not be
copied, modified, or distributed except according to those terms. -->

alloc-tls
=========

`alloc-tls` provides the `alloc_thread_local!` macro, a near-drop-in replacement
for the standard library's `thread_local!` macro that is safe for use in
implementing a global allocator.

Unlike `thread_local!`, `alloc_thread_local!` address the following issues
unique to implementing a global allocator:
- On platforms that support the `#[thread_local]` attribute, registering
  destructors for types that implement `Drop` requires allocation. When a
  thread-local is initialized from a call to an allocation function (`malloc`,
  `free`, etc), this causes reentrancy. `alloc_thread_local!` can detect this.
- On Mac, it is not safe to access TLS while a dynamic library is being loaded.
  When implementing a Mac dynamic library that provides a global allocator,
  `alloc_thread_local!` can detect whether the library has been loaded or not,
  and can avoid using TLS if `malloc` or other similar calls are made from the
  loader itself during loading.

Known limitations:
- `alloc-tls` does not currently support platforms that do not support the
  `#[thread_local]` attribute.

repository: cormacrelf/allocators-rs

repo_name: cormacrelf/allocators-rs


text:
# Robots.txt Directives ONLY for People unable to use the Apache Bot and Spam Referrer Blocker
### If this helps you [why not buy me a beer](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TNCNMH8QVM78J):beer:
## DO NOT use this on any of your sites if you are running the Bad Bot and Spam Referrer Blocker (not needed)

_______________
#### Version: V3.2023.08.1649
#### Bad Referrer Count: 7104
#### Bad Bot Count: 642
____________________

The robots.txt file residing in this directory can be used to ADD onto your existing robots.txt file by placing this after anything you already have in your robots.txt file.

## Do NOT make this file the only contents of your robots.txt file !!!

##### 1. Click on the robots.txt file in this directory
##### 2. Then click on the button that says RAW, this will give you clear unformatted code
##### 3. Then copy those contents to paste into your robots.txt file

If your existing robots.txt file looks like this:

    User-agent: *
    Allow: /wp-admin/admin-ajax.php

Then your new file will look like this:

    User-agent: *
    Allow: /wp-admin/admin-ajax.php
    User-agent: Acunetix
    Disallow:/
    User-agent: FHscan
    Disallow:/
    User-agent: masscan
    Disallow:/
    ........ rest of file contents

# You use this at your own risk

This will only help stop some bad bots from gaining access to your site
this certainly does not provide nearly as much protection as the full
Apache Bad Bot and Spam Referrer Blocker

### If this helped you [buy me a beer](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TNCNMH8QVM78J):beer:

## Update Notification System
Please subscribe your email address to the mailing list at **https://groups.google.com/forum/#!forum/apache-ultimate-bad-bot-blocker**
or simply send a blank email to<EMAIL_ADDRESS>to subscribe.
**Please make sure you are subscribed to notifications** to be notified when the blocker is updated and also to be notified when any important or mission critical changes take place.

## Also follow me on twitter @ubuntu101za for update notifications


text:
# blockBeats
## About
blockBeats is a dApp bound with an ERC-721 smart contract allowing for artists to distribute non-exclusive licenses to their music samples securely via IPFS and NFTs.

Artists can create a listing for their samples on blockbeats, attaching a chosen price and an immutable link to the sample on IPFS which will be stored in the blockbeats smart contract.

Buyers can view and preview these listings on blockbeats and have the option of buying a license for a listing. Upon buying a sample, the buyer will mint an NFT with the immutable IPFS file link and their wallet address attached. A buyer can then use their NFT ownership as cryptographic proof of their rights to use the sample.

## Outline
| Contract | System |
| --- | --- |
| ![contractUsageWhiteBG](https://user-images.githubusercontent.com/57472912/114683723-999d4780-9d53-11eb-9a85-11a030f6cf0a.png) | ![systemWhiteBG](https://user-images.githubusercontent.com/57472912/114684631-71faaf00-9d54-11eb-94a6-b39c1007acb5.png) |

# GUIDES
*Refer to [dev guides](dev-guide.md) for set up & installation info for devs.*

*Refer to [user guides](user-guide.md) for set up / usage guide for users*

repository: gmulhearn/blockbeats

repo_name: gmulhearn/blockbeats


text:
# Why Connector Specification
This is the connection between the What and the various Why implementations.
By having the connections use the same label, it allows our UI to list all of the Whys associated with a What, independent of the Why's types.
Even if we don't have any UI to show a particular why, we can still show that there is a Why (and what the type is).

# Construction

![](../img/why-connector.png)

# Why Connector Specification
Note that each implementation can store information in the Why Connector's properties.
The only restriction is that the implementation cannot use any of the reserved property keys (found below).

**Label** `Why`

**Reserved Properties**

* `Type` - The namespace of the Why (ie Note)

repository: todrobbins/ptree

repo_name: todrobbins/ptree