text:
using UnityEngine;
using UnityEditor;
using CorruptedSmileStudio.JukeBox;

/// <summary>
/// Custom inspector for JukeBox component
/// </summary>
[CustomEditor(typeof(Jukebox))]
public class JukeBoxInspector : Editor
{
    bool showPlaylistSection = false;
    Vector2 songSection = new Vector2();
    Vector2 playlistSection = new Vector2();

    Jukebox box;
    /// <summary>
    /// Performs the custom Inspector.
    /// </summary>
    public override void OnInspectorGUI()
    {

        box = (Jukebox)target;
        #region PlaylistAssign
        showPlaylistSection = EditorGUILayout.Foldout(showPlaylistSection, "Playlists");
        if (showPlaylistSection)
        {
            GUI.SetNextControlName("PlaylistAdd");
            if (GUILayout.Button("Add Playlist"))
            {
                box.playlists.Add(new PlayList(""));
            }
            playlistSection = EditorGUILayout.BeginScrollView(playlistSection);
            for (int i = 0; i < box.playlists.Count; i++)
            {
                EditorGUILayout.BeginHorizontal();
                {
                    EditorGUILayout.BeginVertical(GUILayout.Width(80));
                    {
                        GUILayout.Label("Name:");
                    }
                    EditorGUILayout.EndVertical();
                    EditorGUILayout.BeginVertical();
                    {
                        box.playlists[i].name = GUILayout.TextField(box.playlists[i].name);
                    }
                    EditorGUILayout.EndVertical();
                }
                EditorGUILayout.EndHorizontal();
                #region SongSection
                box.playlists[i].showSongs = EditorGUILayout.Foldout(box.playlists[i].showSongs, "Assign Songs");
                if (box.playlists[i].showSongs)
                {
                    GUI.SetNextControlName("SongAdd");
                    if (GUILayout.Button("Add Song"))
                    {
                        GUI.FocusControl("SongAdd");
                        box.playlists[i].songs.Add(new Song());
                    }
                    songSection = EditorGUILayout.BeginScrollView(songSection);
                    {
                        for (int x = box.playlists[i].songs.Count - 1; x >= 0; x--)
                        {
                            EditorGUILayout.BeginHorizontal();
                            {
                                EditorGUILayout.BeginVertical(GUILayout.Width(80));
                                {
                                    GUILayout.Label("Artist");
                                    GUILayout.Label("Title");
                                    GUILayout.Label("Clip");
                                }
                                EditorGUILayout.EndVertical();
                                EditorGUILayout.BeginVertical();
                                {
                                    box.playlists[i].songs[x].artist = EditorGUILayout.TextField(box.playlists[i].songs[x].artist);
                                    box.playlists[i].songs[x].title = EditorGUILayout.TextField(box.playlists[i].songs[x].title);
                                    box.playlists[i].songs[x].clip = (AudioClip)EditorGUILayout.ObjectField(box.playlists[i].songs[x].clip, typeof(AudioClip), false);
                                }
                                EditorGUILayout.EndVertical();
                            }
                            EditorGUILayout.EndHorizontal();
                            EditorGUILayout.BeginHorizontal();
                            {
                                if (box.playlists[i].songs[x].clip != null)
                                {
                                    GUILayout.Label("Length: " + GetTime(box.playlists[i].songs[x].clip.length));
                                }
                                else
                                {
                                    GUILayout.Label("Length: 0:00");
                                }
                                if (GUILayout.Button("X", GUILayout.Width(20)))
                                {
                                    GUI.FocusControl("SongAdd");
                                    box.playlists[i].songs.RemoveAt(x);
                                }
                            }
                            EditorGUILayout.EndHorizontal();
                            EditorGUILayout.Space();
                        }
                    }
                    EditorGUILayout.EndScrollView();
                }
                #endregion
                EditorGUILayout.Space();
                if (GUILayout.Button("Delete Playlist", GUILayout.Width(120)))
                {
                    GUI.FocusControl("PlaylistAdd");
                    box.playlists.RemoveAt(i);
                }
            }
            EditorGUILayout.EndScrollView();
        }
        #endregion
        EditorGUILayout.Space();
        #region MainSettings
        EditorGUILayout.BeginHorizontal();
        {
            EditorGUILayout.BeginVertical(GUILayout.Width(90));
            {
                GUILayout.Label("Play on Start");
            }
            EditorGUILayout.EndVertical();
            EditorGUILayout.BeginVertical();
            {
                box.playOnStart = EditorGUILayout.Toggle(box.playOnStart);
            }
            EditorGUILayout.EndVertical();
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        {
            EditorGUILayout.BeginVertical(GUILayout.Width(90));
            {
                GUILayout.Label("Playlist");
            }
            EditorGUILayout.EndVertical();
            EditorGUILayout.BeginVertical();
            {
                box.currentPlaylist = EditorGUILayout.IntSlider(box.currentPlaylist, 0, box.playlists.Count - 1);
            }
            EditorGUILayout.EndVertical();
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        {
            EditorGUILayout.BeginVertical(GUILayout.Width(90));
            {
                GUILayout.Label("Volume");
            }
            EditorGUILayout.EndVertical();
            EditorGUILayout.BeginVertical();
            {
                box._volume = EditorGUILayout.Slider(box._volume, 0, 100);
            }
            EditorGUILayout.EndVertical();
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        {
            EditorGUILayout.BeginVertical(GUILayout.Width(90));
            {
                GUILayout.Label("Keep Between Scenes");
            }
            EditorGUILayout.EndVertical();
            EditorGUILayout.BeginVertical();
            {
                box.keepBetweenScenes = EditorGUILayout.Toggle(box.keepBetweenScenes);
            }
            EditorGUILayout.EndVertical();
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        {
            EditorGUILayout.BeginVertical(GUILayout.Width(90));
            {
                GUILayout.Label("Repeat");
            }
            EditorGUILayout.EndVertical();
            EditorGUILayout.BeginVertical();
            {
                box.repeat = EditorGUILayout.Toggle(box.repeat);
            }
            EditorGUILayout.EndVertical();
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        {
            EditorGUILayout.BeginVertical(GUILayout.Width(90));
            {
                GUILayout.Label("Random");
            }
            EditorGUILayout.EndVertical();
            EditorGUILayout.BeginVertical();
            {
                box.random = EditorGUILayout.Toggle(box.random);
            }
            EditorGUILayout.EndVertical();
        }
        EditorGUILayout.EndHorizontal();

        if (!box.random && box.playlists.Count > 0)
        {
            EditorGUILayout.BeginHorizontal();
            {
                EditorGUILayout.BeginVertical(GUILayout.Width(90));
                {
                    GUILayout.Label("Start Song");
                }
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical();
                {
                 //   box.currentSong = EditorGUILayout.IntSlider(box.currentSong, 0, box.playlists[box.currentPlaylist].songs.Count - 1); //Widget
                }
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndHorizontal();
        }

        EditorGUILayout.BeginHorizontal();
        {
            EditorGUILayout.BeginVertical(GUILayout.Width(90));
            {
                GUILayout.Label("Load from File");
            }
            EditorGUILayout.EndVertical();
            EditorGUILayout.BeginVertical();
            {
                box.loadFromFile = EditorGUILayout.Toggle(box.loadFromFile);
            }
            EditorGUILayout.EndVertical();
        }
        EditorGUILayout.EndHorizontal();

        if (box.loadFromFile)
        {
            EditorGUILayout.BeginHorizontal();
            {
                EditorGUILayout.BeginVertical(GUILayout.Width(90));
                {
                    GUILayout.Label("Folder to Load");
                }
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical();
                {
                    box.folderToLoad = EditorGUILayout.TextField(box.folderToLoad);
                }
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            {
                EditorGUILayout.BeginVertical(GUILayout.Width(90));
                {
                    GUILayout.Label("Load as 3D sound.");
                }
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical();
                {
                    box.loadAs3D = EditorGUILayout.Toggle(box.loadAs3D);
                }
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndHorizontal();
        }
        #endregion
        #region RuntimeView
        if (EditorApplication.isPlaying)
        {
            if (GUILayout.Button("Next Song"))
            {
                box.NextTrack();
            }
            if (GUILayout.Button("Previous Song"))
            {
                box.PreviousTrack();
            }
            if (GUILayout.Button("Stop"))
            {
                box.Stop();
            }
            if (GUILayout.Button("Play"))
            {
                box.Play();
            }
        //    GUILayout.Label("Current Song: " + box.CurrentSong()); //Widget
        }

        #endregion
        if (GUI.changed)
            EditorUtility.SetDirty(target);
    }

    /// <summary>
    /// Returns the time as minutes:seconds from a length of time in seconds.
    /// </summary>
    /// <param name="time">The length of time in seconds</param>
    /// <returns>Minutes:Seconds</returns>
    static string GetTime(float time)
    {
        // Length / 60 = minutes. Point numbers * 60 how many seconds.
        int minutes = Mathf.FloorToInt(time / 60);
        float seconds = Mathf.CeilToInt(time - (minutes * 60));

        if (seconds == 60)
        {
            minutes++;
            seconds = 0;
        }

        return string.Format("{0}:{1}", minutes.ToString().PadLeft(2, '0'), seconds.ToString().PadLeft(2, '0'));
    }
}


text:
namespace HadoukInput
{
	/// <summary>
	/// An object for wrapping the thumbsticks
	/// </summary>
	public class ThumbsticksWrapper
	{
		#region Members

		/// <summary>
		/// the type of dead zone to use for thumbsticks
		/// </summary>
		private DeadZoneType _thumbstickScrubbing = DeadZoneType.Radial;

		/// <summary>
		/// how do we want to clean up thumbsticks?
		/// </summary>
		public DeadZoneType ThumbstickScrubbing
		{
			get
			{
				return _thumbstickScrubbing;
			}
			set
			{
				_thumbstickScrubbing = value;
				LeftThumbstick.ThumbstickScrubbing = value;
				RightThumbstick.ThumbstickScrubbing = value;
			}
		}

		/// <summary>
		/// The current direction of the left thumbstick, cleaned up however we want.
		/// </summary>
		public ThumbstickWrapper LeftThumbstick { get; protected set; }

		/// <summary>
		/// The current direction of the right thumbstick, cleaned up however we want.
		/// </summary>
		public ThumbstickWrapper RightThumbstick { get; protected set; }

		#endregion //Members

		#region Properties

		public float ThumbstickPower
		{
			set
			{
				LeftThumbstick.ThumbstickPower = value;
				RightThumbstick.ThumbstickPower = value;
			}
		}

		#endregion //Properties

		#region Methods

		/// <summary>
		/// Initializes a new instance of the <see cref="HadoukInput.ThumbsticksWrapper"/> class.
		/// </summary>
		public ThumbsticksWrapper(IControllerWrapper controls)
		{
			LeftThumbstick = new ThumbstickWrapper(controls, true);
			RightThumbstick = new ThumbstickWrapper(controls, false);
		}

		/// <summary>
		/// Reset this instance.
		/// </summary>
		public void Reset()
		{
			LeftThumbstick.Reset();
			RightThumbstick.Reset();
		}

		/// <summary>
		/// called each frame to update the thumbstick vector and the cleaned "direction" vector
		/// </summary>
		/// <param name="inputState"></param>
		/// <param name="i"></param>
		public void UpdateThumbsticks(IInputState inputState, int i)
		{
			//update the left thumbstick
			LeftThumbstick.Update(inputState, i, inputState.LeftThumbstick(i), true);
			RightThumbstick.Update(inputState, i, inputState.RightThumbstick(i), false);
		}

		#endregion //Methods
	}
}

redpajama_set_name: RedPajamaGithub


text:
namespace std{ namespace tr1{

   using ::lslboost::unordered_set;
   using ::lslboost::unordered_multiset;
   using ::lslboost::swap;

} } // namespaces

#endif

#endif


text:
package study.nestpath;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class NestPathStudy {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		SpringApplication.run(NestPathStudy.class, args);
	}
}


text:
All notable changes to this project from 5.0.0 forward will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

### Changed

### Fixed

## [6.0.1] - 2021-10-14
### Added
- add API method for check dependency only in current container
- createTaggedDecorator #1343
- Async bindings #1132
- Async binding resolution (getAllAsync, getAllNamedAsync, getAllTaggedAsync, getAsync, getNamedAsync, getTaggedAsync, rebindAsync, unbindAsync, unbindAllAsync, unloadAsync) #1132
- Global onActivation / onDeactivation #1132
- Parent/Child onActivation / onDeactivation #1132
- Module onActivation / onDeactivation #1132
- Added @preDestroy decorator #1132

### Changed
- @postConstruct can target an asyncronous function #1132
- Singleton scoped services cache resolved values once the result promise is fulfilled #1320

### Fixed
- only inject decorator can be applied to setters #1342
- Container.resolve should resolve in that container #1338

## [5.1.1] - 2021-04-25
-Fix pre-publish for build artifacts

## [5.1.0] - 2021-04-25
### Added
- Upgrade information for v4.x to v5.x

### Changed
- Update BindingToSyntax with `.toAutoNamedFactory()`.

### Fixed
- Fix `Target.isTagged()` to exclude `optional` from tag injections #1190.
- Update `toConstructor`, `toFactory`, `toFunction`, `toAutoFactory`, `toProvider` and `toConstantValue` to have singleton scope #1297.
- Fix injection on optional properties when targeting ES6 #928

## [5.0.1] - 2018-10-17
### Added
- Updating constructor injection wiki document with concrete injection example #922

### Changed
- Change GUID to incremented counter for better performance #882

### Fixed
- fix broken compilation by adding `.toString()` so symbols serialization #893
- Fix problem with applying options on Container.resolve (fix #914) #915
- Fixed documentation issues

## [4.14.0] - 2018-10-16
Deprecated - Replaced by 5.0.1


text: Touristinformation Burg (Spreewald)


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once "functions.php";

/**
 * Description of Test
 *
 * @author Amir <amirsanni@gmail.com>
 * Date: Dec 31st, 2015
 */

class Test extends CI_Controller {

    public function __construct() {
        parent::__construct();

    }

    public function index(){
        echo password_hash("mm3v6ki3fr", PASSWORD_BCRYPT);
    }

    public function newhex(){
        echo md5(time());
    }

}


text:
package io.hua.common.persistence.service;

import io.hua.common.interfaces.IOperations;
import io.hua.common.persistence.model.IEntity;
import org.springframework.data.domain.Page;

public interface IRawService<T extends IEntity> extends IOperations<T> {
    Page<T> findAllPaginationAndSortedRaw(final int page, final int size, final String sortBy, final String sortOrder);
}


text:
/*globals describe, before, afterEach, it */
/*jshint expr:true*/
var testUtils   = require('../utils/index'),
    _           = require('lodash'),
    should      = require('should'),
    sinon       = require('sinon'),
    Promise     = require('bluebird'),
    validator   = require('validator'),

    // Stuff we are testing
    SiteMapManager = require('../../server/data/sitemap/manager'),
    BaseGenerator = require('../../server/data/sitemap/base-generator'),
    PostGenerator = require('../../server/data/sitemap/post-generator'),
    PageGenerator = require('../../server/data/sitemap/page-generator'),
    TagGenerator = require('../../server/data/sitemap/tag-generator'),
    UserGenerator = require('../../server/data/sitemap/user-generator'),

    sandbox = sinon.sandbox.create();

describe('Sitemap', function () {
    var makeStubManager = function () {
        return new SiteMapManager({
            pages: {
                init: sandbox.stub().returns(Promise.resolve()),
                addUrl: sandbox.stub(),
                removeUrl: sandbox.stub(),
                updateUrl: sandbox.stub()
            },
            posts: {
                init: sandbox.stub().returns(Promise.resolve()),
                addUrl: sandbox.stub(),
                removeUrl: sandbox.stub(),
                updateUrl: sandbox.stub()
            },
            authors: {
                init: sandbox.stub().returns(Promise.resolve()),
                addUrl: sandbox.stub(),
                removeUrl: sandbox.stub(),
                updateUrl: sandbox.stub()
            },
            tags: {
                init: sandbox.stub().returns(Promise.resolve()),
                addUrl: sandbox.stub(),
                removeUrl: sandbox.stub(),
                updateUrl: sandbox.stub()
            },
            index: {
                init: sandbox.stub().returns(Promise.resolve()),
                addUrl: sandbox.stub(),
                removeUrl: sandbox.stub(),
                updateUrl: sandbox.stub()
            }
        });
    };

    before(testUtils.teardown);
    afterEach(testUtils.teardown);
    afterEach(function () {
        sandbox.restore();
    });

    describe('SiteMapManager', function () {
        should.exist(SiteMapManager);

        it('can create a SiteMapManager instance', function () {
            var manager = makeStubManager();

            should.exist(manager);
        });

        it('can initialize', function (done) {
            var manager = makeStubManager();

            manager.initialized.should.equal(false);

            manager.init().then(function () {
                manager.posts.init.called.should.equal(true);
                manager.pages.init.called.should.equal(true);
                manager.authors.init.called.should.equal(true);
                manager.tags.init.called.should.equal(true);

                manager.initialized.should.equal(true);

                done();
            }).catch(done);
        });

        it('responds to calls before being initialized', function () {
            var manager = makeStubManager();

            manager.initialized.should.equal(false);

            manager.getIndexXml();
            manager.getSiteMapXml();
            manager.pageAdded();
            manager.pages.addUrl.called.should.equal(false);
            manager.pageEdited();
            manager.pageDeleted();
            manager.postAdded();
            manager.pages.addUrl.called.should.equal(false);
            manager.postEdited();
            manager.postDeleted();
            manager.userAdded();
            manager.pages.addUrl.called.should.equal(false);
            manager.userEdited();
            manager.userDeleted();
            manager.tagAdded();
            manager.pages.addUrl.called.should.equal(false);
            manager.tagEdited();
            manager.tagDeleted();
            manager.permalinksUpdated();

            manager.initialized.should.equal(false);
        });

        it('updates page site map', function (done) {
            var manager = makeStubManager(),
                fake = {
                    toJSON: sandbox.stub().returns({
                        status: 'published'
                    }),
                    get: sandbox.stub().returns('published'),
                    updated: sandbox.stub().returns('published')
                };

            manager.init().then(function () {
                manager.pageAdded(fake);
                manager.pages.addUrl.called.should.equal(true);
                manager.pageEdited(fake);
                manager.pages.updateUrl.called.should.equal(true);
                manager.pageDeleted(fake);
                manager.pages.removeUrl.called.should.equal(true);

                done();
            }).catch(done);
        });

        it('adds pages that were published', function (done) {
            var manager = makeStubManager(),
                fake = {
                    toJSON: sandbox.stub().returns({
                        status: 'published'
                    }),
                    get: sandbox.stub().returns('published'),
                    updated: sandbox.stub().returns('draft')
                };

            manager.init().then(function () {
                manager.pageAdded = sandbox.stub();

                manager.pageEdited(fake);

                manager.pages.updateUrl.called.should.equal(false);
                manager.pageAdded.called.should.equal(true);

                done();
            }).catch(done);
        });

        it('doesn\'t add draft pages', function (done) {
            var manager = makeStubManager(),
                fake = {
                    toJSON: sandbox.stub().returns({
                        status: 'draft'
                    }),
                    get: sandbox.stub().returns('draft'),
                    updated: sandbox.stub().returns('draft')
                };

            manager.init().then(function () {
                manager.pageAdded(fake);

                manager.pages.addUrl.called.should.equal(false);

                done();
            }).catch(done);
        });

        it('deletes pages that were unpublished', function (done) {
            var manager = makeStubManager(),
                fake = {
                    toJSON: sandbox.stub().returns({
                        status: 'draft'
                    }),
                    get: sandbox.stub().returns('draft'),
                    updated: sandbox.stub().returns('published')
                };

            manager.init().then(function () {
                manager.pageAdded = sandbox.stub();
                manager.pageDeleted = sandbox.stub();

                manager.pageEdited(fake);

                manager.pages.updateUrl.called.should.equal(false);
                manager.pageAdded.called.should.equal(false);
                manager.pageDeleted.called.should.equal(true);

                done();
            }).catch(done);
        });

        it('updates post site map', function (done) {
            var manager = makeStubManager(),
                fake = {
                    toJSON: sandbox.stub().returns({
                        status: 'published'
                    }),
                    get: sandbox.stub().returns('published'),
                    updated: sandbox.stub().returns('published')
                };

            manager.init().then(function () {
                manager.postAdded(fake);
                manager.posts.addUrl.called.should.equal(true);
                manager.postEdited(fake);
                manager.posts.updateUrl.called.should.equal(true);
                manager.postDeleted(fake);
                manager.posts.removeUrl.called.should.equal(true);

                done();
            }).catch(done);
        });

        it('adds posts that were published', function (done) {
            var manager = makeStubManager(),
                fake = {
                    toJSON: sandbox.stub().returns({
                        status: 'published'
                    }),
                    get: sandbox.stub().returns('published'),
                    updated: sandbox.stub().returns('draft')
                };

            manager.init().then(function () {
                manager.postAdded = sandbox.stub();

                manager.postEdited(fake);

                manager.posts.updateUrl.called.should.equal(false);
                manager.postAdded.called.should.equal(true);

                done();
            }).catch(done);
        });

        it('doesn\'t add draft posts', function (done) {
            var manager = makeStubManager(),
                fake = {
                    toJSON: sandbox.stub().returns({
                        status: 'draft'
                    }),
                    get: sandbox.stub().returns('draft'),
                    updated: sandbox.stub().returns('draft')
                };

            manager.init().then(function () {
                manager.postAdded(fake);
                manager.posts.addUrl.called.should.equal(false);

                done();
            }).catch(done);
        });

        it('deletes posts that were unpublished', function (done) {
            var manager = makeStubManager(),
                fake = {
                    toJSON: sandbox.stub().returns({
                        status: 'draft'
                    }),
                    get: sandbox.stub().returns('draft'),
                    updated: sandbox.stub().returns('published')
                };

            manager.init().then(function () {
                manager.postAdded = sandbox.stub();
                manager.postDeleted = sandbox.stub();

                manager.postEdited(fake);

                manager.posts.updateUrl.called.should.equal(false);
                manager.postAdded.called.should.equal(false);
                manager.postDeleted.called.should.equal(true);

                done();
            }).catch(done);
        });

        it('updates authors site map', function (done) {
            var manager = makeStubManager(),
                fake = {
                    toJSON: sandbox.stub().returns({})
                };

            manager.init().then(function () {
                manager.userAdded(fake);
                manager.authors.addUrl.called.should.equal(true);
                manager.userEdited(fake);
                manager.authors.updateUrl.called.should.equal(true);
                manager.userDeleted(fake);
                manager.authors.removeUrl.called.should.equal(true);

                done();
            }).catch(done);
        });

        it('updates tags site map', function (done) {
            var manager = makeStubManager(),
                fake = {
                    toJSON: sandbox.stub().returns({})
                };

            manager.init().then(function () {
                manager.tagAdded(fake);
                manager.tags.addUrl.called.should.equal(true);
                manager.tagEdited(fake);
                manager.tags.updateUrl.called.should.equal(true);
                manager.tagDeleted(fake);
                manager.tags.removeUrl.called.should.equal(true);

                done();
            }).catch(done);
        });
    });

    describe('Generators', function () {
        var stubPermalinks = function (generator) {
                sandbox.stub(generator, 'getPermalinksValue', function () {
                    return Promise.resolve({
                        id: 13,
                        uuid: 'ac6d6bb2-0b64-4941-b5ef-e69000bb738a',
                        key: 'permalinks',
                        value: '/:slug/',
                        type: 'blog'
                    });
                });

                return generator;
            },
            stubUrl = function (generator) {
                sandbox.stub(generator, 'getUrlForDatum', function (datum) {
                    return 'http://my-ghost-blog.com/url/' + datum.id;
                });
                sandbox.stub(generator, 'getUrlForImage', function (image) {
                    return 'http://my-ghost-blog.com/images/' + image;
                });

                return generator;
            },
            makeFakeDatum = function (id) {
                return {
                    id: id,
                    created_at: (Date.UTC(2014, 11, 22, 12) - 360000) + id
                };
            };

        describe('BaseGenerator', function () {
            it('can initialize with empty siteMapContent', function (done) {
                var generator = new BaseGenerator();

                stubPermalinks(generator);

                generator.init().then(function () {
                    should.exist(generator.siteMapContent);

                    validator.contains(generator.siteMapContent, '<loc>').should.equal(false);

                    done();
                }).catch(done);
            });

            it('can initialize with non-empty siteMapContent', function (done) {
                var generator = new BaseGenerator();

                stubPermalinks(generator);
                stubUrl(generator);

                sandbox.stub(generator, 'getData', function () {
                    return Promise.resolve([
                        makeFakeDatum(100),
                        makeFakeDatum(200),
                        makeFakeDatum(300)
                    ]);
                });

                generator.init().then(function () {
                    var idxFirst,
                        idxSecond,
                        idxThird;

                    should.exist(generator.siteMapContent);

                    // TODO: We should validate the contents against the XSD:
                    // xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    // xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"

                    validator.contains(generator.siteMapContent,
                        '<loc>http://my-ghost-blog.com/url/100</loc>').should.equal(true);
                    validator.contains(generator.siteMapContent,
                        '<loc>http://my-ghost-blog.com/url/200</loc>').should.equal(true);
                    validator.contains(generator.siteMapContent,
                        '<loc>http://my-ghost-blog.com/url/300</loc>').should.equal(true);

                    // Validate order newest to oldest
                    idxFirst = generator.siteMapContent.indexOf('<loc>http://my-ghost-blog.com/url/300</loc>');
                    idxSecond = generator.siteMapContent.indexOf('<loc>http://my-ghost-blog.com/url/200</loc>');
                    idxThird = generator.siteMapContent.indexOf('<loc>http://my-ghost-blog.com/url/100</loc>');

                    idxFirst.should.be.below(idxSecond);
                    idxSecond.should.be.below(idxThird);

                    done();
                }).catch(done);
            });
        });

        describe('PostGenerator', function () {
            it('uses 0.8 priority for all posts', function () {
                var generator = new PostGenerator();

                generator.getPriorityForDatum({}).should.equal(0.8);
            });

            it('adds an image:image element if post has a cover image', function () {
                var generator = new PostGenerator(),
                    urlNode = generator.createUrlNodeFromDatum(_.extend(makeFakeDatum(100), {
                        image: 'post-100.jpg'
                    })),
                    hasImage;

                hasImage = _.any(urlNode.url, function (node) {
                    return !_.isUndefined(node['image:image']);
                });

                hasImage.should.equal(true);
            });

            it('can initialize with non-empty siteMapContent', function (done) {
                var generator = new PostGenerator();

                stubPermalinks(generator);
                stubUrl(generator);

                sandbox.stub(generator, 'getData', function () {
                    return Promise.resolve([
                        _.extend(makeFakeDatum(100), {
                            image: 'post-100.jpg'
                        }),
                        makeFakeDatum(200),
                        _.extend(makeFakeDatum(300), {
                            image: 'post-300.jpg'
                        })
                    ]);
                });

                generator.init().then(function () {
                    var idxFirst,
                        idxSecond,
                        idxThird;

                    should.exist(generator.siteMapContent);

                    // TODO: We should validate the contents against the XSD:
                    // xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    // xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"

                    validator.contains(generator.siteMapContent,
                        '<loc>http://my-ghost-blog.com/url/100</loc>').should.equal(true);
                    validator.contains(generator.siteMapContent,
                        '<loc>http://my-ghost-blog.com/url/200</loc>').should.equal(true);
                    validator.contains(generator.siteMapContent,
                        '<loc>http://my-ghost-blog.com/url/300</loc>').should.equal(true);

                    validator.contains(generator.siteMapContent,
                        '<image:loc>http://my-ghost-blog.com/images/post-100.jpg</image:loc>')
                        .should.equal(true);
                    // This should NOT be present
                    validator.contains(generator.siteMapContent,
                        '<image:loc>http://my-ghost-blog.com/images/post-200.jpg</image:loc>')
                        .should.equal(false);
                    validator.contains(generator.siteMapContent,
                        '<image:loc>http://my-ghost-blog.com/images/post-300.jpg</image:loc>')
                        .should.equal(true);

                    // Validate order newest to oldest
                    idxFirst = generator.siteMapContent.indexOf('<loc>http://my-ghost-blog.com/url/300</loc>');
                    idxSecond = generator.siteMapContent.indexOf('<loc>http://my-ghost-blog.com/url/200</loc>');
                    idxThird = generator.siteMapContent.indexOf('<loc>http://my-ghost-blog.com/url/100</loc>');

                    idxFirst.should.be.below(idxSecond);
                    idxSecond.should.be.below(idxThird);

                    done();
                }).catch(done);
            });
        });

        describe('PageGenerator', function () {
            it('uses 1 priority for home page', function () {
                var generator = new PageGenerator();

                generator.getPriorityForDatum({
                    name: 'home'
                }).should.equal(1);
            });
            it('uses 0.8 priority for static pages', function () {
                var generator = new PageGenerator();

                generator.getPriorityForDatum({}).should.equal(0.8);
            });
        });

        describe('TagGenerator', function () {
            it('uses 0.6 priority for all tags', function () {
                var generator = new TagGenerator();

                generator.getPriorityForDatum({}).should.equal(0.6);
            });
        });

        describe('UserGenerator', function () {
            it('uses 0.6 priority for author links', function () {
                var generator = new UserGenerator();

                generator.getPriorityForDatum({}).should.equal(0.6);
            });
        });
    });
});


text:
Guernsey Entity Reader/Writer Module
------------------------------------

.. automodule:: guernsey.entities

This module provides a pair of classes used to support marshalling and
unmarshalling data to/from Python. The ``EntityReader`` class allows
the automatic unmarshalling from an encoded form in the response from
a service into Python.  The ``EntityWriter`` class allows the
automatic marshalling of a Python object in a request into the
appropriate encoded form.  Both of these classes use the
``Content-Type`` header to denote the encoded form.

The following example shows how these are typically used in the client,
the client has a set of default configured entity classes (which can be
added to or reduced as needed) which are scanned for any request and
response. If a matching entity class is found for the request or
response it is used to convert to/from Python. In this case we see that
the ``entity`` property on the response has been parsed into the
``parsed_entity`` property; the original value is retained as a string
but the JSON has been parsed into a standard Python dictionary.::

  import guernsey
  c = guernsey.Client.create()
  print c.entity_classes
  [<JsonReader object>, <JsonWriter object>, <XmlReader object>, <XmlWriter object>]
  ...
  response = resource.get()
  print repr(response.entity)
  '{"name": "test"}'
  print response.parsed_entity
  {u'name': u'test'}

Base Classes
************

.. autoclass:: guernsey.entities.EntityReader
   :members:

.. autoclass:: guernsey.entities.EntityWriter
   :members:

Standard Reader/Writer Classes
******************************

.. autoclass:: guernsey.entities.JsonReader

.. autoclass:: guernsey.entities.JsonWriter

.. autoclass:: guernsey.entities.XmlReader

.. autoclass:: guernsey.entities.XmlWriter


text:
require('./test-env');

const fn = require('../src/helpers/email/get-template-id');
const config = require('smart-config');

describe('Templates map', () => {

  it('use template id directly', () => {
    const template = '123456';
    const templateId = fn(template);

    assert.equal(templateId, template);
  });

  it('use template id from template map', () => {
    const template = 'alerts';
    const alertsTemplateId = config.get(`email.templatesMap.${template}`);
    const templateId = fn(template);

    assert.equal(templateId, alertsTemplateId);
  });

});


text:
/**
 * @fileoverview Utility function transforming a string into robber language
 * @author Vemund Santi
 */
"use strict";

module.exports = function createRobberLanguageString(string) {
  var robberLanguageMatcher = /([b-df-hj-np-tv-xzB-DF-HJ-NP-TV-XZ])/g;

  return string.replace(robberLanguageMatcher, function(match) {
    if(match === match.toUpperCase()) {
      return match + "O" + match;
    } else {
      return match + "o" + match;
    }
  });
};


text:
/**
 * Element classes for XEP-0012: Last Activity.
 */
package org.jivesoftware.smackx.iqlast.packet;


text:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import argparse
import ast
import json
import logging
import os
import sys
import uuid
import subprocess

from gentable import *

SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.append(SCRIPT_DIR + "/../tests")
from utils import platform

# the log format for the logging module
LOG_FORMAT = "%(levelname)s [Line %(lineno)d]: %(message)s"

CANONICAL_PLATFORMS = {
    "specs": "All Platforms",
    "darwin": "Darwin (Apple OS X)",
    "linux": "Ubuntu, CentOS",
    "centos": "CentOS",
    "ubuntu": "Ubuntu",
    "utility": "Utility",
}

TEMPLATE_API_DEFINITION = """
{
"tables": %s,
"events": [
]
}
"""

class NoIndent(object):

    """Special instance checked object for removing json newlines."""

    def __init__(self, value):
        self.value = value
        if 'type' in self.value and isinstance(self.value['type'], DataType):
            self.value['type'] = str(self.value['type'])

class Encoder(json.JSONEncoder):

    """
    Newlines are such a pain in json-generated output.
    Use this custom encoder to produce pretty json multiplexed with a more
    raw json output within.
    """

    def __init__(self, *args, **kwargs):
        super(Encoder, self).__init__(*args, **kwargs)
        self.kwargs = dict(kwargs)
        del self.kwargs['indent']
        self._replacement_map = {}

    def default(self, o):
        if isinstance(o, NoIndent):
            key = uuid.uuid4().hex
            self._replacement_map[key] = json.dumps(o.value, **self.kwargs)
            return "@@%s@@" % (key,)
        else:
            return super(Encoder, self).default(o)

    def encode(self, o):
        result = super(Encoder, self).encode(o)
        for k, v in self._replacement_map.iteritems():
            result = result.replace('"@@%s@@"' % (k,), v)
        return result

def gen_api_json(api):
    """Apply the api literal object to the template."""
    api = json.dumps(
        api, cls=Encoder, sort_keys=True, indent=1, separators=(',', ': ')
    )
    return TEMPLATE_API_DEFINITION % (api)

def gen_spec(tree):
    """Given a table tree, produce a literal of the table representation."""
    exec(compile(tree, "<string>", "exec"))
    columns = [NoIndent({
        "name": column.name,
        "type": column.type,
        "description": column.description,
        "options": column.options,
    }) for column in table.columns()]
    foreign_keys = [NoIndent({"column": key.column, "table": key.table})
                    for key in table.foreign_keys()]
    return {
        "name": table.table_name,
        "columns": columns,
        "foreign_keys": foreign_keys,
        "function": table.function,
        "description": table.description,
        "attributes": table.attributes,
        "examples": table.examples,
    }

def gen_diff(api_old_path, api_new_path):
    """Quick and dirty way to view table API changes."""
    with open(api_old_path, 'r') as fh:
        api_old = json.loads(fh.read())
    with open(api_new_path, 'r') as fh:
        api_new = json.loads(fh.read())

    # Prune table lists into maps
    old_tables = {}
    new_tables = {}
    for category in api_new["tables"]:
        for table in category["tables"]:
            new_tables["%s:%s" % (category["name"], table["name"])] = table
    for category in api_old["tables"]:
        for table in category["tables"]:
            old_tables["%s:%s" % (category["name"], table["name"])] = table

    # Iterate backwards then forward to detect added/removed.
    tables_added = []
    tables_removed = []
    columns_added = []
    columns_removed = []
    for name, table in new_tables.iteritems():
        if name not in old_tables:
            tables_added.append(name)
            continue
        for column in table["columns"]:
            old_columns = [c["name"] for c in old_tables[name]["columns"]]
            if column["name"] not in old_columns:
                columns_added.append("%s:%s:%s:%s" % (category["name"],
                    table["name"], column["name"], column["type"]))

    for name, table in old_tables.iteritems():
        if name not in new_tables:
            tables_removed.append(name)
            continue
        for column in table["columns"]:
            new_columns = [c["name"] for c in new_tables[name]["columns"]]
            if column["name"] not in new_columns:
                columns_removed.append("%s:%s:%s:%s" % (category["name"],
                    table["name"], column["name"], column["type"]))

    # Sort then pretty print (md) the changes.
    tables_added.sort()
    for name in tables_added:
        print ("Added table `%s` to %s" % tuple(name.split(":")[::-1]))
    columns_added.sort()
    for name in columns_added:
        column = name.split(":")
        print ("Added column `%s` (`%s`) to table `%s`" % (column[2], column[3],
            column[1]))
    tables_removed.sort()
    for name in tables_removed:
        print ("Removed table `%s` from %s" % tuple(name.split(":")[::-1]))
    columns_removed.sort()
    for name in columns_removed:
        column = name.split(":")
        print ("Removed column `%s` (`%s`) from table `%s`" % (column[2],
            column[3], column[1]))

def gen_api(tables_path, profile={}):
    blacklist = None
    blacklist_path = os.path.join(tables_path, "blacklist")
    if os.path.exists(blacklist_path):
        with open(blacklist_path, "r") as fh:
            blacklist = fh.read()

    categories = {}
    for base, _, files in os.walk(tables_path):
        for spec_file in files:
            if spec_file[0] == '.' or spec_file.find("example") == 0:
                continue
            # Exclude blacklist specific file
            if spec_file == 'blacklist':
                continue
            platform = os.path.basename(base)
            platform_name = CANONICAL_PLATFORMS[platform]
            name = spec_file.split(".table", 1)[0]
            if platform not in categories.keys():
                categories[platform] = {"name": platform_name, "tables": []}
            with open(os.path.join(base, spec_file), "rU") as fh:
                tree = ast.parse(fh.read())
                table_spec = gen_spec(tree)
                table_profile = profile.get("%s.%s" % (platform, name), {})
                table_spec["profile"] = NoIndent(table_profile)
                table_spec["blacklisted"] = is_blacklisted(table_spec["name"],
                                                           blacklist=blacklist)
                categories[platform]["tables"].append(table_spec)
    categories = [{"key": k, "name": v["name"], "tables": v["tables"]}
                  for k, v in categories.iteritems()]
    return categories

def main(argc, argv):
    parser = argparse.ArgumentParser("Generate API documentation.")
    parser.add_argument(
        "--debug", default=False, action="store_true",
        help="Output debug messages (when developing)"
    )
    parser.add_argument(
        "--tables", default="specs",
        help="Path to osquery table specs"
    )
    parser.add_argument(
        "--profile", default=None,
        help="Add the results of a profile summary to the API."
    )
    parser.add_argument(
        "--diff", default=False, action="store_true",
        help="Compare API changes API_PREVIOUS API_CURRENT"
    )
    parser.add_argument(
        "--output", default=False, action="store_true",
        help="Create output file as the version tagged."
    )
    parser.add_argument(
        "--directory", default=".",
        help="Directory to use for the output file."
    )
    parser.add_argument("vars", nargs="*")
    args = parser.parse_args()

    if args.debug:
        logging.basicConfig(format=LOG_FORMAT, level=logging.DEBUG)
    else:
        logging.basicConfig(format=LOG_FORMAT, level=logging.INFO)

    if args.diff:
        if len(args.vars) < 2:
            logging.error("If using --diff you must supply API_OLD API_NEW")
            exit(1)
        gen_diff(args.vars[0], args.vars[1])
        exit(0)

    if not os.path.exists(args.tables):
        logging.error("Cannot find path: %s" % (args.tables))
        exit(1)

    profile = {}
    if args.profile is not None:
        if not os.path.exists(args.profile):
            logging.error("Cannot find path: %s" % (args.profile))
            exit(1)
        with open(args.profile, "r") as fh:
            try:
                profile = json.loads(fh.read())
            except Exception as e:
                logging.error("Cannot parse profile data: %s" % (str(e)))
                exit(2)

    # Read in the optional list of blacklisted tables, then generate categories.
    api = gen_api(args.tables, profile)

    # Output file will be the version with json extension, otherwise stdout
    if args.output:
      print('[+] creating tables json')
      cmd = ['git', 'describe', '--tags', 'HEAD']
      proc = subprocess.Popen(
        cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE
      )
      out, err = proc.communicate()
      output_file = out.split("\n")[0] + ".json"
      if args.directory[-1:] == '/':
        output_path = args.directory + output_file
      else:
        output_path = args.directory + '/' + output_file

      with open(output_path, 'w') as f:
        print(gen_api_json(api), file=f)
      print('[+] tables json file created at %s' % (output_path))
    else:
      print(gen_api_json(api))

if __name__ == "__main__":
    SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
    main(len(sys.argv), sys.argv)


text:
package com.alipay.api.response;

import com.alipay.api.internal.mapping.ApiField;

import com.alipay.api.AlipayResponse;

/**
 * ALIPAY API: alipay.marketing.card.update response.
 *
 * @author auto create
 * @since 1.0, 2017-08-24 15:51:39
 */
public class AlipayMarketingCardUpdateResponse extends AlipayResponse {

	private static final long serialVersionUID = 6789552744714947573L;

	/**
	 * 二级错误处理结果(如果公用返回结果为false,则可以看这个接口判断明细原因)
如果公用返回为true,则该字段为空
	 */
	@ApiField("result_code")
	private String resultCode;

	public void setResultCode(String resultCode) {
		this.resultCode = resultCode;
	}
	public String getResultCode( ) {
		return this.resultCode;
	}

}


text:
<?php
class Pleesher_GetUserPageOutputAction extends Pleesher_Action
{
	public function getAllowedParams()
	{
		return array_merge(parent::getAllowedParams(), [
			'username' => null
		]);
	}

	protected function doExecute()
	{
		$user_name = $this->getParameter('username');

		$output = '';

		PleesherExtension::$pleesher->setExceptionHandler(PleesherExtension::$pleesher->getDefaultExceptionHandler());

		try {
			$achievement_count = count(PleesherExtension::getAchievements($user_name)) ?: 0;
			$showcased_achievement_count = count(PleesherExtension::getShowcasedAchievements($user_name));
			$goal_count = count(PleesherExtension::$goal_data);

			$user = PleesherExtension::getUser($user_name);
			if (is_object($user))
			{
				if (!empty($output))
					$output .= PHP_EOL . PHP_EOL;

				$output .= PleesherExtension::render('user', array_merge(PleesherExtension::$implementation->getUserPageData($user), [
					'user' => $user,
					'closest_achievements' => PleesherExtension::getClosestAchievements($user_name, 3),
					'achievement_count' => $achievement_count,
					'showcased_achievement_count' => $showcased_achievement_count,
					'goal_count' => $goal_count
				]));
			}
		} catch (Exception $e)
		{
			if (!empty($output))
				$output .= PHP_EOL . PHP_EOL;

			if ($e instanceof PleesherDisabledException)
				$output .= PleesherExtension::render('disabled');
			else if ($e instanceof \Pleesher\Client\Exception\Exception)
				$output .= PleesherExtension::render('error', ['error_message' => PleesherExtension::$view_helper->text('pleesher.error.text.' . ($e->getErrorCode() ?: 'generic'), $e->getErrorParameters() ?: [])]);
			else
			{
				PleesherExtension::$pleesher->logger->error($e);
				$output .= PleesherExtension::render('error', ['error_message' => PleesherExtension::$view_helper->text('pleesher.error.text.generic')]);
			}
		}

		PleesherExtension::$pleesher->restoreExceptionHandler();

		$this->getResult()->addValue(null, 'output', $output);
	}
}


text:
#ifndef HB_PRIVATE_H
#define HB_PRIVATE_H

#if HAVE_CONFIG_H
#include "config.h"
#endif

#include "hb-common.h"

#include <stdlib.h>
#include <string.h>
#include <assert.h>

/* We only use these two for debug output.  However, the debug code is
 * always seen by the compiler (and optimized out in non-debug builds.
 * If including these becomes a problem, we can start thinking about
 * someway around that. */
#include <stdio.h>
#include <errno.h>

HB_BEGIN_DECLS

/* Essentials */

#ifndef NULL
# define NULL ((void *) 0)
#endif

#undef FALSE
#define FALSE 0

#undef TRUE
#define TRUE 1

/* Basics */

#undef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))

#undef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))

#undef  ARRAY_LENGTH
#define ARRAY_LENGTH(__array) ((signed int) (sizeof (__array) / sizeof (__array[0])))

#define HB_STMT_START do
#define HB_STMT_END   while (0)

#define _ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1]
#define _ASSERT_STATIC0(_line, _cond) _ASSERT_STATIC1 (_line, (_cond))
#define ASSERT_STATIC(_cond) _ASSERT_STATIC0 (__LINE__, (_cond))

/* Misc */

#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
#define _HB_BOOLEAN_EXPR(expr) ((expr) ? 1 : 0)
#define likely(expr) (__builtin_expect (_HB_BOOLEAN_EXPR(expr), 1))
#define unlikely(expr) (__builtin_expect (_HB_BOOLEAN_EXPR(expr), 0))
#else
#define likely(expr) (expr)
#define unlikely(expr) (expr)
#endif

#ifndef __GNUC__
#undef __attribute__
#define __attribute__(x)
#endif

#if __GNUC__ >= 3
#define HB_PURE_FUNC	__attribute__((pure))
#define HB_CONST_FUNC	__attribute__((const))
#else
#define HB_PURE_FUNC
#define HB_CONST_FUNC
#endif
#if __GNUC__ >= 4
#define HB_UNUSED	__attribute__((unused))
#else
#define HB_UNUSED
#endif

#ifndef HB_INTERNAL
# define HB_INTERNAL __attribute__((__visibility__("hidden")))
#endif

#if (defined(__WIN32__) && !defined(__WINE__)) || defined(_MSC_VER)
#define snprintf _snprintf
#endif

#ifdef _MSC_VER
#undef inline
#define inline __inline
#endif

#ifdef __STRICT_ANSI__
#undef inline
#define inline __inline__
#endif

#if __GNUC__ >= 3
#define HB_FUNC __PRETTY_FUNCTION__
#elif defined(_MSC_VER)
#define HB_FUNC __FUNCSIG__
#else
#define HB_FUNC __func__
#endif

/* Return the number of 1 bits in mask. */
static inline HB_CONST_FUNC unsigned int
_hb_popcount32 (uint32_t mask)
{
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
  return __builtin_popcount (mask);
#else
  /* "HACKMEM 169" */
  register uint32_t y;
  y = (mask >> 1) &033333333333;
  y = mask - y - ((y >>1) & 033333333333);
  return (((y + (y >> 3)) & 030707070707) % 077);
#endif
}

/* Returns the number of bits needed to store number */
static inline HB_CONST_FUNC unsigned int
_hb_bit_storage (unsigned int number)
{
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__)
  return likely (number) ? (sizeof (unsigned int) * 8 - __builtin_clz (number)) : 0;
#else
  register unsigned int n_bits = 0;
  while (number) {
    n_bits++;
    number >>= 1;
  }
  return n_bits;
#endif
}

/* Returns the number of zero bits in the least significant side of number */
static inline HB_CONST_FUNC unsigned int
_hb_ctz (unsigned int number)
{
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__)
  return likely (number) ? __builtin_ctz (number) : 0;
#else
  register unsigned int n_bits = 0;
  if (unlikely (!number)) return 0;
  while (!(number & 1)) {
    n_bits++;
    number >>= 1;
  }
  return n_bits;
#endif
}

/* Type of bsearch() / qsort() compare function */
typedef int (*hb_compare_func_t) (const void *, const void *);

/* We need external help for these */

#ifdef HAVE_GLIB

#include <glib.h>

typedef int hb_atomic_int_t;
#define hb_atomic_int_fetch_and_add(AI, V)	g_atomic_int_exchange_and_add (&(AI), V)
#define hb_atomic_int_get(AI)			g_atomic_int_get (&(AI))
#define hb_atomic_int_set(AI, V)		g_atomic_int_set (&(AI), V)

typedef GStaticMutex hb_mutex_t;
#define HB_MUTEX_INIT			G_STATIC_MUTEX_INIT
#define hb_mutex_init(M)		g_static_mutex_init (&M)
#define hb_mutex_lock(M)		g_static_mutex_lock (&M)
#define hb_mutex_trylock(M)		g_static_mutex_trylock (&M)
#define hb_mutex_unlock(M)		g_static_mutex_unlock (&M)

#else

#ifdef _MSC_VER
#pragma message(__LOC__"Could not find any system to define platform macros, library will NOT be thread-safe")
#else
#warning "Could not find any system to define platform macros, library will NOT be thread-safe"
#endif

typedef int hb_atomic_int_t;
#define hb_atomic_int_fetch_and_add(AI, V)	((AI) += (V), (AI) - (V))
#define hb_atomic_int_get(AI)			(AI)
#define hb_atomic_int_set(AI, V)		HB_STMT_START { (AI) = (V); } HB_STMT_END

typedef int hb_mutex_t;
#define HB_MUTEX_INIT				0
#define hb_mutex_init(M)			HB_STMT_START { (M) = 0; } HB_STMT_END
#define hb_mutex_lock(M)			HB_STMT_START { (M) = 1; } HB_STMT_END
#define hb_mutex_trylock(M)			((M) = 1, 1)
#define hb_mutex_unlock(M)			HB_STMT_START { (M) = 0; } HB_STMT_END

#endif

/* Big-endian handling */

#define hb_be_uint16(v)		((uint16_t) ((((const uint8_t *)&(v))[0] << 8) + (((const uint8_t *)&(v))[1])))

#define hb_be_uint16_put(v,V)	HB_STMT_START { v[0] = (V>>8); v[1] = (V); } HB_STMT_END
#define hb_be_uint16_get(v)	(uint16_t) ((v[0] << 8) + v[1])
#define hb_be_uint16_cmp(a,b)	(a[0] == b[0] && a[1] == b[1])

#define hb_be_uint32_put(v,V)	HB_STMT_START { v[0] = (V>>24); v[1] = (V>>16); v[2] = (V>>8); v[3] = (V); } HB_STMT_END
#define hb_be_uint32_get(v)	(uint32_t) ((v[0] << 24) + (v[1] << 16) + (v[2] << 8) + v[3])
#define hb_be_uint32_cmp(a,b)	(a[0] == b[0] && a[1] == b[1] && a[2] == b[2] && a[3] == b[3])

/* Debug */

#ifndef HB_DEBUG
#define HB_DEBUG 0
#endif

static inline hb_bool_t /* always returns TRUE */
_hb_trace (const char *what,
	   const char *function,
	   const void *obj,
	   unsigned int depth,
	   unsigned int max_depth)
{
  (void) ((depth < max_depth) && fprintf (stderr, "%s(%p) %-*d-> %s\n", what, obj, depth, depth, function));
  return TRUE;
}

#include "hb-object-private.h"

HB_END_DECLS

#endif /* HB_PRIVATE_H */


text:
<?php

namespace ProtobufCompilerTest;

use Protobuf\Field;
use Protobuf\Compiler;
use Protobuf\Descriptor;
use Protobuf\Compiler\Options;
use Protobuf\Compiler\Context;
use Protobuf\Compiler\Generator;

use google\protobuf\php\Extension;
use google\protobuf\SourceCodeInfo;
use google\protobuf\DescriptorProto;
use google\protobuf\EnumDescriptorProto;
use google\protobuf\FileDescriptorProto;
use google\protobuf\FieldDescriptorProto;
use google\protobuf\MethodDescriptorProto;
use google\protobuf\ServiceDescriptorProto;
use google\protobuf\EnumValueDescriptorProto;
use google\protobuf\compiler\CodeGeneratorRequest;

class GeneratorTest extends TestCase
{
    public function descriptorProvider()
    {
        return [

            // simple message
            [
                'Simple.tpl',
                'ProtobufCompilerTest.Protos.Simple',
                [
                    'name'    => 'simple.proto',
                    'package' => 'ProtobufCompilerTest.Protos',
                    'values'  => [
                        'messages' => [
                            [
                                'name'   => 'Simple',
                                'fields' => [
                                    1  => ['double', Field::TYPE_DOUBLE, Field::LABEL_OPTIONAL],
                                    2  => ['float', Field::TYPE_FLOAT, Field::LABEL_OPTIONAL],
                                    3  => ['int64', Field::TYPE_INT64, Field::LABEL_OPTIONAL],
                                    4  => ['uint64', Field::TYPE_UINT64, Field::LABEL_OPTIONAL],
                                    5  => ['int32', Field::TYPE_INT32, Field::LABEL_OPTIONAL],
                                    6  => ['fixed64', Field::TYPE_FIXED64, Field::LABEL_OPTIONAL],
                                    7  => ['fixed32', Field::TYPE_FIXED32, Field::LABEL_OPTIONAL],
                                    8  => ['bool', Field::TYPE_BOOL, Field::LABEL_OPTIONAL],
                                    9  => ['string', Field::TYPE_STRING, Field::LABEL_OPTIONAL],
                                    12 => ['bytes', Field::TYPE_BYTES, Field::LABEL_OPTIONAL],
                                    13 => ['uint32', Field::TYPE_UINT32, Field::LABEL_OPTIONAL],
                                    15 => ['sfixed32', Field::TYPE_SFIXED32, Field::LABEL_OPTIONAL],
                                    16 => ['sfixed64', Field::TYPE_SFIXED64, Field::LABEL_OPTIONAL],
                                    17 => ['sint32', Field::TYPE_SINT32, Field::LABEL_OPTIONAL],
                                    18 => ['sint64', Field::TYPE_SINT64, Field::LABEL_OPTIONAL]
                                ]
                            ]
                        ]
                    ]
                ]
            ],

            // complex with default value
            [
                'PhoneNumber.tpl',
                'ProtobufCompilerTest.Protos.PhoneNumber',
                [
                    'name'    => 'addressbook.proto',
                    'package' => 'ProtobufCompilerTest.Protos',
                    'values'  => [
                        'messages' => [
                            [
                                'name'   => 'PhoneNumber',
                                'fields' => [
                                    1  => ['number', Field::TYPE_STRING, Field::LABEL_REQUIRED],
                                    2  => ['type', Field::TYPE_ENUM, Field::LABEL_OPTIONAL, '.ProtobufCompilerTest.Protos.PhoneType', ['default' => 'HOME']],
                                ]
                            ],
                            [
                                'name'   => 'PhoneType',
                                'fields' => []
                            ]
                        ]
                    ]
                ]
            ],

            // complex message
            [
                'Person.tpl',
                'ProtobufCompilerTest.Protos.Person',
                [
                    'name'    => 'addressbook.proto',
                    'package' => 'ProtobufCompilerTest.Protos',
                    'values'  => [
                        'messages' => [
                            [
                                'name'   => 'Person',
                                'fields' => [
                                    1  => ['name', Field::TYPE_STRING, Field::LABEL_REQUIRED],
                                    2  => ['id', Field::TYPE_INT32, Field::LABEL_REQUIRED],
                                    3  => ['email', Field::TYPE_STRING, Field::LABEL_OPTIONAL],
                                    4  => ['phone', Field::TYPE_MESSAGE, Field::LABEL_REPEATED, '.ProtobufCompilerTest.Protos.PhoneNumber'],
                                ]
                            ],
                            [
                                'name'   => 'PhoneNumber',
                                'fields' => []
                            ]
                        ]
                    ]
                ]
            ],

            // nested enum
            [
                'Person/PhoneType.tpl',
                'ProtobufCompilerTest.Protos.Person.PhoneType',
                [
                    'name'    => 'addressbook.proto',
                    'package' => 'ProtobufCompilerTest.Protos',
                    'values'  => [
                        'messages' => [
                            [
                                'name'   => 'Person',
                                'fields' => [],
                                'values' => [
                                    'enums' => [
                                        [
                                            'name'   => 'PhoneType',
                                            'values' => [
                                                0 => 'MOBILE',
                                                1 => 'HOME',
                                                2 => 'WORK'
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ]
                    ]
                ]
            ],

            // extension
            [
                'Extension/Extension.tpl',
                'ProtobufCompilerTest.Protos.Extension.Extension',
                [
                    'name'    => 'extension.proto',
                    'package' => 'ProtobufCompilerTest.Protos.Extension',
                    'values'  => [
                        'extensions' => [
                            200  => ['habitat', Field::TYPE_STRING, Field::LABEL_OPTIONAL, '.ProtobufCompilerTest.Protos.Extension.Animal'],
                            201  => ['verbose', Field::TYPE_BOOL, Field::LABEL_OPTIONAL, '.ProtobufCompilerTest.Protos.Extension.Command']
                        ],
                        'messages' => [
                            [
                                'name'   => 'Dog',
                                'fields' => [],
                                'values' => [
                                    'extensions' => [
                                        101  => ['animal',  Field::TYPE_MESSAGE, Field::LABEL_OPTIONAL, '.ProtobufCompilerTest.Protos.Extension.Animal', '.ProtobufCompilerTest.Protos.Extension.Dog']
                                    ]
                                ]
                            ],
                            [
                                'name'   => 'Command',
                                'fields' => []
                            ],
                            [
                                'name'   => 'Animal',
                                'fields' => []
                            ]
                        ]
                    ]
                ]
            ],

            // nested extension
            [
                'Extension/Dog.tpl',
                'ProtobufCompilerTest.Protos.Extension.Dog',
                [
                    'name'    => 'extension.proto',
                    'package' => 'ProtobufCompilerTest.Protos.Extension',
                    'values'  => [
                        'messages' => [
                            [
                                'name'   => 'Dog',
                                'fields' => [
                                    1  => ['bones_buried', Field::TYPE_INT32, Field::LABEL_OPTIONAL, '.ProtobufCompilerTest.Protos.Extension.Dog'],
                                ],
                                'values' => [
                                    'extensions' => [
                                        101  => ['animal',  Field::TYPE_MESSAGE, Field::LABEL_OPTIONAL, '.ProtobufCompilerTest.Protos.Extension.Animal', '.ProtobufCompilerTest.Protos.Extension.Dog']
                                    ]
                                ]
                            ],
                            [
                                'name'   => 'Animal',
                                'fields' => []
                            ]
                        ]
                    ]
                ]
            ],

            // message using php.package
            [
                'Options/SimpleMessage.tpl',
                'ProtobufCompilerTest.Protos.SimpleMessage',
                [
                    'name'    => 'php_options.proto',
                    'package' => 'ProtobufCompilerTest.Protos',
                    'values'  => [
                        'options' => [
                            'extensions' => [
                                [Extension::package(), 'ProtobufCompilerTest.Protos.Options']
                            ]
                        ],
                        'messages' => [
                            [
                                'name'   => 'SimpleMessage',
                                'fields' => []
                            ]
                        ]
                    ]
                ]
            ],

            // Inner Enum using php.package
            [
                'Options/ParentMessage/InnerMessage/InnerMessageEnum.tpl',
                'ProtobufCompilerTest.Protos.ParentMessage.InnerMessage.InnerMessageEnum',
                [
                    'name'    => 'php_options.proto',
                    'package' => 'ProtobufCompilerTest.Protos',
                    'values'  => [
                        'options' => [
                            'extensions' => [
                                [Extension::package(), 'ProtobufCompilerTest.Protos.Options']
                            ]
                        ],
                        'messages' => [
                            [
                                'name'   => 'ParentMessage',
                                'fields' => [],
                                'values' => [
                                    'messages' => [
                                        [
                                            'name'   => 'InnerMessage',
                                            'fields' => [],
                                            'values' => [
                                                'enums' => [
                                                    [
                                                        'name'   => 'InnerMessageEnum',
                                                        'values' => [
                                                            0 => 'VALUE'
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ]
                    ]
                ]
            ],

        ];
    }

    /**
     * @dataProvider descriptorProvider
     */
    public function testVisitEntity($fixture, $className, $descriptor)
    {
        $context   = $this->createContext([$descriptor]);
        $expected  = $this->getFixtureFileContent($fixture);
        $entity    = $context->getEntity($className);
        $generator = new Generator($context);

        $generator->visit($entity);

         // file_put_contents(__DIR__ . '/Fixtures/'. $fixture, $entity->getContent());

        $this->assertEquals($expected, $entity->getContent());
    }

    public function testService()
    {
        $serviceDesc = new ServiceDescriptorProto();
        $methodDesc  = new MethodDescriptorProto();

        // rpc search (SearchRequest) returns (SearchResponse);

        $methodDesc->setName('search');
        $methodDesc->setInputType('.ProtobufCompilerTest.Protos.Service.SearchRequest');
        $methodDesc->setOutputType('.ProtobufCompilerTest.Protos.Service.SearchResponse');

        $serviceDesc->setName('SearchService');
        $serviceDesc->addMethod($methodDesc);

        $context = $this->createContext([
            [
                'name'    => 'service.proto',
                'package' => 'ProtobufCompilerTest.Protos.Service',
                'values'  => [
                    'services' => [$serviceDesc],
                    'messages' => [
                        [
                            'name'   => 'SearchRequest',
                            'fields' => []
                        ],
                        [
                            'name'   => 'SearchResponse',
                            'fields' => []
                        ]
                    ]
                ]
            ]
        ]);

        $expected  = $this->getFixtureFileContent('Service/SearchService.tpl');
        $className = 'ProtobufCompilerTest.Protos.Service.SearchService';
        $entity    = $context->getEntity($className);
        $generator = new Generator($context);

        $generator->visit($entity);

        // file_put_contents(__DIR__ . '/Fixtures/Service/SearchService.tpl', $entity->getContent());

        $this->assertEquals($expected, $entity->getContent());
    }

    public function testGetPsr4ClassPath()
    {
        $className = '\\ProtobufCompilerTest\\Protos\\Foo';
        $options   = [
            'psr4' => [
                'Protos',
                'ProtobufCompilerTest'
            ]
        ];

        $context   = $this->createContext([], $options);
        $generator = new Generator($context);

        $expected   = 'Protos/Foo.php';
        $actual     = $this->invokeMethod($generator, 'getPsr4ClassPath', [$className]);

        $this->assertEquals($expected, $actual);
    }
}


text:
package tamestaj;

@SuppressWarnings("unused")
class AbstractFrame<L, S> implements Frame<L, S> {
    private final Object[] locals;
    private final Object[] stack;
    private int stackSize;

    protected AbstractFrame(int maxLocals, int maxStack) {
        locals = new Object[maxLocals];
        stack = new Object[maxStack];
    }

    protected AbstractFrame(L[] locals, S[] stack) {
        this.locals = locals;
        this.stack = stack;
    }

    final int getMaxLocals() {
        return locals.length;
    }

    final int getMaxStack() {
        return stack.length;
    }

    final int getStackSize() {
        return stackSize;
    }

    public S peek() {
        return (S) stack[stackSize - 1];
    }

    public S pop() {
        stackSize--;
        return (S) stack[stackSize];
    }

    public void push(S value) {
        stack[stackSize] = value;
        stackSize++;
    }

    public void setStack(int offset, S value) {
        stack[stackSize - 1 - offset] = value;
    }

    public S getStack(int offset) {
        return (S) stack[stackSize - 1 - offset];
    }

    public void setLocal(int index, L value) {
        locals[index] = value;
    }

    public L getLocal(int index) {
        return (L) locals[index];
    }

    public void clearStack() {
        stackSize = 0;
    }

    public S pop2() {
        pop();
        S v = pop();

        return v;
    }

    public void push2(S value) {
        push(value);
        push(null);
    }

    public void setLocal2(int index, L value) {
        setLocal(index, value);
        setLocal(index + 1, null);
    }

    public L getLocal2(int index) {
        return getLocal(index);
    }

    void copyLocalsInto(AbstractFrame<L, S> frame) {
        System.arraycopy(locals, 0, frame.locals, 0, locals.length);
    }

    void copyStackInto(AbstractFrame<L, S> frame) {
        System.arraycopy(stack, 0, frame.stack, 0, stack.length);
        frame.stackSize = stackSize;
    }

    void copyInto(AbstractFrame<L, S> frame) {
        copyLocalsInto(frame);
        copyStackInto(frame);
    }

    public boolean equals(Object obj) {
        if (this == obj) { return true; }
        if (!(obj instanceof AbstractFrame)) { return false; }
        AbstractFrame frame = (AbstractFrame) obj;

        for (int i = 0; i < locals.length; i++) {
            if (locals[i] != null && frame.locals[i] != null) {
                if (!locals[i].equals(frame.locals[i])) {
                    return false;
                }
            } else if (locals[i] == null && frame.locals[i] != null) {
                return false;
            } else if (locals[i] != null && frame.locals[i] == null) {
                return false;
            }
        }

        for (int i = 0; i < stackSize; i++) {
            if (stack[i] != null) {
                if (!stack[i].equals(frame.stack[i])) {
                    return false;
                }
            }
        }

        return true;
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();

        sb.append("locals = [");
        for (int i = 0; i < locals.length; i++) {
            sb.append(locals[i] == null ? "empty" : locals[i].toString());
            if (i < locals.length - 1) {
                sb.append(", ");
            }
        }
        sb.append("] stack = [");
        for (int i = 0; i < stackSize; i++) {
            sb.append(stack[i]);
            if (i < stackSize - 1) {
                sb.append(", ");
            }
        }
        sb.append("]");

        return sb.toString();
    }
}


text:
package io.github.ageofwar.telejam.inline;

import com.google.gson.annotations.SerializedName;

import java.util.Objects;

/**
 * This object represents one button of an inline keyboard.
 *
 * @author Michi Palazzo
 */
public class CallbackDataInlineKeyboardButton extends InlineKeyboardButton {

  static final String CALLBACK_DATA_FIELD = "callback_data";

  /**
   * Data to be sent in a callback query to the bot when button is pressed.
   */
  @SerializedName(CALLBACK_DATA_FIELD)
  private final String data;

  /**
   * Constructs a CallbackDataInlineKeyboardButton.
   *
   * @param text label text on the button
   * @param data data to be sent in a callback query to the
   *             bot when button is pressed.
   */
  public CallbackDataInlineKeyboardButton(String text, String data) {
    super(text);
    this.data = Objects.requireNonNull(data);
  }

  /**
   * Getter for property {@link #data}.
   *
   * @return value for property {@link #data}
   */
  public String getData() {
    return data;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (!(obj instanceof CallbackDataInlineKeyboardButton)) {
      return false;
    }
    CallbackDataInlineKeyboardButton button = (CallbackDataInlineKeyboardButton) obj;
    return getText().equals(button.getText()) && data.equals(button.data);
  }

  @Override
  public int hashCode() {
    return Objects.hash(getText(), data);
  }

}


text:
<?php

namespace PhpSpec\Wrapper\Subject;

use PhpSpec\Loader\Node\ExampleNode;
use PhpSpec\Matcher\MatcherInterface;
use PhpSpec\Wrapper\Subject\Expectation\ConstructorDecorator;
use PhpSpec\Wrapper\Subject\Expectation\DispatcherDecorator;
use PhpSpec\Wrapper\Subject\Expectation\ExpectationInterface;
use PhpSpec\Wrapper\Subject\Expectation\UnwrapDecorator;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use PhpSpec\Runner\MatcherManager;
use PhpSpec\Wrapper\Unwrapper;

class ExpectationFactory
{
    /**
     * @var \PhpSpec\Loader\Node\ExampleNode
     */
    private $example;
    /**
     * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
     */
    private $dispatcher;
    /**
     * @var \PhpSpec\Runner\MatcherManager
     */
    private $matchers;

    /**
     * @param ExampleNode              $example
     * @param EventDispatcherInterface $dispatcher
     * @param MatcherManager           $matchers
     */
    public function __construct(ExampleNode $example, EventDispatcherInterface $dispatcher, MatcherManager $matchers)
    {
        $this->example = $example;
        $this->dispatcher = $dispatcher;
        $this->matchers = $matchers;
    }

    /**
     * @param string $expectation
     * @param mixed  $subject
     * @param array  $arguments
     *
     * @return ExpectationInterface
     */
    public function create($expectation, $subject, array $arguments = array())
    {
        if (0 === strpos($expectation, 'shouldNot')) {
            return $this->createNegative(lcfirst(substr($expectation, 9)), $subject, $arguments);
        }

        if (0 === strpos($expectation, 'should')) {
            return $this->createPositive(lcfirst(substr($expectation, 6)), $subject, $arguments);
        }
    }

    /**
     * @param string $name
     * @param mixed  $subject
     * @param array  $arguments
     *
     * @return ExpectationInterface
     */
    private function createPositive($name, $subject, array $arguments = array())
    {
        if (strtolower($name) === 'throw') {
            return $this->createDecoratedExpectation("PositiveThrow", $name, $subject, $arguments);
        }

        return $this->createDecoratedExpectation("Positive", $name, $subject, $arguments);
    }

    /**
     * @param string $name
     * @param mixed  $subject
     * @param array  $arguments
     *
     * @return ExpectationInterface
     */
    private function createNegative($name, $subject, array $arguments = array())
    {
        if (strtolower($name) === 'throw') {
            return $this->createDecoratedExpectation("NegativeThrow", $name, $subject, $arguments);
        }

        return $this->createDecoratedExpectation("Negative", $name, $subject, $arguments);
    }

    /**
     * @param string $expectation
     * @param string $name
     * @param mixed  $subject
     * @param array  $arguments
     *
     * @return ExpectationInterface
     */
    private function createDecoratedExpectation($expectation, $name, $subject, array $arguments)
    {
        $matcher = $this->findMatcher($name, $subject, $arguments);
        $expectation = "\\PhpSpec\\Wrapper\\Subject\\Expectation\\".$expectation;

        $expectation = new $expectation($matcher);

        if ($expectation instanceof Expectation\ThrowExpectation) {
            return $expectation;
        }

        return $this->decoratedExpectation($expectation, $matcher);
    }

    /**
     * @param string $name
     * @param mixed  $subject
     * @param array  $arguments
     *
     * @return MatcherInterface
     */
    private function findMatcher($name, $subject, array $arguments = array())
    {
        $unwrapper = new Unwrapper();
        $arguments = $unwrapper->unwrapAll($arguments);

        return $this->matchers->find($name, $subject, $arguments);
    }

    /**
     * @param ExpectationInterface $expectation
     * @param MatcherInterface     $matcher
     *
     * @return ConstructorDecorator
     */
    private function decoratedExpectation(ExpectationInterface $expectation, MatcherInterface $matcher)
    {
        $dispatcherDecorator = new DispatcherDecorator($expectation, $this->dispatcher, $matcher, $this->example);
        $unwrapperDecorator = new UnwrapDecorator($dispatcherDecorator, new Unwrapper());
        $constructorDecorator = new ConstructorDecorator($unwrapperDecorator);

        return $constructorDecorator;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<web-app
        version="2.5"
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<servlet>
    <servlet-name>Jersey Web Application</servlet-name>
    <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
    <init-param>
        <param-name>jersey.config.server.provider.packages</param-name>
        <param-value>edu.ucsb.cs.lawtonnichols</param-value>
    </init-param>
    <init-param>
        <!-- speed up initial Jersey loading by deactivating WADL -->
        <param-name>jersey.config.server.wadl.disableWadl</param-name>
        <param-value>true</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Jersey Web Application</servlet-name>
    <url-pattern>/context/*</url-pattern>
</servlet-mapping>

	<servlet>
        <servlet-name>guestbook</servlet-name>
        <servlet-class>edu.ucsb.cs.lawtonnichols.GuestbookServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>guestbook</servlet-name>
        <url-pattern>/guestbook</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>enqueue</servlet-name>
        <servlet-class>edu.ucsb.cs.lawtonnichols.Enqueue</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>enqueue</servlet-name>
        <url-pattern>/enqueue</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>worker</servlet-name>
        <servlet-class>edu.ucsb.cs.lawtonnichols.Worker</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>worker</servlet-name>
        <url-pattern>/worker</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>sign</servlet-name>
        <servlet-class>edu.ucsb.cs.lawtonnichols.SignGuestbookServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>sign</servlet-name>
        <url-pattern>/sign</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>readdata</servlet-name>
        <servlet-class>edu.ucsb.cs.lawtonnichols.ReadData</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>readdata</servlet-name>
        <url-pattern>/test</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>memcache</servlet-name>
        <servlet-class>edu.ucsb.cs.lawtonnichols.MemcacheTest</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>memcache</servlet-name>
        <url-pattern>/memcache</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>upload</servlet-name>
        <servlet-class>edu.ucsb.cs.lawtonnichols.Upload</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>upload</servlet-name>
        <url-pattern>/upload</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>serve</servlet-name>
        <servlet-class>edu.ucsb.cs.lawtonnichols.Serve</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>serve</servlet-name>
        <url-pattern>/serve</url-pattern>
    </servlet-mapping>

<welcome-file-list>
    	<welcome-file>guestbook.jsp</welcome-file>
</welcome-file-list>

</web-app>


text:
'use strict'
var mongoose = require("mongoose");
var co = require("co");
var Schema = mongoose.Schema,
    ObjectId = Schema.ObjectId;
var should = require("should");
var _ = require("lodash");
var userSchema = new Schema({
    name: String,
    gender: String,
    age: Number,
    birthday: Date,
    role: {
        name: {type:String,index:true}
    },
    crtTime: {type: Date, default: new Date()}

});

describe("base_crud", function () {
    mongoose.connect('mongodb://localhost/test');
    var User = mongoose.model('user', userSchema);
    before(function (done) {
        co(function* () {
            yield User.remove({});
            done();
        })
    })

    it("findAndModify", function (done) {
        co(function* () {
            var user = new User();
            user.name = "JIE"
            yield user.save();
            user = yield User.findAndModify({name: "JIE"});
            user.should.have.property("name", "JIE");
            done();
        });
    })

})


text:
#include "Automaton.h"

Automaton::Automaton(State& startState, std::list<Transition*> pTT)
: pCurrentState(&startState), pTT(pTT), TTlength(TTlength), currentStateTicks(0), first(true) {
}

void Automaton::run() {
  currentStateTicks++;

  if (first) { pCurrentState->enter(); first=false; }

  // Über alle ausgehenden Transitionen des aktuellen Zustands
  for(std::list<Transition *>::const_iterator pTTi = pTT.begin(); pTTi != pTT.end(); pTTi++) {
    Transition *t = *(pTTi);
    if (&t->start == pCurrentState) {
      // Wenn Wächter die Transition frei gibt
      if (t->guard()) {
        pCurrentState->exit(); // Verhalten Verlassen Zustand
        t->effect(); // Verhalten Übergang
        pCurrentState = &t->target;
        currentStateTicks = 0;
        pCurrentState->enter(); // Verhalten Eintritt Zustand
        return;
      }
    }
  }
  // Wenn wir hier angekommen sind, dann hat keine Transition geschaltet
  pCurrentState->stay(); // Verhalten Verharren Zustand
}


text:
"""

Revision ID: 0263_remove_edit_folders_2
Revises: 0262_remove_edit_folders
Create Date: 2019-02-15 14:38:13.823432

"""
import sqlalchemy as sa
from alembic import op

revision = "0263_remove_edit_folders_2"
down_revision = "0262_remove_edit_folders"

def upgrade():
    # run this again in case it got added between the 2 deploys
    op.execute("DELETE from service_permissions where permission = 'edit_folders'")
    op.execute("DELETE from service_permission_types where name = 'edit_folders'")

def downgrade():
    op.execute("INSERT INTO service_permission_types values('edit_folders')")


text:
#include "sky/engine/config.h"
#include "sky/engine/platform/fonts/VDMXParser.h"

#include <stdlib.h>
#include <string.h>

#include "sky/engine/wtf/ByteOrder.h"

// Buffer helper class
//
// This class perform some trival buffer operations while checking for
// out-of-bounds errors. As a family they return false if anything is amiss,
// updating the current offset otherwise.
class Buffer {
public:
    Buffer(const uint8_t* buffer, size_t length)
        : m_buffer(buffer)
        , m_length(length)
        , m_offset(0) { }

    bool skip(size_t numBytes)
    {
        if (m_offset + numBytes > m_length)
            return false;
        m_offset += numBytes;
        return true;
    }

    bool readU8(uint8_t* value)
    {
        if (m_offset + sizeof(uint8_t) > m_length)
            return false;
        *value = m_buffer[m_offset];
        m_offset += sizeof(uint8_t);
        return true;
    }

    bool readU16(uint16_t* value)
    {
        if (m_offset + sizeof(uint16_t) > m_length)
            return false;
        memcpy(value, m_buffer + m_offset, sizeof(uint16_t));
        *value = ntohs(*value);
        m_offset += sizeof(uint16_t);
        return true;
    }

    bool readS16(int16_t* value)
    {
        return readU16(reinterpret_cast<uint16_t*>(value));
    }

    size_t offset() const
    {
        return m_offset;
    }

    void setOffset(size_t newoffset)
    {
        m_offset = newoffset;
    }

private:
    const uint8_t *const m_buffer;
    const size_t m_length;
    size_t m_offset;
};

// VDMX parsing code.
//
// VDMX tables are found in some TrueType/OpenType fonts and contain
// ascender/descender overrides for certain (usually small) sizes. This is
// needed in order to match font metrics on Windows.
//
// Freetype does not parse these tables so we do so here.

namespace blink {

// Parse a TrueType VDMX table.
//   yMax: (output) the ascender value from the table
//   yMin: (output) the descender value from the table (negative!)
//   vdmx: the table bytes
//   vdmxLength: length of @vdmx, in bytes
//   targetPixelSize: the pixel size of the font (e.g. 16)
//
// Returns true iff a suitable match are found. Otherwise, *yMax and *yMin are
// untouched. size_t must be 32-bits to avoid overflow.
//
// See http://www.microsoft.com/opentype/otspec/vdmx.htm
bool parseVDMX(int* yMax, int* yMin,
               const uint8_t* vdmx, size_t vdmxLength,
               unsigned targetPixelSize)
{
    Buffer buf(vdmx, vdmxLength);

    // We ignore the version. Future tables should be backwards compatible with
    // this layout.
    uint16_t numRatios;
    if (!buf.skip(4) || !buf.readU16(&numRatios))
        return false;

    // Now we have two tables. Firstly we have @numRatios Ratio records, then a
    // matching array of @numRatios offsets. We save the offset of the beginning
    // of this second table.
    //
    // Range 6 <= x <= 262146
    unsigned long offsetTableOffset =
        buf.offset() + 4 /* sizeof struct ratio */ * numRatios;

    unsigned desiredRatio = 0xffffffff;
    // We read 4 bytes per record, so the offset range is
    //   6 <= x <= 524286
    for (unsigned i = 0; i < numRatios; ++i) {
        uint8_t xRatio, yRatio1, yRatio2;

        if (!buf.skip(1)
            || !buf.readU8(&xRatio)
            || !buf.readU8(&yRatio1)
            || !buf.readU8(&yRatio2))
            return false;

        // This either covers 1:1, or this is the default entry (0, 0, 0)
        if ((xRatio == 1 && yRatio1 <= 1 && yRatio2 >= 1)
            || (xRatio == 0 && yRatio1 == 0 && yRatio2 == 0)) {
            desiredRatio = i;
            break;
        }
    }

    if (desiredRatio == 0xffffffff) // no ratio found
        return false;

    // Range 10 <= x <= 393216
    buf.setOffset(offsetTableOffset + sizeof(uint16_t) * desiredRatio);

    // Now we read from the offset table to get the offset of another array
    uint16_t groupOffset;
    if (!buf.readU16(&groupOffset))
        return false;
    // Range 0 <= x <= 65535
    buf.setOffset(groupOffset);

    uint16_t numRecords;
    if (!buf.readU16(&numRecords) || !buf.skip(sizeof(uint16_t)))
        return false;

    // We read 6 bytes per record, so the offset range is
    //   4 <= x <= 458749
    for (unsigned i = 0; i < numRecords; ++i) {
        uint16_t pixelSize;
        if (!buf.readU16(&pixelSize))
            return false;
        // the entries are sorted, so we can abort early if need be
        if (pixelSize > targetPixelSize)
            return false;

        if (pixelSize == targetPixelSize) {
            int16_t tempYMax, tempYMin;
            if (!buf.readS16(&tempYMax)
                || !buf.readS16(&tempYMin))
                return false;
            *yMin = tempYMin;
            *yMax = tempYMax;
            return true;
        }
        if (!buf.skip(2 * sizeof(int16_t)))
            return false;
    }

    return false;
}

} // namespace blink


text:
<?php

declare(strict_types=1);

namespace Badcow\DNS\Rdata;

trait RdataTrait
{
    /**
     * Get the string representation of the Rdata type.
     *
     * @return string Rdata type, e.g. "A", "MX", "NS", etc.
     */
    public function getType(): string
    {
        /* @const TYPE */
        return static::TYPE;
    }

    /**
     * Get the integer type code of the Rdata type as defined by IANA.
     *
     * @return int IANA Rdata type code
     */
    public function getTypeCode(): int
    {
        /* @const TYPE_CODE */
        return static::TYPE_CODE;
    }
}


text:
package org.jvnet.hyperjaxb3.item;

import java.io.Serializable;
import java.util.List;

public class DefaultItemList<ListType, ItemType extends Item<ListType>> extends
		AbstractItemList<ListType, ItemType> implements Serializable {

	private static final long serialVersionUID = -1941259574287915806L;
	private final Class<? extends ItemType> itemClass;

	public DefaultItemList(List<ItemType> core,
			final Class<? extends ItemType> itemClass) {
		super(core);
		this.itemClass = itemClass;
	}

	public Class<? extends ItemType> getItemClass() {
		return itemClass;
	}

	public ItemType create(ListType item) {
		return ItemUtils.create(getItemClass(), item);
	}

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using QuantConnect.Data.Market;
using QuantConnect.Indicators;

namespace QuantConnect.Algorithm.CSharp
{
    /// <summary>
    /// Constructs a displaced moving average ribbon and buys when all are lined up, liquidates when they all line down
    /// Ribbons are great for visualizing trends
    ///   Signals are generated when they all line up in a paricular direction
    ///     A buy signal is when the values of the indicators are increasing (from slowest to fastest).
    ///     A sell signal is when the values of the indicators are decreasing (from slowest to fastest).
    /// </summary>
    public class DisplacedMovingAverageRibbon : QCAlgorithm
    {
        private Symbol _spy = QuantConnect.Symbol.Create("SPY", SecurityType.Equity, Market.USA);
        private IndicatorBase<IndicatorDataPoint>[] _ribbon;

        /// <summary>
        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.
        /// </summary>
        /// <meta name="tag" content="charting" />
        /// <meta name="tag" content="plotting indicators" />
        /// <seealso cref="QCAlgorithm.SetStartDate(System.DateTime)"/>
        /// <seealso cref="QCAlgorithm.SetEndDate(System.DateTime)"/>
        /// <seealso cref="QCAlgorithm.SetCash(decimal)"/>
        public override void Initialize()
        {
            SetStartDate(2009, 01, 01);
            SetEndDate(2015, 01, 01);

            AddSecurity(SecurityType.Equity, "SPY", Resolution.Minute);

            const int count = 6;
            const int offset = 5;
            const int period = 15;

            // define our sma as the base of the ribbon
            var sma = new SimpleMovingAverage(period);

            _ribbon = Enumerable.Range(0, count).Select(x =>
            {
                // define our offset to the zero sma, these various offsets will create our 'displaced' ribbon
                var delay = new Delay(offset*(x+1));

                // define an indicator that takes the output of the sma and pipes it into our delay indicator
                var delayedSma = delay.Of(sma);

                // register our new 'delayedSma' for automaic updates on a daily resolution
                RegisterIndicator(_spy, delayedSma, Resolution.Daily, data => data.Value);

                return delayedSma;
            }).ToArray();
        }

        private DateTime _previous;

        /// <summary>
        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
        /// </summary>
        /// <param name="data">TradeBars IDictionary object with your stock data</param>
        public void OnData(TradeBars data)
        {
            // wait for our entire ribbon to be ready
            if (!_ribbon.All(x => x.IsReady)) return;

            // only once per day
            if (_previous.Date == Time.Date) return;

            Plot("Ribbon", "Price", data[_spy].Price);
            Plot("Ribbon", _ribbon);

            // check for a buy signal
            var values = _ribbon.Select(x => x.Current.Value).ToArray();

            var holding = Portfolio[_spy];
            if (holding.Quantity <= 0 && IsAscending(values))
            {
                SetHoldings(_spy, 1.0);
            }
            else if (holding.Quantity > 0 && IsDescending(values))
            {
                Liquidate(_spy);
            }

            _previous = Time;
        }

        /// <summary>
        /// Returns true if the specified values are in ascending order
        /// </summary>
        private bool IsAscending(IEnumerable<decimal> values)
        {
            decimal? last = null;
            foreach (var val in values)
            {
                if (last == null)
                {
                    last = val;
                    continue;
                }

                if (last.Value < val)
                {
                    return false;
                }
                last = val;
            }
            return true;
        }

        /// <summary>
        /// Returns true if the specified values are in descending order
        /// </summary>
        private bool IsDescending(IEnumerable<decimal> values)
        {
            decimal? last = null;
            foreach (var val in values)
            {
                if (last == null)
                {
                    last = val;
                    continue;
                }

                if (last.Value > val)
                {
                    return false;
                }
                last = val;
            }
            return true;
        }
    }
}