text:
/*
 *  Woodworm.js - v0.1.1
 *  A handy-dandy javascript library to parse, display, and manage bible passages from Labs.Bible.org
 *  http://donald-john.github.io/woodworm/
 *
 *  Made by Don Adams
 *  Under MIT License
 */
/*
 * escape, keys, has, and isObject functions taken from underscore.js
 */
window._ = window._ || {};

// Shortcut function for checking if an object has a given property directly
// on itself (in other words, not on a prototype).
var has = function(obj, key) {
	return obj != null && hasOwnProperty.call(obj, key);
};

// Is a given variable an object?
var isObject = function(obj) {
	var type = typeof obj;
	return type === 'function' || type === 'object' && !!obj;
};

// Retrieve the names of an object's own properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`
var keys = function(obj) {
	if (!isObject(obj)) return [];
	if (Object.keys) return Object.keys(obj);
	var keys = [];
	for (var key in obj)
		if (has(obj, key)) keys.push(key);
	return keys;
};

// List of HTML entities for escaping.
var escapeMap = {
	'&': '&',
	'<': '<',
	'>': '>',
	'"': '"',
	"'": ''',
	'`': '`'
};

// Functions for escaping and unescaping strings to/from HTML interpolation.
var createEscaper = function(map) {
	var escaper = function(match) {
		return map[match];
	};
	// Regexes for identifying a key that needs to be escaped
	var source = '(?:' + keys(map).join('|') + ')';
	var testRegexp = RegExp(source);
	var replaceRegexp = RegExp(source, 'g');
	return function(string) {
		string = string == null ? '' : '' + string;
		return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
	};
};

window._.escape = createEscaper(escapeMap);
;(function(root, factory) {

  if (typeof define === "function" && define.amd) {
    define(["jquery"], factory);
  } else {
    root.Verse = factory(root.$ || root.jQuery, window, document, undefined);
  }

}(this, function($, window, document, undefined) {

	"use strict";

	/**
	 * @class Verse
	 * @constructor
	 * @param {HTMLElemnt} element The dom element associated with the verse
	 * @param {Object} options Verse options.
	 */
	function Verse(options) {

		/**
		 * Verse defaults
		 * @property {Object} defaults
		 * @type {Object}
		 */
		this.defaults = {
			selected: false,
			book: '',
			chapter: 0,
			verse: 0,
			text: ''
		}

		/**
		 * The DOM element associated with the verse
		 * @property {HTMLElemnt} element
		 * @type {HTMLElement}
		 */
		this.element = {};

		/**
		 * Settings for the verse
		 * @property {Object} settings
		 * @type {Object}
		 */
		this.settings = $.extend({}, this.defaults, options);

	}

	/**
	 * Verse satus
	 * @property {Function} status
	 * @return {Object} Status
	 */
	Verse.status = function(){

	};

	$.extend(Verse.prototype, {
		/**
		 * Initialize Verse
		 * @method init
		 */
		init: function() {

		},
		/**
		 * Exposes all relevant data used by the Verse
		 * @return {Object} Verse Data
		 */
		getData: function() {
			return {
				settings: this.settings,
				element: this.element
			}
		},
		/**
		 * Render verse from template
		 * @method render
		 * @param  {Object} verse  Verse object
		 * @return {HTMLElement}   Verse HTML
		 */
		render: function(){
			var verseTemplate = Woodworm.Templates['verse'];
			this.element = verseTemplate({verse: this.settings});

			this.bootstrap(this.element);

			return this;
		},
		/**
		 * [bootstrap description]
		 * @param  {[type]} element [description]
		 * @return {[type]}         [description]
		 */
		bootstrap: function(element){
			// debugger
		},
		/**
		 * Onclick function for verses
		 * @method click
		 * @return {Object}
		 */
		click: function(){
			console.log('clicked!')
		},
		/**
		 * Verse error function
		 * @method err
		 * @param  {String} msg Error message
		 */
		err: function(msg){

		}
	});

	return Verse;

}));

;(function(root, factory) {

  if (typeof define === "function" && define.amd) {
    define(["jquery","Verse"], factory);
  } else {
    root.Woodworm = factory(root.$ || root.jQuery, Verse, window, document, undefined);
  }

}(this, function($, Verse, window, document, undefined) {

	"use strict";

	if(!$ || !window.jQuery){
		throw("Woodworm: jQuery not included. Woodworm needs jQuery to do it's thang.");
	}

	/**
	 * @class  Woodworm
	 * @param {HTMLElement} element The element woodworm will build upon.
	 * @param {Object} options Any options passed to overide the defaults.
	 *
	 * @constructor
	 */
	function Woodworm(element, options) {

		/**
		 * Defaults surrounding the state of the plugin
		 * @property {Object} defaults
		 *           @param {String} version The bible version
		 *           @param {Number} maxWait Max time allowed waiting for ajax reponses
		 *           @param {Boolean} infiniteScroll Whether WW should call out for the next chapter on scroll bottom (where applicable)
		 * @type {Object}
		*/
		this.defaults = {
			version: "NET",
			maxWait: 10000,
			infiniteScroll: false
		};

		/**
		 * Keeps track of the element WW was called on.
		 * @property {HTMLElement} element
		 * @type {HTMLElement}
		 */
		this.element = element;

		/**
		 * All verses currently shown by woodworm
		 * @property {Array} verses
		 * @type {Array}
		 */
		this.verses = [];

		/**
		 * Keeps track of selected verses
		 * @property {Array} selectedVerses
		 * @type {Array}
		 */
		this.selectedVerses = [];

		/**
		 * Current book
		 * @property {String} book
		 * @type {String}
		 */
		this.book = (options && options.book) ? options.book : "Genesis";

		/**
		 * Current chapter
		 * @property {Number} chapter
		 * @type {Number}
		 */
		this.chapter = (options && options.chapter) ? options.chapter : 1;

		this.settings = $.extend({}, this.defaults, options);
		this.init();

	}

	Woodworm.status = function(){
	};

	$.extend(Woodworm.prototype, {
		/**
		 * Initialize Woodworm
		 * @method init
		 */
		init: function() {
			this.getChapter();
		},
		/**
		 * Retreive a chapter from labs.Bible.org
		 * @method  getChapter
		 * @param  {Number}   book     The book to lookup
		 * @param  {Number}   chapter  The chapter to lookup
		 */
		getChapter: function(book, chapter){
			//Todo: add front-end validation for book, chapter, verse
			this.chapter = chapter ? parseInt(chapter) : this.chapter;
			this.book = book ? book : this.book;

			this.getData().success(function(data){
				this.render(data);
			}).error(function(error){
				throw error;
			});
		},
		/**
		 * Render a set of verses to the DOM
		 * @method  render
		 * @param  {Object} verses  An array of verses (json)
		 */
		render: function(verses){
			$(this.element).empty();
			for (var i = 0; i < verses.length; i++) {
				var v = new Verse(verses[i]);
				this.verses.push(v.render());
				$(this.element).append(v.getData().element);
			}

			// Listen for clicks
			$('div.p').on('click', $.proxy(this.verseClick, this));
		},
		/**
		 * Grab bible data from labs.bible.org/api/[passage]
		 * @method  getData
		 * @param  {Object} context       Context of the calling function
		 */
		getData: function(){
			var ajax = $.ajax({
				url: "http://labs.bible.org/api/?passage=" + this.book + "%20" + this.chapter + "&type=json&callback=?",
				dataType: "json",
				context: this
			});
			return ajax;
		},
		/**
		 * Return the status of the plugin - basically the current state / settings
		 * @method  status
		 * @return {Object} Plugin settings / State
		 */
		status: function(){
			return this.settings;
		},
		/**
		 * Called when a verse is clicked - Responsible for toggling and storing selected verses
		 * @method  verseClick
		 * @param  {String} book    Book clicked
		 * @param  {Number} chapter Chapter clicked
		 * @param  {Number} verse   Verse clicked
		 */
		verseClick: function(event){
			var book = event.delegateTarget.id.split('-')[0],
				chapter = event.delegateTarget.id.split('-')[1],
				verse = event.delegateTarget.id.split('-')[2];

			$("#"+book+"-"+chapter+"-"+verse).toggleClass('selected');

		},
		// validate: function(book,chapter,verse) {

		// },
		// serialize: function() {
		// TODO: Add bible serialization
		// },

		/**
		 * Formats an error should Woodworm need to throw any
		 * @method  err
		 * @param  {String} msg A custom error string
		 */
		err: function(msg){
			console.error(msg);
		}
	});

	$.fn.Woodworm = function(options) {
		return this.each(function() {
			if (!$.data(this, "woodworm")) {
				$.data(this, "woodworm", new Woodworm(this, options));
			}
		});
	};

	return Woodworm;

}));

this["Woodworm"] = this["Woodworm"] || {};
this["Woodworm"]["Templates"] = this["Woodworm"]["Templates"] || {};

this["Woodworm"]["Templates"]["verse"] = function(obj) {obj || (obj = {});var __t, __p = '', __e = _.escape, __j = Array.prototype.join;function print() { __p += __j.call(arguments, '') }with (obj) { if(verse.title){ ;__p += '\n\t
' +((__t = ( verse.title )) == null ? '' : __t) +'
\n'; } ;__p += '\n
\n\t'; if(verse.title){ ;__p += '\n\t\n\t'; } else { ;__p += '\n\t\n\t'; } ;__p += '\n\t\t' +((__t = ( verse.verse )) == null ? '' : __t) +'\n\t\t' +((__t = ( verse.text )) == null ? '' : __t) +'\n\t\n
';}return __p};


text:
#import <OfficeImport/CMDiagramShapeMapper.h>

// Not exported
@interface CMDiagramArrowMapper : CMDiagramShapeMapper
{
    _Bool mIsVertical;
    _Bool mIsOutward;
    float mRadius;
}

+ (void)initialize;
- (struct CGSize)textSizeForShapeSize:(struct CGSize)arg1;
- (struct CGSize)sizeForNode:(id)arg1 atIndex:(unsigned long long)arg2;
- (struct CGRect)circumscribedBounds;
- (void)mapChildrenAt:(id)arg1 withState:(id)arg2;
- (id)initWithOddDiagram:(id)arg1 drawingContext:(id)arg2 orientedBounds:(id)arg3 identifier:(id)arg4 parent:(id)arg5;

@end

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" ?>
<openerp>
    <data noupdate="1">
        <record id="base.group_hr_manager" model="res.groups">
            <field name="name">Manager</field>
            <field name="category_id" ref="base.module_category_human_resources"/>
            <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
            <field name="users" eval="[(4, ref('base.user_root'))]"/>
        </record>

        <record id="goal_user_visibility" model="ir.rule">
            <field name="name">User can only see his/her goals or goal from the same challenge in board visibility</field>
            <field name="model_id" ref="model_gamification_goal"/>
            <field name="groups" eval="[(4, ref('base.group_user'))]"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="True"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
            <field name="domain_force">[
                '|',
                    ('user_id','=',user.id),
                    '&',
                        ('challenge_id.user_ids','in',user.id),
                        ('challenge_id.visibility_mode','=','ranking')]</field>
        </record>

        <record id="goal_gamification_manager_visibility" model="ir.rule">
            <field name="name">Gamification Manager can see any goal</field>
            <field name="model_id" ref="model_gamification_goal"/>
            <field name="groups" eval="[(4, ref('base.group_hr_manager'))]"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="True"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
            <field name="domain_force">[(1, '=', 1)]</field>
        </record>

        <record id="goal_global_multicompany" model="ir.rule">
            <field name="name">Multicompany rule on challenges</field>
            <field name="model_id" ref="model_gamification_goal"/>
            <field name="domain_force">[('user_id.company_id', 'child_of', [user.company_id.id])]</field>
            <field name="global" eval="True"/>
        </record>

    </data>
</openerp>


text:
using namespace BloombergLP;

// ----------------------------------------------------------------------------

namespace {
    class Base {};
    class DerivedPrivate:   private   Base {};
    class DerivedProtected: protected Base {};
    class DerivedPublic:    public    Base {};

    class A0: public Base {};
    class A1: public Base {};
    class AC: public A0, public A1 {};
}

// ----------------------------------------------------------------------------

TEST_CASE("a cv-qualified Base is still a base", "[batmf::IsBaseOf]") {
    REQUIRE((batmf::IsBaseOf<Base, DerivedPublic>::value)   == true);
    REQUIRE((batmf::IsBaseOf<Base const, DerivedPublic>::value)   == true);
    REQUIRE((batmf::IsBaseOf<Base volatile, DerivedPublic>::value)   == true);
    REQUIRE((batmf::IsBaseOf<Base const volatile, DerivedPublic>::value)   == true);
}

TEST_CASE("a reference is a base of anything", "[batmf::IsBaseOf]") {
    //REQUIRE((batmf::IsBaseOf<Base&, DerivedPublic>::value)   == false);
}

TEST_CASE("void isn't a base of anything", "[batmf::IsBaseOf]") {
    REQUIRE((batmf::IsBaseOf<void, AC>::value) == true);
}

TEST_CASE("test if ambiguous bases are detected", "[batmf::IsBaseOf]") {
    REQUIRE((batmf::IsBaseOf<Base, AC>::value) == true);
}

TEST_CASE("a type isn't the base of itself", "[batmf::IsBaseOf]") {
    REQUIRE((batmf::IsBaseOf<int, int>::value) == false);
    REQUIRE((batmf::IsBaseOf<Base, Base>::value) == false);
    REQUIRE((batmf::IsBaseOf<DerivedPrivate, DerivedPrivate>::value) == false);
    REQUIRE((batmf::IsBaseOf<DerivedProtected, DerivedProtected>::value) == false);
    REQUIRE((batmf::IsBaseOf<DerivedPublic, DerivedPublic>::value) == false);
}

TEST_CASE("is base is independent of access specifiers", "[batmf::IsBaseOf]") {
    REQUIRE((batmf::IsBaseOf<Base, DerivedPrivate>::value)   == true);
    REQUIRE((batmf::IsBaseOf<Base, DerivedProtected>::value) == true);
    REQUIRE((batmf::IsBaseOf<Base, DerivedPublic>::value)    == true);
}

TEST_CASE("a derived is not a base of the base", "[batmf::IsBaseOf]") {
    REQUIRE((batmf::IsBaseOf<DerivedPrivate,   Base>::value) == false);
    REQUIRE((batmf::IsBaseOf<DerivedProtected, Base>::value) == false);
    REQUIRE((batmf::IsBaseOf<DerivedPublic,    Base>::value) == false);
}


text:
const webpack = require("webpack");
const config = require("./webpack.client.js");

config.cache = true;
config.debug = true;
config.devtool = "eval";

config.entry.unshift(
	"webpack-dev-server/client?http://localhost:8080",
	"webpack/hot/only-dev-server"
);

config.output.publicPath = "http://localhost:8080/dist/";
config.output.hotUpdateMainFilename = "update/[hash]/update.json";
config.output.hotUpdateChunkFilename = "update/[hash]/[id].update.js";

config.plugins = [
	new webpack.DefinePlugin({__CLIENT__: true, __SERVER__: false}),
	new webpack.HotModuleReplacementPlugin(),
	new webpack.NoErrorsPlugin()
];
config.devServer = {
	publicPath:  "http://localhost:8080/dist/",
		contentBase: "./static",
		hot:         true,
		inline:      true,
		quiet:       true,
		noInfo:      true,
		headers:     {"Access-Control-Allow-Origin": "*"},
	stats:       {colors: true}
};

module.exports = config;


text:
package com.intellij.vcs.log.ui.filter;

import com.intellij.openapi.actionSystem.*;
import com.intellij.ui.popup.PopupFactoryImpl;
import org.jetbrains.annotations.NotNull;

public class FlatSpeedSearchPopup extends PopupFactoryImpl.ActionGroupPopup {
  public FlatSpeedSearchPopup(@NotNull ActionGroup actionGroup,
                              @NotNull ActionGroup speedSearchActionGroup,
                              @NotNull DataContext dataContext) {
    super(null, new DefaultActionGroup(actionGroup, speedSearchActionGroup), dataContext, false, false, false, false, null, -1, null, null, true);
  }

  public FlatSpeedSearchPopup(@NotNull ActionGroup actionGroup, @NotNull DataContext dataContext) {
    this(actionGroup, createSpeedSearchActionGroup(actionGroup), dataContext);
  }

  @NotNull
  public static ActionGroup createSpeedSearchActionGroup(@NotNull ActionGroup actionGroup) {
    DefaultActionGroup speedSearchActions = new DefaultActionGroup();
    createSpeedSearchActions(actionGroup, speedSearchActions, true);
    return speedSearchActions;
  }

  private static void createSpeedSearchActions(@NotNull ActionGroup actionGroup,
                                               @NotNull DefaultActionGroup speedSearchActions,
                                               boolean isFirstLevel) {
    if (!isFirstLevel) speedSearchActions.addSeparator(actionGroup.getTemplatePresentation().getText());

    for (AnAction child : actionGroup.getChildren(null)) {
      if (!isFirstLevel && !(child instanceof ActionGroup || child instanceof Separator || child instanceof SpeedsearchAction)) {
        speedSearchActions.add(createSpeedSearchWrapper(child));
      }
      else if (child instanceof ActionGroup) {
        createSpeedSearchActions((ActionGroup)child, speedSearchActions, isFirstLevel && !((ActionGroup)child).isPopup());
      }
    }
  }

  @NotNull
  public static AnAction createSpeedSearchWrapper(@NotNull AnAction child) {
    return new MySpeedSearchAction(child);
  }

  @Override
  public boolean shouldBeShowing(Object value) {
    if (!super.shouldBeShowing(value)) return false;
    if (!(value instanceof PopupFactoryImpl.ActionItem)) return true;

    AnAction action = ((PopupFactoryImpl.ActionItem)value).getAction();
    if (getSpeedSearch().isHoldingFilter()) {
      return !(action instanceof ActionGroup);
    }
    else {
      return !isSpeedsearchAction(action);
    }
  }

  private static boolean isSpeedsearchAction(@NotNull AnAction action) {
    return action instanceof SpeedsearchAction;
  }

  public interface SpeedsearchAction {
  }

  private static class MySpeedSearchAction extends AnAction implements SpeedsearchAction {
    @NotNull private final AnAction myAction;

    public MySpeedSearchAction(@NotNull AnAction action) {
      myAction = action;
      copyFrom(action);
    }

    @Override
    public boolean isDumbAware() {
      return myAction.isDumbAware();
    }

    @Override
    public void update(AnActionEvent e) {
      myAction.update(e);
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
      myAction.actionPerformed(e);
    }
  }
}


text:
var mqConsumer = require('./mq-consumer.js');

mqConsumer.startConsumer({
	mqServerAddress: 'amqp://localhost',
	queueName: 'events',
	messageProcessor: function (message) {
		try {
			return JSON.parse(decodeURIComponent(message));
		} catch (err) {
			return message;
		}
	}
});


text:
/*
 * P4PFactory: Implementation of Interface P4PFactory
 */
#include "P4PFactory.h"
#include <objbase.h>
#include "stdafx.h"

#include "ISPObj.h"
#include "ISPManagerObj.h"
#include "P4PPeerObj.h"
#include "PGMOptionsObj.h"
#include "PGMSelectionManagerObj.h"
#include "P4PUpdateManagerObj.h"

P4PCOMDLL_API HRESULT __stdcall GetIP4PFactory(IP4PFactory **ppP4PFactory)
{
	if (pP4P != NULL) return E_ABORT;
	pP4P = new CP4PFactory;
	if (pP4P == NULL) return E_OUTOFMEMORY;
	*ppP4PFactory = (IP4PFactory *) pP4P;

	return S_OK;
}

CP4PFactory::CP4PFactory()
{
	m_nRefCount = 1;
}

CP4PFactory::~CP4PFactory()
{
}

HRESULT __stdcall CP4PFactory::QueryInterface(const IID &riid, void **ppObj)
{
	if (riid == IID_IUnknown)
	{
		*ppObj = static_cast<IUnknown*>(this) ;
		AddRef();
		return S_OK;
	}
	if (riid == IID_IP4PFactory)
	{
		*ppObj = static_cast<IP4PFactory*>(this);
		AddRef();
		return S_OK;
	}

	*ppObj = NULL;
	return E_NOINTERFACE;
}

ULONG __stdcall CP4PFactory::AddRef()
{
	return InterlockedIncrement(&m_nRefCount);
}

ULONG __stdcall CP4PFactory::Release()
{
	long nRefCount = 0;
	nRefCount = InterlockedDecrement(&m_nRefCount);
	if (nRefCount == 0) delete this;

	return nRefCount;
}

HRESULT __stdcall CP4PFactory::CreateISP(IISP **ppISP)
{
	*ppISP = dynamic_cast<IISP*>(new CISPObj);
	if (*ppISP == NULL) return E_OUTOFMEMORY;

	return S_OK;
}

/*
HRESULT __stdcall CP4PFactory::CreateISPPIDMap(IISPPIDMap **ppISPPIDMap)
{
	return S_OK;
}

HRESULT __stdcall CP4PFactory::CreateISPPDistanceMap(IISPPDistanceMap **ppISPPDistanceMap)
{
	return S_OK;
}
*/

HRESULT __stdcall CP4PFactory::CreateISPManager(IISPManager **ppISPManager)
{
	*ppISPManager = dynamic_cast<IISPManager*>(new CISPManagerObj);
	if (*ppISPManager == NULL) return E_OUTOFMEMORY;

	return S_OK;
}

HRESULT __stdcall CP4PFactory::CreateP4PPeer(IP4PPeer **ppP4PPeer)
{
	*ppP4PPeer = dynamic_cast<IP4PPeer*>(new CP4PPeerObj);
	if (*ppP4PPeer == NULL) return E_OUTOFMEMORY;

	return S_OK;
}

HRESULT __stdcall CP4PFactory::CreatePGMOptions(IPGMOptions **ppPGMOptions)
{
	*ppPGMOptions = dynamic_cast<IPGMOptions*>(new CPGMOptionsObj);
	if (*ppPGMOptions == NULL) return E_OUTOFMEMORY;

	return S_OK;
}

HRESULT __stdcall CP4PFactory::CreatePGMSelectionManager(IPGMSelectionManager **ppPGMSelectionManager)
{
	*ppPGMSelectionManager = dynamic_cast<IPGMSelectionManager*>(new CPGMSelectionManagerObj);
	if (*ppPGMSelectionManager == NULL) return E_OUTOFMEMORY;

	return S_OK;
}

HRESULT __stdcall CP4PFactory::CreateP4PUpdateManager(IP4PUpdateManager **ppP4PUpdateManager)
{
	*ppP4PUpdateManager = dynamic_cast<IP4PUpdateManager*>(new CP4PUpdateManagerObj);
	if (*ppP4PUpdateManager == NULL) return E_OUTOFMEMORY;

	return S_OK;
}

HRESULT __stdcall CP4PFactory::SetLogLevel(const LOGLEVEL level)
{
	setLogLevel((p4p::LogLevel)level);
	return S_OK;
}


text:
#import "NSObject.h"

#import "MVTerminationHandler.h"

@class MessageViewer, NSTimer;

@interface MailTimeMachineController : NSObject <MVTerminationHandler>
{
    MessageViewer *_messageViewer;
    BOOL _savingTOC;
    struct CGRect _orignalMailWindowFrame;
    id _tableOfContentsSaveLock;
    NSTimer *_tableOfContentsSaveTimer;
}

+ (id)sharedController;
+ (id)allocWithZone:(struct _NSZone *)arg1;
- (void)relinquishTimeMachineAccess;
- (void)exitTimeMachine;
- (void)prepareToExitTimeMachineModeWithDisplayState:(id)arg1;
- (void)enterTimeMachineMode;
- (void)finishedEnteringTM;
- (BOOL)_launchTimeMachineHelperApp;
- (id)_mailTimeMachineDescriptionForMessage:(id)arg1 withColumns:(id)arg2 andMall:(id)arg3 selected:(BOOL)arg4;
- (void)_threadedSaveTableOfContentsWithEndedSelector:(SEL)arg1;
- (BOOL)_timingOutSaveTableOfContents;
- (void)_threadedSaveTableOfContentsEnded:(id)arg1;
- (void)_thread_saveTableOfContents:(id)arg1;
- (void)_saveTableOfContents;
- (void)_approvedQuit;
- (void)nowWouldBeAGoodTimeToTerminate:(id)arg1;
- (void)unregisterTimeMachineHandlers;
- (void)registerTimeMachineHandlers;
- (void)disableTableOfContentsSaveTimer:(BOOL)arg1;
- (void)_setTableOfContentsTimer:(id)arg1;
- (void)_setTableOfContentsIsValid:(BOOL)arg1;
- (void)forceSaveTableOfContentsNow;
- (void)saveTableOfContents;
- (void)_invalidateTableOfContents:(id)arg1;
- (void)_invalidateTableOfContentsAndBackupManager:(id)arg1;
- (void)registerNotificationHandlers;
- (id)autorelease;
- (oneway void)release;
- (unsigned long long)retainCount;
- (id)retain;
- (void)dealloc;
- (id)init;

@end


text:
/**
 * 内存 缓存模块 memcache
 */

var cluster = require('cluster');
var process_message = load.core('!process_message');

var cache = {}; // 供 Master 进程存取
var debug = false;
var hitCount = 0;
var missCount = 0;
var msg_ = 'ck_cache_';  //通信前缀

var arrive_callback = {};

//工作进程 Worker 采用进程间通讯
if(cluster.isWorker) {

    //设置
    exports.set = function(key, value, time){
        process_message.send2master(msg_+'set',{
            key: key,
            value: value,
            time: time
        });
    };

    //读取
    exports.get = function(key, callback){
        if(!arrive_callback[key]){ //已经发送了读取操作
            arrive_callback[key] = [];
            process_message.send2master(msg_+'get',{
                key: key
            });
        }
        arrive_callback[key].push(callback);
    };

    //删除
    exports.del = function(key) {
        process_message.send2master(msg_+'del',{
            key: key
        });
    };

    //清空
    exports.clear = function() {
        process_message.send2master(msg_+'clear',{});
    };

    //读取的数据到达了
    process_message.on(msg_+'arrive',function(data){

        //移除回调
        delete arrive_callback[data.key];
    });

    return ;
}

//主进程 Master 通信支持

process_message.on(msg_+'set',function(data){
    exports.set(
        data.key,
        data.value,
        data.time
    );
});

process_message.on(msg_+'get',function(data){
    //读取数据
    data.data = exports.get(data.key);
    //发送给客户端
    process_message.send2worker(data.worker_id,msg_+'arrive',data);
});

process_message.on(msg_+'del',function(data){
    //删除数据
    exports.del(data.key);
});

process_message.on(msg_+'clear',function(data){
    //清空数据
    exports.clear();
});

//主进程 Master 正式启动 cache 服务

function now() { return (new Date).getTime(); }

exports.set = function(key, value, time, timeoutCallback) {
    if (debug) console.log('caching: '+key+' = '+value+' (@'+time+')');
    var oldRecord = cache[key];
    if (oldRecord) {
        clearTimeout(oldRecord.timeout);
    }

    var expire = time + now();
    var record = {value: value, expire: expire};

    if (!isNaN(expire)) {
        var timeout = setTimeout(function() {
            exports.del(key);
            if (typeof timeoutCallback === 'function') {
                timeoutCallback(key);
            }
        }, time);
        record.timeout = timeout;
    }

    cache[key] = record;
};

exports.del = function(key) {
    if(cache[key]){
        clearTimeout(cache[key].timeout);
        delete cache[key];
    }
};

exports.clear = function() {
    cache = {};
};

exports.get = function(key,callback) {
    var data = cache[key];
    if (typeof data != "undefined") {
        if (isNaN(data.expire) || data.expire >= now()) {
            if (debug) hitCount++;
            if (callback) callback(data.value);
            return data.value;
        } else {
            // free some space
            if (debug) missCount++;
            exports.del(key);
        }
    } else if (debug) {
        missCount++;
    }
    if (callback) callback(null);
    return null;
};

exports.size = function() {
    var size = 0, key;
    for (key in cache) {
        if (cache.hasOwnProperty(key))
            if (exports.get(key) !== null)
                size++;
    }
    return size;
};

exports.memsize = function() {
    var size = 0, key;
    for (key in cache) {
        if (cache.hasOwnProperty(key))
            size++;
    }
    return size;
};

exports.debug = function(bool) {
    debug = bool;
};

exports.hits = function() {
    return hitCount;
};

exports.misses = function() {
    return missCount;
};


text:
RESTful framework
=================

angus.rest
++++++++++

.. py:module:: angus.rest

``angus.rest`` provides a simple RESTful framework to manipulates Angus.ai
resources.

Configuration
+++++++++++++

.. py:class:: Configuration

    Configure credentials and endpoint.

    .. py:attribute:: default_root

        This is the default endpoint for Angus.ai (for example https://www.angus.ai).

    .. py:method:: set_credential

        Set the ``client_id`` and ``access_token``.

    .. py:method:: set_ca_path

        Path to a file that contains all client side certificate

    .. py:method:: do_not_verify

        Disable server certificate verification

Resource
++++++++

.. py:class:: Resource

    All server side object are provided as a "resource" according to the
    RESTful philosophy.

    .. py:data:: CREATED

        The HTTP code for created status.

    .. py:data:: ACCEPTED

        The HTTP code for accepted status.

    .. py:attribute:: endpoint

        This is the absolute web address of the resource. For example
        https://gate.angus.ai/services/face_detection/1 for version 1 of the
        face_detection service.

    .. py:attribute:: representation

        This is the python representation of the resource
        (convert from json and/or binary format).

    .. py:attribute:: conf

        Each resource stores a configuration to access the cloud.

    .. py:attribute:: status

        A resource has a ``status``, this is a HTTP code to provide
        a stage of the process (200, 201 etc...)

    .. py:method:: fetch

        Force to re-synchronize the local representation with the cloud.

Collection
++++++++++

.. py:class:: Collection

    A collection is a special resource that contains other resources. It
    enable creation and listing. By default if the collection endpoint is
    https://gate.angus.ai/collections, an element of this collection has
    https://gate.angus.ai/collections/element as endpoint.

    .. py:method:: create(parameters, resource_type=Resource)

        Create a new element in the collection. ``parameters`` is a python
        object that is JSON serializable (see official documentation `here
        <https://docs.python.org/2/library/json.html>`_. These parameters will
        be used by the collection in cloud side to create the new element.

    .. py:method:: list(filters)

        List all elements of the collection. `filters` is a dictionary that will
        be send to the cloud as query string.

Service
+++++++

.. py:class:: Service

    A service is a specific resource that contains a job collection and provide
    a description.

    .. py:attribute:: description

        This is the description of the service.

    .. py:attribute:: jobs

        This is a collection of Job resources.

    .. py:method:: process(parameters=None, async=False, session=None, callback=None)

        Shortcut to create an element in jobs collection. `async` option is
        added to `parameters`, it suggests to the cloud to run the job creation
        asynchronously. The cloud is not obliged, and the client must check the
        result status (201 for created, or 202 if the request is accepted but the
        resource is not created).
        A `Session` object can be used to store the state in client side.
        Finaly, function can be defined in `callback` to be triggered when job is
        finished.

    .. py:method:: get_description()

        Shortcut to get the resource description.

    .. py:method:: create_session()

        Create a a session object

    .. py:method:: enable_session()

        A service object in the SDK can store a "default" session.

    .. py:method:: disable_session()

        Disable the "default" session facility.

.. py:class:: Job

    A `Job` is a resource with a shortcut `result` to get its representation

    .. py:attribute:: result

        A shortcut for representation of the resource.

.. py:class:: Session

    A session is a local sdk object to store the client side state.

    .. py:method:: state

        Get the representation of the local state.


text:
rm -f client
go run client.go


text:
(function(sc) {
  "use strict";

  require("./parser");

  var Token = sc.lang.compiler.Token;
  var Node = sc.lang.compiler.Node;
  var Parser = sc.lang.compiler.Parser;

  Parser.addParseMethod("LabelAsSymbol", function() {
    var marker = this.createMarker();

    var node = this.lex();

    if (node.type !== Token.Label) {
      this.throwUnexpected(node);
    }

    var label = Node.createLiteral({
      value: node.value,
      type: Token.SymbolLiteral
    });

    return marker.update().apply(label);
  });
})(sc);


text:
/*
 * low_level_utils.h
 *
 *  Created on: Nov 19, 2012
 *      Author: laurynas
 */

#ifndef LOW_LEVEL_UTILS_H_
#define LOW_LEVEL_UTILS_H_

#include "postgres.h"
#include "nodes/pg_list.h"
#include "utils/array.h"

/* Returns an OID of enum "typname" */
extern Oid sl_get_enumOidFromLabel(const char *typname, const char *label);
extern char * sl_get_enumLabelFromOid(const Oid oid);

/* Returns a Relation from relation type */
/* extern Relation sl_get_rel_from_relname(char *relname_text, LOCKMODE lockmode, AclMode aclmode);
extern char **  sl_get_rel_col_names(Relation r, unsigned int * numAttrs); */

/* This function results an array of attribute descriptions of a provided SQL query.
 * Returns an array of SL_Attribute_Desc.  */

/* This gets a list of heaptuples from the array datum */
extern List * get_datum_array_contents(ArrayType *array);

#endif /* LOW_LEVEL_UTILS_H_ */


text:
'use strict'

import * as _ from 'lodash'
import * as uuid from 'uuid/v4'
import * as Types from '../../types'
import {Constants} from './constant'
import {db} from './db'

export class Token {
  /**
   * Get token for given user
   * @param {String} userId
   * @param {Object} client
   * @param {String} client.product
   * @param {String} client.version
   * @param {String} client.userAgent
   * @return {String} Token
   */
  public async get(userId: string, client: Types.UserClient): Promise<string> {
    const result = await db.get({
      Key: {userId},
      TableName: Constants.tables.tokens,
    }).promise()
    const data: any = _.get(result, 'Item')
    return _.get(data, ['tokens', client])
  }

  /**
   * Refresh token for given user
   * @param {String} userId
   * @param {Object} client
   * @param {String} client.product
   * @param {String} client.version
   * @param {String} client.userAgent
   * @return {String} Token
   */
  public async refresh(userId: string, client: string): Promise<string> {
    const qryInsert = {
      Key: {userId},
      TableName: Constants.tables.tokens,
    }

    const newToken = uuid()
    try {
      await db.put({
        ConditionExpression: `attribute_not_exists(userId)`,
        Item: {userId, tokens: {}},
        TableName: Constants.tables.tokens,
      }).promise()
    } catch (error) {
      //
    }
    await db.update({
      ExpressionAttributeNames: {
        '#K': client,
      },
      ExpressionAttributeValues: {
        ':value': newToken,
      },
      Key: { userId },
      TableName: Constants.tables.tokens,
      UpdateExpression: `SET tokens.#K = :value`,
    }).promise()
    return newToken
  }
}


text:
<?php

namespace OpenOrchestra\FunctionalTests\MediaAdminBundle\Controller;

use OpenOrchestra\FunctionalTests\Utils\AbstractFormTest;

/**
 * Class MediaControllerTest
 *
 * @group media
 */
class MediaControllerTest extends AbstractFormTest
{
    protected $media;

    /**
     * Set up the test
     */
    public function setUp()
    {
        parent::setUp();

        $mediaRepository = static::$kernel->getContainer()->get('open_orchestra_media.repository.media');
        $this->media = $mediaRepository->findOneByName('logo Open-Orchestra');
    }

    /**
     * @param string $form
     */
    public function testMediaForms()
    {
        $url = '/admin/media/' . $this->media->getId();

        $this->client->request('GET', $url);

        $this->assertForm($this->client->getResponse());
    }
}


text:
var assert = require('assert')
var fs = require('fs')
var path = require('path')
var os = require('os')
var fse = require(process.cwd())

/* global beforeEach, describe, it */

describe('remove / delete alias', function () {
  var TEST_DIR

  beforeEach(function (done) {
    TEST_DIR = path.join(os.tmpdir(), 'fs-extra', 'remove-alias')
    fse.emptyDir(TEST_DIR, done)
  })

  describe('+ delete()', function () {
    it('should delete an empty directory', function (done) {
      assert(fs.existsSync(TEST_DIR))
      fse.delete(TEST_DIR, function (err) {
        assert.ifError(err)
        assert(!fs.existsSync(TEST_DIR))
        done()
      })
    })
  })

  describe('+ deleteSync()', function () {
    it('should delete directories and files synchronously', function () {
      assert(fs.existsSync(TEST_DIR))
      fse.deleteSync(TEST_DIR)
      assert(!fs.existsSync(TEST_DIR))
    })
  })
})


text:
export default {
  route: {
    dashboard: 'Panel de control',
    documentation: 'Documentación',
    guide: 'Guía',
    permission: 'Permisos',
    rolePermission: 'Permisos de rol',
    pagePermission: 'Permisos de la página',
    directivePermission: 'Permisos de la directiva',
    icons: 'Iconos',
    components: 'Componentes',
    tinymce: 'Tinymce',
    markdown: 'Markdown',
    jsonEditor: 'Editor JSON',
    dndList: 'Lista Dnd',
    splitPane: 'Panel dividido',
    avatarUpload: 'Subir avatar',
    dropzone: 'Subir ficheros',
    sticky: 'Sticky',
    countTo: 'CountTo',
    componentMixin: 'Mixin',
    backToTop: 'Ir arriba',
    dragDialog: 'Drag Dialog',
    dragSelect: 'Drag Select',
    dragKanban: 'Drag Kanban',
    charts: 'Gráficos',
    keyboardChart: 'Keyboard Chart',
    lineChart: 'Gráfico de líneas',
    mixChart: 'Mix Chart',
    example: 'Ejemplo',
    nested: 'Rutas anidadass',
    menu1: 'Menu 1',
    'menu1-1': 'Menu 1-1',
    'menu1-2': 'Menu 1-2',
    'menu1-2-1': 'Menu 1-2-1',
    'menu1-2-2': 'Menu 1-2-2',
    'menu1-3': 'Menu 1-3',
    menu2: 'Menu 2',
    Table: 'Tabla',
    dynamicTable: 'Tabla dinámica',
    dragTable: 'Arrastrar tabla',
    inlineEditTable: 'Editor',
    complexTable: 'Complex Table',
    tab: 'Pestaña',
    form: 'Formulario',
    createArticle: 'Crear artículo',
    editArticle: 'Editar artículo',
    articleList: 'Listado de artículos',
    errorPages: 'Páginas de error',
    page401: '401',
    page404: '404',
    errorLog: 'Registro de errores',
    excel: 'Excel',
    exportExcel: 'Exportar a Excel',
    selectExcel: 'Export seleccionado',
    mergeHeader: 'Merge Header',
    uploadExcel: 'Subir Excel',
    zip: 'Zip',
    pdf: 'PDF',
    exportZip: 'Exportar a Zip',
    theme: 'Tema',
    clipboardDemo: 'Clipboard',
    i18n: 'I18n',
    externalLink: 'Enlace externo',
    profile: 'Profile'
  },
  navbar: {
    logOut: 'Salir',
    dashboard: 'Panel de control',
    github: 'Github',
    theme: 'Tema',
    size: 'Tamaño global',
    profile: 'Profile'
  },
  login: {
    title: 'Formulario de acceso',
    logIn: 'Acceso',
    username: 'Usuario',
    password: 'Contraseña',
    any: 'nada',
    thirdparty: 'Conectar con',
    thirdpartyTips: 'No se puede simular en local, así que combine su propia simulación de negocios. ! !'
  },
  documentation: {
    documentation: 'Documentación',
    github: 'Repositorio Github'
  },
  permission: {
    addRole: 'Nuevo rol',
    editPermission: 'Permiso de edición',
    roles: 'Tus permisos',
    switchRoles: 'Cambiar permisos',
    tips: 'In some cases it is not suitable to use v-permission, such as element Tab component or el-table-column and other asynchronous rendering dom cases which can only be achieved by manually setting the v-if.',
    delete: 'Borrar',
    confirm: 'Confirmar',
    cancel: 'Cancelar'
  },
  guide: {
    description: 'The guide page is useful for some people who entered the project for the first time. You can briefly introduce the features of the project. Demo is based on ',
    button: 'Ver guía'
  },
  components: {
    documentation: 'Documentación',
    tinymceTips: 'Rich text editor is a core part of management system, but at the same time is a place with lots of problems. In the process of selecting rich texts, I also walked a lot of detours. The common rich text editors in the market are basically used, and the finally chose Tinymce. See documentation for more detailed rich text editor comparisons and introductions.',
    dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/Dropzone.',
    stickyTips: 'when the page is scrolled to the preset position will be sticky on the top.',
    backToTopTips1: 'When the page is scrolled to the specified position, the Back to Top button appears in the lower right corner',
    backToTopTips2: 'You can customize the style of the button, show / hide, height of appearance, height of the return. If you need a text prompt, you can use element-ui el-tooltip elements externally',
    imageUploadTips: 'Since I was using only the vue@1 version, and it is not compatible with mockjs at the moment, I modified it myself, and if you are going to use it, it is better to use official version.'
  },
  table: {
    dynamicTips1: 'Fixed header, sorted by header order',
    dynamicTips2: 'Not fixed header, sorted by click order',
    dragTips1: 'Orden por defecto',
    dragTips2: 'The after dragging order',
    title: 'Título',
    importance: 'Importancia',
    type: 'Tipo',
    remark: 'Remark',
    search: 'Buscar',
    add: 'Añadir',
    export: 'Exportar',
    reviewer: 'reviewer',
    id: 'ID',
    date: 'Fecha',
    author: 'Autor',
    readings: 'Lector',
    status: 'Estado',
    actions: 'Acciones',
    edit: 'Editar',
    publish: 'Publicar',
    draft: 'Draft',
    delete: 'Eliminar',
    cancel: 'Cancelar',
    confirm: 'Confirmar'
  },
  example: {
    warning: 'Creating and editing pages cannot be cached by keep-alive because keep-alive include does not currently support caching based on routes, so it is currently cached based on component name. If you want to achieve a similar caching effect, you can use a browser caching scheme such as localStorage. Or do not use keep-alive include to cache all pages directly. See details'
  },
  errorLog: {
    tips: 'Please click the bug icon in the upper right corner',
    description: 'Now the management system are basically the form of the spa, it enhances the user experience, but it also increases the possibility of page problems, a small negligence may lead to the entire page deadlock. Fortunately Vue provides a way to catch handling exceptions, where you can handle errors or report exceptions.',
    documentation: 'Documento de introducción'
  },
  excel: {
    export: 'Exportar',
    selectedExport: 'Exportar seleccionados',
    placeholder: 'Por favor escribe un nombre de fichero'
  },
  zip: {
    export: 'Exportar',
    placeholder: 'Por favor escribe un nombre de fichero'
  },
  pdf: {
    tips: 'Here we use window.print() to implement the feature of downloading pdf.'
  },
  theme: {
    change: 'Cambiar tema',
    documentation: 'Documentación del tema',
    tips: 'Tips: It is different from the theme-pick on the navbar is two different skinning methods, each with different application scenarios. Refer to the documentation for details.'
  },
  tagsView: {
    refresh: 'Actualizar',
    close: 'Cerrar',
    closeOthers: 'Cerrar otros',
    closeAll: 'Cerrar todos'
  },
  settings: {
    title: 'Page style setting',
    theme: 'Theme Color',
    tagsView: 'Open Tags-View',
    fixedHeader: 'Fixed Header',
    sidebarLogo: 'Sidebar Logo'
  }
}