text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- Unused strings, commented for possible for later use.
	<string name="aboutDescription">Про MPDroid</string>
	<string name="configurationName">Назва налаштувань</string>
	<string name="coverSettings">Налаштування обкладинок</string>
	<string name="clientSettings">Налаштування клієнта</string>
	<string name="edit">Редагувати</string>
	<string name="enableLightNowPlayingTheme">Використовувати світлу тему "Зараз вітдворюється"</string>
	<string name="enableLightNowPlayingThemeDescription">Перезапустіть програму, щоб зміни набули чинності</string>
	<string name="manage">Впорядкувати</string>
	<string name="outputsDescription">Дозволити/заборонити MPD-виходи</string>
	<string name="paused">Пауза</string>
	<string name="playlistNameEditTitle">Назва плейлиста</string>
	<string name="playlistSave">Зберегти плейлист</string>
	<string name="random">Змішування</string>
	<string name="randomDescription">Дозволити/заборонити змішування</string>
	<string name="removeSong">Видалити пісню</string>
	<string name="repeat">Повтопення</string>
	<string name="repeatDescription">Дозволити/заборонити повторення</string>
	<string name="sc_LibTab">Б</string>
	<string name="serverAddress">Адреси серверів:</string>
	<string name="serverSettings">Налаштування сервера</string>
	<string name="skipToHere">Пропустит до цього місця</string>
	<string name="stopped">Зупинено</string>
	<string name="streamDetails">Деталі потоку:</string>
	<string name="streamError">Помилка потоек, потік неможливо відтворити</string>
	<string name="streamingManualURL">Використовувати специфічний URL для потокового відтворення (icecast)</string>
	<string name="streamPaused">Потік призупинено</string>
	<string name="streamPauseBattery">Для збереження батареї, припинити потік, якщо він не використовується</string>
	<string name="streamStopped">Потік зупинено</string>
	<string name="streamingURLDescription">URL потоку(with http://)</string>
	<string name="track">Трек</string>
	<string name="updateDB">Оновити</string>
	<string name="volume">Гучність</string>
	<string name="waitForWLAN">Очікування на з'єднання WLAN…</string>
	<string name="whatsNew">Що нового?</string>
	<string name="whatsNewDescription">Подивитися лог змін (відкриється зовнішня вебсторінка)</string>
	<string name="widget_initial_text">Торкніться щоб обрати музику.</string>
	<string name="musicPathDescription">Шлях до Вашої теки з музикою на сервері MPD як, files/mp3 (music/ для користувачів vortexbox)</string>
	-->

    <string name="app_name">MPDroid</string>
    <string name="artists">Виконавець</string>
    <string name="genres">Стилі</string>
    <string name="playlists">Плейлисти</string>
    <string name="files">Файли</string>
    <string name="albums">Альбоми</string>
    <string name="settings">Налаштування</string>
    <string name="next">Наступний</string>
    <string name="previous">Попередній</string>
    <string name="ok">OK</string>
    <string name="quit">Вихід</string>
    <string name="retry">Нова спроба</string>
    <string name="loading">Завантаження…</string>
    <string name="loadingGenres">Завантаження стилів</string>
    <string name="loadingAlbums">Завантаження альбомів…</string>
    <string name="loadingArtists">Завантаження артистів…</string>
    <string name="loadingSongs">Завантаження пісень…</string>
    <string name="loadingPlaylists">Завантаження плейлистів…</string>
    <string name="playlist">Плейлист</string>
    <string name="addAndReplace">Додати та замінити</string>
    <string name="addAndReplacePlay">Додати, замінити та відтворити</string>
    <string name="addAlbum">Додати альбом</string>
    <string name="addPlaylist">Додати плейлист</string>
    <string name="addAndPlay">Додати та відтворити</string>
    <string name="addArtist">Додати виконавця</string>
    <string name="addGenre">Додати стиль</string>
    <string name="addDirectory">Додати</string>
    <string name="addSong">Додати пісню</string>
    <string name="removeSongs">Видалити пісні</string>
    <string name="removeCountSongs">Видалено пісень:%s</string>
    <string name="clear">Очистити</string>
    <string name="mainMenu">Головне меню</string>
    <string name="playlistCleared">Плейлист очищено</string>
    <string name="deletedSongFromPlaylist">Пісні з плейлиста видалено</string>
    <string name="albumAdded">Альбом %s додано</string>
    <string name="playlistAdded">Плейлист %s додано</string>
    <string name="addedDirectoryToPlaylist">Додано %s шо плейлиста</string>
    <string name="artistAdded">Виконавеця %s додано</string>
    <string name="host">Хост</string>
    <string name="hostDescription">Хост-ім\'я чи IP-адреса MPD-сервера</string>
    <string name="hostStreaming">Потоковий хост</string>
    <string name="hostStreamingDescription">Хост-ім\'я чи IP-адресу потокового сервера</string>
    <string name="port">Порт</string>
    <string name="portDescription">Порт MPD-сервера (За замовчуванням: 6600)</string>
    <string name="password">Пароль</string>
    <string name="passwordDescription">Пароль для сервера</string>
    <string name="version">Версія</string>
    <string name="songs">Пісні</string>
    <string name="serverInformation">Інформація про сервер</string>
    <string name="serverInformationDescription">Інша інформація про MPD-сервер, як версія, кількість пісень…</string>
    <string name="connectionSettings">Налаштування підключення</string>
    <string name="connectionSettingsDescription">Встановити MPD-хост/порт та пароль</string>
    <string name="outputs">Виходи</string>
    <string name="interfaceSettings">Налаштування інтерфейса</string>
    <string name="librarySettings">Налаштування бібліотеки</string>
    <string name="songAdded">Додано пісень: %s</string>
    <string name="about">Про</string>
    <string name="connectionFailed">Невдале з'єднання</string>
    <string name="connectionFailedMessage">З'єднання з MPD-сервером невдале! Перевірте чи сервер доступний та запущений. (%s)</string>
    <string name="connect">З'єднання</string>
    <string name="connecting">З'єднання…</string>
    <string name="connectingToServer">З'єднання з MPD-сервером.</string>
    <string name="connected">Під'єднано</string>
    <string name="notConnected">Не під'єднано</string>
    <string name="noSongInfo">Інфо про пісню відсутнє</string>
    <string name="notInRange">Не досяжна, але збережена</string>
    <string name="playlistDeleted">Плейлист %s видалено</string>
    <string name="deletePlaylist">Видалити плейлист</string>
    <string name="preferredConnection">Приоритетне з'єднання</string>
    <string name="chooseWLAN">Обрати WLAN мережу</string>
    <string name="wlanBasedSettings">З'єднання прив'зані до WLAN</string>
    <string name="defaultSettings">Налаштування з'єднання за замовчуванням</string>
    <string name="wlanBasedSettingsDescription">Встановіть MPD-хост/порт та пароль з'єднаннь прив'заних до WLAN</string>
    <string name="defaultSettingsDescription">Встановіть MPD-хост/порт та пароль з'єднання за замовчуванням</string>
    <string name="stream">Потік</string>
    <string name="buffering">Кешування…</string>
    <string name="portStreaming">Порт потоку</string>
    <string name="portStreamingDescription">Порт потоку MPD (за замовчуванням: 8000)</string>
    <string name="suffixStreaming">Url суфікс потоку</string>
    <string name="suffixStreamingDescription">Сіфукс, що додаватиметься до url потоку(напр. mpd.mp3)</string>
    <string name="aboutText1">MPDroid є програмним забеспеченням з відкритим кодом. Завітайте до http://github.com/abarisain/dmix для його отримання!</string>
    <string name="aboutText2">MPDroid - це форк PMix (http://code.google.com/p/pmix/). Подяка їм!</string>
    <string name="search">Пошук</string>
    <string name="search_label">MPDroid</string>
    <string name="search_hint">Пошук…</string>
    <string name="libraryTabActivity">Бібліотека</string>
    <string name="warningTitle">Будь ласка, прочитайте</string>
    <string name="warningText1">Вітаю в MPDroid 1.0!\nЦе повідомлення з'являється тільки один раз.\n\nПоперше, якщо Ви не знаєте для чого MPD сервео, слід видалити програму, її зроблено не для Вас.\n\nВажливий відомий баґ: Інколи віджет виснажує батарею.\n\nДля користувачів, що зі мною - дякую за підтримку та Ваші внески а проект. Я маю велике сподівання, що нова веосія MPDroid Вам сподообається. Пишіть, будь ласка, на email що Вам не подобається чи що Ви хотіли б повернути з попередньої версії:)\nСтара версія досі присутня на сторінці github.</string>
    <string name="editPlaylist">Редагувати</string>
    <string name="nowPlaying">Зараз відтворюється</string>
    <string name="cancel">Відміна</string>
    <string name="playNext">Відтворити наступний</string>
    <string name="go_to">перейти до …</string>
    <string name="moveFirst">Перейти до першого</string>
    <string name="moveLast">Перейти до останнього</string>
    <string name="removeFromPlaylist">Видалити з плейлиста</string>
    <string name="save">Зберегти</string>
    <string name="updateDBDetails">Оновити базу MPD</string>
    <string name="sortAlbumsByYear">Рік альбому</string>
    <string name="sortAlbumsByYearDescription">Сортувати альбоми за роком</string>
    <string name="showAlbumTrackCount">Кількість треків в альбомі</string>
    <string name="showAlbumTrackCountDescription">Показувати номер трека в альбомі</string>
    <string name="enableLocalCover">Використовувати локальну обкладмнку альбома</string>
    <string name="enableLocalCoverDescription">Отримати обкладинку альбома з сервера MPD (потребує веб-сервео, читайте wiki!)</string>
    <string name="musicPath">Шлях до музики</string>
    <string name="coverFileName">Ім'я обкладенки</string>
    <string name="coverFileNameDescription">Стандартна назва файла для обкладинки як, folder.jpg (cover.jpg для користувачів vortexbox)</string>
    <string name="deleteServer">Видалити цей сервер</string>
    <string name="aboutIcon">Оригінальні іконки додатку від Asher (http://kyo-tux.deviantart.com/) та brsev (http://brsev.deviantart.com/), модифіковані для MPDroid.</string>
    <string name="connectionFailedMessageSetting">З'єднання невдале, перевірте налаштування з'єднання. (%s)</string>
    <string name="no_result">Немає результатів</string>
    <string name="backpressToQuit">Натисніть "Назад" ще раз для виходу</string>
    <string name="playQueue">Послідовність відтворення</string>
    <string name="deletePlaylistPrompt">Ви впевнені, що бажаєте видалити %s?</string>
    <string name="failedToDelete">Неможливо видалити %s</string>
    <string name="variousArtists">Різні виконавці</string>
    <string name="tracksInfoHeader">%1$s треків, %2$s</string>
    <string name="tracksInfoHeaderPlural">%1$s треків, %2$s</string>
    <string name="audioFocusFailed">Неможливо почати поток: Інша програма відтворює музику.</string>
    <string name="addToPlaylist">Додати до плейлиста</string>
    <string name="newPlaylist">(Новий плейлист)</string>
    <string name="playlistName">Назва плейлиста</string>
    <string name="newPlaylistPrompt">Введіть назву для плейлиста:</string>
    <string name="streams">Потоки</string>
    <string name="addStream">Додати поток</string>
    <string name="editStream">Редагувати поток</string>
    <string name="streamAdded">Потік %s додано</string>
    <string name="loadingStreams">Завантаження потоків…</string>
    <string name="streamDeleted">Потік %s видалено</string>
    <string name="deleteStream">Видалити потік</string>
    <string name="deleteStreamPrompt">Ви впевнені, що бажаєте видалити  %s?</string>
    <string name="streamName">Назва:</string>
    <string name="streamUrl">URL:</string>
    <string name="genreAdded">Стиль %s додано</string>
    <string name="enableStopButton">Показувати кнопку "Стоп"</string>
    <string name="enableAlbumYearText">Показати альбом року</string>
    <string name="enableAudioText">Показати властивості звуку</string>
    <string name="singleMode">Режим "1 трек"</string>
    <string name="consumeMode">Режим "Відтворити та прибрати"</string>
    <string name="stop">Стоп</string>

    <string name="behavior">Поедінка телефона</string>
    <string name="pauseOnPhoneStateChange">Пауза відтворення</string>
    <string name="pauseOnPhoneStateChangeDescription">Зупинити відтворення під час вхідного дзвінка</string>
    <string name="playOnPhoneStateChange">Поновити відтворення</string>
    <string name="playOnPhoneStateChangeDescription">Поновити відтворення після закінчення відтворення</string>

    <string name="libraryTabsSettings">Налаштування теґів бібліотеки</string>
    <string name="libraryTabsSettingsDescription">Оберіть видимість теґів та їх порядок</string>
    <string name="visibleTabs">Видимі теґи</string>
    <string name="hiddenTabs">Приховані теґи</string>

    <string name="coverArtTitle">Налаштування обкладинок</string>
    <string name="coverArtDescription">Оберіть як завантажувати та зберігати обкладинки</string>
    <string name="enableLocalCoverCache">Кешувати обкладинки</string>
    <string name="enableLocalCoverCacheDescription">Зберігати завантажені обкадинки на пристрої для швидкого відображення</string>
    <string name="clearLocalCoverCache">Очистити кеш обкладинок</string>
    <string name="clearLocalCoverCacheDescription">Звільнити місце на пристрої за рахунок кешу обкладинок</string>
    <string name="clearLocalCoverCachePrompt">Видалити всі кешовані обкладинки?</string>

    <string name="goToAlbum">Перейти до альбому</string>
    <string name="goToArtist">Перейти до виконавця</string>
    <string name="goToFolder">Перейти до теки</string>
    <string name="goToStream">Перейти до потоків</string>
    <string name="goToCurrent">До поточної пісні</string>
    <string name="otherCover">інша картина</string>
    <string name="resetCover">Скидання зображення</string>

    <string name="actionSongSelected">Обрано 1 пісню</string>
    <string name="actionSongsSelected">Пісень обрано: %s</string>
    <string name="searchQueue">Пошук черги відтворення…</string>
    <string name="enableCoverOnlyOnWifi">Завантажувати тільки через Wi-Fi</string>
    <string name="enableCoverOnlyOnWifiDescription">Не завантажувати обкладинки через мобільну мережу. Зменьшує витрати на послуги оператора</string>
    <string name="enableExitConfirmation">Питати підтвердження перед виходом</string>
    <string name="enableExitConfirmationDescription">Використовувати подвійне натискання Back тап для виходу</string>
    <string name="enableLightTheme">Використовувати світлу тему</string>
    <string name="share">Порекомендувати</string>
    <string name="sharePrefix">Зараз вітворюється:</string>
    <string name="enableTabletUI">Використовувати оболонку для планшета</string>
    <string name="enableTabletUIDescription">Перезапустіть програму, щоб зміни набули чинності</string>
</resources>


text:
Pose estimation is the task of using an ML model to estimate the pose of a
person from an image or a video by estimating the spatial locations of key body
joints (keypoints).

## Get started

If you are new to TensorFlow Lite and are working with Android or iOS, explore
the following example applications that can help you get started.

Android example

iOS example

If you are familiar with the
[TensorFlow Lite APIs](https://www.tensorflow.org/api_docs/python/tf/lite),
download the starter MoveNet pose estimation model and supporting files.

 Download
starter model

If you want to try pose estimation on a web browser, check out the

TensorFlow JS Demo.

## Model description

### How it works

Pose estimation refers to computer vision techniques that detect human figures
in images and videos, so that one could determine, for example, where someone's
elbow shows up in an image. It is important to be aware of the fact that pose
estimation merely estimates where key body joints are and does not recognize who
is in an image or video.

The pose estimation models takes a processed camera image as the input and
outputs information about keypoints. The keypoints detected are indexed by a
part ID, with a confidence score between 0.0 and 1.0. The confidence score
indicates the probability that a keypoint exists in that position.

We provides reference implementation of two TensorFlow Lite pose estimation
models:

*   MoveNet: the state-of-the-art pose estimation model available in two
    flavors: Lighting and Thunder. See a comparison between these two in the
    section below.
*   PoseNet: the previous generation pose estimation model released in 2017.

The various body joints detected by the pose estimation model are tabulated
below:

      Id
      Part

      0
      nose

      1
      leftEye

      2
      rightEye

      3
      leftEar

      4
      rightEar

      5
      leftShoulder

      6
      rightShoulder

      7
      leftElbow

      8
      rightElbow

      9
      leftWrist

      10
      rightWrist

      11
      leftHip

      12
      rightHip

      13
      leftKnee

      14
      rightKnee

      15
      leftAnkle

      16
      rightAnkle

An example output is shown below:

## Performance benchmarks

MoveNet is available in two flavors:

*   MoveNet.Lightning is smaller, faster but less accurate than the Thunder
    version. It can run in realtime on modern smartphones.
*   MoveNet.Thunder is the more accurate version but also larger and slower than
    Lightning. It is useful for the use cases that require higher accuracy.

MoveNet outperforms PoseNet on a variety of datasets, especially in images with
fitness action images. Therefore, we recommend using MoveNet over PoseNet.

Performance benchmark numbers are generated with the tool
[described here](../../performance/measurement). Accuracy (mAP) numbers are
measured on a subset of the [COCO dataset](https://cocodataset.org/#home) in
which we filter and crop each image to contain only one person .

    Model
    Size (MB)
    mAP
    Latency (ms)

    Pixel 5 - CPU 4 threads
    Pixel 5 - GPU
    Raspberry Pi 4 - CPU 4 threads

      MoveNet.Thunder (FP16 quantized)

    12.6MB
    72.0
    155ms
    45ms
    594ms

      MoveNet.Thunder (INT8 quantized)

    7.1MB
    68.9
    100ms
    52ms
    251ms

      MoveNet.Lightning (FP16 quantized)

    4.8MB
    63.0
    60ms
    25ms
    186ms

      MoveNet.Lightning (INT8 quantized)

    2.9MB
    57.4
    52ms
    28ms
    95ms

      PoseNet(MobileNetV1 backbone, FP32)

    13.3MB
    45.6
    80ms
    40ms
    338ms

## Further reading and resources

*   Check out this
    [blog post](https://blog.tensorflow.org/2021/08/pose-estimation-and-classification-on-edge-devices-with-MoveNet-and-TensorFlow-Lite.html)
    to learn more about pose estimation using MoveNet and TensorFlow Lite.
*   Check out this
    [blog post](https://blog.tensorflow.org/2021/05/next-generation-pose-detection-with-movenet-and-tensorflowjs.html)
    to learn more about pose estimation on the web.
*   Check out this [tutorial](https://www.tensorflow.org/hub/tutorials/movenet)
    to learn about running MoveNet on Python using a model from TensorFlow Hub.
*   Coral/EdgeTPU can make pose estimation run much faster on IoT devices. See
    [EdgeTPU-optimized models](https://coral.ai/models/pose-estimation/) for
    more details.
*   Read the PoseNet paper [here](https://arxiv.org/abs/1803.08225)

Also, check out these use cases of pose estimation.

'PomPom Mirror'

Amazing Art Installation Turns You Into A Bird | Chris Milk "The Treachery of Sanctuary"

Puppet Parade - Interactive Kinect Puppets

Messa di Voce (Performance), Excerpts

Augmented reality

Interactive animation

Gait analysis

redpajama_set_name: RedPajamaGithub


text:
using BookStore.Client.Commands;
using BookStore.Data;
using BookStore.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;

namespace BookStore.Client.Core
{
    public class JsonReader : BaseCommand, ICommand
    {
        public JsonReader(IBookStoreContext context)
            : base(context)
        {
        }
        // TODO: Fix Deserializing since it needs a structure to deserialize the object
        public override string Execute(IList<string> parameters)
        {
            var path = "..\\..\\..\\BookStore.AppData\\jsonbooks.json";
            using (StreamReader reader = new StreamReader(path))
            {
                string json = reader.ReadToEnd();

                List<Book> books = JsonConvert.DeserializeObject<List<Book>>(json);
                foreach (var book in books)
                {
                    Context.Books.Add(book);
                }
                Context.SaveChanges();
            }
            return $"Operation was successful!";
        }
        private static bool IsValidJson(string strInput)
        {
            strInput = strInput.Trim();
            if ((strInput.StartsWith("{") && strInput.EndsWith("}")) || //For object
                (strInput.StartsWith("[") && strInput.EndsWith("]"))) //For array
            {
                try
                {
                    var obj = JToken.Parse(strInput);
                    return true;
                }
                catch (JsonReaderException jex)
                {
                    //Exception in parsing json
                    Console.WriteLine(jex.Message);
                    return false;
                }
                catch (Exception ex) //some other exception
                {
                    Console.WriteLine(ex.ToString());
                    return false;
                }
            }
            else
            {
                return false;
            }
        }
    }
}


text:
var Muybridge = (function() {
    /**
     * Create and run an animation.
     */
    function run(opts) {
        console.log('running sketch', opts);
        var draw = opts.draw;
        var setup = opts.setup || function() {};
        var update = opts.update || function(state) { return state; }

        var canvas = opts.canvas;
        var container = opts.container || document.body;

        if (canvas === undefined) {
            canvas = document.createElement('canvas');
            container.appendChild(canvas);
        }

        var ctx = canvas.getContext('2d');
        if (typeof opts.setupCanvas === 'function') {
            opts.setupCanvas(canvas, ctx);
        }

        var step = 0;
        var initialState = setup(canvas.width, canvas.height, ctx);

        // Autoscale the canvas for hi-dpi screens by default
        if (opts.autoScaleCanvas !== false) {
            autoScaleCanvas(canvas, ctx);
        }

        (function loop(state, step) {
            window.requestAnimationFrame(function frame() {
                draw(ctx, state, step);
                loop(update(state, step), step + 1);
            }, canvas);
        })(initialState, 0);
    }

    function autoScaleCanvas(canvas, ctx) {
        // http://www.html5rocks.com/en/tutorials/canvas/hidpi/
        var devicePixelRatio = window.devicePixelRatio || 1;
        var backingStoreRatio = ctx.webkitBackingStorePixelRatio ||
                                ctx.mozBackingStorePixelRatio ||
                                ctx.msBackingStorePixelRatio ||
                                ctx.oBackingStorePixelRatio ||
                                ctx.backingStorePixelRatio ||
                                1;

        var ratio = devicePixelRatio / backingStoreRatio;

        if (devicePixelRatio === backingStoreRatio) {
            return;
        }

        var w = canvas.width;
        var h = canvas.height;
        canvas.width = w * ratio;
        canvas.height = h * ratio;
        canvas.style.width = w + 'px';
        canvas.style.height = h + 'px';
        ctx.scale(ratio, ratio);
    }

    return {
        run: run,
    }
})();


text:
begin
  require 'sinatra/base'
  require 'rack/test'
  SINATRA_PRESENT = true
rescue LoadError
  SINATRA_PRESENT = false
  puts 'Skipping Sinatra integration specs.'
end

if SINATRA_PRESENT
  require FIXTURES_PATH.join('sinatra', 'app.rb')
  require 'honeybadger/init/sinatra'

  describe 'Sinatra integration' do
    include Rack::Test::Methods

    def app
      SinatraApp
    end

    before(:each) do
      Honeybadger.configure do |config|
        config.backend = 'test'
      end
    end

    after(:each) do
      Honeybadger::Backend::Test.notifications[:notices].clear
    end

    it "reports exceptions" do
      Honeybadger.flush do
        get '/runtime_error'
        expect(last_response.status).to eq(500)
      end

      expect(Honeybadger::Backend::Test.notifications[:notices].size).to eq(1)
    end

    it "configures the api key from sinatra config" do
      get '/' # Initialize app
      expect(Honeybadger.config.get(:api_key)).to eq('gem testing')
    end
  end
end


text:
class CreateRatings < ActiveRecord::Migration
  def change
    create_table :ratings do |t|
      t.integer :comment_id
      t.integer :score
      t.integer :sequential_id
      t.timestamps
    end
  end
end


text:
  <ng-md-icon icon="chevron_left" size="56"></ng-md-icon>

Caption: {{Lightbox.imageCaption}}

  <ng-md-icon icon="chevron_right" size="56"></ng-md-icon>

  <ng-md-icon icon="close" size="48"></ng-md-icon>


text:
import logging
from collections import defaultdict
from androguard.decompiler.dad.instruction import (Variable, ThisParam, Param)
from androguard.decompiler.dad.util import build_path, common_dom
from androguard.decompiler.dad.node import Node

logger = logging.getLogger('dad.control_flow')

class BasicReachDef(object):

    def __init__(self, graph, params):
        self.g = graph
        self.A = defaultdict(set)
        self.R = defaultdict(set)
        self.DB = defaultdict(set)
        self.defs = defaultdict(lambda: defaultdict(set))
        self.def_to_loc = defaultdict(set)
        # Deal with special entry node
        entry = graph.entry
        self.A[entry] = set(range(-1, -len(params) - 1, -1))
        for loc, param in enumerate(params, 1):
            self.defs[entry][param].add(-loc)
            self.def_to_loc[param].add(-loc)
        # Deal with the other nodes
        for node in graph.rpo:
            for i, ins in node.get_loc_with_ins():
                kill = ins.get_lhs()
                if kill is not None:
                    self.defs[node][kill].add(i)
                    self.def_to_loc[kill].add(i)
            for defs, values in self.defs[node].iteritems():
                self.DB[node].add(max(values))

    def run(self):
        nodes = self.g.rpo[:]
        while nodes:
            node = nodes.pop(0)
            newR = set()
            for pred in self.g.all_preds(node):
                newR.update(self.A[pred])
            if newR and newR != self.R[node]:
                self.R[node] = newR
                for suc in self.g.all_sucs(node):
                    if suc not in nodes:
                        nodes.append(suc)

            killed_locs = set()
            for reg in self.defs[node]:
                killed_locs.update(self.def_to_loc[reg])

            A = set()
            for loc in self.R[node]:
                if loc not in killed_locs:
                    A.add(loc)
            newA = A.union(self.DB[node])
            if newA != self.A[node]:
                self.A[node] = newA
                for suc in self.g.all_sucs(node):
                    if suc not in nodes:
                        nodes.append(suc)

def update_chain(graph, loc, du, ud):
    '''
    Updates the DU chain of the instruction located at loc such that there is
    no more reference to it so that we can remove it.
    When an instruction is found to be dead (i.e it has no side effect, and the
    register defined is not used) we have to update the DU chain of all the
    variables that may me used by the dead instruction.
    '''
    ins = graph.get_ins_from_loc(loc)
    for var in ins.get_used_vars():
        # We get the definition points of the current variable
        for def_loc in set(ud[var, loc]):
            # We remove the use of the variable at loc from the DU chain of
            # the variable definition located at def_loc
            du[var, def_loc].remove(loc)
            ud[var, loc].remove(def_loc)
            if not ud.get((var, loc)):
                ud.pop((var, loc))
            # If the DU chain of the defined variable is now empty, this means
            # that we may have created a new dead instruction, so we check that
            # the instruction has no side effect and we update the DU chain of
            # the new dead instruction, and we delete it.
            # We also make sure that def_loc is not < 0. This is the case when
            # the current variable is a method parameter.
            if def_loc >= 0 and not du[var, def_loc]:
                du.pop((var, def_loc))
                def_ins = graph.get_ins_from_loc(def_loc)
                if def_ins.is_call():
                    def_ins.remove_defined_var()
                elif def_ins.has_side_effect():
                    continue
                else:
                    update_chain(graph, def_loc, du, ud)
                    graph.remove_ins(def_loc)

def dead_code_elimination(graph, du, ud):
    '''
    Run a dead code elimination pass.
    Instructions are checked to be dead. If it is the case, we remove them and
    we update the DU & UD chains of its variables to check for further dead
    instructions.
    '''
    for node in graph.rpo:
        for i, ins in node.get_loc_with_ins()[:]:
            reg = ins.get_lhs()
            if reg is not None:
                # If the definition is not used, we check that the instruction
                # has no side effect. If there is one and this is a call, we
                # remove only the unused defined variable. else, this is
                # something like an array access, so we do nothing.
                # Otherwise (no side effect) we can remove the instruction from
                # the node.
                if (reg, i) not in du:
                    if ins.is_call():
                        ins.remove_defined_var()
                    elif ins.has_side_effect():
                        continue
                    else:
                        # We can delete the instruction. First update the DU
                        # chain of the variables used by the instruction to
                        # `let them know` that they are not used anymore by the
                        # deleted instruction.
                        # Then remove the instruction.
                        update_chain(graph, i, du, ud)
                        graph.remove_ins(i)

def clear_path_node(graph, reg, loc1, loc2):
    for loc in xrange(loc1, loc2):
        ins = graph.get_ins_from_loc(loc)
        logger.debug('  treat loc: %d, ins: %s', loc, ins)
        if ins is None:
            continue
        logger.debug('  LHS: %s, side_effect: %s', ins.get_lhs(),
                     ins.has_side_effect())
        if ins.get_lhs() == reg or ins.has_side_effect():
            return False
    return True

def clear_path(graph, reg, loc1, loc2):
    '''
    Check that the path from loc1 to loc2 is clear.
    We have to check that there is no side effect between the two location
    points. We also have to check that the variable `reg` is not redefined
    along one of the possible pathes from loc1 to loc2.
    '''
    logger.debug('clear_path: reg(%s), loc1(%s), loc2(%s)', reg, loc1, loc2)
    node1 = graph.get_node_from_loc(loc1)
    node2 = graph.get_node_from_loc(loc2)
    # If both instructions are in the same node, we only have to check that the
    # path is clear inside the node
    if node1 is node2:
        return clear_path_node(graph, reg, loc1 + 1, loc2)

    # If instructions are in different nodes, we also have to check the nodes
    # in the path between the two locations.
    if not clear_path_node(graph, reg, loc1 + 1, node1.ins_range[1]):
        return False
    path = build_path(graph, node1, node2)
    for node in path:
        locs = node.ins_range
        end_loc = loc2 if (locs[0] <= loc2 <= locs[1]) else locs[1]
        if not clear_path_node(graph, reg, locs[0], end_loc):
            return False
    return True

def register_propagation(graph, du, ud):
    '''
    Propagate the temporary registers between instructions and remove them if
    necessary.
    We process the nodes of the graph in reverse post order. For each
    instruction in the node, we look at the variables that it uses. For each of
    these variables we look where it is defined and if we can replace it with
    its definition.
    We have to be careful to the side effects some instructions may have.
    To do the propagation, we use the computed DU and UD chains.
    '''
    change = True
    while change:
        change = False
        for node in graph.rpo:
            for i, ins in node.get_loc_with_ins()[:]:
                logger.debug('Treating instruction %d: %s', i, ins)
                logger.debug('  Used vars: %s', ins.get_used_vars())
                for var in ins.get_used_vars():
                    # Get the list of locations this variable is defined at.
                    locs = ud[var, i]
                    logger.debug('    var %s defined in lines %s', var, locs)
                    # If the variable is uniquely defined for this instruction
                    # it may be eligible for propagation.
                    if len(locs) != 1:
                        continue

                    loc = locs[0]
                    # Methods parameters are defined with a location < 0.
                    if loc < 0:
                        continue
                    orig_ins = graph.get_ins_from_loc(loc)
                    logger.debug('     -> %s', orig_ins)
                    logger.debug('     -> DU(%s, %s) = %s', var, loc,
                                 du[var, loc])

                    # We defined some instructions as not propagable.
                    # Actually this is the case only for array creation
                    # (new foo[x])
                    if not orig_ins.is_propagable():
                        logger.debug('    %s not propagable...', orig_ins)
                        continue

                    if not orig_ins.get_rhs().is_const():
                        # We only try to propagate constants and definition
                        # points which are used at only one location.
                        if len(du[var, loc]) > 1:
                            logger.debug('       => variable has multiple uses'
                                         ' and is not const => skip')
                            continue

                        # We check that the propagation is safe for all the
                        # variables that are used in the instruction.
                        # The propagation is not safe if there is a side effect
                        # along the path from the definition of the variable
                        # to its use in the instruction, or if the variable may
                        # be redifined along this path.
                        safe = True
                        orig_ins_used_vars = orig_ins.get_used_vars()
                        logger.debug('    variables used by the original '
                                     'instruction: %s', orig_ins_used_vars)
                        for var2 in orig_ins_used_vars:
                            # loc is the location of the defined variable
                            # i is the location of the current instruction
                            if not clear_path(graph, var2, loc, i):
                                safe = False
                                break
                        if not safe:
                            logger.debug('Propagation NOT SAFE')
                            continue

                    # We also check that the instruction itself is
                    # propagable. If the instruction has a side effect it
                    # cannot be propagated if there is another side effect
                    # along the path
                    if orig_ins.has_side_effect():
                        if not clear_path(graph, None, loc, i):
                            logger.debug('        %s has side effect and the '
                                         'path is not clear !', orig_ins)
                            continue

                    logger.debug('     => Modification of the instruction!')
                    logger.debug('      - BEFORE: %s', ins)
                    ins.replace(var, orig_ins.get_rhs())
                    logger.debug('      -> AFTER: %s', ins)
                    logger.debug('\t UD(%s, %s) : %s', var, i, ud[var, i])
                    ud[var, i].remove(loc)
                    logger.debug('\t    -> %s', ud[var, i])
                    if len(ud[var, i]) == 0:
                        ud.pop((var, i))
                    for var2 in orig_ins.get_used_vars():
                        # We update the UD chain of the variables we
                        # propagate. We also have to take the
                        # definition points of all the variables used
                        # by the instruction and update the DU chain
                        # with this information.
                        old_ud = ud.get((var2, loc))
                        logger.debug('\t  ud(%s, %s) = %s', var2, loc, old_ud)
                        # If the instruction use the same variable
                        # multiple times, the second+ time the ud chain
                        # will be None because already treated.
                        if old_ud is None:
                            continue
                        ud[var2, i].extend(old_ud)
                        logger.debug('\t  - ud(%s, %s) = %s', var2, i,
                                     ud[var2, i])
                        ud.pop((var2, loc))

                        for def_loc in old_ud:
                            du[var2, def_loc].remove(loc)
                            du[var2, def_loc].append(i)

                    new_du = du[var, loc]
                    logger.debug('\t new_du(%s, %s): %s', var, loc, new_du)
                    new_du.remove(i)
                    logger.debug('\t    -> %s', new_du)
                    if not new_du:
                        logger.debug('\t  REMOVING INS %d', loc)
                        du.pop((var, loc))
                        graph.remove_ins(loc)
                        change = True

class DummyNode(Node):

    def __init__(self, name):
        super(DummyNode, self).__init__(name)

    def get_loc_with_ins(self):
        return []

    def __repr__(self):
        return '%s-dumnode' % self.name

    def __str__(self):
        return '%s-dummynode' % self.name

def group_variables(lvars, DU, UD):
    treated = defaultdict(list)
    variables = defaultdict(list)
    for var, loc in sorted(DU):
        if var not in lvars:
            continue
        if loc in treated[var]:
            continue
        defs = [loc]
        uses = set(DU[var, loc])
        change = True
        while change:
            change = False
            for use in uses:
                ldefs = UD[var, use]
                for ldef in ldefs:
                    if ldef not in defs:
                        defs.append(ldef)
                        change = True
            for ldef in defs[1:]:
                luses = set(DU[var, ldef])
                for use in luses:
                    if use not in uses:
                        uses.add(use)
                        change = True
        treated[var].extend(defs)
        variables[var].append((defs, list(uses)))
    return variables

def split_variables(graph, lvars, DU, UD):
    variables = group_variables(lvars, DU, UD)

    if lvars:
        nb_vars = max(lvars) + 1
    else:
        nb_vars = 0
    for var, versions in variables.iteritems():
        nversions = len(versions)
        if nversions == 1:
            continue
        orig_var = lvars.pop(var)
        for i, (defs, uses) in enumerate(versions):
            if min(defs) < 0:  # Param
                if orig_var.this:
                    new_version = ThisParam(var, orig_var.type)
                else:
                    new_version = Param(var, orig_var.type)
                lvars[var] = new_version
            else:
                new_version = Variable(nb_vars)
                new_version.type = orig_var.type
                lvars[nb_vars] = new_version  # add new version to variables
                nb_vars += 1
            new_version.name = '%d_%d' % (var, i)

            for loc in defs:
                if loc < 0:
                    continue
                ins = graph.get_ins_from_loc(loc)
                ins.replace_lhs(new_version)
                DU[(new_version.value(), loc)] = DU.pop((var, loc))
            for loc in uses:
                ins = graph.get_ins_from_loc(loc)
                ins.replace_var(var, new_version)
                UD[(new_version.value(), loc)] = UD.pop((var, loc))

def reach_def_analysis(graph, lparams):
    # We insert two special nodes : entry & exit, to the graph.
    # This is done to simplify the reaching definition analysis.
    old_entry = graph.entry
    old_exit = graph.exit
    new_entry = DummyNode('entry')
    graph.add_node(new_entry)
    graph.add_edge(new_entry, old_entry)
    graph.entry = new_entry
    if old_exit:
        new_exit = DummyNode('exit')
        graph.add_node(new_exit)
        graph.add_edge(old_exit, new_exit)
        graph.rpo.append(new_exit)

    analysis = BasicReachDef(graph, set(lparams))
    analysis.run()

    # The analysis is done, We can now remove the two special nodes.
    graph.remove_node(new_entry)
    if old_exit:
        graph.remove_node(new_exit)
    graph.entry = old_entry
    return analysis

def build_def_use(graph, lparams):
    '''
    Builds the Def-Use and Use-Def (DU/UD) chains of the variables of the
    method.
    '''
    analysis = reach_def_analysis(graph, lparams)

    UD = defaultdict(list)
    for node in graph.rpo:
        for i, ins in node.get_loc_with_ins():
            for var in ins.get_used_vars():
                # var not in analysis.def_to_loc: test that the register
                # exists. It is possible that it is not the case, when a
                # variable is of a type which is stored on multiple registers
                # e.g: a 'double' stored in v3 is also present in v4, so a call
                # to foo(v3), will in fact call foo(v3, v4).
                if var not in analysis.def_to_loc:
                    continue
                ldefs = analysis.defs[node]
                prior_def = -1
                for v in ldefs.get(var, set()):
                    if prior_def < v < i:
                        prior_def = v
                if prior_def >= 0:
                    UD[var, i].append(prior_def)
                else:
                    intersect = analysis.def_to_loc[var].intersection(
                        analysis.R[node])
                    UD[var, i].extend(intersect)
    DU = defaultdict(list)
    for var_loc, defs_loc in UD.items():
        var, loc = var_loc
        for def_loc in defs_loc:
            DU[var, def_loc].append(loc)

    return UD, DU

def place_declarations(graph, dvars, du, ud):
    idom = graph.immediate_dominators()
    for node in graph.post_order():
        for loc, ins in node.get_loc_with_ins():
            for var in ins.get_used_vars():
                if (not isinstance(dvars[var], Variable) or
                    isinstance(dvars[var], Param)):
                    continue
                var_defs_locs = ud[var, loc]
                def_nodes = set()
                for def_loc in var_defs_locs:
                    def_node = graph.get_node_from_loc(def_loc)
                    # TODO: place declarations in catch if needed
                    if def_node.in_catch:
                        continue
                    def_nodes.add(def_node)
                if not def_nodes:
                    continue
                common_dominator = def_nodes.pop()
                for def_node in def_nodes:
                    common_dominator = common_dom(
                        idom, common_dominator, def_node)
                if any(var in range(*common_dominator.ins_range)
                       for var in ud[var, loc]):
                    continue
                common_dominator.add_variable_declaration(dvars[var])


text:
namespace Enterprise.Administration.Entities
{
    using Organization.Entities;
    using Organization.Repositories;
    using Serenity;
    using Serenity.ComponentModel;
    using Serenity.Data;
    using Serenity.Data.Mapping;
    using Serenity.Services;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.IO;
    using System.Web;
    using System.Web.Security;

    [ConnectionKey("Default"), DisplayName("Users"), InstanceName("User"), TwoLevelCached]
    [ReadPermission(Keys.General)]
    [ModifyPermission(Keys.User.Modify)]
    [LookupScript(Ks.Module + "." + Ks.User, Permission = Keys.General)]
    public sealed class UserRow : LoggingRow, IIdRow, INameRow, IIsActiveRow
    {
        [DisplayName("User Id"), Identity]
        public Int32? UserId
        {
            get { return Fields.UserId[this]; }
            set { Fields.UserId[this] = value; }
        }

        [DisplayName("Username"), Size(100), NotNull, QuickSearch, LookupInclude]
        public String Username
        {
            get { return Fields.Username[this]; }
            set { Fields.Username[this] = value; }
        }

        [DisplayName("Source"), Size(4), NotNull, Insertable(false), Updatable(false), DefaultValue("site")]
        public String Source
        {
            get { return Fields.Source[this]; }
            set { Fields.Source[this] = value; }
        }

        [DisplayName("Password Hash"), Size(86), NotNull, Insertable(false), Updatable(false), MinSelectLevel(SelectLevel.Never)]
        public String PasswordHash
        {
            get { return Fields.PasswordHash[this]; }
            set { Fields.PasswordHash[this] = value; }
        }

        [DisplayName("Password Salt"), Size(10), NotNull, Insertable(false), Updatable(false), MinSelectLevel(SelectLevel.Never)]
        public String PasswordSalt
        {
            get { return Fields.PasswordSalt[this]; }
            set { Fields.PasswordSalt[this] = value; }
        }

        [DisplayName("Email"), Size(100)]
        public String Email
        {
            get { return Fields.Email[this]; }
            set { Fields.Email[this] = value; }
        }

        [DisplayName("User Image"), Size(100)]
        [ImageUploadEditor(FilenameFormat = "UserImage/~", CopyToHistory = true)]
        public String UserImage
        {
            get { return Fields.UserImage[this]; }
            set { Fields.UserImage[this] = value; }
        }

        [DisplayName("Password"), Size(50), NotMapped]
        public String Password
        {
            get { return Fields.Password[this]; }
            set { Fields.Password[this] = value; }
        }

        [NotNull, Insertable(false), Updatable(true)]
        public Int16? IsActive
        {
            get { return Fields.IsActive[this]; }
            set { Fields.IsActive[this] = value; }
        }

        [DisplayName("Confirm Password"), Size(50), NotMapped]
        public String PasswordConfirm
        {
            get { return Fields.PasswordConfirm[this]; }
            set { Fields.PasswordConfirm[this] = value; }
        }

        [DisplayName("Last Directory Update"), Insertable(false), Updatable(false)]
        public DateTime? LastDirectoryUpdate
        {
            get { return Fields.LastDirectoryUpdate[this]; }
            set { Fields.LastDirectoryUpdate[this] = value; }
        }

        IIdField IIdRow.IdField
        {
            get { return Fields.UserId; }
        }

        StringField INameRow.NameField
        {
            get { return Fields.Username; }
        }

        Int16Field IIsActiveRow.IsActiveField
        {
            get { return Fields.IsActive; }
        }

        public static readonly RowFields Fields = new RowFields().Init();

        public UserRow()
            : base(Fields)
        {
        }

        public class RowFields : LoggingRowFields
        {
            public Int32Field UserId;
            public StringField Username;
            public StringField Source;
            public StringField PasswordHash;
            public StringField PasswordSalt;
            public StringField Email;
            public StringField UserImage;
            public DateTimeField LastDirectoryUpdate;
            public Int16Field IsActive;

            public StringField Password;
            public StringField PasswordConfirm;

            public RowFields()
            {
                LocalTextPrefix = "Administration.User";
            }
        }

        public String GetToken(params string[] purposes) {
            int userId = this.UserId.GetValueOrDefault(0);
            byte[] bytes;
            using (var ms = new MemoryStream())
            using (var bw = new BinaryWriter(ms))
            {
                bw.Write(DateTime.UtcNow.AddHours(3).ToBinary());
                bw.Write(userId);
                bw.Flush();
                bytes = ms.ToArray();
            }

            var token = Convert.ToBase64String(MachineKey.Protect(bytes, purposes));

            return token;
        }

        public void SetPersonnelRecord(UnitOfWork uow, PersonnelRow personnel) {
            personnel.DateStarted = this.InsertDate;
            personnel.Email = this.Email;
            personnel.UserId = this.UserId.GetValueOrDefault(0);

            uow.Connection.InsertAndGetID(personnel);
        }

        public PersonnelRow GetPersonnelRecord(IDbConnection connection) {
            return connection.TrySingle<PersonnelRow>(new Criteria(PersonnelRow.Fields.UserId) == this.UserId.Value);
        }
    }
}


text:
package com.itheima.domain;

public class Order {
	private Integer id;
	private String name;

	private Customer customer;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@Override
	public String toString() {
		return "Order [id=" + id + ", name=" + name + "]";
	}

}


text:
<?php
//
// Copyright (c) 2008-2016 Decibel Technology Limited.
//
namespace app\decibel\cache;

use app\decibel\authorise\DUser;
use app\decibel\authorise\DUserCapabilityCode;
use app\decibel\cache\DCacheHandler;

/**
 * Provides caching for Capability Codes.
 *
 * A User's Capability Code is an MD5 hash of their assigned Permissors,
 * unless the User has been personally assigned one or more permissions,
 * in which case their Capability Code is their ID.
 *
 * @author        Timothy de Paris
 */
class DCapabilityCache extends DCacheHandler
{
    /**
     * Clears all information from the Capability Cache for the specified user.
     *
     * @param    DUser $user The user to clear the cache for.
     *
     * @return    bool
     */
    public function clearUser(DUser $user)
    {
        // If the user has been directly assigned to a permissible object
        // as a permissor, the capability code will be the User's ID. In this
        // case, only removing the capability code will not be enough and
        // all permissions for this user must be cleared.
        $userId = $user->getId();
        $userCapabilityCode = DUserCapabilityCode::adapt($user);
        $capabilityCode = $userCapabilityCode->getCapabilityCode();
        if ($capabilityCode === $userId) {
            DCacheHandler::clearCapabilitiesCaches(array($capabilityCode));
        }
        // Determine cache key.
        $key = $userId;

        // Clear from memory.
        return $this->removeFromMemory($key);
    }

    /**
     * Returns a cached capability code for the specified User.
     *
     * @param    DUser $user The User to retrieve a Capability Code for.
     *
     * @return    string    The capability code, or null if no code is found for the user.
     */
    public function getForUser(DUser $user)
    {
        // Determine cache key.
        $key = $user->getId();

        // Check in memory.
        return $this->getFromMemory($key);
    }

    /**
     * Caches a capability code for a user.
     *
     * @param    DUser  $user The User for which the Capability Code is being cached.
     * @param    string $code The Capability Code.
     *
     * @return    bool
     */
    public function setForUser(DUser $user, $code)
    {
        // Don't cache capability codes for new users.
        $userId = $user->getId();
        if ($userId === 0) {
            $success = false;
        } else {
            // Determine cache key.
            $key = $userId;
            // Store in memory.
            $success = $this->storeInMemory($key, $code, false);
        }

        return $success;
    }
}


text:
<beans:beans xmlns="http://www.springframework.org/schema/batch"
	xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:task="http://www.springframework.org/schema/task"
	xsi:schemaLocation="
           http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/batch
           http://www.springframework.org/schema/batch/spring-batch-2.2.xsd
           http://www.springframework.org/schema/task
           http://www.springframework.org/schema/task/spring-task.xsd">
	<task:annotation-driven />

	<beans:bean id="jobOperator"
		class="org.springframework.batch.core.launch.support.SimpleJobOperator">
		<beans:property name="jobExplorer" ref="jobExplorerFactoryBean" />
		<beans:property name="jobRepository" ref="jobRepository" />
		<beans:property name="jobRegistry" ref="jobRegistry" />
		<beans:property name="jobLauncher" ref="jobLauncher" />
	</beans:bean>
	<beans:bean name="jobExplorerFactoryBean"
		class="org.springframework.batch.core.explore.support.JobExplorerFactoryBean">
		<beans:property name="dataSource" ref="dataSource" />
	</beans:bean>
	<beans:bean id="jobRegistry"
		class="org.springframework.batch.core.configuration.support.MapJobRegistry" />
	<beans:bean id="automaticJobRegistrar"
		class="org.springframework.batch.core.configuration.support.AutomaticJobRegistrar">
		<beans:property name="applicationContextFactories">
			<beans:bean
				class="org.springframework.batch.core.configuration.support.ClasspathXmlApplicationContextsFactoryBean">
				<beans:property name="resources" value="classpath*:/jobs/job-*.xml" />
			</beans:bean>
		</beans:property>
		<beans:property name="jobLoader">
			<beans:bean
				class="org.springframework.batch.core.configuration.support.DefaultJobLoader">
				<beans:property name="jobRegistry" ref="jobRegistry" />
			</beans:bean>
		</beans:property>
	</beans:bean>
	<beans:bean id="jobLauncher"
		class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
		<beans:property name="jobRepository" ref="jobRepository" />
		<beans:property name="taskExecutor" ref="taskScheduler" />
	</beans:bean>
	<!-- <beans:bean id="syncTaskExecutor" class="org.springframework.core.task.SyncTaskExecutor"></beans:bean> -->
	<!-- <beans:bean id="threadPoolTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"
		scope="singleton"> <beans:property name="corePoolSize" value="4" /> <beans:property
		name="maxPoolSize" value="10" /> <beans:property name="keepAliveSeconds"
		value="60" /> </beans:bean> -->

	<beans:bean id="SyncTaskExecutor"
		class="org.springframework.core.task.SyncTaskExecutor">
	</beans:bean>
	<beans:bean id="taskScheduler"
		class="org.springframework.scheduling.concurrent.ConcurrentTaskScheduler" />
	<beans:bean name="jobRepository"
		class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean">
		<beans:property name="dataSource" ref="dataSource" />
		<beans:property name="transactionManager" ref="transactionManager" />
	</beans:bean>
</beans:beans>


text:
#ifndef OSMIUM_VISITOR_HPP
#define OSMIUM_VISITOR_HPP

#include <osmium/fwd.hpp>
#include <osmium/handler.hpp>
#include <osmium/io/reader_iterator.hpp> // IWYU pragma: keep
#include <osmium/memory/buffer.hpp>
#include <osmium/osm.hpp>
#include <osmium/osm/entity.hpp>
#include <osmium/osm/item_type.hpp>

#include <type_traits>
#include <utility>

namespace osmium {

    namespace detail {

        template <typename T, typename U>
        using ConstIfConst = typename std::conditional<std::is_const<T>::value, typename std::add_const<U>::type, U>::type;

        template <typename THandler, typename TItem>
        inline void apply_item_impl(TItem& item, THandler&& handler) {
            switch (item.type()) {
                case osmium::item_type::undefined:
                    break;
                case osmium::item_type::node:
                    std::forward<THandler>(handler).osm_object(static_cast<ConstIfConst<TItem, osmium::OSMObject>&>(item));
                    std::forward<THandler>(handler).node(static_cast<ConstIfConst<TItem, osmium::Node>&>(item));
                    break;
                case osmium::item_type::way:
                    std::forward<THandler>(handler).osm_object(static_cast<ConstIfConst<TItem, osmium::OSMObject>&>(item));
                    std::forward<THandler>(handler).way(static_cast<ConstIfConst<TItem, osmium::Way>&>(item));
                    break;
                case osmium::item_type::relation:
                    std::forward<THandler>(handler).osm_object(static_cast<ConstIfConst<TItem, osmium::OSMObject>&>(item));
                    std::forward<THandler>(handler).relation(static_cast<ConstIfConst<TItem, osmium::Relation>&>(item));
                    break;
                case osmium::item_type::area:
                    std::forward<THandler>(handler).osm_object(static_cast<ConstIfConst<TItem, osmium::OSMObject>&>(item));
                    std::forward<THandler>(handler).area(static_cast<ConstIfConst<TItem, osmium::Area>&>(item));
                    break;
                case osmium::item_type::changeset:
                    std::forward<THandler>(handler).changeset(static_cast<ConstIfConst<TItem, osmium::Changeset>&>(item));
                    break;
                case osmium::item_type::tag_list:
                    std::forward<THandler>(handler).tag_list(static_cast<ConstIfConst<TItem, osmium::TagList>&>(item));
                    break;
                case osmium::item_type::way_node_list:
                    std::forward<THandler>(handler).way_node_list(static_cast<ConstIfConst<TItem, osmium::WayNodeList>&>(item));
                    break;
                case osmium::item_type::relation_member_list:
                case osmium::item_type::relation_member_list_with_full_members:
                    std::forward<THandler>(handler).relation_member_list(static_cast<ConstIfConst<TItem, osmium::RelationMemberList>&>(item));
                    break;
                case osmium::item_type::outer_ring:
                    std::forward<THandler>(handler).outer_ring(static_cast<ConstIfConst<TItem, osmium::OuterRing>&>(item));
                    break;
                case osmium::item_type::inner_ring:
                    std::forward<THandler>(handler).inner_ring(static_cast<ConstIfConst<TItem, osmium::InnerRing>&>(item));
                    break;
                case osmium::item_type::changeset_discussion:
                    std::forward<THandler>(handler).changeset_discussion(static_cast<ConstIfConst<TItem, osmium::ChangesetDiscussion>&>(item));
                    break;
            }
        }

        template <typename THandler>
        inline void apply_item_impl(const osmium::OSMEntity& item, THandler&& handler) {
            switch (item.type()) {
                case osmium::item_type::node:
                    std::forward<THandler>(handler).osm_object(static_cast<const osmium::OSMObject&>(item));
                    std::forward<THandler>(handler).node(static_cast<const osmium::Node&>(item));
                    break;
                case osmium::item_type::way:
                    std::forward<THandler>(handler).osm_object(static_cast<const osmium::OSMObject&>(item));
                    std::forward<THandler>(handler).way(static_cast<const osmium::Way&>(item));
                    break;
                case osmium::item_type::relation:
                    std::forward<THandler>(handler).osm_object(static_cast<const osmium::OSMObject&>(item));
                    std::forward<THandler>(handler).relation(static_cast<const osmium::Relation&>(item));
                    break;
                case osmium::item_type::area:
                    std::forward<THandler>(handler).osm_object(static_cast<const osmium::OSMObject&>(item));
                    std::forward<THandler>(handler).area(static_cast<const osmium::Area&>(item));
                    break;
                case osmium::item_type::changeset:
                    std::forward<THandler>(handler).changeset(static_cast<const osmium::Changeset&>(item));
                    break;
                default:
                    throw osmium::unknown_type{};
            }
        }

        template <typename THandler>
        inline void apply_item_impl(osmium::OSMEntity& item, THandler&& handler) {
            switch (item.type()) {
                case osmium::item_type::node:
                    std::forward<THandler>(handler).osm_object(static_cast<osmium::OSMObject&>(item));
                    std::forward<THandler>(handler).node(static_cast<osmium::Node&>(item));
                    break;
                case osmium::item_type::way:
                    std::forward<THandler>(handler).osm_object(static_cast<osmium::OSMObject&>(item));
                    std::forward<THandler>(handler).way(static_cast<osmium::Way&>(item));
                    break;
                case osmium::item_type::relation:
                    std::forward<THandler>(handler).osm_object(static_cast<osmium::OSMObject&>(item));
                    std::forward<THandler>(handler).relation(static_cast<osmium::Relation&>(item));
                    break;
                case osmium::item_type::area:
                    std::forward<THandler>(handler).osm_object(static_cast<osmium::OSMObject&>(item));
                    std::forward<THandler>(handler).area(static_cast<osmium::Area&>(item));
                    break;
                case osmium::item_type::changeset:
                    std::forward<THandler>(handler).changeset(static_cast<osmium::Changeset&>(item));
                    break;
                default:
                    throw osmium::unknown_type{};
            }
        }

        template <typename THandler>
        inline void apply_item_impl(const osmium::OSMObject& item, THandler&& handler) {
            switch (item.type()) {
                case osmium::item_type::node:
                    std::forward<THandler>(handler).osm_object(item);
                    std::forward<THandler>(handler).node(static_cast<const osmium::Node&>(item));
                    break;
                case osmium::item_type::way:
                    std::forward<THandler>(handler).osm_object(item);
                    std::forward<THandler>(handler).way(static_cast<const osmium::Way&>(item));
                    break;
                case osmium::item_type::relation:
                    std::forward<THandler>(handler).osm_object(item);
                    std::forward<THandler>(handler).relation(static_cast<const osmium::Relation&>(item));
                    break;
                case osmium::item_type::area:
                    std::forward<THandler>(handler).osm_object(item);
                    std::forward<THandler>(handler).area(static_cast<const osmium::Area&>(item));
                    break;
                default:
                    throw osmium::unknown_type{};
            }
        }

        template <typename THandler>
        inline void apply_item_impl(osmium::OSMObject& item, THandler&& handler) {
            switch (item.type()) {
                case osmium::item_type::node:
                    std::forward<THandler>(handler).osm_object(item);
                    std::forward<THandler>(handler).node(static_cast<osmium::Node&>(item));
                    break;
                case osmium::item_type::way:
                    std::forward<THandler>(handler).osm_object(item);
                    std::forward<THandler>(handler).way(static_cast<osmium::Way&>(item));
                    break;
                case osmium::item_type::relation:
                    std::forward<THandler>(handler).osm_object(item);
                    std::forward<THandler>(handler).relation(static_cast<osmium::Relation&>(item));
                    break;
                case osmium::item_type::area:
                    std::forward<THandler>(handler).osm_object(item);
                    std::forward<THandler>(handler).area(static_cast<osmium::Area&>(item));
                    break;
                default:
                    throw osmium::unknown_type{};
            }
        }

        template <typename TFunc>
        struct wrapper_handler : TFunc {

            template<typename T>
            explicit wrapper_handler(T&& func) : TFunc(std::forward<T>(func)) { // NOLINT(bugprone-forwarding-reference-overload)
            }

            // Fallback that always matches.
            void operator()(const osmium::memory::Item& /*item*/) const noexcept {
            }

            // The function we are wrapping.
            using TFunc::operator();

            void osm_object(const osmium::OSMObject& /*osm_object*/) const noexcept {
            }

            void node(const osmium::Node& node) const {
                operator()(node);
            }

            void node(osmium::Node& node) const {
                operator()(node);
            }

            void way(const osmium::Way& way) const {
                operator()(way);
            }

            void way(osmium::Way& way) const {
                operator()(way);
            }

            void relation(const osmium::Relation& relation) const {
                operator()(relation);
            }

            void relation(osmium::Relation& relation) const {
                operator()(relation);
            }

            void area(const osmium::Area& area) const {
                operator()(area);
            }

            void area(osmium::Area& area) const {
                operator()(area);
            }

            void changeset(const osmium::Changeset& changeset) const {
                operator()(changeset);
            }

            void changeset(osmium::Changeset& changeset) const {
                operator()(changeset);
            }

            void tag_list(const osmium::TagList& /*tag_list*/) const noexcept {
            }

            void way_node_list(const osmium::WayNodeList& /*way_node_list*/) const noexcept {
            }

            void relation_member_list(const osmium::RelationMemberList& /*relation_member_list*/) const noexcept {
            }

            void outer_ring(const osmium::OuterRing& /*outer_ring*/) const noexcept {
            }

            void inner_ring(const osmium::InnerRing& /*inner_ring*/) const noexcept {
            }

            void changeset_discussion(const osmium::ChangesetDiscussion& /*changeset_discussion*/) const noexcept {
            }

            void flush() const noexcept {
            }

        }; // struct wrapper_handler

        // Is the class T derived from osmium::handler::Handler?
        template <typename T>
        using is_handler = std::is_base_of<osmium::handler::Handler, typename std::remove_reference<T>::type>;

        // This is already a handler, use it as it is.
        template <typename T, typename = typename std::enable_if<is_handler<T>::value>::type>
        T make_handler(T&& func) {
            return std::forward<T>(func);
        }

        // This is not a handler, but a functor. Wrap a handler around it.
        template <typename T, typename = typename std::enable_if<!is_handler<T>::value>::type>
        wrapper_handler<typename std::decay<T>::type> make_handler(T&& func) {
            return wrapper_handler<typename std::decay<T>::type>(std::forward<T>(func));
        }

    } // namespace detail

    template <typename TItem, typename... THandlers>
    inline void apply_item(TItem& item, THandlers&&... handlers) {
        (void)std::initializer_list<int>{
            (detail::apply_item_impl(item, std::forward<THandlers>(handlers)), 0)...
        };
    }

    template <typename... THandlers>
    inline void apply_flush(THandlers&&... handlers) {
        (void)std::initializer_list<int>{
            (std::forward<THandlers>(handlers).flush(), 0)...
        };
    }

    template <typename TIterator, typename... THandlers>
    inline void apply_impl(TIterator it, TIterator end, THandlers&&... handlers) {
        for (; it != end; ++it) {
            apply_item(*it, std::forward<THandlers>(handlers)...);
        }
        apply_flush(std::forward<THandlers>(handlers)...);
    }

    template <typename TIterator, typename... THandlers>
    inline void apply(TIterator it, TIterator end, THandlers&&... handlers) {
        apply_impl(it, end, detail::make_handler<THandlers>(std::forward<THandlers>(handlers))...);
    }

    template <typename TContainer, typename... THandlers>
    inline void apply(TContainer& c, THandlers&&... handlers) {
        using std::begin;
        using std::end;
        apply(begin(c), end(c), std::forward<THandlers>(handlers)...);
    }

    template <typename... THandlers>
    inline void apply(const osmium::memory::Buffer& buffer, THandlers&&... handlers) {
        apply(buffer.cbegin(), buffer.cend(), std::forward<THandlers>(handlers)...);
    }

} // namespace osmium

#endif // OSMIUM_VISITOR_HPP


text:
Mojo.Views.Playback.VolumeDial = Backbone.View.extend({
	$knob: null,
	playback: null,
	$icon: $("#playback-volume-icon"),

	initialize: function(options) {
		_.bindAll(this, "render", "reloadKnob", "changeVolume", "windowResizedHandler");
		this.playback = options.playback;
		this.initKnob();
		this.initListeners();
		this.render();
	},

	initKnob: function() {
		var that = this;
		this.$knob = this.$("#playback-volume-value");
		var dim = this.getKnobDimension();
		var v, up = 0, down = 0;
		this.$knob.knob({
			min: 0,
			max: 100,
			width: dim,
			height: dim,
			thickness: 0.25,
			cursor: 40,
			stopper: false,
			displayInput: false,
			bgColor: "#ffffff",
			fgColor: "#2a9fd6",
			change: function() {
				if (v > this.cv) {
					if (up) {
						that.changeVolume(-1);
						up = 0;
					} else {
						up = 1;
						down=0;
					}
				} else {
					if (v < this.cv) {
						if (down) {
							that.changeVolume(1);
							down = 0;
						} else {
							down = 1;
							up = 0;
						}
					}
				}
				v = this.cv;
			}
		});
		this.$el.css("padding-top", parseInt((this.$el.outerHeight() - dim) / 2));
		$(window).resize(this.windowResizedHandler);
		this.fitIconSizeToKnob(dim);
	},

	getKnobDimension: function() {
		var width = this.$el.outerWidth();
		var height = this.$el.outerHeight();
		return parseInt(Math.min(width, height) * 0.9);
	},

	changeVolume: function(delta) {
		delta = delta * 3;
		this.playback.changeVolume(delta);
	},

	windowResizedHandler: function() {
		this.reloadKnob();
	},

	reloadKnob: function() {
		var dim = this.getKnobDimension();
		this.$knob.trigger("configure", {
			width: dim,
			height: dim
		});
		this.$el.css("padding-top", parseInt((this.$el.outerHeight() - dim) / 2));
		this.fitIconSizeToKnob(dim);
	},

	fitIconSizeToKnob: function(knobDimension) {
		this.$icon.css({
			"line-height": this.$icon.height() + "px",
			"font-size": (knobDimension * 0.6) + "px"
		});
	},

	initListeners: function() {
		this.listenTo(this.playback, "change:volume", this.render);
	},

	render: function() {
		var volume = this.playback.get("volume");
		var opacity = (20 + 80 * volume / 100) / 100;
		this.$icon.css("opacity", opacity);
		if (volume <= 0) {
			this.$icon.removeClass("glyphicon-volume-up");
			this.$icon.removeClass("glyphicon-volume-down");
			this.$icon.addClass("glyphicon-volume-off");
		} else if (volume >= 100) {
			this.$icon.removeClass("glyphicon-volume-off");
			this.$icon.removeClass("glyphicon-volume-down");
			this.$icon.addClass("glyphicon-volume-up");
		} else {
			this.$icon.removeClass("glyphicon-volume-off");
			this.$icon.removeClass("glyphicon-volume-up");
			this.$icon.addClass("glyphicon-volume-down");
		}
	}
});


text:
import http.client
from lxml import html
import csv
import os
import sys
import time
import string
import re

if len(sys.argv) != 3:
    print( "Usage: %s id name" % (sys.argv[0]))
    exit(-1)

conn = http.client.HTTPConnection("www.eliteprospects.com")

def writeCsv(player, years):
    if len(years) == 0:
        print("No years")
        return

    directory = "./stats/eliteprospect/goalie/"
    filename = "%s/%s.csv" % (directory, player)

    if not os.path.exists(directory):
        os.makedirs(directory)

    with open(filename, 'w', newline='') as csvfile:
        fieldnames = []
        for fieldname in years[0]:
            fieldnames.append(fieldname)

        writer = csv.DictWriter(csvfile, fieldnames=fieldnames)

        writer.writeheader()

        for i in range(len(years)):
            writer.writerow(years[i])

def getHtml(url):
    time.sleep(2)
    conn.request("GET", url, None, {"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"})
    response = conn.getresponse()

    print(url, response.status, response.reason)

    return response.read()

id = sys.argv[1]
name = sys.argv[2]
content = getHtml("/%s?player=%s" % ("player.php", id))
content = str(content).replace("\\n", "").replace("\\t", "")
r =re.compile('CAREER STATISTICS(.*?)CAREER HIGHLIGHTS<\/span>', re.MULTILINE + re.S)
m = r.search(content)
tree = html.fromstring(m.group())

tables = tree.xpath('table')

yearsPre = tree.xpath('table/tr/td[1]')
teams = tree.xpath('table/tr/td[2]/font/text()')
leagues = tree.xpath('table/tr/td[3]/font/text()')
gamesPlayedPre = tree.xpath('table/tr/td[4]/font')
goalsAllowedAveragePre = tree.xpath('table/tr/td[5]/strong/font')
savesPercentagePre = tree.xpath('table/tr/td[6]/font')

counter = 0
count = len(yearsPre)
years = []
lastYear = '1969'
while counter < count:
    yearTree = yearsPre[counter]
    counter = counter + 1
    if yearTree.attrib.has_key('colspan'):
        continue
    yearFont = yearTree.xpath('font')

    if len(yearFont) != 0:
        yearString = yearFont[0].text.lstrip()
        lastYear = yearString.split("-")[0]
    elif lastYear == '1969':
        continue
    year = lastYear
    years.append(year)

gamesPlayed = [x.text if x.text else '' for x in gamesPlayedPre]
goalsAllowedAverage = [x.text if x.text else '' for x in goalsAllowedAveragePre]
savesPercentage = [x.text if x.text else '' for x in savesPercentagePre]
stats = []
count = len(years)

counter = 0
while counter < count:
    year = {
        "year": years[counter] ,
        "league": leagues[counter].lstrip(),
        "team": teams[counter].lstrip(),
        "games_played": gamesPlayed[counter],
        "goals_allowed_average": goalsAllowedAverage[counter],
        "savePercentage": savesPercentage[counter],
    }
    stats.append(year)
    counter = counter + 1

writeCsv(name, stats)


text:
import matplotlib
matplotlib.use('Agg')
import subprocess
from multiprocessing import Pool
from functools import partial
import os
import sys
import string

import pyroms
import pyroms_toolbox
import commands

irange = None
jrange = None

def do_file(file):
    print 'file is: ' + file
    start = string.find(file,'_')
    end = string.find(file,'_',start+1)
    var = file[start+1:end]
    print 'var is: ' + var
    if var == 'uv':
        dst_var = pyroms_toolbox.remapping_bound(['u', 'v'], file,\
                     wts_file,src_grd,dst_grd,rotate_uv=True,\
                     uvar='u', vvar='v')
    else:
        dst_var = pyroms_toolbox.remapping_bound([var], file,\
                     wts_file,src_grd,dst_grd)

lst_file = []

# Change src_filename to your directory for the file's containing variable data
data_dir = '/archive/u1/uaf/kate/COSINE/data/'
#lst = commands.getoutput('ls ' + data_dir + '*_1979.nc')
#lst = commands.getoutput('ls ' + data_dir + 'Pacific_s?o[n4]_1979.nc')
lst = commands.getoutput('ls ' + data_dir + 'Pacific_[tuvz]*_1979.nc')
lst = lst.split()
lst_file = lst_file + lst

wts_file = "./remap_weights_PP_COSINE_to_NWGOA3_bilinear_*"
src_grd = pyroms.grid.get_ROMS_grid('PP_COSINE')
dst_grd = pyroms.grid.get_ROMS_grid('NWGOA3')
# Outfile is a parameter to allow you to place these created remap files in a different
# directory than the one that is default which is where the file came from.
#processes = 1
processes = 2
p = Pool(processes)
results = p.map(do_file, lst_file)


text:
This is a first of series integrations with other plugins. First of them is Datepicker.

Try to click on some row and select the Last Sales cell - a datapicker will popup.

 HTML
<XMP>
<link rel="stylesheet" type="text/css" media="screen" href="themes/ui.datepicker.css" />

...

</XMP>
Java Scrpt code
<XMP>
var lastsel3;
jQuery("#rowed6").jqGrid({
	datatype: "local",
	height: 250,
   	colNames:['ID Number','Last Sales','Name', 'Stock', 'Ship via','Notes'],
   	colModel:[
   		{name:'id',index:'id', width:90, sorttype:"int", editable: true},
		{name:'sdate',index:'sdate',width:90, editable:true, sorttype:"date"},
   		{name:'name',index:'name', width:150,editable: true,editoptions:{size:"20",maxlength:"30"}},
   		{name:'stock',index:'stock', width:60, editable: true,edittype:"checkbox",editoptions: {value:"Yes:No"}},
   		{name:'ship',index:'ship', width:90, editable: true,edittype:"select",editoptions:{value:"FE:FedEx;IN:InTime;TN:TNT;AR:ARAMEX"}},
   		{name:'note',index:'note', width:200, sortable:false,editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"10"}}
   	],
	onSelectRow: function(id){
		if(id && id!==lastsel3){
			jQuery('#rowed6').jqGrid('restoreRow',lastsel3);
			jQuery('#rowed6').jqGrid('editRow',id,true,pickdates);
			lastsel3=id;
		}
	},
	editurl: "server.php",
	caption: "Date Picker Integration"

});
var mydata3 = [
		{id:"12345",name:"Desktop Computer",note:"note",stock:"Yes",ship:"FedEx", sdate:"2007-12-03"},
		{id:"23456",name:"Laptop",note:"Long text ",stock:"Yes",ship:"InTime",sdate:"2007-12-03"},
		{id:"34567",name:"LCD Monitor",note:"note3",stock:"Yes",ship:"TNT",sdate:"2007-12-03"},
		{id:"45678",name:"Speakers",note:"note",stock:"No",ship:"ARAMEX",sdate:"2007-12-03"},
		{id:"56789",name:"Laser Printer",note:"note2",stock:"Yes",ship:"FedEx",sdate:"2007-12-03"},
		{id:"67890",name:"Play Station",note:"note3",stock:"No", ship:"FedEx",sdate:"2007-12-03"},
		{id:"76543",name:"Mobile Telephone",note:"note",stock:"Yes",ship:"ARAMEX",sdate:"2007-12-03"},
		{id:"87654",name:"Server",note:"note2",stock:"Yes",ship:"TNT",sdate:"2007-12-03"},
		{id:"98765",name:"Matrix Printer",note:"note3",stock:"No", ship:"FedEx",sdate:"2007-12-03"}
		];
for(var i=0;i < mydata3.length;i++)
	jQuery("#rowed6").jqGrid('addRowData',mydata3[i].id,mydata3[i]);

function pickdates(id){
	jQuery("#"+id+"_sdate","#rowed6").datepicker({dateFormat:"yy-mm-dd"});
}
</XMP>


text:
<?php

/**
 * @see Zend_Gdata_Extension
 */
require_once 'Zend/Gdata/Extension.php';

/**
 * File format, physical medium, or dimensions of the resource
 *
 * @category   Zend
 * @package    Zend_Gdata
 * @subpackage DublinCore
 * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Gdata_DublinCore_Extension_Format extends Zend_Gdata_Extension
{

    protected $_rootNamespace = 'dc';
    protected $_rootElement = 'format';

    /**
     * Constructor for Zend_Gdata_DublinCore_Extension_Format which
     * File format, physical medium, or dimensions of the resource
     *
     * @param DOMElement $element (optional) DOMElement from which this
     *          object should be constructed.
     */
    public function __construct($value = null)
    {
        $this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
        parent::__construct();
        $this->_text = $value;
    }

}


text:
django-rest-app
===============

startapp template for rest apps


text:
<?php namespace App\TransportStation\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * ORM for Bus
 * @package App\TransportStationLocator\Models
 */
class Bus extends Model
{

    protected $table = 'buses';

    protected $fillable = ['name', 'station_id', 'arrival'];

    /**
     * Method that defines child relationship to Station model
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function station() {
        return $this->belongsTo('App\\TransportStation\\Models\Station');
    }

}


text:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule } from '@angular/router';

// import { MetaModule, MetaService, MetaConfig } from 'ng2-meta'; // Not yet.
// todo: compile it to AOT compatible.
//https://medium.com/@isaacplmann/making-your-angular-2-library-statically-analyzable-for-aot-e1c6f3ebedd5#.21ysvhdnl

import { AppComponent } from './app.component';

import { HeaderComponent } from './common/header/header.component';
import { FooterComponent } from './common/footer/footer.component';
import { HomeComponent } from './home/home.component';

import { ApiComponent } from './api/api.component';

import { NotFoundPageComponent } from './404/404.component';
import { ThankYouComponent } from './thank-you/thank-you.component';
import { InsightComponent } from './insight/insight.component';
import { PricingComponent } from './pricing/pricing.component';
import { GettingStartedComponent } from './getting-started/getting-started.component';
import { PartnersComponent } from './partners/partners.component';
import { CompanyComponent } from './company/company.component';
import { PrivacyPolicyComponent } from './legal/privacy-policy.component';
import { LegalMenuComponent } from './legal/legal-menu.component';
import { LegalComponent } from './legal/legal.component';
import { CommercialLicenseComponent } from './legal/commercial-license.component';
import { CommercialLicenseOemComponent } from './legal/commercial-license-oem.component';
import { OpenSourceLicenseComponent } from './legal/open-source-license.component';
import { CloudHostingAgreementComponent } from './legal/cloud-hosting-agreement.component';
import { SupportAgreementComponent } from './legal/support-agreement.component';
import { GnuAgplLicenseComponent } from './legal/gnu-agpl-license.component';
import { SupportComponent } from './support/support.component';
import { SalesComponent } from './sales/sales.component';

// const metaConfig: MetaConfig = {
//   useTitleSuffix: true,
//   defaults: {
//     title: 'Understanding data made simple',
//     titleSuffix: ' - Slamby',
//     'og:type': 'website',
//     'og:image': 'https://www.slamby.com/assets/slamby-logo.png',
//     'description': 'Slamby is a great tool for classifieds to do perfect machine learning. Category recommendation, keyword-extraction, duplicate search, matchmaking. Open-source, SaaS, on-premise install.'
//   }
// };

@NgModule({
  declarations: [
    AppComponent,
    HeaderComponent,
    FooterComponent,
    NotFoundPageComponent,
    ThankYouComponent,
    GettingStartedComponent,
    InsightComponent,
    HomeComponent,
    PricingComponent,
    PartnersComponent,
    CompanyComponent,
    PrivacyPolicyComponent,
    CommercialLicenseComponent,
    CommercialLicenseOemComponent,
    GnuAgplLicenseComponent,
    OpenSourceLicenseComponent,
    CloudHostingAgreementComponent,
    SupportAgreementComponent,
    LegalComponent,
    LegalMenuComponent,
    SupportComponent,
    ApiComponent,
    SalesComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    // MetaModule.forRoot(metaConfig),
    RouterModule.forRoot([
      {
        path: '',
        component: HomeComponent
      },
      {
        path: 'home',
        component: HomeComponent
      },
      {
        path: 'api',
        component: ApiComponent,
        pathMatch: 'full',
        data: {meta:{title: 'API'}}
      },
      {
        path: 'insight',
        component: InsightComponent,
        pathMatch: 'full',
        data: {meta:{title: 'Insight'}}
      },
      {
        path: 'pricing',
        component: PricingComponent,
        pathMatch: 'full',
        data: {meta: {title: 'Pricing', description: 'Slamby pricing, on-premise, SaaS, PaaS. core-based, open-source.'}}
      },
      {
        path: '404',
        component: NotFoundPageComponent,
        pathMatch: 'full',
        data: {meta:{title: 'Page not found', description: 'The requested page is not found.'}}
      },
      {
        path: 'thank-you',
        component: ThankYouComponent,
        pathMatch: 'full',
        data: {meta: {title: 'Thank You' }}
      },
      {
        path: 'getting-started',
        component: GettingStartedComponent,
        pathMatch: 'full',
        data: {meta: {title: 'Getting started',
        description: 'Quick tutorial about Slamby install steps, pricing, licenses, support, SDKs, related softwares and Slamby Insight.'}}
      },
      {
        path: 'partners',
        component: PartnersComponent,
        pathMatch: 'full',
        data: {meta:{title: 'Partners', description: 'Slamby partners who helped a lot to us.'}}
      },
      {
        path: 'company',
        component: CompanyComponent,
        pathMatch: 'full',
        data: {meta: {title: 'Company',
        description: 'We love what we do, if you need more information about Slamby, just contact us anytime at hello@slamby.com'}}
      },
      {
        path: 'legal',
        component: LegalComponent,
        pathMatch: 'full',
        data: {meta: {title: 'Legal'}}
      },
      {
        path: 'legal/privacy-policy',
        component: PrivacyPolicyComponent,
        pathMatch: 'full',
        data: {meta:{title: 'Privacy policy'}}
      },
      {
        path: 'legal/commercial-license',
        component: CommercialLicenseComponent,
        pathMatch: 'full',
        data: {meta: {title: 'Commercial license'}}
      },
      {
        path: 'legal/commercial-license-oem',
        component: CommercialLicenseOemComponent,
        pathMatch: 'full',
        data: {meta: {title: 'Commercial license for OEMs'}}
      },
      {
        path: 'legal/gnu-agpl-license',
        component: GnuAgplLicenseComponent,
        pathMatch: 'full',
        data: {meta: { title: 'GNU AGPL V3 license'}}
      },
      {
        path: 'legal/open-source-license',
        component: OpenSourceLicenseComponent,
        pathMatch: 'full',
        data: {meta: {title: 'Open-source license'}}
      },
      {
        path: 'legal/cloud-hosting-agreement',
        component: CloudHostingAgreementComponent,
        pathMatch: 'full',
        data: {meta: {title: 'Cloud hosting agreement'}}
      },
      {
        path: 'legal/support-agreement',
        component: SupportAgreementComponent,
        pathMatch: 'full',
        data: {meta: {title: 'Support Agreement'}}
      },
      {
        path: 'support',
        component: SupportComponent,
        pathMatch: 'full',
        data: {meta: {title: 'Support'}}
      },
      {
        path: 'sales',
        component: SalesComponent,
        pathMatch: 'full',
        data: {meta: {title: 'Sales'}}
      },
      {
        path: '**',
        redirectTo: '/404'
      }
    ])
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }


text:
var Q = require('q');
var _ = Alloy._;

var settings = Alloy.Models.instance('settings');

exports.definition = {
config: {
    "URL": "https://api.parse.com/1/installations",
    //"debug": 1,
    "adapter": {
        "type": "restapi",
        "collection_name": "Installation",
        "idAttribute": "objectId"
    },
    "headers": { // your custom headers
        "X-Parse-Application-Id" : Ti.App.Properties.getString('Parse_AppId'),
        //TODO : CFG로 가져오면 왜 대부분 값이없을까.
        "X-Parse-REST-API-Key" : Ti.App.Properties.getString('Parse_RestKey'),
        "Content-Type" : "application/json"
    }
  },
  extendModel: function(Model) {
    _.extend(Model.prototype, {
      _parse_class_name: "Installation",

      // //Installtion_objectId
      // getById : function (id) {
      //   this.set('id', id);
      //   return this._getBy({});
      // },
      getByRandomId : function (randomId) {
                var self = this;
                var deferred = Q.defer();
                //웹에서 테스트할때, 숫자로 전달하면 실패했음. 그래서 string..
                randomId = randomId ? randomId.toString() : randomId;

                Parse.Cloud.run('getInstallationByRandomId', {randomId : randomId }, {
                success: function(_inst) {
                        //fetch와 비슷한결과를 얻기위해. this에 setset.
                        if(_inst){
                            self.set({'objectId':_inst.id, 'id':_inst.id}, {change:false});
                            self.set(_inst.attributes, {change:false});
                      deferred.resolve(self);
                        }else{
                            deferred.reject('not found installation by randomId: '+ randomId);
                        }
                },
                error: function(error) {
                  //TOOD[faith] : 이전값 저장해두었다가 되돌리는 코드가필요함.
                  return deferred.reject(error);
                }
              });

                return deferred.promise;
      },
      changeChannels : function (channels) {
        if(!_.isArray(channels)) { channels = [channels]; }
        // Ti.API.debug('channels',channels,this.attributes)
        return this._save({'channels' :channels });
      },
      create : function (attributes) {
        // promise 사용
        return this._save(attributes);
      },

      // // url에 쿼리문을 추가하는 방식.
      // _getBy : function (query) {
      //   var deferred = Q.defer();
            //
      //   this.fetch({
      //     data : query,
      //     success:function (res) { return deferred.resolve(res); },
      //     error:function (err) {  return deferred.reject(err); }
      //   });
            //
      //   return deferred.promise;
      // },

      // https://api.parse.com/1/installations/mrmBZvsErB + PUT
      // Installation_objectId 등록되었다는 가정하에 사용됨.
      // _update : function (data) {
      //   var deferred = Q.defer();
      //   var id = settings.getInstallationId();

      //   this.save(_.extend({'id': id}, data), {
      //     success:function (res) { return deferred.resolve(res); },
      //     error:function (err) { return deferred.reject(err); }
      //   });

      //   return deferred.promise;
      // }

      //save
      _save : function (attributes) {
                var self = this;
        var deferred = Q.defer();
                // deviceToken이 업데이트 되면 에러 발생
                var tempInstallationM = Alloy.createModel('installation');
        tempInstallationM.save(_.extend({'objectId': this.id},attributes), {
          success: function (result) {
            self.set(attributes, {change:false});
            deferred.resolve(self);
          },
          error : function (error) {
            deferred.reject(error);
          }
        });

        return deferred.promise;
      }
    });

  return Model;
  },
  extendCollection: function(Collection) {
  _.extend(Collection.prototype, {
    // Extend, override or implement Backbone.Collection
    _parse_class_name: "Installation",
                // For Backbone v1.1.2, uncomment the following to override the
                // fetch method to account for a breaking change in Backbone.
                fetch: function(options) {
                        options = options ? _.clone(options) : {};
                        options.reset = true;
                        return Backbone.Collection.prototype.fetch.call(this, options);
                },
    //objectIds를 가져옴
    getAll : function () {
      var deferred = Q.defer();

      this.fetch({
        success:function (res) { return deferred.resolve(res); },
        error:function (err) { return deferred.reject(err); }
      });

      return deferred.promise;
    }

  });

  return Collection;
  }
};

// helper
function _makeQuery(params) {
  return { where : JSON.stringify(params) };
}