text:
"""Contain helper class to retrieve/store token from/to local cache."""
import os
from pathlib import Path
from typing import Optional

class HfFolder:
    path_token = Path("~/.huggingface/token").expanduser()

    @classmethod
    def save_token(cls, token: str) -> None:
        """
        Save token, creating folder as needed.

        Args:
            token (`str`):
                The token to save to the [`HfFolder`]
        """
        cls.path_token.parent.mkdir(exist_ok=True)
        with cls.path_token.open("w+") as f:
            f.write(token)

    @classmethod
    def get_token(cls) -> Optional[str]:
        """
        Get token or None if not existent.

        Note that a token can be also provided using the
        `HUGGING_FACE_HUB_TOKEN` environment variable.

        Returns:
            `str` or `None`: The token, `None` if it doesn't exist.
        """
        token: Optional[str] = os.environ.get("HUGGING_FACE_HUB_TOKEN")
        if token is None:
            try:
                return cls.path_token.read_text()
            except FileNotFoundError:
                pass
        return token

    @classmethod
    def delete_token(cls) -> None:
        """
        Deletes the token from storage. Does not fail if token does not exist.
        """
        try:
            cls.path_token.unlink()
        except FileNotFoundError:
            pass


text:
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.sagar.physicsanimation.chainanimation.ChainAnimationFragment">

    <ImageView
        android:id="@+id/android_bot"
        android:layout_width="@dimen/chain_android_bot_size"
        android:layout_height="@dimen/chain_android_bot_size"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:srcCompat="@drawable/ic_android"/>

    <ImageView
        android:id="@+id/android_bot1"
        android:layout_width="@dimen/chain_android_bot1_size"
        android:layout_height="@dimen/chain_android_bot1_size"
        android:layout_marginTop="@dimen/android_bot_vertical_spacing"
        app:layout_constraintStart_toStartOf="@+id/android_bot"
        app:layout_constraintTop_toBottomOf="@+id/android_bot"
        app:layout_constraintEnd_toEndOf="@+id/android_bot"
        app:srcCompat="@drawable/ic_android"/>

    <ImageView
        android:id="@+id/android_bot2"
        android:layout_width="@dimen/chain_android_bot2_size"
        android:layout_height="@dimen/chain_android_bot2_size"
        android:layout_marginTop="@dimen/android_bot_vertical_spacing"
        app:srcCompat="@drawable/ic_android"
        app:layout_constraintStart_toStartOf="@+id/android_bot1"
        app:layout_constraintTop_toBottomOf="@+id/android_bot1"
        app:layout_constraintEnd_toEndOf="@+id/android_bot1" />

</android.support.constraint.ConstraintLayout>

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE>Week 4: Multi-Agent PacMan</title>

Week 4: Multi-Agent PacMan

PacMan, now with ghosts.

  Evaluation, Minimax, Alpha-beta-pruning.

Introduction

 Oh No! Now there is a ghost around who for some reason is trying to kill PacMan (or even, if that's not bad enough,
several ghosts)! PacMan needs some way of planning to achieve his goals of eating the pellets, whilst avoiding the ghosts.
As we don't know how clever the ghosts are, for now we will assume they are very clever (act optimally to get PacMan).

In this project, you will design agents for the classic version of PacMan, including ghosts. Along the way, you will
implement minimax search without and with α-β-pruning, and try your hand at evaluation function design.

The code base has changed a bit from the previous projects, so please start with a fresh installation, rather than
intermingling files from earlier weeks. You can, however, copy-paste your own code or the example solutions in
search.py and searchAgents.py in any way
you want.

The code for this project contains the following files, available as a zip
archive.

Key files to read

      multiAgents.py

Where all of your multi-agent search agents will reside.

      pacman.py

The main file that runs PacMan games. This file also describes a PacMan GameState type,
         which you will use extensively in this project

      game.py

The logic behind how the PacMan world works. This file describes several supporting types like AgentState,
        Agent, Direction, and Grid.

      util.py

Useful data structures for implementing search algorithms.

Files you can ignore

      graphicsDisplay.py

Graphics for PacMan

      graphicsUtils.py

Support for PacMan graphics

      textDisplay.py

ASCII graphics for PacMan

      ghostAgents.py

Agents to control ghosts

      keyboardAgents.py

Keyboard interfaces to control PacMan

        layout.py

Code for reading layout files and storing their contents

What to submit:

You will fill in portions of multiAgents.py
during the assignment. You should submit this file with your code and comments.  You may also submit supporting files
(like search.py, etc.) that you use in your code.
Please do not change the other files in this distribution or submit any of our original files other than
multiAgents.py. Make sure that you submit the (source) .py files,
not the (compiled) .pyc files!

Multi-Agent PacMan

First, play a game of classic PacMan:

python pacman.py

Now, run the provided ReflexAgent in multiAgents.py:

python pacman.py -p ReflexAgent

Note that it plays quite poorly even on simple layouts:

python pacman.py -p ReflexAgent -l testClassic

Inspect its code (in multiAgents.py) and make sure you understand what
it's doing.

Assignment 1:

Improve the ReflexAgent in multiAgents.py to play respectably.
The provided reflex agent code provides some helpful examples of methods that query the GameState for
information. In addition, you might find the following methods useful (but remember that you can get a listing of all
methods for an object by typing dir(<objectName>) in the python run window):

      <gameState>.isWin()

returns True if the game state is a winning one (all food eaten)

      <gameState>.isLose()

returns True if the game state is a losing one (pacman died)

      <agentState>.getPosition()

returns an (x,y) tuple with the current position of the agent (pacman or ghost)

      <ghostState>.scaredTimer

gets you the number of turns that the ghost will remain scared (0 if it currently isn't)

A capable reflex agent will have to consider both food locations and ghost locations to perform well. Your
agent should easily and reliably clear the testClassic layout:

python pacman.py -p ReflexAgent -l testClassic

Try out your reflex agent on the default mediumClassic layout with one ghost or two (and animation off to speed up the display):

python pacman.py --frameTime 0 -p ReflexAgent -k 1

python pacman.py --frameTime 0 -p ReflexAgent -k 2

How does your agent fare?  It will likely often die with 2 ghosts on the default board, unless your evaluation function is quite good.

Note: you can never have more ghosts than the layout permits. For mediumClassic that amount is two. So  -k 3 will still get you only two ghosts.

Note: As features, try the reciprocal of important values (such as distance to food) rather than just the values themselves.

Note: The evaluation function you're writing is evaluating state-action pairs; in later parts of this project, you'll be evaluating states.

Options: Default ghosts are random; you can also play for fun with slightly smarter directional ghosts using -g DirectionalGhost.  If the randomness is preventing you from telling whether your agent is improving, you can use -f to run with a fixed random seed (same random choices every game).  You can also play multiple games in a row with -n.  Turn off graphics with -q to run lots of games quickly.

We will will check that your agent can rapidly clear the
openClassic layout ten times without dying more than twice or thrashing around infinitely (i.e. repeatedly moving back and forth between two positions, making no progress).

python pacman.py -p ReflexAgent -l openClassic -n 10 -q

Don't spend too much time on this question, though, as the meat of the project lies ahead.

Assignment 2:

Now you will write an adversarial search agent in the provided MinimaxAgent class stub in
multiAgents.py.  For now, your minimax agent only needs to work with one ghost
(extra credit assignment B will ask you to extend the algorithm to any number of ghosts). You can use the pseudo-algorithm
in P&M (page 432) and strip out the alpha-beta parts.

 Your code should expand the game tree to the depth given in the 'depth' argument, and stored in self.depth.
Score the leaves of your minimax tree (i.e. the nodes at the depth limit) with the supplied self.evaluationFunction,
which defaults to scoreEvaluationFunction. MinimaxAgent extends MultiAgentAgent,
which gives access to self.depth and self.evaluationFunction. Make sure your minimax code makes
reference to these two variables where appropriate as these variables are populated in response to command line options.

Important: A single search ply is considered to be one PacMan move and the ghost's response, so depth 2 search will involve PacMan and the ghost each moving two times.

Hints and Observations

The evaluation function in this part is already written (self.evaluationFunction).You shouldn't
change this function, but recognize that now we're evaluating *states* rather than actions, as we were for the reflex
agent. Look-ahead agents evaluate future states whereas reflex agents evaluate actions from the current state.

The minimax values of the initial state in the minimaxClassic layout with one ghost are 9, 8, 7, 536 for
depths 1, 2, 3 and 4 respectively. Note that your minimax agent predicts a win at depth 4, but still has a low expectation
at depth 3, i.e. it does not see the win coming at lower depths. This is due to the weakness of the provided state evaluation
function, which simply evaluates a state by its game score.

python pacman.py -p MinimaxAgent -l minimaxClassic -a depth=4 -k 1

To increase the search depth achievable by your agent, remove the Directions.STOP action from PacMan's list
of possible actions. Depth 2 should be pretty quick, but depth 3 or 4 will be slow.  Don't worry, the next question will
speed up the search somewhat.

PacMan is always agent 0, and the ghost(s) are agent(s) 1 - n. The agents move in order of increasing agent index.

All states in minimax should be GameStates, either passed in to getAction or generated via
GameState.generateSuccessor. In this project, you will not be abstracting to simplified states.

On larger boards such as openClassic and mediumClassic (the default), you'll find PacMan to
be good at not dying, but quite bad at winning. He'll often thrash around without making progress. He might even thrash
around right next to a dot without eating it because he doesn't know where he'd go after eating that dot.  Don't worry
if you see this behavior, a better evaluation function (extra credit assignment A) will clean up all of these issues.

When PacMan believes that his death is unavoidable, he will try to end the game as soon as possible because of the
constant penalty for living.  Sometimes, this is the wrong thing to do with random ghosts, but minimax agents always
assume the worst:

python pacman.py -p MinimaxAgent -l trappedClassic -a depth=3 -k 1

Make sure you understand why PacMan rushes the ghost in this case.

Assignment 3:

Make a new agent that uses alpha-beta pruning to more efficiently explore the minimax tree, in AlphaBetaAgent.
In principle this should be fairly easy, following the P&M pseudo-code on page 432, if only that
pseudo-code would not be wrong: where it says return β on line 13, that should be
return α, and where it says return α  on line 19, that should be
return β. So beware!

 You should see a speed-up (perhaps depth 3 alpha-beta will run as fast as depth 2 minimax). Ideally, depth 3 on
smallClassic should run in just a few seconds per move or faster.

python pacman.py -p AlphaBetaAgent -a depth=3 -l smallClassic -k 1

 The AlphaBetaAgent minimax values should be identical to the MinimaxAgent minimax values,
although the actions it selects can vary because of different tie-breaking behavior.  Again, the minimax values of the
initial state in the minimaxClassic layout are 9, 8, 7 and 536 for depths 1, 2, 3 and 4 respectively.

BONUS: better evaluation and/or more opponents

There are two bonus assignments. You can choose which one to hand in for your extra credit points. You will not get
double credit points if you hand in both.

Extra credit assignment A:

Write a better evaluation function for pacman in the provided function
betterEvaluationFunction.  The evaluation function should evaluate states, rather than actions like your reflex agent evaluation function did.  You may use any tools at your disposal for evaluation, including your search code (or the example solution code) from the last project.  With depth 2 search, your evaluation function should clear the smallClassic layout with one random ghost most of the times and still run at a reasonable rate (to get full credit, PacMan should be averaging around 1000 points when he's winning).

python pacman.py -l smallClassic -p MinimaxAgent -a evalFn=better -q -n 10 -k 1

Document your evaluation function!  We're very curious about what great ideas you have, so don't be shy.

Hints and Observations

Like for your reflex agent evaluation function, you may want to use the reciprocal of important values (such as
distance to food) rather than the values themselves.

One way you might want to write your evaluation function is to use a linear combination of features. That is, compute
values for features about the state that you think are important, and then combine those features by multiplying them by
different values and adding the results together. You might decide what to multiply each feature by based on how important
you think it is.

Extra credit assignment B:

Extend your alpha-beta-minimax algorithm to work with any number of ghosts, by filling in the
MultiAlphaBetaAgent class stub. This means writing an algorithm that is slightly more general than what
appears in P&M. In particular, your minimax tree will have multiple min layers (one for each ghost) for every max layer,
and you should extend the alpha-beta pruning logic appropriately to multiple minimizer agents.

The minimax values of the initial state in the minimaxClassic layout with two ghost are 9, 8, 7, -492 for
depths 1, 2, 3 and 4 respectively. Note that your minimax agent will now predict a loss at depth 4 (instead of the win
when there was one ghost). But also note that your agent will in fact often win, despite the dire prediction of depth 4
minimax. This is, of course, because minimax assumes that all ghost play optimally, whilst in fact these (default) ghosts
move randomly.


text:
package jdamvc.engine.model;

public class UserModel extends Model {}


text:
describe('L#noConflict', function() {
	it('restores the previous L value and returns Leaflet namespace', function(){

		expect(L.version).to.be.ok();

		var L2 = L.noConflict();

		expect(L).to.eql('test');
		expect(L2.version).to.be.ok();

		window.L = L2;
	});
});


text:
package org.buildmlearn.toolkit.templates;

import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.BaseAdapter;
import android.widget.EditText;

import org.buildmlearn.toolkit.R;
import org.buildmlearn.toolkit.infotemplate.fragment.SplashFragment;
import org.buildmlearn.toolkit.model.Template;
import org.buildmlearn.toolkit.model.TemplateInterface;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

import java.util.ArrayList;

/**
 * @brief Info template code implementing methods of TemplateInterface
 * <p/>
 * Created by abhishek on 16/06/15 at 9:59 PM.
 */
public class InfoTemplate implements TemplateInterface {

    transient private InfoAdapter adapter;
    private ArrayList<InfoModel> infoData;
    private int templateId;

    public InfoTemplate() {
        infoData = new ArrayList<>();
    }

    public static boolean validated(Context context, EditText word, EditText meaning) {
        if (word == null || meaning == null) {
            return false;
        }

        String wordText = word.getText().toString().trim();
        String meaningText = meaning.getText().toString().trim();

        if ("".equals(wordText)) {
            word.setError(context.getString(R.string.enter_word));
            return false;
        } else if ("".equals(meaningText)) {
            meaning.setError(context.getString(R.string.enter_description));
            return false;
        }
        return true;

    }

    @Override
    public BaseAdapter newTemplateEditorAdapter(Context context) {
        adapter = new InfoAdapter(context, infoData);
        setEmptyView((Activity) context);
        return adapter;
    }

    @Override
    public BaseAdapter newMetaEditorAdapter(Context context) {
        return null;
    }

    @Override
    public BaseAdapter currentTemplateEditorAdapter() {
        return adapter;
    }

    @Override
    public BaseAdapter currentMetaEditorAdapter() {
        return null;
    }

    @Override
    public BaseAdapter loadProjectMetaEditor(Context context, Document doc) {
        return null;
    }

    @Override
    public BaseAdapter loadProjectTemplateEditor(Context context, ArrayList<Element> data) {
        infoData = new ArrayList<>();
        for (Element item : data) {
            String infoObject = item.getElementsByTagName("item_title").item(0).getTextContent();
            String infoDescription = item.getElementsByTagName("item_description").item(0).getTextContent();
            infoData.add(new InfoModel(infoObject, infoDescription));
        }
        adapter = new InfoAdapter(context, infoData);
        setEmptyView((Activity) context);
        return adapter;
    }

    @Override
    public void setTemplateId(int templateId) {
        this.templateId = templateId;
    }

    @Override
    public String getTitle() {
        return "Info Template";
    }

    @Override
    public void addItem(final Activity activity) {

        LayoutInflater inflater = activity.getLayoutInflater();
        View dialogView = inflater.inflate(R.layout.info_dialog_add_edit_data, null);
        final AlertDialog dialog = new AlertDialog.Builder(activity)
                .setTitle(R.string.info_add_new_title)
                .setView(dialogView,
                        activity.getResources().getDimensionPixelSize(R.dimen.spacing_left),
                        activity.getResources().getDimensionPixelSize(R.dimen.spacing_top),
                        activity.getResources().getDimensionPixelSize(R.dimen.spacing_right),
                        activity.getResources().getDimensionPixelSize(R.dimen.spacing_bottom))
                .setPositiveButton(R.string.info_template_add, null)
                .setNegativeButton(R.string.info_template_cancel, null)
                .create();
        dialog.show();

        final EditText word = (EditText) dialogView.findViewById(R.id.info_word);
        final EditText meaning = (EditText) dialogView.findViewById(R.id.info_meaning);

        dialog.getButton(DialogInterface.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if (validated(activity, word, meaning)) {
                    String wordText = word.getText().toString().trim();
                    String meaningText = meaning.getText().toString().trim();

                    InfoModel temp = new InfoModel(wordText, meaningText);
                    infoData.add(temp);
                    adapter.notifyDataSetChanged();
                    setEmptyView(activity);
                    dialog.dismiss();
                }

            }
        });
    }

    @Override
    public void addMetaData(Activity activity) {
        // This is intentionally empty
    }

    @Override
    public void editItem(final Activity activity, int position) {
        LayoutInflater inflater = activity.getLayoutInflater();
        View dialogView = inflater.inflate(R.layout.info_dialog_add_edit_data, null);
        final AlertDialog dialog = new AlertDialog.Builder(activity)
                .setTitle(R.string.info_edit_title)
                .setView(dialogView,
                        activity.getResources().getDimensionPixelSize(R.dimen.spacing_left),
                        activity.getResources().getDimensionPixelSize(R.dimen.spacing_top),
                        activity.getResources().getDimensionPixelSize(R.dimen.spacing_right),
                        activity.getResources().getDimensionPixelSize(R.dimen.spacing_bottom))
                .setPositiveButton(R.string.info_template_ok, null)
                .setNegativeButton(R.string.info_template_cancel, null)
                .create();
        dialog.show();

        final InfoModel data = infoData.get(position);

        final EditText word = (EditText) dialogView.findViewById(R.id.info_word);
        final EditText meaning = (EditText) dialogView.findViewById(R.id.info_meaning);
        word.setText(data.getInfoObject().trim());
        meaning.setText(data.getInfoDescription().trim());

        dialog.getButton(DialogInterface.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if (validated(activity, word, meaning)) {
                    String wordText = word.getText().toString().trim();
                    String meaningText = meaning.getText().toString().trim();

                    data.setWord(wordText);
                    data.setInfoDescription(meaningText);

                    adapter.notifyDataSetChanged();
                    dialog.dismiss();
                }

            }
        });
    }

    @Override
    public Object deleteItem(Activity activity, int position) {
        InfoModel infoModel = infoData.get(position);
        infoData.remove(position);
        setEmptyView(activity);
        adapter.notifyDataSetChanged();
        return infoModel;
    }

    @Override
    public void restoreItem(Activity activity, int position, Object object) {
        if (object instanceof InfoModel)
        {
            InfoModel infoModel = (InfoModel)object;
            if (infoModel!=null)
            {
                infoData.add(position,infoModel);
                adapter.notifyDataSetChanged();
            }
        }
    }

    @Override
    public ArrayList<Element> getItems(Document doc) {
        ArrayList<Element> itemElements = new ArrayList<>();

        for (InfoModel data : infoData) {

            itemElements.add(data.getXml(doc));
        }

        return itemElements;
    }

    @Override
    public android.support.v4.app.Fragment getSimulatorFragment(String filePathWithName) {
        return SplashFragment.newInstance(filePathWithName);
    }

    @Override
    public String getAssetsFileName(Context context) {
        Template[] templates = Template.values();
        return context.getString(templates[templateId].getAssetsName());
    }

    @Override
    public String getAssetsFilePath() {
        return "assets/";
    }

    @Override
    public String getApkFilePath() {
        return "BasicmLearningApp.apk";
    }

    @Override
    public void onActivityResult(Context context, int requestCode, int resultCode, Intent intent) {
        // This is intentionally empty
    }

    /**
     * @brief Toggles the visibility of empty text if Array has zero elements
     */
    private void setEmptyView(Activity activity) {
        if (infoData.size() < 1) {
            activity.findViewById(R.id.empty).setVisibility(View.VISIBLE);
        } else {
            activity.findViewById(R.id.empty).setVisibility(View.GONE);
        }
    }
}


text:
# grunt-frontnote

> StyleGuide Generator [FrontNote](https://github.com/frontainer/frontnote)  Plugin for Grunt.

## Getting Started
This plugin requires

* [Grunt](http://gruntjs.com/) `~0.4.5`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins.

Once you're familiar with that process, you may install this plugin with this command:

```js
grunt.loadNpmTasks('grunt-frontnote');
```

## The "frontNote" task

### Overview
In your project's Gruntfile, add a section named `frontNote` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
  frontNote: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      files: [
        // Target files path.
      ]
      // Target-specific file lists and/or options go here.
    },
  },
});
```

### Options

Options supported by [frontnote](https://github.com/frontainer/frontnote)

### Usage Examples
	frontNote: {
	    options: {
	        out: './doc',
	        template: './my-template',
	        overview: './overview.md',
	        includePath: 'assets/**/*'
	    },
	    dev: {
	        options: {
	        },
	        files: [
	            '/path/to/**/*.css',
	            '/path/to/**/*.sass',
	            '/path/to/**/*.less'
	        ]
	    }
	}


text:
/** Create Trigger DDL operation. */
package org.apache.hadoop.hive.ql.ddl.workloadmanagement.trigger.create;


text:
module ROM
  module Commands
    # Abstract result class for success and error results
    #
    # @api public
    class Result
      # Return command execution result
      #
      # @api public
      attr_reader :value

      # Return potential command execution result error
      #
      # @api public
      attr_reader :error

      # Coerce result to an array
      #
      # @abstract
      #
      # @api public
      def to_ary
        raise NotImplementedError
      end
      alias_method :to_a, :to_ary

      # Return true if command successful
      #
      # @api public
      def success?
        is_a?(Success)
      end

      # Return true if command failed
      #
      # @api public
      def failure?
        is_a?(Failure)
      end

      # Success result has a value and no error
      #
      # @api public
      class Success < Result
        # @api private
        def initialize(value)
          @value = value.is_a?(self.class) ? value.value : value
        end

        # Call next command on continuation
        #
        # @api public
        def >(other)
          other.call(value)
        end

        # Return the value
        #
        # @return [Array]
        #
        # @api public
        def to_ary
          value.to_ary
        end
      end

      # Failure result has an error and no value
      #
      # @api public
      class Failure < Result
        # @api private
        def initialize(error)
          @error = error
        end

        # Do not call next command on continuation
        #
        # @return [self]
        #
        # @api public
        def >(_other)
          self
        end

        # Return the error
        #
        # @return [Array<CommandError>]
        #
        # @api public
        def to_ary
          error
        end
      end
    end
  end
end


text:
package edw.icecat.ws.response;

import java.io.Serializable;
import java.math.BigInteger;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for Supplier complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="Supplier">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <attribute name="ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
 *       <attribute name="Name" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="LogoPic" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
 *       <attribute name="Sponsor" type="{http://www.w3.org/2001/XMLSchema}string" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Supplier")
public class Supplier
    implements Serializable
{

    private final static long serialVersionUID = 1L;
    @XmlAttribute(name = "ID", required = true)
    protected BigInteger id;
    @XmlAttribute(name = "Name")
    protected String name;
    @XmlAttribute(name = "name")
    protected String name2;
    @XmlAttribute(name = "LogoPic")
    @XmlSchemaType(name = "anyURI")
    protected String logoPic;
    @XmlAttribute(name = "Sponsor")
    protected String sponsor;

    /**
     * Gets the value of the id property.
     *
     * @return
     *     possible object is
     *     {@link BigInteger }
     *
     */
    public BigInteger getID() {
        return id;
    }

    /**
     * Sets the value of the id property.
     *
     * @param value
     *     allowed object is
     *     {@link BigInteger }
     *
     */
    public void setID(BigInteger value) {
        this.id = value;
    }

    /**
     * Gets the value of the name property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the value of the name property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setName(String value) {
        this.name = value;
    }

    /**
     * Gets the value of the name2 property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getName2() {
        return name2;
    }

    /**
     * Sets the value of the name2 property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setName2(String value) {
        this.name2 = value;
    }

    /**
     * Gets the value of the logoPic property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getLogoPic() {
        return logoPic;
    }

    /**
     * Sets the value of the logoPic property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setLogoPic(String value) {
        this.logoPic = value;
    }

    /**
     * Gets the value of the sponsor property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getSponsor() {
        return sponsor;
    }

    /**
     * Sets the value of the sponsor property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setSponsor(String value) {
        this.sponsor = value;
    }

}


text:
#region Copyright (c) 2014 Orcomp development team.
// -------------------------------------------------------------------------------------------------------------------
// <copyright file="GraphExplorerFactory.cs" company="Orcomp development team">
//   Copyright (c) 2014 Orcomp development team. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
#endregion

namespace Orc.GraphExplorer.Factories
{
    using Catel;
    using Messages;
    using Models;
    using Services;

    public class GraphExplorerFactory : IGraphExplorerFactory
    {
        #region Fields
        private readonly IDataLocationSettingsService _dataLocationSettingsService;
        #endregion

        #region Constructors
        public GraphExplorerFactory(IDataLocationSettingsService dataLocationSettingsService)
        {
            Argument.IsNotNull(() => dataLocationSettingsService);

            _dataLocationSettingsService = dataLocationSettingsService;
        }
        #endregion

        #region IGraphExplorerFactory Members
        public Explorer CreateExplorer()
        {
            var explorer = new Explorer();
            explorer.EditorToolset = new GraphToolset("Editor", true);
            explorer.NavigatorToolset = new GraphToolset("Navigator", false);

            explorer.Settings = new Settings();

            explorer.Settings.DataLocationSettings = _dataLocationSettingsService.Load();
            SettingsChangedMessage.SendWith(true);

            return explorer;
        }
        #endregion
    }
}


text:
<title>Some random page</title>

This is an H1 Title

Under the above h1 title we have some paragaph text. We even have a link that goes to the blog. You can click on it just fine.

Look funny chars: æ, ø, å

And a little H3 to mix it up

And under the little h3, we have more text. We can even throw a blockquote ...

We are now inside a blockquote. Look at my snazzy border.

This is copy of an H1 Title

Under the above h1 title we have some paragaph text. We even have a link that goes to the blog. You can click on it just fine.

Look funny chars: æ, ø, å

And a little H3 to mix it up

And under the little h3, we have more text. We can even throw a blockquote ...

We are now inside a blockquote. Look at my snazzy border.


text:
category: faq
title:  Can I solve BMIs without PENBMI or PENLAB?
tags: [Bilinear matrix inequality, Semidefinite programming]
date: '2016-09-17'
sidebar:
  nav:
---

Yes (and you will have to as these solvers typically do not work well).

Develop your own heuristic (fix variables, alternating coordinates, trust regions etc). This can easily be done in high-level YALMIP code.

Alternatively, try the global solver [BMIBNB](/solver/bmibnb) which supports nonlinear semidefinite constraints. Most likely it worn't work as your problem is too large, but it never hurts to try.


text:
using SuperMap.WinRT.Utilities;
using SuperMap.WinRT.Core;
using SuperMap.WinRT.REST;
using Windows.Data.Json;

namespace SuperMap.WinRT.REST.SpatialAnalyst
{
    ///
    /// 	<para>${REST_GeometryBufferAnalystResult_Title}</para>
    /// 	<para>${REST_GeometryBufferAnalystResult_Description}</para>
    ///
    public class GeometryBufferAnalystResult : SpatialAnalystResult
    {
        /// ${REST_GeometryBufferAnalystResult_constructor_D}
        public GeometryBufferAnalystResult()
        { }

        //public ImageResult Image
        //{
        //    get;
        //    set;
        //}

        //public string Message
        //{
        //    get;
        //    set;
        //}
        /// ${REST_GeometryBufferAnalystResult_attribute_ResultGeometry_D}
        public Geometry ResultGeometry
        {
            get;
            private set;
        }
        /// ${REST_GeometryBufferAnalystResult_method_fromJson_D}
        /// <returns>${REST_GeometryBufferAnalystResult_method_fromJson_return}</returns>
        /// <param name="jsonResult">${REST_GeometryBufferAnalystResult_method_fromJson_param_jsonObject}</param>
        internal static GeometryBufferAnalystResult FromJson(JsonObject jsonResult)
        {
            GeometryBufferAnalystResult result = new GeometryBufferAnalystResult();
            result.ResultGeometry = (ServerGeometry.FromJson(jsonResult["resultGeometry"].GetObjectEx())).ToGeometry();
            //result.Image = ImageResult.FromJson((System.Json.JsonObject)jsonResult["image"]);
            return result;
        }
    }
}


text:
module SpreeShippingTax
  class Engine < Rails::Engine
    require 'spree/core'
    isolate_namespace Spree
    engine_name 'spree_shipping_tax'

    config.autoload_paths += %W(#{config.root}/lib)

    # use rspec for tests
    config.generators do |g|
      g.test_framework :rspec
    end

    def self.activate
      Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
        Rails.configuration.cache_classes ? require(c) : load(c)
      end
    end

    initializer "spree.register.calculators" do |app|
       app.config.spree.calculators.tax_rates << Spree::Calculator::DefaultTaxWithShipping
    end

    config.to_prepare &method(:activate).to_proc
  end
end


text:
=pod

=head1 NAME

DSA_new, DSA_free - allocate and free DSA objects

=head1 SYNOPSIS

 #include <openssl/dsa.h>

Deprecated since OpenSSL 3.0, can be hidden entirely by defining
B<OPENSSL_API_COMPAT> with a suitable version value, see
L<openssl_user_macros(7)>:

 DSA* DSA_new(void);

 void DSA_free(DSA *dsa);

=head1 DESCRIPTION

All of the functions described on this page are deprecated.
Applications should instead use L<EVP_PKEY_new(3)> and L<EVP_PKEY_free(3)>.

DSA_new() allocates and initializes a B<DSA> structure. It is equivalent to
calling DSA_new_method(NULL).

DSA_free() frees the B<DSA> structure and its components. The values are
erased before the memory is returned to the system.
If B<dsa> is NULL nothing is done.

=head1 RETURN VALUES

If the allocation fails, DSA_new() returns B<NULL> and sets an error
code that can be obtained by
L<ERR_get_error(3)>. Otherwise it returns a pointer
to the newly allocated structure.

DSA_free() returns no value.

=head1 SEE ALSO

L<EVP_PKEY_new(3)>, L<EVP_PKEY_free(3)>,
L<DSA_new(3)>, L<ERR_get_error(3)>,
L<DSA_generate_parameters(3)>,
L<DSA_generate_key(3)>

=head1 HISTORY

All of these functions were deprecated in OpenSSL 3.0.

=head1 COPYRIGHT

Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License").  You may not use
this file except in compliance with the License.  You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.

=cut


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

namespace MongoDB.Test
{
    [TestFixture]
    public class TestClass
    {
        [TestCase]
        public void TestDatabase()
        {
            MongoDatabase db = new MongoDatabase("localhost", "test_db");
            db.Connect();
            db.GetCollection("foo");
        }

        [TestCase]
        [ExpectedException(typeof(System.TimeoutException))]
        public void TestUnresponsiveDatabase()
        {
            // This test was supposed to test trying to connect to a MongoDB server that was either a) not responsive, or
            // b) not available/invalid. Looks like my testing method won't work at the moment due to limitations in the API.
            // Leaving this here to revisit in the future.
            // Issue: CHARP-1231, https://jira.mongodb.org/browse/CSHARP-1231

            //MongoDatabase db = new MongoDatabase("this.is.not.a.valid.host.com", "test_db");
            //db.SetTimeout(1);
            //db.Connect();
            //db.GetCollection("foo");
        }
    }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#nullable disable

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.Composition;
using static AnalyzerRunner.Program;

namespace AnalyzerRunner
{
    public sealed class CodeRefactoringRunner
    {
        private readonly Workspace _workspace;
        private readonly Options _options;
        private readonly ImmutableDictionary<string, ImmutableArray<CodeRefactoringProvider>> _refactorings;
        private readonly ImmutableDictionary<string, ImmutableHashSet<int>> _syntaxKinds;

        public CodeRefactoringRunner(Workspace workspace, Options options)
        {
            _workspace = workspace;
            _options = options;

            var refactorings = GetCodeRefactoringProviders(options.AnalyzerPath);
            _refactorings = FilterRefactorings(refactorings, options);

            _syntaxKinds = GetSyntaxKinds(options.RefactoringNodes);
        }

        public bool HasRefactorings => _refactorings.Any(pair => pair.Value.Any());

        public async Task RunAsync(CancellationToken cancellationToken)
        {
            if (!HasRefactorings)
            {
                return;
            }

            var solution = _workspace.CurrentSolution;
            var updatedSolution = solution;

            foreach (var project in solution.Projects)
            {
                foreach (var document in project.Documents)
                {
                    var newDocument = await RefactorDocumentAsync(document, cancellationToken).ConfigureAwait(false);
                    if (newDocument is null)
                    {
                        continue;
                    }

                    updatedSolution = updatedSolution.WithDocumentSyntaxRoot(document.Id, await newDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false));
                }
            }

            if (_options.ApplyChanges)
            {
                _workspace.TryApplyChanges(updatedSolution);
            }
        }

        private async Task<Document> RefactorDocumentAsync(Document document, CancellationToken cancellationToken)
        {
            var syntaxKinds = _syntaxKinds[document.Project.Language];
            var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
            foreach (var node in root.DescendantNodesAndTokens(descendIntoTrivia: true))
            {
                if (!syntaxKinds.Contains(node.RawKind))
                {
                    continue;
                }

                foreach (var refactoringProvider in _refactorings[document.Project.Language])
                {
                    var codeActions = new List<CodeAction>();
                    var context = new CodeRefactoringContext(document, new TextSpan(node.SpanStart, 0), codeActions.Add, cancellationToken);
                    await refactoringProvider.ComputeRefactoringsAsync(context).ConfigureAwait(false);

                    foreach (var codeAction in codeActions)
                    {
                        var operations = await codeAction.GetOperationsAsync(cancellationToken).ConfigureAwait(false);
                        foreach (var operation in operations)
                        {
                            if (!(operation is ApplyChangesOperation applyChangesOperation))
                            {
                                continue;
                            }

                            var changes = applyChangesOperation.ChangedSolution.GetChanges(document.Project.Solution);
                            var projectChanges = changes.GetProjectChanges().ToArray();
                            if (projectChanges.Length != 1 || projectChanges[0].ProjectId != document.Project.Id)
                            {
                                continue;
                            }

                            var documentChanges = projectChanges[0].GetChangedDocuments().ToArray();
                            if (documentChanges.Length != 1 || documentChanges[0] != document.Id)
                            {
                                continue;
                            }

                            return projectChanges[0].NewProject.GetDocument(document.Id);
                        }
                    }
                }
            }

            return null;
        }

        private static ImmutableDictionary<string, ImmutableHashSet<int>> GetSyntaxKinds(ImmutableHashSet<string> refactoringNodes)
        {
            var knownLanguages = new[]
            {
                (LanguageNames.CSharp, typeof(Microsoft.CodeAnalysis.CSharp.SyntaxKind)),
                (LanguageNames.VisualBasic, typeof(Microsoft.CodeAnalysis.VisualBasic.SyntaxKind)),
            };

            var builder = ImmutableDictionary.CreateBuilder<string, ImmutableHashSet<int>>();
            foreach (var (language, enumType) in knownLanguages)
            {
                var kindBuilder = ImmutableHashSet.CreateBuilder<int>();
                foreach (var name in refactoringNodes)
                {
                    if (!Enum.IsDefined(enumType, name))
                    {
                        continue;
                    }

                    kindBuilder.Add(Convert.ToInt32(Enum.Parse(enumType, name)));
                }

                builder.Add(language, kindBuilder.ToImmutable());
            }

            return builder.ToImmutable();
        }

        private static ImmutableDictionary<string, ImmutableArray<CodeRefactoringProvider>> FilterRefactorings(ImmutableDictionary<string, ImmutableArray<Lazy<CodeRefactoringProvider, CodeRefactoringProviderMetadata>>> refactorings, Options options)
        {
            return refactorings.ToImmutableDictionary(
                pair => pair.Key,
                pair => FilterRefactorings(pair.Value, options).ToImmutableArray());
        }

        private static IEnumerable<CodeRefactoringProvider> FilterRefactorings(IEnumerable<Lazy<CodeRefactoringProvider, CodeRefactoringProviderMetadata>> refactorings, Options options)
        {
            if (options.IncrementalAnalyzerNames.Any())
            {
                // AnalyzerRunner is running for IIncrementalAnalyzer testing. DiagnosticAnalyzer testing is disabled
                // unless /all or /a was used.
                if (!options.UseAll && options.AnalyzerNames.IsEmpty)
                {
                    yield break;
                }
            }

            if (options.RefactoringNodes.IsEmpty)
            {
                // AnalyzerRunner isn't configured to run refactorings on any nodes.
                yield break;
            }

            var refactoringTypes = new HashSet<Type>();

            foreach (var refactoring in refactorings.Select(refactoring => refactoring.Value))
            {
                if (!refactoringTypes.Add(refactoring.GetType()))
                {
                    // Avoid running the same analyzer multiple times
                    continue;
                }

                if (options.AnalyzerNames.Count == 0)
                {
                    yield return refactoring;
                }
                else if (options.AnalyzerNames.Contains(refactoring.GetType().Name))
                {
                    yield return refactoring;
                }
            }
        }

        private static ImmutableDictionary<string, ImmutableArray<Lazy<CodeRefactoringProvider, CodeRefactoringProviderMetadata>>> GetCodeRefactoringProviders(string path)
        {
            var assemblies = new List<Assembly>(MefHostServices.DefaultAssemblies);
            if (File.Exists(path))
            {
                assemblies.Add(Assembly.LoadFrom(path));
            }
            else if (Directory.Exists(path))
            {
                foreach (var file in Directory.GetFiles(path, "*.dll", SearchOption.AllDirectories))
                {
                    try
                    {
                        assemblies.Add(Assembly.LoadFrom(file));
                    }
                    catch
                    {
                        WriteLine($"Skipped assembly '{Path.GetFileNameWithoutExtension(file)}' during code refactoring discovery.", ConsoleColor.Yellow);
                    }
                }
            }

            var discovery = new AttributedPartDiscovery(Resolver.DefaultInstance, isNonPublicSupported: true);
            var parts = Task.Run(() => discovery.CreatePartsAsync(assemblies)).GetAwaiter().GetResult();
            var catalog = ComposableCatalog.Create(Resolver.DefaultInstance).AddParts(parts);

            var configuration = CompositionConfiguration.Create(catalog);
            var runtimeConfiguration = RuntimeComposition.CreateRuntimeComposition(configuration);
            var exportProviderFactory = runtimeConfiguration.CreateExportProviderFactory();

            var exportProvider = exportProviderFactory.CreateExportProvider();
            var refactorings = exportProvider.GetExports<CodeRefactoringProvider, CodeRefactoringProviderMetadata>();
            var languages = refactorings.SelectMany(refactoring => refactoring.Metadata.Languages).Distinct();
            return languages.ToImmutableDictionary(
                language => language,
                language => refactorings.Where(refactoring => refactoring.Metadata.Languages.Contains(language)).ToImmutableArray());
        }

        private class CodeRefactoringProviderMetadata
        {
            public IEnumerable<string> Languages { get; }

            public CodeRefactoringProviderMetadata(IDictionary<string, object> data)
            {
                data.TryGetValue(nameof(Languages), out var languages);

                Languages = languages switch
                {
                    IEnumerable<string> values => values,
                    string value => new[] { value },
                    _ => Array.Empty<string>(),
                };
            }
        }
    }
}


text:
<?php

namespace Gtt\ADPoller\Sync\Events\Event;

/**
 * Incremental sync event
 *
 * @author fduch <alex.medwedew@gmail.com>
 */
class IncrementalSyncEvent extends AbstractSyncEvent
{
    /**
     * List of changed AD entries
     *
     * @var array
     */
    private $changed;

    /**
     * List of deleted AD entries
     *
     * @var array
     */
    private $deleted;

    /**
     * IncrementalSyncEvent constructor.
     *
     * @param string $pollerName
     * @param int    $syncId
     * @param array  $changed
     * @param array  $deleted
     */
    public function __construct($pollerName, $syncId, array $changed, array $deleted)
    {
        parent::__construct($pollerName, $syncId);
        $this->changed = $changed;
        $this->deleted = $deleted;
    }

    /**
     * @return array
     */
    public function getChanged()
    {
        return $this->changed;
    }

    /**
     * @return array
     */
    public function getDeleted()
    {
        return $this->deleted;
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Threading;

namespace WixSharp
{
    /// <summary>
    /// Container with the parameters of the digital signature
    /// </summary>
    public class DigitalSignature
    {
        private SecureString _password;

        /// <summary>Specify the signing certificate in a file. If this file is a PFX with a password, the password may be supplied
        /// with the <see cref="Password"/> property.
        /// </summary>
        public string PfxFilePath
        {
            get => CertificateId;
            set => CertificateId = value;
        }

        /// <summary>
        /// The identifier used to locate the certificate
        /// </summary>
        public string CertificateId { get; set; }

        /// <summary>
        /// Selects the hash algorithm to apply. Default sha1
        /// </summary>
        public HashAlgorithmType HashAlgorithm { get; set; } = HashAlgorithmType.sha1;

        /// <summary>The timestamp server's URL. If this option is not present (pass to null), the signed file will not be timestamped.
        /// A warning is generated if timestamping fails.
        /// </summary>
        public Uri TimeUrl
        {
            get => TimeUrls.FirstOrDefault();

            set
            {
                TimeUrls.Clear();
                if (value != null)
                    TimeUrls.Add(value);
            }
        }

        /// <summary>
        /// Gets or sets the time server URLs.
        /// <para>This list of urls is useful if you want to try multiple time servers in case some of them is failing.
        /// </para>
        /// <para>
        /// You can customize the way the servers are accessed by signing tool. Use <see cref="DigitalSignature.MaxTimeUrlRetry"/>
        /// and <see cref="DigitalSignature.UrlRetrySleep"/> for that.</para>
        /// </summary>
        /// <value>
        /// The time server urls.
        /// </value>
        public List<Uri> TimeUrls { get; set; } = new List<Uri>();

        /// <summary>
        /// Gets or sets the maximum count of retrying an individual time server from <see cref="DigitalSignature.TimeUrls"/>.
        /// </summary>
        /// <value>
        /// The maximum time URL retry.
        /// </value>
        public int MaxTimeUrlRetry { get; set; } = 3;

        /// <summary>
        /// Gets or sets the delay (in milliseconds) between retries when accessing an individual time server from <see cref="DigitalSignature.TimeUrls"/>.
        /// </summary>
        /// <value>
        /// The URL retry sleep.
        /// </value>
        public int UrlRetrySleep { get; set; } = 500;

        /// <summary>
        /// The password to use when opening the PFX file. Should be <c>null</c> if no password required.
        /// </summary>
        public string Password
        {
            get { return _password?.ToInsecureString(); }
            set { _password = value?.ToSecureString(); }
        }

        /// <summary>
        /// Description of the signed content.
        /// Is passed to the /d parameter of the <c>SignTool.exe</c>
        /// UAC uses this Description when asks the user about user rights elevation.
        /// UAC uses temporary file name instead if no Description provided.
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// Extra arguments to pass to the <c>SignTool.exe</c> utility.
        /// </summary>
        public string OptionalArguments { get; set; }

        /// <summary>
        /// The optional ';' separated list of directories where SignTool.exe can be located.
        /// If this parameter is not specified WixSharp will try to locate the SignTool in the built-in well-known locations (system PATH)
        /// </summary>
        public string WellKnownLocations { get; set; }

        /// <summary>
        /// A flag indicating if the value of <see cref="WixSharp.DigitalSignature.PfxFilePath"/> is a name of the subject of the signing certificate
        /// from the certificate store (as opposite to the certificate file). This value can be a substring of the entire subject name.
        /// </summary>
        public bool UseCertificateStore
        {
            get => CertificateStore == StoreType.commonName || CertificateStore == StoreType.sha1Hash;
            set => CertificateStore = value ? StoreType.commonName : StoreType.file;
        }

        /// <summary>
        /// Where to read the certificate from.
        /// </summary>
        public StoreType CertificateStore { get; set; } = StoreType.file;

        /// <summary>
        /// A flag indicating the output level of the <c>SignTool.exe</c> utility.
        /// </summary>
        public SignOutputLevel OutputLevel { get; set; }

        /// <summary>
        /// Applies digital signature to a file
        /// </summary>
        /// <param name="fileToSign">The file to sign.</param>
        /// <returns>Exit code of the <c>SignTool.exe</c> process.</returns>
        public virtual int Apply(string fileToSign)
        {
            int retValue = -1;

            int apply(string url) =>
                CommonTasks.Tasks.DigitalySign(fileToSign, CertificateId, TimeUrl?.AbsoluteUri, Password,
                                               PrepareOptionalArguments(), WellKnownLocations, CertificateStore, OutputLevel, HashAlgorithm);

            Console.WriteLine("Signing with DigitasSignature");

            if (TimeUrls.Any())
                foreach (Uri uri in TimeUrls)
                {
                    for (int i = 0; i < MaxTimeUrlRetry && retValue != 0; i++)
                    {
                        retValue = apply(uri?.AbsoluteUri);
                        Console.WriteLine("Retrying applying DigitalSignature");
                        Thread.Sleep(UrlRetrySleep);
                    }

                    if (retValue == 0)
                        break;
                }
            else
                retValue = apply(null);

            return retValue;
        }

        /// <summary>
        /// Preparing optional arguments by adding custom arguments with current signer specific
        /// </summary>
        /// <returns>Final version of the optional arguments</returns>
        protected virtual string PrepareOptionalArguments()
        {
            if (Description.IsNullOrEmpty())
                return OptionalArguments;

            return $"{OptionalArguments} /d \"{Description}\"";
        }
    }
}


text:
package cz.muni.fi.pa165.languageschool.dto;

import cz.muni.fi.pa165.languageschool.utils.DayOfWeek;
import cz.muni.fi.pa165.languageschool.utils.DayOfWeek;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author Marketa Trachtova (255498) marketa.tr(at)gmail.com
 */
public class LectureTO {

    private Long id;
    private String label;
    private String topicDescription;
    private CourseTO course;
    private LecturerTO lecturer;
    private Set<StudentTO> enrolledStudents = new HashSet<StudentTO>();
    private Date tpTime;
    private DayOfWeek tpDay;

    public LectureTO() {

    }

    /**
     * Constructor for the Lecture
     * @param id id of the lecture
     * @param label label of the lecture
     * @param topicDescription description of the lecture
     * @param course course to which this lecture belongs
     * @param lecturer lecturer of the course
     * @param tpTime time of the lecture
     * @param tpDay  day of the lecture
     */
    public LectureTO(Long id, String label, String topicDescription, CourseTO course, Date tpTime, DayOfWeek tpDay) {
        this.id = id;
        this.label = label;
        this.topicDescription = topicDescription;
        this.course = course;
        this.tpTime = tpTime;
        this.tpDay = tpDay;
    }

    /**
     * Method which returns id of the lecture
     * @return id of the lecture
     */
    public Long getId() {
        return id;
    }

    /**
     * Method is used for setting Id of the lecture
     * @param id id of the lecture. Id cannot be null
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * Method which returns label of the lecture
     * @return label of the lecture
     */
    public String getLabel() {
        return label;
    }

    /**
     * Method is used for setting label of the lecture
     * @param label label of the lecture. Lecture cannot be null
     */
    public void setLabel(String label) {
        this.label = label;
    }

    /**
     * Method which returns topic of the lecture
     * @return topicDescription
     */
    public String getTopicDescription() {
        return topicDescription;
    }

    /**
     * Method is used for setting topic description of the lecture
     * @param topicDescription
     */
    public void setTopicDescription(String topicDescription) {
        this.topicDescription = topicDescription;
    }

    /**
     * Method which returns course to which lecture belongs
     * @return course
     */
    public CourseTO getCourse() {
        return course;
    }

    /**
     * Method is used for setting course to which lecture belongs
     * @param course
     */
    public void setCourse(CourseTO course) {
        this.course = course;
    }

    public LecturerTO getLecturer() {
        return lecturer;
    }

    public void setLecturer(LecturerTO lecturer) {
        this.lecturer = lecturer;
    }

    public Set<StudentTO> getEnrolledStudents() {
        return enrolledStudents;
    }

    public void setEnrolledStudents(Set<StudentTO> enrolledStudents) {
        this.enrolledStudents = enrolledStudents;
    }

    public Date getTpTime() {
        return tpTime;
    }

    public void setTpTime(Date tpTime) {
        this.tpTime = tpTime;
    }

    public DayOfWeek getTpDay() {
        return tpDay;
    }

    public void setTpDay(DayOfWeek tpDay) {
        this.tpDay = tpDay;
    }

    @Override
    public int hashCode() {
	int hash = 7;
	hash = 97 * hash + (this.id != null ? this.id.hashCode() : 0);
	return hash;
    }

    @Override
    public boolean equals(Object obj) {
	if (obj == null) {
	    return false;
	}
	if (getClass() != obj.getClass()) {
	    return false;
	}
	final LectureTO other = (LectureTO) obj;
	if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
	    return false;
	}
	return true;
    }
}


text:
import os
import subprocess
import tempfile
import json
import logging
import skybase.exceptions

def prepare_knife_env(knife_env_path):
    # add skybase PLANET_PATH env var to copy of current shell environment
    knife_env = os.environ.copy()
    knife_env['PLANET_PATH'] = knife_env_path
    return knife_env

def cookbook_upload(knife_env_path, knife_config_path, cookbooks_path, cookbook, logger):
    # prepare and execute knife command for each cookbook in list
    result = []

    # prepare knife cookbook upload command as list
    knife_cmd = ['knife', 'cookbook', 'upload',
                 '--config', knife_config_path,
                 '--cookbook-path', cookbooks_path,
                 cookbook]

    # execute knife command as subprocess trapping standard output and error
    logger.write('Running knife cookbook upload --config ' + knife_config_path + ' --cookbook-path ' + cookbooks_path +
                 ' ' + cookbook)
    proc = subprocess.Popen(knife_cmd, env=prepare_knife_env(knife_env_path),
                            stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    stdout_value, stderr_value = proc.communicate()

    result.append({
        cookbook: {
            'stdout': stdout_value,
            'stderr': stderr_value,
        }
    })

    return result

def environment_create(knife_env_path, knife_config_path, chef_env_attr):
    result = {"valid": True, "result_string": ""}
    # create temporary file to be based to knife cmd
    try:
        with tempfile.NamedTemporaryFile(suffix='.json', dir=os.getcwd()) as env_attr_file:
            # create name and description for environment
            chef_env_attr['name'] = chef_env_attr['definition']['planet']
            chef_env_attr['description'] = 'The ' + chef_env_attr['name'] + ' planet'
            # write attributes to temp file as JSON
            env_attr_file.write(json.dumps(chef_env_attr))
            env_attr_file.seek(0)

            # prepare knife cookbook upload command as list
            knife_cmd = ['knife', 'environment', 'from', 'file',
                         '--config', knife_config_path,
                         env_attr_file.name]

            # execute knife command as subprocess trapping standard output and error
            result["result_string"] += 'Running knife environment from file --config ' + knife_config_path + ' ' + \
                                       env_attr_file.name + '\n'
            proc = subprocess.Popen(knife_cmd, env=prepare_knife_env(knife_env_path),
                                    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
            stdout_value, stderr_value = proc.communicate()
            rc = proc.returncode
            if rc is not 0:
                result["valid"] = False
            result["result_string"] += "stdout: " + stdout_value + "\nstderr: " + stderr_value

    except Exception as e:
        result["result_string"] += "Exception: " + str(e)
        result["valid"] = False

    return result

def _run_knife_command(knife_cmd, knife_env=None, logger=None):
    result = []

    env = os.environ.copy()
    if knife_env is not None:
        env.update(knife_env)

    if logger:
        logger.debug('Running "%s"' % ' '.join(knife_cmd))

    # execute knife command as subprocess trapping standard output and error
    proc = subprocess.Popen(
        knife_cmd,
        env=env,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE
    )
    stdout_value, stderr_value = proc.communicate()

    stdout_value.strip()
    stderr_value.strip()
    returncode = proc.returncode

    if logger:
        logger.debug('stdout (%s): %s' % (returncode, stdout_value))
        logger.debug('stderr (%s): %s' % (returncode, stderr_value))

    if returncode is not 0:
        raise skybase.exceptions.SkyBaseResponseError("knife returned a non-zero exit code (%s): %s" % (returncode, stderr_value))

    result.append(
        {'output': stdout_value}
    )

    return result

def get_node(planet, node, logger=None):
    # prepare and execute knife command
    knife_cmd = [
        'knife',
        'node',
        'show',
        '--config',
        os.path.join(planet.planet_data_dir, 'knife.rb'),
        '--format',
        'json',
        node
    ]

    knife_env = os.environ.copy()
    knife_env.update(planet.get_chef_knife_attributes())

    return _run_knife_command(knife_cmd, knife_env, logger)

def delete_node(planet, node, logger=None):
    # prepare and execute knife command
    knife_cmd = [
        'knife',
        'node',
        'delete',
        '--config',
        os.path.join(planet.planet_data_dir, 'knife.rb'),
        '--yes',
        node
    ]

    knife_env = os.environ.copy()
    knife_env.update(planet.get_chef_knife_attributes())

    return _run_knife_command(knife_cmd, knife_env, logger)

def get_role(planet, role, logger=None):
    # prepare and execute knife command
    knife_cmd = [
        'knife',
        'role',
        'show',
        '--config',
        os.path.join(planet.planet_data_dir, 'knife.rb'),
        '--format',
        'json',
        role
    ]

    knife_env = os.environ.copy()
    knife_env.update(planet.get_chef_knife_attributes())

    return _run_knife_command(knife_cmd, knife_env, logger)

def delete_role(planet, role, logger=None):
    # prepare and execute knife command
    knife_cmd = [
        'knife',
        'role',
        'delete',
        '--config',
        os.path.join(planet.planet_data_dir, 'knife.rb'),
        '--yes',
        role
    ]

    knife_env = os.environ.copy()
    knife_env.update(planet.get_chef_knife_attributes())

    return _run_knife_command(knife_cmd, knife_env, logger)

def delete_client(planet, client, logger=None):
    # prepare and execute knife command
    knife_cmd = [
        'knife',
        'client',
        'delete',
        '--config',
        os.path.join(planet.planet_data_dir, 'knife.rb'),
        '--yes',
        client
    ]

    knife_env = os.environ.copy()
    knife_env.update(planet.get_chef_knife_attributes())

    return _run_knife_command(knife_cmd, knife_env, logger)


text:
<resources>

    <style name="AppTheme.BlackStatusBar" parent="AppTheme.NoActionBar">
        <item name="android:windowDrawsSystemBarBackgrounds">false</item>
    </style>

    <style name="AppTheme.TransparentStatusBar" parent="AppTheme.NoActionBar">
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:statusBarColor">@android:color/transparent</item>
    </style>

</resources>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//JP">

<TITLE>Macros</TITLE>
<META NAME="description" CONTENT="Macros">
<META NAME="keywords" CONTENT="manual">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="manual.css">

<LINK REL="next" HREF="manual-node23.html">
<LINK REL="previous" HREF="manual-node21.html">
<LINK REL="up" HREF="manual-node17.html">
<LINK REL="next" HREF="manual-node23.html">

 Next: Functions
 Up: Forms and Evaluation
 Previous: Special Forms
     Contents
     Index

Macros

Macro is a convenient method to expand language constructs.
When a macro is called, arguments are passed to the macro body,
which is a macro expansion function, without being evaluated.
Then, the macro expansion function expands the arguments,
and returns the new form.
The resulted form is then evaluated again outside the macro.
It is an error to apply a macro or special form to a list of arguments.
Macroexpand function can be used for the explicit macro expansion.

Though macro runs slowly when interpreted,
it speeds up compiled code execution,
because macro expansion is taken at compile-time only once
and no overhead is left to run-time.
Note that explicit call to eval or apply in the macro function may
produce different results between interpreted execution
and the compiled execution.

<ADDRESS>

2015-07-31
</ADDRESS>


text:
<?php
/**
 * Documentation Configuration
 *
 * Please override any of these options in your own projects _config.php file.
 * For more information and documentation see docsviewer/docs/en
 */

if(!defined('DOCSVIEWER_PATH')) {
	define('DOCSVIEWER_PATH', dirname(__FILE__));
}

if(!defined('DOCSVIEWER_DIR')) {
	$dir = explode(DIRECTORY_SEPARATOR, DOCSVIEWER_PATH);

	define('DOCSVIEWER_DIR', array_pop($dir));
}

// define filetypes to ignore
DocumentationService::set_ignored_files(array(
	'.', '..', '.DS_Store',
	'.svn', '.git', 'assets', 'themes', '_images', '_resources'
));


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
using Azure.IoT.Hub.Service.Models;

namespace Azure.IoT.Hub.Service
{
    /// <summary>
    /// Helper functions for mutating the <see cref="ExportImportDevice"/> instance.
    /// </summary>
    internal static class ExportImportDeviceExtensions
    {
        /// <summary>
        /// Initializes the <see cref="ExportImportDevice.Tags"/> property using provided values.
        /// </summary>
        public static ExportImportDevice WithTags(this ExportImportDevice device, IDictionary<string, object> tags)
        {
            foreach (var tag in tags)
            {
                device.Tags.Add(tag);
            }
            return device;
        }

        /// <summary>
        /// Initializes the <see cref="ExportImportDevice.Properties"/> property using provided values.
        /// </summary>
        public static ExportImportDevice WithPropertiesFrom(this ExportImportDevice device, TwinProperties properties)
        {
            var container = new PropertyContainer();
            if (properties != null)
            {
                foreach (var property in properties.Desired)
                {
                    container.Desired.Add(property);
                }
                foreach (var property in properties.Reported)
                {
                    container.Reported.Add(property);
                }
            }

            device.Properties = container;

            return device;
        }
    }
}


text:
const normalizeIndex = (index, count, defaultIndex) => {
  if (index === undefined) {
    return defaultIndex;
  }
  if (index < 0) {
    if (count === Infinity) {
      return count;
    }
    return Math.max(0, count + index) | 0;
  }
  if (count === undefined || count === index) {
    return index;
  }
  return Math.min(count, index) | 0;
};

export default normalizeIndex;


text:
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>

<link href="doc-style.css" type="text/css" rel="StyleSheet">

		Local Properties

Managed Object Types	Data Object Types	All Properties	All Methods

Fault - VspanDestPortConflict

Thrown by

ReconfigureDvs_Task

Extends

DvsFault

Since

vSphere API 5.0

Fault
                  Description

         Thrown if a dvPort is used as destination in multiple Distributed Port Mirroring sessions.

Properties

	          Name

	          Type

	          Description

portKey	xsd:string

         The key of the the port that is used as destination in multiple Distributed Port Mirroring sessions

vspanSessionKey1	xsd:string

         The key of the Distributed Port Mirroring session whose destination ports include a port
  that is also used as destination ports of other Distributed Port Mirroring sessions

vspanSessionKey2	xsd:string

         The key of the Distributed Port Mirroring session whose destination ports include a port
  that is also used as destination ports of other Distributed Port Mirroring sessions

						Properties inherited from DvsFault

None

						Properties inherited from VimFault

None

						Properties inherited from MethodFault

dynamicProperty, dynamicType, faultCause, faultMessage

Show WSDL type definition

<textarea cols="20" rows="10" name="wsdl-textarea" wrap="off" readonly="1" id="wsdl-textarea">         <complexType xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="VspanDestPortConflict">
            <complexContent>
               <extension base="vim25:DvsFault">
                  <sequence>
                     <element name="vspanSessionKey1" type="xsd:string"/>
                     <element name="vspanSessionKey2" type="xsd:string"/>
                     <element name="portKey" type="xsd:string"/>
                  </sequence>
               </extension>
            </complexContent>
         </complexType></textarea>

Top of page		Local Properties

Managed Object Types	Data Object Types	All Properties	All Methods


text:
<!doctype html>

		<title>Zabuun - Learn Egyptian Arabic for English speakers</title>
		<meta name="description" content="">
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/head.php';?>

		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/ie8.php';?>
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/header.php';?>

			<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/side.php';?>

Essays > Ripped Bag

						Expand All | Collapse All

Ripped Bag

  Tracy had to take a vocabulary quiz. She needed her pen. She looked inside her bag, but the pen wasn't in there. It was always there. She just used it yesterday. She decided to let it go. She also needed a piece of paper. She looked inside her bag. There was no paper. Did she leave everything at home? Was she becoming forgetful? Was someone stealing from her. She borrowed paper from a friend. She also needed an eraser. She looked inside her bag. No eraser! She screamed, "Oh my god!" Her classmates stared at her. She apologized. Her classmate then pointed at the bottom of her bag. There was a huge hole.

		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/footer.php';?>
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/scripts.php';?>


text:
<head>
  <meta charset="utf-8">
  <!-- (1) Optimize for mobile versions: http://goo.gl/EOpFl -->
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <!-- (1) force latest IE rendering engine: bit.ly/1c8EiC9 -->
  <meta http-equiv="X-UA-Compatible" content="IE=edge">

  <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
  <meta name="description" content="{{ site.description }}" />

  <meta name="HandheldFriendly" content="True" />
  <meta name="MobileOptimized" content="320" />
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

  <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">

  <link rel="shortcut icon" href="{{ "/assets/images/favicon.ico" | prepend: site.baseurl }}">
<!--  <link rel="stylesheet" href="{{asset "js/styles/obsidian.css"}}"> -->
  <link rel="stylesheet" href="http://brick.a.ssl.fastly.net/Linux+Libertine:400,400i,700,700i/Open+Sans:400,400i,700,700i">
  <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

  <link rel="stylesheet" type="text/css" media="screen" href="{{ "/css/main.css"  | prepend: site.baseurl  }}" />
  <link rel="stylesheet" type="text/css" media="print" href="{{ "/css/print.css"  | prepend: site.baseurl  }}" />
  <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>

  <script type="text/javascript" src="{{ "/assets/js/jquery.fitvids.js" | prepend: site.baseurl  }}"></script>
  <script type="text/javascript" src="{{ "/assets/js/index.js" | prepend: site.baseurl  }}"></script>
  <script type="text/javascript" src="{{ "/assets/js/readingTime.min.js" | prepend: site.baseurl  }}"></script>

  <!-- Google Analytics -->
  <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-26222580-1', 'auto');
    ga('send', 'pageview');

  </script>
</head>


text:
import sys
import os.path
import netaddr
from pyroute2 import IPRoute

from lib.inventory import Inventory
from lib.logger import Logger

FILE_PATH = os.path.dirname(os.path.abspath(__file__))

class EnableDeployerIfc(object):
    BRIDGE = 'bridge'
    LOCAL = 'lo'

    def __init__(self, log, inv_file):
        inv = Inventory(log, inv_file)
        self.log = log
        self.ext_label_dev = inv.get_mgmt_switch_external_dev_label()

        if inv.is_passive_mgmt_switches():
            if self.ext_label_dev:
                self.log.info('Passive Management Switch(es) Detected')
                print(self.ext_label_dev)
                sys.exit(0)
            else:
                self.log.error('Management switch not found')
                sys.exit(1)

        for self.ipv4 in inv.yield_mgmt_switch_ip():
            pass
        mgmt_network = inv.get_ipaddr_mgmt_network()
        self.broadcast = str(netaddr.IPNetwork(mgmt_network).broadcast)
        self.mask = str(netaddr.IPNetwork(mgmt_network).netmask)

        if self.ext_label_dev:
            self.log.debug(
                'External dev label %s was specified' % self.ext_label_dev)
        else:
            self.log.debug('External dev label was not specified')
        self.ext_ip_dev = inv.get_mgmt_switch_external_dev_ip()
        self.ext_prefix = inv.get_mgmt_switch_external_prefix()
        for self.ext_ip_switch in inv.yield_mgmt_switch_external_switch_ip():
            pass

        self.ext_broadcast = str(netaddr.IPNetwork(
            self.ext_ip_dev + '/' + self.ext_prefix).broadcast)
        self.ext_mask = str(netaddr.IPNetwork(
            self.ext_ip_dev + '/' + self.ext_prefix).netmask)

        self.ipr = IPRoute()
        for link in self.ipr.get_links():
            kind = None
            try:
                self.label = (link.get_attr('IFLA_IFNAME'))
                kind = (link.get_attr('IFLA_LINKINFO').get_attr(
                    'IFLA_INFO_KIND'))
            except:
                pass
            if kind == self.BRIDGE:
                if self.ipr.get_addr(
                        label=self.label, broadcast=self.broadcast):
                    self.log.info(
                        'Bridge %s on management subnet %s found' %
                        (self.label, mgmt_network))
                    if self._ping(self.ipv4, self.label):
                        self.log.info(
                            'Management switch found on %s' %
                            self.label)
                        sys.exit(0)
                    else:
                        self.log.debug(
                            'Management switch not found on %s' %
                            self.label)

        if self.ext_label_dev:
            self.dev = self.ipr.link_lookup(ifname=self.ext_label_dev)[0]
            self._add_ip()

            # Print to stdout for Ansible playbook to register
            print(self.ext_label_dev)
        else:
            switch_found = False
            for link in self.ipr.get_links():
                kind = None
                try:
                    self.label = (link.get_attr('IFLA_IFNAME'))
                    kind = (link.get_attr('IFLA_LINKINFO').get_attr(
                        'IFLA_INFO_KIND'))
                except:
                    pass
                if self.label != self.LOCAL and not kind:
                    self.dev = self.ipr.link_lookup(ifname=self.label)[0]
                    self._add_ip()

                    if self._ping(self.ext_ip_switch, self.label):
                        switch_found = True
                        self.log.info(
                            'Management switch found on %s' %
                            self.label)
                        self._configure_switch()
                    else:
                        self.log.debug(
                            'Management switch not found on %s' % self.label)

                    self._del_ip()

                    if switch_found:
                        break

            if not switch_found:
                self.log.error('Management switch not found')
                sys.exit(1)

            # Print to stdout for Ansible playbook to register
            print(self.label)

    def _add_ip(self):
        if self.ext_label_dev:
            label = self.ext_label_dev
        else:
            label = self.label
        if self.ipr.get_addr(label=label, address=self.ext_ip_dev):
            self._is_add_ext_ip = False
            self.log.debug(
                '%s was already configured on %s' %
                (self.ext_ip_dev, label))
        else:
            self._is_add_ext_ip = True
            self.log.debug(
                'Add %s to interface %s' % (self.ext_ip_dev, label))
            self.ipr.addr(
                'add',
                index=self.dev,
                address=self.ext_ip_dev,
                mask=int(self.ext_prefix),
                broadcast=self.ext_broadcast)

    def _ping(self, ipaddr, dev):
        if os.system('ping -c 1 -I %s %s > /dev/null' % (dev, ipaddr)):
            self.log.info(
                'Ping via %s to management switch at %s failed' %
                (dev, ipaddr))
            return False
        self.log.info(
            'Ping via %s to management switch at %s passed' %
            (dev, ipaddr))
        return True

if __name__ == '__main__':
    """
    Arg1: inventory file
    Arg2: log level
    """
    LOG = Logger(__file__)

    if len(sys.argv) != 3:
        try:
            raise Exception()
        except Exception:
            LOG.error('Invalid argument count')
            sys.exit(1)

    INV_FILE = sys.argv[1]
    LOG.set_level(sys.argv[2])

    EnableDeployerIfc(LOG, INV_FILE)


text:
#ifndef __STDLIB_H
#define __STDLIB_H

/* reference: http://www.acm.uiuc.edu/webmonkeys/book/c_guide/2.13.html */

#include <stddef.h>

#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0

/* string functions */
extern double atof(const char *str);
extern int atoi(const char *nptr);
extern long int atol(const char *str);
extern double strtod(const char *start, char **endptr);
extern long int strtol(const char *start, char **endptr, int radix);
extern unsigned long int strtoul(const char *start, char **endptr, int radix);

/* memory functions */
extern void free(void *ptr);
extern void *malloc(size_t size);
extern void *realloc(void *ptr, size_t size);

/* environment functions */
extern void abort(void);
extern int atexit(void (*func)(void));
extern void exit(int exit_code);
extern char *getenv(const char *name);
extern int system(const char *string);

/* math functions */
extern int abs(int value);
extern int rand(void);
extern void srand(unsigned int seed);

#endif


text:
class MyExep < Exception
  def initialize(msg, err)
  end
end

def raiser!
  raise MyExep.new('blabla', 400)
end

raiser!


text:
package main

import (
	_ "fmt"
	"github.com/ysugimoto/gang"
	"github.com/ysugimoto/go-cliargs"
)

func main() {
	args := cliarg.NewArguments()
	args.Alias("h", "help", false)
	args.Alias("d", "directory", nil)
	args.Alias("v", "version", false)
	args.Parse()

	runner := gang.NewRunner(args)
	runner.Run()
}


text:
/**
 * Created by David Yahalomi on 5/23/15.
 */

Tinytest.add('attachSchema - registering schema for first time', function (test) {
  Books.attachSchema(Schemas.booksV1);
  Stores.attachSchema(Schemas.storesV1);

  test.equal(Books._migrations.find().count(), 2);
});

Tinytest.add('attachSchema - add fields to the schema', function (test) {
  Books.insert({name: 'Crime and Punishment', author: 'Fyodor Dostoyevsky'});

  Books.attachSchema(Schemas.booksV2); //merge with current schema

  test.equal(Books.find().count(), 1);
  test.equal(Books._migrations.findOne({_id: Books._name}).version, 2, 'new version of books schema registerd');

  teardown(test);
});

Tinytest.add('attachSchema - call with null', function (test) {
  Books.attachSchema(null);

  test.equal(Books._migrations.find().count(), 0);
  teardown(test);
});

Tinytest.add('attachSchema - change field type', function (test) {
  Books.attachSchema(Schemas.booksV1);
  Books.attachSchema(Schemas.booksV2); // merge into V1 - isbn is optional

  Books.insert({name: 'Crime and Punishment', author: 'Fyodor Dostoyevsky'});

  Books.attachSchema(Schemas.booksV4, {replace: true});

  test.equal(Books.findOne().sold, "0", "crimeNPunishment has string typed zero");
  test.equal(Books.find().count(), 1);
  test.equal(Books._migrations.findOne({_id: Books._name}).version, 3);

  teardown(test);
});

Tinytest.add('attachSchema - remove fields from the schema', function (test) {
  Books.attachSchema(Schemas.booksV1);

  Books.insert({name: 'Crime and Punishment', author: 'Fyodor Dostoyevsky'});
  Books.insert({name: 'The Rosie Project', author: 'Graeme C. Simsion', isbn: 'ISBN 0 71817 813 0'});

  var crimeNPunishment = Books.findOne({name: 'Crime and Punishment'});
  test.equal(crimeNPunishment.author, 'Fyodor Dostoyevsky');

  var rosieProject = Books.findOne({name: 'The Rosie Project'});
  test.equal(rosieProject.isbn, 'ISBN 0 71817 813 0');

  Books.attachSchema(Schemas.booksV3, {replace: true});

  test.equal(Books.find().count(), 2);

  crimeNPunishment = Books.findOne({name: 'Crime and Punishment'});
  test.equal(crimeNPunishment.author, 'Fyodor Dostoyevsky');
  test.isUndefined(crimeNPunishment.isbn);

  rosieProject = Books.findOne({name: 'The Rosie Project'});
  test.isUndefined(rosieProject.isbn);

  test.equal(Books._migrations.findOne({_id: Books._name}).version, 2, 'new version of books schema registerd');

  teardown(test);
});

Tinytest.add('attachSchema - no change', function (test) {
  Stores.attachSchema(Schemas.storesV1, {replace: true});

  test.equal(Stores._migrations.findOne({_id: Stores._name}).version, 1);

  Stores.attachSchema(Schemas.storesV1, {replace: true});

  test.equal(Stores._migrations.findOne({_id: Stores._name}).version, 1);

  teardown(test);
});

Tinytest.add('attachSchema - no field that is required and no default value or auto value', function (test) {
  Books.attachSchema(Schemas.booksV1, {replace: true});
  Stores.attachSchema(Schemas.storesV1, {replace: true});

  Books.insert({name: 'The Rosie Project', author: 'Graeme C. Simsion'});

  // failure to migrate
  Books.attachSchema(Schemas.booksV2, {replace: true});

  // manual fix
  Books.update({name: 'The Rosie Project'}, {$set: {isbn: 'ISBN-13 978 0 71817 813 0'}}, {validate: false});

  // try again
  Books.attachSchema(Schemas.booksV2, {replace: true});

  test.equal(Books.find().count(), 1);
  test.equal(Books.findOne({name: 'The Rosie Project'}).isbn, 'ISBN-13 978 0 71817 813 0');
  test.equal(Books.findOne({name: 'The Rosie Project'}).sold, 0);
  test.equal(Books._migrations.findOne({_id: Books._name}).version, 2);

  teardown(test);
});

Tinytest.add('attachSchema - auto value updating existing documents', function (test) {
  Stores.attachSchema(Schemas.storesV2, {replace: true});

  Stores.insert({name: 'The Little Book Store', address: 'Neverland'});

  Stores.attachSchema(Schemas.storesV3, {replace: true});

  test.equal(Stores.find().count(), 1);
  test.equal(Stores.findOne({name: 'The Little Book Store'}).name_sorting, 'The Little Book Store'.toLowerCase());
  test.equal(Stores._migrations.findOne({_id: Stores._name}).version, 2);

  teardown(test);
});

Tinytest.add('attachSchema - optional auto value should not update existing documents', function (test) {
  Stores.attachSchema(Schemas.storesV3, {replace: true});

  Stores.insert({name: 'The Little Book Store', address: 'Neverland'});

  Stores.attachSchema(Schemas.storesV4, {replace: true});

  test.equal(Stores.find().count(), 1);
  test.isUndefined(Stores.findOne({name: 'The Little Book Store'}).update_count,
    'There should not have been any changes to the existing document');
  test.equal(Stores._migrations.findOne({_id: Stores._name}).version, 2);

  teardown(test);
});


text:
A banking simulation emulating a distributed, multi-threaded network. Created in C#.

This program implements the architecture necessary for a distributed banking platform. It allows for multiple instances of a "Teller" interface, and multiple instances of an "ATM" interface. Each ATM/Teller instance occupies a seperate thread, with software locks preventing any potential race conditions.

Class structure embodies MVC architecture, with a database model that supports quick look-ups and large data sets.

Use:
The teller can create and delete customer accounts. ATM's can easily request account information or perfrom withdrawls.

![Banking Screenshot](http://i.imgur.com/xbq8FVt.png "Banking Screenshot")


text:
package angular.ng_binding;

import angular.TestNgBinding;
import angular.TestNgRepeater;
import org.openqa.selenium.WebDriver;
import other.SupportedDriver;

/**
 * ng-binding in Safari!
 */
public class TestNgBinding_Safari extends TestNgBinding
{
    @Override
    public WebDriver getDriver()
    {
        return SupportedDriver.Safari.getDriver();
    }
}


text:
<?php

namespace Frontend\Modules\Slideshow\Widgets;

use Frontend\Core\Engine\Base\Widget as FrontendBaseWidget;
use Frontend\Core\Engine\Model as FrontendModel;
use Frontend\Modules\Slideshow\Engine\Model as FrontendSlideshowModel;

/**
 * This is a widget with a specific slideshow
 *
 * @author Koen Vinken <koen@tagz.be>
 */
class Slideshow extends FrontendBaseWidget
{
    /**
     * Execute the extra
     *
     * @return void
     */
    public function execute()
    {
        // call the parent
        parent::execute();

        // load template
        $this->loadTemplate();

        // load the data
        $this->getData();

        // parse
        $this->parse();
    }

    /**
     * Load the data, don't forget to validate the incoming data
     *
     * @return void
     */
    private function getData()
    {
        // get gallery data
        $this->gallery = FrontendSlideshowModel::getGallery($this->data['id']);

        // get image data
        $this->slides = FrontendSlideshowModel::getImages($this->data['id']);
    }

    /**
     * Parse
     *
     * @return void
     */
    private function parse()
    {
        // add CSS
        $this->header->addCSS(
            '/src/Frontend/Modules/' .
            $this->getModule() .
            '/Layout/Css/slideshow.css'
        );

        // add JS
        $this->addJS('Settings.js');

        // assign
        $this->tpl->assign('widgetSlideshow', $this->slides);
        $this->tpl->assign('widgetGallery', $this->gallery);

        if (!empty($this->gallery)) {
            // should we use the settings per slide or the module settings
            if (FrontendModel::getModuleSetting('Slideshow', 'settings_per_slide')) {
                $settings = FrontendSlideshowModel::getAllSettings($this->gallery['id']);
                $settings['id'] = $this->gallery['id'];
            } else {
                $settings = FrontendModel::getModuleSettings('Slideshow');
                $settings['id'] = $this->gallery['id'];
            }
            // pass settings to JS
            $this->addJSData(
                'slideshowSettings',
                $settings
            );
        }
    }
}


text:
from telemetry import decorators
from telemetry.core import platform as platform_module
from telemetry.testing import browser_test_case
from telemetry.testing import tab_test_case
from telemetry.timeline import model as model_module
from telemetry.timeline import tracing_config

class TracingControllerTest(tab_test_case.TabTestCase):

  def testModifiedConsoleTime(self):
    tracing_controller = self._tab.browser.platform.tracing_controller
    config = tracing_config.TracingConfig()
    config.enable_chrome_trace = True
    tracing_controller.StartTracing(config)
    self.Navigate('blank.html')
    self.assertEquals(
        self._tab.EvaluateJavaScript('document.location.pathname;'),
        '/blank.html')

    self._tab.EvaluateJavaScript("""
        window.__console_time = console.time;
        console.time = function() { };
        """)
    with self.assertRaisesRegexp(Exception, 'Page stomped on console.time'):
      tracing_controller.StopTracing()

    # Restore console.time
    self._tab.EvaluateJavaScript("""
        console.time = window.__console_time;
        delete window.__console_time;
        """)

    # Check that subsequent tests will be able to use tracing normally.
    self.assertFalse(tracing_controller.is_tracing_running)
    tracing_controller.StartTracing(config)
    self.assertTrue(tracing_controller.is_tracing_running)
    tracing_controller.StopTracing()
    self.assertFalse(tracing_controller.is_tracing_running)

  def testExceptionRaisedInStopTracing(self):
    tracing_controller = self._tab.browser.platform.tracing_controller
    config = tracing_config.TracingConfig()
    config.enable_chrome_trace = True
    tracing_controller.StartTracing(config)

    self.Navigate('blank.html')
    self._tab.EvaluateJavaScript("""
        window.__console_time = console.time;
        console.time = function() { };
        """)
    with self.assertRaisesRegexp(Exception, 'Page stomped on console.time'):
      tracing_controller.StopTracing()

    # Tracing is stopped even if there is exception.
    self.assertFalse(tracing_controller.is_tracing_running)

  def testGotTrace(self):
    tracing_controller = self._browser.platform.tracing_controller
    config = tracing_config.TracingConfig()
    config.enable_chrome_trace = True
    tracing_controller.StartTracing(config)

    trace_data = tracing_controller.StopTracing()
    # Test that trace data is parsable
    model = model_module.TimelineModel(trace_data)
    assert len(model.processes) > 0

  def testStartAndStopTraceMultipleTimes(self):
    tracing_controller = self._browser.platform.tracing_controller
    config = tracing_config.TracingConfig()
    config.enable_chrome_trace = True
    tracing_controller.StartTracing(config)
    self.assertFalse(tracing_controller.StartTracing(config))

    trace_data = tracing_controller.StopTracing()
    # Test that trace data is parsable
    model_module.TimelineModel(trace_data)
    self.assertFalse(tracing_controller.is_tracing_running)
    # Calling stop again will raise exception
    self.assertRaises(Exception, tracing_controller.StopTracing)

  def _StartupTracing(self, platform):
    # Stop browser
    browser_test_case.teardown_browser()

    # Start tracing
    self.assertFalse(platform.tracing_controller.is_tracing_running)
    config = tracing_config.TracingConfig()
    config.enable_chrome_trace = True
    platform.tracing_controller.StartTracing(config)
    self.assertTrue(platform.tracing_controller.is_tracing_running)

    try:
      # Start browser
      self.setUpClass()
      self._browser.tabs[0].Navigate('about:blank')
      self._browser.tabs[0].WaitForDocumentReadyStateToBeInteractiveOrBetter()
      self.assertEquals(platform, self._browser.platform)
      # Calling start tracing again will return False
      self.assertFalse(
          self._browser.platform.tracing_controller.StartTracing(config))

      trace_data = self._browser.platform.tracing_controller.StopTracing()
      # Test that trace data is parsable
      model_module.TimelineModel(trace_data)
      self.assertFalse(
          self._browser.platform.tracing_controller.is_tracing_running)
      # Calling stop tracing again will raise exception
      self.assertRaises(Exception,
                        self._browser.platform.tracing_controller.StopTracing)
    finally:
      if self._browser:
        self._browser.Close()
        self._browser = None

  @decorators.Enabled('android')
  def testStartupTracingOnAndroid(self):
    self._StartupTracing(self._browser.platform)

  # Not enabled on win because of crbug.com/570955
  @decorators.Enabled('linux', 'mac')
  @decorators.Isolated
  def testStartupTracingOnDesktop(self):
    self._StartupTracing(platform_module.GetHostPlatform())


text:
$(function () {
    // Custom selects
    $("select").dropkick();
});

$(document).ready(function() {
    // Todo list
    $(".todo li").click(function() {
        $(this).toggleClass("todo-done");

    });

    // Init tooltips
    $("[data-toggle=tooltip]").tooltip("show");

    // Init tags input
    $(".tagsinput").tagsInput();

    // Init jQuery UI slider
    $("#slider").slider({
        min: 1,
        max: 5,
        value: 2,
        orientation: "horizontal",
        range: "min"
    });

    // JS input/textarea placeholder
    $("input, textarea").placeholder();

    // Make pagination demo work
    $(".pagination a").click(function() {
        if (!$(this).parent().hasClass("previous") && !$(this).parent().hasClass("next")) {
            $(this).parent().siblings("li").removeClass("active");
            $(this).parent().addClass("active");
        }
    });

    $(".btn-group a").click(function() {
        $(this).siblings().removeClass("active");
        $(this).addClass("active");
    });

    // Disable link click not scroll top
    $("a[href='#']").click(function() {
        return false
    });

});