text:
/*
    Name:ChangeTabView.js
    Author: www.devtreks.org
    Date: 2012, September
    Purpose: set up tabs, respond to tab events using jquery
    called using syntax: var oChangeTabViewer = new ChangeTabView.ViewChanger(params);
*/
//first script loaded
function changeLinkedViewsTabs(){
    var oChangeTabViewer = new ChangeTabView.ViewChanger(null, "linkedviews");
}
//constructors
var ChangeMvcTabView = new Object();
ChangeMvcTabView.ViewChanger=function(){
   var oChangeTabViewer = new ChangeTabView.ViewChanger(null);
   //HighlightLinkClicked(id);
}
var ChangeTabView = new Object();
ChangeTabView.ViewChanger=function(onError, tabId, updatePanelType){
    this.onError = (onError) ? onError : this.defaultError;
    if (arguments.length <= 1){
        //window.onload (no click event)
		this.initTabs();
	}
    else if (arguments.length == 2) {
        //error messages are cleared by clicking on any tab
        ClearErrorMessage();
	    //tab click event
	    this.changeTabs(tabId);
	}
	else if (arguments.length == 3){
	    //other click event
	    this.changeTabsByUpdatePanelType(updatePanelType);
	}
	//else: an event on this class has been raised (i.e. callback events from content loaders)
}
//object literal
ChangeTabView.ViewChanger.prototype={
    initTabs:function(){
        //check for serveraction in uri: www.devtreks.org/agtreks/search
        var sURI = window.location.href;
        //menu id has # symbol while corresponding div does not
        var sTabId = "menusearch";
        if (sURI) {
            var bHasGoodTab = false;
            var sServerActionType = GetSubStringWithDelimiter(sURI, SharedUtils.URIPatternDelimiter, 4);
            if (sServerActionType != null && sServerActionType != undefined){
                var regServerActionType = new RegExp("search");
                if (regServerActionType.test(sServerActionType)){
                    sTabId = "menusearch";
                    bHasGoodTab = true;
                }
                if (bHasGoodTab == false) {
                    regServerActionType = new RegExp("preview");
                    if (regServerActionType.test(sServerActionType)){
                        sTabId = "menupreview";
                        bHasGoodTab = true;
                    }
                }
                if (bHasGoodTab == false) {
                    regServerActionType = new RegExp("select");
                    if (regServerActionType.test(sServerActionType)){
                        sTabId = "menuselect";
                        bHasGoodTab = true;
                    }
                }
                if (bHasGoodTab == false) {
                    regServerActionType = new RegExp("edit");
                    if (regServerActionType.test(sServerActionType)){
                        sTabId = "menuedit";
                        bHasGoodTab = true;
                    }
                }
                if (bHasGoodTab == false) {
                    regServerActionType = new RegExp("pack");
                    if (regServerActionType.test(sServerActionType)){
                        sTabId = "menupack";
                        bHasGoodTab = true;
                    }
                }
                if (bHasGoodTab == false) {
                    regServerActionType = new RegExp("linkedviews");
                    if (regServerActionType.test(sServerActionType)){
                        sTabId = "menulinkedviews";
                        bHasGoodTab = true;
                    }
                }
                if (bHasGoodTab == false) {
                    regServerActionType = new RegExp("member");
                    if (regServerActionType.test(sServerActionType)){
                        sTabId = "menumember";
                        bHasGoodTab = true;
                    }
                }
            }
        }
        else {
            //search is default
            sTabId = "menusearch";
        }
        this.changeTabs(sTabId);
    },//initTabs
    changeTabsByUpdatePanelType:function(updatePanelType){
        var sTabId = this.getTabIdFromUpdatePanelType(updatePanelType);
        this.changeTabs(sTabId);
    },//changeTabsByUpdatePanelType
    changeTabs:function(tabId){
        var sTabId = '#' + tabId;
        //toggle the appearance of the selected linkui-btn-active ui-state-persist
        //show the corresponding selected div (i.e. menusearch = divsearch)
        var sPanelId = "";
        if (StartsWith("menu", tabId)){
            $("a[id^='menu']").removeClass("ui-btn-active");
            $(sTabId).addClass("ui-btn-active");
            //this works identically
            //$("a[id^='menu']").removeClass($.mobile.activeBtnClass);
            //$(sTabId).addClass($.mobile.activeBtnClass);
            $("#basecontent").children("div").hide();
            sPanelId = ReplaceString(tabId, "menu", "");
            $('#div' + sPanelId).toggle();
        }
        else if (StartsWith("step", tabId)){
            $("a[id^='step']").removeClass("ui-btn-active");
            $(sTabId).addClass("ui-btn-active");
            sPanelId = '#div' + tabId;
            $(sPanelId).siblings("div").hide();
            $(sPanelId).hide();
            $(sPanelId).toggle();
            $("#" + "stepsmenu").toggle();
        }
        //show the message div
        $("#spanDisplayError").show();
        //the views tab uses multi-step views (i.e. calculator steps)
        this.initSecondTabs(tabId);
    },//changeTabs
    initSecondTabs:function(tabId){
        if (tabId){
            if (EndsWith("linkedviews", tabId)) {
                //init tab on instructions/intro panel
                var sStepId;
                if (SharedUtils.TabId != null){
                    sStepId = SharedUtils.TabId;
                }
                else {
                    sStepId = "stepzero";
                }
                this.changeTabs(sStepId);
            }
            //persist it if a step
            if (tabId.indexOf("step") > -1) {
                SharedUtils.TabId = tabId;
            }
        }
    },//initSecondTabs
     initThirdTabs:function(tabId){
        //refactor: 1. multiple docs with same menu (dynamic tabs may be needed for each menu)
        //          2. respective stylesheets need standard id attribute values (of some type)
        //          3. animation : show the div expanding to 100% while the previous one contracts
        var regIsSectionTab = new RegExp("^section");
        if (!regIsSectionTab.test(tabId)){
            var thirdTabbedMenuItem = $("#sectionsmenu");
            if ($(thirdTabbedMenuItem).length > 0) {
                //init sections in documents (refactor for multiple docs)
                this.changeTabs("section0");
            }
        }
    },//initThirdTabs
    getTabIdFromUpdatePanelType:function(updatePanelType){
        var sTabId = "menusearch";
        updatePanelType = this.getPanelAction(updatePanelType);
        switch(updatePanelType){
            case SharedUtils.UPDATE_PANEL_TYPES_search:
                sTabId = "menusearch";
                break;
            case SharedUtils.UPDATE_PANEL_TYPES_preview:
                sTabId = "menupreview";
                break;
            case SharedUtils.UPDATE_PANEL_TYPES_select:
                sTabId = "menuselect";
                break;
            case SharedUtils.UPDATE_PANEL_TYPES_edit:
                sTabId = "menuedit";
                break;
            case SharedUtils.UPDATE_PANEL_TYPES_pack:
                sTabId = "menupack";
                break;
            case SharedUtils.UPDATE_PANEL_TYPES_linkedviews:
                sTabId = "menulinkedviews";
                break;
            case SharedUtils.UPDATE_PANEL_TYPES_member:
                sTabId = "menumember";
                break;
            default:
                break;
        }
        return sTabId;
    },//getTabIdFromUpdatePanelType
    getPanelAction:function(updatePanelType) {
        //cross browser support
        var ePanelType;
        if (isNaN(updatePanelType)) {
            if (updatePanelType == "SharedUtils.UPDATE_PANEL_TYPES_search"){
                ePanelType = SharedUtils.UPDATE_PANEL_TYPES_search;
            }
            else if (updatePanelType == "SharedUtils.UPDATE_PANEL_TYPES_preview"){
                ePanelType = SharedUtils.UPDATE_PANEL_TYPES_preview;
            }
            else if (updatePanelType == "SharedUtils.UPDATE_PANEL_TYPES_edit"){
                ePanelType = SharedUtils.UPDATE_PANEL_TYPES_edit;
            }
            else if (updatePanelType == "SharedUtils.UPDATE_PANEL_TYPES_select"){
                ePanelType = SharedUtils.UPDATE_PANEL_TYPES_select;
            }
            else if (updatePanelType == "SharedUtils.UPDATE_PANEL_TYPES_pack"){
                ePanelType = SharedUtils.UPDATE_PANEL_TYPES_pack;
            }
            else if (updatePanelType == "SharedUtils.UPDATE_PANEL_TYPES_member"){
                ePanelType = SharedUtils.UPDATE_PANEL_TYPES_member;
            }
            else if (updatePanelType == "SharedUtils.UPDATE_PANEL_TYPES_linkedviews"){
                ePanelType = SharedUtils.UPDATE_PANEL_TYPES_linkedviews;
            }
            else if (updatePanelType == "SharedUtils.UPDATE_PANEL_TYPES_preview"){
                ePanelType = SharedUtils.UPDATE_PANEL_TYPES_preview;
            }
        }
        else {
            ePanelType = updatePanelType;
        }
        return ePanelType;
    },
    hideAfterDeletes:function(){
        //hide other divs that might still contain the deleted element
        $('#divsearch').hide();
        $('#divselect').hide();
        $('#divpreview').hide();
    },
    defaultError:function(){
        alert("couldn't change tab view");
    }
}


text:
There are a few assumptions we need to make about how the Docker image build process is set up.

## Dockerfile repos
We assume that a version-controlled repository (i.e. a git repository) will be used that contains the Dockerfile(s) that the Docker image(s) is/are built from. In our case we use GitHub repos.

We're mostly concerned with repositories whose primary purpose is to manage Dockerfiles, not repositories that also contain the source code of the software actually being deployed in the Docker image.

Some examples of our Dockerfile repos:
* [`praekeltfoundation/docker-seed`](https://github.com/praekeltfoundation/docker-seed)
* [`praekeltfoundation/docker-django-bootstrap`](https://github.com/praekeltfoundation/docker-django-bootstrap)
* [`praekeltfoundation/docker-junebug`](https://github.com/praekeltfoundation/docker-junebug)

Ideally, the Dockerfile repo accurately describes everything about the Docker image that is produced from it. Building the Docker image from the repo can be reproduced reliably.

## Continuous Integration
### Using a general-purpose CI service
We assume that Docker images will be built and pushed to a registry by some form of Continuous Integration (CI). In our case this is [Travis CI](https://travis-ci.org), but this system should apply to any _general-purpose_ CI service, such as [Semaphore](https://semaphoreci.com) or [CircleCI](https://circleci.com).

We want to use an existing, full-featured CI service because:
* We have a lot of existing experience with Travis CI (and we already pay them for their service).
* We want full control over the build environment, particularly over which version of Docker we use.
* It's easier to run integration tests against built images.
* We've built some existing tooling to make tasks like tagging images easier inside Travis CI ([docker-ci-deploy](https://github.com/praekeltfoundation/docker-ci-deploy)).

### Why not Docker Hub automated builds?
[Docker Hub's automated builds](https://docs.docker.com/docker-hub/builds/) are a quick and easy way to get started with automating building Docker images. It also provides some tools to handle the problem we're seeking to solve by making it possible to trigger builds of images when another image is updated. See the [document about existing solutions](already-exists.md) for more information.

So why not use this? There are a few reasons, the primary one being that Docker Hub automated builds don't provide enough control over the build process. Most of the advantages of a full-featured CI service listed above do not apply to Docker Hub automated builds.

Other problems we've encountered:
* No notifications of failed builds (unless you manually set up a webhook).
* Enjoy refreshing the page as you watch the build logs.
* Very limited control of image tagging.
* Obscure [build hook](https://docs.docker.com/docker-cloud/builds/advanced/#build-hook-examples) system for more advanced usage basically overrides anything you set in the Docker Hub web UI.

In addition to this, in the past we've experienced poor reliability from Docker Hub automated builds, and the Docker organisation generally provides little support if you are not a paying customer. Documentation is lacking, to say the least.

redpajama_set_name: RedPajamaGithub


text:
title: Twitter Implies Their Ads Suck
date: 2016-01-28 10:28:57 -06:00
layout: post
custom_type: link
link_url: http://mattgemmell.com/tiered-social-media/
---

Matt Gemmell on what he's calling "tiered social media":

> There are problems with that approach, the main one being the tacit admission that their ads are detrimental. If you're rewarding people by reducing the hostility of their experience, maybe just fix the experience for everyone, and find something positive to charge for instead.

Twitter has no idea what the heck they're doing. The ads they've introduced to make them money are being devalued by none other than themselves. Like Matt, I never see Twitter ads, and I bet many others don't either. Which also takes away from any value these ads could have. Twitter could do some type of "patronage" model, but it has made enemies with some of their third-party developers and most of their long-time users.

2016 is a pivotal year for Twitter, which could begin their decline, or (hopefully) a second rise in popularity.


text:
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Total Downloads][ico-downloads]][link-downloads]
[![Build Status][ico-build]][link-build]
[![Software License][ico-license]](LICENSE)

Easy and fast file sharing from the command-line brought to Composer community.
Based on [https://transfer.sh](https://transfer.sh)

Features:
- Made for use with shell
- Share files with an URL
- Upload up to 10 GB
- Files stored for 14 days
- Encrypt your files
- Preview your files in the browser
- For free

## Installation

Install package globally:

```
$ composer global require tamtamchik/composer-transfer
```

**Note!** Make sure to place the `~/.composer/vendor/bin` directory (or the equivalent directory for
your OS) in your PATH so the `transfer` executable can be located by your system. Simply add this directory to your PATH in your  `~/.bashrc` (or `~/.bash_profile`) like this:

```
$ echo "export PATH=~/.composer/vendor/bin:$PATH" >> ~/.bashrc
$ source ~/.bashrc
```

## Usage

Now uploading your file to the web is as easy as running `transfer` command:

```
$ transfer file.txt
######################################################################## 100.0%
https://transfer.sh/XXXXX/file.txt
```

Or using it with a pipe (real life example):

```
$ cat /var/log/nginx/access.log | cut -d ' ' -f 1 | logtop | transfer access-statistics.txt
######################################################################## 100.0%
https://transfer.sh/XXXXX/access-statistics.txt
```

Or for folders (require `zip` on server):

```
$ transfer /tmp/some-folder
######################################################################## 100.0%
https://transfer.sh/XXXXX/some-folder.zip
```

## Creators

##### Original service:

- [Remco Verhoef](https://github.com/nl5887)
- Uvis Grinfelds
- [All Contributors](https://github.com/dutchcoders/transfer.sh/graphs/contributors)

##### Composer package:

- [Yuri Tkachenko](https://github.com/tamtamchik)
- [All Contributors](../../contributors)

## TODO

- Create PHP Class for uploading files to [https://transfer.sh](https://transfer.sh).

## Copyright and license

Original [https://transfer.sh](https://transfer.sh) code and documentation copyright 2011-2016 Remco Verhoef.

Code released under [the MIT license](LICENSE).

  [ico-version]: https://img.shields.io/packagist/v/tamtamchik/composer-transfer.svg?style=flat-square
  [ico-license]: https://img.shields.io/packagist/l/tamtamchik/composer-transfer.svg?style=flat-square
  [ico-downloads]: https://img.shields.io/packagist/dt/tamtamchik/composer-transfer.svg?style=flat-square
  [ico-build]: https://img.shields.io/travis/tamtamchik/composer-transfer.svg?style=flat-square

  [link-packagist]: https://packagist.org/packages/tamtamchik/composer-transfer
  [link-downloads]: https://packagist.org/packages/tamtamchik/composer-transfer/stats
  [link-build]: https://travis-ci.org/tamtamchik/composer-transfer


text:
package fr.xebia.workshop.monitoring;

import com.amazonaws.services.ec2.AmazonEC2;

import java.util.Collection;

public class CreateDocumentation implements InfrastructureCreationListener {

    @Override
    public void infrastructureCreated(AmazonEC2 ec2, WorkshopInfrastructure infra) throws Exception {
        Collection<TeamInfrastructure> teamsInfrastructures = new InfrastructureTopologyScanner(ec2, infra).scan();

        new DocumentationGenerator().generateDocs(teamsInfrastructures, "/tmp/monitoring/");
    }
}


text:
package org.seagrid.desktop.connectors.storage;

import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.SftpException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.*;
import java.nio.file.Paths;

public class GuiFileUploadTask extends GuiFileTask {
    private final static Logger logger = LoggerFactory.getLogger(GuiFileUploadTask.class);

    private String remoteFilePath, localFilePath;

    public GuiFileUploadTask(String remoteFilePath, String localFilePath) throws JSchException {
        super();
        this.remoteFilePath = remoteFilePath;
        this.localFilePath = localFilePath;
    }

    @Override
    protected Boolean call() throws Exception {
        return uploadFile(remoteFilePath, localFilePath);
    }

    public Boolean uploadFile(String remoteFilePath, String localFilePath) throws IOException, SftpException {
        createRemoteDirsIfNotExists(Paths.get(remoteFilePath).getParent().toString());
        remoteFilePath = remoteFilePath.replace("\\","/");
        OutputStream remoteOutputStream = new BufferedOutputStream(channelSftp.put(remoteFilePath));
        File localFile = new File(localFilePath);
        InputStream localInputStream = new FileInputStream(localFile);
        long fileSize = localFile.length();
        byte[] buffer = new byte[BUFFER_SIZE];
        int bytesRead = -1;
        int totalBytesRead = 0;
        double percentCompleted = 0;

        while ((bytesRead = localInputStream.read(buffer)) != -1) {
            remoteOutputStream.write(buffer, 0, bytesRead);
            totalBytesRead += bytesRead;
            percentCompleted = ((double)totalBytesRead) / fileSize;
            updateMessage("Uploaded " + totalBytesRead + " bytes");
            updateProgress(percentCompleted, 1);
        }

        remoteOutputStream.close();
        localInputStream.close();
        return true;
    }

    private void createRemoteDirsIfNotExists(String parentDirPath) throws SftpException {
        parentDirPath = parentDirPath.replace("\\","/");
        String[] folders = parentDirPath.split( "/" );
        for ( String folder : folders ) {
            if ( folder.length() > 0 ) {
                try {
                    channelSftp.cd(folder);
                }
                catch ( SftpException e ) {
                    channelSftp.mkdir( folder );
                    channelSftp.chmod(Integer.parseInt("777",8), folder);
                    channelSftp.cd( folder );
                }
            }
        }
    }
}


text:
package com.blackmoonit.androidbits.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;

public class UriPreference extends StringPreference {

	public UriPreference(Context aContext, AttributeSet attrs) {
		super(aContext, attrs);
	}

	@Override
	protected void onAddEditTextToDialogView(View aDialogView, EditText aEditText) {
		super.onAddEditTextToDialogView(aDialogView, aEditText);
		aEditText.setInputType(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_URI);
	}

}


text:
<def-group>
  <definition class="compliance" id="audit_rules_time_adjtimex" version="1">
    <metadata>
      <title>Record Attempts to Alter Time Through Adjtimex</title>
      <affected family="unix">
        <platform>Red Hat Enterprise Linux 7</platform>
        <platform>multi_platform_fedora</platform>
      </affected>
      <description>Record attempts to alter time through adjtimex.</description>
      <reference source="JL" ref_id="RHEL7_20150429" ref_url="test_attestation" />
      <reference source="JL" ref_id="FEDORA20_20150429" ref_url="test_attestation" />
    </metadata>

    <criteria operator="OR">

      <!-- Test the augenrules case -->
      <criteria operator="AND">
        <criterion comment="audit augenrules" test_ref="test_art_adjtimex_augenrules" />
        <criterion comment="audit augenrules 32-bit adjtimex" test_ref="test_32bit_art_adjtimex_augenrules" />
        <criteria operator="OR">
          <!-- System either isn't 64-bit => we just check presence of 32-bit version of adjtimex audit rule -->
          <extend_definition comment="64-bit system" definition_ref="system_info_architecture_x86_64" negate="true" />
          <!-- Or system is 64-bit => in that case we also need to verify the presence of 64-bit version of adjtimex audit rule -->
          <criterion comment="audit augenrules 64-bit adjtimex" test_ref="test_64bit_art_adjtimex_augenrules" />
        </criteria>
      </criteria>

      <!-- OR test the auditctl case -->
      <criteria operator="AND">
        <criterion comment="audit auditctl" test_ref="test_art_adjtimex_auditctl" />
        <criterion comment="audit auditctl 32-bit adjtimex" test_ref="test_32bit_art_adjtimex_auditctl" />
        <criteria operator="OR">
          <!-- System either isn't 64-bit => we just check presence of 32-bit version of adjtimex audit rule -->
          <extend_definition comment="64-bit system" definition_ref="system_info_architecture_x86_64" negate="true" />
          <!-- Or system is 64-bit => in that case we also need to verify the presence of 64-bit version of adjtimex audit rule -->
          <criterion comment="audit auditctl 64-bit adjtimex" test_ref="test_64bit_art_adjtimex_auditctl" />
        </criteria>
      </criteria>

    </criteria>
  </definition>

  <!-- Test the augenrules case -->
  <ind:textfilecontent54_test check="all" comment="audit augenrules" id="test_art_adjtimex_augenrules" version="1">
    <ind:object object_ref="object_art_adjtimex_augenrules" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_art_adjtimex_augenrules" version="1">
    <ind:filepath>/usr/lib/systemd/system/auditd.service</ind:filepath>
    <ind:pattern operation="pattern match">^ExecStartPost=\-\/sbin\/augenrules.*$</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit augenrules 32-bit adjtimex" id="test_32bit_art_adjtimex_augenrules" version="1">
    <ind:object object_ref="object_32bit_art_adjtimex_augenrules" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_32bit_art_adjtimex_augenrules" version="1">
    <ind:filepath operation="pattern match">/etc/audit/rules\.d/.*\.rules</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*-a[\s]+always,exit[\s]+-F[\s]+arch=b32.*-S[\s]+adjtimex[\s]+.*-k[\s]+[\S]+[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit augenrules 64-bit adjtimex" id="test_64bit_art_adjtimex_augenrules" version="1">
    <ind:object object_ref="object_64bit_art_adjtimex_augenrules" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_64bit_art_adjtimex_augenrules" version="1">
    <ind:filepath operation="pattern match">/etc/audit/rules\.d/.*\.rules</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*-a[\s]+always,exit[\s]+-F[\s]+arch=b64.*-S[\s]+adjtimex[\s]+.*-k[\s]+[\S]+[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <!-- Test the auditctl case -->
  <ind:textfilecontent54_test check="all" comment="audit auditctl" id="test_art_adjtimex_auditctl" version="1">
    <ind:object object_ref="object_art_adjtimex_auditctl" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_art_adjtimex_auditctl" version="1">
    <ind:filepath>/usr/lib/systemd/system/auditd.service</ind:filepath>
    <ind:pattern operation="pattern match">^ExecStartPost=\-\/sbin\/auditctl.*$</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit auditctl 32-bit adjtimex" id="test_32bit_art_adjtimex_auditctl" version="1">
    <ind:object object_ref="object_32bit_art_adjtimex_auditctl" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_32bit_art_adjtimex_auditctl" version="1">
    <ind:filepath>/etc/audit/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*-a[\s]+always,exit[\s]+-F[\s]+arch=b32.*-S[\s]+adjtimex[\s]+.*-k[\s]+[\S]+[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit auditctl 64-bit adjtimex" id="test_64bit_art_adjtimex_auditctl" version="1">
    <ind:object object_ref="object_64bit_art_adjtimex_auditctl" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_64bit_art_adjtimex_auditctl" version="1">
    <ind:filepath>/etc/audit/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*-a[\s]+always,exit[\s]+-F[\s]+arch=b64.*-S[\s]+adjtimex[\s]+.*-k[\s]+[\S]+[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

</def-group>


text:
package ai.akka.exception

import akka.actor.ActorRef

/**
 * Object with exceptions
 */
object Exception {

  /**
   * Trait with information and reference to actor which waiting http response
   */
  trait OAuthServiceException {
    val httpResponseActor: ActorRef
    val msg: String
  }

  /**
   * Exception when parsing authorization request
   * @param httpResponseActor reference to actor which waiting http response
   * @param msg readable message
   */
  case class OAuthParseRequestException(httpResponseActor: ActorRef, msg: String) extends Throwable with OAuthServiceException {
    override def getMessage: String = msg
  }

  /**
   * Exception when unsupported response type
   * @param httpResponseActor reference to actor which waiting http response
   * @param msg readable message
   */
  case class UnsupportedResponseTypeException(httpResponseActor: ActorRef, msg: String) extends Throwable with OAuthServiceException {
    override def getMessage: String = msg
  }

  /**
   * Exception when client identity is invalid
   * @param httpResponseActor reference to actor which waiting http response
   * @param msg readable message
   */
  case class InvalidClientException(httpResponseActor: ActorRef, msg: String) extends Throwable with OAuthServiceException {
    override def getMessage: String = msg
  }

  /**
   * Exception when authentication is invalid
   * @param httpResponseActor reference to actor which waiting http response
   * @param msg readable message
   */
  case class InvalidAuthenticationException(httpResponseActor: ActorRef, msg: String) extends Throwable with OAuthServiceException {
    override def getMessage: String = msg
  }

}


text:
import helper.py

helper.blah("blahblahblah")


text:
@interface YCYVideoVc ()

@end

@implementation YCYVideoVc

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor yellowColor];

    self.tableView.contentInset = UIEdgeInsetsMake(YCYNavMaxY + YCYTitlesViewH, 0, YCYTabBarH, 0);
}

#pragma mark - 数据源
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 30;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *ID = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
        cell.backgroundColor = [UIColor clearColor];
    }
    cell.textLabel.text = [NSString stringWithFormat:@"%@-%zd", self.class, indexPath.row];
    return cell;
}
@end


text:
package net.erdfelt.android.sdkfido.project.maven;

import java.io.File;
import java.io.IOException;
import java.util.logging.Logger;

import net.erdfelt.android.sdkfido.FetchException;
import net.erdfelt.android.sdkfido.FetchTarget;
import net.erdfelt.android.sdkfido.local.JarListing;
import net.erdfelt.android.sdkfido.project.AbstractOutputProject;
import net.erdfelt.android.sdkfido.project.Dir;
import net.erdfelt.android.sdkfido.project.JavaPathValidator;
import net.erdfelt.android.sdkfido.project.OutputProject;
import net.erdfelt.android.sdkfido.project.SourceCopier;
import net.erdfelt.android.sdkfido.project.XmlBuildGen;

import org.apache.commons.io.FileUtils;

public class MavenOutputProject extends AbstractOutputProject implements OutputProject {
    public static final String  GROUPID    = "com.android.sdk";
    public static final String  ARTIFACTID = "android";

    private static final Logger LOG        = Logger.getLogger(MavenOutputProject.class.getName());
    private Dir                 sourceDir;
    private Dir                 resourceDir;
    private SourceCopier        copier;
    private XmlBuildGen         buildgen;

    public MavenOutputProject(File projectDir, FetchTarget target) {
        baseDir = new Dir(projectDir, toBaseDirName(target));
        sourceDir = baseDir.getSubDir("src/main/java");
        resourceDir = baseDir.getSubDir("src/main/resources");
        buildgen = new MavenPackageGen(target);
    }

    public MavenOutputProject(File moduleDir, XmlBuildGen buildgen) {
        this.baseDir = new Dir(moduleDir);
        this.sourceDir = baseDir.getSubDir("src/main/java");
        this.resourceDir = baseDir.getSubDir("src/main/resources");
        this.buildgen = buildgen;
    }

    public XmlBuildGen getBuildGen() {
        return buildgen;
    }

    public void setBuildGen(XmlBuildGen buildgen) {
        this.buildgen = buildgen;
    }

    public void setCopierNarrowJar(JarListing jarlisting) {
        if (jarlisting != null) {
            this.copier.setNarrowSearchTo(jarlisting);
        }
    }

    @Override
    public void close() throws FetchException {
        copier.close();

        try {
            JavaPathValidator validator = new JavaPathValidator();
            int count = validator.validateSourceTree(sourceDir);
            LOG.info(String.format("Validation Success! (output source tree structure of %,d java files)%n", count));
        } catch (IOException e) {
            throw new FetchException(
                    "Java Source Validation Failed!  You might not have a valid set of source! (see console for details on why)",
                    e);
        }

        // Create pom.xml
        buildgen.generate(baseDir.getFile("pom.xml"));
    }

    @Override
    public void copySource(File gitIncludeDir) throws FetchException {
        try {
            copier.copyTree(gitIncludeDir, sourceDir, resourceDir);
        } catch (IOException e) {
            throw new FetchException("Unable to copy source tree: " + gitIncludeDir, e);
        }
    }

    @Override
    public void init() throws FetchException {
        baseDir.ensureExists();
        sourceDir.ensureExists();
        resourceDir.ensureExists();

        try {
            this.copier = new SourceCopier(baseDir);
        } catch (IOException e) {
            throw new FetchException(e.getMessage(), e);
        }
        if (androidStub != null) {
            try {
                Dir libDir = baseDir.getSubDir("lib");
                libDir.ensureExists();
                FileUtils.copyFile(androidStub, libDir.getFile("android-stub.jar"));
                copier.setNarrowSearchTo(new JarListing(androidStub));
            } catch (IOException e) {
                throw new FetchException(
                        "Unable to narrow search tree by using listing of java files withou android stub jar file: "
                                + androidStub, e);
            }
        }
    }

    @Override
    public String toString() {
        return String.format("Maven Output: %s", baseDir.getPath().getAbsolutePath());
    }
}


text:
using System;
using System.Collections.Generic;

namespace RockLib.Configuration.MessagingProvider
{
    /// <summary>
    /// An implementation of <see cref="ISettingFilter"/> that only allows changes to
    /// settings that are members of a safelist - all other settings are blocked.
    /// </summary>
    public sealed class SafelistSettingFilter : ISettingFilter
    {
        private readonly HashSet<string> _safeSettings;

        /// <summary>
        /// Initializes a new instance of the <see cref="SafelistSettingFilter"/> class.
        /// </summary>
        /// <param name="safeSettings">
        /// The collection of settings (and their child settings) that are safe - all
        /// other settings will be blocked.
        /// </param>
        /// <param name="innerFilter">
        /// An optional setting filter that is applied if a setting is a
        /// member of <see cref="SafeSettings"/>.
        /// </param>
        public SafelistSettingFilter(IEnumerable<string> safeSettings, ISettingFilter innerFilter = null)
        {
            if (safeSettings == null)
                throw new ArgumentNullException(nameof(safeSettings));
            _safeSettings = new HashSet<string>(safeSettings, StringComparer.OrdinalIgnoreCase);
            InnerFilter = innerFilter ?? NullSettingFilter.Instance;
        }

        /// <summary>
        /// Gets the collection of settings (and their child settings) that are safe - all
        /// other settings will be blocked.
        /// </summary>
        public IEnumerable<string> SafeSettings => _safeSettings;

        /// <summary>
        /// Gets the inner setting filter that is applied if a setting is a
        /// member of <see cref="SafeSettings"/>.
        /// </summary>
        public ISettingFilter InnerFilter { get; }

        /// <summary>
        /// Returns whether the specified setting should be allowed to be changed.
        /// </summary>
        /// <param name="setting">The setting to potentially change.</param>
        /// <param name="receivedMessageHeaders">
        /// The headers of the message that was received that has initiated the change.
        /// </param>
        /// <returns>
        /// <see langword="true"/> if the setting is allowed to be changed; otherwise
        /// <see langword="false"/> if the setting is not allowed to be changed.
        /// </returns>
        public bool ShouldProcessSettingChange(string setting, IReadOnlyDictionary<string, object> receivedMessageHeaders) =>
            _safeSettings.HasSetting(setting) && InnerFilter.ShouldProcessSettingChange(setting, receivedMessageHeaders);
    }
}


text:
package com.graphiq.kettle.steps.streamschemamerge;

public class TestFailedException extends Exception {

  private static final long serialVersionUID = 8585395841938180974L;

  TestFailedException( String message ) {
    super( message );
  }
}


text:
import React from 'react'
import PropTypes from 'prop-types'
import isEmpty from 'lodash/isEmpty'
import get from 'lodash/get'
import { Control } from 'react-redux-form'
import StatefulError from './StatefulError'
import styles from './scss/FileInput.scss'

class FileInput extends React.Component {
  state = {
    uploading: undefined,
    errors: undefined
  }

  onReset = e => {
    e.preventDefault()
    const { model, createDocument } = this.props
    createDocument(model)
    this.props.onReset()
  }

  onChange = e => {
    e.preventDefault()
    this.setState({
      uploading: true,
      errors: undefined
    })

    const { url, api, id, onUpload, createDocument, model, updateDocumentName, uploading, csrfToken } = this.props
    const file = e.target.files[0]
    uploading(true)

    onUpload(url, api, id, file, csrfToken).then(result => {
      this.setState({
        uploading: false
      })
      if (result.filename) {
        updateDocumentName(model, result.filename)
      } else {
        this.setState({ errors: result.errorMessage })
        createDocument(model)
      }
      this.props.onUploadSuccess()
      uploading(false)
    })
  }
  render() {
    const { url, form, name, id, model, validators, messages, fieldLabel, title, accept } = this.props
    const fileField = `${id}`
    const doc = get(form, `${name}.${fileField}`, {})
    return (

        {this.state.errors && (

            There was an error uploading the file: {this.state.errors}

        )}
        {isEmpty(doc) && !this.state.uploading && (

              <Control.file
                model={model}
                type="file"
                id={`file_${name}_${fileField}`}
                name={`file_${name}_${fileField}`}
                accept={accept}
                onChange={this.onChange}
                className={styles.hidden_input}
                validators={validators}
                title={title || ''}
              />
              <label htmlFor={`file_${name}_${fileField}`} id={`label_${name}_${id}`} className={styles.custom_input}>

{fieldLabel}

              {messages && (
                <StatefulError
                  model={model}
                  messages={messages}
                  showMessagesDuringFocus="false"
                  id={`file_${name}_${fileField}`}
                />
              )}

        )}
        {!isEmpty(doc) && typeof doc === 'string' && (

              <a href={`/api/2${url}/${doc}`} target="_blank" rel="noopener noreferrer">
                {doc}

                Delete

        )}
        {this.state.uploading &&
Uploading...
}

    )
  }
}

FileInput.defaultProps = {
  onReset: () => {},
  onUploadSuccess: () => {}
}

FileInput.propTypes = {
  onReset: PropTypes.func,
  onUploadSuccess: PropTypes.func
}

export default FileInput


text:
namespace clover {
namespace ui { namespace hid {

class DirectionalControl : public Control {
public:
	using Value= typename nodes::SignalTypeTraits<nodes::SignalType::Real>::Value;

	DirectionalControl()
		: curValue(0.0)
		, prevValue(0.0){
	}
	virtual ~DirectionalControl(){}

	void setValue(const Value& value){ curValue= value; }

	virtual void update() override {
		triggerEvent<nodes::SignalType::Real>("value", curValue);
		triggerEvent<nodes::SignalType::Real>("delta", curValue - prevValue);

		if (prevValue != curValue)
			triggerEvent<nodes::SignalType::Real>("changedValue", curValue);

		prevValue= curValue;
	}

private:
	Value curValue, prevValue;
};

}} // ui::hid
} // clover

#endif // CLOVER_UI_HID_CONTROLS_CONTROL_DIRECTIONAL_HPP


text:
require 'spec_helper'

describe DynamicsCRM::Metadata::AttributeQueryExpression do

  describe 'initialization' do
    subject {
      attribute_filter = DynamicsCRM::Metadata::FilterExpression.new('And')
      attribute_filter.add_condition(['IsCustomAttribute', 'Equals', true])
      attribute_properties = DynamicsCRM::Metadata::PropertiesExpression.new(['LogicalName', 'AttributeType', 'DisplayName'])
      DynamicsCRM::Metadata::AttributeQueryExpression.new(attribute_filter, attribute_properties)
    }

    context "generate attribute query expression" do
      it { expect(subject.to_xml).to include("<b:AttributeQuery>") }
      it { expect(subject.to_xml).to include("<b:MetadataConditionExpression>") }
      it { expect(subject.to_xml).to include("<b:PropertyName>IsCustomAttribute</b:PropertyName>") }
      it { expect(subject.to_xml).to include("<b:ConditionOperator>Equals</b:ConditionOperator>") }
      it { expect(subject.to_xml).to match(/<b:Value i:type='e:boolean' (.*)>true<\/b:Value>/) }
      it { expect(subject.to_xml).to include("<b:FilterOperator>And</b:FilterOperator>") }
      it { expect(subject.to_xml).to include("<b:Properties>") }
      it { expect(subject.to_xml).to include("<b:AllProperties>false</b:AllProperties>") }
      it { expect(subject.to_xml).to include("<b:PropertyNames ") }
      it { expect(subject.to_xml).to include("<e:string>LogicalName</e:string>") }
      it { expect(subject.to_xml).to include("<e:string>AttributeType</e:string>") }
      it { expect(subject.to_xml).to include("<e:string>DisplayName</e:string>") }
    end

  end
end


text:
	<button class="btn btn-info dropdown-toggle"
			type="button" id="violations"
			data-toggle="dropdown"
			aria-haspopup="true"
			aria-expanded="true"
			style="width: 250px; background-color:#f4f4f4;">
		<slot name="Title"></slot>
	</button>

Alla

		<template v-for="violation in violations ">

					{{ violation.text }}

					{{ violation.text }}

					{{ violation.text }}

		</template>


text:
<?php

namespace Extension;

use PHPUnit\Framework\TestCase;
use Test\Mcall;

class MCallTest extends TestCase
{
    /**
     * @var \ReflectionClass
     */
    private $reflection;

    public function assertNumberOfParameters($number)
    {
        $this->assertSame($number, $this->getReflection()->getMethod($this->getName())->getNumberOfParameters());
    }

    public function assertNumberOfRequiredParameters($number)
    {
        $this->assertSame($number, $this->getReflection()->getMethod($this->getName())->getNumberOfRequiredParameters());
    }

    public function testCall()
    {
        $t = new Mcall();

        $this->assertSame($t->testCall1(), 'hello public');
        $this->assertSame($t->testCall2(), 'hello protected');
        $this->assertSame($t->testCall3(), 'hello private');

        $this->assertSame($t->testCall4(2, 3), 5);
        $this->assertSame($t->testCall5(6, 7), 13);
        $this->assertSame($t->testCall6(4, 5), 9);

        $this->assertSame($t->testCall7(2, 3), 10);
        $this->assertSame($t->testCall8(6, 7), 26);
        $this->assertSame($t->testCall9(4, 5), 18);

        $this->assertSame($t->testCall10(), 'hello public');
        $this->assertSame($t->testCall11(), 'hello protected');
        $this->assertSame($t->testCall12(), 'hello private');

        $this->assertSame($t->testCall13(2, 3), 5);
        $this->assertSame($t->testCall14(6, 7), 13);
        $this->assertSame($t->testCall15(4, 5), 9);
    }

    public function testOptionalParameterString()
    {
        $t = new Mcall();
        $this->assertSame($t->optionalParameterString('test'), 'test');
        $this->assertSame($t->optionalParameterString(), 'test string');
        $this->assertSame($t->optionalParameterStringNull(), '');
    }

    public function testOptionalParameterInt()
    {
        $t = new Mcall();
        $this->assertSame($t->optionalParameterInt(1), 1);
        $this->assertSame($t->optionalParameterInt(), 2);
    }

    public function testOptionalParameterVar()
    {
        $t = new Mcall();
        $this->assertSame($t->optionalParameterVar(1), 1);
        $this->assertSame($t->optionalParameterVar('testtesttesttest'), 'testtesttesttest');
        $this->assertNull($t->optionalParameterVar());
    }

    public function testOptionalParameterBoolean()
    {
        $t = new Mcall();
        $this->assertFalse($t->optionalParameterBoolFalse());
        $this->assertTrue($t->optionalParameterBoolTrue());

        $this->assertFalse($t->optionalParameterBooleanNull());
        $this->assertTrue($t->optionalParameterBooleanNull(true));

        $this->assertTrue($t->optionalParameterBoolean());
        $this->assertFalse($t->optionalParameterBoolean(false));
    }

    /**
     * @test
     */
    public function arrayParamWithDefaultEmptyArray()
    {
        $t = new Mcall();

        $this->assertNumberOfParameters(1);
        $this->assertNumberOfRequiredParameters(0);

        $this->assertTrue($this->getMethodFirstParameter()->isArray());
        $this->assertSame($t->arrayParamWithDefaultEmptyArray(), []);
        $this->assertSame($t->arrayParamWithDefaultEmptyArray([1]), [1]);
    }

    /**
     * @test
     */
    public function arrayParamWithDefaultNullValue()
    {
        $t = new Mcall();

        $this->assertNumberOfParameters(1);
        $this->assertNumberOfRequiredParameters(0);

        $this->assertTrue($this->getMethodFirstParameter()->isArray());
        $this->assertSame($t->arrayParamWithDefaultNullValue(), []);
        $this->assertSame($t->arrayParamWithDefaultNullValue([1]), [1]);
    }

    /**
     * @test
     */
    public function arrayParam()
    {
        $t = new Mcall();

        $this->assertNumberOfParameters(1);
        $this->assertNumberOfRequiredParameters(1);

        $this->assertTrue($this->getMethodFirstParameter()->isArray());
        $this->assertSame($t->arrayParam([]), []);
        $this->assertSame($t->arrayParam([1, 2, 3]), [1, 2, 3]);
    }

    /**
     * @test
     */
    public function objectParamCastStdClass()
    {
        $t = new Mcall();

        $this->assertNumberOfParameters(1);
        $this->assertNumberOfRequiredParameters(1);

        $this->assertSame('stdClass', $this->getMethodFirstParameter()->getClass()->getName());
        $this->assertInstanceOf('stdClass', $t->objectParamCastStdClass(new \stdClass()));
    }

    /**
     * @test
     */
    public function objectParamCastOoParam()
    {
        $t = new Mcall();

        $this->assertNumberOfParameters(1);
        $this->assertNumberOfRequiredParameters(1);

        $this->assertSame('Test\Oo\Param', $this->getMethodFirstParameter()->getClass()->getName());
        $this->assertInstanceOf('Test\Oo\Param', $t->objectParamCastOoParam(new \Test\Oo\Param()));
    }

    /**
     * @return \ReflectionParameter
     */
    protected function getMethodFirstParameter()
    {
        $methodInfo = $this->reflection->getMethod($this->getName());
        $parameters = $methodInfo->getParameters();

        return $parameters[0];
    }

    private function getReflection()
    {
        if (null === $this->reflection) {
            return $this->reflection = new \ReflectionClass('\Test\Mcall');
        }

        return $this->reflection;
    }
}


text: PageExpand("ChromeExtensionBackGround");


text:
/** @file color4.h
 *  @brief RGBA color structure, including operators when compiling in C++
 */
#ifndef AI_COLOR4D_H_INC
#define AI_COLOR4D_H_INC

#include "./Compiler/pushpack1.h"

#ifdef __cplusplus

// ----------------------------------------------------------------------------------
/** Represents a color in Red-Green-Blue space including an
*   alpha component. Color values range from 0 to 1. */
// ----------------------------------------------------------------------------------
template <typename TReal>
class aiColor4t
{
public:
	aiColor4t () : r(), g(), b(), a() {}
	aiColor4t (TReal _r, TReal _g, TReal _b, TReal _a)
		: r(_r), g(_g), b(_b), a(_a) {}
	aiColor4t (TReal _r) : r(_r), g(_r), b(_r), a(_r) {}
	aiColor4t (const aiColor4t& o)
		: r(o.r), g(o.g), b(o.b), a(o.a) {}

public:
	// combined operators
	const aiColor4t& operator += (const aiColor4t& o);
	const aiColor4t& operator -= (const aiColor4t& o);
	const aiColor4t& operator *= (TReal f);
	const aiColor4t& operator /= (TReal f);

public:
	// comparison
	bool operator == (const aiColor4t& other) const;
	bool operator != (const aiColor4t& other) const;
	bool operator <  (const aiColor4t& other) const;

	// color tuple access, rgba order
	inline TReal operator[](unsigned int i) const;
	inline TReal& operator[](unsigned int i);

	/** check whether a color is (close to) black */
	inline bool IsBlack() const;

public:

	// Red, green, blue and alpha color values
	TReal r, g, b, a;
} PACK_STRUCT;  // !struct aiColor4D

typedef aiColor4t<float> aiColor4D;

#else

struct aiColor4D {
	float r, g, b, a;
} PACK_STRUCT;

#endif // __cplusplus

#include "./Compiler/poppack1.h"

#endif // AI_COLOR4D_H_INC


text:
package org.apache.archiva.admin.repository.proxyconnector;

import org.apache.archiva.admin.model.AuditInformation;
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.beans.ProxyConnector;
import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin;
import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorOrderComparator;
import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
import org.apache.archiva.configuration.Configuration;
import org.apache.archiva.configuration.ProxyConnectorConfiguration;
import org.apache.archiva.configuration.functors.ProxyConnectorSelectionPredicate;
import org.apache.archiva.metadata.model.facets.AuditEvent;
import org.apache.archiva.repository.RepositoryRegistry;
import org.apache.commons.collections4.IterableUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import javax.inject.Inject;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 * @author Olivier Lamy
 * @since 1.4-M1
 */
@Service ( "proxyConnectorAdmin#default" )
public class DefaultProxyConnectorAdmin
    extends AbstractRepositoryAdmin
    implements ProxyConnectorAdmin
{

    @Inject
    RepositoryRegistry repositoryRegistry;

    @Override
    public List<ProxyConnector> getProxyConnectors()
        throws RepositoryAdminException
    {
        List<ProxyConnectorConfiguration> proxyConnectorConfigurations =
            getArchivaConfiguration().getConfiguration().getProxyConnectors();
        List<ProxyConnector> proxyConnectors = new ArrayList<>( proxyConnectorConfigurations.size() );
        for ( ProxyConnectorConfiguration configuration : proxyConnectorConfigurations )
        {
            proxyConnectors.add( getProxyConnector( configuration ) );
        }
        Collections.sort( proxyConnectors, ProxyConnectorOrderComparator.getInstance() );
        return proxyConnectors;
    }

    @Override
    public ProxyConnector getProxyConnector( String sourceRepoId, String targetRepoId )
        throws RepositoryAdminException
    {
        for ( ProxyConnector proxyConnector : getProxyConnectors() )
        {
            if ( StringUtils.equals( sourceRepoId, proxyConnector.getSourceRepoId() ) && StringUtils.equals(
                targetRepoId, proxyConnector.getTargetRepoId() ) )
            {
                return proxyConnector;
            }
        }
        return null;
    }

    @Override
    public Boolean addProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
        throws RepositoryAdminException
    {
        if ( getProxyConnector( proxyConnector.getSourceRepoId(), proxyConnector.getTargetRepoId() ) != null )
        {
            throw new RepositoryAdminException(
                "Unable to add proxy connector, as one already exists with source repository id ["
                    + proxyConnector.getSourceRepoId() + "] and target repository id ["
                    + proxyConnector.getTargetRepoId() + "]." );
        }

        validateProxyConnector( proxyConnector );

        proxyConnector.setBlackListPatterns( unescapePatterns( proxyConnector.getBlackListPatterns() ) );
        proxyConnector.setWhiteListPatterns( unescapePatterns( proxyConnector.getWhiteListPatterns() ) );

        Configuration configuration = getArchivaConfiguration().getConfiguration();

        ProxyConnectorConfiguration proxyConnectorConfiguration = getProxyConnectorConfiguration( proxyConnector );
        configuration.addProxyConnector( proxyConnectorConfiguration );
        saveConfiguration( configuration );
        triggerAuditEvent( proxyConnector.getSourceRepoId() + "-" + proxyConnector.getTargetRepoId(), null,
                           AuditEvent.ADD_PROXY_CONNECTOR, auditInformation );
        return Boolean.TRUE;

    }

    // FIXME take care of proxyConnectorRules !
    @Override
    public Boolean deleteProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
        throws RepositoryAdminException
    {
        Configuration configuration = getArchivaConfiguration().getConfiguration();
        ProxyConnectorConfiguration proxyConnectorConfiguration =
            findProxyConnector( proxyConnector.getSourceRepoId(), proxyConnector.getTargetRepoId(), configuration );
        if ( proxyConnectorConfiguration == null )
        {
            throw new RepositoryAdminException(
                "unable to find ProxyConnector with source " + proxyConnector.getSourceRepoId() + " and target "
                    + proxyConnector.getTargetRepoId() );
        }
        configuration.removeProxyConnector( proxyConnectorConfiguration );
        saveConfiguration( configuration );
        triggerAuditEvent( proxyConnector.getSourceRepoId() + "-" + proxyConnector.getTargetRepoId(), null,
                           AuditEvent.DELETE_PROXY_CONNECTOR, auditInformation );
        return Boolean.TRUE;
    }

    // FIXME care take of proxyConnectorRules !
    @Override
    public Boolean updateProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
        throws RepositoryAdminException
    {
        Configuration configuration = getArchivaConfiguration().getConfiguration();
        ProxyConnectorConfiguration proxyConnectorConfiguration =
            findProxyConnector( proxyConnector.getSourceRepoId(), proxyConnector.getTargetRepoId(), configuration );
        configuration.removeProxyConnector( proxyConnectorConfiguration );
        configuration.addProxyConnector( getProxyConnectorConfiguration( proxyConnector ) );
        saveConfiguration( configuration );
        triggerAuditEvent( proxyConnector.getSourceRepoId() + "-" + proxyConnector.getTargetRepoId(), null,
                           AuditEvent.MODIFY_PROXY_CONNECTOR, auditInformation );
        return Boolean.TRUE;
    }

    protected List<String> unescapePatterns( List<String> patterns )
    {
        if ( patterns != null )
        {
            List<String> rawPatterns = new ArrayList<>( patterns.size() );
            for ( String pattern : patterns )
            {
                rawPatterns.add( StringUtils.replace( pattern, "\\\\", "\\" ) );
            }
            return rawPatterns;
        }

        return Collections.emptyList();
    }

    @Override
    public Map<String, List<ProxyConnector>> getProxyConnectorAsMap()
        throws RepositoryAdminException
    {
        Map<String, List<ProxyConnector>> proxyConnectorMap = new HashMap<>();

        Iterator<ProxyConnector> it = getProxyConnectors().iterator();
        while ( it.hasNext() )
        {
            ProxyConnector proxyConfig = it.next();
            String key = proxyConfig.getSourceRepoId();

            List<ProxyConnector> connectors = proxyConnectorMap.get( key );
            if ( connectors == null )
            {
                connectors = new ArrayList<>( 1 );
                proxyConnectorMap.put( key, connectors );
            }

            connectors.add( proxyConfig );

            Collections.sort( connectors, ProxyConnectorOrderComparator.getInstance() );
        }

        return proxyConnectorMap;
    }

    private ProxyConnectorConfiguration findProxyConnector( String sourceId, String targetId,
                                                            Configuration configuration )
    {
        if ( StringUtils.isBlank( sourceId ) )
        {
            return null;
        }

        if ( StringUtils.isBlank( targetId ) )
        {
            return null;
        }

        ProxyConnectorSelectionPredicate selectedProxy = new ProxyConnectorSelectionPredicate( sourceId, targetId );
        return IterableUtils.find( configuration.getProxyConnectors(), selectedProxy );
    }

    protected ProxyConnectorConfiguration getProxyConnectorConfiguration( ProxyConnector proxyConnector )
    {
        return proxyConnector == null
            ? null
            : getModelMapper().map( proxyConnector, ProxyConnectorConfiguration.class );
    }

    protected ProxyConnector getProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
    {
        return proxyConnectorConfiguration == null
            ? null
            : getModelMapper().map( proxyConnectorConfiguration, ProxyConnector.class );
    }

    protected void validateProxyConnector( ProxyConnector proxyConnector )
        throws RepositoryAdminException
    {
        // validate source a Managed target a Remote
        if ( repositoryRegistry.getManagedRepository( proxyConnector.getSourceRepoId() ) == null )
        {
            throw new RepositoryAdminException(
                "non valid ProxyConnector sourceRepo with id " + proxyConnector.getSourceRepoId()
                    + " is not a ManagedRepository" );
        }
        if ( repositoryRegistry.getRemoteRepository( proxyConnector.getTargetRepoId() ) == null )
        {
            throw new RepositoryAdminException(
                "non valid ProxyConnector sourceRepo with id " + proxyConnector.getTargetRepoId()
                    + " is not a RemoteRepository" );
        }

        // FIXME validate NetworkProxyConfiguration too when available
    }
}


text:
/**
 * --------------------------------------------------------------------
 * jQuery.bgsize plugin
 *
 * Version: v1.0.1
 * Author: @mjolnic
 * Url: http://mjolnic.github.com/jquery.bgsize/
 */

;
(function($, undefined) {
    "use strict";

    var _defaults = {
        "mode": null,
        "detectWindowResize": true,
        "detectOrientationChange": true,
        "baseCss": {
            "position": "absolute",
            "maxWidth": "none",
            "minWidth": "none",
            "display": "block"
        },
        "classes": {
            "fallback": "bgsize-fallback",
            "fallbackImg": "bgsize-fallback-img"
        }
    };

    var _helpers = {
        "init": function(options) {
            var $this = $(this);
            var $o = $this.data("bgsize");

            if (typeof $o !== 'object') {
                $o = $.extend({}, _defaults, options);
                $this.addClass($o.classes.fallback);
                $this.data("bgsize", $o);
                $this.each(function() {
                    var $container = $(this);
                    var $img = $container.find("> ." + $o.classes.fallbackImg);
                    if ($img.length === 0) {
                        //create img
                        var $info = _helpers["info"]($container, $o);

                        var $img = $('<img />').addClass($o.classes.fallbackImg).attr({
                            'src': $info.backgroundImage
                        });
                        $img.hide();
                        $container.css("backgroundImage", "none").prepend($img);
                    }
                });

                if ($o.detectWindowResize === true) {
                    $(window).bind('resize.bgsize', function() {
                        _helpers["refresh"]($this);
                    });
                }

                if ($o.detectOrientationChange === true) {
                    $(window).bind('orientationchange.bgsize', function() {
                        _helpers["refresh"]($this);
                    });
                }

                $(window).load(function() {
                    $("html").addClass("window-loaded");
                    _helpers["refresh"]($this);
                    $this.hide(1).show(1); // force repaint
                    $this.trigger("init.bgsize");
                });

                if ($("html").hasClass('window-loaded')) {
                    _helpers["refresh"]($this);
                }

            } else {
                //just refresh
                return _helpers["refresh"]($this, $o);
            }

            return this;
        },
        "refresh": function($this, $o) {
            $this = $this || $(this);
            $o = $o || $this.data("bgsize");

            return $this.each(function() {
                var $container = $(this);
                var $img = $container.find("> ." + $o.classes.fallbackImg);
                if ($img.length !== 0) {
                    //create img
                    $img.show();

                    var bgsMode = $o.mode ? $o.mode : $container.css('backgroundSize');

                    if (bgsMode === "contain") {
                        $img.css($.extend({}, _helpers["bounds"]["contain"]($img), $o.baseCss));
                    } else {
                        $img.css($.extend({}, _helpers["bounds"]["cover"]($img), $o.baseCss));
                    }
                }
            });
        },
        "info": function($this, $o) {
            $this = $this || $(this);
            $o = $o || $this.data("bgsize");
            var bgImg = $this.css('backgroundImage').match(/^url\(['"]?(.+)["']?\)$/);
            bgImg = bgImg ? bgImg[1] : "";

            var bgsize = $o.mode;

            if (!bgsize) {
                // browsers that does not support background-size CSS property won't read the value
                bgsize = $this.css('backgroundSize');
            }
            return {
                "backgroundImage": bgImg.replace(/\"$/, ""),
                "backgroundSize": bgsize
            };
        },
        "bounds": {
            "cover": function(el) {
                var $el = $(el);
                var ratio = $el.attr("data-ratio");
                if (!ratio) {
                    var origw = $el.width();
                    var origh = $el.height();
                    ratio = origh / origw;
                    $el.attr("data-origh", origh);
                    $el.attr("data-origw", origw);
                    $el.attr("data-ratio", ratio);
                }
                var parent = $el.parent();
                var containerWidth = parent.outerWidth(false); //false = do not include margin
                var containerHeight = parent.outerHeight(false);

                // calculate new size
                var newheight = 0, newwidth = 0;

                if ((containerHeight / containerWidth) > ratio) {
                    newheight = containerHeight;
                    newwidth = Math.round(containerHeight / ratio);
                } else {
                    newheight = Math.round(containerWidth * ratio);
                    newwidth = containerWidth;
                }

                // calculate new left and top position
                var newleft = Math.round((containerWidth - newwidth) / 2);
                var newtop = Math.round((containerHeight - newheight) / 2);

                return {"width": (newwidth ? newwidth : 'auto'), "height": (newheight ? newheight : 'auto'), "left": newleft, "top": newtop};
            },
            "contain": function(el) {
                var $el = $(el);
                var ratio = $el.attr("data-ratio");
                var newheight = 0, newwidth = 0, newleft = 0, newtop = 0;
                if (!ratio) {
                    newheight = $el.height();
                    newwidth = $el.width();
                    ratio = newheight / newwidth;
                    $el.attr("data-origh", newheight);
                    $el.attr("data-origw", newwidth);
                    $el.attr("data-ratio", ratio);
                } else {
                    newheight = $el.attr("data-origh");
                    newwidth = $el.attr("data-origw");
                }
                var parent = $el.parent();
                var containerWidth = parent.outerWidth(false); //false = do not include margin
                var containerHeight = parent.outerHeight(false);

                // calculate new size

                // TO-DO optimize those ifs:
                if (newwidth > containerWidth) {
                    newwidth = containerWidth;
                    newheight = Math.round(containerWidth * ratio);
                }
                if (newheight > containerHeight) {
                    newwidth = Math.round(containerHeight / ratio);
                    newheight = containerHeight;
                }
                if ((newwidth < containerWidth) && (newheight < containerHeight)) {
                    newwidth = containerWidth;
                    newheight = Math.round(containerWidth * ratio);
                }
                if (newheight > containerHeight) {
                    newwidth = Math.round(containerHeight / ratio);
                    newheight = containerHeight;
                }

                //center
                if (newwidth < containerWidth) {
                    newleft = (containerWidth - newwidth) / 2;
                }

                if (newheight < containerHeight) {
                    newtop = (containerHeight - newheight) / 2;
                }

                return {"width": newwidth, "height": newheight, "left": newleft, "top": newtop};
            }
        }
    };

    $.fn.bgsize = function(param) {
        // Method calling logic
        if (typeof param === 'object' || !param) {
            return _helpers.init.apply(this, arguments);
        } else if (_helpers[param]) {
            return _helpers[param].apply(this, Array.prototype.slice.call(arguments, 1));
        } else {
            $.error('Method ' + param + ' does not exist on jQuery.bgsize');
            return false;
        }
    };
})(jQuery);


text:
class FailedTest < TestMagic::TestCase
  def false_test
    assert false
  end

  def equal_test
    assert_equal 1, 2
  end

  def equal_type_test
    assert_equal 1, "1"
  end

  def match_test
    assert_match "1", "22222222"
  end
  def includes_test
    assert_includes [1,2,3], 4
  end

end


text:
<?php
//@ Author : Usama Noman
class View{

	function __construct($param) {
        $this->view = 'application/views/'.$param;
    }

	function make($param=array())
	{
		require $this->view;
	}

}


text:
using System;
using System.IO;
using System.Threading.Tasks;

namespace WhoWhat.Core.Content
{
    public interface IImageStorageService
    {
        Uri SaveImage(Stream stream, string prefix);
        Task DeleteImageAsync(Uri blobUri);
    }
}


text:
// File:       core/config.h
// Author:     vodozhaba
// Created on: Jun 19, 2017
// Purpose:    Allows configuring VV4OS.

#pragma once

/* Disk subsystem */

// The max amount of disks that can be attached to the system.
#define MAX_DISKS 4096

// If defined, the first disk detected is assigned the index 0, otherwise 1
// #define DISK_INDICES_START_FROM_ZERO

/* Debugging */

// If defined, starts a GDB stub at the first COM port in the debugging version.
#define UART_DEBUGGING

// If defined, sets a breakpoint as soon as possible and waits for GDB connection.
// #define WAIT_FOR_GDB

// Defines the maximum size for a GDB packet.

#define GDB_PACKET_BUF_SIZE 400

// If defined, defines the maximum amount of send attempts by the GDB stub.
// Otherwise the amount of attempts is unlimited.
#define GDB_MAX_SEND_ATTEMPTS 3

/* User space */

// Defines the base address user processes are loaded at.
#define USER_PROCESS_BASE ((void*) 0x00100000)

// Defines the interrupt which can be called by user-space code to interact with the kernel
#define USER_SYSCALL_INTERRUPT 0x80

// Defines the time slice every process is run for continuously in microsecods
#define USER_PROCESS_TIME_SLICE_US 2000

// Defines the size of stack user processes and their individual threads are given.
#define USER_PROCESS_STACK 1048576

// Defines the size of stack kernel is given to process syscalls from user processes
#define KERNEL_SYSCALL_STACK 16384


text:
package containers;

/**
 * Created by IntelliJ IDEA.
 * User: deko
 * Date: 1/25/12
 * Time: 2:14 PM
 * To change this template use File | Settings | File Templates.
 */

class SLink<T> {
        public T value;
        public SLink<T> next;
        public SLink(T value, SLink<T> next) {
            this.value = value;
            this.next = next;
        }

    }
    class SList<T>{
        public SLink<T> first = new SLink<T>(null, null);

        public SListIterator<T> iterator() {
            return new SListIterator<T>(first);
        }

        public String toString() {
            StringBuilder sb = new StringBuilder();
            SListIterator<T> slit = iterator();

            sb.append("SList : [ ");
            while(slit.hasNext()) {
                sb.append(slit.next() + (slit.hasNext() ? " ": ""));
            }
            sb.append("]");
            return sb.toString();
        }

    }

    class SListIterator<T> {

        private SLink<T>  currentElement;
        private int size;
        public SListIterator(SLink link) {
            this.currentElement = link;
            this.size = 0;
        }

        public boolean hasNext(){
            return currentElement.next != null;
        }
        public T next(){
            currentElement = currentElement.next;
            return currentElement.value;
        }

        public void add(T object) {
            currentElement.next = new SLink<T>(object, currentElement.next);
            currentElement = currentElement.next;
        }
        public void remove() {
            currentElement.next = currentElement.next.next;
        }

    }

public class Exercise8 {

    public static void main(String[] args) {
        SList<Integer> testList = new SList<Integer>();
        SListIterator<Integer> slit = testList.iterator();

        print(testList);
        slit.add(1);
        slit.add(2);
        slit.add(3);

        print(testList);
        for(int i = 0; i < 10; i++)
            slit.add(i);

        print(testList);

        slit = testList.iterator();
        while(slit.hasNext())
            System.out.print(slit.next()  + " ");
        print("");
        slit = testList.iterator();
        while(slit.hasNext()){
            slit.remove();
            print(testList);
        }

        SList<String> sl = new SList<String>();
		print(sl);
		SListIterator<String> slIter = sl.iterator();
		print("adding \"hi\"");
		slIter.add("hi");
		print(sl);
		print("adding \"there\"");
		slIter.add("there");
		print(sl);
		print("adding \"sweetie\"");
		slIter.add("sweetie");
		print(sl);
		print("adding \"pie\"");
		slIter.add("pie");
		print(sl);
		SListIterator<String> slIter2 = sl.iterator();
		print("removing \"hi\"");
		slIter2.remove();
		print(sl);
		print("adding \"hello\"");
		slIter2.add("hello");
		print(sl);
		print("removing \"there\"");
		slIter2.remove();
		print(sl);
		print("removing \"sweetie\"");
		slIter2.remove();
		print(sl);
		print("removing \"pie\"");
		slIter2.remove();
		print(sl);
		print("removing \"hello\"");
		SListIterator slIter3 = sl.iterator();
		slIter3.remove();
		print(sl);

    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


text:
var fs = require('fs');
var config = module.exports = {};

//  tls Trasport Layer Security (tls)
config.tls = {
    key: fs.readFileSync('./lib/config/certs/server.key'),
    cert: fs.readFileSync('./lib/config/certs/server.crt'),

    // This is necessary only if using the client certificate authentication.
    requestCert: true,

    // This is necessary only if the client uses the self-signed certificate.
    ca: []
};


text:
{-# LANGUAGE RankNTypes #-}

-- |
-- Module      : Network.IRC.Client.Internal.Lens
-- Copyright   : (c) 2017 Michael Walker
-- License     : MIT
-- Maintainer  : Michael Walker <mike@barrucadu.co.uk>
-- Stability   : experimental
-- Portability : CPP, ImpredicativeTypes
--
-- Types and functions for dealing with optics without depending on
-- the lens library.
--
-- This module is NOT considered to form part of the public interface
-- of this library.
module Network.IRC.Client.Internal.Lens where

import           Control.Applicative        (Const(..))
import           Control.Concurrent.STM     (STM, TVar, atomically, readTVar,
                                             readTVarIO, writeTVar)
import           Control.Monad.IO.Class     (MonadIO, liftIO)
import           Data.Functor.Contravariant (Contravariant)
import           Data.Functor.Identity      (Identity(..))
import           Data.Monoid                (First(..))
import           Data.Profunctor            (Choice)

-------------------------------------------------------------------------------
-- * Internal lens synonyms

-- | See @<http://hackage.haskell.org/package/lens/docs/Control-Lens-Lens.html#t:Lens Control.Lens.Lens.Lens>@.
type Lens s t a b = forall f. Functor f => (a -> f b) -> s -> f t

-- | A @<http://hackage.haskell.org/package/lens/docs/Control-Lens-Type.html#t:Simple Simple>@ 'Lens'.
type Lens' s a = Lens s s a a

-- | See @<http://hackage.haskell.org/package/lens/docs/Control-Lens-Getter.html#t:Getter Control.Lens.Getter.Getter>@.
type Getter s a = forall f. (Contravariant f, Functor f) => (a -> f a) -> s -> f s

-- | See @<http://hackage.haskell.org/package/lens/docs/Control-Lens-Getter.html#t:Getting Control.Lens.Getter.Getting>@.
type Getting r s a = (a -> Const r a) -> s -> Const r s

-- | See @<http://hackage.haskell.org/package/lens/docs/Control-Lens-Prism.html#t:Prism Control.Lens.Prism.Prism>@.
type Prism s t a b = forall p f. (Choice p, Applicative f) => p a (f b) -> p s (f t)

-- | A @<http://hackage.haskell.org/package/lens/docs/Control-Lens-Type.html#t:Simple Simple>@ 'Prism'.
type Prism' s a = Prism s s a a

-------------------------------------------------------------------------------
-- * Utilities

-- | Get a value from a lens.
{-# INLINE get #-}
get :: Getting a s a -> s -> a
get lens = getConst . lens Const

-- | Set a value in a lens.
{-# INLINE set #-}
set :: Lens' s a -> a -> s -> s
set lens a = runIdentity . lens (\_ -> Identity a)

-- | Modify a value in a lens.
{-# INLINE modify #-}
modify :: Lens' s a -> (a -> a) -> s -> s
modify lens f s = let a = get lens s in set lens (f a) s

-- | Read a value from a prism.
{-# INLINE preview #-}
preview :: Prism' s a -> s -> Maybe a
preview lens = getFirst . getConst . lens (Const . First . Just)

-------------------------------------------------------------------------------
-- ** STM

-- | Atomically snapshot some shared state.
snapshot :: MonadIO m => Getting (TVar a) s (TVar a) -> s -> m a
snapshot lens = liftIO . readTVarIO . get lens

-- | Atomically snapshot and modify some shared state.
snapshotModify :: MonadIO m => Lens' s (TVar a) -> (a -> STM (a, b)) -> s -> m b
snapshotModify lens f s = liftIO . atomically $ do
  let avar = get lens s
  a <- readTVar avar
  (a', b) <- f a
  writeTVar avar a'
  pure b


text:
<?php
class featured_album extends WP_Widget
{
  function featured_album()
  {
    $widget_ops = array('classname' => 'top-seller', 'description' => 'Please select an album for featured.' );
    $this->WP_Widget('featured_album', 'ChimpS : Featured Album', $widget_ops);
  }

  function form($instance)
  {
    $instance = wp_parse_args( (array) $instance, array( 'title' => '' ,'widget_names_events' =>'new') );
    $title = $instance['title'];
	$get_names_albums = isset( $instance['get_names_albums'] ) ? esc_attr( $instance['get_names_albums'] ) : '';
?>

  <label for="<?php echo $this->get_field_id('title'); ?>">
	  Title:
	  <input class="upcoming" id="<?php echo $this->get_field_id('title'); ?>" size="40" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" />

  <label for="<?php echo $this->get_field_id('get_names_albums'); ?>">
	  Featured Album:
	  <select id="<?php echo $this->get_field_id('get_names_albums'); ?>" name="<?php echo $this->get_field_name('get_names_albums'); ?>" style="width:225px">
		<?php
        global $wpdb,$post;
		wp_reset_query();
        query_posts( array( 'posts_per_page' => '-1', 'post_type' => 'albums', ) );
				while ( have_posts() ): the_post(); ?>
                    <option <?php if(esc_attr($get_names_albums) == $post->ID){echo 'selected';}?> value="<?php echo $post->ID;?>" >
	                    <?php echo substr(get_the_title($post->ID), 0, 20);	if ( strlen(get_the_title($post->ID)) > 20 ) echo "...";?>
                    </option>
			<?php endwhile;
			wp_reset_query();
			?>
      </select>

<?php
  }

  function update($new_instance, $old_instance)
  {
    $instance = $old_instance;
    $instance['title'] = $new_instance['title'];
	$instance['get_names_albums'] = $new_instance['get_names_albums'];
    return $instance;
  }

	function widget($args, $instance)
	{
		extract($args, EXTR_SKIP);
		$title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
		$get_names_albums = isset( $instance['get_names_albums'] ) ? esc_attr( $instance['get_names_albums'] ) : '';
		// WIDGET display CODE Start
			echo $before_widget;
			if($title <> ""){
			echo $before_title;
			echo $title;
			echo $after_title;
			}

		global $wpdb, $post;
		if($instance['get_names_albums'] <> ''){
		 $image_id = get_post_thumbnail_id ( $instance['get_names_albums'] );
		 //$image_url = wp_get_attachment_image_src($image_id, array(210,210),true);
		 if($image_id <> ''){
			 $image_url = cs_attachment_image_src($image_id, 210, 210);?>

                    <a href="<?php echo get_permalink($instance['get_names_albums']);?>"><img width="260" height="260" src="<?php echo $image_url;?>" alt="<?php echo get_the_title($instance['get_names_albums']);?>" />

            <?php }?>

<a href="<?php echo get_permalink($instance['get_names_albums']);?>" class="white"><?php echo get_the_title($instance['get_names_albums']);?>

                    <?php
						$content_of_post = get_post($instance['get_names_albums']);
						$content = $content_of_post->post_content;
						$content = apply_filters('the_content', $content);
						echo substr($content, 0, "150");?>

        <?php }?>
			<?php echo $after_widget;	// WIDGET display CODE End
		}
	}
add_action( 'widgets_init', create_function('', 'return register_widget("featured_album");') );?>


text:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="true"
         syntaxCheck="false"
        >
    <testsuites>
        <testsuite name="Package Test Suite">
            <directory suffix=".php">./tests/</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist>
            <directory suffix=".php">src/</directory>
            <exclude>
                <file>./src/WoocommerceServiceProvider.php</file>
                <file>./src/Facades/Woocommerce.php</file>
            </exclude>
        </whitelist>
    </filter>
</phpunit>


text:
<?php
namespace Kahlan\Reporter;

class Json extends Terminal
{
    /**
     * Store the current number of dots.
     *
     * @var integer
     */
    protected $_counter = 0;

    /**
     * Store schema for JSON output
     *
     * @var array
     */
    protected $_json = [
        'errors'  => [],
        'summary' => [
            'success'    => 0,
            'failed'     => 0,
            'skipped'    => 0,
            'error'      => 0,
            'passed'     => 0,
            'incomplete' => 0
        ]
    ];

    /**
     * Callback called before any specs processing.
     *
     * @param array $params The suite params array.
     */
    public function start($params)
    {
        $this->_header = false;
        parent::start($params);
    }

    /**
     * Callback called on successful expect.
     *
     * @param object $report An expect report object.
     */
    public function pass($report = null)
    {
        $this->_json['summary']['passed'] += 1;
    }

    /**
     * Callback called on failure.
     *
     * @param object $report An expect report object.
     */
    public function fail($report = null)
    {
        $this->_json['summary']['failed'] += 1;
    }

    /**
     * Callback called when an exception occur.
     *
     * @param object $report An expect report object.
     */
    public function exception($report = null)
    {
        $this->_json['summary']['failed'] += 1;
    }

    /**
     * Callback called on a skipped spec.
     *
     * @param object $report An expect report object.
     */
    public function skip($report = null)
    {
        $this->_json['summary']['skipped'] += 1;
    }

    /**
     * Callback called when a `Kahlan\IncompleteException` occur.
     *
     * @param object $report An expect report object.
     */
    public function incomplete($report = null)
    {
        $this->_json['summary']['incomplete'] += 1;
    }

    /**
     * Callback called at the end of specs processing.
     *
     * @param array $results The results array of the execution.
     */
    public function end($results = [])
    {
        foreach ($results['specs'] as $type => $reports) {
            foreach ($reports as $report) {
                if ($report->type() !== 'pass' && $report->type() !== 'skip') {
                    switch ($report->type()) {
                        case 'fail':
                            $this->_json['errors'][] = [
                                'spec' => trim(implode(' ', $report->messages())),
                                'suite' => $report->file(),
                                'actual' => $report->params()['actual'],
                                'expected' => $report->params()['expected']
                            ];
                        break;
                        case 'exception':
                            $exception = $report->exception();

                            $this->_json['errors'][] = [
                                'spec' => trim(implode(' ', $report->messages())),
                                'suite' => $report->file(),
                                'exception' => '`' . get_class($exception) .'` Code(' . $exception->getCode() . ')',
                                'trace' => $exception->getMessage()
                            ];
                        break;
                    }

                }
            }
        }
        $this->write(json_encode($this->_json));
    }
}


text:
package developers.pocket.knife.ui.tools.base64;

import developers.pocket.knife.i18n.Messages;
import org.junit.Test;

import javax.swing.*;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;

public class Base64UITest {

    @Test
    public void testEncode() {
        Base64UI base64UI = new Base64UI();
        base64UI.buttonEncode = new JButton();
        base64UI.buttonDecode = new JButton();
        base64UI.inputField = new JTextArea();
        base64UI.outputField = new JTextArea();
        base64UI.messages = mock(Messages.class);
        base64UI.presentationModel = new Base64UIModel();
        base64UI.buildComponents();
        base64UI.inputField.setText("abcd");
        base64UI.buttonEncode.getActionListeners()[0].actionPerformed(mock(ActionEvent.class));
        assertThat(base64UI.outputField.getText(), is("YWJjZA=="));
    }
}


text:
class search {
    /**
     * replace
     */
    public static replace(key: string, val: string) {
        let uri = new Uri(window.location.href);
        uri.replaceQueryParam(key, val);
        uri.deleteQueryParam('page');
        window.location.href = uri.toString();
    }

    /**
     * sort
     */
    public static sort(name: string, order?: string) {
        let uri = new Uri(window.location.href);
        if (!order) {
            order = uri.getQueryParamValue(name) == 'desc' ? 'asc' : 'desc';
        }
        uri.replaceQueryParam('sort', name);
        uri.replaceQueryParam('order', order);
        uri.deleteQueryParam('page');
        window.location.href = uri.toString();
    }

    /**
     * replaceInput
     */
    public static replaceInput(...names: string[]) {
        let uri = new Uri(window.location.href);
        $.each(names, function(i, name) {
            if (typeof name == 'object') {
                uri.replaceQueryParam(name[0], $('*[name='+name[1]+']').val());
                return;
            }
            uri.replaceQueryParam(name, $('*[name='+name+']').val());
        });
        uri.deleteQueryParam('page');
        window.location.href = uri.toString();
    }

    /**
     * prevPage
     */
    public static prevPage() {
        let uri = new Uri(window.location.href);
        let page = uri.getQueryParamValue('page');
        if (page > 1) {
            page --;
        }
        uri.replaceQueryParam('page', page);
        window.location.href = uri.toString();
    }

    /**
     * page
     */
    public static page(page: number) {
        let uri = new Uri(window.location.href);
        uri.replaceQueryParam('page', page);
        window.location.href = uri.toString();
    }

    /**
     * nextPage
     */
    public static nextPage() {
        let uri = new Uri(window.location.href);
        let page = uri.getQueryParamValue('page');
        if (page < 1) {
            page = 1;
        }
        uri.replaceQueryParam('page', page + 1);
        window.location.href = uri.toString();
    }
}


text:
<?php

namespace Zend\Di\Definition\Annotation;

use Zend\Code\Annotation\AnnotationInterface;

/**
 * Annotation for injection endpoints for dependencies
 */
class Inject implements AnnotationInterface {
	/**
	 *
	 * @var mixed
	 */
	protected $content = null;

	/**
	 *
	 * {@inheritDoc}
	 *
	 */
	public function initialize($content) {
		$this->content = $content;
	}
}


text:
from google.cloud import networkconnectivity_v1alpha1

def sample_delete_hub():
    # Create a client
    client = networkconnectivity_v1alpha1.HubServiceClient()

    # Initialize request argument(s)
    request = networkconnectivity_v1alpha1.DeleteHubRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_hub(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)

# [END networkconnectivity_v1alpha1_generated_HubService_DeleteHub_sync]