text:
package org.slc.sli.entity;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.slc.sli.util.Constants;

/**
 * Simple application entity
 *
 * @author David Wu
 * @author Robert Bloh
 *
 */
public class GenericEntity extends LinkedHashMap<String, Object> {

    private static final long serialVersionUID = -1398693068211322783L;

    public GenericEntity() {
        super();
    }

    public GenericEntity(Map<String, Object> map) {
        super(map);
    }

    public String getId() {
        return getString(Constants.ATTR_ID);
    }

    public String getString(String key) {
        return (String) (get(key));
    }

    @SuppressWarnings("rawtypes")
    public List getList(String key) {
        @SuppressWarnings("unchecked")
        List<Object> list = (List<Object>) (get(key));
        return list == null ? Collections.emptyList() : list;
    }

    public void appendToList(String key, GenericEntity obj) {
        if (!containsKey(key)) {
            put(key, new ArrayList<GenericEntity>());
        }
        @SuppressWarnings("unchecked")
        List<GenericEntity> list = (List<GenericEntity>) get(key);
        list.add(obj);
        put(key, list);
    }
}


text:
#include "app.h"

#include <cstdio>
#include <cctype>

#include <list>
#include <string>
#include <iostream>
#include <sstream>
#include <stdexcept>

#include "global.h"
#include "scanner.h"
#include "engine.h"
#include "terminal.h"
#include "utils.h"
#include "file.h"
#include "storage.h"

namespace {
  const char RESET[] = "\x1b[0m";
  const char RED[]     = "\x1b[31m";
  const char GREEN[]   = "\x1b[32m";
  const char YELLOW[]  = "\x1b[33m";
  const char BLUE[]    = "\x1b[34m";
  const char MAGENTA[] = "\x1b[35m";
  const char CYAN[]    = "\x1b[36m";

  std::string colorize_filename (const std::string &str, const char* color) {
    size_t found = str.find_last_of("/\\");

    std::stringstream colorized;
    colorized << color << str.substr(found+1) << RESET;

    std::string cstr(str);
    cstr.replace(found+1, str.length()-1, colorized.str());

    return cstr;
  }

  std::vector<std::string> split(const std::string &s, char delim) {
    std::vector<std::string> elems;
    std::stringstream ss(s);
    std::string item;
    while(std::getline(ss, item, delim)) {
      elems.push_back(item);
    }
    return elems;
  }
}

/**
 * Overloading of ostream operator<< to print a duplicate
 */
std::ostream& operator<< (std::ostream &out, const findd::duplicate &d) {
  for (int i = 0; i < d.size(); i++) {
    const findd::File &file = d[i];
    out << "#" << i+1 << " " << file.path() << std::endl;
  }
  return out;
}

namespace findd {

  using std::vector;
  using std::string;
  using std::cout; using std::cerr; using std::cin; using std::endl;
  using utils::Timer;
  using utils::Logger;

  App::App () {}

  App::~App () {}

  void App::execute () {
    char logmsg[200];
    file_list files;
    Storage storage;
    Logger *logger = Logger::instance();

    if (_env.in_scan_file.empty() == false) {

      // ------------------------------------------------------------------------
      // Restore backup
      // ------------------------------------------------------------------------

      files = storage.restore(_env.in_scan_file);
      sprintf(logmsg, "restored scan from %s", _env.in_scan_file.c_str());
      logger->info(logmsg);
    } else {

      if (_env.directories.empty() == false) {

        // ------------------------------------------------------------------------
        // Scan directories
        // ------------------------------------------------------------------------
        Timer t; t.start();
        Scanner scanner;

        logger->info("starting scanning directories");
        for (unsigned int i = 0; i < _env.directories.size(); i++)
          scanner.scan(_env.directories[i], _env.include_hidden, _env.recursive, _env.force);
        t.stop();

        files = scanner.files();
        sprintf(logmsg, "done scanning %i files",(int)files.size());
        logger->info(logmsg);

        cerr << "Scanned " << files.size() << " files (" << scanner.total_bytes_scanned() << " bytes) in " << t.elapsed() << " seconds" << endl;

        // ------------------------------------------------------------------------
        // Save scan result
        // ------------------------------------------------------------------------

        if (_env.out_scan_file.empty() == false) {
          storage.persist(files, _env.out_scan_file);
          sprintf(logmsg, "saved scan result into %s", _env.out_scan_file.c_str());
          logger->info(logmsg);
        }
      } else {
        logger->error("no files entry (directories or backup file) was specified");
        throw std::logic_error("findd : no input parameter was specified to get files");
      }
    }

    if (_env.comparator.mode() == 0) return; // do not search duplicates without filter settings

    // ------------------------------------------------------------------------
    // Search for duplicates
    // ------------------------------------------------------------------------

    sprintf(logmsg, "search duplicates with mode : %i", _env.comparator.mode());
    logger->info(logmsg);

    Engine engine;
    engine.search(files, _env.comparator);

    const duplicate_list &dups = engine.duplicates();
    cerr << "Found " << dups.size() << " duplicates" << endl << endl;

    // print duplicates
    for (int i = 0; i < dups.size(); i++) {
      const duplicate &dup = dups[i];
      cout << dup << endl;
      if (_env.remove)
        ask_for_duplicate_removal(dup);
    }

    // Statistics
    long gain_avg = (engine.get_min_gain_of_bytes() + engine.get_max_gain_of_bytes()) / 2;
    cerr << "Average size of duplicates into the memory space : " << gain_avg << " bytes" << endl;
  }

  void App::ask_for_duplicate_removal (const duplicate &d) const {
    Logger *logger = Logger::instance();
    string answer;
    cerr << "enter the file numbers you want to remove separated by a comma : ";
    cin >> answer;
    cerr << endl;

    vector<string> files_to_del = split(answer, ',');

    for (int i = 0; i < files_to_del.size(); i++) {
      unsigned int num;
      std::stringstream ssnum(files_to_del[i]);
      ssnum >> num;
      if (num >= d.size()) continue;
      d[num].drop();

      char logmsg[200];
      sprintf(logmsg, "removed file %s", d[num].path().c_str());
      logger->info(logmsg);
    }
  }

  env_t & App::env () { return _env; }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">

<link rel="stylesheet" href="css/poole.css">
<link rel="stylesheet" href="css/syntax.css">
<link rel="stylesheet" href="css/hyde.css">
<link rel="stylesheet" href="css/theme.css">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=PT+Sans:400,700|Russo+One">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
<link href="//block.blokada.org/favicon.png" rel="icon">

Vo vašom zariadení máte nainštalované niekoľko verzií Blokada. Chcete ponechať najlepšiu verziu a zvyšné odinštalovať?


text:
require 'date_time_precision/format/hash'

if defined?(ActiveSupport)
  require 'active_support/json/encoding'

  [Date, Time, DateTime].each do |klass|
    klass.class_eval do
      def as_json(*args)
        to_h
      end

      def to_json(opts = {})
        to_h.to_json(opts)
      end
    end
  end
end

module DateTimePrecision
  def as_json(*args)
    to_h
  end

  def to_json(opts = {})
    to_h.to_json(opts)
  end
end


text:
package com.netuitive.iris.entity.wrapper;

import java.util.HashMap;
import java.util.Map;
import lombok.Data;

/**
 *
 * @author john.king
 */
@Data
public class MetricMetaWrapper {

    private String id;
    private String fqn;
    private Map<String, Object> state = new HashMap<String, Object>();
    private Map<String, Object> configuration = new HashMap<String, Object>();
}


text:
const { randomBytes, createCipheriv } = require('crypto')

const { defaults, httpCodes } = require('server/utils/constants')
const {
  httpResponse,
  executeCommand,
  getSunstoneAuth,
} = require('server/utils/server')
const { getSunstoneConfig } = require('server/utils/yml')
const { Actions: userActions } = require('server/utils/constants/commands/user')
const { Actions: vmActions } = require('server/utils/constants/commands/vm')
const { createTokenServerAdmin } = require('server/routes/api/auth/utils')

const { USER_INFO } = userActions
const { VM_INFO } = vmActions

const { ok, unauthorized, internalServerError, badRequest } = httpCodes
const { defaultEmptyFunction, defaultCommandVM, defaultTypeCrypto } = defaults

const appConfig = getSunstoneConfig()
const prependCommand = appConfig.sunstone_prepend || ''
const regexpSplitLine = /\r|\n/

/**
 * Save as template.
 *
 * @param {object} res - http response
 * @param {Function} next - express stepper
 * @param {object} params - params of http request
 * @param {object} userData - user of http request
 */
const saveAsTemplate = (
  res = {},
  next = defaultEmptyFunction,
  params = {},
  userData = {}
) => {
  let rtn = httpResponse(badRequest, '', '')
  const { id, name, persistent } = params
  if (id && name) {
    let message = ''
    const paramsCommand = ['save', `${id}`, `${name}`]

    if (persistent && persistent === 'true') {
      paramsCommand.push('--persistent')
    }

    const executedCommand = executeCommand(
      defaultCommandVM,
      paramsCommand,
      prependCommand
    )

    const response = executedCommand.success ? ok : internalServerError

    if (executedCommand.data) {
      message = executedCommand.data.replace(regexpSplitLine, '')
    }
    rtn = httpResponse(response, message)
  }
  res.locals.httpCode = rtn
  next()
}

/**
 * Generates a session to connect a VM by id through Guacamole.
 *
 * @param {object} res - http response
 * @param {Function} next - express stepper
 * @param {object} params - params of http request
 * @param {string} params.id - VM id
 * @param {'vnc'|'ssh'|'rdp'} params.type - Type connection
 * @param {object} userData - user of http request
 * @param {Function} xmlrpc - XML-RPC function
 */
const generateGuacamoleSession = (
  res = {},
  next = defaultEmptyFunction,
  params = {},
  userData = {},
  xmlrpc = defaultEmptyFunction
) => {
  const { id: userAuthId } = userData
  const { id: vmId, type } = params
  const ensuredType = `${type}`.toLowerCase()

  if (!['vnc', 'ssh', 'rdp'].includes(ensuredType)) {
    const messageError = "Type connection isn't supported by Guacamole"
    res.locals.httpCode = httpResponse(badRequest, messageError)
    next()
  }

  const serverAdmin = getSunstoneAuth() ?? {}
  const { token: authToken } = createTokenServerAdmin(serverAdmin) ?? {}

  if (!authToken) {
    res.locals.httpCode = httpResponse(badRequest, '')
    next()
  }

  const { username } = serverAdmin
  const oneClient = xmlrpc(`${username}:${username}`, authToken)

  // get authenticated user
  oneClient({
    action: USER_INFO,
    parameters: [parseInt(userAuthId, 10), true],
    callback: (userInfoErr, { USER } = {}) => {
      if (userInfoErr || !USER) {
        res.locals.httpCode = httpResponse(badRequest, userInfoErr)
        next()
      }

      // get VM information by id
      oneClient({
        action: VM_INFO,
        parameters: [parseInt(vmId, 10), true],
        callback: (vmInfoErr, { VM } = {}) => {
          if (vmInfoErr || !VM) {
            res.locals.httpCode = httpResponse(unauthorized, vmInfoErr)
            next()
          }

          const settings = {
            vnc: () => getVncSettings(VM),
            ssh: () => getSshSettings(VM, USER),
            rdp: () => getRdpSettings(VM),
          }[ensuredType]?.() ?? { error: '' }

          if (settings.error) {
            res.locals.httpCode = httpResponse(badRequest, settings.error)
            next()
          }

          // const minutesToAdd = 1
          // const currentDate = new Date()
          // const expiration = currentDate.getTime() + minutesToAdd * 60000

          const connection = {
            // expiration,
            connection: {
              type: ensuredType,
              settings: {
                security: 'any',
                'ignore-cert': 'true',
                'enable-drive': 'true',
                'create-drive-path': 'true',
                ...settings,
              },
            },
          }

          const wsToken = JSON.stringify(encryptConnection(connection))
          const encodedWsToken = Buffer.from(wsToken).toString('base64')

          res.locals.httpCode = httpResponse(ok, encodedWsToken)
          next()
        },
      })
    },
  })
}

const getVncSettings = (vmInfo) => {
  const config = {}

  if (`${vmInfo.USER_TEMPLATE?.HYPERVISOR}`.toLowerCase() === 'vcenter') {
    const esxHost = vmInfo?.MONITORING?.VCENTER_ESX_HOST

    if (!esxHost) {
      return {
        error: `Could not determine the vCenter ESX host where
        the VM is running. Wait till the VCENTER_ESX_HOST attribute is
        retrieved once the host has been monitored`,
      }
    }

    config.hostname = esxHost
  }

  if (!config.hostname) {
    const lastHistory = [vmInfo.HISTORY_RECORDS?.HISTORY ?? []].flat().at(-1)
    config.hostname = lastHistory?.HOSTNAME ?? 'localhost'
  }

  config.port = vmInfo.TEMPLATE?.GRAPHICS?.PORT ?? '5900'
  config.password = vmInfo.TEMPLATE?.GRAPHICS?.PASSWD ?? null

  return config
}

const getSshSettings = (vmInfo, authUser) => {
  const config = {}

  const nics = [
    vmInfo.TEMPLATE?.NIC ?? [],
    vmInfo.TEMPLATE?.NIC_ALIAS ?? [],
  ].flat()

  const nicWithExternalPortRange = nics.find((nic) => !nic.EXTERNAL_PORT_RANGE)
  const { EXTERNAL_PORT_RANGE } = nicWithExternalPortRange ?? {}

  if (EXTERNAL_PORT_RANGE) {
    const lastHistory = [vmInfo.HISTORY_RECORDS?.HISTORY ?? []].flat().at(-1)
    const lastHostname = lastHistory?.HOSTNAME

    if (lastHostname) {
      config.hostname = lastHostname
      config.port = parseInt(EXTERNAL_PORT_RANGE.split(':')[0], 10) + 21
    }
  }

  if (!config.hostname) {
    const nicWithSsh = nics.find(({ SSH }) => `${SSH}`.toLowerCase() === 'yes')
    config.hostname = nicWithSsh?.EXTERNAL_IP ?? nicWithSsh?.IP
  }

  if (!config.hostname) {
    return { error: 'Wrong configuration. Cannot find a NIC with SSH' }
  }

  config.port ??= vmInfo.TEMPLATE?.CONTEXT?.SSH_PORT ?? '22'

  if (vmInfo.TEMPLATE?.CONTEXT?.SSH_PUBLIC_KEY) {
    config['private-key'] = authUser?.TEMPLATE?.SSH_PRIVATE_KEY
    config.passphrase = authUser?.TEMPLATE?.SSH_PASSPHRASE
  } else {
    config.username = vmInfo.TEMPLATE?.CONTEXT?.USERNAME
    config.password = vmInfo.TEMPLATE?.CONTEXT?.PASSWORD
  }

  return config
}

const getRdpSettings = (vmInfo) => {
  const config = {}

  const nics = [
    vmInfo.TEMPLATE?.NIC ?? [],
    vmInfo.TEMPLATE?.NIC_ALIAS ?? [],
  ].flat()

  const nicWithRdp = nics.find(({ RDP }) => `${RDP}`.toLowerCase() === 'yes')
  config.hostname = nicWithRdp?.EXTERNAL_IP ?? nicWithRdp?.IP

  if (!config.hostname) {
    return { error: 'Wrong configuration. Cannot find a NIC with RDP' }
  }

  config.port = vmInfo.TEMPLATE?.CONTEXT?.RDP_PORT ?? '3389'
  config.username = vmInfo.TEMPLATE?.CONTEXT?.USERNAME
  config.password = vmInfo.TEMPLATE?.CONTEXT?.PASSWORD
  config['server-layout'] = nicWithRdp?.RDP_SERVER_LAYOUT
  config['resize-method'] = nicWithRdp?.RDP_RESIZE_METHOD ?? 'display-update'
  config['disable-audio'] =
    nicWithRdp?.RDP_DISABLE_AUDIO?.toLowerCase() === 'yes'
  config['enable-audio-input'] =
    nicWithRdp?.RDP_ENABLE_AUDIO_INPUT?.toLowerCase() === 'yes'
  config['enable-wallpaper'] =
    nicWithRdp?.RDP_ENABLE_WALLPAPER?.toLowerCase() === 'yes'
  config['enable-theming'] =
    nicWithRdp?.RDP_ENABLE_THEMING?.toLowerCase() === 'yes'
  config['enable-font-smoothing'] =
    nicWithRdp?.RDP_ENABLE_FONT_SMOOTHING?.toLowerCase() === 'yes'
  config['enable-full-window-drag'] =
    nicWithRdp?.RDP_ENABLE_FULL_WINDOW_DRAG?.toLowerCase() === 'yes'
  config['enable-desktop-composition'] =
    nicWithRdp?.RDP_ENABLE_DESKTOP_COMPOSITION?.toLowerCase() === 'yes'
  config['enable-menu-animations'] =
    nicWithRdp?.RDP_ENABLE_MENU_ANIMATIONS?.toLowerCase() === 'yes'
  config['disable-bitmap-caching'] =
    nicWithRdp?.RDP_DISABLE_BITMAP_CACHING?.toLowerCase() === 'yes'
  config['disable-offscreen-caching'] =
    nicWithRdp?.RDP_DISABLE_OFFSCREEN_CACHING?.toLowerCase() === 'yes'
  config['disable-glyph-caching'] =
    nicWithRdp?.RDP_DISABLE_GLYPH_CACHING?.toLowerCase() === 'yes'

  if (config.username && config.password) config.security = 'nla'

  return config
}

const encryptConnection = (data) => {
  const iv = randomBytes(16)
  const key = global.paths.FIREEDGE_KEY
  const cipher = createCipheriv(defaultTypeCrypto, key, iv)

  const ensuredData = typeof data === 'string' ? data : JSON.stringify(data)
  let value = cipher.update(ensuredData, 'utf-8', 'base64')
  value += cipher.final('base64')

  return { iv: iv.toString('base64'), value }
}

const functionRoutes = {
  saveAsTemplate,
  generateGuacamoleSession,
}

module.exports = functionRoutes


text:
set -x

DOWNLOAD_DIR=$1
DOWNLOAD_FILE=$2

mkdir -p $DOWNLOAD_DIR
cd $DOWNLOAD_DIR

$TRAVIS_BUILD_DIR/scripts/dropbox_uploader.sh download travis/$TRAVIS_BUILD_NUMBER/$DOWNLOAD_FILE.tgz $DOWNLOAD_FILE.tgz
tar -xzf $DOWNLOAD_FILE.tgz
rm $DOWNLOAD_FILE.tgz

cd $TRAVIS_BUILD_DIR


text:
@interface SectionedDocumentViewController()
@property(nonatomic, retain) DocumentGenerator* documentGenerator;
@end

@implementation SectionedDocumentViewController

#pragma mark - Initialization and deallocation

// -----------------------------------------------------------------------------
/// @brief Deallocates memory allocated by this SectionedDocumentViewController
/// object.
// -----------------------------------------------------------------------------
- (void) dealloc
{
  self.documentGenerator = nil;
  [super dealloc];
}

#pragma mark - UIViewController overrides

// -----------------------------------------------------------------------------
/// @brief UIViewController method.
// -----------------------------------------------------------------------------
- (void) didReceiveMemoryWarning
{
  [super didReceiveMemoryWarning];
  self.documentGenerator = nil;
}

#pragma mark - Property accessors

// -----------------------------------------------------------------------------
/// @brief Property accessor with lazy initialization.
// -----------------------------------------------------------------------------
- (DocumentGenerator*) documentGenerator
{
  if (_documentGenerator)
    return _documentGenerator;
  ApplicationDelegate* appDelegate = [ApplicationDelegate sharedDelegate];
  enum UIArea uiArea = self.uiArea;
  NSString* resourceName = [MainUtility resourceNameForUIArea:uiArea];
  NSString* resourceContent = [appDelegate contentOfTextResource:resourceName];
  switch (uiArea)
  {
    case UIAreaHelp:
      self.documentGenerator = [[[DocumentGenerator alloc] initWithFileContent:resourceContent] autorelease];
      break;
    default:
      DDLogError(@"%@: Unexpected UI area %d", self, uiArea);
      assert(0);
      self.documentGenerator = nil;
  }
  return _documentGenerator;
}

#pragma mark - UITableViewDataSource overrides

// -----------------------------------------------------------------------------
/// @brief UITableViewDataSource protocol method.
// -----------------------------------------------------------------------------
- (NSInteger) numberOfSectionsInTableView:(UITableView*)tableView
{
  return [self.documentGenerator numberOfGroups];
}

// -----------------------------------------------------------------------------
/// @brief UITableViewDataSource protocol method.
// -----------------------------------------------------------------------------
- (NSInteger) tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section
{
  // Cast is required because NSInteger and int differ in size in 64-bit. Cast
  // is safe because this controller was not made to handle more than pow(2, 31)
  // sections.
  return [self.documentGenerator numberOfSectionsInGroup:(int)section];
}

// -----------------------------------------------------------------------------
/// @brief UITableViewDataSource protocol method.
// -----------------------------------------------------------------------------
- (NSString*) tableView:(UITableView*)tableView titleForHeaderInSection:(NSInteger)section
{
  // Cast is required because NSInteger and int differ in size in 64-bit. Cast
  // is safe because this controller was not made to handle more than pow(2, 31)
  // groups.
  return [self.documentGenerator titleForGroup:(int)section];
}

// -----------------------------------------------------------------------------
/// @brief UITableViewDataSource protocol method.
// -----------------------------------------------------------------------------
- (UITableViewCell*) tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
  UITableViewCell* cell = [TableViewCellFactory cellWithType:DefaultCellType tableView:tableView];
  // Cast is required because NSInteger and int differ in size in 64-bit. Cast
  // is safe because this controller was not made to handle more than pow(2, 31)
  // sections and groups.
  cell.textLabel.text = [self.documentGenerator titleForSection:(int)indexPath.row inGroup:(int)indexPath.section];
  cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
  return cell;
}

#pragma mark - UITableViewDelegate overrides

// -----------------------------------------------------------------------------
/// @brief UITableViewDelegate protocol method.
// -----------------------------------------------------------------------------
- (void) tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
  [tableView deselectRowAtIndexPath:indexPath animated:NO];
  [self viewSectionAtIndexPath:indexPath];
}

// -----------------------------------------------------------------------------
/// @brief UITableViewDelegate protocol method.
// -----------------------------------------------------------------------------
- (void) tableView:(UITableView*)tableView willDisplayHeaderView:(UIView*)view forSection:(NSInteger)section
{
  if ([view isKindOfClass:[UITableViewHeaderFooterView class]])
  {
    UITableViewHeaderFooterView* headerFooterView = (UITableViewHeaderFooterView*)view;
    headerFooterView.contentView.backgroundColor = [UIColor blackColor];
    headerFooterView.textLabel.textColor = [UIColor whiteColor];
  }
  else
  {
    DDLogError(@"%@: Header view object %@ has unexpected type %@", self, view, [view class]);
    assert(0);
  }
}

#pragma mark - Action handlers

// -----------------------------------------------------------------------------
/// @brief Displays DocumentViewController with the content of the section at
/// index position @a sectionIndex.
// -----------------------------------------------------------------------------
- (void) viewSectionAtIndexPath:(NSIndexPath*)indexPath
{
  // Cast is required because NSInteger and int differ in size in 64-bit. Cast
  // is safe because this controller was not made to handle more than pow(2, 31)
  // sections and groups.
  NSString* sectionTitle = [self.documentGenerator titleForSection:(int)indexPath.row inGroup:(int)indexPath.section];
  NSString* sectionContent = [self.documentGenerator contentForSection:(int)indexPath.row inGroup:(int)indexPath.section];
  DocumentViewController* controller = [DocumentViewController controllerWithTitle:sectionTitle htmlString:sectionContent];
  [self.navigationController pushViewController:controller animated:YES];
}

@end


text:
php artisan config:cache --no-interaction --verbose
php artisan view:cache --no-interaction --verbose
php artisan event:cache --no-interaction --verbose
php artisan route:cache --no-interaction --verbose
exec php artisan horizon --no-interaction --verbose


text:
/**
 * This a jQuery equivalent for Lightbox2. Alternative to image popups that will display images in an overlay. All links that have attribute 'rel' starting with 'imagebox' and link to an image will display the image inside the page. Galleries can by build buy giving the value 'imagebox-galname' to attribute 'rel'. Attribute 'title' will be used as caption.
 * Keyboard navigation:
 *  -  next image: arrow right, page down, 'n' key, space
 *  -  previous image: arrow left, page up, 'p' key, backspace
 *  -  close: escape
 *
 * CSS
 *	#ImageBoxOverlay
 *	{
 *		background-color: #000;
 *	}
 *	#ImageBoxCaption
 *	{
 *		background-color: #F4F4EC;
 *	}
 *	#ImageBoxContainer
 *	{
 *		width: 250px;
 *		height: 250px;
 *		background-color: #F4F4EC;
 *	}
 *	#ImageBoxCaptionText
 *	{
 *		font-weight: bold;
 *		padding-bottom: 5px;
 *		font-size: 13px;
 *		color: #000;
 *	}
 *	#ImageBoxCaptionImages
 *	{
 *		margin: 0;
 *	}
 *	#ImageBoxNextImage
 *	{
 *		background-image: url(images/imagebox/spacer.gif);
 *		background-color: transparent;
 *	}
 *	#ImageBoxPrevImage
 *	{
 *		background-image: url(images/imagebox/spacer.gif);
 *		background-color: transparent;
 *	}
 *	#ImageBoxNextImage:hover
 *	{
 *		background-image: url(images/imagebox/next_image.jpg);
 *		background-repeat:	no-repeat;
 *		background-position: right top;
 *	}
 *	#ImageBoxPrevImage:hover
 *	{
 *		background-image: url(images/imagebox/prev_image.jpg);
 *		background-repeat:	no-repeat;
 *		background-position: left bottom;
 *	}
 *
 * @name Imagebox
 * @description This a jQuery equivalent for Lightbox2. Alternative to image popups that will display images in an overlay. All links that have attribute 'rel' starting with 'imagebox' and link to an image will display the image inside the page. Galleries can by build buy giving the value 'imagebox-galname' to attribute 'rel'. Attribute 'title' will be used as caption.
 * @param Hash hash A hash of parameters
 * @option Integer border border width
 * @option String loaderSRC path to loading image
 * @option String closeHTML path to close overlay image
 * @option Float overlayOpacity opacity for overlay
 * @option String textImage when a galalry it is build then the iteration is displayed
 * @option String textImageFrom when a galalry it is build then the iteration is displayed
 * @option Integer fadeDuration fade duration in miliseconds
 *
 * @type jQuery
 * @cat Plugins/Interface
 * @author Stefan Petre
 */
jQuery.ImageBox = {
	options : {
		border				: 10,
		loaderSRC			: 'images/loading.gif',
		closeHTML			: '<img src="images/close.jpg" />',
		overlayOpacity		: 0.8,
		textImage			: 'Showing image',
		textImageFrom		: 'from',
		fadeDuration		: 400
	},
	imageLoaded : false,
	firstResize : false,
	currentRel : null,
	animationInProgress : false,
	opened : false,

	keyPressed : function(event)
	{
		if(!jQuery.ImageBox.opened || jQuery.ImageBox.animationInProgress)
			return;
		var pressedKey = event.charCode || event.keyCode || -1;
		switch (pressedKey)
		{
			//end
			case 35:
				if (jQuery.ImageBox.currentRel)
					jQuery.ImageBox.start(null, jQuery('a[@rel=' + jQuery.ImageBox.currentRel+ ']:last').get(0));
			break;
			//home
			case 36:
				if (jQuery.ImageBox.currentRel)
					jQuery.ImageBox.start(null, jQuery('a[@rel=' + jQuery.ImageBox.currentRel+ ']:first').get(0));
			break;
			//left
			case 37:
			//backspace
			case 8:
			//page up
			case 33:
			//p
			case 80:
			case 112:
				var prevEl = jQuery('#ImageBoxPrevImage');
				if(prevEl.get(0).onclick != null) {
					prevEl.get(0).onclick.apply(prevEl.get(0));
				}
			break;
			//up
			case 38:
			break;
			//right
			case 39:
			//page down
			case 34:
			//space
			case 32:
			//n
			case 110:
			case 78:
				var nextEl = jQuery('#ImageBoxNextImage');
				if(nextEl.get(0).onclick != null) {
					nextEl.get(0).onclick.apply(nextEl.get(0));
				}
			break;
			//down;
			case 40:
			break;
			//escape
			case 27:
				jQuery.ImageBox.hideImage();
			break;
		}
	},

	init : function(options)
	{
		if (options)
			jQuery.extend(jQuery.ImageBox.options, options);
		if (window.event) {
			jQuery('body',document).bind('keyup', jQuery.ImageBox.keyPressed);
		} else {
			jQuery(document).bind('keyup', jQuery.ImageBox.keyPressed);
		}
		jQuery('a').each(
			function()
			{
				el 				= jQuery(this);
				relAttr 		= el.attr('rel')||'';
				hrefAttr 		= el.attr('href')||'';
				imageTypes 		= /\.jpg|\.jpeg|\.png|\.gif|\.bmp/g;
				if (hrefAttr.toLowerCase().match(imageTypes) != null && relAttr.toLowerCase().indexOf('imagebox') == 0) {
					el.bind('click', jQuery.ImageBox.start);
				}
			}
		);
		if (jQuery.browser.msie) {
			iframe = document.createElement('iframe');
			jQuery(iframe)
				.attr(
					{
						id			: 'ImageBoxIframe',
						src			: 'javascript:false;',
						frameborder	: 'no',
						scrolling	: 'no'
					}
				)
				.css (
					{
						display		: 'none',
						position	: 'absolute',
						top			: '0',
						left		: '0',
						filter		: 'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'
					}
				);
			jQuery('body').append(iframe);
		}

		overlay	= document.createElement('div');
		jQuery(overlay)
			.attr('id', 'ImageBoxOverlay')
			.css(
				{
					position	: 'absolute',
					display		: 'none',
					top			: '0',
					left		: '0',
					opacity		: 0
				}
			)
			.append(document.createTextNode(' '))
			.bind('click', jQuery.ImageBox.hideImage);

		captionText = document.createElement('div');
		jQuery(captionText)
			.attr('id', 'ImageBoxCaptionText')
			.css(
				{
					paddingLeft		: jQuery.ImageBox.options.border + 'px'
				}
			)
			.append(document.createTextNode(' '));

		captionImages = document.createElement('div');
		jQuery(captionImages)
			.attr('id', 'ImageBoxCaptionImages')
			.css(
				{
					paddingLeft		: jQuery.ImageBox.options.border + 'px',
					paddingBottom	: jQuery.ImageBox.options.border + 'px'
				}
			)
			.append(document.createTextNode(' '));

		closeEl = document.createElement('a');
		jQuery(closeEl)
			.attr(
				{
					id			: 'ImageBoxClose',
					href		: '#'
				}
			)
			.css(
				{
					position	: 'absolute',
					right		: jQuery.ImageBox.options.border + 'px',
					top			: '0'
				}
			)
			.append(jQuery.ImageBox.options.closeHTML)
			.bind('click', jQuery.ImageBox.hideImage);

		captionEl = document.createElement('div');
		jQuery(captionEl)
			.attr('id', 'ImageBoxCaption')
			.css(
				{
					position	: 'relative',
					textAlign	: 'left',
					margin		: '0 auto',
					zIndex		: 1
				}
			)
			.append(captionText)
			.append(captionImages)
			.append(closeEl);

		loader = document.createElement('img');
		loader.src = jQuery.ImageBox.options.loaderSRC;
		jQuery(loader)
			.attr('id', 'ImageBoxLoader')
			.css(
				{
					position	: 'absolute'
				}
			);

		prevImage = document.createElement('a');
		jQuery(prevImage)
			.attr(
				{
					id			: 'ImageBoxPrevImage',
					href		: '#'
				}
			)
			.css(
				{
					position		: 'absolute',
					display			: 'none',
					overflow		: 'hidden',
					textDecoration	: 'none'
				}
			)
			.append(document.createTextNode(' '));

		nextImage = document.createElement('a');
		jQuery(nextImage)
			.attr(
				{
					id			: 'ImageBoxNextImage',
					href		: '#'
				}
			)
			.css(
				{
					position		: 'absolute',
					overflow		: 'hidden',
					textDecoration	: 'none'
				}
			)
			.append(document.createTextNode(' '));

		container = document.createElement('div');
		jQuery(container)
			.attr('id', 'ImageBoxContainer')
			.css(
				{
					display		: 'none',
					position	: 'relative',
					overflow	: 'hidden',
					textAlign	: 'left',
					margin		: '0 auto',
					top			: '0',
					left		: '0',
					zIndex		: 2
				}
			)
			.append([loader, prevImage, nextImage]);

		outerContainer = document.createElement('div');
		jQuery(outerContainer)
			.attr('id', 'ImageBoxOuterContainer')
			.css(
				{
					display		: 'none',
					position	: 'absolute',
					overflow	: 'hidden',
					top			: '0',
					left		: '0',
					textAlign	: 'center',
					backgroundColor : 'transparent',
					lineHeigt	: '0'
				}
			)
			.append([container,captionEl]);

		jQuery('body')
			.append(overlay)
			.append(outerContainer);
	},

	start : function(e, elm)
	{
		el = elm ? jQuery(elm) : jQuery(this);
		linkRel =  el.attr('rel');
		var totalImages, iteration, prevImage, nextImage;
		if (linkRel != 'imagebox') {
			jQuery.ImageBox.currentRel = linkRel;
			gallery = jQuery('a[@rel=' + linkRel + ']');
			totalImages = gallery.size();
			iteration = gallery.index(elm ? elm : this);
			prevImage = gallery.get(iteration - 1);
			nextImage = gallery.get(iteration + 1);
		}
		imageSrc =  el.attr('href');
		captionText = el.attr('title');
		pageSize = jQuery.iUtil.getScroll();
		overlay = jQuery('#ImageBoxOverlay');
		if (!jQuery.ImageBox.opened) {
			jQuery.ImageBox.opened = true;
			if (jQuery.browser.msie) {
				jQuery('#ImageBoxIframe')
					.css ('height', Math.max(pageSize.ih,pageSize.h) + 'px')
					.css ('width', Math.max(pageSize.iw,pageSize.w) + 'px')
					.show();
			}
			overlay
				.css ('height', Math.max(pageSize.ih,pageSize.h) + 'px')
				.css ('width', Math.max(pageSize.iw,pageSize.w) + 'px')
				.show()
				.fadeTo(
					300,
					jQuery.ImageBox.options.overlayOpacity,
					function()
					{
						jQuery.ImageBox.loadImage(
							imageSrc,
							captionText,
							pageSize,
							totalImages,
							iteration,
							prevImage,
							nextImage
						);
					}
				);
			jQuery('#ImageBoxOuterContainer').css ('width', Math.max(pageSize.iw,pageSize.w) + 'px');
		} else {
			jQuery('#ImageBoxPrevImage').get(0).onclick = null;
			jQuery('#ImageBoxNextImage').get(0).onclick = null;
			jQuery.ImageBox.loadImage(
				imageSrc,
				captionText,
				pageSize,
				totalImages,
				iteration,
				prevImage,
				nextImage
			);
		}
		return false;
	},

	loadImage : function(imageSrc, captiontext, pageSize, totalImages, iteration, prevImage, nextImage)
	{
		jQuery('#ImageBoxCurrentImage').remove();
		prevImageEl = jQuery('#ImageBoxPrevImage');
		prevImageEl.hide();
		nextImageEl = jQuery('#ImageBoxNextImage');
		nextImageEl.hide();
		loader = jQuery('#ImageBoxLoader');
		container = jQuery('#ImageBoxContainer');
		outerContainer = jQuery('#ImageBoxOuterContainer');
		captionEl = jQuery('#ImageBoxCaption').css('visibility', 'hidden');
		jQuery('#ImageBoxCaptionText').html(captionText);
		jQuery.ImageBox.animationInProgress = true;
		if (totalImages)
			jQuery('#ImageBoxCaptionImages').html(
				jQuery.ImageBox.options.textImage
				+ ' ' + (iteration + 1) + ' '
				+ jQuery.ImageBox.options.textImageFrom
				+ ' ' + totalImages
			);
		if (prevImage) {
			prevImageEl.get(0).onclick = function()
			{
				this.blur();
				jQuery.ImageBox.start(null, prevImage);
				return false;
			};
		}
		if (nextImage) {
			nextImageEl.get(0).onclick =function()
			{
				this.blur();
				jQuery.ImageBox.start(null, nextImage);
				return false;
			};
		}
		loader.show();
		containerSize = jQuery.iUtil.getSize(container.get(0));
		containerW = Math.max(containerSize.wb, loader.get(0).width + jQuery.ImageBox.options.border * 2);
		containerH = Math.max(containerSize.hb, loader.get(0).height + jQuery.ImageBox.options.border * 2);
		loader
			.css(
				{
					left	: (containerW - loader.get(0).width)/2 + 'px',
					top		: (containerH - loader.get(0).height)/2 + 'px'
				}
			);
		container
			.css(
				{
					width	: containerW + 'px',
					height	: containerH + 'px'
				}
			)
			.show();
		clientSize = jQuery.iUtil.getClient();
		outerContainer
			.css('top', pageSize.t +  (clientSize.h / 15) + 'px');
		if (outerContainer.css('display') == 'none') {
			outerContainer
				.show()
				.fadeIn(
					jQuery.ImageBox.options.fadeDuration
				);
		}
		imageEl = new Image;
		jQuery(imageEl)
			.attr('id', 'ImageBoxCurrentImage')
			.bind('load',
			function()
			{
				containerW = imageEl.width + jQuery.ImageBox.options.border * 2;
				containerH = imageEl.height + jQuery.ImageBox.options.border * 2;
				loader.hide();
				container.animate(
					{
						height		: containerH
					},
					containerSize.hb != containerH ? jQuery.ImageBox.options.fadeDuration : 1,
					function()
					{
						container.animate(
							{
								width		: containerW
							},
							containerSize.wb != containerW ? jQuery.ImageBox.options.fadeDuration : 1,
							function()
							{
								container.prepend(imageEl);
								jQuery(imageEl)
									.css(
										{
											position	: 'absolute',
											left		: jQuery.ImageBox.options.border + 'px',
											top			: jQuery.ImageBox.options.border + 'px'
										}
									)
									.fadeIn(
										jQuery.ImageBox.options.fadeDuration,
										function()
										{
											captionSize = jQuery.iUtil.getSize(captionEl.get(0));
											if (prevImage) {
												prevImageEl
													.css(
														{
															left	: jQuery.ImageBox.options.border + 'px',
															top		: jQuery.ImageBox.options.border + 'px',
															width	: containerW/2 - jQuery.ImageBox.options.border * 3 + 'px',
															height	: containerH - jQuery.ImageBox.options.border * 2 + 'px'
														}
													)
													.show();
											}
											if (nextImage) {
												nextImageEl
													.css(
														{
															left	: containerW/2 + jQuery.ImageBox.options.border * 2 + 'px',
															top		: jQuery.ImageBox.options.border + 'px',
															width	: containerW/2 - jQuery.ImageBox.options.border * 3 + 'px',
															height	: containerH - jQuery.ImageBox.options.border * 2 + 'px'
														}
													)
													.show();
											}
											captionEl
												.css(
													{
														width		: containerW + 'px',
														top			: - captionSize.hb + 'px',
														visibility	: 'visible'
													}
												)
												.animate(
													{
														top		: -1
													},
													jQuery.ImageBox.options.fadeDuration,
													function()
													{
														jQuery.ImageBox.animationInProgress = false;
													}
												);
										}
									);
							}
						);
					}
				);
			}
		);
		imageEl.src = imageSrc;

	},

	hideImage : function()
	{
		jQuery('#ImageBoxCurrentImage').remove();
		jQuery('#ImageBoxOuterContainer').hide();
		jQuery('#ImageBoxCaption').css('visibility', 'hidden');
		jQuery('#ImageBoxOverlay').fadeTo(
			300,
			0,
			function(){
				jQuery(this).hide();
				if (jQuery.browser.msie) {
					jQuery('#ImageBoxIframe').hide();
				}
			}
		);
		jQuery('#ImageBoxPrevImage').get(0).onclick = null;
		jQuery('#ImageBoxNextImage').get(0).onclick = null;
		jQuery.ImageBox.currentRel = null;
		jQuery.ImageBox.opened = false;
		jQuery.ImageBox.animationInProgress = false;
		return false;
	}
};


text:
SigninCreateProfileHandler::SigninCreateProfileHandler()
    : profile_creation_type_(NO_CREATION_IN_PROGRESS),
      weak_ptr_factory_(this) {}

SigninCreateProfileHandler::~SigninCreateProfileHandler() {
#if defined(ENABLE_SUPERVISED_USERS)
  // Cancellation is only supported for supervised users.
  CancelProfileRegistration(false);
#endif
}

void SigninCreateProfileHandler::GetLocalizedValues(
    base::DictionaryValue* localized_strings) {
  localized_strings->SetString(
      "manageProfilesSupervisedSignedInLabel",
      l10n_util::GetStringUTF16(
          IDS_PROFILES_CREATE_SUPERVISED_MULTI_SIGNED_IN_LABEL));
  localized_strings->SetString("createProfileConfirm",
                               l10n_util::GetStringUTF16(IDS_SAVE));
  localized_strings->SetString("learnMore",
                               l10n_util::GetStringUTF16(IDS_LEARN_MORE));
  localized_strings->SetString(
      "selectAnAccount",
      l10n_util::GetStringUTF16(
          IDS_PROFILES_CREATE_SUPERVISED_SENTINEL_MENU_ITEM_TEXT));
  localized_strings->SetString(
      "createProfileTitle",
      l10n_util::GetStringUTF16(IDS_PROFILES_CREATE_TITLE));
  localized_strings->SetString(
      "supervisedUserLearnMoreTitle",
      l10n_util::GetStringUTF16(IDS_LEGACY_SUPERVISED_USER_LEARN_MORE_TITLE));
  localized_strings->SetString(
      "supervisedUserLearnMoreDone",
      l10n_util::GetStringUTF16(
          IDS_LEGACY_SUPERVISED_USER_LEARN_MORE_DONE_BUTTON));
  localized_strings->SetString(
      "supervisedUserLearnMoreText",
      l10n_util::GetStringFUTF16(
          IDS_SUPERVISED_USER_LEARN_MORE_TEXT,
          base::ASCIIToUTF16(
              chrome::kLegacySupervisedUserManagementURL),
          base::ASCIIToUTF16(
              chrome::kLegacySupervisedUserManagementDisplayURL)));
  localized_strings->SetString(
      "manageProfilesExistingSupervisedUser",
      l10n_util::GetStringUTF16(
          IDS_PROFILES_CREATE_LEGACY_SUPERVISED_USER_ERROR_EXISTS_REMOTELY));
  localized_strings->SetString(
      "managedProfilesExistingLocalSupervisedUser",
      l10n_util::GetStringUTF16(
          IDS_PROFILES_CREATE_LEGACY_SUPERVISED_USER_ERROR_EXISTS_LOCALLY));
  localized_strings->SetString(
      "custodianAccountNotSelectedError",
      l10n_util::GetStringUTF16(
          IDS_PROFILES_CREATE_NO_CUSTODIAN_ACCOUNT_ERROR));
}

void SigninCreateProfileHandler::RegisterMessages() {
#if defined(ENABLE_SUPERVISED_USERS)
  // Cancellation is only supported for supervised users.
  web_ui()->RegisterMessageCallback(
      "cancelCreateProfile",
      base::Bind(&SigninCreateProfileHandler::HandleCancelProfileCreation,
                 base::Unretained(this)));
#endif
  web_ui()->RegisterMessageCallback(
      "createProfile", base::Bind(&SigninCreateProfileHandler::CreateProfile,
                                  base::Unretained(this)));

  web_ui()->RegisterMessageCallback(
      "requestDefaultProfileIcons",
      base::Bind(&SigninCreateProfileHandler::RequestDefaultProfileIcons,
                 base::Unretained(this)));

  web_ui()->RegisterMessageCallback(
      "requestSignedInProfiles",
      base::Bind(&SigninCreateProfileHandler::RequestSignedInProfiles,
                 base::Unretained(this)));
}

void SigninCreateProfileHandler::RequestDefaultProfileIcons(
    const base::ListValue* args) {
  base::ListValue image_url_list;

  // Add the default avatar icons.
  size_t placeholder_avatar_index = profiles::GetPlaceholderAvatarIndex();
  for (size_t i = 0; i < profiles::GetDefaultAvatarIconCount() &&
                     i != placeholder_avatar_index;
       i++) {
    std::string url = profiles::GetDefaultAvatarIconUrl(i);
    image_url_list.AppendString(url);
  }

  web_ui()->CallJavascriptFunction("cr.webUIListenerCallback",
                                   base::StringValue("profile-icons-received"),
                                   image_url_list);

  SendNewProfileDefaults();
}

void SigninCreateProfileHandler::SendNewProfileDefaults() {
  ProfileInfoCache& cache =
      g_browser_process->profile_manager()->GetProfileInfoCache();
  base::DictionaryValue profile_info;
  profile_info.SetString("name", cache.ChooseNameForNewProfile(0));

  web_ui()->CallJavascriptFunction(
      "cr.webUIListenerCallback",
      base::StringValue("profile-defaults-received"),
      profile_info);
}

void SigninCreateProfileHandler::RequestSignedInProfiles(
    const base::ListValue* args) {
  base::ListValue user_info_list;
  std::vector<ProfileAttributesEntry*> entries =
      g_browser_process->profile_manager()->
          GetProfileAttributesStorage().GetAllProfilesAttributesSortedByName();
  for (ProfileAttributesEntry* entry : entries) {
    base::string16 username = entry->GetUserName();
    if (username.empty())
      continue;
    base::string16 profile_path = entry->GetPath().AsUTF16Unsafe();
    std::unique_ptr<base::DictionaryValue> user_info(
        new base::DictionaryValue());
    user_info->SetString("username", username);
    user_info->SetString("profilePath", profile_path);

    user_info_list.Append(std::move(user_info));
  }
  web_ui()->CallJavascriptFunction("cr.webUIListenerCallback",
                                   base::StringValue("signedin-users-received"),
                                   user_info_list);
}

void SigninCreateProfileHandler::CreateProfile(const base::ListValue* args) {
  if (!profiles::IsMultipleProfilesEnabled())
    return;

  // We can have only one in progress profile creation
  // at any given moment, if new ones are initiated just
  // ignore them until we are done with the old one.
  if (profile_creation_type_ != NO_CREATION_IN_PROGRESS)
    return;

  profile_creation_type_ = NON_SUPERVISED_PROFILE_CREATION;

  DCHECK(profile_path_being_created_.empty());
  profile_creation_start_time_ = base::TimeTicks::Now();

  base::string16 name;
  std::string icon_url;
  bool create_shortcut = false;
  if (args->GetString(0, &name) && args->GetString(1, &icon_url)) {
    DCHECK(base::IsStringASCII(icon_url));
    base::TrimWhitespace(name, base::TRIM_ALL, &name);
    CHECK(!name.empty());
#ifndef NDEBUG
    size_t icon_index;
    DCHECK(profiles::IsDefaultAvatarIconUrl(icon_url, &icon_index));
#endif
    args->GetBoolean(2, &create_shortcut);
  }
#if defined(ENABLE_SUPERVISED_USERS)
  std::string supervised_user_id;
  base::FilePath custodian_profile_path;
  if (GetSupervisedCreateProfileArgs(args, &supervised_user_id,
                                     &custodian_profile_path)) {
    // Load custodian profile.
    g_browser_process->profile_manager()->CreateProfileAsync(
        custodian_profile_path,
        base::Bind(&SigninCreateProfileHandler::LoadCustodianProfileCallback,
                   weak_ptr_factory_.GetWeakPtr(), name, icon_url,
                   create_shortcut, supervised_user_id),
        base::string16(), std::string(), std::string());
  } else {
    DoCreateProfile(name, icon_url, create_shortcut, std::string(), nullptr);
  }
#else
  DoCreateProfile(name, icon_url, create_shortcut, std::string(), nullptr);
#endif
}

void SigninCreateProfileHandler::DoCreateProfile(
    const base::string16& name,
    const std::string& icon_url,
    bool create_shortcut,
    const std::string& supervised_user_id,
    Profile* custodian_profile) {
  ProfileMetrics::LogProfileAddNewUser(ProfileMetrics::ADD_NEW_USER_DIALOG);

  profile_path_being_created_ = ProfileManager::CreateMultiProfileAsync(
      name, icon_url,
      base::Bind(&SigninCreateProfileHandler::OnProfileCreated,
                 weak_ptr_factory_.GetWeakPtr(), create_shortcut,
                 supervised_user_id, custodian_profile),
      supervised_user_id);
}

void SigninCreateProfileHandler::OnProfileCreated(
    bool create_shortcut,
    const std::string& supervised_user_id,
    Profile* custodian_profile,
    Profile* profile,
    Profile::CreateStatus status) {
  if (status != Profile::CREATE_STATUS_CREATED)
    RecordProfileCreationMetrics(status);

  switch (status) {
    case Profile::CREATE_STATUS_LOCAL_FAIL: {
      ShowProfileCreationError(profile, GetProfileCreationErrorMessageLocal());
      break;
    }
    case Profile::CREATE_STATUS_CREATED: {
      // Do nothing for an intermediate status.
      break;
    }
    case Profile::CREATE_STATUS_INITIALIZED: {
      HandleProfileCreationSuccess(create_shortcut, supervised_user_id,
                                   custodian_profile, profile);
      break;
    }
    // User-initiated cancellation is handled in CancelProfileRegistration and
    // does not call this callback.
    case Profile::CREATE_STATUS_CANCELED:
    // Supervised user registration errors are handled in
    // OnSupervisedUserRegistered().
    case Profile::CREATE_STATUS_REMOTE_FAIL:
    case Profile::MAX_CREATE_STATUS: {
      NOTREACHED();
      break;
    }
  }
}

void SigninCreateProfileHandler::HandleProfileCreationSuccess(
    bool create_shortcut,
    const std::string& supervised_user_id,
    Profile* custodian_profile,
    Profile* profile) {
  switch (profile_creation_type_) {
    case NON_SUPERVISED_PROFILE_CREATION: {
      DCHECK(supervised_user_id.empty());
      CreateShortcutAndShowSuccess(create_shortcut, profile);
      break;
    }
#if defined(ENABLE_SUPERVISED_USERS)
    case SUPERVISED_PROFILE_CREATION:
    case SUPERVISED_PROFILE_IMPORT:
      RegisterSupervisedUser(create_shortcut, supervised_user_id,
                             custodian_profile, profile);
      break;
#endif
    case NO_CREATION_IN_PROGRESS:
      NOTREACHED();
      break;
  }
}

void SigninCreateProfileHandler::CreateShortcutAndShowSuccess(
    bool create_shortcut,
    Profile* profile) {
  if (create_shortcut) {
    ProfileShortcutManager* shortcut_manager =
        g_browser_process->profile_manager()->profile_shortcut_manager();

    if (shortcut_manager)
      shortcut_manager->CreateProfileShortcut(profile->GetPath());
  }

  DCHECK_EQ(profile_path_being_created_.value(), profile->GetPath().value());
  profile_path_being_created_.clear();
  DCHECK_NE(NO_CREATION_IN_PROGRESS, profile_creation_type_);
  base::DictionaryValue dict;
  dict.SetString("name", profile->GetPrefs()->GetString(prefs::kProfileName));
  dict.Set("filePath", base::CreateFilePathValue(profile->GetPath()));
#if defined(ENABLE_SUPERVISED_USERS)
  bool is_supervised = profile_creation_type_ == SUPERVISED_PROFILE_CREATION ||
                       profile_creation_type_ == SUPERVISED_PROFILE_IMPORT;
  dict.SetBoolean("isSupervised", is_supervised);
#endif
  web_ui()->CallJavascriptFunction(
      "cr.webUIListenerCallback",
      GetWebUIListenerName(PROFILE_CREATION_SUCCESS),
      dict);

  // If the new profile is a supervised user, instead of opening a new window
  // right away, a confirmation overlay will be shown by JS from the creation
  // dialog. If we are importing an existing supervised profile or creating a
  // new non-supervised user profile we don't show any confirmation, so open
  // the new window now.
  bool should_open_new_window = true;
#if defined(ENABLE_SUPERVISED_USERS)
  if (profile_creation_type_ == SUPERVISED_PROFILE_CREATION)
    should_open_new_window = false;
#endif

  if (should_open_new_window) {
    // Opening the new window must be the last action, after all callbacks
    // have been run, to give them a chance to initialize the profile.
    webui::OpenNewWindowForProfile(
        profile, Profile::CREATE_STATUS_INITIALIZED);
  }
  profile_creation_type_ = NO_CREATION_IN_PROGRESS;
}

void SigninCreateProfileHandler::ShowProfileCreationError(
    Profile* profile,
    const base::string16& error) {
  DCHECK_NE(NO_CREATION_IN_PROGRESS, profile_creation_type_);
  web_ui()->CallJavascriptFunction("cr.webUIListenerCallback",
                                   GetWebUIListenerName(PROFILE_CREATION_ERROR),
                                   base::StringValue(error));
  // The ProfileManager calls us back with a NULL profile in some cases.
  if (profile)
    webui::DeleteProfileAtPath(profile->GetPath(), web_ui());
  profile_creation_type_ = NO_CREATION_IN_PROGRESS;
  profile_path_being_created_.clear();
}

void SigninCreateProfileHandler::RecordProfileCreationMetrics(
    Profile::CreateStatus status) {
  UMA_HISTOGRAM_ENUMERATION("Profile.CreateResult", status,
                            Profile::MAX_CREATE_STATUS);
  UMA_HISTOGRAM_MEDIUM_TIMES(
      "Profile.CreateTimeNoTimeout",
      base::TimeTicks::Now() - profile_creation_start_time_);
}

base::string16 SigninCreateProfileHandler::GetProfileCreationErrorMessageLocal()
    const {
  int message_id = IDS_PROFILES_CREATE_LOCAL_ERROR;
#if defined(ENABLE_SUPERVISED_USERS)
  // Local errors can occur during supervised profile import.
  if (profile_creation_type_ == SUPERVISED_PROFILE_IMPORT)
    message_id = IDS_LEGACY_SUPERVISED_USER_IMPORT_LOCAL_ERROR;
#endif
  return l10n_util::GetStringUTF16(message_id);
}

#if defined(ENABLE_SUPERVISED_USERS)
base::string16 SigninCreateProfileHandler::GetProfileCreateErrorMessageRemote()
    const {
  return l10n_util::GetStringUTF16(
      profile_creation_type_ == SUPERVISED_PROFILE_IMPORT
          ? IDS_LEGACY_SUPERVISED_USER_IMPORT_REMOTE_ERROR
          : IDS_PROFILES_CREATE_REMOTE_ERROR);
}

base::string16 SigninCreateProfileHandler::GetProfileCreateErrorMessageSignin()
    const {
  return l10n_util::GetStringUTF16(
      profile_creation_type_ == SUPERVISED_PROFILE_IMPORT
          ? IDS_LEGACY_SUPERVISED_USER_IMPORT_SIGN_IN_ERROR
          : IDS_PROFILES_CREATE_SIGN_IN_ERROR);
}
#endif

base::StringValue SigninCreateProfileHandler::GetWebUIListenerName(
    ProfileCreationStatus status) const {
  switch (profile_creation_type_) {
#if defined(ENABLE_SUPERVISED_USERS)
    case SUPERVISED_PROFILE_IMPORT:
      switch (status) {
        case PROFILE_CREATION_SUCCESS:
          return base::StringValue("create-profile-success");
        case PROFILE_CREATION_ERROR:
          return base::StringValue("create-profile-error");
      }
      break;
#endif
    default:
      switch (status) {
        case PROFILE_CREATION_SUCCESS:
          return base::StringValue("create-profile-success");
        case PROFILE_CREATION_ERROR:
          return base::StringValue("create-profile-error");
      }
      break;
  }

  NOTREACHED();
  return base::StringValue(std::string());
}

#if defined(ENABLE_SUPERVISED_USERS)
bool SigninCreateProfileHandler::GetSupervisedCreateProfileArgs(
    const base::ListValue* args,
    std::string* supervised_user_id,
    base::FilePath* custodian_profile_path) {
  bool supervised_user = false;
  bool success = args->GetBoolean(3, &supervised_user);
  DCHECK(success);

  if (!supervised_user)
    return false;

  success = args->GetString(4, supervised_user_id);
  DCHECK(success);
  const base::Value* path_value;
  success = args->Get(5, &path_value);
  DCHECK(success);
  success = base::GetValueAsFilePath(*path_value, custodian_profile_path);
  DCHECK(success);

  return !custodian_profile_path->empty();
}

void SigninCreateProfileHandler::LoadCustodianProfileCallback(
    const base::string16& name,
    const std::string& icon_url,
    bool create_shortcut,
    const std::string& supervised_user_id,
    Profile* custodian_profile,
    Profile::CreateStatus status) {
  // This method gets called once before with Profile::CREATE_STATUS_CREATED.
  switch (status) {
    case Profile::CREATE_STATUS_LOCAL_FAIL: {
      // TODO(mahmadi): see if a better error message is required here.
      ShowProfileCreationError(nullptr, GetProfileCreationErrorMessageLocal());
      break;
    }
    case Profile::CREATE_STATUS_CREATED: {
      // Ignore the intermediate status.
      break;
    }
    case Profile::CREATE_STATUS_INITIALIZED: {
      // We are only interested in Profile::CREATE_STATUS_INITIALIZED when
      // everything is ready.
      if (!IsAccountConnected(custodian_profile) ||
          HasAuthError(custodian_profile)) {
        ShowProfileCreationError(nullptr, l10n_util::GetStringUTF16(
          IDS_PROFILES_CREATE_CUSTODIAN_ACCOUNT_DETAILS_OUT_OF_DATE_ERROR));
        return;
      }

      PrefService* prefs = custodian_profile->GetPrefs();
      if (!prefs->GetBoolean(prefs::kSupervisedUserCreationAllowed))
        return;

      if (!supervised_user_id.empty()) {
        profile_creation_type_ = SUPERVISED_PROFILE_IMPORT;

        SupervisedUserSyncService* supervised_user_sync_service =
            SupervisedUserSyncServiceFactory::GetForProfile(custodian_profile);
        if (supervised_user_sync_service) {
          supervised_user_sync_service->GetSupervisedUsersAsync(base::Bind(
              &SigninCreateProfileHandler::DoCreateProfileIfPossible,
              weak_ptr_factory_.GetWeakPtr(), name, icon_url, create_shortcut,
              supervised_user_id, custodian_profile));
        }
      } else {
        profile_creation_type_ = SUPERVISED_PROFILE_CREATION;
        std::string new_supervised_user_id =
            SupervisedUserRegistrationUtility::GenerateNewSupervisedUserId();

        // If sync is not yet fully initialized, the creation may take extra
        // time, so show a message. Import doesn't wait for an acknowledgment,
        // so it won't have the same potential delay.
        ProfileSyncService* sync_service =
            ProfileSyncServiceFactory::GetInstance()->GetForProfile(
                custodian_profile);
        ProfileSyncService::SyncStatusSummary status =
            sync_service->QuerySyncStatusSummary();
        if (status == ProfileSyncService::DATATYPES_NOT_INITIALIZED) {
          ShowProfileCreationWarning(l10n_util::GetStringUTF16(
              IDS_PROFILES_CREATE_SUPERVISED_JUST_SIGNED_IN));
        }

        DoCreateProfile(name, icon_url, create_shortcut, new_supervised_user_id,
                        custodian_profile);
      }
      break;
    }
    case Profile::CREATE_STATUS_CANCELED:
    case Profile::CREATE_STATUS_REMOTE_FAIL:
    case Profile::MAX_CREATE_STATUS: {
      NOTREACHED();
      break;
    }
  }
}

bool SigninCreateProfileHandler::IsAccountConnected(Profile* profile)
    const {
  SigninManagerBase* signin_manager =
      SigninManagerFactory::GetForProfile(profile);
  return signin_manager && signin_manager->IsAuthenticated();
}

bool SigninCreateProfileHandler::HasAuthError(Profile* profile)
    const {
  SigninErrorController* error_controller =
      SigninErrorControllerFactory::GetForProfile(profile);
  if (!error_controller)
    return true;

  GoogleServiceAuthError::State state = error_controller->auth_error().state();
  return state != GoogleServiceAuthError::NONE;
}

void SigninCreateProfileHandler::DoCreateProfileIfPossible(
    const base::string16& name,
    const std::string& icon_url,
    bool create_shortcut,
    const std::string& supervised_user_id,
    Profile* custodian_profile,
    const base::DictionaryValue* dict) {
  DCHECK(dict);
  if (!dict->HasKey(supervised_user_id))
    return;

  // Check if this supervised user already exists on this machine.
  std::vector<ProfileAttributesEntry*> entries =
      g_browser_process->profile_manager()->
          GetProfileAttributesStorage().GetAllProfilesAttributes();
  for (ProfileAttributesEntry* entry : entries) {
    if (supervised_user_id == entry->GetSupervisedUserId()) {
      // TODO(mahmadi): see whether we need a more specific error message here.
      ShowProfileCreationError(nullptr, GetProfileCreationErrorMessageLocal());
      return;
    }
  }

  DoCreateProfile(name, icon_url, create_shortcut, supervised_user_id,
                  custodian_profile);
}

void SigninCreateProfileHandler::HandleCancelProfileCreation(
    const base::ListValue* args) {
  CancelProfileRegistration(true);
}

// Non-supervised user creation cannot be canceled. (Creating a non-supervised
// profile shouldn't take significant time, and it can easily be deleted
// afterward.)
void SigninCreateProfileHandler::CancelProfileRegistration(
    bool user_initiated) {
  if (profile_path_being_created_.empty())
    return;

  ProfileManager* manager = g_browser_process->profile_manager();
  Profile* new_profile = manager->GetProfileByPath(profile_path_being_created_);
  if (!new_profile || !new_profile->IsSupervised())
    return;

  DCHECK(supervised_user_registration_utility_.get());
  supervised_user_registration_utility_.reset();

  if (user_initiated) {
    UMA_HISTOGRAM_MEDIUM_TIMES(
        "Profile.CreateTimeCanceledNoTimeout",
        base::TimeTicks::Now() - profile_creation_start_time_);
    RecordProfileCreationMetrics(Profile::CREATE_STATUS_CANCELED);
  }

  DCHECK_NE(NO_CREATION_IN_PROGRESS, profile_creation_type_);
  profile_creation_type_ = NO_CREATION_IN_PROGRESS;

  // Canceling registration means the callback passed into
  // RegisterAndInitSync() won't be called, so the cleanup must be done here.
  profile_path_being_created_.clear();
  webui::DeleteProfileAtPath(new_profile->GetPath(), web_ui());
}

void SigninCreateProfileHandler::RegisterSupervisedUser(
    bool create_shortcut,
    const std::string& supervised_user_id,
    Profile* custodian_profile,
    Profile* new_profile) {
  DCHECK_EQ(profile_path_being_created_.value(),
            new_profile->GetPath().value());

  SupervisedUserService* supervised_user_service =
      SupervisedUserServiceFactory::GetForProfile(new_profile);

  // Register the supervised user using the profile of the custodian.
  supervised_user_registration_utility_ =
      SupervisedUserRegistrationUtility::Create(custodian_profile);
  supervised_user_service->RegisterAndInitSync(
      supervised_user_registration_utility_.get(), custodian_profile,
      supervised_user_id,
      base::Bind(&SigninCreateProfileHandler::OnSupervisedUserRegistered,
                 weak_ptr_factory_.GetWeakPtr(), create_shortcut, new_profile));
}

void SigninCreateProfileHandler::OnSupervisedUserRegistered(
    bool create_shortcut,
    Profile* profile,
    const GoogleServiceAuthError& error) {
  GoogleServiceAuthError::State state = error.state();
  RecordSupervisedProfileCreationMetrics(state);
  if (state == GoogleServiceAuthError::NONE) {
    CreateShortcutAndShowSuccess(create_shortcut, profile);
    return;
  }

  base::string16 error_msg;
  if (state == GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS ||
      state == GoogleServiceAuthError::USER_NOT_SIGNED_UP ||
      state == GoogleServiceAuthError::ACCOUNT_DELETED ||
      state == GoogleServiceAuthError::ACCOUNT_DISABLED) {
    error_msg = GetProfileCreateErrorMessageSignin();
  } else {
    error_msg = GetProfileCreateErrorMessageRemote();
  }
  ShowProfileCreationError(profile, error_msg);
}

void SigninCreateProfileHandler::ShowProfileCreationWarning(
    const base::string16& warning) {
  DCHECK_EQ(SUPERVISED_PROFILE_CREATION, profile_creation_type_);
  web_ui()->CallJavascriptFunction("cr.webUIListenerCallback",
                                   base::StringValue("create-profile-warning"),
                                   base::StringValue(warning));
}

void SigninCreateProfileHandler::RecordSupervisedProfileCreationMetrics(
    GoogleServiceAuthError::State error_state) {
  if (profile_creation_type_ == SUPERVISED_PROFILE_CREATION) {
    UMA_HISTOGRAM_ENUMERATION("Profile.SupervisedProfileCreateError",
                              error_state, GoogleServiceAuthError::NUM_STATES);
    UMA_HISTOGRAM_MEDIUM_TIMES(
        "Profile.SupervisedProfileTotalCreateTime",
        base::TimeTicks::Now() - profile_creation_start_time_);
  } else {
    DCHECK_EQ(SUPERVISED_PROFILE_IMPORT, profile_creation_type_);
    UMA_HISTOGRAM_ENUMERATION("Profile.SupervisedProfileImportError",
                              error_state, GoogleServiceAuthError::NUM_STATES);
    UMA_HISTOGRAM_MEDIUM_TIMES(
        "Profile.SupervisedProfileTotalImportTime",
        base::TimeTicks::Now() - profile_creation_start_time_);
  }
}

#endif


text:
#include "rxdlinkr.h"
#include "adesk.h"
#pragma pack (push, 8)

// Load a module, given its file name.
//
bool acrxLoadModule(const ACHAR * moduleName, bool printit, bool asCmd=false);

// Load an app, given its logical app name.
//
bool acrxLoadApp(const ACHAR * appname, bool asCmd=false);

// UnLoad a module, given its file name. Module's services and classes are
// queried for dependencies.  If all module elements have no dependencies,
// then unload can proceed.
//
bool acrxUnloadModule(const ACHAR * moduleName, bool asCmd=false);

// UnLoad an app, given its logical app name.
//
bool acrxUnloadApp(const ACHAR * appName, bool asCmd=false);

// Return an AcDbVoidPtrArray* containing names of applications
// that are currently loaded.  Caller must delete the names
// and the array afterwards.  See acrxAppIsLoaded(), if that's
// all you want to use this for.
//
void *acrxLoadedApps();

// Find out if an app is loaded.  Name is case independent
// but must include the extension (.arx etc).
//
bool ADESK_STDCALL acrxAppIsLoaded(const ACHAR  *pAppName);

// Return a const string containing the product name and the product version
// to use in writing to the Registry
// e.g Software\Autodesk\AutoCAD\R14.0
//
const ACHAR * acrxProductKey();

// Return a const string containing the ObjectDBX Registry root,
// e.g. Software\Autodesk\ObjectDBX\R15.0
//
const ACHAR * acrxObjectDBXRegistryKey();

// Return 32 bit value containing the product locale id
//
unsigned long acrxProductLCID();

// Write an entry to the NT/WIN95 system registry for this app.
// Returns:
// AcadApp::eOk if success.
// AcadApp::eKeyExists if entry already exists and can't be over written.
// AcadApp::eRejected if the write could not be completed.
//
AcadApp::ErrorStatus acrxRegisterApp(AcadApp::LoadReasons alr,
        const ACHAR  *logicalName, bool bDwgU = false);

// Remove app entry from the NT/WIN95 system registry.
// Returns:
// AcadApp::eOk if success.
// AcadApp::eRejected if entry cannot be removed.
// AcadApp::eKeyNotFound if entry cannot be found.
//
AcadApp::ErrorStatus acrxUnregisterApp(const ACHAR  *logicalname,
                                       bool bDwgU = false);

// return a void * representing a handle to the module that
// registered the service, NIL if service is not present.
//
// For be use in C API libraries to link up stub entry points with
// real ones.  C++ libraries can use this function as well.
//
void * acrxGetServiceSymbolAddr(const ACHAR * serviceName, const ACHAR * symbol);

// Tell system that the service represented by serviceName string is
// present in this module.  The system registers an instance
// of AcRxService with this name, for internal use.
//
void* acrxRegisterService(const ACHAR * serviceName);

// Return boolean indicating whether named service is registered
// and present in the system.
//
bool acrxServiceIsRegistered(const ACHAR * serviceName);

// Unlocks an application to enable it from being unloaded in mid-session.
// The default is that applications are locked, and hence unloadable in
// mid-session. The appId argument is the Id passed in as a void* during
// the AcRx::kInitAppMsg call back when the application is loaded. Return
// of non-zero means success.
//
bool acrxUnlockApplication(void* appId);

// Returns non-zero if the specified app is locked.
//
bool acrxApplicationIsLocked(const ACHAR * modulename);

// Symmetric to acrxUnlockApplication. Locks it, and hence prevents it from
// being unloaded in mid-session. Return of non-zero means success.
//
bool acrxLockApplication(void* appId);

// acrxApplicationsIsMDIAware()
// Retruns non-zero if application has registered itself as MDI aware during its kInitApp msg
//
bool acrxIsAppMDIAware(const ACHAR  * moduleName);

// acrxSetApplicationMDIAware()
// Register Application as MDI aware default is NOT MDI aware
//
bool acrxRegisterAppMDIAware(void* appId);

// acrxSetApplicationNotMDIAware()
// ARX application is NOT MDI aware this is the default.
//
bool acrxRegisterAppNotMDIAware(void* appId);

#pragma pack (pop)
#endif


text:
#ifndef Magnum_Implementation_TextureState_h
#define Magnum_Implementation_TextureState_h

#include <string>
#include <vector>

#include "Magnum/CubeMapTexture.h"

#ifdef _MSC_VER
/* Otherwise the member function pointers will have different size based on
   whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND
   IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */
#include "Magnum/BufferTexture.h"
#endif

namespace Magnum { namespace Implementation {

struct TextureState {
    explicit TextureState(Context& context, std::vector<std::string>& extensions);
    ~TextureState();

    void reset();

    void(*unbindImplementation)(GLint);
    void(*bindMultiImplementation)(GLint, Containers::ArrayView<AbstractTexture* const>);
    void(AbstractTexture::*createImplementation)();
    void(AbstractTexture::*bindImplementation)(GLint);
    void(AbstractTexture::*parameteriImplementation)(GLenum, GLint);
    void(AbstractTexture::*parameterfImplementation)(GLenum, GLfloat);
    #ifndef MAGNUM_TARGET_GLES2
    void(AbstractTexture::*parameterivImplementation)(GLenum, const GLint*);
    #endif
    void(AbstractTexture::*parameterfvImplementation)(GLenum, const GLfloat*);
    #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
    void(AbstractTexture::*parameterIuivImplementation)(GLenum, const GLuint*);
    void(AbstractTexture::*parameterIivImplementation)(GLenum, const GLint*);
    #endif
    void(AbstractTexture::*setMaxAnisotropyImplementation)(GLfloat);
    #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
    void(AbstractTexture::*getLevelParameterivImplementation)(GLint, GLenum, GLint*);
    #endif
    void(AbstractTexture::*mipmapImplementation)();
    #ifndef MAGNUM_TARGET_GLES
    void(AbstractTexture::*storage1DImplementation)(GLsizei, TextureFormat, const Math::Vector<1, GLsizei>&);
    #endif
    void(AbstractTexture::*storage2DImplementation)(GLsizei, TextureFormat, const Vector2i&);
    #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
    void(AbstractTexture::*storage3DImplementation)(GLsizei, TextureFormat, const Vector3i&);
    #endif
    #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
    void(AbstractTexture::*storage2DMultisampleImplementation)(GLsizei, TextureFormat, const Vector2i&, GLboolean);
    void(AbstractTexture::*storage3DMultisampleImplementation)(GLsizei, TextureFormat, const Vector3i&, GLboolean);
    #endif
    #ifndef MAGNUM_TARGET_GLES
    void(AbstractTexture::*getImageImplementation)(GLint, PixelFormat, PixelType, std::size_t, GLvoid*);
    void(AbstractTexture::*getCompressedImageImplementation)(GLint, std::size_t, GLvoid*);
    #endif
    #ifndef MAGNUM_TARGET_GLES
    void(AbstractTexture::*subImage1DImplementation)(GLint, const Math::Vector<1, GLint>&, const Math::Vector<1, GLsizei>&, PixelFormat, PixelType, const GLvoid*);
    void(AbstractTexture::*compressedSubImage1DImplementation)(GLint, const Math::Vector<1, GLint>&, const Math::Vector<1, GLsizei>&, CompressedPixelFormat, const GLvoid*, GLsizei);
    #endif
    void(AbstractTexture::*subImage2DImplementation)(GLint, const Vector2i&, const Vector2i&, PixelFormat, PixelType, const GLvoid*);
    void(AbstractTexture::*compressedSubImage2DImplementation)(GLint, const Vector2i&, const Vector2i&, CompressedPixelFormat, const GLvoid*, GLsizei);
    #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
    void(AbstractTexture::*subImage3DImplementation)(GLint, const Vector3i&, const Vector3i&, PixelFormat, PixelType, const GLvoid*);
    void(AbstractTexture::*compressedSubImage3DImplementation)(GLint, const Vector3i&, const Vector3i&, CompressedPixelFormat, const GLvoid*, GLsizei);
    #endif
    void(AbstractTexture::*invalidateImageImplementation)(GLint);
    void(AbstractTexture::*invalidateSubImageImplementation)(GLint, const Vector3i&, const Vector3i&);

    #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
    void(BufferTexture::*setBufferImplementation)(BufferTextureFormat, Buffer&);
    void(BufferTexture::*setBufferRangeImplementation)(BufferTextureFormat, Buffer&, GLintptr, GLsizeiptr);
    #endif

    #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
    Vector2i(CubeMapTexture::*getCubeImageSizeImplementation)(Int);
    #endif
    #ifndef MAGNUM_TARGET_GLES
    void(CubeMapTexture::*getCubeImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, PixelFormat, PixelType, std::size_t, GLvoid*);
    void(CubeMapTexture::*getCompressedCubeImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, std::size_t, GLvoid*);
    #endif
    void(CubeMapTexture::*cubeSubImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, const Vector2i&, PixelFormat, PixelType, const GLvoid*);
    void(CubeMapTexture::*cubeCompressedSubImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, const Vector2i&, CompressedPixelFormat, const GLvoid*, GLsizei);

    GLint maxSize,
        #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
        max3DSize,
        #endif
        maxCubeMapSize;
    #ifndef MAGNUM_TARGET_GLES2
    GLint maxArrayLayers;
    #endif
    #ifndef MAGNUM_TARGET_GLES
    GLint maxRectangleSize;
    #endif
    #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
    GLint maxBufferSize;
    #endif
    GLint maxTextureUnits;
    #ifndef MAGNUM_TARGET_GLES2
    GLfloat maxLodBias;
    #endif
    GLfloat maxMaxAnisotropy;
    GLint currentTextureUnit;
    #ifndef MAGNUM_TARGET_GLES2
    GLint maxColorSamples,
        maxDepthSamples,
        maxIntegerSamples;
    #endif
    #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
    GLint bufferOffsetAlignment;
    #endif

    std::vector<std::pair<GLenum, GLuint>> bindings;
};

}}

#endif


text:
/* JSHint strict mode tweak */
/*jshint globalstrict: true, devel: true, browser: true */
/*global $, _, amplify, angular, ya, helpers, app */
'use strict';

app.controller('TestDetailArtsCtrl', function TestsCtrl(
    $scope, $filter, $http, $routeParams,
    ngTableParams,
    util, data_factory1) {

    var adapt_arts = function(arts) {
        /* Test artefact API resource adaptor.
        */
        return _.map(arts, function(v, k){
            return {
                'name':k,
                'link':v,
                'link_public': util.art_public_lnk(v)
            };
        });
    };

    //main
    $scope.popover = {
        'arts': CONST.get('arts_popover'),
    };

    $scope.test_id = $routeParams.test_id;
    $scope.tbl_arts = new ngTableParams({
        page: 1,            // show first page
        total: 21,           // length of data
        count: 22,          // count per page
        counts: [],
        sorting: {
            name: 'desc'     // initial sorting
        }
    });

    $scope.$watch('tbl_arts', function(params){
        data_factory1.get_test_arts($scope.test_id)
            .then(function(resp) {
                var tbl_entries = adapt_arts(resp.data);
                var ordered_entries = params.filter ? $filter('filter')(tbl_entries, params.filter) : tbl_entries;
                $scope.tbl_data_arts = ordered_entries.slice(
                    (params.page - 1) * params.count,
                    params.page * params.count
                );
            }, function(resp) {
                data_factory1.handle_error(resp, [404]);
            });
    }, true);
});


text:
Flask Integration
=================

.. todo::
    discuss how to use bowtie within existing flask app

.. todo::
    show example


text:
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App.js';

ReactDOM.render(
  <App headerProp="Need some content"/>,
  document.getElementById('app')
);


text:
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/import/chips/p10/procedures/hwp/io/p10_io_init_start_ppe.H $ */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2019,2020                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
///
/// @file p10_io_init_start_ppe.H
/// @brief Start PHY PPE's and begin bringing up configured lanes/links
///-----------------------------------------------------------------------------
/// *HW HW Maintainer: Chris Steffen <cwsteffen@us.ibm.com>
/// *HW FW Maintainer: Ilya Smirnov <ismirno@us.ibm.com>
/// *HW Consumed by  : HB
///-----------------------------------------------------------------------------

#include <fapi2.H>

//------------------------------------------------------------------------------
// Consts
//------------------------------------------------------------------------------
static const int P10_IO_PPE_IOHS_SERDES_16_TO_1 = 1;   //FIXME depends on bitrate

static const int P10_IO_PPE_OMIC_SERDES_16_TO_1 = 1;   //FIXME

//------------------------------------------------------------------------------
// Structure definitions
//------------------------------------------------------------------------------
typedef fapi2::ReturnCode (*p10_io_init_start_ppe_FP_t)(
    const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>&);

//------------------------------------------------------------------------------
// Function prototypes
//------------------------------------------------------------------------------

extern "C"
{

///
/// @brief Setup PHY PPE registers and start reg init, dccal, lane power-up and fifo init
///
/// @param[in] i_target Chip target to start
///
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
    fapi2::ReturnCode p10_io_init_start_ppe(
        const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target);

} // extern "C"


text:
Keyzen - Colemak Edition
========================

This is a fork of [Keyzen by wwwtyro](https://github.com/wwwtyro/keyzen), modified for learning the [Colemak](http://colemak.com/) keyboard layout.

The key sequence focuses on learning the Colemak home row, then gradually introduces keys in the top and bottom rows. Common punctuation and web navigation characters are added to the mix after learning every lowercase letter. Alpha letters and uncommon punctuation marks are added last.

Keyzen automatically adds new characters to the mix as your errors decrease. Click on the character sequence at the top to increase or decrease difficulty.

Hosted Version
--------------

You can use keyzen-colemak without installing it. All you need is an internet connection:

http://first20hours.github.com/keyzen-colemak/

Local Installation
------------------

I recommend installing this program locally on your computer, which allows you to use the program when you're not connected to the net. I use [Pow.cx](http://pow.cx) by 37signals and the [Powder](https://github.com/rodreegez/powder) Ruby gem to make setup and local hosting a breeze.

**Clone keyzen-colemak**

	$ git clone git@github.com:first20hours/keyzen-colemak.git

**Navigate to the new folder**

	$ cd keyzen-colemak

**Install the Powder gem (assuming you have Ruby installed)**

	$ gem install powder

**Install Pow.cx via Powder**

	$ powder install

**Set up keyzen-colemak in Pow**

	$ powder link keyzen

Open http://keyzen.dev in your browser. That's it!

Most modern operating systems have the Colemak keyboard set installed by default. If you're having trouble finding it, Google is your friend. Installation information is also available at [Colemak.com](http://colemak.com/wiki/index.php?title=Download).

Enjoy!


text:
package discovery

// PluginCache is an interface implemented by objects that are able to maintain
// a cache of plugins.
type PluginCache interface {
	// CachedPluginPath returns a path where the requested plugin is already
	// cached, or an empty string if the requested plugin is not yet cached.
	CachedPluginPath(kind string, name string, version Version) string

	// InstallDir returns the directory that new plugins should be installed into
	// in order to populate the cache. This directory should be used as the
	// first argument to getter.Get when downloading plugins with go-getter.
	//
	// After installing into this directory, use CachedPluginPath to obtain the
	// path where the plugin was installed.
	InstallDir() string
}

// NewLocalPluginCache returns a PluginCache that caches plugins in a
// given local directory.
func NewLocalPluginCache(dir string) PluginCache {
	return &pluginCache{
		Dir: dir,
	}
}

type pluginCache struct {
	Dir string
}

func (c *pluginCache) CachedPluginPath(kind string, name string, version Version) string {
	allPlugins := FindPlugins(kind, []string{c.Dir})
	plugins := allPlugins.WithName(name).WithVersion(version)

	if plugins.Count() == 0 {
		// nothing cached
		return ""
	}

	// There should generally be only one plugin here; if there's more than
	// one match for some reason then we'll just choose one arbitrarily.
	plugin := plugins.Newest()
	return plugin.Path
}

func (c *pluginCache) InstallDir() string {
	return c.Dir
}


text:
// Copyright 2015-present, Cyrill @ Schumacher.fm and the CoreStore contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*
Package catalog implements category tree and product features.
*/
package catalog


text:
package org.ssase.objective.optimization.femosaa.variability.fm;

public class Leaf {

}


text:
package com.facetime.core.bean;

import java.io.Serializable;

public abstract interface BusinessBean extends Serializable {
}


text:
static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
					    acpi_size size)
{
       return ioremap_cache(phys, size);
}
#endif

void __iomem *__init_refok
acpi_os_map_iomem(acpi_physical_address phys, acpi_size size);
void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size);
void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size);

int acpi_os_map_generic_address(struct acpi_generic_address *addr);
void acpi_os_unmap_generic_address(struct acpi_generic_address *addr);

#endif


text:
using DesignTE.Serialization;
using DesignTE.View.NoteEditing.MsHtmlWrap;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DesignTE.View.NoteEditing
{
    /// <summary>
    /// Pastes image from Clipboard to NoteEditor
    /// </summary>
    public class ClipboardImagePaster
    {
        private readonly PersistenceManager pManager;

        public ClipboardImagePaster(NoteEditor editor, PersistenceManager pManager)
        {
            editor.Pasting += Editor_Pasting;
            this.pManager = pManager;
        }

        private void Editor_Pasting(object arg1, PastingEventArgs arg2)
        {
            arg2.Handled = PasteFromClipboard((NoteEditor)arg1, pManager.CurrentTree);
        }

        public static bool PasteFromClipboard(NoteEditor editor, PersistentTree tree)
        {
            if(Clipboard.ContainsImage())
            {
                Image image = Clipboard.GetImage();

                var imagePath = ImageLocalPath.CreateNewLocalPath("png");

                MemoryStream ms = new MemoryStream();
                image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                tree.SetByteArray(imagePath.FileName, ms.ToArray());

                var htmlImage = new HtmlImageCreator(editor);
                htmlImage.InsertImage(imagePath.Url, "");

                return true;
            }
            else if (Clipboard.ContainsFileDropList())
            {
                var fileList = Clipboard.GetFileDropList();
                var imageList = FilterImageFiles(fileList);
                if (imageList.Any())
                {
                    imageList.ForEach(i =>
                    {
                        var localPath = ImageLocalPath.CreateNewLocalPath(Path.GetExtension(i).Substring(1));
                        tree.SetByteArray(localPath.FileName, File.ReadAllBytes(i));

                        var htmlImage = new HtmlImageCreator(editor);
                        htmlImage.InsertImage(localPath.Url, "");
                    });
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                return false;
            }
        }

        private static List<string> FilterImageFiles(StringCollection fileList)
        {
            string[] imageExtensions = { "png", "jpg", "jpeg", "gif", "bmp" };
            var imageList = new List<string>();
            foreach (var fileName in fileList)
            {
                if (imageExtensions.Any(ext => fileName.EndsWith(ext, StringComparison.InvariantCultureIgnoreCase)))
                {
                    imageList.Add(fileName);
                }
            }
            return imageList;
        }
    }
}


text:
(function() {
  'use strict';

  angular
    .module('app.customerDetails')
    .controller('CustomerDetailsController', CustomerDetailsController);

  function CustomerDetailsController($stateParams, $modalInstance, initData, customerService, checklistService, settingService, logger) {
    var vm = this;

    // initialize data
    vm.customer = initData;
    vm.properties = settingService.getCustomerProperties();

    vm.addChecklist = addChecklist;
    vm.close = closeDialog;

    function addChecklist() {
      checklistService.create(vm.customer._id, {
        name: 'Checklist',
      }).then(addChecklistSuccessful, addChecklistFailed);

      function addChecklistSuccessful(result) {
        vm.customer.checklists.push(result);
        vm.customer.checklists.sort(function(a, b) {
          return a.pos < b.pos;
        });
      };

      function addChecklistFailed(error) {
        logger.error(error);
      };
    }

    function closeDialog() {
      $modalInstance.dismiss();
    }
  }

})();


text:
package org.jmock.core;

import java.util.List;

import org.jmock.core.constraint.IsAnything;
import org.jmock.core.matcher.ArgumentsMatcher;
import org.jmock.core.matcher.MethodNameMatcher;
import org.jmock.core.matcher.NoArgumentsMatcher;
import org.jmock.core.stub.CustomStub;
import org.jmock.core.stub.ReturnStub;
import org.jmock.util.JMockUtils;
import org.jmock.util.MockAssertionError;

public abstract class AbstractDynamicMock
    implements DynamicMock
{
    private InvocationDispatcher invocationDispatcher;
    private Class mockedType;
    private String name;
    private Error failure = null;

    public AbstractDynamicMock( Class mockedType, String name ) {
        this(mockedType, name, new LIFOInvocationDispatcher());
    }

    public AbstractDynamicMock( Class mockedType,
                                String name,
                                InvocationDispatcher invocationDispatcher ) {
        this.mockedType = mockedType;
        this.name = name;
        this.invocationDispatcher = invocationDispatcher;

        setupDefaultBehaviour();
    }

    abstract public Object proxy();

    public Class getMockedType() {
        return mockedType;
    }

    public void setDefaultStub( Stub newDefaultStub ) {
        invocationDispatcher.setDefaultStub(newDefaultStub);
    }

    public void addInvokable( Invokable invokable ) {
        invocationDispatcher.add(invokable);
    }

    public void reset() {
        //TODO write tests for this
        invocationDispatcher.clear();
        forgetFailure();
        setupDefaultBehaviour();
    }

    public void verify() {
        forgetFailure();

        try {
            invocationDispatcher.verify();
        } catch (Error ex) {
            if (ex instanceof MockAssertionError) {
                throw JMockUtils.newMockAssertionError( "mock object " + name + ": " + ex.getMessage());
            } else {
                throw ex;
            }
        }
    }

    public String toString() {
        return this.name;
    }

    public String getMockName() {
        return this.name;
    }

    public static String mockNameFromClass( Class c ) {
        return "mock" + Formatting.classShortName(c);
    }

    protected Object mockInvocation( Invocation invocation ) throws Throwable {
        if (failure != null && (invocation.invokedMethod.getDeclaringClass() != Object.class) ) {
            throw failure;
        }

        try {
            Object result = invocationDispatcher.dispatch(invocation);
            invocation.checkReturnTypeCompatibility(result);
            return result;
        }
        catch (Error error) {
            if (error instanceof MockAssertionError) {
                failure = JMockUtils.newDynamickMockError( this, invocation, invocationDispatcher, error.getMessage());
                failure.fillInStackTrace();
                throw failure;
            } else {
                throw error;
            }
        }
    }

    private void setupDefaultBehaviour() {
        addInvokable(hiddenInvocationMocker("toString",
                                            NoArgumentsMatcher.INSTANCE,
                                            new ReturnStub(name)));
        addInvokable(hiddenInvocationMocker("equals",
                                            new ArgumentsMatcher(new Constraint[]{new IsAnything()}),
                                            new IsSameAsProxyStub()));
        addInvokable(hiddenInvocationMocker("hashCode",
                                            NoArgumentsMatcher.INSTANCE,
                                            new HashCodeStub()));
    }

    private void forgetFailure() {
        failure = null;
    }

    private static final InvocationMocker.Describer NO_DESCRIPTION =
        new InvocationMocker.Describer() {
            public boolean hasDescription() {
                return false;
            }

            public void describeTo( StringBuffer buffer, List matchers, Stub stub, String name ) {
            }
        };

    private InvocationMocker hiddenInvocationMocker( String methodName,
                                                     InvocationMatcher arguments,
                                                     Stub stub )
    {
        InvocationMocker invocationMocker = new InvocationMocker(NO_DESCRIPTION);

        invocationMocker.addMatcher(new MethodNameMatcher(methodName));
        invocationMocker.addMatcher(arguments);
        invocationMocker.setStub(stub);

        return invocationMocker;
    }

    private class IsSameAsProxyStub extends CustomStub
    {
        public IsSameAsProxyStub() {
            super("returns whether equal to proxy");
        }

        public Object invoke( Invocation invocation ) throws Throwable {
            return new Boolean(invocation.parameterValues.get(0) == proxy());
        }
    }

    private class HashCodeStub extends CustomStub
    {
        public HashCodeStub() {
            super("returns hashCode for proxy");
        }

        public Object invoke( Invocation invocation ) throws Throwable {
            return new Integer(AbstractDynamicMock.this.hashCode());
        }
    }
}


text:
import './mentor-about-me-widget.html';
import './mentor-about-me-widget';
import './mentor-mentorspace-answer-form.html';
import './mentor-mentorspace-answer-form';
import './mentor-mentorspace-questions-accordion.html';
import './mentor-mentorspace-questions-accordion';


text:
namespace MTL {

// TODO shouldn't these be in the nRF51 header?
static const unsigned  PIN_UART_TX    = nRF51::PIN_24;
static const unsigned  PIN_UART_RX    = nRF51::PIN_25;
static const unsigned  PIN_SPI_MOSI   = nRF51::PIN_21;
static const unsigned  PIN_SPI_MISO   = nRF51::PIN_22;
static const unsigned  PIN_SPI_SCK    = nRF51::PIN_23;
static const unsigned  PIN_I2C_SCL    = nRF51::PIN_0;
static const unsigned  PIN_I2C_SDA    = nRF51::PIN_30;

static const unsigned  PIN_LED_COL1   = nRF51::PIN_4;
static const unsigned  PIN_LED_COL2   = nRF51::PIN_5;
static const unsigned  PIN_LED_COL3   = nRF51::PIN_6;
static const unsigned  PIN_LED_COL4   = nRF51::PIN_7;
static const unsigned  PIN_LED_COL5   = nRF51::PIN_8;
static const unsigned  PIN_LED_COL6   = nRF51::PIN_9;
static const unsigned  PIN_LED_COL7   = nRF51::PIN_10;
static const unsigned  PIN_LED_COL8   = nRF51::PIN_11;
static const unsigned  PIN_LED_COL9   = nRF51::PIN_12;

static const unsigned  PIN_LED_ROW1   = nRF51::PIN_13;
static const unsigned  PIN_LED_ROW2   = nRF51::PIN_14;
static const unsigned  PIN_LED_ROW3   = nRF51::PIN_15;

static const unsigned  PIN_BTN_A      = nRF51::PIN_17;
static const unsigned  PIN_BTN_B      = nRF51::PIN_26;

static const unsigned  PIN_RESET      = nRF51::PIN_19;

static const unsigned  PIN_ACCEL_INT2 = nRF51::PIN_27;
static const unsigned  PIN_ACCEL_INT1 = nRF51::PIN_28;

static const unsigned  PIN_MAG_INT    = nRF51::PIN_29;

static const unsigned  PIN_PAD_0      = nRF51::PIN_3;
static const unsigned  PIN_PAD_1      = nRF51::PIN_2;
static const unsigned  PIN_PAD_2      = nRF51::PIN_1;
static const unsigned  PIN_PAD_3      = nRF51::PIN_4;
static const unsigned  PIN_PAD_4      = nRF51::PIN_17;
static const unsigned  PIN_PAD_5      = nRF51::PIN_5;
static const unsigned  PIN_PAD_6      = nRF51::PIN_14;
static const unsigned  PIN_PAD_7      = nRF51::PIN_13;
static const unsigned  PIN_PAD_8      = nRF51::PIN_18;
static const unsigned  PIN_PAD_9      = nRF51::PIN_15;
static const unsigned  PIN_PAD_10     = nRF51::PIN_6;
static const unsigned  PIN_PAD_11     = nRF51::PIN_26;
static const unsigned  PIN_PAD_12     = nRF51::PIN_20;
static const unsigned  PIN_PAD_13     = nRF51::PIN_23;
static const unsigned  PIN_PAD_14     = nRF51::PIN_22;
static const unsigned  PIN_PAD_15     = nRF51::PIN_21;
static const unsigned  PIN_PAD_16     = nRF51::PIN_16;
static const unsigned  PIN_PAD_19     = nRF51::PIN_0;
static const unsigned  PIN_PAD_20     = nRF51::PIN_30;

static const unsigned  PIN_LED1 = PIN_LED_COL1;

static const unsigned  PIN_NOT_CONNECTED = 0xFFFFFFFF;

} // namespace MTL

#endif // MTL_MICROBIT_PINS_H


text:
module Alchemy
  class PublishPageJob < BaseJob
    queue_as :default

    def perform(page_id, public_on:)
      page = Alchemy::Page.includes(
        Alchemy::EagerLoading.page_includes(version: :draft_version)
      ).find(page_id)
      Alchemy::Page::Publisher.new(page).publish!(public_on: public_on)
    end
  end
end


text:
#ifndef PASS_H_
#define PASS_H_

#include "3d/C3DRenderState.h"

namespace cocos3d
{

class C3DTechnique;
class C3DVertexDeclaration;
class C3DEffect;

/**
 * Defines a pass for an model to be rendered.
 *
 * This class includes an effect and a vertexattribute declaration.This class is the direct
 * render interface,you can set all the shader values by which.
 */
class C3DPass : public C3DRenderState
{
    friend class C3DTechnique;
    friend class C3DMaterial;
    friend class C3DRenderState;

public:
	C3DPass();
	C3DPass(const char* id, C3DTechnique* technique, C3DEffect* effect);

    ~C3DPass();

    const char* getId() const;

    C3DEffect* getEffect() const;

    const std::vector<std::string>* getAutoBindProperties() const;

    void setVertexAttributeBinding(C3DVertexDeclaration* binding);

    void bind();
	void setParamMethonAutoUniform();

    void unbind();

    // get max support lights each type
    int getMaxDirLight() const { return _nMaxDirLight; }
    int getMaxPointLight() const  { return _nMaxPointLight; }
    int getMaxSpotLight() const { return _nMaxSpotLight; }
	int getMaxAnimLight() const { return _nMaxAnimLight; }
    int getMaxShadowMap() const { return _nMaxShadowMap; }

	C3DPass* clone() const;

    void setupParametersFromEffect();

	 /**
     * load info from the elementnode
     *
     * @param nodes elementnode which contains the renderstate info.
     *
     */
	virtual bool load(C3DElementNode* node);

	 /**
     * save the pass info into the elementnode
     *
     * @param nodes elementnode which contains the renderstate info.
     *
     */
	virtual bool save(C3DElementNode* node);

	std::string getVshPath()const{return _vshPath;}
	std::string getFshPath()const{return _fshPath;}
	std::string getDefines()const{return _defines;}

private:

    std::string _id;
    C3DTechnique* _technique;
    C3DEffect* _effect;
    C3DVertexDeclaration* _vaBinding;

    std::string _vshPath;
    std::string _fshPath;
    std::string _defines;

    //max support lights
    int _nMaxDirLight;
    int _nMaxPointLight;
    int _nMaxSpotLight;
	int _nMaxAnimLight;

    int _nMaxShadowMap;
};

}

#endif


text:
@class NSString;

@interface LbsLocation : WXPBGeneratedMessage
{
}

+ (void)initialize;

// Remaining properties
@property(retain, nonatomic) NSString *cellId; // @dynamic cellId;
@property(nonatomic) int gpssource; // @dynamic gpssource;
@property(nonatomic) float latitude; // @dynamic latitude;
@property(nonatomic) float longitude; // @dynamic longitude;
@property(retain, nonatomic) NSString *macAddr; // @dynamic macAddr;
@property(nonatomic) int precision; // @dynamic precision;

@end


text:
<?php

namespace Symfony\Component\Serializer\Tests\Fixtures;

use Symfony\Component\Serializer\Normalizer\DenormalizableInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizableInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

class Dummy implements NormalizableInterface, DenormalizableInterface
{
    public $foo;
    public $bar;
    public $baz;
    public $qux;

    public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []): array|string|int|float|bool
    {
        return [
            'foo' => $this->foo,
            'bar' => $this->bar,
            'baz' => $this->baz,
            'qux' => $this->qux,
        ];
    }

    public function denormalize(DenormalizerInterface $denormalizer, array|string|int|float|bool $data, string $format = null, array $context = [])
    {
        $this->foo = $data['foo'];
        $this->bar = $data['bar'];
        $this->baz = $data['baz'];
        $this->qux = $data['qux'];
    }
}


text:
goog.require('Zlib.CRC32');

goog.exportSymbol('Zlib.CRC32', Zlib.CRC32);
goog.exportSymbol('Zlib.CRC32.calc', Zlib.CRC32.calc);
goog.exportSymbol('Zlib.CRC32.update', Zlib.CRC32.update);