text:
using System;
using System.Collections.Generic;
using System.Management;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace HuUtils.SystemManager
{
    public partial class WMIInfo : Form
    {
        public WMIInfo()
        {
            InitializeComponent();
        }

        [StructLayout(LayoutKind.Sequential)]
        public struct DEV_BROADCAST_VOLUME
        {
            public int dbcv_size;
            public int dbcv_devicetype;
            public int dbcv_reserved;
            public int dbcv_unitmask;
        }

        protected override void WndProc(ref Message m)
        {
            // 发生设备变动
            const int WM_DEVICECHANGE = 0x0219;
            // 系统检测到一个新设备
            const int DBT_DEVICEARRIVAL = 0x8000;
            // 系统完成移除一个设备
            const int DBT_DEVICEREMOVECOMPLETE = 0x8001;
            // 逻辑卷标
            const int DBT_DEVTYP_VOLUME = 0x00000002;
            switch (m.Msg)
            {
                case WM_DEVICECHANGE:
                    switch (m.WParam.ToInt32())
                    {
                        case DBT_DEVICEARRIVAL:
                            int devType = Marshal.ReadInt32(m.LParam, 4);
                            if (devType == DBT_DEVTYP_VOLUME)
                            {
                                DEV_BROADCAST_VOLUME vol;
                                vol = (DEV_BROADCAST_VOLUME)Marshal.PtrToStructure(
                                 m.LParam, typeof(DEV_BROADCAST_VOLUME));
                                MessageBox.Show(vol.dbcv_unitmask.ToString("x"));
                            }
                            break;

                        case DBT_DEVICEREMOVECOMPLETE:
                            MessageBox.Show("Removal");
                            break;
                    }
                    break;
            }
            base.WndProc(ref m);
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
        }

        #region 取得windows的所有进程

        public static string GetCourse()
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            string tempName = "";
            int begpos, endpos;
            foreach (System.Diagnostics.Process thisProc in System.Diagnostics.Process.GetProcesses())
            {
                tempName = thisProc.ToString();
                begpos = tempName.IndexOf("(") + 1;
                endpos = tempName.IndexOf(")");
                tempName = tempName.Substring(begpos, endpos - begpos);
                sb.Append(tempName + "<br /> ");
            }
            return sb.ToString();
        }

        #endregion 取得windows的所有进程

        /// <summary>
        /// 判断一个磁盘驱动器的类型
        /// </summary>
        /// <param name="nDrive">包含了驱动器根目录路径的一个字串</param>
        /// <returns>Long,如驱动器不能识别,则返回零。如指定的目录不存在,则返回1。如执行成功,则用下述任何一个常数指定驱动器类型:DRIVE_REMOVABLE, DRIVE_FIXED, DRIVE_REMOTE, DRIVE_CDROM 或 DRIVE_RAMDISK</returns>
        [DllImport("Kernel32.dll", EntryPoint = "0", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern long GetDriveType(string nDrive);

        #region 用C#获取硬盘序列号,CPU序列号,网卡MAC地址的源码

        private string[] GetMoc()
        {
            string[] str = new string[3];
            ManagementClass mcCpu = new ManagementClass("win32_Processor");
            ManagementObjectCollection mocCpu = mcCpu.GetInstances();
            foreach (ManagementObject m in mocCpu)
            {
                str[0] = m["ProcessorId"].ToString();
            }

            ManagementClass mcHD = new ManagementClass("win32_logicaldisk");
            ManagementObjectCollection mocHD = mcHD.GetInstances();
            foreach (ManagementObject m in mocHD)
            {
                if (m["DeviceID"].ToString() == "C:")
                {
                    str[1] = m["VolumeSerialNumber"].ToString();
                    break;
                }
            }

            ManagementClass mcMAC = new ManagementClass("Win32_NetworkAdapterConfiguration");
            ManagementObjectCollection mocMAC = mcMAC.GetInstances();
            foreach (ManagementObject m in mocMAC)
            {
                if ((bool)m["IPEnabled"])
                {
                    str[2] = m["MacAddress"].ToString();
                    break;
                }
            }

            return str;
        }

        #endregion 用C#获取硬盘序列号,CPU序列号,网卡MAC地址的源码

        #region 获取U盘序列号

        private List<string> _serialNumber = new List<string>();

        /// <summary>
        /// 调用这个函数将本机所有U盘序列号存储到_serialNumber中
        /// </summary>
        private void matchDriveLetterWithSerial()
        {
            string[] diskArray;
            string driveNumber;
            var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_LogicalDiskToPartition");
            foreach (ManagementObject dm in searcher.Get())
            {
                getValueInQuotes(dm["Dependent"].ToString());
                diskArray = getValueInQuotes(dm["Antecedent"].ToString()).Split(',');
                driveNumber = diskArray[0].Remove(0, 6).Trim();
                var disks = new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive");
                foreach (ManagementObject disk in disks.Get())
                {
                    if (disk["Name"].ToString() == ("\\\\.\\PHYSICALDRIVE" + driveNumber) & disk["InterfaceType"].ToString() == "USB")
                    {
                        _serialNumber.Add(parseSerialFromDeviceID(disk["PNPDeviceID"].ToString()));
                    }
                }
            }
        }

        private static string parseSerialFromDeviceID(string deviceId)
        {
            var splitDeviceId = deviceId.Split('\\');
            var arrayLen = splitDeviceId.Length - 1;
            var serialArray = splitDeviceId[arrayLen].Split('&');
            var serial = serialArray[0];
            return serial;
        }

        private static string getValueInQuotes(string inValue)
        {
            var posFoundStart = inValue.IndexOf("\"");
            var posFoundEnd = inValue.IndexOf("\"", posFoundStart + 1);
            var parsedValue = inValue.Substring(posFoundStart + 1, (posFoundEnd - posFoundStart) - 1);
            return parsedValue;
        }

        #endregion 获取U盘序列号

        public void Test2()
        {
            matchDriveLetterWithSerial();
            string[] aa = _serialNumber.ToArray();
            for (int i = 0; i < aa.Length; i++)
            {
                aa[i].ToString(); //这里就可以拿出现在所有的U盘序列号
            }
        }

        private void LocalDisk()
        {
            WqlObjectQuery wmiquery = new WqlObjectQuery("select * from Win32_LogiCalDisk");
            ManagementObjectSearcher wmifind = new ManagementObjectSearcher(wmiquery);
            //显示
            ShowInfo(wmifind);
        }

        //远程
        private void RemoteDisk()
        {
            string ip = "114.216.27.167";
            string username = "huruiyi";
            string password = "hu629727!";
            ConnectionOptions conn = new ConnectionOptions();
            conn.Username = username;
            conn.Password = password;
            conn.Timeout = new TimeSpan(1, 1, 1, 1);//连接时间
                                                    //ManagementScope 的服务器和命名空间。
            string path = string.Format(@"\\{0}\root\cimv2", ip);
            //表示管理操作的范围(命名空间),使用指定选项初始化ManagementScope 类的、表示指定范围路径的新实例。
            ManagementScope scope = new ManagementScope(path, conn);
            scope.Connect();
            //查询
            string strQuery = "select * from Win32_LogicalDisk ";
            ObjectQuery query = new ObjectQuery(strQuery);
            //查询ManagementObjectCollection返回结果集
            ManagementObjectSearcher wmifind = new ManagementObjectSearcher(scope, query);
            ShowInfo(wmifind);
        }

        #region 显示磁盘信息

        private void ShowInfo(ManagementObjectSearcher wmifind)
        {
            long gb = 1024 * 1024 * 1024;
            string type = "";
            string str = "";
            double freePath = 0d;
            foreach (var mobj in wmifind.Get())
            {
                type = mobj["Description"].ToString();
                //判断是否是本机固盘
                if (type == "Local Fixed Disk")
                {
                    str = " 磁盘名称:" + mobj["Name"].ToString();
                    freePath = Math.Round(Convert.ToDouble(mobj["FreeSpace"]) / gb, 1);
                    str += " 可用空间:" + freePath + "G";
                    str += " 实际大小:" + Math.Round(Convert.ToDouble(mobj["Size"].ToString()) / gb, 1) + "G";
                    if (freePath < 20)
                    {
                        str += " ----请尽快清理!";
                    }
                    MessageBox.Show(str);
                }
            }
        }

        #endregion 显示磁盘信息
    }
}


text:
<?php

namespace Stp\SndApi\Common;

use GuzzleHttp\Client as GuzzleHttpClient;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Message\RequestInterface;
use GuzzleHttp\Message\ResponseInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Stp\SndApi\Common\Exception\InvalidPublicationIdException;
use Stp\SndApi\Common\Validator\PublicationIdValidator;

abstract class Client implements LoggerAwareInterface
{
    const BASE_URL = 'http://api.snd.no';

    /**
     * @var GuzzleHttpClient
     */
    protected $client;

    /**
     * @var string
     */
    protected $apiKey;

    /**
     * @var string
     */
    protected $apiSecret;

    /**
     * @var string
     */
    protected $publicationId;

    /**
     * @var string
     */
    protected $apiUrl = self::BASE_URL;

    /**
     * @var LoggerInterface
     */
    protected $logger;

    /**
     * @param string $apiKey
     * @param string $apiSecret
     * @param string $publicationId
     * @param string $apiUrl
     */
    public function __construct($apiKey, $apiSecret, $publicationId, $apiUrl = self::BASE_URL)
    {
        $this->client = new GuzzleHttpClient(['base_url' => $apiUrl]);
        $this->apiUrl = $apiUrl;
        $this->setApiKey($apiKey);
        $this->setApiSecret($apiSecret);
        $this->setPublicationId($publicationId);
        $this->setLogger(new NullLogger());
    }

    /**
     * @param RequestInterface $request
     */
    protected function signRequest(RequestInterface $request)
    {
        $now = new \DateTime('now', new \DateTimeZone('UTC'));
        $signature = sprintf('0x%s', hash_hmac('sha256', $now->format('d M Y H'), $this->getApiSecret()));

        $request->addHeader('X-Snd-ApiSignature', $signature);

        if (!empty($this->getApiKey())) {
            $request->addHeader('X-Snd-ApiKey', $this->getApiKey());
        }
    }

    /**
     * @param RequestInterface $request
     * @param bool $acceptJsonResponse
     */
    protected function buildRequest(RequestInterface $request, $acceptJsonResponse = true)
    {
        if ($acceptJsonResponse) {
            $request->addHeader('Accept', 'application/json');
        }
        $request->addHeader('Accept-Charset', 'UTF-8');
    }

    /**
     * @param string $url
     * @param bool $acceptJsonResponse
     *
     * @return ResponseInterface
     * @throws RequestException
     */
    protected function apiGet($url, $acceptJsonResponse = true)
    {
        if (0 === preg_match('/^\//', $url)) {
            $url = '/' . $url;
        }

        $url = str_replace('{publicationId}', $this->getPublicationId(), $url);

        $request = $this->client->createRequest('GET', $this->getApiUrl() . $url);
        $this->buildRequest($request, $acceptJsonResponse);
        $this->signRequest($request);

        return $this->client->send($request);
    }

    /**
     * @return string
     */
    public function getApiKey()
    {
        return $this->apiKey;
    }

    /**
     * @param string $apiKey
     */
    public function setApiKey($apiKey)
    {
        $this->apiKey = $apiKey;
    }

    /**
     * @return string
     */
    public function getApiSecret()
    {
        return $this->apiSecret;
    }

    /**
     * @param string $apiSecret
     */
    public function setApiSecret($apiSecret)
    {
        $this->apiSecret = $apiSecret;
    }

    /**
     * @return string
     */
    public function getApiUrl()
    {
        return $this->apiUrl;
    }

    /**
     * @return string
     */
    public function getPublicationId()
    {
        return $this->publicationId;
    }

    /**
     * @param string $publicationId
     *
     * @throws InvalidPublicationIdException
     * @SuppressWarnings(PHPMD.LongVariable)
     */
    public function setPublicationId($publicationId)
    {
        $publicationIdValidator = new PublicationIdValidator($publicationId);

        if (!$publicationIdValidator->isValid()) {
            throw new InvalidPublicationIdException;
        }

        $this->publicationId = $publicationId;
    }

    /**
     * Sets a logger instance on the object
     *
     * @param LoggerInterface $logger
     * @return null
     */
    public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
    }

    /**
     * @param GuzzleHttpClient $client
     */
    public function setClient(GuzzleHttpClient $client)
    {
        $this->client = $client;
    }
}

redpajama_set_name: RedPajamaGithub


text:
layout: page
title: "Robert Goodrich"
comments: true
description: "blanks"
keywords: "Robert Goodrich,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
	font-family: "Bebas Neue";
	src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
	}
	h1.Bebas {
		font-family: "Bebas Neue", Verdana, Tahoma;
	}
</style>
</head>

#### TEACHING INFORMATION

**College**: College of Arts and Sciences

**Classes taught**: MATH 1150, MATH 3000, MATH 3001, MATH 4430, MATH 4510, MATH 4520, MATH 4800, MATH 4820

#### MATH 1150: PRECALCULUS MATHEMATICS GT-MA1

**Terms taught**: Fall 2008

**Instructor rating**: 4.81

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 2.36

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 3.24

**Standard deviation in workload** (raw): 0.0

#### MATH 3000: INTRO TO ABSTRACT MATH

**Terms taught**: Spring 2008, Fall 2008

**Instructor rating**: 5.28

**Standard deviation in instructor rating**: 0.22

**Average grade** (4.0 scale): 2.5

**Standard deviation in grades** (4.0 scale): 0.15

**Average workload** (raw): 2.97

**Standard deviation in workload** (raw): 0.03

#### MATH 3001: Analysis 1

**Terms taught**: Fall 2009, Fall 2010, Fall 2010

**Instructor rating**: 5.54

**Standard deviation in instructor rating**: 0.22

**Average grade** (4.0 scale): 2.78

**Standard deviation in grades** (4.0 scale): 0.17

**Average workload** (raw): 3.27

**Standard deviation in workload** (raw): 0.35

#### MATH 4430: ORDINARY DIFF EQUATIONS

**Terms taught**: Spring 2008

**Instructor rating**: 5.37

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 2.95

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 3.44

**Standard deviation in workload** (raw): 0.0

#### MATH 4510: INTRO-PROBABILITY THEORY

**Terms taught**: Fall 2006

**Instructor rating**: 3.61

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 2.78

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 3.3

**Standard deviation in workload** (raw): 0.0

#### MATH 4520: INTRO TO MATH STATISTICS

**Terms taught**: Spring 2009, Spring 2010

**Instructor rating**: 5.39

**Standard deviation in instructor rating**: 0.07

**Average grade** (4.0 scale): 3.19

**Standard deviation in grades** (4.0 scale): 0.09

**Average workload** (raw): 3.19

**Standard deviation in workload** (raw): 0.19

#### MATH 4800: HISTORY OF MATHEMATICS

**Terms taught**: Fall 2007

**Instructor rating**: 5.42

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 3.25

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 2.53

**Standard deviation in workload** (raw): 0.0

#### MATH 4820: HISTORY OF MATH IDEAS

**Terms taught**: Fall 2009

**Instructor rating**: 5.67

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 2.83

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 3.1

**Standard deviation in workload** (raw): 0.0


text:
var EventEmitter = require('events').EventEmitter;
var path = require('path');
var util = require('util');

var async = require('async');
var Gaze = require('gaze').Gaze;
var log = require('npmlog');

var config = require('./config');
var globs = require('./util').globs;
var getLibraryPath = require('./util').getLibraryPath;
var minimatches = require('./util').minimatches;
var scripts = require('./scripts');

/**
 * Configurable log level.
 * @type {string}
 */
log.level = config.get('log_level');

/**
 * Script manager.
 * @param {Object} options Manager options.
 * @constructor
 * @extends {EventEmitter}
 */
var Manager = exports.Manager = function Manager(options) {
  EventEmitter.call(this);
  options = options || {};

  /**
   * Cache of managed scripts.
   * @type {Object.<string, Script}
   */
  this._scripts = {};

  /**
   * Cache of parsing errors per script.
   * @type {Object.<string, Error}
   */
  this._errors = {};

  /**
   * Cache of the sorted dependencies.
   * @type {Object.<string, Array.<Script>>}
   */
  this._dependencies = {};

  /**
   * Root for lib and main file patterns.
   * @type {string}
   */
  this._cwd = options.cwd || process.cwd();

  var lib = options.lib || [];
  if (!Array.isArray(lib)) {
    lib = [lib];
  }

  /**
   * Lib glob patterns.
   * @type {Array.<string>}
   */
  this._lib = lib;

  var main = options.main || [];
  if (!Array.isArray(main)) {
    main = [main];
  }

  /**
   * Main glob patterns.
   * @type {Array.<string>}
   */
  this._main = main;

  /**
   * Ignore requires pattern.
   * @type {RegExp}
   */
  this._ignoreRequires = options.ignoreRequires ?
      new RegExp(options.ignoreRequires) : null;

  /**
   * Gaze instance.
   * @type {gaze.Gaze}
   */
  this._gaze = null;

  /**
   * The manager is closed.
   * @type {boolean}
   */
  this._closed = false;

  var paths = lib.concat(main);
  if (options.closure !== false) {
    var closure = getLibraryPath();
    paths = paths.concat([
      path.join(closure, 'closure', 'goog', '**', '*.js'),
      path.join(closure, 'third_party', 'closure', 'goog', '**', '*.js')
    ]);
  }
  process.nextTick(function() {
    this._processPaths(paths);
  }.bind(this));

};
util.inherits(Manager, EventEmitter);

/**
 * Add a script to the manager.
 * @param {Script} script Script to add.
 */
Manager.prototype._addScript = function(script) {
  var filepath = script.path;
  if (this._scripts.hasOwnProperty(filepath)) {
    throw new Error('Script with same path already added: ' + filepath);
  }
  log.verbose('manager', 'Adding ' + filepath);
  this._scripts[filepath] = script;
  this._dependencies = {};
};

/**
 * Get a list of scripts sorted in dependency order.
 * @param {string=} opt_main Optional main script (must already be included in
 *     currently managed paths).
 * @return {Array.<Script>} List of scripts.
 */
Manager.prototype.getDependencies = function(opt_main) {
  var main = opt_main && path.resolve(opt_main);
  var scriptsLookup = this._scripts;
  var ignoreRequires = this._ignoreRequires;
  if (main && !scriptsLookup.hasOwnProperty(main)) {
    throw new Error('Main script not currently managed: ' + main);
  }
  var mainKey = main || '*';
  if (!this._dependencies.hasOwnProperty(mainKey)) {
    var providesLookup = {};
    var base = [];
    var depsOnly = [];
    Object.keys(scriptsLookup).forEach(function(filepath) {
      var script = scriptsLookup[filepath];
      script.provides.forEach(function(provide) {
        if (provide === 'goog') {
          base.push(filepath);
        }
        if (providesLookup.hasOwnProperty(provide)) {
          throw new Error('Redundant provide "' + provide + '" ' +
              'in script: ' + filepath + ' - already provided by ' +
              providesLookup[provide].path);
        }
        providesLookup[provide] = script;
      });
      if (script.provides.length === 0 && script.requires.length === 0 &&
          script.addsDependencies) {
        depsOnly.push(script);
      }
    });

    var visited = {};
    var dependencies = [];

    // check for base
    if (base.length === 0) {
      throw new Error('Could not find base.js');
    } else if (base.length > 1) {
      throw new Error('Found more than one base: ' + base.join(' '));
    }

    // seed dependencies with base.js
    visited[base[0]] = true;
    dependencies[0] = scriptsLookup[base[0]];

    var visit = function(script) {
      if (!visited.hasOwnProperty(script.path)) {
        visited[script.path] = true;
        script.requires.forEach(function(require) {
          if (!providesLookup.hasOwnProperty(require)) {
            if (!ignoreRequires || !require.match(ignoreRequires)) {
              throw new Error('Unsatisfied dependency "' + require + '" ' +
                  'in script: ' + script.path);
            }
          } else {
            visit(providesLookup[require]);
          }
        });
        // do not include scripts that neither provide nor require
        if (script.provides.length > 0 || script.requires.length > 0) {
          dependencies.push(script);
        }
      }
    };

    if (main) {
      visit(scriptsLookup[main]);
    } else {
      var lib = this._lib;
      var cwd = this._cwd;
      Object.keys(scriptsLookup).forEach(function(filepath) {
        /**
         * Bundled closure library includes test and debug scripts that should
         * not be included unless explicitly required.  Any main scripts should
         * not be included unless explicitly required.
         */
        if (minimatches(path.relative(cwd, filepath), lib)) {
          visit(scriptsLookup[filepath]);
        }
      });
    }
    if (depsOnly.length > 0) {
      dependencies = dependencies.concat(depsOnly);
    }
    this._dependencies[mainKey] = dependencies;
  }
  return this._dependencies[mainKey];
};

/**
 * Get any cached parsing errors.
 * @return {Array.<Error>} Cached parsing errors.
 */
Manager.prototype.getErrors = function() {
  var errors = this._errors;
  return Object.keys(errors).map(function(key) {
    return errors[key];
  });
};

/**
 * Get a script given the absolute path to a script.
 * @param {string} filepath Absolute path to script.
 * @return {Script} The script (or null if not found).
 */
Manager.prototype.getScript = function(filepath) {
  return this._scripts[filepath] || null;
};

/**
 * Add all scripts from provided path patterns.
 * @param {Array.<string>} paths Paths patterns to process.
 */
Manager.prototype._processPaths = function(paths) {
  var self = this;
  async.waterfall([
    function(callback) {
      globs(paths, {cwd: self._cwd}, callback);
    },
    function(paths, callback) {
      paths = paths.map(function(relative) {
        return path.resolve(self._cwd, relative);
      });
      async.map(paths, scripts.read, callback);
    },
    function(results, callback) {
      var err;
      try {
        results.forEach(self._addScript.bind(self));
      } catch (e) {
        err = e;
      }
      callback(err);
    }
  ], function(err) {
    if (err) {
      log.verbose('manager', err);
      self.emit('error', err);
    } else {
      self.emit('beforewatch');
      self._startWatch();
    }
  });
};

/**
 * Start watching managed file paths.
 */
Manager.prototype._startWatch = function() {
  if (this._closed) {
    return;
  }
  var paths = this._lib.concat(this._main);
  var gaze = new Gaze(paths);
  gaze.on('changed', this._handleChanged.bind(this));
  gaze.on('added', function(filepath) {
    // TODO: remove this when gaze@0.5 is published
    if (minimatches(path.relative(this._cwd, filepath), paths)) {
      this._handleChanged(filepath);
    }
  }.bind(this));
  gaze.on('deleted', this._handleDeleted.bind(this));
  this._gaze = gaze;
  this.emit('ready');
};

/**
 * Handle script addition and modification.
 * @param {string} filepath Script path.
 */
Manager.prototype._handleChanged = function(filepath) {
  var self = this;
  scripts.read(filepath, function(err, script) {
    if (err) {
      log.verbose('manager', err);
      self._errors[filepath] = err;
      return self.emit('error', err);
    } else {
      delete self._errors[filepath];
    }
    log.verbose('manager', 'updated ' + filepath);
    delete self._scripts[filepath];
    self._addScript(script);
    self.emit('update', script);
  });
};

/**
 * Handle script removal.
 * @param {string} filepath Script path.
 */
Manager.prototype._handleDeleted = function(filepath) {
  delete this._scripts[filepath];
  delete this._errors[filepath];
  this._dependencies = {};
  log.verbose('manager', 'deleted ' + filepath);
  this.emit('update');
};

/**
 * Stop watching all files.
 */
Manager.prototype.close = function() {
  if (this._gaze) {
    this._gaze.close();
    delete this._gaze;
  }
  if (!this._closed) {
    this._closed = true;
    this.emit('close');
  }
};


text:
#ifndef LICENSE_CONTROL_H
#define LICENSE_CONTROL_H

#include "sdk_export.h"
#include <string>
#include "common.h"

//定义业务类型
typedef enum
{
    DIAL, //点呼
    VIDEO_P2P, //视频点呼
    VIDEO_UPLOAD, //视频回传
    PTT,  //组呼
    UNDEFINED_TP
}Service_type;

//定义呼叫优先类型
typedef enum
{
    EMERGENCY, //紧急呼叫类型
    NORMAL  //普通呼叫类型
}Priority_type;

class SDK_IMPORT_EXPORT ServInfo
{
public:
    ServInfo(MSISDN caller, MSISDN callee);
    ServInfo(const ServInfo& sInfo);

    std::string datalog_str();

    void setServiceType(Service_type stype);
    void setPriType(Priority_type ctype);
    void setFmt(Fmt_type FmtVlaue);
    void setMute(int MuteValue);
    void setCallId(MSISDN callid);

    MSISDN getCaller();
    MSISDN getCallee();
    Service_type getServiceType();
    Priority_type getPriType();
    Fmt_type getFmt();
    int getMute();
    MSISDN getCallId();

private:
    MSISDN m_Caller;
    MSISDN m_Callee;
    Service_type m_stype;
    Priority_type m_ctype;
    Fmt_type m_ftype;
    int m_mute;
    MSISDN m_callid;
};

class SDK_IMPORT_EXPORT LicenseControl
{
public:

    //license是否允许接入,true表示允许,false表示禁止
    virtual bool is_license_accept(ServInfo *Sinfo) =0;

};

class SDK_IMPORT_EXPORT ConnInfo
{
public:
    ConnInfo();

    void setLocalIp(char *localip);
    void setAudioport(unsigned int aport);
    void setVideoport(unsigned int vport);

    char * getLocalIp();
    unsigned int getAudioport();
    unsigned int getVideoport();
    std::string datalog_str();

private:
    char * m_LocalIp;
    unsigned int m_audioport;
    unsigned int m_videoport;

};

class SDK_IMPORT_EXPORT ConnectionControl
{
public:

    //获取上层设置的网络连接信息,true表示成功,false表示失败
    virtual bool get_Connection_info(ServInfo *Sinfo,ConnInfo *Cinfo) =0;

};
#endif // LICENSE_CONTROL_H


text:
namespace guslib
{
  class GUSLIB_EXPORT_SYMBOL CustomMutex
  {
  public:
    CustomMutex();
    virtual ~CustomMutex();

  public:
    void lock();
    void unlock();

  private:
    // Internal class to store the implementation.
    class Impl;

    // Pointer to implementation (pImpl).
    Impl* impl_;
  };

  class GUSLIB_EXPORT_SYMBOL CustomLock
  {
  public:
    CustomLock(CustomMutex& mutex);
    virtual ~CustomLock();

  private:
    CustomMutex& mutex_;
  };
}

#endif  // GUS_LIB_SMARTPTR_H


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.node.admin.task.util.template;

import com.yahoo.vespa.hosted.node.admin.task.util.text.CursorRange;

/**
 * Represents a template literal section
 *
 * @see Template
 * @author hakonhall
 */
class LiteralSection extends Section {
    LiteralSection(CursorRange range) {
        super("literal", range);
    }

    @Override
    void appendTo(StringBuilder buffer) {
        range().appendTo(buffer);
    }

    @Override
    void appendCopyTo(SectionList sectionList) {
        sectionList.appendLiteralSection(range().end());
    }
}


text:
package Paws::Rekognition::DetectLabelsResponse;
  use Moose;
  has Labels => (is => 'ro', isa => 'ArrayRef[Paws::Rekognition::Label]');
  has OrientationCorrection => (is => 'ro', isa => 'Str');

  has _request_id => (is => 'ro', isa => 'Str');

### main pod documentation begin ###

=head1 NAME

Paws::Rekognition::DetectLabelsResponse

=head1 ATTRIBUTES

=head2 Labels => ArrayRef[L<Paws::Rekognition::Label>]

An array of labels for the real-world objects detected.

=head2 OrientationCorrection => Str

The orientation of the input image (counter-clockwise direction). If
your application displays the image, you can use this value to correct
the orientation. If Amazon Rekognition detects that the input image was
rotated (for example, by 90 degrees), it first corrects the orientation
before detecting the labels.

If the input image Exif metadata populates the orientation field,
Amazon Rekognition does not perform orientation correction and the
value of OrientationCorrection will be null.

Valid values are: C<"ROTATE_0">, C<"ROTATE_90">, C<"ROTATE_180">, C<"ROTATE_270">
=head2 _request_id => Str

=cut

1;


text:
package org.apache.shindig.server.endtoend;

import org.apache.shindig.auth.BasicSecurityToken;
import org.apache.shindig.auth.BasicSecurityTokenCodec;
import org.apache.shindig.auth.SecurityToken;
import org.apache.shindig.common.JsonAssert;
import org.apache.shindig.common.crypto.BlobCrypterException;

import com.gargoylesoftware.htmlunit.CollectingAlertHandler;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HTMLParserListener;
import com.google.common.collect.Maps;

import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Ignore;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import java.io.IOException;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

/**
 * Base class for end-to-end tests.
 */
public class EndToEndTest {
  private static final String[] EXPECTED_RESOURCES = {
    "fetchPersonTest.xml",
    "fetchPeopleTest.xml",
    "errorTest.xml",
    "jsonTest.xml",
    "cajaTest.xml",
    "failCajaTest.xml",
    "failCajaUrlTest.xml",
    "osapi/personTest.xml",
    "osapi/peopleTest.xml",
    "osapi/activitiesTest.xml",
    "osapi/appdataTest.xml",
    "osapi/batchTest.xml",
    "testframework.js"
  };

  static private EndToEndServer server = null;

  private WebClient webClient;
  private CollectingAlertHandler alertHandler;
  private SecurityToken token;
  private String language;

  @Test
  public void checkResources() throws Exception {
    for ( String resource : EXPECTED_RESOURCES ) {
      String url = EndToEndServer.SERVER_URL + '/' + resource;
      Page p = webClient.getPage(url);
      assertEquals("Failed to load test resource " + url, 200, p.getWebResponse().getStatusCode());
    }
  }

  @Test
  public void fetchPerson() throws Exception {
    executeAllPageTests("fetchPersonTest");
  }

  @Test
  public void fetchPeople() throws Exception {
    executeAllPageTests("fetchPeopleTest");
  }

  @Test
  public void messageBundles() throws Exception {
    executeAllPageTests("messageBundle");
  }

  @Test
  public void jsonParse() throws Exception {
    executeAllPageTests("jsonTest");
  }

  @Test
  @Ignore("Issues with passing the neko dom to caja") // FIXME
  public void cajaJsonParse() throws Exception {
    executeAllPageTests("jsonTest", true /* caja */);
  }

  @Test
  @Ignore("Issues with passing the neko dom to caja") // FIXME
  public void cajaFetchPerson() throws Exception {
    executeAllPageTests("fetchPersonTest", true /* caja */);
  }

  @Test
  @Ignore("Issues with passing the neko dom to caja") // FIXME
  public void cajaFetchPeople() throws Exception {
    executeAllPageTests("fetchPeopleTest", true /* caja */);
  }

  @Test
  @Ignore("Issues with passing the neko dom to caja") // FIXME
  public void cajaTestMakeRequest() throws Exception {
      executeAllPageTests("makeRequestTest", true /* caja */);
  }

  @Test
  @Ignore("Issues with passing the neko dom to caja") // FIXME
  public void caja() throws Exception {
    executeAllPageTests("cajaTest.xml");
  }

  @Test
  public void testMakeRequest() throws Exception {
    executeAllPageTests("makeRequestTest");
  }

  @Test
  public void messageBundlesRtl() throws Exception {
    // Repeat the messageBundle tests, but with the language set to "ar"
    language = "ar";

    executeAllPageTests("messageBundle");
  }

  @Test
  public void notFoundError() throws Exception {
    server.setDataServiceError(HttpServletResponse.SC_NOT_FOUND, "Not Found");
    executePageTest("errorTest", "notFoundError");
  }

  @Test
  public void badRequest() throws Exception {
    server.setDataServiceError(HttpServletResponse.SC_BAD_REQUEST, "Bad Request");
    executePageTest("errorTest", "badRequestError");
  }

  @Test
  public void internalError() throws Exception {
    server.setDataServiceError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Internal Server Error");
    executePageTest("errorTest", "internalError");
  }

  @Test
  public void testTemplates() throws Exception {
    executeAllPageTests("opensocial-templates/ost_test");
  }

  @Test
  public void testFailCaja() throws Exception {
    HtmlPage page = executePageTest("failCajaTest", null);
    NodeList bodyList = page.getElementsByTagName("body");

    // Result should contain just one body
    assertEquals(1, bodyList.getLength());
    DomNode body = (DomNode) bodyList.item(0);

    // Failed output contains only an error block plus a onload script block
    assertEquals(2, body.getChildNodes().getLength());
    assertEquals("ul", body.getFirstChild().getNodeName());
    assertEquals("script", body.getLastChild().getNodeName());
  }

  @Test
  public void testCajaFailUrlGadgets() throws Exception {
    try {
      executePageTest("failCajaUrlTest", null, /* caja */ true);
    } catch (FailingHttpStatusCodeException e) {
      assertEquals(HttpServletResponse.SC_BAD_REQUEST, e.getStatusCode());
    }
  }

  @Test
  public void testPipelining() throws Exception {
    HtmlPage page = executePageTest("pipeliningTest", null);
    JSONArray array = new JSONArray(page.asText());
    assertEquals(3, array.length());
    Map<String, JSONObject> jsonObjects = Maps.newHashMap();
    for (int i = 0; i < array.length(); i++) {
      JSONObject jsonObj = array.getJSONObject(i);
      assertTrue(jsonObj.has("id"));

      jsonObjects.put(jsonObj.getString("id"), jsonObj);
    }

    JSONObject me = jsonObjects.get("me").getJSONObject("result");
    assertEquals("Digg", me.getJSONObject("name").getString("familyName"));

    JSONObject json = jsonObjects.get("json").getJSONObject("result");
    JSONObject expected = new JSONObject("{content: {key: 'value'}, status: 200}");
    JsonAssert.assertJsonObjectEquals(expected, json);

    JsonAssert.assertObjectEquals("{id: 'var', result: 'value'}", jsonObjects.get("var"));
  }

  // TODO PML - convert this to use junit 4 Theories to simplify this.

  @Test
  public void testOsapiPeople() throws Exception {
    executeAllPageTests("osapi/peopleTest");
  }

  @Test
  public void testOsapiPerson() throws Exception {
    executeAllPageTests("osapi/personTest");
  }

  @Test
  public void testOsapiActivities() throws Exception {
    executeAllPageTests("osapi/activitiesTest");
  }

  @Test
  public void testOsapiAppdataFetchId() throws Exception {
    executePageTest("osapi/appdataTest", "fetchId");
  }

  @Test
  public void testOsapiAppdataAppDataWrite() throws Exception {
    executePageTest("osapi/appdataTest", "appdataWrite");
  }

  @Test
  public void testOsapiBatch() throws Exception {
    executeAllPageTests("osapi/batchTest");
  }

  @Test
  @Ignore("Issues with passing the neko dom to caja") // FIXME
  public void testCajaOsapiAppdata() throws Exception {
    executeAllPageTests("osapi/appdataTest", true /* caja */);
  }

  @Test
  @Ignore("Issues with passing the neko dom to caja") // FIXME
  public void testCajaOsapiBatch() throws Exception {
    executeAllPageTests("osapi/batchTest", true /* caja */);
  }

  @Test
  public void testTemplateRewrite() throws Exception {
    HtmlPage page = executePageTest("templateRewriter", null);

    // Verify that iteration attributes were processed
    HtmlElement attrs = page.getElementById("attrs");
    List<HtmlElement> attrsList = attrs.getElementsByTagName("li");
    assertEquals(3, attrsList.size());

    Element element = page.getElementById("id0");
    assertNotNull(element);
    assertEquals("Jane", element.getTextContent().trim());

    element = page.getElementById("id2");
    assertNotNull(element);
    assertEquals("Maija", element.getTextContent().trim());

    // Verify that the repeatTag was processed
    HtmlElement repeat = page.getElementById("repeatTag");
    List<HtmlElement> repeatList = repeat.getElementsByTagName("li");
    assertEquals(1, repeatList.size());
    assertEquals("George", repeatList.get(0).getTextContent().trim());

    // Verify that the ifTag was processed
    HtmlElement ifTag = page.getElementById("ifTag");
    List<HtmlElement> ifList = ifTag.getElementsByTagName("li");
    assertEquals(3, ifList.size());
    assertEquals(1, page.getElementsByTagName("b").getLength());
    assertEquals(1, ifList.get(2).getElementsByTagName("b").size());

    Element jsonPipeline = page.getElementById("json");
    assertEquals("value", jsonPipeline.getTextContent().trim());

    Element textPipeline = page.getElementById("text");
    assertEquals("{\"key\": \"value\"}", textPipeline.getTextContent().trim());

    // Test of oncreate
    Element oncreateSpan = page.getElementById("mutate");
    assertEquals("mutated", oncreateSpan.getTextContent().trim());

    assertEquals("45", page.getElementById("sum").getTextContent().trim());
    assertEquals("25", page.getElementById("max").getTextContent().trim());
  }

  @Test
  public void testTemplateLibrary() throws Exception {
    HtmlPage page = executeAllPageTests("templateLibrary");
    String pageXml = page.asXml();
    assertTrue(pageXml.replaceAll("[\n\r ]", "").contains("p{color:red}"));

    Node paragraph = page.getElementsByTagName("p").item(0);
    assertEquals("Hello world", paragraph.getTextContent().trim());
  }

  @BeforeClass
  public static void setUpOnce() throws Exception {
    server = new EndToEndServer();
    server.start();
  }

  @AfterClass
  public static void tearDownOnce() throws Exception {
    server.stop();
  }

  @Before
  public void setUp() throws Exception {
    webClient = new WebClient();
    // NicelyResynchronizingAjaxController changes XHR calls from asynchronous
    // to synchronous, saving the test from needing to wait or sleep for XHR
    // completion.
    webClient.setAjaxController(new NicelyResynchronizingAjaxController());
    webClient.waitForBackgroundJavaScript(2000);
    webClient.setHTMLParserListener(HTMLParserListener.LOG_REPORTER);
    webClient.setTimeout(3000);

    alertHandler = new CollectingAlertHandler();
    webClient.setAlertHandler(alertHandler);
    token = createToken("canonical", "john.doe");
    language = null;
    server.clearDataServiceError();
  }

//  @After
//  public void tearDown() {
//    server.clearDataServiceError();
//  }

  /**
   * Verify that the Javascript completed running.  This ensures that
   * logic errors or exceptions don't get treated as success.
   */
  @After
  public void verifyTestsFinished() {
    // Verify the format of the alerts - test method names followed by "finished"
    String testMethod = null;

    //System.out.println("=== All results " + alertHandler.getCollectedAlerts());
    for (String alert : alertHandler.getCollectedAlerts()) {
      if (testMethod == null) {
        assertFalse("Test method omitted - '" + alert + '"', "FINISHED".equals(alert));
        testMethod = alert;
      } else {
        assertEquals("test method " + testMethod + " did not finish", "FINISHED", alert);
        testMethod = null;
      }
    }

    assertNull("test method " + testMethod + " did not finish", testMethod);
  }

  /**
   * Executes a page test by loading the HTML page.
   * @param testName name of the test, which must match a gadget XML file
   *     name in test/resources/endtoend (minus .xml).
   * @param testMethod name of the javascript method to execute
   * @return the parsed HTML page
   */
  private HtmlPage executePageTest(String testName, String testMethod)
      throws IOException {
    return executePageTest(testName, testMethod, false /* caja */);
  }

  private HtmlPage executePageTest(String testName, String testMethod, boolean caja)
      throws IOException {
    if (!testName.endsWith(".xml")) {
      testName = testName + ".xml";
    }

    String gadgetUrl = EndToEndServer.SERVER_URL + '/' + testName;
    String url = EndToEndServer.GADGET_BASEURL + "?url=" + URLEncoder.encode(gadgetUrl, "UTF-8");
    BasicSecurityTokenCodec codec = new BasicSecurityTokenCodec();
    url += "&st=" + URLEncoder.encode(codec.encodeToken(token), "UTF-8");
    if (testMethod != null) {
      url += "&testMethod=" + URLEncoder.encode(testMethod, "UTF-8");
    }
    if (caja) {
      url += "&caja=1&libs=caja";
    }

    url += "&nocache=1";
    if (language != null) {
      url += "&lang=" + language;
    }

    Page page = webClient.getPage(url);
    if (!(page instanceof HtmlPage)) {
      fail("Got wrong page type. Was: " + page.getWebResponse().getContentType());
    }
    webClient.waitForBackgroundJavaScript(3000);
    return (HtmlPage) page;
  }

  /**
   * Executes all page test in a single XML file.
   * @param testName name of the test, which must match a gadget XML file
   *     name in test/resources/endtoend (minus .xml).
   * @throws IOException
   */
  private HtmlPage executeAllPageTests(String testName) throws IOException {
      return executePageTest(testName, "all", false);
  }

  /**
   * Executes all page test in a single XML file injecting a flag to cajole the test first.
   * @param testName name of the test, which must match a gadget XML file
   *     name in test/resources/endtoend (minus .xml).
   * @throws IOException
   */
    private HtmlPage executeAllPageTests(String testName, boolean caja) throws IOException {
        return executePageTest(testName, "all", caja);
  }

  private BasicSecurityToken createToken(String owner, String viewer)
      throws BlobCrypterException {
    return new BasicSecurityToken(owner, viewer, "test", "domain", "appUrl", "1", "default", null, null);
  }
}


text:
struct Human;

fn main() {
    let _x: ! = unsafe {
        std::mem::transmute::<Human, !>(Human) //~ ERROR entering unreachable code
    };
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using ClientDependency.Core;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
using Umbraco.Core.Strings.Css;
using Umbraco.Web.Composing;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi;
using Umbraco.Web.WebApi.Filters;
using Umbraco.Web.Trees;
using Stylesheet = Umbraco.Core.Models.Stylesheet;
using StylesheetRule = Umbraco.Web.Models.ContentEditing.StylesheetRule;
using CharArrays = Umbraco.Core.Constants.CharArrays;

namespace Umbraco.Web.Editors
{
    // TODO: Put some exception filters in our webapi to return 404 instead of 500 when we throw ArgumentNullException
    // ref: https://www.exceptionnotfound.net/the-asp-net-web-api-exception-handling-pipeline-a-guided-tour/
    [PluginController("UmbracoApi")]
    [PrefixlessBodyModelValidator]
    [UmbracoApplicationAuthorize(Core.Constants.Applications.Settings)]
    public class CodeFileController : BackOfficeNotificationsController
    {
        public CodeFileController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper)
            : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
        {
        }

        /// <summary>
        /// Used to create a brand new file
        /// </summary>
        /// <param name="type">This is a string but will be 'scripts' 'partialViews', 'partialViewMacros'</param>
        /// <param name="display"></param>
        /// <returns>Will return a simple 200 if file creation succeeds</returns>
        [ValidationFilter]
        public HttpResponseMessage PostCreate(string type, CodeFileDisplay display)
        {
            if (display == null) throw new ArgumentNullException("display");
            if (string.IsNullOrWhiteSpace(type)) throw new ArgumentException("Value cannot be null or whitespace.", "type");

            switch (type)
            {
                case Core.Constants.Trees.PartialViews:
                    var view = new PartialView(PartialViewType.PartialView, display.VirtualPath);
                    view.Content = display.Content;
                    var result = Services.FileService.CreatePartialView(view, display.Snippet, Security.CurrentUser.Id);
                    return result.Success == true ? Request.CreateResponse(HttpStatusCode.OK) : Request.CreateNotificationValidationErrorResponse(result.Exception.Message);

                case Core.Constants.Trees.PartialViewMacros:
                    var viewMacro = new PartialView(PartialViewType.PartialViewMacro, display.VirtualPath);
                    viewMacro.Content = display.Content;
                    var resultMacro = Services.FileService.CreatePartialViewMacro(viewMacro, display.Snippet, Security.CurrentUser.Id);
                    return resultMacro.Success == true ? Request.CreateResponse(HttpStatusCode.OK) : Request.CreateNotificationValidationErrorResponse(resultMacro.Exception.Message);

                case Core.Constants.Trees.Scripts:
                    var script = new Script(display.VirtualPath);
                    Services.FileService.SaveScript(script, Security.CurrentUser.Id);
                    return Request.CreateResponse(HttpStatusCode.OK);

                default:
                    return Request.CreateResponse(HttpStatusCode.NotFound);
            }
        }

        /// <summary>
        /// Used to create a container/folder in 'partialViews', 'partialViewMacros', 'scripts' or 'stylesheets'
        /// </summary>
        /// <param name="type">'partialViews', 'partialViewMacros' or 'scripts'</param>
        /// <param name="parentId">The virtual path of the parent.</param>
        /// <param name="name">The name of the container/folder</param>
        /// <returns></returns>
        [HttpPost]
        public HttpResponseMessage PostCreateContainer(string type, string parentId, string name)
        {
            if (string.IsNullOrWhiteSpace(type)) throw new ArgumentException("Value cannot be null or whitespace.", "type");
            if (string.IsNullOrWhiteSpace(parentId)) throw new ArgumentException("Value cannot be null or whitespace.", "parentId");
            if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException("Value cannot be null or whitespace.", "name");
            if (name.ContainsAny(Path.GetInvalidPathChars())) {
                return Request.CreateNotificationValidationErrorResponse(Services.TextService.Localize("codefile/createFolderIllegalChars"));
            }

            // if the parentId is root (-1) then we just need an empty string as we are
            // creating the path below and we don't want -1 in the path
            if (parentId == Core.Constants.System.RootString)
            {
                parentId = string.Empty;
            }

            name = System.Web.HttpUtility.UrlDecode(name);

            if (parentId.IsNullOrWhiteSpace() == false)
            {
                parentId = System.Web.HttpUtility.UrlDecode(parentId);
                name = parentId.EnsureEndsWith("/") + name;
            }

            var virtualPath = string.Empty;
            switch (type)
            {
                case Core.Constants.Trees.PartialViews:
                    virtualPath = NormalizeVirtualPath(name, SystemDirectories.PartialViews);
                    Services.FileService.CreatePartialViewFolder(virtualPath);
                    break;
                case Core.Constants.Trees.PartialViewMacros:
                    virtualPath = NormalizeVirtualPath(name, SystemDirectories.MacroPartials);
                    Services.FileService.CreatePartialViewMacroFolder(virtualPath);
                    break;
                case Core.Constants.Trees.Scripts:
                    virtualPath = NormalizeVirtualPath(name, SystemDirectories.Scripts);
                    Services.FileService.CreateScriptFolder(virtualPath);
                    break;
                case Core.Constants.Trees.Stylesheets:
                    virtualPath = NormalizeVirtualPath(name, SystemDirectories.Css);
                    Services.FileService.CreateStyleSheetFolder(virtualPath);
                    break;

            }

            return Request.CreateResponse(HttpStatusCode.OK, new CodeFileDisplay
            {
                VirtualPath = virtualPath,
                Path = Url.GetTreePathFromFilePath(virtualPath)
            });
        }

        /// <summary>
        /// Used to get a specific file from disk via the FileService
        /// </summary>
        /// <param name="type">This is a string but will be 'scripts' 'partialViews', 'partialViewMacros' or 'stylesheets'</param>
        /// <param name="virtualPath">The filename or URL encoded path of the file to open</param>
        /// <returns>The file and its contents from the virtualPath</returns>
        public CodeFileDisplay GetByPath(string type, string virtualPath)
        {
            if (string.IsNullOrWhiteSpace(type)) throw new ArgumentException("Value cannot be null or whitespace.", "type");
            if (string.IsNullOrWhiteSpace(virtualPath)) throw new ArgumentException("Value cannot be null or whitespace.", "virtualPath");

            virtualPath = System.Web.HttpUtility.UrlDecode(virtualPath);

            switch (type)
            {
                case Core.Constants.Trees.PartialViews:
                    var view = Services.FileService.GetPartialView(virtualPath);
                    if (view != null)
                    {
                        var display = Mapper.Map<IPartialView, CodeFileDisplay>(view);
                        display.FileType = Core.Constants.Trees.PartialViews;
                        display.Path = Url.GetTreePathFromFilePath(view.Path);
                        display.Id = System.Web.HttpUtility.UrlEncode(view.Path);
                        return display;
                    }
                    throw new HttpResponseException(HttpStatusCode.NotFound);

                case Core.Constants.Trees.PartialViewMacros:
                    var viewMacro = Services.FileService.GetPartialViewMacro(virtualPath);
                    if (viewMacro != null)
                    {
                        var display = Mapper.Map<IPartialView, CodeFileDisplay>(viewMacro);
                        display.FileType = Core.Constants.Trees.PartialViewMacros;
                        display.Path = Url.GetTreePathFromFilePath(viewMacro.Path);
                        display.Id = System.Web.HttpUtility.UrlEncode(viewMacro.Path);
                        return display;
                    }
                    throw new HttpResponseException(HttpStatusCode.NotFound);

                case Core.Constants.Trees.Scripts:
                    var script = Services.FileService.GetScriptByName(virtualPath);
                    if (script != null)
                    {
                        var display = Mapper.Map<Script, CodeFileDisplay>(script);
                        display.FileType = Core.Constants.Trees.Scripts;
                        display.Path = Url.GetTreePathFromFilePath(script.Path);
                        display.Id = System.Web.HttpUtility.UrlEncode(script.Path);
                        return display;
                    }
                    throw new HttpResponseException(HttpStatusCode.NotFound);

                case Core.Constants.Trees.Stylesheets:
                    var stylesheet = Services.FileService.GetStylesheetByName(virtualPath);
                    if (stylesheet != null)
                    {
                        var display = Mapper.Map<Stylesheet, CodeFileDisplay>(stylesheet);
                        display.FileType = Core.Constants.Trees.Stylesheets;
                        display.Path = Url.GetTreePathFromFilePath(stylesheet.Path);
                        display.Id = System.Web.HttpUtility.UrlEncode(stylesheet.Path);
                        return display;
                    }
                    throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            throw new HttpResponseException(HttpStatusCode.NotFound);
        }

        /// <summary>
        /// Used to get a list of available templates/snippets to base a new Partial View or Partial View Macro from
        /// </summary>
        /// <param name="type">This is a string but will be 'partialViews', 'partialViewMacros'</param>
        /// <returns>Returns a list of <see cref="SnippetDisplay"/> if a correct type is sent</returns>
        public IEnumerable<SnippetDisplay> GetSnippets(string type)
        {
            if (string.IsNullOrWhiteSpace(type)) throw new ArgumentException("Value cannot be null or whitespace.", "type");

            IEnumerable<string> snippets;
            switch (type)
            {
                case Core.Constants.Trees.PartialViews:
                    snippets = Services.FileService.GetPartialViewSnippetNames(
                        //ignore these - (this is taken from the logic in "PartialView.ascx.cs")
                        "Gallery",
                        "ListChildPagesFromChangeableSource",
                        "ListChildPagesOrderedByProperty",
                        "ListImagesFromMediaFolder");
                    break;
                case Core.Constants.Trees.PartialViewMacros:
                    snippets = Services.FileService.GetPartialViewSnippetNames();
                    break;
                default:
                    throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            return snippets.Select(snippet => new SnippetDisplay() {Name = snippet.SplitPascalCasing().ToFirstUpperInvariant(), FileName = snippet});
        }

        /// <summary>
        /// Used to scaffold the json object for the editors for 'scripts', 'partialViews', 'partialViewMacros' and 'stylesheets'
        /// </summary>
        /// <param name="type">This is a string but will be 'scripts' 'partialViews', 'partialViewMacros' or 'stylesheets'</param>
        /// <param name="id"></param>
        /// <param name="snippetName"></param>
        /// <returns></returns>
        public CodeFileDisplay GetScaffold(string type, string id, string snippetName = null)
        {
            if (string.IsNullOrWhiteSpace(type)) throw new ArgumentException("Value cannot be null or whitespace.", "type");
            if (string.IsNullOrWhiteSpace(id)) throw new ArgumentException("Value cannot be null or whitespace.", "id");

            CodeFileDisplay codeFileDisplay;

            switch (type)
            {
                case Core.Constants.Trees.PartialViews:
                    codeFileDisplay = Mapper.Map<IPartialView, CodeFileDisplay>(new PartialView(PartialViewType.PartialView, string.Empty));
                    codeFileDisplay.VirtualPath = SystemDirectories.PartialViews;
                    if (snippetName.IsNullOrWhiteSpace() == false)
                        codeFileDisplay.Content = Services.FileService.GetPartialViewSnippetContent(snippetName);
                    break;
                case Core.Constants.Trees.PartialViewMacros:
                    codeFileDisplay = Mapper.Map<IPartialView, CodeFileDisplay>(new PartialView(PartialViewType.PartialViewMacro, string.Empty));
                    codeFileDisplay.VirtualPath = SystemDirectories.MacroPartials;
                    if (snippetName.IsNullOrWhiteSpace() == false)
                        codeFileDisplay.Content = Services.FileService.GetPartialViewMacroSnippetContent(snippetName);
                    break;
                case Core.Constants.Trees.Scripts:
                    codeFileDisplay = Mapper.Map<Script, CodeFileDisplay>(new Script(string.Empty));
                    codeFileDisplay.VirtualPath = SystemDirectories.Scripts;
                    break;
                case Core.Constants.Trees.Stylesheets:
                    codeFileDisplay = Mapper.Map<Stylesheet, CodeFileDisplay>(new Stylesheet(string.Empty));
                    codeFileDisplay.VirtualPath = SystemDirectories.Css;
                    break;
                default:
                    throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Unsupported editortype"));
            }

            // Make sure that the root virtual path ends with '/'
            codeFileDisplay.VirtualPath = codeFileDisplay.VirtualPath.EnsureEndsWith("/");

            if (id != Core.Constants.System.RootString)
            {
                codeFileDisplay.VirtualPath += id.TrimStart(CharArrays.ForwardSlash).EnsureEndsWith("/");
                //if it's not new then it will have a path, otherwise it won't
                codeFileDisplay.Path = Url.GetTreePathFromFilePath(id);
            }

            codeFileDisplay.VirtualPath = codeFileDisplay.VirtualPath.TrimStart("~");
            codeFileDisplay.FileType = type;
            return codeFileDisplay;
        }

        /// <summary>
        /// Used to delete a specific file from disk via the FileService
        /// </summary>
        /// <param name="type">This is a string but will be 'scripts' 'partialViews', 'partialViewMacros' or 'stylesheets'</param>
        /// <param name="virtualPath">The filename or URL encoded path of the file to delete</param>
        /// <returns>Will return a simple 200 if file deletion succeeds</returns>
        [HttpDelete]
        [HttpPost]
        public HttpResponseMessage Delete(string type, string virtualPath)
        {
            if (string.IsNullOrWhiteSpace(type)) throw new ArgumentException("Value cannot be null or whitespace.", "type");
            if (string.IsNullOrWhiteSpace(virtualPath)) throw new ArgumentException("Value cannot be null or whitespace.", "virtualPath");

            virtualPath = System.Web.HttpUtility.UrlDecode(virtualPath);

            switch (type)
            {
                case Core.Constants.Trees.PartialViews:
                    if (IsDirectory(virtualPath, SystemDirectories.PartialViews))
                    {
                        Services.FileService.DeletePartialViewFolder(virtualPath);
                        return Request.CreateResponse(HttpStatusCode.OK);
                    }
                    if (Services.FileService.DeletePartialView(virtualPath, Security.CurrentUser.Id))
                    {
                        return Request.CreateResponse(HttpStatusCode.OK);
                    }
                    return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Partial View or folder found with the specified path");

                case Core.Constants.Trees.PartialViewMacros:
                    if (IsDirectory(virtualPath, SystemDirectories.MacroPartials))
                    {
                        Services.FileService.DeletePartialViewMacroFolder(virtualPath);
                        return Request.CreateResponse(HttpStatusCode.OK);
                    }
                    if (Services.FileService.DeletePartialViewMacro(virtualPath, Security.CurrentUser.Id))
                    {
                        return Request.CreateResponse(HttpStatusCode.OK);
                    }
                    return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Partial View Macro or folder found with the specified path");

                case Core.Constants.Trees.Scripts:
                    if (IsDirectory(virtualPath, SystemDirectories.Scripts))
                    {
                        Services.FileService.DeleteScriptFolder(virtualPath);
                        return Request.CreateResponse(HttpStatusCode.OK);
                    }
                    if (Services.FileService.GetScriptByName(virtualPath) != null)
                    {
                        Services.FileService.DeleteScript(virtualPath, Security.CurrentUser.Id);
                        return Request.CreateResponse(HttpStatusCode.OK);
                    }
                    return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Script or folder found with the specified path");

                case Core.Constants.Trees.Stylesheets:
                    if (IsDirectory(virtualPath, SystemDirectories.Css))
                    {
                        Services.FileService.DeleteStyleSheetFolder(virtualPath);
                        return Request.CreateResponse(HttpStatusCode.OK);
                    }
                    if (Services.FileService.GetStylesheetByName(virtualPath) != null)
                    {
                        Services.FileService.DeleteStylesheet(virtualPath, Security.CurrentUser.Id);
                        return Request.CreateResponse(HttpStatusCode.OK);
                    }
                    return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Stylesheet found with the specified path");

                default:
                    return Request.CreateResponse(HttpStatusCode.NotFound);
            }

            throw new HttpResponseException(HttpStatusCode.NotFound);
        }

        /// <summary>
        /// Used to create or update a 'partialview', 'partialviewmacro', 'script' or 'stylesheets' file
        /// </summary>
        /// <param name="display"></param>
        /// <returns>The updated CodeFileDisplay model</returns>
        public CodeFileDisplay PostSave(CodeFileDisplay display)
        {
            if (display == null) throw new ArgumentNullException("display");

            if (ModelState.IsValid == false)
            {
                throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            switch (display.FileType)
            {
                case Core.Constants.Trees.PartialViews:
                    var partialViewResult = CreateOrUpdatePartialView(display);
                    if (partialViewResult.Success)
                    {
                        display = Mapper.Map(partialViewResult.Result, display);
                        display.Path = Url.GetTreePathFromFilePath(partialViewResult.Result.Path);
                        display.Id = System.Web.HttpUtility.UrlEncode(partialViewResult.Result.Path);
                        return display;
                    }

                    display.AddErrorNotification(
                        Services.TextService.Localize("speechBubbles/partialViewErrorHeader"),
                        Services.TextService.Localize("speechBubbles/partialViewErrorText"));
                    break;

                case Core.Constants.Trees.PartialViewMacros:
                    var partialViewMacroResult = CreateOrUpdatePartialViewMacro(display);
                    if (partialViewMacroResult.Success)
                    {
                        display = Mapper.Map(partialViewMacroResult.Result, display);
                        display.Path = Url.GetTreePathFromFilePath(partialViewMacroResult.Result.Path);
                        display.Id = System.Web.HttpUtility.UrlEncode(partialViewMacroResult.Result.Path);
                        return display;
                    }

                    display.AddErrorNotification(
                        Services.TextService.Localize("speechBubbles/partialViewErrorHeader"),
                        Services.TextService.Localize("speechBubbles/partialViewErrorText"));
                    break;

                case Core.Constants.Trees.Scripts:

                    var scriptResult = CreateOrUpdateScript(display);
                    display = Mapper.Map(scriptResult, display);
                    display.Path = Url.GetTreePathFromFilePath(scriptResult.Path);
                    display.Id = System.Web.HttpUtility.UrlEncode(scriptResult.Path);
                    return display;

                //display.AddErrorNotification(
                //    Services.TextService.Localize("speechBubbles/partialViewErrorHeader"),
                //    Services.TextService.Localize("speechBubbles/partialViewErrorText"));

                case Core.Constants.Trees.Stylesheets:

                    var stylesheetResult = CreateOrUpdateStylesheet(display);
                    display = Mapper.Map(stylesheetResult, display);
                    display.Path = Url.GetTreePathFromFilePath(stylesheetResult.Path);
                    display.Id = System.Web.HttpUtility.UrlEncode(stylesheetResult.Path);
                    return display;

                default:
                    throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            return display;
        }

        /// <summary>
        /// Extracts "umbraco style rules" from a style sheet
        /// </summary>
        /// <param name="data">The style sheet data</param>
        /// <returns>The style rules</returns>
        public StylesheetRule[] PostExtractStylesheetRules(StylesheetData data)
        {
            if (data.Content.IsNullOrWhiteSpace())
            {
                return new StylesheetRule[0];
            }

            return StylesheetHelper.ParseRules(data.Content)?.Select(rule => new StylesheetRule
            {
                Name = rule.Name,
                Selector = rule.Selector,
                Styles = rule.Styles
            }).ToArray();
        }

        /// <summary>
        /// Creates a style sheet from CSS and style rules
        /// </summary>
        /// <param name="data">The style sheet data</param>
        /// <returns>The style sheet combined from the CSS and the rules</returns>
        /// <remarks>
        /// Any "umbraco style rules" in the CSS will be removed and replaced with the rules passed in <see cref="data"/>
        /// </remarks>
        public string PostInterpolateStylesheetRules(StylesheetData data)
        {
            // first remove all existing rules
            var existingRules = data.Content.IsNullOrWhiteSpace()
                ? new Core.Strings.Css.StylesheetRule[0]
                : StylesheetHelper.ParseRules(data.Content).ToArray();
            foreach (var rule in existingRules)
            {
                data.Content = StylesheetHelper.ReplaceRule(data.Content, rule.Name, null);
            }

            data.Content = data.Content.TrimEnd(CharArrays.LineFeedCarriageReturn);

            // now add all the posted rules
            if (data.Rules != null && data.Rules.Any())
            {
                foreach (var rule in data.Rules)
                {
                    data.Content = StylesheetHelper.AppendRule(data.Content, new Core.Strings.Css.StylesheetRule
                    {
                        Name = rule.Name,
                        Selector = rule.Selector,
                        Styles = rule.Styles
                    });
                }

                data.Content += Environment.NewLine;
            }

            return data.Content;
        }

        /// <summary>
        /// Create or Update a Script
        /// </summary>
        /// <param name="display"></param>
        /// <returns></returns>
        /// <remarks>
        /// It's important to note that Scripts are DIFFERENT from cshtml files since scripts use IFileSystem and cshtml files
        /// use a normal file system because they must exist on a real file system for ASP.NET to work.
        /// </remarks>
        private Script CreateOrUpdateScript(CodeFileDisplay display)
        {
            return CreateOrUpdateFile(display, ".js", Current.FileSystems.ScriptsFileSystem,
                name => Services.FileService.GetScriptByName(name),
                (script, userId) => Services.FileService.SaveScript(script, userId),
                name => new Script(name));
        }

        private Stylesheet CreateOrUpdateStylesheet(CodeFileDisplay display)
        {
            return CreateOrUpdateFile(display, ".css", Current.FileSystems.StylesheetsFileSystem,
                name => Services.FileService.GetStylesheetByName(name),
                (stylesheet, userId) => Services.FileService.SaveStylesheet(stylesheet, userId),
                name => new Stylesheet(name)
            );
        }

        private T CreateOrUpdateFile<T>(CodeFileDisplay display, string extension, IFileSystem fileSystem,
            Func<string, T> getFileByName, Action<T, int> saveFile, Func<string, T> createFile) where T : Core.Models.File
        {
            //must always end with the correct extension
            display.Name = EnsureCorrectFileExtension(display.Name, extension);

            var virtualPath = display.VirtualPath ?? string.Empty;
            // this is all weird, should be using relative paths everywhere!
            var relPath = fileSystem.GetRelativePath(virtualPath);

            if (relPath.EndsWith(extension) == false)
            {
                //this would typically mean it's new
                relPath = relPath.IsNullOrWhiteSpace()
                    ? relPath + display.Name
                    : relPath.EnsureEndsWith('/') + display.Name;
            }

            var file = getFileByName(relPath);
            if (file != null)
            {
                // might need to find the path
                var orgPath = file.OriginalPath.Substring(0, file.OriginalPath.IndexOf(file.Name));
                file.Path = orgPath + display.Name;

                file.Content = display.Content;
                //try/catch? since this doesn't return an Attempt?
                saveFile(file, Security.CurrentUser.Id);
            }
            else
            {
                file = createFile(relPath);
                file.Content = display.Content;
                saveFile(file, Security.CurrentUser.Id);
            }

            return file;
        }

        private Attempt<IPartialView> CreateOrUpdatePartialView(CodeFileDisplay display)
        {
            return CreateOrUpdatePartialView(display, SystemDirectories.PartialViews,
                Services.FileService.GetPartialView, Services.FileService.SavePartialView, Services.FileService.CreatePartialView);
        }

        private Attempt<IPartialView> CreateOrUpdatePartialViewMacro(CodeFileDisplay display)
        {
            return CreateOrUpdatePartialView(display, SystemDirectories.MacroPartials,
                Services.FileService.GetPartialViewMacro, Services.FileService.SavePartialViewMacro, Services.FileService.CreatePartialViewMacro);
        }

        /// <summary>
        /// Helper method to take care of persisting partial views or partial view macros - so we're not duplicating the same logic
        /// </summary>
        /// <param name="display"></param>
        /// <param name="systemDirectory"></param>
        /// <param name="getView"></param>
        /// <param name="saveView"></param>
        /// <param name="createView"></param>
        /// <returns></returns>
        private Attempt<IPartialView> CreateOrUpdatePartialView(
            CodeFileDisplay display, string systemDirectory,
            Func<string, IPartialView> getView,
            Func<IPartialView, int, Attempt<IPartialView>> saveView,
            Func<IPartialView, string, int, Attempt<IPartialView>> createView)
        {
            //must always end with the correct extension
            display.Name = EnsureCorrectFileExtension(display.Name, ".cshtml");

            Attempt<IPartialView> partialViewResult;
            var virtualPath = NormalizeVirtualPath(display.VirtualPath, systemDirectory);
            var view = getView(virtualPath);
            if (view != null)
            {
                // might need to find the path
                var orgPath = view.OriginalPath.Substring(0, view.OriginalPath.IndexOf(view.Name));
                view.Path = orgPath + display.Name;

                view.Content = display.Content;
                partialViewResult = saveView(view, Security.CurrentUser.Id);
            }
            else
            {
                view = new PartialView(PartialViewType.PartialView, virtualPath + display.Name);
                view.Content = display.Content;
                partialViewResult = createView(view, display.Snippet, Security.CurrentUser.Id);
            }

            return partialViewResult;
        }

        private string NormalizeVirtualPath(string virtualPath, string systemDirectory)
        {
            if (virtualPath.IsNullOrWhiteSpace())
                return string.Empty;

            systemDirectory = systemDirectory.TrimStart("~");
            systemDirectory = systemDirectory.Replace('\\', '/');
            virtualPath = virtualPath.TrimStart("~");
            virtualPath = virtualPath.Replace('\\', '/');
            virtualPath = virtualPath.ReplaceFirst(systemDirectory, string.Empty);

            return virtualPath;
        }

        private string EnsureCorrectFileExtension(string value, string extension)
        {
            if (value.EndsWith(extension) == false)
                value += extension;

            return value;
        }

        private bool IsDirectory(string virtualPath, string systemDirectory)
        {
            var path = IOHelper.MapPath(systemDirectory + "/" + virtualPath);
            var dirInfo = new DirectoryInfo(path);

            // If you turn off indexing in Windows this will have the attribute:
            // `FileAttributes.Directory | FileAttributes.NotContentIndexed`
            return (dirInfo.Attributes & FileAttributes.Directory) != 0;
        }

        // this is an internal class for passing stylesheet data from the client to the controller while editing
        public class StylesheetData
        {
            public string Content { get; set; }

            public StylesheetRule[] Rules { get; set; }
        }
    }
}


text:
define mw_prefix='{$wgDBprefix}';

ALTER TABLE &mw_prefix.archive ADD ar_content_format VARCHAR2(64);


text:
define([], function() {

	var Signal = mini.Class.subclass({
		initialize: function(eventManager, messageTag) {
			this._eventManager = eventManager;
			this._messageTag = messageTag;
		},
		emit: function(/* arguments */) {
			this._eventManager.send(this._messageTag, arguments);
		}
	});

	var Slot = mini.Class.subclass({
		initialize: function() {
			this._callback = function() {};
			this._filter = function() { return true; };
			this._map = function(/* arguments */) { return arguments; };
		},
		callback: function(callback) {
			this._callback = callback;

			return this;
		},
		filter: function(filter) {
			this._filter = filter;

			return this;
		},
		map: function(map) {
			this._map = map;

			return this;
		},
		process: function(args) {
			var a = this._map.apply(this, args);
			if(this._filter.apply(this, a))
				this._callback.apply(this, a);
		}
	});

	var EventManager = mini.Class.subclass({
		initialize: function() {
			this.clear();
		},
		signal: function(messageTag) {
			this._signals[messageTag] = this._signals[messageTag] || new Signal(this, messageTag);

			return this._signals[messageTag];
		},
		slot: function(messageTag) {
			var slot = new Slot();

			if(!this._slots[messageTag])
				this._slots[messageTag] = [slot];
			else
				this._slots[messageTag].push(slot);

			return slot;
		},
		clear: function() {
			this._signals = {};
			this._slots = {};
		},
		send: function(messageTag, args) {
			var slots = this._slots[messageTag];
			if(slots)
				for(var i = 0; i < slots.length; i++) {
					var slot = slots[i];

					slot.process(args);
				}
		}
	});

	return EventManager;
});


text:
layout: page
title: Bell - Walsh Wedding
date: 2016-05-24
author: Roy Gillespie
tags: weekly links, java
status: published
summary: Praesent quis massa id sapien egestas.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 01/12/2017
  endDate: 01/13/2017
  ctyhocn: CWIVBHX
  groupCode: BWW
published: true
---
Cras ut ante gravida lectus lobortis posuere et mattis ex. Nunc egestas aliquam metus non bibendum. Donec nisi enim, interdum a felis quis, luctus dictum odio. Aenean laoreet, nibh faucibus interdum volutpat, sem metus mattis nulla, in rutrum tellus odio pulvinar nulla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed dui diam, malesuada id sapien et, dignissim aliquam nunc. Ut faucibus lobortis erat ac consequat. Suspendisse ac nibh et ante ullamcorper cursus nec eu mauris.
Morbi commodo libero orci, ut malesuada odio interdum et. Aenean nisi sem, commodo convallis magna vel, molestie tempor tellus. Aenean eget lacinia mi, quis semper diam. Cras condimentum, lectus id ullamcorper posuere, tortor velit rutrum mi, blandit facilisis arcu lorem quis ipsum. Praesent euismod sem in porta egestas. In finibus, orci vel dapibus feugiat, ex sem tincidunt quam, non scelerisque orci tellus at massa. Vivamus varius massa eget porttitor malesuada. Morbi pharetra in magna ut tristique. Nulla imperdiet ipsum id eros porttitor, vel varius turpis dapibus.

* Donec eget diam in sapien tristique iaculis id ut nisl
* Sed quis risus gravida, tempor libero in, tincidunt elit.

Duis finibus turpis sit amet risus ullamcorper facilisis. Sed iaculis urna neque, ut fermentum nulla tristique non. Aliquam non ullamcorper nunc. Fusce tempor, est quis venenatis facilisis, velit metus interdum ex, ac fermentum nibh quam sed quam. Aenean scelerisque molestie mattis. Integer malesuada viverra vestibulum. In pulvinar ullamcorper est, aliquam vulputate urna consequat vel. Praesent magna magna, auctor finibus eros at, pharetra sollicitudin sapien. In mauris ligula, hendrerit et nisi et, vestibulum iaculis ex. Cras at ornare tellus.


text:
React Hot Boilerplate
=====================

The minimal dev environment to enable live-editing React components. This project comes with Redux and Semantic-UI.

### Usage

```
npm install
npm start
open http://localhost:3000
```

Now edit `src/App.js`.
Your changes will appear without reloading the browser like in [this video](http://vimeo.com/100010922).

### Linting

This boilerplate project includes React-friendly ESLint configuration.

```
npm run lint
```

### Using `0.0.0.0` as Host

You may want to change the host in `server.js` and `webpack.config.js` from `localhost` to `0.0.0.0` to allow access from same WiFi network. This is not enabled by default because it is reported to cause problems on Windows. This may also be useful if you're using a VM.

### Deploy on Heroku

First create the app on [heroku]()

Then add the heroku remote to you project :

``` bash
heroku git:remote -a rrsui
```

Build the bundle:
``` bash
npm run build
```

And send:
``` bash
git commit -am "deployment message"
```
``` bash
git push heroku master
```

### About Semantic-UI
Semantic-UI needs a compilation step with gulp. To simplify things, I precompiled it and included the minified files in the index.html. However, if you wish to recompile it by yourself (in the aim to change the current Font for example), you can go here :
[official doc](http://semantic-ui.com/introduction/getting-started.html)

### Dependencies

* React
* Webpack
* [webpack-dev-server](https://github.com/webpack/webpack-dev-server)
* [babel-loader](https://github.com/babel/babel-loader)
* [react-hot-loader](https://github.com/gaearon/react-hot-loader)


text:
--TEST--
Test array_diff_uassoc() function : usage variation -Passing classWithoutToString (handling fatal error) to callback
--FILE--
<?php
/* Prototype  : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func)
 * Description: Computes the difference of arrays with additional index check which is performed by a
 * 				user supplied callback function
 * Source code: ext/standard/array.c
 */

echo "*** Testing array_diff_uassoc() : usage variation ***\n";

//Initialize array
$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
$array2 = array("a" => "green", "yellow", "red");

class classWithoutToString
{
}

// Define error handler
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
	if (error_reporting() != 0) {
		// report non-silenced errors
		echo "Error: $err_no - $err_msg, $filename($linenum)\n";
	}
}
set_error_handler('test_error_handler');

$value = new classWithoutToString();
var_dump( array_diff_uassoc($array1, $array2, $value) );

?>
===DONE===
--EXPECTF--
*** Testing array_diff_uassoc() : usage variation ***
Error: 2 - array_diff_uassoc() expects parameter 3 to be a valid callback, no array or string given, %s(%d)
NULL
===DONE===


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Index (Heliocentric Trajectories Web Services API v0.9.14)</title>
<meta name="date" content="2015-07-28">
<link rel="stylesheet" type="text/css" href="./stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

C D F G H L O R S T V

C

clone() - Method in class gov.nasa.gsfc.spdf.helio.ObjectDescription

CoordinateSystem - Enum in gov.nasa.gsfc.spdf.helio

This class represents the

 coordinate systems supported by the
 HeliocentricTrajectoriesInterface services.

D

DataResult - Class in gov.nasa.gsfc.spdf.helio

This class represents the result of a Request to the
 HeliocentricTrajectoriesInterface services.

DataResult() - Constructor for class gov.nasa.gsfc.spdf.helio.DataResult

Constructs a default DataResult with no data.

DataResult(ResultStatusCode, ResultStatusSubCode, List<String>) - Constructor for class gov.nasa.gsfc.spdf.helio.DataResult

Constructs a DataResult with the given values.

DataResult(ResultStatusCode, ResultStatusSubCode, List<String>, List<Trajectory>) - Constructor for class gov.nasa.gsfc.spdf.helio.DataResult

Constructs a DataResult with the given values.

F

FileResult - Class in gov.nasa.gsfc.spdf.helio

This class represents the result of a Request to the
 HeliocentricTrajectoriesInterface service.

FileResult() - Constructor for class gov.nasa.gsfc.spdf.helio.FileResult

Constructs a default FileResult with no data.

FileResult(ResultStatusCode, ResultStatusSubCode, List<String>, List<String>) - Constructor for class gov.nasa.gsfc.spdf.helio.FileResult

Constructs a FileResult with the given values.

fromValue(int) - Static method in enum gov.nasa.gsfc.spdf.helio.CoordinateSystem

Provides the CoordinateSystem corresponding to the given integer
 value.

fromValue(int) - Static method in enum gov.nasa.gsfc.spdf.helio.ResultStatusCode

Provides the ResultStatusCode corresponding to the given integer
 value.

fromValue(int) - Static method in enum gov.nasa.gsfc.spdf.helio.ResultStatusSubCode

Provides the ResultStatusSubCode corresponding to the given
 integer value.

G

getAcknowledgements() - Method in interface gov.nasa.gsfc.spdf.helio.HeliocentricTrajectoriesInterface

This method provides a list of URLs that can be used by clients
 to acknowledge the use of these Web Services.

getAllObjects() - Method in interface gov.nasa.gsfc.spdf.helio.HeliocentricTrajectoriesInterface

Provides the names of all the ObjectDescriptions available
 through this Web Service.

getBeginDate() - Method in class gov.nasa.gsfc.spdf.helio.Request

Gets the beginDate of the requested trajectory.

getCoordinateSystem() - Method in class gov.nasa.gsfc.spdf.helio.Request

Gets the CoordinateSystem.

getCoordinateSystem() - Method in class gov.nasa.gsfc.spdf.helio.Trajectory

Gets the coordinateSystem value.

getEndDate() - Method in class gov.nasa.gsfc.spdf.helio.ObjectDescription

Gets the end date (ending date of position information) value.

getEndDate() - Method in class gov.nasa.gsfc.spdf.helio.Request

Gets the endDate of the requested trajectory.

getId() - Method in class gov.nasa.gsfc.spdf.helio.ObjectDescription

Gets the object identifier value.

getId() - Method in class gov.nasa.gsfc.spdf.helio.Trajectory

Gets the object identifier for this data.

getLatitude() - Method in class gov.nasa.gsfc.spdf.helio.Trajectory

Gets the latitude value.

getLongitude() - Method in class gov.nasa.gsfc.spdf.helio.Trajectory

Gets the longitude value.

getName() - Method in class gov.nasa.gsfc.spdf.helio.ObjectDescription

Gets the object name value.

getObjects() - Method in class gov.nasa.gsfc.spdf.helio.Request

Gets the objects.

getPrivacyAndImportantNotices() - Method in interface gov.nasa.gsfc.spdf.helio.HeliocentricTrajectoriesInterface

This method provides a list of URLs to privacy and important
 notices concerning the use of these Web Services.

getRadius() - Method in class gov.nasa.gsfc.spdf.helio.Trajectory

Gets the radius value.

getResolution() - Method in class gov.nasa.gsfc.spdf.helio.Request

Gets the resolution.

getStartDate() - Method in class gov.nasa.gsfc.spdf.helio.ObjectDescription

Gets the start date (beginning date of position information)
 value.

getStatusCode() - Method in class gov.nasa.gsfc.spdf.helio.Result

Gets the status code value.

getStatusSubCode() - Method in class gov.nasa.gsfc.spdf.helio.Result

Gets the status sub-code value.

getStatusText() - Method in class gov.nasa.gsfc.spdf.helio.Result

Gets the textual status value.

getTime() - Method in class gov.nasa.gsfc.spdf.helio.Trajectory

Gets the time values.

getTrajectories() - Method in class gov.nasa.gsfc.spdf.helio.DataResult

Gets the trajectories.

getTrajectories(Request) - Method in interface gov.nasa.gsfc.spdf.helio.HeliocentricTrajectoriesInterface

Requests trajectory information for an object.

getUrls() - Method in class gov.nasa.gsfc.spdf.helio.FileResult

Gets the URLs to the files containing the requested information.

gov.nasa.gsfc.spdf.helio - package gov.nasa.gsfc.spdf.helio

Provides a Web Service interface to NASA's
HelioWeb.

H

HeliocentricTrajectoriesInterface - Interface in gov.nasa.gsfc.spdf.helio

This interface represents the XML Web Service interface to NASA's
 HelioWeb.

HelioException - Exception in gov.nasa.gsfc.spdf.helio

This class represents exceptional conditions that may occur during
 the execution of HeliocentricTrajectories Web service operations.

HelioException() - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioException

Constructs an HelioException with null as its detail
 message.

HelioException(String) - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioException

Constructs an HelioException with the specified detail message.

HelioException(String, Throwable) - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioException

Constructs a new exception with the specified detail message and
 cause.

HelioException(Throwable) - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioException

Constructs a new exception with the specified cause and a detail
 message of {@code (cause==null ?

HelioExternalException - Exception in gov.nasa.gsfc.spdf.helio

This class represents exceptional conditions that occur during the
 execution of HeliocentricTrajectories Web service operations.

HelioExternalException() - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioExternalException

Constructs an HelioExternalException with null as its
 detail message.

HelioExternalException(String) - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioExternalException

Constructs an HelioExternalException with the specified detail
 message.

HelioExternalException(String, Throwable) - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioExternalException

Constructs a new exception with the specified detail message and
 cause.

HelioExternalException(Throwable) - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioExternalException

Constructs a new exception with the specified cause and a detail
 message of {@code (cause==null ?

HelioInternalException - Exception in gov.nasa.gsfc.spdf.helio

This class represents exceptional conditions that occur during the
 execution of HeliocentricTrajectories Web service operations.

HelioInternalException() - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioInternalException

Constructs an HelioInternalException with null as its
 detail message.

HelioInternalException(String) - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioInternalException

Constructs an HelioInternalException with the specified detail
 message.

HelioInternalException(String, Throwable) - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioInternalException

Constructs a new exception with the specified detail message
 and cause.

HelioInternalException(Throwable) - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioInternalException

Constructs a new exception with the specified cause and a detail
 message of {@code (cause==null ?

HelioResourceLimitExceededException - Exception in gov.nasa.gsfc.spdf.helio

This class represents a resource limit exceeded exceptional
 condition.

HelioResourceLimitExceededException() - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioResourceLimitExceededException

Constructs an HelioResourceLimitExceededException with
 null as its detail message.

HelioResourceLimitExceededException(String) - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioResourceLimitExceededException

Constructs an HelioResourceLimitExceededException with the
 specified detail message.

HelioResourceLimitExceededException(String, Throwable) - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioResourceLimitExceededException

Constructs a new exception with the specified detail message and
 cause.

HelioResourceLimitExceededException(Throwable) - Constructor for exception gov.nasa.gsfc.spdf.helio.HelioResourceLimitExceededException

Constructs a new exception with the specified cause and a detail
 message of {@code (cause==null ?

L

list(PrintStream) - Method in class gov.nasa.gsfc.spdf.helio.Request

Prints this object's value to the specified output stream.

O

ObjectDescription - Class in gov.nasa.gsfc.spdf.helio

This class represents an objects description.

ObjectDescription() - Constructor for class gov.nasa.gsfc.spdf.helio.ObjectDescription

Constructs a ObjectDescription with a null value.

ObjectDescription(String, String, Calendar, Calendar) - Constructor for class gov.nasa.gsfc.spdf.helio.ObjectDescription

Constructs a ObjectDescription with the given attribute values.

R

Request - Class in gov.nasa.gsfc.spdf.helio

This class represents a request for the
 HeliocentricTrajectoriesInterface.

Request() - Constructor for class gov.nasa.gsfc.spdf.helio.Request

Constructs a default Request object.

Request(List<String>, CoordinateSystem, Calendar, Calendar, int) - Constructor for class gov.nasa.gsfc.spdf.helio.Request

Constructs an Request object with the given attribute
 values.

Result - Class in gov.nasa.gsfc.spdf.helio

This class represents the result of a request to the
 HeliocentricTrajectoriesInterface service.

Result() - Constructor for class gov.nasa.gsfc.spdf.helio.Result

Constructs a Result with a default (successful) value.

Result(ResultStatusCode, ResultStatusSubCode, List<String>) - Constructor for class gov.nasa.gsfc.spdf.helio.Result

Constructs a Result with the given values.

ResultStatusCode - Enum in gov.nasa.gsfc.spdf.helio

This class represents Result status code values.

ResultStatusSubCode - Enum in gov.nasa.gsfc.spdf.helio

This class represents Result status sub-code values.

S

setBeginDate(Calendar) - Method in class gov.nasa.gsfc.spdf.helio.Request

Sets the beginDate of the requested trajectory (any time value is
 ignored).

setCoordinateSystem(CoordinateSystem) - Method in class gov.nasa.gsfc.spdf.helio.Request

Sets the CoordinateSystem.

setCoordinateSystem(CoordinateSystem) - Method in class gov.nasa.gsfc.spdf.helio.Trajectory

Sets the coordinateSystem value.

setEndDate(Calendar) - Method in class gov.nasa.gsfc.spdf.helio.ObjectDescription

Sets the end date (ending date of position information)
 to the given value.

setEndDate(Calendar) - Method in class gov.nasa.gsfc.spdf.helio.Request

Sets the endDate of the requested trajectory (any time value is
 ignored).

setId(String) - Method in class gov.nasa.gsfc.spdf.helio.ObjectDescription

Sets the object identifier to the given value.

setId(String) - Method in class gov.nasa.gsfc.spdf.helio.Trajectory

Sets the object identifier to the given value.

setLatitude(List<Double>) - Method in class gov.nasa.gsfc.spdf.helio.Trajectory

Set the latitude value.

setLongitude(List<Double>) - Method in class gov.nasa.gsfc.spdf.helio.Trajectory

Set the longitude value.

setName(String) - Method in class gov.nasa.gsfc.spdf.helio.ObjectDescription

Sets the object name to the given value.

setObjects(List<String>) - Method in class gov.nasa.gsfc.spdf.helio.Request

Sets the objects.

setRadius(List<Double>) - Method in class gov.nasa.gsfc.spdf.helio.Trajectory

Set the radius value.

setResolution(int) - Method in class gov.nasa.gsfc.spdf.helio.Request

Sets the resolution.

setStartDate(Calendar) - Method in class gov.nasa.gsfc.spdf.helio.ObjectDescription

Sets the start date (beginning date of position information)
 to the given value.

setStatusCode(ResultStatusCode) - Method in class gov.nasa.gsfc.spdf.helio.Result

Sets the status code value.

setStatusSubCode(ResultStatusSubCode) - Method in class gov.nasa.gsfc.spdf.helio.Result

Sets the status sub-code value.

setStatusText(List<String>) - Method in class gov.nasa.gsfc.spdf.helio.Result

Sets the textual status value.

setTime(List<Calendar>) - Method in class gov.nasa.gsfc.spdf.helio.Trajectory

Sets the time values.

setTrajectories(List<Trajectory>) - Method in class gov.nasa.gsfc.spdf.helio.DataResult

Sets the trajectories.

setUrls(List<String>) - Method in class gov.nasa.gsfc.spdf.helio.FileResult

Sets the URLs to the files containing the requested information.

T

toString() - Method in enum gov.nasa.gsfc.spdf.helio.CoordinateSystem

Provides a string representation of this CoordinateSystem.

toString() - Method in enum gov.nasa.gsfc.spdf.helio.ResultStatusCode

Provides a string representation of this ResultStatusCode.

toString() - Method in enum gov.nasa.gsfc.spdf.helio.ResultStatusSubCode

Provides a string representation of this ResultStatusSubCode.

Trajectory - Class in gov.nasa.gsfc.spdf.helio

This class represents an object's heliocentric trajectory.

Trajectory() - Constructor for class gov.nasa.gsfc.spdf.helio.Trajectory

Constructs a Trajectory with an empty value.

Trajectory(String, List<Calendar>, CoordinateSystem, List<Double>, List<Double>, List<Double>) - Constructor for class gov.nasa.gsfc.spdf.helio.Trajectory

Constructs a Trajectory with the given attribute values.

V

value() - Method in enum gov.nasa.gsfc.spdf.helio.CoordinateSystem

Provides the integer value corresponding to this
 CoordinateSystem.

value() - Method in enum gov.nasa.gsfc.spdf.helio.ResultStatusCode

Provides the integer value corresponding to this
 ResultStatusCode.

value() - Method in enum gov.nasa.gsfc.spdf.helio.ResultStatusSubCode

Provides the integer value corresponding to this
 ResultStatusSubCode.

valueOf(String) - Static method in enum gov.nasa.gsfc.spdf.helio.CoordinateSystem

Returns the enum constant of this type with the specified name.

valueOf(String) - Static method in enum gov.nasa.gsfc.spdf.helio.ResultStatusCode

Returns the enum constant of this type with the specified name.

valueOf(String) - Static method in enum gov.nasa.gsfc.spdf.helio.ResultStatusSubCode

Returns the enum constant of this type with the specified name.

values() - Static method in enum gov.nasa.gsfc.spdf.helio.CoordinateSystem

Returns an array containing the constants of this enum type, in
the order they are declared.

values() - Static method in enum gov.nasa.gsfc.spdf.helio.ResultStatusCode

Returns an array containing the constants of this enum type, in
the order they are declared.

values() - Static method in enum gov.nasa.gsfc.spdf.helio.ResultStatusSubCode

Returns an array containing the constants of this enum type, in
the order they are declared.

C D F G H L O R S T V

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

SSC Feedback.

Copyright © 2007-2014 United States Government as represented by the National Aeronautics and Space Administration.  No copyright is claimed in the United States under Title 17, U.S.Code.  All Other Right s Reserved.


text:
module.exports = function(app) {
  var OrgUser = app.models.OrgUser;
  var Org = app.models.Org;

  // Create an organization named as 'myRealm'
  Org.create({name: 'myRealm'}, function(err, org) {
    console.log(err, org);
    // Create an user within the organization
    org.orgUsers.create(
      {
        username: 'john',
        lname: 'Smith',
        fname: 'John',
        email: 'john@gmail.com',
        password: '123'
      },
      function(err, user) {
        console.log(err, user);

        // Now try to login with realm
        OrgUser.login({username: 'myRealm:john', password: '123'},
          function(err, result) {
            console.log(err, result);
          })
      });

  });
};