text:
module Grooveshark
  class Client
    attr_accessor :session, :comm_token
    attr_reader :user, :comm_token_ttl, :country

    def initialize(params = {})
      @ttl = params[:ttl] || 120 # 2 minutes
      @uuid = UUID.new.generate.upcase
      get_token_data
    end

    # Authenticate user
    def login(user, password)
      data = request('authenticateUser', {:username => user, :password => password}, true)
      @user = User.new(self, data)
      raise InvalidAuthentication, 'Wrong username or password!' if @user.id == 0
      return @user
    end

    # Find user by ID
    def get_user_by_id(id)
      resp = request('getUserByID', {:userID => id})['user']
      resp['username'].empty? ? nil : User.new(self, resp)
    end

    # Find user by username
    def get_user_by_username(name)
      resp = request('getUserByUsername', {:username => name})['user']
      resp['username'].empty? ? nil : User.new(self, resp)
    end

    # Get recently active users
    def recent_users
      request('getRecentlyActiveUsers', {})['users'].map { |u| User.new(self, u) }
    end

    # Get popular songs
    # type => daily, monthly
    def popular_songs(type='daily')
      raise ArgumentError, 'Invalid type' unless ['daily', 'monthly'].include?(type)
      request('popularGetSongs', {:type => type})['songs'].map { |s| Song.new(s) }
    end

    # Perform search request for query
    def search(type, query)
      results = request('getResultsFromSearch', {:type => type, :query => query})['result']
      results.map { |song| Song.new song }
    end

    # Perform songs search request for query
    def search_songs(query)
      search('Songs', query)
    end

    # Return raw response for songs search request
    def search_songs_pure(query)
      request('getSearchResultsEx', {:type => 'Songs', :query => query})
    end

    # Get stream authentication by song ID
    def get_stream_auth_by_songid(song_id)
      result = request('getStreamKeyFromSongIDEx', {
        'type' => 0,
        'prefetch' => false,
        'songID' => song_id,
        'country' => @country,
        'mobile' => false,
      })
      if result == [] then
        raise GeneralError, "No data for this song. Maybe Grooveshark banned your IP."
      end
      result
    end

    # Get stream authentication for song object
    def get_stream_auth(song)
      get_stream_auth_by_songid(song.id)
    end

    # Get song stream url by ID
    def get_song_url_by_id(id)
      resp = get_stream_auth_by_songid(id)
      "http://#{resp['ip']}/stream.php?streamKey=#{resp['stream_key']}"
    end

    # Get song stream
    def get_song_url(song)
      get_song_url_by_id(song.id)
    end

    def get_token_data
      response = RestClient.get('http://grooveshark.com')

      preload_regex = /gsPreloadAjax\(\{url: '\/preload.php\?(.*)&hash=' \+ clientPage\}\)/
      preload_id = response.to_s.scan(preload_regex).flatten.first
      preload_url = "http://grooveshark.com/preload.php?#{preload_id}&getCommunicationToken=1&hash=%2F"
      preload_response = RestClient.get(preload_url)

      token_data_json = preload_response.to_s.scan(/window.tokenData = (.*);/).flatten.first
      raise GeneralError, "token data not found" if not token_data_json
      token_data = JSON.parse(token_data_json)
      @comm_token = token_data['getCommunicationToken']
      @comm_token_ttl = Time.now.to_i
      config = token_data['getGSConfig']
      @country = config['country']
      @session = config['sessionID']
    end

    # Sign method
    def create_token(method)
      rnd = get_random_hex_chars(6)
      salt = "gooeyFlubber"
      plain = [method, @comm_token, salt, rnd].join(':')
      hash = Digest::SHA1.hexdigest(plain)
      "#{rnd}#{hash}"
    end

    def get_random_hex_chars(length)
      chars = ('a'..'f').to_a | (0..9).to_a
      (0...length).map { chars[rand(chars.length)] }.join
    end

    # Perform API request
    def request(method, params={}, secure=false)
      refresh_token if @comm_token

      url = "#{secure ? 'https' : 'http'}://grooveshark.com/more.php?#{method}"
      body = {
        'header' => {
          'client' => 'mobileshark',
          'clientRevision' => '20120830',
          'country' => @country,
          'privacy' => 0,
          'session' => @session,
          'uuid' => @uuid
        },
        'method' => method,
        'parameters' => params
      }
      body['header']['token'] = create_token(method) if @comm_token
      begin
        data = RestClient.post(url, body.to_json, {'Content-Type' => 'application/json'})
      rescue Exception => ex
        raise GeneralError, ex.message
      end

      data = JSON.parse(data)
      data = data.normalize if data.kind_of?(Hash)

      if data.key?('fault')
        raise ApiError.new(data['fault'])
      else
        data['result']
      end
    end

    # Refresh communications token on ttl
    def refresh_token
      get_token_data if Time.now.to_i - @comm_token_ttl > @ttl
    end
  end
end


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace GeoFlash.PCL.Localization {
    using System;
    using System.Reflection;

    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class AppResources {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal AppResources() {
        }

        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GeoFlash.PCL.Localization.AppResources", typeof(AppResources).GetTypeInfo().Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Africa.
        /// </summary>
        internal static string _Africa {
            get {
                return ResourceManager.GetString("_Africa", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Asia.
        /// </summary>
        internal static string _Asia {
            get {
                return ResourceManager.GetString("_Asia", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Australia.
        /// </summary>
        internal static string _Australia {
            get {
                return ResourceManager.GetString("_Australia", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Capitol.
        /// </summary>
        internal static string _Capitol {
            get {
                return ResourceManager.GetString("_Capitol", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Quiz is in progress do you wish to exit?.
        /// </summary>
        internal static string _CloseQuiz {
            get {
                return ResourceManager.GetString("_CloseQuiz", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Complete.
        /// </summary>
        internal static string _Complete {
            get {
                return ResourceManager.GetString("_Complete", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Confirm.
        /// </summary>
        internal static string _Confirm {
            get {
                return ResourceManager.GetString("_Confirm", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Credits.
        /// </summary>
        internal static string _Credits {
            get {
                return ResourceManager.GetString("_Credits", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Multiple Choice.
        /// </summary>
        internal static string _Easy {
            get {
                return ResourceManager.GetString("_Easy", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Europe.
        /// </summary>
        internal static string _Europe {
            get {
                return ResourceManager.GetString("_Europe", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Spelling.
        /// </summary>
        internal static string _Hard {
            get {
                return ResourceManager.GetString("_Hard", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to India.
        /// </summary>
        internal static string _India {
            get {
                return ResourceManager.GetString("_India", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Multiple Choice: Capital.
        /// </summary>
        internal static string _MultiSelectCapitol {
            get {
                return ResourceManager.GetString("_MultiSelectCapitol", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to No.
        /// </summary>
        internal static string _No {
            get {
                return ResourceManager.GetString("_No", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to North America.
        /// </summary>
        internal static string _North_America {
            get {
                return ResourceManager.GetString("_North_America", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Ok.
        /// </summary>
        internal static string _Ok {
            get {
                return ResourceManager.GetString("_Ok", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Points: .
        /// </summary>
        internal static string _Points {
            get {
                return ResourceManager.GetString("_Points", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Review.
        /// </summary>
        internal static string _Review {
            get {
                return ResourceManager.GetString("_Review", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to South America.
        /// </summary>
        internal static string _South_America {
            get {
                return ResourceManager.GetString("_South_America", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Yes.
        /// </summary>
        internal static string _Yes {
            get {
                return ResourceManager.GetString("_Yes", resourceCulture);
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
extern "C" {
#endif

#include <stdlib.h>
#include <stdbool.h>

typedef unsigned short TSSymbol;
typedef struct TSLanguage TSLanguage;
typedef struct TSDocument TSDocument;

typedef enum {
  TSInputEncodingUTF8,
  TSInputEncodingUTF16,
} TSInputEncoding;

typedef struct {
  void *payload;
  const char *(*read_fn)(void *payload, size_t *bytes_read);
  int (*seek_fn)(void *payload, size_t character, size_t byte);
  TSInputEncoding encoding;
} TSInput;

typedef enum {
  TSDebugTypeParse,
  TSDebugTypeLex,
} TSDebugType;

typedef struct {
  void *payload;
  void (*debug_fn)(void *payload, TSDebugType, const char *);
} TSDebugger;

typedef struct {
  size_t position;
  size_t chars_inserted;
  size_t chars_removed;
} TSInputEdit;

typedef struct {
  size_t row;
  size_t column;
} TSPoint;

typedef struct {
  const void *data;
  size_t offset[3];
} TSNode;

typedef struct {
  TSSymbol value;
  bool done;
  void *data;
} TSSymbolIterator;

size_t ts_node_start_char(TSNode);
size_t ts_node_start_byte(TSNode);
TSPoint ts_node_start_point(TSNode);
size_t ts_node_end_char(TSNode);
size_t ts_node_end_byte(TSNode);
TSPoint ts_node_end_point(TSNode);
TSSymbol ts_node_symbol(TSNode);
TSSymbolIterator ts_node_symbols(TSNode);
void ts_symbol_iterator_next(TSSymbolIterator *);
const char *ts_node_name(TSNode, const TSDocument *);
char *ts_node_string(TSNode, const TSDocument *);
bool ts_node_eq(TSNode, TSNode);
bool ts_node_is_named(TSNode);
bool ts_node_has_changes(TSNode);
TSNode ts_node_parent(TSNode);
TSNode ts_node_child(TSNode, size_t);
TSNode ts_node_named_child(TSNode, size_t);
size_t ts_node_child_count(TSNode);
size_t ts_node_named_child_count(TSNode);
TSNode ts_node_next_sibling(TSNode);
TSNode ts_node_next_named_sibling(TSNode);
TSNode ts_node_prev_sibling(TSNode);
TSNode ts_node_prev_named_sibling(TSNode);
TSNode ts_node_descendant_for_range(TSNode, size_t, size_t);
TSNode ts_node_named_descendant_for_range(TSNode, size_t, size_t);

TSDocument *ts_document_make();
void ts_document_free(TSDocument *);
const TSLanguage *ts_document_language(TSDocument *);
void ts_document_set_language(TSDocument *, const TSLanguage *);
TSInput ts_document_input(TSDocument *);
void ts_document_set_input(TSDocument *, TSInput);
void ts_document_set_input_string(TSDocument *, const char *);
TSDebugger ts_document_debugger(const TSDocument *);
void ts_document_set_debugger(TSDocument *, TSDebugger);
void ts_document_print_debugging_graphs(TSDocument *, bool);
void ts_document_edit(TSDocument *, TSInputEdit);
int ts_document_parse(TSDocument *);
void ts_document_invalidate(TSDocument *);
TSNode ts_document_root_node(const TSDocument *);
size_t ts_document_parse_count(const TSDocument *);

size_t ts_language_symbol_count(const TSLanguage *);
const char *ts_language_symbol_name(const TSLanguage *, TSSymbol);

#define ts_builtin_sym_error ((TSSymbol)-1)
#define ts_builtin_sym_end 0
#define ts_builtin_sym_start 1

#ifdef __cplusplus
}
#endif

#endif  // TREE_SITTER_RUNTIME_H_


text:
<package>
    <name>amcl</name>
    <version>1.14.0</version>
    <description>

            amcl is a probabilistic localization system for a robot moving in
            2D. It implements the adaptive (or KLD-sampling) Monte Carlo
            localization approach (as described by Dieter Fox), which uses a
            particle filter to track the pose of a robot against a known map.

            This node is derived, with thanks, from Andrew Howard's excellent
            'amcl' Player driver.

    </description>
    <url>http://wiki.ros.org/amcl</url>
    <author>Brian P. Gerkey</author>
    <author>contradict@gmail.com</author>
    <maintainer email="davidvlu@gmail.com">David V. Lu!!</maintainer>
    <maintainer email="mferguson@fetchrobotics.com">Michael Ferguson</maintainer>
    <license>LGPL</license>

    <buildtool_depend>catkin</buildtool_depend>

    <build_depend>rosbag</build_depend>
    <build_depend>dynamic_reconfigure</build_depend>
    <build_depend>message_filters</build_depend>
    <build_depend>nav_msgs</build_depend>
    <build_depend>roscpp</build_depend>
    <build_depend>rostest</build_depend>
    <build_depend>std_srvs</build_depend>
    <build_depend>tf</build_depend>

    <run_depend>rosbag</run_depend>
    <run_depend>roscpp</run_depend>
    <run_depend>dynamic_reconfigure</run_depend>
    <run_depend>tf</run_depend>
    <run_depend>nav_msgs</run_depend>

    <test_depend>map_server</test_depend>
</package>


text:
namespace FluentLinqToSql.Mappings {
	using System.Reflection;

	/// <summary>
	/// Mapping class that represents a one-to-many mapping.
	/// </summary>
	public class HasManyMapping<T, TElement> : AssociationMapping<T, TElement>, IHasManyMapping {
		/// <summary>
		/// Creates a new instance of the HasManyMapping class.
		/// </summary>
		/// <param name="property">The property that represents the association</param>
		public HasManyMapping(MemberInfo property) : base(property) {}
	}
}


text:
const request = require('supertest');

var app = {};

describe('GET /items/:id', function () {
  it('returns all items', function (done) {
    // newer mocha versions accepts promises as well
    return request(app)
      .get('/items')
      .set('Accept', 'application/json')
      .expect(200, {
        id: '1',
        name: 'John Math'
      }, done);
  });
});


text:
"""provides the Lexer class for parsing template strings into parse trees."""

import re, codecs
from mako import parsetree, exceptions
from mako.pygen import adjust_whitespace

_regexp_cache = {}

class Lexer(object):
    def __init__(self, text, filename=None, input_encoding=None, preprocessor=None):
        self.text = text
        self.filename = filename
        self.template = parsetree.TemplateNode(self.filename)
        self.matched_lineno = 1
        self.matched_charpos = 0
        self.lineno = 1
        self.match_position = 0
        self.tag = []
        self.control_line = []
        self.encoding = input_encoding
        if preprocessor is None:
            self.preprocessor = []
        elif not hasattr(preprocessor, '__iter__'):
            self.preprocessor = [preprocessor]
        else:
            self.preprocessor = preprocessor

    exception_kwargs = property(lambda self:{'source':self.text, 'lineno':self.matched_lineno, 'pos':self.matched_charpos, 'filename':self.filename})

    def match(self, regexp, flags=None):
        """match the given regular expression string and flags to the current text position.

        if a match occurs, update the current text and line position."""
        mp = self.match_position
        try:
            reg = _regexp_cache[(regexp, flags)]
        except KeyError:
            if flags:
                reg = re.compile(regexp, flags)
            else:
                reg = re.compile(regexp)
            _regexp_cache[(regexp, flags)] = reg

        match = reg.match(self.text, self.match_position)
        if match:
            (start, end) = match.span()
            if end == start:
                self.match_position = end + 1
            else:
                self.match_position = end
            self.matched_lineno = self.lineno
            lines = re.findall(r"\n", self.text[mp:self.match_position])
            cp = mp - 1
            while (cp >= 0 and cp<self.textlength and self.text[cp] != '\n'):
                cp -=1
            self.matched_charpos = mp - cp
            self.lineno += len(lines)
            #print "MATCHED:", match.group(0), "LINE START:", self.matched_lineno, "LINE END:", self.lineno
        #print "MATCH:", regexp, "\n", self.text[mp : mp + 15], (match and "TRUE" or "FALSE")
        return match

    def parse_until_text(self, *text):
        startpos = self.match_position
        while True:
            match = self.match(r'#.*\n')
            if match:
                continue
            match = self.match(r'(\"\"\"|\'\'\'|\"|\')')
            if match:
                m = self.match(r'.*?%s' % match.group(1), re.S)
                if not m:
                    raise exceptions.SyntaxException("Unmatched '%s'" % match.group(1), **self.exception_kwargs)
            else:
                match = self.match(r'(%s)' % r'|'.join(text))
                if match:
                    return (self.text[startpos:self.match_position-len(match.group(1))], match.group(1))
                else:
                    match = self.match(r".*?(?=\"|\'|#|%s)" % r'|'.join(text), re.S)
                    if not match:
                        raise exceptions.SyntaxException("Expected: %s" % ','.join(text), **self.exception_kwargs)

    def append_node(self, nodecls, *args, **kwargs):
        kwargs.setdefault('source', self.text)
        kwargs.setdefault('lineno', self.matched_lineno)
        kwargs.setdefault('pos', self.matched_charpos)
        kwargs['filename'] = self.filename
        node = nodecls(*args, **kwargs)
        if len(self.tag):
            self.tag[-1].nodes.append(node)
        else:
            self.template.nodes.append(node)
        if isinstance(node, parsetree.Tag):
            if len(self.tag):
                node.parent = self.tag[-1]
            self.tag.append(node)
        elif isinstance(node, parsetree.ControlLine):
            if node.isend:
                self.control_line.pop()
            elif node.is_primary:
                self.control_line.append(node)
            elif len(self.control_line) and not self.control_line[-1].is_ternary(node.keyword):
                raise exceptions.SyntaxException("Keyword '%s' not a legal ternary for keyword '%s'" % (node.keyword, self.control_line[-1].keyword), **self.exception_kwargs)

    def escape_code(self, text):
        if self.encoding:
            return text.encode('ascii', 'backslashreplace')
        else:
            return text

    def parse(self):
        for preproc in self.preprocessor:
            self.text = preproc(self.text)
        if not isinstance(self.text, unicode) and self.text.startswith(codecs.BOM_UTF8):
            self.text = self.text[len(codecs.BOM_UTF8):]
            parsed_encoding = 'utf-8'
            me = self.match_encoding()
            if me is not None and me != 'utf-8':
                raise exceptions.CompileException("Found utf-8 BOM in file, with conflicting magic encoding comment of '%s'" % me, self.text.decode('utf-8', 'ignore'), 0, 0, self.filename)
        else:
            parsed_encoding = self.match_encoding()
        if parsed_encoding:
            self.encoding = parsed_encoding
        if not isinstance(self.text, unicode):

            if self.encoding:
                try:
                    self.text = self.text.decode(self.encoding)
                except UnicodeDecodeError, e:
                    raise exceptions.CompileException("Unicode decode operation of encoding '%s' failed" % self.encoding, self.text.decode('utf-8', 'ignore'), 0, 0, self.filename)
            else:
                try:
                    self.text = self.text.decode()
                except UnicodeDecodeError, e:
                    raise exceptions.CompileException("Could not read template using encoding of 'ascii'.  Did you forget a magic encoding comment?", self.text.decode('utf-8', 'ignore'), 0, 0, self.filename)

        self.textlength = len(self.text)

        while (True):
            if self.match_position > self.textlength:
                break

            if self.match_end():
                break
            if self.match_expression():
                continue
            if self.match_control_line():
                continue
            if self.match_comment():
                continue
            if self.match_tag_start():
                continue
            if self.match_tag_end():
                continue
            if self.match_python_block():
                continue
            if self.match_text():
                continue

            if self.match_position > self.textlength:
                break
            raise exceptions.CompileException("assertion failed")

        if len(self.tag):
            raise exceptions.SyntaxException("Unclosed tag: <%%%s>" % self.tag[-1].keyword, **self.exception_kwargs)
        if len(self.control_line):
            raise exceptions.SyntaxException("Unterminated control keyword: '%s'" % self.control_line[-1].keyword, self.text, self.control_line[-1].lineno, self.control_line[-1].pos, self.filename)
        return self.template

    def match_encoding(self):
        match = self.match(r'#.*coding[:=]\s*([-\w.]+).*\r?\n')
        if match:
            return match.group(1)
        else:
            return None

    def match_tag_start(self):
        match = self.match(r'''
            \<%     # opening tag

            (\w+)   # keyword

            ((?:\s+\w+|=|".*?"|'.*?')*)  # attrname, = sign, string expression

            \s*     # more whitespace

            (/)?>   # closing

            ''',

            re.I | re.S | re.X)

        if match:
            (keyword, attr, isend) = (match.group(1).lower(), match.group(2), match.group(3))
            self.keyword = keyword
            attributes = {}
            if attr:
                for att in re.findall(r"\s*(\w+)\s*=\s*(?:'([^']*)'|\"([^\"]*)\")", attr):
                    (key, val1, val2) = att
                    text = val1 or val2
                    text = text.replace('\r\n', '\n')
                    attributes[key] = self.escape_code(text)
            self.append_node(parsetree.Tag, keyword, attributes)
            if isend:
                self.tag.pop()
            else:
                if keyword == 'text':
                    match = self.match(r'(.*?)(?=\</%text>)',  re.S)
                    if not match:
                        raise exceptions.SyntaxException("Unclosed tag: <%%%s>" % self.tag[-1].keyword, **self.exception_kwargs)
                    self.append_node(parsetree.Text, match.group(1))
                    return self.match_tag_end()
            return True
        else:
            return False

    def match_tag_end(self):
        match = self.match(r'\</%[\t ]*(.+?)[\t ]*>')
        if match:
            if not len(self.tag):
                raise exceptions.SyntaxException("Closing tag without opening tag: </%%%s>" % match.group(1), **self.exception_kwargs)
            elif self.tag[-1].keyword != match.group(1):
                raise exceptions.SyntaxException("Closing tag </%%%s> does not match tag: <%%%s>" % (match.group(1), self.tag[-1].keyword), **self.exception_kwargs)
            self.tag.pop()
            return True
        else:
            return False

    def match_end(self):
        match = self.match(r'\Z', re.S)
        if match:
            string = match.group()
            if string:
                return string
            else:
                return True
        else:
            return False

    def match_text(self):
        match = self.match(r"""
                (.*?)         # anything, followed by:
                (
                 (?<=\n)(?=[ \t]*(?=%|\#\#)) # an eval or line-based comment preceded by a consumed \n and whitespace
                 |
                 (?=\${)   # an expression
                 |
                 (?=\#\*) # multiline comment
                 |
                 (?=</?[%&])  # a substitution or block or call start or end
                                              # - don't consume
                 |
                 (\\\r?\n)         # an escaped newline  - throw away
                 |
                 \Z           # end of string
                )""", re.X | re.S)

        if match:
            text = match.group(1)
            self.append_node(parsetree.Text, text)
            return True
        else:
            return False

    def match_python_block(self):
        match = self.match(r"<%(!)?")
        if match:
            (line, pos) = (self.matched_lineno, self.matched_charpos)
            (text, end) = self.parse_until_text(r'%>')
            text = adjust_whitespace(text)
            self.append_node(parsetree.Code, self.escape_code(text), match.group(1)=='!', lineno=line, pos=pos)
            return True
        else:
            return False

    def match_expression(self):
        match = self.match(r"\${")
        if match:
            (line, pos) = (self.matched_lineno, self.matched_charpos)
            (text, end) = self.parse_until_text(r'\|', r'}')
            if end == '|':
                (escapes, end) = self.parse_until_text(r'}')
            else:
                escapes = ""
            text = text.replace('\r\n', '\n')
            self.append_node(parsetree.Expression, self.escape_code(text), escapes.strip(), lineno=line, pos=pos)
            return True
        else:
            return False

    def match_control_line(self):
        match = self.match(r"(?<=^)[\t ]*(%|##)[\t ]*((?:(?:\\r?\n)|[^\r\n])*)(?:\r?\n|\Z)", re.M)
        if match:
            operator = match.group(1)
            text = match.group(2)
            if operator == '%':
                m2 = re.match(r'(end)?(\w+)\s*(.*)', text)
                if not m2:
                    raise exceptions.SyntaxException("Invalid control line: '%s'" % text, **self.exception_kwargs)
                (isend, keyword) = m2.group(1, 2)
                isend = (isend is not None)

                if isend:
                    if not len(self.control_line):
                        raise exceptions.SyntaxException("No starting keyword '%s' for '%s'" % (keyword, text), **self.exception_kwargs)
                    elif self.control_line[-1].keyword != keyword:
                        raise exceptions.SyntaxException("Keyword '%s' doesn't match keyword '%s'" % (text, self.control_line[-1].keyword), **self.exception_kwargs)
                self.append_node(parsetree.ControlLine, keyword, isend, self.escape_code(text))
            else:
                self.append_node(parsetree.Comment, text)
            return True
        else:
            return False

    def match_comment(self):
        """matches the multiline version of a comment"""
        match = self.match(r"<%doc>(.*?)</%doc>", re.S)
        if match:
            self.append_node(parsetree.Comment, match.group(1))
            return True
        else:
            return False


text:
<?php

namespace Symbiote\ContentServiceAssets;

/**
 * A non-file asset which is served from an external content source.
 */
class ContentServiceAsset extends \DataObject {

	private static $db = array(
		'Filename' => 'Varchar(255)',
		'FilePointer' => 'FileContent'
	);

    private static $has_one = array(
        'Parent'        => 'File',
        'Source'        => 'File',
    );

	private static $indexes = array(
		'Filename' => true
	);

    /*
     *  This automatically migrates any records from the previous namespace to the current namespace, since the
     *  table names actually contain these.
     */

    public function requireDefaultRecords() {

        parent::requireDefaultRecords();

        // The tables to migrate.

        $from = 'SilverStripeAustralia\ContentServiceAssets\ContentServiceAsset';
        $to = 'Symbiote\ContentServiceAssets\ContentServiceAsset';
        $escaped = 'Symbiote\\\\ContentServiceAssets\\\\ContentServiceAsset';

        // This only ever needs to run once, so we need to do an efficient check here.

        if(
            !\DB::query("SELECT EXISTS(SELECT 1 FROM \"{$to}\" LIMIT 1);")->value() &&
            \ClassInfo::hasTable($from) &&
            \DB::query("SELECT EXISTS(SELECT 1 FROM \"{$from}\" LIMIT 1);")->value()
        ) {

            // Copy the records across, and make sure the class name is correct.

            \DB::query("INSERT INTO \"{$to}\" SELECT * FROM \"{$from}\";");
            \DB::query("UPDATE \"{$to}\" SET ClassName = '{$escaped}';");
        }
    }

    public function getSecureURL($expires = 60) {

		/** @var \FileContent $pointer */
		$pointer = $this->obj('FilePointer');

		if($pointer->exists() && $pointer->getValue()) {
			$reader = $pointer->getReader();
			if ($reader) {
                if ($this->ParentID) {
                    // check for things first
                    $parent = $this->Parent();
                    if ($parent && $parent->ID && !$parent->canView()) {
                        return;
                    }
                }
                return method_exists($reader, 'getSecureURL') ? $reader->getSecureURL($expires) : '';
			}
		}
	}

    /**
	 * @return ContentReader
	 */
	public function reader() {
		$pointer = $this->obj('FilePointer');
		if ($pointer && $pointer->getValue()) {
			return $pointer->getReader();
		}
	}

    public function getURL() {
        $pointer = $this->obj('FilePointer');

        $controller = \Controller::has_curr() ? \Controller::curr() : null;
        if ($controller instanceof \CMSMain) {
            return $this->Filename;
        }

		if($pointer->exists() && $pointer->getValue()) {
			$reader = $pointer->getReader();
			if ($reader) {
				return $reader->getURL();
			}
		}
    }

    public function canView($member = null) {
        $parent = $this->Parent();
        if ($parent && $parent->ID) {
            return $parent->canView($member);
        }
        return parent::canView($member);
    }

    public function getViewType() {
        $parent = $this->Parent();
        if ($parent && $parent->ID) {
            return $parent->getViewType();
        }
        return \CDNFile::ANYONE_PERM;
    }

    public function onAfterDelete() {
        $obj = $this->obj('FilePointer');
        if ($obj) {
            try {
                $writer = $obj->getReader()->getWriter();
                $writer->delete();
            } catch (Exception $ex) {
                // not much that can be done really?
                SS_Log::log($ex, SS_Log::WARN);
            }
        }
	}
}


text:
<form class="form-horizontal" name="finishForm" ng-submit="finish()" novalidate>

          * BC set name

          <input id="inputf1" name="inputf1" class="form-control" ng-model="bcSetName" required>
          Required field.

      Check the configurations to include in the set.

        <input type="submit" class="btn btn-primary" value="Finish process" tooltip-is-open="finishTooltipIsOpen" tooltip-enable="finishTooltipIsOpen" tooltip-trigger="none"
        tooltip="You can try it again" ng-disabled="submitDisabled || finishForm.$invalid">
        <input type="reset" class="btn btn-default"
               pnc-confirm-click="reset()"
               pnc-confirm-message="Reset the entire import process and start over?" value="Reset">

</form>


text:
import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';

import { MyApp } from './app.component';

import { TabsPage } from '../pages/tabs/tabs';

import { PostsPage } from '../pages/posts/posts';
import { PostDetailPage } from '../pages/post-detail/post-detail';
import { CommentsPage } from '../pages/comments/comments';
import { CommentDetailPage } from '../pages/comment-detail/comment-detail';
import { AlbumsPage } from '../pages/albums/albums';
import { AlbumDetailPage } from '../pages/album-detail/album-detail';
import { PhotosPage } from '../pages/photos/photos';
import { PhotoDetailPage } from '../pages/photo-detail/photo-detail';
import { TodosPage } from '../pages/todos/todos';
import { TodoDetailPage } from '../pages/todo-detail/todo-detail';
import { UsersPage } from '../pages/users/users';
import { UserDetailPage } from '../pages/user-detail/user-detail';

import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

import { SystemProvider } from '../providers/system/system';

@NgModule({
	declarations: [
		MyApp,

		TabsPage,

		PostsPage,
		PostDetailPage,
		CommentsPage,
		CommentDetailPage,
		AlbumsPage,
		AlbumDetailPage,
		PhotosPage,
		PhotoDetailPage,
		TodosPage,
		TodoDetailPage,
		UsersPage,
		UserDetailPage,
	],
	imports: [
		BrowserModule,
		HttpModule,
		IonicModule.forRoot(MyApp)
	],
	bootstrap: [IonicApp],
	entryComponents: [
		MyApp,

		TabsPage,

		PostsPage,
		PostDetailPage,
		CommentsPage,
		CommentDetailPage,
		AlbumsPage,
		AlbumDetailPage,
		PhotosPage,
		PhotoDetailPage,
		TodosPage,
		TodoDetailPage,
		UsersPage,
		UserDetailPage,
	],
	providers: [
		StatusBar,
		SplashScreen,
		{provide: ErrorHandler, useClass: IonicErrorHandler},

		SystemProvider
	]
})
export class AppModule {}


text:
select 1 as id
union all
select * from {{ ref('node_0') }}
union all
select * from {{ ref('node_24') }}
union all
select * from {{ ref('node_140') }}


text:
namespace Assets.Environments
{
    public class UpdatableVar : Variable {

        public string Min;
        public string Max;
    }
}


text:
package org.metafacture.metamorph.functions;

import java.util.regex.Pattern;

import org.metafacture.metamorph.api.NamedValueSource;
import org.metafacture.metamorph.api.helpers.AbstractFunction;

/**
 * Splits the received value and output each part separately.
 *
 * @author Markus Michael Geipel
 */
public final class Split extends AbstractFunction {

	private Pattern delimiterPattern;

	@Override
	public void receive(final String name, final String value,
			final NamedValueSource source, final int recordCount,
			final int entityCount) {
		final String[] parts = delimiterPattern.split(value);
		for (final String part : parts) {
			getNamedValueReceiver().receive(name, part, this, recordCount,
					entityCount);
		}
	}

	public void setDelimiter(final String delimiter) {
		this.delimiterPattern = Pattern.compile(delimiter);
	}

}


text:
@interface ErrorItemsTVC : BeckTVC

@property (nonatomic, strong) NSString *subjectId;

@end


text:
package li.mvc.view;

import java.util.Map;
import java.util.Properties;

import javax.servlet.http.HttpServletResponse;

import li.mvc.Context;
import li.util.Files;
import li.util.Log;

import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity;

/**
 * Velocity视图
 *
 * @author : 明伟
 */
public class VelocityView extends AbstractView {
    private static final Log log = Log.init();

    private static Object flag;

    public static synchronized void init() {
        if (null == flag) {
            log.info("velocity initializing ..");
            Properties properties = new Properties();// 默认的参数设置
            properties.put("file.resource.loader.path", Context.getRootPath());
            properties.put("input.encoding", "UTF-8");
            properties.put("output.encoding", "UTF-8");
            properties.putAll(Files.load("velocity.properties"));// velocity.properties中的参数设置
            Velocity.init(properties);// 初始化Velocity
            flag = "inited";
        }
    }

    public void render(String tempPath, HttpServletResponse response, Map<String, Object> map) throws Exception {
        init();
        Template template = Velocity.getTemplate(tempPath);
        template.merge(new VelocityContext(map), response.getWriter());
        log.debug("velocity to : ?", tempPath);
    }
}


text:
#pragma once
#include <samchon/protocol/Entity.hpp>
#include <samchon/protocol/IProtocol.hpp>

#include <string>
#include <samchon/library/CriticalSet.hpp>

namespace samchon
{
	namespace example
	{
		namespace chat_service
		{
			class ChatUser;
			class ChatService;

			class ChatRoomArray;

			/**
			 * @brief A chat room
			 *
			 * @details
			 * <p> An entity class representing a chat room containing participants.
			 * The ChatRoom class takes a responsibility of Invoke message chain between
			 * clients (participating ChatUser(s)) objects. </p>
			 *
			 * <p> @image html cpp/example_chat_service.png
			 * @image latex cpp/example_chat_service.png </p>
			 *
			 * @author Jeongho Nam
			 */
			class ChatRoom
				: public protocol::Entity,
				public protocol::IProtocol
			{
			protected:
				typedef protocol::Entity super;

				virtual auto TAG() const -> std::string { return "room"; };

			private:
				/**
				 * @brief All rooms that the room is belonged to.
				 */
				ChatRoomArray *roomArray;

				/**
				 * @brief Name of the room.
				 * @details The name is the identifier of the ChatRoom.
				 */
				std::string name;

				/**
				 * @brief A host, who established the room.
				 */
				ChatUser *host;

				/**
				 * @brief Participants, ChatUser(s) in the room
				 */
				library::CriticalSet<ChatService*> participants;

			public:
				/* -----------------------------------------------------------
					CONSTRUCTORS
				----------------------------------------------------------- */
				/**
				 * @brief Construct from rooms, name and host
				 *
				 * @param rooms Rooms managing ChatRoom(s).
				 * @param name Name of the room, the identifier.
				 * @param host A host who established the room.
				 */
				ChatRoom(ChatRoomArray*, const std::string &, ChatUser*);
				virtual ~ChatRoom() = default;

				/**
				 * @brief Register a participant client.
				 * @details Registers a participant and notify the participation to another clients.
				 */
				void registerClient(ChatService*);

				/**
				 * @brief Erase a participant client.
				 * @details Erases a participant and notify others about the exiting.
				 */
				void eraseClient(ChatService*);

				/* -----------------------------------------------------------
					CHAIN OF RESPONSIBILITY
				----------------------------------------------------------- */
				virtual void replyData(std::shared_ptr<protocol::Invoke>) override;
				virtual void sendData(std::shared_ptr<protocol::Invoke>) override;

			public:
				/* -----------------------------------------------------------
					GETTERS
				----------------------------------------------------------- */
				virtual auto toXML() const -> std::shared_ptr<library::XML> override;
			};
		};
	};
};


text:
 What The Trell

       Boards
       Logout

 My Boards

      <form role="form" ng-submit="boardCtrl.createBoard()">

          <input type="text" ng-model="boardCtrl.formData.title" placeholder="New Board" class="form-control">

            <input type="submit" class="btn btn-primary" value="Add">

      </form>

          <input type="text" ng-model="board.title" class="form-control boardStyle">

            <button class="btn btn-danger" ng-click="boardCtrl.removeBoard(board._id)" aria-label="Remove">

            </button>

            <button class="btn btn-success" ng-click="boardCtrl.editBoard(board._id, board.title)" aria-label="Edit">

            </button>


text:
require 'spec_helper'

describe "Proxy + WebDriver" do
  let(:driver)  { Selenium::WebDriver.for :firefox, :profile => profile }
  let(:proxy) { new_proxy }
  let(:wait) { Selenium::WebDriver::Wait.new(:timeout => 10) }

  let(:profile) {
    pr = Selenium::WebDriver::Firefox::Profile.new
    pr.proxy = proxy.selenium_proxy

    pr
  }

  after {
    driver.quit
    proxy.close
  }

  describe 'request interceptor' do
    it "modifies request" do
      proxy.new_har("1", :capture_headers => true)
      proxy.request_interceptor = 'request.getMethod().setHeader("foo", "bar");'

      driver.get url_for("1.html")
      wait.until { driver.title == '1' }

      entry = proxy.har.entries.first
      header = entry.request.headers.find { |h| h['name'] == "foo" }
      header['value'].should == "bar"
    end
  end

  it "should fetch a HAR" do
    proxy.new_har("1")
    driver.get url_for("1.html")
    wait.until { driver.title == '1' }

    proxy.new_page "2"
    driver.get url_for("2.html")
    wait.until { driver.title == '2' }

    har = proxy.har

    har.should be_kind_of(HAR::Archive)
    har.pages.size.should == 2
  end

  it "should fetch a HAR and capture headers" do
    proxy.new_har("2", :capture_headers => true)

    driver.get url_for("2.html")
    wait.until { driver.title == '2' }

    entry = proxy.har.entries.first
    entry.should_not be_nil

    entry.request.headers.should_not be_empty
  end

  it "should fetch a HAR and capture content" do
    proxy.new_har("2", :capture_content => true)

    driver.get url_for("2.html")
    wait.until { driver.title == '2' }

    entry = proxy.har.entries.first
    entry.should_not be_nil

    entry.response.content.size.should be > 0
    entry.response.content.text.should == File.read("spec/fixtures/2.html")
  end

  it "should fetch a HAR and capture binary content as Base64 encoded string" do
    proxy.new_har("binary", :capture_binary_content => true)

    driver.get url_for("empty.gif")

    entry = proxy.har.entries.first
    entry.should_not be_nil

    entry.response.content.size.should be > 0
    require 'base64'
    expected_content = Base64.encode64(File.read("spec/fixtures/empty.gif")).strip
    entry.response.content.text.should == expected_content
  end

  describe 'whitelist' do
    it "allows access to urls in whitelist" do
      dest = url_for('1.html')

      proxy.whitelist(Regexp.quote(dest), 404)
      driver.get dest
      wait.until { driver.title == '1' }
    end

    it "disallows access to urls outside whitelist" do
      proxy.new_har('whitelist')
      proxy.whitelist('foo\.bar\.com', 404)
      driver.get url_for('2.html')
      proxy.har.entries.first.response.status.should == 404
    end

    it "can be cleared" do
      proxy.new_har('whitelist')
      proxy.whitelist('foo\.bar\.com', 404)

      proxy.clear_whitelist
      driver.get url_for('2.html')
      proxy.har.entries.first.response.status.should_not == 404
    end
  end

  describe 'blacklist' do
    it "disallows access to urls in blacklist" do
      proxy.new_har('blacklist')

      dest = url_for('1.html')
      proxy.blacklist(Regexp.quote(dest), 404)
      driver.get dest

      entry = proxy.har.entries.find { |e| e.request.url == dest }
      entry.should_not be_nil
      entry.response.status.should == 404
    end

    it "allows access to urls outside blacklist" do
      proxy.blacklist('foo\.bar\.com', 404)
      driver.get url_for('2.html')

      wait.until { driver.title == '2' }
    end

    it "can be cleared" do
      proxy.new_har('blacklist')

      dest = url_for('1.html')
      proxy.blacklist(Regexp.quote(dest), 404)

      proxy.clear_blacklist
      driver.get dest

      entry = proxy.har.entries.find { |e| e.request.url == dest }
      entry.should_not be_nil
      entry.response.status.should_not == 404
    end
  end

  describe 'rewrite rules' do

    let(:uri) { URI.parse url_for('1.html') }

    before do
      proxy.rewrite(%r{1\.html}, '2.html')
    end

    it 'fetches the rewritten url' do
      driver.get uri

      wait.until { driver.title == '2' }
    end

    it 'can be cleared' do
      proxy.clear_rewrites
      driver.get uri

      wait.until { driver.title == '1' }
    end

  end

  it 'should set timeouts' do
    proxy.timeouts(read: 0.001)
    driver.get url_for('slow')
    wait.until { driver.title == 'Problem loading page' } # This title appears in Firefox
  end

  it "should set headers" do
    proxy.headers('Content-Type' => "text/html")
  end

  it "should set limits" do
    proxy.limit(:downstream_kbps => 100, :upstream_kbps => 100, :latency => 2)
  end

  it 'should remap given DNS hosts' do
    uri = URI.parse url_for('1.html')
    host = 'plus.google.com'

    proxy.remap_dns_hosts(host => uri.host)
    uri.host = host

    driver.get uri
    wait.until { driver.title == '1' }
  end

end


text:
import { Direction, cmd } from 'affinity-engine-stage';

export default Direction.extend({
  _configurationTiers: [
    'all',
    'component.stage.all',
    'component.stage.direction.appender'
  ],

  _setup: cmd(function(footerText) {
    this.link('all', { footerText });
  })
});


text:
/// By Teemu Kaukoranta, member of the Oulu GamedevClub Stage
/// http://www.gamedevcenter.org
///
/// Part of the S.o.l.u.m project
/// Licensed under WTFPL - Do What The Fuck You Want To Public License
/// It would be nice if you don't remove this comment section though

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace Solum.Utility
{
    class TextureRefs
    {
        public static Texture2D koala;
        public static Texture2D menuBgImage;
        public static Texture2D menuButton;
    }
}


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**docs** | [**Array<models.MongoModel>**](models.MongoModel.md) |  | [optional] [default to null]
**total** | **number** |  | [optional] [default to null]
**limit** | **number** |  | [optional] [default to null]
**page** | **number** |  | [optional] [default to null]
**pages** | **number** |  | [optional] [default to null]


text:
package com.helospark.spark.builder.dialogs.domain;

import java.util.Collections;
import java.util.List;

import javax.annotation.Generated;

/**
 * Data for the dialog.
 * @author helospark
 */
public class RegularBuilderDialogData {
    private List<RegularBuilderFieldIncludeFieldIncludeDomain> regularBuilderFieldIncludeFieldIncludeDomains;
    private boolean shouldCreateCopyMethod;
    private boolean addJacksonDeserializeAnnotation;
    private boolean createDefaultConstructor;
    private boolean createPublicConstructorWithMandatoryFields;

    @Generated("SparkTools")
    private RegularBuilderDialogData(Builder builder) {
        this.regularBuilderFieldIncludeFieldIncludeDomains = builder.regularBuilderFieldIncludeFieldIncludeDomains;
        this.shouldCreateCopyMethod = builder.shouldCreateCopyMethod;
        this.addJacksonDeserializeAnnotation = builder.addJacksonDeserializeAnnotation;
        this.createDefaultConstructor = builder.createDefaultConstructor;
        this.createPublicConstructorWithMandatoryFields = builder.createPublicConstructorWithMandatoryFields;
    }

    public List<RegularBuilderFieldIncludeFieldIncludeDomain> getRegularBuilderFieldIncludeFieldIncludeDomains() {
        return regularBuilderFieldIncludeFieldIncludeDomains;
    }

    public boolean shouldCreateCopyMethod() {
        return shouldCreateCopyMethod;
    }

    public boolean isAddJacksonDeserializeAnnotation() {
        return addJacksonDeserializeAnnotation;
    }

    public boolean isCreateDefaultConstructor() {
        return createDefaultConstructor;
    }

    public boolean isCreatePublicConstructorWithMandatoryFields() {
        return createPublicConstructorWithMandatoryFields;
    }

    @Generated("SparkTools")
    public static Builder builder() {
        return new Builder();
    }

    @Generated("SparkTools")
    public static final class Builder {
        private List<RegularBuilderFieldIncludeFieldIncludeDomain> regularBuilderFieldIncludeFieldIncludeDomains = Collections.emptyList();
        private boolean shouldCreateCopyMethod;
        private boolean addJacksonDeserializeAnnotation;
        private boolean createDefaultConstructor;
        private boolean createPublicConstructorWithMandatoryFields;

        private Builder() {
        }

        public Builder withRegularBuilderFieldIncludeFieldIncludeDomains(List<RegularBuilderFieldIncludeFieldIncludeDomain> regularBuilderFieldIncludeFieldIncludeDomains) {
            this.regularBuilderFieldIncludeFieldIncludeDomains = regularBuilderFieldIncludeFieldIncludeDomains;
            return this;
        }

        public Builder withShouldCreateCopyMethod(boolean shouldCreateCopyMethod) {
            this.shouldCreateCopyMethod = shouldCreateCopyMethod;
            return this;
        }

        public Builder withAddJacksonDeserializeAnnotation(boolean addJacksonDeserializeAnnotation) {
            this.addJacksonDeserializeAnnotation = addJacksonDeserializeAnnotation;
            return this;
        }

        public Builder withCreateDefaultConstructor(boolean createDefaultConstructor) {
            this.createDefaultConstructor = createDefaultConstructor;
            return this;
        }

        public Builder withCreatePublicConstructorWithMandatoryFields(boolean createPublicConstructorWithMandatoryFields) {
            this.createPublicConstructorWithMandatoryFields = createPublicConstructorWithMandatoryFields;
            return this;
        }

        public RegularBuilderDialogData build() {
            return new RegularBuilderDialogData(this);
        }
    }

}


text:
package com.newbiechen.chatdemo.widget;

import android.content.Context;
import android.graphics.Typeface;
import android.os.Handler;
import android.os.Looper;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.RelativeLayout;

import com.newbiechen.chatdemo.R;
import com.newbiechen.chatdemo.fragment.FaceContentFragment;
import com.newbiechen.chatdemo.fragment.ToolFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by PC on 2016/11/20.
 */

public class ChatFrameView extends RelativeLayout
        implements KeyboardStateHelper.OnKeyboardStateChangeListener{
    public static final int STATE_HIDE = 0;
    public static final int STATE_FACE = 1;
    public static final int STATE_MORE = 2;

    private ViewPager mVpBox;
    private CheckBox mCbFace;
    private CheckBox mCbMore;
    private EditText mEtInput;
    private Button mBtnSend;

    private Context mContext;
    private InputMethodManager mImm;
    private KeyboardStateHelper mStateHelper;
    private OnChatFrameListener mChatFrameListener;

    private FaceContentFragment mFaceContentFragment;
    private ToolFragment mToolFragment;

    private String mSendContent = "";
    private final Handler mHandler = new Handler(Looper.getMainLooper());
    private int mFrameState = STATE_HIDE;

    public ChatFrameView(Context context) {
        this(context,null);
    }

    public ChatFrameView(Context context, AttributeSet attrs) {
        this(context, attrs,0);
    }

    public ChatFrameView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        mContext = context;
        init();
    }

    private void init(){
        initView();
        initWidget();
        initListener();
    }

    private void initView(){
        //将聊天框加入到该Layout中
        View view = LayoutInflater.from(mContext).inflate(R.layout.view_chat_frame,this,false);
        addView(view);

        mCbFace = (CheckBox) view.findViewById(R.id.frame_cb_face);
        mCbMore = (CheckBox) view.findViewById(R.id.frame_cb_more);
        mEtInput = (EditText) view.findViewById(R.id.frame_et_message);
        mBtnSend = (Button) view.findViewById(R.id.frame_btn_send);
        mVpBox = (ViewPager) view.findViewById(R.id.frame_vp_box);
        changeSendState();
    }

    private void initWidget(){
        //这里有可能出错,小心
        mStateHelper = new KeyboardStateHelper((AppCompatActivity) getContext());
        mStateHelper.setOnKeyboardStateChangeListener(this);
        mImm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
        mEtInput.setTypeface(Typeface.createFromAsset(mContext.getAssets(),"fonts/AppleColorEmoji.ttf"));
        changeSendState();
        setUpViewPager();
    }

    private void setUpViewPager(){
        mFaceContentFragment = new FaceContentFragment();
        mToolFragment = new ToolFragment();

        final List<Fragment> mFragmentList = new ArrayList<>();
        mFragmentList.add(mFaceContentFragment);
        mFragmentList.add(mToolFragment);

        AppCompatActivity mActivity = (AppCompatActivity) mContext;
        FragmentPagerAdapter adapter = new FragmentPagerAdapter(mActivity.getSupportFragmentManager()) {
            @Override
            public Fragment getItem(int position) {
                return mFragmentList.get(position);
            }

            @Override
            public int getCount() {
                return mFragmentList.size();
            }
        };
        mVpBox.setAdapter(adapter);
    }

    /**
     * 设置Button是否可点击
     */
    private void changeSendState(){
        if (mSendContent.equals("")){
            mBtnSend.setSelected(false);
        }
        else{
            mBtnSend.setSelected(true);
        }
    }

    private void initListener(){
        //当输入的时候的监听
        mEtInput.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

            }

            @Override
            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
                mSendContent = charSequence.toString().trim();
                changeSendState();
            }

            @Override
            public void afterTextChanged(Editable editable) {

            }
        });

        //发送数据的点击事件
        mBtnSend.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if(mChatFrameListener != null && !mSendContent.equals("")){
                    //发送数据
                    mChatFrameListener.sendMessage(mSendContent);
                    mSendContent = "";
                    mEtInput.setText(mSendContent);
                    changeSendState();
                }
            }
        });

        mCbFace.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                checkFrameState(STATE_FACE);
                mVpBox.setCurrentItem(0,false);
            }
        });

        mCbMore.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                checkFrameState(STATE_MORE);
                mVpBox.setCurrentItem(1,false);
            }
        });

        mEtInput.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                //隐藏toolbox
                hideToolBox();
            }
        });

        mVpBox.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {

            }

            @Override
            public void onPageSelected(int position) {
                //切换按钮的状态
                switch (position){
                    case 0:
                        changeState(STATE_FACE);
                        break;
                    case 1:
                        changeState(STATE_MORE);
                        break;
                }
            }

            @Override
            public void onPageScrollStateChanged(int state) {

            }
        });

        mFaceContentFragment.setOnFaceClickListener(new FaceContentFragment.OnFaceClickListener() {
            @Override
            public void onFaceClick(String code) {
                mEtInput.getText().append(code);
            }
        });
    }

    private void checkFrameState(int state){
        //判断是否ViewPager打开了,如果打开了,并且等于当前状态,就表示关闭
        if (isBoxOpening() && state == mFrameState){
            hideToolBox();
        }
        else {
            //首先关闭软键盘
            hideKeyBoard();
            //首先关闭软件盘后再打开工具箱
            postDelayed(new Runnable() {
                @Override
                public void run() {
                    mVpBox.setVisibility(View.VISIBLE);
                }
            }, 50);
            changeState(state);
        }
    }

    private void changeState(int state){
        //修改当前状态
        mFrameState = state;

        //将CheckBox的状态修改回来
        mCbFace.setChecked(state == STATE_FACE);
        mCbMore.setChecked(state == STATE_MORE);
    }

    private void hideKeyBoard(){
        if (mStateHelper.getKeyboardState()){
            mImm.toggleSoftInput(0,InputMethodManager.HIDE_NOT_ALWAYS);
            mStateHelper.setKeyboardState(false);
        }
    }

    private void hideToolBox(){
        if (mFrameState != STATE_HIDE){
            //首先隐藏ViewPager
            mVpBox.setVisibility(GONE);
            //将按钮恢复原状
            mCbFace.setChecked(false);
            mCbMore.setChecked(false);
            //修改当前状态
            mFrameState = STATE_HIDE;
        }
    }

    private boolean isBoxOpening(){
        return mVpBox.getVisibility() == View.VISIBLE;
    }

    @Override
    public void onKeyboardOpen(int keyboardHeight) {
    }

    @Override
    public void onKeyboardClosed() {
    }

    public interface OnChatFrameListener{
        //发送数据的回调
        void sendMessage(String inputContent);
    }

    /*************************************公共的方法**********************************/
    public void setOnChatFrameListener(OnChatFrameListener listener){
        mChatFrameListener = listener;
    }

    public int getFrameState(){
        return mFrameState;
    }

    public void hideLayout(){
        hideToolBox();
        hideKeyBoard();
    }

    public void removeChatFrame(){
        mStateHelper.removeKeyboardStateHelper();
    }
}


text:
package io.cdap.transformation;

import io.cdap.transformation.api.NotFoundException;
import org.junit.Assert;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

public class DefaultMutableRowValueTest {

  @Test(expected = IllegalArgumentException.class)
  public void testNullValueMap() {
    new DefaultMutalbeRowValue(null);
  }

  @Test(expected = NotFoundException.class)
  public void testGetNonexisting() throws Exception {
    new DefaultMutalbeRowValue(new HashMap<>()).getColumnValue("non");
  }

  @Test(expected = IllegalArgumentException.class)
  public void testSetNullColumnName() {
    new DefaultMutalbeRowValue(new HashMap<>()).setColumnValue(null, "value");
  }

  @Test(expected = IllegalArgumentException.class)
  public void testRenameNonexisting() {
    new DefaultMutalbeRowValue(new HashMap<>()).renameColumn("non", "new");
  }

  @Test(expected = IllegalArgumentException.class)
  public void testRenameToExisting() {
    DefaultMutalbeRowValue defaultRowValue = new DefaultMutalbeRowValue(new HashMap<>());
    defaultRowValue.setColumnValue("col1", "value1");
    defaultRowValue.setColumnValue("col2", "value2");
    defaultRowValue.renameColumn("col1", "col2");
  }

  @Test
  public void testGetSetRename() throws Exception {

    Map<String, Object> valuesMap = new HashMap<>();
    valuesMap.put("col1", "value1");
    valuesMap.put("col2", true);
    DefaultMutalbeRowValue rowValue = new DefaultMutalbeRowValue(valuesMap);
    //get
    Assert.assertEquals("value1", rowValue.getColumnValue("col1"));
    Assert.assertEquals(Boolean.TRUE, rowValue.getColumnValue("col2"));

    //set
    rowValue.setColumnValue("col1", "value2");
    Assert.assertEquals("value2", rowValue.getColumnValue("col1"));

    //rename
    rowValue.renameColumn("col1", "col3");
    Assert.assertEquals("value2", rowValue.getColumnValue("col3"));

  }

}


text:
var github = require('./github.js');
var logger = require('winston');

// TODO: add validation!
module.exports = {
	// WebRTC signaling
	shareVideo: function(session, clientId, data) {
		logger.log('debug', clientId + ' is sharing audio and/or video');
		session.shareVideo(clientId, data.includeAudio, data.includeVideo);
	},

	unshareVideo: function(session, clientId, data) {
		logger.log('debug', clientId + ' is unsharing video');
		session.unshareVideo(clientId);
	},

	rtcMessage: function(session, clientId, data) {
		logger.log('debug', 'Video signaling message');
		session.forwardRTCMessage(clientId, data);
	},

	// Text operation
	opText: function(session, clientId, data) {
		session.applyOp(clientId, data.op, data.rev);
	},

	// Selection operation
	opCursor: function(session, clientId, data) {
		session.applyCursor(clientId, data.sel);
	},

	// Request a GitHub repo tree
	reqWorkspace: function(session, clientId, data) {
		var user = data.user;
		var repo = data.repo;
		var sha = data.sha;

		session.setWorkspaceAsync(user, repo, function(success, error) {
			github.getBranches(user,repo, function(branches) {
				github.getTree(user, repo, sha, function(tree) {
					success({
						'user' : data.user,
						'repo' : data.repo,
						'tree' : tree,
						'branches': branches
					});
				},
				function(err) {
					error(err);
				});
			},
			function(err){
				error(err);
			});
		});
	},

	// Request a GitHub file
	reqDoc: function(session, clientId, data) {
		var user = data.user;
		var repo = data.repo;
		var sha = data.sha;

		session.setDocAsync(data.filename, data.filepath, function(success, error) {
			github.getFile(user, repo, sha, function(file) {
				success(file, data.filename, data.filepath);
			},
			function(err) {
				error(err);
			});
		});
	},

	// Set a folder to open or closed
	setWorkTreeState: function(session, clientId, data) {
		session.setWorkTreeState(data.path, data.isopen);
	},

	setLang: function(session, clientId, data) {
		session.setLang(clientId, data.lang);
	},

	// Create a patch file of project changes
	createPatch: function(session, clientId, data) {
		session.createPatch(clientId);
	}
};


text:
<!DOCTYPE html>

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<title>Job 8 (WEB)</title>
<link href="../../../build/mobile.css" rel="stylesheet" />

World English BibleJob 8<
=
>

8

1 Then Bildad the Shuhite answered,

2 "How long will you speak these things?

Shall the words of your mouth be a mighty wind?

3 Does God pervert justice?

Or does the Almighty pervert righteousness?

4 If your children have sinned against him,

He has delivered them into the hand of their disobedience.

5 If you want to seek God diligently,

make your supplication to the Almighty.

6 If you were pure and upright,

surely now he would awaken for you,

and make the habitation of your righteousness prosperous.

7 Though your beginning was small,

yet your latter end would greatly increase.

8 "Please inquire of past generations.

Find out about the learning of their fathers.

9 (For we are but of yesterday, and know nothing,

because our days on earth are a shadow.)

10 Shall they not teach you, tell you,

and utter words out of their heart?

11 "Can the papyrus grow up without mire?

Can the rushes grow without water?

12 While it is yet in its greenness, not cut down,

it withers before any other reed.

13 So are the paths of all who forget God.

The hope of the godless man shall perish,

14 Whose confidence shall break apart,

Whose trust is a spider's web.

15 He shall lean on his house, but it shall not stand.

He shall cling to it, but it shall not endure.

16 He is green before the sun.

His shoots go out along his garden.

17 His roots are wrapped around the rock pile.

He sees the place of stones.

18 If he is destroyed from his place,

then it shall deny him, saying, 'I have not seen you.'

19 Behold, this is the joy of his way:

out of the earth, others shall spring.

20 "Behold, God will not cast away a blameless man,

neither will he uphold the evildoers.

21 He will still fill your mouth with laughter,

your lips with shouting.

22 Those who hate you shall be clothed with shame.

The tent of the wicked shall be no more."

+1:1The Hebrew word rendered "God" is "אֱלֹהִ֑ים" (Elohim).+1:6"Yahweh" is God's proper Name, sometimes rendered "LORD" (all caps) in other translations.+1:12"Behold", from "הִנֵּה", means look at, take notice, observe, see, or gaze at. It is often used as an interjection.+5:25or, seed+7:9Sheol is the place of the dead.

<
=
>


text:
<?php

class Ess_M2ePro_Block_Adminhtml_Ebay_Account_Edit_Tabs extends Ess_M2ePro_Block_Adminhtml_Widget_Tabs
{
    //########################################

    public function __construct()
    {
        parent::__construct();

        // Initialization block
        // ---------------------------------------
        $this->setId('ebayAccountEditTabs');
        // ---------------------------------------

        $this->setTitle(Mage::helper('M2ePro')->__('Configuration'));
        $this->setDestElementId('edit_form');
    }

    protected function _beforeToHtml()
    {
        $this->addTab(
            'general', array(
            'label'   => Mage::helper('M2ePro')->__('General'),
            'title'   => Mage::helper('M2ePro')->__('General'),
            'content' => $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_account_edit_tabs_general')->toHtml(),
            )
        );

        if (Mage::helper('M2ePro/Data_Global')->getValue('temp_data') &&
            Mage::helper('M2ePro/Data_Global')->getValue('temp_data')->getId()) {
            $isAdvancedMode = Mage::helper('M2ePro/View_Ebay')->isAdvancedMode();

            if ($isAdvancedMode) {
                $this->addTab(
                    'listingOther', array(
                    'label'   => Mage::helper('M2ePro')->__('3rd Party Listings'),
                    'title'   => Mage::helper('M2ePro')->__('3rd Party Listings'),
                    'content' => $this->getLayout()
                        ->createBlock('M2ePro/adminhtml_ebay_account_edit_tabs_listingOther')->toHtml(),
                    )
                );
            }

            $this->addTab(
                'store', array(
                     'label'   => Mage::helper('M2ePro')->__('eBay Store'),
                     'title'   => Mage::helper('M2ePro')->__('eBay Store'),
                     'content' => $this->getLayout()
                                       ->createBlock('M2ePro/adminhtml_ebay_account_edit_tabs_store')->toHtml(),
                )
            );
            $this->addTab(
                'order', array(
                     'label'   => Mage::helper('M2ePro')->__('Orders'),
                     'title'   => Mage::helper('M2ePro')->__('Orders'),
                     'content' => $this->getLayout()
                                       ->createBlock('M2ePro/adminhtml_ebay_account_edit_tabs_order')->toHtml(),
                )
            );

            if ($isAdvancedMode) {
                $this->addTab(
                    'feedback', array(
                    'label'   => Mage::helper('M2ePro')->__('Feedback'),
                    'title'   => Mage::helper('M2ePro')->__('Feedback'),
                    'content' => $this->getLayout()
                        ->createBlock('M2ePro/adminhtml_ebay_account_edit_tabs_feedback')->toHtml(),
                    )
                );
            }
        }

        $this->setActiveTab($this->getRequest()->getParam('tab', 'general'));

        return parent::_beforeToHtml();
    }

    //########################################
}


text:
package com.kentchiu.tree.visitor;

import com.kentchiu.tree.domain.Node;
import com.kentchiu.tree.domain.Visitor;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;

public class TreePrintVisitor<T extends Node> implements Visitor<T> {

    int i = 0;
    private Function<T, String> function;
    private List<String> lines = new ArrayList<>();

    public TreePrintVisitor(Function<T, String> function) {
        this.function = function;
    }

    public List<String> getLines() {
        return lines;
    }

    protected void dump(T node) {
        String repeat = StringUtils.repeat(" │ ", i - 1);
        String line = repeat + " ├─ " + function.apply(node);
        lines.add(line);
    }

    @Override
    public boolean visitEnter(T node) {
        i++;
        return true;
    }

    @Override
    public boolean visitLeave(T node) {
        i--;
        return true;
    }

    @Override
    public boolean visit(T node) {
        dump(node);
        return true;
    }
}


text:
require File.expand_path '../../test_helper', __dir__

# Storage Container Class
class TestGetContainerAcl < Minitest::Test
  # This class posesses the test cases for the requests of getting storage container acl.
  def setup
    Fog.mock!
    @mock_service = Fog::Storage::AzureRM.new(storage_account_credentials)
    Fog.unmock!
    @mocked_response = mocked_storage_http_error

    @service = Fog::Storage::AzureRM.new(storage_account_credentials)
    @blob_client = @service.instance_variable_get(:@blob_client)

    @raw_container_acl = ApiStub::Requests::Storage::Directory.raw_container_acl
    @container_acl = ApiStub::Requests::Storage::Directory.container_acl
  end

  def test_get_container_acl_success
    @blob_client.stub :get_container_acl, @raw_container_acl do
      assert_equal @container_acl, @service.get_container_acl('test_container')
    end
  end

  def test_get_container_acl_http_exception
    http_exception = ->(*) { raise Azure::Core::Http::HTTPError.new(@mocked_response) }
    @blob_client.stub :get_container_acl, http_exception do
      assert_raises(Azure::Core::Http::HTTPError) do
        @service.get_container_acl('test_container')
      end
    end
  end

  def test_get_container_acl_mock
    assert_equal @container_acl, @mock_service.get_container_acl('test_container')
  end
end


text:
@interface SBTopBottomMenuNavigationController : UINavigationController

@property (nonatomic, strong) SBMenuController *topMenuController;
@property (nonatomic, strong) SBMenuController *bottomMenuController;

- (void)setTopMenuPanGestureEnabled:(BOOL)enabled;
- (void)showTopMenuAnimated:(BOOL)animated;
- (void)hideTopMenuAnimated:(BOOL)animated;
- (BOOL)isTopMenuVisible;

- (void)setBottomMenuPanGestureEnabled:(BOOL)enabled;
- (void)showBottomMenuAnimated:(BOOL)animated;
- (void)hideBottomMenuAnimated:(BOOL)animated;
- (BOOL)isBottomMenuVisible;

@end


text:
namespace chromecast {
namespace shell {

namespace {

const char kTargetTypePage[] = "page";
const char kTargetTypeServiceWorker[] = "service_worker";
const char kTargetTypeSharedWorker[] = "worker";
const char kTargetTypeOther[] = "other";

class Target : public content::DevToolsTarget {
 public:
  explicit Target(scoped_refptr<content::DevToolsAgentHost> agent_host);

  std::string GetId() const override { return agent_host_->GetId(); }
  std::string GetParentId() const override { return std::string(); }
  std::string GetType() const override {
    switch (agent_host_->GetType()) {
      case content::DevToolsAgentHost::TYPE_WEB_CONTENTS:
        return kTargetTypePage;
      case content::DevToolsAgentHost::TYPE_SERVICE_WORKER:
        return kTargetTypeServiceWorker;
      case content::DevToolsAgentHost::TYPE_SHARED_WORKER:
        return kTargetTypeSharedWorker;
      default:
        break;
    }
    return kTargetTypeOther;
  }
  std::string GetTitle() const override { return agent_host_->GetTitle(); }
  std::string GetDescription() const override { return std::string(); }
  GURL GetURL() const override { return agent_host_->GetURL(); }
  GURL GetFaviconURL() const override { return favicon_url_; }
  base::TimeTicks GetLastActivityTime() const override {
    return last_activity_time_;
  }
  bool IsAttached() const override { return agent_host_->IsAttached(); }
  scoped_refptr<content::DevToolsAgentHost> GetAgentHost() const override {
    return agent_host_;
  }
  bool Activate() const override { return agent_host_->Activate(); }
  bool Close() const override { return agent_host_->Close(); }

 private:
  scoped_refptr<content::DevToolsAgentHost> agent_host_;
  GURL favicon_url_;
  base::TimeTicks last_activity_time_;

  DISALLOW_COPY_AND_ASSIGN(Target);
};

Target::Target(scoped_refptr<content::DevToolsAgentHost> agent_host)
    : agent_host_(agent_host) {
  if (content::WebContents* web_contents = agent_host_->GetWebContents()) {
    content::NavigationController& controller = web_contents->GetController();
    content::NavigationEntry* entry = controller.GetActiveEntry();
    if (entry != NULL && entry->GetURL().is_valid())
      favicon_url_ = entry->GetFavicon().url;
    last_activity_time_ = web_contents->GetLastActiveTime();
  }
}

}  // namespace

// CastDevToolsDelegate -----------------------------------------------------

CastDevToolsDelegate::CastDevToolsDelegate() {
}

CastDevToolsDelegate::~CastDevToolsDelegate() {
}

std::string CastDevToolsDelegate::GetDiscoveryPageHTML() {
#if defined(OS_ANDROID)
  return std::string();
#else
  return ResourceBundle::GetSharedInstance().GetRawDataResource(
      IDR_CAST_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string();
#endif  // defined(OS_ANDROID)
}

bool CastDevToolsDelegate::BundlesFrontendResources() {
  return false;
}

base::FilePath CastDevToolsDelegate::GetDebugFrontendDir() {
  return base::FilePath();
}

scoped_ptr<net::ServerSocket>
CastDevToolsDelegate::CreateSocketForTethering(std::string* name) {
  return scoped_ptr<net::ServerSocket>();
}

// CastDevToolsManagerDelegate -----------------------------------------------

CastDevToolsManagerDelegate::CastDevToolsManagerDelegate() {
}

CastDevToolsManagerDelegate::~CastDevToolsManagerDelegate() {
}

base::DictionaryValue* CastDevToolsManagerDelegate::HandleCommand(
    content::DevToolsAgentHost* agent_host,
    base::DictionaryValue* command) {
  return NULL;
}

std::string CastDevToolsManagerDelegate::GetPageThumbnailData(
    const GURL& url) {
  return "";
}

scoped_ptr<content::DevToolsTarget>
CastDevToolsManagerDelegate::CreateNewTarget(const GURL& url) {
  return scoped_ptr<content::DevToolsTarget>();
}

void CastDevToolsManagerDelegate::EnumerateTargets(TargetCallback callback) {
  TargetList targets;
  content::DevToolsAgentHost::List agents =
      content::DevToolsAgentHost::GetOrCreateAll();
  for (content::DevToolsAgentHost::List::iterator it = agents.begin();
       it != agents.end(); ++it) {
    targets.push_back(new Target(*it));
  }
  callback.Run(targets);
}

}  // namespace shell
}  // namespace chromecast


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

  <title>NEGATED :nth-last-of-type() pseudo-class</title>

  <link rel="first" href="css3-modsel-1.xml" title="Groups of selectors"/>
  <link rel="prev" href="css3-modsel-76.xml" title="NEGATED :nth-last-of-type() pseudo-class"/>
  <link rel="next" href="css3-modsel-77.xml" title="NEGATED :first-child pseudo-class"/>
  <link rel="last" href="css3-modsel-d4.xml" title="Dynamic updating of :first-child and :last-child"/>
  <link rel="up" href="./index.html"/>
  <link rel="top" href="../../index.html"/>

This paragraph should be unstyled.

<address>This address should be unstyled.</address>

This paragraph should have green background.

This paragraph should have green background.

First definition term that should have green background.

First definition that should also have a green background.

Second definition term that should have green background.

Second definition that should have green background.

Third definition term.

Third definition.

Fourth definition term that should have green background.

Fourth definition that should have green background.

Fifth definition term that should have green background.

Fifth definition that should have green background.

Sixth definition term.

Sixth definition.


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<title>PSYC 3320: Psycholinguistics</title>

<meta  http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta  name="generator" content="Org-mode" />

PSYC 3320: Psycholinguistics

Contact info

Professor: Thomas J. Faulkenberry, Ph.D

Office: Math 319

Office hours: MWF 8-11 am (or by appointment)

Email: faulkenberry@tarleton.edu

Website: http://tomfaulkenberry.github.io

Phone: 254-968-9816

Course description

(from catalog) The course emphasizes the study of language, understanding languages, producing language and speech, language development, and related topics such as reading, language and the brain, linguistic diversity, and universals.

Psycholinguistics is an area of specialization within cognitive psychology that focuses on the psychological mechanisms of language processing.  This course provides an introduction to the field of psycholinguistics. Psycholinguistics is the field that studies the information processing mechanisms that govern the use of language in comprehension and production, acquisition, and representation.  A common misconception is that one learns about the specifics of particular languages in a course on psycholinguistics.  This is not the case.  Rather, like most of cognitive psychology, this course emphasizes the commonalities that underlie human languages everywhere, and we will focus on what these commonalities tell us about the human ability to construct and understand language.

Course materials

The Psychology of Language: From Data to Theory (4th ed.) by Harley Amazon link

Student learning outcomes

Define the basic vocabulary of psycholinguistics

Discuss the biological bases of human communication.

Describe how humans perceive and produce speech.

Describe how sentences and discourse are processed and comprehended.

Discuss the acquisition of language.

Describe the psychological processes involved in reading.

Identify and explain problems in speech and language processes.

Explain bilingualism and second language acquisition.

Requirements and grading

Exam 1 (100 pts)

Exam 2 (100 pts)

Exam 3 (100 pts)

Exam 4 (100 pts)

Unit quizzes (100 pts)

Total = 500 points

Grades will be assigned based on the percentage of points you accumulate out of these 500 points.  I will use the standard grading scale of A=90%, B=80%, etc.

Exams (80% of grade)

There will be four total exams throughout the semester, occurring
approximately once every 2  weeks.  They will cover material
from your reading, online lectures, and quizzes.  Exam questions will be a mix of multiple choice and short answer.  Exams are due by 11:59 pm on
the due date (see below).  Each exam will have a time limit and may only
be attempted once.

Due dates:

Exam 1 (Wednesday, June 28 at 11:59 pm)

Exam 2 (Wednesday, July 12 at 11:59 pm)

Exam 3 (Wednesday, July 26 at 11:59 pm)

Final exam (Wednesday, August 9 at 11:59 pm)

Unit quizzes (20% of grade)

At the end of each unit, you will complete a quiz over the content of that
unit. Each quiz will be graded as number correct out of 10 possible points.  Your total quiz grade will be computed by scaling your average quiz percentage up to a 100 point score.  For example, if you average 8.6/10 on your unit quizzes, your total quiz grade for the semester will be 86/100.

Course Communication

Email is the primary means of communication for this course.  If you have questions about the course, always feel free to send me an email at faulkenberry@tarleton.edu.  I only ask that you adhere to two guidelines:

please include the course number (PSYC 3320) in the subject line.  For example, one good way to do this is:  Subject: [PSYC 3320] Question about Exam 2

please use proper email etiquette.  Include a salutation (e.g., Dear Dr. Faulkenberry), complete sentences, and a closing (e.g., "Regards, Your Name").  You might be surprised how many times I get an email from a nondescript email address with no indication from WHOM the email was sent!

Also, I will be sending periodic emails to each of you that update you on course progress, due dates, etc.  It is imperative that you check your Tarleton email address regularly so that you don't miss any of these messages.

University Policy on "F" Grades

Beginning in Fall 2015, Tarleton will begin differentiating between a
failed grade in a class because a student never attended (F0 grade),
stopped attending at some point in the semester (FX grade), or because
the student did not pass the course (F) but attended the entire semester.
These grades will be noted on the official transcript. Stopping or never
attending class can result in the student having to return aid monies
received.  For more information see the Tarleton Financial Aid website.

Academic Honesty

Tarleton State University expects its students to maintain high standards of
personal and scholarly conduct. Students guilty of academic dishonesty are
subject to disciplinary action. Cheating, plagiarism (submitting another person's materials or ideas as one's own), or doing work for another person who will receive academic credit are all disallowed. This includes the use of unauthorized books, notebooks, or other sources in order to secure of give help during an examination, the unauthorized copying of examinations, assignments, reports, or term papers, or the presentation of unacknowledged material as if it were the student's own work. Disciplinary action may be taken beyond the academic discipline administered by the faculty member who teaches the course in which the cheating took place.

In particular, any exam taken online must be completed without the aid of any unauthorized resource (including using any search engine, Google, etc.).  Authorized resources are limited only to the official textbook and any lecture notes from the course.  Any other authorized resources will be provided to you before the exam.  The minimum sanction for violation of this policy is a grade of 0 on the affected exam.

Each student's honesty and integrity are taken for granted. However, if I find
evidence of academic misconduct I will pursue the matter
to the fullest extent permitted by the university. ACADEMIC MISCONDUCT OR
DISHONESTY WILL RESULT IN A GRADE OF F FOR THE COURSE.  Students are
strongly advised to avoid even the appearance of academic misconduct.

Academic Affairs Core Value Statements

Academic Integrity Statement

Tarleton State University's core values are integrity, leadership, tradition, civility, excellence, and service.  Central to these values is integrity, which is maintaining a high standard of personal and scholarly conduct.  Academic integrity represents the choice to uphold ethical responsibility for one's learning within the academic community, regardless of audience or situation.

Academic Civility Statement

Students are expected to interact with professors and peers in a respectful manner that enhances the learning environment. Professors may require a student who deviates from this expectation to leave the face-to-face (or virtual) classroom learning environment for that particular class session (and potentially subsequent class sessions) for a specific amount of time. In addition, the professor might consider the university disciplinary process (for Academic Affairs/Student Life) for egregious or continued disruptive behavior.

Academic Excellence Statement

Tarleton holds high expectations for students to assume responsibility for their own individual learning. Students are also expected to achieve academic excellence by:

honoring Tarleton's core values, upholding high standards of habit and behavior.

maintaining excellence through class attendance and punctuality, preparing for active participation in all learning experiences.

putting forth their best individual effort.

continually improving as independent learners.

engaging in extracurricular opportunities that encourage personal and academic growth.

reflecting critically upon feedback and applying these lessons to meet future challenges.

Students with Disabilities Policy

It is the policy of Tarleton State University to comply with the Americans
with Disabilities Act and other applicable laws. If you are a student with a
disability seeking accommodations for this course, please contact Trina
Geye, Director of Student Disability Services, at 254.968.9400 or
geye@tarleton.edu. Student Disability Services is
located in Math 201. More information can be found at www.tarleton.edu/sds or in the University Catalog.

Note:  any changes to this syllabus will be communicated to you by the instructor!

Semester Schedule

<colgroup>
<col  class="left" />

<col  class="left" />

<col  class="right" />
</colgroup>

Unit
Topic
Book chapter(s)

1 (June 14-20)
The basics (cognitive psychology and linguistics)
1,2

2 (June 21-27)
The foundations of language
3

Exam 1 (due Wednesday, June 28)

3 (June 28-July 4)
Language development
4

4 (July 5-11)
Perception of words (visual and spoken)
6,9

Exam 2 (due Wednesday, July 12)

5 (July 12-18)
Reading
7,8

6 (July 19-25)
Understanding the structure of sentences
10

Exam 3 (due Wednesday, July 26)

7 (July 26-Aug 1)
Word meaning
11

8 (Aug 2-8)
Language production
13

Exam 4 (due Wednesday, Aug 9)

Date: Summer 2017

Created: 2017-06-02 Fri 08:32

Emacs 25.2.1 (Org mode 8.2.10)

Validate


text:
import {InjectionToken} from '@angular/core';
import {
  ComponentType,
  Overlay,
  ScrollStrategy,
} from '@angular/cdk/overlay';
import {DialogRef} from './dialog-ref';
import {CdkDialogContainer} from './dialog-container';
import {DialogConfig} from './dialog-config';

/** Injection token for the Dialog's ScrollStrategy. */
export const DIALOG_SCROLL_STRATEGY =
    new InjectionToken<() => ScrollStrategy>('DialogScrollStrategy');

/** Injection token for the Dialog's Data. */
export const DIALOG_DATA = new InjectionToken<any>('DialogData');

/** Injection token for the DialogRef constructor. */
export const DIALOG_REF = new InjectionToken<DialogRef<any>>('DialogRef');

/** Injection token for the DialogConfig. */
export const DIALOG_CONFIG = new InjectionToken<DialogConfig>('DialogConfig');

/** Injection token for the Dialog's DialogContainer component. */
export const DIALOG_CONTAINER =
    new InjectionToken<ComponentType<CdkDialogContainer>>('DialogContainer');

/** @docs-private */
export function MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay: Overlay):
    () => ScrollStrategy {
  return () => overlay.scrollStrategies.block();
}

/** @docs-private */
export const MAT_DIALOG_SCROLL_STRATEGY_PROVIDER = {
  provide: DIALOG_SCROLL_STRATEGY,
  deps: [Overlay],
  useFactory: MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY,
};


text:
gdelt-dashboard
===============


text:
namespace impala {

class DescriptorTbl;
class ObjectPool;
class RuntimeState;
class RowBatch;
class TPlanNode;

/// Legacy ScanNode implementation used in the non-multi-threaded execution mode
/// that is used for all tables read directly from HDFS-serialised data.
/// A HdfsScanNode spawns multiple scanner threads to process the bytes in
/// parallel.  There is a handshake between the scan node and the scanners
/// to get all the splits queued and bytes processed.
/// 1. The scan node initially calls the Scanner with a list of files and splits
///    for that scanner/file format.
/// 2. The scanner issues the initial byte ranges for each of those files.  For text
///    this is simply the entire range but for rc files, this would just be the header
///    byte range.  The scan node doesn't care either way.
/// 3. The scan node spins up a number of scanner threads. Each of those threads
///    pulls the next scan range to work on from the IoMgr and then processes the
///    range end to end.
/// 4. The scanner processes the buffers, issuing more scan ranges if necessary.
/// 5. The scanner finishes the scan range and informs the scan node so it can track
///    end of stream.
///
/// TODO: This class allocates a bunch of small utility objects that should be
/// recycled.
/// TODO: Remove this class once the fragment-based multi-threaded execution is
/// fully functional.
class HdfsScanNode : public HdfsScanNodeBase {
 public:
  HdfsScanNode(ObjectPool* pool, const TPlanNode& tnode, const DescriptorTbl& descs);
  ~HdfsScanNode();

  virtual Status Init(const TPlanNode& tnode, RuntimeState* state);
  virtual Status Prepare(RuntimeState* state);
  virtual Status Open(RuntimeState* state);
  virtual Status GetNext(RuntimeState* state, RowBatch* row_batch, bool* eos);
  virtual void Close(RuntimeState* state);

  virtual bool HasRowBatchQueue() const { return true; }

  bool done() const { return done_; }

  /// Adds ranges to the io mgr queue and starts up new scanner threads if possible.
  virtual Status AddDiskIoRanges(const std::vector<DiskIoMgr::ScanRange*>& ranges,
      int num_files_queued);

  /// Adds a materialized row batch for the scan node.  This is called from scanner
  /// threads.
  /// This function will block if materialized_row_batches_ is full.
  void AddMaterializedRowBatch(RowBatch* row_batch);

  /// Sets the scanner specific metadata for 'filename'.
  /// This is thread safe.
  void SetFileMetadata(const std::string& filename, void* metadata);

  /// Gets scanner specific metadata for 'filename'.  Scanners can use this to store
  /// file header information.
  /// Returns NULL if there is no metadata.
  /// This is thread safe.
  void* GetFileMetadata(const std::string& filename);

  /// Called by scanners when a range is complete. Used to record progress and set done_.
  /// This *must* only be called after a scanner has completely finished its
  /// scan range (i.e. context->Flush()), and has added the final row batch to the row
  /// batch queue. Otherwise, we may lose the last batch due to racing with shutting down
  /// the RowBatch queue.
  virtual void RangeComplete(const THdfsFileFormat::type& file_type,
      const std::vector<THdfsCompression::type>& compression_type);

  /// Acquires all allocations from pool into scan_node_pool_. Thread-safe.
  void TransferToScanNodePool(MemPool* pool);

 private:
  /// Released when initial ranges are issued in the first call to GetNext().
  CountingBarrier ranges_issued_barrier_;

  /// The estimated memory required to start up a new scanner thread. If the memory
  /// left (due to limits) is less than this value, we won't start up optional
  /// scanner threads.
  int64_t scanner_thread_bytes_required_;

  /// Scanner specific per file metadata (e.g. header information) and associated lock.
  /// This lock cannot be taken together with any other locks except lock_.
  boost::mutex metadata_lock_;
  std::map<std::string, void*> per_file_metadata_;

  /// Thread group for all scanner worker threads
  ThreadGroup scanner_threads_;

  /// Outgoing row batches queue. Row batches are produced asynchronously by the scanner
  /// threads and consumed by the main thread.
  boost::scoped_ptr<RowBatchQueue> materialized_row_batches_;

  /// Maximum size of materialized_row_batches_.
  int max_materialized_row_batches_;

  /// Lock protects access between scanner thread and main query thread (the one calling
  /// GetNext()) for all fields below.  If this lock and any other locks needs to be taken
  /// together, this lock must be taken first.
  boost::mutex lock_;

  /// Protects file_type_counts_. Cannot be taken together with any other lock
  /// except lock_, and if so, lock_ must be taken first.
  SpinLock file_type_counts_;

  /// Flag signaling that all scanner threads are done.  This could be because they
  /// are finished, an error/cancellation occurred, or the limit was reached.
  /// Setting this to true triggers the scanner threads to clean up.
  /// This should not be explicitly set. Instead, call SetDone().
  bool done_;

  /// Set to true if all ranges have started. Some of the ranges may still be in flight
  /// being processed by scanner threads, but no new ScannerThreads should be started.
  bool all_ranges_started_;

  /// The id of the callback added to the thread resource manager when thread token
  /// is available. Used to remove the callback before this scan node is destroyed.
  /// -1 if no callback is registered.
  int thread_avail_cb_id_;

  /// Maximum number of scanner threads. Set to 'NUM_SCANNER_THREADS' if that query
  /// option is set. Otherwise, it's set to the number of cpu cores. Scanner threads
  /// are generally cpu bound so there is no benefit in spinning up more threads than
  /// the number of cores.
  int max_num_scanner_threads_;

  /// The wait time for fetching a row batch from the row batch queue.
  RuntimeProfile::Counter* row_batches_get_timer_;

  /// The wait time for enqueuing a row batch into the row batch queue.
  RuntimeProfile::Counter* row_batches_put_timer_;

  /// Tries to spin up as many scanner threads as the quota allows. Called explicitly
  /// (e.g., when adding new ranges) or when threads are available for this scan node.
  void ThreadTokenAvailableCb(ThreadResourceMgr::ResourcePool* pool);

  /// Main function for scanner thread. This thread pulls the next range to be
  /// processed from the IoMgr and then processes the entire range end to end.
  /// This thread terminates when all scan ranges are complete or an error occurred.
  void ScannerThread();

  /// Process the entire scan range with a new scanner object. Executed in scanner
  /// thread. 'filter_ctxs' is a clone of the class-wide filter_ctxs_, used to filter rows
  /// in this split.
  Status ProcessSplit(const std::vector<FilterContext>& filter_ctxs,
      DiskIoMgr::ScanRange* scan_range);

  /// Returns true if there is enough memory (against the mem tracker limits) to
  /// have a scanner thread.
  /// If new_thread is true, the calculation is for starting a new scanner thread.
  /// If false, it determines whether there's adequate memory for the existing
  /// set of scanner threads.
  /// lock_ must be taken before calling this.
  bool EnoughMemoryForScannerThread(bool new_thread);

  /// Checks for eos conditions and returns batches from materialized_row_batches_.
  Status GetNextInternal(RuntimeState* state, RowBatch* row_batch, bool* eos);

  /// sets done_ to true and triggers threads to cleanup. Cannot be called with
  /// any locks taken. Calling it repeatedly ignores subsequent calls.
  void SetDone();
};

}

#endif