text:
from __future__ import unicode_literals

from django.db import models, migrations
import django.utils.timezone
import model_utils.fields

class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
                ('meetup_id', models.CharField(max_length=32)),
                ('meetup_url', models.URLField(max_length=256)),
                ('title', models.CharField(max_length=128)),
                ('date', models.DateTimeField(null=True, blank=True)),
            ],
            options={
                'ordering': ['-date'],
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='Member',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
                ('meetup_id', models.CharField(max_length=32)),
                ('name', models.CharField(max_length=128)),
                ('join_date', models.DateTimeField(null=True, blank=True)),
                ('thumb_link', models.ImageField(max_length=256, null=True, upload_to=b'', blank=True)),
            ],
            options={
                'abstract': False,
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='MemberRSVP',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
                ('meetup_id', models.CharField(max_length=32)),
                ('join_date', models.DateTimeField(null=True, blank=True)),
                ('worked_on', models.CharField(max_length=128, null=True, blank=True)),
                ('event', models.ForeignKey(related_name='rsvps', to='core.Event')),
                ('member', models.ForeignKey(related_name='events', to='core.Member')),
            ],
            options={
                'abstract': False,
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='Venue',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
                ('meetup_id', models.CharField(max_length=32)),
                ('name', models.CharField(max_length=128)),
                ('longitude', models.CharField(max_length=128)),
                ('latitude', models.CharField(max_length=128)),
            ],
            options={
                'abstract': False,
            },
            bases=(models.Model,),
        ),
        migrations.AddField(
            model_name='event',
            name='venue',
            field=models.ForeignKey(related_name='events', to='core.Venue'),
            preserve_default=True,
        ),
    ]


text:
interface A {
    [x: number]: string; // error
}

interface A {
    [x: string]: { length: string }; // error
}

interface A2 {
    [x: number]: string;
    'a': number; //error
}

interface A2 {
    [x: string]: { length: number };
    1: { length: number }; // error
}

//// [mergedInterfacesWithIndexers2.js]

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace SofaChamps\Bundle\CoreBundle\RequestProcessor;

use JMS\DiExtraBundle\Annotation as DI;
use SofaChamps\Bundle\CoreBundle\Entity\User;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;

/**
 * TargetUrlProcessor
 *
 * @DI\Service
 * @DI\Tag("sofachamps.request_processor.login", attributes={"priority": -255})
 */
class TargetUrlProcessor implements LoginRequestProcessor
{
    public function processLoginRequest(Request $request, User $user)
    {
        return new RedirectResponse($this->getTargetUrl($request));
    }

    protected function getTargetUrl(Request $request)
    {
        if ($targetUrl = $request->get('_target_path', null, true)) {
            return $targetUrl;
        }

        // This is because the firewall is named "main"
        $sessionKey = '_security.main.target_path';
        if ($targetUrl = $request->getSession()->get($sessionKey)) {
            $request->getSession()->remove($sessionKey);

            return $targetUrl;
        }

        return '/';
    }
}


text:
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');

$GLOBALS['TL_LANG']['tl_user']['faqs'] = array('Catégories de FAQ autorisées', 'Vous pouvez accorder l\'accès à une ou plusieurs catégories de FAQ.');
$GLOBALS['TL_LANG']['tl_user']['faqp'] = array('Permissions des catégories de FAQ', 'Définir les permissions des catégorie de FAQ.');
$GLOBALS['TL_LANG']['tl_user']['faq_legend'] = 'Permissions des FAQ';

?>


text:
require 'bundler'
require 'webmock/rspec'
Bundler.require(:default, :development)

Dir[File.expand_path('../support/**/*.rb', __FILE__)].each do |path|
  require path
end

RSpec.configure do |config|
  config.order = 'random'
end


text:
#ifndef __VERIFY__
#define __VERIFY__

#include <string>

#include "CleartextSignature.h"
#include "DetachedSignature.h"
#include "Key.h"
#include "Message.h"
#include "Misc/PKCS1.h"
#include "Misc/mpi.h"
#include "Misc/sigcalc.h"
#include "PKA/PKAs.h"
#include "Packets/Packets.h"
#include "RevocationCertificate.h"

namespace OpenPGP {
    namespace Verify {
        // verify pka with variables only
        int with_pka(const std::string & digest, const uint8_t hash, const uint8_t pka, const PKA::Values & signer, const PKA::Values & signee);

        // verify pka with packets
        int with_pka(const std::string & digest, const Packet::Key::Ptr & signer, const Packet::Tag2::Ptr & signee);
        // /////////////////

        // detached signatures (not a standalone signature)
        int detached_signature(const Key & key, const std::string & data, const DetachedSignature & sig);

        // 0x00: Signature of a binary document.
        int binary(const Key & key, const Message & message);

        // 0x01: Signature of a canonical text document.
        int cleartext_signature(const Key & pub, const CleartextSignature & message);

        // 0x02: Standalone signature.

        // 0x10: Generic certification of a User ID and Public-Key packet.
        // 0x11: Persona certification of a User ID and Public-Key packet.
        // 0x12: Casual certification of a User ID and Public-Key packet.
        // 0x13: Positive certification of a User ID and Public-Key packet.
        int primary_key(const Packet::Key::Ptr & signer_key, const Packet::Key::Ptr & signee_key, const Packet::User::Ptr & signee_id, const Packet::Tag2::Ptr & signee_signature);
        int primary_key(const Key & signer, const Key & signee);

        // 0x18: Subkey Binding Signature

        // 0x19: Primary Key Binding Signature

        // 0x1F: Signature directly on a key

        // 0x20: Key revocation signature
        // 0x28: Subkey revocation signature
        // 0x30: Certification revocation signature
        int revoke(const Key & key, const RevocationCertificate & revoke);

        // 0x40: Timestamp signature.
        int timestamp(const Key & key, const DetachedSignature & timestamp);

        // 0x50: Third-Party Confirmation signature.
    }
}

#endif


text:
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;

/**
 * Write a description of class TextField here.
 *
 * @Green Techies
 * @version (a version number or a date)
 */
public class TextField extends Actor
{
    private boolean active = false;
    private boolean cursorActive = false;
    private boolean displayKeyNames;
    private boolean enabled = true;

    private static int activeTextField = 1;

    private int textFieldNumber;
    private int textFontSize;
    private int cursorPosition = 0;

    private long cursorTime = System.currentTimeMillis();

    private String input = "";
    private String text = "";
    private String temp = "";

    private Color bgColor = Color.white;
    private Color textColor = Color.black;

    /**
     * Creates a new TextField of a default size of 250 x 50 with black letters on white background.
     */
    public TextField(){
        this(250, 50, false, true, Color.white, Color.black, "");
    }

    public TextField(int width, int height, boolean displayKeyNames, boolean enabled, Color bgColor, Color textColor, String text) throws IllegalArgumentException {
        this.bgColor = bgColor;
        this.textColor = textColor;
        this.text = text;
        this.displayKeyNames = displayKeyNames;
        this.enabled = enabled;
        cursorPosition = text.length();
        getImage().clear();
        getImage().scale(width, height);
        textFontSize = height - 10;
        resetImage();
        displayText();
    }

      /**
     * Assigns this field a number.
     * This method is called when the object is added to the world.
     */
    public void addedToWorld(World world) {
        textFieldNumber = getWorld().getObjects(TextField.class).size();
    }

        /**
     * Control the TextFields action.
     */
    public void act() {
        if (Greenfoot.mouseClicked(this)) {
            activeTextField = textFieldNumber;
            active = true;
        }
        if (active) {
            if (activeTextField != textFieldNumber) {
                active = false;
                cursorActive = false;
                displayText();
                return;
            }
            if (System.currentTimeMillis() - cursorTime > 750) {
                cursorTime = System.currentTimeMillis();
                cursorActive = !cursorActive;
            }
            input = Greenfoot.getKey();
            if (enabled) {
                if (displayKeyNames) {
                    if (input != null && input != "") {
                        text = input;
                    }
                }
                else {
                    if (input == "backspace" && text.length() != 0 && cursorPosition != 0) {
                        if (cursorPosition == text.length()) {
                            text = text.substring(0, text.length()-1);
                        }
                        else {
                            temp = text.substring(0, cursorPosition - 1);
                            temp += text.substring(cursorPosition, text.length()-1);
                            text = temp;
                            temp = "";
                        }
                        cursorPosition--;
                    }
                    else if (input == "enter") {
                        setActiveTextField();
                    }
                    else if (input == "space") {
                        if (cursorPosition == text.length()) {
                            text += " ";
                        }
                        else {
                            temp = text.substring(0, cursorPosition);
                            temp += " ";
                            temp += text.substring(cursorPosition, text.length() - 1);
                            text = temp;
                            temp = "";
                        }
                        cursorPosition++;
                    }
                    else if (input == "left") {
                        if (cursorPosition > 0) {
                            cursorPosition--;
                            cursorTime = System.currentTimeMillis();
                            cursorActive = true;
                        }
                    }
                    else if (input == "right") {
                        if (cursorPosition < text.length()) {
                            cursorPosition++;
                            cursorTime = System.currentTimeMillis();
                            cursorActive = true;
                        }
                    }
                    else if (input != null && input.length() == 1) {
                        if (cursorPosition == text.length()) {
                            text += input;
                        }
                        else {
                            temp = text.substring(0, cursorPosition);
                            temp += input;
                            temp += text.substring(cursorPosition, text.length() - 1);
                            text = temp;
                            temp = "";
                        }
                        cursorPosition++;
                    }
                }
            }
            else if (input == "enter") {
                setActiveTextField();
            }
            displayText();
        }
        else {
            if (activeTextField == textFieldNumber) {
                active = true;
            }
        }
    }

    /**
     * Display the text onto the TextField.
     */
    private void displayText() {
        GreenfootImage textImage = new GreenfootImage(text, textFontSize, textColor, new Color(0, 0, 0, 0));
        GreenfootImage textBeforeCursor = new GreenfootImage(text.substring(0, cursorPosition), textFontSize, textColor, new Color(0, 0, 0, 0));
        resetImage();
        getImage().drawImage(textImage, (textImage.getWidth() > getImage().getWidth() - 10 ? -(textImage.getWidth() - getImage().getWidth()) - 10 : 5), (getImage().getHeight() / 2 - textImage.getHeight() / 2));
        getImage().setColor(textColor);
        if (cursorActive) {
            getImage().fillRect((textBeforeCursor.getWidth() > getImage().getWidth() - 10 ? getImage().getWidth() - 8 : textBeforeCursor.getWidth() + 7), getImage().getHeight() / 2 - textFontSize / 2, 2, textFontSize);
        }
        getImage().setColor(bgColor);
        getImage().fillRect(0, 0, 3, getImage().getHeight()-2);
    }

    /**
     * Clears the image of the TextField so that it is empty again.
     */
    private void resetImage() {
        getImage().setColor(bgColor);
        getImage().fill();
        getImage().setColor(Color.black);
        getImage().fillRect(0, getImage().getHeight()-2, getImage().getWidth(), 3);
        getImage().fillRect(getImage().getWidth()-2, 0, 3, getImage().getHeight());
    }

    /**
     * Set the active TextField to the given number.
     *
     * @param activeTextField
     *      The number of the TextField that is activated.
     */
    public void setActiveTextField(int activeTextField) {
        this.activeTextField = activeTextField;
    }
    /**
     * Set the active TextField to the next textfield.
     */
    public void setActiveTextField() {
        activeTextField++;
        if (activeTextField > getWorld().getObjects(TextField.class).size()) {
            activeTextField = 1;
        }
    }

    /**
     * Check whether this textfield is enabled (if you can change the text in it).
     *
     * @return
     *      Returns true if the text field is enabled.
     */
    public boolean isEnabled() {
        return enabled;
    }
    /**
     * Enable or disenable the textfield.
     *
     * @param enabled
     *      If you want the textfield to be enabled (able to write in it) this boolean has to be true.
     */
    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    /**
     * Returns the text of this textfield.
     *
     * @return
     *      The text that is currently displayed in the textfield.
     */
    public String getText() {
        return text;
    }
    /**
     * Set the text of this textfield.
     *
     * @param text
     *      The text that should be displayed in the textfield.
     */
    public void setText(String text) {
        this.text = text;
        cursorPosition = text.length();
    }

    /**
     * Returns the backgroundcolor of this TextField.
     *
     * @return
     *      The backgroundcolor of this TextField.
     */
    public Color getBackgroundColor() {
        return bgColor;
    }
    /**
     * Set the backgroundcolor to the given color.
     *
     * @param bgColor
     *      The new backgroundcolor.
     */
    public void setBackgroundColor(Color bgColor) {
        this.bgColor = bgColor;
    }

    /**
     * Returns the textcolor of this TextField.
     *
     * @return
     *      The textcolor of this TextField.
     */
    public Color getTextColor() {
        return textColor;
    }
    /**
     * Set the textcolor to the given color.
     *
     * @param textColor
     *      The new textcolor.
     */
    public void setTextColor(Color textColor) {
        this.textColor = textColor;
    }
}


text:
module.exports = function(app){
    var views = app.views,
        actions = app.actions,
        behaviours = app.behaviours;

    function createAppWrapper(){
        var wrapper = new views.Container();

        wrapper.views.content.add([
            require('./header')(app),
            require('../controls/mainMenu')(app),
            require('./appBody')(app)
        ]);

        return wrapper;
    }

    return createAppWrapper();

};


text:
log library for c++

Supported platform: g++

Usage:
#include "log4cpp.h"
use namespace log4cpp;

// log level: 0=emergency;1=alert;2=critical;3=error;4=warning;5=notice;6=info;7=debug
// change log level to notice, default is 6 (info)
g_logger.SetLogLevel(5);

// send a notice message to syslog
g_logger.Notice("exit");


text:
namespace HGE
{
	enum class Orientation
	{
		None = 1 << 0,
		FlipHorizontal = 1 << 1,
		FlipVertical = 1 << 2,
		FlipBoth = (1 << 1) | (1 << 2)
	};

	inline Orientation operator|(Orientation pEffectA, Orientation pEffectB)
	{
		return static_cast<Orientation>(static_cast<int>(pEffectA) | static_cast<int>(pEffectB));
	}

	inline Orientation operator&(Orientation pEffectA, Orientation pEffectB)
	{
		return static_cast<Orientation>(static_cast<int>(pEffectA)& static_cast<int>(pEffectB));
	}
}

#endif


text:
package helloworld.creational.abstract_factory;

import helloworld.SplitHelloWorld;

/**
 * @author yihua.huang@dianping.com
 */
public interface SplitHelloWorldFactory {

    public SplitHelloWorld.HelloWorldInterjection createHelloWorldInterjection();

    public SplitHelloWorld.HelloWorldObject createHelloWorldObject();
}


text:
package org.databene.commons.file;

import java.io.File;
import java.io.IOException;

/**
 *
Utility for preventing the start of more than one process of a given application.
 * The lock is acquired calling {@link #acquireLock(File)} with a File instance.
 * The method creates the file and registers a shutdown hook that deletes the file
 * when the process finishes. When a second acquireLock is tried while the file exists
 * (no matter if by this or another process), a {@link LockAlreadyAcquiredException}
 * is thrown.

 * It can be used like this:
 *

 * 		try {
 *			LockFile.acquireLock("MyApp.lock");
 *		} catch (LockFile.LockAlreadyAcquiredException e) {
 *			JOptionPane.showMessageDialog(null, "MyApp is already running", "Error", JOptionPane.ERROR_MESSAGE);
 *			System.exit(-1);
 *		}
 *

 *
 * Created: 29.11.2013 08:16:23
 * @since 0.5.25
 * @author Volker Bergmann
 */

public class LockFile {

	public static void acquireLock(final File lockFile) throws LockAlreadyAcquiredException {
		if (lockFile.exists()) {
			throw new LockAlreadyAcquiredException(lockFile.getPath());
		} else {
			try {
				File parent = lockFile.getParentFile();
				parent.mkdirs();
				lockFile.createNewFile();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
			Runtime.getRuntime().addShutdownHook(new Thread() {
				@Override
				public void run() {
					lockFile.delete();
				}
			});
		}
	}

	public static class LockAlreadyAcquiredException extends Exception {

		private static final long serialVersionUID = 1L;

		public LockAlreadyAcquiredException(String fileName) {
			super("Lock file already acquired: " + fileName);
		}
	}

}


text:
shinyCartogram
==============
[![Build Status](https://travis-ci.org/saurfang/shinyCartogram.png?branch=master)](https://travis-ci.org/saurfang/shinyCartogram)

This R package wraps [d3-cartogram](https://github.com/shawnbot/d3-cartogram) in
a reusable [Shiny](http://rstudio.com/shiny) component.
The concept and R Shiny binding implementation borrows heavily from
[leaflet-shiny](https://github.com/jcheng5/leaflet-shiny).

You can install the latest development version from github with
```R
#install.packages("devtools")
devtools::install_github("saurfang/shinyCartogram")
```

[cartogram.js](https://github.com/shawnbot/d3-cartogram/blob/master/cartogram.js) is a JavaScript
implementation of [an algoritm to construct continuous area cartograms](http://lambert.nico.free.fr/tp/biblio/Dougeniketal1985.pdf),
by James A. Dougenik, Nicholas R. Chrisman and Duane R. Niemeyer, ©1985
by the Association of American Geographers.

This [example](https://saurfang.shinyapps.io/shinyCartogram/) replicates the original demo that
[Shawn Allen](http://stamen.com/studio/shawn) made for his [d3-cartogram](https://github.com/shawnbot/d3-cartogram).
This R package has made it possible for you to only focus on providing the dataset and column definitions
rather than writing boilerplate codes that creates the map and associated visual updates.


text:
package pharmacyCode;

import java.util.Scanner;

public class Menu {

	private static final int maxNumber = 1000;
	private static Drugs[] drugAr = new Drugs[maxNumber];
	private static People[] patientAr = new Patient[maxNumber];
	private static People[] doctorAr = new Doctor[maxNumber];
	private static Prescription[] prescriptionAr = new Prescription[maxNumber];

	public static void main(String[] args) {

		int choice = 0;
		boolean cont = true;
		int numOfDrugs = 0, numOfPatients = 0, numOfDoctors = 0, numOfPres = 0;

		Scanner reader = new Scanner(System.in);

		printMenu.login(reader);	// Calling Login method

		while(cont) {
			boolean cont_funct = true;

			choice = printMenu.mainMenu(reader);
			System.out.println();

			switch(choice) {
			case 1:
				if(Drugs.getDrugsTotal() < maxNumber) {
					System.out.print("\t\tInsert Medicine's Name: ");
					String drugName = reader.next();
					System.out.print("\t\tInsert Price: ");
					double drugPrice = reader.nextDouble();

					if (!CheckArray.booleanCheckList(drugAr, drugName)) {
						drugAr[numOfDrugs] = new Drugs(drugName, drugPrice);
						numOfDrugs++;

						System.out.println("\n\t\tMedicine Added");
					}
				}else {
					System.out.println("\n\t\tWARNING\n\t\tThe list of Medicines is Full --- Delete to proceed\n");
				}
				break;

			case 2:
				if(Patient.getPatientsTotal() < maxNumber) {
					System.out.print("\t\tInsert Patient's First Name: ");
					String patFname = reader.next();
					System.out.print("\t\tInsert Patient's Last Name: ");
					String patLname = reader.next();

					if(!CheckArray.booleanCheckListPat(patientAr, patFname, patLname)) {
						patientAr[numOfPatients] = new Patient(patFname, patLname);
						((Patient)patientAr[numOfPatients]).setCodeID();
						numOfPatients++;

						System.out.println("\n\t\tPatient Added");
					}
				}else {
					System.out.println("\n\t\tWARNING\n\t\tThe list of Patients is Full --- Delete to proceed\n");
				}
				break;

			case 3:
				if(Doctor.getDoctorsTotal() < maxNumber) {
					System.out.print("\t\tInsert Doctor's First Name: ");
					String docFname = reader.next();
					System.out.print("\t\tInsert Doctor's Last Name: ");
					String docLname = reader.next();

					if(!CheckArray.booleanCheckListDoc(doctorAr, docFname, docLname)) {
						doctorAr[numOfDoctors] = new Doctor(docFname, docLname);
						((Doctor)doctorAr[numOfDoctors]).setCodeID();
						numOfDoctors++;

						System.out.println("\n\t\tDoctor Added");
					}
				}else {
					System.out.println("\n\t\tWARNING\n\t\tThe list of Doctors is Full --- Delete to proceed\n");
				}
				break;

			case 4:
				if(Prescription.getPrescriptionsTotal() < maxNumber) {
					String presDocFname, presDocLname, presPatFname, presPatLname;
					String addDrug = new String("yes");

					String[] presDrugName = new String[6];
					int [] presDrugQuantity = new int[6];
					int numOfPresDrugs = 0;
					int indexDoc = -1;
					int indexPat = -1;
					boolean foundDoc = false;
					boolean foundPat = false;
					boolean foundDrug = false;

					System.out.print("\t\tInsert Prescription's Doctor First Name: ");
					presDocFname = reader.next();
					System.out.print("\t\tInsert Prescription's Doctor Last Name: ");
					presDocLname = reader.next();

					for(int i = 0; i < Doctor.getDoctorsTotal(); i++ ) {
						if((presDocFname.equalsIgnoreCase(doctorAr[i].getFname())) && (presDocLname.equalsIgnoreCase(doctorAr[i].getLname()))) {
							indexDoc = i;
							foundDoc = true;
						}
					}
					if(!foundDoc){
							System.out.println("\n\t\tError --- Doctor not Found!");
							System.out.println("\t\tRedirecting to Main Menu.");
							break;
					}

					System.out.print("\n\t\tInsert Prescription's Patient First Name: ");
					presPatFname = reader.next();
					System.out.print("\t\tInsert Prescription's Patient Last Name: ");
					presPatLname = reader.next();

					for(int i = 0; i < Patient.getPatientsTotal(); i++ ) {
						if((presPatFname.equalsIgnoreCase(patientAr[i].getFname())) && (presPatLname.equalsIgnoreCase(patientAr[i].getLname()))) {
							indexPat = i;
							foundPat = true;
						}
					}
					if(!foundPat) {
							System.out.println("\n\t\tError --- Patient not Found!");
							System.out.println("\t\tRedirecting to Main Menu.");
							break;
					}

					if(foundDoc && foundPat) {
						prescriptionAr[numOfPres] = new Prescription( ((Doctor)doctorAr[indexDoc]),
								((Patient)patientAr[indexPat]));
						prescriptionAr[numOfPres].setPresID();
						prescriptionAr[numOfPres].setPresCurrentDate();

						double totalPrice = 0;
						while(numOfPresDrugs < 6 && (addDrug.equalsIgnoreCase("yes") || addDrug.equalsIgnoreCase("y") )) {
							System.out.println();
							System.out.print("\t\tInsert Prescription's Medicine: ");
							presDrugName[numOfPresDrugs] = reader.next();
							System.out.print("\t\tInsert Quantity: ");
							presDrugQuantity[numOfPresDrugs] = reader.nextInt();

							for(int i = 0; i < Drugs.getDrugsTotal(); i++) {
								if(presDrugName[numOfPresDrugs].equalsIgnoreCase(drugAr[i].getDrugName())) {

									prescriptionAr[numOfPres].setPresDrug(presDrugName[numOfPresDrugs],
											presDrugQuantity[numOfPresDrugs]);

									totalPrice += drugAr[i].getDrugPrice() * presDrugQuantity[numOfPresDrugs];

									foundDrug = true;
								}
							}
							if(foundDrug)
								numOfPresDrugs++;
							else
								System.out.println("\n\t\tMedicine not Found");

							foundDrug = false;

							if(numOfPresDrugs < 6) {
								do {
									System.out.print("\t\tInsert New Medicine? (yes/no) : ");
									addDrug = reader.next();
								}while((!addDrug.equalsIgnoreCase("yes")) && (!addDrug.equalsIgnoreCase("y")) && (!addDrug.equalsIgnoreCase("no"))
										&& (!addDrug.equalsIgnoreCase("n")));
							}

						}

						prescriptionAr[numOfPres].setTotalMoney(totalPrice);
					}
					numOfPres++;
					System.out.println("\n\n\t\tPrescription Added\n");
				}
				else {
					System.out.println("\n\t\tWARNING\n\t\tList of Prescriptions is Full --- Delete to proceed\n");
				}

				break;

			case 5:
				while(cont_funct) {

					int indexDrugDelete = -1, indexPatientDelete = -1, indexDoctorDelete = -1, indexPresDelete = -1;
					boolean foundDrugDelete = false, foundPatientDelete = false, foundDoctorDelete = false, foundPresDelete = false;

					printMenu.deleteMenu();

					int choice3 = reader.nextInt();

					switch(choice3) {
					case 1:
						System.out.print("\t\tInsert Medicine's name to delete: ");
						String drugNameDelete = reader.next();

						for(int i = 0; i < Drugs.getDrugsTotal(); i++) {
							if(drugNameDelete.equalsIgnoreCase(drugAr[i].getDrugName())) {
								indexDrugDelete = i;
								foundDrugDelete = true;
							}
						}
						if(foundDrugDelete) {
							for(int i = indexDrugDelete; i < Drugs.getDrugsTotal()-1 ; i++) {
								drugAr[i].setDrugID(drugAr[i+1].getDrugID());
								drugAr[i].setDrugName(drugAr[i+1].getDrugName());
								drugAr[i].setDrugPrice(drugAr[i+1].getDrugPrice());
							}
							numOfDrugs--;
							Drugs.setDrugsTotal();
							System.out.println("\n\t\tMedicine Deleted");
						}
						else {
							System.out.println("\n\t\tError --- Medicine not Found");
						}

						break;

					case 2:
						System.out.print("\t\tEnter Patient's first name: ");
						String patientFnameDelete = reader.next();
						System.out.print("\t\tEnter Patient's last name: ");
						String patientLnameDelete = reader.next();

						for(int i = 0; i < Patient.getPatientsTotal(); i++) {
							if((patientFnameDelete.equalsIgnoreCase(patientAr[i].getFname())) && (patientLnameDelete.equalsIgnoreCase(patientAr[i].getLname()))) {
								indexPatientDelete = i;
								foundPatientDelete = true;
							}
						}
						if(foundPatientDelete) {
							for(int i = indexPatientDelete; i < (Patient.getPatientsTotal()-1); i++) {
								patientAr[i].setFname(patientAr[i+1].getFname());
								patientAr[i].setLname(patientAr[i+1].getLname());
								((Patient)patientAr[i]).setCodeID(((Patient)patientAr[i+1]).getAMKA());
							}
							numOfPatients--;
							Patient.setPatientsTotal();
							System.out.println("\n\t\tPatient Deleted");
						}
						else {
							System.out.println("\n\t\tError --- Patient not Found");
						}

						break;

					case 3:
						System.out.print("\t\tEnter Doctor's first name: ");
						String doctorFnameDelete = reader.next();
						System.out.print("\t\tEnter Doctor's last name: ");
						String doctorLnameDelete = reader.next();

						for(int i = 0; i < Doctor.getDoctorsTotal(); i++) {
							if((doctorFnameDelete.equalsIgnoreCase(doctorAr[i].getFname())) && (doctorLnameDelete.equalsIgnoreCase(doctorAr[i].getLname()))) {
								indexDoctorDelete = i;
								foundDoctorDelete = true;
							}
						}
						if(foundDoctorDelete) {
							for(int i = indexDoctorDelete; i < Doctor.getDoctorsTotal()-1; i++) {
								doctorAr[i].setFname(doctorAr[i+1].getFname());
								doctorAr[i].setLname(doctorAr[i+1].getLname());
								((Doctor)doctorAr[i]).setCodeID(((Doctor)doctorAr[i+1]).getDocCode());
							}
							numOfDoctors--;
							Doctor.setDoctorsTotal();
							System.out.println("\n\t\tDoctor Deleted");
						}
						else {
							System.out.println("\n\t\tError --- Doctor not Found!");
						}

						break;

					case 4:
						System.out.print("\t\tEnter the Presciption's ID to delete: ");
						int presDelete = reader.nextInt();
						for(int i = 0; i < Prescription.getPrescriptionsTotal(); i++) {
							if(presDelete == prescriptionAr[i].getPresID()) {
								indexPresDelete = i;
								foundPresDelete = true;
							}
						}
						if(foundPresDelete) {
							for(int i = indexPresDelete; i < Prescription.getPrescriptionsTotal()-1; i++) {
								prescriptionAr[i].setPresID(prescriptionAr[i+1].getPresID());
								prescriptionAr[i].setPresDoctor(prescriptionAr[i+1].getPresDoctor());
								prescriptionAr[i].setPresPatient(prescriptionAr[i+1].getPresPatient());
								prescriptionAr[i].setPresDate(prescriptionAr[i+1].getPresDate());
								for(int j = 0; j < 6; j++) {
									prescriptionAr[i].setPresDrug(prescriptionAr[i+1].getPresDrugName(j), prescriptionAr[i+1].getPresDrugQuantity(j), j);
								}
							}
							numOfPres--;
							Prescription.setPrescriptionsTotal();
							System.out.println("\n\t\tPrescription Deleted");
						}
						else {
							System.out.println("\t\tError --- Prescription not Found");
						}

						break;

					case 5:
						cont_funct = false;
						break;

					default:
						System.out.println("Error --- Wrong Input");
						break;
					}
				}

				break;
			case 6:
				while(cont_funct) {

					boolean foundSearch = false;

					printMenu.searchMenu();

					int choice4 = reader.nextInt();

					switch(choice4) {
					case 1:
						System.out.print("\t\tInsert Doctor's first name: ");
						String searchDoctorFname = reader.next();
						System.out.print("\t\tInsert Doctor's Last Name: ");
						String searchDoctorLname = reader.next();

						for(int i = 0; i < Prescription.getPrescriptionsTotal(); i++) {
							if( (searchDoctorFname.equalsIgnoreCase(prescriptionAr[i].getPresDoctorFname())) &&
									(searchDoctorLname.equalsIgnoreCase(prescriptionAr[i].getPresDoctorLname())) ) {
								System.out.println("\t\t==============================");
								prescriptionAr[i].printAllPrescriptions();
								foundSearch = true;
							}
						}
						if(!foundSearch) {
							System.out.println("\t\t==============================");
							System.out.println("\n\t\tNo Prescription with this Doctor's Name.\n");
							System.out.println("\t\t==============================");
						}

						break;

					case 2:
						System.out.print("\t\tInsert Patient's ID: ");
						int searchPatientAMKA = reader.nextInt();

						for(int i = 0; i < Prescription.getPrescriptionsTotal(); i++) {
							if( searchPatientAMKA == prescriptionAr[i].getPresPatientAMKA()) {
								System.out.println("\t\t==============================");
								prescriptionAr[i].printAllPrescriptions();
								foundSearch = true;
							}
						}
						if(!foundSearch) {
							System.out.println("\t\t==============================");
							System.out.println("\n\t\tNo Prescription with this Patient's ID.\n");
							System.out.println("\t\t==============================");
						}

						break;

					case 3:
						System.out.println("\t\tStill in Progress!!");
						break;

					case 4:
						cont_funct = false;
						break;

					default:
						System.out.println("Error --- Wrong Input");
						break;
					}
				}

				break;
			case 7:
				while(cont_funct) {
					printMenu.printMenuAll();

					int choice2 = reader.nextInt();
					switch(choice2) {
					case 1:
						printMenu.printMedicines(drugAr);
						break;
					case 2:
						printMenu.printPatients(patientAr);
						break;
					case 3:
						printMenu.printDoctors(doctorAr);
						break;
					case 4:
						printMenu.printPrescriptions(prescriptionAr);
						break;
					case 5:
						cont_funct = false;
						break;
					default:
						System.out.println("Error --- Wrong Input");
						break;
					}
				}
				break;

			case 8:
				System.out.println("\n\n-------- System Terminated --------");
				cont = false;
				break;
			}
		}
		reader.close();
	}
}


text:
package org.thingsboard.server.transport.lwm2m.secure;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.californium.elements.auth.RawPublicKeyIdentity;
import org.eclipse.californium.elements.util.CertPathUtil;
import org.eclipse.californium.scandium.dtls.AlertMessage;
import org.eclipse.californium.scandium.dtls.CertificateMessage;
import org.eclipse.californium.scandium.dtls.CertificateType;
import org.eclipse.californium.scandium.dtls.CertificateVerificationResult;
import org.eclipse.californium.scandium.dtls.ConnectionId;
import org.eclipse.californium.scandium.dtls.HandshakeException;
import org.eclipse.californium.scandium.dtls.HandshakeResultHandler;
import org.eclipse.californium.scandium.dtls.x509.NewAdvancedCertificateVerifier;
import org.eclipse.californium.scandium.dtls.x509.StaticNewAdvancedCertificateVerifier;
import org.eclipse.californium.scandium.util.ServerNames;
import org.eclipse.leshan.server.security.NonUniqueSecurityInfoException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.DeviceProfile;
import org.thingsboard.server.common.data.StringUtils;
import org.thingsboard.server.common.data.device.credentials.lwm2m.LwM2MSecurityMode;
import org.thingsboard.server.common.data.device.credentials.lwm2m.X509ClientCredential;
import org.thingsboard.server.common.msg.EncryptionUtil;
import org.thingsboard.server.common.transport.auth.ValidateDeviceCredentialsResponse;
import org.thingsboard.server.common.transport.util.SslUtil;
import org.thingsboard.server.queue.util.TbLwM2mTransportComponent;
import org.thingsboard.server.transport.lwm2m.config.LwM2MTransportServerConfig;
import org.thingsboard.server.transport.lwm2m.secure.credentials.LwM2MClientCredentials;
import org.thingsboard.server.transport.lwm2m.server.client.LwM2MAuthException;
import org.thingsboard.server.transport.lwm2m.server.store.TbLwM2MDtlsSessionStore;
import org.thingsboard.server.transport.lwm2m.server.store.TbMainSecurityStore;

import javax.annotation.PostConstruct;
import javax.security.auth.x500.X500Principal;
import java.net.InetSocketAddress;
import java.security.PublicKey;
import java.security.cert.CertPath;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateExpiredException;
import java.security.cert.CertificateNotYetValidException;
import java.security.cert.X509Certificate;
import java.util.Arrays;
import java.util.List;

import static org.thingsboard.server.transport.lwm2m.server.uplink.LwM2mTypeServer.CLIENT;

@Slf4j
@Component
@TbLwM2mTransportComponent
@RequiredArgsConstructor
public class TbLwM2MDtlsCertificateVerifier implements NewAdvancedCertificateVerifier {

    private final TbLwM2MDtlsSessionStore sessionStorage;
    private final LwM2MTransportServerConfig config;
    private final LwM2mCredentialsSecurityInfoValidator securityInfoValidator;
    private final TbMainSecurityStore securityStore;

    private StaticNewAdvancedCertificateVerifier staticCertificateVerifier;

    @Value("${transport.lwm2m.server.security.skip_validity_check_for_client_cert:false}")
    private boolean skipValidityCheckForClientCert;

    @Override
    public List<CertificateType> getSupportedCertificateTypes() {
        return Arrays.asList(CertificateType.X_509, CertificateType.RAW_PUBLIC_KEY);
    }

    @PostConstruct
    public void init() {
        try {
            /* by default trust all */
            if (config.getTrustSslCredentials() != null) {
                X509Certificate[] trustedCertificates = config.getTrustSslCredentials().getTrustedCertificates();
                staticCertificateVerifier = new StaticNewAdvancedCertificateVerifier(trustedCertificates, new RawPublicKeyIdentity[0], null);
            }
        } catch (Exception e) {
            log.warn("Failed to initialize the LwM2M certificate verifier", e);
        }
    }

    @Override
    public CertificateVerificationResult verifyCertificate(ConnectionId cid, ServerNames serverName, InetSocketAddress remotePeer,
                                                           boolean clientUsage, boolean verifySubject, boolean truncateCertificatePath,
                                                           CertificateMessage message) {
        CertPath certChain = message.getCertificateChain();
        if (certChain == null) {
            //We trust all RPK on this layer, and use TbLwM2MAuthorizer
            PublicKey publicKey = message.getPublicKey();
            return new CertificateVerificationResult(cid, publicKey, null);
        } else {
            try {
                boolean x509CredentialsFound = false;
                X509Certificate[] chain = certChain.getCertificates().toArray(new X509Certificate[0]);
                for (X509Certificate cert : chain) {
                    try {
                        if (!skipValidityCheckForClientCert) {
                            cert.checkValidity();
                        }
                        TbLwM2MSecurityInfo securityInfo = null;
                        if (staticCertificateVerifier != null) {
                            HandshakeException exception = staticCertificateVerifier.verifyCertificate(cid, serverName, remotePeer, clientUsage, verifySubject, truncateCertificatePath, message).getException();
                            if (exception == null) {
                                try {
                                    String endpoint = config.getTrustSslCredentials().getValueFromSubjectNameByKey(cert.getSubjectX500Principal().getName(), "CN");
                                    if (StringUtils.isNotEmpty(endpoint)) {
                                        securityInfo = securityInfoValidator.getEndpointSecurityInfoByCredentialsId(endpoint, CLIENT);
                                    }
                                } catch (LwM2MAuthException e) {
                                    log.trace("Certificate trust validation failed.", e);
                                }
                            } else {
                                log.trace("Certificate trust validation failed.", exception);
                            }
                        }
                        // if not trust or cert trust securityInfo == null
                        String strCert = SslUtil.getCertificateString(cert);
                        String sha3Hash = EncryptionUtil.getSha3Hash(strCert);
                        if (securityInfo == null || securityInfo.getMsg() == null) {
                            try {
                                securityInfo = securityInfoValidator.getEndpointSecurityInfoByCredentialsId(sha3Hash, CLIENT);
                            } catch (LwM2MAuthException e) {
                                log.trace("Failed find security info: {}", sha3Hash, e);
                            }
                        }
                        ValidateDeviceCredentialsResponse msg = securityInfo != null ? securityInfo.getMsg() : null;
                        if (msg != null && StringUtils.isNotEmpty(msg.getCredentials())) {
                            LwM2MClientCredentials credentials = JacksonUtil.fromString(msg.getCredentials(), LwM2MClientCredentials.class);
                            if (!credentials.getClient().getSecurityConfigClientMode().equals(LwM2MSecurityMode.X509)) {
                                continue;
                            }
                            X509ClientCredential config = (X509ClientCredential) credentials.getClient();
                            String certBody = config.getCert();
                            String endpoint = config.getEndpoint();
                            if (StringUtils.isBlank(certBody) || strCert.equals(certBody)) {
                                x509CredentialsFound = true;
                                DeviceProfile deviceProfile = msg.getDeviceProfile();
                                if (msg.hasDeviceInfo() && deviceProfile != null) {
                                    sessionStorage.put(endpoint, new TbX509DtlsSessionInfo(cert.getSubjectX500Principal().getName(), msg));
                                    try {
                                        securityStore.putX509(securityInfo);
                                    } catch (NonUniqueSecurityInfoException e) {
                                        log.trace("Failed to add security info: {}", securityInfo, e);
                                    }
                                    break;
                                }
                            } else {
                                log.trace("[{}][{}] Certificate mismatch. Expected: {}, Actual: {}", endpoint, sha3Hash, strCert, certBody);
                            }
                        }
                    } catch (CertificateEncodingException |
                            CertificateExpiredException |
                            CertificateNotYetValidException e) {
                        log.error(e.getMessage(), e);
                    }
                }
                if (!x509CredentialsFound) {
                    AlertMessage alert = new AlertMessage(AlertMessage.AlertLevel.FATAL, AlertMessage.AlertDescription.INTERNAL_ERROR);
                    throw new HandshakeException("x509 verification not enabled!", alert);
                }
                return new CertificateVerificationResult(cid, certChain, null);
            } catch (HandshakeException e) {
                log.trace("Certificate validation failed!", e);
                return new CertificateVerificationResult(cid, e, null);
            }
        }
    }

    @Override
    public List<X500Principal> getAcceptedIssuers() {
        return CertPathUtil.toSubjects(null);
    }

    @Override
    public void setResultHandler(HandshakeResultHandler resultHandler) {

    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Bol. Secr. Agric. (Pernambuco) 19(1-2): 174 (1952)

#### Original name
Periconiella echinochloae Bat., 1952

### Remarks
null


text:
import os,sys
from PIL import Image
import colorsys
from collections import Counter

imgFile = Image.open("HSVstrip.png")
imgXsize,imgYsize = imgFile.size
colourWeight = []

def whatHue(hue):
	if hue > 345.0 and hue <= 360.0: #reddish
		colourWeight.append(1)
	elif hue > 0.0 and hue <= 20.0: #reddish
		colourWeight.append(1)
	elif hue > 160.0 and hue <= 250.0: #blueish
		colourWeight.append(2)
	elif hue > 80.0 and hue <= 160.0: #greenish
		colourWeight.append(3)
	elif hue > 40.0 and hue <= 80.0: #yellowish
		colourWeight.append(4)
	elif hue > 20.0 and hue <= 40.0: #orangebrownish
		colourWeight.append(5)
	elif hue > 250.0 and hue <= 345.0: #pinkish
		colourWeight.append(6)
	else:								#not defined
		colourWeight.append(0)
	return

for x in range(int(0.9 * imgXsize), imgXsize):
	for y in range(int(0.9 * imgYsize), imgYsize):
		r,g,b,a = imgFile.getpixel((x,y))
		h,s,v = colorsys.rgb_to_hsv(r, g, b)
		hue = h*360
		#print(x,y)
		whatHue(hue)

most_common,num_most_common = Counter(colourWeight).most_common(1)[0]
print(most_common,num_most_common)


text:
<?php

namespace app\models;

use Yii;
use yii\base\Model;

/**
 * LoginForm is the model behind the login form.
 */
class RemarkForm extends Model
{
	public $remark;

	/**
	 * @return array the validation rules.
	 */
	public function rules(){
		return [
			['remark', 'required'],
		];
	}

	public function add($userID){
		if ($this->validate()) {
			$Remarks = new UserRemarks();

			$Remarks->userID = $userID;
			$Remarks->remark = $this->remark;
			$Remarks->dateAdd = time();
			$this->remark = '';
			return $Remarks->save();
		} else {
			return false;
		}
	}
}


text:
      <form class="form-signin" ng-controller="LoginCtrl">

Please Log In

        User Name
        <input type="text" id="inputUname" ng-model ="user.uname" class="form-control" placeholder="User Name" required autofocus>
        Password
        <input type="password" id="inputPassword" ng-model ="user.password" class="form-control" placeholder="Password" required>

            <input type="checkbox" value="remember-me"> Remember me

        <button class="btn btn-lg btn-primary btn-block" type="submit" ng-click="login()">Log in</button>
      </form>


text: A simple photo importer


text:
<?php
namespace Podlove\Modules\Networks\Settings;
use \Podlove\Model;
use \Podlove\Modules\Networks\Model\PocastList;

class Dashboard {

	static $pagehook;

	public function __construct() {

		// use \Podlove\Podcast_Post_Type::NETWORK_SETTINGS_PAGE_HANDLE to replace
		// default first item name
		Dashboard::$pagehook = add_submenu_page(
			/* $parent_slug*/ \Podlove\Podcast_Post_Type::NETWORK_SETTINGS_PAGE_HANDLE,
			/* $page_title */ __( 'Dashboard', 'podlove' ),
			/* $menu_title */ __( 'Dashboard', 'podlove' ),
			/* $capability */ 'administrator',
			/* $menu_slug  */ \Podlove\Podcast_Post_Type::NETWORK_SETTINGS_PAGE_HANDLE,
			/* $function   */ array( $this, 'settings_page' )
		);

		add_action( Dashboard::$pagehook, function () {

			wp_enqueue_script( 'postbox' );
			add_screen_option( 'layout_columns', array(
				'max' => 2, 'default' => 2
			) );

			wp_register_script(
				'cornify-js',
				\Podlove\PLUGIN_URL . '/js/admin/cornify.js'
			);
			wp_enqueue_script( 'cornify-js' );
		} );
	}

	public static function settings_page() {

		add_meta_box( Dashboard::$pagehook . '_right_now', __( 'At a glance', 'podlove' ), '\Podlove\Modules\Networks\Settings\Dashboard::right_now', Dashboard::$pagehook, 'normal' );
		add_meta_box( Dashboard::$pagehook . '_about', __( 'About', 'podlove' ), '\Podlove\Settings\Dashboard\About::content', Dashboard::$pagehook, 'side' );
		add_meta_box( Dashboard::$pagehook . '_podcast_overview', __( 'Podcasts', 'podlove' ), '\Podlove\Modules\Networks\Settings\Dashboard::podcast_overview', Dashboard::$pagehook, 'normal' );
		add_meta_box( Dashboard::$pagehook . '_list_overview', __( 'Lists', 'podlove' ), '\Podlove\Modules\Networks\Settings\Dashboard::list_overview', Dashboard::$pagehook, 'normal' );

		do_action( 'podlove_network_dashboard_meta_boxes' );

		?>

			<?php screen_icon( 'podlove-podcast' ); ?>

<?php echo __( 'Podlove Network Dashboard', 'podlove' ); ?>

					<?php do_action( 'podlove_settings_before_sidebar_boxes' ); ?>
					<?php do_meta_boxes( Dashboard::$pagehook, 'side', NULL ); ?>
					<?php do_action( 'podlove_settings_after_sidebar_boxes' ); ?>

						<?php do_action( 'podlove_settings_before_main_boxes' ); ?>
						<?php do_meta_boxes( Dashboard::$pagehook, 'normal', NULL ); ?>
						<?php do_meta_boxes( Dashboard::$pagehook, 'additional', NULL ); ?>
						<?php do_action( 'podlove_settings_after_main_boxes' ); ?>

			<form style='display: none' method='get' action=''>
				<?php
				wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
				wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
				?>
			</form>

		<?php
	}

	public static function right_now() {
		$podcasts = \Podlove\Modules\Networks\Model\Network::podcast_blog_ids();
		$number_of_podcasts = count( $podcasts );

		if (!$number_of_podcasts) {
			echo __('No podcasts exist yet.', 'podlove');
			return;
		}

		$episodes_total = 0;
		$episodes_total_per_status = array(
				'publish' => 0,
				'private' => 0,
				'future' => 0,
				'draft' => 0
			);
		$episodes_total_length = 0;
		$episode_total_average_length = 0;
		$media_file_total_average_size = 0;
		$media_file_total_size = 0;
		$days_between_episodes = 0;

		foreach ( $podcasts as $podcast ) {
			switch_to_blog( $podcast );
			$statistics = \Podlove\Settings\Dashboard\Statistics::prepare_statistics();

			$episodes_total += $statistics['total_number_of_episodes'];

			array_walk( $statistics['episodes'], function( $posts, $type ) use ( &$episodes_total_per_status ) {
				switch ( $type ) {
					case 'publish':
						$episodes_total_per_status['publish'] += $posts;
					break;
					case 'publish':
						$episodes_total_per_status['private'] += $posts;
					break;
					case 'future':
						$episodes_total_per_status['future'] += $posts;
					break;
					case 'draft':
						$episodes_total_per_status['draft'] += $posts;
					break;
				}
			});

			$episodes_total_length += $statistics['total_episode_length'];
			$episode_total_average_length += $statistics['average_episode_length'];
			$days_between_episodes += $statistics['days_between_releases'];
			$media_file_total_average_size += $statistics['average_media_file_size'];
			$media_file_total_size += $statistics['total_media_file_size'];
			restore_current_blog();
		}

		// Devide stats by number of Podcasts
		$episode_total_average_length /= $number_of_podcasts;
		$days_between_episodes /= $number_of_podcasts;
		$media_file_total_average_size /= $number_of_podcasts;
		?>

Episodes

						<?php echo $episodes_total_per_status['publish']; ?>

						<?php echo __( 'Published', 'podlove' ); ?>

						<?php echo $episodes_total_per_status['private']; ?>

						<?php echo __( 'Private', 'podlove' ); ?>

						<?php echo $episodes_total_per_status['future']; ?>

						<?php echo __( 'To be published', 'podlove' ); ?>

						<?php echo $episodes_total_per_status['draft']; ?>

						<?php echo __( 'Drafts', 'podlove' ); ?>

						<?php echo $episodes_total; ?>

						<?php echo __( 'Total', 'podlove' ); ?>

<?php echo __('Statistics', 'podlove') ?>

						<?php echo gmdate("H:i:s", $episode_total_average_length ); ?>

						<?php echo __( 'is the average length of an episode', 'podlove' ); ?>.

						<?php
							$days = round($episodes_total_length / 3600 / 24, 1);
							echo sprintf(_n('%s day', '%s days', $days, 'podlove'), $days);
						?>

						<?php echo __( 'is the total playback time of all episodes', 'podlove' ); ?>.

						<?php echo \Podlove\format_bytes($media_file_total_average_size, 1); ?>

						<?php echo __( 'is the average media file size', 'podlove' ); ?>.

						<?php echo \Podlove\format_bytes($media_file_total_size, 1); ?>

						<?php echo __( 'is the total media file size', 'podlove' ); ?>.

						<?php echo sprintf(_n('%s day', '%s days', round( $days_between_episodes ), 'podlove'), round( $days_between_episodes ) ); ?>

						<?php echo __( 'is the average interval until a new episode is released', 'podlove' ); ?>.

						<?php echo sprintf(_n('%s podcast', '%s podcasts', $number_of_podcasts, 'podlove'), $number_of_podcasts ); ?>

						<?php echo __( 'exist in your WordPress installation', 'podlove' ); ?>.

				<?php do_action('podlove_dashboard_statistics_network'); ?>

			<?php echo sprintf( __('You are using %s', 'podlove'), 'Podlove Publisher ' . \Podlove\get_plugin_header( 'Version' ) . ''); ?>.

		<?php
	}

	public static function podcast_overview() {
		switch_to_blog( 1 );
		$table = new \Podlove\Modules\Networks\Podcast_List_Table();
		$table->prepare_items();
		$table->display();
		restore_current_blog();
	}

	public static function list_overview() {
		switch_to_blog( 1 );
		$table = new \Podlove\Modules\Networks\PodcastList_List_Table();
		$table->prepare_items();
		$table->display();
		restore_current_blog();
	}
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>ScrollMagic Source: jquery.scrollmagic.debug.js</title>

	<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
	<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
	<link rel="shortcut icon" href="../img/favicon.ico" type="image/x-icon">

	<link type="text/css" rel="stylesheet" href="styles/site.cosmo.css">

			ScrollMagic

					Classes

							ScrollMagic

							ScrollScene

					Events

							change

							destroy

							end

							enter

							leave

							progress

							shift

							start

							update

Source: jquery.scrollmagic.debug.js

/*
ScrollMagic v1.2.3
The jQuery plugin for doing magical scroll interactions.
(c) 2014 Jan Paepke (@janpaepke)
License & Info: http://janpaepke.github.io/ScrollMagic

Inspired by and partially based on SUPERSCROLLORAMA by John Polacek (@johnpolacek)
http://johnpolacek.github.com/superscrollorama/

Powered by the Greensock Tweening Platform (GSAP): http://www.greensock.com/js
Greensock License info at http://www.greensock.com/licensing/
*/
/*
	@overview Debug Extension for ScrollMagic.
	@version	1.2.3
	@license	Dual licensed under MIT license and GPL.
	@author		Jan Paepke - e-mail@janpaepke.de
*/
(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(['ScrollScene', 'jquery'], factory);
    } else {
    		// no browser global needed, just execute
        factory(root.ScrollScene, root.jQuery);
    }
}(this, function(ScrollScene, $) {
	/**
	 * Add Indicators for a ScrollScene.
	 * __REQUIRES__ ScrollMagic Debug Extension: `jquery.scrollmagic.debug.js`
	 * The indicators can only be added _AFTER_ the scene has been added to a controller.
	 * @public

	 * @example
	 * // add basic indicators
	 * scene.addIndicators()
	 *
	 * // passing options
	 * scene.addIndicators({zindex: 100, colorEnd: "#FFFFFF"});
	 *
	 * @param {object} [options] - An object containing one or more options for the indicators.
	 * @param {(string|object)} [options.parent=undefined] - A selector, DOM Object or a jQuery object that the indicators should be added to.
	 														 If undefined, the scene's container will be used.
	 * @param {number} [options.zindex=-1] - CSS zindex for the indicator container.
	 * @param {number} [options.indent=0] - Additional position offset for the indicators (useful, when having multiple scenes starting at the same time).
	 * @param {number} [options.suffix=""] - This string will be attached to the start and end indicator (useful for identification when working with multiple scenes).
	 * @param {string} [options.colorTrigger=blue] - CSS color definition for the trigger indicator.
	 * @param {string} [options.colorStart=green] - CSS color definition for the start indicator.
	 * @param {string} [options.colorEnd=red] - CSS color definition for the end indicator.
	*/
	ScrollScene.prototype.addIndicators = function(opt) {
		var
			DEFAULT_OPTIONS = {
				parent: undefined,
				zindex: -1,
				indent: 0,
				suffix: "",
				colorTrigger: "blue",
				colorStart: "green",
				colorEnd: "red"
			};

		var
			scene = this,
			options = $.extend({}, DEFAULT_OPTIONS, opt),
			controller = this.parent();
		if (controller) {
			var
				cParams = controller.info(),
				suffix = (options.labelSuffix === "") ? "" : " " + options.suffix,
				$container = $(options.parent).length > 0 ?
						  $(options.parent)
						: cParams.isDocument ? $("body") : cParams.container, // check if window element (then use body)
				$wrap = $("<div></div>")
						.addClass("ScrollSceneIndicators")
						.data("options", options)
						.css({
							position: "absolute",
							top: 0,
							left: 0,
							width: "100%",
							height: "100%",
							"text-align": "center",
							"z-index": options.zindex,
							"pointer-events": "none",
							"font-size": 10
						}),
				$triggerHook = $("<div>trigger</div>")
								.css({
									position: "fixed",
									overflow: "visible",
									color: options.colorTrigger
								})
								.addClass("hook");
				$start = $("<div>start" + suffix + "</div>")
								.css({
									position: "absolute",
									overflow: "visible",
									color: options.colorStart
								})
								.addClass("start");
				$end = $("<div>end" + suffix + "</div>")
								.css({
									position: "absolute",
									overflow: "visible",
									color: options.colorEnd
								})
								.addClass("end");

			if ($container.css("position") == "static") {
				$container.css("position", "relative"); // positioning needed for correct display of indicators
			}

			scene.indicators = $wrap
				    			.append($triggerHook)
				    			.append($start)
				    			.append($end)
				    			.appendTo($container);

			scene.updateIndicators();
			var callUpdate = function (e) {
				if ((e.type == "scroll" || e.type == "resize") && !cParams.isDocument) {
					scene.updateIndicators(true);
				} else {
					scene.updateIndicators();
				}
			};
			scene.on("change.debug", callUpdate);
			cParams.container.on("resize scroll", callUpdate);
			if (!cParams.isDocument) {
				$(window).on("scroll resize", callUpdate);
			}
		} else {
			console.log("ERROR: Please add Scene to controller before adding indicators.");
		}
		return scene;
	};
	ScrollScene.prototype.updateIndicators = function(triggerOnly) {
		var
			scene = this,
			controller = scene.parent(),
			indicators = scene.indicators,
			options = indicators.data("options");
		if (indicators && controller) {
			var
				cParams = controller.info(),
				$triggerHook = indicators.children(".hook"),
				$start = indicators.children(".start"),
				$end = indicators.children(".end"),
				parentOffset = cParams.container.offset() || {top: 0, left: 0},
				parentPos = cParams.vertical ? parentOffset.top : parentOffset.left,
				hookPos = (cParams.size * scene.triggerHook()) + parentPos,
				direction = cParams.vertical ? "v" : "h";

			if (cParams.isDocument) { // account for possible body positioning
				var bodyOffset = indicators.offsetParent().is("body") ? $("body").offset() : parentOffset;
				indicators.css({
					top: -bodyOffset.top,
					left: -bodyOffset.left
				});
			} else {
				hookPos -=  cParams.vertical ? $(document).scrollTop() : $(document).scrollLeft();
			}

			$triggerHook
				.attr("data-hook", hookPos)
				.attr("data-direction", direction)
				.data("parent", cParams.container);

			$otherhook = $(".ScrollSceneIndicators .hook[data-hook=\""+ hookPos +"\"][data-direction="+direction+"]:visible").not($triggerHook);
			if ($otherhook.length > 0 && $otherhook.data("parent") == cParams.container) {
				$triggerHook.hide();
			} else {
				$triggerHook.show();
				var flip = hookPos > cParams.size*0.8; // put name above line?
				if (cParams.vertical) {
					// triggerHook
					$triggerHook.css({
						top: flip ? hookPos - $triggerHook.height() - 2 : hookPos,
						left: (cParams.isDocument ? cParams.container.width() : parentOffset.left + cParams.container.width() - $(document).scrollLeft()) - 70 - options.indent,
						width: 40,
						height: "auto",
						padding: "0 8px 2px 8px",
						"border-top": flip ? "none" : "1px solid blue",
						"border-bottom": flip ? "1px solid blue" : "none",
						"border-left": "none",
						"border-right": "none"
					});
				} else {
					$triggerHook.css({
						top: (cParams.isDocument ? cParams.container.height() : parentOffset.top + cParams.container.height() - $(document).scrollTop()) - 40 - options.indent,
						left: flip ? hookPos - $triggerHook.width() - 9: hookPos,
						width: "auto",
						height: 20,
						padding: "5px 5px 0 5px",
						"border-top": "none",
						"border-bottom": "none",
						"border-left": flip ? "none" : "1px solid blue",
						"border-right": flip ? "1px solid blue" : "none"
					});
				}
			}

			if (!triggerOnly) {
				var
					startPos = scene.triggerPosition(),
					endPos = startPos + scene.duration(),
					resetCSS = {
						"border": "none",
						top: "auto",
						bottom: "auto",
						left: "auto",
						right: "auto"
					};

				$start.css(resetCSS);
				$end.css(resetCSS);

				if (scene.duration() === 0) {
					$end.hide();
				} else {
					$end.show();
				}
				if (cParams.vertical) {
					// start
					$start.css({
						top: startPos,
						right: 71-cParams.container.scrollLeft() + options.indent,
						"border-top": "1px solid green",
						padding: "0 8px 0 8px"
					});
					// end
					$end.css({
						top: endPos,
						right: 71-cParams.container.scrollLeft() + options.indent,
						"border-top": "1px solid red",
						padding: "0 8px 0 8px"
					});
				} else {
					// start
					$start.css({
						left: startPos,
						bottom: 40-cParams.container.scrollTop() + options.indent,
						"border-left": "1px solid green",
						padding: "0 8px 0 8px"
					});
					// end
					$end.css({
						left: endPos,
						bottom: 40-cParams.container.scrollTop() + options.indent,
						"border-left": "1px solid red",
						padding: "0 8px 0 8px"
					});
				}
			}
		}
	};
}));

		© Jan Paepke 2014

		Documentation generated by JSDoc 3.3.0-alpha9
		using a customized version of the DocStrap template.


text:
<?php

use PHPUnit\Framework\TestCase;

/*
 * @covers twitterSearch
 */

class twitterSearchTest extends TestCase {

	/* @var twitterSearch */
	protected $twitter;

	public function setUp() {

		include_once("src/class.twitterSearch.php");

		$this->twitter = new twitterSearch('testConsumerKeyValue',
			'testConsumerSecretValue');
	}

	public function tearDown() {

		$this->twitter = null;
	}

	/**
	 * @param string $inputString string of space separated usernames
	 * @param string $expectedResult the expected query string
	 * @param int $numLookupUserLoops # times a user has to be validated
	 *
	 * @dataProvider providerTestSetUsernamesSetsUsernameQuery
	 */
	public function testSetUsernamesSetsUsernameQuery($inputString, $expectedResult, $numLookupUserLoops) {

		// first prepare the TwitterOAuth mock
		$twitterOAuth = $this->getMockBuilder('Abraham\TwitterOAuth\TwitterOAuth')
			->setConstructorArgs(array($this->twitter->getConsumerKey(),
				$this->twitter->getConsumerSecret()))
			->getMock();

		$twitterOAuth->expects($this->exactly($numLookupUserLoops))
			->method('get')
			->will($this->returnValue(''));

		$twitterOAuth->expects($this->exactly($numLookupUserLoops))
			->method('getLastHttpCode')
			->will($this->returnValue('200'));

		$this->twitter->setTwitter($twitterOAuth);
		$this->twitter->setUsernames($inputString);

		$this->assertEquals($expectedResult, $this->twitter->getUsernameQuery());
	}

	public function providerTestSetUsernamesSetsUsernameQuery() {

		return array(
			array('', '', 0),
			array(' ', '', 0),
			array('username1', 'from:username1', 1),
			array('username1 username2 username3',
				'from:username1 OR from:username2 OR from:username3',
				3)
			);
	}

	/**
	 * @param string $inputString string of space separated usernames
	 * @param array $expectedResult the expected query string
	 * @param int $numLookupUserLoops # times a user has to be validated
	 *
	 * @dataProvider providerTestSetUsernamesSetsUsernameArray
	 */
	public function testSetUsernamesSetsUsernameArray($inputString, $expectedResult, $numLookupUserLoops) {

		// first prepare the TwitterOAuth mock
		$twitterOAuth = $this->getMockBuilder('Abraham\TwitterOAuth\TwitterOAuth')
			->setConstructorArgs(array($this->twitter->getConsumerKey(),
				$this->twitter->getConsumerSecret()))
			->getMock();

		$twitterOAuth->expects($this->exactly($numLookupUserLoops))
			->method('get')
			->will($this->returnValue(''));

		$twitterOAuth->expects($this->exactly($numLookupUserLoops))
			->method('getLastHttpCode')
			->will($this->returnValue('200'));

		$this->twitter->setTwitter($twitterOAuth);
		$this->twitter->setUsernames($inputString);

		$this->assertEquals($expectedResult,
			$this->twitter->getUsernameArray());
	}

	public function providerTestSetUsernamesSetsUsernameArray() {

		return array(
			array('', array(), 0),
			array(' ', array(), 0),
			array('username1', array('username1'), 1),
			array('username1 username2 username3',
				array('username1', 'username2', 'username3'),
				3)
			);
	}

	/**
	 * @expectedException Exception
	 */
	public function testSetUsernamesLookupUsersFailureThrowsException() {

		// first prepare the TwitterOAuth mock
		$twitterOAuth = $this->getMockBuilder('Abraham\TwitterOAuth\TwitterOAuth')
			->setConstructorArgs(array($this->twitter->getConsumerKey(),
				$this->twitter->getConsumerSecret()))
			->getMock();

		$twitterOAuth->expects($this->exactly(3))
			->method('get')
			->will($this->returnValue(''));

		$twitterOAuth->expects($this->exactly(3))
			->method('getLastHttpCode')
			->will($this->returnValue('404'));

		$this->twitter->setTwitter($twitterOAuth);
		$this->twitter->setUsernames('username1 username2 username3');
	}

	public function testAuthenticateAppSetsOauthTokenSecret() {

		$expectedOauth2ReturnCreds = json_decode(json_encode(array('access_token' => 'value')));

		$twitterOAuth = $this->getMockBuilder('Abraham\TwitterOAuth\TwitterOAuth')
			->setConstructorArgs(array($this->twitter->getConsumerKey(),
				$this->twitter->getConsumerSecret()))
			->getMock();

		$twitterOAuth->expects($this->once())
			->method('oauth2')
			->will($this->returnValue($expectedOauth2ReturnCreds));

		$twitterOAuth->expects($this->once())
			->method('getLastHttpCode')
			->will($this->returnValue('200'));

		$authArray = $this->twitter->authenticateApp($twitterOAuth);

		$this->assertArrayHasKey('oauthTokenSecret', $authArray);
		$this->assertEquals($authArray['oauthTokenSecret'], 'value');
	}

	/**
	 * @expectedException Exception
	 */
	public function testAuthenticateAppFailureThrowsException() {

		$expectedOauth2ReturnCreds = json_decode(json_encode(array('access_token' => 'value')));

		$twitterOAuth = $this->getMockBuilder('Abraham\TwitterOAuth\TwitterOAuth')
			->setConstructorArgs(array($this->twitter->getConsumerKey(),
				$this->twitter->getConsumerSecret()))
			->getMock();

		$twitterOAuth->expects($this->once())
			->method('oauth2')
			->will($this->returnValue($expectedOauth2ReturnCreds));

		$twitterOAuth->expects($this->once())
			->method('getLastHttpCode')
			->will($this->returnValue('404'));

		$authArray = $this->twitter->authenticateApp($twitterOAuth);
	}

	public function testSearchReturnsArray() {

		$numTweets = 3;
		$oembedResponse = json_encode(array(
			'html' => 'tweetBlock'));
		$getResponse = json_decode(json_encode(array(
			'statuses' => array(
				array(
					'id' => 'idval',
					'text' => 'textval',
					'user' => array('name' => 'nameval',
						'screen_name' => 'snval'),
					'created_at' => 'createval'),
				array(
                                        'id' => 'idval2',
                                        'text' => 'textval2',
                                        'user' => array('name' => 'nameval2',
                                                'screen_name' => 'snval2'),
                                        'created_at' => 'createval2'),
				array(
                                        'id' => 'idval3',
                                        'text' => 'textval3',
                                        'user' => array('name' => 'nameval3',
                                                'screen_name' => 'snval3'),
                                        'created_at' => 'createval3')))));

		// first prepare the TwitterOAuth mock
                $twitterOAuth = $this->getMockBuilder('Abraham\TwitterOAuth\TwitterOAuth')
                        ->setConstructorArgs(array($this->twitter->getConsumerKey(),
                                $this->twitter->getConsumerSecret()))
                        ->getMock();

                $twitterOAuth->expects($this->once())
                        ->method('get')
                        ->will($this->returnValue($getResponse));

                $this->twitter->setTwitter($twitterOAuth);

		// then prepare the curl mock
		$curl = $this->getMockBuilder('curl')
			->setMethods(['initiate', 'setOptArray', 'execute', 'getErrorNumber', 'close'])
			->getMock();

		$curl->expects($this->exactly($numTweets))
			->method('initiate');
		$curl->expects($this->exactly($numTweets))
			->method('setOptArray');
		$curl->expects($this->exactly($numTweets))
                        ->method('execute')
			->will($this->returnValue($oembedResponse));
		$curl->expects($this->exactly($numTweets))
                        ->method('getErrorNumber')
			->will($this->returnValue(false));
		$curl->expects($this->exactly($numTweets))
                        ->method('close');

		$this->twitter->setCurl($curl);

		$searchResults = $this->twitter->search('', 3, 'term', '', false);

		$this->assertEquals(3, sizeof($searchResults));
		$this->assertTrue(is_array($searchResults));
	}

	public function testSearchSearchArray() {

		$numTweets = 3;
                $oembedResponse = json_encode(array(
                        'html' => 'tweetBlock'));
                $getResponse = json_decode(json_encode(array(
                        'statuses' => array(
                                array(
                                        'id' => 'idval',
                                        'text' => 'textval',
                                        'user' => array('name' => 'nameval',
                                                'screen_name' => 'snval'),
                                        'created_at' => 'createval'),
                                array(
                                        'id' => 'idval2',
                                        'text' => 'textval2',
                                        'user' => array('name' => 'nameval2',
                                                'screen_name' => 'snval2'),
                                        'created_at' => 'createval2'),
                                array(
                                        'id' => 'idval3',
                                        'text' => 'textval3',
                                        'user' => array('name' => 'nameval3',
                                                'screen_name' => 'snval3'),
                                        'created_at' => 'createval3')))));

                // first prepare the TwitterOAuth mock
                $twitterOAuth = $this->getMockBuilder('Abraham\TwitterOAuth\TwitterOAuth')
                        ->setConstructorArgs(array($this->twitter->getConsumerKey(),
                                $this->twitter->getConsumerSecret()))
                        ->getMock();

                $twitterOAuth->expects($this->exactly(4))
                        ->method('get')
                        ->will($this->returnValue($getResponse));

		$this->twitter->setTwitter($twitterOAuth);

                // then prepare the curl mock
                $curl = $this->getMockBuilder('curl')
			->setMethods(['initiate', 'setOptArray', 'execute', 'getErrorNumber', 'close'])
                        ->getMock();

                $curl->expects($this->exactly(2 * $numTweets))
                        ->method('initiate');
                $curl->expects($this->exactly(2 * $numTweets))
                        ->method('setOptArray');
                $curl->expects($this->exactly(2 * $numTweets))
                        ->method('execute')
                        ->will($this->returnValue($oembedResponse));
                $curl->expects($this->exactly(2 * $numTweets))
                        ->method('getErrorNumber')
                        ->will($this->returnValue(false));
                $curl->expects($this->exactly(2 * $numTweets))
                        ->method('close');

                $this->twitter->setCurl($curl);

                // test with no retweets filter off and geocode on
                $searchResults = $this->twitter->search('username', 3, 'term to search', '36.778259,-119.417931', false);

		$expectedResult = array('q' => 'from:username term to search',
			'count' => 3,
			'geocode' => '36.778259,-119.417931,5mi');
		$this->assertEquals($expectedResult, $this->twitter->getSearchArray());

		// test with no retweets filter on and geocode off
		$searchResults = $this->twitter->search('username', 3, 'term to search', '', true);

                $expectedResult = array('q' => 'from:username term to search -filter:retweets',
                        'count' => 3);
                $this->assertEquals($expectedResult, $this->twitter->getSearchArray());

	}

	public function testSearchOembedFailureReturnsTextTweet() {

		$numTweets = 1;
		$oembedResponse = json_encode(array(
			'html' => 'tweetBlock'));
		$getResponse = json_decode(json_encode(array(
			'statuses' => array(
				array(
					'id' => 'idval',
					'text' => 'textval',
					'user' => array('name' => 'nameval',
						'screen_name' => 'snval'),
					'created_at' => '2016-09-23 00:34:19')
				))));

		// first prepare the TwitterOAuth mock
		$twitterOAuth = $this->getMockBuilder('Abraham\TwitterOAuth\TwitterOAuth')
			->setConstructorArgs(array($this->twitter->getConsumerKey(),
				$this->twitter->getConsumerSecret()))
			->getMock();

		$twitterOAuth->expects($this->exactly(2))
			->method('get')
			->will($this->returnValue($getResponse));

		$this->twitter->setTwitter($twitterOAuth);

		// then prepare the curl mock
		$curl = $this->getMockBuilder('curl')
			->setMethods(['initiate', 'setOptArray', 'execute', 'getErrorNumber', 'close'])
			->getMock();

		$curl->expects($this->exactly($numTweets))
			->method('initiate');
		$curl->expects($this->exactly($numTweets))
			->method('setOptArray');
		$curl->expects($this->exactly($numTweets))
			->method('execute')
			->will($this->returnValue($oembedResponse));
		$curl->expects($this->exactly($numTweets))
			->method('getErrorNumber')
			->will($this->returnValue('1'));
		$curl->expects($this->exactly($numTweets))
			->method('close');

		$this->twitter->setCurl($curl);

		$searchResults = $this->twitter->search('username', 3, 'term to search', '36.778259,-119.417931', false);

		$expectedResultUrl = 'https://twitter.com/snval/status/idval';
		$expectedResult = '
';
		$expectedResult .= '
textval
';
		$expectedResult .= ' — nameval (@snval)';
		$expectedResult .= ' September 23, 2016';
		$expectedResult .= '
';

		$this->assertEquals(1, sizeof($searchResults));
		$this->assertEquals($expectedResult, $searchResults[0]);
	}

	/**
	 * @expectedException Exception
	 */
	public function testSearchThrowsExceptionOnNoResults() {

		$numTweets = 1;
		$getResponse = json_decode(json_encode(array(
				'statuses' => array())));

		// first prepare the TwitterOAuth mock
		$twitterOAuth = $this->getMockBuilder('Abraham\TwitterOAuth\TwitterOAuth')
			->setConstructorArgs(array($this->twitter->getConsumerKey(),
				$this->twitter->getConsumerSecret()))
			->getMock();

		$twitterOAuth->expects($this->once())
			->method('get')
			->will($this->returnValue($getResponse));

		$this->twitter->setTwitter($twitterOAuth);

		$searchResults = $this->twitter->search('', 3, 'term to search', '36.778259,-119.417931', false);
	}

	public function testSearchReturnsOembedBlock() {

		$numTweets = 1;
		$oembedResponse = json_encode(array(
			'html' => 'tweetBlock'));
		$getResponse = json_decode(json_encode(array(
			'statuses' => array(
				array(
					'id' => 'idval',
					'text' => 'textval',
					'user' => array('name' => 'nameval',
						'screen_name' => 'snval'),
					'created_at' => 'createval')
				))));

		// first prepare the TwitterOAuth mock
		$twitterOAuth = $this->getMockBuilder('Abraham\TwitterOAuth\TwitterOAuth')
			->setConstructorArgs(array($this->twitter->getConsumerKey(),
				$this->twitter->getConsumerSecret()))
			->getMock();

		$twitterOAuth->expects($this->exactly(2))
			->method('get')
			->will($this->returnValue($getResponse));

		$this->twitter->setTwitter($twitterOAuth);

		// then prepare the curl mock
		$curl = $this->getMockBuilder('curl')
			->setMethods(['initiate', 'setOptArray', 'execute', 'getErrorNumber', 'close'])
			->getMock();

		$curl->expects($this->exactly($numTweets))
			->method('initiate');
		$curl->expects($this->exactly($numTweets))
			->method('setOptArray');
		$curl->expects($this->exactly($numTweets))
			->method('execute')
			->will($this->returnValue($oembedResponse));
		$curl->expects($this->exactly($numTweets))
			->method('getErrorNumber')
			->will($this->returnValue(false));
		$curl->expects($this->exactly($numTweets))
			->method('close');

		$this->twitter->setCurl($curl);

		$searchResults = $this->twitter->search('username', 3, 'term to search', '36.778259,-119.417931', false);

		$this->assertEquals(1, sizeof($searchResults));
		$this->assertEquals('tweetBlock', $searchResults[0]);
	}
}
?>


text:
layout: post
date: 2016-12-24
title: "Mikaella Bridal 1909 Sleeveless Chapel Train Mermaid/Trumpet"
category: Mikaella
tags: [Mikaella ,Mikaella,Mermaid/Trumpet,Spaghetti Straps,Chapel Train,Sleeveless]
---
### Mikaella Bridal 1909
Just **$329.99**
###   Sleeveless Chapel Train Mermaid/Trumpet

BRANDS	Mikaella

Silhouette	Mermaid/Trumpet

Neckline	Spaghetti Straps

Hemline/Train	Chapel Train

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/mikaella-/46374-mikaella-bridal-1909.html](https://www.readybrides.com/en/mikaella-/46374-mikaella-bridal-1909.html)


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

using System.Web.Http;
using System.Web.Http.Description;
using System.Web.Http.SelfHost;
using Tavis;

namespace WebApiConsole
{
    class Program
    {
        static void Main(string[] args)
        {

            var baseAddress = "http://localhost:8080";
            var config = new HttpSelfHostConfiguration(baseAddress);

            config.Routes.MapHttpRoute("defaultWithId", "api/{controller}/{id}");
            config.Routes.MapHttpRoute("default", "api/{controller}");
            //config.Routes.MapHttpRoute("default", "api/{controller}/{id}", new {id= RouteParameter.Optional});

            var server = new HttpSelfHostServer(config);

            Console.WriteLine("Opening server at " + baseAddress);
            server.OpenAsync().Wait();

            Console.WriteLine("Press enter to shutdown server");
            Console.ReadLine();
            server.CloseAsync().Wait();

        }
    }
}


text:
using eFormShared;
using eFormSqlController;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using eFormCore.Helpers;

namespace eFormCore.Helpers
{
    public class TestHelperReturnXML
    {

        private TestHelpers testHelpers;
        Tools t = new Tools();

        public TestHelperReturnXML()
        {        Tools t = new Tools();
            testHelpers = new TestHelpers();

        }

        #region "prep sever information for full load"
        public string CreateSiteUnitWorkersForFullLoaed(bool create)
        {
            if (create)
            {
                int id = t.GetRandomInt(6);
                string siteName = Guid.NewGuid().ToString();
                sites site = testHelpers.CreateSite(siteName, id);

                id = t.GetRandomInt(6);
                string userFirstName = Guid.NewGuid().ToString();
                string userLastName = Guid.NewGuid().ToString();
                workers worker = testHelpers.CreateWorker("sfsdfsdf23ref@invalid.com", userFirstName, userLastName, id);
                return "";
            }

            try
            {
                sites site = testHelpers.DbContext.sites.First();
                workers worker = testHelpers.DbContext.workers.First();

                int id = t.GetRandomInt(6);
                JObject result = JObject.FromObject(new JArray(new
                {
                    id = id, created_at = "2018-01-12T01:01:00Z", updated_at = "2018-01-12T01:01:10Z",
                    workflow_state = Constants.WorkflowStates.Created, person_type = "",
                    site_id = site.microting_uid, user_id = worker.microting_uid
                }));
                return result.ToString();
            }
            catch
            {
                return "{}";
            }
        }
        #endregion

        #region
        public string CreateMultiPictureXMLResult(bool create)
        {
            if (create)
            {
                sites site = testHelpers.CreateSite("TestSite1", 12334);
                units unit = testHelpers.CreateUnit(20934, 234234, site, 24234);
                workers worker = testHelpers.CreateWorker("sfsdfsdf23ref@invalid.com", "John", "Doe", 2342341);
                site_workers sw = testHelpers.CreateSiteWorker(242345, site, worker);
                DateTime cl1_ca = DateTime.Now;
                DateTime cl1_ua = DateTime.Now;
                check_lists cl1 = testHelpers.CreateTemplate(cl1_ca, cl1_ua, "MultiPictureXMLResult", "MultiPictureXMLResult_Description", "", "", 0, 0);
                check_lists cl2 = testHelpers.CreateSubTemplate("Sub1", "Sub1Description", "", 0, 0, cl1);
                fields f1 = testHelpers.CreateField(0, "", cl2, Constants.FieldColors.Blue, "", null, "", "PictureDescription", 0, 0, testHelpers.DbContext.field_types.Where(x => x.field_type == "picture").First(), 0, 0, 0, 0, "Take picture", 0, 0, "", "", 0, 0, "", 0, 0, 0, 0, "", 0);
                check_list_sites cls = testHelpers.CreateCheckListSite(cl1, cl1_ca, site, cl1_ua, 0, Constants.WorkflowStates.Created, "MultiPictureTestInMultipleChecks");
                //returnXML = ;
                return "MultiPictureTestInMultipleChecks";
            }
            else
            {
                sites site = testHelpers.DbContext.sites.First();
                units unit = testHelpers.DbContext.units.First();
                workers worker = testHelpers.DbContext.workers.First();
                check_lists cl1 = testHelpers.DbContext.check_lists.ToList()[0];
                check_lists cl2 = testHelpers.DbContext.check_lists.ToList()[1];
                fields f1 = testHelpers.DbContext.fields.First();

                #region return xml
                return $@"<?xml version='1.0' encoding='UTF-8'?>
                <Response>
                    <Value type='success'>MultiPictureTestInMultipleChecks</Value>
                    <Checks>
                        <Check worker='John Doe' worker_id='{worker.microting_uid}' date='2018-04-25 14:29:21 +0200' unit_id='{unit.microting_uid}' id='7'>
                            <ElementList>
                                <Id>{cl2.id}</Id>
                                <Status>approved</Status>
                                <DataItemList>
                                    <DataItem>
                                        <Id>{f1.id}</Id>
                                        <Geolocation>
                                            <Latitude></Latitude>
                                            <Longitude></Longitude>
                                            <Altitude></Altitude>
                                            <Heading></Heading>
                                            <Accuracy></Accuracy>
                                            <Date></Date>
                                        </Geolocation>
                                        <Value></Value>
                                        <Extension>.jpeg</Extension>
                                        <URL>https://www.microting.com/wp-content/themes/Artificial-Reason-WP/img/close.png</URL>
                                    </DataItem>
                                </DataItemList>
                                <ExtraDataItemList></ExtraDataItemList>
                            </ElementList>
                        </Check>
                        <Check worker='John Doe' worker_id='{worker.microting_uid}' date='2018-04-25 14:29:52 +0200' unit_id='{unit.microting_uid}' id='12'>
                            <ElementList>
                                <Id>{cl2.id}</Id>
                                <Status>approved</Status>
                                <DataItemList>
                                    <DataItem>
                                        <Id>{f1.id}</Id>
                                        <Geolocation>
                                            <Latitude></Latitude>
                                            <Longitude></Longitude>
                                            <Altitude></Altitude>
                                            <Heading></Heading>
                                            <Accuracy></Accuracy>
                                            <Date></Date>
                                        </Geolocation>
                                        <Value></Value>
                                        <Extension>.jpeg</Extension>
                                        <URL>https://www.microting.com/wp-content/themes/Artificial-Reason-WP/img/close.png</URL>
                                    </DataItem>
                                    <DataItem>
                                        <Id>{f1.id}</Id>
                                        <Geolocation>
                                            <Latitude></Latitude>
                                            <Longitude></Longitude>
                                            <Altitude></Altitude>
                                            <Heading></Heading>
                                            <Accuracy></Accuracy>
                                            <Date></Date>
                                        </Geolocation>
                                        <Value></Value>
                                        <Extension>.jpeg</Extension>
                                        <URL>https://www.microting.com/wp-content/themes/Artificial-Reason-WP/img/close.png</URL>
                                    </DataItem>
                                </DataItemList>
                                <ExtraDataItemList></ExtraDataItemList>
                            </ElementList>
                        </Check>
                        <Check worker='John Doe' worker_id='{worker.microting_uid}' date='2018-04-25 14:39:43 +0200' unit_id='{unit.microting_uid}' id='17'>
                            <ElementList>
                                <Id>{cl2.id}</Id>
                                <Status>approved</Status>
                                <DataItemList>
                                    <DataItem>
                                        <Id>{f1.id}</Id>
                                        <Geolocation>
                                            <Latitude></Latitude>
                                            <Longitude></Longitude>
                                            <Altitude></Altitude>
                                            <Heading></Heading>
                                            <Accuracy></Accuracy>
                                            <Date></Date>
                                        </Geolocation>
                                        <Value></Value>
                                        <Extension>.jpeg</Extension>
                                        <URL>https://www.microting.com/wp-content/themes/Artificial-Reason-WP/img/close.png</URL>
                                    </DataItem>
                                    <DataItem>
                                        <Id>{f1.id}</Id>
                                        <Geolocation>
                                            <Latitude></Latitude>
                                            <Longitude></Longitude>
                                            <Altitude></Altitude>
                                            <Heading></Heading>
                                            <Accuracy></Accuracy>
                                            <Date></Date>
                                        </Geolocation>
                                        <Value></Value>
                                        <Extension>.jpeg</Extension>
                                        <URL>https://www.microting.com/wp-content/themes/Artificial-Reason-WP/img/close.png</URL>
                                    </DataItem>
                                </DataItemList>
                                <ExtraDataItemList></ExtraDataItemList>
                            </ElementList>
                        </Check>
                    </Checks>
                </Response>".Replace("'", "\"");
                #endregion
            }

        }
        #endregion
    }
}


text:
package org.roag.pages;

import com.codeborne.selenide.Condition;
import io.qameta.allure.Step;
import org.roag.pages.modules.AlertPanel;
import org.roag.pages.modules.SideBar;
import org.roag.pages.modules.MenuBar;

import static com.codeborne.selenide.Selenide.$;

/**
 * Created by eurohlam on 17/08/19.
 */
abstract class AbstractPage implements Page {

    private final MenuBar menuBar = new MenuBar($("nav#mainNav"));
    private final SideBar sideBar = new SideBar($("aside#sidebar-wrapper"));
    private AlertPanel alertPanel = new AlertPanel($("#alerts_panel"));

    @Step("Get menu bar")
    public MenuBar menubar() {
        menuBar.shouldBe(Condition.visible);
        return menuBar;
    }

    @Step("Get side bar")
    public SideBar sidebar() {
        sideBar.shouldBe(Condition.visible);
        return sideBar;
    }

    @Step("Get alert panel")
    public AlertPanel alertPanel() {
        alertPanel.shouldBe(Condition.visible);
        return alertPanel;
    }
}


text:
package org.develnext.jphp.core.tokenizer.token.expr.operator;

import php.runtime.env.Environment;
import php.runtime.env.TraceInfo;
import php.runtime.memory.StringMemory;
import php.runtime.Memory;
import org.develnext.jphp.core.tokenizer.TokenType;
import org.develnext.jphp.core.tokenizer.TokenMeta;
import org.develnext.jphp.core.tokenizer.token.expr.OperatorExprToken;

public class ConcatExprToken extends OperatorExprToken {
    public ConcatExprToken(TokenMeta meta) {
        super(meta, TokenType.T_J_CONCAT);
    }

    @Override
    public int getPriority() {
        return 50;
    }

    @Override
    public String getCode() {
        return "concat";
    }

    @Override
    public Class<?> getResultClass() {
        return String.class;
    }

    @Override
    public Memory calc(Environment env, TraceInfo trace, Memory o1, Memory o2) {
        return StringMemory.valueOf(o1.concat(o2));
    }

    @Override
    public boolean isImmutableResult() {
        return true;
    }

    @Override
    public boolean isMutableArguments() {
        return true;
    }
}