text:
title: "back 2 yearzzz"
layout: "post"
#permalink: "/back-2-yearzzz.html"
uuid: "3731449632128162099"
guid: "tag:blogger.com,1999:blog-3395442647519481452.post-3731449632128162099"
date: "2011-11-14 09:42:00"
updated: "2011-11-14 09:57:06"
description:
blogger:
    siteid: "3395442647519481452"
    postid: "3731449632128162099"
    comments: "0"
categories:
author:
    name: "Junaid Babu"
    url: "https://plus.google.com/116146697743652867110?rel=author"
    image: "//lh4.googleusercontent.com/-uP3Xzdf9OgU/AAAAAAAAAAI/AAAAAAAAhrI/ir4DgdKnzN0/s512-c/photo.jpg"
published: "false"
---

<div class="css-full-post-content js-full-post-content">
Still trapped in those dayz... Lost all 'ma-self' frm me. nthng left. Got a lot frm insti. evrthng now seems to have drownd. hardly 11 dayz to pack evrthng gO home. PEACE... thats the situation that exists now... Always putting pseud... N therz 1 mor thing that I feel embaressed to post here.. I'dve posted it if this thing was private... Evr1 started to MUG. Ive nevr got enthu in that matrs coming to IIT. its always peacemaX. I cud evn predict wats gonna happen. Sometimes its even betr than what hapnd earlier. And em so happy juzt fo 1 thing, juzt hav some loving friendz wingmates n roomiez... [$gcha mg af2yz!]
</div>


text:
short make_object_colors(short border_color, short text_color, short draw_mode, short fill_pattern, short fill_color) {
    return (border_color << 12) | (text_color << 8) | (draw_mode << 7) | (fill_pattern << 4) | fill_color;
}
//"llama llama llama llama llama llama\n"
bool tokenize_multiline(char *buffer, const char *input, short max_width, short text_size, short *last_index) {
    short input_length = strlen(input);
    short buffer_position = 0;

    //Bail out if we're at the end of input
    if (*last_index >= input_length) {
        return false;
    }

    while (*last_index < input_length) {
        if (input[*last_index] == '\n') {
            buffer[buffer_position] = 0;
            buffer_position++;
            (*last_index)++;
            break;
        } else {
            buffer[buffer_position] = input[*last_index];
            buffer_position++;
            //Make sure we always end our string!
            buffer[buffer_position] = 0;
            (*last_index)++;
        }
    }

    //If we need to wrap, we should do so now
    short width_char_difference = buffer_position - (max_width / text_size);
    short inspected_char_pos = 0;
    short original_last_index = *last_index;

    if (width_char_difference > 0) {
        inspected_char_pos = buffer_position - width_char_difference;
        (*last_index) -= width_char_difference;

        while (inspected_char_pos > 0 && buffer[inspected_char_pos] != ' ') {
            inspected_char_pos--;
            (*last_index)--;
        }
        if (buffer[inspected_char_pos] == ' ') {
            buffer[inspected_char_pos] = 0;
            (*last_index)++;
        } else {
            *last_index = original_last_index;
        }
    }
    return true;
}

redpajama_set_name: RedPajamaGithub


text:
/**
 * @category Internal processor
 * @packageDocumentation
 */
import { logger } from "@truffle/db/logger";
const debug = logger("db:network:query:relation");

import type { IdObject, Resource } from "@truffle/db/resources";
import type { Process } from "@truffle/db/process";
import * as Fetch from "@truffle/db/network/fetch";
import * as QueryNextPossiblyRelatedNetworks from "./nextPossiblyRelatedNetworks";

/**
 * Issue GraphQL requests and eth_getBlockByNumber requests to determine if any
 * existing Network resources are ancestor or descendant of the connected
 * Network.
 *
 * Iteratively, this queries all possibly-related Networks for known historic
 * block. For each possibly-related Network, issue a corresponding web3 request
 * to determine if the known historic block is, in fact, the connected
 * blockchain's record of the block at that historic height.
 *
 * This queries @truffle/db for possibly-related Networks in batches, keeping
 * track of new candidates vs. what has already been tried.
 */
export function* process(options: {
  relationship: "ancestor" | "descendant";
  network: IdObject<"networks">;
  exclude?: IdObject<"networks">[];
  disableIndex?: boolean;
}): Process<Resource<"networks"> | undefined> {
  const { relationship, network, exclude = [], disableIndex = false } = options;

  // since we're doing this iteratively, track what we've already tried to
  // exclude from further consideration.
  //
  // use provided `exclude` list for initial value
  let alreadyTried: string[] = exclude.map(({ id }) => id);
  let candidates: Resource<"networks">[];

  do {
    // query graphql for new candidates
    ({
      networks: candidates,
      alreadyTried
    } = yield* QueryNextPossiblyRelatedNetworks.process({
      relationship,
      network,
      alreadyTried,
      disableIndex
    }));

    // check blockchain to find a matching network
    for (const candidate of candidates) {
      const { historicBlock } = candidate;
      const block = yield* Fetch.Block.process({
        block: {
          height: historicBlock.height
        }
      });

      if (block && block.hash === historicBlock.hash) {
        return candidate;
      }
    }
  } while (candidates.length > 0);

  // otherwise we got nothin'
}


text:
//
//  WKSubjectImageTableViewCell.h
//  Walking
//
//  Created by lanou on 16/4/26.
//  Copyright © 2016年 xqy. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "WKSubjectDetailSectionsModel.h"

@interface WKSubjectImageTableViewCell : UITableViewCell

@property (copy, nonatomic) NSString *urlStr;
@property (strong, nonatomic) UIView *bgView;
/** 缩放视图层 */
@property (nonatomic, strong)UIImageView *imageView1;

@property (nonatomic, strong) WKSubjectDetailSectionsModel *model;

@end


text:
package tzk.image.tool;

import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.awt.image.BufferedImageOp;
import java.awt.image.ConvolveOp;
import java.awt.image.Kernel;
import javax.swing.JToggleButton;
import tzk.image.ui.ImageCraft;

/**
 * Basic tool class. Extend this class with your tool.
 *
 * Contributers:    Thomas James Barry/ thomasbarry92@gmail.com   /5076942
 *                  Zachary Gateley/    zach.cykic@gmail.com      /5415772
 *                  K Drew Gonzales/    drewgonzales360@gmail.com /5470602
 */
public class SimpleTool {

    public SimpleTool(ImageCraft iC) {
        imageCraft = iC;
    }

    /**
     * What happens when the mouse is pressed. When this tool is selected, this
     * event fires when the mouse is pressed in the DrawingArea
     *
     * @param evt
     */
    public void mousePressed(MouseEvent evt) {
    }

    /**
     * What happens when the mouse is dragged. When this tool is selected, this
     * method is called when the mouse has been pressed within the DrawingArea
     * and the mouse is dragged in the drawing area.
     *
     * @param evt
     */
    public void mouseDragged(MouseEvent evt) {
    }

    /**
     * What happens when the mouse is released. When this tool is selected, this
     * method is called when the mouse has been pressed within the DrawingArea
     * and the mouse is released
     *
     * @param evt
     */
    public void mouseReleased(MouseEvent evt) {
    }

    /**
     * Deselects any current tool and selects the new tool.
     *
     *
     */
    public void select() {
        if (imageCraft.currentTool != null) {
            deselect();
        }

        // Select currentTool
        // Set the toggle button of the current tool to selected
        imageCraft.currentTool = this;
        if (imageCraft.currentTool != null && imageCraft.currentTool.toolButton != null) {
            imageCraft.currentTool.toolButton.setSelected(true);
        }
        //By default you cannot select a size for a tool (this is overrided if
        //this is a draw or shape tool.
        imageCraft.jSize.setEnabled(false);
    }

    /**
     * Deselects this SimpleTool
     *
     *
     */
    public void deselect() {
        // In case this was called when there is no current tool, end execution
        if (imageCraft.currentTool == null) {
            return;
        }

        // Toggle its button
        if (imageCraft.currentTool.toolButton != null) {
            imageCraft.currentTool.toolButton.setSelected(false);
        }
    }

    public void setButton(JToggleButton button) {
        toolButton = button;
    }

    public void setPenStroke(String filePath) {
    }

    public void setPenWidth(int width) {
    }

    // Variables declaration
    private final ImageCraft imageCraft;

    // What button the tool is using
    private JToggleButton toolButton = null;

    // End of variables declaration
}


text:
set -o errexit
set -o nounset
set -o pipefail

KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..

echo "NOTE: $0 has been replaced by 'make test-integration'"
echo
echo "The equivalent of this invocation is: "
echo "    make test-integration"
echo
echo
echo make --no-print-directory -C "${KUBE_ROOT}" test-integration
echo
echo
make --no-print-directory -C "${KUBE_ROOT}" test-integration


text:
using UnityEngine;
using System.Collections;

public class Remover : MonoBehaviour
{
	public GameObject splash;

	void OnTriggerEnter2D(Collider2D col)
	{
		// If the player hits the trigger...
		if(col.gameObject.tag == "Player")
		{
			// .. stop the Health Bar following the player
			if(GameObject.FindGameObjectWithTag("HealthBar").activeSelf)
			{
				GameObject.FindGameObjectWithTag("HealthBar").SetActive(false);
			}

			// ... instantiate the splash where the player falls in.
			Instantiate(splash, col.transform.position, transform.rotation);
			// ... destroy the player.
			Destroy (col.gameObject);
			// ... reload the level.
			StartCoroutine("ReloadGame");
		}
		else
		{
			// ... instantiate the splash where the enemy falls in.
			Instantiate(splash, col.transform.position, transform.rotation);

			// Destroy the enemy.
			Destroy (col.gameObject);
		}
	}

	IEnumerator ReloadGame()
	{
		// ... pause briefly
		yield return new WaitForSeconds(2);
		// ... and then reload the level.
		Application.LoadLevel(Application.loadedLevel);
	}
}


text:
package pl.krix.chat.jsonApi.response;

import pl.krix.chat.domain.ChatUser;

/**
 * Created by krix on 12.11.15.
 */
public class UserEvent {

    private ChatUser user;

    private String event;

    public UserEvent(ChatUser user, String event) {
        this.user = user;
        this.event = event;
    }

    public ChatUser getUser() {
        return user;
    }

    public void setUser(ChatUser user) {
        this.user = user;
    }

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }
}


text:
RSpec.shared_examples_for 'a provider' do
  let(:user) { User.create! }
  let(:other_user) { User.create! }

  it 'can log a user in' do
    provider.login(user)

    expect(provider.current_user).to eq user
  end

  it 'can log a user out' do
    provider.login(user)

    provider.logout

    expect(provider.current_user).to eq nil
  end

  it 'responds to login_exclusive' do
    expect(provider).to respond_to(:login_exclusive)
  end

  it 'responds to login_exclusive' do
    expect(provider).to respond_to(:login_inclusive)
  end

  it 'knows if there are any users logged in' do
    provider.login(user, :user)

    expect(provider.current_users_without_scope).to eq [user]
  end

  it 'can lock the original user, allowing us to change current_user' do
    provider.login(user)
    provider.remember_current_user(true)
    provider.login_exclusive(other_user, scope: 'user')

    expect(provider.original_user).to eq user
    expect(provider.current_user(:user)).to eq other_user
  end

  it 'can forget the original_user' do
    provider.login(user)
    provider.remember_current_user(true)

    expect(provider.original_user).to eq user
    provider.remember_current_user(false)

    expect(provider.original_user).to eq nil
  end
end


text:
require 'spec_helper'

if run_integration_specs?
  describe SagePay::Server, "integration specs" do
    before(:each) do
      SagePay::Server.default_registration_options = {
          :mode => :test,
          :vendor => TEST_VENDOR_NAME,
          :notification_url => TEST_NOTIFICATION_URL
      }
    end

    after(:each) do
      SagePay::Server.default_registration_options = {}
    end

    describe ".payment" do
      before(:each) do
        @payment = SagePay::Server.payment(
            :description => "Demo payment",
            :amount => 12.34,
            :currency => "GBP",
            :billing_address => address_factory
        )
      end

      it "should successfully register the payment with SagePay" do
        result = @payment.run!
        result.should_not be_nil
      end

      it "should be a valid registered payment" do
        registration = @payment.run!
        puts "Registration failed> #{registration}" unless registration.ok?
        registration.should be_ok
      end

      it "should have a next URL" do
        registration = @payment.run!
        next_url = registration.next_url
        puts "    Next URL given by gateway > #{next_url}" if next_url
        next_url.should_not be_nil
      end

      it "should allow us to follow the next URL and the response should be successful" do
        registration = @payment.run!
        uri = URI.parse(registration.next_url)
        request = Net::HTTP::Get.new(uri.request_uri)
        http = Net::HTTP.new(uri.host, uri.port)
        http.use_ssl = true if uri.scheme == "https"
        http.start { |http|
          http.request(request)
        }
      end

      it "should allow us to retrieve signature verification details" do
        @payment.run!
        sig_details = @payment.signature_verification_details

        sig_details.should_not                be_nil
        sig_details.security_key.should_not   be_nil
        sig_details.vendor.should_not         be_nil
      end
    end

    describe ".payment with a US address" do
      before(:each) do
        @payment = SagePay::Server.payment(
            :description => "Demo payment",
            :amount => 12.34,
            :currency => "GBP",
            :billing_address => address_factory(:country => "US", :state => "WY")
        )
      end

      it "should successfully register the payment with SagePay" do
        @payment.run!.should_not be_nil
      end

      it "should be a valid registered payment" do
        registration = @payment.run!
        registration.should be_ok
      end

      it "should have a next URL" do
        registration = @payment.run!
        next_url = registration.next_url
        puts "    Next URL given by gateway > #{next_url}" if next_url
        next_url.should_not be_nil
      end

      it "should allow us to follow the next URL and the response should be successful" do
        registration = @payment.run!
        uri = URI.parse(registration.next_url)
        request = Net::HTTP::Get.new(uri.request_uri)
        http = Net::HTTP.new(uri.host, uri.port)
        http.use_ssl = true if uri.scheme == "https"
        http.start { |http|
          http.request(request)
        }
      end

      it "should allow us to retrieve signature verification details" do
        @payment.run!
        sig_details = @payment.signature_verification_details

        sig_details.should_not                be_nil
        sig_details.security_key.should_not   be_nil
        sig_details.vendor.should_not         be_nil
      end
    end

    describe ".deferred" do
      before(:each) do
        @deferred = SagePay::Server.deferred(
            :description => "Demo payment",
            :amount => 12.34,
            :currency => "GBP",
            :billing_address => address_factory
        )
      end

      it "should successfully register the deferred payment with SagePay" do
        @deferred.run!.should_not be_nil
      end

      it "should be a valid deferred payment" do
        registration = @deferred.run!
        registration.should be_ok
      end

      it "should have a next URL" do
        registration = @deferred.run!
        puts registration.response.inspect
        next_url = registration.next_url
        puts "    Next URL given by gateway > #{next_url}" if next_url
        next_url.should_not be_nil
      end

      it "should allow us to follow the next URL and the response should be successful" do
        registration = @deferred.run!
        uri = URI.parse(registration.next_url)
        request = Net::HTTP::Get.new(uri.request_uri)
        http = Net::HTTP.new(uri.host, uri.port)
        http.use_ssl = true if uri.scheme == "https"
        http.start { |http|
          http.request(request)
        }
      end

      it "should allow us to retrieve signature verification details" do
        @deferred.run!
        sig_details = @deferred.signature_verification_details

        sig_details.should_not                be_nil
        sig_details.security_key.should_not   be_nil
        sig_details.vendor.should_not         be_nil
      end
    end

    describe ".token_registration" do
      before(:each) do
        @token_registration = SagePay::Server.token_registration(
            :currency => "GBP"
        )
      end

      it "should successfully register the payment with SagePay" do
        result = @token_registration.run!
        result.should_not be_nil
      end

      it "should be a valid registered token" do
        registration = @token_registration.run!
        puts "Registration failed> #{registration}" unless registration.ok?
        registration.should be_ok
      end

      it "should have a next URL" do
        registration = @token_registration.run!
        next_url = registration.next_url
        puts "    Next URL given by gateway > #{next_url}" if next_url
        next_url.should_not be_nil
      end

    end

    describe ".token_payment" do
      before(:each) do
        @token_registration = SagePay::Server.token_registration(
            :currency => "GBP"
        )

      end

      it "should register the token and save it for the next test" do
        #initially register the token with SagePay gateway
        registration = @token_registration.run!
        puts "Registration failed> #{registration}" unless registration.ok?
        next_url = registration.next_url
        puts "    Next URL given by gateway > #{next_url}" if next_url
        full_path = File.expand_path("../../../stub_sage_server/last_security_key.yml", __FILE__)
        yaml_obj = YAML::dump(registration)
        File.open(full_path, 'w') { |f| f.write yaml_obj }
        puts "saved returned values to #{full_path}"
      end

      it "should use a registered token as the " do

        stored_params = YAML::load(File.open(File.expand_path("../../../stub_sage_server/responses/token_ok.yml", __FILE__)))
        stored_token = stored_params["Token"]

        @payment = SagePay::Server.payment(
            :description => "Demo payment with TOKEN #{stored_token}",
            :amount => 99.75,
            :currency => "GBP",
            :billing_address => address_factory,
            :token => stored_token,
            :store_token => true)

        registration = @payment.run!
        next_url = registration.next_url
        puts "    Next URL given by gateway > #{next_url}" if next_url

      end

    end

    context ".authenticate and .authorize" do
      before(:each) do
        @authenticated_transaction= SagePay::Server.authenticate(
            :description => "Demo payment",
            :amount => 12.34,
            :currency => "GBP",
            :billing_address => address_factory
        )
      end

      it "should have a next URL" do
        #
        registration = @authenticated_transaction.run!
        next_url = registration.next_url
        puts "    Next URL given by gateway > #{next_url}" if next_url
        next_url.should_not be_nil
      end

      it "current_TEST change" do

        {
            "VPSProtocol" => "2.23",
            "TxType" => "AUTHENTICATE",
            "VendorTxCode" => "715deff0-3721-012f-37f9-001617b98af1",
            "VPSTxId" => "{795F8EFC-C681-4A64-BF71-500DE08BA0B1}",
            "Status" => "AUTHENTICATED",
            "StatusDetail" => "Simulator example AUTHENTICATED Notification Post",
            "GiftAid" => "0",
            "3DSecureStatus" => "OK",
            "CAVV" => "MNBMISVQ5FOJX3WIR4H1JV",
            "CardType" => "VISA",
            "Last4Digits" => "1362",
            "VPSSignature" => "1A7C418CB4733117C7C8202D86956329",
            "controller" => "notifications",
            "action" => "create"
        }

      end

    end

  end
end


text:
package main

import (
	"fmt"
	"github.com/jroimartin/gocui"
)

type LogEntry struct {
	Date Date
	Msg  string
}

func (l LogEntry) String() string {
	return fmt.Sprintf("[%v] %s", l.Date, l.Msg)
}

func printLogsToView(logs []LogEntry, v *gocui.View) {
	v.Clear()
	v.SetOrigin(0, 0)
	_, height := v.Size()
	var sliceStart int
	if len(logs) > height {
		sliceStart = len(logs) - height
	}
	for _, l := range logs[sliceStart:] {
		fmt.Fprintln(v, l)
	}
}

func NewLogEntry(date Date, formatString string, v ...interface{}) LogEntry {
	return LogEntry{date, fmt.Sprintf(formatString, v...)}
}


text:
'use strict';

var fs = require('fs');

var template = fs.readFileSync(__dirname + '/groupCreate.html', 'utf8');

var Controller = [
  '$scope',
  'page',
  'GroupResource',
  'Notifications',
  '$location',
  '$translate',
  function(
    $scope,
    pageService,
    GroupResource,
    Notifications,
    $location,
    $translate
  ) {
    $scope.$root.showBreadcrumbs = true;

    pageService.titleSet($translate.instant('GROUP_CREATE_NEW_GROUP'));

    pageService.breadcrumbsClear();

    pageService.breadcrumbsAdd([
      {
        label: $translate.instant('GROUP_CREATE_LABEL_GROUP'),
        href: '#/groups'
      },
      {
        label: $translate.instant('GROUP_CREATE_LABEL_NEW_GROUP'),
        href: '#/group-create'
      }
    ]);

    // data model for new group
    $scope.group = {
      id: '',
      name: '',
      type: ''
    };

    $scope.createGroup = function() {
      var group = $scope.group;
      GroupResource.createGroup(group).$promise.then(
        function() {
          Notifications.addMessage({
            type: 'success',
            status: $translate.instant('NOTIFICATIONS_STATUS_SUCCESS'),
            message: $translate.instant('GROUP_CREATE_MESSAGE_SUCCESS', {
              group: group.id
            })
          });
          $location.path('/groups');
        },
        function() {
          Notifications.addError({
            status: $translate.instant('NOTIFICATIONS_STATUS_FAILED'),
            message: $translate.instant('GROUP_CREATE_MESSAGE_ERROR', {
              group: group.id
            })
          });
        }
      );
    };
  }
];

module.exports = [
  '$routeProvider',
  function($routeProvider) {
    $routeProvider.when('/group-create', {
      template: template,
      controller: Controller,
      authentication: 'required'
    });
  }
];


text:
from __future__ import unicode_literals
import re
import base64

from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
    determine_ext,
    ExtractorError,
    float_or_none,
    int_or_none,
    try_get,
    unsmuggle_url,
)
from ..compat import compat_urllib_parse_urlencode

class OoyalaBaseIE(InfoExtractor):
    _PLAYER_BASE = 'http://player.ooyala.com/'
    _CONTENT_TREE_BASE = _PLAYER_BASE + 'player_api/v1/content_tree/'
    _AUTHORIZATION_URL_TEMPLATE = _PLAYER_BASE + 'sas/player_api/v2/authorization/embed_code/%s/%s?'

    def _extract(self, content_tree_url, video_id, domain='example.org', supportedformats=None, embed_token=None):
        content_tree = self._download_json(content_tree_url, video_id)['content_tree']
        metadata = content_tree[list(content_tree)[0]]
        embed_code = metadata['embed_code']
        pcode = metadata.get('asset_pcode') or embed_code
        title = metadata['title']

        auth_data = self._download_json(
            self._AUTHORIZATION_URL_TEMPLATE % (pcode, embed_code) +
            compat_urllib_parse_urlencode({
                'domain': domain,
                'supportedFormats': supportedformats or 'mp4,rtmp,m3u8,hds,dash,smooth',
                'embedToken': embed_token,
            }), video_id)

        cur_auth_data = auth_data['authorization_data'][embed_code]

        urls = []
        formats = []
        if cur_auth_data['authorized']:
            for stream in cur_auth_data['streams']:
                url_data = try_get(stream, lambda x: x['url']['data'], compat_str)
                if not url_data:
                    continue
                s_url = base64.b64decode(url_data.encode('ascii')).decode('utf-8')
                if not s_url or s_url in urls:
                    continue
                urls.append(s_url)
                ext = determine_ext(s_url, None)
                delivery_type = stream.get('delivery_type')
                if delivery_type == 'hls' or ext == 'm3u8':
                    formats.extend(self._extract_m3u8_formats(
                        re.sub(r'/ip(?:ad|hone)/', '/all/', s_url), embed_code, 'mp4', 'm3u8_native',
                        m3u8_id='hls', fatal=False))
                elif delivery_type == 'hds' or ext == 'f4m':
                    formats.extend(self._extract_f4m_formats(
                        s_url + '?hdcore=3.7.0', embed_code, f4m_id='hds', fatal=False))
                elif delivery_type == 'dash' or ext == 'mpd':
                    formats.extend(self._extract_mpd_formats(
                        s_url, embed_code, mpd_id='dash', fatal=False))
                elif delivery_type == 'smooth':
                    self._extract_ism_formats(
                        s_url, embed_code, ism_id='mss', fatal=False)
                elif ext == 'smil':
                    formats.extend(self._extract_smil_formats(
                        s_url, embed_code, fatal=False))
                else:
                    formats.append({
                        'url': s_url,
                        'ext': ext or delivery_type,
                        'vcodec': stream.get('video_codec'),
                        'format_id': delivery_type,
                        'width': int_or_none(stream.get('width')),
                        'height': int_or_none(stream.get('height')),
                        'abr': int_or_none(stream.get('audio_bitrate')),
                        'vbr': int_or_none(stream.get('video_bitrate')),
                        'fps': float_or_none(stream.get('framerate')),
                    })
        else:
            raise ExtractorError('%s said: %s' % (
                self.IE_NAME, cur_auth_data['message']), expected=True)
        self._sort_formats(formats)

        subtitles = {}
        for lang, sub in metadata.get('closed_captions_vtt', {}).get('captions', {}).items():
            sub_url = sub.get('url')
            if not sub_url:
                continue
            subtitles[lang] = [{
                'url': sub_url,
            }]

        return {
            'id': embed_code,
            'title': title,
            'description': metadata.get('description'),
            'thumbnail': metadata.get('thumbnail_image') or metadata.get('promo_image'),
            'duration': float_or_none(metadata.get('duration'), 1000),
            'subtitles': subtitles,
            'formats': formats,
        }

class OoyalaIE(OoyalaBaseIE):
    _VALID_URL = r'(?:ooyala:|https?://.+?\.ooyala\.com/.*?(?:embedCode|ec)=)(?P<id>.+?)(&|$)'

    _TESTS = [
        {
            # From http://it.slashdot.org/story/13/04/25/178216/recovering-data-from-broken-hard-drives-and-ssds-video
            'url': 'http://player.ooyala.com/player.js?embedCode=pxczE2YjpfHfn1f3M-ykG_AmJRRn0PD8',
            'info_dict': {
                'id': 'pxczE2YjpfHfn1f3M-ykG_AmJRRn0PD8',
                'ext': 'mp4',
                'title': 'Explaining Data Recovery from Hard Drives and SSDs',
                'description': 'How badly damaged does a drive have to be to defeat Russell and his crew? Apparently, smashed to bits.',
                'duration': 853.386,
            },
            # The video in the original webpage now uses PlayWire
            'skip': 'Ooyala said: movie expired',
        }, {
            # Only available for ipad
            'url': 'http://player.ooyala.com/player.js?embedCode=x1b3lqZDq9y_7kMyC2Op5qo-p077tXD0',
            'info_dict': {
                'id': 'x1b3lqZDq9y_7kMyC2Op5qo-p077tXD0',
                'ext': 'mp4',
                'title': 'Simulation Overview - Levels of Simulation',
                'duration': 194.948,
            },
        },
        {
            # Information available only through SAS api
            # From http://community.plm.automation.siemens.com/t5/News-NX-Manufacturing/Tool-Path-Divide/ba-p/4187
            'url': 'http://player.ooyala.com/player.js?embedCode=FiOG81ZTrvckcchQxmalf4aQj590qTEx',
            'md5': 'a84001441b35ea492bc03736e59e7935',
            'info_dict': {
                'id': 'FiOG81ZTrvckcchQxmalf4aQj590qTEx',
                'ext': 'mp4',
                'title': 'Divide Tool Path.mp4',
                'duration': 204.405,
            }
        },
        {
            # empty stream['url']['data']
            'url': 'http://player.ooyala.com/player.js?embedCode=w2bnZtYjE6axZ_dw1Cd0hQtXd_ige2Is',
            'only_matching': True,
        }
    ]

    @staticmethod
    def _url_for_embed_code(embed_code):
        return 'http://player.ooyala.com/player.js?embedCode=%s' % embed_code

    @classmethod
    def _build_url_result(cls, embed_code):
        return cls.url_result(cls._url_for_embed_code(embed_code),
                              ie=cls.ie_key())

    def _real_extract(self, url):
        url, smuggled_data = unsmuggle_url(url, {})
        embed_code = self._match_id(url)
        domain = smuggled_data.get('domain')
        supportedformats = smuggled_data.get('supportedformats')
        embed_token = smuggled_data.get('embed_token')
        content_tree_url = self._CONTENT_TREE_BASE + 'embed_code/%s/%s' % (embed_code, embed_code)
        return self._extract(content_tree_url, embed_code, domain, supportedformats, embed_token)

class OoyalaExternalIE(OoyalaBaseIE):
    _VALID_URL = r'''(?x)
                    (?:
                        ooyalaexternal:|
                        https?://.+?\.ooyala\.com/.*?\bexternalId=
                    )
                    (?P<partner_id>[^:]+)
                    :
                    (?P<id>.+)
                    (?:
                        :|
                        .*?&pcode=
                    )
                    (?P<pcode>.+?)
                    (?:&|$)
                    '''

    _TEST = {
        'url': 'https://player.ooyala.com/player.js?externalId=espn:10365079&pcode=1kNG061cgaoolOncv54OAO1ceO-I&adSetCode=91cDU6NuXTGKz3OdjOxFdAgJVtQcKJnI&callback=handleEvents&hasModuleParams=1&height=968&playerBrandingId=7af3bd04449c444c964f347f11873075&targetReplaceId=videoPlayer&width=1656&wmode=opaque&allowScriptAccess=always',
        'info_dict': {
            'id': 'FkYWtmazr6Ed8xmvILvKLWjd4QvYZpzG',
            'ext': 'mp4',
            'title': 'dm_140128_30for30Shorts___JudgingJewellv2',
            'duration': 1302.0,
        },
        'params': {
            # m3u8 download
            'skip_download': True,
        },
    }

    def _real_extract(self, url):
        partner_id, video_id, pcode = re.match(self._VALID_URL, url).groups()
        content_tree_url = self._CONTENT_TREE_BASE + 'external_id/%s/%s:%s' % (pcode, partner_id, video_id)
        return self._extract(content_tree_url, video_id)


text:
package org.cojen.classfile;

/**
 * A label is used to manipulate a branch instruction's branch location. A
 * label has a location address. Branch instructions have origin addresses,
 * which contain the address of the opcode that performs the conditional or
 * unconditional branch.
 *
 * <p>Labels are generated by factory methods in the CodeBuilder class.
 * If a label has any origin addresses, its location address must be set by
 * the time the CodeBuilder's class file is output.
 *
 * @author Brian S O'Neill
 * @see CodeBuilder
 */
public interface Label extends Location {
    /**
     * Sets the location of a label to be at the current postion in the
     * code being generated.
     *
     * @return the Label itself.
     */
    Label setLocation();

    /**
     * Returns -1 if the location isn't yet fully resolved.
     *
     * @exception IllegalStateException when the location is unknown because
     * the setLocation method was never called.
     */
    int getLocation() throws IllegalStateException;
}