text:
import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { resetSettings, updateSetting } from '../../../redux/Actions';
import { initialState } from '../../../redux/State';
import {
  cadLog,
  isChrome,
  isFirefox,
  isFirefoxNotAndroid,
} from '../../../services/Libs';
import { ReduxAction } from '../../../typings/ReduxConstants';
import CheckboxSetting from '../../common_components/CheckboxSetting';
import IconButton from '../../common_components/IconButton';
import SelectInput from '../../common_components/SelectInput';
import { downloadObjectAsJSON } from '../../UILibs';
import SettingsTooltip from './SettingsTooltip';

const styles = {
  buttonStyle: {
    height: 'max-content',
    padding: '0.75em',
    width: 'max-content',
  },
  inlineNumberInput: {
    display: 'inline',
    margin: '0 5px',
  },
};

interface OwnProps {
  style?: React.CSSProperties;
}

interface StateProps {
  cache: CacheMap;
  settings: MapToSettingObject;
}

interface DispatchProps {
  onUpdateSetting: (setting: Setting) => void;
  onResetButtonClick: () => void;
}

type SettingProps = OwnProps & StateProps & DispatchProps;

class InitialState {
  public error = '';
  public success = '';
}

class Settings extends React.Component<SettingProps> {
  public state = new InitialState();

  // Import Settings
  public importCoreSettings(importFile: File) {
    const { settings } = this.props;
    const debug = settings[SettingID.DEBUG_MODE].value as boolean;
    cadLog(
      {
        msg: 'Import Core Settings received file for parsing.',
        x: {
          name: importFile.name,
          size: importFile.size,
          type: importFile.type,
        },
      },
      debug,
    );
    // Do check for import first!
    if (importFile.type !== 'application/json') {
      this.setError(
        new Error(
          `${browser.i18n.getMessage('importFileTypeInvalid')}:  ${
            importFile.name
          } (${importFile.type})`,
        ),
      );
      return;
    }
    const { onUpdateSetting } = this.props;
    const initialSettingKeys = Object.keys(initialState.settings);
    const reader = new FileReader();
    reader.onload = (file) => {
      try {
        if (!file.target) {
          this.setError(
            new Error(
              browser.i18n.getMessage('importFileNotFound', [importFile.name]),
            ),
          );
          return;
        }
        // https://stackoverflow.com/questions/35789498/new-typescript-1-8-4-build-error-build-property-result-does-not-exist-on-t
        const target: FileReader = file.target;
        const result: string = target.result as string;
        const jsonImport: { [k: string]: Record<string, unknown> } =
          JSON.parse(result);
        if (!jsonImport.settings) {
          cadLog(
            {
              msg: 'importCoreSettings:  Imported JSON does not have "settings" array',
              x: jsonImport,
            },
            debug,
          );
          this.setError(
            new Error(
              `${browser.i18n.getMessage(
                'importFileValidationFailed',
              )}. ${browser.i18n.getMessage('importMissingKey')} 'settings': ${
                importFile.name
              }`,
            ),
          );
          return;
        }
        // from { name, value } to name:{ name, value }
        const newSettings: MapToSettingObject = (
          jsonImport.settings as unknown as Setting[]
        ).reduce((a: { [k: string]: Setting }, c: Setting) => {
          a[c.name] = c;
          return a;
        }, {});
        const settingKeys = Object.keys(newSettings);
        const unknownKeys = settingKeys.filter(
          (key) => !initialSettingKeys.includes(key),
        );
        if (unknownKeys.length > 0) {
          this.setError(
            new Error(
              `${browser.i18n.getMessage(
                'importCoreSettingsFailed',
              )}:  ${unknownKeys.join(', ')}`,
            ),
          );
          return;
        }
        settingKeys.forEach((setting) => {
          if (settings[setting].value !== newSettings[setting].value) {
            cadLog(
              {
                msg: `Setting updated:  ${setting} (${settings[setting].value} => ${newSettings[setting].value})`,
              },
              debug,
            );
            onUpdateSetting(newSettings[setting]);
          } else {
            cadLog(
              {
                msg: `Setting remains unchanged:  ${setting} (${settings[setting].value})`,
              },
              debug,
            );
          }
        });
        this.setState({
          error: '',
          success: browser.i18n.getMessage('importCoreSettingsText'),
        });
      } catch (error: unknown) {
        if (error instanceof Error) {
          this.setState({
            error: error.toString(),
            success: '',
          });
        }
      }
    };

    reader.readAsText(importFile);
  }

  public exportCoreSettings() {
    const { settings } = this.props;
    // Convert from name:{name, value} to {name, value}
    const exportSettings: Setting[] = Object.values(settings);
    const r = downloadObjectAsJSON(
      { settings: exportSettings },
      'CoreSettings',
    );
    cadLog(
      {
        msg: 'exportCoreSettings: Core Settings Exported.',
        type: 'info',
        x: r,
      },
      settings[SettingID.DEBUG_MODE].value as boolean,
    );
    this.setState({
      error: '',
      success: `${browser.i18n.getMessage('exportSettingsText')}: ${
        r.downloadName
      }`,
    });
  }

  public render() {
    const { cache, onResetButtonClick, onUpdateSetting, settings, style } =
      this.props;
    const { error, success } = this.state;
    const ffVersion = Number.parseInt(cache.browserVersion);
    return (

{browser.i18n.getMessage('settingsText')}

            <IconButton
              className="btn-primary"
              iconName="download"
              role="button"
              onClick={() => this.exportCoreSettings()}
              title={browser.i18n.getMessage('exportTitleTimestamp')}
              text={browser.i18n.getMessage('exportSettingsText')}
              styleReact={styles.buttonStyle}
            />

            <IconButton
              tag="input"
              className="btn-info"
              iconName="upload"
              type="file"
              accept="application/json, .json"
              onChange={(e) => this.importCoreSettings(e.target.files[0])}
              title={browser.i18n.getMessage('importCoreSettingsText')}
              text={browser.i18n.getMessage('importCoreSettingsText')}
              styleReact={styles.buttonStyle}
            />

            <IconButton
              className="btn-danger"
              role="button"
              onClick={() => {
                onResetButtonClick();
                this.setState({
                  error: '',
                  success: browser.i18n.getMessage('defaultSettingsText'),
                });
              }}
              iconName="undo"
              title={browser.i18n.getMessage('defaultSettingsText')}
              text={browser.i18n.getMessage('defaultSettingsText')}
              styleReact={styles.buttonStyle}
            />

        {error !== '' ? (

 this.setState({ error: '' })}
            className="row alert alert-danger alertPreWrap"
          >
            {error}

        ) : (
          ''
        )}
        {success !== '' ? (

 this.setState({ success: '' })}
            className="row alert alert-success alertPreWrap"
          >
            {browser.i18n.getMessage('successText')} {success}

        ) : (
          ''
        )}

        <fieldset>
          <legend>{browser.i18n.getMessage('settingGroupAutoClean')}</legend>

            <CheckboxSetting
              text={browser.i18n.getMessage('activeModeText')}
              inline={true}
              settingObject={settings[SettingID.ACTIVE_MODE]}
              updateSetting={(payload) => onUpdateSetting(payload)}
            />
            <SettingsTooltip hrefURL={'#enable-automatic-cleaning'} />

            <input
              id="delayBeforeClean"
              type="number"
              className="form-control w-auto"
              style={styles.inlineNumberInput}
              onChange={(e) => {
                const eValue = Number.parseInt(e.target.value, 10);
                if (!Number.isNaN(eValue) && eValue >= 1 && eValue <= 2147483) {
                  onUpdateSetting({
                    name: SettingID.CLEAN_DELAY,
                    value: eValue,
                  });
                }
              }}
              value={settings[SettingID.CLEAN_DELAY].value as number}
              min="1"
              max="2147483"
              size={10}
            />

              {browser.i18n.getMessage('secondsText')}{' '}
              {browser.i18n.getMessage('activeModeDelayText')}

            <SettingsTooltip hrefURL={'#delay-before-automatic-cleaning'} />

            <CheckboxSetting
              text={browser.i18n.getMessage('cleanDiscardedText')}
              settingObject={settings[SettingID.CLEAN_DISCARDED]}
              inline={true}
              updateSetting={(payload) => onUpdateSetting(payload)}
            />
            <SettingsTooltip
              hrefURL={'#enable-cleanup-for-discardedunloaded-tabs'}
            />

            <CheckboxSetting
              text={browser.i18n.getMessage('cleanupDomainChangeText')}
              settingObject={settings[SettingID.CLEAN_DOMAIN_CHANGE]}
              inline={true}
              updateSetting={(payload) => onUpdateSetting(payload)}
            />
            <SettingsTooltip hrefURL={'#enable-cleanup-on-domain-change'} />

            <CheckboxSetting
              text={browser.i18n.getMessage(SettingID.ENABLE_GREYLIST)}
              settingObject={settings[SettingID.ENABLE_GREYLIST]}
              inline={true}
              updateSetting={(payload) => onUpdateSetting(payload)}
            />
            <SettingsTooltip
              hrefURL={'#enable-greylist-cleanup-on-browser-restart'}
            />

            <CheckboxSetting
              text={browser.i18n.getMessage('cookieCleanUpOnStartText')}
              settingObject={settings[SettingID.CLEAN_OPEN_TABS_STARTUP]}
              inline={true}
              updateSetting={(payload) => onUpdateSetting(payload)}
            />
            <SettingsTooltip
              hrefURL={'#clean-cookies-from-open-tabs-on-startup'}
            />

            <CheckboxSetting
              settingObject={settings[SettingID.CLEAN_EXPIRED]}
              inline={true}
              text={browser.i18n.getMessage('cleanExpiredCookiesText')}
              updateSetting={(payload) => onUpdateSetting(payload)}
            />
            <SettingsTooltip hrefURL={'#clean-all-expired-cookies'} />

        </fieldset>

        <fieldset>
          <legend>{browser.i18n.getMessage('settingGroupExpression')}</legend>

            {browser.i18n.getMessage('groupExpressionDefaultNotice', [
              browser.i18n.getMessage('expressionListText'),
            ])}{' '}
            <SettingsTooltip hrefURL={'#default-expression-options'} />

        </fieldset>

        {(isFirefoxNotAndroid(cache) || isChrome(cache)) && (
          <fieldset>
            <legend>
              {browser.i18n.getMessage('settingGroupOtherBrowsing')}
            </legend>

              <CheckboxSetting
                text={browser.i18n.getMessage('siteDataEmptyOnEnable')}
                settingObject={settings[SettingID.SITEDATA_EMPTY_ON_ENABLE]}
                inline={true}
                updateSetting={(payload) => onUpdateSetting(payload)}
              />
              <SettingsTooltip
                hrefURL={
                  '#clean-existing-data-for-newly-enabled-browsing-data-types'
                }
              />

              {browser.i18n.getMessage(
                `browsingData${
                  settings[SettingID.SITEDATA_EMPTY_ON_ENABLE].value === true
                    ? ''
                    : 'NoEmpty'
                }Warning`,
              )}

            {((isFirefoxNotAndroid(cache) && ffVersion >= 78) ||
              isChrome(cache)) && (

                <CheckboxSetting
                  text={browser.i18n.getMessage('cacheCleanupText')}
                  settingObject={settings[SettingID.CLEANUP_CACHE]}
                  inline={true}
                  updateSetting={(payload) => onUpdateSetting(payload)}
                />
                <SettingsTooltip
                  hrefURL={'#other-browsing-data-cleanup-options'}
                />

            )}
            {((isFirefoxNotAndroid(cache) && ffVersion >= 77) ||
              isChrome(cache)) && (

                <CheckboxSetting
                  text={browser.i18n.getMessage('indexedDBCleanupText')}
                  settingObject={settings[SettingID.CLEANUP_INDEXEDDB]}
                  inline={true}
                  updateSetting={(payload) => onUpdateSetting(payload)}
                />
                <SettingsTooltip
                  hrefURL={'#other-browsing-data-cleanup-options'}
                />

            )}
            {((isFirefoxNotAndroid(cache) && ffVersion >= 58) ||
              isChrome(cache)) && (

                <CheckboxSetting
                  text={browser.i18n.getMessage('localStorageCleanupText')}
                  settingObject={settings[SettingID.CLEANUP_LOCALSTORAGE]}
                  inline={true}
                  updateSetting={(payload) => onUpdateSetting(payload)}
                />
                <SettingsTooltip
                  hrefURL={'#other-browsing-data-cleanup-options'}
                />

            )}
            {((isFirefoxNotAndroid(cache) && ffVersion >= 78) ||
              isChrome(cache)) && (

                <CheckboxSetting
                  text={browser.i18n.getMessage('pluginDataCleanupText')}
                  settingObject={settings[SettingID.CLEANUP_PLUGINDATA]}
                  inline={true}
                  updateSetting={(payload) => onUpdateSetting(payload)}
                />
                <SettingsTooltip
                  hrefURL={'#other-browsing-data-cleanup-options'}
                />

            )}
            {((isFirefoxNotAndroid(cache) && ffVersion >= 77) ||
              isChrome(cache)) && (

                <CheckboxSetting
                  text={browser.i18n.getMessage('serviceWorkersCleanupText')}
                  settingObject={settings[SettingID.CLEANUP_SERVICEWORKERS]}
                  inline={true}
                  updateSetting={(payload) => onUpdateSetting(payload)}
                />
                <SettingsTooltip
                  hrefURL={'#other-browsing-data-cleanup-options'}
                />

            )}
          </fieldset>
        )}
        {(isFirefoxNotAndroid(cache) || isChrome(cache)) &&
}
        <fieldset>
          <legend>{browser.i18n.getMessage('settingGroupExtension')}</legend>
          {isFirefoxNotAndroid(cache) && (

                {browser.i18n.getMessage('containerSiteDataWarning')}

              <CheckboxSetting
                text={browser.i18n.getMessage(
                  'contextualIdentitiesEnabledText',
                )}
                settingObject={settings[SettingID.CONTEXTUAL_IDENTITIES]}
                inline={true}
                updateSetting={(payload) => onUpdateSetting(payload)}
              />
              <SettingsTooltip
                hrefURL={'#enable-support-for-firefoxs-container-tabs'}
              />

          )}
          {isFirefoxNotAndroid(cache) &&
            settings[SettingID.CONTEXTUAL_IDENTITIES].value && (

                <CheckboxSetting
                  text={browser.i18n.getMessage(
                    'contextualIdentitiesAutoRemoveText',
                  )}
                  settingObject={
                    settings[SettingID.CONTEXTUAL_IDENTITIES_AUTOREMOVE]
                  }
                  inline={true}
                  updateSetting={(payload) => onUpdateSetting(payload)}
                />
                <SettingsTooltip
                  hrefURL={
                    '#enable-automatic-removal-of-expression-list-when-its-container-is-removed'
                  }
                />

            )}

            <CheckboxSetting
              text={browser.i18n.getMessage('enableCleanupLogText')}
              settingObject={settings[SettingID.STAT_LOGGING]}
              inline={true}
              updateSetting={(payload) => onUpdateSetting(payload)}
            />
            <SettingsTooltip hrefURL={'#enable-cleanup-log-and-counter'} />
            {settings[SettingID.STAT_LOGGING].value && (

                {browser.i18n.getMessage('noPrivateLogging')}

            )}

          {(!isFirefox(cache) || isFirefoxNotAndroid(cache)) && (

              <CheckboxSetting
                text={browser.i18n.getMessage('showNumberOfCookiesInIconText')}
                settingObject={settings[SettingID.NUM_COOKIES_ICON]}
                inline={true}
                updateSetting={(payload) => onUpdateSetting(payload)}
              />
              <SettingsTooltip
                hrefURL={'#show-number-of-cookies-for-that-domain'}
              />

          )}
          {(!isFirefox(cache) || isFirefoxNotAndroid(cache)) &&
            settings[SettingID.NUM_COOKIES_ICON].value === true && (

                <CheckboxSetting
                  text={browser.i18n.getMessage(SettingID.KEEP_DEFAULT_ICON)}
                  settingObject={settings[SettingID.KEEP_DEFAULT_ICON]}
                  inline={true}
                  updateSetting={(payload) => onUpdateSetting(payload)}
                />
                <SettingsTooltip
                  hrefURL={'#keep-default-icon-on-all-list-types'}
                />

            )}

            <CheckboxSetting
              text={browser.i18n.getMessage('notifyCookieCleanUpText')}
              settingObject={settings[SettingID.NOTIFY_AUTO]}
              inline={true}
              updateSetting={(payload) => onUpdateSetting(payload)}
            />
            <SettingsTooltip
              hrefURL={'#show-notification-after-automatic-cleanup'}
            />

            <CheckboxSetting
              inline={true}
              settingObject={settings[SettingID.NOTIFY_MANUAL]}
              text={browser.i18n.getMessage('manualNotificationsText')}
              updateSetting={(payload) => onUpdateSetting(payload)}
            />
            <SettingsTooltip
              hrefURL={'#show-notification-from-manual-site-data-cleanups'}
            />

            <SelectInput
              numSize={9}
              numStart={1}
              settingObject={settings[SettingID.NOTIFY_DURATION]}
              text={`${browser.i18n.getMessage(
                'secondsText',
              )} ${browser.i18n.getMessage('notifyCookieCleanupDelayText')}`}
              updateSetting={(payload) => {
                onUpdateSetting(payload);
              }}
            />
            <SettingsTooltip hrefURL={'#duration-for-notifications'} />

            <CheckboxSetting
              text={browser.i18n.getMessage(SettingID.ENABLE_NEW_POPUP)}
              settingObject={settings[SettingID.ENABLE_NEW_POPUP]}
              inline={true}
              updateSetting={(payload) => onUpdateSetting(payload)}
            />
            <SettingsTooltip
              hrefURL={'#enable-popup-when-new-version-is-released'}
            />

            <SelectInput
              numSize={14}
              numStart={10}
              settingObject={settings[SettingID.SIZE_POPUP]}
              text={browser.i18n.getMessage('sizePopupText')}
              updateSetting={(payload) => onUpdateSetting(payload)}
            />
            <SettingsTooltip hrefURL={'#size-of-popup'} />

            <SelectInput
              numSize={14}
              numStart={10}
              settingObject={settings[SettingID.SIZE_SETTING]}
              text={browser.i18n.getMessage('sizeSettingText')}
              updateSetting={(payload) => {
                onUpdateSetting(payload);
              }}
            />
            <SettingsTooltip hrefURL={'#size-of-setting'} />

          {(isFirefoxNotAndroid(cache) || isChrome(cache)) && (

              <CheckboxSetting
                text={browser.i18n.getMessage('enableContextMenus')}
                settingObject={settings[SettingID.CONTEXT_MENUS]}
                inline={true}
                updateSetting={(payload) => onUpdateSetting(payload)}
              />
              <SettingsTooltip hrefURL={'#enable-context-menus'} />

          )}
          {(isFirefoxNotAndroid(cache) || isChrome(cache)) && (

              <CheckboxSetting
                text={browser.i18n.getMessage(SettingID.DEBUG_MODE)}
                settingObject={settings[SettingID.DEBUG_MODE]}
                inline={true}
                updateSetting={(payload) => onUpdateSetting(payload)}
              />
              <SettingsTooltip hrefURL={'#debug-mode'} />
              {settings[SettingID.DEBUG_MODE].value && (

{browser.i18n.getMessage('openDebugMode')}

                      {(isFirefox(cache) &&
                        'about:devtools-toolbox?type=extension&id=') ||
                        (isChrome(cache) && `chrome://extensions/?id=`)}
                      {encodeURIComponent(browser.runtime.id)}

                  {isChrome(cache) && (

{browser.i18n.getMessage('chromeDebugMode')}

                  )}

                    {browser.i18n.getMessage('consoleDebugMode')}.{' '}
                    {browser.i18n.getMessage('filterDebugMode')}

                    CAD_

              )}

          )}
        </fieldset>

    );
  }

  private setError(e: Error): void {
    this.setState({
      error: e.toString(),
      success: '',
    });
  }
}

const mapStateToProps = (state: State) => {
  const { settings, cache } = state;
  return {
    cache,
    settings,
  };
};

const mapDispatchToProps = (dispatch: Dispatch<ReduxAction>) => ({
  onUpdateSetting(newSetting: Setting) {
    dispatch(updateSetting(newSetting));
  },
  onResetButtonClick() {
    dispatch(resetSettings());
  },
});

export default connect(mapStateToProps, mapDispatchToProps)(Settings);


text:
html, body {
  height: 100%;
  width: 100%;
  padding: 0;
  margin: 0;
}
body {
  background: #fffae5;
}
#container {
  background: #fffae5;
}
#main {
  background: #fffae5;
}
#navigation {
  background: #fffae5;
}
#navigation h2 {
  margin-right: 10px;
  border: 1px solid gray;
  border-radius: 5px;
}
#content {
  background: #fffae5;
  height: 100%;
}
#about {
  display: none;
}
table.module_list td.name,
table.module_list td.summary,
table.function_list td.name,
table.function_list td.summary {
  background: #fffae5;
  border-color: gray;
}
a:link, a:visited {
  color: #800000;
}

redpajama_set_name: RedPajamaGithub


text:
// flow-typed signature: 0ec217efb85c4b4e56452494e2ae1a41
// flow-typed version: <<STUB>>/react-native-zip-archive_v5.0.2/flow_v0.105.2

/**
 * This is an autogenerated libdef stub for:
 *
 *   'react-native-zip-archive'
 *
 * Fill this stub out by replacing all the `any` types.
 *
 * Once filled out, we encourage you to share your work with the
 * community by sending a pull request to:
 * https://github.com/flowtype/flow-typed
 */

declare module 'react-native-zip-archive' {
  declare module.exports: any;
}

/**
 * We include stubs for each file inside this npm package in case you need to
 * require those files directly. Feel free to delete any files that aren't
 * needed.
 */

// Filename aliases
declare module 'react-native-zip-archive/index' {
  declare module.exports: $Exports<'react-native-zip-archive'>;
}
declare module 'react-native-zip-archive/index.js' {
  declare module.exports: $Exports<'react-native-zip-archive'>;
}


text:
package com.jivesoftware.os.amza.service;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.google.common.base.Charsets;
import com.google.common.collect.Sets;
import com.google.common.io.BaseEncoding;
import de.svenjacobs.loremipsum.LoremIpsum;
import java.io.IOException;
import java.util.Random;
import java.util.Set;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class AmzaGetStress {

    private static final Random rand = new Random();
    private static final LoremIpsum loremIpsum = new LoremIpsum();
    private static final ObjectMapper mapper = new ObjectMapper();

    public static void main(String[] args) throws IOException {

        args = new String[]{"soa-integ-data11.phx1.jivehosted.com", "1185", "1", "10000"};

        final String hostName = args[0];
        final int port = Integer.parseInt(args[1]);
        final int firstDocId = Integer.parseInt(args[2]);
        final int count = Integer.parseInt(args[3]);
        final int batchSize = 100;

        String partitionName = "lorem";

        for (int i = 0; i < 1024; i++) {
            final String rname = partitionName + i;
            final org.apache.http.client.HttpClient httpClient = HttpClients.createDefault();

            Thread t = new Thread() {
                @Override
                public void run() {
                    try {
                        get(httpClient, hostName, port, rname, 0, count, batchSize);
                    } catch (Exception x) {
                        x.printStackTrace();
                    }
                }
            };
            t.start();
        }
    }

    private static void get(org.apache.http.client.HttpClient httpClient,
        String hostName, int port, String partitionName, int firstDocId, int count, int batchSize) throws IOException, InterruptedException {
        long start = System.currentTimeMillis();
        for (int key = firstDocId; key < count; key++) {
            StringBuilder url = new StringBuilder();
            url.append("http://");
            url.append(hostName).append(":").append(port);
            url.append("/amza/get");
            url.append("?partition=").append(partitionName);
            url.append("&key=");

            Set<String> expectedValues = Sets.newHashSet();
            for (int b = 0; b < batchSize; b++) {
                if (b > 0) {
                    url.append(',');
                }
                url.append(b).append('k').append(key);
                expectedValues.add(b + "v" + key);
            }

            while (true) {
                HttpGet method = new HttpGet(url.toString());
                StatusLine statusLine;
                try {
                    try {
                        HttpResponse response = httpClient.execute(method);

                        statusLine = response.getStatusLine();
                        if (statusLine.getStatusCode() == 200) {
                            //System.out.println("Got:" + new String(method.getResponseBody()));
                            ArrayNode node = mapper.readValue(EntityUtils.toString(response.getEntity()), ArrayNode.class);
                            for (JsonNode value : node) {
                                if (!value.isNull()) {
                                    expectedValues.remove(new String(BaseEncoding.base64().decode(value.textValue()), Charsets.UTF_8));
                                }
                            }
                            if (!expectedValues.isEmpty()) {
                                System.out.println("Missing values in " + partitionName + " for key " + key + ": " + expectedValues);
                            }
                            break;
                        }
                    } catch (Exception x) {
                        x.printStackTrace();
                    }
                    Thread.sleep(1000);
                } finally {
                    method.releaseConnection();
                }
            }

            if (key % 100 == 0) {
                long elapse = System.currentTimeMillis() - start;
                double millisPerAdd = ((double) elapse / (double) key);
                System.out.println(partitionName + " millisPerGet:" + millisPerAdd + " getsPerSec:" + (1000d / millisPerAdd) + " key:" + key);
            }
        }
    }

}


text:
package com.atlassian.sal.api.search.query;

/**
 * Parses a query string created by a {@link SearchQuery} to allow easy access to the various aspects of the query
 *
 * @since 2.0
 */
public interface SearchQueryParser
{

    /**
     * Query string submitted should already be url-encoded.
     *
     * @param query The search query
     * @return The parsed query
     */
    SearchQuery parse(String query);
}


text:
NodeGroups
----------------------------

.. automodule:: google.cloud.compute_v1.services.node_groups
    :members:
    :inherited-members:

.. automodule:: google.cloud.compute_v1.services.node_groups.pagers
    :members:
    :inherited-members:


text:
  using System;
  using System.Collections.Generic;
  using System.Text.RegularExpressions;
  using Com.Aspose.OMR.Model;

namespace Com.Aspose.OMR.Api
{
    public class OmrApi
    {
        string basePath;
        private readonly ApiInvoker apiInvoker = ApiInvoker.GetInstance();

        public OmrApi(String apiKey, String appSid, String basePath)
        {
            apiInvoker.ApiKey = apiKey;
            apiInvoker.AppSid = appSid;
            this.basePath = basePath;
        }

        public ApiInvoker getInvoker()
        {
            return apiInvoker;
        }

        // Sets the endpoint base url for the services being accessed
        public void setBasePath(string basePath)
        {
            this.basePath = basePath;
        }

        // Gets the endpoint base url for the services being accessed
        public String getBasePath()
        {
            return basePath;
        }

        /// <summary>
        /// PostRunOmrTask
        /// </summary>
        /// <param name="name"></param>
        /// <param name="actionName"></param>
        /// <param name="functionParams"></param>
        /// <param name="additionalParams"></param>
        /// <param name="storage"></param>
        /// <param name="folder"></param>
        /// <returns></returns>
        public OMRResponse PostRunOmrTask(string name, string actionName, OMRFunctionParam functionParam,
            string storage, string folder)
        {
            // create path and map variables
            string ResourcePath =
                "/omr/{name}/runOmrTask/?appSid={appSid}&actionName={actionName}&storage={storage}&folder={folder}"
                    .Replace("{format}", "json");
            ResourcePath = Regex.Replace(ResourcePath, "\\*", "")
                .Replace("&", "&")
                .Replace("/?", "?")
                .Replace("toFormat={toFormat}", "format={format}");

            // query params
            Dictionary<string, string> queryParams = new Dictionary<String, String>();
            Dictionary<string, string> headerParams = new Dictionary<String, String>();
            Dictionary<string, object> formParams = new Dictionary<String, object>();

            // verify required params are set
            if (name == null)
            {
                throw new ApiException(400, "missing required params");
            }
            if (name == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])name=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "name" + "}", apiInvoker.ToPathValue(name));
            }
            if (actionName == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])actionName=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "actionName" + "}", apiInvoker.ToPathValue(actionName));
            }
            if (storage == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])storage=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "storage" + "}", apiInvoker.ToPathValue(storage));
            }
            if (folder == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])folder=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "folder" + "}", apiInvoker.ToPathValue(folder));
            }
            try
            {
                if (typeof(OMRResponse) == typeof(ResponseMessage))
                {
                    byte[] response = apiInvoker.invokeBinaryAPI(basePath, ResourcePath, "POST", queryParams,
                        functionParam, headerParams, formParams);
                    return (OMRResponse) ApiInvoker.deserialize(response, typeof(OMRResponse));
                }
                else
                {
                    string response = apiInvoker.invokeAPI(basePath, ResourcePath, "POST", queryParams, functionParam,
                        headerParams, formParams);
                    if (response != null)
                    {
                        return (OMRResponse) ApiInvoker.deserialize(response, typeof(OMRResponse));
                    }
                    else
                    {
                        return null;
                    }
                }
            }
            catch (ApiException ex)
            {
                if (ex.ErrorCode == 404)
                {
                    return null;
                }
                else
                {
                    throw ex;
                }
            }
        }

    }
}


text:
<?php

namespace Spatie\Varnish\Test;

use Orchestra\Testbench\TestCase as Orchestra;
use Spatie\Varnish\VarnishServiceProvider;

class TestCase extends Orchestra
{
    /**
     * @param \Illuminate\Foundation\Application $app
     *
     * @return array
     */
    protected function getPackageProviders($app)
    {
        return [
            VarnishServiceProvider::class,
        ];
    }
}


text:
class MountableGallery::IconUploader < CarrierWave::Uploader::Base

  include CarrierWave::MiniMagick

  storage :file # :fog

  # Override the directory where uploaded files will be stored.
  # This is a sensible default for uploaders that are meant to be mounted:
  def store_dir
    "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
  end

  [32, 48, 56, 64].each do |size|
    version :"icon#{size}" do
      process :resize_to_fit => [size, size]
    end
  end

  def extension_white_list
    %w(jpg jpeg gif png)
  end

end


text:
//
//  GuideViewController.m
//  Coding-StartGuidePage-01
//
//  Created by HailongHan on 15/7/17.
//  Copyright (c) 2015年 HailongHan. All rights reserved.
//

#import "GuideViewController.h"
#import <SMPageControl.h>

@interface GuideViewController ()

@property (nonatomic,strong) UIButton *registerBtn,*loginBtn;

@end

@implementation GuideViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];

    [self configViews];
}

/**
 *  配置视图view
 */
- (void)configViews{
    [self configRegisterLoginButtonAndPageControl];
}

- (void)configRegisterLoginButtonAndPageControl{
    self.registerBtn = [UIButton new];

}

@end


text:
package org.apache.nifi.distributed.cache.client;

import java.util.Optional;

public class AtomicCacheEntry<K, V, R> {

    private final K key;
    private V value;
    private final R revision;

    /**
     * Create new cache entry.
     * @param key cache key
     * @param value cache value
     * @param revision cache revision, can be null with a brand new entry
     */
    public AtomicCacheEntry(final K key, final V value, final R revision) {
        this.key = key;
        this.value = value;
        this.revision = revision;
    }

    /**
     * @return the latest revision stored in a cache server
     */
    public Optional<R> getRevision() {
        return Optional.ofNullable(revision);
    }

    public K getKey() {
        return key;
    }

    public V getValue() {
        return value;
    }

    public void setValue(V value) {
        this.value = value;
    }

}


text:
@interface WPJsonApiHandlerTests : SenTestCase

@end


text:
using namespace SteamAPIWrap;

namespace SteamAPIWrap
{
	template <> CServices *CSingleton<CServices>::instance = nullptr;

	CServices::CServices()
		: CSteamAPIContext()
		, appID(0)
		, errorCode(EErrorCodes::Ok)
		, steamLoadStatus(ELoadStatus::NotLoaded)
		, managedCallback(nullptr)
		, managedResultCallback(nullptr)
	{

	}

	bool CServices::Startup(u32 interfaceVersion)
	{
		if (interfaceVersion != CVersionInfo::GetInterfaceID())
		{
			// The interface versions do not match
			SetErrorCode(EErrorCodes::InvalidInterfaceVersion);
			return false;
		}

		if (steamLoadStatus != ELoadStatus::NotLoaded)
		{
			// Steam have already been loaded once. This is not supported
			SetErrorCode(EErrorCodes::AlreadyLoaded);
			return false;
		}

		// Initialize Steam
		if (!SteamAPI_InitSafe())
		{
			SetErrorCode(EErrorCodes::SteamInitializeFailed);
			return false;
		}

		// Initialize the Steam interfaces
		if (!Init())
		{
			SetErrorCode(EErrorCodes::SteamInterfaceInitializeFailed);
			return false;
		}

		appID = SteamUtils()->GetAppID();

		// Setup all interfaces
		CCloud::Instance().SetSteamInterface(SteamRemoteStorage());
		CStats::Instance().SetSteamInterface(SteamUserStats());
		CUser::Instance().SetSteamInterface(SteamUser());
		CFriends::Instance().SetSteamInterface(SteamFriends());
		CMatchMaking::Instance().SetSteamInterface(SteamMatchmaking());
		CMatchmakingServers::Instance().SetSteamInterface(SteamMatchmakingServers());
		CNetworking::Instance().SetSteamInterface(SteamNetworking());
		CUtils::Instance().SetSteamInterface(SteamUtils());
		CApps::Instance().SetSteamInterface(SteamApps());
		CHTTP::Instance().SetSteamInterface(SteamHTTP());
		CScreenshots::Instance().SetSteamInterface(SteamScreenshots());
		CUGC::Instance().SetSteamInterface(SteamUGC());
		CSteamController::Instance().SetSteamInterface(SteamController());

		steamLoadStatus = ELoadStatus::Loaded;
		SetErrorCode(EErrorCodes::Ok);
		return true;
	}

	void CServices::Shutdown()
	{
		CNetworking::Destroy();
		CMatchmakingServers::Destroy();
		CMatchMaking::Destroy();
		CFriends::Destroy();
		CUser::Destroy();
		CStats::Destroy();
		CCloud::Destroy();
		CApps::Destroy();
		CUtils::Destroy();
		CHTTP::Destroy();
		CScreenshots::Destroy();
		CUGC::Destroy();
		CSteamController::Destroy();

		steamLoadStatus = ELoadStatus::Unloaded;
		SteamAPI_Shutdown();

		SetErrorCode(EErrorCodes::Ok);
	}

	bool CServices::IsSteamRunning()
	{
		return SteamAPI_IsSteamRunning();
	}

	bool CServices::RunCallbackSizeCheck()
	{
		CNetworking::Instance().RunCallbackSizeCheck();
		//CMatchmakingServers::Instance().RunCallbackSizeCheck();  //No callbacks
		CMatchMaking::Instance().RunCallbackSizeCheck();
		CFriends::Instance().RunCallbackSizeCheck();
		CUser::Instance().RunCallbackSizeCheck();
		CStats::Instance().RunCallbackSizeCheck();
		CCloud::Instance().RunCallbackSizeCheck();
		CApps::Instance().RunCallbackSizeCheck();
		CUtils::Instance().RunCallbackSizeCheck();
		CHTTP::Instance().RunCallbackSizeCheck();
		CScreenshots::Instance().RunCallbackSizeCheck();
		CUGC::Instance().RunCallbackSizeCheck();
		//CSteamController::Instance().RunCallbackSizeCheck();	//No callbacks

		return true; //Wow. very useful. such good code.
	}
}

ManagedSteam_API_Lite bool Services_IsSteamRunning()
{
	return CServices::Instance().IsSteamRunning();
}

ManagedSteam_API_Lite bool Services_RestartAppIfNecessary( u32 ownAppID )
{
	return SteamAPI_RestartAppIfNecessary( ownAppID );
}

ManagedSteam_API_Lite u32 Services_GetInterfaceVersion()
{
	return CVersionInfo::GetInterfaceID();
}

ManagedSteam_API_Lite Enum Services_GetErrorCode()
{
	return CServices::Instance().GetErrorCode();
}

ManagedSteam_API_Lite bool Services_Startup(u32 interfaceVersion)
{
	return CServices::Instance().Startup(interfaceVersion);
}

ManagedSteam_API_Lite void Services_Shutdown()
{
	CServices::Instance().Shutdown();
}

ManagedSteam_API_Lite Enum Services_GetSteamLoadStatus()
{
	return CServices::Instance().GetSteamLoadStatus();
}

ManagedSteam_API_Lite void Services_HandleCallbacks()
{
	SteamAPI_RunCallbacks();
}

ManagedSteam_API_Lite u32 Services_GetAppID()
{
	return CServices::Instance().GetAppID();
}

ManagedSteam_API bool Services_RunCallbackSizeCheck()
{
	return CServices::Instance().RunCallbackSizeCheck();
}

ManagedSteam_API_Lite void Services_RegisterManagedCallbacks(ManagedCallback callback, ManagedResultCallback resultCallback)
{
	CServices::Instance().RegisterManagedCallbacks(callback, resultCallback);
}

ManagedSteam_API_Lite void Services_RemoveManagedCallbacks()
{
	CServices::Instance().RemoveManagedCallbacks();
}


text:
title: "Перенаправление с HTTP на HTTPS"
updated_on: 2015-03-27
key-takeaways:
  - "В заголовок своей страницы необходимо вставить каноническую ссылку, чтобы указать поисковым системам, что наилучший способ перейти на ваш сайт – воспользоваться протоколом https."
---

{% include shared/takeaway.liquid list=page.key-takeaways %}

Вставьте на свои страницы теги <link rel="canonical" href="https://…"/>. [Это
позволит поисковым системам](https://support.google.com/webmasters/answer/139066?hl=en)
определить наилучший способ перейти на ваш сайт.

Большинство веб-серверов оснащены простой функцией перенаправления. Воспользуйтесь кодом состояния 301 (окончательно перемещено),
чтобы указать поисковым системам и браузерам, что версия HTTPS является канонической, и перенаправить пользователей на версию HTTPS вашего сайта с версии HTTP.


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package acciones;

import com.opensymphony.xwork2.ActionSupport;
import java.util.Map;
import org.apache.struts2.interceptor.SessionAware;

/**
 *
 * @author derick
 */
public class Default extends ActionSupport implements SessionAware{

    @Override
    public String execute() {
        return "success";
    }

    @Override
    public void setSession(Map<String, Object> map) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

}


text:
/**
 * Progress Loader Elements
 * @type {{body: *, holder: Element}}
 */
const ple = {
  body: document.getElementsByTagName('body')[0],
  html: document.getElementsByTagName('html')[0],
  barOuter: document.querySelector('.c-progressLoader'),
  barInner: document.querySelector('.c-progressLoader__loader'),
  states: {
    loading: 'c-progressLoader--load',
    complete: 'c-progressLoader--complete'
  },
  barstates: {
    loading: 'c-progressLoader--bar--load',
    complete: 'c-progressLoader--bar--complete'
  }
}

/**
 * Initial Loading Function
 */
const stateLoading = () => {
  // Give Body a initial Load Class
  ple.body.classList.add(ple.states.loading)
  // Activate the Bar Element with adding a Class
  ple.barInner.classList.add(ple.barstates.loading)
}

/**
 * Complete State Function
 */
const stateComplete = () => {
  // Change Classes for the Progressbar
  ple.barInner.classList.remove(ple.barstates.loading)
  ple.barInner.classList.add(ple.barstates.complete)

  // After a small Timeout toggle the Body Class
  setTimeout(() => {
    ple.body.classList.add(ple.states.complete)
  }, 700)
}

const onLoad = (loading, loaded) => {
  if (document.readyState === 'complete') {
    return loaded()
  }
  loading()
  if (window.addEventListener) {
    window.addEventListener('load', loaded, false)
  } else if (window.attachEvent) {
    window.attachEvent('onload', loaded)
  }
}
/**
 * Progress Loader
 */
const progressLoader = () => {
  // Disable Progressloader on Craft Livepreview
  if (!ple.body.classList.contains('is-livepreview') && ple.html.classList.contains('plj')) {
    onLoad(
      () => {
        stateLoading()
      },
      () => {
        setTimeout(() => {
          stateComplete()
        }, 0)
      }
    )
  }
}

module.exports = progressLoader


text:
Opp_Caller oc_window_0;
Opp_Caller oc_window_1;
Opp_Caller oc_window_2;
Opp_Caller oc_window_3;
Opp_Caller oc_window_4;
Opp_Caller oc_window_5;
Opp_Caller oc_window_6;
Opp_Caller oc_window_7;

int multi_frame_count = 1; //default

void fmain_fractional_enter() {
	static int count = 0;
	count++;
	if(count == multi_frame_count) {
		count = 0;
		std::cout << "fMAIN multi-frame enter" << std::endl;
		opp_frame_enter(frame_name_to_id[fMAIN]);
	}
}

void fmain_fractional_exit() {
	static int count = 0;
	count++;
	if(count == multi_frame_count) {
		count = 0;
		std::cout << "fMAIN multi-frame exit" << std::endl;
		opp_frame_exit_complete(frame_name_to_id[fMAIN]);
	}
}

char * plot_filename = 0;

void init_srt_interface() {
	Opp::feature_control_use_fast_reaction_strategy(true);

	const char * srt_exp_plot_filename = std::getenv("SRT_EXP_PLOT_FILENAME");
	std::cout << "Environment variable SRT_EXP_PLOT_FILENAME = " << (srt_exp_plot_filename != 0 ? srt_exp_plot_filename : "") << std::endl;
	plot_filename = "plot.dat";
	if(srt_exp_plot_filename != 0) {
		plot_filename = (char *)malloc( strlen(srt_exp_plot_filename) + 1 );
		strcpy(plot_filename, srt_exp_plot_filename);
	}
	std::cout << "  plot_filename = " << plot_filename << std::endl;

	const char * srt_exp_multi_frame_count = std::getenv("SRT_EXP_MULTI_FRAME_COUNT");
	std::cout << "Environment variable SRT_EXP_MULTI_FRAME_COUNT = " << (srt_exp_multi_frame_count != 0 ? srt_exp_multi_frame_count : "") << std::endl;
	if(srt_exp_multi_frame_count != 0) {
		int temp_mfc;
		if( std::sscanf(srt_exp_multi_frame_count, "%d", &temp_mfc) == 1)
			multi_frame_count = temp_mfc;
		assert(multi_frame_count > 0);
	}
	std::cout << "For Frame fMAIN multi_frame_count = " << multi_frame_count << std::endl;

	const char * srt_exp_mean = std::getenv("SRT_EXP_MEAN");
	std::cout << "Environment variable SRT_EXP_MEAN = " << (srt_exp_mean != 0 ? srt_exp_mean : "") << std::endl;
	double mean = 0.53; //default value
	if(srt_exp_mean != 0) {
		double temp_mean;
		if( std::sscanf(srt_exp_mean, "%lf", &temp_mean) == 1 )
			mean = temp_mean;
		assert(mean >= 0.0);
	}
	mean = mean * multi_frame_count;
	std::cout << "For Frame fMAIN using (multi-frame) mean = " << mean << std::endl;

	const char * srt_exp_window_frac = std::getenv("SRT_EXP_WINDOW_FRAC");
	std::cout << "Environment variable SRT_EXP_WINDOW_FRAC = " << (srt_exp_window_frac != 0 ? srt_exp_window_frac : "") << std::endl;
	double window_frac = 0.20; //default value
	if(srt_exp_window_frac != 0) {
		double temp_window_frac;
		if( std::sscanf(srt_exp_window_frac, "%lf", &temp_window_frac) == 1 )
			window_frac = temp_window_frac;
		assert(window_frac >= 0.0);
	}
	std::cout << "For Frame fMAIN using (multi-frame) window_frac = " << window_frac << std::endl;

	const char * srt_exp_sliding_window = std::getenv("SRT_EXP_SLIDING_WINDOW");
	int sliding_window_size = 1;
	if(srt_exp_sliding_window != 0) {
		int temp_sliding_window_size;
		if( std::sscanf(srt_exp_sliding_window, "%d", &temp_sliding_window_size) == 1 )
			sliding_window_size = temp_sliding_window_size;
		assert(sliding_window_size >= 1);
	}
	std::cout << "Environment variable SRT_EXP_SLIDING_WINDOW = " << (srt_exp_sliding_window != 0 ? srt_exp_sliding_window: "") << std::endl;
	std::cout << "SRT for mpeg2enc ExecFrame: sliding_window_size = " << sliding_window_size << std::endl;

	double lower_window_frac = window_frac;
	double upper_window_frac = window_frac;
	std::cout << "  lower_window_frac = " << lower_window_frac << std::endl;
	std::cout << "  upper_window_frac = " << upper_window_frac << std::endl;
	static Opp::Frame f_main(Opp::Objective(mean, lower_window_frac, upper_window_frac, 0.90, sliding_window_size));
	frame_name_to_id[fMAIN] = f_main.id;

	static Opp::Frame f_motion_est;
	frame_name_to_id[fMOTION_EST] = f_motion_est.id;

	static Opp::Caller window_0;
	static Opp::Caller window_1;
	static Opp::Caller window_2;
	static Opp::Caller window_3;
	static Opp::Caller window_4;
	static Opp::Caller window_5;
	static Opp::Caller window_6;
	static Opp::Caller window_7;

	oc_window_0 = Opp::get_c_handle_for_caller(&window_0);
	oc_window_1 = Opp::get_c_handle_for_caller(&window_1);
	oc_window_2 = Opp::get_c_handle_for_caller(&window_2);
	oc_window_3 = Opp::get_c_handle_for_caller(&window_3);
	oc_window_4 = Opp::get_c_handle_for_caller(&window_4);
	oc_window_5 = Opp::get_c_handle_for_caller(&window_5);
	oc_window_6 = Opp::get_c_handle_for_caller(&window_6);
	oc_window_7 = Opp::get_c_handle_for_caller(&window_7);

	std::vector<Opp::Model> vM;
	vM.push_back( Opp::Model(&window_0) );
	vM.push_back( Opp::Model(&window_1) );
	vM.push_back( Opp::Model(&window_2) );
	vM.push_back( Opp::Model(&window_3) );
	vM.push_back( Opp::Model(&window_4) );
	vM.push_back( Opp::Model(&window_5) );
	vM.push_back( Opp::Model(&window_6) );
	vM.push_back( Opp::Model(&window_7) );

	const char * srt_mode_char = std::getenv("SRT_EXP_MODE");
	bool bFixedMode = false;
	int fixedLevel = -1;
	if(srt_mode_char != 0) {
		char mode_char = srt_mode_char[0];
		if(mode_char >= '0' && mode_char <= '7') {
			bFixedMode = true;
			fixedLevel = mode_char - '0';
		}
	}
	std::cout << "Environment variable SRT_EXP_MODE = " << (srt_mode_char != 0 ? srt_mode_char : "") << std::endl;
	std::cout << "SRT mode control for mpeg2enc: bFixedMode = " << bFixedMode << " fixedLevel = " << fixedLevel << std::endl;

	const char * srt_exp_stickiness_length = std::getenv("SRT_EXP_STICKINESS_LENGTH");
	int stickiness_length = 0;
	if(srt_exp_stickiness_length != 0) {
		int temp_stickiness_length;
		if( std::sscanf(srt_exp_stickiness_length, "%d", &temp_stickiness_length) == 1 )
			stickiness_length = temp_stickiness_length;
		assert(stickiness_length >= 0);
	}
	std::cout << "Environment variable SRT_EXP_STICKINESS_LENGTH = " << (srt_exp_stickiness_length != 0 ? srt_exp_stickiness_length : "") << std::endl;
	std::cout << "SRT for mpeg2enc ExecFrame: stickiness_length = " << stickiness_length << std::endl;

	const char * srt_exp_fast_reaction_strategy_coeff = std::getenv("SRT_EXP_FAST_REACTION_STRATEGY_COEFF");
	double fast_reaction_strategy_coeff = 0.0;
	if(srt_exp_fast_reaction_strategy_coeff != 0) {
		double temp_fast_reaction_strategy_coeff;
		if( std::sscanf(srt_exp_fast_reaction_strategy_coeff, "%lf", &temp_fast_reaction_strategy_coeff) == 1 )
			fast_reaction_strategy_coeff = temp_fast_reaction_strategy_coeff;
		assert(fast_reaction_strategy_coeff >= 0.0);
	}
	std::cout << "Environment variable SRT_EXP_FAST_REACTION_STRATEGY_COEFF = " << (srt_exp_fast_reaction_strategy_coeff != 0 ? srt_exp_fast_reaction_strategy_coeff : "") << std::endl;
	std::cout << "SRT for mpeg2enc ExecFrame: fast_reaction_strategy_coeff = " << fast_reaction_strategy_coeff << std::endl;

	const char * srt_exp_force_fixed_frs_coeff = std::getenv("SRT_EXP_FORCE_FIXED_FRS_COEFF");
	int force_fixed_frs_coeff = 0;
	if(srt_exp_force_fixed_frs_coeff != 0) {
		int temp_force_fixed_frs_coeff;
		if( std::sscanf(srt_exp_force_fixed_frs_coeff, "%d", &temp_force_fixed_frs_coeff) == 1 )
			force_fixed_frs_coeff = temp_force_fixed_frs_coeff;
		assert(force_fixed_frs_coeff == 0 || force_fixed_frs_coeff == 1);
	}
	std::cout << "Environment variable SRT_EXP_FORCE_FIXED_FRS_COEFF = " << (srt_exp_force_fixed_frs_coeff != 0 ? srt_exp_force_fixed_frs_coeff : "") << std::endl;
	std::cout << "SRT for mpeg2enc ExecFrame: force_fixed_frs_coeff = " << force_fixed_frs_coeff << std::endl;

	////
	Opp::Model model_choose_search_window(0, vM, fixedLevel, fast_reaction_strategy_coeff);

	static Opp::ExecFrame ef_choose_search_window(model_choose_search_window, stickiness_length);
	ef_choose_search_window.force_default_selection(bFixedMode);
	ef_choose_search_window.force_fast_reaction_strategy_fixed_coeff( (force_fixed_frs_coeff == 1) );
	execframe_name_to_id[efCHOOSE_SEARCH_WINDOW] = ef_choose_search_window.id;

}

void print_srt_stats_for_frame(SRT_Frame_Names_e frame_name) {
	Opp::FrameID_t frame_id = frame_name_to_id[frame_name];
	std::cout << Opp::FrameStatistics(frame_id).refresh().print_string() << std::endl;
}

void print_srt_stats_for_execframe(SRT_ExecFrame_Names_e execframe_name) {
	Opp::FrameID_t execframe_id = execframe_name_to_id[execframe_name];
	std::cout << Opp::ExecFrameStatistics(execframe_id).refresh().print_string() << std::endl;
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<specs xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="../specs/specs_system_information.xml"/>
  <xi:include href="../specs/specs_msacc.xml"/>
</specs>


text:
<?php

/**
 * @nodep Gtk
 */
//the space is needed for windows include paths with trailing backslash
// http://pear.php.net/bugs/bug.php?id=19482
if ('@include_path@ ' != '@'.'include_path'.'@ ') {
    ini_set('include_path', trim('@include_path@ '));
    $raw = false;
} else {
    // this is a raw, uninstalled pear, either a cvs checkout, or php distro
    $raw = true;
}
define('PEAR_RUNTYPE', 'pecl');
require_once 'pearcmd.php';
/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * indent-tabs-mode: nil
 * mode: php
 * End:
 */
// vim600:syn=php

?>


text:
<package>
  <name>flexbe_behaviors</name>
  <version>1.0.0</version>
  <description>
     flexbe_behaviors references all implemented behaviors.
  </description>
  <maintainer email="todo@todo.com">TODO</maintainer>
  <license>BSD</license>

  <buildtool_depend>catkin</buildtool_depend>

  <run_depend>rospy</run_depend>

  <!-- Add here all ROS packages that contain behaviors -->
  <run_depend>behavior_example_behavior</run_depend>

</package>


text:
CV-search application searches the corpus of cv's (actually any *.pdf, -doc or -txt document) using another corpus of documents as a query. This code can be used as a tutorial for Text Mining and Natural Language Processing with Spark Machine Learning Library.

### How to run:

1. Put documents to the data/corpus folder (there are some examples there already)
2. Put documents to the data/query folder (there are some examples there already)
3. Execute in the command line: ```sbt run```
4. See results in the data/results folder

### Promblem statement

Assume we have a bunch of CV's in different formats which we want to search.

There are several ways we can compose search queries. One can search the text in cv's for keywords, like "java", "teamlead", "scrum". This approach is not  very handy, since there are not so many combinations of keywords you can come up with, not enough to describe a much reacher set of sv's.

Another approach is to parse cv's and to extract important fields to the database, then to query for. This approach is very complex due to the parsing and data extraction parts, thsi approach also  requires from user the knowledge  of a query language, such as SQL.

What if we could query our cv's-base by specifying a bunch of example cv's, to look for similar ones. This application sorts cv's in *.pdf, doc, txt formats from the "corpus" folder in order of their relevance to the cv's in the "query" folder. In other words you query by examples instead of keywords.

Uses Tika parser and Spark's MLlib TF-IDF statistics implementation in order to sort a set of documents according to their similarity to the query qocuments.

#### See more:

1. [Spark MLlib](http://spark.apache.org/mllib/)
2. [Vector Space Model](https://en.wikipedia.org/wiki/Vector_space_model)
3. [TF-IDF](https://en.wikipedia.org/wiki/Tf%E2%80%93idf)


text:
package basic.bit;

import com.google.common.primitives.Longs;

public class Long16Radix {
    @SuppressWarnings("unused")
    public static void main(String[] args) {
        System.out.println("打印最大long和最小long的十六进制、二进制明文");
        System.out.println("最大long十进制:" + Long.MAX_VALUE);
        System.out.println("最大long十六进制:" + Long.toHexString(Long.MAX_VALUE));
        System.out.println("最大long二进制(最高位是0没打印出来):" + Long.toBinaryString(Long.MAX_VALUE));
        System.out.println("最小long十进制:" + Long.MIN_VALUE);
        System.out.println("最小long十六进制:" + Long.toHexString(Long.MIN_VALUE));
        System.out.println("最小long二进制:" + Long.toBinaryString(Long.MIN_VALUE));

        System.out.println("===========================");
        long l = 0xffffffffffffffffL;
        System.out.println("long l = 0xffffffffffffffffL的十进制:" + l);

        byte[] numberByte = Longs.toByteArray(l);
        System.out.println("使用guava api将l转成byte[]再转成long的结果:" + Longs.fromByteArray(numberByte));

        String hex = Long.toHexString(l);
        System.out.println("Long.toHexString(l):" + hex);
        try {
            long ll = Long.parseLong("ffffffffffffffff", 16);
            System.out.println(ll);
        } catch (Exception e) {
            //e.printStackTrace();
        }
        System.out.println("Long.parseLong(\"ffffffffffffffff\", 16)发生异常");

        System.out.println("-------------------");
        l = 0x7fffffffffffffffL;
        System.out.println("long l = 0x7fffffffffffffffL的十进制:" + l);

        numberByte = Longs.toByteArray(l);
        System.out.println("使用guava api将l转成byte[]再转成long的结果:" + Longs.fromByteArray(numberByte));

        hex = Long.toHexString(l);
        System.out.println("Long.toHexString(l):" + hex);
        long ll = Long.parseLong(hex, 16);
        System.out.println("Long.parseLong(\"7fffffffffffffff\", 16):" + ll);

        System.out.println("===========================");
        l = 0x7fffffffffffffffL;
        byte[] bytes = longToBytes(l);
        long res = bytesToLong(bytes);
        System.out.println("l = 0x7fffffffffffffffL;byte[] bytes = longToBytes(l);long res = bytesToLong(bytes);的结果" + res);

        System.out.println("===========================");
        int i = -1;
        String ii = Integer.toHexString(i);
        System.out.println("Long.toHexString(0xFFFFFFFF):" + Long.toHexString(0xFFFFFFFF));
        System.out.println("Long.toHexString(i & 0xFFFFFFFFl):" + Long.toHexString(i & 0xFFFFFFFFl));

        System.out.println("===========================");
        //java中有3个移位运算符
        //>> 算术右移:低位溢出,符号位不变,并用符号位补溢出的高位
        //>>>逻辑右移:低位溢出,高位补0
        long maxLong = Long.MAX_VALUE;
        System.out.println("Long.toHexString(maxLong):" + Long.toHexString(maxLong));
        System.out.println("Long.toBinaryString(maxLong):" + Long.toBinaryString(maxLong));
        System.out.println("Long.toHexString(maxLong>>1):" + Long.toHexString(maxLong >> 1));
        System.out.println("Long.toBinaryString(maxLong>>1)低位溢出,符号位不变,并用符号位补溢出的高位:" + Long.toBinaryString(maxLong >> 1));
        System.out.println("Long.toHexString(maxLong>>>1):" + Long.toHexString(maxLong >>> 1));
        System.out.println("Long.toBinaryString(maxLong>>>1)低位溢出,高位补0:" + Long.toBinaryString(maxLong >>> 1));

        System.out.println("-------------------");
        long minLong = Long.MIN_VALUE;
        System.out.println("Long.toHexString(minLong)" + Long.toHexString(minLong));
        System.out.println("Long.toBinaryString(minLong)" + Long.toBinaryString(minLong));
        System.out.println("Long.toHexString(minLong>>1)" + Long.toHexString(minLong >> 1));
        System.out.println("Long.toBinaryString(minLong>>1)低位溢出,符号位不变,并用符号位补溢出的高位:" + Long.toBinaryString(minLong >> 1));
        System.out.println("Long.toHexString(minLong>>>1)" + Long.toHexString(minLong >>> 1));
        System.out.println("Long.toBinaryString(minLong>>>1)低位溢出,高位补0(变成了正数!):" + Long.toBinaryString(minLong >>> 1));
    }

    public static byte[] longToBytes(long x) {
        byte[] b = new byte[8];
        for (int i = 0; i < b.length; i++) {
            b[i] = (byte) ((x >> (i * 8)) & 0xFF);// 低位存储
        }
        return b;
    }

    public static long bytesToLong(byte[] x) {
        long value = 0;
        for (int i = 0; i < x.length; i++) {
            value += ((long) x[i] & 0xffL) << (8 * i);
        }
        return value;
    }
}


text:
```
python3 -m contrib.dump_backup
```

It will generate .tar.gz file as database backup.

## Import database

```
python3 -m contrib.restore_backup filename.tar.gz
```


text:
"""
.. module: security_monkey.auditors.sns
    :platform: Unix

.. version:: $$VERSION$$
.. moduleauthor:: Patrick Kelley <pkelley@netflix.com> @monkeysecurity

"""

from security_monkey.auditor import Auditor
from security_monkey.watchers.sns import SNS
from security_monkey.exceptions import InvalidARN
from security_monkey.exceptions import InvalidSourceOwner
from security_monkey.datastore import Account

import re

class SNSAuditor(Auditor):
    index = SNS.index
    i_am_singular = SNS.i_am_singular
    i_am_plural = SNS.i_am_plural

    def __init__(self, accounts=None, debug=False):
        super(SNSAuditor, self).__init__(accounts=accounts, debug=debug)

    def check_snstopicpolicy_empty(self, snsitem):
        """
        alert on empty SNS Policy
        """
        tag = "SNS Topic Policy is empty"
        severity = 1
        if snsitem.config.get('policy', {}) == {}:
            self.add_issue(severity, tag, snsitem, notes=None)

    def check_snstopicpolicy_crossaccount(self, snsitem):
        """
        alert on cross account access
        """
        policy = snsitem.config.get('policy', {})
        for statement in policy.get("Statement", []):
            account_numbers = []
            account_number = ''
            princ = statement.get("Principal", {})
            if isinstance(princ, dict):
                princ_aws = princ.get("AWS", "error")
            else:
                princ_aws = princ
            if princ_aws == "*":
                account_number = statement.get("Condition", {}) \
                    .get("StringEquals", {}) \
                    .get("AWS:SourceOwner", None)
                if not account_number:
                    tag = "SNS Topic open to everyone"
                    notes = "An SNS policy where { 'Principal': { 'AWS': '*' } } must also have"
                    notes += " a {'Condition': {'StringEquals': { 'AWS:SourceOwner': '<ACCOUNT_NUMBER>' } } }"
                    notes += " or it is open to the world. In this case, anyone is allowed to perform "
                    notes += " this action(s): {}".format(statement.get("Action"))
                    self.add_issue(10, tag, snsitem, notes=notes)
                    continue
                else:
                    try:
                        account_numbers.append(str(account_number))
                    except ValueError:
                        raise InvalidSourceOwner(account_number)
            else:
                if isinstance(princ_aws, list):
                    for entry in princ_aws:
                        account_numbers.append(str(re.search('arn:aws:iam::([0-9-]+):', entry).group(1)))
                else:
                    try:
                        account_numbers.append(str(re.search('arn:aws:iam::([0-9-]+):', princ_aws).group(1)))
                    except:
                        raise InvalidARN(princ_aws)

            for account_number in account_numbers:
                self._check_account(account_number, snsitem, 'policy')

    def _check_account(self, account_number, snsitem, source):
        account = Account.query.filter(Account.number == account_number).first()
        account_name = None
        if account is not None:
            account_name = account.name

        src = account_name
        dst = snsitem.account
        if 'subscription' in source:
            src = snsitem.account
            dst = account_name

        notes = "SRC [{}] DST [{}]. Location: {}".format(src, dst, source)

        if not account_name:
            tag = "Unknown Cross Account Access"
            self.add_issue(10, tag, snsitem, notes=notes)
        elif account_name != snsitem.account and not account.third_party:
            tag = "Friendly Cross Account Access"
            self.add_issue(0, tag, snsitem, notes=notes)
        elif account_name != snsitem.account and account.third_party:
            tag = "Friendly Third Party Cross Account Access"
            self.add_issue(0, tag, snsitem, notes=notes)

    def check_subscriptions_crossaccount(self, snsitem):
        """
        "subscriptions": [
          {
               "Owner": "020202020202",
               "Endpoint": "someemail@example.com",
               "Protocol": "email",
               "TopicArn": "arn:aws:sns:us-east-1:020202020202:somesnstopic",
               "SubscriptionArn": "arn:aws:sns:us-east-1:020202020202:somesnstopic:..."
          }
        ]
        """
        subscriptions = snsitem.config.get('subscriptions', [])
        for subscription in subscriptions:
            source = '{0} subscription to {1}'.format(
                subscription.get('Protocol', None),
                subscription.get('Endpoint', None)
            )
            owner = subscription.get('Owner', None)
            self._check_account(owner, snsitem, source)


text:
class Test{
  int field =
}


text:
#ifndef INCLUDE_git_version_h__
#define INCLUDE_git_version_h__

#define LIBGIT2_VERSION "0.22.2"
#define LIBGIT2_VER_MAJOR 0
#define LIBGIT2_VER_MINOR 22
#define LIBGIT2_VER_REVISION 2

#define LIBGIT2_SOVERSION 22

#endif


text:
- use points for font size
- set font color to black
- remove margins
- display title, alt, cite?
- diplay href
#Content a[href]:after {
  content: " [" attr(href) "] ";
  word-wrap: break-word;
}
#Content a[href^="#"]:after,
#Content a[href^="tel"]:after,
#Content a[href^="mailto"]:after,
#Content a[href^="javascript"]:after {
  content: "";
}

- remove nav
- remove social media links
- keep breadcrumbs, but don't expand links
#Bread a:link,
#Bread a:visited {
  text-decoration: underline;
  color: #000;
}
#Bread {
  color: #000;
  font-size: 6pt;
}
#Bread > a:after {
  content: "";
}

- page-break-before, page-break-after, page-break-inside
- hide videos, audio, canvas
- don't scale images to 100%
- widows and orphans
p {
  orphans: 3;
  widows: 2;
}

- QR code
header::before {
  content: url(http://chart.apis.google.com/chart?chs=120x120&cht=qr&chl=http%3A%2F%2Fbriankoser.com);
}

- margins
@page {
  @bottom-left {
    content: "Creative Commons";
  }
  @bottom-right {
    counter-increment: page;
    content: "Page " counter(page);
  }
}

*,
*:before,
*:after {
  background: transparent !important;
  color: #000 !important; /* Black prints faster: h5bp.com/s */
  box-shadow: none !important;
}


text:
/**
* DOM utility class.
*
* Provides a useful Window and Element functions as well as cross-browser compatibility buffer.
*
* Some code originally derived from {@link https://github.com/ryanve/verge verge}.
* Some parts were inspired by the research of Ryan Van Etten, released under MIT License 2013.
*
* @class Phaser.DOM
* @static
*/
Phaser.DOM = {

    /**
    * Get the [absolute] position of the element relative to the Document.
    *
    * The value may vary slightly as the page is scrolled due to rounding errors.
    *
    * @method Phaser.DOM.getOffset
    * @param {DOMElement} element - The targeted element that we want to retrieve the offset.
    * @param {Phaser.Point} [point] - The point we want to take the x/y values of the offset.
    * @return {Phaser.Point} - A point objet with the offsetX and Y as its properties.
    */
    getOffset: function (element, point) {

        point = point || new Phaser.Point();

        var box = element.getBoundingClientRect();

        var scrollTop = Phaser.DOM.scrollY;
        var scrollLeft = Phaser.DOM.scrollX;
        var clientTop = document.documentElement.clientTop;
        var clientLeft = document.documentElement.clientLeft;

        point.x = box.left + scrollLeft - clientLeft;
        point.y = box.top + scrollTop - clientTop;

        return point;

    }

};

Phaser.Device.whenReady(function (device) {

    // All target browsers should support page[XY]Offset.
    var scrollX = window && ('pageXOffset' in window) ?
        function () { return window.pageXOffset; } :
        function () { return document.documentElement.scrollLeft; };

    var scrollY = window && ('pageYOffset' in window) ?
        function () { return window.pageYOffset; } :
        function () { return document.documentElement.scrollTop; };

    /**
    * A cross-browser window.scrollX.
    *
    * @name Phaser.DOM.scrollX
    * @property {number} scrollX
    * @readonly
    * @protected
    */
    Object.defineProperty(Phaser.DOM, "scrollX", {
        get: scrollX
    });

    /**
    * A cross-browser window.scrollY.
    *
    * @name Phaser.DOM.scrollY
    * @property {number} scrollY
    * @readonly
    * @protected
    */
    Object.defineProperty(Phaser.DOM, "scrollY", {
        get: scrollY
    });

}, null, true);


text:
<?php

namespace Google\Service\YouTubeReporting;

class GdataDiffUploadRequest extends \Google\Model
{
  protected $checksumsInfoType = GdataCompositeMedia::class;
  protected $checksumsInfoDataType = '';
  protected $objectInfoType = GdataCompositeMedia::class;
  protected $objectInfoDataType = '';
  /**
   * @var string
   */
  public $objectVersion;

  /**
   * @param GdataCompositeMedia
   */
  public function setChecksumsInfo(GdataCompositeMedia $checksumsInfo)
  {
    $this->checksumsInfo = $checksumsInfo;
  }
  /**
   * @return GdataCompositeMedia
   */
  public function getChecksumsInfo()
  {
    return $this->checksumsInfo;
  }
  /**
   * @param GdataCompositeMedia
   */
  public function setObjectInfo(GdataCompositeMedia $objectInfo)
  {
    $this->objectInfo = $objectInfo;
  }
  /**
   * @return GdataCompositeMedia
   */
  public function getObjectInfo()
  {
    return $this->objectInfo;
  }
  /**
   * @param string
   */
  public function setObjectVersion($objectVersion)
  {
    $this->objectVersion = $objectVersion;
  }
  /**
   * @return string
   */
  public function getObjectVersion()
  {
    return $this->objectVersion;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GdataDiffUploadRequest::class, 'Google_Service_YouTubeReporting_GdataDiffUploadRequest');


text:
import _ from "lodash";

import * as blueslip from "./blueslip";

export function eq_array(a, b, eq) {
    if (a === b) {
        // either both are undefined, or they
        // are referentially equal
        return true;
    }

    if (a === undefined || b === undefined) {
        return false;
    }

    if (a.length !== b.length) {
        return false;
    }

    return a.every((item, i) => eq(item, b[i]));
}

export function ul(opts) {
    return {
        tag_name: "ul",
        opts,
    };
}

export function render_tag(tag) {
    /*
        This renders a tag into a string.  It will
        automatically escape attributes, but it's your
        responsibility to make sure keyed_nodes provide
        a `render` method that escapes HTML properly.
        (One option is to use templates.)

        Do NOT call this method directly, except for
        testing.  The vdom scheme expects you to use
        the `update` method.
    */
    const opts = tag.opts;
    const tag_name = tag.tag_name;
    const attr_str = opts.attrs
        .map((attr) => " " + attr[0] + '="' + _.escape(attr[1]) + '"')
        .join("");

    const start_tag = "<" + tag_name + attr_str + ">";
    const end_tag = "</" + tag_name + ">";

    if (opts.keyed_nodes === undefined) {
        blueslip.error("We need keyed_nodes to render innards.");
        return undefined;
    }

    const innards = opts.keyed_nodes.map((node) => node.render()).join("\n");
    return start_tag + "\n" + innards + "\n" + end_tag;
}

export function update_attrs(elem, new_attrs, old_attrs) {
    const new_dict = new Map(new_attrs);
    const old_dict = new Map(old_attrs);

    for (const [k, v] of new_attrs) {
        if (v !== old_dict.get(k)) {
            elem.attr(k, v);
        }
    }

    for (const [k] of old_attrs) {
        if (!new_dict.has(k)) {
            elem.removeAttr(k);
        }
    }
}

export function update(replace_content, find, new_dom, old_dom) {
    /*
        The update method allows you to continually
        update a "virtual" representation of your DOM,
        and then this method actually updates the
        real DOM using jQuery.  The caller will pass
        in a method called `replace_content` that will replace
        the entire html and a method called `find` to
        find the existing DOM for more surgical updates.

        The first "update" will be more like a create,
        because your `old_dom` should be undefined.
        After that initial call, it is important that
        you always pass in a correct value of `old_dom`;
        otherwise, things will be incredibly confusing.

        The basic scheme here is simple:

            1) If old_dom is undefined, we render
               everything for the first time.

            2) If the keys of your new children are no
               longer the same order as the old
               children, then we just render
               everything anew.
               (We may refine this in the future.)

            3) If your key structure remains the same,
               then we update your child nodes on
               a child-by-child basis, and we avoid
               updates where the data had remained
               the same.

        The key to making this all work is that
        `new_dom` should include a `keyed_nodes` option
        where each `keyed_node` has a `key` and supports
        these methods:

            eq - can compare itself to similar nodes
                 for data equality

            render - can create an HTML representation
                     of itself

        The `new_dom` should generally be created with
        something like `vdom.ul`, which will set a
        tag field internally and which will want options
        like `attrs` for attributes.

        For examples of creating vdom objects, look at
        `pm_list_dom.js`.
    */
    function do_full_update() {
        const rendered_dom = render_tag(new_dom);
        replace_content(rendered_dom);
    }

    if (old_dom === undefined) {
        do_full_update();
        return;
    }

    const new_opts = new_dom.opts;
    const old_opts = old_dom.opts;

    if (new_opts.keyed_nodes === undefined) {
        // We generally want to use vdom on lists, and
        // adding keys for children lets us avoid unnecessary
        // redraws (or lets us know we should just rebuild
        // the dom).
        blueslip.error("We need keyed_nodes for updates.");
        return;
    }

    const same_structure = eq_array(
        new_opts.keyed_nodes,
        old_opts.keyed_nodes,
        (a, b) => a.key === b.key,
    );

    if (!same_structure) {
        /* We could do something smarter like detecting row
           moves, but it's overkill for small lists.
        */
        do_full_update();
        return;
    }

    /*
        DO "QUICK" UPDATES:

        We've gotten this far, so we know we have the
        same overall structure for our parent tag, and
        the only thing left to do with our child nodes
        is to possibly update them in place (via jQuery).
        We will only update nodes whose data has changed.
    */

    const child_elems = find().children();

    for (const [i, new_node] of new_opts.keyed_nodes.entries()) {
        const old_node = old_opts.keyed_nodes[i];
        if (new_node.eq(old_node)) {
            continue;
        }
        const rendered_dom = new_node.render();
        child_elems.eq(i).replaceWith(rendered_dom);
    }

    update_attrs(find(), new_opts.attrs, old_opts.attrs);
}


text:
#ifndef _ASM_MACH_IP32_SPACES_H
#define _ASM_MACH_IP32_SPACES_H

/*
 * Memory above this physical address will be considered highmem.
 * Fixme: 59 bits is a fictive number and makes assumptions about processors
 * in the distant future.  Nobody will care for a few years :-)
 */
#ifndef HIGHMEM_START
#define HIGHMEM_START		(1UL << 59UL)
#endif

#define CAC_BASE		0x9800000000000000UL
#define IO_BASE			0x9000000000000000UL
#define UNCAC_BASE		0x9000000000000000UL
#define MAP_BASE		0xc000000000000000UL

#define TO_PHYS(x)		(             ((x) & TO_PHYS_MASK))
#define TO_CAC(x)		(CAC_BASE   | ((x) & TO_PHYS_MASK))
#define TO_UNCAC(x)		(UNCAC_BASE | ((x) & TO_PHYS_MASK))

/*
 * This handles the memory map.
 */
#define PAGE_OFFSET		CAC_BASE

#endif /* __ASM_MACH_IP32_SPACES_H */


text:
package com.tern.db;

import java.sql.ResultSet;
import java.sql.SQLException;

public interface RowMapper<T>
{
    T map(ResultSet rs, int rowNum) throws SQLException;
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using AInBox.Astove.Core.Filter;

namespace AInBox.Astove.Core.Options
{
    public class FilterOptions
    {
        public List<PropertyValue> Filters { get; set; }

        public FilterCondition[] GetFilterConditions(IRequestFilter cmd)
        {
            List<FilterCondition> conditions = new List<FilterCondition>();

            if (cmd != null && cmd.Fields != null)
            {
                for (int i = 0; i < cmd.Fields.Length; i++)
                    conditions.Add(
                        new FilterCondition
                        {
                            FilterType = cmd.FiltersType[i],
                            Property = cmd.Fields[i],
                            DisplayName = this.GetDisplayName(cmd.Fields[i]),
                            DefaultOperator = int.Parse(cmd.Operators[i]),
                            DisplayOperator = this.GetDisplayOperator(cmd.Fields[i], cmd.Operators[i]),
                            DefaultValue = cmd.Values[i],
                            DisplayValue = this.GetDisplayValue(cmd.FiltersType[i], cmd.Fields[i], cmd.Values[i]),
                            FilterExistsColumn = (cmd.ExistsColumns != null) ? cmd.ExistsColumns[i] : string.Empty
                        });

                conditions.AddRange(GetInternalFilterConditions(cmd));
            }
            else if (cmd == null || cmd.HasDefaultConditions || cmd.FilterInternalDictionary.Count > 0)
            {
                conditions = this.GetDefaultFilterConditions(cmd);
            }

            return (conditions != null) ? conditions.ToArray() : new FilterCondition[0];
        }

        private string GetDisplayName(string propertyName)
        {
            PropertyValue pv = this.Filters.FirstOrDefault(f => f.Property.Equals(propertyName));
            return pv.DisplayName;
        }

        private string GetDisplayOperator(string propertyName, string operatorValue)
        {
            PropertyValue pv = this.Filters.FirstOrDefault(f => f.Property.Equals(propertyName));
            return pv.Operators[int.Parse(operatorValue)].Value;
        }

        private string GetDisplayValue(string filterType, string propertyName, string value)
        {
            if (string.IsNullOrEmpty(value) || value.Equals("null", StringComparison.InvariantCultureIgnoreCase))
                return string.Empty;

            string displayValue = string.Empty;

            PropertyValue pv = this.Filters.FirstOrDefault(f => f.Property.Equals(propertyName));
            if (pv.DomainValues != null)
            {
                var domainValue = pv.DomainValues.FirstOrDefault(d => d.Key == int.Parse(value));
                displayValue = domainValue.Value;
            }
            else if (filterType.Equals("DateFilter", StringComparison.InvariantCultureIgnoreCase))
            {
                var date = (DateTime)Convert.ChangeType((object)value.Replace("\"", ""), typeof(DateTime));
                displayValue = date.ToString("dd/MM/yyyy");
            }
            else
            {
                displayValue = value;
            }

            return displayValue;
        }

        private List<FilterCondition> GetDefaultFilterConditions(IRequestFilter cmd)
        {
            var filters = this.Filters.Where(p => p.PreLoaded == true || p.Internal==true).ToList();
            var conditions = new List<FilterCondition>();

            if (filters.Count == 0)
                return conditions;

            foreach (PropertyValue value in filters)
                if (value.Internal == false)
                    conditions.Add(this.GetFilterCondition(value, null));

            conditions.AddRange(GetInternalFilterConditions(cmd));

            return conditions;
        }

        private List<FilterCondition> GetInternalFilterConditions(IRequestFilter cmd)
        {
            var filters = this.Filters.Where(p => p.Internal == true).ToList();
            var conditions = new List<FilterCondition>();

            if (filters.Count == 0 || cmd == null || cmd.FilterInternalDictionary.Count==0)
                return conditions;

            foreach (PropertyValue value in filters)
            {
                string key = (string)value.DefaultValue;
                conditions.Add(this.GetFilterCondition(value, cmd.FilterInternalDictionary[key]));
            }

            return conditions;
        }

        private FilterCondition GetFilterCondition(PropertyValue value, object defaultValue)
        {
            FilterCondition obj = new FilterCondition();

            Type t = obj.GetType();
            Type c = value.GetType();
            foreach (var propInfo in t.GetProperties())
                if (c.GetProperty(propInfo.Name) != null)
                    propInfo.SetValue(obj, c.GetProperty(propInfo.Name).GetValue(value, null), null);

            if (defaultValue != null)
                obj.DefaultValue = defaultValue;

            obj.DisplayOperator = this.Filters.FirstOrDefault(f => f.Property.Equals(value.Property)).Operators[obj.DefaultOperator].Value;

            KeyValue[] domainValues = this.Filters.FirstOrDefault(f => f.Property.Equals(value.Property)).DomainValues;
            if (domainValues != null)
            {
                if (string.IsNullOrEmpty(Convert.ToString(obj.DefaultValue)))
                    obj.DisplayValue = Convert.ToString(obj.DefaultValue);
                else
                    obj.DisplayValue = domainValues[Convert.ToInt32(obj.DefaultValue)].Value;
            }
            else
            {
                obj.DisplayValue = string.Empty;
                if (obj.DefaultValue != null)
                    obj.DisplayValue = Convert.ToString(obj.DefaultValue);
            }

            return obj;
        }
    }
}


text:
namespace clang {
namespace clangd {

class IgnoreDiagnostics : public DiagnosticConsumer {
public:
  static void log(DiagnosticsEngine::Level DiagLevel,
                  const clang::Diagnostic &Info);

  void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
                        const clang::Diagnostic &Info) override;
};

// Options to run clang e.g. when parsing AST.
struct ParseOptions {
  tidy::ClangTidyOptions ClangTidyOpts;
  bool SuggestMissingIncludes = false;
};

/// Information required to run clang, e.g. to parse AST or do code completion.
struct ParseInputs {
  tooling::CompileCommand CompileCommand;
  IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS;
  std::string Contents;
  // Used to recover from diagnostics (e.g. find missing includes for symbol).
  const SymbolIndex *Index = nullptr;
  ParseOptions Opts;
};

/// Builds compiler invocation that could be used to build AST or preamble.
std::unique_ptr<CompilerInvocation>
buildCompilerInvocation(const ParseInputs &Inputs,
                        clang::DiagnosticConsumer &D);

/// Creates a compiler instance, configured so that:
///   - Contents of the parsed file are remapped to \p MainFile.
///   - Preamble is overriden to use PCH passed to this function. It means the
///     changes to the preamble headers or files included in the preamble are
///     not visible to this compiler instance.
///   - llvm::vfs::FileSystem is used for all underlying file accesses. The
///     actual vfs used by the compiler may be an overlay over the passed vfs.
/// Returns null on errors. When non-null value is returned, it is expected to
/// be consumed by FrontendAction::BeginSourceFile to properly destroy \p
/// MainFile.
std::unique_ptr<CompilerInstance> prepareCompilerInstance(
    std::unique_ptr<clang::CompilerInvocation>, const PrecompiledPreamble *,
    std::unique_ptr<llvm::MemoryBuffer> MainFile,
    IntrusiveRefCntPtr<llvm::vfs::FileSystem>, DiagnosticConsumer &);

} // namespace clangd
} // namespace clang

#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_COMPILER_H


text:
#ifndef _XSECOBJ_H
#define _XSECOBJ_H

#include "children.h"

/*
 *	Dialogs.
 */

typedef struct {
	ButtonParentObjectType	modelpm;	/* Numerical model	*/
	char			*model_label;	/* Numerical model	*/
	ButtonParentObjectType	vcoordpm;	/* Vertical coordinate	*/
	TextFieldObjectType	vcoord;		/* Vertical coordinate	*/
	TextFieldObjectType	level1;		/* Level 1 		*/
	TextFieldObjectType	level2;		/* Level 2		*/
	TextFieldObjectType	xsection;	/* Cross section	*/
	ButtonParentObjectType	scalarpm;	/* Scalar pulldown menu */
	ButtonParentObjectType	vectorpm;	/* Vector pulldown menu */
	LabelObjectType		fdf;		/* Fld Description File */
	ListParentObjectType	time_list;	/* List of date/times	*/
	ListIndexObjectType	match_list;	/* Time matched indices */
	ListIndexObjectType	select_list;	/* Selected indices     */
	ListParentObjectType	scalar_list;	/* Scalar fields 	*/
	ListParentObjectType	vector_list;	/* Vector fields	*/
	ScrolledWObjectType	field_info;	/* Field description	*/
	TextFieldObjectType	func_string;	/* Function text field	*/
	TextFieldObjectType	cint;		/* Contour interval     */
	TextFieldObjectType	cmin;		/* Contour maximum      */
	TextFieldObjectType	cmax;		/* Contour maximum      */
	LabelObjectType		line_color;	/* Contour line color	*/
	ButtonParentObjectType	line_type_pm;	/* Contour line type	*/
	LabelObjectType		line_width;	/* Contour line width	*/
	ButtonParentObjectType	label_freq_pm;	/* Label frequency	*/
	ButtonObject		scalar_b;	/* Scalar radio button	*/
	ButtonObject		vector_b;	/* Vector radio button	*/
	TextFieldObjectType	fint;		/* Color fill interval	*/
	TextFieldObjectType	fmin;		/* Color fill minimum	*/
	TextFieldObjectType	fmax;		/* Color fill maximum	*/
	ButtonParentObjectType  color_fillpm;   /* Fill colors          */
	LabelObjectType		fill_color;	/* Fill colors		*/
	ToggleButtonObjectType	line_toggle1;	/* Plot contour lines	*/
	ToggleButtonObjectType	line_toggle2;	/* Plot contour lines	*/
	ToggleButtonObjectType	fill_toggle1;	/* Plot color fill	*/
	ToggleButtonObjectType	fill_toggle2;	/* Plot color fill	*/
	ToggleButtonObjectType	symbol_toggle1;	/* Plot symbols		*/
	ToggleButtonObjectType	symbol_toggle2;	/* Plot symbols		*/
	int			plot_type;	/* Scalar or vector 	*/
	ButtonParentObjectType	axis_type_pm;	/* Vertical axis	*/
	ButtonParentObjectType	vector_sym_pm;	/* Wind symbol          */
	TextFieldObjectType	scale;		/* Scale factor		*/
	LabelObjectType		timelistlbl;	/* Time list label	   */
	Widget			main_dialog;	/* main dialog 		   */
} GuiXSectionDialogType;

GuiXSectionDialogType *GetGuiXSectionDialog();

#define SetModelTypePmXSW(x,c)		((x)->modelpm.parent=(c))
#define GetModelTypePmXSW(x)		((x)->modelpm.parent)
#define SetModelTypeOmXSW(x,c)		((x)->modelpm.menu=(c))
#define GetModelTypeOmXSW(x)		((x)->modelpm.menu)
#define SetModelTypeXS(x,c)		((x)->modelpm.string = (c) ?	\
					 strdup(c) : (c))
#define GetModelTypeXS(x)		((x)->modelpm.string)
#define FreeModelTypeXS(x)		((x)->modelpm.string ?		\
					 free((x)->modelpm.string) : (void) 1)

#define SetModelLabelTypeXS(x,c)	((x)->model_label = (c) ? strdup(c) : (c))
#define GetModelLabelTypeXS(x)		((x)->model_label)
#define FreeModelLabelTypeXS(x)		((x)->model_label ? 		\
					 free((x)->model_label) : (void)1 )

#define SetModelVCoordPmXSW(x,c)	((x)->vcoordpm.parent=(c))
#define GetModelVCoordPmXSW(x)		((x)->vcoordpm.parent)
#define SetModelVCoordOmXSW(x,c)	((x)->vcoordpm.menu=(c))
#define GetModelVCoordOmXSW(x)		((x)->vcoordpm.menu)
#define SetModelVCoordXS(x,c)		((x)->vcoordpm.string = (c) ?	\
					 strdup(c) : (c))
#define GetModelVCoordXS(x)		((x)->vcoordpm.string)
#define FreeModelVCoordXS(x)		((x)->vcoordpm.string ?		\
					 free((x)->vcoordpm.string) : (void) 1)

#define SetModelVCoordXSW(x,c)		((x)->vcoord.w=(c))
#define GetModelVCoordXSW(x)		((x)->vcoord.w)

#define SetLevel1XSW(x,c)		((x)->level1.w=(c))
#define GetLevel1XSW(x)			((x)->level1.w)
#define SetLevel1XS(x,c)		((x)->level1.string = (c) ?	\
					 strdup(c) : (c))
#define GetLevel1XS(x)			((x)->level1.string)
#define FreeLevel1XS(x)			((x)->level1.string ?		\
					 free((x)->level1.string) : (void) 1)

#define SetLevel2XSW(x,c)		((x)->level2.w=(c))
#define GetLevel2XSW(x)			((x)->level2.w)
#define SetLevel2XS(x,c)		((x)->level2.string = (c) ?	\
					 strdup(c) : (c))
#define GetLevel2XS(x)			((x)->level2.string)
#define FreeLevel2XS(x)			((x)->level2.string ?		\
					 free((x)->level2.string) : (void) 1)

#define SetXSectionXSW(x,c)		((x)->xsection.w=(c))
#define GetXSectionXSW(x)		((x)->xsection.w)
#define SetXSectionXS(x,c)		((x)->xsection.string = (c) ?	\
					 strdup(c) : (c))
#define GetXSectionXS(x)		((x)->xsection.string)
#define FreeXSectionXS(x)		((x)->xsection.string ?		\
					 free((x)->xsection.string) : (void) 1)

#define SetModelScalarPmXSW(x,c)	((x)->scalarpm.parent=(c))
#define GetModelScalarPmXSW(x)		((x)->scalarpm.parent)
#define SetModelScalarOmXSW(x,c)	((x)->scalarpm.menu=(c))
#define GetModelScalarOmXSW(x)		((x)->scalarpm.menu)
#define SetModelXSScalarDir(x,c)	((x)->scalarpm.string = (c) ?	\
					 strdup(c) : (c))
#define GetModelXSScalarDir(x)		((x)->scalarpm.string)
#define FreeModelXSScalarDir(x)		((x)->scalarpm.string ?		\
					 free((x)->scalarpm.string) : (void) 1)

#define SetModelVectorPmXSW(x,c)	((x)->vectorpm.parent=(c))
#define GetModelVectorPmXSW(x)		((x)->vectorpm.parent)
#define SetModelXSVectorDir(x,c)	((x)->vectorpm.string = (c) ?	\
					 strdup(c) : (c))
#define GetModelXSVectorDir(x)		((x)->vectorpm.string)
#define FreeModelXSVectorDir(x)		((x)->vectorpm.string ?		\
					 free((x)->vectorpm.string) : (void) 1)

#define SetModelFdfXSW(x,c)		((x)->fdf.w=(c))
#define GetModelFdfXSW(x)		((x)->fdf.w)
#define SetModelFdfXS(x,c)		((x)->fdf.string = (c) ?	\
					 strdup(c) : (c))
#define GetModelFdfXS(x)		((x)->fdf.string)
#define FreeModelFdfXS(x)		((x)->fdf.string ?		\
					 free((x)->fdf.string) : (void) 1)

#define SetContourIntervalXSW(x,c)	((x)->cint.w=(c))
#define GetContourIntervalXSW(x)	((x)->cint.w)
#define SetContourIntervalXS(x,c)	((x)->cint.string = (c) ?	\
					 strdup(c) : (c))
#define GetContourIntervalXS(x)		((x)->cint.string)
#define FreeContourIntervalXS(x)	((x)->cint.string ?		\
					 free((x)->cint.string) : (void) 1)

#define SetContourMinimumXSW(x,c)	((x)->cmin.w=(c))
#define GetContourMinimumXSW(x)		((x)->cmin.w)
#define SetContourMinimumXS(x,c)	((x)->cmin.string = (c) ?	\
					 strdup(c) : (c))
#define GetContourMinimumXS(x)		((x)->cmin.string)
#define FreeContourMinimumXS(x)		((x)->cmin.string ?		\
					 free((x)->cmin.string) : (void) 1)

#define SetContourMaximumXSW(x,c)	((x)->cmax.w=(c))
#define GetContourMaximumXSW(x)		((x)->cmax.w)
#define SetContourMaximumXS(x,c)	((x)->cmax.string = (c) ?	\
					 strdup(c) : (c))
#define GetContourMaximumXS(x)		((x)->cmax.string)
#define FreeContourMaximumXS(x)		((x)->cmax.string ?		\
					 free((x)->cmax.string) : (void) 1)

#define SetModelScrolledListXSW(x,c)	((x)->time_list.w=(c))
#define GetModelScrolledListXSW(x)	((x)->time_list.w)

#define SetScalarListXSW(x,c)		((x)->scalar_list.w=(c))
#define GetScalarListXSW(x)		((x)->scalar_list.w)

#define SetVectorListXSW(x,c)		((x)->vector_list.w=(c))
#define GetVectorListXSW(x)		((x)->vector_list.w)

#define SetFieldInfoXSW(x,c)		((x)->field_info.w=(c))
#define GetFieldInfoXSW(x)		((x)->field_info.w)
#define SetFieldInfoXS(x,c)		((x)->field_info.string = (c) ?	\
					 strdup(c) : (c))
#define GetFieldInfoXS(x)		((x)->field_info.string)
#define FreeFieldInfoXS(x)		((x)->field_info.string ?	\
					 free((x)->field_info.string) : (void) 1)

#define SetFunctionXSW(x,c)		((x)->func_string.w=(c))
#define GetFunctionXSW(x)		((x)->func_string.w)
#define SetFunctionXS(x,c)		((x)->func_string.string = (c) ? \
				         strdup(c) : (c))
#define GetFunctionXS(x)		((x)->func_string.string)
#define FreeFunctionXS(x)		((x)->func_string.string ?	 \
				         free((x)->func_string.string) : (void) 1)

#define SetLineColorXS(x,c)		((x)->line_color.string = (c) ?	\
					 strdup(c) : (c))
#define GetLineColorXS(x)		((x)->line_color.string)
#define FreeLineColorXS(x)		((x)->line_color.string ?	\
					 free((x)->line_color.string) : (void) 1)

#define SetLineTypePmXSW(x,c)		((x)->line_type_pm.parent=(c))
#define GetLineTypePmXSW(x)		((x)->line_type_pm.parent)
#define SetLineTypeOmXSW(x,c)		((x)->line_type_pm.menu=(c))
#define GetLineTypeOmXSW(x)		((x)->line_type_pm.menu)
#define SetLineTypeXS(x,c)		((x)->line_type_pm.string = (c) ? \
				         strdup(c) : (c))
#define GetLineTypeXS(x)		((x)->line_type_pm.string)
#define FreeLineTypeXS(x)		((x)->line_type_pm.string ?	  \
					 free((x)->line_type_pm.string) : (void) 1)

#define SetLineWidthXS(x,c)		((x)->line_width.string = (c) ?	\
					 strdup(c) : (c))
#define GetLineWidthXS(x)		((x)->line_width.string)
#define FreeLineWidthXS(x)		((x)->line_width.string ?	\
					 free((x)->line_width.string) : (void) 1)

#define SetLabelFrequencyPmXSW(x,c)	((x)->label_freq_pm.parent=(c))
#define GetLabelFrequencyPmXSW(x)	((x)->label_freq_pm.parent)
#define SetLabelFrequencyOmXSW(x,c)	((x)->label_freq_pm.menu=(c))
#define GetLabelFrequencyOmXSW(x)	((x)->label_freq_pm.menu)
#define SetLabelFrequencyXS(x,c)	((x)->label_freq_pm.string = (c) ? \
					 strdup(c) : (c))
#define GetLabelFrequencyXS(x)		((x)->label_freq_pm.string)
#define FreeLabelFrequencyXS(x)		((x)->label_freq_pm.string ?	   \
					 free((x)->label_freq_pm.string) : (void) 1)

#define SetFillColorsXSW(x,c)		((x)->color_fillpm.parent=(c))
#define GetFillColorsXSW(x)		((x)->color_fillpm.parent)

#define SetFillColorsXS(x,c)		((x)->fill_color.string = (c) ?	\
					 strdup(c) : (c))
#define GetFillColorsXS(x)		((x)->fill_color.string)
#define FreeFillColorsXS(x)		((x)->fill_color.string ?	\
					 free((x)->fill_color.string) : (void) 1)

#define SetModelScalarButtonXSW(x,c)	((x)->scalar_b.w=(c))
#define GetModelScalarButtonXSW(x)	((x)->scalar_b.w)

#define SetModelVectorButtonXSW(x,c)	((x)->vector_b.w=(c))
#define GetModelVectorButtonXSW(x)	((x)->vector_b.w)

#define SetFillIntervalXSW(x,c)		((x)->fint.w=(c))
#define GetFillIntervalXSW(x)		((x)->fint.w)
#define SetFillIntervalXS(x,c)		((x)->fint.string = (c) ?	\
					 strdup(c) : (c))
#define GetFillIntervalXS(x)		((x)->fint.string)
#define FreeFillIntervalXS(x)		((x)->fint.string ?		\
					 free((x)->fint.string) : (void) 1)

#define SetFillMinimumXSW(x,c)		((x)->fmin.w=(c))
#define GetFillMinimumXSW(x)		((x)->fmin.w)
#define SetFillMinimumXS(x,c)		((x)->fmin.string = (c) ?	\
					 strdup(c) : (c))
#define GetFillMinimumXS(x)		((x)->fmin.string)
#define FreeFillMinimumXS(x)		((x)->fmin.string ?		\
					 free((x)->fmin.string) : (void) 1)

#define SetFillMaximumXSW(x,c)		((x)->fmax.w=(c))
#define GetFillMaximumXSW(x)		((x)->fmax.w)
#define SetFillMaximumXS(x,c)		((x)->fmax.string = (c) ?	\
					 strdup(c) : (c))
#define GetFillMaximumXS(x)		((x)->fmax.string)
#define FreeFillMaximumXS(x)		((x)->fmax.string ?		\
					 free((x)->fmax.string) : (void) 1)

#define SetLineToggleXSW1(x,c)		((x)->line_toggle1.w=(c))
#define GetLineToggleXSW1(x)		((x)->line_toggle1.w)
#define SetLineToggleXSW2(x,c)		((x)->line_toggle2.w=(c))
#define GetLineToggleXSW2(x)		((x)->line_toggle2.w)

#define SetFillToggleXSW1(x,c)		((x)->fill_toggle1.w=(c))
#define GetFillToggleXSW1(x)		((x)->fill_toggle1.w)
#define SetFillToggleXSW2(x,c)		((x)->fill_toggle2.w=(c))
#define GetFillToggleXSW2(x)		((x)->fill_toggle2.w)

#define SetSymbolToggleXSW1(x,c)	((x)->symbol_toggle1.w=(c))
#define GetSymbolToggleXSW1(x)		((x)->symbol_toggle1.w)
#define SetSymbolToggleXSW2(x,c)	((x)->symbol_toggle2.w=(c))
#define GetSymbolToggleXSW2(x)		((x)->symbol_toggle2.w)

#define SetXSGridType(x,c)		((x)->plot_type=(c))
#define GetXSGridType(x)		((x)->plot_type)

#define SetAxisTypePmXSW(x,c)		((x)->axis_type_pm.parent=(c))
#define GetAxisTypePmXSW(x)		((x)->axis_type_pm.parent)
#define SetAxisTypeOmXSW(x,c)		((x)->axis_type_pm.menu=(c))
#define GetAxisTypeOmXSW(x)		((x)->axis_type_pm.menu)
#define SetAxisTypeXS(x,c)		((x)->axis_type_pm.string = (c) ? \
					 strdup(c) : (c))
#define GetAxisTypeXS(x)		((x)->axis_type_pm.string)
#define FreeAxisTypeXS(x)		((x)->axis_type_pm.string ?	  \
					 free((x)->axis_type_pm.string) : (void) 1)

#define SetVectorSymbolPmXSW(x,c)	((x)->vector_sym_pm.parent=(c))
#define GetVectorSymbolPmXSW(x)		((x)->vector_sym_pm.parent)
#define SetVectorSymbolOmXSW(x,c)	((x)->vector_sym_pm.menu=(c))
#define GetVectorSymbolOmXSW(x)		((x)->vector_sym_pm.menu)
#define SetVectorSymbolXS(x,c)		((x)->vector_sym_pm.string = (c) ? \
					 strdup(c) : (c))
#define GetVectorSymbolXS(x)		((x)->vector_sym_pm.string)
#define FreeVectorSymbolXS(x)		((x)->vector_sym_pm.string ?	   \
					 free((x)->vector_sym_pm.string) : (void) 1)

#define SetScaleFactorXSW(x,c)		((x)->scale.w=(c))
#define GetScaleFactorXSW(x)		((x)->scale.w)
#define SetScaleFactorXS(x,c)		((x)->scale.string = (c) ?	\
					 strdup(c) : (c))
#define GetScaleFactorXS(x)		((x)->scale.string)
#define FreeScaleFactorXS(x)		((x)->scale.string ?		\
					 free((x)->scale.string) : (void) 1)

#define	SetModelCSTimeListLabelW(s,c)	((s)->timelistlbl.w=(c))
#define	GetModelCSTimeListLabelW(s)	((s)->timelistlbl.w)

#define	SetModelXSDialogW(s,c)		((s)->main_dialog=(c))
#define	GetModelXSDialogW(s)		((s)->main_dialog)

#endif  /*   _XSECOBJ_H   */