text:
package test.dataload.parser;

import dataload.parsers.TvdbParser;
import dataload.provider.TvdbProvider;
import models.*;
import org.junit.Test;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import java.util.List;
import java.util.Set;

import static org.fest.assertions.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static play.test.Helpers.*;

public class Test_Parser_Tvdb {

    private final static Integer TVDB_ID_SHOW = 75978;
    private final static Integer TVDB_ID_EPISODE = 1230461;

    private void createFakeShow() {

        Show show = new Show();
        show.setTvdbId(TVDB_ID_SHOW);
        show.setTitle("Family Guy");

        show.save();

    }

    private Document parseXmlFile(String path) throws ParserConfigurationException, IOException, SAXException {

        File xmlFile = new File(path);

        return DocumentBuilderFactory
                .newInstance()
                .newDocumentBuilder()
                .parse(xmlFile);
    }

    @Test
    public void parseShow() throws ParserConfigurationException, SAXException, IOException, ParseException {

        running(fakeApplication(inMemoryDatabase()), new Runnable() {
            public void run() {

                createFakeShow();
                List<Show> shows = null;
                try {
                    TvdbProvider tvdbProvider = mock(TvdbProvider.class);
                    when(tvdbProvider.getIdByNameFromFile("Family Guy")).thenReturn(TVDB_ID_SHOW);
                    when(tvdbProvider.fetchShow(TVDB_ID_SHOW)).thenReturn(parseXmlFile(String.format("test/test/data/%s.xml", TVDB_ID_SHOW)));

                    TvdbParser tvdbParser = new TvdbParser(tvdbProvider, true);
                    shows = tvdbParser.parseShows();
                } catch (Exception e) {
                    assertThat(true).overridingErrorMessage("Something went wrong while parsing the test tvdb data").isFalse();
                }

                assertThat(shows).hasSize(1);

                Show show = shows.get(0);
                assertThat(show.getAirday()).isEqualTo(Day.SUNDAY);
                assertThat(show.getAirtime()).isEqualTo("9:00 PM");
                assertThat(show.getDescription()).startsWith("Sick, twisted, politically incorrect and Freakin' Sweet");
                assertThat(show.getNetwork().getName()).isEqualTo("FOX");
                assertThat(show.getTitle()).isEqualTo("Family Guy");
                assertThat(show.getTvdbId()).isEqualTo(TVDB_ID_SHOW);

                Set<Actor> actors = show.getActors();
                assertThat(actors).hasSize(7);

                List<Season> seasons = show.getSeasons();
                assertThat(seasons).hasSize(12);

                Season firstSeason = seasons.get(0);
                assertThat(firstSeason.getEpisodes()).hasSize(7);

                Episode firstEpisode = firstSeason.getEpisodes().get(0);
                assertThat(firstEpisode.getAirtime().toString()).startsWith("Sun Jan 31");
                assertThat(firstEpisode.getDescription()).startsWith("After Peter heavily drinks at a bachelor party");
                assertThat(firstEpisode.getNumber()).isEqualTo(1);
                assertThat(firstEpisode.getTitle()).isEqualTo("Death has a Shadow");
            }
        });

    }

    @Test
    public void parseUpdatesForShow() throws ParserConfigurationException, SAXException, IOException, ParseException {

        running(fakeApplication(inMemoryDatabase()), new Runnable() {
            public void run() {

                createFakeShow();
                List<Show> shows = null;
                try {
                    TvdbProvider tvdbProvider = mock(TvdbProvider.class);
                    when(tvdbProvider.fetchShow(TVDB_ID_SHOW)).thenReturn(parseXmlFile(String.format("test/test/data/%s.xml", TVDB_ID_SHOW)));
                    when(tvdbProvider.fetchUpdates()).thenReturn(parseXmlFile("test/test/data/updates_day_show.xml"));

                    TvdbParser tvdbParser = new TvdbParser(tvdbProvider, true);
                    shows = tvdbParser.parseUpdates();
                } catch (Exception e) {
                    assertThat(true).overridingErrorMessage("Something went wrong while parsing the test tvdb data").isFalse();
                }

                assertThat(shows).hasSize(1);

                Show show = shows.get(0);
                assertThat(show.getAirday()).isEqualTo(Day.SUNDAY);
                assertThat(show.getAirtime()).isEqualTo("9:00 PM");
                assertThat(show.getDescription()).startsWith("Sick, twisted, politically incorrect and Freakin' Sweet");
                assertThat(show.getNetwork().getName()).isEqualTo("FOX");
                assertThat(show.getTitle()).isEqualTo("Family Guy");
                assertThat(show.getTvdbId()).isEqualTo(TVDB_ID_SHOW);

                Set<Actor> actors = show.getActors();
                assertThat(actors).hasSize(7);

                List<Season> seasons = show.getSeasons();
                assertThat(seasons).hasSize(12);

                Season firstSeason = seasons.get(0);
                assertThat(firstSeason.getEpisodes()).hasSize(7);

                Episode firstEpisode = firstSeason.getEpisodes().get(0);
                assertThat(firstEpisode.getAirtime().toString()).startsWith("Sun Jan 31");
                assertThat(firstEpisode.getDescription()).startsWith("After Peter heavily drinks at a bachelor party");
                assertThat(firstEpisode.getNumber()).isEqualTo(1);
                assertThat(firstEpisode.getTitle()).isEqualTo("Death has a Shadow");
            }
        });

    }

    @Test
    public void parseUpdatesForEpisode() throws ParserConfigurationException, SAXException, IOException, ParseException {

        running(fakeApplication(inMemoryDatabase()), new Runnable() {
            public void run() {

                createFakeShow();
                List<Show> shows = null;
                try {
                    TvdbProvider tvdbProvider = mock(TvdbProvider.class);
                    when(tvdbProvider.fetchUpdates()).thenReturn(parseXmlFile("test/test/data/updates_day_episode.xml"));
                    when(tvdbProvider.fetchEpisode(TVDB_ID_EPISODE)).thenReturn(parseXmlFile(String.format("test/test/data/%s.xml", TVDB_ID_EPISODE)));

                    TvdbParser tvdbParser = new TvdbParser(tvdbProvider, true);
                    shows = tvdbParser.parseUpdates();
                } catch (Exception e) {
                    assertThat(true).overridingErrorMessage("Something went wrong while parsing the test tvdb data").isFalse();
                }

                assertThat(shows).hasSize(1);

                Show show = shows.get(0);
                assertThat(show.getTitle()).isEqualTo("Family Guy");

                List<Season> seasons = show.getSeasons();
                assertThat(seasons).hasSize(1);

                Season eigthSeason = seasons.get(0);
                assertThat(eigthSeason.getNumber()).isEqualTo(8);
                assertThat(eigthSeason.getEpisodes()).hasSize(1);

                Episode firstEpisode = eigthSeason.getEpisodes().get(0);
                assertThat(firstEpisode.getAirtime().toString()).startsWith("Sun Jan 31");
                assertThat(firstEpisode.getDescription()).startsWith("Brian gets a gig writing for a teen magazine");
                assertThat(firstEpisode.getNumber()).isEqualTo(11);
                assertThat(firstEpisode.getTitle()).isEqualTo("Dial Meg for Murder");
            }
        });

    }

}


text:
using System;

namespace XenAdmin
{
    public static class StringExtensions
    {

        /// <summary>
        /// Ellipsise string by appending the ellipsis - no truncation is performed
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public static string AddEllipsis(this string input)
        {
            return String.Concat(input, Messages.ELLIPSIS);
        }

        /// <summary>
        /// If input is longer than maxLength, returns a string of length maxLength consisting of a truncated
        /// version of the input string with an i18n'd ellipsis character appended. Otherwise returns input.
        /// </summary>
        /// <param name="input">May be null, in which case the empty string is returned.</param>
        /// <param name="maxLength">Must be >= Messages.ELLIPSIS.Length.</param>
        /// <returns></returns>
        public static string Ellipsise(this string input, int maxLength)
        {
            if (maxLength < Messages.ELLIPSIS.Length)
                return ".";
            if (input == null)
                return "";
            if (input.Length < maxLength)
                return input;
            else
                return input.Truncate(maxLength - Messages.ELLIPSIS.Length) + Messages.ELLIPSIS;
        }

        /// <summary>
        /// Truncate string to a fixed number of characters, but not cutting it in the middle of a UTF-16 surrogate pair:
        /// shorten it by one if necessary. The "number of characters" is actually "number of UTF-16 double bytes", not
        /// the number of true Unicode characters. In other words, this a safe replacement for s.Substring(0, len).
        /// </summary>
        /// <reference>CA-89876</reference>
        /// <param name="s">The string to be truncated</param>
        /// <param name="len">The length of the resultant string</param>
        /// <returns>A truncated copy of the string</returns>
        public static string Truncate(this string s, int len)
        {
            if (len > 0 && Char.IsSurrogatePair(s, len - 1))
                return s.Substring(0, len - 1);
            else
                return s.Substring(0, len);
        }

        /// <summary>
        /// Escapes ampersands by doubling them up. Will return null if passed null.
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public static string EscapeAmpersands(this string s)
        {
            if (s == null)
                return null;
            else
                return s.Replace("&", "&&");
        }

        public static string EscapeQuotes(this string s)
        {
            return s == null ? null : s.Replace("\"", "\"\"");
        }

        /// <summary>
        /// Surround a string with a given character
        /// </summary>
        /// <param name="s"></param>
        /// <param name="c"></param>
        /// <returns></returns>
        public static string SurroundWith(this string s, char c)
        {
            if (s == null)
            {
                return null;
            }

            return c + s + c;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package nl.xillio.xill.components.expressions.pipeline;

import nl.xillio.xill.api.Debugger;
import nl.xillio.xill.api.components.*;
import nl.xillio.xill.components.expressions.FunctionParameterExpression;
import nl.xillio.xill.components.instructions.FunctionDeclaration;

import java.util.Collections;

/**
 * This class represents the implementation of the foreach function. This function will apply a function to every element
 * in an iterable argument and return nothing.
 *
 * @author Thomas Biesaart
 * @author Andrea Parrilli
 */
public class ForeachTerminalExpression extends AbstractPipelineTerminalExpression implements FunctionParameterExpression {
    private FunctionDeclaration function;

    public ForeachTerminalExpression(Processable input) {
        super(input);
    }

    @Override
    protected MetaExpression reduce(MetaExpression inputValue, Debugger debugger) {
        // Create the iterator
        try (WrappingIterator iterator = iterate(inputValue)) {

            // Walk the iterator
            while (iterator.hasNext()) {
                InstructionFlow<MetaExpression> result = function.run(debugger, Collections.singletonList(iterator.next()));
                if (result.hasValue() && !result.get().isDisposalPrevented()) {
                    result.get().registerReference();
                    result.get().releaseReference();
                }
            }

            // Return the result
            return ExpressionBuilder.NULL;
        }
    }

    @Override
    public void setFunction(FunctionDeclaration function) {
        this.function = function;
    }
}


text:
using System.Data.Entity;

namespace SocialApi.Models
{
  public class SocializeContext : DbContext
  {
    //public SchoolDBContext(): base("SchoolDBConnectionString")
    //    {
    //  Database.SetInitializer<SchoolDBContext>(new CreateDatabaseIfNotExists<SchoolDBContext>());

    //  //Database.SetInitializer<SchoolDBContext>(new DropCreateDatabaseIfModelChanges<SchoolDBContext>());
    //  //Database.SetInitializer<SchoolDBContext>(new DropCreateDatabaseAlways<SchoolDBContext>());
    //  //Database.SetInitializer<SchoolDBContext>(new SchoolDBInitializer());
    //}
    //public DbSet<Student> Students { get; set; }
    //public DbSet<Standard> Standards { get; set; }

    public SocializeContext() :
      base("DefaultConnection"){   }

    public DbSet<Article> Articles { get; set; }
    public DbSet<Connection> Connections { get; set; }
    public DbSet<Invite> Invites { get; set; }
    public DbSet<Rate> Rates { get; set; }
    public DbSet<Profile> Profiles { get; set; }
    public DbSet<Status> Statuses { get; set; }
    public DbSet<Comment> Comments { get; set; }

    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
      //base.OnModelCreating(modelBuilder);
      //modelBuilder.Entity<Student>()
      //           .HasRequired<Standard>(s => s.Standard)
      //           .WithMany(s => s.Students)
      //           .HasForeignKey(s => s.StdId);

      //one-to-many
      //modelBuilder.Entity<Standard>()
      //            .HasMany<Student>(s => s.Students)
      //            .WithRequired(s => s.Standard)
      //            .HasForeignKey(s => s.StdId);

      //one-to-many
      //modelBuilder.Entity<Student>()
      //            .HasOptional<Standard>(s => s.Standard)
      //            .WithMany(s => s.Students)
      //            .HasForeignKey(s => s.StdId);

      //modelBuilder.Entity<Student>()
      //            .HasMany<Course>(s => s.Courses)
      //            .WithMany(c => c.Students)
      //            .Map(cs =>
      //            {
      //              cs.MapLeftKey("StudentRefId");
      //              cs.MapRightKey("CourseRefId");
      //              cs.ToTable("StudentCourse");
      //            });

      //modelBuilder.Configurations.Add(new StudentEntityConfiguration());

    }
  }

  //public class StudentEntityConfiguration : EntityTypeConfiguration<Student>
  //{
  //  public StudentEntityConfiguration()
  //  {

  //    this.ToTable("StudentInfo");

  //    this.HasKey<int>(s => s.StudentKey);

  //    this.Property(p => p.DateOfBirth)
  //            .HasColumnName("DoB")
  //            .HasColumnOrder(3)
  //            .HasColumnType("datetime2");

  //    this.Property(p => p.StudentName)
  //            .HasMaxLength(50);

  //    this.Property(p => p.StudentName)
  //            .IsConcurrencyToken();

  //    this.HasMany<Course>(s => s.Courses)
  //       .WithMany(c => c.Students)
  //       .Map(cs =>
  //       {
  //         cs.MapLeftKey("StudentId");
  //         cs.MapRightKey("CourseId");
  //         cs.ToTable("StudentCourse");
  //       });
  //  }
  //}
}


text:
package com.hotfixs.thinkinginjava.containers.tester;

/**
 * @author Junwei Wang (i.junwei.wang@gmail.com)
 */
public class TestParam {
    public final int size;
    public final int loops;

    public TestParam(int size, int loops) {
        this.size = size;
        this.loops = loops;
    }

    public static TestParam[] array(int... values) {
        int size = values.length / 2;
        TestParam[] result = new TestParam[size];

        int n = 0;
        for (int i = 0; i < size; i++) {
            result[i] = new TestParam(values[n++], values[n++]);
        }

        return result;
    }

    public static TestParam[] array(String[] values) {
        int[] vals = new int[values.length];
        for (int i = 0; i < vals.length; i++) {
            vals[i] = Integer.parseInt(values[i]);
        }

        return array(vals);
    }

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta property="og:site_name" content="Eric Chung Design"/>
    <meta property="og:title" content="Freelance Graphic Designer"/>
    <meta property="og:description" content="Eric is a self-driven, creative designer, currently based in Ottawa, Ontario. Currently, he is expanding his portfolio by working with private clients as a freelance designer. His work ranges from creating logos from concept sketches to vector files, to designing print material for advertising, to improving the web by applying UI/UX principles."/>
    <meta property="og:image" content="img/about_header_saturated.jpg"/>
    <meta property="og:url" content="http://ericchungdesign.ca"/>
    <meta property="og:type" content="portfolio"/>

    <title>Eric Chung Design</title>

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

    <link href="../css/freelancer.css" rel="stylesheet">

    <link href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.2/normalize.min.css" rel="stylesheet">
    <link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>

PORTFOLIO

ABOUT

CONTACT

Bomber Social Night

Client: Taiwanese Waterloo Student Association

Year: 2014

Service: Graphic Design

                Description:

                Poster and Facebook banner design for Bomber Social Night, presented by the Taiwanese Waterloo Student Association.

                  View project on Behance

                      Previous Project

                      Next Project

Contact:
 hello@ericchungdesign.ca

Connect:

© Eric Chung Design 2016.

All Rights Reserved.


text:
Build process
* youtube-producer:
    * gulp needs to execute tests
    * (I)(U) browser needs to be updated after watch -> gulp tool browsersync: http://www.browsersync.io/docs/gulp/
* update angular bower dependencies to current versions
* integrate npm in sbt life cycle
https://github.com/sbt/sbt-web
https://github.com/sbt/sbt-js-engine
http://eng.kifi.com/hooking-in-to-play-frameworks-sbt-plugin-lifecycle/
http://typesafe.com/activator/template/angular-seed-play

Code
* default img in yt_resultItemTemplate.html
* solve errors on browser console

(I) important
(U) urgent


text:
  Merlieux-et-Fouquerolles est
       un village
       géographiquement positionné dans le département de l'Aisne en Picardie. On dénombrait 258 habitants en 2008.

À coté de Merlieux-et-Fouquerolles sont positionnées géographiquement les communes de
Wissignicourt à 4 km, 148 habitants,
Mons-en-Laonnois localisée à 4 km, 1 064 habitants,
Urcel à 4 km, 570 habitants,
Cessières située à 4 km, 437 habitants,
Bourguignon-sous-Montbavin localisée à 2 km, 128 habitants,
Chavignon localisée à 4 km, 742 habitants,
 entre autres. De plus, Merlieux-et-Fouquerolles est située à seulement 19 km de Soissons.

Le parc d'habitations, à Merlieux-et-Fouquerolles, se décomposait en 2011 en sept appartements et 102 maisons soit
 un marché relativement équilibré.

Si vous envisagez de venir habiter à Merlieux-et-Fouquerolles, vous pourrez aisément trouver une maison à acheter.


text:
function reducers(state = [], action) {

  switch (action.type) {

  case 'ADD_LANE':
    return [
      ...state,
      {
        id: action.id,
        title: action.title,
        cards: action.cards,
      },
    ];

  case 'UPDATE_LANE':
    return state.map(lane => {
      if (lane.id == action.id) {
        return Object.assign({}, lane,
          {
            title: action.title,
          });
      }
      return lane;
    });

  case 'DELETE_LANE':
    return state.filter(lane => lane.id !== action.id);

  case 'ADD_CARD':
    return state.map(lane => {
      if (lane.id == action.laneid) {
        action.card.id = action.cardid;
        return Object.assign({}, lane,
          {
            cards: [...lane.cards,
              action.card],
          });
      }
      return lane;
    });

  case 'UPDATE_CARD':

    return state.map(lane => {
      if (lane.id == action.laneid) {
        const newCards = lane.cards.map(card => {
          if (card.id == action.card.id) {
            return action.card;
          }
          return card;
        });
        return Object.assign({}, lane,
          {
            cards: newCards,
          });
      }
      return lane;
    });

  case 'DELETE_CARD':
    return state.map(lane => {
      if (lane.id == action.laneid) {
        lane.cards = lane.cards.filter(card => card.id !== action.id);
      }
      return lane;
    });

  case 'ADD_LABEL':
    return state.map(lane => {
      if (lane.id == action.laneid) {
        const newCards = lane.cards.map(card => {
          if (card.id == action.cardid) {
            const newLabels = [...card.labels, action.label];
            return Object.assign({}, card,
              {
                labels: newLabels,
              });
          }
          return card;
        });
        return Object.assign({}, lane,
          {
            cards: newCards,
          });
      }
      return lane;
    });

  case 'DELETE_LABEL':
    return state.map(lane => {
      if (lane.id == action.laneid) {
        const newCards = lane.cards.map(card => {
          if (card.id == action.cardid) {
            const newLabels = card.labels.filter(label =>
            label.id != action.labelid);

            return Object.assign({}, card,
              {
                labels: newLabels,
              });
          }
          return card;
        });
        return Object.assign({}, lane,
          {
            cards: newCards,
          });
      }
      return lane;
    });

  default:
    return state;
  }
}

export default reducers;


text:
\hypertarget{dir_1b8e54fdf747a77fb031eca65abb08f9}{\section{src Directory Reference}
\label{dir_1b8e54fdf747a77fb031eca65abb08f9}\index{src Directory Reference@{src Directory Reference}}
}
\subsection*{Files}
\begin{DoxyCompactItemize}
\item
file {\bfseries board.\-cpp}
\item
file {\bfseries board.\-h}
\item
file {\bfseries pvcanvas.\-cpp}
\item
file {\bfseries pvcanvas.\-h}
\item
file {\bfseries shape.\-cpp}
\item
file {\bfseries shape.\-h}
\item
file {\bfseries tcanvas.\-cpp}
\item
file {\bfseries tcanvas.\-h}
\item
file {\bfseries tmain.\-cpp}
\item
file {\bfseries tmain.\-h}
\item
file {\bfseries tutils.\-h}
\end{DoxyCompactItemize}


text:
import { IDeploymentStrategy } from '@spinnaker/core';

export const strategyNone: IDeploymentStrategy = {
  label: 'None',
  description: 'Creates the new ReplicaSet with no impact on existing ReplicaSets in the cluster',
  key: null,
  providerRestricted: false,
};


text:
using UnityEngine;
using System;
using LuaInterface;
using SLua;
using System.Collections.Generic;
public class Lua_UnityEngine_GUITexture : LuaObject {
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.GUITexture o;
			o=new UnityEngine.GUITexture();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_color(IntPtr l) {
		try {
			UnityEngine.GUITexture self=(UnityEngine.GUITexture)checkSelf(l);
			pushValue(l,true);
			pushValue(l,self.color);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_color(IntPtr l) {
		try {
			UnityEngine.GUITexture self=(UnityEngine.GUITexture)checkSelf(l);
			UnityEngine.Color v;
			checkType(l,2,out v);
			self.color=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_texture(IntPtr l) {
		try {
			UnityEngine.GUITexture self=(UnityEngine.GUITexture)checkSelf(l);
			pushValue(l,true);
			pushValue(l,self.texture);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_texture(IntPtr l) {
		try {
			UnityEngine.GUITexture self=(UnityEngine.GUITexture)checkSelf(l);
			UnityEngine.Texture v;
			checkType(l,2,out v);
			self.texture=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_pixelInset(IntPtr l) {
		try {
			UnityEngine.GUITexture self=(UnityEngine.GUITexture)checkSelf(l);
			pushValue(l,true);
			pushValue(l,self.pixelInset);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_pixelInset(IntPtr l) {
		try {
			UnityEngine.GUITexture self=(UnityEngine.GUITexture)checkSelf(l);
			UnityEngine.Rect v;
			checkValueType(l,2,out v);
			self.pixelInset=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_border(IntPtr l) {
		try {
			UnityEngine.GUITexture self=(UnityEngine.GUITexture)checkSelf(l);
			pushValue(l,true);
			pushValue(l,self.border);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_border(IntPtr l) {
		try {
			UnityEngine.GUITexture self=(UnityEngine.GUITexture)checkSelf(l);
			UnityEngine.RectOffset v;
			checkType(l,2,out v);
			self.border=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	static public void reg(IntPtr l) {
		getTypeTable(l,"UnityEngine.GUITexture");
		addMember(l,"color",get_color,set_color,true);
		addMember(l,"texture",get_texture,set_texture,true);
		addMember(l,"pixelInset",get_pixelInset,set_pixelInset,true);
		addMember(l,"border",get_border,set_border,true);
		createTypeMetatable(l,constructor, typeof(UnityEngine.GUITexture),typeof(UnityEngine.GUIElement));
	}
}


text:
/**
 *
 */
package org.hamster.weixinmp.dao.repository.resp;

import org.hamster.weixinmp.dao.entity.resp.WxRespVideoEntity;
import org.springframework.data.repository.PagingAndSortingRepository;

/**
 * @author honey.zhao@aliyun.com
 * @version Jul 28, 2013
 *
 */
public interface WxRespVideoDao extends PagingAndSortingRepository<WxRespVideoEntity, Long> {
}


text:
% Copyright (C) 2008-2010 Rosen Diankov
%
% 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.
more off;
addopenravepaths_graspplanning();

global probs
orEnvSetOptions('debug 4');

scenefile = 'data/lab1.env.xml';
grasptablefile = '../grasping/grasptables/grasp_barrett_mug1.mat';
[robot, scenedata] = SetupSceneFromGraspTables(scenefile,grasptablefile);

armjoints = robot.manips{robot.activemanip}.armjoints;
handjoints = robot.manips{robot.activemanip}.handjoints;
wristlinkid = robot.manips{robot.activemanip}.eelink;

orProblemSendCommand('releaseall',probs.manip);
RobotGoInitial(robot,scenedata.home);

squeeze = [];
MySwitchModels = @(x) 1;
SwitchModelPatterns = {};

while(1)
    curobj = scenedata.targetobjs{floor(length(scenedata.targetobjs)*rand*0.9999+1)};
    curobj.grasps = scenedata.GraspTable;
    curobj.dests = scenedata.dests;

    orProblemSendCommand('releaseall',probs.manip);
    [graspsuccess, full_solution_index] = GraspAndPlaceObject(robot, curobj, squeeze, MySwitchModels,SwitchModelPatterns);
    WaitForRobot(robot.id);
    if( ~graspsuccess )
        warning('failed grasp');
        continue;
    end
end


text:
//
//  MBMLFontFunctionTests.m
//  Mockingbird Data Environment Unit Tests
//
//  Created by Evan Coyne Maloney on 1/23/15.
//  Copyright (c) 2015 Gilt Groupe. All rights reserved.
//

#import "MBDataEnvironmentTestSuite.h"

#if MB_BUILD_UIKIT

/******************************************************************************/
#pragma mark -
#pragma mark MBMLFontFunctionTests class
/******************************************************************************/

@interface MBMLFontFunctionTests : MBDataEnvironmentTestSuite
@end

@implementation MBMLFontFunctionTests

/*
    <Function class="MBMLFontFunctions" name="fontFamilyNames" input="none"/>
    <Function class="MBMLFontFunctions" name="fontNamesForFamilyName" input="string"/>
    <Function class="MBMLFontFunctions" name="fontWithNameAndSize" input="pipedObjects"/>
    <Function class="MBMLFontFunctions" name="sizeOfTextWithFont" input="pipedObjects"/>
    <Function class="MBMLFontFunctions" name="linesNeededToDrawText" input="pipedExpressions"/>
    <Function class="MBMLFontFunctions" name="stringWidth" input="pipedObjects"/>
 */
- (void) testFontFamilyNames
{
    MBLogInfoTrace();

    // although the font families may differ between devices and OS
    // versions, there are a few common ones we can test for
    // although unlikely, we will need to change this list if any
    // of these fonts are removed from a future version of iOS
    NSArray* expectedFonts = @[@"Courier New",
                               @"Times New Roman",
                               @"Copperplate",
                               @"Symbol",
                               @"Helvetica",
                               @"Courier"];

    NSArray* fontFamilies = [MBExpression asObject:@"^fontFamilyNames()"];
    XCTAssertNotNil(fontFamilies);
    XCTAssertTrue([fontFamilies isKindOfClass:[NSArray class]]);
    XCTAssertTrue(fontFamilies.count >= expectedFonts.count);

    NSSet* familySet = [NSSet setWithArray:fontFamilies];
    for (NSString* name in expectedFonts) {
        XCTAssertTrue([familySet containsObject:name]);
    }
}

- (void) testFontNamesForFamilyName
{
    MBLogInfoTrace();

    // it is possible that some of the fonts for Helvetica may
    // change, but since these are already present, I doubt
    // they will be removed
    NSArray* expectedFonts = @[@"Helvetica-Bold",
                               @"Helvetica",
                               @"Helvetica-LightOblique",
                               @"Helvetica-Oblique",
                               @"Helvetica-BoldOblique",
                               @"Helvetica-Light"];

    NSArray* fontNames = [MBExpression asObject:@"^fontNamesForFamilyName(Helvetica)"];
    XCTAssertNotNil(fontNames);
    XCTAssertTrue([fontNames isKindOfClass:[NSArray class]]);
    XCTAssertTrue(fontNames.count >= expectedFonts.count);

    NSSet* fontSet = [NSSet setWithArray:fontNames];
    for (NSString* name in expectedFonts) {
        XCTAssertTrue([fontSet containsObject:name]);
    }
}

- (void) _testFontWithName:(NSString*)fontName pointSize:(CGFloat)pointSize
{
    NSString* expr = [NSString stringWithFormat:@"^fontWithNameAndSize(%@|%g)", fontName, pointSize];
    UIFont* font = [expr evaluateAsObject];

    XCTAssertNotNil(font);
    XCTAssertTrue([font isKindOfClass:[UIFont class]]);
    XCTAssertEqualObjects(font.fontName, fontName);
    XCTAssertEqual(font.pointSize, pointSize);
}

- (void) testFontWithNameAndSize
{
    MBLogInfoTrace();

    // make sure we can get UIFont instances for a few common things
    [self _testFontWithName:@"Helvetica" pointSize:14];
    [self _testFontWithName:@"Helvetica-Bold" pointSize:24];
    [self _testFontWithName:@"Helvetica-Light" pointSize:18.5];
}

- (void) _testSizeOfText:(NSString*)text withFont:(NSString*)fontName pointSize:(CGFloat)pointSize expectedSize:(CGSize)expectedSize
{
    NSString* expr = [NSString stringWithFormat:@"^sizeOfTextWithFont(%@|%@|%g)", text, fontName, pointSize];
    NSString* sizeStr = [expr evaluateAsString];
    XCTAssertNotNil(sizeStr);

    CGSize size = [MBStringConversions sizeFromString:sizeStr];
    XCTAssertFalse(CGSizeEqualToSize(size, CGSizeZero));

    // we apply the accuracy tests because font metrics have been known
    // to change slightly between OS versions
    XCTAssertEqualWithAccuracy(size.width, expectedSize.width, expectedSize.width * 0.01);
    XCTAssertEqualWithAccuracy(size.height, expectedSize.height, expectedSize.height * 0.01);

    // test the alternate way of using this method to ensure we're
    // getting the same results
    NSString* altExpr = [NSString stringWithFormat:@"^sizeOfTextWithFont(%@|^fontWithNameAndSize(%@|%g))", text, fontName, pointSize];
    NSString* altSizeStr = [altExpr evaluateAsString];
    XCTAssertEqualObjects(sizeStr, altSizeStr);
}

- (void) testSizeOfTextWithFont
{
    [self _testSizeOfText:@"Size me up" withFont:@"Helvetica" pointSize:14 expectedSize:(CGSize){70.0342, 16.1}];
    [self _testSizeOfText:@"A different test" withFont:@"Helvetica-Bold" pointSize:20 expectedSize:(CGSize){140.391, 23}];
}

- (void) _testLinesNeededToDrawText:(NSString*)text withFont:(NSString*)fontName pointSize:(CGFloat)pointSize width:(CGFloat)width minLines:(NSUInteger)minLines maxLines:(NSUInteger)maxLines
{
    NSString* expr = [NSString stringWithFormat:@"^linesNeededToDrawText(%@|%@|%g|%g)", text, fontName, pointSize, width];
    NSNumber* linesNum = [expr evaluateAsNumber];
    XCTAssertNotNil(linesNum);
    NSUInteger lines = [linesNum unsignedIntegerValue];

    // font sizes can change over time, and we've had to adjust this
    // number several times as that happens to fix breaking tests.
    // so now, we'll test for a range of values instead
    XCTAssertGreaterThanOrEqual(lines, minLines);
    XCTAssertLessThanOrEqual(lines, maxLines);

    // test the alternate way of using this method to ensure we're
    // getting the same results
    NSString* altExpr = [NSString stringWithFormat:@"^linesNeededToDrawText(%@|^fontWithNameAndSize(%@|%g)|%g)", text, fontName, pointSize, width];
    NSNumber* altLinesNum = [altExpr evaluateAsNumber];
    XCTAssertEqualObjects(linesNum, altLinesNum);
}

- (void) testLinesNeededToDrawText
{
    MBLogInfoTrace();

    [self _testLinesNeededToDrawText:@"This is my argument" withFont:@"Helvetica-Bold" pointSize:18 width:150 minLines:2 maxLines:2];
    [self _testLinesNeededToDrawText:@"This is my argument\nThis is my argument\nThis is my argument\nThis is my argument" withFont:@"Helvetica-Oblique" pointSize:64 width:500 minLines:7 maxLines:10];
}

- (void) _testStringWidthForText:(NSString*)text withFont:(NSString*)fontName pointSize:(CGFloat)pointSize expectedWidth:(CGFloat)expectedWidth
{
    NSString* expr = [NSString stringWithFormat:@"^stringWidth(%@|%@|%g)", text, fontName, pointSize];
    NSNumber* widthNum = [expr evaluateAsNumber];
    XCTAssertNotNil(widthNum);

    CGFloat width = [widthNum doubleValue];
    XCTAssertTrue(width > 0);

    // we apply the accuracy tests because font metrics have been known
    // to change slightly between OS versions
    XCTAssertEqualWithAccuracy(width, expectedWidth, expectedWidth * 0.01);

    // test the alternate way of using this method to ensure we're
    // getting the same results
    NSString* altExpr = [NSString stringWithFormat:@"^stringWidth(%@|^fontWithNameAndSize(%@|%g))", text, fontName, pointSize];
    NSNumber* altWidthNum = [altExpr evaluateAsNumber];
    XCTAssertEqualObjects(widthNum, altWidthNum);
}

- (void) testStringWidth
{
    MBLogInfoTrace();

    [self _testStringWidthForText:@"What's the deal with airline peanuts?" withFont:@"Helvetica" pointSize:17 expectedWidth:276.349609375];
    [self _testStringWidthForText:@"same as it ever was \n same as it ever was" withFont:@"Helvetica-BoldOblique" pointSize:14 expectedWidth:134.647460938];
}

@end

#endif


text:
from .users import set_user  # noqa
from .project import config_project  # noqa
from .ssl import config_ssl  # noqa


text:
namespace Castle.DynamicProxy
{
	using System;
	using System.Diagnostics;
	using System.Reflection;
	using System.Runtime.Serialization;
	using Castle.DynamicProxy.Serialization;

#if DOTNET40
	using System.Security;
#endif

#if SILVERLIGHT
	public abstract class AbstractInvocation : IInvocation
#else
	[Serializable]
    [DebuggerStepThrough]
	public abstract class AbstractInvocation : IInvocation, ISerializable
#endif
	{
		private readonly IInterceptor[] interceptors;
		private readonly object[] arguments;
		private int currentInterceptorIndex = -1;
		private Type[] genericMethodArguments;
		private readonly MethodInfo proxiedMethod;
		protected readonly object proxyObject;

		protected AbstractInvocation(
			object proxy,
			IInterceptor[] interceptors,
			MethodInfo proxiedMethod,
			object[] arguments)
		{
			Debug.Assert(proxiedMethod != null);
			proxyObject = proxy;
			this.interceptors = interceptors;
			this.proxiedMethod = proxiedMethod;
			this.arguments = arguments;
		}

		protected AbstractInvocation(
			object proxy,
			Type targetType,
			IInterceptor[] interceptors,
			MethodInfo proxiedMethod,
			object[] arguments,
			IInterceptorSelector selector,
			ref IInterceptor[] methodInterceptors)
			: this(proxy, interceptors, proxiedMethod, arguments)
		{
			methodInterceptors = SelectMethodInterceptors(selector, methodInterceptors, targetType);
			this.interceptors = methodInterceptors;
		}

		private IInterceptor[] SelectMethodInterceptors(IInterceptorSelector selector,
		                                                IInterceptor[] methodInterceptors,
		                                                Type targetType)
		{
			return methodInterceptors ??
			       selector.SelectInterceptors(targetType, Method, interceptors) ??
			       new IInterceptor[0];
		}

		public void SetGenericMethodArguments(Type[] arguments)
		{
			genericMethodArguments = arguments;
		}

		public abstract object InvocationTarget { get; }

		public abstract Type TargetType { get; }

		public abstract MethodInfo MethodInvocationTarget { get; }

		public Type[] GenericArguments
		{
			get { return genericMethodArguments; }
		}

		public object Proxy
		{
			get { return proxyObject; }
		}

		public MethodInfo Method
		{
			get { return proxiedMethod; }
		}

		public MethodInfo GetConcreteMethod()
		{
			return EnsureClosedMethod(Method);
		}

		public MethodInfo GetConcreteMethodInvocationTarget()
		{
			// it is ensured by the InvocationHelper that method will be closed
			var method = MethodInvocationTarget;
			Debug.Assert(method == null || method.IsGenericMethodDefinition == false,
			             "method == null || method.IsGenericMethodDefinition == false");
			return method;
		}

		public object ReturnValue { get; set; }

		public object[] Arguments
		{
			get { return arguments; }
		}

		public void SetArgumentValue(int index, object value)
		{
			arguments[index] = value;
		}

		public object GetArgumentValue(int index)
		{
			return arguments[index];
		}

        [DebuggerHidden]
        [DebuggerStepThrough]
		public void Proceed()
		{
			if (interceptors == null)
				// not yet fully initialized? probably, an intercepted method is called while we are being deserialized
			{
				InvokeMethodOnTarget();
				return;
			}

			currentInterceptorIndex++;
			try
			{
				if (currentInterceptorIndex == interceptors.Length)
				{
					InvokeMethodOnTarget();
				}
				else if (currentInterceptorIndex > interceptors.Length)
				{
					string interceptorsCount;
					if (interceptors.Length > 1)
					{
						interceptorsCount = " each one of " + interceptors.Length + " interceptors";
					}
					else
					{
						interceptorsCount = " interceptor";
					}

					var message = "This is a DynamicProxy2 error: invocation.Proceed() has been called more times than expected." +
					              "This usually signifies a bug in the calling code. Make sure that" + interceptorsCount +
					              " selected for the method '" + Method + "'" +
					              "calls invocation.Proceed() at most once.";
					throw new InvalidOperationException(message);
				}
				else
				{
					interceptors[currentInterceptorIndex].Intercept(this);
				}
			}
			finally
			{
				currentInterceptorIndex--;
			}
		}

#if !SILVERLIGHT
#if DOTNET40
		[SecurityCritical]
#endif
		public void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			info.SetType(typeof(RemotableInvocation));
			info.AddValue("invocation", new RemotableInvocation(this));
		}
#endif

		protected abstract void InvokeMethodOnTarget();

		protected void ThrowOnNoTarget()
		{
			// let's try to build as friendly message as we can
			string interceptorsMessage;
			if (interceptors.Length == 0)
			{
				interceptorsMessage = "There are no interceptors specified";
			}
			else
			{
				interceptorsMessage = "The interceptor attempted to 'Proceed'";
			}

			string methodKindIs;
			string methodKindDescription;
			if (Method.DeclaringType.IsClass && Method.IsAbstract)
			{
				methodKindIs = "is abstract";
				methodKindDescription = "an abstract method";
			}
			else
			{
				methodKindIs = "has no target";
				methodKindDescription = "method without target";
			}

			var message = string.Format("This is a DynamicProxy2 error: {0} for method '{1}' which {2}. " +
			                            "When calling {3} there is no implementation to 'proceed' to and " +
			                            "it is the responsibility of the interceptor to mimic the implementation " +
			                            "(set return value, out arguments etc)",
			                            interceptorsMessage, Method, methodKindIs, methodKindDescription);

			throw new NotImplementedException(message);
		}

		private MethodInfo EnsureClosedMethod(MethodInfo method)
		{
			if (method.ContainsGenericParameters)
			{
				Debug.Assert(genericMethodArguments != null);
				return method.GetGenericMethodDefinition().MakeGenericMethod(genericMethodArguments);
			}
			return method;
		}
	}
}


text:
Captura de Reposiciones

                Producto
                Componente
                Fecha de Creacion

                {{detalle.Producto}}
                {{detalle.Componente}}
                {{detalle.FechaCreacion}}

                    <button type="button" ng-click="selectComponente(detalle.IdComponente); saveReposicion($index,10);" class="btn btn-info btn-sm">

                    </button>


text:
<TITLE>Review for Mission: Impossible II (2000)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Mission: Impossible II (2000)

reviewed by
Shay Casey

**1/2 out of ****

Year: 2000. Starring Tom Cruise, Thandie Newton, Dougray Scott, Ving
Rhames, Richard Roxburgh, John Polson, Brendan Gleeson, Rade Serbedzija,
Anthony Hopkins. Written by Ronald D. Moore & Brannon Braga (story) and
Robert Towne (screenplay). Directed by John Woo. Rated PG-13.

Now here's a curious beast: A film that's equal parts tedious and
exhilarating, partially absorbed in its own self-importance, but also
possessing moments of pure, unpretentious exuberance. That's what
happens when an acclaimed action director (John Woo) meets crass
Hollywood commercialism (personified by *producer* Tom Cruise).
"Mission: Impossible 2" bogs itself down as a star vehicle and glamour
project, but succeeds when egos get out of the way and allow Woo to work
his special kind of magic. It's enjoyable once it gets to the good
stuff, but the good stuff only takes up about half of the running time.

Cruise returns in his role as Ethan Hunt, super-secret agent for the
mysterious IMF agency. He's called in to deal with a new crisis: Sean
Ambrose (Dougray Scott), a former IMF operative, is attempting to steal
both a new deadly virus and its only known cure. After releasing the
virus to the public, he will make millions by investing in the only
company producing the antidote. The plan is for Hunt to recruit one of
Ambrose's old flames, Nyah Nordoff-Hall (Thandie Newton), professional
thief and sexy love interest, to spy on the disgruntled former employee.
Unfortunately, Hunt has fallen into a romantic relationship with Nyah,
and is therefore reluctant to send her into dangerous situations.

Most of the setup is fairly laborious, with an exciting opening scene
aboard a plane giving way to long, dull passages of exposition and a
tedious romantic dalliance for Cruise and Newton. You can see the
problems coming quickly: The script has been written in just such a way
so that even the biggest idiot in the house will be able to understand
what's going on. That means every time something is *shown* to us, it
must also be *told* to us. I don't understand why this had to be done;
Woo is a good enough director to indicate things to the audience. We
don't need a shot of Newton entering a house and then a character
saying, "She's in the house now."

The romantic relationship is set up in a ridiculous slow-motion car
chase scene: They hate each other, get into a car crash, and then sleep
with each other-just your standard action movie logic. I didn't find the
romance at all credible, despite Woo's best efforts to spice up the
proceedings. (I did like the scene with Cruise and Newton gazing at each
other through the dress of a salsa dancer.) Then after Cruise gets some
booty, the movie shuttles Newton off into support mode, revealing that
all her thief skills won't be necessary; she's just supposed to be a
front for the main man. You can tell this was Cruise's pet project
because other characters are dashed off every time Tom wants to preen.
Ving Rhames and Richard Roxburgh are brought in as Hunt's presumably
skilled associates, then mainly stand around giving reasons why they
can't help him at the crucial moment. That's too bad, because I wanted
to see more of these guys. They're interesting characters; why not give
them more screen time? Ms. Newton, meanwhile, is an absolutely gorgeous
woman with tremendous screen presence and a lovely
can't-quite-tell-what-race-she-is look that can't be manufactured. But
she disappears for long stretches while Cruise shows off his pecs and
flicks his hair. Again, too bad.

That's not to say there isn't fun stuff. There's fun stuff. The ending
motorcycle chase scene is fun. The spycraft stuff, with earpieces,
interceptions, and fancy Macintosh laptops, is fun. Slow motion gun
battles are fun. The movie does come down with Invincible Villain
Syndrome at the end (a Woo trademark that has always annoyed me), but
the second half of "Mission: Impossible 2" does seem remarkably less
tedious than the first-no surprise, because it's at about the halfway
point that the script gets out of the way and lets Woo's action set
pieces take over. But it's not only action scenes that have driven
previous Woo films to success. His most successful American release,
"Face/Off," had a human interest story at the center of the outrageous
action. "Mission: Impossible 2," by contrast, barely has time for
characters. Cruise is too busy posing to play a character, and the other
actors have been shoved aside to make room for more of his posing.
Consequently, all hopes for a great, well-rounded film have been dashed
because of a star's ego.

Ultimately, there's a question one must ask when a film has fun action
scenes conflicting with a lame script: Is the action good enough to make
you forget about the other stuff? For me, for this movie, it wasn't.
Maybe Tom Cruise felt he had the right to indulge himself in 2000 after
delivering two of the least narcissistic performances of his career in
1999. In "Eyes Wide Shut" and "Magnolia," Cruise put his ego aside and
deferred to two directors he respected, Stanley Kubrick and Paul Thomas
Anderson. Why couldn't he have done the same for John Woo? Where
Cruise's deference helped elevate his previous two films to artistic
heights, his egotism has deflated his latest.

-reviewed by Shay Casey

For more reviews, go to http://www.geocities.com/sycasey/movies.html

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
set -e
set -x

source tensorflow/tools/ci_build/release/common.sh
install_bazelisk

# Install pip dependencies
install_macos_pip_deps sudo pip3.7

# For python3 path on Mac
export PATH=$PATH:/usr/local/bin

# Export required variables for running pip.sh
export OS_TYPE="MACOS"
export CONTAINER_TYPE="CPU"
export TF_PYTHON_VERSION='python3.7'

# Run configure.
export TF_NEED_CUDA=0
export CC_OPT_FLAGS='-mavx'
export PYTHON_BIN_PATH=$(which ${TF_PYTHON_VERSION})
yes "" | "$PYTHON_BIN_PATH" configure.py

# Export optional variables for running pip.sh
export TF_BUILD_FLAGS="--config=opt"
export TF_TEST_FLAGS="--define=no_tensorflow_py_deps=true --test_lang_filters=py --test_output=errors --verbose_failures=true --keep_going"
export TF_TEST_TARGETS="//tensorflow/python/..."
export TF_PIP_TESTS="test_pip_virtualenv_non_clean test_pip_virtualenv_clean"
export TF_TEST_FILTER_TAGS='-nomac,-no_mac,-no_oss,-oss_serial'
export IS_NIGHTLY=0 # Not nightly
export TF_PROJECT_NAME="tensorflow"
export TF_PIP_TEST_ROOT="pip_test"

./tensorflow/tools/ci_build/builds/pip_new.sh

# Copy and rename to tensorflow_cpu
for WHL_PATH in $(ls ${TF_PIP_TEST_ROOT}/whl/tensorflow*.whl); do
  copy_to_new_project_name "${WHL_PATH}" tensorflow_cpu
done


text:
var config = require('../config');

var Authorize = {

  setloginwindow : function ()
  {
    $("iframe").get(0).src = config.authurl + "login?response_type=token&state=xyz&client_id=" + config.appid + "&redirect_uri=" + origin() + "/auth.html";
  },

  hello : function ()
  {
    window.location = "/";
  },

  hasToken : function ()
  {
    // Authentication
    var token = window.localStorage.getItem('token');

    if(token && token.length > 9) this.hello();
    else
    {
      if(token) window.localStorage.removeItem('token');

      this.setloginwindow ();
      window.addEventListener("message", this.receiveToken.bind(this), false);
    }
  },

  receiveToken :function (event)
  {
    if (event.origin !== origin())
    return;

    if (event.data && event.data.length > 9)
    {
      window.localStorage.setItem('token', event.data);
      this.hello();
    }
    else this.setloginwindow();
  }
}

module.exports = Authorize;

/**
 * Origin function
 */
var origin = function ()
{
  return (window.location.origin) ? window.location.origin : window.location.protocol + "//" + window.location.hostname;
}


text:
package org.apache.camel.processor;

import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.Test;

/**
 * @version
 */
public class AOPBeforeTest extends ContextTestSupport {

    @Test
    public void testAOPBefore() throws Exception {
        getMockEndpoint("mock:before").expectedBodiesReceived("Hello World");
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Bye World");

        String out = template.requestBody("direct:start", "Hello World", String.class);
        assertEquals("Bye World", out);

        assertMockEndpointsSatisfied();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @SuppressWarnings("deprecation")
            @Override
            public void configure() throws Exception {
                from("direct:start")
                    .aop().before("mock:before")
                    .transform(constant("Bye World")).to("mock:result");
            }
        };
    }
}


text:
author: "Brandon Giesing"
title: "Casting to new heights! | Big CosiCast Update!"
description: "CosiCast is getting a major overhaul with some HUGE changes!"
draft: false
date: 2017-06-27T14:52:43Z
slug: "casting-to-new-heights-big-cosicast-update-2"
layout: blog
categories:
  - Announcements
  - CosiCast

---

{{< privacytube GGjEiO02ki4 >}}

## Redefining Current Shows

At the end of last year, I made some changes to CosiCast to divide my content up
into Shows based on the content.

These included:

* Shorties: Short random videos covering a range of things from music edits to
  memes.
* In 60 Seconds: A topic presented at a fast pace, visual only way! No text or
  talking, only images, videos, and music!
* Promo Promotions: Fan ads to promote Internet creators from YouTube, Twitch,
  and more!
* Fan Music Videos (aka FMVs): Music edits based on a topic or specific fandom
  using a full-length song.

You might have noticed here recently that I've done a lot of Shorties, very few
In 60 Seconds and FMVs, and no new Promo Promotions... You also might have
noticed that each type is very similar and doesn't have that clear of a divide.
Today I'm making some changes to simplify and enhance them.

### Shorties/In 60 Seconds

Shorties are going to stay mostly the same as it is now since it's pretty clear
what it is and I do a lot of them.  However, In 60 Seconds is gonna be merged
into Shorties as most of them weren't exactly 60 seconds and Shorties are also
usually about only 1 topic anyway as is.

The big difference here is actually a return of some older stuff! I used to do
more of the funny meme ones (like the Gravity Falls/Nostalgia Critic thing if
you remember that) but now it's all been music mashups basically. I'm going to
try and do more of the meme ones but don't worry, music ones are still going to
happen and they are likely going to be the majority still.

### Fan Music Videos (FMVs)

These are also going to be staying mostly the same as before with 2 big differences:

* Like Promo Promotions, I'm gonna be changing the Outro for these. Since they
  are Music Videos, I'm going to let the end of the music play over the outro
  instead of my normal Outro Music so it's not as jarring and they can be
  listened to like normal music videos which usually end when the song does.
* These are now going to be Vidme Exclusives! A big reason for this is since
  these rely on a full song, they are a lot more prone to DMCA/Music ID stuff
  than the small clips used in other videos. Also by moving these to Vidme, I
  can also open it up to more songs as I previously tried to only use
  royalty-free music for these because of the DMCA crap.

### Promo Promotions

The changes to Promo Promotions are going to be a bit later down in the post.
You'll see why shortly.

### Show Recap

So to recap all the changes above:

* Shorties stay mostly the same but brings back more meme-like ones
* In 60 Seconds is discontinued becomes a part of Shorties
* Fan Music Videos stay mostly the same and are becoming Vidme Exclusive
* Keep reading for Promo Promotions

--------------------------------------------------------------------------------

## New Shows

In addition to the changes to the existing shows to streamline them, I'm
introducing two new shows!

### Cosi Conversations

So do you remember back in April 2016 when I uploaded Episode 1 of a new series
called "The Weekly Prime" before I even made the above 4 shows and that I never
uploaded an episode 2 even though the show was supposed to be weekly? Do you
also remember Casting With Cosi which I launched in March and then basically did
the same thing? Yeah... so I kinda failed on that one!

Well, I'm bringing both back and merging them into a new show called Cosi
Conversations! Like CWC, it's going to be a full-on variety show instead of a
fast-paced video with 5 topics like TWP. However, unlike CWC and like TWP, it's
going to be video and audio instead of audio-only.

So what is the show going to be like? It's going to be a 30 minute to 1-hour
program divided into the following segments:

* The Prime:
  * I'm reprising the role of The Weekly Prime as a quick top 5 of my fave
    topics since the last episode inside of Cosi Conversations.
  * Basically going to be the same format as before but of course, with the
    addition of my voice.
* Deep Discussions
  * I'm going to provide more detail and discuss a topic or two (could be one
    from The Prime or not)
* Creator Casting
  * Showcasing new shows/videos/songs/channels/etc I like.
* TechHouse
  * Reviving my TechHouse brand I had a long time ago for a segment about
    Technology
  * May include some sub-segments for Tutorials, Tips, news, etc.
* Cosi's Corner
  * Basically your standard fan mailbag segment. I'll answer questions and stuff
  * If you have made fan-work of the channel mascot Cosi, I'll show it off also.

Not every episode is going to include every segment of course and they can
change in the future. Also, the show is going to be scripted unlike past shows
to prevent rambling.

The show will always have at least one episode a month but may also have more.
This way, I'm not locked into a tight weekly schedule that is easy to miss but I
also don't go months on end without posting it effectively canceling it.  Audio
versions will be on Anchor and SoundCloud while Video versions will be Vidme
Exclusive.

## Cosi Commentary

Obviously, by now, everyone has seen Reaction videos where people watch a video
and well, react to what they saw. Cosi Commentary is a twist on the standard
reaction concept! Not only will I be watching the video and giving my first
"blind" reaction to it like normal reactions but I'll then go back and analyze,
theorize, and discuss the video in depth to provide my overall thoughts on the
video and I'll give it a rating of how much I liked it.

Like Cosi Conversations above, these are also going to be Vidme Exclusives.

--------------------------------------------------------------------------------

## CAST Channel

Now time for the biggest announcement of them all, Pravox VARIETY is coming back
as CAST Channel! Like before, CAST Channel is going to be a linear web-based TV
channel but with some changes to not only make it easier for me to manage but
also more varied.

### Shows

Instead of relying on YouTube Videos and all user submissions, I'm going to make
edit together blocks of programs. The big advantage of this is I can make
perfectly curated shows that I can replay exactly and schedule better. For
comparison, the old style meant I had to add 30+ videos into a block and it
played all the videos I added in a row making each block easily over 2 hours. I
had to do this otherwise the channel would run out of content but it made it
near impossible to manage as to replace the videos with fresh content, I had to
completely delete the block which would also change the order it played.

Now I'll be able to tightly pack stuff into neat 30-60 minute videos with "ad
breaks" (more on this later) and be able to put a channel bug in the corner
which I couldn't do before at all. While this might take a bit longer to set up
as I actually have to edit the videos together, it allows me to reuse full
blocks! This means I can do encore airings and throw a past episode up if I need
more time to complete the new one. Videos will be mostly picked by me and some
others I talk with but there will be Viewer Submission Blocks which will contain
videos viewers submit.

Current shows are to be determined (TBD) but you can expect Pravox PRESENTS (now
CAST Presents), Pravox TUNE (CAST Tune) and Pravox TECH (CAST TechHouse) to come
back and for the two new CosiCast shows to be a part of it.

### Ad Breaks

So you know I mentioned above to keep reading for more info on Promo Promotions?
Well, they are going to be a part of CAST alongside some other stuff in the ad
breaks.

Each break will include a few retro ads, CAST Bumpers, and CAST Promos. CAST
will not include any actually paid ads!!  This is of course cause I'm playing
others content of course and don't want to monetize it. The retro ads are
included for fun basically.

### CAST Promos

CAST Promos are going to be like a mix of Promo Promotions and the previous
Pravox VARIETY Presents ads with some additional changes.

From the Pravox format:

* They will always start and end with the CAST logo.
* They will use songs non-specific to the creator but unlike the old Pravox
  ones, it won't always be Checkpoint by Nitro Fun but a select few songs. So
  not everyone will share the same song like Pravox but also not each video will
  have a unique song per creator.
* Links to CAST website and Social Media.

From the Promo Promotions format:

* Being divided up into sections based on their content.
* Featuring Creator Info like Website and Social Media

And some new things:

* Voice-over
* Lower-third during the full video showing who the creator is at all times.
* Sometimes, might include voice clips of the person.
* I'm opening it up to more than just "creators". Now, anything I want to make a
  trailer for basically. Some will be promos for actual things airing on CAST,
  others will be for creators, some might be for games, etc.
* For promos that are about stuff airing, they will include the times they air.

### CAST Recap

* Pravox VARIETY is back as CAST Channel
* More professional now with legit voice-overs, promos, etc.
* Going to make actual edited shows
  * Pravox PRESENTS, TUNE, and TECH are coming back
  * The two new CosiCast shows will be included.
* Ad Breaks that include fun retro ads but no actual paid ads
* CAST Promos are a merge of the old Promo Promotions and VARIETY ads with some
  new tweaks.

CAST Channel isn't ready yet so make sure to check back here or follow me on
social media for more info!

--------------------------------------------------------------------------------

## Final Recap

* Simplifying existing shows by merging Shorties and In 60 Seconds
* Making two new shows which are going to be the first on-camera shows by me
* Reviving Pravox VARIETY as CAST Channel

So CosiCast is expanding a lot!


text:
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var http_1 = require('@angular/http');
var Observable_1 = require('rxjs/Observable');
var pricetypes_1 = require('../priceboard/pricetypes');
require('rxjs/add/operator/map');
var PriceService = (function () {
    function PriceService(http) {
        this.http = http;
    }
    PriceService.prototype.getSellBand = function () {
        this.DoAllSelections();
        return Observable_1.Observable.from(this.priceSellBands.bands);
    };
    PriceService.prototype.getPriceData = function (regionid, typehref) {
        this.uri = 'https://crest-tq.eveonline.com/market/' + regionid + '/orders/sell/?type=' + typehref;
        console.log('URI for price data' + this.uri);
        return this.http.get(this.uri)
            .map(function (res) { return res.json(); });
    };
    PriceService.prototype.DoAllSelections = function () {
        this.popItems();
        this.popSystems();
        var isys = 0;
        var iitem = 0;
        try {
            var x = this.listSystems.length + this.listItems.length;
            if (x === 0) {
                document.getElementById('noData').hidden = false;
                return;
            }
        }
        catch (error) {
            document.getElementById('noData').hidden = false;
            return;
        }
        for (isys = 0; isys < this.listSystems.length; isys++) {
            for (iitem = 0; iitem < this.listItems.length; iitem++) {
                this.callPriceData(this.listSystems[isys].regionName, this.listItems[iitem].type.name, this.listSystems[isys].systemName, this.listSystems[isys].regionid, this.listItems[iitem].id.toString());
            }
        }
    };
    PriceService.prototype.callPriceData = function (region, itemname, station, regionid, itemhref) {
        var _this = this;
        this.getPriceData(regionid, itemhref).subscribe(function (res) {
            if (res.items.length > 0)
                _this.aggItems(region, itemname, station, res.items);
        }, function (err) { return console.log('Something went wrong:' + err.message); });
    };
    PriceService.prototype.popItems = function () {
        var res;
        res = localStorage.getItem('SelEveItems');
        if (res != null && res.indexOf('marketGroup') > 0) {
            var restry = JSON.parse(res);
            this.listItems = restry;
        }
    };
    PriceService.prototype.popSystems = function () {
        var jsondata = localStorage.getItem('Systems');
        if (jsondata != null && jsondata.indexOf('systemid') > 0) {
            this.listSystems = JSON.parse(jsondata);
        }
    };
    PriceService.prototype.aggItems = function (region, itemname, station, data) {
        var filtered;
        var i = 0;
        var pp = new Array();
        var bb = new Array();
        var bbs = new Array();
        var pps = new Array();
        for (i = 0; i < data.length; i++) {
            var p = new pricetypes_1.PriceData();
            p.duration = data[i].duration;
            p.price = data[i].price;
            p.volume = data[i].volume;
            p.range = data[i].range;
            p.issued = data[i].issued;
            p.location = data[i].location.name;
            pp.push(p);
        }
        pps = pp.sort(function (left, right) { if (left.price < right.price)
            return -1; if (left.price > right.price)
            return 1;
        else
            return 0; });
        // NEW INTERFACE OBJECT
        if (pps.length > 0) {
            var npb = {
                region: region,
                itemname: itemname,
                station: station,
                priceData: pps[0]
            };
            this.priceSellBands.bands.push(npb);
        }
    };
    PriceService = __decorate([
        core_1.Injectable(),
        __metadata('design:paramtypes', [http_1.Http])
    ], PriceService);
    return PriceService;
}());
exports.PriceService = PriceService;
//# sourceMappingURL=price.service.js.map


text:
export DEBIAN_FRONTEND="noninteractive"
apt-get install -y ubuntu-desktop


text:
package com.xxxxx.imitatetheheadlinestoday;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.ViewGroup;

/**
 * Created by xxxxx on 2016/9/25.
 */
public class MainFragmentPagerAdapter extends FragmentPagerAdapter {

    public MainFragmentPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    /**
     * 返回ViewPager的每一个item(每一个item是Fragment)
     * @param position
     * @return
     */
    @Override
    public Fragment getItem(int position) {
        return MainFragmentFactory.getFragment(position);
    }

    /**
     * 返回ViewPager页的数量
     * @return
     */
    @Override
    public int getCount() {
        return MainFragmentFactory.FRAGMENT_COUNT;//4
    }

    /**
     * 销毁item
     * @param container
     * @param position
     * @param object
     */
    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        super.destroyItem(container, position, object);
    }
}


text:
sass_path               = "src/net/darkhounds/aethernauts/admin/css"
css_path                = "public/css"

# Production paths
http_path               = "/"
#css_dir                 = "css"
#images_dir              = "images"
#javascripts_dir         = "js"


text:
layout: post
title: "Slight of hand IClientMessageInspector"
date: 2017-01-12 +1100
comments: false
categories: ['wcf','iclientmessageinspector']
---

Recently I had the need to implement generic code that could take an XML message transform it using XSL and then POST the result to a WCF end point. In the course of researching and performing proof of concepts one approach I tried was to create a client proxy and rewrite the message before the POST occured. I did not end up using this approach but wanted to document what I did.

```
    public class TrickySoapMessageInspector : IClientMessageInspector
    {
        private readonly string _newSoapAction;

        public TrickySoapMessageInspector(string oldSoapAction, string newSoapAction)
        {
            _oldSoapAction = oldSoapAction;
            _newSoapAction = newSoapAction;
        }

        public object BeforeSendRequest(ref Message request, IClientChannel channel)
        {
            string action = request.Headers.GetHeader<string>("Action", request.Headers[0].Namespace);

            if (action.Contains("SendXml"))
            {
                request.Headers.Action = request.Headers.Action = _soapAction;

                var doc = LoadMessageXml(request);

                ChangeMessage(doc);

                var reader = LoadMessageXml(doc);

                request = Message.CreateMessage(reader, int.MaxValue, request.Version);
            }

            return null;
        }

        public void AfterReceiveReply(ref Message reply, object correlationState)
        {
        }

        private XmlDocument LoadMessageXml(Message request)
        {
            var ms = new MemoryStream();

            using (var writer = XmlWriter.Create(ms))
            {
                request.WriteMessage(writer);
                writer.Flush();
                ms.Position = 0;
            }

            var doc = new XmlDocument();
            doc.Load(ms);

            return doc;
        }

        private XmlReader LoadMessageXml(XmlDocument document)
        {
            var ms = new MemoryStream();

            using (var writer = XmlWriter.Create(ms))
            {
                document.WriteTo(writer);
                writer.Flush();
                ms.Position = 0;
            }

            return XmlReader.Create(ms);
        }

        private void ChangeMessage(XmlDocument doc)
        {
            var node = doc.SelectSingleNode("descendant::*[local-name()='SendXml']");

            if (node != null && node.ParentNode != null)
            {
                var fragment = doc.CreateDocumentFragment();
                fragment.InnerXml = node.InnerText;

                node.ParentNode.ReplaceChild(fragment, node);
            }
        }
    }
```


text:
package org.elasticsearch.xpack.sql.expression;

import org.elasticsearch.xpack.sql.SqlIllegalArgumentException;
import org.elasticsearch.xpack.sql.expression.gen.script.ScriptTemplate;
import org.elasticsearch.xpack.sql.tree.NodeInfo;
import org.elasticsearch.xpack.sql.tree.Source;
import org.elasticsearch.xpack.sql.type.DataType;

import java.util.List;
import java.util.Objects;

import static java.util.Collections.emptyList;

/**
 * {@link Expression}s that can be materialized and represent the result columns sent to the client.
 * Typically are converted into constants, functions or Elasticsearch order-bys,
 * aggregations, or queries. They can also be extracted from the result of a search.
 *
 * In the statement {@code SELECT ABS(foo), A, B+C FROM ...} the three named
 * expressions {@code ABS(foo), A, B+C} get converted to attributes and the user can
 * only see Attributes.
 *
 * In the statement {@code SELECT foo FROM TABLE WHERE foo > 10 + 1} both {@code foo} and
 * {@code 10 + 1} are named expressions, the first due to the SELECT, the second due to being a function.
 * However since {@code 10 + 1} is used for filtering it doesn't appear appear in the result set
 * (derived table) and as such it is never translated to an attribute.
 * "foo" on the other hand is since it's a column in the result set.
 *
 * Another example {@code SELECT foo FROM ... WHERE bar > 10 +1} {@code foo} gets
 * converted into an Attribute, bar does not. That's because {@code bar} is used for
 * filtering alone but it's not part of the projection meaning the user doesn't
 * need it in the derived table.
 */
public abstract class Attribute extends NamedExpression {

    // empty - such as a top level attribute in SELECT cause
    // present - table name or a table name alias
    private final String qualifier;

    // can the attr be null - typically used in JOINs
    private final Nullability nullability;

    public Attribute(Source source, String name, String qualifier, ExpressionId id) {
        this(source, name, qualifier, Nullability.TRUE, id);
    }

    public Attribute(Source source, String name, String qualifier, Nullability nullability, ExpressionId id) {
        this(source, name, qualifier, nullability, id, false);
    }

    public Attribute(Source source, String name, String qualifier, Nullability nullability, ExpressionId id, boolean synthetic) {
        super(source, name, emptyList(), id, synthetic);
        this.qualifier = qualifier;
        this.nullability = nullability;
    }

    @Override
    public final Expression replaceChildren(List<Expression> newChildren) {
        throw new UnsupportedOperationException("this type of node doesn't have any children to replace");
    }

    @Override
    public ScriptTemplate asScript() {
        throw new SqlIllegalArgumentException("Encountered a bug - an attribute should never be scripted");
    }

    public String qualifier() {
        return qualifier;
    }

    public String qualifiedName() {
        return qualifier == null ? name() : qualifier + "." + name();
    }

    @Override
    public Nullability nullable() {
        return nullability;
    }

    @Override
    public AttributeSet references() {
        return new AttributeSet(this);
    }

    public Attribute withLocation(Source source) {
        return Objects.equals(source(), source) ? this : clone(source, name(), dataType(), qualifier(), nullable(), id(), synthetic());
    }

    public Attribute withQualifier(String qualifier) {
        return Objects.equals(qualifier(), qualifier) ? this : clone(source(), name(), dataType(), qualifier, nullable(), id(),
                synthetic());
    }

    public Attribute withName(String name) {
        return Objects.equals(name(), name) ? this : clone(source(), name, dataType(), qualifier(), nullable(), id(), synthetic());
    }

    public Attribute withNullability(Nullability nullability) {
        return Objects.equals(nullable(), nullability) ? this : clone(source(), name(), dataType(), qualifier(), nullability, id(),
                synthetic());
    }

    public Attribute withDataType(DataType type) {
        return Objects.equals(dataType(), type) ? this : clone(source(), name(), type, qualifier(), nullable(), id(), synthetic());
    }

    public Attribute withId(ExpressionId id) {
        return clone(source(), name(), dataType(), qualifier(), nullable(), id, synthetic());
    }

    protected abstract Attribute clone(Source source, String name, DataType type, String qualifier, Nullability nullability,
            ExpressionId id, boolean synthetic);

    @Override
    public Attribute toAttribute() {
        return this;
    }

    @Override
    public int semanticHash() {
        return id().hashCode();
    }

    @Override
    protected NodeInfo<? extends Expression> info() {
        return null;
    }

    @Override
    public boolean semanticEquals(Expression other) {
        return other instanceof Attribute ? id().equals(((Attribute) other).id()) : false;
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), qualifier, nullability);
    }

    @Override
    public boolean equals(Object obj) {
        if (super.equals(obj)) {
            Attribute other = (Attribute) obj;
            return Objects.equals(qualifier, other.qualifier)
                    && Objects.equals(nullability, other.nullability);
        }

        return false;
    }

    @Override
    public String toString() {
        return name() + "{" + label() + "}" + "#" + id();
    }

    protected abstract String label();
}


text:
// For conditions of distribution and use, see copyright notice in LICENSE

#pragma once

#include "TundraCoreApi.h"
#include "InputFwd.h"
#include "CoreTypes.h"
#include "KeyEvent.h"
#include "Signals.h"

#include <Urho3D/Core/Object.h>
#include <Urho3D/Container/HashSet.h>

namespace Tundra
{

/// Holds information about pressed key.
struct TUNDRACORE_API KeyPressInformation
{
    /// Identifies the press count for the key. 0 denotes the key is not being held down.
    /// 1 means that the key is being held down, and no key repeat signals have yet occurred.
    /// A value > 1 means that the key has been held down for a longer period, and this field
    /// tells how many repeated presses have been received already for the key.
    int keyPressCount;

    /// Specifies in which state the key is in.
    KeyEvent::EventType keyState;

    /// The absolute timestamp (in seconds) telling when the key was first pressed down.
    float firstPressTime;
};
typedef HashMap<Key, KeyPressInformation> HeldKeysMap;

/// Provides clients with input events in a priority order.
class TUNDRACORE_API InputContext : public Object
{
    URHO3D_OBJECT(InputContext, Object);

public:
    InputContext(InputAPI *owner, const char *name, int priority);
    ~InputContext();

    /// Emitted for each key code, for each event type.
    Signal1<KeyEvent*> KeyEventReceived;

    /// Emitted for each mouse event (move, scroll, button press/release).
    Signal1<MouseEvent*> MouseEventReceived;

    /// This signal is emitted when any key is pressed in this context.
    Signal1<KeyEvent*> KeyPressed;

    /// This signal is emitted for each application frame when this key is pressed down in this context.
    Signal1<KeyEvent*> KeyDown;

    /// This signal is emitted when any key is released in this context.
    Signal1<KeyEvent*> KeyReleased;

    /// Emitted when the mouse cursor is moved, independent of whether any buttons are down.
    Signal1<MouseEvent*> MouseMove;

    /// Mouse wheel was scrolled.
    Signal1<MouseEvent*> MouseScroll;

    /// Mouse double click
    Signal1<MouseEvent*> MouseDoubleClicked;

    // The following signals are emitted on the appropriate events. It is guaranteed that each press event
    // will follow a corresponding release event
    Signal1<MouseEvent*> MouseLeftPressed;
    Signal1<MouseEvent*> MouseMiddlePressed;
    Signal1<MouseEvent*> MouseRightPressed;

    Signal1<MouseEvent*> MouseLeftReleased;
    Signal1<MouseEvent*> MouseMiddleReleased;
    Signal1<MouseEvent*> MouseRightReleased;

    /// Creates a new signal object that will be triggered when the given
    /// key sequence occurs in this context. To actually receive the events,
    /// connect to one of the member signals of the returned object.
    /// You do not need to hold on to the received signal
    /// object, it will be remembered and freed along with the context.
    KeyEventSignal *RegisterKeyEvent(KeySequence keySequence);

    /// Stops signals from being triggered for the given key sequence in this context.
    /// This is optional. KeyEventSignals are freed properly when the context is destroyed.
    void UnregisterKeyEvent(KeySequence keySequence);

    /// Returns the user-defined name of this InputContext. [property]
    /** The name cannot be used as an unique identifier, it is only present for human-readable purposes. */
    String Name() const { return name; }

    /// Sets the name of this InputContext. The name cannot be used as an unique identifier, it is only
    /// present for human-readable purposes.
    void SetName(const String &name_) { name = name_; }

    /// Adjusts the priority of this input context.
    void SetPriority(int newPriority);

    /// Tests whether the given key was pressed down in this context.
    /// @return The keypress count for the given keycode. If 0, means that
    /// the key was not pressed down during this frame, or that it is being
    /// held down. If 1, it means that the key was pressed down during this
    /// frame. If > 1, it means that key has been held down for a longer
    /// duration, and key repeat was triggered for it this frame. The value
    /// denotes the repeat count.
    int KeyPressedCount(Key keyCode) const;

    /// A convenience method to test key presses ignoring repeats.
    bool IsKeyPressed(Key keyCode) const { return KeyPressedCount(keyCode) == 1; }

    /// Returns true if the given key is being held down in this context.
    bool IsKeyDown(Key keyCode) const;

    /// Returns true if the given key was released in this context during
    /// this frame.
    bool IsKeyReleased(Key keyCode) const;

    /// Constructs a key release event for the given key and calls TriggerKeyEvent for it.
    /// Use to forcibly release a key that is being held down.
    void TriggerKeyReleaseEvent(Key keyCode);

    /// Tells the InputContext whether the given keyCode is automatically
    /// suppressed. This can be used to avoid having to manually set the
    /// handled-flag to true for each received event.
    /// @param keyCode The keyboard code to set the suppression state for.
    /// @param isSuppressed If true, events related to this keycode will
    /// be automatically suppressed after this context has handled them,
    /// without passing the event on to lower layers.
    void SetKeySuppressed(Key keyCode, bool isSuppressed);

    /// Forces all held down keys to be released, and the appropriate release events to be sent.
    void ReleaseAllKeys();

    /// Returns true if the given mouse button is being held down.
    ///\todo Bypasses context and queries mouse state directly from Urho3D. Use events instead.
    bool IsMouseButtonDown(int mouseButton) const;

    /// Returns true if the given mouse button was pressed down during this frame.
    ///\todo Bypasses context and queries mouse state directly from Urho3D. Use events instead.
    bool IsMouseButtonPressed(int mouseButton) const;

    /// Returns true if the given mouse button was released during this frame.
    ///\todo Bypasses context and queries mouse state directly from Urho3D. Use events instead.
    bool IsMouseButtonReleased(int mouseButton) const;

    /// Returns number of active touches [property]
    ///\todo Bypasses context and queries touch state directly from Urho3D. Use events instead.
    unsigned GetNumTouches() const;

    /// Return active touch by index.
    ///\todo Bypasses context and queries touch state directly from Urho3D. Use events instead.
    Urho3D::TouchState* GetTouch(unsigned index) const;

    /// Returns the priority value this context has with respect to the other input contexts. [property]
    /** Higher = more urgent. Used to determine the order in which input is received by the input contexts.
        The priority is assigned when the context is created and may not be changed afterwards. */
    int Priority() const { return priority; }

private:
    /// Updates the buffered key presses. Called by the input API to proceed on to the next input frame.
    void UpdateFrame();

    /// Same as TriggerKeyEvent, but for mouse events.
    void TriggerMouseEvent(MouseEvent &mouse);

    /// This function is called by the InputAPI whenever there is a new
    /// key event for this context to handle. The event is emitted through
    /// all relevant signals. You may call this function yourself to inject
    /// keyboard events to this context manually.
    void TriggerKeyEvent(KeyEvent &key);

    typedef HashMap<KeySequence, KeyEventSignal*> KeyEventSignalMap;
    /// Stores a signal object for each keyboard key code that the user
    /// has registered a signal-slot connection for.
    KeyEventSignalMap registeredKeyEventSignals;

    /// Stores the set of keycodes that this input automatically suppresses,
    /// i.e. this context "grabs" these keys and does not pass them forward
    /// to anyone else.
    HashSet<Key> suppressedKeys;

    /// Stores each new key event that is being held down.
    HeldKeysMap newKeyEvents;

    /// Stores a buffered version of all the key pressed. This is to avoid losing any press or
    /// release events in the case of different module Update() orders, or when accessing the
    /// context from event handlers outside Update() cycle.
    HeldKeysMap heldKeysBuffered;

    /// Tests both newKeyEvents and heldKeysBuffered and looks if this context is aware of the
    /// given key being pressed down.
    bool IsKeyDownImmediate(Key keyCode) const;

    String name;

    /// The priority value this context has with respect to the other input contexts. Higher = more urgent. Used
    /// to determine the order in which input is received by the input contexts.
    int priority;

    InputAPI *inputApi;
    friend class InputAPI;
};

}


text:
namespace {

// Allocates all normal tab contents views to the size of the passed in
// |allocation|.
void ResizeChildren(GtkWidget* widget, void* param) {
  GtkAllocation* allocation = reinterpret_cast<GtkAllocation*>(param);

  if (widget->allocation.width != allocation->width ||
      widget->allocation.height != allocation->height) {
    gtk_widget_set_size_request(widget, allocation->width,
                                allocation->height);
  }
}

}  // namespace

TabContentsContainerGtk::TabContentsContainerGtk(StatusBubbleGtk* status_bubble)
    : tab_contents_(NULL),
      status_bubble_(status_bubble) {
  Init();
}

TabContentsContainerGtk::~TabContentsContainerGtk() {
  floating_.Destroy();
}

void TabContentsContainerGtk::Init() {
  // A high level overview of the TabContentsContainer:
  //
  // +- GtkFloatingContainer |floating_| -------------------------------+
  // |+- GtkFixedContainer |fixed_| -----------------------------------+|
  // ||                                                                ||
  // ||                                                                ||
  // ||                                                                ||
  // ||                                                                ||
  // |+- (StatusBubble) ------+                                        ||
  // |+                       +                                        ||
  // |+-----------------------+----------------------------------------+|
  // +------------------------------------------------------------------+

  floating_.Own(gtk_floating_container_new());

  fixed_ = gtk_fixed_new();
  g_signal_connect(fixed_, "size-allocate",
                   G_CALLBACK(OnFixedSizeAllocate), this);
  gtk_container_add(GTK_CONTAINER(floating_.get()), fixed_);

  gtk_floating_container_add_floating(GTK_FLOATING_CONTAINER(floating_.get()),
                                      status_bubble_->widget());
  g_signal_connect(floating_.get(), "set-floating-position",
                   G_CALLBACK(OnSetFloatingPosition), this);

  gtk_widget_show(fixed_);
  gtk_widget_show(floating_.get());
}

void TabContentsContainerGtk::AddContainerToBox(GtkWidget* box) {
  gtk_box_pack_start(GTK_BOX(box), floating_.get(), TRUE, TRUE, 0);
}

void TabContentsContainerGtk::SetTabContents(TabContents* tab_contents) {
  if (tab_contents_) {
    gfx::NativeView widget = tab_contents_->GetNativeView();
    if (widget)
      gtk_widget_hide(widget);

    tab_contents_->WasHidden();

    registrar_.Remove(this, NotificationType::RENDER_VIEW_HOST_CHANGED,
        Source<NavigationController>(&tab_contents_->controller()));
    registrar_.Remove(this, NotificationType::TAB_CONTENTS_DESTROYED,
                      Source<TabContents>(tab_contents_));
  }

  tab_contents_ = tab_contents;

  // When detaching the last tab of the browser SetTabContents is invoked
  // with NULL. Don't attempt to do anything in that case.
  if (tab_contents_) {
    // TabContents can change their RenderViewHost and hence the GtkWidget that
    // is shown. I'm not entirely sure that we need to observe this event under
    // GTK, but am putting a stub implementation and a comment saying that if
    // we crash after that NOTIMPLEMENTED(), we'll need it.
    registrar_.Add(this, NotificationType::RENDER_VIEW_HOST_CHANGED,
                   Source<NavigationController>(&tab_contents_->controller()));
    registrar_.Add(this, NotificationType::TAB_CONTENTS_DESTROYED,
                   Source<TabContents>(tab_contents_));

    gfx::NativeView widget = tab_contents_->GetNativeView();
    if (widget) {
      if (widget->parent != fixed_)
        gtk_fixed_put(GTK_FIXED(fixed_), widget, 0, 0);
      gtk_widget_show(widget);
    }

    // We need to make sure that we are below the findbar.
    // Sometimes the content native view will be null.
    // TODO(estade): will this case ever cause findbar occlusion problems?
    if (tab_contents_->GetContentNativeView()) {
      GdkWindow* content_gdk_window =
          tab_contents_->GetContentNativeView()->window;
      if (content_gdk_window)
        gdk_window_lower(content_gdk_window);
    }
  }
}

void TabContentsContainerGtk::DetachTabContents(TabContents* tab_contents) {
  gfx::NativeView widget = tab_contents->GetNativeView();
  // It is possible to detach an unrealized, unparented TabContents if you
  // slow things down enough in valgrind. Might happen in the real world, too.
  if (widget && widget->parent) {
    DCHECK_EQ(widget->parent, fixed_);
    gtk_container_remove(GTK_CONTAINER(fixed_), widget);
  }
}

void TabContentsContainerGtk::Observe(NotificationType type,
                                      const NotificationSource& source,
                                      const NotificationDetails& details) {
  if (type == NotificationType::RENDER_VIEW_HOST_CHANGED) {
    RenderViewHostSwitchedDetails* switched_details =
        Details<RenderViewHostSwitchedDetails>(details).ptr();
    RenderViewHostChanged(switched_details->old_host,
                          switched_details->new_host);
  } else if (type == NotificationType::TAB_CONTENTS_DESTROYED) {
    TabContentsDestroyed(Source<TabContents>(source).ptr());
  } else {
    NOTREACHED();
  }
}

void TabContentsContainerGtk::RenderViewHostChanged(RenderViewHost* old_host,
                                                    RenderViewHost* new_host) {
  // TODO(port): Remove this method and the logic where we subscribe to the
  // RENDER_VIEW_HOST_CHANGED notification. This was used on Windows for focus
  // issues, and I'm not entirely convinced that this isn't necessary.
}

void TabContentsContainerGtk::TabContentsDestroyed(TabContents* contents) {
  // Sometimes, a TabContents is destroyed before we know about it. This allows
  // us to clean up our state in case this happens.
  DCHECK(contents == tab_contents_);
  SetTabContents(NULL);
}

// static
void TabContentsContainerGtk::OnFixedSizeAllocate(
    GtkWidget* fixed,
    GtkAllocation* allocation,
    TabContentsContainerGtk* container) {
  // Set all the tab contents GtkWidgets to the size of the allocation.
  gtk_container_foreach(GTK_CONTAINER(fixed), ResizeChildren, allocation);
}

// static
void TabContentsContainerGtk::OnSetFloatingPosition(
    GtkFloatingContainer* floating_container, GtkAllocation* allocation,
    TabContentsContainerGtk* tab_contents_container) {
  GtkWidget* widget = tab_contents_container->status_bubble_->widget();

  // Look at the size request of the status bubble and tell the
  // GtkFloatingContainer where we want it positioned.
  GtkRequisition requisition;
  gtk_widget_size_request(widget, &requisition);

  GValue value = { 0, };
  g_value_init(&value, G_TYPE_INT);
  g_value_set_int(&value, 0);
  // TODO(erg): Since we're absolutely positioning stuff, we probably have to
  // do manual RTL right here.
  gtk_container_child_set_property(GTK_CONTAINER(floating_container),
                                   widget, "x", &value);

  int child_y = std::max(
      allocation->y + allocation->height - requisition.height, 0);
  g_value_set_int(&value, child_y);
  gtk_container_child_set_property(GTK_CONTAINER(floating_container),
                                   widget, "y", &value);
  g_value_unset(&value);
}


text:
namespace System.Management.Automation.Interpreter
{
    internal sealed class NewArrayInitInstruction<TElement> : Instruction
    {
        private readonly int _elementCount;

        internal NewArrayInitInstruction(int elementCount)
        {
            _elementCount = elementCount;
        }

        public override int ConsumedStack { get { return _elementCount; } }
        public override int ProducedStack { get { return 1; } }

        public override int Run(InterpretedFrame frame)
        {
            TElement[] array = new TElement[_elementCount];
            for (int i = _elementCount - 1; i >= 0; i--)
            {
                array[i] = (TElement)frame.Pop();
            }
            frame.Push(array);
            return +1;
        }
    }

    internal sealed class NewArrayInstruction<TElement> : Instruction
    {
        internal NewArrayInstruction() { }

        public override int ConsumedStack { get { return 1; } }
        public override int ProducedStack { get { return 1; } }

        public override int Run(InterpretedFrame frame)
        {
            int length = (int)frame.Pop();
            frame.Push(new TElement[length]);
            return +1;
        }
    }

    internal sealed class NewArrayBoundsInstruction : Instruction
    {
        private readonly Type _elementType;
        private readonly int _rank;

        internal NewArrayBoundsInstruction(Type elementType, int rank)
        {
            _elementType = elementType;
            _rank = rank;
        }

        public override int ConsumedStack { get { return _rank; } }
        public override int ProducedStack { get { return 1; } }

        public override int Run(InterpretedFrame frame)
        {
            var lengths = new int[_rank];
            for (int i = _rank - 1; i >= 0; i--)
            {
                lengths[i] = (int)frame.Pop();
            }
            var array = Array.CreateInstance(_elementType, lengths);
            frame.Push(array);
            return +1;
        }
    }

    internal sealed class GetArrayItemInstruction<TElement> : Instruction
    {
        internal GetArrayItemInstruction() { }

        public override int ConsumedStack { get { return 2; } }
        public override int ProducedStack { get { return 1; } }

        public override int Run(InterpretedFrame frame)
        {
            int index = (int)frame.Pop();
            TElement[] array = (TElement[])frame.Pop();
            frame.Push(array[index]);
            return +1;
        }

        public override string InstructionName
        {
            get { return "GetArrayItem"; }
        }
    }

    internal sealed class SetArrayItemInstruction<TElement> : Instruction
    {
        internal SetArrayItemInstruction() { }

        public override int ConsumedStack { get { return 3; } }
        public override int ProducedStack { get { return 0; } }

        public override int Run(InterpretedFrame frame)
        {
            TElement value = (TElement)frame.Pop();
            int index = (int)frame.Pop();
            TElement[] array = (TElement[])frame.Pop();
            array[index] = value;
            return +1;
        }

        public override string InstructionName
        {
            get { return "SetArrayItem"; }
        }
    }
}


text:
package net.bither.ui.base.dialog;

import android.content.Context;
import android.content.DialogInterface;
import android.text.Layout;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;

import net.bither.R;
import net.bither.util.UIUtil;
import net.bither.util.WalletUtils;

import java.util.List;

/**
 * Created by songchenwen on 16/6/13.
 */
public class DialogMonitorAddressesValidation extends CenterDialog implements DialogInterface
        .OnDismissListener, View.OnClickListener {
    private Runnable okRunnable;
    private int clickedId;

    public DialogMonitorAddressesValidation(Context context, List<String> addresses, Runnable
            okRunnable) {
        super(context);
        this.okRunnable = okRunnable;
        setOnDismissListener(this);
        setContentView(R.layout.dialog_monitor_address_validation);
        findViewById(R.id.btn_cancel).setOnClickListener(this);
        findViewById(R.id.btn_ok).setOnClickListener(this);
        final LinearLayout llAddresses = (LinearLayout) findViewById(R.id.ll_addresses);
        for (int i = 0;
             i < addresses.size();
             i++) {
            TextView tv = new TextView(context);
            tv.setTextColor(getContext().getResources().getColor(R.color.white));
            tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
            tv.setText(WalletUtils.formatHash(addresses.get(i), 4, 16));
            llAddresses.addView(tv);
            if (i < addresses.size() - 1) {
                LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) tv.getLayoutParams();
                lp.bottomMargin = UIUtil.dip2pix(4);
                tv.setLayoutParams(lp);
            }
        }
        final ScrollView sv = (ScrollView) llAddresses.getParent();
        llAddresses.measure(0, 0);
        ViewGroup.LayoutParams lp = sv.getLayoutParams();
        lp.height = Math.min(UIUtil.dip2pix(200), llAddresses.getMeasuredHeight());
        sv.setLayoutParams(lp);
    }

    @Override
    public void show() {
        super.show();
        clickedId = 0;
    }

    @Override
    public void onClick(View v) {
        clickedId = v.getId();
        dismiss();
    }

    @Override
    public void onDismiss(DialogInterface dialog) {
        if (clickedId == R.id.btn_ok && okRunnable != null) {
            okRunnable.run();
        }
    }
}