text:
<?xml version='1.0' encoding='UTF-8'?>
<resources>
  <string name="accessibility_title">Akıllı Yardımcı</string>
  <string name="accordingto_position">GPS kullanarak sık kullanılan yerleri tanı</string>
  <string name="account_address">Adres</string>
  <string name="address_name_spell">Adresi girin</string>
  <string name="adjustment_order">Siparişi değiştir</string>
  <string name="agenda">Hatırlatıcılar</string>
  <string name="agenda_open">Ajanda hatırlatıcısını aç</string>
  <string name="agenda_setting_brief">Planlanan faaliyetler hakkında hatırlatıcıları al</string>
  <string name="alipay_scan">Tarayıcı</string>
  <string name="app_label">Akıllı Yardımcı</string>
  <string name="apps">Uygulama Önerisi</string>
  <string name="apps_label">Uygulamalar</string>
  <string name="assistant_place">Sık kullanılan yerleri tanı</string>
  <string name="assistant_summary">İhtiyacınız olduğunda hemen faydalı öneri alın</string>
  <string name="beijing">Pekin</string>
  <string name="bicycle">Döngü</string>
  <string name="calc_currency">Döviz</string>
  <string name="calc_name">Bilimsel</string>
  <string name="calc_num">Finansal Karakterler</string>
  <string name="calc_parent">Hesap Makinesi</string>
  <string name="calendar_name">Etkinlik ekle</string>
  <string name="calendar_parent">Takvim</string>
  <string name="card_settings">Kart Ayarları</string>
  <string name="card_settings_rule">Kart sipariş ayarları</string>
  <string name="check_network">Ağ ayarlarını kontrol et</string>
  <string name="check_network_retry">Ağ ayarlarını kontrol edin ve tekrar deneyin</string>
  <string name="choose_city">Şehri seçin</string>
  <string name="choose_upload">Yüklenecek dosyaları seçin</string>
  <string name="city_name_spell">Şehri girin</string>
  <string name="cleanup_garbage">Tamizleyici</string>
  <string name="cleanup_memory">Önbelleği Temizle</string>
  <string name="cleanup_power">Derin Temizlik</string>
  <string name="clear">Temizle</string>
  <string name="closed">Kapat</string>
  <string name="commute">Harita Tavsiyeleri</string>
  <string name="commute_open">Harita tavsiyeleri için kartı göster</string>
  <string name="commute_setting_brief">Ayrılmadan önce rota ve trafik tavsiyelerini alın.</string>
  <string name="company_or_school">İş veya okul</string>
  <string name="complete">Tamam</string>
  <string name="cta_dialog_negative">Çık</string>
  <string name="cta_dialog_positive">Kabul</string>
  <string name="cta_dialog_text1">"Akıllı Yardımcı'yı kullanmak için, "</string>
  <string name="cta_dialog_text2">\"Kullanıcı Sözleşmesi\'ni \"</string>
  <string name="cta_dialog_text3">ve</string>
  <string name="cta_dialog_text4">\"Gizlilik Politikası\'nı\" okumalı ve kabul etmelisiniz.</string>
  <string name="cta_dialog_text5">Servis ayrıca internet bağlantısı ve konum servislerine erişim gerektiriyor. Katılıyor musunuz?</string>
  <string name="cta_dialog_title">Şartlar ve Hükümler</string>
  <string name="daily_greeting">Günlük Olaylar</string>
  <string name="data_error">Bir hata oluştu, bir iki dakika bekleyin ve tekrar deneyin.</string>
  <string name="data_error_show">"Sipariş tamamlandı, ayrıntıları göremiyorum"</string>
  <string name="drive">Sür</string>
  <string name="duokan_not_installed">"Bu uygulama telefonunuza yüklenmedi. Bu kart şu an kullanılamıyor."</string>
  <string name="duokan_open">Duokan kartı ekle</string>
  <string name="duokan_reading">Duokan</string>
  <string name="duokan_setting_brief">Bıraktığınız yerden okumaya devam edin.</string>
  <string name="entrance">Kart kısayolları</string>
  <string name="exercise_setting_brief">"Faaliyet istatistiklerinizi görüntüleyin."</string>
  <string name="express">Hızlı teslimat</string>
  <string name="express_jd">JD</string>
  <string name="express_mi_shop">Mi Mağazası</string>
  <string name="express_open">Teslimat izleme kartlarını göster</string>
  <string name="express_other_app">Alışveriş uygulamalarından siparişleri takip et</string>
  <string name="express_setting_brief">Siparişlerinizi izlemek için alışveriş uygulamalarından kartlar edinin.</string>
  <string name="express_support_app">Desteklenen uygulamalar</string>
  <string name="express_taobao">Taobao</string>
  <string name="express_tmall">Tmall</string>
  <string name="favorite">Favoriler</string>
  <string name="favorite_main">Geçmiş</string>
  <string name="flow_open">Mobil bilgi kartını göster</string>
  <string name="flow_setting_brief">Mobil veri bilgilerinizi görüntüleyin (Veri planınızı Güvenlik > Veri kullanımı bölümüne ekleyin).</string>
  <string name="focus">Durumu takip et</string>
  <string name="focus_on_dynamic">Durumu takip et</string>
  <string name="go_to_school">İşyerinde veya okulda</string>
  <string name="greeting_open">Günlük olayları aç</string>
  <string name="greeting_setting_brief">Her sabah ve akşam saatlerinde olayları, alarmlar ve doğum günleri hakkında hava durumu ve hatırlatıcıları al</string>
  <string name="greeting_setting_brief_notice">Şehre ait Hava Durumu uygulamasını değiştirebilirsiniz</string>
  <string name="greeting_weather_desc">%1$s %2$s %3$s %4$s</string>
  <string name="greeting_weather_desc_from_to">%1$s to %2$s</string>
  <string name="greeting_weather_prefix_moring">Bugün</string>
  <string name="greeting_weather_prefix_night">Yarın</string>
  <string name="greeting_weather_prefix_saturday">Cumartesi</string>
  <string name="greeting_weather_prefix_sunday">Pazar</string>
  <string name="groupon">Biletler & Kuponlar</string>
  <string name="groupon_open">Biletleri & Kuponları göster</string>
  <string name="groupon_setting_brief">Alınan biletler ve kuponlar hakkında bilgi göster.</string>
  <string name="help_quick_start_wechat_video">Kısayolları kullanarak belirli uygulama özelliklerine erişin</string>
  <string name="hold_down_adjustment_order">Öğeleri sürüklemek için sağdaki simgeye basılı tutun</string>
  <string name="home">Ev</string>
  <string name="home_and_company">Ev & İş</string>
  <string name="immediate_recommendation">Tavsiyeler</string>
  <string name="keyword_recommend">推荐您</string>
  <string name="launch_app">Uygulama Tavsiyesi</string>
  <string name="launch_change_order">Siparişi değiştir</string>
  <string name="launch_enable">Hızlı erişim kartlarını göster</string>
  <string name="launch_function">Özellikleri seçin</string>
  <string name="launch_label">Hızlı erişim</string>
  <string name="launch_no_dapp_dialog_content">Bu karttan sorumlu ikili uygulama silindi. Bu kartı başka bir kartla değiştirebilirsiniz.</string>
  <string name="launch_no_dapp_dialog_reset">Klonlu Uygulama Ayarları</string>
  <string name="launch_no_dapp_dialog_title">Klonlu uygulama silindi</string>
  <string name="launch_noapp_dialog_cancel">İptal</string>
  <string name="launch_noapp_dialog_content">Bu karttan sorumlu uygulama silindi. Bu kartı başka bir kartla değiştirebilirsiniz.</string>
  <string name="launch_noapp_dialog_redownload">Tekrar indir</string>
  <string name="launch_noapp_dialog_replace">Değiştir</string>
  <string name="launch_noapp_dialog_title">Uygulama silindi</string>
  <string name="launch_order_change">Siparişi değiştir</string>
  <string name="launch_order_finish">Tamam</string>
  <string name="launch_top">Önerilen uygulamaları ekleyin veya bu özelliği özelleştirin</string>
  <string name="launcher_else">Diğer</string>
  <string name="locating_fail">"Konum alınamadı"</string>
  <string name="locations">Sık kullanılan yerler</string>
  <string name="locations_preferences">Sık kullanılan yerler ve tercihler</string>
  <string name="map_msg_smooth">| 当前路线整体畅通</string>
  <string name="map_msg_sufix">,详情</string>
  <string name="map_title_baidu_middle">约有</string>
  <string name="map_title_blocked">异常拥堵</string>
  <string name="map_title_blocked_last">公里异常拥堵</string>
  <string name="map_title_congestion">道路拥堵</string>
  <string name="map_title_congestion_last">公里拥堵</string>
  <string name="map_title_smooth">整体畅通</string>
  <string name="metre">mt</string>
  <string name="mi_sport">Mi Fit</string>
  <string name="mi_sport_go_install">İndir</string>
  <string name="mi_sport_not_installed">"Bu uygulama telefonunuza yüklenmedi. Bu kart şu an kullanılamıyor."</string>
  <string name="mi_wallet">Mi Cüzdan</string>
  <string name="music">Müzik & Radyo</string>
  <string name="music_open">Müzik & Radyoyu göster</string>
  <string name="music_setting_brief">Kaldığınız yerden müzik veya radyo dinlemeye devam etmek için kulaklık takın.</string>
  <string name="navigation_network_location_enable">Aç</string>
  <string name="navigation_network_location_enable_later">Sonra</string>
  <string name="navigation_network_location_enabled">"Konum hizmetleri açık. Bunu Ayarlar'dan değiştirebilirsiniz."</string>
  <string name="navigation_network_location_not_enabled_summary">Akıllı Yardımcı bulunduğunuz yere göre önerilerde bulunur. Daha iyi bir deneyim için konum servislerini açın.</string>
  <string name="navigation_network_location_not_enabled_title">Konum servislerini aç</string>
  <string name="navigation_search_automatically_positioned_city">Bulunduğu yeri kullanarak şehir hakkında bilgi edinin</string>
  <string name="navigation_search_current_city">Şu anki şehir:</string>
  <string name="navigation_search_default_hint">Burada öğe ara</string>
  <string name="navigation_search_no_city_list">Burada hiçbir şehir yok</string>
  <string name="navigation_search_positioning">Konum bilgisi alınıyor...</string>
  <string name="navigation_search_positioning_failed">"Konum alınamadı, şehri elle olarak seçiniz"</string>
  <string name="network_access_denied">"Ağa bağlanamıyor, önce Şartlar ve Koşullar'ı kabul edin"</string>
  <string name="network_error">Ağ hatası</string>
  <string name="network_unavaliable">"Bilgi alamıyor, ağ bağlantısını kontrol edemiyorum"</string>
  <string name="no_install">Yüklenmedi</string>
  <string name="no_more_result">Fazla öğe yok</string>
  <string name="no_settings">Ayarlanmadı</string>
  <string name="not_install_c1">"Bu uygulama telefonunuza yüklenmedi. İndirilsin ve yüklensin mi?"</string>
  <string name="not_install_c3">İndir</string>
  <string name="not_install_c4">Hayır, teşekkürler</string>
  <string name="not_installed">Yüklenmedi</string>
  <string name="note_name">Bir not oluştur</string>
  <string name="note_parent">Notlar</string>
  <string name="notification_express_app_open">Aç</string>
  <string name="notification_express_content">"Akıllı Yardımcı'yı kullanarak siparişleri takip et"</string>
  <string name="notification_express_title">Alışveriş uygulamalarından kartları aç</string>
  <string name="opened">Aç</string>
  <string name="pay_card_pack">Mi Ödeme</string>
  <string name="paycode_parent">Alipay</string>
  <string name="place_label">Sık kullanılan yerler</string>
  <string name="preferences">Tercihler</string>
  <string name="preferences_label">Tercihler</string>
  <string name="qq_new">Yeni durum</string>
  <string name="qq_qzone">Qzone</string>
  <string name="quickstart_label">Özellikler</string>
  <string name="reading_setting_brief">Bıraktığınız yerden okumaya devam edin.</string>
  <string name="record_name">Kayda başla</string>
  <string name="record_parent">Kaydedici</string>
  <string name="remain_flow">Mobil Veri</string>
  <string name="req_no_data">"Bilgi alınamadı"</string>
  <string name="req_no_sdata">"Sonuç bulunamadı"</string>
  <string name="retry">Tekrar deneyin</string>
  <string name="scan">Tara</string>
  <string name="scan_card">İş Kartviziti</string>
  <string name="scan_code">QR Kodu</string>
  <string name="scan_doc">Döküman</string>
  <string name="scan_exercise">Çalışma</string>
  <string name="scan_parent">Tarayıcı</string>
  <string name="scan_trans">Çevir</string>
  <string name="security">Güvenlik</string>
  <string name="service_unavailiable">Ağ bağlantısını kontrol edin ve tekrar deneyin</string>
  <string name="setting_address">Sık kullanılan yerleri ekle</string>
  <string name="setting_dialog_cancel">İptal</string>
  <string name="setting_dialog_quit">Çık</string>
  <string name="setting_dialog_title">Tüm değişiklikler kaybolacak. Şimdi çıkmak mı?</string>
  <string name="setting_disable">Kapalı</string>
  <string name="setting_home_label">Ev adresini ekle</string>
  <string name="setting_launch_change">Değiştir</string>
  <string name="setting_place">Trafiği görmek ve yönlendirmek için sık kullanılan yerleri ekleyin</string>
  <string name="setting_place_next">Sonraki</string>
  <string name="setting_pref_confirm">Tamam</string>
  <string name="setting_school_label">İş/okul adresi ekle</string>
  <string name="settings_label">Akıllı Yardımcı Ayarlar</string>
  <string name="shortcut">Kısayollar</string>
  <string name="sport_open">Mi Fit kartını göster</string>
  <string name="taxi">Taksi</string>
  <string name="taxi_open">Taksi kartı göster</string>
  <string name="taxi_setting_brief">Tek bir dokunuşta bir taksi bul.</string>
  <string name="trans_card">T. Taşıma Kartı</string>
  <string name="transit_subway">Toplu taşıma</string>
  <string name="try_again">Tekrar dene</string>
  <string name="understandassistant">Akıllı Yardımcı Hakkında</string>
  <string name="unusual_weather">Hava Durumu Alarmı</string>
  <string name="unusual_weather_open">Hava Durumu Alarmını aç</string>
  <string name="unusual_weather_setting_brief">Tehlikeli hava durumu bulunduğunuz yere yaklaştığında uyarı alın.</string>
  <string name="unusual_weather_setting_tip">Uyarıyı yayını için gerekli şehirlerin Hava Durumu uygulamasını değiştirilebilir.</string>
  <string name="uploads_disabled">"Dosya yüklenemiyor"</string>
  <string name="walk">Yürü</string>
  <string name="weibo_name">Yeni Posta</string>
  <string name="weibo_parent">Weibo</string>
  <string name="which_transport">Normal olarak varış noktanıza nasıl ulaşıyorsunuz?</string>
  <string name="widget_fav">Favori</string>
  <string name="widget_fav_open">Favori kartı göster</string>
  <string name="widget_fav_setting_brief">Favori veriye gözat</string>
  <string name="wx_aa">Alman Usulu</string>
  <string name="wx_collectioncode">Ödeme al</string>
  <string name="wx_name">Kartım</string>
  <string name="wx_parent">WeChat</string>
  <string name="wx_paycode">Ödeme</string>
  <string name="wx_scan">Tarayıcı</string>
  <string name="wx_timeline">Anlar</string>
  <string name="xspace_resolver_activity_title">Uygulama seç</string>
  <string name="year_month_day_all_format_en">dd/MM/yyyy HH:mm:ss</string>
</resources>


text:
using PKStudio.ItemWrappers;

namespace PKStudio.Forms.Editors.Pages.Feature
{
    public partial class MainPage : FeaturePageBase
    {
        public MainPage()
        {
            InitializeComponent();
        }

        public MainPage(FeatureWrapper Feat)
            :base(Feat)
        {
            InitializeComponent();

            GroupsCb.Items.Clear();
            GroupsCb.Items.Add("");

            foreach (FeatureWrapper feat in PK.Wrapper.GetFeatures())
            {
                if (!GroupsCb.Items.Contains(feat.Groups))
                {
                    GroupsCb.Items.Add(feat.Groups);
                }
            }
            this.NodeName = Strings.Main;
            HeaderLbl.Text = this.NodeName;
        }

        #region Override

        public override bool OnApplyChanges()
        {
            this.Wrapper.Name = NameTb.Text;

            this.Wrapper.Groups = GroupsCb.Text;

            return true;
        }

        protected override void RefreshControl()
        {

            NameTb.Text = Wrapper.Name;

            if (GroupsCb.Items.Contains(Wrapper.Groups)) GroupsCb.SelectedItem = Wrapper.Groups;
            else
            {
                if (GroupsCb.Items.Count > 0) GroupsCb.SelectedIndex = 0;
            }
        }

        #endregion

        private void NameTb_TextChanged(object sender, System.EventArgs e)
        {
            ModifiedChange();
        }

        private void GroupsCb_TextUpdate(object sender, System.EventArgs e)
        {
            ModifiedChange();
        }

        private void GroupsCb_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            ModifiedChange();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace _02.OddOccurrences
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    public class OddCountOfWords
    {
        public static void Main()
        {
            var strs = Console.ReadLine()
                .ToLower()
                .Split(' ')
                .ToList();

            var oddCount = new Dictionary<string, int>();

            foreach (var s in strs)
            {
                if (!oddCount.ContainsKey(s))
                {
                    oddCount[s] = 0;
                }

                oddCount[s]++;
            }

            var result = new List<string>();

            foreach (var item in oddCount)
            {
                if (item.Value % 2 == 1)
                {
                    result.Add(item.Key);
                }
            }

            Console.WriteLine(string.Join(", ", result));
        }
    }
}


text:
class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  before_action :set_locale

  rescue_from CanCan::AccessDenied do |exception|
    redirect_to :root, alert: exception.message
  end

  private
    def set_wiki
      @wiki = Wiki.find_by!(slug: params[:wiki_id].presence || params[:id])
    end

    def page_params
      params.require(:page).permit(:title, :content, :parent_id)
    end

    # Locale
    def set_locale
      locale = available_locale(extract_locale_from_params)
      locale ||= available_locale(extract_locale_from_accept_language_header)
      locale ||= I18n.default_locale
      I18n.locale = locale
    end

    def extract_locale_from_accept_language_header
      request.env['HTTP_ACCEPT_LANGUAGE'].to_s.scan(/^[a-z]{2}/).first
    end

    def extract_locale_from_params
      params[:locale]
    end

    def available_locale(locale)
      locale.presence_in(I18n.available_locales.map(&:to_s))
    end

    def default_url_options(options = nil)
      if params[:locale].present?
        { locale: I18n.locale }
      else
        {}
      end
    end

    # Auth
    def current_user
      @current_user ||= User.find_by(id: session[:user_id])
    end
    helper_method :current_user

    def user_signed_in?
      !!current_user
    end
    helper_method :user_signed_in?

    def current_user=(user)
      @current_user = user
      session[:user_id] = user.try(:id)
    end

    def authenticate_user!
      redirect_to :root, alert: t('flash.application.unauthenticated') unless user_signed_in?
    end
end


text:
"use strict";

describe("Events", function() {
    var Events = require("../../lib/events/Events");
    var noop = require("../../lib/util/noop");

    it("noops on", function() {
        expect(Events.on).toBe(noop);
    });

    it("noops off", function() {
        expect(Events.off).toBe(noop);
    });

    it("noops trigger", function() {
        expect(Events.trigger).toBe(noop);
    });

    it("noops once", function() {
        expect(Events.once).toBe(noop);
    });

    it("noops listenTo", function() {
        expect(Events.listenTo).toBe(noop);
    });

    it("noops listenToOnce", function() {
        expect(Events.listenToOnce).toBe(noop);
    });

    it("noops stopListening", function() {
        expect(Events.stopListening).toBe(noop);
    });

});

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


text:
import warnings
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ImproperlyConfigured

default_app_config = 'leonardo.module.search.SearchConfig'

class Default(object):

    optgroup = 'Search'

    @property
    def apps(self):

        INSTALLED_APPS = []
        try:
            import whoosh
        except Exception as e:
            try:
                import haystack
            except ImportError as e:
                warnings.warn(
                    'Haystack search engine is disabled because: {}'.format(e))
            except ImproperlyConfigured as e:
                warnings.warn(
                    'Haystack search engine is disabled because: {}'.format(e))
            else:
                INSTALLED_APPS += ['haystack']
        else:
            INSTALLED_APPS += ['whoosh', 'haystack']

        return INSTALLED_APPS + ['leonardo.module.search']

    plugins = [
        ('leonardo.module.search.apps.search', _('Search'))
    ]

class SearchConfig(AppConfig, Default):
    name = 'leonardo.module.search'
    verbose_name = "Search Module"

default = Default()


text:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="pom.css"?>
<project>
  <pomVersion>4</pomVersion>
  <artifactId>ppw-libraries</artifactId>
  <organization>
    <name>PeopleWare n.v.</name>
    <url>http://www.peopleware.be/</url>
    <logo>http://cvs.peopleware.be/projects/Java/img/ppwlogo.jpg</logo>
  </organization>
  <dependencies>
    <dependency>
      <groupId>maven-taglib</groupId>
      <artifactId>maven-taglib-plugin</artifactId>
      <version>1.2.2</version>
      <type>plugin</type>
    </dependency>
    <dependency>
      <groupId>statcvs</groupId>
      <artifactId>maven-statcvs-plugin</artifactId>
      <version>2.5</version>
      <type>plugin</type>
    </dependency>
  </dependencies>
  <groupId>ppw-libraries</groupId>
  <url>http://www.peopleware.be/projects/JavaLibraries/${pom.artifactId}/</url>
  <siteAddress>cvs.peopleware.be</siteAddress>
  <siteDirectory>/ppw/projects/JavaLibraries/public_html/${pom.artifactId}/</siteDirectory>
  <distributionSite>cvs.peopleware.be</distributionSite>
  <distributionDirectory>/ppw/projects/JavaLibraries/public_html/maven-repository/${pom.groupId}/jars</distributionDirectory>
  <repository>
    <connection>scm:cvs:ext:${user.name}@cvs.peopleware.be:/ppw/projects/JavaLibraries/repository:${pom.artifactId}</connection>
    <developerConnection>scm:cvs:ext:${user.name}@cvs.peopleware.be:/ppw/projects/JavaLibraries/repository:${pom.artifactId}</developerConnection>
  </repository>
  <licenses>
    <license>
      <name>Copyright PeopleWare n.v.</name>
      <url>http://www.peopleware.be/licenses/fullCopyright.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <build>
    <nagEmailAddress>${pom.artifactId}-dev@peopleware.be</nagEmailAddress>
    <sourceDirectory>src/java</sourceDirectory>
    <!--<unitTestSourceDirectory>src/test</unitTestSourceDirectory>
        <unitTest>
            <includes>
                <include>**/_Test_*.java</include>
            </includes>
        </unitTest>
        -->
    <resources>
      <resource>
        <directory>src/conf</directory>
        <includes>
          <include>*.properties</include>
        </includes>
        <filtering>false</filtering>
      </resource>
    </resources>
  </build>
  <reports>
    <report>maven-license-plugin</report>
    <report>maven-javadoc-plugin</report>
    <report>maven-faq-plugin</report>
    <report>maven-jdepend-plugin</report>
    <report>maven-changelog-plugin</report>
    <report>maven-changes-plugin</report>
    <!--
  This plugin is usefull when we have different version to compare, currently
  we only have 1 version in CVS. This plugin needs to be tested when we have
  at least 2 version in CVS.
        <report>maven-jdiff-plugin</report>
-->
    <report>maven-checkstyle-plugin</report>
    <report>maven-linkcheck-plugin</report>
    <report>maven-pmd-plugin</report>
    <report>maven-developer-activity-plugin</report>
    <report>maven-file-activity-plugin</report>
    <report>maven-tasklist-plugin</report>
    <!-- <report>maven-doccheck-plugin</report> -->
    <report>taglib</report>
    <report>maven-statcvs-plugin</report>
  </reports>
  <properties />
</project>


text:
/**
 * Copyable module allows you to add text to copy buffer by click
 * Just add 'js-copyable' name to element and call init method
 *
 * @usage
 * Click to copy
 *
 * You can pass callback function to init method. Callback will fire when something has copied
 *
 * @type {{init}}
 */
module.exports = function () {
  const NAMES = {
    copyable: 'js-copyable',
    authorized: 'js-copyable-authorize'
  };

  /**
   * Take element by name and pass it to prepareElement function
   *
   * @param {Function} copiedCallback - fires when something has copied
   */
  let init = function (copiedCallback) {
    let elems = document.getElementsByName(NAMES.copyable);

    if (!elems) {
      console.log('There are no copyable elements');
      return;
    }

    for (let i = 0; i < elems.length; i++) {
      prepareElement(elems[i], copiedCallback);
    }

    let authorizedElems = document.getElementsByName(NAMES.authorized);

    for (let i = 0; i < elems.length; i++) {
      authorize(authorizedElems[i]);
    }

    console.log('Copyable module initialized');
  };

  /**
   * Add click and copied listeners to copyable element
   *
   * @param element
   * @param copiedCallback
   */
  let prepareElement = function (element, copiedCallback) {
    element.addEventListener('click', elementClicked);
    element.addEventListener('copied', copiedCallback);
  };

  /**
   * Add click listner for authorized element
   *
   * @param element
   */
  let authorize = function (element) {
    element.addEventListener('click', authorizedCopy);
  };

  /**
   * Click handler for authorized elements
   */
  let authorizedCopy = function () {
    let authorizedElem = this;
    let copyable = authorizedElem.querySelector('[name='+NAMES.copyable+']');

    copyable.click();
  };

  /**
   * Click handler
   * Create new range, select copyable element and add range to selection. Then exec 'copy' command
   */
  let elementClicked = function (event) {
    let selection = window.getSelection(),
        range     = document.createRange();

    range.selectNodeContents(this);
    selection.removeAllRanges();
    selection.addRange(range);

    document.execCommand('copy');
    selection.removeAllRanges();

    /**
     * We create new CustomEvent and dispatch it on copyable element
     * Consist copied text in detail property
     */
    let CopiedEvent = new CustomEvent('copied', {
      bubbles: false,
      cancelable: false,
      detail: range.toString()
    });

    this.dispatchEvent(CopiedEvent);
    event.stopPropagation();
  };

  return {
    init: init
  };
}();


text:
#region License

#endregion

#region Imports

using System;
using System.Globalization;
using System.Reflection;
using System.Text;

using Spring.Core;
using Spring.Core.TypeResolution;
using Spring.Util;

#endregion

namespace Spring.Objects.Factory.Config
{
    ///
    /// <see cref="Spring.Objects.Factory.IFactoryObject"/> implementation that
    /// retrieves a static or non-static public field value.
    ///
    /// <remarks>
    ///

    /// Typically used for retrieving public constants.
    ///

    /// </remarks>
    /// <example>
    ///

    /// The following example retrieves the <see cref="System.DBNull.Value"/> field value...
    ///

    ///
    /// <object id="dbnull" type="Spring.Objects.Factory.Config.FieldRetrievingFactoryObject, Spring.Core">
    ///     <property name="TargetType" value="System.DBNull"/>
    ///     <property name="TargetField" value="Value"/>
    /// </object>
    ///
    ///

    /// The previous example could also have been written using the convenience
    /// <see cref="Spring.Objects.Factory.Config.FieldRetrievingFactoryObject.StaticField"/>
    /// property, like so...
    ///

    ///
    /// <object id="dbnull" type="Spring.Objects.Factory.Config.FieldRetrievingFactoryObject, Spring.Core">
    ///     <property name="StaticField" value="System.DBNull.Value"/>
    /// </object>
    ///
    ///

    /// This class also implements the <see cref="Spring.Objects.Factory.IObjectNameAware"/>
    /// interface
    /// (<see cref="Spring.Objects.Factory.Config.FieldRetrievingFactoryObject.ObjectName"/>).
    /// If the id (or name) of one's
    /// <see cref="Spring.Objects.Factory.Config.FieldRetrievingFactoryObject"/>
    /// object definition is set to the <see cref="System.Type.AssemblyQualifiedName"/>
    /// of the <see langword="static"/> field to be retrieved, then the id (or
    /// name) of one's object definition will be used for the name of the
    /// <see langword="static"/> field lookup. See below for an example of this
    /// concise style of definition.
    ///

    ///
    ///
    /// <object id="System.DBNull.Value"
    ///         type="Spring.Objects.Factory.Config.FieldRetrievingFactoryObject, Spring.Core"/>
    ///
    ///
    /// <object id="System.Type.Delimiter"
    ///         type="Spring.Objects.Factory.Config.FieldRetrievingFactoryObject, Spring.Core"/>
    ///
    ///

    /// The usage for retrieving instance fields is similar. No example is shown
    /// because public instance fields are generally bad practice; but if
    /// you have some legacy code that exposes public instance fields, or if you
    /// just really like coding public instance fields, then you can use this
    /// <see cref="Spring.Objects.Factory.IFactoryObject"/> implementation to
    /// retrieve such field values.
    ///

    /// </example>
    /// <author>Juergen Hoeller</author>
    /// <author>Rick Evans (.NET)</author>
    [Serializable]
    public class FieldRetrievingFactoryObject : IFactoryObject, IInitializingObject, IObjectNameAware
    {
        private string targetField;
        private object targetObject;
        private Type targetType;
        private FieldInfo field;
        private string objectName;
        private string staticField;

        ///
        /// The <see cref="System.Type.AssemblyQualifiedName"/> of the
        /// <see langword="static"/> field to be retrieved.
        ///
        public string StaticField
        {
            set { this.staticField = value; }
        }

        ///
        /// Set the name of the object in the object factory that created this object.
        ///
        /// <value>
        /// The name of the object in the factory.
        /// </value>
        /// <remarks>
        ///

        /// In the context of the
        /// <see cref="Spring.Objects.Factory.Config.FieldRetrievingFactoryObject"/>
        /// class, the
        /// <see cref="Spring.Objects.Factory.Config.FieldRetrievingFactoryObject.ObjectName"/>
        /// value will be interepreted as the value of the
        /// <see cref="Spring.Objects.Factory.Config.FieldRetrievingFactoryObject.StaticField"/>
        /// property if no value has been explicitly assigned to the
        /// <see cref="Spring.Objects.Factory.Config.FieldRetrievingFactoryObject.StaticField"/>
        /// property. This allows for concise object definitions with just an id or name;
        /// see the class documentation for
        /// <see cref="Spring.Objects.Factory.Config.FieldRetrievingFactoryObject"/>
        /// for an example of this style of usage.
        ///

        /// </remarks>
        public string ObjectName
        {
            set { this.objectName = value; }
        }

        ///
        /// The name of the field the value of which is to be retrieved.
        ///
        /// <remarks>
        ///

        /// If the
        /// <see cref="Spring.Objects.Factory.Config.FieldRetrievingFactoryObject.TargetObject"/>
        /// has been set (and is not <cref lang="null"/>), then the value of this property
        /// refers to an instance field name; it otherwise refers to a <see langword="static"/>
        /// field name.
        ///

        /// </remarks>
        public string TargetField
        {
            get { return targetField; }
            set { targetField = value; }
        }

        ///
        /// The object instance on which the field is defined.
        ///
        public object TargetObject
        {
            get { return targetObject; }
            set { targetObject = value; }
        }

        ///
        /// The <see cref="System.Type"/> on which the field is defined.
        ///
        public Type TargetType
        {
            get { return targetType; }
            set { targetType = value; }
        }

        ///
        /// The <see cref="System.Type"/> of object that this
        /// <see cref="Spring.Objects.Factory.IFactoryObject"/> creates, or
        /// <cref lang="null"/> if not known in advance.
        ///
        public Type ObjectType
        {
            get { return (this.field == null) ? null : this.field.FieldType; }
        }

        ///
        /// Is the object managed by this factory a singleton or a prototype?
        ///
        public bool IsSingleton
        {
            get { return true; }
        }

        ///
        /// Invoked by an <see cref="Spring.Objects.Factory.IObjectFactory"/>
        /// after it has set all object properties supplied
        /// (and satisfied <see cref="Spring.Objects.Factory.IObjectFactoryAware"/>
        /// and ApplicationContextAware).
        ///
        /// <remarks>
        ///

        /// This method allows the object instance to perform initialization only
        /// possible when all object properties have been set and to throw an
        /// exception in the event of misconfiguration.
        ///

        /// </remarks>
        /// <exception cref="System.Exception">
        /// In the event of misconfiguration (such as failure to set an essential
        /// property) or if initialization fails.
        /// </exception>
        public void AfterPropertiesSet()
        {
            if (TargetType != null && TargetObject != null)
            {
                throw new ArgumentException(
                    "Only one of the TargetType or TargetObject properties can be set, not both.");
            }
            if (TargetType == null && TargetObject == null)
            {
                if (TargetField != null)
                {
                    throw new ArgumentException(
                        "Specify the TargetType or TargetObject property in combination with the TargetField property.");
                }

                // if no other property specified, use the object name for the static field expression...
                if (StringUtils.IsNullOrEmpty(this.staticField))
                {
                    this.staticField = this.objectName;
                }
                ParseAndSetFromStaticFieldValue();
            }
            if (TargetField == null)
            {
                throw new ArgumentException("The TargetField property is required.");
            }
            BindingFlags fieldFlags = BindingFlags.Public | BindingFlags.IgnoreCase;
            if (TargetObject == null)
            {
                // a static field...
                fieldFlags |= BindingFlags.Static;
            }
            else
            {
                // an instance field...
                fieldFlags |= BindingFlags.Instance;
                TargetType = TargetObject.GetType();
            }
            this.field = targetType.GetField(TargetField, fieldFlags);
            if (this.field == null)
            {
                throw new ObjectDefinitionStoreException(
                    string.Format(
                        CultureInfo.InvariantCulture,
                        "No such field '{0}' on [{1}].", TargetField,
                        TargetObject == null ? TargetType : TargetObject));
            }
        }

        ///
        /// Return an instance (possibly shared or independent) of the object
        /// managed by this factory.
        ///
        /// <returns>
        /// An instance (possibly shared or independent) of the object managed by
        /// this factory.
        /// </returns>
        /// <see cref="Spring.Objects.Factory.IFactoryObject.GetObject"/>
        public object GetObject()
        {
            if (TargetObject != null)
            {
                return this.field.GetValue(TargetObject);
            }
            else
            {
                return this.field.GetValue(null);
            }
        }

        private void ParseAndSetFromStaticFieldValue()
        {
            TypeAssemblyHolder info = new TypeAssemblyHolder(this.staticField);
            // the info.TypeName should now contains the Type name, followed by a
            // period, followed by the name of the field
            int lastDotIndex = info.TypeName.LastIndexOf('.');
            if (lastDotIndex == -1
                || lastDotIndex == info.TypeName.Length)
            {
                throw new ArgumentException(
                    "The value passed to the StaticField property must be a fully " +
                    "qualified Type plus field name: " +
                    "e.g. 'Example.MyExampleClass.MyField, MyAssembly'");
            }
            string typeName = info.TypeName.Substring(0, lastDotIndex);
            string fieldName = info.TypeName.Substring(lastDotIndex + 1);
            StringBuilder buffer = new StringBuilder(typeName);
            if (info.IsAssemblyQualified)
            {
                buffer.Append(TypeAssemblyHolder.TypeAssemblySeparator);
                buffer.Append(info.AssemblyName);
            }
            TargetType = TypeResolutionUtils.ResolveType(buffer.ToString());
            TargetField = fieldName;
        }
    }
}


text:
<?php

namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;

use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\Security\Http\EventListener\RememberMeLogoutListener;

/**
 * @internal
 */
class RememberMeFactory implements SecurityFactoryInterface, AuthenticatorFactoryInterface
{
    protected $options = [
        'name' => 'REMEMBERME',
        'lifetime' => 31536000,
        'path' => '/',
        'domain' => null,
        'secure' => false,
        'httponly' => true,
        'samesite' => null,
        'always_remember_me' => false,
        'remember_me_parameter' => '_remember_me',
    ];

    public function create(ContainerBuilder $container, string $id, array $config, ?string $userProvider, ?string $defaultEntryPoint)
    {
        // authentication provider
        $authProviderId = 'security.authentication.provider.rememberme.'.$id;
        $container
            ->setDefinition($authProviderId, new ChildDefinition('security.authentication.provider.rememberme'))
            ->replaceArgument(0, new Reference('security.user_checker.'.$id))
            ->addArgument($config['secret'])
            ->addArgument($id)
        ;

        // remember me services
        $templateId = $this->generateRememberMeServicesTemplateId($config, $id);
        $rememberMeServicesId = $templateId.'.'.$id;

        // attach to remember-me aware listeners
        $userProviders = [];
        foreach ($container->findTaggedServiceIds('security.remember_me_aware') as $serviceId => $attributes) {
            foreach ($attributes as $attribute) {
                if (!isset($attribute['id']) || $attribute['id'] !== $id) {
                    continue;
                }

                if (!isset($attribute['provider'])) {
                    throw new \RuntimeException('Each "security.remember_me_aware" tag must have a provider attribute.');
                }

                // context listeners don't need a provider
                if ('none' !== $attribute['provider']) {
                    $userProviders[] = new Reference($attribute['provider']);
                }

                $container
                    ->getDefinition($serviceId)
                    ->addMethodCall('setRememberMeServices', [new Reference($rememberMeServicesId)])
                ;
            }
        }

        $this->createRememberMeServices($container, $id, $templateId, $userProviders, $config);

        // remember-me listener
        $listenerId = 'security.authentication.listener.rememberme.'.$id;
        $listener = $container->setDefinition($listenerId, new ChildDefinition('security.authentication.listener.rememberme'));
        $listener->replaceArgument(1, new Reference($rememberMeServicesId));
        $listener->replaceArgument(5, $config['catch_exceptions']);

        // remember-me logout listener
        $container->setDefinition('security.logout.listener.remember_me.'.$id, new Definition(RememberMeLogoutListener::class))
            ->addArgument(new Reference($rememberMeServicesId))
            ->addTag('kernel.event_subscriber', ['dispatcher' => 'security.event_dispatcher.'.$id]);

        return [$authProviderId, $listenerId, $defaultEntryPoint];
    }

    public function createAuthenticator(ContainerBuilder $container, string $firewallName, array $config, string $userProviderId): string
    {
        $templateId = $this->generateRememberMeServicesTemplateId($config, $firewallName);
        $rememberMeServicesId = $templateId.'.'.$firewallName;

        // create remember me services (which manage the remember me cookies)
        $this->createRememberMeServices($container, $firewallName, $templateId, [new Reference($userProviderId)], $config);

        // create remember me listener (which executes the remember me services for other authenticators and logout)
        $this->createRememberMeListener($container, $firewallName, $rememberMeServicesId);

        // create remember me authenticator (which re-authenticates the user based on the remember me cookie)
        $authenticatorId = 'security.authenticator.remember_me.'.$firewallName;
        $container
            ->setDefinition($authenticatorId, new ChildDefinition('security.authenticator.remember_me'))
            ->replaceArgument(0, new Reference($rememberMeServicesId))
            ->replaceArgument(3, array_intersect_key($config, $this->options))
        ;

        foreach ($container->findTaggedServiceIds('security.remember_me_aware') as $serviceId => $attributes) {
            // register ContextListener
            if ('security.context_listener' === substr($serviceId, 0, 25)) {
                $container
                    ->getDefinition($serviceId)
                    ->addMethodCall('setRememberMeServices', [new Reference($rememberMeServicesId)])
                ;

                continue;
            }

            throw new \LogicException(sprintf('Symfony Authenticator Security dropped support for the "security.remember_me_aware" tag, service "%s" will no longer work as expected.', $serviceId));
        }

        return $authenticatorId;
    }

    public function getPosition()
    {
        return 'remember_me';
    }

    public function getKey()
    {
        return 'remember-me';
    }

    public function addConfiguration(NodeDefinition $node)
    {
        $builder = $node
            ->fixXmlConfig('user_provider')
            ->children()
        ;

        $builder
            ->scalarNode('secret')->isRequired()->cannotBeEmpty()->end()
            ->scalarNode('service')->end()
            ->scalarNode('token_provider')->end()
            ->arrayNode('user_providers')
                ->beforeNormalization()
                    ->ifString()->then(function ($v) { return [$v]; })
                ->end()
                ->prototype('scalar')->end()
            ->end()
            ->booleanNode('catch_exceptions')->defaultTrue()->end()
        ;

        foreach ($this->options as $name => $value) {
            if ('secure' === $name) {
                $builder->enumNode($name)->values([true, false, 'auto'])->defaultValue('auto' === $value ? null : $value);
            } elseif ('samesite' === $name) {
                $builder->enumNode($name)->values([null, Cookie::SAMESITE_LAX, Cookie::SAMESITE_STRICT, Cookie::SAMESITE_NONE])->defaultValue($value);
            } elseif (\is_bool($value)) {
                $builder->booleanNode($name)->defaultValue($value);
            } elseif (\is_int($value)) {
                $builder->integerNode($name)->defaultValue($value);
            } else {
                $builder->scalarNode($name)->defaultValue($value);
            }
        }
    }

    private function generateRememberMeServicesTemplateId(array $config, string $id): string
    {
        if (isset($config['service'])) {
            return $config['service'];
        }

        if (isset($config['token_provider'])) {
            return 'security.authentication.rememberme.services.persistent';
        }

        return 'security.authentication.rememberme.services.simplehash';
    }

    private function createRememberMeServices(ContainerBuilder $container, string $id, string $templateId, array $userProviders, array $config): void
    {
        $rememberMeServicesId = $templateId.'.'.$id;

        $rememberMeServices = $container->setDefinition($rememberMeServicesId, new ChildDefinition($templateId));
        $rememberMeServices->replaceArgument(1, $config['secret']);
        $rememberMeServices->replaceArgument(2, $id);

        if (isset($config['token_provider'])) {
            $rememberMeServices->addMethodCall('setTokenProvider', [
                new Reference($config['token_provider']),
            ]);
        }

        // remember-me options
        $rememberMeServices->replaceArgument(3, array_intersect_key($config, $this->options));

        if ($config['user_providers']) {
            $userProviders = [];
            foreach ($config['user_providers'] as $providerName) {
                $userProviders[] = new Reference('security.user.provider.concrete.'.$providerName);
            }
        }

        if (0 === \count($userProviders)) {
            throw new \RuntimeException('You must configure at least one remember-me aware listener (such as form-login) for each firewall that has remember-me enabled.');
        }

        $rememberMeServices->replaceArgument(0, new IteratorArgument(array_unique($userProviders)));
    }

    private function createRememberMeListener(ContainerBuilder $container, string $id, string $rememberMeServicesId): void
    {
        $container
            ->setDefinition('security.listener.remember_me.'.$id, new ChildDefinition('security.listener.remember_me'))
            ->addTag('kernel.event_subscriber', ['dispatcher' => 'security.event_dispatcher.'.$id])
            ->replaceArgument(0, new Reference($rememberMeServicesId))
        ;

        $container
            ->setDefinition('security.logout.listener.remember_me.'.$id, new Definition(RememberMeLogoutListener::class))
            ->addTag('kernel.event_subscriber', ['dispatcher' => 'security.event_dispatcher.'.$id])
            ->addArgument(new Reference($rememberMeServicesId));
    }
}


text:
'''
Author: jason
Created: Apr 16, 2012
Module: core.__init__
Purpose: to import
'''

from globalVariables import *

import sys

# skip .pycs
sys.dont_write_bytecode = True

print "core.__init__ imported"


text:
There is also debugger extension for Yii2 with automatic beautifying JSON response.
You can see details [here](https://github.com/strider2038/yii2-ajax-debugger)

## Known issues

Numbers in exponential notation will be transformed into simple numeric notation.
For example "3e+1" will be displayed as "30".


text:
function show_usage {
    echo "Deploy viajante app utility"
    echo "Usage: $0 dev|prod [port]"
    echo "Feature: [port], status: pending"
    exit 1
}

case "$1" in
    "dev")
        NODE_ENV=development
        PORT=3001
        ;;
    "prod")
        NODE_ENV=production
        PORT=3000
        ;;
    *)
        show_usage
        ;;
esac

#if [ "$*" == "" ]; then
#    show_usage
#fi

HOME=~
ENVIRONMENT=$1
FOLDER=$HOME/$ENVIRONMENT
cd $FOLDER

git pull

LOG_FILENAME=$HOME/logs/$ENVIRONMENT.log
NODE_ENV=$NODE_ENV PORT=$PORT node server.js &>$>$LOG_FILENAME &

echo "Server: started, logs:"$LOG_FILENAME


text:
title: Easy Way to Auto Backup Your Linux
author: Aris Ripandi
type: post
date: 2014-05-15T08:13:46+00:00
url: /201405147/easy-way-to-auto-backup-your-linux
bs_social_share_interval:
  - 1486512143
categories:
  - Teknologi

---
Data is one thing that is very important for us. Data loss is a disaster for everyone, including a System Administrator. Therefore, it is necessary to backup your data regularly. In Linux we can easily to backup data automatically and scheduled. The following will explain how.

### Step 01 – setup ssh {#step01setupssh}

This step should be done because we will upload the backup file to a remote server. At this stage we will arrange to login SSH without password.

Create RSA key:

mkdir -p ~/.ssh
touch ~/.ssh/authorized_keys
ssh-keygen -t rsa -b 2048
chmod go-w ~/
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*

Upload public key to backup server:

ssh-copy-id -i ~/.ssh/id_rsa.pub '-o StrictHostKeyChecking=no REMOTEUSER@REMOETHOST -pREMOTEPORT'

Create backup directory in local and remote server:

mkdir -p /var/backup; chown -R REMOTEUSER /var/backup
ssh REMOTEUSER@REMOETHOST -pREMOTEPORT 'sudo mkdir -p /var/backup; sudo chown -R REMOTEUSER /var/backup'

### Step 02 – install backup2l {#step02installbackup2l}

In RedHat based distros:

yum update
yum install backup2l

In Debian based distros:

apt-get update
apt-get install backup2l

Or you can build it from source. Please read the official documentation for more information.

### Step 03 – configure backup2l {#step03configurebackup2l}

Edit `/etc/backup2l.conf` and create configuration like this:

FOR_VERSION=1.5
VOLNAME="all"
SRCLIST=(/etc/apache2/sites-available /home)
SKIPCOND=(-path "/home/REMOTEUSER" "/etc/apache2/sites-available/default*" "*.nobackup*" -o -name "*.o")
BACKUP_DIR="/var/backup"
MAX_LEVEL=3
MAX_PER_LEVEL=9
MAX_FULL=2
GENERATIONS=1
CREATE_CHECK_FILE=1
AUTORUN=0
SIZE_UNITS="M"
UNCONFIGURED=0
CREATE_DRIVER="DRIVER_TAR_GZ"
PRE_BACKUP () {
  echo -e "  Backup MySQL Databases:"
  echo -e "  -----------------------"
  /usr/bin/mysqldump -u root -p --all-databases --skip-lock-tables | bzip2 > /home/all_db.sql.bz2
}
POST_BACKUP () {
  echo -e "  Uploading Backup File to Backup Server:"
  echo -e "  ---------------------------------------"
  /usr/bin/scp -r /var/backup/all.*.tar.gz REMOTEUSER@REMOTEHOST:/var/backup/.
}

Create Cron for auto backup, in this example I just create automatic backup every week. You can edit as you want.

cat > /etc/cron.d/autobackup <<EOF
@weekly /usr/sbin/backup2l > /dev/null || nice -n 19 ionice -c 3 backup2l -b
EOF

**Notes:** You can modify the configuration as you want. Remember to change REMOTEUSER, REMOTEHOST, and REMOTEPORT variables.

### References: {#references}

[Official backup2l][1]

[Hetzner Wiki][2]

#### Done. That’s easy huh? Thank you for reading {#donethatseasyhuhthankyouforreading}

 [1]: http://backup2l.sourceforge.net
 [2]: http://wiki.hetzner.de/index.php/Backup2l/en


text:
/*!
 * jPanelMenu - CSS Transforms
 * @version 1.3.1-beta
 * @source https://github.com/raywalker-it/jPanelMenu-raywalker
 * @authors Originally by Anthony Colangelo <http://acolangelo.com>,
 *          Ray Walker <geek@raywalker.it>
 * @license MIT
 */
(function($, global, doc) {
    $.jPanelMenu = function(options) {
        var $document = $(doc),
            M = global.Modernizr || false,
            jP = {
            options: $.extend({
                menu: '#menu',
                trigger: '.menu-trigger',
                excludedPanelContent: 'style, script',
                keepEventHandlers: false,
                direction: 'left',
                openPosition: '250px',
                animated: true,
                closeOnContentClick: true,
                keyboardShortcuts: [
                    {
                        code: 27,
                        open: false,
                        close: true
                    },
                    {
                        code: 37,
                        open: false,
                        close: true
                    },
                    {
                        code: 39,
                        open: true,
                        close: true
                    },
                    {
                        code: 77,
                        open: true,
                        close: true
                    }
                ],
                duration: 150,
                openDuration: options.duration || 150,
                closeDuration: options.duration || 150,
                easing: 'ease-in-out',
                openEasing: options.easing || 'ease-in-out',
                closeEasing: options.easing || 'ease-in-out',
                before: function() {
                },
                beforeOpen: function() {
                },
                beforeClose: function() {
                },
                after: function() {
                },
                afterOpen: function() {
                },
                afterClose: function() {
                },
                beforeOn: function() {
                },
                afterOn: function() {
                },
                beforeOff: function() {
                },
                afterOff: function() {
                }
            }, options || {}),
            settings: {
                transitionsSupported: 'WebkitTransition' in doc.body.style ||
                    'MozTransition' in doc.body.style ||
                    'msTransition' in doc.body.style ||
                    'OTransition' in doc.body.style ||
                    'Transition' in doc.body.style,
                transformsSupported: 'WebkitTransform' in doc.body.style ||
                    'MozTransform' in doc.body.style ||
                    'msTransform' in doc.body.style ||
                    'OTransform' in doc.body.style ||
                    'Transform' in doc.body.style,
                cssPrefix: '',
                shiftFixedChildren: false,
                panelPosition: 'relative',
                positionUnits: 'px'
            },
            menu: '#jPanelMenu-menu',
            panel: '.jPanelMenu-panel',
            fixedChildren: [],
            timeouts: {},
            clearTimeouts: function() {
                clearTimeout(jP.timeouts.open);
                clearTimeout(jP.timeouts.afterOpen);
                clearTimeout(jP.timeouts.afterClose);
            },
            setPositionUnits: function() {
                var foundUnit = false,
                    allowedUnits = ['%', 'px', 'em'];

                for (var unitID in allowedUnits) {
                    var unit = allowedUnits[unitID];
                    if (jP.options.openPosition.toString().substr(-unit.length) === unit)
                    {
                        foundUnit = true;
                        jP.settings.positionUnits = unit;
                    }
                }

                if (!foundUnit) {
                    jP.options.openPosition = parseInt(jP.options.openPosition) + jP.settings.positionUnits;
                }
            },
            computePositionStyle: function(open, string) {
                var position = (open) ? jP.options.openPosition : '0' + jP.settings.positionUnits,
                    property = {};
                if (jP.settings.transformsSupported) {
                    var direction = (open && jP.options.direction === 'right') ? '-' : '',
                        translate = 'translate3d(' + direction + position + ',0,0)',
                        transform = 'transform';

                    if (string) {
                        property = '';
                        if (jP.settings.cssPrefix !== '') {
                            property = jP.settings.cssPrefix + transform + ':' + translate + ';';
                        }
                        property += transform + ':' + translate + ';';
                    } else {
                        if (jP.settings.cssPrefix !== '') {
                            property[jP.settings.cssPrefix + transform] = translate;
                        }
                        property[transform] = translate;
                    }
                } else {
                    if (string) {
                        property = '';
                        property = jP.options.direction + ': ' + position + ';';
                    } else {
                        property[jP.options.direction] = position;
                    }
                }
                return property;
            },
            setCSSPrefix: function() {
                jP.settings.cssPrefix = jP.getCSSPrefix();
            },
            checkFixedChildren: function() {
                jP.disableTransitions();

                var defaultPanelStyle = {position: $(jP.panel).css('position')};

                defaultPanelStyle[jP.options.direction] = ($(jP.panel).css(jP.options.direction) === 'auto') ? 0 : $(jP.panel).css(jP.options.direction);

                $(jP.panel).find('> *').each(function() {
                    if ($(this).css('position') === 'fixed' && $(this).css(jP.options.direction) === 'auto') {
                        jP.fixedChildren.push(this);
                    }
                });

                if (jP.fixedChildren.length > 0)
                {
                    var newPanelStyle = {position: 'relative'};

                    newPanelStyle[jP.options.direction] = '1px';
                    jP.setPanelStyle(newPanelStyle);

                    if (parseInt($(jP.fixedChildren[0]).offset().left) === 0) {
                        jP.settings.shiftFixedChildren = true;
                    }
                }

                jP.setPanelStyle(defaultPanelStyle);
            },
            setjPanelMenuStyles: function() {
                var bgColor = '#fff',
                    htmlBG = $('html').css('background-color'),
                    bodyBG = $('body').css('background-color');

                if (bodyBG !== 'transparent' && bodyBG !== "rgba(0, 0, 0, 0)") {
                    bgColor = bodyBG;
                }
                else if (htmlBG !== 'transparent' && htmlBG !== "rgba(0, 0, 0, 0)") {
                    bgColor = htmlBG;
                }
                else {
                    bgColor = '#fff';
                }

                if ($('#jPanelMenu-style-master').length === 0)
                {
                    $('body').append('<style id="jPanelMenu-style-master">body{width:100%}.jPanelMenu,body{overflow-x:hidden}#jPanelMenu-menu{display:block;position:fixed;top:0;' + jP.options.direction + ':0;height:100%;z-index:-1;overflow-x:hidden;overflow-y:scroll;-webkit-overflow-scrolling:touch}.jPanelMenu-panel{position:static;' + jP.computePositionStyle(false, true) + 'z-index:2;width:100%;min-height:100%;background:' + bgColor + '}</style>');
                }
            },
            setMenuState: function(open) {
                var position = (open) ? 'open' : 'closed';
                $('body').attr('data-menu-position', position);
            },
            getMenuState: function() {
                return $('body').attr('data-menu-position');
            },
            menuIsOpen: function() {
                if (jP.getMenuState() === 'open') {
                    return true;
                }
                else {
                    return false;
                }
            },
            setMenuStyle: function(styles) {
                $(jP.menu).css(styles);
            },
            setPanelStyle: function(styles) {
                $(jP.panel).css(styles);
            },
            showMenu: function() {
                jP.setMenuStyle({
                    display: 'block'
                });
                jP.setMenuStyle({
                    'z-index': '1'
                });
            },
            hideMenu: function() {
                jP.setMenuStyle({
                    'z-index': '-1'
                });
                jP.setMenuStyle({
                    display: 'none'
                });
            },
            enableTransitions: function(duration, easing) {
                var formattedDuration = duration / 1000;
                var formattedEasing = jP.getCSSEasingFunction(easing);
                jP.disableTransitions();
                $('body').append('<style id="jPanelMenu-style-transitions">.jPanelMenu-panel{' + jP.settings.cssPrefix + 'transition: all ' + formattedDuration + 's ' + formattedEasing + '; transition: all ' + formattedDuration + 's ' + formattedEasing + ';}</style>');
            },
            disableTransitions: function() {
                $('#jPanelMenu-style-transitions').remove();
            },
            enableFixedTransitions: function(selector, id, duration, easing) {
                var formattedDuration = duration / 1000,
                    formattedEasing = jP.getCSSEasingFunction(easing);
                jP.disableFixedTransitions(id);
                $('body').append('<style id="jPanelMenu-style-fixed-' + id + '">' + selector + '{' + jP.settings.cssPrefix + 'transition: all ' + formattedDuration + 's ' + formattedEasing + '; transition: all ' + formattedDuration + 's ' + formattedEasing + ';}</style>');
            },
            disableFixedTransitions: function(id) {
                $('#jPanelMenu-style-fixed-' + id).remove();
            },
            getCSSEasingFunction: function(name) {
                switch (name) {
                    case 'linear':
                        return name;

                    case 'ease':
                        return name;

                    case 'ease-in':
                        return name;

                    case 'ease-out':
                        return name;

                    case 'ease-in-out':
                        return name;

                    default:
                        return 'ease-in-out';
                }
            },
            getJSEasingFunction: function(name) {
                switch (name)
                {
                    case 'linear':
                        return name;

                    default:
                        return 'swing';
                }
            },
            getVendorPrefix: function() {
                if (M && M.hasOwnProperty('prefixed')) {
                    return M.prefixed('transform').replace('transform','');
                }

                // Thanks to Lea Verou for this beautiful function. (http://lea.verou.me/2009/02/find-the-vendor-prefix-of-the-current-browser)
                if ('result' in arguments.callee) {
                    return arguments.callee.result;
                }

                var regex = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,
                    someScript = doc.getElementsByTagName('script')[0];

                for (var prop in someScript.style)
                {
                    if (regex.test(prop))
                    {
                        arguments.callee.result = prop.match(regex)[0];
                        // test is faster than match, so it's better to perform
                        // that on the lot and match only when necessary
                        return arguments.callee.result;
                    }

                }

                // Nothing found so far? Webkit does not enumerate over the CSS properties of the style object.
                // However (prop in style) returns the correct value, so we'll have to test for
                // the precence of a specific property
                if ('WebkitOpacity' in someScript.style) {
                    arguments.callee.result = 'Webkit';
                } else if ('KhtmlOpacity' in someScript.style) {
                    arguments.callee.result = 'Khtml';
                } else {
                    arguments.callee.result = '';
                }

                return arguments.callee.result;
            },
            getCSSPrefix: function() {
                var prefix = jP.getVendorPrefix();
                if (prefix !== '') {
                    return '-' + prefix.toLowerCase() + '-';
                }
                return '';
            },
            openMenu: function(animated) {
                if (typeof (animated) === "undefined" || animated === null) {
                    animated = jP.options.animated;
                }

                jP.clearTimeouts();

                jP.options.before();
                jP.options.beforeOpen();

                jP.setMenuState(true);

                jP.setPanelStyle({position: 'relative'});

                jP.showMenu();

                var animationChecks = {
                    none: (!animated) ? true : false,
                    transitions: (animated && jP.settings.transitionsSupported) ? true : false
                };

                if (animationChecks.transitions || animationChecks.none) {
                    if (animationChecks.none) {
                        jP.disableTransitions();
                    }
                    if (animationChecks.transitions) {
                        jP.enableTransitions(jP.options.openDuration, jP.options.openEasing);
                    }

                    var newPanelStyle = jP.computePositionStyle(true);

                    jP.setPanelStyle(newPanelStyle);

                    if (jP.settings.shiftFixedChildren) {
                        $(jP.fixedChildren).each(function() {
                            var id = $(this).prop("tagName").toLowerCase() + ' ' + $(this).attr('class'),
                                selector = id.replace(' ', '.'),
                                identifier = id.replace(' ', '-'),
                                newChildrenStyle = {};

                            if (animationChecks.none) {
                                jP.disableFixedTransitions(identifier);
                            }
                            if (animationChecks.transitions) {
                                jP.enableFixedTransitions(selector, identifier, jP.options.openDuration, jP.options.openEasing);
                            }

                            newChildrenStyle[jP.options.direction] = jP.options.openPosition;
                            $(this).css(newChildrenStyle);
                        });
                    }

                    jP.timeouts.afterOpen = setTimeout(function() {
                        jP.disableTransitions();
                        if (jP.settings.shiftFixedChildren) {
                            $(jP.fixedChildren).each(function() {
                                var id = $(this).prop("tagName").toLowerCase() + ' ' + $(this).attr('class');

                                jP.disableFixedTransitions(id.replace(' ', '-'));
                            });
                        }

                        jP.options.after();
                        jP.options.afterOpen();
                        jP.initiateContentClickListeners();
                    }, jP.options.openDuration);
                }
                else {
                    var formattedEasing = jP.getJSEasingFunction(jP.options.openEasing);

                    var animationOptions = {};
                    animationOptions[jP.options.direction] = jP.options.openPosition;
                    $(jP.panel).stop().animate(animationOptions, jP.options.openDuration, formattedEasing, function() {
                        jP.options.after();
                        jP.options.afterOpen();
                        jP.initiateContentClickListeners();
                    });

                    if (jP.settings.shiftFixedChildren) {
                        $(jP.fixedChildren).each(function() {
                            var childrenAnimationOptions = {};
                            childrenAnimationOptions[jP.options.direction] = jP.options.openPosition;
                            $(this).stop().animate(childrenAnimationOptions, jP.options.openDuration, formattedEasing);
                        });
                    }
                }
            },
            closeMenu: function(animated) {
                if (typeof animated === "undefined" || animated === null) {
                    animated = jP.options.animated;
                }

                jP.clearTimeouts();

                jP.options.before();
                jP.options.beforeClose();

                jP.setMenuState(false);

                var animationChecks = {
                    none: (!animated) ? true : false,
                    transitions: (animated && jP.settings.transitionsSupported) ? true : false
                };

                if (animationChecks.transitions || animationChecks.none) {
                    if (animationChecks.none) {
                        jP.disableTransitions();
                    }
                    if (animationChecks.transitions) {
                        jP.enableTransitions(jP.options.closeDuration, jP.options.closeEasing);
                    }

                    var newPanelStyle = jP.computePositionStyle();
                    jP.setPanelStyle(newPanelStyle);

                    if (jP.settings.shiftFixedChildren) {
                        $(jP.fixedChildren).each(function() {
                            var id = $(this).prop("tagName").toLowerCase() + ' ' + $(this).attr('class'),
                                selector = id.replace(' ', '.'),
                                ident = id.replace(' ', '-'),
                                newChildrenStyle = {};

                            if (animationChecks.none) {
                                jP.disableFixedTransitions(ident);
                            }
                            if (animationChecks.transitions) {
                                jP.enableFixedTransitions(selector, ident, jP.options.closeDuration, jP.options.closeEasing);
                            }

                            newChildrenStyle[jP.options.direction] = 0 + jP.settings.positionUnits;
                            $(this).css(newChildrenStyle);
                        });
                    }

                    jP.timeouts.afterClose = setTimeout(function() {
                        jP.setPanelStyle({position: jP.settings.panelPosition});

                        jP.disableTransitions();
                        if (jP.settings.shiftFixedChildren) {
                            $(jP.fixedChildren).each(function() {
                                var id = $(this).prop("tagName").toLowerCase() + ' ' + $(this).attr('class');

                                jP.disableFixedTransitions(id.replace(' ', '-'));
                            });
                        }

                        jP.hideMenu();
                        jP.options.after();
                        jP.options.afterClose();
                        jP.destroyContentClickListeners();
                    }, jP.options.closeDuration);
                }
                else {
                    var formattedEasing = jP.getJSEasingFunction(jP.options.closeEasing),
                        animationOptions = {};

                    animationOptions[jP.options.direction] = 0 + jP.settings.positionUnits;
                    $(jP.panel).stop().animate(animationOptions, jP.options.closeDuration, formattedEasing, function() {
                        jP.setPanelStyle({position: jP.settings.panelPosition});

                        jP.hideMenu();
                        jP.options.after();
                        jP.options.afterClose();
                        jP.destroyContentClickListeners();
                    });

                    if (jP.settings.shiftFixedChildren) {
                        $(jP.fixedChildren).each(function() {
                            var childrenAnimationOptions = {};

                            childrenAnimationOptions[jP.options.direction] = 0 + jP.settings.positionUnits;
                            $(this).stop().animate(childrenAnimationOptions, jP.options.closeDuration, formattedEasing);
                        });
                    }
                }
            },
            triggerMenu: function(animated) {
                if (jP.menuIsOpen()) {
                    jP.closeMenu(animated);
                }
                else {
                    jP.openMenu(animated);
                }
            },
            initiateClickListeners: function() {
                $document.on('click', jP.options.trigger, function() {
                    jP.triggerMenu(jP.options.animated);
                    return false;
                });
            },
            destroyClickListeners: function() {
                $document.off('click', jP.options.trigger, null);
            },
            initiateContentClickListeners: function() {
                if (!jP.options.closeOnContentClick){
                    return false;}

                $document.on('click', jP.panel, function() {
                    if (jP.menuIsOpen()) {
                        jP.closeMenu(jP.options.animated);
                    }
                });

                $document.on('touchend', jP.panel, function() {
                    if (jP.menuIsOpen()) {
                        jP.closeMenu(jP.options.animated);
                    }
                });
            },
            destroyContentClickListeners: function() {
                if (!jP.options.closeOnContentClick) {
                    return false;
                }

                $document.off('click', jP.panel, null);
                $document.off('touchend', jP.panel, null);
            },
            initiateKeyboardListeners: function() {
                var preventKeyListeners = ['input', 'textarea'];
                $document.on('keydown', function(e) {
                    var target = $(e.target),
                        prevent = false;
                    $.each(preventKeyListeners, function() {
                        if (target.is(this.toString())) {
                            prevent = true;
                        }
                    });
                    if (prevent) {
                        return true;
                    }

                    for (var mapping in jP.options.keyboardShortcuts) {
                        if (e.which === jP.options.keyboardShortcuts[mapping].code) {
                            var key = jP.options.keyboardShortcuts[mapping];

                            if (key.open && key.close) {
                                jP.triggerMenu(jP.options.animated);
                            }
                            else if ((key.open && !key.close) && !jP.menuIsOpen()) {
                                jP.openMenu(jP.options.animated);
                            }
                            else if ((!key.open && key.close) && jP.menuIsOpen()) {
                                jP.closeMenu(jP.options.animated);
                            }

                            return false;
                        }
                    }
                });
            },
            destroyKeyboardListeners: function() {
                $document.off('keydown', null);
            },
            setupMarkup: function() {
                $('html').addClass('jPanelMenu');
                $('body > *').not(jP.menu + ', ' + jP.options.excludedPanelContent).wrapAll('<div class="' + jP.panel.replace('.', '') + '"/>');
                $(jP.options.menu).clone(jP.options.keepEventHandlers).attr('id', jP.menu.replace('#', '')).insertAfter('body > ' + jP.panel);
            },
            resetMarkup: function() {
                $('html').removeClass('jPanelMenu');
                $('body > ' + jP.panel + ' > *').unwrap();
                $(jP.menu).remove();
            },
            init: function() {
                jP.options.beforeOn();

                jP.setPositionUnits();
                jP.setCSSPrefix();
                jP.initiateClickListeners();
                if (Object.prototype.toString.call(jP.options.keyboardShortcuts) === '[object Array]') {
                    jP.initiateKeyboardListeners();
                }

                jP.setjPanelMenuStyles();
                jP.setMenuState(false);
                jP.setupMarkup();

                jP.setMenuStyle({width: jP.options.openPosition});

                if (!jP.settings.transformsSupported) {
                    jP.checkFixedChildren();
                }

                jP.closeMenu(false);

                jP.options.afterOn();
            },
            destroy: function() {
                jP.options.beforeOff();

                jP.closeMenu();
                jP.destroyClickListeners();
                if (Object.prototype.toString.call(jP.options.keyboardShortcuts) === '[object Array]') {
                    jP.destroyKeyboardListeners();
                }

                jP.resetMarkup();
                var childrenStyles = {};
                childrenStyles[jP.options.direction] = 'auto';
                $(jP.fixedChildren).each(function() {
                    $(this).css(childrenStyles);
                });
                jP.fixedChildren = [];

                jP.options.afterOff();
            }
        };

        return {
            on: jP.init,
            off: jP.destroy,
            trigger: jP.triggerMenu,
            open: jP.openMenu,
            close: jP.closeMenu,
            isOpen: jP.menuIsOpen,
            menu: jP.menu,
            getMenu: function() {
                return $(jP.menu);
            },
            panel: jP.panel,
            getPanel: function() {
                return $(jP.panel);
            }
        };
    };
})(jQuery, this, document);


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class URL
{
    public static void ExtractURL(string url)
    {
        int index = 0;
        index = url.IndexOf(':');
        Console.WriteLine("[protocol] = \"{0}\"", url.Substring(0, index));
        url = url.Replace(url.Substring(0, index + 3), "");

        index = url.IndexOf('/');
        Console.WriteLine("[server] = \"{0}\"", url.Substring(0, index));
        url = url.Replace(url.Substring(0, index), "");

        Console.WriteLine("[resource] = \"{0}\"", url);

    }

    static void Main()
    {
        string url = @"https://telerikacademy.com/Courses/Courses/Details/151";
        ExtractURL(url);
    }
}


text:
local Class = require "lib.hump.Class"
local MovementComponent = require "component.movement.MovementComponent"

local ConstantMovementComponent = Class{}
ConstantMovementComponent:include(MovementComponent)

function ConstantMovementComponent:init(targetDirX, targetDirY, terminalVelocity)
  MovementComponent.init(self, terminalVelocity, true)

  self._targetDirX, self._targetDirY = targetDirX, targetDirY

  self._velocity.x = self._targetDirX * self._terminalVelocity
  self._velocity.y = self._targetDirY * self._terminalVelocity

  self._direction.x = self._targetDirX
  self._direction.y = self._targetDirY
end

return ConstantMovementComponent


text:
import java.util.*;
import java.util.Scanner;
import java.io.PrintWriter;
import java.io.FileReader;
import java.io.FileWriter;

public class GCJTemplate{
	private final static String PROBLEM_NAME = "PROBLEM";
	private final static String FILE_LOC = "/";
	private final static String FILE_INPUT_NAME = "file.in";
	private final static Strinf FILE_OUTPUT_NAME = "file.out";
	private Scanner sc;
	private PrintWritter pw;

	public GCJTemplate(){
		sc = new Scanner(new FileReader(FILE_LOC + FILE_INPUT_NAME));
		pw = new PrintWriter(new FileWriter(FILE_LOC + FILE_OUTPUT_NAME));
	}

	public static void main(String []args){
		GCJTemplate template = new GCJTemplate();
		template.preprocess();
		template.solve();
	}

	private void preprocess(){
		//placeholder used for preprocessing some data helpers/informations
	}

	private void solve(){
		//placeholder used for solving the problem
	}

}


text:
var React = require('react');
var copyProperties = require('react/lib/copyProperties');

function routeIsActive(activeRoutes, routeName) {
  return activeRoutes.some(function (route) {
    return route.props.name === routeName;
  });
}

function paramsAreActive(activeParams, params) {
  for (var property in params)
    if (String(activeParams[property]) !== String(params[property]))
      return false;

  return true;
}

function queryIsActive(activeQuery, query) {
  for (var property in query)
    if (String(activeQuery[property]) !== String(query[property]))
      return false;

  return true;
}

/**
 * A mixin for components that store the active state of routes, URL
 * parameters, and query.
 */
var ActiveContext = {

  propTypes: {
    initialActiveState: React.PropTypes.object
  },

  getDefaultProps: function () {
    return {
      initialActiveState: {}
    };
  },

  getInitialState: function () {
    var state = this.props.initialActiveState;

    return {
      activeRoutes: state.activeRoutes || [],
      activeParams: state.activeParams || {},
      activeQuery: state.activeQuery || {}
    };
  },

  /**
   * Returns a read-only array of the currently active routes.
   */
  getActiveRoutes: function () {
    return this.state.activeRoutes.slice(0);
  },

  /**
   * Returns a read-only object of the currently active URL parameters.
   */
  getActiveParams: function () {
    return copyProperties({}, this.state.activeParams);
  },

  /**
   * Returns a read-only object of the currently active query parameters.
   */
  getActiveQuery: function () {
    return copyProperties({}, this.state.activeQuery);
  },

  /**
   * Returns true if the route with the given name, URL parameters, and
   * query are all currently active.
   */
  isActive: function (routeName, params, query) {
    var isActive = routeIsActive(this.state.activeRoutes, routeName) &&
                   paramsAreActive(this.state.activeParams, params);

    if (query)
      return isActive && queryIsActive(this.state.activeQuery, query);

    return isActive;
  },

  childContextTypes: {
    activeRoutes: React.PropTypes.array.isRequired,
    activeParams: React.PropTypes.object.isRequired,
    activeQuery: React.PropTypes.object.isRequired,
    isActive: React.PropTypes.func.isRequired
  },

  getChildContext: function () {
    return {
      activeRoutes: this.getActiveRoutes(),
      activeParams: this.getActiveParams(),
      activeQuery: this.getActiveQuery(),
      isActive: this.isActive
    };
  }

};

module.exports = ActiveContext;


text:
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;

namespace System.Windows.Controls
{
    /// <summary>
    /// A static class providing methods for working with the visual tree.
    /// </summary>
    public static class VisualTreeExtensions
    {
        /// <summary>
        /// Retrieves all the visual children of a framework element.
        /// </summary>
        /// <param name="parent">The parent framework element.</param>
        /// <returns>The visual children of the framework element.</returns>
        public static IEnumerable<DependencyObject> GetVisualChildren(this DependencyObject parent)
        {
            Debug.Assert(parent != null, "The parent cannot be null.");

            int childCount = VisualTreeHelper.GetChildrenCount(parent);
            for (int counter = 0; counter < childCount; counter++)
            {
                yield return VisualTreeHelper.GetChild(parent, counter);
            }
        }

        public static IEnumerable<T> GetChildren<T>(this DependencyObject parent) where T : FrameworkElement
        {
            if (parent != null)
            {
                for (var i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
                {
                    var child = VisualTreeHelper.GetChild(parent, i);
                    if (child is T)
                    {
                        yield return (T)child;
                    }

                    foreach (T childOfChild in GetChildren<T>(child))
                    {
                        yield return childOfChild;
                    }
                }
            }
        }

        public static T GetVisualChild<T>(this UIElement parent) where T : UIElement
        {
            T child = null;
            for (var i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
            {
                var element = (UIElement)VisualTreeHelper.GetChild(parent, i);
                child = element as T;
                if (child == null)
                {
                    child = element.GetVisualChild<T>();
                }
                if (child != null)
                {
                    break;
                }
            }
            return child;
        }

        /// <summary>
        /// Retrieves all the logical children of a framework element using a
        /// breadth-first search.  A visual element is assumed to be a logical
        /// child of another visual element if they are in the same namescope.
        /// For performance reasons this method manually manages the queue
        /// instead of using recursion.
        /// </summary>
        /// <param name="parent">The parent framework element.</param>
        /// <returns>The logical children of the framework element.</returns>
        public static IEnumerable<FrameworkElement> GetLogicalChildrenBreadthFirst(this FrameworkElement parent)
        {
            Debug.Assert(parent != null, "The parent cannot be null.");

            Queue<FrameworkElement> queue =
                new Queue<FrameworkElement>(parent.GetVisualChildren().OfType<FrameworkElement>());

            while (queue.Count > 0)
            {
                FrameworkElement element = queue.Dequeue();
                yield return element;

                foreach (FrameworkElement visualChild in element.GetVisualChildren().OfType<FrameworkElement>())
                {
                    queue.Enqueue(visualChild);
                }
            }
        }

        /// <summary>
        /// Gets the ancestors of the element, up to the root, limiting the
        /// ancestors by FrameworkElement.
        /// </summary>
        /// <param name="node">The element to start from.</param>
        /// <returns>An enumerator of the ancestors.</returns>
        public static IEnumerable<FrameworkElement> GetVisualAncestors(this FrameworkElement node)
        {
            FrameworkElement parent = node.GetVisualParent();
            while (parent != null)
            {
                yield return parent;
                parent = parent.GetVisualParent();
            }
        }

        /// <summary>
        /// Gets the visual parent of the element.
        /// </summary>
        /// <param name="node">The element to check.</param>
        /// <returns>The visual parent.</returns>
        internal static FrameworkElement GetVisualParent(this FrameworkElement node)
        {
            return VisualTreeHelper.GetParent(node) as FrameworkElement;
        }

        /// <summary>
        /// The first parent of the framework element of the specified type
        /// that is found while traversing the visual tree upwards.
        /// </summary>
        /// <typeparam name="T">
        /// The element type of the dependency object.
        /// </typeparam>
        /// <param name="element">The dependency object element.</param>
        /// <returns>
        /// The first parent of the framework element of the specified type.
        /// </returns>
        public static T GetParentByType<T>(this DependencyObject element)
            where T : FrameworkElement
        {
            Debug.Assert(element != null, "The element cannot be null.");

            T result = null;
            DependencyObject parent = VisualTreeHelper.GetParent(element);

            while (parent != null)
            {
                result = parent as T;

                if (result != null)
                {
                    return result;
                }

                parent = VisualTreeHelper.GetParent(parent);
            }

            return null;
        }
    }
}


text:
package com.skyfire.hipda.lib.span;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.annotation.DrawableRes;
import android.text.style.ReplacementSpan;
import android.util.Log;

import java.lang.ref.WeakReference;

/**
 * Created by Neil
 */
public class SmileySpan extends ReplacementSpan {

  /**
   * A constant indicating that the bottom of this span should be aligned
   * with the bottom of the surrounding text, i.e., at the same level as the
   * lowest descender in the text.
   */
  public static final int ALIGN_BOTTOM = 0;

  /**
   * A constant indicating that the bottom of this span should be aligned
   * with the baseline of the surrounding text.
   */
  public static final int ALIGN_BASELINE = 1;

  protected final int mVerticalAlignment;

  private final int mSize;
  private int mResourceId;
  private Context mContext;
  private WeakReference<Drawable> mDrawableRef;

  public SmileySpan(Context context, @DrawableRes int resourceId, int size) {
    mContext = context;
    mResourceId = resourceId;
    mSize = (int) context.getResources().getDisplayMetrics().density * size;
    mVerticalAlignment = ALIGN_BOTTOM;
  }

  @Override
  public int getSize(Paint paint, CharSequence text,
                     int start, int end,
                     Paint.FontMetricsInt fm) {
    Drawable d = getCachedDrawable();

    Rect rect = d.getBounds();

    if (fm != null) {
      fm.ascent = -rect.bottom;
      fm.descent = 0;

      fm.top = fm.ascent;
      fm.bottom = 0;
    }

    return rect.right;
  }

  @Override
  public void draw(Canvas canvas, CharSequence text,
                   int start, int end, float x,
                   int top, int y, int bottom, Paint paint) {
    Drawable d = getCachedDrawable();
    canvas.save();

    int transY = bottom - d.getBounds().bottom;
    if (mVerticalAlignment == ALIGN_BASELINE) {
      transY -= paint.getFontMetricsInt().descent;
    }

    canvas.translate(x, transY);
    d.draw(canvas);
    canvas.restore();
  }

  private Drawable getCachedDrawable() {
    WeakReference<Drawable> wr = mDrawableRef;
    Drawable d = null;

    if (wr != null) {
      d = wr.get();
    }

    if (d == null) {
      d = getDrawable();
      mDrawableRef = new WeakReference<>(d);
    }

    return d;
  }

  public Drawable getDrawable() {
    Drawable drawable = null;
    try {
      drawable = mContext.getResources().getDrawable(mResourceId);
      drawable.setBounds(0, 0, mSize, mSize);
    } catch (Exception e) {
      Log.e("sms", "Unable to find resource: " + mResourceId);
    }
    return drawable;
  }

}


text:
layout: default
title: Work · DrupalCamp Ottawa
previous: uottawa/
class: drupalcamp
---

DrupalCamp

UX Design / UI Design / Responsive
Front End Development

Checkout DrupalCamp

DrupalCamp is an event for anyone using Drupal, or responsible for designing, building, developing, and supporting Drupal in any capacity. It's a place where designers, developers, and Drupal users can brush shoulders with Drupal service providers, hosting vendors, and other members of the broader open-source community to discuss and learn about Drupal.

Information Upfront

After talking with the board of directors, it was clear that in the past the event information wasn't available on the home page like it should be - it had been under the about section, or contact. This didn't make sense, since the main goal of the site is for users to attend the conference - we needed to showcase how to register, where the event would be, pricing and key features. This was accomplished by including all the conference information on the home page.

Google Maps

The design called for a full-width map, however I wanted to make sure that it was interactive and useful. Incorporating a custom Google Map, with custom styling and directions was something I had never done before - but after doing research and reading documentation it wasn't difficult to implement. I ended up using a really neat tool called Snazzy Maps, which is a repository of different color schemes for Google Maps aimed towards web designers and developers. After choosing one and customizing a few details, I went through the task of implementing it - making sure to turn off scrolling zoom on the map to avoid any issues for users scrolling past it on desktop.

Mobile Friendly Schedule

The schedule was one of the most important pages on the site, it is always the most accessed, and it was essential to ensure that it worked well on mobile devices. The design was stacked and straightforward to clearly indicate the time slots and concurrent sessions for each. The best part was seeing people continuously use this feature at the conference between breaks.

Outcomes

One Great Event

There were very few issues reported with the site, and the conference itself was a success - with the largest number of attendees to date. The saying, keep it simple, really hit home for me with this project. I definitely look forward to improving the site next year, by implementing a 'create your own schedule' feature for logged in users, and rejigging a few things throughout the site – such as adding animations to some of the existing graphics.

  {% if page.previous %}Previous {% endif %}
  {% if page.next%}Next {% endif %}


text:
#pragma once
#include "NyWMCaptureInterface.h"

class CNySample :public INySample
{
private:
	ULONG m_RefCount;
	void* m_data;
	INT32 m_data_size;

public:
	//IUnknown
	HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void** ppvObj);
	ULONG STDMETHODCALLTYPE AddRef(void);
	ULONG STDMETHODCALLTYPE Release(void);
public:
	//INySample
	void*  __RPC_FAR STDMETHODCALLTYPE GetData(void);
	INT32  STDMETHODCALLTYPE GetDataSize(void);
	HRESULT STDMETHODCALLTYPE CopyToBuffer(void __RPC_FAR *o_data,INT32 i_start,INT32 i_length);
public:
	CNySample(void);
	~CNySample(void);
	void SetParam(void  __RPC_FAR *i_data,INT32 i_length);
};


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

  angular
    .module('horizon.app.core.images')
    .factory('horizon.app.core.images.actions.edit.service', editService);

  editService.$inject = [
    '$q',
    'horizon.app.core.images.events',
    'horizon.app.core.images.resourceType',
    'horizon.app.core.images.actions.editWorkflow',
    'horizon.app.core.metadata.service',
    'horizon.app.core.openstack-service-api.glance',
    'horizon.app.core.openstack-service-api.policy',
    'horizon.framework.util.actions.action-result.service',
    'horizon.framework.util.q.extensions',
    'horizon.framework.widgets.modal.wizard-modal.service',
    'horizon.framework.widgets.toast.service'
  ];

  /**
   * @ngDoc factory
   * @name horizon.app.core.images.actions.editService
   * @Description A service to open the user wizard.
   */
  function editService(
    $q,
    events,
    imageResourceType,
    editWorkflow,
    metadataService,
    glance,
    policy,
    actionResultService,
    $qExtensions,
    wizardModalService,
    toast
  ) {
    var message = {
      success: gettext('Image %s was successfully updated.')
    };
    var modifyImagePolicyCheck, scope;

    var model = {
      image: {},
      metadata: {}
    };

    var service = {
      initScope: initScope,
      allowed: allowed,
      perform: perform
    };

    return service;

    //////////////

    function initScope($scope) {
      scope = $scope;
      $scope.$on(events.IMAGE_METADATA_CHANGED, onMetadataChange);
      modifyImagePolicyCheck = policy.ifAllowed({rules: [['image', 'modify_image']]});
    }

    function allowed(image) {
      return $q.all([
        modifyImagePolicyCheck,
        isActive(image)
      ]);
    }

    function perform(image) {
      var deferred = glance.getImage(image.id);
      deferred.then(onLoad);
      scope.imagePromise = deferred;

      function onLoad(response) {
        var localImage = response.data;
        model.image = localImage;
      }

      return wizardModalService.modal({
        scope: scope,
        workflow: editWorkflow,
        submit: submit
      }).result;
    }

    function onMetadataChange(e, metadata) {
      model.metadata = metadata;
      e.stopPropagation();
    }

    function submit() {
      return updateMetadata().then(updateImage, onUpdateImageFail);
    }

    function updateImage() {
      var finalModel = model.image;
      return glance.updateImage(finalModel).then(onUpdateImageSuccess, onUpdateImageFail);
    }

    function onUpdateImageSuccess() {
      toast.add('success', interpolate(message.success, [model.image.name]));
      return actionResultService.getActionResult()
        .updated(imageResourceType, model.image.id)
        .result;
    }

    function onUpdateImageFail() {
      return actionResultService.getActionResult()
        .failed(imageResourceType, model.image.id)
        .result;
    }

    function updateMetadata() {

      return metadataService
        .getMetadata('image', model.image.id)
        .then(onMetadataGet);

      function onMetadataGet(response) {
        var updated = model.metadata;
        var removed = angular.copy(response.data);
        angular.forEach(updated, function(value, key) {
          delete removed[key];
        });

        return metadataService
          .editMetadata('image', model.image.id, updated, Object.keys(removed));
      }
    }

    function isActive(image) {
      return $qExtensions.booleanAsPromise(image.status === 'active');
    }

  } // end of editService
})(); // end of IIFE