text:
> Codemod scripts for MUI

[![npm version](https://img.shields.io/npm/v/@mui/codemod.svg?style=flat-square)](https://www.npmjs.com/package/@mui/codemod)
[![npm downloads](https://img.shields.io/npm/dm/@mui/codemod.svg?style=flat-square)](https://www.npmjs.com/package/@mui/codemod)

This repository contains a collection of codemod scripts based for use with
[jscodeshift](https://github.com/facebook/jscodeshift) that help update MUI APIs.

## Setup & run

<!-- #default-branch-switch -->

```bash
npx @mui/codemod <codemod> <paths...>

Applies a `@mui/codemod` to the specified paths

Positionals:
  codemod  The name of the codemod                                [string]
  paths    Paths forwarded to `jscodeshift`                       [string]

Options:
  --version  Show version number                                 [boolean]
  --help     Show help                                           [boolean]
  --dry      dry run (no changes are made to files)
                                                [boolean] [default: false]
  --parser   which parser for jscodeshift to use.
                                                [string] [default: 'tsx']
  --print    print transformed files to stdout, useful for development
                                                [boolean] [default: false]
  --jscodeshift                                  [string] [default: false]

Examples:
  npx @mui/codemod v4.0.0/theme-spacing-api src
  npx @mui/codemod v5.0.0/component-rename-prop src --
  --component=Grid --from=prop --to=newProp
  npx @mui/codemod v5.0.0/preset-safe src --parser=flow
```

### jscodeshift options

To pass more options directly to jscodeshift, use `--jscodeshift="..."`. For example:

```sh
npx @mui/codemod --jscodeshift="--run-in-band --verbose=2"
```

See all available options [here](https://github.com/facebook/jscodeshift#usage-cli).

### Recast Options

Options to [recast](https://github.com/benjamn/recast)'s printer can be provided
through jscodeshift's `printOptions` command line argument

```sh
npx @mui/codemod <transform> <path> --jscodeshift="--printOptions='{\"quote\":\"double\"}'"
```

## Included scripts

### v5.0.0

#### `date-pickers-moved-to-x`

Rename the imports of date and time pickers from `@mui/lab` to `@mui/x-date-pickers` and `@mui/x-date-pickers-pro`.

```sh
npx @mui/codemod v5.0.0/date-pickers-moved-to-x <path>
```

#### 🚀 `preset-safe`

A combination of all important transformers for migrating v4 to v5. ⚠ This codemod should be run only once.

```sh
npx @mui/codemod v5.0.0/preset-safe <path|folder>
```

The list includes these transformers

- [`adapter-v4`](#adapter-v4)
- [`autocomplete-rename-closeicon`](#autocomplete-rename-closeicon)
- [`autocomplete-rename-option`](#autocomplete-rename-option)
- [`avatar-circle-circular`](#avatar-circle-circular)
- [`badge-overlap-value`](#badge-overlap-value)
- [`box-borderradius-values`](#box-borderradius-values)
- [`box-rename-css`](#box-rename-css)
- [`box-rename-gap`](#box-rename-gap)
- [`button-color-prop`](#button-color-prop)
- [`chip-variant-prop`](#chip-variant-prop)
- [`circularprogress-variant`](#circularprogress-variant)
- [`collapse-rename-collapsedheight`](#collapse-rename-collapsedheight)
- [`core-styles-import`](#core-styles-import)
- [`create-theme`](#create-theme)
- [`dialog-props`](#dialog-props)
- [`dialog-title-props`](#dialog-title-props)
- [`emotion-prepend-cache`](#emotion-prepend-cache)
- [`expansion-panel-component`](#expansion-panel-component)
- [`fab-variant`](#fab-variant)
- [`fade-rename-alpha`](#fade-rename-alpha)
- [`grid-justify-justifycontent`](#grid-justify-justifycontent)
- [`grid-list-component`](#grid-list-component)
- [`icon-button-size`](#icon-button-size)
- [`material-ui-styles`](#material-ui-styles)
- [`material-ui-types`](#material-ui-types)
- [`modal-props`](#modal-props)
- [`moved-lab-modules`](#moved-lab-modules)
- [`pagination-round-circular`](#pagination-round-circular)
- [`optimal-imports`](#optimal-imports)
- [`root-ref`](#root-ref)
- [`skeleton-variant`](#skeleton-variant)
- [`styled-engine-provider`](#styled-engine-provider)
- [`table-props`](#table-props)
- [`tabs-scroll-buttons`](#tabs-scroll-buttons)
- [`textarea-minmax-rows`](#textarea-minmax-rows)
- [`theme-augment`](#theme-augment)
- [`theme-breakpoints`](#theme-breakpoints)
- [`theme-breakpoints-width`](#theme-breakpoints-width)
- [`theme-options`](#theme-options)
- [`theme-palette-mode`](#theme-palette-mode)
- [`theme-provider`](#theme-provider)
- [`theme-spacing`](#theme-spacing)
- [`theme-typography-round`](#theme-typography-round)
- [`transitions`](#transitions)
- [`use-autocomplete`](#use-autocomplete)
- [`use-transitionprops`](#use-transitionprops)
- [`with-mobile-dialog`](#with-mobile-dialog)
- [`with-width`](#with-width)
- [`mui-replace`](#mui-replace)

#### `adapter-v4`

Imports and inserts `adaptV4Theme` into `createTheme` (or `createMuiTheme`)

```diff
+import { adaptV4Theme } from '@material-ui/core/styles';

-createTheme({ palette: { ... }})
+createTheme(adaptV4Theme({ palette: { ... }}))
```

```sh
npx @mui/codemod v5.0.0/adapter-v4 <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#theme).

#### `autocomplete-rename-closeicon`

Renames `Autocomplete`'s `closeIcon` prop to `clearIcon`.

```diff
-<Autocomplete closeIcon={defaultClearIcon} />
+<Autocomplete clearIcon={defaultClearIcon} />
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/autocomplete-rename-closeicon  <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#autocomplete).

#### `autocomplete-rename-option`

Renames `Autocomplete`'s `getOptionSelected` to `isOptionEqualToValue`.

```diff
 <Autocomplete
-  getOptionSelected={(option, value) => option.title === value.title}
+  isOptionEqualToValue={(option, value) => option.title === value.title}
 />
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/autocomplete-rename-option  <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#autocomplete).

#### `avatar-circle-circular`

Updates the `Avatar`'s `variant` value and `classes` key from 'circle' to 'circular'.

```diff
-<Avatar variant="circle" />
-<Avatar classes={{ circle: 'className' }} />
+<Avatar variant="circular" />
+<Avatar classes={{ circular: 'className' }} />
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/avatar-circle-circular <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#avatar).

#### `badge-overlap-value`

Renames the badge's props.

```diff
-<Badge overlap="circle">
-<Badge overlap="rectangle">
+<Badge overlap="circular">
+<Badge overlap="rectangular">
 <Badge classes={{
-  anchorOriginTopRightRectangle: 'className',
-  anchorOriginBottomRightRectangle: 'className',
-  anchorOriginTopLeftRectangle: 'className',
-  anchorOriginBottomLeftRectangle: 'className',
-  anchorOriginTopRightCircle: 'className',
-  anchorOriginBottomRightCircle: 'className',
-  anchorOriginTopLeftCircle: 'className',
+  anchorOriginTopRightRectangular: 'className',
+  anchorOriginBottomRightRectangular: 'className',
+  anchorOriginTopLeftRectangular: 'className',
+  anchorOriginBottomLeftRectangular: 'className',
+  anchorOriginTopRightCircular: 'className',
+  anchorOriginBottomRightCircular: 'className',
+  anchorOriginTopLeftCircular: 'className',
 }}>
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/badge-overlap-value <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#badge).

#### `base-rename-components-to-slots`

Renames the `components` and `componentsProps` props to `slots` and `slotProps`, respectively.
Also, changes `slots`' fields names to camelCase.

This change only affects MUI Base components.

```diff
 <BadgeUnstyled
-  components={{ Root, Badge: CustomBadge }}
+  slots={{ root: Root, badge: CustomBadge }}
-  componentsProps={{ root: { className: 'root' }, badge: { 'data-testid': 'badge' } }}
+  slotProps={{ root: { className: 'root' }, badge: { 'data-testid': 'badge' } }}
 />;
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/base-rename-components-to-slots <path>
```

The associated breaking change was done in [#34693](https://github.com/mui/material-ui/pull/34693).

#### `box-borderradius-values`

Updates the Box API from separate system props to `sx`.

```diff
-<Box borderRadius="borderRadius">
-<Box borderRadius={16}>
+<Box borderRadius={1}>
+<Box borderRadius="16px">
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/box-borderradius-values <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#box).

#### `box-rename-css`

Renames the Box `css` prop to `sx`

```diff
-<Box css={{ m: 2 }}>
+<Box sx={{ m: 2 }}>
```

```sh
npx @mui/codemod v5.0.0/box-rename-css <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#box).

#### `box-rename-gap`

Renames the Box `grid*Gap` props.

```diff
-<Box gridGap={2}>Item 3</Box>
-<Box gridColumnGap={3}>Item 4</Box>
-<Box gridRowGap={4}>Item 5</Box>
+<Box gap={2}>Item 3</Box>
+<Box columnGap={3}>Item 4</Box>
+<Box rowGap={4}>Item 5</Box>
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/box-rename-gap <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#box).

#### `button-color-prop`

Removes the outdated `color` prop values.

```diff
-<Button color="default">
+<Button>
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/button-color-prop <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#button).

#### `chip-variant-prop`

Removes the Chip `variant` prop if the value is `"default"`.

```diff
-<Chip variant="default">
+<Chip>
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/chip-variant-prop <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#chip).

#### `circularprogress-variant`

Renames the CircularProgress `static` variant to `determinate`.

```diff
-<CircularProgress variant="static" classes={{ static: 'className' }} />
+<CircularProgress variant="determinate" classes={{ determinate: 'className' }} />
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/circularprogress-variant <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#circularprogress).

#### `collapse-rename-collapsedheight`

Renames `Collapse`'s `collapsedHeight` prop to `collapsedSize`.

```diff
-<Collapse collapsedHeight={40} />
-<Collapse classes={{ container: 'collapse' }} />
+<Collapse collapsedSize={40} />
+<Collapse classes={{ root: 'collapse' }} />
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/collapse-rename-collapsedheight <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#collapse).

#### `component-rename-prop`

A generic codemod to rename any component prop.

```diff
-<Component prop="value" />
-<Component prop />
+<Component newProp="value" />
+<Component newProp />
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/component-rename-prop <path> -- --component=Grid --from=prop --to=newProp
```

#### `core-styles-import`

Renames private import from `core/styles/*` to `core/styles`

```diff
-import { darken, lighten } from '@material-ui/core/styles/colorManipulator';
+import { darken, lighten } from '@material-ui/core/styles';
```

```sh
npx @mui/codemod v5.0.0/core-styles-import <path>
```

#### `create-theme`

Renames the function `createMuiTheme` to `createTheme`

```diff
-import { createMuiTheme } from '@material-ui/core/styles';
+import { createTheme } from '@material-ui/core/styles';
```

```sh
npx @mui/codemod v5.0.0/create-theme <path>
```

#### `dialog-props`

Remove `disableBackdropClick` prop from `<Dialog>`

```diff
-<Dialog disableBackdropClick />
+<Dialog />
```

```sh
npx @mui/codemod v5.0.0/dialog-props <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#dialog).

#### `dialog-title-props`

Remove `disableTypography` prop from `<DialogTitle>`

```diff
-<DialogTitle disableTypography />
+<DialogTitle />
```

```sh
npx @mui/codemod v5.0.0/dialog-title-props <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#dialog).

#### `emotion-prepend-cache`

Adds `prepend: true` to Emotion `createCache`

```diff
 const cache = emotionCreateCache({
   key: 'css',
+  prepend: true,
 });
```

```sh
npx @mui/codemod v5.0.0/create-theme <path>
```

#### `expansion-panel-component`

Renames `ExpansionPanel*` to `Accordion*`

```sh
npx @mui/codemod v5.0.0/expansion-panel-component <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#expansionpanel).

#### `fab-variant`

```diff
-<Fab variant="round" />
+<Fab variant="circular" />
```

```sh
npx @mui/codemod v5.0.0/fab-variant <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#fab).

#### `fade-rename-alpha`

Renames the `fade` style utility import and calls to `alpha`.

```diff
-import { fade, lighten } from '@material-ui/core/styles';
+import { alpha, lighten } from '@material-ui/core/styles';

-const foo = fade('#aaa');
+const foo = alpha('#aaa');
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/fade-rename-alpha <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#styles).

#### `grid-justify-justifycontent`

Renames `Grid`'s `justify` prop to `justifyContent`.

```diff
-<Grid justify="left">Item</Grid>
+<Grid item justifyContent="left">Item</Grid>
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/grid-justify-justifycontent <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#grid).

#### `grid-list-component`

Renames `GridList*` to `ImageList*`

```sh
npx @mui/codemod v5.0.0/grid-list-component <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#gridlist).

#### `icon-button-size`

Adds `size="large"` if `size` is not defined to get the same appearance as v4.

```diff
-<IconButton size="medium" />
-<IconButton />
+<IconButton size="medium" />
+<IconButton size="large" />
```

```sh
npx @mui/codemod v5.0.0/icon-button-size <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#iconbutton).

#### `jss-to-styled`

Replace JSS styling with `makeStyles` or `withStyles` to `styled` API.

```diff
 import Typography from '@material-ui/core/Typography';
-import makeStyles from '@material-ui/styles/makeStyles';
+import { styled } from '@material-ui/core/styles';

-const useStyles = makeStyles((theme) => ({
-  root: {
-    display: 'flex',
-    alignItems: 'center',
-    backgroundColor: theme.palette.primary.main
-  },
-  cta: {
-    borderRadius: theme.shape.radius
-  },
-  content: {
-    color: theme.palette.common.white,
-    fontSize: 16,
-    lineHeight: 1.7
-  },
-}))
+const PREFIX = 'MyCard';
+const classes = {
+  root: `${PREFIX}-root`,
+  cta: `${PREFIX}-cta`,
+  content: `${PREFIX}-content`,
+}
+const Root = styled('div')((theme) => ({
+  [`&.${classes.root}`]: {
+    display: 'flex',
+    alignItems: 'center',
+    backgroundColor: theme.palette.primary.main
+  },
+  [`& .${classes.cta}`]: {
+    borderRadius: theme.shape.radius
+  },
+  [`& .${classes.content}`]: {
+    color: theme.palette.common.white,
+    fontSize: 16,
+    lineHeight: 1.7
+  },
+}))

 export const MyCard = () => {
   const classes = useStyles();
   return (
-    <div className={classes.root}>
+    <Root className={classes.root}>
       <Typography className={classes.content}>...</Typography>
       <Button className={classes.cta}>Go</Button>
-    </div>
+    </Root>
   )
 }
```

```sh
npx @mui/codemod v5.0.0/jss-to-styled <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#1-use-styled-or-sx-api).

> **Note:** This approach converts the first element in the return statement into styled component but also increases CSS specificity to override nested children.
> This codemod should be adopted after handling all breaking changes, [check out the migration documentation](https://mui.com/material-ui/migration/migration-v4/).

#### `jss-to-tss-react`

Migrate JSS styling with `makeStyles` or `withStyles` to the corresponding `tss-react` API.

```diff
-import clsx from 'clsx';
-import {makeStyles, createStyles} from '@material-ui/core/styles';
+import { makeStyles } from 'tss-react/mui';

-const useStyles = makeStyles((theme) => createStyles<
-  'root' | 'small' | 'child', {color: 'primary' | 'secondary', padding: number}
->
-({
-  root: ({color, padding}) => ({
+const useStyles = makeStyles<{color: 'primary' | 'secondary', padding: number}, 'child' | 'small'>({name: 'App'})((theme, { color, padding }, classes) => ({
+  root: {
     padding: padding,
-    '&:hover $child': {
+    [`&:hover .${classes.child}`]: {
       backgroundColor: theme.palette[color].main,
     }
-  }),
+  },
   small: {},
   child: {
     border: '1px solid black',
     height: 50,
-    '&$small': {
+    [`&.${classes.small}`]: {
       height: 30
     }
   }
-}), {name: 'App'});
+}));

 function App({classes: classesProp}: {classes?: any}) {
-  const classes = useStyles({color: 'primary', padding: 30, classes: classesProp});
+  const { classes, cx } = useStyles({
+    color: 'primary',
+    padding: 30
+  }, {
+    props: {
+      classes: classesProp
+    }
+  });

   return (
     <div className={classes.root}>
       <div className={classes.child}>
         The Background take the primary theme color when the mouse hovers the parent.
       </div>
-      <div className={clsx(classes.child, classes.small)}>
+      <div className={cx(classes.child, classes.small)}>
         The Background take the primary theme color when the mouse hovers the parent.
         I am smaller than the other child.
       </div>
     </div>
   );
 }

 export default App;
```

```sh
npx @mui/codemod v5.0.0/jss-to-tss-react <path>
```

The following scenarios are not currently handled by this codemod and will be marked with a
"TODO jss-to-tss-react codemod" comment:

- If the hook returned by `makeStyles` (e.g. `useStyles`) is exported and used in another file,
  the usages in other files will not be converted.
- Arrow functions as the value for a CSS prop will not be converted. Arrow functions **are**
  supported at the rule level, though with some caveats listed below.
- In order for arrow functions at the rule level to be converted, the parameter must use object
  destructuring (e.g. `root: ({color, padding}) => (...)`). If the parameter is not destructured
  (e.g. `root: (props) => (...)`), it will not be converted.
- If an arrow function at the rule level contains a code block (i.e. contains an explicit `return`
  statement) rather than just an object expression, it will not be converted.

You can find more details about migrating from JSS to tss-react in [the migration guide](https://mui.com/material-ui/migration/migrating-from-jss/#2-use-tss-react).

#### `link-underline-hover`

Apply `underline="hover"` to `<Link />` that does not define `underline` prop (to get the same behavior as in v4).

```diff
-<Link />
+<Link underline="hover" />
```

```sh
npx @mui/codemod v5.0.0/link-underline-hover <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#link).

#### `material-ui-styles`

Moves JSS imports to `@material-ui/styles`

```diff
-import {
-  createGenerateClassName,
-  createStyles,
-  jssPreset,
-  makeStyles,
-  ServerStyleSheets,
-  useThemeVariants,
-  withStyles,
-  withTheme,
-  ThemeProvider,
-  styled,
-  getStylesCreator,
-  mergeClasses,
-} from '@material-ui/core/styles';
+import { ThemeProvider, styled } from '@material-ui/core/styles';
+import createGenerateClassName from '@material-ui/styles/createGenerateClassName';
+import createStyles from '@material-ui/styles/createStyles';
+import jssPreset from '@material-ui/styles/jssPreset';
+import makeStyles from '@material-ui/styles/makeStyles';
+import ServerStyleSheets from '@material-ui/styles/ServerStyleSheets';
+import useThemeVariants from '@material-ui/styles/useThemeVariants';
+import withStyles from '@material-ui/styles/withStyles';
+import withTheme from '@material-ui/styles/withTheme';
+import getStylesCreator from '@material-ui/styles/getStylesCreator';
 import mergeClasses from '@material-ui/styles/mergeClasses';
```

```sh
npx @mui/codemod v5.0.0/material-ui-styles <path>
```

#### `material-ui-types`

Renames `Omit` import from `@material-ui/types` to `DistributiveOmit`

```diff
-import { Omit } from '@material-ui/types';
+import { DistributiveOmit } from '@material-ui/types';
```

```sh
npx @mui/codemod v5.0.0/material-ui-types <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#material-ui-types).

#### `modal-props`

Removes `disableBackdropClick` and `onEscapeKeyDown` from `<Modal>`

```diff
 <Modal
-  disableBackdropClick
-  onEscapeKeyDown={handleEscapeKeyDown}
 />
```

```sh
npx @mui/codemod v5.0.0/modal-props <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#modal).

#### `moved-lab-modules`

Updates all imports for `@material-ui/lab` components that have moved to `@material-ui/core`.

```diff
-import Skeleton from '@material-ui/lab/Skeleton';
+import Skeleton from '@material-ui/core/Skeleton';
```

or

```diff
-import { SpeedDial } from '@material-ui/lab';
+import { SpeedDial } from '@material-ui/core';
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/moved-lab-modules <path>
```

You can find more details about this breaking change in the migration guide.

- [Alert](https://mui.com/material-ui/migration/v5-component-changes/#alert)
- [Autocomplete](https://mui.com/material-ui/migration/v5-component-changes/#autocomplete)
- [AvatarGroup](https://mui.com/material-ui/migration/v5-component-changes/#avatar)
- [Pagination](https://mui.com/material-ui/migration/v5-component-changes/#pagination)
- [Skeleton](https://mui.com/material-ui/migration/v5-component-changes/#skeleton)
- [SpeedDial](https://mui.com/material-ui/migration/v5-component-changes/#speeddial)
- [ToggleButton](https://mui.com/material-ui/migration/v5-component-changes/#togglebutton)

#### `pagination-round-circular`

Renames `Pagination*`'s `shape` values from 'round' to 'circular'.

```diff
-<Pagination shape="round" />
-<PaginationItem shape="round" />
+<Pagination shape="circular" />
+<PaginationItem shape="circular" />
```

```sh
npx @mui/codemod v5.0.0/pagination-round-circular <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#pagination).

#### `optimal-imports`

Fix private import paths.

```diff
-import red from '@material-ui/core/colors/red';
-import createTheme from '@material-ui/core/styles/createTheme';
+import { red } from '@material-ui/core/colors';
+import { createTheme } from '@material-ui/core/styles';
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/optimal-imports <path>
```

#### `root-ref`

Removes `RootRef` from the codebase.

```sh
npx @mui/codemod v5.0.0/root-ref <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#rootref).

#### `skeleton-variant`

```diff
-<Skeleton variant="circle" />
-<Skeleton variant="rect" />
+<Skeleton variant="circular" />
+<Skeleton variant="rectangular" />
```

```sh
npx @mui/codemod v5.0.0/skeleton-variant <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#skeleton).

#### `styled-engine-provider`

Applies `StyledEngineProvider` to the files that contains `ThemeProvider`.

```sh
npx @mui/codemod v5.0.0/styled-engine-provider <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-style-changes/#style-library).

#### `table-props`

Renames props in `Table*` components.

```diff
-<>
-  <TablePagination onChangeRowsPerPage={() => {}} onChangePage={() => {}} />
-  <TablePagination classes={{ input: 'foo' }} />
-  <Table padding="default" />
-  <TableCell padding="default" />
-</>
+<>
+  <TablePagination onRowsPerPageChange={() => {}} onPageChange={() => {}} />
+  <TablePagination classes={{ select: 'foo' }} />
+  <Table padding="normal" />
+  <TableCell padding="normal" />
+</>

```

```sh
npx @mui/codemod v5.0.0/table-props <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#table).

#### `tabs-scroll-buttons`

Renames the `Tabs`'s `scrollButtons` prop values.

```diff
-<Tabs scrollButtons="on" />
-<Tabs scrollButtons="desktop" />
-<Tabs scrollButtons="off" />
+<Tabs scrollButtons allowScrollButtonsMobile />
+<Tabs scrollButtons />
+<Tabs scrollButtons={false} />
```

```sh
npx @mui/codemod v5.0.0/tabs-scroll-buttons <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#tabs).

#### `textarea-minmax-rows`

Renames `TextField`'s rows props.

```diff
-<TextField rowsMin={3} rowsMax={6} />
-<TextareaAutosize rows={2} />
-<TextareaAutosize rowsMin={3} rowsMax={6} />
+<TextField minRows={3} maxRows={6} />
+<TextareaAutosize minRows={2} />
+<TextareaAutosize minRows={3} maxRows={6} />
```

```sh
npx @mui/codemod v5.0.0/textarea-minmax-rows <path>
```

You can find more details about this breaking change in the migration guide.

- [TextareaAutosize](https://mui.com/material-ui/migration/v5-component-changes/#textareaautoresize)
- [TextField](https://mui.com/material-ui/migration/v5-component-changes/#textfield)

#### `theme-augment`

Adds `DefaultTheme` module augmentation to typescript projects.

```sh
npx @mui/codemod v5.0.0/theme-augment <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#material-ui-styles).

#### `theme-breakpoints`

Updates breakpoint values to match new logic. ⚠ This mod is not idempotent, it should be run only once.

```diff
-theme.breakpoints.down('sm')
-theme.breakpoints.between('sm', 'md')
+theme.breakpoints.down('md')
+theme.breakpoints.between('sm', 'lg')
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/theme-breakpoints <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#theme).

#### `theme-breakpoints-width`

Renames `theme.breakpoints.width('md')` to `theme.breakpoints.values.md`.

```sh
npx @mui/codemod v5.0.0/theme-breakpoints-width <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#theme).

#### `theme-options`

```diff
-import { ThemeOptions } from '@material-ui/core';
+import { DeprecatedThemeOptions } from '@material-ui/core';
```

```sh
npx @mui/codemod v5.0.0/theme-options <path>
```

#### `theme-palette-mode`

Renames `type` to `mode`.

```diff
 {
   palette: {
-    type: 'dark',
+    mode: 'dark',
   },
 }
```

```diff
-theme.palette.type === 'dark'
+theme.palette.mode === 'dark'
```

```sh
npx @mui/codemod v5.0.0/theme-palette-mode <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#theme).

#### `theme-provider`

Renames `MuiThemeProvider` to `ThemeProvider`.

```sh
npx @mui/codemod v5.0.0/theme-provider <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#material-ui-core-styles).

#### `theme-spacing`

Removes the 'px' suffix from some template strings.

```diff
-`${theme.spacing(2)}px`
-`${theme.spacing(2)}px ${theme.spacing(4)}px`
+`${theme.spacing(2)}`
+`${theme.spacing(2)} ${theme.spacing(4)}`
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/theme-spacing <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#theme).

#### `theme-typography-round`

Renames `theme.typography.round($number)` to `Math.round($number * 1e5) / 1e5`.

```diff
-`${theme.typography.round($number)}`
+`${Math.round($number * 1e5) / 1e5}`
```

```sh
npx @mui/codemod v5.0.0/theme-typography-round <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#theme).

#### `top-level-imports`

Converts all `@mui/material` submodule imports to the root module:

```diff
-import List from '@mui/material/List';
-import Grid from '@mui/material/Grid';
+import { List, Grid } from '@mui/material';
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/top-level-imports <path>
```

Head to https://mui.com/guides/minimizing-bundle-size/ to understand when it's useful.

#### `transitions`

Renames import `transitions` to `createTransitions`

```sh
npx @mui/codemod v5.0.0/transitions <path>
```

#### `use-autocomplete`

Renames `useAutocomplete` related import from lab to core

```diff
-import useAutocomplete from '@material-ui/lab/useAutocomplete';
+import useAutocomplete from '@material-ui/core/useAutocomplete';
```

```sh
npx @mui/codemod v5.0.0/use-autocomplete <path>
```

#### `use-transitionprops`

Updates Dialog, Menu, Popover, and Snackbar to use the `TransitionProps` prop to replace the `onEnter*` and `onExit*` props.

```diff
 <Dialog
-  onEnter={onEnter}
-  onEntered={onEntered}
-  onEntering={onEntering}
-  onExit={onExit}
-  onExited={onExited}
-  onExiting={onExiting}
+  TransitionProps={{
+    onEnter,
+    onEntered,
+    onEntering,
+    onExit,
+    onExited,
+    onExiting,
+  }}
 />
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/use-transitionprops <path>
```

You can find more details about this breaking change in [the migration guide](/material-ui/migration/v5-component-changes/#dialog).

#### `variant-prop`

> Don't run this codemod if you already set `variant` to `outlined` or `filled` in theme default props.

Adds the TextField, Select, and FormControl's `variant="standard"` prop when `variant` is undefined.
The diff should look like this:

```diff
-<TextField value="Standard" />
+<TextField value="Standard" variant="standard" />
```

```diff
-<Select value="Standard" />
+<Select value="Standard" variant="standard" />
```

```diff
-<FormControl value="Standard" />
+<FormControl value="Standard" variant="standard" />
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v5.0.0/variant-prop <path>
```

#### `with-mobile-dialog`

Removes imported `withMobileDialog`, and inserts hardcoded version to prevent application crash.

```diff
-import withMobileDialog from '@material-ui/core/withMobileDialog';
+// FIXME checkout https://mui.com/material-ui/migration/v5-component-changes/#dialog
+const withMobileDialog = () => (WrappedComponent) => (props) => <WrappedComponent {...props} width="lg" fullScreen={false} />;
```

```sh
npx @mui/codemod v5.0.0/with-mobile-dialog <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-component-changes/#dialog).

#### `with-width`

Removes `withWidth` import, and inserts hardcoded version to prevent application crash.

```diff
-import withWidth from '@material-ui/core/withWidth';
+// FIXME checkout https://mui.com/components/use-media-query/#migrating-from-withwidth
+const withWidth = () => (WrappedComponent) => (props) => <WrappedComponent {...props} width="xs" />;
```

```sh
npx @mui/codemod v5.0.0/with-width <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/v5-style-changes/#material-ui-core-styles).

#### `mui-replace`

Replace every occurrence of `material-ui` related package with the new package names (listed below) except these packages (`@material-ui/pickers`, `@material-ui/data-grid`, `@material-ui/x-grid` & `@material-ui/x-grid-data-generator`). [More details about why package names are changed](https://github.com/mui/material-ui/issues/27666)

**Material Design components**

```diff
-import Alert from '@material-ui/core/Alert';
+import Alert from '@mui/material/Alert';
```

**JSS styles package**

```diff
-import { makeStyles } from '@material-ui/styles';
+import { makeStyles } from '@mui/styles';
```

**System package**

```diff
-import { SxProps } from '@material-ui/system';
+import { SxProps } from '@mui/system';
```

**Utilities package**

```diff
-import { deepmerge } from '@material-ui/utils';
+import { deepmerge } from '@mui/utils';
```

**Lab**

```diff
-import Mansory from '@material-ui/lab/Mansory';
+import Mansory from '@mui/lab/Mansory';
```

**Dependencies**

```diff
  // package.json
-"@material-ui/core": "next",
-"@material-ui/icons": "next",
-"@material-ui/lab": "next",
-"@material-ui/unstyled": "next",
-"@material-ui/styled-engine-sc": "next",
+"@mui/material": "next",
+"@mui/icons-material": "next",
+"@mui/lab": "next",
+"@mui/base": "next",
+"@mui/styled-engine-sc": "next",
```

```sh
npx @mui/codemod v5.0.0/mui-replace <path>
```

You can find more details about this breaking change in [the migration guide](https://mui.com/material-ui/migration/migration-v4/#update-material-ui-version).

### v4.0.0

#### `theme-spacing-api`

Updates the `theme-spacing-api` from `theme.spacing.unit x` to `theme.spacing(x)`.
The diff should look like this:

```diff
-const spacing = theme.spacing.unit;
+const spacing = theme.spacing(1);
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v4.0.0/theme-spacing-api <path>
```

This codemod tries to perform a basic expression simplification which can be improved for expressions that use more than one operation.

```diff
-const spacing = theme.spacing.unit / 5;
+const spacing = theme.spacing(0.2);

 // Limitation
-const spacing = theme.spacing.unit * 5 * 5;
+const spacing = theme.spacing(5) * 5;
```

#### `optimal-imports`

Converts all `@material-ui/core` imports more than 1 level deep to the optimal form for tree shaking:

```diff
-import withStyles from '@material-ui/core/styles/withStyles';
-import createTheme from '@material-ui/core/styles/createTheme';
+import { withStyles, createTheme } from '@material-ui/core/styles';
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v4.0.0/optimal-imports <path>
```

Head to https://mui.com/guides/minimizing-bundle-size/ to understand when it's useful.

#### `top-level-imports`

Converts all `@material-ui/core` submodule imports to the root module:

```diff
-import List from '@material-ui/core/List';
-import { withStyles } from '@material-ui/core/styles';
+import { List, withStyles } from '@material-ui/core';
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v4.0.0/top-level-imports <path>
```

Head to https://mui.com/guides/minimizing-bundle-size/ to understand when it's useful.

### v1.0.0

#### `import-path`

Updates the `import-paths` for the new location of the components.
MUI v1.0.0 flatten the import paths.
The diff should look like this:

```diff
-import { MenuItem } from '@material-ui/core/Menu';
+import MenuItem from '@material-ui/core/MenuItem';
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v1.0.0/import-path <path>
```

**Notice**: if you are migrating from pre-v1.0, and your imports use `material-ui`, you will need to manually find and replace all references to `material-ui` in your code to `@material-ui/core`. E.g.:

```diff
-import Typography from 'material-ui/Typography';
+import Typography from '@material-ui/core/Typography';
```

Subsequently, you can run the above `find ...` command to flatten your imports.

#### `color-imports`

Updates the `color-imports` for the new location of MUI color palettes.
The diff should look like this:

```diff
-import { blue, teal500 } from 'material-ui/styles/colors';
+import blue from '@material-ui/core/colors/blue';
+import teal from '@material-ui/core/colors/teal';
+const teal500 = teal['500'];
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v1.0.0/color-imports <path>
```

**additional options**

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v1.0.0/color-imports <path> -- --importPath='mui/styles/colors' --targetPath='mui/colors'
```

#### `svg-icon-imports`

Updates the `svg-icons` import paths from `material-ui/svg-icons/<category>/<icon-name>` to `@material-ui/icons/<IconName>`, to use the new `@material-ui/icons` package.
The diff should look like this:

```diff
-import AccessAlarmIcon from 'material-ui/svg-icons/device/AccessAlarm';
-import ThreeDRotation from 'material-ui/svg-icons/action/ThreeDRotation';
+import AccessAlarmIcon from '@material-ui/icons/AccessAlarm';
+import ThreeDRotation from '@material-ui/icons/ThreeDRotation';
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v1.0.0/svg-icon-imports <path>
```

#### `menu-item-primary-text`

Updates `MenuItem` with `primaryText` property making its value tag's child.
The diff should look like this:

```diff
-<MenuItem primaryText="Profile" />
-<MenuItem primaryText={"Profile" + "!"} />
+<MenuItem>Profile</MenuItem>
+<MenuItem>{"Profile" + "!"}</MenuItem>
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v1.0.0/menu-item-primary-text <path>
```

### v0.15.0

#### `import-path`

Updates the `import-paths` for the new location of the components.
MUI v0.15.0 is reorganizing the folder distribution of the project.
The diff should look like this:

```diff
 // From the source
-import FlatButton from 'material-ui/src/flat-button';
+import FlatButton from 'material-ui/src/FlatButton';

 // From npm
-import RaisedButton from 'material-ui/lib/raised-button';
+import RaisedButton from 'material-ui/RaisedButton';
```

<!-- #default-branch-switch -->

```sh
npx @mui/codemod v0.15.0/import-path <path>
```


text:
'use strict';

module.exports = [
  '$log',
  '$rootScope',
  '$location',
  function($log, $rootScope, $location){
    this.$onInit = () => {

      let url = $location.url();
      this.viewPost = url === '/post#view' || url === '/post';
      this.createPost = url === '/post#create';
      this.editPost = url === '/post#edit';

      this.showEdit = () => {
        this.editPost=true;
        this.viewPost=false;
      };

      this.showView = () => {
        this.editPost=false;
        this.viewPost=true;
      };
    };
  }];

redpajama_set_name: RedPajamaGithub


text:
{% import 'student/assignment/_formhelpers.html' as forms %}
{% import '_globalhelpers.html' as globals %}

{% macro render_subms(subms, course, flagged, flag_form, tname="Submissions", empty=True) %}
  {% if subms %}

{{ tname }}

          ID
          Author
          Flag
          Code

        {% for subm in subms %}

              Submission {{ globals.backup_style(subm.hashid) }}

              {{ subm.submitter.email }}
              {{ utils.local_time(subm.created, course) }}

            {% call forms.render_form(flag_form, action_url=url_for('.flag', name=assignment.name, bid=subm.id), class_='form-inline') %}
              {% if not subm.flagged %}
                <input type="hidden" name="flag">
              {% endif %}
              <input type="hidden" name="next" value="{{ request.url }}">
              <button class="flag-button tip-trigger final-button button-small"  {% if not assignment.active %} disabled {% endif %} type="submit">

                  {% if not assignment.active %}
                    Cannot be changed after deadline
                  {% elif subm.flagged %}
                    Flagged for grading (click to unflag)
                  {% else %}
                    Not flagged for grading (click to flag)
                  {% endif %}

                  {{ 'Remove Flag' if subm.flagged else 'Flag for grading' }}
              </button>
            {% endcall %}

                View Code

        {% endfor %}

  {% elif empty %}

No {{ tname }}

  {% endif %}
{% endmacro %}

{% macro render_backups(backups, course, flagged, flag_form, tname="Backups", empty=True) %}
  {% if backups %}

{{ tname }}

          ID
          Author
          Submit
          Code

        {% for backup in backups %}

              Backup {{ globals.backup_style(backup.hashid) }}

              {{ backup.submitter.email }}
              {{ utils.local_time(backup.created, course) }}

            {% call forms.render_form(flag_form, action_url=url_for('.flag', name=assignment.name, bid=backup.id), class_='form-inline') %}
              <input type="hidden" name="flag">
              <input type="hidden" name="next" value="{{ request.url }}">
              <button class="convert-button tip-trigger final-button button-small"  {% if not assignment.active %} disabled {% endif %} type="submit">
                  {% if not assignment.active %}

                    Too late to convert submission

                  {% else %}

                    Convert to submission &
 flag for grading (click to flag)

                  {% endif %}
                  Convert to submission
              </button>
            {% endcall %}

                View Code

        {% endfor %}

  {% elif empty %}

No {{ tname }}

  {% endif %}
{% endmacro %}

{% macro render_subms_mobile(subms, course, flagged, flag_form, tname="Submissions", empty=True) %}
  {% if subms %}

{{tname}}

      {% for subm in subms %}

 {{ utils.local_time(subm.created, course) }}

Submitter:  {{ subm.submitter.email }}

          {% if subm.flagged %}
           Flagged for Grading. This submission will be graded.
          {% elif not flagged and loop.index == 1 %}

               This is the most recent submission.
              Unless you flag another submission, the most recent submission will be graded
              {% else %}

 Not flagged for grading.
          {% endif %}

                    View Code

                {% call forms.render_form(flag_form, action_url=url_for('.flag', name=assignment.name, bid=subm.id), class_='form-inline') %}
                  {% if not subm.flagged %}
                    <input type="hidden" name="flag">
                  {% endif %}
                  <input type="hidden" name="next" value="{{ request.url }}">
                  <button class="final-button" type="submit">
                      {{ 'Remove Flag for Grading' if subm.flagged else 'Flag for Grading' }}
                  </button>
                {% endcall %}

      {% endfor %}

  {% elif empty %}

No {{ tname }}

  {% endif %}
{% endmacro %}

{% macro render_backups_mobile(backups, course, flagged, flag_form, tname="Backups", empty=True) %}
  {% if backups %}

{{tname}}

      {% for backup in backups %}

 {{ utils.local_time(backup.created, course) }}

Submitter:  {{ backup.submitter.email }}

                    View Code

                {% call forms.render_form(flag_form, action_url=url_for('.flag', name=assignment.name, bid=backup.id), class_='form-inline') %}
                  <input type="hidden" name="flag">
                  <input type="hidden" name="next" value="{{ request.url }}">
                  <button class="final-button" type="submit">
                       Submit & Flag for Grading
                  </button>
                {% endcall %}

      {% endfor %}

  {% elif empty %}

No {{ tname }}

  {% endif %}
{% endmacro %}


text:
layout:     post
permalink:  /en/denver-colorado
ref:        denver-colorado
lang:       en
title:      Denver, Colorado
date:       2017-11-22 12:00:00
image:      https://content.11route.com/posts/2017/denver-colorado/cover-2000.jpg
summary:    In the mountains of Colorado.
categories:
  - denver
  - colorado
  - usa
  - rocky mountains
location:
  latitude:  39.7409662
  longitude: -105.0001597
---

{% google_map width="100%" height="568" zoom="13" show_popup="false" %}

  After Austin we went to Colorado, where spent a couple of days in Denver.

They have a free bus running on the main street here, taking people from one mall to another.

Christmass market, almost like in Germany.

Walk around an empty prak.

Met some well-fed squirells here.

  In Denver we visited botanical garden as well.

There are christmass lights all over the trees and bushes.

Japanese garden, but it's not very exciting for us 😀

Someone has a memorial bench in the garden.

Modern art.

  From Denver we went to Rocky Mountains, in a town called Estes-Park.

  The nature is great here and deers are walking just in fron of the houses.


text:
describe("Configuration setup", function() {
    it("should load local configurations", function(next) {
        var config = require('../config')();
        expect(config.mode).toBe('local');
        next();
    });
    it("should load staging configurations", function(next) {
        var config = require('../config')('staging');
        expect(config.mode).toBe('staging');
        next();
    });
    it("should load production configurations", function(next) {
        var config = require('../config')('production');
        expect(config.mode).toBe('production');
        next();
    });
});


text:
kanka-bluetooth Module

Description

TODO: Enter your module description here

Accessing the kanka-bluetooth Module

To access this module from JavaScript, you would do the following:

var kanka_bluetooth = require("com.ewin.kanka.bluetooth");

The kanka_bluetooth variable is a reference to the Module object.

Reference

TODO: If your module has an API, you should document
the reference here.

kanka_bluetooth.function

TODO: This is an example of a module function.

kanka_bluetooth.property

TODO: This is an example of a module property.

Usage

TODO: Enter your usage example here

Author

TODO: Enter your author name, email and other contact
details you want to share here.

License

TODO: Enter your license/legal information here.


text:
import * as flatbuffers from 'flatbuffers';
import { Color } from '../../my-game/example/color.js';
export class TestSimpleTableWithEnum {
    constructor() {
        this.bb = null;
        this.bb_pos = 0;
    }
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsTestSimpleTableWithEnum(bb, obj) {
        return (obj || new TestSimpleTableWithEnum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsTestSimpleTableWithEnum(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new TestSimpleTableWithEnum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    color() {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.readUint8(this.bb_pos + offset) : Color.Green;
    }
    mutate_color(value) {
        const offset = this.bb.__offset(this.bb_pos, 4);
        if (offset === 0) {
            return false;
        }
        this.bb.writeUint8(this.bb_pos + offset, value);
        return true;
    }
    static getFullyQualifiedName() {
        return 'MyGame_Example_TestSimpleTableWithEnum';
    }
    static startTestSimpleTableWithEnum(builder) {
        builder.startObject(1);
    }
    static addColor(builder, color) {
        builder.addFieldInt8(0, color, Color.Green);
    }
    static endTestSimpleTableWithEnum(builder) {
        const offset = builder.endObject();
        return offset;
    }
    static createTestSimpleTableWithEnum(builder, color) {
        TestSimpleTableWithEnum.startTestSimpleTableWithEnum(builder);
        TestSimpleTableWithEnum.addColor(builder, color);
        return TestSimpleTableWithEnum.endTestSimpleTableWithEnum(builder);
    }
    serialize() {
        return this.bb.bytes();
    }
    static deserialize(buffer) {
        return TestSimpleTableWithEnum.getRootAsTestSimpleTableWithEnum(new flatbuffers.ByteBuffer(buffer));
    }
    unpack() {
        return new TestSimpleTableWithEnumT(this.color());
    }
    unpackTo(_o) {
        _o.color = this.color();
    }
}
export class TestSimpleTableWithEnumT {
    constructor(color = Color.Green) {
        this.color = color;
    }
    pack(builder) {
        return TestSimpleTableWithEnum.createTestSimpleTableWithEnum(builder, this.color);
    }
}


text:
package com.rho.wificonfig;

import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.os.Build;
import android.os.Environment;
import android.widget.Toast;
import android.content.Context;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.File;
import java.io.FileWriter;
import java.security.Provider;
import java.security.Security;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.Map;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import com.rhomobile.rhodes.api.IMethodResult;
import com.rhomobile.rhodes.api.MethodResult;
import com.rhomobile.rhodes.RhodesActivity;
import com.rhomobile.rhodes.Logger;

public class WifiConfig extends WifiConfigBase implements IWifiConfig {
    private static final String INT_PRIVATE_KEY = "private_key";
    private static final String INT_PHASE2 = "phase2";
    private static final String INT_PASSWORD = "password";
    private static final String INT_IDENTITY = "identity";
    private static final String INT_EAP = "eap";
    private static final String INT_CLIENT_CERT = "client_cert";
    private static final String INT_CA_CERT = "ca_cert";
    private static final String INT_ANONYMOUS_IDENTITY = "anonymous_identity";
    //private static final String WIFI_SERVICE = "wifi";

    private static final String TAG = "WiFi Config Extension";

    final String INT_ENTERPRISEFIELD_NAME = "android.net.wifi.WifiConfiguration$EnterpriseField";

    public WifiConfig(String id) {
        super(id);
    }

    @Override
    public void get_EAP_Identity(String a, IMethodResult result) {
          result.set(get_EAP_identity(a));
    }

    private String get_EAP_identity(String strSSID_Name) {
        String result = null;
        String strComplete_SSID_Name = "\"" + strSSID_Name + "\"";

        /*Get the WifiService */
        RhodesActivity ra = RhodesActivity.safeGetInstance();
        WifiManager wifi = (WifiManager)ra.getSystemService(Context.WIFI_SERVICE);
        /*Get All WIfi configurations*/
        List<WifiConfiguration> configList = wifi.getConfiguredNetworks();
        /*Now we need to search appropriate configuration i.e. with name SSID_Name*/
        for(int i = 0;i<configList.size();i++)
        {
            if(configList.get(i).SSID.contentEquals(strComplete_SSID_Name))
            {
                /*We found the appropriate config now read all config details*/
                Iterator<WifiConfiguration> iter =  configList.iterator();
                WifiConfiguration config = configList.get(i);

                /*reflection magic*/
                /*These are the fields we are really interested in*/
                try
                {
                    // Let the magic start
                    Class[] wcClasses = WifiConfiguration.class.getClasses();
                    // null for overzealous java compiler
                    Class wcEnterpriseField = null;

                    for (Class wcClass : wcClasses)
                        if (wcClass.getName().equals(INT_ENTERPRISEFIELD_NAME))
                        {
                            wcEnterpriseField = wcClass;
                            break;
                        }
                    boolean noEnterpriseFieldType = false;
                    if(wcEnterpriseField == null)
                        noEnterpriseFieldType = true; // Cupcake/Donut access enterprise settings directly

                    Field wcefIdentity = null;
                    Field[] wcefFields = WifiConfiguration.class.getFields();
                    // Dispatching Field vars
                    for (Field wcefField : wcefFields)
                    {
                        if (wcefField.getName().trim().equals(INT_IDENTITY))
                            wcefIdentity = wcefField;
                    }
                    Method wcefValue = null;
                    if(!noEnterpriseFieldType)
                    {
                        for(Method m: wcEnterpriseField.getMethods())
                            //System.out.println(m.getName());
                            if(m.getName().trim().equals("value")){
                                wcefValue = m;
                                break;
                            }
                    }

                /*EAP Method*/
                    Object obj = null;
                /*Identity*/
                    if(!noEnterpriseFieldType)
                    {
                        result = (String) wcefValue.invoke(wcefIdentity.get(config), null);
                        //Logger.I(TAG, "<<<<<<<<<<WifiPreference>>>>>>>>>>>>", "[EAP IDENTITY]" + result);
                        Log.d("<<<<<<<<<<WifiPreference>>>>>>>>>>>>", "[EAP IDENTITY]" + result);
                    }
                    else
                    {
                        result = (String)wcefIdentity.get(config);
                    }

                }
                catch(Exception e)
                {
                    e.printStackTrace();
                }

            }
        }

        return result;
    }
}


text:
> Convert a JSON or a Javascript object into a valid YAML configuration file

[![Build Status](https://travis-ci.org/gabrieledarrigo/grunt-yml.svg?branch=master)](https://travis-ci.org/gabrieledarrigo/grunt-yml)

## Getting Started
This plugin requires Grunt `~0.4.5`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-yml --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-yml');
```

## The "yml" task

### Overview
In your project's Gruntfile, add a section named `yml` to the data object passed into `grunt.initConfig()`.
The task make use of [yaml.js plugin](https://github.com/jeremyfa/yaml.js).

```js
grunt.initConfig({
  yml: {
    options: {
        depth: 2,
        indent: 2
    },
    target: {
      src: [
          'path/to/data.json'
      ],
      dest: 'path/to/data.yml'
    },
  },
});
```

### Options

#### options.depth
Type: `Number`
Default value: `4`

The depth before YAML will be inlined (default 4).

#### options.indent
Type: `Number`
Default value: `2`

The number of spaces used to indent the YAML (default 2).

### Usage Examples
In this example, You can convert a JSON file using the `src` / `dest` Grunt file format.

```js
grunt.initConfig({
    yml: {
        files: {
            'dest/default_options': ['src/testing', 'src/123'],
        },
    },
});
```

You can use dynamic mapping to convert multiple files at once.

```js
grunt.initConfig({
    yml: {
        files: [{
            expand: true,
            cwd: 'test/fixtures/',
            src: ['*.json'],
            dest: 'test/expected/multiple',
            ext: '.yml'
        }]
    },
});
```

#### Raw Javascript Object
If You specify the raw option You can convert a Javascript Object literal into a valid YAML file.

```js
grunt.initConfig({
    yml: {
        raw: {
            a: 1,
            b: 2,
            c: {
                json: true
            }
        },
        dest: 'test/expected/raw.yml'
    },
});
```

## Contributing
Follow the existing coding style.
Add unit tests with [nodeunit](https://github.com/caolan/nodeunit) for any new or changed functionality.
Lint and test your code using [Grunt](http://gruntjs.com/).

## Release History
- 0.1.0 First version


text:
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0

# Save screenshots to the folder
defaults write com.apple.screencapture location -string "${HOME}/Downloads"

# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
defaults write com.apple.screencapture type -string "png"


text:
'use strict';

angular.module('ourWedding', ['ngAnimate', 'ngCookies', 'ngTouch', 'ngSanitize', 'ngResource', 'ui.router', 'ui.bootstrap', 'timer' ])
.config(function ($stateProvider, $urlRouterProvider, $locationProvider) {
  $urlRouterProvider.otherwise('/');

  $stateProvider
    .state('home', {
      url: '/',
      templateUrl: 'app/main/main.html',
      controller: 'MainCtrl'
  });

  $locationProvider.html5Mode(true);
});


text:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifndef WIN32
#include <sys/types.h>
#include <netinet/in.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <pcap.h>
#ifndef PCAP_OLDSTYLE
# ifdef HAVE_LINUX_IF_PACKET_H
#include <linux/if_packet.h>
# endif /* HAVE_LINUX_IF_PACKET_H */
#include <unistd.h>
#endif /* PCAP_OLDSTYLE */

#include "daq_api.h"

#define DAQ_PCAP_VERSION 3

typedef struct _pcap_context
{
    char *device;
    char *file;
    char *filter_string;
    int snaplen;
    pcap_t *handle;
    char errbuf[PCAP_ERRBUF_SIZE];
    int promisc_flag;
    int timeout;
    int buffer_size;
    int packets;
    int delayed_open;
    DAQ_Analysis_Func_t analysis_func;
    u_char *user_data;
    uint32_t netmask;
    DAQ_Stats_t stats;
    uint32_t base_recv;
    uint32_t base_drop;
    uint64_t rollover_recv;
    uint64_t rollover_drop;
    uint32_t wrap_recv;
    uint32_t wrap_drop;
    DAQ_State state;
} Pcap_Context_t;

static void pcap_daq_reset_stats(void *handle);

#ifndef PCAP_OLDSTYLE
/* Attempt to convert from the PCAP_FRAMES environment variable used by Phil Wood's PCAP-Ring
    to a buffer size I can pass to PCAP 1.0.0's pcap_set_buffer_size(). */
static int translate_PCAP_FRAMES(int snaplen)
{
# ifdef HAVE_LINUX_IF_PACKET_H
    char *frames_str = getenv("PCAP_FRAMES");
    int frame_size, block_size, frames_per_block;
    int frames;

    if (!frames_str)
        return 0;

    /* Look, I didn't make these numbers and calculations up, I'm just using them. */
    frame_size = TPACKET_ALIGN(snaplen + TPACKET_ALIGN(TPACKET_HDRLEN) + sizeof(struct sockaddr_ll));
    block_size = getpagesize();
    while (block_size < frame_size)
        block_size <<= 1;
    frames_per_block = block_size / frame_size;

    if (strncmp(frames_str, "max", 3) && strncmp(frames_str, "MAX", 3))
        frames = strtol(frames_str, NULL, 10);
    else
        frames = 0x8000; /* Default maximum of 32k frames. */

    printf("PCAP_FRAMES -> %d * %d / %d = %d (%d)\n", frames, block_size, frames_per_block, frames * block_size / frames_per_block, frame_size);
    return frames * block_size / frames_per_block;
# else
    return 0;
# endif
}
#endif /* PCAP_OLDSTYLE */

static int pcap_daq_open(Pcap_Context_t *context)
{
    uint32_t localnet, netmask;
    uint32_t defaultnet = 0xFFFFFF00;
#ifndef PCAP_OLDSTYLE
    int status;
#endif /* PCAP_OLDSTYLE */

    if (context->handle)
        return DAQ_SUCCESS;

    if (context->device)
    {
#ifndef PCAP_OLDSTYLE
        context->handle = pcap_create(context->device, context->errbuf);
        if (!context->handle)
            return DAQ_ERROR;
        if ((status = pcap_set_snaplen(context->handle, context->snaplen)) < 0)
            goto fail;
        if ((status = pcap_set_promisc(context->handle, context->promisc_flag ? 1 : 0)) < 0)
            goto fail;
        if ((status = pcap_set_timeout(context->handle, context->timeout)) < 0)
            goto fail;
        if ((status = pcap_set_buffer_size(context->handle, context->buffer_size)) < 0)
            goto fail;
        if ((status = pcap_activate(context->handle)) < 0)
            goto fail;
#else
        context->handle = pcap_open_live(context->device, context->snaplen,
                                         context->promisc_flag ? 1 : 0, context->timeout, context->errbuf);
        if (!context->handle)
            return DAQ_ERROR;
#endif /* PCAP_OLDSTYLE */
        if (pcap_lookupnet(context->device, &localnet, &netmask, context->errbuf) < 0)
            netmask = htonl(defaultnet);
    }
    else
    {
        context->handle = pcap_open_offline(context->file, context->errbuf);
        if (!context->handle)
            return DAQ_ERROR;

        netmask = htonl(defaultnet);
    }
    context->netmask = htonl(defaultnet);

    return DAQ_SUCCESS;

#ifndef PCAP_OLDSTYLE
fail:
    if (status == PCAP_ERROR || status == PCAP_ERROR_NO_SUCH_DEVICE || status == PCAP_ERROR_PERM_DENIED)
        DPE(context->errbuf, "%s", pcap_geterr(context->handle));
    else
        DPE(context->errbuf, "%s: %s", context->device, pcap_statustostr(status));
    pcap_close(context->handle);
    context->handle = NULL;
    return DAQ_ERROR;
#endif /* PCAP_OLDSTYLE */
}

static int update_hw_stats(Pcap_Context_t *context)
{
    struct pcap_stat ps;

    if (context->handle && context->device)
    {
        memset(&ps, 0, sizeof(struct pcap_stat));
        if (pcap_stats(context->handle, &ps) == -1)
        {
            DPE(context->errbuf, "%s", pcap_geterr(context->handle));
            return DAQ_ERROR;
        }

        /* PCAP receive counter wrapped */
        if (ps.ps_recv < context->wrap_recv)
            context->rollover_recv += UINT32_MAX;

        /* PCAP drop counter wrapped */
        if (ps.ps_drop < context->wrap_drop)
            context->rollover_drop += UINT32_MAX;

        context->wrap_recv = ps.ps_recv;
        context->wrap_drop = ps.ps_drop;

        context->stats.hw_packets_received = context->rollover_recv + context->wrap_recv - context->base_recv;
        context->stats.hw_packets_dropped = context->rollover_drop + context->wrap_drop - context->base_drop;
    }

    return DAQ_SUCCESS;
}

static int pcap_daq_initialize(const DAQ_Config_t *config, void **ctxt_ptr, char *errbuf, size_t len)
{
    Pcap_Context_t *context;
#ifndef PCAP_OLDSTYLE
    DAQ_Dict *entry;
#endif

    context = calloc(1, sizeof(Pcap_Context_t));
    if (!context)
    {
        snprintf(errbuf, len, "%s: Couldn't allocate memory for the new PCAP context!", __FUNCTION__);
        return DAQ_ERROR_NOMEM;
    }

    context->snaplen = config->snaplen;
    context->promisc_flag = (config->flags & DAQ_CFG_PROMISC);
    context->timeout = config->timeout;

#ifndef PCAP_OLDSTYLE
    /* Retrieve the requested buffer size (default = 0) */
    for (entry = config->values; entry; entry = entry->next)
    {
        if (!strcmp(entry->key, "buffer_size"))
            context->buffer_size = strtol(entry->value, NULL, 10);
    }
    /* Try to account for legacy PCAP_FRAMES environment variable if we weren't passed a buffer size. */
    if (context->buffer_size == 0)
        context->buffer_size = translate_PCAP_FRAMES(context->snaplen);
#endif

    if (config->mode == DAQ_MODE_READ_FILE)
    {
        context->file = strdup(config->name);
        if (!context->file)
        {
            snprintf(errbuf, len, "%s: Couldn't allocate memory for the filename string!", __FUNCTION__);
            free(context);
            return DAQ_ERROR_NOMEM;
        }
        context->delayed_open = 0;
    }
    else
    {
        context->device = strdup(config->name);
        if (!context->device)
        {
            snprintf(errbuf, len, "%s: Couldn't allocate memory for the device string!", __FUNCTION__);
            free(context);
            return DAQ_ERROR_NOMEM;
        }
        context->delayed_open = 1;
    }

    if (!context->delayed_open)
    {
        if (pcap_daq_open(context) != DAQ_SUCCESS)
        {
            snprintf(errbuf, len, "%s", context->errbuf);
            free(context);
            return DAQ_ERROR;
        }
    }

    context->state = DAQ_STATE_INITIALIZED;

    *ctxt_ptr = context;
    return DAQ_SUCCESS;
}

static int pcap_daq_set_filter(void *handle, const char *filter)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;
    struct bpf_program fcode;
    pcap_t *dead_handle;

    if (context->handle)
    {
        if (pcap_compile(context->handle, &fcode, (char *)filter, 1, context->netmask) < 0)
        {
            DPE(context->errbuf, "%s: pcap_compile: %s", __FUNCTION__, pcap_geterr(context->handle));
            return DAQ_ERROR;
        }

        if (pcap_setfilter(context->handle, &fcode) < 0)
        {
            pcap_freecode(&fcode);
            DPE(context->errbuf, "%s: pcap_setfilter: %s", __FUNCTION__, pcap_geterr(context->handle));
            return DAQ_ERROR;
        }

        pcap_freecode(&fcode);
    }
    else
    {
        /* Try to validate the BPF with a dead PCAP handle. */
        dead_handle = pcap_open_dead(DLT_EN10MB, context->snaplen);
        if (!dead_handle)
        {
            DPE(context->errbuf, "%s: Could not allocate a dead PCAP handle!", __FUNCTION__);
            return DAQ_ERROR_NOMEM;
        }
        if (pcap_compile(dead_handle, &fcode, (char *)filter, 1, context->netmask) < 0)
        {
            DPE(context->errbuf, "%s: pcap_compile: %s", __FUNCTION__, pcap_geterr(dead_handle));
            return DAQ_ERROR;
        }
        pcap_freecode(&fcode);
        pcap_close(dead_handle);

        /* Store the BPF string for later. */
        if (context->filter_string)
            free(context->filter_string);
        context->filter_string = strdup(filter);
        if (!context->filter_string)
        {
            DPE(context->errbuf, "%s: Could not allocate space to store a copy of the filter string!", __FUNCTION__);
            return DAQ_ERROR_NOMEM;
        }
    }

    return DAQ_SUCCESS;
}

static int pcap_daq_start(void *handle)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;

    if (pcap_daq_open(context) != DAQ_SUCCESS)
        return DAQ_ERROR;

    pcap_daq_reset_stats(handle);

    if (context->filter_string)
    {
        if (pcap_daq_set_filter(handle, context->filter_string))
            return DAQ_ERROR;
        free(context->filter_string);
        context->filter_string = NULL;
    }

    context->state = DAQ_STATE_STARTED;

    return DAQ_SUCCESS;
}

static void pcap_process_loop(u_char *user, const struct pcap_pkthdr *pkth, const u_char *data)
{
    Pcap_Context_t *context = (Pcap_Context_t *) user;
    DAQ_PktHdr_t hdr;
    DAQ_Verdict verdict;

    hdr.caplen = pkth->caplen;
    hdr.pktlen = pkth->len;
    hdr.ts = pkth->ts;
    hdr.ingress_index = -1;
    hdr.egress_index = -1;
    hdr.ingress_group = -1;
    hdr.egress_group = -1;
    hdr.flags = 0;
    hdr.address_space_id = 0;

    /* Increment the current acquire loop's packet counter. */
    context->packets++;
    /* ...and then the module instance's packet counter. */
    context->stats.packets_received++;
    verdict = context->analysis_func(context->user_data, &hdr, data);
    if (verdict >= MAX_DAQ_VERDICT)
        verdict = DAQ_VERDICT_PASS;
    context->stats.verdicts[verdict]++;
}

static int pcap_daq_acquire(
    void *handle, int cnt, DAQ_Analysis_Func_t callback, DAQ_Meta_Func_t metaback, void *user)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;
    int ret;

    context->analysis_func = callback;
    context->user_data = user;

    context->packets = 0;
    while (context->packets < cnt || cnt <= 0)
    {
        ret = pcap_dispatch(
            context->handle, cnt-context->packets, pcap_process_loop, (void *) context);
        if (ret == -1)
        {
            DPE(context->errbuf, "%s", pcap_geterr(context->handle));
            return ret;
        }
        /* In read-file mode, PCAP returns 0 when it hits the end of the file. */
        else if (context->file && ret == 0)
            return DAQ_READFILE_EOF;
        /* If we hit a breakloop call or timed out without reading any packets, break out. */
        else if (ret == -2 || ret == 0)
            break;
    }

    return 0;
}

static int pcap_daq_inject(void *handle, const DAQ_PktHdr_t *hdr, const uint8_t *packet_data, uint32_t len, int reverse)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;

    if (pcap_inject(context->handle, packet_data, len) < 0)
    {
        DPE(context->errbuf, "%s", pcap_geterr(context->handle));
        return DAQ_ERROR;
    }

    context->stats.packets_injected++;
    return DAQ_SUCCESS;
}

static int pcap_daq_breakloop(void *handle)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;

    if (!context->handle)
        return DAQ_ERROR;

    pcap_breakloop(context->handle);

    return DAQ_SUCCESS;
}

static int pcap_daq_stop(void *handle)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;

    if (context->handle)
    {
        /* Store the hardware stats for post-stop stat calls. */
        update_hw_stats(context);
        pcap_close(context->handle);
        context->handle = NULL;
    }

    context->state = DAQ_STATE_STOPPED;

    return DAQ_SUCCESS;
}

static void pcap_daq_shutdown(void *handle)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;

    if (context->handle)
        pcap_close(context->handle);
    if (context->device)
        free(context->device);
    if (context->file)
        free(context->file);
    if (context->filter_string)
        free(context->filter_string);
    free(context);
}

static DAQ_State pcap_daq_check_status(void *handle)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;

    return context->state;
}

static int pcap_daq_get_stats(void *handle, DAQ_Stats_t *stats)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;

    if (update_hw_stats(context) != DAQ_SUCCESS)
        return DAQ_ERROR;

    memcpy(stats, &context->stats, sizeof(DAQ_Stats_t));

    return DAQ_SUCCESS;
}

static void pcap_daq_reset_stats(void *handle)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;
    struct pcap_stat ps;

    memset(&context->stats, 0, sizeof(DAQ_Stats_t));

    if (!context->handle)
        return;

    memset(&ps, 0, sizeof(struct pcap_stat));
    if (context->handle && context->device && pcap_stats(context->handle, &ps) == 0)
    {
        context->base_recv = context->wrap_recv = ps.ps_recv;
        context->base_drop = context->wrap_drop = ps.ps_drop;
    }
}

static int pcap_daq_get_snaplen(void *handle)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;

    if (context->handle)
        return pcap_snapshot(context->handle);

    return context->snaplen;
}

static uint32_t pcap_daq_get_capabilities(void *handle)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;
    uint32_t capabilities = DAQ_CAPA_BPF;

    if (context->device)
        capabilities |= DAQ_CAPA_INJECT;

    capabilities |= DAQ_CAPA_BREAKLOOP;

    if (!context->delayed_open)
        capabilities |= DAQ_CAPA_UNPRIV_START;

    return capabilities;
}

static int pcap_daq_get_datalink_type(void *handle)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;

    if (context->handle)
        return pcap_datalink(context->handle);

    return DLT_NULL;
}

static const char *pcap_daq_get_errbuf(void *handle)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;

    return context->errbuf;
}

static void pcap_daq_set_errbuf(void *handle, const char *string)
{
    Pcap_Context_t *context = (Pcap_Context_t *) handle;

    if (!string)
        return;

    DPE(context->errbuf, "%s", string);
}

static int pcap_daq_get_device_index(void *handle, const char *device)
{
    return DAQ_ERROR_NOTSUP;
}

#ifdef BUILDING_SO
DAQ_SO_PUBLIC const DAQ_Module_t DAQ_MODULE_DATA =
#else
const DAQ_Module_t pcap_daq_module_data =
#endif
{
#ifndef WIN32
    .api_version = DAQ_API_VERSION,
    .module_version = DAQ_PCAP_VERSION,
    .name = "pcap",
    .type = DAQ_TYPE_FILE_CAPABLE | DAQ_TYPE_INTF_CAPABLE | DAQ_TYPE_MULTI_INSTANCE,
    .initialize = pcap_daq_initialize,
    .set_filter = pcap_daq_set_filter,
    .start = pcap_daq_start,
    .acquire = pcap_daq_acquire,
    .inject = pcap_daq_inject,
    .breakloop = pcap_daq_breakloop,
    .stop = pcap_daq_stop,
    .shutdown = pcap_daq_shutdown,
    .check_status = pcap_daq_check_status,
    .get_stats = pcap_daq_get_stats,
    .reset_stats = pcap_daq_reset_stats,
    .get_snaplen = pcap_daq_get_snaplen,
    .get_capabilities = pcap_daq_get_capabilities,
    .get_datalink_type = pcap_daq_get_datalink_type,
    .get_errbuf = pcap_daq_get_errbuf,
    .set_errbuf = pcap_daq_set_errbuf,
    .get_device_index = pcap_daq_get_device_index,
    .modify_flow = NULL,
    .hup_prep = NULL,
    .hup_apply = NULL,
    .hup_post = NULL,
#else
    DAQ_API_VERSION,
    DAQ_PCAP_VERSION,
    "pcap",
    DAQ_TYPE_FILE_CAPABLE | DAQ_TYPE_INTF_CAPABLE | DAQ_TYPE_MULTI_INSTANCE,
    pcap_daq_initialize,
    pcap_daq_set_filter,
    pcap_daq_start,
    pcap_daq_acquire,
    pcap_daq_inject,
    pcap_daq_breakloop,
    pcap_daq_stop,
    pcap_daq_shutdown,
    pcap_daq_check_status,
    pcap_daq_get_stats,
    pcap_daq_reset_stats,
    pcap_daq_get_snaplen,
    pcap_daq_get_capabilities,
    pcap_daq_get_datalink_type,
    pcap_daq_get_errbuf,
    pcap_daq_set_errbuf,
    pcap_daq_get_device_index,
    NULL,
    NULL,
    NULL,
    NULL,
#endif
};


text:
```
make
docker run -it --rm \
	-e KUBECFG=/etc/kube/conf \
	-e DOMAIN=cluster.local \
	-v ~/.kube/config:/etc/kube/conf:ro \
	kube2lb:haproxy-docker-wrapper
```

To be used with [haproxy-docker-wrapper](https://github.com/tuenti/haproxy-docker-wrapper).


text:
\documentclass[landscape,a3paper]{article}
\usepackage{revy}
\usepackage[danish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage[a3paper]{geometry}

\frenchspacing

\title{\large{Rolleoversigt}}

\version{<+VERSION+>}
\revyname{<+REVUENAME+>}
\revyyear{<+REVUEYEAR+>}

\textwidth 360mm
\textheight 260mm

\evensidemargin 0pt
\oddsidemargin 0pt

\headsep 1cm

\renewcommand{\baselinestretch}{1.0}
\newcommand{\q}{\rule{5.5mm}{0mm}}

\newcommand{\actor}[1]{\rotatebox{90}{#1\ }}
\def\makeatactive{\catcode`\@=\active}
\newcount\savedcat
{\makeatactive\catcode`\|=\active\global\let|\ignorespaces
\gdef\actors{\makeatactive\savedcat=\the\catcode`\|\catcode`\|=\active\@actors}
\long\gdef\@actors#1{#1@@\makeatother\catcode`\|=\savedcat}
\gdef@#1@{\def\tempa{}\def\tempb{#1}\ifx\tempa\tempb
\let\next\relax\else\def\next{&\actor{#1}@}\fi\next}}

\begin{document}
\begin{center}

\maketitle

\begin{tabular}{|rl|*{<+NACTORS+>}{@{}c@{}|}}
\hline

&Sketch / Navn

<+ROLEMATRIX+>

\end{tabular}
\end{center}
\end{document}


text:
package com.andres.elevator.entities;

import java.awt.image.BufferedImage;

public class Flower extends Prize {

	private BufferedImage mSprite;

	public Flower(int parentWidth, int ascensorWidth) {
		super(parentWidth, ascensorWidth);
	}

	@Override
	protected void loadSprite() {
		mSprite = getSpriteSheet().getSubimage(52, 64, 16, 16);
	}

	@Override
	protected BufferedImage getPrizeSprite() {
		return mSprite;
	}
}


text:
var wellKnownSymbol = require('../internals/well-known-symbol');

var MATCH = wellKnownSymbol('match');

module.exports = function (METHOD_NAME) {
  var regexp = /./;
  try {
    '/./'[METHOD_NAME](regexp);
  } catch (e) {
    try {
      regexp[MATCH] = false;
      return '/./'[METHOD_NAME](regexp);
    } catch (f) { /* empty */ }
  } return false;
};


text:
var graphs = {};

var initDimensions = function(elementId) {
    // automatically size to the container using JQuery to get width/height
    width = $("#" + elementId).width();
    height = $("#" + elementId).height();

    // make sure to use offset() and not position() as we want it relative to
    // the document, not its parent
    xOffset = $("#" + elementId).offset().left;
    yOffset = $("#" + elementId).offset().top;
    return {width: width, height: height, xOffset: xOffset, yOffset: yOffset};
};

var maxFinite = function(collection) {
    var max = collection[0];
    _.each(collection, function(item) {
        max = (isFinite(item) && (!max || item > max)) ? item : max;
    });
    return max;
};

var drawTimeseries = function(trace, elementId, dataX, dataY, showAverage,
        showMax) {
    // create an SVG element inside the element that fills 100% of the div
    var graph = d3.select("#" + elementId).append("svg:svg").attr("width", "100%")
            .attr("height", "100%");
    hoverContainer = $("#" + elementId + " svg");

    var dimensions = initDimensions(elementId);

    // X scale will fit values from 0-10 within range of pixels
    var x = d3.scale.linear().domain([_.min(dataX), _.max(dataX)]).range(
            [0, dimensions.width]);
    // Y scale will fit values from 0-10 within pixels 0-100
    var y = d3.scale.linear().domain([_.min(dataY), maxFinite(dataY)]).range(
            [dimensions.height, 0]);

    // create a line object that represents the SVG line we're creating
    var line = d3.svg.line()
        .x(function(d,i) {
            return x(d[0]);
        })
        .y(function(d) {
            return y(d[1]);
        })
        .defined(function(d) {
            return isFinite(d[1]);
        });

    var hoverLineGroup = graph.append("svg:svg").attr("class", "hover-line");
    var hoverLine = hoverLineGroup.append("svg:line")
        .attr("x1", 10).attr("x2", 10)
        .attr("y1", 0).attr("y2", dimensions.height);
    hoverLine.classed("hide", true);

    if(showMax) {
        var maxDataPoint = _.max(_.zip(dataX, dataY), function(point) {
            return point[1];
        });
        var maxPosition = x(maxDataPoint[0]);
        var maxLineGroup = graph.append("svg:svg").attr("class", "max-line")
            .attr("opacity", ".5");
        var maxLine = maxLineGroup.append("svg:line")
            .attr("x1", maxPosition).attr("x2", maxPosition)
            .attr("y1", 0).attr("y2", dimensions.height);
    }

    if(showAverage) {
        var average = _.reduce(dataY, function(memo, value) {
                if(!value || value === Infinity) {
                    return memo;
                }
                return memo + value;
            }, 0) / dataY.length;
        var averageLineGroup = graph.append("svg:svg")
            .attr("class", "average-line")
            .attr("opacity", ".5");
        var averageLine = averageLineGroup.append("svg:line")
            .attr("x1", 0).attr("x2", dimensions.width)
            .attr("y1", y(average)).attr("y2", y(average));
        var averageText = averageLineGroup.append("svg:text")
            .attr("x", 5).attr("y", y(average) - 8)
            .attr("text-anchor", "left")
            .attr("class", "annotation")
            .text("avg " + average.toFixed(2));
    }

    // display the line by appending an svg:path element with the data line we created above
    graph.append("svg:path").attr("d", line(_.zip(dataX, dataY)));

    var graphHolder = {elementId: elementId, graph: graph, x: x, y: y,
            hoverLine: hoverLine, dimensions: dimensions, dataX: dataX,
            dataY: dataY};

    $(hoverContainer).mouseleave(function(event) {
        handleMouseOutGraph(event);
    });

    $(hoverContainer).mousemove(function(event) {
        handleMouseOverGraph(event, trace, graphHolder);
    });

    return graphHolder;
};

var timeseriesHoverHandler = {
    on: function(timestamp, trace, mouseX, mouseY) {
        _.each(graphs, function(otherGraph, i) {
            otherGraph.hoverLine.classed("hide", false);

            // set position of hoverLine
            otherGraph.hoverLine.attr("x1", mouseX).attr("x2", mouseX);

            var hoveredValue = findClosestToX(timestamp,
                otherGraph.dataX, otherGraph.dataY)[1];
            if(hoveredValue) {
                $("#current_" + otherGraph.elementId).text(hoveredValue.toFixed(2)).parent().show();
            } else {
                $("#current_" + otherGraph.elementId).parent().hide();
            }
        });
    },
    off: function() {
        _.each(graphs, function(graph, i) {
            graph.hoverLine.classed("hide", true);
            $("#current_" + graph.elementId).parent().hide();
        });
    }
};

var timeseriesHandler = {
    onLoad: function(trace) {
        _.each(["vehicle_speed", "engine_speed", "torque_at_transmission"],
                function(key, i) {
            graphs[key] = drawTimeseries(trace, key,
                _.pluck(trace.records, "timestamp"),
                _.pluck(trace.records, key),
                true, true);
            return;
        });

        _.each(["odometer", "fuel_consumed_since_restart",
                "accelerator_pedal_position"], function(key, i) {
            graphs[key] = drawTimeseries(trace, key,
                _.pluck(trace.records, "timestamp"),
                _.pluck(trace.records, key),
                false, false);
            return;
        });
    },
    onUnload: function(trace) {
        // TODO could make this faster by caching the graphs instead of forcing
        // re-render, but there really isn't much delay in recalculating right
        // now
        d3.selectAll(".graph svg").remove();
    }
};


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>libxml++: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

libxml++
    2.37.1

Main Page

Related Pages

Namespaces

Classes

Class List

Class Index

Class Hierarchy

Class Members

xmlpp

OutputBuffer

xmlpp::OutputBuffer Member List

This is the complete list of members for xmlpp::OutputBuffer, including all inherited members.

cobj()	xmlpp::OutputBuffer

cobj() const 	xmlpp::OutputBuffer

NonCopyable()	xmlpp::NonCopyable	protected

OutputBuffer(const Glib::ustring& encoding=Glib::ustring())	xmlpp::OutputBuffer

~NonCopyable()	xmlpp::NonCopyable	protectedvirtual

~OutputBuffer()	xmlpp::OutputBuffer	virtual

<address class="footer">
Generated on Mon Sep 16 2013 11:27:49 for libxml++ by

 1.8.3.1
</address>


text:
'use strict';

import { ApiConfig } from '../config/api';

export abstract class ConfigService {
    abstract installAllMiddlewares(): Promise<void>;
    abstract getAllApiConfig(): Promise<Array<ApiConfig>>;
    abstract getApiConfig(apiId: string): Promise<ApiConfig>;
    abstract subscribeEvents(): Promise<void>;
    abstract on(event: string | symbol, listener: Function): this;
    abstract removeAllListeners(event?: string | symbol): this;
}


text:
SIM_ROOT ?= $(CURDIR)/../../
TEST_BENCH_DIR = $(SIM_ROOT)/tests/benchmarks/

TEST_BENCH_LIST = barnes_bench_test ocean_contiguous_bench_test ocean_non_contiguous_bench_test water-nsquared_bench_test water-spatial_bench_test cholesky_bench_test fft_bench_test lu_contiguous_bench_test lu_non_contiguous_bench_test radix_bench_test volrend_bench_test raytrace_bench_test radiosity_bench_test
TEST_DIST_BENCH_LIST = barnes_bench_test_dist ocean_contiguous_bench_test_dist ocean_non_contiguous_bench_test_dist water-nsquared_bench_test_dist water-spatial_bench_test_dist cholesky_bench_test_dist fft_bench_test_dist lu_contiguous_bench_test_dist lu_non_contiguous_bench_test_dist radix_bench_test_dist volrend_bench_test_dist raytrace_bench_test_dist

# Radiosity is not added to the TEST_DIST_BENCH_LIST since it takes 3 days to complete

regress_bench: $(TEST_BENCH_LIST) $(TEST_DIST_BENCH_LIST)

ifeq ($(MAKECMDGOALS),clean)
clean:
	for t in $(patsubst %_bench_test,%,$(TEST_BENCH_LIST)) ; do make -C $(TEST_BENCH_DIR)/$$t clean ; done
endif

%_bench_test_dist:
	date
	$(MAKE) -C $(TEST_BENCH_DIR)/$(patsubst %_bench_test_dist,%,$@) PROCS=2; if [ $$? -ne 0 ] ; then echo "TEST: $@ FAILED" ; else echo "TEST: $@ PASSED" ; true ; fi
%_bench_test:
	date
	$(MAKE) -C $(TEST_BENCH_DIR)/$(patsubst %_bench_test,%,$@); if [ $$? -ne 0 ] ; then echo "TEST: $@ FAILED" ; else echo "TEST: $@ PASSED" ; true ; fi


text:
    # _posts
    - scops:
      path: ""
      type: posts
    values:
        layout: single
        author_profile: true
        read_time: true
        comments: true
        share: true
        related: true


text:
package com.opengamma.sdk.margin;

import java.time.Period;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.NoSuchElementException;

import org.joda.beans.Bean;
import org.joda.beans.BeanBuilder;
import org.joda.beans.ImmutableBean;
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.MetaBean;
import org.joda.beans.MetaProperty;
import org.joda.beans.gen.BeanDefinition;
import org.joda.beans.gen.PropertyDefinition;
import org.joda.beans.impl.direct.DirectMetaBean;
import org.joda.beans.impl.direct.DirectMetaProperty;
import org.joda.beans.impl.direct.DirectMetaPropertyMap;
import org.joda.beans.impl.direct.DirectPrivateBeanBuilder;

/**
 * The sensitivity of a trade in the portfolio to a single curve.
 */
@BeanDefinition(builderScope = "private", metaScope = "private", factoryName = "of")
public final class TradeCurveSensitivity implements ImmutableBean {

  /**
   * The name of the curve that the sensitivities relate to.
   */
  @PropertyDefinition(validate = "notNull")
  private final String curveName;
  /**
   * The currency of the sensitivities, as an ISO 4217 three letter currency code.
   * This is the currency of the sensitivities of the curve.
   */
  @PropertyDefinition(validate = "notNull")
  private final String currency;
  /**
   * The total sensitivity, calculated as the sum of all the tenor values.
   * This is expressed in the specified currency.
   */
  @PropertyDefinition
  private final double sensitivity;
  /**
   * The per-tenor sensitivity.
   * Values are expressed in the specified currency.
   */
  @PropertyDefinition(validate = "notNull")
  private final Map<Period, Double> tenorSensitivity;

  //------------------------- AUTOGENERATED START -------------------------
  /**
   * The meta-bean for {@code TradeCurveSensitivity}.
   * @return the meta-bean, not null
   */
  public static MetaBean meta() {
    return TradeCurveSensitivity.Meta.INSTANCE;
  }

  static {
    MetaBean.register(TradeCurveSensitivity.Meta.INSTANCE);
  }

  /**
   * Obtains an instance.
   * @param curveName  the value of the property, not null
   * @param currency  the value of the property, not null
   * @param sensitivity  the value of the property
   * @param tenorSensitivity  the value of the property, not null
   * @return the instance
   */
  public static TradeCurveSensitivity of(
      String curveName,
      String currency,
      double sensitivity,
      Map<Period, Double> tenorSensitivity) {
    return new TradeCurveSensitivity(
      curveName,
      currency,
      sensitivity,
      tenorSensitivity);
  }

  private TradeCurveSensitivity(
      String curveName,
      String currency,
      double sensitivity,
      Map<Period, Double> tenorSensitivity) {
    JodaBeanUtils.notNull(curveName, "curveName");
    JodaBeanUtils.notNull(currency, "currency");
    JodaBeanUtils.notNull(tenorSensitivity, "tenorSensitivity");
    this.curveName = curveName;
    this.currency = currency;
    this.sensitivity = sensitivity;
    this.tenorSensitivity = Collections.unmodifiableMap(new HashMap<>(tenorSensitivity));
  }

  @Override
  public MetaBean metaBean() {
    return TradeCurveSensitivity.Meta.INSTANCE;
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the name of the curve that the sensitivities relate to.
   * @return the value of the property, not null
   */
  public String getCurveName() {
    return curveName;
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the currency of the sensitivities, as an ISO 4217 three letter currency code.
   * This is the currency of the sensitivities of the curve.
   * @return the value of the property, not null
   */
  public String getCurrency() {
    return currency;
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the total sensitivity, calculated as the sum of all the tenor values.
   * This is expressed in the specified currency.
   * @return the value of the property
   */
  public double getSensitivity() {
    return sensitivity;
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the per-tenor sensitivity.
   * Values are expressed in the specified currency.
   * @return the value of the property, not null
   */
  public Map<Period, Double> getTenorSensitivity() {
    return tenorSensitivity;
  }

  //-----------------------------------------------------------------------
  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    }
    if (obj != null && obj.getClass() == this.getClass()) {
      TradeCurveSensitivity other = (TradeCurveSensitivity) obj;
      return JodaBeanUtils.equal(curveName, other.curveName) &&
          JodaBeanUtils.equal(currency, other.currency) &&
          JodaBeanUtils.equal(sensitivity, other.sensitivity) &&
          JodaBeanUtils.equal(tenorSensitivity, other.tenorSensitivity);
    }
    return false;
  }

  @Override
  public int hashCode() {
    int hash = getClass().hashCode();
    hash = hash * 31 + JodaBeanUtils.hashCode(curveName);
    hash = hash * 31 + JodaBeanUtils.hashCode(currency);
    hash = hash * 31 + JodaBeanUtils.hashCode(sensitivity);
    hash = hash * 31 + JodaBeanUtils.hashCode(tenorSensitivity);
    return hash;
  }

  @Override
  public String toString() {
    StringBuilder buf = new StringBuilder(160);
    buf.append("TradeCurveSensitivity{");
    buf.append("curveName").append('=').append(JodaBeanUtils.toString(curveName)).append(',').append(' ');
    buf.append("currency").append('=').append(JodaBeanUtils.toString(currency)).append(',').append(' ');
    buf.append("sensitivity").append('=').append(JodaBeanUtils.toString(sensitivity)).append(',').append(' ');
    buf.append("tenorSensitivity").append('=').append(JodaBeanUtils.toString(tenorSensitivity));
    buf.append('}');
    return buf.toString();
  }

  //-----------------------------------------------------------------------
  /**
   * The meta-bean for {@code TradeCurveSensitivity}.
   */
  private static final class Meta extends DirectMetaBean {
    /**
     * The singleton instance of the meta-bean.
     */
    static final Meta INSTANCE = new Meta();

    /**
     * The meta-property for the {@code curveName} property.
     */
    private final MetaProperty<String> curveName = DirectMetaProperty.ofImmutable(
        this, "curveName", TradeCurveSensitivity.class, String.class);
    /**
     * The meta-property for the {@code currency} property.
     */
    private final MetaProperty<String> currency = DirectMetaProperty.ofImmutable(
        this, "currency", TradeCurveSensitivity.class, String.class);
    /**
     * The meta-property for the {@code sensitivity} property.
     */
    private final MetaProperty<Double> sensitivity = DirectMetaProperty.ofImmutable(
        this, "sensitivity", TradeCurveSensitivity.class, Double.TYPE);
    /**
     * The meta-property for the {@code tenorSensitivity} property.
     */
    @SuppressWarnings({"unchecked", "rawtypes" })
    private final MetaProperty<Map<Period, Double>> tenorSensitivity = DirectMetaProperty.ofImmutable(
        this, "tenorSensitivity", TradeCurveSensitivity.class, (Class) Map.class);
    /**
     * The meta-properties.
     */
    private final Map<String, MetaProperty<?>> metaPropertyMap$ = new DirectMetaPropertyMap(
        this, null,
        "curveName",
        "currency",
        "sensitivity",
        "tenorSensitivity");

    /**
     * Restricted constructor.
     */
    private Meta() {
    }

    @Override
    protected MetaProperty<?> metaPropertyGet(String propertyName) {
      switch (propertyName.hashCode()) {
        case 771153946:  // curveName
          return curveName;
        case 575402001:  // currency
          return currency;
        case 564403871:  // sensitivity
          return sensitivity;
        case 334451647:  // tenorSensitivity
          return tenorSensitivity;
      }
      return super.metaPropertyGet(propertyName);
    }

    @Override
    public BeanBuilder<? extends TradeCurveSensitivity> builder() {
      return new TradeCurveSensitivity.Builder();
    }

    @Override
    public Class<? extends TradeCurveSensitivity> beanType() {
      return TradeCurveSensitivity.class;
    }

    @Override
    public Map<String, MetaProperty<?>> metaPropertyMap() {
      return metaPropertyMap$;
    }

    //-----------------------------------------------------------------------
    @Override
    protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {
      switch (propertyName.hashCode()) {
        case 771153946:  // curveName
          return ((TradeCurveSensitivity) bean).getCurveName();
        case 575402001:  // currency
          return ((TradeCurveSensitivity) bean).getCurrency();
        case 564403871:  // sensitivity
          return ((TradeCurveSensitivity) bean).getSensitivity();
        case 334451647:  // tenorSensitivity
          return ((TradeCurveSensitivity) bean).getTenorSensitivity();
      }
      return super.propertyGet(bean, propertyName, quiet);
    }

    @Override
    protected void propertySet(Bean bean, String propertyName, Object newValue, boolean quiet) {
      metaProperty(propertyName);
      if (quiet) {
        return;
      }
      throw new UnsupportedOperationException("Property cannot be written: " + propertyName);
    }

  }

  //-----------------------------------------------------------------------
  /**
   * The bean-builder for {@code TradeCurveSensitivity}.
   */
  private static final class Builder extends DirectPrivateBeanBuilder<TradeCurveSensitivity> {

    private String curveName;
    private String currency;
    private double sensitivity;
    private Map<Period, Double> tenorSensitivity = Collections.emptyMap();

    /**
     * Restricted constructor.
     */
    private Builder() {
    }

    //-----------------------------------------------------------------------
    @Override
    public Object get(String propertyName) {
      switch (propertyName.hashCode()) {
        case 771153946:  // curveName
          return curveName;
        case 575402001:  // currency
          return currency;
        case 564403871:  // sensitivity
          return sensitivity;
        case 334451647:  // tenorSensitivity
          return tenorSensitivity;
        default:
          throw new NoSuchElementException("Unknown property: " + propertyName);
      }
    }

    @SuppressWarnings("unchecked")
    @Override
    public Builder set(String propertyName, Object newValue) {
      switch (propertyName.hashCode()) {
        case 771153946:  // curveName
          this.curveName = (String) newValue;
          break;
        case 575402001:  // currency
          this.currency = (String) newValue;
          break;
        case 564403871:  // sensitivity
          this.sensitivity = (Double) newValue;
          break;
        case 334451647:  // tenorSensitivity
          this.tenorSensitivity = (Map<Period, Double>) newValue;
          break;
        default:
          throw new NoSuchElementException("Unknown property: " + propertyName);
      }
      return this;
    }

    @Override
    public TradeCurveSensitivity build() {
      return new TradeCurveSensitivity(
          curveName,
          currency,
          sensitivity,
          tenorSensitivity);
    }

    //-----------------------------------------------------------------------
    @Override
    public String toString() {
      StringBuilder buf = new StringBuilder(160);
      buf.append("TradeCurveSensitivity.Builder{");
      buf.append("curveName").append('=').append(JodaBeanUtils.toString(curveName)).append(',').append(' ');
      buf.append("currency").append('=').append(JodaBeanUtils.toString(currency)).append(',').append(' ');
      buf.append("sensitivity").append('=').append(JodaBeanUtils.toString(sensitivity)).append(',').append(' ');
      buf.append("tenorSensitivity").append('=').append(JodaBeanUtils.toString(tenorSensitivity));
      buf.append('}');
      return buf.toString();
    }

  }

  //-------------------------- AUTOGENERATED END --------------------------
}