text:
[![BSD-3 license](https://img.shields.io/badge/license-BSD--3--Clause-428F7E.svg)](https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29)

### Description

CYTHS is a sensor which is able to send through 433 MHz transmitter a temperature thus a humidity value.

These information are coded on 32 bits and transmitted using the RSL protocol each 5 minutes.

Sensor is low energy consumption allowing to have it working around 1000 days (~2.8 years) with three 1.5V batteries.

Each sensor has an identifier which is initialized following two ways:
 1. On runtime after the first power on.

    After it can be changed later, with this special sequence:
    * Power off
    * Repeat 3 times:
      * Power on
      * Wait between 3 and 6 seconds
      * Power off
	* Power on
 2. On compilation with a special variable defined in source code

### Lifetime

Sensor lifetime is calculated using [Oregon Embedded](http://oregonembedded.com/batterycalc.htm) website and the following information:

| Description                                     | Value |
|:------------------------------------------------|:------|
| Capacity rating of battery (mAh)                | 1250  |
| Current consumption of device during sleep (mA) | 0.02  |
| Current consumption of device during wake (mA)  | 15    |
| Number of wakeups per hour                      | 11    |
| Duration of wake time (ms)                      | 500   |

Estimated battery life is: **1032.29 days, or 2.83 years**.

### Hardware

Sensor is driven by an AVR ATtiny85 microcontroller which is programmed using:
 * The [Tiny AVR Programmer](https://www.sparkfun.com/products/11801)
 * [Arduino IDE](http://www.arduino.org/)

### Code structure

RSL code is based on 32 bits.

They are organized like this:

| 32-31                     | 30-29                          | 28-25                                 | 24-1                      |
|:--------------------------|:-------------------------------|:--------------------------------------|:--------------------------|
| Remote command identifier | Remote command switch position | Switch state to enable (on/off/onoff) | Remote command identifier |

The 4 bits from 25 to 28 never takes value *1111* thus [CYTHS](https://github.com/cyosp/CYTHS) code is organized like this:

| 32-31         | 30-29            | 28-25 | 24-18     | 17-11    | 10-1        |
|:--------------|:-----------------|:------|:----------|:---------|:------------|
| Battery level | Protocol version | 1111  | Sensor id | Humidity | Temperature |

Where:
 * Battery level
 	* 00 ⇔ 4.35V
 	* 11 ⇔ 4.86V

 * Protocol version
 	* 00 ⇔ First protocol managed and implemented
	It's the one described here

 * 1111
	* Fixed value in order to detect a RSL sensor code

 * Sensor id
	* The sensor identifier
	Value between 1 and 127

 * Humidity
	* Value between 0 and 100
    It matches with the real humidity in %

 * Temperature
	* Value between 0 and 1024
	Real temperature is computed like this:
			T=(Ts-400)/10
    With:
		* T: Real temperature in °C
		* Ts: Temperature coming from sensor
			It means value betwenn 0 and 1024

	At the end it produces the following matching:

		* 0 ⇔ -40.0 °C
		* ...
		* 40 ⇔ 0.0 °C
		* ...
		* 1024 ⇔ 62.4 °C

### Arduino

#### Dependency libraries installation
1. **DHTlib**
   * Sketch → Include Library → Manage Libraries
   * Search **DHTlib** by *Rob Tillaart*
   * Latest version is: *0.1.35* the *2022-08-04*
   * Click *Install*
2. **PinChangeInterrupt**
   * Sketch → Include Library → Manage Libraries
   * Search **PinChangeInterrupt** by *NicoHood*
   * Latest version is: *1.2.9* the *2022-08-04*
   * Click *Install*
3. **rc-switch** by *CYOSP*
   * Download https://github.com/cyosp/rc-switch/archive/refs/tags/v2.52.1.zip
   * Sketch → Include Library → Add .ZIP Library...
   * Then choose the downloaded ZIP file

#### Configuration

These steps will configure Arduino software in order to use the microcontroller running at 16 Mhz:
 * File → Preferences
  * In *Additional Boards Manager URLs:*
  * Enter *https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json*
  * And *OK* button
 * Tools → Board → Boards Manager...
    * Search in the list and select: **attiny** by **David A. Mellis**
    * Click *Install*
    * And *Close* button
 * Tools → Board → ATtiny25/45/85
 * Tools → Processor → ATtiny85
 * Tools → Clock → **Internal** 8 MHz

#### Setup programmer

Here is used [Tiny AVR Programmer](https://www.sparkfun.com/products/11801) and it means:
 * Tools → Programmer → USBtinyISP
 * Plug the microcontroller on the programmer board or wire the sensor in case of SMD package:

   ![CYTHS-2.0-Programmer-wired](CYTHS-2.0-Programmer-wired.png?raw=true)

   **/!\ Photo displays sensor bottom side /!\\**

 * Plug the programmer board to the computer

#### Code upload

It's necessary to burn fuses of the microcontroller to set this configuration:
 * Tools → Burn Bootloader

Output example of burn bootloader in verbose mode:
```
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pattiny85 -cusbtiny -e -Uefuse:w:0xff:m -Uhfuse:w:0xdf:m -Ulfuse:w:0xe2:m

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/cyosp/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : usbtiny
avrdude: usbdev_open(): Found USBtinyISP, bus:device: 000:005
         AVR Part                      : ATtiny85
         Chip Erase delay              : 400000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    12     4    0 no        512    4      0  4000  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6    32    0 yes      8192   64    128 30000 30000 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : USBtiny
         Description     : USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyisp
avrdude: programmer operation not supported

avrdude: Using SCK period of 10 usec
CMD: [ac 53 00 00] [00 00 53 00]
avrdude: AVR device initialized and ready to accept instructions

Reading | CMD: [30 00 00 00] [00 30 00 1e]
CMD: [30 00 01 00] [00 30 00 93]
################CMD: [30 00 02 00] [00 30 00 0b]
################################## | 100% 0.01s

avrdude: Device signature = 0x1e930b (probably t85)
avrdude: erasing chip
CMD: [ac 80 00 00] [00 ac 80 00]
avrdude: Using SCK period of 10 usec
CMD: [ac 53 00 00] [00 ac 53 00]
avrdude: reading input file "0xff"
avrdude: writing efuse (1 bytes):

/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pattiny85 -cusbtiny

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/cyosp/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : usbtiny
avrdude: usbdev_open(): Found USBtinyISP, bus:device: 000:005
         AVR Part                      : ATtiny85
         Chip Erase delay              : 400000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    12     4    0 no        512    4      0  4000  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6    32    0 yes      8192   64    128 30000 30000 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : USBtiny
         Description     : USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyisp
avrdude: programmer operation not supported

avrdude: Using SCK period of 10 usec
Writing | CMD: [50 08 00 00] [00 50 08 ff]
################################################## | 100% 0.00s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xff:
avrdude: load data efuse data from input file 0xff:
avrdude: input file 0xff contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | CMD: [50 08 00 00] [00 50 08 ff]
################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xdf"
avrdude: writing hfuse (1 bytes):

Writing | CMD: [58 08 00 00] [00 58 08 df]
################################################## | 100% 0.00s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xdf:
avrdude: load data hfuse data from input file 0xdf:
avrdude: input file 0xdf contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | CMD: [58 08 00 00] [00 58 08 df]
################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xe2"
avrdude: writing lfuse (1 bytes):

Writing | CMD: [50 00 00 00] [00 50 00 f1]
CMD: [ac a0 00 e2] [00 ac a0 00]
CMD: [50 00 00 00] [e2 50 00 ff]
CMD: [50 00 00 00] [00 50 00 e2]
################################################## | 100% 0.01s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xe2:
avrdude: load data lfuse data from input file 0xe2:
avrdude: input file 0xe2 contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | CMD: [50 00 00 00] [00 50 00 e2]
################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude done.  Thank you.

CMD: [ac 53 00 00] [00 00 53 00]
avrdude: AVR device initialized and ready to accept instructions

Reading | CMD: [30 00 00 00] [00 30 00 1e]
CMD: [30 00 01 00] [00 30 00 93]
################CMD: [30 00 02 00] [00 30 00 0b]
################################## | 100% 0.01s

avrdude: Device signature = 0x1e930b (probably t85)

avrdude done.  Thank you.
```

Then **Upload** button of Arduino IDE can be used to upload code to the microcontroller.

Output example of an upload in verbose mode:
```
Sketch uses 5086 bytes (62%) of program storage space. Maximum is 8192 bytes.
Global variables use 218 bytes (42%) of dynamic memory, leaving 294 bytes for local variables. Maximum is 512 bytes.
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -pattiny85 -cusbtiny -Uflash:w:/var/folders/0m/mk12ygtj6vvc6_7bwsyj_v5w0000gp/T/arduino_build_649299/CYTHS.ino.hex:i

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/cyosp/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : usbtiny
avrdude: usbdev_open(): Found USBtinyISP, bus:device: 000:005
         AVR Part                      : ATtiny85
         Chip Erase delay              : 400000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    12     4    0 no        512    4      0  4000  4500 0xff 0xff
           flash         65     6    32    0 yes      8192   64    128 30000 30000 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : USBtiny
         Description     : USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyisp
avrdude: programmer operation not supported

avrdude: Using SCK period of 10 usec
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e930b (probably t85)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: Using SCK period of 10 usec
avrdude: reading input file "/var/folders/0m/mk12ygtj6vvc6_7bwsyj_v5w0000gp/T/arduino_build_649299/CYTHS.ino.hex"
avrdude: writing flash (5086 bytes):

Writing | ################################################## | 100% 8.46s

avrdude: 5086 bytes of flash written
avrdude: verifying flash memory against /var/folders/0m/mk12ygtj6vvc6_7bwsyj_v5w0000gp/T/arduino_build_649299/CYTHS.ino.hex:
avrdude: load data flash data from input file /var/folders/0m/mk12ygtj6vvc6_7bwsyj_v5w0000gp/T/arduino_build_649299/CYTHS.ino.hex:
avrdude: input file /var/folders/0m/mk12ygtj6vvc6_7bwsyj_v5w0000gp/T/arduino_build_649299/CYTHS.ino.hex contains 5086 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 12.97s

avrdude: verifying ...
avrdude: 5086 bytes of flash verified

avrdude done.  Thank you.
```

#### Code re-upload

Reprogram microcontroller could be hard due to its deep sleep mode.

In that case you must try several times and you will succeed to re-upload a new version.

If needed, try to reburn bootloader until successful.


text:
package org.apache.pulsar.common.protocol.schema;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Response with the version of a schema.
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PostSchemaResponse {
    private SchemaVersion version;
}

redpajama_set_name: RedPajamaGithub


text:
package pipe

import (
	"github.com/akaspin/logx"
	"github.com/akaspin/soil/agent/bus"
	"sort"
)

// Slicer pipe accepts map[string]interface{} messages and converts them to []interface{}
type Slice struct {
	log      *logx.Log
	consumer bus.Consumer
}

func NewSlice(log *logx.Log, consumer bus.Consumer) (p *Slice) {
	p = &Slice{
		log:      log.GetLog("pipe", "slicer"),
		consumer: consumer,
	}
	return
}

func (p *Slice) ConsumeMessage(message bus.Message) (err error) {
	var v map[string]interface{}
	var keys []string
	var res []interface{}
	if err = message.Payload().Unmarshal(&v); err != nil {
		p.log.Errorf(`can't unmarshal %s to map[string]interface{}: %v`, message, err)
		return
	}
	for k := range v {
		keys = append(keys, k)
	}
	sort.Strings(keys)
	for _, k := range keys {
		res = append(res, v[k])
	}
	p.consumer.ConsumeMessage(bus.NewMessage(message.Topic(), res))
	return
}


text:
const path = require('path');
const webpack = require('webpack');

module.exports = {
  context: path.resolve(__dirname, './src'),
  entry: {
    app: ['./vendor.ts', './main.ts'],
  },
  output: {
    path: path.resolve(__dirname, './dist'),
    filename: '[name].bundle.js',
    publicPath: '/assets',
  },
  module: {
    rules: [
      {
        test: /\.scss$/,
        use: ['style-loader', 'css-loader', 'sass-loader']
      },
      {
        test: /\.ts$/,
        use: ['awesome-typescript-loader']
      }
    ]
  },
  devServer: {
    contentBase: path.resolve(__dirname, './src'),
  },
  resolve: {
    modules: [ path.join(__dirname, "node_modules"), path.join(__dirname, "node_modules/angular-fusejs/node_modules") ],
    extensions: ['.ts', '.js']
  },
};


text:
#import <Foundation/Foundation.h>

#import <IGListDiffKit/IGListDiff.h>

/**
 Bitmask-able options used for pre-release feature testing.
 */
NS_SWIFT_NAME(ListExperiment)
typedef NS_OPTIONS (NSInteger, IGListExperiment) {
    /// Specifies no experiments.
    IGListExperimentNone = 1 << 1,
    /// Test updater diffing performed on a background queue.
    IGListExperimentBackgroundDiffing = 1 << 2,
    /// Test fallback to reloadData when "too many" update operations.
    IGListExperimentReloadDataFallback = 1 << 3,
    /// Test removing the layout pass when calling scrollToObject to avoid creating off-screen cells.
    IGListExperimentAvoidLayoutOnScrollToObject = 1 << 4,
    /// Test fixing a crash when inserting and deleting the same NSIndexPath multiple times.
    IGListExperimentFixIndexPathImbalance = 1 << 5,
    /// Test deferring object creation until just before diffing.
    IGListExperimentDeferredToObjectCreation = 1 << 6,
    /// Test getting collection view at update time.
    IGListExperimentGetCollectionViewAtUpdate = 1 << 7,
    /// Test invalidating layout when cell reloads/updates in IGListBindingSectionController.
    IGListExperimentInvalidateLayoutForUpdates = 1 << 8,
    /// Test using the collection view when asking for layout instead of accessing the data source. Only apply to IGListCollectionViewLayout.
    IGListExperimentUseCollectionViewInsteadOfDataSourceInLayout = 1 << 9
};

/**
 Check if an experiment is enabled in a bitmask.

 @param mask The bitmask of experiments.
 @param option The option to compare with.

 @return `YES` if the option is in the bitmask, otherwise `NO`.
 */
NS_SWIFT_NAME(ListExperimentEnabled(mask:option:))
static inline BOOL IGListExperimentEnabled(IGListExperiment mask, IGListExperiment option) {
    return (mask & option) != 0;
}

NS_ASSUME_NONNULL_BEGIN

/**
 Performs an index diff with an experiment bitmask.

 @param oldArray The old array of objects.
 @param newArray The new array of objects.
 @param option Option to specify the type of diff.
 @param experiments Optional experiments.

 @return An index set result object contained the changed indexes.

 @see `IGListDiff()`.
 */
NS_SWIFT_NAME(ListDiffExperiment(oldArray:newArray:option:experiments:))
FOUNDATION_EXTERN IGListIndexSetResult *IGListDiffExperiment(NSArray<id<IGListDiffable>> *_Nullable oldArray,
                                                             NSArray<id<IGListDiffable>> *_Nullable newArray,
                                                             IGListDiffOption option,
                                                             IGListExperiment experiments);

/**
 Performs a index path diff with an experiment bitmask.

 @param fromSection The old section.
 @param toSection The new section.
 @param oldArray The old array of objects.
 @param newArray The new array of objects.
 @param option Option to specify the type of diff.
 @param experiments Optional experiments.

 @return An index path result object containing the changed indexPaths.

 @see `IGListDiffPaths()`.
 */
NS_SWIFT_NAME(ListDiffPathsExperiment(fromSection:toSection:oldArray:newArray:option:experiments:))
FOUNDATION_EXTERN IGListIndexPathResult *IGListDiffPathsExperiment(NSInteger fromSection,
                                                                   NSInteger toSection,
                                                                   NSArray<id<IGListDiffable>> *_Nullable oldArray,
                                                                   NSArray<id<IGListDiffable>> *_Nullable newArray,
                                                                   IGListDiffOption option,
                                                                   IGListExperiment experiments);

NS_ASSUME_NONNULL_END


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Proc. Linn. Soc. N. S. W. 50(2): 77 (1926)

#### Original name
Geastrum ellipticum G. Cunn.

### Remarks
null


text:
<Type Name="ALGetString" FullName="MonoMac.OpenAL.ALGetString">
  <TypeSignature Language="C#" Value="public enum ALGetString" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed ALGetString extends System.Enum" />
  <AssemblyInfo>
    <AssemblyName>MonoMac</AssemblyName>
    <AssemblyVersion>0.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>System.Enum</BaseTypeName>
  </Base>
  <Docs>
    To be added.
    <remarks>To be added.</remarks>
  </Docs>
  <Members>
    <Member MemberName="Extensions">
      <MemberSignature Language="C#" Value="Extensions" />
      <MemberSignature Language="ILAsm" Value=".field public static literal valuetype MonoMac.OpenAL.ALGetString Extensions = int32(45060)" />
      <MemberType>Field</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.OpenAL.ALGetString</ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
      </Docs>
    </Member>
    <Member MemberName="Renderer">
      <MemberSignature Language="C#" Value="Renderer" />
      <MemberSignature Language="ILAsm" Value=".field public static literal valuetype MonoMac.OpenAL.ALGetString Renderer = int32(45059)" />
      <MemberType>Field</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.OpenAL.ALGetString</ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
      </Docs>
    </Member>
    <Member MemberName="Vendor">
      <MemberSignature Language="C#" Value="Vendor" />
      <MemberSignature Language="ILAsm" Value=".field public static literal valuetype MonoMac.OpenAL.ALGetString Vendor = int32(45057)" />
      <MemberType>Field</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.OpenAL.ALGetString</ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
      </Docs>
    </Member>
    <Member MemberName="Version">
      <MemberSignature Language="C#" Value="Version" />
      <MemberSignature Language="ILAsm" Value=".field public static literal valuetype MonoMac.OpenAL.ALGetString Version = int32(45058)" />
      <MemberType>Field</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.OpenAL.ALGetString</ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
      </Docs>
    </Member>
  </Members>
</Type>


text:
  Saint-Genis-de-Saintonge est
      une ville située dans le département de Charente-Maritime en Poitou-Charentes. Elle totalisait 1 185 habitants en 2008.

Le nombre d'habitations, à Saint-Genis-de-Saintonge, se décomposait en 2011 en 90 appartements et 537 maisons soit
 un marché plutôt équilibré.

À Saint-Genis-de-Saintonge, le prix moyen à l'achat d'un appartement se situe à 815 € du m² en vente. la valorisation moyenne d'une maison à l'achat se situe à 1 196 € du m². À la location la valorisation moyenne se situe à 8,06 € du m² par mois.

À coté de Saint-Genis-de-Saintonge sont situées les communes de
Guitinières située à 6 km, 400 habitants,
Mosnac localisée à 4 km, 465 habitants,
Saint-Sigismond-de-Clermont localisée à 4 km, 155 habitants,
Saint-Quantin-de-Rançanne à 6 km, 264 habitants,
Clion à 5 km, 750 habitants,
Belluire à 6 km, 169 habitants,
 entre autres. De plus, Saint-Genis-de-Saintonge est située à seulement onze km de Pons.

La commune compte de multiples  équipements, elle propose entre autres un bassin de natation, un terrain de tennis et deux terrains de sport.


text:
package {{ cookiecutter.package_name }};

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * Testing Fundamentals
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}


text:
package cl.rvillablanca;

public class Main {

    public static void main(String[] args) {

        System.out.println("Suma");
        ISuma suma = new Suma();
        int value = suma.sum(6, 7);
        System.out.format("Suma: %s%n%n", value);

        System.out.println("Suma2");
        suma = new Suma2();
        value = suma.sum(6, 7);
        System.out.format("Suma: %s%n%n", value);

        System.out.println("Factory");
        suma = ISumaFactory.newISumaInstance();
        value = suma.sum(6, 7);
        System.out.format("Suma: %s%n%n", value);

        System.out.println("Factory con Suma");
        suma = ISumaFactory.newISumaInstance(new Suma());
        value = suma.sum(6, 7);
        System.out.format("Suma: %s%n%n", value);

        System.out.println("Factory con Suma2");
        suma = ISumaFactory.newISumaInstance(new Suma2());
        value = suma.sum(6, 7);
        System.out.format("Suma: %s%n%n", value);

        System.out.println("Factory con Suma y NullHandler");
        suma = ISumaFactory.newISumaInstance(new Suma(), new NullSumHandler());
        value = suma.sum(null, 7);
        System.out.format("Suma: %s%n%n", value);

        System.out.println("Factory con Suma2 y NullHandler");
        suma = ISumaFactory.newISumaInstance(new Suma2(), new NullSumHandler());
        value = suma.sum(6, null);
        System.out.format("Suma: %s%n%n", value);
    }
}


text:
layout: post
title: "Foundations: Basic Authentication (Part 8)"
cover-title:
cover-title-color: white
cover: /public/assets/authentication.jpg
cover-position: 50% 50%
---

Getting basic authentication up and running in rails is easy. There are four main steps to implementing authentication.

1. Password setup. Hashed and salted authentication.
2. Verifying and creating the user session.
3. Locking down requests from non-authenticated users.
4. Influencing UI elements depending on authentication status.

##Setup
###1. Add bcrypt
/Gemfile
{% highlight erb %}
gem 'bcrypt-ruby'
{% endhighlight %}

`$bundle install --without production`

###2. Add password digest migrations
`$rails generate migration add_password_digest_to_users`

/db/migrate

{% highlight ruby %}
class AddPasswordDigestToUsers < ActiveRecord::Migration
  def change
    add_column :users, :password_digest, :string
  end
end
{% endhighlight %}

This creates a "password_digest" string column to the users table.

`$bundle exec rake db:migrate`

###3. Add authentication to User model
/app/models/user.rb

{% highlight ruby %}
...
has_secure_password validations: false
validates :username, presence: true, uniqueness: true
validates :password, presence: true, length: {minimum: 8 }, on: :create
{% endhighlight %}
`has_secure_password` adds `.password` setter and `.authenticate(some_password)` methods to User objects. Rails also knows by convention to look for hashed passwords in the users table password_digest column.
We have turned default rails password validations off, such as requiring a password confirmation. Instead we will use our own validations.

Of note `on: :create` only requires validations when creating new User objects. Therefore one does not need to create another password when updating their user.

##Creating and Verifying user session
Although we already have `resources :users`, we can customize the register link by mapping `/register` manually to `users#new`

The session is not a stand-alone model. We only need to create the session upon login, and destroy the session upon logout.

###1. Create routing
/config/routes

{% highlight ruby %}
...
get '/register', to: 'users#new'
get '/login', to: 'sessions#new'
post '/login', to: 'sessions#create'
get '/logout', to: 'sessions#destroy'
...
{% endhighlight %}

###2. Create controller actions
/app/controllers/users_controller.rb
This will be a model-backed form, so we will have to set up a new `@user` instance variable for the users/new.html.erb template.

{% highlight ruby %}
class UsersController < ApplicationController
  def new
    @user = User.new
  end

  def create
    @user = User.new(user_params)
    #mass assign new User object with strong parameters
    if user.save
    #If the save was successfully validated
      flash[:notice] = "Registration successful"
      session[:user_id] = @user.id
      #set their session automatically to authenticate
      redirect_to root_path
    else
      render :new
      #else render the form again, displaying model-backed form errors
    end
  end

  private
  def user_params
    params.require(:user).permit(:username, :password)
  end

end
{% endhighlight %}

/app/controllers/sessions_controller.rb

{% highlight ruby %}
class SessionsControler < ApplicationController
  def new
    #get '/login' will render the '/app/views/sessions/new.html.erb' that has the login form.
  end

  def create
    user = User.find_by(username: params[:username])
    #Finds user with input username
    if user && user.authenticate(params[:password])
    #If that user exists, and password authentication is successful
      flash[:notice] = "Login successful"
      session[:user_id] = user.id
      #Then set the session[:user_id] to the user.id
      redirect_to root_path
    else
      flash[:error] = "Login unsuccessful"
      #since sessions is not model backed, showing errors does not require instance variable re-rendering. Simply redirect and flash a notice.
      redirect_to root_path
    end
  end

  def destroy
    session[:user_id] = nil
    flash[:notice] = "Logout successful"
    redirect_to root_path
  end

end
{% endhighlight %}

###3. Create registration and login forms
/app/views/users/new.html.erb
{% highlight erb %}
Register
<%= render 'shared/errors', object: @post %>
<%= form_for @post do |f| %>
  <%= f.label :username %>
  <%= f.text_field :username %>
  <%= f.label :password %>
  <%= f.password_field :password %>
  <%= f.submit "Register" %>
<% end %>

{% endhighlight %}

/app/views/sessions/new.html.erb

{% highlight erb %}
Login
<%= form_tag "/login" do %>
  <%= label_tag :username %>
  <%= text_field_tag :username, params[:username] %>

  <%= label_tag :password %>
  <%= password_field_tag :password %>
  <%= submit_tag "Login" %>
<% end %>
{% endhighlight %}

##Locking down requests
###1. Create Application-wide controller methods
Throughout the site, we will often need to:

- Know who the current user is (This new post belongs to user)

- Require a user for an action (This form can only be submitted with a user)

- Know boolean if the user is logged in or not (Hide or show this form?)

This means that these actions will be used repeatedly, and belong in the application controller.

/app/controllers/application_controller.rb

{% highlight ruby %}
class ApplicationController < ActionContoller::Base
  ...
  def current_user
    @current_user ||= User.find(session[:user_id]) if session[:user_id]
    #If session[:user_id] exists, set the corresponding user.
    #||= is a memoization optimization
    #if @current_user already exists, then use @current_user, else call the database again.
  end

  def logged_in?
    !!current_user
    #! makes a false value boolean
    #! again reverts the true value boolean
  end

  def require_user
    if !logged_in?
      flash[:error] = "Login required"
      redirect_to root_path
      #If request is not a user, then redirect them elsewhere.
    end
  end

end
{% endhighlight %}

###2. Lock down specific controller actions
Preventing access to actions is easy. Simply use `require_user` as a before_action on that action.

/app/controllers/posts_controller.rb

{% highlight ruby %}
class PostsController < ApplicationController
  before_action :require_user, only[:create]
  #this explicitly requires a user for the new post submission action.
  ...
  def create
    @post = Post.new(post_params)
    if @post.save #if validation passes and database save successful
      flash[:notice] = "Post created"
      redirect_to posts_path
    else
      render :new
    end
  end
end
{% endhighlight %}

###3. Influencing UI elements
We'd like to reuse our application controller methods in our views, however they are not available for the templates unless explicitly stated. We're interested in two.

{% highlight ruby %}
/app/controllers/application_controller.rb

class ApplicationController < ActionContoller::Base
  ...
  helper_method :logged_in?, :current_user
  #This makes these two methods helpers
  ...
end
{% endhighlight %}

/app/views/posts/new.html.erb

{% highlight erb %}
<% if logged_in? %>

  Logged in as: <%= current_user %>

  <%= form_for @post do |f| %>
    <%= f.label :title %>
    <%= f.text_field :title %>

    <%= f.label :url %>
    <%= f.text_field :url %>

    <%= f.label :description %>
    <%= f.text_area :description %>

    <%= f.collection_check_boxes :category_ids, Category.all, :id, :name %>

    <%= f.submit 'Create Post' %>
  <% end %>
<% end %>
{% endhighlight %}

##Basic Permissions
As with basic authentication, creating a basic permissions system doesn't have to be a complicated permissions lookup system.

Simply create a migration to generate a new role column for the user, and lock down controller actions/UI elements as required when certain roles are present/absent.


text:
package com.myjavaworld.ftp;

import java.util.EventObject;

/**
 * An event generated by data connections to notify the status of data transfer.
 *
 * @author Sai Pullabhotla, psai [at] jMethods [dot] com
 * @version 2.0
 */
public class DataConnectionEvent extends EventObject {

	/**
	 * Serial version UID
	 */
	private static final long serialVersionUID = 7736555651463625070L;
	/**
	 * A constant to indicate that data is being sent to the remote host.
	 */
	public static final int SEND = 1;
	/**
	 * A constant to indicate that data is being received from the remote host.
	 */
	public static final int RECEIVE = 2;
	/**
	 * The type of this event.
	 */
	private int id = 0;
	/**
	 * Number of bytes trabsferred so far.
	 */
	private long bytesTransferred = 0L;

	/**
	 * Constructs a DataConnectionEvent.
	 *
	 * @param source
	 *            The object that generated this event.
	 * @param id
	 *            Type of this event. Possible types are -
	 *

	 *
DataConnectionEvent.SEND

	 *
DataConnectionEvent.RECEIVE

	 *

	 * @param bytesTransferred
	 *            Number of bytes transferred so far.
	 */
	public DataConnectionEvent(Object source, int id, long bytesTransferred) {
		super(source);
		this.id = id;
		this.bytesTransferred = bytesTransferred;
	}

	/**
	 * Returns the ID ot type of this event.
	 *
	 * @return Type of this event.
	 */
	public int getId() {
		return id;
	}

	/**
	 * Returns the number of bytes transferred.
	 *
	 * @return number of bytes transferred.
	 */
	public long getBytesTransferred() {
		return bytesTransferred;
	}

	/**
	 * String rpresentation of this event.
	 *
	 * @return String representation of this event.
	 */
	@Override
	public String toString() {
		return "Type: " + id + " Bytes Transferred: " + bytesTransferred;
	}
}


text:
pm2 status
pm2 show wiki-server


text:
<TITLE>Review for Miss Julie (1999)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Miss Julie (1999)

reviewed by
Christopher Null

filmcritic.com presents a review from staff member Jeremiah Kipp.
You can find the review with full credits at
http://www.filmcritic.com/misc/emporium.nsf/60e74e041ca9cd6b8625626f0062219f/5ce2185d91dd24d3882568e800799457?OpenDocument

                                 MISS JULIE
                        A film review by Jeremiah Kipp
                         Copyright 2000 filmcritic.com
                              filmcritic.com

After single handedly crafting the worst film of 1999, the unbearably
heavy handed art house rubbish The Loss of Sexual Innocence, jazzy
auteur Mike Figgis brings his experimental eye to an adaptation of
August Strindberg's Miss Julie.

It's a brilliant play, one which observes naturalistic behavior and
flawed, complex characters without judgment. It's filled with
beautifully written scenes of emotional conviction. Naturally, Figgis is
so hell bent on his radical tinkering with form and content that the
story becomes a muddle of sensual implications taken straight from
fashion magazine perfume ads.

Indeed, he casts former model and current girlfriend Saffron Burrows in
the title role as Julie – a challenge for even the most experienced
actor. Julie slowly breaks down on the evening after her marriage has
fallen to pieces. She will ultimately return to a family structure which
will stifle her, and struggles willfully with her passions and appetites
embodied in the form of a robust servant (Peter Mullan).

Burrows gave sulky, shallow performances in Figgis' Sexual Innocence and
in Renny Harlin's Deep Blue Sea (the audience I was with cheered when
the sharks pursued her with bared teeth.) Her performances in those
films were remarkably similar to her work here. She does wear her hair
in slightly different curls and perhaps uses some blond highlights, but
her emotional range remains the same, haughtily demanding to be waited
on or entertained, occasionally allowing her lips to part for wet kisses
and chafing tongues. Would this be a Figgis film without smutty groping
and breast fondling every ten minutes?

When we first glimpse Miss Julie, she enters the large kitchen space. It
resembles the crumbling theater used in Louis Malle's superior Vanya on
42nd Street. Julie stares at a bird in a cage. Figgis can't resist
hammering the point home by shooting Julie through the bars. After that
image, there's hardly any point to watching the rest of the film, which
is her last gasp of inflicting her will on the macho, belligerent and
self righteous servant, who continually mutters that she on her pedestal
can never understand the lives of those below. She allows herself to be
ravished on her own terms (`kiss my foot'), with the inevitable regret,
guilt and sadness which surely follow. She is, after all, merely `a
fragile woman' full of dew.

If Burrows had a commanding screen presence, some shred of integrity or
glimmer of intellect – Cate Blanchett would have been perfect – one
would feel Strindberg's sense of all too human tragedy which comes hand
in hand with female oppression. Instead, we are presented with Figgis
posturing artistically and, shooting her brooding face in the soft
sunlight, sexually objectifying her.

Figgis has a penchant for hand-held photography on the mobile super-16mm
camera, which makes free use of the space and puts us on the same level
of his characters. This does manage to break through the stodgy barrier
of making a highbrow, affected period film, which all too often
degenerates into costume drama waxwork displays and loses all passion
and vigor.

However, he neglects to make it as `human' as this technique might
imply, still overly fixated on hyperreal, gauzy lighting and formal
devices over content, even making fade out ellipses feel heavy handed.
He's in love with long, adoring close ups of Burrows vacant good looks,
or of Mullen staring at her obsessively. His performance is so rigid he
might as well be wearing a corset.

His most indulgent choice is editing a sex scene from two angles running
parallel in a split framed sequence, which reeks of being experimental
for its own sake and a prelude for Time Code, which tells its story in
four panels simultaneously (one in each corner of the screen.) If Miss
Julie is any indication, it's a device which serves to increase the
artificiality and, thus, the ridiculousness of his scenario.

Mike Figgis is not without prowess or enormous technical skill, and I
admire his adventurous spirit. If only he didn't get high on the fumes
of his own highbrow artistic flatulence, he's become a filmmaker of
serious consideration. Until that time, he remains merely a curious
dilettante.

RATING:  **

|------------------------------|
 \ ***** Perfection             \
  \ **** Good, memorable film    \
   \ *** Average, hits and misses \
    \ ** Sub-par on many levels    \
     \ * Unquestionably awful       \
      |------------------------------|

MPAA Rating: R

Director: Mike Figgis
Producer: Mike Figgis, Helen Cruickshank
Writer: Helen Cooper (from the play by August Strindberg)
Starring: Saffron Burrows, Peter Mullan, Maria Doyle Kennedy, Heathcote
Williams

http://www.mgm.com/missjulie/index.html
---
Jeremiah Kipp - kipp@filmcritic.com - http://www.filmcritic.com
--
Christopher Null - cnull@mindspring.com - http://www.filmcritic.com

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
import random

from monte_carlo import MonteCarloGenerator

from store import StoreSampler

import numpy as np
import pandas as pd

pets = ["dog", "cat", "fish", "rabbit", "rodent", "reptile"]
first_names = ["Larry", "Susan", "Chris", "Jay", "Marigold", "Lisa"]
last_names = ["Houdini", "Danzig", "Smith", "Doe", "Van Horn"]

class CustomerPDF(object):
	def __init__(self, stores):
		self.stores = stores

	def probability(self, customer):
		zipcode = customer["zipcode"]
		return self.stores.loc[zipcode].pop_density

class CustomerInstanceGenerator(object):
	def __init__(self, stores):
		self.stores = stores
		self.store_sampler = StoreSampler(stores)

	def generate(self):
		name = random.choice(first_names) + " " + random.choice(last_names)
		pet = random.choice(pets)
		purchase_value = self.sample_exp()
		zipcode = self.store_sampler.sample().loc["zipcode"]
		return {"name" : name, "pet_type" : pet, "purchase_value" : purchase_value, "zipcode" : zipcode}

	def sample_exp(self):
		mean = 1.0
		return random.expovariate(mean)

class CustomerGenerator(object):
	def __init__(self, stores):
		self.stores = stores
		gen = CustomerInstanceGenerator(stores)
		pdf = CustomerPDF(stores)
		self.mcmc = MonteCarloGenerator(gen, pdf)

	def generate_n(self, n):
		prototypes = self.generate_customers(n)
		finalized = self.finalize_customers(prototypes)
		return finalized

	def generate_customers(self, n):
		customers = []
		for i in xrange(n):
			customer = self.mcmc.generate()
			customers.append(customer)
		return customers

	def finalize_customers(self, customers):
		zipcodes = []
		pets = []
		names = []
		purchase_values = []
		value_total = 0.0
		ids = np.arange(len(customers))
		for c in customers:
			zipcodes.append(c["zipcode"])
			pets.append(c["pet_type"])
			names.append(c["name"])
			purchase_values.append(c["purchase_value"])
			value_total += c["purchase_value"]
		purchase_pdf = [value / value_total for value in purchase_values]
		return pd.DataFrame(data={"id" : ids, "name" : names, "zipcode" : zipcodes, "pet_type" : pets, "purchase_pdf" : purchase_pdf}, index=ids)


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.microsoft.azure.batch;

/**
 * Error code strings returned from the Batch service.
 */
public final class BatchErrorCodeStrings {
    // Batch Service

    /**
     * The specified account is disabled.
     */
    public static final String AccountIsDisabled = "AccountIsDisabled";

    /**
     * The account has reached its quota of active jobs and job schedules.
     */
    public static final String ActiveJobAndScheduleQuotaReached = "ActiveJobAndScheduleQuotaReached";

    /**
     * The specified application does not exist.
     */
    public static final String ApplicationNotFound = "ApplicationNotFound";

    /**
     * An automatic scaling formula has a syntax error.
     */
    public static final String AutoScalingFormulaSyntaxError = "AutoScalingFormulaSyntaxError";

    /**
     * An automatic scaling formula is too long. The maximum length is 8192 characters.
     */
    public static final String AutoScaleFormulaTooLong = "AutoScaleFormulaTooLong";

    /**
     * Enable AutoScale requests for the same pool must be separated by at least 30 seconds.
     */
    public static final String AutoScaleTooManyRequestsToEnable = "TooManyEnableAutoScaleRequests";

    /**
     * A certificate operation was attempted which is not permitted when the certificate is in the process of being deleted.
     */
    public static final String CertificateBeingDeleted = "CertificateBeingDeleted";

    /**
     * The certificate you are attempting to add already exists.
     */
    public static final String CertificateExists = "CertificateExists";

    /**
     * The certificate on which an operation was attempted is not present in the Batch account.
     */
    public static final String CertificateNotFound = "CertificateNotFound";

    /**
     * A certificate operation was attempted which is not permitted when the certificate is active.
     */
    public static final String CertificateStateActive = "CertificateStateActive";

    /**
     * A certificate could not be deleted because it is still in use.
     */
    public static final String CertificateStateDeleteFailed = "CertificateDeleteFailed";

    /**
     * A node file requested from a task or compute node was not found.
     */
    public static final String FileNotFound = "FileNotFound";

    /**
     * One or more application package references could not be satisfied. This occurs if the application
     * ID or version does not exist or is not active, or if the reference did not specify a version and
     * there is no default version configured.
     */
    public static final String InvalidApplicationPackageReferences = "InvalidApplicationPackageReferences";

    /**
     * A pool specification specifies one or more invalid certificates (for example, certificates that are
     * not present in the Batch account).
     */
    public static final String InvalidCertificateReferences = "InvalidCertificateReferences";

    /**
     * A value in a job or task constraint is out of range.
     */
    public static final String InvalidConstraintValue = "InvalidConstraintValue";

    /**
     * There is a conflict between the REST API being used and the account.
     */
    public static final String InvalidRestAPIForAccountSetting = "InvalidRestAPIForAccountSetting";

    /**
     * A job operation was attempted which is not permitted when the job is in the process of being deleted.
     */
    public static final String JobBeingDeleted = "JobBeingDeleted";

    /**
     * A job operation was attempted which is not permitted when the job is in the process of being terminated.
     */
    public static final String JobBeingTerminated = "JobBeingTerminated";

    /**
     * A job operation was attempted which is not permitted when the job has been completed.
     */
    public static final String JobCompleted = "JobCompleted";

    /**
     * A job operation was attempted which is not permitted when the job is not active.
     */
    public static final String JobNotActive = "JobNotActive";

    /**
     * The specified job exists.
     */
    public static final String JobExists = "JobExists";

    /**
     * A Job Preparation task was not run on a compute node.
     */
    public static final String JobPreparationTaskNotRunOnNode = "JobPreparationTaskNotRunOnNode";

    /**
     * The specified job does not have a Job Preparation task.
     */
    public static final String JobPreparationTaskNotSpecified = "JobPreparationTaskNotSpecified";

    /**
     * A Job Release task was not run on a compute node.
     */
    public static final String JobReleaseTaskNotRunOnNode = "JobReleaseTaskNotRunOnNode";

    /**
     * The specified job does not have a Job Release task.
     */
    public static final String JobReleaseTaskNotSpecified = "JobReleaseTaskNotSpecified";

    /**
     * The job on which an operation was attempted is not present in the Batch account.
     */
    public static final String JobNotFound = "JobNotFound";

    /**
     * An I/O error occurred while trying to access a resource within the Batch account.
     */
    public static final String IOError = "IOError";

    /**
     * The specified operation is not valid for the current state of the resource.
     */
    public static final String OperationInvalidForCurrentState = "OperationInvalidForCurrentState";

    /**
     * The specified Azure Guest OS version is disabled.
     */
    public static final String OSVersionDisabled = "OSVersionDisabled";

    /**
     * The specified Azure Guest OS version is expired.
     */
    public static final String OSVersionExpired = "OSVersionExpired";

    /**
     * The specified Azure Guest OS version was not found.
     */
    public static final String OSVersionNotFound = "OSVersionNotFound";

    /**
     * A job priority was specified which was outside the permitted range of -1000 to 1000.
     */
    public static final String OutOfRangePriority = "OutOfRangePriority";

    /**
     * A file path was not found on a compute node.
     */
    public static final String PathNotFound = "PathNotFound";

    /**
     * A pool operation was attempted which is not permitted when the pool is in the process of being deleted.
     */
    public static final String PoolBeingDeleted = "PoolBeingDeleted";

    /**
     * A pool operation was attempted which is not permitted when the pool is in the process of being resized.
     */
    public static final String PoolBeingResized = "PoolBeingResized";

    /**
     * A pool operation was attempted which is not permitted when the pool is in the process of being created.
     */
    public static final String PoolBeingCreated = "PoolBeingCreated";

    /**
     * The pool you are attempting to add already exists.
     */
    public static final String PoolExists = "PoolExists";

    /**
     * The specified pool is not eligible for an operating system version upgrade.
     */
    public static final String PoolNotEligibleForOSVersionUpgrade = "PoolNotEligibleForOSVersionUpgrade";

    /**
     * The pool on which an operation was attempted is not present in the Batch account.
     */
    public static final String PoolNotFound = "PoolNotFound";

    /**
     * The account has reached its quota of pools.
     */
    public static final String PoolQuotaReached = "PoolQuotaReached";

    /**
     * The pool is already on the operating system version to which it was asked to upgrade.
     */
    public static final String PoolVersionEqualsUpgradeVersion = "PoolVersionEqualsUpgradeVersion";

    /**
     * A requested storage account was not found.
     */
    public static final String StorageAccountNotFound = "StorageAccountNotFound";

    /**
     * A task operation was attempted which is not permitted when the task has been completed.
     */
    public static final String TaskCompleted = "TaskCompleted";

    /**
     * A task was specified as depending on other tasks, but the job did not specify that it would use task dependencies.
     */
    public static final String TaskDependenciesNotSpecifiedOnJob = "TaskDependenciesNotSpecifiedOnJob";

    /**
     * A task was specified as depending on other tasks, but the list of dependencies was too long to be stored.
     */
    public static final String TaskDependencyListTooLong = "TaskDependencyListTooLong";

    /**
     * A task was specified as depending on other tasks, but the list of task ID ranges was too long to be stored.
     */
    public static final String TaskDependencyRangesTooLong = "TaskDependencyRangesTooLong";

    /**
     * The node files for a task are not available, for example because the retention period has expired.
     */
    public static final String TaskFilesUnavailable = "TaskFilesUnavailable";

    /**
     * The files of the specified task are cleaned up.
     */
    public static final String TaskFilesCleanedup = "TaskFilesCleanedup";

    /**
     * The task you are attempting to add already exists.
     */
    public static final String TaskExists = "TaskExists";

    /**
     * The task ID is the same as that of the Job Preparation task.
     */
    public static final String TaskIdSameAsJobPreparationTask = "TaskIdSameAsJobPreparationTask";

    /**
     * The task ID is the same as that of the Job Release task.
     */
    public static final String TaskIdSameAsJobReleaseTask = "TaskIdSameAsJobReleaseTask";

    /**
     * The task on which an operation was attempted is not present in the job.
     */
    public static final String TaskNotFound = "TaskNotFound";

    /**
     * A compute node operation was attempted which is not permitted when the node is in the process of being created.
     */
    public static final String NodeBeingCreated = "NodeBeingCreated";

    /**
     * A compute node operation was attempted which is not permitted when the node is in the process of being started.
     */
    public static final String NodeBeingStarted = "NodeBeingStarted";

    /**
     * A compute node operation was attempted which is not permitted when the node is in the process of being rebooted.
     */
    public static final String NodeBeingRebooted = "NodeBeingRebooted";

    /**
     * A compute node operation was attempted which is not permitted when the node is in the process of being reimaged.
     */
    public static final String NodeBeingReimaged = "NodeBeingReimaged";

    /**
     * The node counts do not match.
     */
    public static final String NodeCountsMismatch = "NodeCountsMismatch";

    /**
     * The compute node on which an operation was attempted is not present in the given pool.
     */
    public static final String NodeNotFound = "NodeNotFound";

    /**
     * A compute node operation was attempted which is not permitted when the node is unusable.
     */
    public static final String NodeStateUnusable = "NodeStateUnusable";

    /**
     * The compute node user account you are attempting to add already exists.
     */
    public static final String NodeUserExists = "NodeUserExists";

    /**
     * The compute node user account on which an operation was attempted does not exist.
     */
    public static final String NodeUserNotFound = "NodeUserNotFound";

    /**
     * The specified compute node is already in the target scheduling state.
     */
    public static final String NodeAlreadyInTargetSchedulingState = "NodeAlreadyInTargetSchedulingState";

    /**
     * The pool is already upgrading to a different operating system version.
     */
    public static final String UpgradePoolVersionConflict = "UpgradePoolVersionConflict";

    /**
     * A requested job or task constraint is not supported.
     */
    public static final String UnsupportedConstraint = "UnsupportedConstraint";

    /**
     * The specified version of the Batch REST API is not supported.
     */
    public static final String UnsupportedRequestVersion = "UnsupportedRequestVersion";

    /**
     * A job schedule operation was attempted which is not permitted when the schedule is in the process of being deleted.
     */
    public static final String JobScheduleBeingDeleted = "JobScheduleBeingDeleted";

    /**
     * A job schedule operation was attempted which is not permitted when the schedule is in the process of being terminated.
     */
    public static final String JobScheduleBeingTerminated = "JobScheduleBeingTerminated";

    /**
     * A job schedule operation was attempted which is not permitted when the schedule has completed.
     */
    public static final String JobScheduleCompleted = "JobScheduleCompleted";

    /**
     * A job schedule operation was attempted which is not permitted when the schedule is disabled.
     */
    public static final String JobScheduleDisabled = "JobScheduleDisabled";

    /**
     * The job schedule you are attempting to add already exists in the Batch account.
     */
    public static final String JobScheduleExists = "JobScheduleExists";

    /**
     * The job schedule on which an operation was attempted does not exist.
     */
    public static final String JobScheduleNotFound = "JobScheduleNotFound";

    /**
     * The specified job is disabled.
     */
    public static final String JobDisabled = "JobDisabled";

    /**
     * A job with the specified job schedule ID exists. Job and job schedule cannot have the same ID.
     */
    public static final String JobWithSameIdExists = "JobWithSameIdExists";

    /**
     * A job schedule with the specified job ID exists. Job and job schedule cannot have the same ID.
     */
    public static final String JobScheduleWithSameIdExists = "JobScheduleWithSameIdExists";

    // General

    /**
     * The Batch service failed to authenticate the request.
     */
    public static final String AuthenticationFailed = "AuthenticationFailed";

    /**
     * A read operation included a HTTP conditional header, and the condition was not met.
     */
    public static final String ConditionNotMet = "ConditionNotMet";

    /**
     * An add or update request specified a metadata item whose key is an empty string.
     */
    public static final String EmptyMetadataKey = "EmptyMetadataKey";

    /**
     * The host information was missing from the HTTP request.
     */
    public static final String HostInformationNotPresent = "HostInformationNotPresent";

    /**
     * The account being accessed does not have sufficient permissions to execute this operation.
     */
    public static final String InsufficientAccountPermissions = "InsufficientAccountPermissions";

    /**
     * An internal error occurred in the Batch service.
     */
    public static final String InternalError = "InternalError";

    /**
     * The authentication credentials were not provided in the correct format.
     */
    public static final String InvalidAuthenticationInfo = "InvalidAuthenticationInfo";

    /**
     * The specified auto-scale settings are not valid.
     */
    public static final String InvalidAutoScalingSettings = "InvalidAutoScalingSettings";

    /**
     * The value of one of the HTTP headers was in an incorrect format.
     */
    public static final String InvalidHeaderValue = "InvalidHeaderValue";

    /**
     * The Batch service did not recognize the HTTP verb used for the request.
     */
    public static final String InvalidHttpVerb = "InvalidHttpVerb";

    /**
     * One of the request inputs is not valid.
     */
    public static final String InvalidInput = "InvalidInput";

    /**
     * An add or update request specified a metadata item which contains characters that are not permitted.
     */
    public static final String InvalidMetadata = "InvalidMetadata";

    /**
     * The value of a property in the HTTP request body is invalid.
     */
    public static final String InvalidPropertyValue = "InvalidPropertyValue";

    /**
     * The HTTP request body is not syntactically valid.
     */
    public static final String InvalidRequestBody = "InvalidRequestBody";

    /**
     * The HTTP request URI contained invalid value for one of the query parameters.
     */
    public static final String InvalidQueryParameterValue = "InvalidQueryParameterValue";

    /**
     * The specified byte range is invalid for the given resource.
     */
    public static final String InvalidRange = "InvalidRange";

    /**
     * The HTTP request URI was invalid.
     */
    public static final String InvalidUri = "InvalidUri";

    /**
     * The size of the metadata exceeds the maximum permitted.
     */
    public static final String MetadataTooLarge = "MetadataTooLarge";

    /**
     * The HTTP content-length header was not specified.
     */
    public static final String MissingContentLengthHeader = "MissingContentLengthHeader";

    /**
     * A required HTTP header was not specified.
     */
    public static final String MissingRequiredHeader = "MissingRequiredHeader";

    /**
     * A required property was not specified in the HTTP request body.
     */
    public static final String MissingRequiredProperty = "MissingRequiredProperty";

    /**
     * A required query parameter was not specified in the URL.
     */
    public static final String MissingRequiredQueryParameter = "MissingRequiredQueryParameter";

    /**
     * Multiple condition headers are not supported.
     */
    public static final String MultipleConditionHeadersNotSupported = "MultipleConditionHeadersNotSupported";

    /**
     * The operation is not implemented.
     */
    public static final String NotImplemented = "NotImplemented";

    /**
     * One of the request inputs is out of range.
     */
    public static final String OutOfRangeInput = "OutOfRangeInput";

    /**
     * A query parameter in the request URL is out of range.
     */
    public static final String OutOfRangeQueryParameterValue = "OutOfRangeQueryParameterValue";

    /**
     * The operation could not be completed within the permitted time.
     */
    public static final String OperationTimedOut = "OperationTimedOut";

    /**
     * The size of the HTTP request body exceeds the maximum permitted.
     */
    public static final String RequestBodyTooLarge = "RequestBodyTooLarge";

    /**
     * The Batch service could not parse the request URL.
     */
    public static final String RequestUrlFailedToParse = "RequestUrlFailedToParse";

    /**
     * The specified resource does not exist.
     */
    public static final String ResourceNotFound = "ResourceNotFound";

    /**
     * The specified resource already exists.
     */
    public static final String ResourceAlreadyExists = "ResourceAlreadyExists";

    /**
     * The resource does not match the expected type.
     */
    public static final String ResourceTypeMismatch = "ResourceTypeMismatch";

    /**
     * The Batch service is currently unable to receive requests.
     */
    public static final String ServerBusy = "ServerBusy";

    /**
     * One of the HTTP headers specified in the request is not supported.
     */
    public static final String UnsupportedHeader = "UnsupportedHeader";

    /**
     * The resource does not support the specified HTTP verb.
     */
    public static final String UnsupportedHttpVerb = "UnsupportedHttpVerb";

    /**
     * The Batch service does not support the specified version of the HTTP protocol.
     */
    public static final String UnsupportedHttpVersion = "UnsupportedHttpVersion";

    /**
     * One of the properties specified in the HTTP request body is not supported.
     */
    public static final String UnsupportedProperty = "UnsupportedProperty";

    /**
     * One of the query parameters specified in the URL is not supported.
     */
    public static final String UnsupportedQueryParameter = "UnsupportedQueryParameter";
}