text:
# Updating from v13 to v14

## Before you start

v14 requires Node 16.11.0 or higher to use, so make sure you're up to date. To check your Node version, use `node -v` in your terminal or command prompt, and if it's not high enough, update it! There are many resources online to help you with this step based on your host system.

### Various packages are now included in v14

If you previously had `@discordjs/builders`, `@discordjs/formatters`, `@discordjs/rest`, or `discord-api-types` manually installed, it's _highly_ recommended that you uninstall the packages to avoid package version conflicts.

:::: code-group
::: code-group-item npm

```sh:no-line-numbers
npm uninstall @discordjs/builders @discordjs/formatters @discordjs/rest discord-api-types
```

:::
::: code-group-item yarn

```sh:no-line-numbers
yarn remove @discordjs/builders @discordjs/formatters @discordjs/rest discord-api-types
```

:::
::: code-group-item pnpm

```sh:no-line-numbers
pnpm remove @discordjs/builders @discordjs/formatters @discordjs/rest discord-api-types
```

:::
::::

## Breaking Changes

### API version

discord.js v14 makes the switch to Discord API v10!

### Common Breakages

### Enum Values

Any areas that used to accept a `string` or `number` type for an enum parameter will now only accept exclusively `number`s.

In addition, the old enums exported by discord.js v13 and lower are replaced with new enums from [discord-api-types](https://discord-api-types.dev/api/discord-api-types-v10).

#### New enum differences

Most of the difference between enums from discord.js and discord-api-types can be summarized as so:

1. Enums are singular, i.e., `ApplicationCommandOptionTypes` -> `ApplicationCommandOptionType`
2. Enums that are prefixed with `Message` no longer have the `Message` prefix, i.e., `MessageButtonStyles` -> `ButtonStyle`
3. Enum values are `PascalCase` rather than `SCREAMING_SNAKE_CASE`, i.e., `.CHAT_INPUT` -> `.ChatInput`

::: warning
You might be inclined to use raw `number`s (most commonly referred to as [magic numbers](<https://en.wikipedia.org/wiki/Magic_number_(programming)>)) instead of enum values. This is highly discouraged. Enums provide more readability and are more resistant to changes in the API. Magic numbers can obscure the meaning of your code in many ways, check out this [blog post](https://blog.webdevsimplified.com/2020-02/magic-numbers/) if you want more context on as to why they shouldn't be used.
:::

#### Common enum breakages

Areas like `Client` initialization, JSON slash commands and JSON message components will likely need to be modified to accommodate these changes:

##### Common Client Initialization Changes

```diff
- const { Client, Intents } = require('discord.js');
+ const { Client, GatewayIntentBits, Partials } = require('discord.js');

- const client = new Client({ intents: [Intents.FLAGS.GUILDS], partials: ['CHANNEL'] });
+ const client = new Client({ intents: [GatewayIntentBits.Guilds], partials: [Partials.Channel] });
```

##### Common Application Command Data changes

```diff
+ const { ApplicationCommandType, ApplicationCommandOptionType } = require('discord.js');

const command = {
  name: 'ping',
- type: 'CHAT_INPUT',
+ type: ApplicationCommandType.ChatInput,
  options: [{
    name: 'option',
    description: 'A sample option',
-   type: 'STRING',
+   type: ApplicationCommandOptionType.String,
  }],
};
```

##### Common Button Data changes

```diff
+ const { ButtonStyle } = require('discord.js');

const button = {
  label: 'test',
- style: 'PRIMARY',
+ style: ButtonStyle.Primary,
  customId: '1234'
}
```

### Removal of method-based type guards

#### Channels

Some channel type guard methods that narrowed to one channel type have been removed. Instead compare the `type` property against a [ChannelType](https://discord-api-types.dev/api/discord-api-types-v10/enum/ChannelType) enum member to narrow channels.

```diff
-channel.isText()
+channel.type === ChannelType.GuildText

-channel.isVoice()
+channel.type === ChannelType.GuildVoice

-channel.isDM()
+channel.type === ChannelType.DM
```

### Builders

Builders are no longer returned by the API like they were previously. For example you send the API an `EmbedBuilder` but you receive an `Embed` of the same data from the API. This may affect how your code handles received structures such as components. Refer to [message component changes section](#messagecomponent) for more details.

Added `disableValidators()` and `enableValidators()` as top-level exports which disable or enable validation (enabled by default).

### Consolidation of `create()` & `edit()` parameters

Various `create()` and `edit()` methods on managers and objects have had their parameters consolidated. The changes are below:

- `Guild#edit()` now takes `reason` in the `data` parameter
- `GuildChannel#edit()` now takes `reason` in the `data` parameter
- `GuildEmoji#edit()` now takes `reason` in the `data` parameter
- `Role#edit()` now takes `reason` in the `data` parameter
- `Sticker#edit()` now takes `reason` in the `data` parameter
- `ThreadChannel#edit()` now takes `reason` in the `data` parameter
- `GuildChannelManager#create()` now takes `name` in the `options` parameter
- `GuildChannelManager#createWebhook()` (and other text-based channels) now takes `channel` and `name` in the `options` parameter
- `GuildChannelManager#edit()` now takes `reason` as a part of `data`
- `GuildEmojiManager#edit()` now takes `reason` as a part of `data`
- `GuildManager#create()` now takes `name` as a part of `options`
- `GuildMemberManager#edit()` now takes `reason` as a part of `data`
- `GuildMember#edit()` now takes `reason` as a part of `data`
- `GuildStickerManager#edit()` now takes `reason` as a part of `data`
- `RoleManager#edit()` now takes `reason` as a part of `options`
- `Webhook#edit()` now takes `reason` as a part of `options`
- `GuildEmojiManager#create()` now takes `attachment` and `name` as a part of `options`
- `GuildStickerManager#create()` now takes `file`, `name`, and `tags` as a part of `options`

### Activity

The following properties have been removed as they are not documented by Discord:

-   `Activity#id`
-   `Activity#platform`
-   `Activity#sessionId`
-   `Activity#syncId`

### Application

`Application#fetchAssets()` has been removed as it is no longer supported by the API.

### BitField

-   BitField constituents now have a `BitField` suffix to avoid naming conflicts with the enum names:

```diff
- new Permissions()
+ new PermissionsBitField()

- new MessageFlags()
+ new MessageFlagsBitField()

- new ThreadMemberFlags()
+ new ThreadMemberFlagsBitField()

- new UserFlags()
+ new UserFlagsBitField()

- new SystemChannelFlags()
+ new SystemChannelFlagsBitField()

- new ApplicationFlags()
+ new ApplicationFlagsBitField()

- new Intents()
+ new IntentsBitField()

- new ActivityFlags()
+ new ActivityFlagsBitField()
```

-   `#FLAGS` has been renamed to `#Flags`

### CDN

The methods that return CDN URLs have changed. Here is an example on a User:

```diff
- const url = user.displayAvatarURL({ dynamic: true, format: "png", size: 1024 });
+ const url = user.displayAvatarURL({ extension: "png", size: 1024 });
```

Dynamic URLs use <DocsLink section="rest" path="ImageURLOptions:Interface"/> and static URLs use <DocsLink section="rest" path="BaseImageURLOptions:Interface"/>. Since dynamic URLs are returned by default, this option has been renamed to `forceStatic` which forces the return of a static URL. Additionally, `format` has been renamed to `extension`.

### CategoryChannel

`CategoryChannel#children` is no longer a `Collection` of channels the category contains. It is now a manager (`CategoryChannelChildManager`). This also means `CategoryChannel#createChannel()` has been moved to the `CategoryChannelChildManager`.

### Channel

The following type guards have been removed:

-   `Channel#isText()`
-   `Channel#isVoice()`
-   `Channel#isDirectory()`
-   `Channel#isDM()`
-   `Channel#isGroupDM()`
-   `Channel#isCategory()`
-   `Channel#isNews()`

Refer to [this section](#channels) for more context.

The base channel class is now `BaseChannel`.

### Client

The `restWsBridgeTimeout` client option has been removed.

### CommandInteractionOptionResolver

`CommandInteractionOptionResolver#getMember()` no longer has a parameter for `required`. See [this pull request](https://github.com/discordjs/discord.js/pull/7188) for more information.

### Constants

-   Many constant objects and key arrays are now top-level exports for example:

```diff
- const { Constants } = require('discord.js');
- const { Colors } = Constants;
+ const { Colors } = require('discord.js');
```

-   The refactored constants structures have `PascalCase` member names as opposed to `SCREAMING_SNAKE_CASE` member names.

-   Many of the exported constants structures have been replaced and renamed:

```diff
- Opcodes
+ GatewayOpcodes

- WSEvents
+ GatewayDispatchEvents

- WSCodes
+ GatewayCloseCodes

- InviteScopes
+ OAuth2Scopes
```

### Events

The `message` and `interaction` events are now removed. Use `messageCreate` and `interactionCreate` instead.

`applicationCommandCreate`, `applicationCommandDelete` and `applicationCommandUpdate` have all been removed. See [this pull request](https://github.com/discordjs/discord.js/pull/6492) for more information.

The `threadMembersUpdate` event now emits the users who were added, the users who were removed, and the thread respectively.

### GuildBanManager

Developers should utilise `deleteMessageSeconds` instead of `days` and `deleteMessageDays`:

```diff
<GuildBanManager>.create('123456789', {
-  days: 3
-  deleteMessageDays: 3
+  deleteMessageSeconds: 3 * 24 * 60 * 60
});
```

`deleteMessageDays` (introduced with version 14) and `days` are both deprecated and will be removed in the future.

### Guild

`Guild#setRolePositions()` and `Guild#setChannelPositions()` have been removed. Use `RoleManager#setPositions()` and `GuildChannelManager#setPositions()` instead respectively.

`Guild#maximumPresences` no longer has a default value of 25,000.

`Guild#me` has been moved to `GuildMemberManager#me`. See [this pull request](https://github.com/discordjs/discord.js/pull/7669) for more information.

### GuildAuditLogs & GuildAuditLogsEntry

`GuildAuditLogs.build()` has been removed as it has been deemed defunct. There is no alternative.

The following properties & methods have been moved to the `GuildAuditLogsEntry` class:

-   `GuildAuditLogs.Targets`
-   `GuildAuditLogs.actionType()`
-   `GuildAuditLogs.targetType()`

### GuildMember

`GuildMember#pending` is now nullable to account for partial guild members. See [this issue](https://github.com/discordjs/discord.js/issues/6546) for more information.

### IntegrationApplication

`IntegrationApplication#summary` has been removed as it is no longer supported by the API.

### Interaction

Whenever an interaction is replied to and one fetches the reply, it could possibly give an `APIMessage` if the guild was not cached. However, interaction replies now always return a discord.js `Message` object with `fetchReply` as `true`.

The base interaction class is now `BaseInteraction`.

### Invite

`Invite#inviter` is now a getter and resolves structures from the cache.

### MessageAttachment

-   `MessageAttachment` has now been renamed to `AttachmentBuilder`.

```diff
- new MessageAttachment(buffer, 'image.png');

+ new AttachmentBuilder(buffer, { name: 'image.png' });
```

### MessageComponent

-   MessageComponents have been renamed as well. They no longer have the `Message` prefix, and now have a `Builder` suffix:

```diff
- const button = new MessageButton();
+ const button = new ButtonBuilder();

- const selectMenu = new MessageSelectMenu();
+ const selectMenu = new StringSelectMenuBuilder();

- const actionRow = new MessageActionRow();
+ const actionRow = new ActionRowBuilder();

- const textInput = new TextInputComponent();
+ const textInput = new TextInputBuilder();
```

-   Components received from the API are no longer directly mutable. If you wish to mutate a component from the API, use `ComponentBuilder#from`. For example, if you want to make a button mutable:

```diff
- const editedButton = receivedButton
-   .setDisabled(true);

+ const { ButtonBuilder } = require('discord.js');
+ const editedButton = ButtonBuilder.from(receivedButton)
+   .setDisabled(true);
```

### MessageManager

`MessageManager#fetch()`'s second parameter has been removed. The `BaseFetchOptions` the second parameter once was is now merged into the first parameter.

```diff
- messageManager.fetch('1234567890', { cache: false, force: true });
+ messageManager.fetch({ message: '1234567890', cache: false, force: true });
```

### MessageSelectMenu

-   `MessageSelectMenu` has been renamed to `StringSelectMenuBuilder`

-   `StringSelectMenuBuilder#addOption()` has been removed. Use `StringSelectMenuBuilder#addOptions()` instead.

### MessageEmbed

-   `MessageEmbed` has now been renamed to `EmbedBuilder`.

-   `EmbedBuilder#setAuthor()` now accepts a sole <DocsLink section="builders" path="EmbedAuthorOptions:TypeAlias"/> object.

-   `EmbedBuilder#setFooter()` now accepts a sole <DocsLink section="builders" path="EmbedFooterOptions:TypeAlias"/> object.

-   `EmbedBuilder#addField()` has been removed. Use `EmbedBuilder#addFields()` instead.

```diff
- new MessageEmbed().addField('Inline field title', 'Some value here', true);

+ new EmbedBuilder().addFields([
+  { name: 'one', value: 'one', inline: true },
+  { name: 'two', value: 'two', inline: true },
+]);
```

### Modal

-   `Modal` has been renamed as well and now has a `Builder` suffix:

```diff
- const modal = new Modal();
+ const modal = new ModalBuilder();
```

### PartialTypes

The `PartialTypes` string array has been removed. Use the `Partials` enum instead.

In addition to this, there is now a new partial: `Partials.ThreadMember`.

### Permissions

Thread permissions `USE_PUBLIC_THREADS` and `USE_PRIVATE_THREADS` have been removed as they are deprecated in the API. Use `CREATE_PUBLIC_THREADS` and `CREATE_PRIVATE_THREADS` respectively.

`ManageEmojisAndStickers` has been deprecated due to API changes. Its replacement is `ManageGuildExpressions`. See [this pull request](https://github.com/discord/discord-api-docs/pull/6017) for more information.

### PermissionOverwritesManager

Overwrites are now keyed by the `PascalCase` permission key rather than the `SCREAMING_SNAKE_CASE` permission key.

### REST Events

#### apiRequest

This REST event has been removed as discord.js now uses [Undici](https://github.com/nodejs/undici) as the underlying request handler. You must now use a [Diagnostics Channel](https://undici.nodejs.org/#/docs/api/DiagnosticsChannel). Here is a simple example:

```js
import diagnosticsChannel from 'node:diagnostics_channel';

diagnosticsChannel.channel('undici:request:create').subscribe(data => {
	// If you use TypeScript, `data` may be casted as
	// `DiagnosticsChannel.RequestCreateMessage`
	// from Undici to receive type definitions.
	const { request } = data;
	console.log(request.method); // Log the method
	console.log(request.path); // Log the path
	console.log(request.headers); // Log the headers
	console.log(request); // Or just log everything!
});
```

You can find further examples at the [Undici Diagnostics Channel documentation](https://undici.nodejs.org/#/docs/api/DiagnosticsChannel).

#### apiResponse

This REST event has been renamed to `response` and moved to `Client#rest`:

```diff
- client.on('apiResponse', ...);
+ client.rest.on('response', ...);
```

#### invalidRequestWarning

This REST event has been moved to `Client#rest`:

```diff
- client.on('invalidRequestWarning', ...);
+ client.rest.on('invalidRequestWarning', ...);
```

#### rateLimit

This REST event has been renamed to `rateLimited` and moved to `Client#rest`:

```diff
- client.on('rateLimit', ...);
+ client.rest.on('rateLimited', ...);
```

### RoleManager

`Role.comparePositions()` has been removed. Use `RoleManager#comparePositions()` instead.

### Sticker

`Sticker#tags` is now a nullable string (`string | null`). Previously, it was a nullable array of strings (`string[] | null`). See [this pull request](https://github.com/discordjs/discord.js/pull/8010) for more information.

### ThreadChannel

The `MAX` helper used in `ThreadAutoArchiveDuration` has been removed. Discord has since allowed any guild to use any auto archive time which makes this helper redundant.

### ThreadMemberManager

`ThreadMemberManager#fetch()`'s second parameter has been removed. The `BaseFetchOptions` the second parameter once was is now merged into the first parameter. In addition, the boolean helper to specify `cache` has been removed.

Usage is now as follows:

```diff
// The second parameter is merged into the first parameter.
- threadMemberManager.fetch('1234567890', { cache: false, force: true });
+ threadMemberManager.fetch({ member: '1234567890', cache: false, force: true });

// The lone boolean has been removed. One must be explicit here.
- threadMemberManager.fetch(false);
+ threadMemberManager.fetch({ cache: false });
```

### Util

`Util.removeMentions()` has been removed. To control mentions, you should use `allowedMentions` on `BaseMessageOptions` instead.

`Util.splitMessage()` has been removed. This utility method is something the developer themselves should do.

`Util.resolveAutoArchiveMaxLimit()` has been removed. Discord has since allowed any guild to use any auto archive time which makes this method redundant.

Other functions in `Util` have been moved to top-level exports so you can directly import them from `discord.js`.

```diff
- import { Util } from 'discord.js';
- Util.escapeMarkdown(message);
+ import { escapeMarkdown } from 'discord.js';
+ escapeMarkdown(message);
```

### `.deleted` Field(s) have been removed

You can no longer use the `deleted` property to check if a structure was deleted. See [this issue](https://github.com/discordjs/discord.js/issues/7091) for more information.

### VoiceChannel

`VoiceChannel#editable` has been removed. You should use `GuildChannel#manageable` instead.

### VoiceRegion

`VoiceRegion#vip` has been removed as it is no longer part of the API.

### Webhook

`Webhook#fetchMessage()`'s second parameter no longer allows a boolean to be passed. The `cache` option in `WebhookFetchMessageOptions` should be used instead.

## Features

### ApplicationCommand

NFSW commands are supported.

### Attachment

Added support for voice message metadata fields.

### AutocompleteInteraction

`AutocompleteInteraction#commandGuildId` has been added which is the id of the guild the invoked application command is registered to.

### BaseChannel

Added support for `BaseChannel#flags`.

Store channels have been removed as they are no longer part of the API.

`BaseChannel#url` has been added which is a link to a channel, just like in the client.

Additionally, new typeguards have been added:

-   `BaseChannel#isDMBased()`
-   `BaseChannel#isTextBased()`
-   `BaseChannel#isVoiceBased()`

### BaseInteraction

Added `BaseInteraction#isRepliable()` to check whether a given interaction can be replied to.

### ClientApplication

Added support for role connection metadata.

### Collection

-   Added `Collection#merge()` and `Collection#combineEntries()`.
-   New type: `ReadonlyCollection` which indicates an immutable `Collection`.

### Collector

A new `ignore` event has been added which is emitted whenever an element is not collected by the collector.

Component collector options now use the `ComponentType` enum values:

```diff
+ const { ComponentType } = require('discord.js');

const collector = interaction.channel.createMessageComponentCollector({
	filter: collectorFilter,
-	componentType: 'BUTTON',
+	componentType: ComponentType.Button,
	time: 20000
});
```

### CommandInteraction

`CommandInteraction#commandGuildId` has been added which is the id of the guild the invoked application command is registered to.

### CommandInteractionOptionResolver

`CommandInteractionOptionResolver#getChannel()` now has a third parameter which narrows the channel type.

### Events

Added support for `guildAuditLogEntryCreate` event.

### ForumChannel

Added support for forum channels.

Added support for `ForumChannel#defaultForumLayout`.

### Guild

Added `Guild#setMFALevel()` which sets the guild's MFA level.

Added `Guild#maxVideoChannelUsers` which indicates the maximum number of video channel users.

Added `Guild#maxStageVideoChannelUsers` which indicates the maximum number of video channel users for stage channels.

Added `Guild#disableInvites()` which disables the guild's invites.

Added support for the `after` parameter in `Guild#fetchAuditLogs()`.

### GuildChannelManager

`videoQualityMode` may be used whilst creating a channel to initially set the camera video quality mode.

### GuildEmojiManager

Added `GuildEmojiManager#delete()` and `GuildEmojiManager#edit()` for managing existing guild emojis.

### GuildForumThreadManager

Added `GuildForumThreadManager` as manager for threads in forum channels.

### GuildMember

Added support for `GuildMember#flags`.

### GuildMembersChunk

This object now supports the `GuildMembersChunk#notFound` property.

### GuildMemberManager

Added `GuildMemberManager#fetchMe()` to fetch the client user in the guild.

Added `GuildMemberManager#addRole()` and `GuildMemberManager#removeRole()`. These methods allow a single addition or removal of a role respectively to a guild member, even if uncached.

### GuildTextThreadManager

Added `GuildTextThreadManager` as manager for threads in text channels and announcement channels.

### Message

`Message#position` has been added as an approximate position in a thread.

Added support for role subscription data.

### MessageReaction

Added `MessageReaction#react()` to make the client user react with the reaction the class belongs to.

### Role

Added support for role subscriptions.

Added support for `Role#tags#guildConnections`.

### StageChannel

Stage channels now allow messages to be sent in them, much like voice channels.

### Sticker

Added support for GIF stickers.

### ThreadMemberManager

The new `withMember` options returns the associated guild member with the thread member.

When fetching multiple thread members alongside `withMember`, paginated results will be returned. The `after` and `limit` option are supported in this scenario.

### Webhook

Added `Webhook#applicationId`.

Added the `threadName` property in `Webhook#send()` options which allows a webhook to create a post in a forum channel.

### WebSocketManager

discord.js uses <PackageLink name="ws" /> internally.

repository: discordjs/guide

gha_language: JavaScript

repo_name: discordjs/guide


text:
---
title: Standard Horizontal Coordinate Transforms
last_updated: 2019-07-23
sidebar: netcdfJavaTutorial_sidebar
permalink: std_horizonal_coord_transforms.html
toc: false
---

## Standard Horizontal Coordinate Transforms
This page documents the _horizontal coordinate transforms_ that are standard in CDM. Most follow the CF-1.0 Conventions, where they are called grid_mappings. They are also often called projections, because most emply projective geometry.

To follow CF, typically one creates a transform definition variable, whose purpose is to contain attributes whose values are the parameters of the transform. Typically the variable does not contain any real data, and so a scalar variable is used. Each data variable that uses the transform has an attribute with name _grid_mapping_ whose value is the name of the transform variable. The projection coordinate variables are also required.

For example:

~~~
  float data(y0, x0);
    data:grid_mapping = "Lambert_Conformal";

  double x0(x0=640);
    x0:standard_name = "projection_x_coordinate";
    x0:long_name = "x distance on the projection plane from the origin";
    x0:units = "km";

  double y0(y0=440);
    y0:standard_name = "projection_y_coordinate";
    y0:long_name = "y distance on the projection plane from the origin";
    y0:units = "km";

  char Lambert_Conformal;
    Lambert_Conformal:grid_mapping_name = "lambert_conformal_conic";
    Lambert_Conformal:standard_parallel = 38.5; // double
    Lambert_Conformal:longitude_of_central_meridian = 262.5; // double
    Lambert_Conformal:latitude_of_projection_origin = 38.5; // double
~~~

In this example, the _Lambert_Conformal_ variable defines the projection and the data variable references it with the _grid_mapping_ attribute. The _x0_ and _y0_ are coordinate variables, and the CF convention standard_name attribute is used to identify them unambiguously as projection x and y coordinates. The defaullt unit is km, but any units that can be converted to km can be used. The value of the coordinates must be the correct geolocation for your data. The projection that you specify is then used to calculate the correct (lat, lon) point. All projections have the form:

~~~
 Projection: (x, y) -> (lat, lon)
 ProjectionInverse: (lat, lon) -> (x, y)
~~~

where the x,y values in this equation are the ones that you put into the x and y projection coordinate variables.

_To summarize, in order for CF Horizontal transforms to work in the CDM, you must:

1. define x and y projection coordinate variables, using the correct projection units, typically km on the projection plane.
2. define your projection dummy variable which has an attribute "grid_mapping_name"
3. refer to the projection in your data variables with the "grid_mapping" attribute._

#### Resources

* Standard horizontal transforms are documented on this page. You can also [implement your own](coord_system_builder.html).
* You may also be interested in [Standard Vertical Coordinate Transforms](std_vertical_coord_transforms.html).
* The [CDM _Coordinate Conventions](coord_attr_conv.html)

### Standard Horizontal Transforms (Projections)

The following are the currently implemented transforms.

Required attributes are in bold, optional in bold italics. Attribute names follow the CF Conventions Appendix F (Grid Mappings). See that document for details on the meanings of the formula terms. The projection algorithms are mostly taken from _John Snyder, Map Projections used by the USGS, Bulletin 1532, 2nd edition (1983)_. Some of the ellispoidal forms are corrected versions of _com.jhlabs.map.proj_.

In some cases, the earth radius may be specified, which uses a spherical earth for the projection. This is indicated by the presence of the _earth_radius_ attribute.

In some cases, the ellipsoidal form of the projection may be used. This is indicated by the presence of the _semi_major_axis_, and either the _semi_minor_axis_ or _inverse_flattening_ attributes. Note that not all projections have an ellipsoidal implementation.

When neither _earth_radius_ or _semi_major_axis_ is allowed or specified, the projection will be spherical with a default earth radius of 6371.229 km.

The units of _earth_radius_, _semi_major_axis_, _semi_minor_axis_ must be in meters.

The optional _false_easting_, and _false_northing_ should match the units of the x and y projection coordinates. Alternatively, the attribute "units" may be specified on the dummy Coordinate Transform Variable (this is CDM standard, not CF). When they are not present in the documentation below, they are not used. Contact us if you have a real sample where they are non-zero.

#### albers_conical_equal_area

~~~
   char Albers_Projection;
     :grid_mapping_name = "albers_conical_equal_area";
     :standard_parallel = 20.0, 60.0; // one or two
     :longitude_of_central_meridian = -32.0;
     :latitude_of_projection_origin = 40.0;
     :false_easting = 0.0;
     :false_northing = 0.0;
     :earth_radius = 6371.229;
     :semi_major_axis =  6378.137;
     :semi_minor_axis =  6356.752;
     :inverse_flattening =   298.257;
~~~

This uses a spherical or ellipsoidal earth. See Snyder, p 98.

#### azimuthal_equidistant

~~~
char azimuthal_equidistant;
 :grid_mapping_name = "azimuthal_equidistant";
 :semi_major_axis = 6378137.0; // double
 :inverse_flattening =<PHONE_NUMBER>63; // double
 :longitude_of_prime_meridian = 0.0; // double
 :false_easting = 0.0; // double
 :false_northing = 0.0; // double
 :latitude_of_projection_origin = -37.0; // double
 :longitude_of_projection_origin = 145.0; // double
~~~

Adapted from proj4 jhlabs. See Snyder, p 191.

#### flat_earth

~~~
   char Flat_Earth;
     :grid_mapping_name = "flat_earth";
     :longitude_of_projection_origin = -132.0;
     :latitude_of_projection_origin = 40.0;
~~~

This is not a standard CF projection. It is used when a "flat earth" assumption is acceptable.

#### geostationary

~~~
   char Geostationary;
     :grid_mapping_name = "geostationary";
     :longitude_of_projection_origin = -97.0;
     :latitude_of_projection_origin = 0.0;
     :perspective_point_height= 33.0, 45.0;
     :false_easting = 0.0;
     :false_northing = 0.0;
     :earth_radius = 6371.229;
     :semi_major_axis =  6378.137;
     :semi_minor_axis =  6356.752;
     :inverse_flattening =   298.257;
     :sweep_angle_axis= 33.0, 45.0;
     :fixed_angle_axis= 33.0, 45.0;
~~~

This uses an ellipsoidal earth. Notes from CF:

* The _"perspective_point_height"_ is the distance to the surface of the ellipsoid. Adding the earth major axis gives the distance from the centre of the earth.
* The _"sweep_angle_axis"_ attribute indicates which axis the instrument sweeps. The value = "y" corresponds to the spin-stabilized Meteosat satellites, the value = "x" to the GOES-R satellite.
* The _"fixed_angle_axis"_ attribute indicates which axis the instrument is fixed. The values are opposite to "sweep_angle_axis". Only one of those two attributes are mandatory.

See CF adding geostationary. This projection covers both Eumetsat GEOS and US GOES-R satellites.

#### lambert_azimuthal_equal_area

~~~
   char Lambert_azimuth_Projection;
     :grid_mapping_name = "lambert_azimuthal_equal_area";
     :longitude_of_projection_origin = -32.0;
     :latitude_of_projection_origin = 90.0;
     :false_easting = 0.0; // km
     :false_northing = 0.0; // km
     :earth_radius = 6371.229;
~~~
This uses a spherical earth. See Snyder, p 184.

#### lambert_conformal_conic

~~~
   char Lambert_Conformal;
     :grid_mapping_name = "lambert_conformal_conic";
     :standard_parallel = 33.0, 45.0;   // one or two
     :longitude_of_central_meridian = -97.0;
     :latitude_of_projection_origin = 40.0;
     :false_easting = 0.0;
     :false_northing = 0.0;
     :earth_radius = 6371.229;
     :semi_major_axis =  6378.137;
     :semi_minor_axis =  6356.752;
     :inverse_flattening =   298.257;
~~~

This uses a spherical or ellipsoidal earth. See Snyder, p 104.

#### lambert_cylindrical_equal_area

~~~
char lambert_cylindrical_equal_area;
 :grid_mapping_name = "lambert_cylindrical_equal_area";
 :semi_major_axis = 6378137.0; // double
 :inverse_flattening =<PHONE_NUMBER>63; // double

 :longitude_of_central_meridian = 145.0; // double
 :false_easting = 0.0; // double
 :false_northing = 0.0; // double
 :standard_parallel = -37.0; // double
~~~

Adapted from proj4 / jhlabs. See Snyder, p 76. As of version 4.3.10

#### mcidas_area

~~~
   char McIDAS_Projection;
     :grid_mapping_name = "mcidas_area";
     :AreaHeader = 33.0, 45.0, ...;   // an integer array
     :NavHeader = -97.0, ...;     // an integer array
~~~

This is not a standard CF projection. The headers are read from a McIDAS Area file, and placed in the attributes as int arrays.

#### mercator

~~~
  char Mercator_Projection;
     :grid_mapping_name = "mercator";
     :longitude_of_projection_origin = 110.0;
     :latitude_of_projection_origin = -25.0;
     :standard_parallel = 0.02;
~~~

This uses a spherical earth and default radius. See Snyder, p 47.

#### MSGnavigation

Used for MSG (METEOSAT 8 onwards) data.

~~~
   char Space_View_Perspective_or_Orthographic;
     :grid_mapping_name = "MSGnavigation";
     :longitude_of_projection_origin = 0.0; // double
     :latitude_of_projection_origin = 0.0; // double
     :semi_major_axis = 6356755.5; // double
     :semi_minor_axis = 6378140.0; // double
     :height_from_earth_center = 4.2163970098E7; // double
     :scale_x = 35785.830098; // double
     :scale_y = -35785.830098; // double
~~~

This is not a standard CF projection. This uses an ellipsoidal earth. See this document. Note there is a bug in some versions of Eumetsat GRIB encoding, per Simon Eliot 1/18/2010, in which the "apparent diameter of earth in units of grid lengths" is incorrectly specified. We do a correction for this in ucar.nc2.iosp.grid.GridHorizCoordSys when we read the GRIB file.

#### orthographic

~~~
  char Orthographic_Projection;
     :grid_mapping_name = "orthographic";
     :longitude_of_projection_origin = 110.0;
     :latitude_of_projection_origin = -25.0;
~~~

This is not a standard CF projection. This uses a spherical earth and default radius. See Snyder, p 145.

#### polar_stereographic

~~~
   char Polar_Stereographic;
     :grid_mapping_name = "polar_stereographic";
     :straight_vertical_longitude_from_pole = -32.0;
     :latitude_of_projection_origin = 90.0;
     :scale_factor_at_projection_origin = 0.9330127018922193;
     :false_easting = 0.0;
     :false_northing = 0.0;
     :semi_major_axis =  6378.137;
     :semi_minor_axis =  6356.752;
     :inverse_flattening =   298.257;
~~~

The Polar Stereographic is the same as the Stereographic projection with origin at the north or south pole. It can use a spherical or ellipsoidal earth.

The polar stereographic will accept these alternate parameter names:

~~~
   char Polar_Stereographic;
     :grid_mapping_name = "polar_stereographic";
     :longitude_of_projection_origin = -32.0;
     :latitude_of_projection_origin = 90.0;
     :standard_parallel = 0.9330127018922193;
~~~

If the _standard_parallel_ is specified, this indicates the parallel where the scale factor = 1.0. In that case the projection scale factor is calculated as

~~~
 double sin = Math.abs(Math.sin( Math.toRadians( stdpar)));
 scale = (1.0 + sin)/2;
rotated_pole
 char rotated_pole;
    :grid_mapping_name = "rotated_latitude_longitude";
   :grid_north_pole_latitude = 37.0f; // float
   :grid_north_pole_longitude = -153.0f; // float
~~~

The rotated latitude and longitude coordinates are identified by the _standard_name_ attribute values _grid_latitude_ and _grid_longitude_ respectively. Example:

~~~
 float rlat(rlat=84);
     :standard_name = "grid_latitude";
     :long_name = "rotated latitude";
     :units = "degrees";
     :_CoordinateAxisType = "GeoY";
   float rlon(rlon=90);
     :standard_name = "grid_longitude";
     :long_name = "rotated longitude";
     :units = "degrees";
     :_CoordinateAxisType = "GeoX";
~~~

The rotated longitude coordinate must be in the range [-180,180] (so there will be a problem when it crosses the dateline). Code contributed by Robert Schmunk.

#### rotated_latlon_grib

Grib 1 projection 10 and Grib 2 projection 1. This is not a standard CF projection.

~~~
 char rotated_pole;
   :grid_mapping_name = "rotated_latlon_grib";
   :grid_south_pole_latitude = 37.0f; // float
   :grid_south_pole_longitude= -153.0f; // float
   :grid_south_pole_angle= 0.0f; // float
~~~

Contributed by Tor Christian Bekkvik.

#### sinusoidal

~~~
   char SinusoidalProjection;
     :grid_mapping_name = "sinusoidal";
     :longitude_of_central_meridian = 0.0; // required
     :false_easting = 0.0;
     :false_northing = 0.0;
     :earth_radius = 6371.229;
~~~

Spherical earth. See CF adding sinusoidal.

This projection is one of those selected by the ESA Climate Change Initiative, which will be reanalysing the MERIS, MODIS and SeaWiFS time series and producing netcdf-CF files.

#### stereographic

~~~
   char Stereographic;
     :grid_mapping_name = "stereographic";
     :longitude_of_projection_origin = -32.0;
     :latitude_of_projection_origin = 90.0;
     :scale_factor_at_projection_origin = 0.9330127018922193;
     :false_easting = 0.0;
     :false_northing = 0.0;
     :semi_major_axis =  6378.137;
     :semi_minor_axis =  6356.752;
     :inverse_flattening =   298.257;
~~~

This uses a spherical or ellipsoidal earth. See Snyder, p 153.

#### transverse_mercator

~~~
   char Transverse_mercator;
     :grid_mapping_name = "transverse_mercator";
     :longitude_of_central_meridian = -32.0;
     :latitude_of_projection_origin = 40.0;
     :scale_factor_at_central_meridian = 0.9330127018922193;
     :false_easting = 0.0;
     :false_northing = 0.0;
     :semi_major_axis =  6378.137;
     :semi_minor_axis =  6356.752;
     :inverse_flattening =   298.257;
     :_CoordinateTransformType = "Projection";
     :_CoordinateAxisTypes = "GeoX GeoY";
~~~

This uses a spherical or ellipsoidal earth. See Snyder, p 53.

#### UTM (Universal Transverse Mercator)

~~~
   char UTM_Projection;
     :grid_mapping_name = "universal_transverse_mercator";
     :utm_zone_number = 22;
     :semi_major_axis = 6378137;
     :inverse_flattening = 298.257;
     :_CoordinateTransformType = "Projection";
     :_CoordinateAxisTypes = "GeoX GeoY";
~~~

This is not a standard CF projection. UTM uses an ellipsoidal earth. Code contributed from the GeoTransform package by Dan Toms, SRI International. Note that semi_major_axis is in meters.

#### vertical_perspective

~~~
   char vertical_perspective_Projection;
     :grid_mapping_name = "vertical_perspective";
     :longitude_of_projection_origin = -97.0;
     :latitude_of_projection_origin = 40.0;
     :height_above_earth = 23980.0; // km
     :earth_radius = 6371.229;
     :false_easting = 0.0;
     :false_northing = 0.0;
     :_CoordinateTransformType = "Projection";
     :_CoordinateAxisTypes = "GeoX GeoY";
~~~

This uses a spherical earth. See Snyder, p 176.

repository: Unidata/netcdf-java

extension: md

gha_language: Java

license_type: permissive

repo_name: Unidata/netcdf-java


text:
# gittinit
View solutions from g32 classmate GitHub repos to get new ideas or become unstuck on assignments.  Gittinit allows a user to view and access public repos of all g32 team members.  It also allows the user to edit some of his/her GitHub profile information, and view the profile information of team members.  Technologies used include Node.js, Express.js, GitHub API and Oauth, Passport, PostgreSQL, Knex, Materialize, and Heroku for deployment.  We also used Meistertask to organize workflow and team member assignments.

A major challenge we encountered with the GitHub API was permissions: the Galvanize organization and associated teams are private, which limited our access to repos via the GitHub API.  Ultimately, we were limited to showing our team members' public repos.  As many of us have made our individual repos public, however, we still have access to a wide variety of files, and Gittinit makes referencing a teammate's code easy and quick.

## Installation
None! Most modern browsers should function as expected when visiting the [page](https://gittinit.herokuapp.com/).

## Usage
Log in and select your peer to see stats about their GitHub account and view a list of their public repositories.

## License
This project is licensed under the MIT License - see the [LICENSE](https://raw.github.com/bamason/gittinit/master/LICENSE) file for details

license: MIT

branch_name: refs/heads/master


text:
# NEC_scripts
Various python scripts for working with and creating .nec files

Run `python bicone.py` to create a directory of bicones at different frequency. Used specifically for 4nec2 to create many .out files for radiation data for different frequencies.

Otherwise, passing `build_nec_file` method in `build_nec_file.py` a list where each element is a .nec card (formatted as list with each element being a column for that card).

The method `reformat` will take a .nec file and properly format it by adding in the proper whitespace between columns and substituting in and then evaluating any variables in the files under the SY card.

branch_name: refs/heads/main


text:
# cpubars

inspired by [spark](https://github.com/holman/spark), this shows your
cpu utilization for each core as a sparkline

```
$ cpubars
________█___█___
```

repository: qmx/cpubars

gha_language: Roff

gha_license_id: MIT

repo_name: qmx/cpubars


text:
# Sitting solver

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Sitting solver aspires to be a good SAT solver in the future.

Resources about SAT solvers:
 - The [Wikipedia page for DPLL] has a concise recursive formulation of the
   basic DPLL algorithm
 - This [series of blog posts] has good explanations of the ideas behind DPLL,
   clause learning, and the two watched literals scheme, but be aware that their
   implementation of clause learning without conflict analysis isn't great
 - This [SAT tutorial paper] is pretty good too; it has simple code examples
   with thorough explanations.  I found its explanation of conflict analysis and
   backjumping particularly useful.
 - [The original MiniSAT paper] is also helpful
 - [SATLIB] and the annual [SAT competitions] have huge catalogs of SAT
   benchmarks, in a [convenient format]

[Wikipedia page for DPLL]: https://en.wikipedia.org/wiki/DPLL_algorithm
[series of blog posts]: https://haz-tech.blogspot.com/2010/07/sat-solving-basics.html
[SAT tutorial paper]: http://poincare.matf.bg.ac.rs/~filip/phd/sat-tutorial.pdf
[The original MiniSAT paper]: http://minisat.se/downloads/MiniSat.pdf
[SATLIB]: https://www.cs.ubc.ca/~hoos/SATLIB/
[SAT Competitions]: https://satcompetition.github.io/
[convenient format]: http://www.satcompetition.org/2011/format-benchmarks2011.html

To do:
 - [x] Main DPLL loop
 - [x] Watched literals
 - [x] Pre-processing
 - [x] Post-processing
 - [x] Conflict analysis and conflict-driven clause learning
 - [ ] Conflict-clause minimization
 - [ ] Update the heuristic: VSIDS
 - [x] Backjumping
 - [x] Limits for clause learning, + heuristic for which learned clauses to keep
 - [ ] Restarts?
 - [ ] Profiling + optimization
 - [ ] Automated testing infrastructure
 - [ ] Better docs

In the (far) future, I hope to extend it to a simple [DPLL(T)] SMT solver. This
would involve:
 - The Tseitin transformation
 - A special preprocessing mode for DPLL(T)
 - Likely a special postprocessing mode, too
 - Extensions to the main DPLL solver to allow feedback from the theory solver
 - Theory solvers: [LRA], congruence closure for UF
 - Theory-specific preprocessing?
 - Something about quantifiers and E-graphs, idk
 - Would also be cool to have: NRA by [ICP + LRA] or [CAD], LIA somehow

[DPLL(T)]: https://en.wikipedia.org/wiki/DPLL(T)
[LRA]: https://yices.csl.sri.com/papers/cav06.pdf
[ICP + LRA]: https://www.cs.colorado.edu/~srirams/papers/FMCAD10.PDF
[CAD]: http://leodemoura.github.io/files/IJCAR2012.pdf


text:
### [CVE-2019-9638](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9638)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

An issue was discovered in the EXIF component in PHP before 7.1.27, 7.2.x before 7.2.16, and 7.3.x before 7.3.3. There is an uninitialized read in exif_process_IFD_in_MAKERNOTE because of mishandling the maker_note->offset relationship to value_len.

### POC

#### Reference
- https://hackerone.com/reports/516237

#### Github
- https://github.com/syadg123/pigat
- https://github.com/teamssix/pigat

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
---
name: Support Request
about: Get help with a problem
title: ''
labels: Support
assignees: ''

---

<!--------------------------------------------------------------
PLEASE CHECK THE TROUBLESHOOTING GUIDE FIRST
https://symfony.com/bundles/SchebTwoFactorBundle/current/troubleshooting.html
--------------------------------------------------------------->

**Bundle version**: x.y.z
**Symfony version**: x.y.z
**PHP version**: x.y.z
**Using authenticators** (`enable_authenticator_manager: true`): YES / NO

**Description**

<!--
Please describe what you're trying to do and where you're getting stuck.
Which approaches did you try out so far?
If you used the troubleshooting guide, how far did you reach and what did you discover?
-->

**Additional Context**

<!--
Please provide the
- the bundle configuration
- content of your security.yaml
-->

<!-- Optional: Any other context to help understanding the problem: log messages, screenshots, etc. -->

gha_language: PHP


text:
# Azure Tables output plugin for [Fluentd](http://www.fluentd.org/)

## Installation

```ruby
fluent-gem install fluent-plugin-azuretables
```

## Usage

### Configuration
```
<match azuretables.**>
  type azuretables
  account_name AZURE_STORAGE_ACCOUNT
  access_key AZURE_STORAGE_ACCESS_KEY
  table YOUR_TABLE_NAME
  detach_process 6
  create_table_if_not_exists false
  partition_keys test-partition-key-01,test-partition-key-02
  row_keys rk1 test-row-key-01,test-row-key-02
  key_delimiter __
</match>
```

* type (required) - azuretables
* account_name (required) - AZURE_STORAGE_ACCOUNT (from your Azure portal).
* access_key (required) - AZURE_STORAGE_ACCESS_KEY (from your Azure portal).
* table (required) - table name where you want to store event records.
* detach_process (optional) - number of processes. You can launch multiprocessing if you need high throughput.
* create_table_if_not_exists (optional) - Set __true__ if you want create table if it doesn't exist. Default: __false__.
* partition_keys (optional) - A string with comma delimiter.List of properties which are used to create a composite __PartitionKey__.
* row_keys (optional) - A string with comma delimiter.List of properties which are used to create a composite __RowKey__.
* key_delimiter (optional) - A string becomes delimiter of partition key and row key in table. Default: "__" (underscores x2)

## TODO

## Contributing
Bug reports and pull requests are welcome on GitHub at [https://github.com/heocoi/fluent-plugin-azuretables](https://github.com/heocoi/fluent-plugin-azuretables).


text:
# Exercise 8 - Tower API Job Launch

We can call into Ansible Tower via the API to run a job template for us.

We'll use the linux-accounts.yml example we did earlier to demonstate this.

## Adding The Job Template:

### Step 1:

Select TEMPLATES

### Step 2:

Click on ADD ![Add button](at_add.png), and select JOB TEMPLATE

### Step 3:

Complete the form using the following values

NAME |Linux Account Admin Template
-----|-------------------------
DESCRIPTION|Template for the Linux user account admin tasks
JOB TYPE|Run
INVENTORY|Ansible Workshop Inventory
PROJECT|Supplementary Project
PLAYBOOK|tower/linux-accounts.yml
MACHINE CREDENTIAL|Ansible Workshop Credential
LIMIT|web
OPTIONS|- [x] Enable Privilege Escalation
PROMPT ON LAUNCH|- [x] Job Tags
PROMPT ON LAUNCH|- [x] Extra Variables

## Job Launch Settings:

## Launching The Job:

We'll use the *curl* command to launch the job. It's a bit of a handful but let's break it down, so it's easier to understand:

```bash
-- user:    who we authenticate as. In our case the admin account
-k:         insecure HTTPS. So we don't check for valid certs
-s:         silent mode. Cuts out some of the not so -useful curl output we don't want
-H:         HTTP JSON MIME type headers. We need to POST in the extra_vars and job_tags so the job will run successfully
```

NB. You will need to check and change where necessary the PUBLIC_IP for your Tower instance and the Job Template number (mine here is 8)

Lastly, we use a little bit of python magic to prettify the output, making it more readable.

```bash
$ curl --user 'admin':'ansible' -k -s -H 'Content-Type: application/json' -XPOST -d '{"extra_vars":"{\"account\":\"fred\"}","job_tags":"disable"}' https://<IP_ADDRESS>/api/v2/job_templates/8/launch/ | python -m json.tool
```

You should see output similar to this:

```bash
{
    "allow_simultaneous": false,
    "artifacts": {},
    "ask_credential_on_launch": false,
    "ask_diff_mode_on_launch": false,
    "ask_inventory_on_launch": false,
    "ask_job_type_on_launch": false,
    "ask_limit_on_launch": false,
    "ask_skip_tags_on_launch": false,
    "ask_tags_on_launch": true,
    "ask_variables_on_launch": true,
    "ask_verbosity_on_launch": false,
    "controller_node": "",
    "created": "2019-02-25T19:24:29.041943Z",
    "credential": 2,
    "description": "",
    "diff_mode": false,
    "elapsed": 0.0,
    "event_processing_finished": false,
    "execution_node": "",
    "extra_vars": "{\"account\": \"fred\"}",
    "failed": false,
    "finished": null,
    "force_handlers": false,
    "forks": 1,
    "id": 6,
    "ignored_fields": {},
    "instance_group": null,
    "inventory": 2,
    "job": 6,
    "job_args": "",
    "job_cwd": "",
    "job_env": {},
    "job_explanation": "",
    "job_slice_count": 1,
    "job_slice_number": 0,
    "job_tags": "disable",
    "job_template": 8,
    "job_type": "run",
    "launch_type": "manual",
    "limit": "web",
    "modified": "2019-02-25T19:24:29.103024Z",
    "name": "Linux Account Admin Template",
    "passwords_needed_to_start": [],
    "playbook": "tower/linux-accounts.yml",
    "project": 6,
    "related": {
        "activity_stream": "/api/v2/jobs/6/activity_stream/",
        "cancel": "/api/v2/jobs/6/cancel/",
        "create_schedule": "/api/v2/jobs/6/create_schedule/",
        "created_by": "/api/v2/users/1/",
        "credential": "/api/v2/credentials/2/",
        "credentials": "/api/v2/jobs/6/credentials/",
        "extra_credentials": "/api/v2/jobs/6/extra_credentials/",
        "inventory": "/api/v2/inventories/2/",
        "job_events": "/api/v2/jobs/6/job_events/",
        "job_host_summaries": "/api/v2/jobs/6/job_host_summaries/",
        "job_template": "/api/v2/job_templates/8/",
        "labels": "/api/v2/jobs/6/labels/",
        "modified_by": "/api/v2/users/1/",
        "notifications": "/api/v2/jobs/6/notifications/",
        "project": "/api/v2/projects/6/",
        "relaunch": "/api/v2/jobs/6/relaunch/",
        "stdout": "/api/v2/jobs/6/stdout/",
        "unified_job_template": "/api/v2/job_templates/8/"
    },
    "result_traceback": "",
    "scm_revision": "",
    "skip_tags": "",
    "start_at_task": "",
    "started": null,
    "status": "pending",
    "summary_fields": {
        "created_by": {
            "first_name": "",
            "id": 1,
            "last_name": "",
            "username": "admin"
        },
        "credential": {
            "cloud": false,
            "credential_type_id": 1,
            "description": "",
            "id": 2,
            "kind": "ssh",
            "name": "Ansible Workshop Credential"
        },
        "credentials": [
            {
                "cloud": false,
                "credential_type_id": 1,
                "description": "",
                "id": 2,
                "kind": "ssh",
                "name": "Ansible Workshop Credential"
            }
        ],
        "extra_credentials": [],
        "inventory": {
            "description": "",
            "groups_with_active_failures": 0,
            "has_active_failures": false,
            "has_inventory_sources": false,
            "hosts_with_active_failures": 0,
            "id": 2,
            "inventory_sources_with_failures": 0,
            "kind": "",
            "name": "Ansible Workshop Inventory",
            "organization_id": 1,
            "total_groups": 2,
            "total_hosts": 4,
            "total_inventory_sources": 0
        },
        "job_template": {
            "description": "",
            "id": 8,
            "name": "Linux Account Admin Template"
        },
        "labels": {
            "count": 0,
            "results": []
        },
        "modified_by": {
            "first_name": "",
            "id": 1,
            "last_name": "",
            "username": "admin"
        },
        "project": {
            "description": "",
            "id": 6,
            "name": "Supplementary Workshop",
            "scm_type": "git",
            "status": "successful"
        },
        "unified_job_template": {
            "description": "",
            "id": 8,
            "name": "Linux Account Admin Template",
            "unified_job_type": "job"
        },
        "user_capabilities": {
            "delete": true,
            "start": true
        }
    },
    "timeout": 0,
    "type": "job",
    "unified_job_template": 8,
    "url": "/api/v2/jobs/6/",
    "use_fact_cache": false,
    "vault_credential": null,
    "verbosity": 0
}
```

## Checking The Job

From the above output, I can see that "job": 6 so that's what I should look for in Tower under Jobs.

## End Result
We've explored the Tower API *Job Launch* facility in order to run a job template.

---

[Click Here to return to the Ansible Lightbulb - Ansible Tower Workshop](../README.md)

repository: yellowpark/linklight

repo_name: yellowpark/linklight


text:
---
uid: circuit-breaker
title: Circuit Breaker
---
# Circuit Breaker

## Why Are They Used?

A circuit breaker is used to provide stability and prevent cascading failures in distributed systems. These should be used in conjunction with judicious timeouts at the interfaces between remote systems to prevent the failure of a single component from bringing down all components.

As an example, we have a web application interacting with a remote third party web service. Let's say the third party has oversold their capacity and their database melts down under load. Assume that the database fails in such a way that it takes a very long time to hand back an error to the third party web service. This in turn makes calls fail after a long period of time. Back to our web application, the users have noticed that their form submissions take much longer seeming to hang. Well the users do what they know to do which is use the refresh button, adding more requests to their already running requests. This eventually causes the failure of the web application due to resource exhaustion. This will affect all users, even those who are not using functionality dependent on this third party web service.

Introducing circuit breakers on the web service call would cause the requests to begin to fail-fast, letting the user know that something is wrong and that they need not refresh their request. This also confines the failure behavior to only those users that are using functionality dependent on the third party, other users are no longer affected as there is no resource exhaustion. Circuit breakers can also allow savvy developers to mark portions of the site that use the functionality unavailable, or perhaps show some cached content as appropriate while the breaker is open.

The Akka.NET library provides an implementation of a circuit breaker called `Akka.Pattern.CircuitBreaker` which has the behavior described below.

## What Do They Do?

* During normal operation, a circuit breaker is in the `Closed` state:
  * Exceptions or calls exceeding the configured `СallTimeout` increment a failure counter
  * Successes reset the failure count to zero
  * When the failure counter reaches a `MaxFailures` count, the breaker is tripped into `Open` state
* While in `Open` state:
  * All calls fail-fast with a `OpenCircuitException`
  * After the configured `ResetTimeout`, the circuit breaker enters a `Half-Open` state
* In `Half-Open` state:
  * The first call attempted is allowed through without failing fast
  * All other calls fail-fast with an exception just as in `Open` state
  * If the first call succeeds, the breaker is reset back to `Closed` state and the `ResetTimeout` is reset
  * If the first call fails, the breaker is tripped again into the `Open` state (as for exponential backoff circuit breaker, the `ResetTimeout` is multiplied by the exponential backoff factor)
* State transition listeners:
  * Callbacks can be provided for every state entry via `OnOpen`, `OnClose`, and `OnHalfOpen`
  * These are executed in the `ExecutionContext` provided.

![Circuit breaker states](/images/circuit-breaker-states.png)

## Examples

### Initialization

Here's how a `CircuitBreaker` would be configured for:

* 5 maximum failures
* a call timeout of 10 seconds
* a reset timeout of 1 minute

[!code-csharp[Main](../../../src/core/Akka.Docs.Tests/Utilities/CircuitBreakerDocSpec.cs?name=circuit-breaker-usage)]

### Call Protection

Here's how the `CircuitBreaker` would be used to protect an asynchronous
call as well as a synchronous one:

[!code-csharp[Main](../../../src/core/Akka.Docs.Tests/Utilities/CircuitBreakerDocSpec.cs?name=call-protection)]

```csharp
dangerousActor.Tell("is my middle name");
// This really isn't that dangerous of a call after all

dangerousActor.Tell("block for me");
dangerousActor.Tell("block for me");
dangerousActor.Tell("block for me");
dangerousActor.Tell("block for me");
dangerousActor.Tell("block for me");

// My CircuitBreaker is now open, and will not close for one minute

// My CircuitBreaker is now half-open

dangerousActor.Tell("is my middle name");
// My CircuitBreaker is now closed
// This really isn't that dangerous of a call after all
```

### Tell Pattern

The above ``Call Protection`` pattern works well when the return from a remote call is wrapped in a ``Future``. However, when a remote call sends back a message or timeout to the caller ``Actor``, the ``Call Protection`` pattern is awkward. CircuitBreaker doesn't support it natively at the moment, so you need to use below low-level power-user APIs, ``succeed``  and  ``fail`` methods, as well as ``isClose``, ``isOpen``, ``isHalfOpen``.

>[!NOTE]
>The below examples doesn't make a remote call when the state is `HalfOpen`. Using the power-user APIs, it is your responsibility to judge when to make remote calls in `HalfOpen`.

[!code-csharp[Main](../../../src/core/Akka.Docs.Tests/Utilities/CircuitBreakerDocSpec.cs?name=circuit-breaker-tell-pattern)]

branch_name: refs/heads/dev

gha_language: C#

gha_license_id: NOASSERTION


text:
# Cyber-RSA

A Python package to generate Cipher.

## Usage

RSA is an asymmetric system ,
which means that a key pair will be generated ,
a public key and a private key ,
obviously you keep your private key secure and pass around the public one.

```
  Import CyberRSA

  encoded = encrypt(message, PublicKey())
  decoded = decrypt(encoded, PrivateKey())

  message- Message to encrypt

  PublicKey - To read the public key from PEM file.

  PrivateKey - To read the Private key from PEM file.

  generate_keys() - Using this function we can generate public key and private key PEM file in oneshot (PEM file available in parent directory of the python script).

  encoded - Encrypted message send across network.

  decoded - Decrypted message.

```

repository: IamSantoshKumar/Cyber-RSA

repo_name: IamSantoshKumar/Cyber-RSA


text:
# Python SNMP Servers

Researching simple pure Python SNMP Server options

## Notes

This is just a quick scan to see whether therre are any decent SMPN server implementations in python.

tldr: not really

### Options

A [quick search](https://pypi.org/search/?q=snmp+server) didn't bring much joy. My short-list after a bit more research:

* [snmp-agent](https://pypi.org/project/snmp-agent/) - experimental and minimal SNMP Server implementation.
* [pytest-snmpserver](https://pypi.org/project/pytest-snmpserver/) SNMP server as a pytest plugin
  * I suspect based on [snmp-server](https://github.com/delimitry/snmp-server) however the versions are not aligned, and the egg version does not contain an SNMP server that can be run stand-alone

### Inspecting pytest-snmpserver

Get the source distribution from [pytest-snmpserver](https://pypi.org/project/pytest-snmpserver/)

```
echo "pytest_snmpserver-0.1.9.tar.gz" >> .gitignore
wget https://files.pythonhosted.org/packages/2c/62/da8d213b6f2fc3ef8ab65c0f1df51e21d82a5fbe8c114ff8bf15a3d9eac8/pytest_snmpserver-0.1.9.tar.gz
tar zxvf pytest_snmpserver-0.1.9.tar.gz
```

Inspecting `pytest_snmpserver-0.1.9/pytest_snmpserver/snmp_server.py` and unfortunately it is hard-coded to
run on a specific port and expect a specific request, so not suitable for stand-alone use.

### Using snmp-server

The [snmp-server](https://github.com/delimitry/snmp-server) project on GitHub has a simple pure-python SNMP server.

I *believe* that the [pytest-snmpserver](https://pypi.org/project/pytest-snmpserver/) egg is based on this project,
however the versions are not aligned, and the egg version does not contain an SNMP server that can be run stand-alone

However rhe [snmp-server](https://github.com/delimitry/snmp-server) does run stand-alone...

#### Installing Requirements

This is not distributed as an egg, so installing and running from source.

Just need to clone the repo:

```
$ echo "snmp-server" >> .gitignore
$ python --version
Python 3.7.3
$ git clone git@github.com:delimitry/snmp-server.git
```

#### Running the SNMP Server

```
$ cd snmp-server
$ python snmp-server.py -p 7161
snmp-server.py:18: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Iterable
SNMP server listening on <IP_ADDRESS>:7161
```

#### Testing with snmp cli

$ snmpget -v 2c -c public <IP_ADDRESS>:7161 <IP_ADDRESS>.<IP_ADDRESS>.9.10.11
iso.<IP_ADDRESS>.<IP_ADDRESS>.10.11 = STRING: "<IP_ADDRESS>.<IP_ADDRESS>.9.10.11"

$ snmpwalk -v 2c -c public <IP_ADDRESS>:7161 <IP_ADDRESS>.<IP_ADDRESS>.9.10.12
iso.<IP_ADDRESS>.<IP_ADDRESS>.10.12 = STRING: "<IP_ADDRESS>.<IP_ADDRESS>.9.10.12"

## Credits and References

* [snmp-server](https://github.com/delimitry/snmp-server) - github
* [pytest-snmpserver](https://pypi.org/project/pytest-snmpserver/) - pypi

repository: tardate/LittleCodingKata

repo_name: tardate/LittleCodingKata


text:
# NEPSENSE
Complete NEPSE solution in command line

https://user-images.githubusercontent.com/52292457/123535784-e636d300-d745-11eb-9fe3-3ad4b8e21078.mp4

## Installation
```console
pip install nepsense
````
After the installation you can use the cli application with the priceof command

## Usage
```console
usage: priceof [-h] [-c  [...]] [-f [path ...]] [-n] [-s] [-m symbol] [-ms] [-d] [-cu] [-ci] [--losers] [--gainers]
[--supply] [--demand] [--turnover] [--volume] [--transactions]

STONK, complete NEPSE solution in command line

optional arguments:
  -h, --help            show this help message and exit
  -c  [ ...], --company  [ ...]
                        symbols of companies seperated by space
  -f [path ...], --floorsheet [path ...]
                        Saves today's floorsheet as a csv file You can specify the path as argument. if no argument
                        is provided the csv file will be saved in the current directory
  -n, --nepse           get NEPSE index
  -s, --sub-indices     get subindices
  -m symbol, --market_depth symbol
                        get market depth of a company
  -ms, --market_summary
                        get market summary
  -d , --get_detail     get the non price related detail of the company
  -cu , --custom        custom list in data.py
  -ci , --change_index
                        change the value of id sent as a payload in the post request
  --losers              get the top losers
  --gainers             get the top gainers
  --supply              get the scripts with maximum supply
  --demand              get the scripts with maximum demand
  --turnover            get the scripts with maximum turnover
  --volume              get the scripts with maximum volume
  --transactions        get the scripts with maximum transactions
```

## Please change the index with -ci flag.
If you get this type of message when using the cli. Review the following video

https://user-images.githubusercontent.com/52292457/123106754-a1b2eb00-d458-11eb-924c-591f24bcb4e2.mp4

Since i can't afford to pay for the nepse api(I don't think I would, even if I could, but anyways).
There are some caveats to retrieving data from api endpoints from the nepse's newweb website. Nepse decided
to change the request method for some api endpoints from get to post. The payload sent along with the
post request changes randomly at different intervals.
The payload looks like
```
{
  "id" : 123
}
```
Here 123 is a random number. This number can be changed using the -ci flag. To get the id we have to
inspect the network traffic while loading the nepse's newweb website. This is demonstrated in the video above

## Floorsheet
```
priceof -f [path]
```
You can either specify a path or leave it blank. If you leave it blank the floorsheet csv file will be
saved in you current directory. The floorsheet file will be saved as floorsheet_todaysdate_weekday.csv
You can do different kind of analysis on the data using the floorsheet.ipynb notebook.

You can also use my public google collab notebook

https://colab.research.google.com/drive/1DrH_DDVKujF6_bVSOfDWZfwUlvNgV35n#scrollTo=_TS2KwMRPf2S

repository: diseezneal/NEPSENSE

repo_name: diseezneal/NEPSENSE


text:
---
title: Cluster Profiles
authors:
  - "@csrwng"
reviewers:
  - "@abhinavdahiya"
  - "@crawford"
  - "@sdodson"
  - "@derekwaynecarr"
  - "@smarterclayton"
approvers:
  - "@derekwaynecarr"
  - "@smarterclayton"
creation-date: 2020-02-04
last-updated: 2020-08-05
status: implementable
see-also:
  - "/enhancements/update/ibm-public-cloud-support.md"
replaces:
superseded-by:
---

# cluster-profiles

## Release Signoff Checklist

- [x] Enhancement is `implementable`
- [ ] Design details are appropriately documented from clear requirements
- [ ] Test plan is defined
- [ ] Graduation criteria for dev preview, tech preview, GA
- [ ] User-facing documentation is created in [openshift/docs]

## Summary

Cluster profiles are a way to support different deployment models for OpenShift clusters.
A profile is an identifier that the Cluster Version Operator uses to determine
which manifests to apply. Operators can be excluded completely or can have different
manifests for each supported profile.

## Motivation

To support different a deployment model in which not all operators rendered by
the CVO by default are needed.  Every usage of a Cluster Profile MUST have a corresponding
enhancement describing its usage.

The initial target for this enhancement is to improve the IBM Cloud managed service offering
to support alternative manifests for clusters that do not self-host the control plane.  Other
scenarios may use this solution (such as Code Ready Containers) pending future enhancements.

Alternative manfiests for any OpenShift release component must link to an enhancement that
defines the profile type and intended usage.

### Goals

- Equip the CVO to include/exclude manifests based on a matching identifier (profile)

### Non-Goals

- Define which manifests should be excluded/included for each use case

## Proposal

### User Stories

#### Story 1
As a user, I can create a cluster in which manifests for control plane operators are
not applied by the CVO.

#### Story 2
As a user, I can create a cluster in which node selectors for certain operators target
worker nodes instead of master nodes.

### Design

#### Cluster profile annotation

The following annotation may be used to include manifests for a given profile:

```text
include.release.openshift.io/[identifier]=true
```

Manifests may support inclusion in multiple profiles by including as many of these annotations
as needed.

For items such as node selectors that need to vary based on a profile, different manifests
will need to be created to support each variation in the node selector. This feature will
not support including/excluding sections of a manifest. In order to avoid drift and
maintenance burden, components may use a templating solution such as kustomize to generate
the required manifests while keeping a single master source.

The current installation profile is called `self-managed-high-availability`. All current
manifests must specify it. Future profiles may choose.

#### Design Details

A cluster profile is specified to the CVO as an identifier an environment variable.

```text
CLUSTER_PROFILE=[identifier]
```

For a given cluster, only one cluster profile may be in effect.

The profile is a set-once property and cannot be changed once the cluster has started.

The cluster-version-operator picks the value for the cluster profile according to this order:
* if it is defined and not empty, the environment variable,
* otherwise, the default profile `self-managed-high-availability`.

Clusters in a version unaware of the cluster profile must upgrade to the `self-managed-high-availability` profile.

When upgrading, outgoing CVO will forward the cluster profile information to the incoming CVO with the environment variable.

`include.release.openshift.io/[identifier]=true` would make the CVO render this manifest only when `CLUSTER_PROFILE=[identifier]`
has been specified.

##### Usage

###### Without the installer

IBM Cloud and others platforms that are managing their own deployment of the CVO should pass the env. variable.
For instance, IBM Cloud already uses `EXCLUDE_MANIFESTS` env. variable. Cluster profile will be set like this env. variable.

Upgrade will have to preserve the initial cluster profile.

###### With the installer

This method will be used by CodeReady Containers and single-node production edge clusters.

Users must set `OPENSHIFT_INSTALL_EXPERIMENTAL_CLUSTER_PROFILE` env. variable in their shell before running the installer if they want to use non-default profile.

Example:
```console
$ OPENSHIFT_INSTALL_EXPERIMENTAL_CLUSTER_PROFILE=single-node-developer openshift-install create manifest
$ OPENSHIFT_INSTALL_EXPERIMENTAL_CLUSTER_PROFILE=single-node-developer openshift-install create cluster
```

##### Release phases

The `CLUSTER_PROFILE` env. variable will break the upgrade as this new template variable in CVO manifests is not known by outgoing CVO.
This requires to deploy cluster profile in 2 phases.

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: bootstrap-cluster-version-operator
  namespace: openshift-cluster-version
...
    env:
      - name: CLUSTER_PROFILE
        value: "{{.ClusterProfile}}"
```

###### Phase 1

* Add the cluster profile `ClusterProfile` in the [`manifestRenderConfig`](https://github.com/openshift/cluster-version-operator/blob/b59561c40240d2a52048923b1b94ed7385cab957/pkg/payload/render.go#L104) object used to render all manifests (esp. CVO manifests).
* Read the env. variable and select manifests with the right include property `include.release.openshift.io/[identifier]=true`.
  It will default to `self-managed-high-availability` in this phase.

This will probably need to be backported.

###### Phase 2

* Add the cluster profile env. variable in CVO manifests,
* Operators can add manifests for the non-default profile.

## Implementation History

* Teach cluster-version operator about profiles, [cvo#404](https://github.com/openshift/cluster-version-operator/pull/404), in flight.

## Alternatives

A potential use for this enhancement would be to include/exclude certain operators based on
the hardware platform, as in the case of the baremetal operator.  However, the general problem
with this use for profiles is that it expands the scope of the templating the payload provides.
The current profile proposes exactly 2 variants decided at install time, and they impact
how the core operator works as well as how SLOs are deployed or included.
If we expanded this to include operators that are determined by infrastructure, then we're
potentially introducing a new variable (not just a new profile), since we very well may want
to deploy bare metal operator in a hypershift mode.

repository: openshift/enhancements

gha_language: Go

repo_name: openshift/enhancements


text:
---
name: 🐛 Bug Report
about: File a bug report, if you've discovered a problem in Bolt's code.
---

A brief description of the issue goes here.

<!--

If you haven't yet done so, please read the "contributing guidelines"
thoroughly. Then, proceed by filling out the rest of the details in the issue
template below. The more details you can give us, the easier it will be for us
to determine the cause of a problem.

See: https://github.com/bolt/bolt/blob/master/.github/CONTRIBUTING.md

-->

Details
-------

| Question                      | Answer
|----------------- | ------
| Relevant Bolt Version | legacy / 3.5 / 3.6 / master
| Install type                   |  Zip or tar install / Composer install / GitHub checkout
| BC Break                     | yes/no
| PHP version                 | 5.5 / 5.6 / 7.0 / 7.1 / 7.2
| Web server                  | Apache / Nginx / Built-in, version [ version ]
| For UX/UI issues        | Browser name and version

Reproduction
------------

If you're filing a bug, please describe how to reproduce it. Include as much
relevant information as possible, such as:

### Bug summary

<!--
    * Write a short summary of the bug
    * Try to pinpoint it as much as possible
    * Try to state the _actual problem_, and not just what you _think_ the
      solution might be.
-->

### Specifics

<!--
    * Mention the URL where this bug occurs, if applicable
    * What version of Bolt are you using (down to the very last digit!)
    * What method did you use to install Bolt
    * What browser and version you are using
    * Please mention if you've checked it in other browsers as well
    * Please include *full error messages* and *screenshots* if possible
-->

### Steps to reproduce

<!--
    * Clearly mention the steps to reproduce the bug
-->

### Expected result

<!--
    * What did you _expect_ that would happen on your Bolt site?
    * Describe the intended/desired outcome after you did the steps mentioned.
-->

### Actual result

<!--
    * What is the actual result of the above steps?
    * Describe the behaviour of the bug
    * Please, please include **error messages** and screenshots. They might mean
      nothing to you, but they are _very_ helpful to us.
-->

repository: bolt/bolt

repo_name: bolt/bolt


text:
### Questions

1. Why choose Redux instead of the Context API for global state?
    for largert projects Redux handles things cleanly, but is a little chunky for small apps.
2. What is the purpose of a reducer?
    takes an action and makes changes to global state based on actions
3. What does an action contain?
    type and payload
4. Why do we need to copy the state in a red

### Vocab
immutable state - state that is not able to be affected
time travel in redux - stepping back through the history of state management actions
action creator - basically a constructor to generate actions to be sent to the reducer
reducer - takes in actions and makes state updates accordingly
dispatch - proccess of taking an action and sending it to the reducer

### Preview

Which 3 things had you heard about previously and now have better clarity on?
    reduc store, reducers, chaining reducers
Which 3 things are you hoping to learn more about in the upcoming lecture/demo?
    how to render the damn cart button, integrating auth/local; storage into the redux system
What are you most excited about trying to implement or see how it works?
     getting a clean and responsive version of this

repository: TrunkOfUkuleles/reading-notes

repo_name: TrunkOfUkuleles/reading-notes


text:
# Daycation iOS v1

Daycation iOS v1 is a native iPhone mobile app built on the OuterSpatial platform. Daycation is brought to locals and visitors to Portland by the Intertwine Alliance.

The Intertwine Alliance (Intertwine) is a coalition of private firms, public agencies and nonprofit organizations working together to tap new sources of funding, better leverage existing investments, and more fully engage residents with the outdoors and nature in the Portland Metro region.

Check out this Daycation page on the Intertwine website for more information:

http://www.theintertwine.org/projects/daycation-mobile-app

Also, here is a video that describes Daycation:

https://www.youtube.com/watch?v=dR5r3yHrC4k&feature=youtu.be

Here are a few screenshots of Daycation:

![Screenshots](https://github.com/trailheadlabs/daycation-ios/blob/master/.github/Screen%20Shot%202017-04-05%20at%201.45.47%20PM.png?raw=true)

repository: trailheadlabs/daycation-ios

repo_name: trailheadlabs/daycation-ios


text:
## Basic Setup

We are using [pipenv](https://github.com/pypa/pipenv) as development workflow for Python. But if don't want it, or you have already installed boto3 globally then you can directly run the script, like
```sh
# Not recomendded but easier to start with
# Installing boto3 globally
# sudo pip3 install boto3
python get_tagged_resources.py -h
```

#### Setting up pipenv
- Installing pipenv

For Ubuntu 18.04
```sh
echo 'export PATH="${HOME}/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
sudo apt install python3-pip
python3 -m pip install --user pipenv

# https://gist.github.com/planetceres/8adb62494717c71e93c96d8adad26f5c#troubleshooting-and-removal
```
For Ubuntu 20.04
```sh
sudo apt install pipenv
```
For Mac
```sh
brew install pipenv
```
- Setting up venv (by Pipenev)
```sh
pipenv install --three
# Should install boto3 also as it reads Pipfile automatically
```
- Activate venv or run directly
```sh
# activates venv on the shell
pipenv shell
# then you can run script
python get_tagged_resources.py -h
# You can directly run script with
pipenv run python get_tagged_resources.py -h
```

## get_tagged_resources.py
This python script filters resources based on a tag and output it to a file in csv format.
```
# will now output all elasticache nodes with ProductDomain tag absent
python get_tagged_resources.py --resource-type elasticache -file untagged_pd.csv --tag ProductDomain
# Get help printed
python get_tagged_resources.py -h
```

repository: rahulwa/aRustyTry

gha_language: Python

repo_name: rahulwa/aRustyTry


text:
# Development Tools Installation

1. Install the Microchip `MPLAB X` Tool Chain

- [MPLAB X IDE](https://www.microchip.com/mplab/mplab-x-ide)

- [MPLAB XC16 Compiler](https://www.microchip.com/en-us/development-tools-tools-and-software/mplab-xc-compilers#tabs)

- `MPLAB Code Configurator` (launch MPLAB X IDE > click on `Tools` > `Plugins Download` > search for `MPLAB Code Configurator` and install it)

2. Install [Git](https://git-scm.com)

- Download/install the latest version of [Git for Windows](https://git-scm.com/download/win)

- Verify working operation of the `Git Bash` prompt (click `Start` > type `Git Bash`)

3. Download the Microchip [IoT Provisioning Tool](https://www.microchip.com/design-centers/internet-of-things/iot-dev-kits/iot-provision-tool)

   - Connect the Microchip IoT Development Board to the Host PC using a standard micro-USB cable
   - Launch `PowerShell` (click on `Start` > type `PowerShell` in the Search field > `Open`)
   - Using the command line, go to the directory where the `iotprovision-bin` executable file resides (`\iotprovision-bin-1\windows64\`)
   - Execute the command

        ```shell
        .\iotprovision-bin.exe -c azure -m custom
        ```

repository: nimisht/Microchip-PIC-IoT-Wx

repo_name: nimisht/Microchip-PIC-IoT-Wx


text:
Node Express API Boilerplate

    This is a boilerplate structure for an API build on Express.
    It already includes authorization and database connection.
    You can tweak it according to your needs, but this is a pretty solid starting point.

Todo

Add an example using the "verifyToken" middleware (protected route maybe?)

repository: tigigti/ExpressAPI

repo_name: tigigti/ExpressAPI


text:
---
layout: post
title: Are you sitting comfortably?
date: 2017-04-28 08:43:00
author: Lucy Tennyson
categories:
  - Blog
---

It's called Sukhasana in Sanskrit, which translates into English as easy sitting pose. But for most of us it ain't easy at all. In fact, before long you might find that your back starts to ache with the effort of sitting up straight, knees starting to protest, and nerve tingling numbness in the feet!

Sitting in ‘easy’ cross legs requires good flexibility in the inner thighs, feet and hips which enables the knees to drop down. The whole posture also involves stretching some of the strongest and biggest muscles in the body.

That's why I seldom ask students sit cross legged at the start of the class, but instead invite you to gently warm up the body, bringing movement into the joints rather than locking them into static positions when cold.

The beginning of a class is also a time to let go of busy lives and transition into the quiet of the class. By tuning into the breath we can explore how we are feeling, bringing our awareness inwards.

As with any other form of exercise, the safest way to begin is with slow and gentle movement, finding out where your body is tight and stiff and encouraging the muscles to move from flexion to extension. Once you feel warmed up then it’s time to start working harder – whether it be it a strong dynamic flow sequence, or a sitting yoga practice of deep and long stretches.

I believe this approach chimes with two important concepts in classical yoga. Firstly, combing ‘effort’ with ‘ease’ that can also be translated from the Sanskrit as ‘steady’ and ‘joyful’. This means that effort should be followed by easing into release/rest.

Sitting cross legged is an effort-full posture, and better done later on in your practice when you are warm and more flexible. This brings to mind another important concept in yoga known as Ahimsa (non-violence) which includes being kind to yourself.

You can read more about how to sit more comfortably in Sukhasana on [the Yoga Journal website](http://www.yogajournal.com/practice/finding-a-comfortable-seated-cross-legged-position)

Here is a reminder of some of what we practised this week:

![](/uploads/versions/yogblog28april17---x----1788-2492x---.jpg)

repository: eye-division/lucytennyson-yoga

repo_name: eye-division/lucytennyson-yoga


text:
# number-files

Number files in ascending order by update date.
Digits will be changed by the number of files.
If a number of files is 9, a number of digits to be 1.
If a number of files is 10, a number of digits to be 2.

## How to use

```bash
$ ./nb.sh target_directory
file_1 -> 001_file_1
file_2 -> 002_file_2
file_3 -> 003_file_3
...
file_100 -> 100_file_100
```


text:
## Meaning of Versions

Versions are defined in `build.gradle.kts`.

`intellij.version` is used for -
1. Building the plugin, so the source code needs to be compatible with it.
2. Determining the _maximum_ supported version. This means that it needs to be updated every time a new IntelliJ _Branch_ version is released. For example, 2021.1, 2021.2, etc.

`tasks.patchPluginXml.sinceBuild` is used for -
1. Determinig the _minimum_ supported version, so the code must not reference classes not introduced yet.

## Testing

* Use Gradle to run the plugin.
* _Don't_ use IntelliJ to run the plugin.

```
ktfmt/ktfmt_idea_plugin $ ./gradlew runIde
```

Point `intellij.alternativeIdePath` in `build.gradle.kts` to a local installation of IntelliJ / Android Studio to test the plugin with it. Don't forget to enable the plugin. Easiest way: Cmd-shift-A, type 'ktfmt', look for Preferences.

Another way: change `intellij.version` and comment out `alternativeIdePath`. This will run the plugin on whatever version you put - it'll be downloaded through Gradle.

repository: cgrushko/ktfmt

repo_name: cgrushko/ktfmt


text:
---
title: Glob syntax
description: Regexp-like syntax
date: 2018-07-23T15:22:34-07:00
draft: false
weight: 10
bref: Glob is used to wildcard multiple entities
toc: true
type: doc
logo:
---

[Glob](https://en.wikipedia.org/wiki/Glob_(programming)) is a matching pattern,
used in most OSes. In go-home glob matching is powered by
[globwas/glob](https://github.com/gobwas/glob) library.

Most systems support wildcarding entities using glob patters.

{{<warning "Don't overdo wildard usage as it may result in unexpected behavior.">}}

### Syntax

|Wildcard|Description|
|--------|-----------|
| `*` | Matches any number of any characters including none |
| `?` | Matches any single character |
| `[abc]` | Matches one character given in the bracket |
| `[a-z]` | Matches one character from the range given in the bracket |
| `[!abc]` | Matches one character that is not given in the bracket |
| `[!a-z]` | Matches one character that is not from the range given in the bracket |

### Examples

- `hue.light.*` will select all light entities exposed by HUE hub.
If both groups and lights are exposed, all of them will be selected.
- `hue.light.[!g]*` will select only lights, as groups will be filtered by
`[!g]` exclusion.

repository: go-home-io/website

repo_name: go-home-io/website


text:
## Description
Repository of Deep Propensity Network - Sparse Autoencoder (DPN-SA) to calculate propensity score using sparse autoencoder - Paper under review at Journal of the American Medical Informatics Association.

## Introduction
A deep learning model - deep propensity network using a sparse autoencoder (DPN-SA), for calculating Propensity Score Mathcing(PSN) to tackle the problems of high dimensionality and residual confounding. It uses a sparse autoencoder in place the Propensity dropout module in Deep counterfactual network - Propensity dropout architecture(DCN-PD).

The original paper of DCN-PD can be founed [here](https://arxiv.org/pdf/1706.05966.pdf).

The original implemetation of DCN-PD in pytorch can be found [here](https://github.com/Shantanu48114860/Deep-Counterfactual-Networks-with-Propensity-Dropout).

## Contributors
[Shantanu Ghosh](https://www.linkedin.com/in/shantanu-ghosh-b369783a/)

[Jiang Bian](http://jiangbian.me/)

[Yi Guo](https://hobi.med.ufl.edu/profile/guo-yi/)

[Mattia Prosperi](https://epidemiology.phhp.ufl.edu/profile/prosperi-mattia/)

## Requirements and setup
pytorch - 1.3.1

numpy - 1.17.2

pandas - 0.25.1

scikit - 0.21.3

matplotlib: 3.1.1

python -  3.7.4

## Keywords
causal AI, biomedical informatics, deep learning, multitask learning, sparse autoencoder

## Dependencies
[python 3.7.7](https://www.python.org/downloads/release/python-374/)

[pytorch 1.3.1](https://pytorch.org/get-started/previous-versions/)

Update the DCN Model path

## How to run
To reproduce the experiments mentioned in the paper for DCN-PD, Logistic regression, Logistic regression Lasso
and all the SAE variants of 25-20-10- (greedy and end to end) for both the
original and synthetic dataset, type the following
command:

python3 main_propensity_dropout.py

## Output
After the run, the outputs will be generated in the following location:

[IHDP](https://github.com/Shantanu48114860/DPN-SA/tree/master/MSE)

Consolidated results will be available in textfile in /Details_original.txt and /Details_augmented.txt files.

The details of each run will be avalable in csv files in the following locations:

/MSE/Results_consolidated.csv and /MSE_Augmented/Results_consolidated_NN.csv

## License & copyright
© DISL, University of Florida

Licensed under the [MIT License](LICENSE)

repository: Crazyoumashu/DPN-SA

repo_name: Crazyoumashu/DPN-SA


text:
# Set theory ∷ Formulae

- if S is the predicate set-exists, then ∃xSx, i.e. sets exists
- there are sets, ∃xSx
- there is the empty set, `∅` = `∃x ∀y ¬(x ∈ y)`

- Russell's paradox, `𝑼 = { x | x ∈ 𝑼 ⟺ x ∉ 𝑼 }`
- Russell's paradox, `𝑼 = { x | x ∈ 𝑼 ⟺ x ∉ 𝑼 }`
- the set of all sets, `x = { x | ∀x(x ∈ x ⟺ x ∉ x) }`

Russell's paradox
- if `𝓡` is the set of all sets
- and `A ⊆ 𝓡` is defined by `A = { x | ∃x(x ∈ 𝓡 ⋀ x ∉ x) }`
  then the set `A` would have the property `A ∈ A ⟺ A ∉ A`

Set comprehension
- sets may be defined with set comprehension, which is a notation that uses predicates to restrict potential set members.
- the most general form of set comprehension notation is `{ x |  P(x) }`.
- the simplest form uses a single predicate and a universally quantified variable `x` that ranges over all individuals in the domain of discorse (DoD); if left unspecified, DoD defaults to the class of all sets, so `x` ranges over all sets. Then `∀xP(x)` is true if, for `P(x)` holds from all sets `x`. If the DoD is not directly specified, it may be indirectly restricted within a formula such as `S = { x |  ∀x(x ∈ ℕ -> P(x)) }`. Here, the part `x ∈ ℕ` indirectly restricts what `x` ranges over to be the set of the natural numbers; to qualify as a member of the set `S`, `x` must be in ℕ and the predicate `P` must hold of any such `x`.

S = { x |  ∀x (Nx -> (Px ⋁ Cx)) }

S = { x |  ∀x(x ∈ ℕ -> (Px ⋁ Cx)) }

T = { x |  ∃x(x ∈ ℕ ⋀ P(x)) }

objects from becoming the set members.

by using one or more predicates

potential set members by using one or more predicates that constrain the eligability of an object to become a set element.

{ x | ∀x P(x) }

If the predicate P holds for some object x, i.e. if P(x) is true, then x is a member of the set being defined; otherwise, if P(x) does not hold, then x is not a member of that set. For example, the set of the rational numbers is defined by `ℚ = { (p,q) | ∀p(p ∈ ℤ -> ∃q(q ∈ ℕ ⋀ q ≠ 0)) }`.

R = { x |  ∀x ((Px ⋁ Qx) -> Sx) }

let R be a predicate meaning "a set that is a member of itself"
so R(x) holds if set x is a member of itself

Zermelo-Fraenkel (ZF) set theory
- the axiom of the empty set, `∃x ∀y ¬(x ∈ y)`
- the axiom of the power set,

license: Unlicense


text:
# :black_square_button: react-native-grid-component

[![NPM version](http://img.shields.io/npm/v/react-native-grid-component.svg?style=flat)](https://www.npmjs.com/package/react-native-grid-component)
[![Build Status](https://travis-ci.org/phil-r/react-native-grid-component.svg?branch=master)](https://travis-ci.org/phil-r/react-native-grid-component)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

Easy to use grid component for your [react-native](https://github.com/facebook/react-native/) project. Supports iOS and Android.

Based on [react-native framework](https://github.com/facebook/react-native/) by Facebook.

## Installation

```
npm install react-native-grid-component --save
```

or

```
yarn add react-native-grid-component
```

## Examples

* [Simple](https://snack.expo.io/@phil/react-native-grid-component-example)
* [Sections](https://snack.expo.io/@phil/grid-with-sections-example)

## Demo

![android low](https://cloud.githubusercontent.com/assets/577316/18456263/d6b977e2-794f-11e6-878f-5737355111ac.gif) ![ios low](https://cloud.githubusercontent.com/assets/577316/18456262/d6b7a39a-794f-11e6-8587-06757dc42e14.gif)

## Usage

```js
import React, { Component } from 'react';
import { StyleSheet, View } from 'react-native';

import Grid from 'react-native-grid-component';

class Simple extends Component {
  _renderItem = (data, i) => (
    <View style={[{ backgroundColor: data }, styles.item]} key={i} />
  );

  _renderPlaceholder = i => <View style={styles.item} key={i} />;

  render() {
    return (
      <Grid
        style={styles.list}
        renderItem={this._renderItem}
        renderPlaceholder={this._renderPlaceholder}
        data={['black', 'white', 'red', 'green', 'blue']}
        itemsPerRow={2}
      />
    );
  }
}

const styles = StyleSheet.create({
  item: {
    flex: 1,
    height: 160,
    margin: 1
  },
  list: {
    flex: 1
  }
});
```

[Full interactive example](https://snack.expo.io/@phil/react-native-grid-component-example)

## Props

| Name                           | propType                                       | description                                                                                |
| ------------------------------ | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data` _required_              | Array                                          | Array that will be used to render items                                                                                |
| `renderItem` _required_        | func `(data: any, i: number) => React$Element` | function that accepts data and returns React Element that will be rendered for each `data` item                                                                                |
| `renderPlaceholder` _optional_ | func `(i: number) => React$Element`            | function that returns placeholder React Elements that ere rendered to fill the space at the end of the grid                                                                                |
| `renderFooter` _optional_      | func `() => React$Element`                     | underlying ListView [renderFooter prop](https://facebook.github.io/react-native/docs/listview.html#renderfooter)                                                                                |
| `refreshControl` _optional_    | func `() => React$Element`                     | underlying ListView [refreshControl prop](https://facebook.github.io/react-native/docs/refreshcontrol.html)                                                                                |
| `itemsPerRow` _optional_       | number                                         | number of elements per one row                                                                                |
| `onEndReached` _optional_      | func                                           | function that is called when the end of the grid reached (can be used to add new elements, like in [example](Examples/Simple))                                                                                |
| `itemHasChanged` _optional_    | func `(data1: any, data2: any) => boolean`     | function that is used in `rowHasChanged` function in `ListView.DataSource` to determine whether the row was updated. **IMPORTANT:** It's possible to get `null` as one or both of arguments, so you'll want to check for that ( e.g. `(d1, d2) => d1 && d2 ? d1.data !== d2.data : true`) |

## [TODO](https://github.com/phil-r/react-native-grid-component/projects/1)

## See also

* [React Native Looped Carousel](https://github.com/appintheair/react-native-looped-carousel)
* [React Native Buyscreen](https://github.com/appintheair/react-native-buyscreen)

## ISC License (ISC)

Copyright (c) 2016-2018, Phil Rukin<EMAIL_ADDRESS>
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

license: ISC

repository: colinfran/pigeonapp

repo_name: colinfran/pigeonapp


text:
network-analyzer
================
This tool dumps to a text file statistics about the IP packets that have been sent and received through the specified interface. It only captures IP datagrams over ethernet.

It uses the libpcap library to capture the packets and the uthash library to create a hash table to store the statistics. Libpcacp has been chosen because it will ensure compatibility with most linux kernels and distributions and it will work with any generic network device. The tool has been analyzed with valgrind to ensure there are no memory leaks.

To achieve best results it is recommended to use a kernel version over 2.4 with PACKET_MMAP support. It is enabled by default in most newer Linux distributions. If this option is not enabled there will be an important performance penalty.

A profile analysis showed that almost 99% of CPU cycles consumed by this tool correspond to the kernel copying the network frames form the network device to the user-space memory region. To achieve less CPU usage  will be necessary to implement a specific solution that interacts directly with the network device memory (thus avoiding the cost of copying the frames to user level). The viability of this solution will depend on the model of the network card.

To use this tool it has to be launched as root or with the CAP_NET_RAW capabilities activated, the capabilities can be activated with the setcap utility:

sudo setcap cap_net_raw+ep ./net_analyze

The tool interface is:

./net_analyze [interface] [options]

And the supported options are:
       [-i | --ip]			Process only packets from or to this ip (it should be associated to the specified interface)
       [-s | --stats_path]	Path where to dump the statistics (default ./stats.log)
       [-d | --duration]	How many seconds between dumps (default dump is done at exit)
       [-p | --print]		Print to stdout
       [-h | --help]		Shows this help message

For example launching the tool as follows will behave like the command: tshark -E header=n -Q -a duration:60 -s 64 -n -z conv,ip,ip.addr==`hostname -i`, but in addition the stats will be dumped to ./stats.log.

./net_analyze eth0 -p -i `hostname -i` -d 60 -p

The output is:

[Time of last frame captured within this source and destination] 	[source] -> [destination]	[total number of bytes transfered]	[num of frames]

repository: GerardGarcia/network-analyzer

repo_name: GerardGarcia/network-analyzer


text:
# Brasiliomyces malachrae (Seaver) Boesew., 1980 SPECIES

#### Status
ACCEPTED

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

#### Published in
Bot. Rev. 42(2): 171 (1980)

#### Original name
Erysiphe malachrae Seaver, 1926

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# sdk-sample
This is a sample to show how to use bitmark-sdk-js

# Installation
```$bash
npm install
```

# Usage
File `main.js` implement examples about core features of bitmark-sdk-js


text:
---
title: "removeAllVirtualAccessForThisUser"
description: "Remove all cloud computing instances from a portal user's instance access list. A user's instance access list controls which of an account's computing instance objects a user has access to in the SoftLayer customer portal and API. If the current user does not have administrative privileges over this user, an inadequate permissions exception will get thrown.

Users can call this function on child users, but not to themselves. An account's master has access to all users permissions on their account. "
date: "2018-02-12"
tags:
    - "method"
    - "sldn"
    - "User"
classes:
    - "SoftLayer_User_Customer"
type: "reference"
layout: "method"
mainService : "SoftLayer_User_Customer"
---


text:
---
layout: post
title: multiplayer-snake
---

![_config.yml]({{ site.baseurl }}/images/multiplayer-snake.png)

### [demo](http://snake-42581.onmodulus.net/) | [source](https://github.com/olivierrr/multiplayer-snake)

Classic game of snake with various multiplayer features.

gha_language: CSS