text:
.class public Lcom/android/settings/accessibility/AccessibilityServiceWarning;
.super Ljava/lang/Object;
.source "AccessibilityServiceWarning.java"

# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static createCapabilitiesDialog(Landroid/app/Activity;Landroid/accessibilityservice/AccessibilityServiceInfo;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/Dialog;
    .locals 6

    new-instance v4, Landroid/app/AlertDialog$Builder;

    invoke-direct {v4, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    invoke-static {p0, p1}, Lcom/android/settings/accessibility/AccessibilityServiceWarning;->createEnableDialogContentView(Landroid/content/Context;Landroid/accessibilityservice/AccessibilityServiceInfo;)Landroid/view/View;

    move-result-object v5

    invoke-virtual {v4, v5}, Landroid/app/AlertDialog$Builder;->setView(Landroid/view/View;)Landroid/app/AlertDialog$Builder;

    move-result-object v4

    const/4 v5, 0x1

    invoke-virtual {v4, v5}, Landroid/app/AlertDialog$Builder;->setCancelable(Z)Landroid/app/AlertDialog$Builder;

    move-result-object v4

    const v5, 0x104000a

    invoke-virtual {v4, v5, p2}, Landroid/app/AlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v4

    const/high16 v5, 0x1040000

    invoke-virtual {v4, v5, p2}, Landroid/app/AlertDialog$Builder;->setNegativeButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v4

    invoke-virtual {v4}, Landroid/app/AlertDialog$Builder;->create()Landroid/app/AlertDialog;

    move-result-object v0

    new-instance v1, Lcom/android/settings/accessibility/-$Lambda$NLUyUmzllqLPrhjOog7Y9C6JMVo;

    invoke-direct {v1}, Lcom/android/settings/accessibility/-$Lambda$NLUyUmzllqLPrhjOog7Y9C6JMVo;-><init>()V

    invoke-virtual {v0}, Landroid/app/AlertDialog;->getWindow()Landroid/view/Window;

    move-result-object v3

    invoke-virtual {v3}, Landroid/view/Window;->getAttributes()Landroid/view/WindowManager$LayoutParams;

    move-result-object v2

    iget v4, v2, Landroid/view/WindowManager$LayoutParams;->privateFlags:I

    const/high16 v5, 0x80000

    or-int/2addr v4, v5

    iput v4, v2, Landroid/view/WindowManager$LayoutParams;->privateFlags:I

    invoke-virtual {v3, v2}, Landroid/view/Window;->setAttributes(Landroid/view/WindowManager$LayoutParams;)V

    invoke-virtual {v0}, Landroid/app/AlertDialog;->create()V

    const/4 v4, -0x1

    invoke-virtual {v0, v4}, Landroid/app/AlertDialog;->getButton(I)Landroid/widget/Button;

    move-result-object v4

    invoke-virtual {v4, v1}, Landroid/widget/Button;->setOnTouchListener(Landroid/view/View$OnTouchListener;)V

    return-object v0
.end method

.method private static createEnableDialogContentView(Landroid/content/Context;Landroid/accessibilityservice/AccessibilityServiceInfo;)Landroid/view/View;
    .locals 20

    const-string/jumbo v17, "layout_inflater"

    move-object/from16 v0, p0

    move-object/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v14

    check-cast v14, Landroid/view/LayoutInflater;

    const v17, 0x7f0d00f6

    const/16 v18, 0x0

    move/from16 v0, v17

    move-object/from16 v1, v18

    invoke-virtual {v14, v0, v1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v9

    const/16 v17, 0x0

    move/from16 v0, v17

    invoke-virtual {v9, v0}, Landroid/view/View;->setFocusable(Z)V

    const v17, 0x7f0a02cd

    move/from16 v0, v17

    invoke-virtual {v9, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v11

    check-cast v11, Landroid/widget/TextView;

    invoke-static {}, Lcom/android/settings/accessibility/AccessibilityServiceWarning;->isFullDiskEncrypted()Z

    move-result v17

    if-eqz v17, :cond_0

    const/16 v17, 0x1

    move/from16 v0, v17

    new-array v0, v0, [Ljava/lang/Object;

    move-object/from16 v17, v0

    invoke-static/range {p0 .. p1}, Lcom/android/settings/accessibility/AccessibilityServiceWarning;->getServiceName(Landroid/content/Context;Landroid/accessibilityservice/AccessibilityServiceInfo;)Ljava/lang/CharSequence;

    move-result-object v18

    const/16 v19, 0x0

    aput-object v18, v17, v19

    const v18, 0x7f120920

    move-object/from16 v0, p0

    move/from16 v1, v18

    move-object/from16 v2, v17

    invoke-virtual {v0, v1, v2}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v16

    move-object/from16 v0, v16

    invoke-virtual {v11, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    const/16 v17, 0x0

    move/from16 v0, v17

    invoke-virtual {v11, v0}, Landroid/widget/TextView;->setVisibility(I)V

    :goto_0
    const v17, 0x7f0a0152

    move/from16 v0, v17

    invoke-virtual {v9, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/TextView;

    const/16 v17, 0x1

    move/from16 v0, v17

    new-array v0, v0, [Ljava/lang/Object;

    move-object/from16 v17, v0

    invoke-static/range {p0 .. p1}, Lcom/android/settings/accessibility/AccessibilityServiceWarning;->getServiceName(Landroid/content/Context;Landroid/accessibilityservice/AccessibilityServiceInfo;)Ljava/lang/CharSequence;

    move-result-object v18

    const/16 v19, 0x0

    aput-object v18, v17, v19

    const v18, 0x7f120557

    move-object/from16 v0, p0

    move/from16 v1, v18

    move-object/from16 v2, v17

    invoke-virtual {v0, v1, v2}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v17

    move-object/from16 v0, v17

    invoke-virtual {v4, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    const v17, 0x7f0a0151

    move/from16 v0, v17

    invoke-virtual {v9, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v5

    check-cast v5, Landroid/widget/LinearLayout;

    const v17, 0x1090039

    const/16 v18, 0x0

    move/from16 v0, v17

    move-object/from16 v1, v18

    invoke-virtual {v14, v0, v1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v8

    const v17, 0x10203e9

    move/from16 v0, v17

    invoke-virtual {v8, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v13

    check-cast v13, Landroid/widget/ImageView;

    const v17, 0x1080501

    move-object/from16 v0, p0

    move/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/content/Context;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v17

    move-object/from16 v0, v17

    invoke-virtual {v13, v0}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    const v17, 0x10203ee

    move/from16 v0, v17

    invoke-virtual {v8, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v15

    check-cast v15, Landroid/widget/TextView;

    const/16 v17, 0x1

    move-object/from16 v0, p0

    move/from16 v1, v17

    invoke-static {v0, v15, v1}, Lcom/android/settings/accessibility/AccessibilityServiceWarning;->setCapabilitiesText(Landroid/content/Context;Landroid/widget/TextView;Z)V

    const v17, 0x7f12055a

    move-object/from16 v0, p0

    move/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v17

    move-object/from16 v0, v17

    invoke-virtual {v15, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    const v17, 0x10203f0

    move/from16 v0, v17

    invoke-virtual {v8, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v10

    check-cast v10, Landroid/widget/TextView;

    const/16 v17, 0x0

    move-object/from16 v0, p0

    move/from16 v1, v17

    invoke-static {v0, v10, v1}, Lcom/android/settings/accessibility/AccessibilityServiceWarning;->setCapabilitiesText(Landroid/content/Context;Landroid/widget/TextView;Z)V

    invoke-virtual/range {p1 .. p1}, Landroid/accessibilityservice/AccessibilityServiceInfo;->getResolveInfo()Landroid/content/pm/ResolveInfo;

    move-result-object v17

    invoke-virtual/range {p0 .. p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v18

    invoke-virtual/range {v17 .. v18}, Landroid/content/pm/ResolveInfo;->loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence;

    move-result-object v17

    const v18, 0x7f120818

    move-object/from16 v0, p0

    move/from16 v1, v18

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v18

    invoke-virtual/range {v17 .. v18}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v17

    if-eqz v17, :cond_1

    const v17, 0x7f120559

    move-object/from16 v0, p0

    move/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v17

    move-object/from16 v0, v17

    invoke-virtual {v10, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    :goto_1
    move-object/from16 v0, p1

    move-object/from16 v1, p0

    invoke-virtual {v0, v1}, Landroid/accessibilityservice/AccessibilityServiceInfo;->getCapabilityInfos(Landroid/content/Context;)Ljava/util/List;

    move-result-object v3

    invoke-virtual {v5, v8}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    invoke-interface {v3}, Ljava/util/List;->size()I

    move-result v7

    const/4 v12, 0x0

    :goto_2
    if-ge v12, v7, :cond_2

    invoke-interface {v3, v12}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Landroid/accessibilityservice/AccessibilityServiceInfo$CapabilityInfo;

    const v17, 0x1090039

    const/16 v18, 0x0

    move/from16 v0, v17

    move-object/from16 v1, v18

    invoke-virtual {v14, v0, v1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v8

    const v17, 0x10203e9

    move/from16 v0, v17

    invoke-virtual {v8, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v13

    check-cast v13, Landroid/widget/ImageView;

    const v17, 0x1080501

    move-object/from16 v0, p0

    move/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/content/Context;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v17

    move-object/from16 v0, v17

    invoke-virtual {v13, v0}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    const v17, 0x10203ee

    move/from16 v0, v17

    invoke-virtual {v8, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v15

    check-cast v15, Landroid/widget/TextView;

    iget v0, v6, Landroid/accessibilityservice/AccessibilityServiceInfo$CapabilityInfo;->titleResId:I

    move/from16 v17, v0

    move-object/from16 v0, p0

    move/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v17

    move-object/from16 v0, v17

    invoke-virtual {v15, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    const v17, 0x10203f0

    move/from16 v0, v17

    invoke-virtual {v8, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v10

    check-cast v10, Landroid/widget/TextView;

    const/16 v17, 0x1

    move-object/from16 v0, p0

    move/from16 v1, v17

    invoke-static {v0, v15, v1}, Lcom/android/settings/accessibility/AccessibilityServiceWarning;->setCapabilitiesText(Landroid/content/Context;Landroid/widget/TextView;Z)V

    const/16 v17, 0x0

    move-object/from16 v0, p0

    move/from16 v1, v17

    invoke-static {v0, v10, v1}, Lcom/android/settings/accessibility/AccessibilityServiceWarning;->setCapabilitiesText(Landroid/content/Context;Landroid/widget/TextView;Z)V

    iget v0, v6, Landroid/accessibilityservice/AccessibilityServiceInfo$CapabilityInfo;->descResId:I

    move/from16 v17, v0

    move-object/from16 v0, p0

    move/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v17

    move-object/from16 v0, v17

    invoke-virtual {v10, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    invoke-virtual {v5, v8}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    add-int/lit8 v12, v12, 0x1

    goto :goto_2

    :cond_0
    const/16 v17, 0x8

    move/from16 v0, v17

    invoke-virtual {v11, v0}, Landroid/widget/TextView;->setVisibility(I)V

    goto/16 :goto_0

    :cond_1
    const v17, 0x7f120558

    move-object/from16 v0, p0

    move/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v17

    move-object/from16 v0, v17

    invoke-virtual {v10, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto/16 :goto_1

    :cond_2
    return-object v9
.end method

.method private static getServiceName(Landroid/content/Context;Landroid/accessibilityservice/AccessibilityServiceInfo;)Ljava/lang/CharSequence;
    .locals 4

    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/res/Configuration;->getLocales()Landroid/os/LocaleList;

    move-result-object v2

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Landroid/os/LocaleList;->get(I)Ljava/util/Locale;

    move-result-object v1

    invoke-virtual {p1}, Landroid/accessibilityservice/AccessibilityServiceInfo;->getResolveInfo()Landroid/content/pm/ResolveInfo;

    move-result-object v2

    invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/content/pm/ResolveInfo;->loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence;

    move-result-object v0

    const-string/jumbo v2, "com.samsung.android.universalswitch"

    invoke-virtual {p1}, Landroid/accessibilityservice/AccessibilityServiceInfo;->getResolveInfo()Landroid/content/pm/ResolveInfo;

    move-result-object v3

    iget-object v3, v3, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    iget-object v3, v3, Landroid/content/pm/ServiceInfo;->packageName:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-static {}, Lcom/android/settings/Utils;->isJapanModel()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-static {v1}, Landroid/text/BidiFormatter;->getInstance(Ljava/util/Locale;)Landroid/text/BidiFormatter;

    move-result-object v2

    const v3, 0x7f120090

    invoke-virtual {p0, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/text/BidiFormatter;->unicodeWrap(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    return-object v2

    :cond_0
    invoke-static {v1}, Landroid/text/BidiFormatter;->getInstance(Ljava/util/Locale;)Landroid/text/BidiFormatter;

    move-result-object v2

    const v3, 0x7f12008f

    invoke-virtual {p0, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/text/BidiFormatter;->unicodeWrap(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    return-object v2

    :cond_1
    invoke-static {v1}, Landroid/text/BidiFormatter;->getInstance(Ljava/util/Locale;)Landroid/text/BidiFormatter;

    move-result-object v2

    invoke-virtual {v2, v0}, Landroid/text/BidiFormatter;->unicodeWrap(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;

    move-result-object v2

    return-object v2
.end method

.method private static isFullDiskEncrypted()Z
    .locals 1

    invoke-static {}, Landroid/os/storage/StorageManager;->isNonDefaultBlockEncrypted()Z

    move-result v0

    return v0
.end method

.method static synthetic lambda$-com_android_settings_accessibility_AccessibilityServiceWarning_2551(Landroid/view/View;Landroid/view/MotionEvent;)Z
    .locals 4

    const/4 v3, 0x1

    const/4 v2, 0x0

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getFlags()I

    move-result v0

    and-int/lit8 v0, v0, 0x2

    if-eqz v0, :cond_1

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v0

    if-ne v0, v3, :cond_0

    invoke-virtual {p0}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v0

    const v1, 0x7f121ba9

    invoke-static {v0, v1, v2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    :cond_0
    return v3

    :cond_1
    return v2
.end method

.method private static setCapabilitiesText(Landroid/content/Context;Landroid/widget/TextView;Z)V
    .locals 4

    const/4 v3, 0x0

    if-eqz p2, :cond_0

    const-string/jumbo v2, "sec-roboto-light"

    const/4 v3, 0x1

    invoke-static {v2, v3}, Landroid/graphics/Typeface;->create(Ljava/lang/String;I)Landroid/graphics/Typeface;

    move-result-object v1

    :goto_0
    :try_start_0
    invoke-virtual {p1, v1}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V

    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    const v3, 0x7f0600e3

    invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getColor(I)I

    move-result v2

    invoke-virtual {p1, v2}, Landroid/widget/TextView;->setTextColor(I)V

    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    const v3, 0x7f07013d

    invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result v2

    int-to-float v2, v2

    const/4 v3, 0x0

    invoke-virtual {p1, v3, v2}, Landroid/widget/TextView;->setTextSize(IF)V
    :try_end_0
    .catch Landroid/content/res/Resources$NotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_1
    return-void

    :cond_0
    const-string/jumbo v2, "sec-roboto-light"

    invoke-static {v2, v3}, Landroid/graphics/Typeface;->create(Ljava/lang/String;I)Landroid/graphics/Typeface;

    move-result-object v1

    goto :goto_0

    :catch_0
    move-exception v0

    goto :goto_1
.end method


text:
personfinder
============

Fork of googlepersonfinder at https://code.google.com/p/googlepersonfinder/

redpajama_set_name: RedPajamaGithub


text:
wget -O - 'http://www.skype.com/go/getskype-linux-beta-ubuntu-64' > /tmp/skype.deb
sudo dpkg --install /tmp/skype.deb
sudo apt-get --assume-yes install -f


text:
Laravel 5
====

Перевод документации Laravel - [http://laravel.su/docs](http://laravel.su/docs)

## Соглашения о формате

В начале каждого файла должна быть конструкция вида

	git a49894e56c3ac8b837ba7d8687d94f6010cb1808

	---

где `a49894e56c3ac8b837ba7d8687d94f6010cb1808` - полный номер коммита в официальной англоязычной документации, последнего актуального на момент редактирования для данного файла.

## Инструкция по переводу

[http://laravel.su/articles/rus-documentation-contribution-guide](http://laravel.su/articles/rus-documentation-contribution-guide)


text:
"""
    Copyright (C) 2014  Navin Ariyaratna (navinnda@yahoo.com)

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""

__author__ = 'Navin'

import sys
import urlparse
import urllib
import xbmc
import xbmcgui
import xbmcplugin
import channel

base_url = sys.argv[0]
addon_handle = int(sys.argv[1])
args = urlparse.parse_qs(sys.argv[2][1:])

xbmcplugin.setContent(addon_handle, 'videos')
mode = args.get('mode', None)

def addDirectory(folderName, url, thumbnailImage=None, isFolder=True, iconImage='DefaultFolder.png',
                 handle=addon_handle):
    if thumbnailImage is None:
        li = xbmcgui.ListItem(folderName, iconImage)
    else:
        li = xbmcgui.ListItem(folderName, iconImage, thumbnailImage=thumbnailImage)
    xbmcplugin.addDirectoryItem(handle=handle, url=url, listitem=li, isFolder=isFolder)

def build_url(query):
    return base_url + '?' + urllib.urlencode(query)
    # xbmc.executebuiltin('Notification(%s, %s)'%(channelName, element))

def displayProgramme(channelName, mode, elements, folderNameIndex=1, directoryNameIndex=0):
    for element in elements:
        url = build_url({'mode': mode, 'foldername': element[folderNameIndex], 'channel': channelName})
        addDirectory(element[directoryNameIndex], url)
    xbmcplugin.endOfDirectory(addon_handle)

def displayCategory(channelName, mode, elements):
    for element in elements:
        url = build_url({'mode': mode, 'foldername': element, 'channel': channelName})
        addDirectory(element, url)
    xbmcplugin.endOfDirectory(addon_handle)

def displayVideo(channelName, mode, elements, folderNameIndex=1, directoryNameIndex=0, thumbnailImgIndex=2):
    for element in elements:
        url = build_url({'mode': mode, 'foldername': element[folderNameIndex], 'channel': channelName})
        addDirectory(element[directoryNameIndex], url, element[thumbnailImgIndex])
    xbmcplugin.endOfDirectory(addon_handle)

def getChannelInstance(channelName):
    channelObj = getattr(channel, channelName)()
    return channelObj

if mode is None:
    for channelName in channel.getChannels():
        url = build_url({'mode': 'categories', 'foldername': channelName, 'channel': channelName})
        addDirectory(folderName=channelName, url=url, handle=addon_handle)
    xbmcplugin.endOfDirectory(addon_handle)
else:
    channelName = args.get('channel')[0]
    channelObj = getChannelInstance(channelName)
    selection = args.get('foldername')[0]
    if mode[0] == 'categories':
        categories = channelObj.getCategories()
        displayCategory(channelName, 'programmes', categories)
    elif mode[0] == 'programmes':
        programmes = channelObj.getProgrammes(selection)
        displayProgramme(channelName, 'episodes', programmes)
    elif mode[0] == 'episodes':
        episodes = channelObj.getEpisodes(selection)
        displayVideo(channelName, 'playVideo', episodes)
    elif mode[0] == 'playVideo':
        video = channelObj.getVideo(selection)
        if xbmc.Player().isPlayingVideo() == False:
            xbmc.Player().play(video)


text:
from rest_framework import serializers
from onadata.apps.logger.models.attachment import Attachment
from onadata.libs.utils.decorators import check_obj
from onadata.libs.utils.image_tools import image_url
import json

def dict_key_for_value(_dict, value):
    """
    This function is used to get key by value in a dictionary
    """
    return _dict.keys()[_dict.values().index(value)]

def get_path(data, question_name, path_list=[]):
    name = data.get('name')
    if name == question_name:
        return '/'.join(path_list)
    elif data.get('children') is not None:
        for node in data.get('children'):
            path_list.append(node.get('name'))
            path = get_path(node, question_name, path_list)
            if path is not None:
                return path
            else:
                del path_list[len(path_list) - 1]
    return None

class AttachmentSerializer(serializers.ModelSerializer):
    url = serializers.HyperlinkedIdentityField(view_name='attachment-detail',
                                               lookup_field='pk')
    field_xpath = serializers.SerializerMethodField('get_field_xpath')
    download_url = serializers.SerializerMethodField('get_download_url')
    small_download_url = serializers.SerializerMethodField(
        'get_small_download_url')
    medium_download_url = serializers.SerializerMethodField(
        'get_medium_download_url')
    xform = serializers.Field(source='instance.xform.pk')
    instance = serializers.Field(source='instance.pk')
    filename = serializers.Field(source='media_file.name')

    class Meta:
        fields = ('url', 'filename', 'mimetype', 'field_xpath', 'id', 'xform',
                  'instance', 'download_url', 'small_download_url',
                  'medium_download_url')
        lookup_field = 'pk'
        model = Attachment

    @check_obj
    def get_download_url(self, obj):
        return obj.media_file.url if obj.media_file.url else None

    def get_small_download_url(self, obj):
        if obj.mimetype.startswith('image'):
            return image_url(obj, 'small')

    def get_medium_download_url(self, obj):
        if obj.mimetype.startswith('image'):
            return image_url(obj, 'medium')

    def get_field_xpath(self, obj):
        qa_dict = obj.instance.get_dict()
        if obj.filename not in qa_dict.values():
            return None

        question_name = dict_key_for_value(qa_dict, obj.filename)
        data = json.loads(obj.instance.xform.json)

        return get_path(data, question_name)


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <ImageView
        android:id="@+id/profileImageView"
        android:layout_width="200dp"
        android:layout_height="200dp"
        android:layout_gravity="center"
        android:layout_marginTop="40dp" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="40dp"
        android:gravity="center"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="right"
            android:orientation="horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Level : "
                android:textSize="25dp" />

            <TextView
                android:id="@+id/level"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Gold"
                android:textSize="25dp" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="right"
            android:orientation="horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Email : "
                android:textSize="25dp" />

            <TextView
                android:id="@+id/email"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Bang"
                android:textSize="25dp" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="right"
            android:orientation="horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Point : "
                android:textSize="25dp" />

            <TextView
                android:id="@+id/point"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Point"
                android:textSize="25dp" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="right"
            android:orientation="horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Name : "
                android:textSize="25dp" />

            <TextView
                android:id="@+id/name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Name"
                android:textSize="25dp" />
        </LinearLayout>
    </LinearLayout>
</LinearLayout>


text:
if [ "$(uname)" == "Darwin" ]; then
    export DOTNET_INSTALL_DIR="$PWD/.dotnetsdk"
    export CLI_VERSION="2.0.0"
    curl -sSL https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh | bash /dev/stdin --version "$CLI_VERSION" --install-dir "$DOTNET_INSTALL_DIR"
    export PATH="$DOTNET_INSTALL_DIR:$PATH"
    #https://download.microsoft.com/download/1/B/4/1B4DE605-8378-47A5-B01B-2C79D6C55519/dotnet-sdk-2.0.0-osx-x64.tar.gz
else
    curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
    sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
    sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
    sudo apt-get update
    sudo apt-get install dotnet-sdk-2.0.0
fi

dotnet restore

if [ -z ${MONO_BUILD+x} ]; then
    # Build with dotnet
    dotnet build Grpc.Tools.MsBuild.sln -v normal
else
    # Build with Mono
    msbuild
fi


text:
Escribe un programa que pida un valor numérico y muestre su [valor absoluto](https://es.wikipedia.org/wiki/Valor_absoluto).

El programa no terminará hasta que el usuario escriba el valor `0`.


text:
- Comprises of core Java applications developed using Java SE7.
- Java coding standards followed


text:
package com.github.commons.message.server;

import com.github.commons.message.MessageChannel;
import com.github.commons.message.server.template.ResolvedEnvelop;

/**
 * Created by Yang Tengfei on 4/23/15.
 */
public interface IMessageSender {
    MessageChannel getMessageChannel();

    boolean send(ResolvedEnvelop envelop);
}


text:
import requests
import json
from bs4 import BeautifulSoup
import logging.config
from django.conf import settings

logging.config.dictConfig(settings.LOGGING)

def login(userid, password):
    """
    login success -> return an instance of requests.Session()
    login fail -> return None
    """
    logger = logging.getLogger('backend')
    with requests.session() as s:
        data = {
            'si_id': userid,
            'si_pwd': password
        }
        res = s.post('https://sso.snu.ac.kr/safeidentity/modules/auth_idpwd', data=data)
        soup = BeautifulSoup(res.text, 'html5lib')
        try:
            data = {i['name']: i['value'] for i in soup.find('form').find_all('input')}
        except AttributeError:
            logger.error('Fail to login mySNU: Invalid password')
            return None
        res = s.post('https://sso.snu.ac.kr/nls3/fcs', data=data)
        soup = BeautifulSoup(res.text, 'html5lib')
        fonts = soup.find_all('font')
        if len(fonts) == 2:
            res_code = fonts[1].text.strip()
            if res_code == '5402':
                logger.error('Fail to login mySNU: Id does not exist')
                return None
            elif res_code != '2800':
                logger.error('Fail to login mySNU: Unexpected page code')
                return None

        s.get('https://shine.snu.ac.kr/com/ssoLoginForSWAction.action')
        return s

def crawl_taken_list(userid, password):
    """return list of taken subject"""
    session = login(userid, password)
    if session is None:
        return None
    with session as s:
        url = 'https://shine.snu.ac.kr/uni/uni/scor/mrtr/findTabCumlMrksYyShtmClsfTtInq02.action'
        params = {'cscLocale': 'ko_KR', 'strPgmCd': 'S030302'}
        headers = {'Content-Type': 'application/extJs+sua; charset=UTF-8'}
        payload = {
            "SUN": {
                "strSchyy": "2015",
                "strShtmFg": "U000200001",
                "strDetaShtmFg": "U000300001",
                "strBdegrSystemFg": "U000100001",
                "strFlag": "all"
            }
        }
        grade_response = s.post(url, params=params, headers=headers, data=json.dumps(payload))
        grade_response.raise_for_status()
        grade_list = grade_response.json()['GRD_SCOR401']

        semester_name = {
            'U000200001U000300001': '1',
            'U000200001U000300002': 'S',
            'U000200002U000300001': '2',
            'U000200002U000300002': 'W',
        }

        def refine(raw):
            return {
                'year': int(raw['schyy']),
                'semester': semester_name[raw['shtmFg'] + raw['detaShtmFg']],
                'code': raw['sbjtCd'],
                'number': raw['ltNo'],
                'title': raw['sbjtNm'],
                'credit': raw['acqPnt'],
                'grade': raw['mrksGrdCd'],
                'category': raw['cptnSubmattFgCdNm']
            }

    return [refine(raw) for raw in grade_list]

def crawl_major(userid, password):
    """return list of major: [{name, type}..]"""
    session = login(userid, password)
    if session is None:
        return None
    with session as s:
        url = 'https://shine.snu.ac.kr/uni/uni/port/stup/findMyMjInfo.action'
        params = {'cscLocale': 'ko_KR', 'strPgmCd': 'S010101'}
        headers = {'Content-Type': 'application/extJs+sua; charset=UTF-8'}
        res = s.post(url, params=params, headers=headers)
    raw_data = res.json()['GRD_SREG524']
    renamed_data = [{
        'name': raw['deptNm'],
        'type': raw['mjFgNm']
    } for raw in raw_data]
    return renamed_data

def crawl_replace_course(userid, password):
    """return list of replace info: [{from_code, to_code}..]"""
    session = login(userid, password)
    if session is None:
        return None
    with session as s:
        same_url = 'https://shine.snu.ac.kr/uni/uni/cour/curr/findSameSubstSbjtInqStd.action'
        replace_url = 'https://shine.snu.ac.kr/uni/uni/cour/curr/findSameSubstSbjtInqStdList.action'
        params = {'cscLocale': 'ko_KR', 'strPgmCd': 'S030205'}
        headers = {'Content-Type': 'application/extJs+sua; charset=UTF-8'}
        payload = {
            "SNU": {
                "strSameSubstGrpFg": "",
                "rowStatus": "insert",
                "strDetaBussCd": "A0071",
                "strSchyy": "2016",
                "strShtmFg": "U000200002",
                "strDetaShtmFg": "U000300002",
                "strShtmDetaShtmFg": "U000200002U000300002",
                "strBdegrSystemFg": "U000100001",
                "strSbjtCd": "",
                "strSbjtNm": ""
            }
        }
        same_res = s.post(same_url, params=params, headers=headers, data=json.dumps(payload))
        same_courses = same_res.json()['GRD_COUR102']
        sames = [{'code': c['sbjtCd'], 'group': c['sameSubstGrpNo']} for c in same_courses]

        replaces = []
        group_by = {}
        for same in sames:
            if same['group'] in group_by:
                group_by[same['group']].append(same['code'])
            else:
                group_by[same['group']] = [same['code']]

        for _, v in group_by.items():
            num = len(v)
            for i in range(num):
                for j in range(i):
                    replaces.append({'from_code': v[i], 'to_code': v[j]})

        replace_res = s.post(replace_url, params=params, headers=headers, data=json.dumps(payload))
        replace_courses = replace_res.json()['GRD_COUR102']
        replaces.extend([{'from_code': c['sbjtCd'], 'to_code': c['substSbjtCd']} for c in replace_courses])
    return replaces


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Numerics;
using System.Linq;
using GlmSharp.Swizzle;

// ReSharper disable InconsistentNaming

namespace GlmSharp
{
    /// <summary>
    /// Static class that contains static glm functions
    /// </summary>
    public static partial class glm
    {

        /// <summary>
        /// Returns an array with all values
        /// </summary>
        public static Half[] Values(hquat q) => q.Values;

        /// <summary>
        /// Returns an enumerator that iterates through all components.
        /// </summary>
        public static IEnumerator<Half> GetEnumerator(hquat q) => q.GetEnumerator();

        /// <summary>
        /// Returns a string representation of this quaternion using ', ' as a seperator.
        /// </summary>
        public static string ToString(hquat q) => q.ToString();

        /// <summary>
        /// Returns a string representation of this quaternion using a provided seperator.
        /// </summary>
        public static string ToString(hquat q, string sep) => q.ToString(sep);

        /// <summary>
        /// Returns a string representation of this quaternion using a provided seperator and a format provider for each component.
        /// </summary>
        public static string ToString(hquat q, string sep, IFormatProvider provider) => q.ToString(sep, provider);

        /// <summary>
        /// Returns a string representation of this quaternion using a provided seperator and a format for each component.
        /// </summary>
        public static string ToString(hquat q, string sep, string format) => q.ToString(sep, format);

        /// <summary>
        /// Returns a string representation of this quaternion using a provided seperator and a format and format provider for each component.
        /// </summary>
        public static string ToString(hquat q, string sep, string format, IFormatProvider provider) => q.ToString(sep, format, provider);

        /// <summary>
        /// Returns the number of components (4).
        /// </summary>
        public static int Count(hquat q) => q.Count;

        /// <summary>
        /// Returns true iff this equals rhs component-wise.
        /// </summary>
        public static bool Equals(hquat q, hquat rhs) => q.Equals(rhs);

        /// <summary>
        /// Returns true iff this equals rhs type- and component-wise.
        /// </summary>
        public static bool Equals(hquat q, object obj) => q.Equals(obj);

        /// <summary>
        /// Returns a hash code for this instance.
        /// </summary>
        public static int GetHashCode(hquat q) => q.GetHashCode();

        /// <summary>
        /// Returns a bvec4 from component-wise application of IsInfinity (Half.IsInfinity(v)).
        /// </summary>
        public static bvec4 IsInfinity(hquat v) => hquat.IsInfinity(v);

        /// <summary>
        /// Returns a bvec4 from component-wise application of IsFinite (!Half.IsNaN(v) && !Half.IsInfinity(v)).
        /// </summary>
        public static bvec4 IsFinite(hquat v) => hquat.IsFinite(v);

        /// <summary>
        /// Returns a bvec4 from component-wise application of IsNaN (Half.IsNaN(v)).
        /// </summary>
        public static bvec4 IsNaN(hquat v) => hquat.IsNaN(v);

        /// <summary>
        /// Returns a bvec4 from component-wise application of IsNegativeInfinity (Half.IsNegativeInfinity(v)).
        /// </summary>
        public static bvec4 IsNegativeInfinity(hquat v) => hquat.IsNegativeInfinity(v);

        /// <summary>
        /// Returns a bvec4 from component-wise application of IsPositiveInfinity (Half.IsPositiveInfinity(v)).
        /// </summary>
        public static bvec4 IsPositiveInfinity(hquat v) => hquat.IsPositiveInfinity(v);

        /// <summary>
        /// Returns a bvec4 from component-wise application of Equal (lhs == rhs).
        /// </summary>
        public static bvec4 Equal(hquat lhs, hquat rhs) => hquat.Equal(lhs, rhs);

        /// <summary>
        /// Returns a bvec4 from component-wise application of NotEqual (lhs != rhs).
        /// </summary>
        public static bvec4 NotEqual(hquat lhs, hquat rhs) => hquat.NotEqual(lhs, rhs);

        /// <summary>
        /// Returns a bvec4 from component-wise application of GreaterThan (lhs > rhs).
        /// </summary>
        public static bvec4 GreaterThan(hquat lhs, hquat rhs) => hquat.GreaterThan(lhs, rhs);

        /// <summary>
        /// Returns a bvec4 from component-wise application of GreaterThanEqual (lhs >= rhs).
        /// </summary>
        public static bvec4 GreaterThanEqual(hquat lhs, hquat rhs) => hquat.GreaterThanEqual(lhs, rhs);

        /// <summary>
        /// Returns a bvec4 from component-wise application of LesserThan (lhs < rhs).
        /// </summary>
        public static bvec4 LesserThan(hquat lhs, hquat rhs) => hquat.LesserThan(lhs, rhs);

        /// <summary>
        /// Returns a bvec4 from component-wise application of LesserThanEqual (lhs <= rhs).
        /// </summary>
        public static bvec4 LesserThanEqual(hquat lhs, hquat rhs) => hquat.LesserThanEqual(lhs, rhs);

        /// <summary>
        /// Returns the inner product (dot product, scalar product) of the two quaternions.
        /// </summary>
        public static Half Dot(hquat lhs, hquat rhs) => hquat.Dot(lhs, rhs);

        /// <summary>
        /// Returns the euclidean length of this quaternion.
        /// </summary>
        public static float Length(hquat q) => q.Length;

        /// <summary>
        /// Returns the squared euclidean length of this quaternion.
        /// </summary>
        public static Half LengthSqr(hquat q) => q.LengthSqr;

        /// <summary>
        /// Returns a copy of this quaternion with length one (undefined if this has zero length).
        /// </summary>
        public static hquat Normalized(hquat q) => q.Normalized;

        /// <summary>
        /// Returns a copy of this quaternion with length one (returns zero if length is zero).
        /// </summary>
        public static hquat NormalizedSafe(hquat q) => q.NormalizedSafe;

        /// <summary>
        /// Returns the represented angle of this quaternion.
        /// </summary>
        public static double Angle(hquat q) => q.Angle;

        /// <summary>
        /// Returns the represented axis of this quaternion.
        /// </summary>
        public static hvec3 Axis(hquat q) => q.Axis;

        /// <summary>
        /// Returns the represented yaw angle of this quaternion.
        /// </summary>
        public static double Yaw(hquat q) => q.Yaw;

        /// <summary>
        /// Returns the represented pitch angle of this quaternion.
        /// </summary>
        public static double Pitch(hquat q) => q.Pitch;

        /// <summary>
        /// Returns the represented roll angle of this quaternion.
        /// </summary>
        public static double Roll(hquat q) => q.Roll;

        /// <summary>
        /// Returns the represented euler angles (pitch, yaw, roll) of this quaternion.
        /// </summary>
        public static dvec3 EulerAngles(hquat q) => q.EulerAngles;

        /// <summary>
        /// Rotates this quaternion from an axis and an angle (in radians).
        /// </summary>
        public static hquat Rotated(hquat q, Half angle, hvec3 v) => q.Rotated(angle, v);

        /// <summary>
        /// Creates a hmat3 that realizes the rotation of this quaternion
        /// </summary>
        public static hmat3 ToMat3(hquat q) => q.ToMat3;

        /// <summary>
        /// Creates a hmat4 that realizes the rotation of this quaternion
        /// </summary>
        public static hmat4 ToMat4(hquat q) => q.ToMat4;

        /// <summary>
        /// Returns the conjugated quaternion
        /// </summary>
        public static hquat Conjugate(hquat q) => q.Conjugate;

        /// <summary>
        /// Returns the inverse quaternion
        /// </summary>
        public static hquat Inverse(hquat q) => q.Inverse;

        /// <summary>
        /// Returns the cross product between two quaternions.
        /// </summary>
        public static hquat Cross(hquat q1, hquat q2) => hquat.Cross(q1, q2);

        /// <summary>
        /// Calculates a proper spherical interpolation between two quaternions (only works for normalized quaternions).
        /// </summary>
        public static hquat Mix(hquat x, hquat y, Half a) => hquat.Mix(x, y, a);

        /// <summary>
        /// Calculates a proper spherical interpolation between two quaternions (only works for normalized quaternions).
        /// </summary>
        public static hquat SLerp(hquat x, hquat y, Half a) => hquat.SLerp(x, y, a);

        /// <summary>
        /// Applies squad interpolation of these quaternions
        /// </summary>
        public static hquat Squad(hquat q1, hquat q2, hquat s1, hquat s2, Half h) => hquat.Squad(q1, q2, s1, s2, h);

        /// <summary>
        /// Returns a hquat from component-wise application of Lerp (min * (1-a) + max * a).
        /// </summary>
        public static hquat Lerp(hquat min, hquat max, hquat a) => hquat.Lerp(min, max, a);

    }
}


text:
package com.anjlab.eclipse.tapestry5;

import org.eclipse.jdt.core.ISourceRange;

public class Member
{

    private String name;
    private ISourceRange nameRange;
    private String javadoc;

    private LazyValue<String> javadocValue;

    private TapestryComponentSpecification specification;

    public TapestryComponentSpecification getSpecification()
    {
        return specification;
    }

    public void setSpecification(TapestryComponentSpecification specification)
    {
        this.specification = specification;
    }

    public String getName()
    {
        return name;
    }

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

    public String getJavadoc()
    {
        if (javadoc == null && javadocValue != null)
        {
            javadoc = javadocValue.get();
        }
        return javadoc;
    }

    public void setJavadoc(String javadoc)
    {
        this.javadoc = javadoc;
    }

    public void setJavadocValue(LazyValue<String> javadocValue)
    {
        this.javadocValue = javadocValue;
    }

    public ISourceRange getNameRange()
    {
        return nameRange;
    }

    public void setNameRange(ISourceRange nameRange)
    {
        this.nameRange = nameRange;
    }
}


text:
An ICraftingRecipe is a furnace table recipe the way ZS sees it.

## 导入类

It might be required to [import](/AdvancedFunctions/Import/) the class to avoid errors.
`import crafttweaker.recipes.IFurnaceRecipe`

## ZenMethods/Getters

### To String

```zenscript
rec.commandString;
rec.toCommandString();
```

### Other getters

```zenscript
rec.input;
rec.output;
rec.xp;
```


text: tinyMCE.addI18n('nl.advhr_dlg',{size:"Hoogte",noshade:"Geen schaduw",width:"Breedte"});


text:
package cz.jaybee.stackusage.mapfile;

import cz.jaybee.stackusage.callgraph.FunctionVertex;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Manipulating of gcc *.map file
 *
 * @author Jan Breuer
 */
public final class MapFileGCC extends MapFile {

    private enum Section {

        Undefined(""),
        ArchiveMemberIncludedBecauseOfFile("Archive member included because of file"),
        AllocatingCommonSymbols("Allocating common symbols"),
        DiscardedInputSections("Discarded input sections"),
        MemoryConfiguration("Memory Configuration"),
        LinkerScriptAndMemoryMap("Linker script and memory map");
        private String pattern;

        private Section(String pattern) {
            this.pattern = pattern;
        }

        public String getPattern() {
            return pattern;
        }
    }

    public MapFileGCC() {
        super();
    }

    @Override
    public void load(File file) {

        boolean newSection = false;
        Section section = Section.Undefined;

        Pattern p = Pattern.compile("^ *\\.text\\.([^ ]*) *[^ ]* *[^ ]* *(.*).o$");

        try (BufferedReader br = new BufferedReader(new FileReader(file))) {
            String line;
            while ((line = br.readLine()) != null) {

                for (Section s : Section.values()) {
                    if (s == Section.Undefined) {
                        continue;
                    }
                    if (line.startsWith(s.getPattern())) {
                        section = s;
                        newSection = true;
                        break;
                    }
                }
                if (newSection) {
                    newSection = false;
                    continue;
                }

                switch (section) {
                    case DiscardedInputSections:
                        if (line.contains(".text.")) {
                            if (!line.contains("0x00000000")) {
                                line += br.readLine();
                            }
                            Matcher m = p.matcher(line);
                            if (m.find()) {
                                FunctionVertex fn = new FunctionVertex(m.group(2), m.group(1));
                                fn.file = fn.file.substring(fn.file.lastIndexOf('\\') + 1) + ".c";

                                addDiscardedFunction(fn);
                            }
                        }
                        break;
                    default:

                }
            }
        } catch (IOException ex) {
            Logger.getLogger(MapFileGCC.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}


text:
package akka.persistence.jdbc.query.journal.javadsl

import akka.NotUsed
import akka.stream.javadsl.Source
import akka.persistence.query.EventEnvelope
import akka.persistence.query.javadsl._

trait CurrentEventsByPersistenceIdAndTagQuery extends ReadJournal {
  /**
   * Query events that have a specific persistenceId/tag combination
   */
  def currentEventsByPersistenceIdAndTag(persistenceId: String, tag: String, offset: Long): Source[EventEnvelope, NotUsed]
}


text:
require 'spec_helper'

describe 'Levelup::Requests::ListOrders' do
  before do
    @test_list_orders_request = Levelup::Requests::ListOrders.new
  end

  describe '#auth_type' do
    it 'returns :merchant_v14' do
      @test_list_orders_request.auth_type.should eq(:merchant_v14)
    end
  end
end


text:
package com.rampatra.base;

import java.util.Arrays;

/**
 * A HEAP is a specialized tree-based ABSTRACT DATA TYPE that satisfies the heap property:
 * min-heap: All non-leaf elements are either smaller than or equal to their left and right child.
 * max-heap: All non-leaf elements are either greater than or equal to their left and right child.
 *

 * Often implemented as an array, where the children of the element at index i are at index
 * 2i+1 (left child) and 2i+2 (right child).
 *

 * The first element (minimum or maximum, depending on chosen order) can be found in O(1).
 * Each successor can be found in O(log n). The algorithm in minHeapify() takes O(log n) time
 * Therefore, buildMinHeap() would take O(n log n) time BUT IF OBSERVED CAREFULLY IT TAKES 0(N) TIME.
 *

 * Used in the HeapSort algorithm. Also can be used to implement a PriorityQueue.
 * Learn more
 *
 * @author rampatra
 * @since 8/2/15
 */
public class MinHeap {

    private int[] heap;
    private int size;

    public MinHeap(int[] heap) {
        this.size = heap.length;
        this.heap = Arrays.copyOf(heap, size);
    }

    /**
     * Makes the array {@param a} satisfy the min heap property starting from
     * {@param index} till the end of array.
     *

     * Time complexity: O(log n).
     *
     * @param index
     */
    public void minHeapify(int index) {
        int minIndex = index;
        int leftIndex = 2 * index + 1;
        int rightIndex = 2 * index + 2;

        if (leftIndex < size && heap[index] > heap[leftIndex]) {
            minIndex = leftIndex;
        }
        if (rightIndex < size && heap[minIndex] > heap[rightIndex]) {
            minIndex = rightIndex;
        }

        if (minIndex != index) {
            swap(index, minIndex);
            minHeapify(minIndex);
        }
    }

    /**
     * Converts array {@param a} in to a min heap.
     *

     * Time complexity: O(n) and is not O(n log n).
     */
    public void buildMinHeap() {
        for (int i = size / 2 - 1; i >= 0; i--) {
            minHeapify(i);
        }
    }

    public void insert(int elem) {
        heap = Arrays.copyOf(heap, size + 1);
        int i = size;
        int parentIndex = (int) Math.floor((i - 1) / 2);
        while (i > 0 && elem < heap[parentIndex]) {
            heap[i] = heap[parentIndex];
            i = parentIndex;
            parentIndex = (int) Math.floor((i - 1) / 2);
        }
        heap[i] = elem;
        size++;
    }

    public int findMin() {
        if (size == 0) {
            return -1;
        } else {
            return heap[0];
        }
    }

    public int extractMin() {
        if (size == 0) return -1;

        int min = heap[0];
        heap[0] = heap[size - 1];
        size--;
        minHeapify(0);
        return min;
    }

    public int getSize() {
        return size;
    }

    public int[] getHeap() {
        return heap;
    }

    public void printHeap() {
        if (heap == null)
            System.out.print("null");
        int iMax = size - 1, i;
        if (iMax == -1)
            System.out.print("[]");

        StringBuilder b = new StringBuilder();
        b.append('[');
        for (i = 0; i < iMax; i++) {
            b.append(heap[i]);
            b.append(", ");
        }
        System.out.println(b.append(heap[i]).append(']').toString());
    }

    private void swap(int firstIndex, int secondIndex) {
        int temp = heap[firstIndex];
        heap[firstIndex] = heap[secondIndex];
        heap[secondIndex] = temp;
    }

    // test cases
    public static void main(String[] args) {
        int[] a = new int[]{2, 4, 5, 1, 6, 7, 8};
        MinHeap minHeap = new MinHeap(a);
        minHeap.printHeap();
        minHeap.buildMinHeap();
        minHeap.printHeap();
        minHeap.extractMin();
        minHeap.printHeap();
        minHeap.insert(0);
        minHeap.printHeap();
    }
}


text:
<?php

namespace Cekurte\Environment\Exception;

use Cekurte\Environment\Exception\Exception;

class FilterException extends Exception
{

}


text:
var optPayRequest = require("./OptPayRequest");
var constants = require("./Constants.js");
var HEALTH_BEAT_URL = 'customervault/monitor';
var URI = 'customer/v1';
var PROFILE_PATH = '/profiles/';
var ADDRESS_PATH = '/addresses/';
var CARD_PATH = '/cards/';
/**
 * @author Atul.Patil method for initialization of constructor
 *         CustomerServiceHandler.
 */
var CustomerServiceHandler = function(optimalApiClient) {
	this._optimalApiClient = optimalApiClient;
};

var prepareURI = function(path, optClient) {
	return URI + path;
};
/**
 * @author Atul.Patil method for monitor customer api
 */
CustomerServiceHandler.prototype.monitor = function(responseCallBack) {
	try {
		var clientObj = this._optimalApiClient;
		var requestObj = new optPayRequest(HEALTH_BEAT_URL, constants.GET);
		clientObj.processRequest(requestObj, null, responseCallBack);
	} catch (err) {
		if (typeof (responseCallBack) === "function") {
			responseCallBack(err, null);
		}
	}
};
/**
 * @author Atul.Patil method for Create Profile.
 */
CustomerServiceHandler.prototype.createCustmerProfile = function(profile,
		responseCallBack) {
	try {
		var clientObj = this._optimalApiClient;
		if (typeof (responseCallBack) === "function") {
			var optPayReqObj = new optPayRequest(prepareURI(PROFILE_PATH, clientObj),
					constants.POST);
			clientObj.processRequest(optPayReqObj, profile,
					function(error, response) {
						response = response ? new clientObj.Profiles(response) : response;
						responseCallBack(error, response);
					});
		} else {
			console.error("Please provide the responseCallBack function "
					+ "in CustomerServiceHandler : createCustmerProfile");
		}
	} catch (err) {
		responseCallBack(err, null);
	}
};
/**
 * @author Atul.Patil method for get profile details.
 */
CustomerServiceHandler.prototype.getCustmerProfile = function(profile,
		responseCallBack) {
	try {
		var clientObj = this._optimalApiClient;
		if (typeof (responseCallBack) === "function") {
			if (profile && profile.id) {
				var optPayReqObj = new optPayRequest(prepareURI(PROFILE_PATH
						+ profile.id, clientObj), constants.GET);
				clientObj.processRequest(optPayReqObj, null, function(error, response) {
					response = response ? new clientObj.Profiles(response) : response;
					responseCallBack(error, response);
				});
			} else {
				throw clientObj.error(400,
						"InvalidRequestException : profile id is missing "
								+ "in CustomerServiceHandler : getCustmerProfile");
			}
		} else {
			console.error("Please provide the responseCallBack function"
					+ " in CustomerServiceHandler : getCustmerProfile");
		}
	} catch (err) {
		responseCallBack(err, null);
	}
};
/**
 * @author Atul.Patil method for delete profile.
 */
CustomerServiceHandler.prototype.deleteCustmerProfile = function(profile,
		responseCallBack) {
	try {
		var clientObj = this._optimalApiClient;
		if (typeof (responseCallBack) === "function") {
			if (profile && profile.id) {
				var requestObj = new optPayRequest(prepareURI(
						PROFILE_PATH + profile.id, clientObj), constants.DELETE);
				clientObj.processRequest(requestObj, null, function(error, response) {
					response = response ? new clientObj.Profiles(response) : response;
					responseCallBack(error, response);
				});
			} else {
				throw clientObj.error(400,
						"InvalidRequestException : profile id is missing"
								+ " in CustomerServiceHandler : deleteCustmerProfile");
			}
		} else {
			console.error("Please provide the responseCallBack function"
					+ " in CustomerServiceHandler : deleteCustmerProfile");
		}
	} catch (err) {
		responseCallBack(err, null);
	}
};
/**
 * @author Atul.Patil method for update a profile.
 */
CustomerServiceHandler.prototype.updateCustmerProfile = function(profile,
		responseCallBack) {
	try {
		var clientObj = this._optimalApiClient;
		if (typeof (responseCallBack) === "function") {
			if (profile && profile.id) {
				var requestObj = new optPayRequest(prepareURI(
						PROFILE_PATH + profile.id, clientObj), constants.PUT);
				clientObj
						.processRequest(requestObj, profile,
								function(error, response) {
									response = response ? new clientObj.Profiles(response)
											: response;
									responseCallBack(error, response);
								});
			} else {
				throw clientObj.error(400,
						"InvalidRequestException : profile id is missing "
								+ "in CustomerServiceHandler : updateCustmerProfile");
			}
		} else {
			console.error("Please provide the responseCallBack function"
					+ " in CustomerServiceHandler : updateCustmerProfile");
		}
	} catch (err) {
		responseCallBack(err, null);
	}
};
/**
 * @author Atul.Patil method for create an address.
 */
CustomerServiceHandler.prototype.createCustmerAddress = function(address,
		responseCallBack) {
	try {
		var clientObj = this._optimalApiClient;
		if (typeof (responseCallBack) === "function") {
			if (address && address.profile && address.profile.id) {
				var profile = address.profile;
				delete address.profile;
				var requestObj = new optPayRequest(prepareURI(PROFILE_PATH + profile.id
						+ ADDRESS_PATH, clientObj), constants.POST);
				clientObj.processRequest(requestObj, address,
						function(error, response) {
							response = response ? new clientObj.Address(response) : response;
							responseCallBack(error, response);
						});
			} else {
				throw clientObj.error(400,
						"InvalidRequestException : profile id is missing "
								+ "in CustomerServiceHandler : createCustmerAddress");
			}
		} else {
			console.error("Please provide the responseCallBack"
					+ " in function CustomerServiceHandler : createCustmerAddress");
		}
	} catch (err) {
		responseCallBack(err, null);
	}
};
/**
 * @author Atul.Patil method for get an address.
 */
CustomerServiceHandler.prototype.getCustmerAddress = function(address,
		responseCallBack) {
	try {
		var clientObj = this._optimalApiClient;
		if (typeof (responseCallBack) === "function") {
			if (address && address.profile && address.profile.id) {
				var profile = address.profile;
				delete address.profile;
				var requestObj = new optPayRequest(prepareURI(PROFILE_PATH + profile.id
						+ ADDRESS_PATH + address.id, clientObj), constants.GET);
				clientObj.processRequest(requestObj, null, function(error, response) {
					response = response ? new clientObj.Address(response) : response;
					responseCallBack(error, response);
				});
			} else {
				throw clientObj.error(400,
						"InvalidRequestException : profile id is missing "
								+ "in CustomerServiceHandler : getCustmerAddress");
			}
		} else {
			console.error("Please provide the responseCallBack function"
					+ " in CustomerServiceHandler : getCustmerAddress");
		}
	} catch (err) {
		responseCallBack(err, null);
	}
};
/**
 * @author Atul.Patil method for delete an address.
 */
CustomerServiceHandler.prototype.deleteCustmerAddress = function(address,
		responseCallBack) {
	try {
		var clientObj = this._optimalApiClient;
		if (typeof (responseCallBack) === "function") {
			if (address && address.profile && address.profile.id) {
				var profile = address.profile;
				if (address && address.id) {
					delete address.profile;
					var requestObj = new optPayRequest(prepareURI(PROFILE_PATH
							+ profile.id + ADDRESS_PATH + address.id, clientObj),
							constants.DELETE);
					clientObj.processRequest(requestObj, null, function(error, response) {
						response = response ? new clientObj.Address(response) : response;
						responseCallBack(error, response);
					});
				} else {
					throw clientObj.error(400,
							"InvalidRequestException : address id is missing "
									+ " in CustomerServiceHandler : deleteCustmerAddress");
				}
			} else {
				throw clientObj.error(400,
						"InvalidRequestException : profile id is missing"
								+ " in CustomerServiceHandler : deleteCustmerAddress");
			}
		} else {
			console.error("Please provide the responseCallBack function "
					+ "in CustomerServiceHandler : deleteCustmerAddress");
		}
	} catch (err) {
		responseCallBack(err, null);
	}
};
/**
 * @author Atul.Patil method for update an address.
 */
CustomerServiceHandler.prototype.updateCustmerAddress = function(address,
		responseCallBack) {
	try {
		var clientObj = this._optimalApiClient;
		if (typeof (responseCallBack) === "function") {
			if (address && address.profile && address.profile.id) {
				var profile = address.profile;
				if (address && address.id) {
					delete address.profile;
					var requestObj = new optPayRequest(prepareURI(PROFILE_PATH
							+ profile.id + ADDRESS_PATH + address.id, clientObj),
							constants.PUT);
					clientObj.processRequest(requestObj, address, function(error,
							response) {
						response = response ? new clientObj.Address(response) : response;
						responseCallBack(error, response);
					});
				} else {
					throw clientObj.error(400,
							"InvalidRequestException : address id is missing "
									+ "in CustomerServiceHandler : updateCustmerAddress");
				}
			} else {
				throw clientObj.error(400,
						"InvalidRequestException : profile id is missing "
								+ "in CustomerServiceHandler : updateCustmerAddress");
			}
		} else {
			console.error("Please provide the responseCallBack function"
					+ " in CustomerServiceHandler : updateCustmerAddress");
		}
	} catch (err) {
		responseCallBack(err, null);
	}
};
/**
 * @author Atul.Patil method for looking profile details using subcomponents
 *         address and card.
 */
CustomerServiceHandler.prototype.lookUpProfileBySubComponent = function(
		responseCallBack, profile, inAddress, inCards) {
	try {
		var clientObj = this._optimalApiClient;
		if (typeof (responseCallBack) === "function") {
			if (profile && profile.id) {
				var toInclude = "";
				if (inAddress) {
					toInclude = "addresses";
				}
				if (inCards) {
					if (toInclude.length > 0) {
						toInclude += ",";
						toInclude += "cards";
					} else {
						toInclude = "cards";
					}
				}
				var requestObj = new optPayRequest(prepareURI(PROFILE_PATH + profile.id
						+ "?" + "fields=" + toInclude, clientObj), constants.GET);
				clientObj.processRequest(requestObj, null, function(error, response) {
					response = response ? new clientObj.Profiles(response) : response;
					responseCallBack(error, response);
				});
			} else {
				throw clientObj.error(400,
						"InvalidRequestException : profile id is missing"
								+ " in CustomerServiceHandler : lookUpProfileBySubComponent");
			}
		} else {
			console.error("Please provide the responseCallBack function"
					+ " in CustomerServiceHandler : lookUpProfileBySubComponent");
		}
	} catch (err) {
		responseCallBack(err, null);
	}
};
/**
 * @author Atul.Patil method for create a card.
 */
CustomerServiceHandler.prototype.createCustmerCard = function(card,
		responseCallBack) {
	try {
		var clientObj = this._optimalApiClient;
		if (typeof (responseCallBack) === "function") {
			if (card && card.profile && card.profile.id) {
				var profile = card.profile;
				delete card.profile;
				var requestObj = new optPayRequest(prepareURI(PROFILE_PATH + profile.id
						+ CARD_PATH, clientObj), constants.POST);
				clientObj.processRequest(requestObj, card, function(error, response) {
					response = response ? new clientObj.Card(response) : response;
					responseCallBack(error, response);
				});
			} else {
				throw clientObj.error(400,
						"InvalidRequestException : profile id is missing "
								+ "in CustomerServiceHandler : createCustmerCard");
			}
		} else {
			console.error("Please provide the responseCallBack function "
					+ "in CustomerServiceHandler : createCustmerCard");
		}
	} catch (err) {
		responseCallBack(err, null);
	}
};
/**
 * @author Atul.Patil method for get a card details.
 */
CustomerServiceHandler.prototype.getCustmerCard = function(card,
		responseCallBack) {
	try {
		var clientObj = this._optimalApiClient;
		if (typeof (responseCallBack) === "function") {
			if (card && card.profile && card.profile.id) {
				var profile = card.profile;
				if (card && card.id) {
					delete card.profile;
					var requestObj = new optPayRequest(prepareURI(PROFILE_PATH
							+ profile.id + CARD_PATH + card.id, clientObj), constants.GET);
					clientObj.processRequest(requestObj, null, function(error, response) {
						response = response ? new clientObj.Card(response) : response;
						responseCallBack(error, response);
					});
				} else {
					throw clientObj.error(400,
							"InvalidRequestException : card id is missing "
									+ "in CustomerServiceHandler : getCustmerCard");
				}
			} else {
				throw clientObj.error(400,
						"InvalidRequestException : profile id is missing "
								+ "in CustomerServiceHandler : getCustmerCard");
			}
		} else {
			console.error("Please provide the responseCallBack function "
					+ "in CustomerServiceHandler : getCustmerCard");
		}
	} catch (err) {
		responseCallBack(err, null);
	}
};
/**
 * @author Atul.Patil method for delete a card.
 */
CustomerServiceHandler.prototype.deleteCustmerCard = function(card,
		responseCallBack) {
	try {
		var clientObj = this._optimalApiClient;
		if (typeof (responseCallBack) === "function") {
			if (card && card.profile && card.profile.id) {
				var profile = card.profile;
				if (card && card.id) {
					delete card.profile;
					var requestObj = new optPayRequest(prepareURI(PROFILE_PATH
							+ profile.id + CARD_PATH + card.id, clientObj), constants.DELETE);
					clientObj.processRequest(requestObj, null, function(error, response) {
						response = response ? new clientObj.Card(response) : response;
						responseCallBack(error, response);
					});
				} else {
					throw clientObj.error(400,
							"InvalidRequestException : card id is missing "
									+ "in CustomerServiceHandler : deleteCustmerCard");
				}
			} else {
				throw clientObj.error(400,
						"InvalidRequestException : profile id is missing"
								+ " in CustomerServiceHandler : deleteCustmerCard");
			}
		} else {
			console.error("Please provide the responseCallBack function "
					+ "in CustomerServiceHandler : deleteCustmerCard");
		}
	} catch (err) {
		responseCallBack(err, null);
	}
};
/**
 * @author Atul.Patil method for update a card.
 */
CustomerServiceHandler.prototype.updateCustmerCard = function(card,
		responseCallBack) {
	try {
		var clientObj = this._optimalApiClient;
		if (typeof (responseCallBack) === "function") {
			if (card && card.profile && card.profile.id) {
				var profile = card.profile;
				if (card && card.id) {
					delete card.profile;
					var requestObj = new optPayRequest(prepareURI(PROFILE_PATH
							+ profile.id + CARD_PATH + card.id, clientObj), constants.PUT);
					clientObj.processRequest(requestObj, card, function(error, response) {
						response = response ? new clientObj.Card(response) : response;
						responseCallBack(error, response);
					});
				} else {
					throw clientObj.error(400,
							"InvalidRequestException : card id is missing "
									+ "in CustomerServiceHandler : updateCustmerCard");
				}
			} else {
				throw clientObj.error(400,
						"InvalidRequestException : profile id is missing "
								+ "in CustomerServiceHandler : updateCustmerCard");
			}
		} else {
			console.error("Please provide the responseCallBack function "
					+ "in CustomerServiceHandler : updateCustmerCard");
		}
	} catch (err) {
		responseCallBack(err, null);
	}
};

module.exports = CustomerServiceHandler;


text:
package org.more.webui.freemarker.loader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;
import java.net.URLClassLoader;
import org.more.webui.resource.ClassPathResourceLoader;
import org.more.webui.resource.IResourceLoader;
/**
* 处理Classpath中的模板。
* @version : 2011-9-14
* @author 赵永春 (zyc@byshell.org)
*/
public class ClassPathTemplateLoader extends URLClassLoader implements ITemplateLoader, IResourceLoader {
    private String                  packageName    = null;
    private ClassPathResourceLoader resourceLoader = null;
    //
    public ClassPathTemplateLoader() {
        this("", Thread.currentThread().getContextClassLoader());
    }
    public ClassPathTemplateLoader(String packageName) {
        this(packageName, Thread.currentThread().getContextClassLoader());
    }
    public ClassPathTemplateLoader(String packageName, ClassLoader parent) {
        super(new URL[0], parent);
        this.packageName = (packageName == null) ? "" : packageName;
        this.packageName = this.packageName.replace(".", "/");
        if (this.packageName.length() > 0)
            if (this.packageName.charAt(0) == '/')
                this.packageName = this.packageName.substring(1);
        this.resourceLoader = new ClassPathResourceLoader(this.packageName, this);
    }
    public String getType() {
        return this.getClass().getSimpleName();
    }
    public Object findTemplateSource(String name) throws IOException {
        StringBuffer $name = new StringBuffer(this.packageName);
        if (name.charAt(0) != '/')
            $name.append("/");
        $name.append(name);
        if ($name.charAt(0) == '/')
            $name = $name.deleteCharAt(0);
        return this.getResource($name.toString());
    }
    public long getLastModified(Object templateSource) {
        URL url = (URL) templateSource;
        if (url.getProtocol().equals("file") == true)
            return new File(url.getFile()).lastModified();
        return 0;
    }
    public Reader getReader(Object templateSource, String encoding) throws IOException {
        URL url = (URL) templateSource;
        InputStream in = url.openStream();
        if (encoding == null)
            return new InputStreamReader(in);
        else
            return new InputStreamReader(in, encoding);
    }
    public void closeTemplateSource(Object templateSource) throws IOException {}
    public void resetState() {}
    public InputStream getResourceAsStream(String name) {
        return this.resourceLoader.getResourceAsStream(name);
    }
}


text:
<?php
abstract class myDoctrineRecord extends sfDoctrineRecord
{

}


text:
<!DOCTYPE html>
<meta charset=utf-8>
<title>invalid formaction: scheme-ftp-no-slash</title>
<input type=submit formaction="ftp:example.com/">


text:
body {
  font-family:"Ubuntu,Tahoma,sans-serif";
  max-width: 900px;
  margin: 0 auto !important;
  float: none !important;
}

#toc_header {
  font-size:20px;
  font-weight:bold;
}

th {
  background-color:#E0E0E0;
  border-bottom:1px solid black;
  border-right:1px solid black;
  padding:5px;
}

td {
  border-bottom:1px dotted black;
  border-right:1px dotted black;
  padding:5px;
}

tr:nth-child(even) {
    background-color: #EFEFEF;
}

table {
  border-collapse:collapse;
  border: 1px solid black;
}

table tr:hover {
  background-color: #ffff99;
}


text:
//
// Generated By:JAX-WS RI IBM 2.1.1 in JDK 6 (JAXB RI IBM JAXB 2.1.3 in JDK 1.6)
//

package org.apache.axis2.jaxws.sample.asyncdoclit.server;

import javax.xml.ws.WebFault;
import org.test.asyncdoclit.ThrowExceptionFaultBean;

@WebFault(name = "throwExceptionFaultBean", targetNamespace = "http://org/test/asyncdoclit")
public class ThrowExceptionFault
    extends Exception
{

    /**
     * Java type that goes as soapenv:Fault detail element.
     *
     */
    private ThrowExceptionFaultBean faultInfo;

    /**
     *
     * @param faultInfo
     * @param message
     */
    public ThrowExceptionFault(String message, ThrowExceptionFaultBean faultInfo) {
        super(message);
        this.faultInfo = faultInfo;
    }

    /**
     *
     * @param faultInfo
     * @param message
     * @param cause
     */
    public ThrowExceptionFault(String message, ThrowExceptionFaultBean faultInfo, Throwable cause) {
        super(message, cause);
        this.faultInfo = faultInfo;
    }

    /**
     *
     * @return
     *     returns fault bean: org.test.asyncdoclit.ThrowExceptionFaultBean
     */
    public ThrowExceptionFaultBean getFaultInfo() {
        return faultInfo;
    }

}


text:
require "trello_standup/command/base"
# config trello project related setting
class TrelloStandup::Command::Config < TrelloStandup::Command::Base
  def initialize(args)
  end
end


text:
package org.locationtech.geowave.core.index;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

/** * Defines a unit interval on a number line */
public class ByteArrayRange implements Comparable<ByteArrayRange> {
  protected byte[] start;
  protected byte[] end;
  protected boolean singleValue;

  /**
   * *
   *
   * @param start start of unit interval
   * @param end end of unit interval
   */
  public ByteArrayRange(final byte[] start, final byte[] end) {
    this(start, end, false);
  }

  /**
   * *
   *
   * @param start start of unit interval
   * @param end end of unit interval
   */
  public ByteArrayRange(final byte[] start, final byte[] end, final boolean singleValue) {
    this.start = start;
    this.end = end;
    this.singleValue = singleValue;
  }

  public byte[] getStart() {
    return start;
  }

  public byte[] getEnd() {
    return end;
  }

  public byte[] getStartAsPreviousPrefix() {
    if (start == null) {
      return null;
    }
    return ByteArrayUtils.getPreviousPrefix(start);
  }

  public byte[] getEndAsNextPrefix() {
    if (end == null) {
      return null;
    }
    return ByteArrayUtils.getNextPrefix(end);
  }

  public boolean isSingleValue() {
    return singleValue;
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = (prime * result) + ((end == null) ? 0 : Arrays.hashCode(end));
    result = (prime * result) + (singleValue ? 1231 : 1237);
    result = (prime * result) + ((start == null) ? 0 : Arrays.hashCode(start));
    return result;
  }

  @Override
  public boolean equals(final Object obj) {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    final ByteArrayRange other = (ByteArrayRange) obj;
    if (end == null) {
      if (other.end != null) {
        return false;
      }
    } else if (!Arrays.equals(end, other.end)) {
      return false;
    }
    if (singleValue != other.singleValue) {
      return false;
    }
    if (start == null) {
      if (other.start != null) {
        return false;
      }
    } else if (!Arrays.equals(start, other.start)) {
      return false;
    }
    return true;
  }

  public boolean intersects(final ByteArrayRange other) {
    if (isSingleValue()) {
      if (other.isSingleValue()) {
        return Arrays.equals(getStart(), other.getStart());
      }
      return false;
    }
    return ((ByteArrayUtils.compare(getStart(), other.getEndAsNextPrefix()) < 0)
        && (ByteArrayUtils.compare(getEndAsNextPrefix(), other.getStart()) > 0));
  }

  public ByteArrayRange intersection(final ByteArrayRange other) {
    return new ByteArrayRange(
        ByteArrayUtils.compare(start, other.start) <= 0 ? other.start : start,
        ByteArrayUtils.compare(getEndAsNextPrefix(), other.getEndAsNextPrefix()) >= 0 ? other.end
            : end);
  }

  public ByteArrayRange union(final ByteArrayRange other) {
    return new ByteArrayRange(
        ByteArrayUtils.compare(start, other.start) <= 0 ? start : other.start,
        ByteArrayUtils.compare(getEndAsNextPrefix(), other.getEndAsNextPrefix()) >= 0 ? end
            : other.end);
  }

  @Override
  public int compareTo(final ByteArrayRange other) {
    final int diff = ByteArrayUtils.compare(getStart(), other.getStart());
    return diff != 0 ? diff
        : ByteArrayUtils.compare(getEndAsNextPrefix(), other.getEndAsNextPrefix());
  }

  public static enum MergeOperation {
    UNION, INTERSECTION
  }

  public static final Collection<ByteArrayRange> mergeIntersections(
      final Collection<ByteArrayRange> ranges,
      final MergeOperation op) {
    final List<ByteArrayRange> rangeList = new ArrayList<>(ranges);
    // sort order so the first range can consume following ranges
    Collections.<ByteArrayRange>sort(rangeList);
    final List<ByteArrayRange> result = new ArrayList<>();
    for (int i = 0; i < rangeList.size();) {
      ByteArrayRange r1 = rangeList.get(i);
      int j = i + 1;
      for (; j < rangeList.size(); j++) {
        final ByteArrayRange r2 = rangeList.get(j);
        if (r1.intersects(r2)) {
          if (op.equals(MergeOperation.UNION)) {
            r1 = r1.union(r2);
          } else {
            r1 = r1.intersection(r2);
          }
        } else {
          break;
        }
      }
      i = j;
      result.add(r1);
    }
    return result;
  }
}


text:
class WidgetType
  def initialize(value)
    @code = value.to_s
  end
  attr_reader :code

  def title
    I18n.t(@code, :scope => [:widgets, :type, :title])
  end

  define_enum do |builder|
    builder.member :default, :object => new("default")
    builder.member :text, :object => new("text")
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="add">Hinzufügen</string>
    <string name="app_name">DRI log</string>
    <string name="author">Autor</string>
    <string name="author_avatar">Avatar des Autors</string>
    <string name="choose_date">Datum wählen</string>
    <string name="comment">Kommentar</string>
    <string name="date">Datum</string>
    <string name="irc_nick">IRC Nickname</string>
    <string name="loading">Lade Daten herunter</string>
    <string name="no_watches">Ihre Beobachtungsliste ist leer. Bitte geben Sie den Nicknamen im
        unten angezeigten Feld ein, um deren Chataktivität zu sehen.
    </string>
    <string name="options">Optionen</string>
    <string name="remove">Entfernen</string>
    <string name="refresh">Neu laden</string>
    <string name="no_lines_yet">Keine Chatlogzeilen zum Anzeigen.</string>

    <string name="drawer_open">Drawer öffnen</string>
    <string name="drawer_close">Drawer schließen</string>

</resources>


text:
package org.apache.activemq.transport.amqp.client;

import javax.jms.InvalidClientIDException;
import javax.jms.InvalidDestinationException;
import javax.jms.JMSException;
import javax.jms.JMSSecurityException;
import javax.jms.ResourceAllocationException;
import javax.jms.TransactionRolledBackException;
import java.io.IOException;
import java.util.Map;

import org.apache.qpid.proton.amqp.Symbol;
import org.apache.qpid.proton.amqp.messaging.Modified;
import org.apache.qpid.proton.amqp.messaging.Rejected;
import org.apache.qpid.proton.amqp.transaction.TransactionErrors;
import org.apache.qpid.proton.amqp.transport.AmqpError;
import org.apache.qpid.proton.amqp.transport.ConnectionError;
import org.apache.qpid.proton.amqp.transport.ErrorCondition;

public class AmqpSupport {

   // Symbols used for connection capabilities
   public static final Symbol SOLE_CONNECTION_CAPABILITY = Symbol.valueOf("sole-connection-for-container");
   public static final Symbol ANONYMOUS_RELAY = Symbol.valueOf("ANONYMOUS-RELAY");

   // Symbols used to announce connection error information
   public static final Symbol CONNECTION_OPEN_FAILED = Symbol.valueOf("amqp:connection-establishment-failed");
   public static final Symbol INVALID_FIELD = Symbol.valueOf("invalid-field");
   public static final Symbol CONTAINER_ID = Symbol.valueOf("container-id");

   // Symbols used to announce connection redirect ErrorCondition 'info'
   public static final Symbol PORT = Symbol.valueOf("port");
   public static final Symbol NETWORK_HOST = Symbol.valueOf("network-host");
   public static final Symbol OPEN_HOSTNAME = Symbol.valueOf("hostname");

   // Symbols used for connection properties
   public static final Symbol QUEUE_PREFIX = Symbol.valueOf("queue-prefix");
   public static final Symbol TOPIC_PREFIX = Symbol.valueOf("topic-prefix");

   public static final Symbol PRODUCT = Symbol.valueOf("product");
   public static final Symbol VERSION = Symbol.valueOf("version");
   public static final Symbol PLATFORM = Symbol.valueOf("platform");

   // Symbols used for receivers.
   public static final Symbol COPY = Symbol.getSymbol("copy");
   public static final Symbol NO_LOCAL_SYMBOL = Symbol.valueOf("no-local");
   public static final Symbol SELECTOR_SYMBOL = Symbol.valueOf("jms-selector");

   // Delivery states
   public static final Rejected REJECTED = new Rejected();
   public static final Modified MODIFIED_FAILED = new Modified();
   public static final Modified MODIFIED_FAILED_UNDELIVERABLE = new Modified();

   // Temporary Destination constants
   public static final Symbol DYNAMIC_NODE_LIFETIME_POLICY = Symbol.valueOf("lifetime-policy");
   public static final String TEMP_QUEUE_CREATOR = "temp-queue-creator:";
   public static final String TEMP_TOPIC_CREATOR = "temp-topic-creator:";

   //----- Static initializer -----------------------------------------------//

   static {
      MODIFIED_FAILED.setDeliveryFailed(true);

      MODIFIED_FAILED_UNDELIVERABLE.setDeliveryFailed(true);
      MODIFIED_FAILED_UNDELIVERABLE.setUndeliverableHere(true);
   }

   //----- Utility Methods --------------------------------------------------//

   /**
    * Given an ErrorCondition instance create a new Exception that best matches
    * the error type.
    *
    * @param errorCondition The ErrorCondition returned from the remote peer.
    * @return a new Exception instance that best matches the ErrorCondition value.
    */
   public static Exception convertToException(ErrorCondition errorCondition) {
      Exception remoteError = null;

      if (errorCondition != null && errorCondition.getCondition() != null) {
         Symbol error = errorCondition.getCondition();
         String message = extractErrorMessage(errorCondition);

         if (error.equals(AmqpError.UNAUTHORIZED_ACCESS)) {
            remoteError = new JMSSecurityException(message);
         } else if (error.equals(AmqpError.RESOURCE_LIMIT_EXCEEDED)) {
            remoteError = new ResourceAllocationException(message);
         } else if (error.equals(AmqpError.NOT_FOUND)) {
            remoteError = new InvalidDestinationException(message);
         } else if (error.equals(TransactionErrors.TRANSACTION_ROLLBACK)) {
            remoteError = new TransactionRolledBackException(message);
         } else if (error.equals(ConnectionError.REDIRECT)) {
            remoteError = createRedirectException(error, message, errorCondition);
         } else if (error.equals(AmqpError.INVALID_FIELD)) {
            Map<?, ?> info = errorCondition.getInfo();
            if (info != null && CONTAINER_ID.equals(info.get(INVALID_FIELD))) {
               remoteError = new InvalidClientIDException(message);
            } else {
               remoteError = new JMSException(message);
            }
         } else {
            remoteError = new JMSException(message);
         }
      } else {
         remoteError = new JMSException("Unknown error from remote peer");
      }

      return remoteError;
   }

   /**
    * Attempt to read and return the embedded error message in the given ErrorCondition
    * object.  If no message can be extracted a generic message is returned.
    *
    * @param errorCondition The ErrorCondition to extract the error message from.
    * @return an error message extracted from the given ErrorCondition.
    */
   public static String extractErrorMessage(ErrorCondition errorCondition) {
      String message = "Received error from remote peer without description";
      if (errorCondition != null) {
         if (errorCondition.getDescription() != null && !errorCondition.getDescription().isEmpty()) {
            message = errorCondition.getDescription();
         }

         Symbol condition = errorCondition.getCondition();
         if (condition != null) {
            message = message + " [condition = " + condition + "]";
         }
      }

      return message;
   }

   /**
    * When a redirect type exception is received this method is called to create the
    * appropriate redirect exception type containing the error details needed.
    *
    * @param error     the Symbol that defines the redirection error type.
    * @param message   the basic error message that should used or amended for the returned exception.
    * @param condition the ErrorCondition that describes the redirection.
    * @return an Exception that captures the details of the redirection error.
    */
   public static Exception createRedirectException(Symbol error, String message, ErrorCondition condition) {
      Exception result = null;
      Map<?, ?> info = condition.getInfo();

      if (info == null) {
         result = new IOException(message + " : Redirection information not set.");
      } else {
         String hostname = (String) info.get(OPEN_HOSTNAME);

         String networkHost = (String) info.get(NETWORK_HOST);
         if (networkHost == null || networkHost.isEmpty()) {
            result = new IOException(message + " : Redirection information not set.");
         }

         int port = 0;
         try {
            port = Integer.valueOf(info.get(PORT).toString());
         } catch (Exception ex) {
            result = new IOException(message + " : Redirection information not set.");
         }

         result = new AmqpRedirectedException(message, hostname, networkHost, port);
      }

      return result;
   }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<layout
    xmlns:android="http://schemas.android.com/apk/res/android"
    >

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingTop="@dimen/large_margin"
        >

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="?android:attr/listDivider"
            />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recycler_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            />
    </LinearLayout>
</layout>


text:
npm-uninstall

uninstall a package programmatically

SYNOPSIS

npm.commands.uninstall(packages, callback)

DESCRIPTION

This acts much the same ways as uninstalling on the command-line.

The 'packages' parameter is an array of strings. Each element in the array is
the name of a package to be uninstalled.

Finally, 'callback' is a function that will be called when all packages have been
uninstalled or when an error has been encountered.


text:
package pr06_1;

public class MyDoubleBox<T extends Comparable<T>> implements Comparable<MyDoubleBox<T>> {
    private T element;

    public MyDoubleBox(T element) {
        this.setElement(element);
    }

    private void setElement(T element) {
        this.element = element;
    }

    public T getElement() {
        return this.element;
    }

    @Override
    public int compareTo(MyDoubleBox<T> tMyDoubleBox) {
        return this.getElement().compareTo(tMyDoubleBox.getElement());
    }
}


text:
package org.zalando.stups.fullstop.config;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.exception.HystrixBadRequestException;
import com.netflix.hystrix.exception.HystrixRuntimeException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@ContextConfiguration
public class HystrixConfigurationTest {

    @Autowired
    private TestService testService;

    @Test(expected = RuntimeException.class)
    public void testMethodThrowsException() throws Exception {
        testService.throwException();
    }

    @Test(expected = HystrixRuntimeException.class)
    public void testMethodRunsIntoTimeout() throws Exception {
        final long start = System.currentTimeMillis();
        try {
            testService.runIntoTimeout();
        }
        finally {
            final long end = System.currentTimeMillis();
            // default timeout is 1 sec
            assertThat(end - start).isLessThan(1500);
        }
    }

    @Test
    public void testGetFallback() throws Exception {
        assertThat(testService.throwExceptionAndFallback()).isEqualTo("Hello Fallback!");
    }

    @Test(expected = IllegalArgumentException.class)
    public void testBadRequest() throws Exception {
        testService.badRequest();
    }

    @Test(expected = IllegalArgumentException.class)
    public void testIgnoreException() throws Exception {
        testService.ignoreException();
    }

    @Configuration
    @Import(HystrixConfiguration.class)

    static class TestConfig {

        @Bean TestService testService() {
            return new TestService();
        }

    }

    static class TestService {

        @HystrixCommand()
        public void throwException() {
            throw new RuntimeException("this method always fails");
        }

        @HystrixCommand
        public void runIntoTimeout() throws InterruptedException {
            SECONDS.sleep(3000);
        }

        @HystrixCommand(ignoreExceptions = IllegalArgumentException.class)
        public void ignoreException() {
            throw new IllegalArgumentException("Oops");
        }

        @HystrixCommand(fallbackMethod = "fallback")
        public String throwExceptionAndFallback() {
            throw new RuntimeException("this method always fails");

        }

        @HystrixCommand(fallbackMethod = "fallback")
        public String badRequest() {
            // simulate failed input validation. Fallback won't be executed.
            throw new HystrixBadRequestException("Bla", new IllegalArgumentException("validation failed"));
        }

        public String fallback() {
            return "Hello Fallback!";
        }
    }

}


text:
/*
 * Module Name: common include
 *
 * Filename: vmdnsincludes.h
 *
 * Abstract:
 *
 * common include file for all modules
 *
 */

#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#endif

#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif

#ifdef HAVE_STDDEF_H
#include <stddef.h>
#endif

#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif

#ifdef HAVE_STRING_H
#include <string.h>
#endif

#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif

#ifdef HAVE_ASSERT_H
#include <assert.h>
#endif

#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif

#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif

#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif

#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif

#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif

#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif

#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif

#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif

#ifdef HAVE_LW_BASE_H
#include <lw/base.h>
#endif

#ifdef HAVE_OPENSSL_CRYPTO_H
#include <openssl/crypto.h>
#endif

#ifdef HAVE_OPENSSL_SSL_H
#include <openssl/ssl.h>
#endif

#ifdef HAVE_OPENSSL_ERR_H
#include <openssl/err.h>
#endif

#ifdef HAVE_UUID_UUID_H
#include <uuid/uuid.h>
#endif


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Indian Phytopath. 39(2): 198 (1987)

#### Original name
Phaeoramularia pithoragarhensis Kamal & Narayan

### Remarks
null