text:
package acirenderer

import (
	"container/list"

	"github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/spec/schema/types"
)

// CreateDepListFromImageID returns the flat dependency tree of the image with
// the provided imageID
func CreateDepListFromImageID(imageID types.Hash, ap ACIRegistry) (Images, error) {
	key, err := ap.ResolveKey(imageID.String())
	if err != nil {
		return nil, err
	}
	return createDepList(key, ap)
}

// CreateDepListFromNameLabels returns the flat dependency tree of the image
// with the provided app name and optional labels.
func CreateDepListFromNameLabels(name types.ACIdentifier, labels types.Labels, ap ACIRegistry) (Images, error) {
	key, err := ap.GetACI(name, labels)
	if err != nil {
		return nil, err
	}
	return createDepList(key, ap)
}

// createDepList returns the flat dependency tree as a list of Image type
func createDepList(key string, ap ACIRegistry) (Images, error) {
	imgsl := list.New()
	im, err := ap.GetImageManifest(key)
	if err != nil {
		return nil, err
	}

	img := Image{Im: im, Key: key, Level: 0}
	imgsl.PushFront(img)

	// Create a flat dependency tree. Use a LinkedList to be able to
	// insert elements in the list while working on it.
	for el := imgsl.Front(); el != nil; el = el.Next() {
		img := el.Value.(Image)
		dependencies := img.Im.Dependencies
		for _, d := range dependencies {
			var depimg Image
			var depKey string
			if d.ImageID != nil && !d.ImageID.Empty() {
				depKey, err = ap.ResolveKey(d.ImageID.String())
				if err != nil {
					return nil, err
				}
			} else {
				var err error
				depKey, err = ap.GetACI(d.ImageName, d.Labels)
				if err != nil {
					return nil, err
				}
			}
			im, err := ap.GetImageManifest(depKey)
			if err != nil {
				return nil, err
			}
			depimg = Image{Im: im, Key: depKey, Level: img.Level + 1}
			imgsl.InsertAfter(depimg, el)
		}
	}

	imgs := Images{}
	for el := imgsl.Front(); el != nil; el = el.Next() {
		imgs = append(imgs, el.Value.(Image))
	}
	return imgs, nil
}


text:
Interactive illustration of power in a 2-sample t-test.

See it in action: <http://www.biostat.wisc.edu/~kbroman/D3/ttest_power>

(It's still got some issues in the calculation of the density for the
non-central t for large values of the non-centrality parameter.)

redpajama_set_name: RedPajamaGithub


text:
using System.Collections.Generic;

namespace IdentityServer4.Models
{
    /// <summary>
    /// Provides the context necessary to construct a logout notificaiton.
    /// </summary>
    public class LogoutNotificationContext
    {
        /// <summary>
        ///  The SubjectId of the user.
        /// </summary>
        public string SubjectId { get; set; }

        /// <summary>
        /// The session Id of the user's authentication session.
        /// </summary>
        public string SessionId { get; set; }

        /// <summary>
        /// The list of client Ids that the user has authenticated to.
        /// </summary>
        public IEnumerable<string> ClientIds { get; set; }
    }
}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="shortcut icon" href="/static/img/favicon.ico" />
        <title>Simple bash scripting for login before open the terminal - Stack Problems</title>
        <meta name="author" content="Angelos" />
        <meta name="description" content="Simple bash scripting for login before open the terminal" />
        <meta name="keywords" content="Simple bash scripting for login before open the terminal, Stack Problems, bash" />
        <link rel="alternate" type="application/rss+xml" title="RSS" href="/feed.xml">

        <meta content="1749788565247320" property="fb:app_id">
        <meta content="Stack Problems" property="og:site_name">

          <meta content="Simple bash scripting for login before open the terminal" property="og:title">

          <meta content="article" property="og:type">

          <meta content="My Personal Stack Problems" property="og:description">

          <meta content="https://agusmakmun.github.io/bash/2016/04/19/simple-bash-scripting-for-login-before-open-the-terminal.html" property="og:url">

          <meta content="2016-04-19T20:19:21+08:00" property="article:published_time">
          <meta content="https://agusmakmun.github.io/about/" property="article:author">

          <meta content="https://agusmakmun.github.io/static/img/logo-high-resolution.png" property="og:image">

          <meta content="bash" property="article:section">

        <meta name="twitter:card" content="summary">
        <meta name="twitter:site" content="@agusmakmun6">
        <meta name="twitter:creator" content="@agusmakmun6">

          <meta name="twitter:title" content="Simple bash scripting for login before open the terminal">

          <meta name="twitter:url" content="https://agusmakmun.github.io/bash/2016/04/19/simple-bash-scripting-for-login-before-open-the-terminal.html">

          <meta name="twitter:description" content="My Personal Stack Problems">

        <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">

        <link rel="stylesheet" href="/static/css/syntax.css">

        <link href="/static/css/bootstrap.min.css" rel="stylesheet">

        <link href="//fonts.googleapis.com/css?family=Roboto+Condensed:400,300italic,300,400italic,700&subset=latin,latin-ext" rel="stylesheet" type="text/css">

        <link rel="stylesheet" href="/static/css/super-search.css">
        <link rel="stylesheet" href="/static/css/thickbox.css">
        <link rel="stylesheet" href="/static/css/projects.css">
        <link rel="stylesheet" href="/static/css/main.css">

Angelos

                    I am freelance developer. Currently doing more in backend, actually in Python and Django.

                  <input type="text" placeholder="(sitemap)~$ type to search" class="search__input form-control" id="js-search__input">

                Navigation

                     » Home

                     » About Me

                     » Projects

                     » Github

                     » XML Feed

Simple bash scripting for login before open the terminal

19 Apr 2016

    » bash

Add this in your file of /etc/bash.bashrc, makesure you logged in as root.

### ===============================================
### Simple bash scripting for login before open the terminal.
### Credit: <Summon Agus> - agus@python.web.id
### Location, end script of: /etc/bash.bashrc
### ===============================================

while true; do
  # Don't exit at Ctrl-C
  trap "echo" SIGINT

  printf "\n"
  echo -n " Who are you guys? "; read -s name;
  if [ "$name" == "agus" ]; then
    reset
    printf "\n Welcome my KING! you are the best!!\n"
    printf " "; date;
    printf " Please start your activity with Basmalah\n\n"
    break
  else
    printf "\n Heey you! why you here!! You are not owner of this machine!\n"
  fi
done

### ===============================================
### END
### ===============================================

    Share this on →

     Tweet

Related Posts

                    Download recrusive files inside index-of in Linux using wget

                        (Categories: bash)

                    Remove all files .pyc with recrusive method

                        (Categories: python, bash)

    « Remove all files .pyc with recrusive method

    Python Permutations »

                    © Angelos

                    - https://github.com/agusmakmun - Powered by Jekyll.


text:
/**
 *
 * Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
 *
 * For example:
 * Given the below binary tree and sum = 22,
 *               5
 *              / \
 *             4   8
 *            /   / \
 *           11  13  4
 *          /  \    / \
 *         7    2  5   1
 * return
 * [
 *   [5,4,11,2],
 *   [5,8,4,5]
 * ]
 *
 *
 * Definition for binary tree
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode(int x) { val = x; }
 * }
 */

import java.util.ArrayList;

public class PathSumII {
    public ArrayList<ArrayList<Integer>> pathSum(TreeNode root, int sum) {
        // Note: The Solution object is instantiated only once and is reused by each test case.
        ArrayList<ArrayList<Integer>> allPath = aux(root);
        ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
        for (ArrayList<Integer> subList : allPath) {
            int listSum = 0;
            for (Integer i : subList) {
                listSum = listSum + i;
            }
            if (listSum == sum) result.add(subList);
        }
        return result;

    }

    public static ArrayList<ArrayList<Integer>> aux(TreeNode root) {

        ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
        if (root == null) return result;

        ArrayList<ArrayList<Integer>> left = aux(root.left);
        ArrayList<ArrayList<Integer>> right = aux(root.right);

        if (left.size() > 0 || right.size() > 0) {
            if (left.size() > 0) {
                for (ArrayList<Integer> subList : left) {
                    subList.add(0, root.val);
                    result.add(subList);
                }
            }
            if (right.size() > 0) {
                for (ArrayList<Integer> subList : right) {
                    subList.add(0, root.val);
                    result.add(subList);
                }
            }
        } else {
            ArrayList<Integer> rootVal = new ArrayList<Integer>();
            rootVal.add(root.val);
            result.add(rootVal);
        }

        return result;
    }
}


text:
var client = require('./rest-client');
var PATH_BASE = '/v4/workflowTasks/mine';

exports.getMyWorkflowTasks = function (params, callback) {
	var auth_type = 'AccessToken';
	client.get(PATH_BASE, params, auth_type, callback);
};


text:
package com.ansorgit.plugins.bash.lang.parser.shellCommand;

import com.ansorgit.plugins.bash.lang.parser.BashPsiBuilder;
import com.ansorgit.plugins.bash.lang.parser.MockPsiTest;
import com.ansorgit.plugins.bash.lang.parser.Parsing;
import org.junit.Ignore;
import org.junit.Test;

public abstract class ArithmeticParserTest extends MockPsiTest {
    private final MockFunction arithmeticTest = new MockFunction() {
        @Override
        public boolean apply(BashPsiBuilder psi) {
            return Parsing.shellCommand.arithmeticParser.parse(psi);
        }
    };

    @Test
    public void testParseSquareMode() {
        //[1]
        mockTest(arithmeticTest, EXPR_ARITH_SQUARE, NUMBER, _EXPR_ARITH_SQUARE);

        //[a + b]
        mockTest(arithmeticTest, EXPR_ARITH_SQUARE, WORD, ARITH_MINUS, WORD, _EXPR_ARITH_SQUARE);
    }

    @Test
    public void testParse() throws Exception {
        //((1))
        mockTest(arithmeticTest, EXPR_ARITH, NUMBER, _EXPR_ARITH);

        //((a))
        mockTest(arithmeticTest, EXPR_ARITH, WORD, _EXPR_ARITH);

        //(($a))
        mockTest(arithmeticTest, EXPR_ARITH, VARIABLE, _EXPR_ARITH);

        //((1 + 1))
        mockTest(arithmeticTest, EXPR_ARITH, NUMBER, ARITH_PLUS, NUMBER, _EXPR_ARITH);

        //((a + b))
        mockTest(arithmeticTest, EXPR_ARITH, WORD, ARITH_MINUS, WORD, _EXPR_ARITH);

        //((1 * 2 - 3))
        mockTest(arithmeticTest, EXPR_ARITH, NUMBER, ARITH_MULT, NUMBER, ARITH_MINUS, NUMBER, _EXPR_ARITH);

        //((10 % 3))
        mockTest(arithmeticTest, EXPR_ARITH, NUMBER, ARITH_MOD, NUMBER, _EXPR_ARITH);
    }

    @Test
    public void testNumbers() {
        //((-1))
        mockTest(arithmeticTest, EXPR_ARITH, ARITH_MINUS, NUMBER, _EXPR_ARITH);

        //((--1))
        mockTest(arithmeticTest, EXPR_ARITH, ARITH_MINUS, ARITH_MINUS, NUMBER, _EXPR_ARITH);

        //((---a))
        mockTest(arithmeticTest, EXPR_ARITH, ARITH_MINUS, ARITH_MINUS, NUMBER, _EXPR_ARITH);
    }

    @Test
    public void testParseList() throws Exception {
        //((1,2))
        mockTest(arithmeticTest, EXPR_ARITH, NUMBER, COMMA, NUMBER, _EXPR_ARITH);

        //(($a,b))
        mockTest(arithmeticTest, EXPR_ARITH, VARIABLE, COMMA, WORD, _EXPR_ARITH);

        //(($a,1*3,b))
        mockTest(arithmeticTest, EXPR_ARITH, VARIABLE, COMMA, NUMBER, ARITH_MULT, NUMBER, COMMA, WORD, _EXPR_ARITH);
    }

    @Test
    public void testParseAssignments() throws Exception {
        //((a=1))
        mockTest(arithmeticTest, EXPR_ARITH, WORD, EQ, NUMBER, _EXPR_ARITH);

        //((a=1)) with assignment word
        mockTest(arithmeticTest, EXPR_ARITH, ASSIGNMENT_WORD, EQ, NUMBER, _EXPR_ARITH);

        //((a += 1))
        mockTest(arithmeticTest, EXPR_ARITH, WORD, ARITH_ASS_PLUS, NUMBER, _EXPR_ARITH);

        //((a -= 1))
        mockTest(arithmeticTest, EXPR_ARITH, WORD, ARITH_ASS_MINUS, NUMBER, _EXPR_ARITH);

        //((a *= 1))
        mockTest(arithmeticTest, EXPR_ARITH, WORD, ARITH_ASS_MUL, NUMBER, _EXPR_ARITH);

        //((a %= 1))
        mockTest(arithmeticTest, EXPR_ARITH, WORD, ARITH_ASS_MOD, NUMBER, _EXPR_ARITH);
    }

    @Test
    public void testParseParentheses() throws Exception {
        //(((1)))
        mockTest(arithmeticTest, EXPR_ARITH, LEFT_PAREN, NUMBER, RIGHT_PAREN, _EXPR_ARITH);

        //(((1 * 2)))
        mockTest(arithmeticTest, EXPR_ARITH, LEFT_PAREN, NUMBER, ARITH_MULT, NUMBER, RIGHT_PAREN, _EXPR_ARITH);

        //((1 * (2 + 3)))
        mockTest(arithmeticTest, EXPR_ARITH, NUMBER, ARITH_MULT, LEFT_PAREN, NUMBER, ARITH_PLUS, NUMBER, RIGHT_PAREN, _EXPR_ARITH);

        //(( (2 + 3) / 2 ))
        mockTest(arithmeticTest, EXPR_ARITH, LEFT_PAREN, NUMBER, ARITH_PLUS, NUMBER, RIGHT_PAREN, ARITH_DIV, NUMBER, _EXPR_ARITH);

        //(( (2 + 3) / (1/2 + (3*4) / 5) ))
        mockTest(arithmeticTest, EXPR_ARITH, LEFT_PAREN, NUMBER, ARITH_PLUS, NUMBER, RIGHT_PAREN, ARITH_DIV,
                LEFT_PAREN,
                NUMBER, ARITH_DIV, NUMBER, ARITH_PLUS,
                LEFT_PAREN, NUMBER, ARITH_MULT, NUMBER, RIGHT_PAREN,
                ARITH_DIV, NUMBER,
                RIGHT_PAREN,
                _EXPR_ARITH);

        // Error: (( (3) * ))
        mockTestError(arithmeticTest, EXPR_ARITH, LEFT_PAREN, NUMBER, RIGHT_PAREN, ARITH_MULT, _EXPR_ARITH);
    }

    @Test
    public void testTristateOperator() {
        //((a ? b : c))
        mockTest(arithmeticTest, EXPR_ARITH, WORD, ARITH_QMARK, WORD, ARITH_COLON, WORD, _EXPR_ARITH);

        //((a ? (b ? c :d) : c))
        mockTest(arithmeticTest, EXPR_ARITH, WORD, ARITH_QMARK, LEFT_PAREN, WORD, ARITH_QMARK, WORD, ARITH_COLON, WORD, RIGHT_PAREN, ARITH_COLON, WORD, _EXPR_ARITH);

        //((a ? b ? c :d : c))
        //mockTest(arithmeticTest, EXPR_ARITH, WORD, ARITH_QMARK, WORD, ARITH_QMARK, WORD, ARITH_COLON, WORD, ARITH_COLON, WORD, _EXPR_ARITH);

        //((1+2 ? 3*4 : 5))
        mockTest(arithmeticTest, EXPR_ARITH, NUMBER, ARITH_PLUS, NUMBER, ARITH_QMARK, NUMBER, ARITH_MULT, NUMBER, ARITH_COLON, WORD, _EXPR_ARITH);

        //((1 == 1 ? 0 : 0))
        mockTest(arithmeticTest, EXPR_ARITH, NUMBER, ARITH_EQ, NUMBER, ARITH_QMARK, NUMBER, ARITH_COLON, NUMBER, _EXPR_ARITH);
    }

    @Test
    public void testParseAssignmentsErrors() throws Exception {
        //((1=1))
        mockTestError(arithmeticTest, EXPR_ARITH, NUMBER, EQ, NUMBER, _EXPR_ARITH);

        //((1 += 1))
        mockTestError(arithmeticTest, EXPR_ARITH, NUMBER, ARITH_ASS_PLUS, NUMBER, _EXPR_ARITH);

        //((1 -= 1))
        mockTestError(arithmeticTest, EXPR_ARITH, NUMBER, ARITH_ASS_MINUS, NUMBER, _EXPR_ARITH);

        //((1 *= 1))
        mockTestError(arithmeticTest, EXPR_ARITH, NUMBER, ARITH_ASS_MUL, NUMBER, _EXPR_ARITH);

        //((1 %= 1))
        mockTestError(arithmeticTest, EXPR_ARITH, NUMBER, ARITH_ASS_MOD, NUMBER, _EXPR_ARITH);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="me.stupidme.cooker.view.cooker.CookerActivity"
    tools:showIn="@layout/app_bar_main">

</FrameLayout>


text:
package com.devbrackets.android.exomedia.builder;

import android.annotation.TargetApi;
import android.content.Context;
import android.media.MediaCodec;
import android.net.Uri;
import android.os.Build;
import android.util.Log;

import com.devbrackets.android.exomedia.exoplayer.EMExoPlayer;
import com.devbrackets.android.exomedia.listener.RendererBuilderCallback;
import com.devbrackets.android.exomedia.renderer.EMMediaCodecAudioTrackRenderer;
import com.devbrackets.android.exomedia.util.MediaUtil;
import com.google.android.exoplayer.MediaCodecVideoTrackRenderer;
import com.google.android.exoplayer.TrackRenderer;
import com.google.android.exoplayer.extractor.Extractor;
import com.google.android.exoplayer.extractor.ExtractorSampleSource;
import com.google.android.exoplayer.extractor.mp3.Mp3Extractor;
import com.google.android.exoplayer.extractor.mp4.FragmentedMp4Extractor;
import com.google.android.exoplayer.extractor.mp4.Mp4Extractor;
import com.google.android.exoplayer.extractor.ts.AdtsExtractor;
import com.google.android.exoplayer.extractor.ts.TsExtractor;
import com.google.android.exoplayer.extractor.webm.WebmExtractor;
import com.google.android.exoplayer.upstream.Allocator;
import com.google.android.exoplayer.upstream.DataSource;
import com.google.android.exoplayer.upstream.DefaultAllocator;
import com.google.android.exoplayer.upstream.DefaultBandwidthMeter;
import com.google.android.exoplayer.upstream.DefaultUriDataSource;

/**
 * A default RenderBuilder that can process Http:// URIs and file:// URI's
 */
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public class RenderBuilder {
    private static final String TAG = RenderBuilder.class.getSimpleName();
    protected static final int DROPPED_FRAME_NOTIFICATION_AMOUNT = 50;

    protected static final long MAX_JOIN_TIME = 5000;
    private static final int BUFFER_SEGMENT_SIZE = 64 * 1024;
    private static final int BUFFER_SEGMENTS = 160;

    protected final Context context;
    protected final String userAgent;
    protected final String uri;
    protected MediaUtil.MediaType requestedDefaultType;

    public RenderBuilder(Context context, String userAgent, String uri) {
        this.uri = uri;
        this.userAgent = userAgent;
        this.context = context;
    }

    public RenderBuilder(Context context, String userAgent, String uri, MediaUtil.MediaType defaultType) {
        this(context, userAgent, uri);
        this.requestedDefaultType = defaultType;
    }

    public void buildRenderers(EMExoPlayer player, RendererBuilderCallback callback) {
        //Create the Sample Source to be used by the renderers
        Allocator allocator = new DefaultAllocator(BUFFER_SEGMENT_SIZE);
        DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter(player.getMainHandler(), player);
        DataSource dataSource = new DefaultUriDataSource(context, bandwidthMeter, userAgent);

        ExtractorSampleSource sampleSource = new ExtractorSampleSource(Uri.parse(MediaUtil.getUriWithProtocol(uri)), dataSource,
               allocator, BUFFER_SEGMENT_SIZE * BUFFER_SEGMENTS, getExtractor(uri, requestedDefaultType));

        //Create the Renderers
        MediaCodecVideoTrackRenderer videoRenderer = new MediaCodecVideoTrackRenderer(sampleSource, null, true, MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT,
                MAX_JOIN_TIME, null, player.getMainHandler(), player, DROPPED_FRAME_NOTIFICATION_AMOUNT);

        EMMediaCodecAudioTrackRenderer audioRenderer = new EMMediaCodecAudioTrackRenderer(sampleSource, null, true, player.getMainHandler(), player);

        //Create the Render list to send to the callback
        TrackRenderer[] renderers = new TrackRenderer[EMExoPlayer.RENDER_COUNT];
        renderers[EMExoPlayer.RENDER_VIDEO_INDEX] = videoRenderer;
        renderers[EMExoPlayer.RENDER_AUDIO_INDEX] = audioRenderer;
        callback.onRenderers(null, null, renderers, bandwidthMeter);
    }

    /**
     * Retrieves the extractor to use with the specified mediaUri
     *
     * @param mediaUri The uri to get the extractor for
     * @return The Extractor for the specified mediaUri
     */
    protected Extractor getExtractor(String mediaUri) {
        return getExtractor(mediaUri, MediaUtil.MediaType.UNKNOWN);
    }

    /**
     * Retrieves the extractor to use with the specified mediaUri
     *
     * @param mediaUri The uri to get the extractor for
     * @param defaultType The media type to use if we can't determine the type
     * @return The Extractor for the specified mediaUri
     */
    protected Extractor getExtractor(String mediaUri, MediaUtil.MediaType defaultType) {
        return getExtractor(MediaUtil.getMediaType(mediaUri), defaultType);
    }

    /**
     * Retrieves the extractor for the requested type.  If the extractor
     * is unavailable then the default extractor will be returned.
     *
     * @param mediaType The media type to get the extractor for
     * @return The extractor for the mediaType
     */
    protected Extractor getExtractor(MediaUtil.MediaType mediaType) {
        return getExtractor(mediaType, MediaUtil.MediaType.UNKNOWN);
    }

    /**
     * Retrieves the extractor for the requested type.  If the extractor
     * is unavailable then the extractor for defaultType will be returned.
     *
     * @param mediaType The media type to get the extractor for
     * @param defaultType The media type to use if the requested type is unavailable
     * @return The extractor for the mediaType
     */
    protected Extractor getExtractor(MediaUtil.MediaType mediaType, MediaUtil.MediaType defaultType) {
        boolean canUseRequestedType = defaultType != null && defaultType != MediaUtil.MediaType.UNKNOWN;

        // NOTE: this is based on the demo project for the ExoPlayer, found at
        // https://github.com/google/ExoPlayer/blob/888d9db3e92bf4605c7be5cf61da52db0c75bdee/demo/src/main/java/com/google/android/exoplayer/demo/PlayerActivity.java#L222
        switch (mediaType) {
            case AAC:
                return new AdtsExtractor();

            case FMP4:
                return new FragmentedMp4Extractor();

            case M4A:
            case MP4:
                return new Mp4Extractor();

            case MP3:
                return new Mp3Extractor();

            case TS:
                return new TsExtractor(0, null);

            case WEBM:
            case MKV:
                return new WebmExtractor();

            default:
            case UNKNOWN:
                Log.d(TAG, "Unable to determine extractor for the uri \"" + uri + "\", assuming " + (canUseRequestedType ? requestedDefaultType : "MP4"));
                return canUseRequestedType ? getExtractor(defaultType) : new Mp4Extractor();
        }
    }
}


text:
echo Compiling driver
@Set WLHBASE=C:\WinDDK\7600.16385.1\

echo Compiling for XP
SET AP_PLATFORM=XP
call ..\ddkbuild -WLHXP checked .

echo Compiling for Vista
SET AP_PLATFORM=Vista
call ..\ddkbuild -WLH checked .

exit /b %error_code%


text:
module BrowserStatus

  # Set this to true to bypass everything.  It will use the test profile below.
  TEST_SESSION_WORKING = true
  TEST_COOKIES_ENABLED = true
  TEST_JS              = true
  TEST_UA              = :firefox
  TEST_UA_VERSION      = 3.0

  # Short snippet of javascript that stores the browser's timezone offset
  # (in minutes from UTC) in a cookied called "tz".
  JAVASCRIPT_THAT_SETS_TIMEZONE =
    'try { document.cookie = "tz=" + (new Date()).getTimezoneOffset(); } ' +
    'catch(err) { }'

  # This is the minimal page that is served when a user first encounters the
  # site.  Subsequently, the session will store a cookie in the browser so that
  # they are recognized, and we won't ever have to do this again.  NOTE: no
  # attempt is made to make this XHTML compliant in the least.  As far as I
  # know it is impossible to do so.  (Way to go, W3C!)
  FIRST_PAGE = %(
    <html>
      <head>
        <script>
          #{JAVASCRIPT_THAT_SETS_TIMEZONE}
          window.location = '%s';
        </script>
      </head>
      <body>
        <noscript>
          <meta HTTP-EQUIV="REFRESH" content="0; url=%s">
        </noscript>
      </body>
    </html>
  )

  # Call this from the head or at the top of the body of your HTML template.
  # It inserts a command to reload the page if we think javascript is turned
  # off but find that it really is on.
  def check_if_user_turned_javascript_on

    # Set a special cookie so we can determine the browser's timezone offset.
    code = JAVASCRIPT_THAT_SETS_TIMEZONE

    # Reload page with special "_js=on" parameter to let us know that
    # Javascript is turned on in the user's browser.  There are a few
    # cases to be careful of: I ignore it on post of forms to avoid the
    # whole post data and file upload problem; and don't bother if the session
    # isn't working, since we won't be able to remember that JS is on, anyway.
    if !@js && !session[:js_override] && request.method == :get
      code += " window.location = '#{reload_with_args(:_js => 'on')}'"
    end

    javascript_tag(code)
  end

  # For backwards compatibility.
  alias report_browser_status check_if_user_turned_javascript_on

  # This is designed to be run as a before_filter at the top of
  # application_controller, before anthing else is run.  It sets several
  # "global" instance variables that are available to all controllers and
  # views.
  def browser_status

    # Create bogus browser for testing purposes.
    if RAILS_ENV == 'test'
      @session_working = TEST_SESSION_WORKING
      @cookies_enabled = TEST_COOKIES_ENABLED
      @js              = TEST_JS
      @ua              = TEST_UA
      @ua_version      = TEST_UA_VERSION
      return true
    end

    ua = request.env['HTTP_USER_AGENT']
    ip = request.env['HTTP_X_FORWARDED_FOR'] ||
         request.env['HTTP_CLIENT_IP'] ||
         request.env['HTTP_REMOTE_ADDR']
    browser_id = "#{ip}|#{ua}"

    # Look up the user's browser.  We keep some minimal info about all browsers
    # that do not have a working session yet.
    @@our_session_cache ||= {}
    our_session = @@our_session_cache[browser_id]

    if session[:_x]

      # Session is working, clear entry from "our session" cache.
      session_new = false
      @session_working = true
      if our_session
        @@our_session_cache.delete(browser_id)
        clean_our_session_cache
      end

    else
      session[:_x] = true
      if our_session

        # Session is not working, but we've seen this browser before.
        session_new = false
        @session_working = false
        our_session[:time] = Time.now

      else

        # Session in not working, and we've never seen this browser before.
        session_new = true
        @session_working = nil
        our_session = @@our_session_cache[browser_id] = { :time => Time.now }
        clean_our_session_cache
      end
    end

    # Is javascript enabled?
    if session[:js_override]
      @js = (session[:js_override] == :on)
    elsif params[:_js]
      @js = (params[:_js] == 'on')
    elsif session[:_js] != nil
      @js = (session[:_js] == true)
    elsif our_session && our_session[:js] != nil
      @js = (our_session[:js] == true)
    else
      @js = nil
    end
    session[:_js] = @js
    our_session[:js] = @js if our_session

    # Are cookies enabled?
    if cookies[:_x]
      @cookies_enabled = true
    else
      cookies[:_x] = '1'
      @cookies_enabled = session_new ? nil : false
    end

    # What is the user agent?
    @ua, @ua_version = parse_user_agent(ua)

    # print "========================================\n"
    # print "browser_id       = [#{browser_id      }]\n"
    # print "session_new      = [#{session_new     }]\n"
    # print "@session_working = [#{@session_working}]\n"
    # print "@cookies_enabled = [#{@cookies_enabled}]\n"
    # print "@js              = [#{@js             }]\n"
    # print "@ua              = [#{@ua             }]\n"
    # print "@ua_version      = [#{@ua_version     }]\n"
    # print "HTTP_USER_AGENT  = [#{ua              }]\n"
    # print "params           = [#{params.inspect  }]\n"
    # print "========================================\n"

    # Find time zone that matches the best.
    if offset = -cookies[:tz].to_i * 60 rescue nil
      for zone in ActiveSupport::TimeZone.all.sort_by(&:utc_offset)
        if zone.utc_offset >= offset
          Time.zone = zone
          break
        end
      end
    else
      Time.zone = Time.default_zone
    end

    # If we've never seen this user before, serve a tiny page that redirects
    # immediately to tell us the state of javascript, and lets us determine
    # whether session and cookies are woring correctly immediately.  (The
    # _new thing prevents infinite loops, just in case.)
    if session_new && params[:_new] != 'true'
      render(:text => FIRST_PAGE % [
        reload_with_args(:_js => 'on',  :_new => 'true'),
        reload_with_args(:_js => 'off', :_new => 'true'),
      ])
    else
      return true
    end
  end

  # Get user agent directly without relying on +browser_status+ filter.
  # Returns the type:
  #
  #   case user_agent
  #   when :ie
  #     ...
  #   when :robot
  #     ...
  #   end
  #
  def user_agent
    @ua, @ua_version = parse_user_agent(request.env['HTTP_USER_AGENT'])
    return @ua
  end

  # Return the number of entries in our_session_cache
  def browser_status_cache_size
    @@our_session_cache.size
  end

  # Return the number of entries in our_session_cache
  def clear_browser_status_cache
    @@our_session_cache = {}
  end

  # Have we seen this browser before?  Short-hand for <tt>@session_working == nil</tt>
  def session_new?
    @session_working == nil
  end

  # Is session working?  (i.e. are cookies enabled or whatever the +session+
  # object needs to work?)  Shorthand for <tt>@session_working</tt>.
  def session_working?
    @session_working
  end

  # Are cookies enabled on browser?  Doesn't determine if user is throwing
  # them away periodically, or whenever they close their browser.  Shorthand
  # for <tt>@cookies_enabled</tt>.
  def cookies_enabled?
    @cookies_enabled
  end

  # Is javascript enabled on browser?  Strictly speaking, it just checks if
  # the browser can do <tt>window.location = ...</tt>, but this is a good
  # proxy for checking if javascript is enabled at all.  You can also use
  # the instance variable <tt>@js</tt> for the same purpose.
  def javascript_enabled?
    @js
  end

  # Check to make sure browser can handle AJAX.  This doubles as a "will
  # prototype and scriptaculous work?" test, I believe.  The criteria clearly
  # need to be refined... Returns:
  #   true   Browser is known to support AJAX.
  #   false  Browser is known NOT to support AJAX.
  #   nil    Browser is unknown or it is not known whether it supports AJAX.
  def can_do_ajax?
    return true  if session[:js_override] == :on
    return false if !@js
    case @ua
      when :ie;        @ua_version >= 5.5
      when :firefox;   @ua_version >= 1.0
      when :iceweasel; @ua_version >= 1.0
      when :safari;    @ua_version >= 1.2
      when :opera;     @ua_version >= 0.0
      when :chrome;    @ua_version >= 0.0
      when :netscape;  @ua_version >= 7.0
      else             nil
    end
  end

  # Check if the request came from a robot.
  def is_robot?
    @ua == :robot
  end

  # Check if browser's rendering engine is Gecko or Gecko-like (e.g. Safari).
  def is_like_gecko?
    [:firefox, :iceweasel, :netscape, :safari, :chrome, :gecko].include? @ua
  end

  # Check if browser's rendering engine is IE-compatible (i.e. IE or Opera).
  def is_ie_compatible?
    [:ie, :opera].include? @ua
  end

  # Is browser text-only?  I'm throwing robots in here as well, since they
  # strip out formatting of all kinds.  You still need to serve important
  # images, though, as users will still want to be able to download them (and
  # robots need to be able to see them).  But it is helpful to simplify
  # formatting.
  def is_text_only?
    @ua == :text || @ua == :robot
  end

  # Take URL that got us to this page and add one or more parameters to it.
  # Returns new URL.
  #
  #   link_to("Next Page", reload_with_args(:page => 2))
  def reload_with_args(new_args)
    add_args_to_url(request.request_uri, new_args)
  end

  # Take an arbitrary URL and change the parameters.  Returns new URL.  Should
  # even handle the fancy "/object/id" case.  (Note: use +nil+ to mean delete
  # -- i.e. <tt>add_args_to_url(url, :old_arg => nil)</tt> deletes the
  # parameter named +old_arg+ from +url+.)
  #
  #   url = url_for(:action => "blah", ...)
  #   new_url = add_args_to_url(url, :arg1 => :val1, :arg2 => :val2, ...)
  def add_args_to_url(url, new_args)
    args = {}

    # Parse parameters off of current URL.
    addr, parms = url.split('?')
    for arg in parms ? parms.split('&') : []
      var, val = arg.split('=')
      if var && var != ''
        var = CGI.unescape(var)
        # See note below about precedence in case of redundancy.
        args[var] = val if !args.has_key?(var)
      end
    end

    # Deal with the special "/object/45" => "/object/show?id=45" case.
    if match = addr.match(/\/(\d+)$/)
      # The "pseudo" arg takes precedence over "real" arg... that is, in the
      # url "/page/4?id=5", empirically Rails chooses the 4.  In fact, it seems
      # always to choose the left-most where there is redundancy.
      args['id'] = match[1]
      addr.sub!(/\/\d+$/, '')
      addr += '/show' if addr.match(/\/\/[^\/]+\/[^\/]+$/)
    end

    # Merge in new arguments, deleting where new values are nil.
    for var in new_args.keys
      val = new_args[var]
      var = var.to_s
      if val.nil?
        args.delete(var)
      elsif val.is_a?(ActiveRecord::Base)
        args[var] = val.id.to_s
      else
        args[var] = CGI.escape(val.to_s)
      end
    end

    # Put it back together.
    return addr if args.keys == []
    return addr + '?' + args.keys.sort.map \
        {|k| CGI.escape(k) + '=' + (args[k] || "")}.join('&')
  end

  # Parse the user_agent string from apache.  This does not catch everything.
  # But it should catch 99% of the browsers that hit your site.  See
  # http://www.zytrax.com/tech/web/browser_ids.htm
  #
  # Returns browser name and version:
  #   name, version = parse_user_agent(request.env['HTTP_USER_AGENT'])
  def parse_user_agent(ua)
    return [:other,    0.0    ] if ua.nil? || ua == '-'
    return [:text,     0.0    ] if ua.match(/^(Lynx|Links|ELinks|Dillo)/)
    return [:robot,    0.0    ] if ua.match(/http:|\w+@[\w\-]+\.\w+|robot|crawler|spider|slurp|googlebot|surveybot|webgobbler|morfeus|nutch|linkaider|linklint|linkwalker|metalogger|page-store|network diagnostics/i)
    return [:opera,    $1.to_f] if ua.match(/Opera[ \/](\d+\.\d+)/)
    return [:ie,       $1.to_f] if ua.match(/ MSIE (\d+\.\d+)/)
    return [:chrome,   $1.to_f] if ua.match(/Chrome\/(\d+\.\d+)/)
    return [:safari,   $1.to_f] if ua.match(/Version\/(\d+(\.\d+)?).*Safari/)
    return [:safari,   2.0    ] if ua.match(/Safari/)
    return [:firefox,  $1.to_f] if ua.match(/Firefox\/(\d+\.\d+)/)
    return [:iceweasel,$1.to_f] if ua.match(/Iceweasel\/(\d+\.\d+)/)
    return [:netscape, $1.to_f] if ua.match(/Netscape\/(\d+\.\d+)/)
    return [:gecko,    $1.to_f] if ua.match(/Gecko\/(\d{8})/)
    return [:mozilla,  $1.to_f] if ua.match(/Mozilla\/(\d+\.\d+)/)
    return [:other,    0.0    ]
  end

  private

  # Clean out old entries from "our_session" cache.
  def clean_our_session_cache
    cutoff = 1.hour.ago
    @@our_session_cache ||= {}
    @@our_session_cache.each_pair do |key, val|
      if val[:time] < cutoff
        @@our_session_cache.delete(key)
      end
    end
  end
end


text:
package br.com.battista.arcadia.caller.service;

import java.util.List;
import java.util.Locale;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import br.com.battista.arcadia.caller.model.Card;
import br.com.battista.arcadia.caller.repository.CardRepository;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Service
public class CardService {

    @Autowired
    private CardRepository cardRepository;

    public List<Card> getAllCards(Locale locale) {
        log.info("Find all cards!");
        return cardRepository.findAll(locale);
    }

    public Card getCardByName(String name) {
        log.info("Find the user by name: {}!", name);
        return cardRepository.findByName(name);
    }

    public Card saveCard(Card card) {
        log.info("Create new card!");
        return cardRepository.saveOrUpdateCard(card);
    }

}


text:
package thirdpartysw

import (
	// "archive/tar"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"github.com/golang/glog"
	"github.com/jmuldoon/flac2mp3util/util"
	"io"
	"net/http"
	"os"
	"path/filepath"
	"time"
)

const (
	thirdpartyswdir  string        = "./thirdpartysw"
	sourceconfigname string        = "sources.json"
	dependencyswpath string        = "./deps"
	clienttimeout    time.Duration = 300
)

type ThirdPartyer interface {
	InitializeClient()
	ReadURLs() (err error)
	Download() (err error)
}

type ThirdPartyType struct {
	Client       *http.Client
	Dependencies []*Url
}

type Url struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

// InitializeClient sets up the client to be used for the http requests since the default
// one is garbage due to not having a timeout.
func (tp *ThirdPartyType) InitializeClient() {
	tp.Client = &http.Client{Timeout: time.Second * clienttimeout}
}

// verifyContentIsCompressed returns nil if the content header specifies gzip
// compression, else returns an error
// TODO: Ensure that the server if it doesn't send a gzip encoding header value
// since it may not send it or it is munged by some formatting of antivirus
// garbage. Handle it gracefully. atm this won't be called so I can proceed.
func verifyContentIsCompressed(resp *http.Response) (err error) {
	fmt.Printf("%+v\n", resp.Header.Get("Content-Encoding"))
	switch resp.Header.Get("Content-Encoding") {
	case "gzip":
		return nil
	default:
		return fmt.Errorf(
			"verifyContentIsCompressed: failed due to incorrect header response")
	}
}

// ungzip decompresses the specified source to the target destination directory.
// if it doesn't exist, it will be created.
func ungzip(source *gzip.Reader, target string) error {
	target = filepath.Join(target, source.Name)
	writer, err := os.Create(target)
	if err != nil {
		return err
	}
	defer writer.Close()

	_, err = io.Copy(writer, source)
	return err
}

// Download retrieves the tarballs from the url list given as a parameter.
func (tp *ThirdPartyType) Download() (err error) {
	if err := util.MakeDirectory(dependencyswpath); err != nil {
		return err
	}
	for _, el := range tp.Dependencies {
		// setup request string and headers
		req, err := http.NewRequest("GET", el.URL, nil)
		if err != nil {
			return err
		}
		req.Header.Add("Accept-Encoding", "gzip")
		glog.V(2).Infof("%+v\n", req)

		// submit the request through the client
		resp, err := tp.Client.Do(req)
		if err != nil {
			return err
		}
		defer resp.Body.Close()

		// TODO: re-add this back in see comment on function
		// // validate that response is gzip compression type
		// if err := verifyContentIsCompressed(resp); err != nil {
		// 	return err
		// }

		// assign the io.ReadCloser
		gzipReader, err := gzip.NewReader(resp.Body)
		if err != nil {
			return err
		}
		defer gzipReader.Close()

		// todo: likely needs to be untar instead, which may be a bit more work.
		if err := ungzip(gzipReader,
			filepath.Join(dependencyswpath, el.Name)); err != nil {
			return err
		}
	}
	return nil
}

// decode takes the ThirdPartyType as a receiver to decode the io.Reader json
// structure and store it in the ThirdPartyType's Dependencies field.
func (tp *ThirdPartyType) decode(file io.Reader) (err error) {
	if err = json.NewDecoder(file).Decode(&tp.Dependencies); err != nil {
		return err
	}
	return nil
}

// read takes the ThirdPartyType as a receiver to readin the json information
// from the file specified by the path
func (tp *ThirdPartyType) read(path string) (err error) {
	file, err := os.OpenFile(path, os.O_RDONLY, 0777)
	if err != nil {
		return err
	}
	if err := tp.decode(file); err != nil {
		return err
	}

	return nil
}

// ReadURLs reads in the URLs from the sources.json file and stores them in the
// receiver ThirdPartyType's field Dependencies.
func (tp *ThirdPartyType) ReadURLs() (err error) {
	absPath, err := util.AbsolutePathHelper(thirdpartyswdir, sourceconfigname)
	glog.V(2).Infoln(absPath)
	if err != nil {
		return err
	}
	if err := tp.read(absPath); err != nil {
		return err
	}
	for i, el := range tp.Dependencies {
		glog.V(2).Infof("%d: %s\n", i, el.URL)
	}
	return nil
}


text:
class HomeController < ApplicationController
  skip_before_action :check_login
  skip_load_and_authorize_resource

  def index
    if current_user.present?
      if can? :read, BloodDrive
        redirect_to blood_drives_path
      elsif can? :read, Emergency
        redirect_to emergencies_path
      end
    end
  end
end


text:
/**
 * @author Pavel Dolgov
 * @version $Revision$
 */
package java.awt.peer;

public interface MenuPeer {

}


text:
<!DOCTYPE html>

<meta charset="UTF-8">
<link href="style.css" type="text/css" rel="stylesheet">
<title>FCOMI/FCOMIP/ FUCOMI/FUCOMIP—Compare Floating Point Values and Set EFLAGS </title>

FCOMI/FCOMIP/ FUCOMI/FUCOMIP—Compare Floating Point Values and Set EFLAGS

Opcode
Instruction
64-Bit Mode
Compat/Leg Mode
Description

DB F0+i
FCOMI ST, ST(i)
Valid
Valid
Compare ST(0) with ST(i) and set status flags accordingly.

DF F0+i
FCOMIP ST, ST(i)
Valid
Valid
Compare ST(0) with ST(i), set status flags accordingly, and pop register stack.

DB E8+i
FUCOMI ST, ST(i)
Valid
Valid
Compare ST(0) with ST(i), check for ordered values, and set status flags accordingly.

DF E8+i
FUCOMIP ST, ST(i)
Valid
Valid
Compare ST(0) with ST(i), check for ordered values, set status flags accordingly, and pop register stack.

Description

Performs an unordered comparison of the contents of registers ST(0) and ST(i) and sets the status flags ZF, PF, and CF in the EFLAGS register according to the results (see the table below). The sign of zero is ignored for compari-sons, so that –0.0 is equal to +0.0.

Table 3-22.  FCOMI/FCOMIP/ FUCOMI/FUCOMIP Results

Comparison Results*
ZF
PF
CF

ST0 > ST(i)
0
0
0

ST0 < ST(i)
0
0
1

ST0 = ST(i)
1
0
0

Unordered**
1
1
1

NOTES:

*

See the IA-32 Architecture Compatibility section below.

** Flags not set if unmasked invalid-arithmetic-operand (#IA) exception is generated.

An unordered comparison checks the class of the numbers being compared (see "FXAM—Examine Floating-Point" in this chapter). The FUCOMI/FUCOMIP instructions perform the same operations as the FCOMI/FCOMIP instruc-tions. The only difference is that the FUCOMI/FUCOMIP instructions raise the invalid-arithmetic-operand exception (#IA) only when either or both operands are an SNaN or are in an unsupported format; QNaNs cause the condition code flags to be set to unordered, but do not cause an exception to be generated. The FCOMI/FCOMIP instructions raise an invalid-operation exception when either or both of the operands are a NaN value of any kind or are in an unsupported format.

If the operation results in an invalid-arithmetic-operand exception being raised, the status flags in the EFLAGS register are set only if the exception is masked.

The FCOMI/FCOMIP and FUCOMI/FUCOMIP instructions set the OF, SF and AF flags to zero in the EFLAGS register (regardless of whether an invalid-operation exception is detected).

The FCOMIP and FUCOMIP instructions also pop the register stack following the comparison operation. To pop the register stack, the processor marks the ST(0) register as empty and increments the stack pointer (TOP) by 1.

This instruction's operation is the same in non-64-bit modes and 64-bit mode.

IA-32 Architecture Compatibility

The FCOMI/FCOMIP/FUCOMI/FUCOMIP instructions were introduced to the IA-32 Architecture in the P6 family processors and are not available in earlier IA-32 processors.

Operation

CASE (relation of operands) OF
    ST(0) > ST(i):
                         ZF, PF, CF ← 000;
    ST(0) < ST(i):
                         ZF, PF, CF ← 001;
    ST(0) = ST(i):
                         ZF, PF, CF ← 100;
ESAC;
IF Instruction is FCOMI or FCOMIP
    THEN
         IF ST(0) or ST(i) = NaN or unsupported format
              THEN
                    #IA
                    IF FPUControlWord.IM = 1
                         THEN
                              ZF, PF, CF ← 111;
                    FI;
         FI;
FI;
IF Instruction is FUCOMI or FUCOMIP
    THEN
         IF ST(0) or ST(i) = QNaN, but not SNaN or unsupported format
              THEN
                    ZF, PF, CF ← 111;
              ELSE (* ST(0) or ST(i) is SNaN or unsupported format *)
                     #IA;
                    IF FPUControlWord.IM = 1
                         THEN
                              ZF, PF, CF ← 111;
                    FI;
         FI;
FI;
IF Instruction is FCOMIP or FUCOMIP
    THEN
         PopRegisterStack;
FI;

FPU Flags Affected

C1
Set to 0.

C0, C2, C3
Not affected.

Floating-Point Exceptions

#IS
Stack underflow occurred.

#IA

(FCOMI or FCOMIP instruction) One or both operands are NaN values or have unsupported formats.

(FUCOMI or FUCOMIP instruction) One or both operands are SNaN values (but not QNaNs) or have undefined formats. Detection of a QNaN value does not raise an invalid-operand excep-tion.

Protected Mode Exceptions

#NM
CR0.EM[bit 2] or CR0.TS[bit 3] = 1.

#MF
If there is a pending x87 FPU exception.

#UD
If the LOCK prefix is used.

Real-Address Mode Exceptions

Same exceptions as in protected mode.

Virtual-8086 Mode Exceptions

Same exceptions as in protected mode.

Compatibility Mode Exceptions

Same exceptions as in protected mode.

64-Bit Mode Exceptions

Same exceptions as in protected mode.


text:
\input{mmd-article-header}
\def\mytitle{MultiMarkdown Table Test}
\def\latexmode{memoir}
\input{mmd-article-begin-doc}

\begin{table}[htbp]
\begin{minipage}{\linewidth}
\setlength{\tymax}{0.5\linewidth}
\centering
\small
\caption{Prototype table caption}
\label{prototypetable}
\begin{tabulary}{\textwidth}{@{}LCR@{}} \toprule
&\multicolumn{2}{c}{Grouping}\\
First Header&Second Header&Third Header\\
\midrule
Content&\multicolumn{2}{c}{\emph{Long Cell}}\\
Content&\textbf{Cell}&Cell\\

\midrule
New section&More&Data\\
And more&\multicolumn{2}{c}{With an escaped `\textbar{}'}\\

\bottomrule

\end{tabulary}
\end{minipage}
\end{table}

And this is a link to the Prototype table (\autoref{prototypetable}).

And now a table with only a caption.

\begin{table}[htbp]
\begin{minipage}{\linewidth}
\setlength{\tymax}{0.5\linewidth}
\centering
\small
\caption{Caption but no label}
\label{captionbutnolabel}
\begin{tabulary}{\textwidth}{@{}LCR@{}} \toprule
&\multicolumn{2}{c}{Grouping}\\
First Header&Second Header&Third Header\\
\midrule
Content&\multicolumn{2}{c}{\emph{Long Cell}}\\
Content&\textbf{Cell}&Cell\\

\midrule
New section&More&Data\\
And more&\multicolumn{2}{c}{With an escaped `\textbar{}'}\\

\bottomrule

\end{tabulary}
\end{minipage}
\end{table}

And a link to the second table (\autoref{captionbutnolabel}).

And two tables in close proximity:

\begin{table}[htbp]
\begin{minipage}{\linewidth}
\setlength{\tymax}{0.5\linewidth}
\centering
\small
\caption{MultiMarkdown vs. Crayons}
\label{multimarkdownvs.crayons}
\begin{tabulary}{\textwidth}{@{}LCC@{}} \toprule
Features&MultiMarkdown&Crayons\\
\midrule
Melts in warm places&No&Yes\\
Mistakes can be easily fixed&Yes&No\\
Easy to copy documents for friends&Yes&No\\
Fun at parties&No&Why not?\\

\midrule
Minimum markup1 for maximum quality?&Yes&No\\

\bottomrule

\end{tabulary}
\end{minipage}
\end{table}

\begin{table}[htbp]
\begin{minipage}{\linewidth}
\setlength{\tymax}{0.5\linewidth}
\centering
\small
\caption{MultiMarkdown vs. Crayons2}
\label{multimarkdownvs.crayons2}
\begin{tabulary}{\textwidth}{@{}LCC@{}} \toprule
Features&MultiMarkdown&Crayons\\
\midrule
Melts in warm places&No&Yes\\
Mistakes can be easily fixed&Yes&No\\
Easy to copy documents for friends&Yes&No\\
Fun at parties&No&Why not?\\

\midrule
Minimum markup2 for maximum quality?&Yes&No\\

\bottomrule

\end{tabulary}
\end{minipage}
\end{table}

\begin{table}[htbp]
\begin{minipage}{\linewidth}
\setlength{\tymax}{0.5\linewidth}
\centering
\small
\caption{Caption only}
\label{captiononly}
\begin{tabulary}{\textwidth}{@{}LL@{}} \toprule
Col 1&Col 2\\
\midrule
One&Two \\

\bottomrule

\end{tabulary}
\end{minipage}
\end{table}

\input{mmd-memoir-footer}

\end{document}


text:
<!DOCTYPE html>

    <meta http-equiv='Content-type' content='text/html; charset=utf-8'>
    <title>Ambry Front End Sandbox</title>

    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Montserrat">

    <link rel="stylesheet" href="css/bootstrap.min.css"/>

    <link rel="stylesheet" href="css/app.min.css" />

Ambry Front End Sandbox

Current Library Versions

Development Tools Included

Gulp (Task Processing and Automation)

Bootstrap

Sass

Angular


text:
package com.teamdev.jxmaps.examples;

public interface EditableTextControlPanel extends ControlPanel {
    void onTextEntered(String value);

    String getInitialText();
}


text:
declare namespace GoogleAdsScripts {
    // TODO: Add doc comments
    namespace AdsApp {
        interface CampaignMobileApp extends MobileApp {
            getBaseCampaign(): Campaign;
            getCampaign(): Campaign;
        }

        interface CampaignMobileAppIterator extends Base.Iterator<CampaignMobileApp> {}

        interface CampaignMobileAppSelector
            extends Base.Selector<CampaignMobileAppIterator>,
                Base.SelectorForDateRange,
                Base.SelectorOrderBy,
                Base.SelectorWithCondition,
                Base.SelectorWithLimit {}
    }
}


text:
module NotekatTags
  class Formatter
    include NotekatTags::RegularExpressions
    def self.format(text)
      # TODO: change tags/ to use tag_url or path
      text.gsub(HASHTAG_EXPRESSION, "[#\\1](/notes/tag/\\1)")
    end
  end
end


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

namespace _3.Reverse_Array_In_place
{
    class Program
    {
        static void Main()
        {
            var listOfInts = Console.ReadLine().Split().Select(int.Parse).ToArray();

            for (int i = 0; i < listOfInts.Length / 2; i++)
            {
                var leftIndex = i;
                var rightIndex = listOfInts.Length - 1 - i;

                var temp = listOfInts[leftIndex];
                listOfInts[leftIndex] = listOfInts[rightIndex];
                listOfInts[rightIndex] = temp;
            }
            foreach (var reversNumbers in listOfInts)
            {
                Console.Write(reversNumbers + " ");
            }
            Console.WriteLine();
        }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Overview List (PMD PL/SQL 5.5.1 API)</title>
<meta name="date" content="2016-07-27">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

All Classes

Packages

net.sourceforge.pmd.cpd

net.sourceforge.pmd.lang.plsql

net.sourceforge.pmd.lang.plsql.ast

net.sourceforge.pmd.lang.plsql.dfa

net.sourceforge.pmd.lang.plsql.rule

net.sourceforge.pmd.lang.plsql.rule.codesize

net.sourceforge.pmd.lang.plsql.rule.design

net.sourceforge.pmd.lang.plsql.symboltable


text:
// taze: mocha from //third_party/javascript/typings/mocha
// taze: chai from //third_party/javascript/typings/chai

import {alignWithDOM, elementClose, elementOpen, elementVoid, patch, skip, text, skipNode} from '../../index';
const {expect} = chai;

describe('skip', () => {
  let container;

  beforeEach(() => {
    container = document.createElement('div');
    document.body.appendChild(container);
  });

  afterEach(() => {
    document.body.removeChild(container);
  });

  function render(data) {
    elementOpen('div');
    if (data.skip) {
      skip();
    } else {
      text('some ');
      text('text');
    }
    elementClose('div');
  }

  it('should keep any DOM nodes in the subtree', () => {
    patch(container, render, {skip: false});
    patch(container, render, {skip: true});

    expect(container.textContent).to.equal('some text');
  });

  it('should throw if an element is declared after skipping', () => {
    expect(() => {
      patch(container, () => {
        skip();
        elementOpen('div');
        elementClose('div');
      });
    })
        .to.throw(
            'elementOpen() may not be called inside an element' +
            ' that has called skip().');
  });

  it('should throw if a text is declared after skipping', () => {
    expect(() => {
      patch(container, () => {
        skip();
        text('text');
      });
    })
        .to.throw(
            'text() may not be called inside an element that has called skip().');
  });

  it('should throw skip is called after declaring an element', () => {
    expect(() => {
      patch(container, () => {
        elementVoid('div');
        skip();
      });
    })
        .to.throw(
            'skip() must come before any child declarations inside' +
            ' the current element.');
  });

  it('should throw skip is called after declaring a text', () => {
    expect(() => {
      patch(container, () => {
        text('text');
        skip();
      });
    })
        .to.throw(
            'skip() must come before any child declarations' +
            ' inside the current element.');
  });
});

describe('alignWithDOM', () => {
  let container:HTMLElement;

  beforeEach(() => {
    container = document.createElement('div');
    document.body.appendChild(container);
  });

  afterEach(() => {
    document.body.removeChild(container);
  });

  function render(condition: boolean, shouldSkip: boolean) {
    if (condition) {
      elementVoid('img');
    }
    if (shouldSkip) {
      alignWithDOM('div', 1);
    } else {
      elementOpen('div', 1);
        text('Hello');
      elementClose('div');
    }
  }
  it('should skip the correct element when used with conditional elements', () => {
    patch(container, () => {
      render(true, false);
    });
    expect(container.children[1]!.innerHTML).to.equal('Hello');
    container.children[1]!.innerHTML = 'Hola';
    patch(container, () => {
      render(false, true);
    });
    expect(container.childElementCount).to.equal(1);
    // When condition is false, the current node will be at <img>
    // alignWithDOM will then pull the second <div> up to the
    // current position and diff it. The <img> will then be deleted.
    expect(container.children[0]!.innerHTML).to.equal('Hola');
  });
});


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2015 Antonio Leiva
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~       http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<resources>

    <style name="AppTheme" parent="BaseTheme">
        <item name="android:windowTranslucentStatus">true</item>
        <item name="android:colorControlHighlight">@color/accent_translucent</item>

        <item name="android:windowSharedElementsUseOverlay">false</item>
    </style>

    <style name="App_textViewStyle"><item name="android:layout_width">210dp</item>
        <item name="android:layout_height">113dp</item>
        <item name="android:layout_marginBottom">17.5dp</item>
        <item name="android:layout_marginTop">17.5dp</item>
    </style>

</resources>


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Implementation</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.5.1">
<link rel="up" href="../roots_noderiv.html" title="Root Finding Without Derivatives">
<link rel="prev" href="root_termination.html" title="Termination Condition Functors">
<link rel="next" href="../roots_deriv.html" title="Root Finding With Derivatives: Newton-Raphson, Halley & Schröder">

Home
Libraries
People
FAQ
More

Implementation

          The implementation of the bisection algorithm is extremely straightforward
          and not detailed here.

          TOMS Algorithm
          748: enclosing zeros of continuous functions is described in detail
          in:

          Algorithm 748: Enclosing Zeros of Continuous Functions, G. E.
          Alefeld, F. A. Potra and Yixun Shi, ACM Transactions on Mathematica1 Software,
          Vol. 21. No. 3. September 1995. Pages 327-344.

          The implementation here is a faithful translation of this paper into C++.

Copyright © 2006-2010, 2012-2014 Nikhar Agrawal,
      Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert
      Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan Råde, Gautam Sewani,
      Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
var Vue = require('vue');
var escapeRegExp = require('escape-string-regexp');

var selected;

Vue.component('tree', {
    template: require('./tree.html'),
    props: {
        item: Object,
        open: Boolean,
        name: String,
        selected: Boolean,
        fetch: Boolean,
        entryPoint: String,
        main: Boolean,
        types: {
            type: Array,
            default: function() {
                return ['dir']
            }
        },
        items: {
            type: Array,
            default: function () {
                return [];
            }
        }
    },
    data: function () {
        return {
            search: this.$parent.search || {
                sword: null,
                results: null
            }
        }
    },
    computed: {
        prefix: function () {
            return this.name ? this.name + '-' : '';
        }
    },
    created: function () {
        if (!this.entryPoint) {
            this.$dispatch(this.prefix + 'load-items', this);
        }
    },
    events: {
        'search': function (sword, results) {
            this.search.sword = sword;
            this.search.results = results;
            this.doSearch();
            return true;
        },
        'select-item': function (item) {
            if (item instanceof Vue) {
                if (item.entryPoint) {
                    this.$nextTick(function () {
                        this.$broadcast('select-item', 'entrypoint');
                    });
                    return false;
                }
                item = item.item;
                if (!item) {
                    return true;
                }
            }
            if (item === 'entrypoint' && !this.item && !this.entryPoint) {
                this.select(false);
                return false;
            }
            if (item && this.item && item.id === this.item.id || this.entryPoint && !item.id) {
                this.select();
                return false;
            } else if (item) {
                for (var i = 0, l = this.items.length; i < l; i++) {
                    if (this.items[i].id === item.id) {
                        if (!this.open && !this.entryPoint) {
                            this.open = true;
                            this.$nextTick(function () {
                                this.$broadcast('select-item', item);
                            });
                            return false;
                        }
                        break;
                    }
                }
            }
            return true;
        },
        '_open': function () {
            this.open = true;
            return true;
        },
        'deselect-items': function () {
            this.selected = false;
            return true;
        }
    },
    methods: {
        doSearch: function () {
            if (this.search.sword) {
                var regex = new RegExp(escapeRegExp(this.search.sword), 'i');
                for (var i = 0, l = this.items.length; i < l ; i++) {
                    if (regex.test(this.items[i].name)) {
                        this.search.results.push(this.items[i]);
                    }
                }
            }
        },
        select: function (doSwitch) {
            if (doSwitch !== false) {
                if (selected && selected !== this) {
                    selected.selected = false;
                }
                selected = this;
            }
            this.selected = true;
            (this.entryPoint ? this : this.$parent).$dispatch(this.prefix + 'select-item', this);
            this.$parent.$dispatch('_open');
        }
    },
    watch: {
        items: function (items) {
            if (this.selected) {
                this.$nextTick(function () {
                    this.$parent.$dispatch(this.prefix + 'select-item', this);
                });
            }
            this.$nextTick(function () {
                this.doSearch();
            })
        }
    },
    components: []
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>net.shibboleth</groupId>
        <artifactId>parent</artifactId>
        <version>3</version>
    </parent>

    <groupId>edu.internet2.middleware</groupId>
    <artifactId>shibboleth-identityprovider</artifactId>
    <version>2.3.8</version>

    <!-- We bundle as a jar here, the installer creates the WAR -->
    <packaging>jar</packaging>

    <name>Shibboleth Identity Provider</name>
    <description>
        The Shibboleth Identity Provider is used by an organization to securely assert information, via SAML, about
        their users.  This information is then read and acted upon by Service Providers.
    </description>

    <properties>
        <svn.relative.location>java-shib-idp2</svn.relative.location>
        <spring.groupId>org.springframework</spring.groupId>
        <spring.version>2.5.6.SEC03</spring.version>
    </properties>

    <repositories>
        <repository>
            <id>shib-release</id>
            <url>https://build.shibboleth.net/nexus/content/groups/public</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>shib-snapshot</id>
            <url>https://build.shibboleth.net/nexus/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>

    <dependencies>
        <!-- Compile dependencies -->
        <dependency>
            <groupId>edu.internet2.middleware</groupId>
            <artifactId>shibboleth-common</artifactId>
            <version>1.3.7</version>
        </dependency>
        <!-- Override Spring version from parent POM -->
        <dependency>
            <groupId>${spring.groupId}</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>aopalliance</artifactId>
                    <groupId>aopalliance</groupId>
                </exclusion>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-aop</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-jdbc</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-tx</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>${spring.groupId}</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- Override BC version from xmltooling because 1.46 causes an issue with the IdP installer -->
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15</artifactId>
            <version>1.45</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>1.6.2</version>
        </dependency>
        <!-- Override Spring version from parent POM -->
        <dependency>
            <groupId>${spring.groupId}</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>aopalliance</artifactId>
                    <groupId>aopalliance</groupId>
                </exclusion>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-aop</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-jdbc</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-tx</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>${spring.groupId}</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- Override BC version from xmltooling because 1.46 causes an issue with the IdP installer -->
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15</artifactId>
            <version>1.45</version>
        </dependency>

        <!-- Provided dependencies -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
        </dependency>

        <!-- Runtime dependencies -->
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15</artifactId>
            <version>1.45</version>
        </dependency>
        <dependency>
            <groupId>ant-contrib</groupId>
            <artifactId>ant-contrib</artifactId>
            <version>1.0b2</version>
            <scope>runtime</scope>
            <exclusions>
                <exclusion>
                    <groupId>ant</groupId>
                    <artifactId>ant</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>edu.internet2.middleware</groupId>
            <artifactId>ant-extensions</artifactId>
            <version>11Jan2011</version>
            <scope>runtime</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcprov-jdk14</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>edu.internet2.middleware</groupId>
            <artifactId>shibboleth-jce</artifactId>
            <version>1.1.0</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>${xerces.groupId}</groupId>
            <artifactId>xml-apis</artifactId>
        </dependency>
        <dependency>
            <groupId>${xerces.groupId}</groupId>
            <artifactId>xercesImpl</artifactId>
        </dependency>
        <dependency>
            <groupId>${xerces.groupId}</groupId>
            <artifactId>serializer</artifactId>
        </dependency>
        <dependency>
            <groupId>xml-resolver</groupId>
            <artifactId>xml-resolver</artifactId>
        </dependency>
        <dependency>
            <groupId>${xalan.groupId}</groupId>
            <artifactId>xalan</artifactId>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

    </dependencies>
    <distributionManagement>
        <repository>
            <id>release</id>
            <url>${dist.release.url}</url>
        </repository>
        <snapshotRepository>
            <id>snapshot</id>
            <url>${dist.release.url}</url>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <index>true</index>
                        <manifestEntries>
                            <Main-Class>edu.internet2.middleware.shibboleth.idp.Version</Main-Class>
                        </manifestEntries>
                        <manifestSections>
                            <manifestSection>
                                <name>edu/internet2/middleware/shibboleth/idp/</name>
                                <manifestEntries>
                                    <Implementation-Title>${project.artifactId}</Implementation-Title>
                                    <Implementation-Version>${project.version}</Implementation-Version>
                                    <Implementation-Vendor>shibboleth.internet2.edu</Implementation-Vendor>
                                </manifestEntries>
                            </manifestSection>
                        </manifestSections>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <configuration>
                            <descriptors>
                                <descriptor>src/main/assembly/bin.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <links>
                                <link>https://build.shibboleth.net/nexus/service/local/repositories/releases/archive/org/opensaml/xmltooling/1.3.4/xmltooling-1.3.4-javadoc.jar/!/</link>
                                <link>https://build.shibboleth.net/nexus/service/local/repositories/releases/archive/org/opensaml/openws/1.4.4/openws-1.4.4-javadoc.jar/!/</link>
                                <link>https://build.shibboleth.net/nexus/service/local/repositories/releases/archive/org/opensaml/opensaml/2.5.3/opensaml-2.5.3-javadoc.jar/!/</link>
                                <link>https://build.shibboleth.net/nexus/service/local/repositories/releases/archive/edu/internet2/middleware/shibboleth-common/1.3.6/shibboleth-common-1.3.6-javadoc.jar/!/</link>
                            </links>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <!-- Project Metadata -->
    <url>http://shibboleth.internet2.edu/</url>

    <inceptionYear>2006</inceptionYear>

    <licenses>
        <license>
            <name>Apache 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <organization>
        <name>Internet2</name>
        <url>http://www.internet2.edu/</url>
    </organization>

    <issueManagement>
        <system>JIRA</system>
        <url>http://bugs.internet2.edu/</url>
    </issueManagement>

    <mailingLists>
        <mailingList>
            <name>Shibboleth Announce</name>
            <subscribe>http://shibboleth.internet2.edu/support.html#lists</subscribe>
            <unsubscribe>http://shibboleth.internet2.edu/support.html#lists</unsubscribe>
            <post>shibboleth-announce@internet2.edu</post>
            <archive>https://mail.internet2.edu/wws/arc/shibboleth-announce</archive>
        </mailingList>
        <mailingList>
            <name>Shibboleth Users</name>
            <subscribe>http://shibboleth.internet2.edu/support.html#lists</subscribe>
            <unsubscribe>http://shibboleth.internet2.edu/support.html#lists</unsubscribe>
            <post>shibboleth-users@internet2.edu</post>
            <archive>https://mail.internet2.edu/wws/arc/shibboleth-users</archive>
        </mailingList>
        <mailingList>
            <name>Shibboleth Development</name>
            <subscribe>http://shibboleth.internet2.edu/support.html#lists</subscribe>
            <unsubscribe>http://shibboleth.internet2.edu/support.html#lists</unsubscribe>
            <post>shibboleth-dev@internet2.edu</post>
            <archive>https://mail.internet2.edu/wws/arc/shibboleth-dev</archive>
        </mailingList>
    </mailingLists>

    <scm>
        <connection>scm:svn:https://svn.middleware.georgetown.edu/java-idp/</connection>
        <developerConnection>scm:svn:https://svn.middleware.georgetown.edu/java-idp/</developerConnection>
        <tag>HEAD</tag>
        <url>http://svn.middleware.georgetown.edu/view/?root=java-idp</url>
    </scm>

    <developers>
        <developer>
            <id>cantor</id>
            <name>Scott Cantor</name>
            <organization>The Ohio State University</organization>
            <organizationUrl>http://www.osu.edu/</organizationUrl>
            <roles>
                <role>developer</role>
            </roles>
            <timezone>-5</timezone>
        </developer>
        <developer>
            <id>ndk</id>
            <name>Nate Klingenstein</name>
            <organization>Internet2</organization>
            <organizationUrl>http://www.internet2.edu/</organizationUrl>
            <roles>
                <role>documentation</role>
            </roles>
            <timezone>-7</timezone>
        </developer>
        <developer>
            <id>lajoie</id>
            <name>Chad La Joie</name>
            <organization>Itumi, LLC</organization>
            <organizationUrl>http://www.itumi.biz/</organizationUrl>
            <roles>
                <role>developer</role>
                <role>documentation</role>
            </roles>
            <timezone>-5</timezone>
        </developer>
        <developer>
            <id>wnorris</id>
            <name>Will Norris</name>
            <organization>Google, Inc.</organization>
            <organizationUrl>http://www.google.com/</organizationUrl>
            <roles>
                <role>developer</role>
            </roles>
            <timezone>-8</timezone>
        </developer>
        <developer>
            <id>rdw</id>
            <name>Rod Widdowson</name>
            <organization>University of Edinburgh</organization>
            <organizationUrl>http://www.ed.ac.uk/</organizationUrl>
            <roles>
                <role>developer</role>
            </roles>
            <timezone>0</timezone>
        </developer>
    </developers>
</project>


text:
<?php
/**
 *
 * Part of the QCubed PHP framework.
 *
 * @license MIT
 *
 */

namespace QCubed\Query\Condition;

/**
 * Class GreaterThan
 * @package QCubed\Query\Condition
 * @was QQConditionGreaterThan
 */
class GreaterThan extends ComparisonBase
{
    protected $strOperator = ' > ';
}


text:
package de.aliceice.paper;

import java.net.MalformedURLException;
import java.net.URL;

public final class URLRule implements Rule {

    @Override
    public String getDescription() {
        return "URL";
    }

    @Override
    public Boolean isValid(String value) {
        try {
            new URL(value);
            return true;
        } catch (MalformedURLException e) {
            return false;
        }
    }
}


text:
namespace acid {
TcpListener::TcpListener() :
	Socket(Type::Tcp) {
}

uint16_t TcpListener::GetLocalPort() const {
	if (GetHandle() != InvalidSocketHandle()) {
		// Retrieve informations about the local end of the socket.
		sockaddr_in address;
		SocketAddrLength size = sizeof(address);

		if (getsockname(GetHandle(), reinterpret_cast<sockaddr *>(&address), &size) != -1)
			return ntohs(address.sin_port);
	}

	// We failed to retrieve the port.
	return 0;
}

Socket::Status TcpListener::Listen(uint16_t port, const IpAddress &address) {
	// Close the socket if it is already bound.
	Close();

	// Create the internal socket if it doesn't exist.
	Create();

	// Check if the address is valid.
	if (address == IpAddress::None || address == IpAddress::Broadcast)
		return Status::Error;

	// Bind the socket to the specified port.
	auto addr = CreateAddress(address.ToInteger(), port);

	if (bind(GetHandle(), reinterpret_cast<sockaddr *>(&addr), sizeof(addr)) == -1) {
		// Not likely to happen, but...
		Log::Error("Failed to bind listener socket to port :", port, '\n');
		return Status::Error;
	}

	// Listen to the bound port.
	if (listen(GetHandle(), SOMAXCONN) == -1) {
		// Oops, socket is deaf.
		Log::Error("Failed to listen to port :", port, '\n');
		return Status::Error;
	}

	return Status::Done;
}

void TcpListener::Close() {
	// Simply close the socket.
	Socket::Close();
}

Socket::Status TcpListener::Accept(TcpSocket &socket) {
	// Make sure that we're listening.
	if (GetHandle() == InvalidSocketHandle()) {
		Log::Error("Failed to accept a new connection, the socket is not listening\n");
		return Status::Error;
	}

	// Accept a new connection.
	sockaddr_in address;
	SocketAddrLength length = sizeof(address);
	SocketHandle remote = accept(GetHandle(), reinterpret_cast<sockaddr *>(&address), &length);

	// Check for errors.
	if (remote == InvalidSocketHandle())
		return GetErrorStatus();

	// Initialize the new connected socket.
	socket.Close();
	socket.Create(remote);

	return Status::Done;
}
}


text:
package com.olegych.scastie.client.components

import japgolly.scalajs.react._, vdom.all._, extra._

final case class Modal(title: String,
                       isClosed: Boolean,
                       close: Reusable[Callback],
                       modalCss: TagMod,
                       modalId: String,
                       content: TagMod) {
  @inline def render: VdomElement = Modal.component(this)
}

object Modal {

  implicit val reuse: Reusability[Modal] =
    Reusability.byRefOr_==

  private def render(props: Modal): VdomElement = {
    val modalStyle =
      if (props.isClosed) TagMod(display.none)
      else TagMod(display.block)

    div(cls := "modal", id := props.modalId, modalStyle)(
      div(cls := "modal-fade-screen",
          onClick ==> (e => e.stopPropagationCB >> props.close))(
        div(cls := "modal-window",
            props.modalCss,
            onClick ==> (e => e.stopPropagationCB))(
          div(cls := "modal-header")(
            div(cls := "modal-close",
                onClick ==> (e => e.stopPropagationCB >> props.close),
                role := "button",
                title := "close help modal")
          )(
            h1(props.title)
          ),
          div(cls := "modal-inner")(
            props.content
          )
        )
      )
    )
  }

  private val component =
    ScalaComponent
      .builder[Modal]("Modal")
      .render_P(render)
      .configure(Reusability.shouldComponentUpdate)
      .build
}


text:
require "test_helper"

# Test theme controller
class ThemeControllerTest < FunctionalTestCase
  # Prove color_themes action succeeds.
  def test_color_themes
    get(:color_themes)
    assert_response(:success)
  end

  def test_individual_themes
    MO.themes.each do |theme|
      get(theme)
      assert_response(:success)
    end
  end
end


text:
import lazySizes from 'lazysizes';
import 'lazysizes/plugins/respimg/ls.respimg';
import 'lazysizes/plugins/object-fit/ls.object-fit';
import 'lazysizes/plugins/parent-fit/ls.parent-fit';
import __assign from 'core-js/features/object/assign';

Object.assign = Object.assign || __assign;

/**
 * configuration for lazysizes
 */

enum States {
	Lazyload = 'js-a-image--lazyload',
	Pending = 'state-a-image__image--pending',
	Loading = 'state-a-image__image--loading',
	Loaded = 'state-a-image__image--loaded',
}

Object.assign(lazySizes.cfg, {
	preloadAfterLoad: false,
	loadMode: 1,
	expand: 10,
	expFactor: 1.7,
	lazyClass: States.Lazyload,
	preloadClass: States.Pending,
	loadingClass: States.Loading,
	loadedClass: States.Loaded,
	debug: true,
});


text:
cask "bettermouse" do
  version "1.2.1565"
  sha256 "220686774aac6e7528f50c2a3e5d9cb30a4efffbab2a4dff66f4b0e3468a113b"

  url "https://better-mouse.com/wp-content/uploads/BetterMouse.#{version}.zip"
  name "BetterMouse"
  desc "Utility improving 3rd party mouse performance and functionalities"
  homepage "https://better-mouse.com/"

  livecheck do
    url :homepage
    regex(/Version (\d+(?:\.\d+)+)/i)
  end

  app "BetterMouse.app"

  uninstall quit: bundle_id = "com.naotanhaocan.BetterMouse"

  zap trash: [
    "~/Library/Application Support/BetterMouse",
    "~/Library/Caches/#{bundle_id}",
    "~/Library/HTTPStorages/#{bundle_id}*",
    "~/Library/Preferences/#{bundle_id}.plist",
    "~/Library/Saved Application State/#{bundle_id}.savedState",
  ]
end


text:
<?php
/**
 * Created by IntelliJ IDEA.
 * User: thanhquanky
 * Date: 9/25/14
 * Time: 3:08 AM
 */
namespace eStadium\Baseball {

    /**
     * Class Configuration
     *
     * Configurable parameters for GT Baseball Feed Parser
     *
     * @package eStadium\Baseball
     */
    class Configuration
    {
        /** @var string GTBaseballFeedParser version */
        const VERSION = '0.1';

        /** @var string Input file for parsing */
        const INPUT_FILE = 'geot.xml';

        /** @var string Author of GTBaseballFeedParser */
        const AUTHOR = 'Thanh Ky Quan';
    }
}


text:
Focus({
  focusOnInput: false,
  render(){

focus

        The focus binding helps you when you need to know or set the focus of an element. If you set the component property to true or false, the associated element will become focused or unfocused. If the user manually focus or unfocus the associated element, the component property will be set to true or false accordingly.

b="focus: property"

focus demo

              <input type="text" placeholder="Select this input" b="focus: focusOnInput" />

              Focus on Input

              The input has the focus!

Example({
  focusOnInput: false,
  render() {

      <input b="focus: focusOnInput" placeholder="Select this input" />
      <button b="click: focusOnInput(true)">Focus on input</button>
      The input has the focus!

  }
})

  }
})


text:
describe RuboCop::Cop::Style::DefWithParentheses do
  subject(:cop) { described_class.new }

  it 'reports an offense for def with empty parens' do
    src = <<-END.strip_indent
      def func()
      end
    END
    inspect_source(cop, src)
    expect(cop.offenses.size).to eq(1)
  end

  it 'reports an offense for class def with empty parens' do
    src = <<-END.strip_indent
      def Test.func()
      end
    END
    inspect_source(cop, src)
    expect(cop.offenses.size).to eq(1)
  end

  it 'accepts def with arg and parens' do
    expect_no_offenses(<<-RUBY.strip_indent)
      def func(a)
      end
    RUBY
  end

  it 'accepts empty parentheses in one liners' do
    expect_no_offenses("def to_s() join '/' end")
  end

  it 'auto-removes unneeded parens' do
    new_source = autocorrect_source(cop, <<-END.strip_indent)
      def test();
      something
      end
    END
    expect(new_source).to eq(<<-END.strip_indent)
      def test;
      something
      end
    END
  end
end


text:
package fr.elefort.piratesremastered.views;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.SystemClock;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;

import fr.elefort.piratesremastered.util.Benchmark;
import fr.elefort.piratesremastered.Settings;
import fr.elefort.piratesremastered.model.GameModel;
import fr.elefort.piratesremastered.model.Movable;
import fr.elefort.piratesremastered.model.Obstacle;

/**
 * Created by Eric on 14/09/2015.
 */
public class GameSurfaceView extends SurfaceView implements GameSurfaceViewInterface{

    private final Benchmark benchmark = new Benchmark();
    private final Paint paint = new Paint();
    private final Object lock = new Object();
    private volatile boolean pause;

    private Bitmap bitmap;
    private GameModel model;

    public GameSurfaceView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void setGameModel(final GameModel model) {
        this.model = model;
        this.model.setView(this);

        setOnTouchListener(new OnTouchListener() {

            @Override
            public boolean onTouch(View v, MotionEvent event) {
                if (pause)
                    return false;

                for (OnTouchListener listener : model.touchListeners) {
                    listener.onTouch(v, event);
                }
                return true;
            }
        });
    }

    @Override
    protected void onDraw(Canvas canvas) {
        SurfaceHolder holder = getHolder();
        synchronized (holder) {
            float scale = model.getLevel().getScale(getWidth(), getHeight());

            canvas.save();

            if (bitmap != null)
                canvas.drawBitmap(bitmap, 0, 0, paint);

            for (Movable movable : model.movables) {
                movable.draw(canvas, model.getLevel().getOffsetX(getWidth(), scale), model.getLevel().getOffsetY(getHeight(), scale), scale);
            }

            for (Obstacle obstacle : model.obstacles) {
                obstacle.draw(canvas, model.getLevel().getOffsetX(getWidth(), scale), model.getLevel().getOffsetY(getHeight(), scale), scale);
            }

            canvas.restore();

            if (Settings.getInstance().showPerformance()) {
                double fps = benchmark.fps();
                double ram = benchmark.ram();
                double ramAllocate = benchmark.ramAllocate();

                paint.setColor(Color.WHITE);
                paint.setTextSize(15);

                int count = 0;
                for (Movable movable : model.movables) {
                    count++;
                    canvas.drawText(count + " - " + movable + "\tVelocity : " + movable.velocity + "\tImpulsion : " + movable.impulsion
                            + "\tLife : " + movable.getStats().lifes + "\tWounded : " + movable.getStats().wounded, 10, count * 25, paint);
                }
                canvas.drawText("FPS : " + String.format("%.2f", fps) + "\tRAM : " + String.format("%.2f", ram) + "/" + String.format("%.2f", ramAllocate) + "mb", 10, getHeight() - 25, paint);
            }

            super.onDraw(canvas);
        }
    }

    @Override
    public void run(){
        SurfaceHolder.Callback callback = new SurfaceHolder.Callback() {
            private Canvas c;
            private Thread render;
            private long lastTime;

            @Override
            public void surfaceCreated(SurfaceHolder holder) {
                setWillNotDraw(false);
                render = new Thread(new Runnable() {

                    private void onPause() {
                        synchronized(lock) {
                            while (pause) {
                                try {
                                    lock.wait();
                                } catch (InterruptedException e) {
                                    pause = false;
                                    Thread.currentThread().interrupt();
                                }
                            }
                        }
                    }

                    @Override
                    public void run() {
                        while(!Thread.currentThread().isInterrupted()) {

                            final long time = SystemClock.uptimeMillis();
                            final long timeDelta = time - lastTime;

                            if(timeDelta >= 1000) {
                                lastTime = time;
                            }

                            SurfaceHolder holder = getHolder();
                            c = null;
                            try {
                                c = holder.lockCanvas(null);
                                synchronized (holder) {
                                    model.update(timeDelta);
                                    postInvalidate();
                                }
                            }
                            finally {
                                if (c != null) {
                                    holder.unlockCanvasAndPost(c);
                                }
                            }
                            onPause();
                        }
                    }
                });
                render.start();
            }

            @Override
            public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
                bitmap = model.getLevel().getBitmap(model.getTexture(), getWidth(), getHeight());
            }

            @Override
            public void surfaceDestroyed(SurfaceHolder holder) {
                if (render == null)
                    return;
                render.interrupt();
                render = null;
            }
        };

        getHolder().addCallback(callback);
    }

    @Override
    public void pause() {
        synchronized (lock) {
            pause = true;
        }
    }

    @Override
    public void stop() {
        synchronized (lock) {
        }
    }

    @Override
    public void resume() {
        synchronized (lock) {
            pause = false;
            lock.notifyAll();
        }
    }
}