text:
package gov.nih.nci.cabig.caaers.domain.repository;

import gov.nih.nci.cabig.caaers.domain.ExpeditedAdverseEventReport;
import gov.nih.nci.cabig.caaers.domain.ReportStatus;
import gov.nih.nci.cabig.caaers.domain.expeditedfields.ExpeditedReportSection;
import gov.nih.nci.cabig.caaers.domain.report.Report;
import gov.nih.nci.cabig.caaers.domain.report.ReportDefinition;
import gov.nih.nci.cabig.caaers.domain.report.ReportDelivery;
import gov.nih.nci.cabig.caaers.service.ReportSubmittability;

import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
 * This is an service class, which is used to obtain the correct address (toAddress) of a recipient.
 *
 * @author Biju Joseph Created-on : May 31, 2007
 * @version Biju Joseph
 * @since 1.0
 */
public interface ReportRepository {

	/**
	 * This method will amend/unamend/withdraw/create the reports.
	 *
	 * @param aeReport the ae report
	 * @param toAmendList - The list of reports to amend
	 * @param toUnAmendList - The list of reports to unamend
	 * @param toWithdrawList - The list of reports to withdraw
	 * @param toCreateList - The list of reports to create
	 */
	void processReports(ExpeditedAdverseEventReport aeReport, List<Report> toAmendList, List<Report> toUnAmendList,
			List<Report> toWithdrawList,  List<ReportDefinition> toCreateList );

	/**
	 * Will mark the report as deleted (ReportStatus = WITHDRAWN). At present it will unschedule the
	 * pending scheduled notifications present in the scheduler, by delegating the call to
	 * SchedulerService.
	 *
	 * @param report the report
	 */
    void withdrawReport(Report report);

    /**
     * Will find the external report to be withdrawn, and will withdraw that report from the system.
     *
     * @param aeReport the ae report
     * @param report the report
     */
    void withdrawExternalReport(ExpeditedAdverseEventReport aeReport,Report report);

    /**
     * Creates a report from the given definition and associates it with the given aeReport and
     * saves it in the database.
     *

     * Also it will schedule the report.
     *
     * @param repDef the rep def
     * @param aeReport the ae report
     * @return the report
     */
    Report createReport(ReportDefinition repDef, ExpeditedAdverseEventReport aeReport);

    /**
     * This method will create all the child reports of the given report.
     *
     * @param report the report
     * @return the list
     */
    List<Report> createChildReports(Report report);

    /**
     * This method amends the report passed to it, by changing the status to {@link ReportStatus#AMENDED}.
     *
     * @param report the report
     */

    void amendReport(Report report);

    /**
     * This method will change the amended report to completed.
     *
     * @param report the report
     */

    void unAmendReport(Report report);

    /**
     * Will find the report deliveries for this report.
     * Note:- This will directly calculate the current deliveries, instead of what is available in report.
     *
     * @param report the report
     * @return the list
     */
    List<ReportDelivery> findReportDeliveries(Report report);

    /**
    * Will save a report
    * @param report
    * @return
    */
    public Report save(Report report);

}


text:
var fs = require('fs'),
	path = require('path'),
	vows = require('vows'),
	assert = require('assert'),
	moment = require('moment'),
	request = require('request'),
	port = 9999,
	config;

vows.describe('flipflop')

	.addBatch({

		'When using `flipflop create`' : {

			topic : function() {
				this.lib = require('../lib/commands/create').lib;
				this.lib.blogDir = __dirname+'/artifacts';
				this.lib.createBlog();
				config = this.lib.config;
				this.callback();
			},

			'blog directory exists' : function() {
				assert.isTrue(fs.existsSync(this.lib.blogDir));
			},
			'articles directory exists' : function() {
				assert.isTrue(fs.existsSync(this.lib.articlesDir));
			},
			'theme directory exists' : function() {
				assert.isTrue(fs.existsSync(path.join(this.lib.blogDir, 'theme')));
			},
			'blog.json config file exists' : function() {
				assert.isTrue(fs.existsSync(path.join(this.lib.blogDir, 'blog.json')));
			},
			'sample article exists' : function() {
				assert.isTrue(fs.existsSync(path.join(this.lib.articlesDir, 'flipflop-ftw')));
			},
			'blog title is correct' : function() {
				assert.equal(this.lib.config.title, require('./artifacts/blog.json').title);
			},
			'blog description is correct' : function() {
				assert.equal(this.lib.config.description, require('./artifacts/blog.json').description);
			}
		}
	})
	.addBatch({

		'When using `flipflop generate`' : {

			topic : function() {
				this.lib = require('../lib/commands/generate').lib;
				this.lib.blogDir = __dirname+'/artifacts';
				this.lib.generate(this.callback);
			},

			'public directory exists' : function() {
				assert.isTrue(fs.existsSync(path.join(this.lib.blogDir, 'public')));
			},
			'archive exists' : function() {
				assert.isTrue(fs.existsSync(path.join(this.lib.blogDir, 'public', 'archive', 'index.html')));
			},
			'feed exists' : function() {
				assert.isTrue(fs.existsSync(path.join(this.lib.blogDir, 'public', 'feed', 'rss.xml')));
			},
			'404 page exists' : function() {
				assert.isTrue(fs.existsSync(path.join(this.lib.blogDir, 'public', '404.html')));
			},
			'images directory exists' : function() {
				assert.isTrue(fs.existsSync(path.join(this.lib.blogDir, 'public', 'images')));
			},
			'tag directory exists' : function() {
				assert.isTrue(fs.existsSync(path.join(this.lib.blogDir, 'public', 'tag')));
			},
			'sample article exists' : function() {
				var article = path.join(
					this.lib.blogDir,
					'public',
					moment().format('YYYY/MM/DD'),
					'flipflop-ftw',
					'index.html'
				);
				assert.isTrue(fs.existsSync(article));
			}
		}
	})
	.addBatch({

		'When using `flipflop start`' : {

			topic : function() {
				this.lib = require('../lib/commands/start').lib;
				this.lib.blogDir = __dirname+'/artifacts';
				this.lib.start(port, this.callback);
			},

			'and requesting homepage' : {

				topic : function() {
					request.get('http://localhost:'+port+'/', this.callback);
				},

				'has response' : function(err, response, body) {
					assert.isNull(err);
					assert.equal(200, response.statusCode);
				},
				'body is correct' : function(err, response, body) {
					assert.isNull(err);
					assert.notEqual(-1, body.indexOf('<title>'+config.title+'</title>'));
				}
			},

			'and requesting archive' : {

				topic : function() {
					request.get('http://localhost:'+port+'/archive/', this.callback);
				},

				'has response' : function(err, response, body) {
					assert.isNull(err);
					assert.equal(200, response.statusCode);
				},
				'body is correct' : function(err, response, body) {
					assert.isNull(err);
					assert.notEqual(-1, body.indexOf('<title>archive - '+config.title+'</title>'));
				}
			},

			'and requesting feed' : {

				topic : function() {
					request.get('http://localhost:'+port+'/feed/rss.xml', this.callback);
				},

				'has response' : function(err, response, body) {
					assert.isNull(err);
					assert.equal(200, response.statusCode);
				},
				'body is correct' : function(err, response, body) {
					assert.isNull(err);
					assert.notEqual(-1, body.indexOf('<channel><title>'+config.title+'</title>'));
					assert.notEqual(-1, body.indexOf(config.domain));
				}
			}

		}
	})

	.export(module);

redpajama_set_name: RedPajamaGithub


text:
jades = $(shell find src/jade -name '*.jade')
styles = src/sass/*
scripts = src/coffee/*

assets = $(shell find src/assets)

coffee = ./node_modules/.bin/coffee
compass = compass
watch = ./node_modules/.bin/watch
serve = ./node_modules/.bin/http-server

.PHONY: all css pages watch dev clean

all: public css public/main.js pages

public: $(assets)
	mkdir --parents $@
	cp --recursive $</* $@

node_modules: package.json
	npm install
	@touch $@

pages: node_modules $(jades)
	$(coffee) src/jade/build.litcoffee

css: compass.rb $(styles)
	$(compass) compile --config $<

public/main.js: node_modules $(scripts)
	$(coffee) --no-header --print --compile src/coffee > $@

watch: node_modules
	$(watch) '$(MAKE) all' src --wait=0

dev: node_modules
	$(serve) public -a localhost -p 31415 -i -c-1 &
	$(MAKE) watch

clean:
	rm --recursive --force node_modules
	rm --recursive --force .sass-cache
	rm --recursive --force public


text:
from generator.actions import Actions, Variable
from random import choice, randint
import string
import struct
import os

# NOTE: this is super inefficient, don't care.
def random_bytes(min, max, mod=255):
    return ''.join(chr(choice(range(mod))) for _ in range(randint(min,max)))

def is_byte_fragmented(byte):
    return (ord(byte) & 0x80)

# -----------------
# state transitions
# -----------------
# CONNTERM
#   |- OTP (on receipt of PKT_CONNTERM)
#   |- else -> CONNTERM
# OTP
#   |- MSG (on receipt of correct-length packet, any contents)
#   |- else -> OTP
# MSG
#   |- OTP (on reciept of PKT_CONNTERM)
#   |- else -> MSG

class QuietSquare(Actions):

    GLOBAL_DEBUG = False
    GLOBAL_POV = False

    # States
    STATE_CONNTERM = 0
    STATE_OTP = 1
    STATE_MSG = 2

    # Packet lengths
    BUF_RX_SZ = 256
    CONNTERM_SZ = BUF_RX_SZ
    OTP_SZ = 16
    MSG_SZ = BUF_RX_SZ

    # Packet contents
    PKT_INVALID_SZ = "\xFF" + "\xDD" * (BUF_RX_SZ-1)
    PKT_CONNTERM = "\x00" * CONNTERM_SZ
    PKT_CONNTERM_ACK = "\xFF" + "\xCC" * (CONNTERM_SZ-1)
    PKT_CONNTERM_ERR = "\xFF" + "\xFF" * (CONNTERM_SZ-1)
    PKT_OTP_ACK = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
    PKT_EXIT = "\xAA" * 42
    PKT_EXIT_ACK = "\xFF" + "\xAA" * 41

    # Maximum number of recursions before vuln is triggered.
    MAX_DEPTH = 125 # There's an off-by-one here, but it doesn't matter.

    def dispatch(self):
        """
        Dummy node.  Acts as central node for more interesting connterm, otp
        and msg nodes.
        """
        pass

    def refresh_otp(self):
        """
        A seldom-visited node to refreshes what OTP is.
        """
        DEBUG = True and self.GLOBAL_DEBUG
        if DEBUG:
            print "REFRESH_OTP node"
        self.state["PKT_OTP"] = random_bytes(16, 16)

    def connterm(self):
        """
        This node wants to send a CONNTERM pkt regardless of current CB state.

        Our expectation on this one is simple: all states should behave the
        same way: advance / revert to STATE_OTP.
        """
        DEBUG = True and self.GLOBAL_DEBUG
        if DEBUG:
            print "CONNTERM node"
        self.write(self.PKT_CONNTERM)

        # We should only expect the CONNTERM ACK if the CB was in CONNTERM state.
        # Initially unintentional, makes protocol slightly more conditional.
        if self.STATE_CONNTERM == self.state["state"]:
            self.read(length=len(self.PKT_CONNTERM_ACK), expect=self.PKT_CONNTERM_ACK)

        # If we're in OTP state already, this would be an invalid size.
        if self.STATE_OTP == self.state["state"]:
            self.read(length=len(self.PKT_INVALID_SZ), expect=self.PKT_INVALID_SZ)

        self.state["state"] = self.STATE_OTP

    def otp(self):
        """
        The node wants to populate the OTP regardless of current CB state.

        Expected response should differ based on state.
        """
        DEBUG = True and self.GLOBAL_DEBUG
        if DEBUG:
            print "OTP node"

        if self.STATE_CONNTERM == self.state["state"]:
            # If the CB is in CONNTERM state, it expects a packet with a length
            # of CONNTERM_SZ.  Any other size (including OTP_SZ) will result in
            # PKT_INVALID_SZ.
            if DEBUG:
                print "send OTP -> CONNTERM state"
            self.write(self.state["PKT_OTP"])
            self.read(length=len(self.PKT_INVALID_SZ), expect=self.PKT_INVALID_SZ)
        elif self.STATE_OTP == self.state["state"]:
            if DEBUG:
                print "send OTP -> OTP state"
            self.write(self.state["PKT_OTP"])
            self.read(length=self.OTP_SZ, expect=self.PKT_OTP_ACK)
            self.state["otp_on_cb"] = self.state["PKT_OTP"]
            self.state["state"] = self.STATE_MSG # advance to MSG state
        elif self.STATE_MSG == self.state["state"]:
            # If the CB is in MSG state, it expects a packet with a length
            # of MSG_SZ.  Any other size (including OTP_SZ) will result in
            # PKT_INVALID_SZ.
            if DEBUG:
                print "send OTP -> MSG state"
            self.write(self.state["PKT_OTP"])
            self.read(length=len(self.PKT_INVALID_SZ), expect=self.PKT_INVALID_SZ)
        else:
            print "[E] THIS SHOULD NEVER HAPPEN"

    def msg(self):
        """
        The node wants to send a MSG regardless of current CB state.

        Expected response should differ based on state.
        """
        DEBUG = True and self.GLOBAL_DEBUG
        if DEBUG:
            print "MSG node"

        while True:
            # Start with a bunch of random bytes, expect CB to drop bytes that
            # have their most signficant bit set and then XOR the remaining
            # with the OTP (looped over).

            # This is a simplification of the FRAG protocol, see service.c
            # for a discussion on implications.
            PKT_MSG = random_bytes(256, 256)

            # Avoid collision with CONNTERM
            if "\x00" == PKT_MSG[0]:
                PKT_MSG = "\x42" + PKT_MSG[1:]

            # We need to make sure don't accidentally trigger the vuln.  The
            # vuln is triggered when a sufficient depth is reached.  We take a
            # simplified avoidance approach here and just limit the total
            # number of recursions. In reality, stack may be unwound in between
            # recursions.  This check will catch all vuln-triggering messages -
            # and then some.
            depth = 0
            for byte in PKT_MSG:
                if is_byte_fragmented(byte):
                    depth = depth + 1

            # Re-try based on whether we want to trigger the vuln.
            if not self.GLOBAL_POV and self.MAX_DEPTH < depth:
                if DEBUG:
                    print "MAX_DEPTH exceeded (depth = %d) and we're not making a POV; looping..." % depth
                continue
            if self.GLOBAL_POV and self.MAX_DEPTH >= depth:
                if DEBUG:
                    print "MAX_DEPTH not exceeed (depth = %d) and we're making a POV; looping..." % depth
                continue

            # Cases:
            # 1) We are not making a POV and the depth is less than MAX_DEPTH.
            # 2) We are making a POV and the depth is greater than MAX_DEPTH.
            break

        # If we've broken the above loop, we have a PKT_MSG that will not
        # trigger the vuln.  Now we must calculate the CB's expected response.

        # If the MSG begins with "\xFF", this is easy. \xFF signifies error
        # MSG, which the CB will reflect verbatim to us.
        if "\xFF" == PKT_MSG[0]:
            PKT_MSG_RESPONSE = PKT_MSG

        # Otherwise, we have to emulate the CB's actions.
        # First, we drop all bytes that have the fragment bit set.
        else:
            PKT_MSG_RESPONSE = ""
            for byte in PKT_MSG:
                if not is_byte_fragmented(byte):
                    PKT_MSG_RESPONSE += byte

            # Then, we XOR with OTP (on cb), looped over.
            # Yes, everything about this snippet is bad.
            for i in range(len(PKT_MSG_RESPONSE)):
                PKT_MSG_RESPONSE = \
                    PKT_MSG_RESPONSE[:i] + \
                    chr(ord(PKT_MSG_RESPONSE[i]) ^ ord(self.state["otp_on_cb"][i % self.OTP_SZ])) + \
                    PKT_MSG_RESPONSE[i+1:]

        if self.STATE_CONNTERM == self.state["state"]:
            if DEBUG:
                print "send MSG -> CONNTERM state"
            # CONNTERM and MSG packet lengths are the same, but a MSG PKT will
            # never begin with "\x00", so the two cannot be confused.
            # As such, we should expect PKT_CONNTERM_ERR.
            self.write(PKT_MSG)
            self.read(length=len(self.PKT_CONNTERM_ERR), expect=self.PKT_CONNTERM_ERR)
        elif self.STATE_OTP == self.state["state"]:
            if DEBUG:
                print "send MSG -> OTP state"
            # MSG and OTP packets are different lengths, so we should expect
            # PKT_INVALID_SZ.
            self.write(PKT_MSG)
            self.read(length=len(self.PKT_INVALID_SZ), expect=self.PKT_INVALID_SZ)
        elif self.STATE_MSG == self.state["state"]:
            if DEBUG:
                print "send MSG -> MSG state"
            # The most interesting case. We send a MSG and the CB is in the MSG
            # state.  Vulns be triggered thar.
            self.write(PKT_MSG)
            self.read(length=len(PKT_MSG_RESPONSE), expect=PKT_MSG_RESPONSE)
        else:
            if DEBUG:
                print "[E] THIS SHOULD NEVER HAPPEN"

    def finish(self):
        """
        Invoke exit functionality, terminating test.

        Must always be last node executed.
        """
        DEBUG = True and self.GLOBAL_DEBUG
        if DEBUG:
            print "exit node"

        self.write(self.PKT_EXIT)
        self.read(length=len(self.PKT_EXIT_ACK), expect=self.PKT_EXIT_ACK)
        return -1

    def start(self):
        """
        Initialize state.
        """
        self.state["PKT_OTP"] = random_bytes(16, 16)
        self.state["otp_on_cb"] = "\x00" * self.OTP_SZ
        self.state["state"] = self.STATE_CONNTERM


text:
namespace base {
class SingleThreadTaskRunner;
}

namespace blink {
class WebInbandTextTrackClient;
class WebMediaPlayerClient;
}

namespace media {

class WebInbandTextTrackImpl;

class TextTrackImpl : public TextTrack {
 public:
  // Constructor assumes ownership of the |text_track| object.
  TextTrackImpl(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
                blink::WebMediaPlayerClient* client,
                scoped_ptr<WebInbandTextTrackImpl> text_track);

  virtual ~TextTrackImpl();

  virtual void addWebVTTCue(const base::TimeDelta& start,
                            const base::TimeDelta& end,
                            const std::string& id,
                            const std::string& content,
                            const std::string& settings) OVERRIDE;

 private:
  static void OnAddCue(WebInbandTextTrackImpl* text_track,
                       const base::TimeDelta& start,
                       const base::TimeDelta& end,
                       const std::string& id,
                       const std::string& content,
                       const std::string& settings);

  static void OnRemoveTrack(blink::WebMediaPlayerClient* client,
                            scoped_ptr<WebInbandTextTrackImpl> text_track);

  scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
  blink::WebMediaPlayerClient* client_;
  scoped_ptr<WebInbandTextTrackImpl> text_track_;
  DISALLOW_COPY_AND_ASSIGN(TextTrackImpl);
};

}  // namespace media

#endif  // MEDIA_BLINK_TEXTTRACK_IMPL_H_


text:
'use strict';
const BigNumber = require('bignumber.js');
BigNumber.config({ EXPONENTIAL_AT: 1e+9 });
BigNumber.config({ POW_PRECISION: 1e+9 });

let nDigitFibonacciIndexCache = [];

/**
 * Finds the the index of the first term in the Fibonacci sequence to contain n digits
 * @param {Number} n
 * @returns {Number}
 */
exports.nDigitFibonacciIndex = n => {
  if (nDigitFibonacciIndexCache[n]) {
    return nDigitFibonacciIndexCache[n];
  }

  let min = new BigNumber(10).pow(n - 1);
  let previous = new BigNumber(0);
  let current = new BigNumber(1);
  let index = 1;

  while (current.lessThan(min)) {
    let temp = previous;
    previous = current;
    current = temp.plus(previous);
    index++;

    let length = current.toString().length;
    nDigitFibonacciIndexCache[length] = nDigitFibonacciIndexCache[length] || index;
  }

  return index;
};


text:
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="msapplication-tap-highlight" content="no">
  <meta name="description" content="Materialize is a Material Design Admin Template,It's modern, responsive and based on Material Design by Google. ">
  <meta name="keywords" content="materialize, admin template, dashboard template, flat admin template, responsive admin template,">
  <title>Loca'Gestion | Connexion</title>

  <link rel="icon" href="images/favicon/favicon-32x32.png" sizes="32x32">

  <link rel="apple-touch-icon-precomposed" href="images/favicon/apple-touch-icon-152x152.png">

  <meta name="msapplication-TileColor" content="#00bcd4">
  <meta name="msapplication-TileImage" content="images/favicon/mstile-144x144.png">

  <link href="<?php echo base_url(); ?>assets/frontend/css/materialize.min.css" type="text/css" rel="stylesheet" media="screen,projection">
  <link href="<?php echo base_url(); ?>assets/frontend/css/global.css" type="text/css" rel="stylesheet" media="screen,projection">

  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

   <link href="<?php echo base_url(); ?>assets/frontend/css/login_register.css" type="text/css" rel="stylesheet" media="screen,projection">

      <?php $attributs = array('id' => 'FORMULAIRE_CONNEXION', 'class' => 'login-form'); ?>
        <?php echo form_open("", $attributs); ?>

            <img src="<?php echo img_url("logo.png"); ?>" alt="" class="responsive-img valign profile-image-login">

Connexion à votre espace

        <?php foreach($tabFlashMessage as $flashDataMessage): ?>
            <div id="card-alert" class="card <?php echo $flashDataMessage["statut"]; ?>">

<?php echo $flashDataMessage["logo"]; ?> <?php echo $flashDataMessage["message"]; ?>

        <?php endforeach; ?>

            perm_identity
            <input id="ADRESSE_EMAIL" type="text" name="ADRESSE_EMAIL" value="<?php echo set_value('ADRESSE_EMAIL'); ?>">
            Adresse email

        <?php echo form_error('ADRESSE_EMAIL'); ?>

            lock_outline
            <input id="MOT_DE_PASSE" name="MOT_DE_PASSE" type="password" value="<?php echo set_value('MOT_DE_PASSE'); ?>">
            Mot de passe

        <?php echo form_error('MOT_DE_PASSE'); ?>

              <input type="checkbox" name="REMEMBER" id="remember-me">
              Se souvenir de moi

            <button class="btn waves-effect waves-light col s12" type="submit">Connexion</button>

<a href="<?php echo base_url("utilisateurs/inscription"); ?>">Inscrivez-vous !

<a href="<?php echo base_url("utilisateurs/forgot"); ?>">Mot de passe oublié ?

      </form>


text:
<?php

namespace NetSuite\Classes;

class InventoryNumberSearchRowBasic extends SearchRowBasic {
    public $expirationDate;
    public $externalId;
    public $internalId;
    public $inventoryNumber;
    public $isonhand;
    public $item;
    public $location;
    public $memo;
    public $quantityavailable;
    public $quantityintransit;
    public $quantityonhand;
    public $quantityonorder;
    public $customFieldList;
    static $paramtypesmap = array(
        "expirationDate" => "SearchColumnDateField[]",
        "externalId" => "SearchColumnSelectField[]",
        "internalId" => "SearchColumnSelectField[]",
        "inventoryNumber" => "SearchColumnStringField[]",
        "isonhand" => "SearchColumnBooleanField[]",
        "item" => "SearchColumnSelectField[]",
        "location" => "SearchColumnSelectField[]",
        "memo" => "SearchColumnStringField[]",
        "quantityavailable" => "SearchColumnDoubleField[]",
        "quantityintransit" => "SearchColumnDoubleField[]",
        "quantityonhand" => "SearchColumnDoubleField[]",
        "quantityonorder" => "SearchColumnDoubleField[]",
        "customFieldList" => "SearchColumnCustomFieldList",
    );
}


text:
{
'!=': '!=',
'!langcode!': 'ro',
'!langname!': 'Română',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" (actualizează) este o expresie opțională precum "câmp1=\'valoare_nouă\'". Nu puteți actualiza sau șterge rezultatele unui JOIN',
'%(nrows)s records found': '%(nrows)s înregistrări găsite',
'%d days ago': '%d days ago',
'%d weeks ago': '%d weeks ago',
'%s %%{row} deleted': '%s linii șterse',
'%s %%{row} updated': '%s linii actualizate',
'%s selected': '%s selectat(e)',
'%Y-%m-%d': '%Y-%m-%d',
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
'(something like "it-it")': '(ceva ce seamănă cu "it-it")',
'1 day ago': '1 day ago',
'1 week ago': '1 week ago',
'<': '<',
'<=': '<=',
'=': '=',
'>': '>',
'>=': '>=',
'A new version of web2py is available': 'O nouă versiune de web2py este disponibilă',
'A new version of web2py is available: %s': 'O nouă versiune de web2py este disponibilă: %s',
'About': 'Despre',
'about': 'despre',
'About application': 'Despre aplicație',
'Access Control': 'Control acces',
'Add': 'Adaugă',
'additional code for your application': 'cod suplimentar pentru aplicația dvs.',
'admin disabled because no admin password': 'administrare dezactivată deoarece parola de administrator nu a fost furnizată',
'admin disabled because not supported on google app engine': 'administrare dezactivată deoarece funcționalitatea nu e suportat pe Google App Engine',
'admin disabled because unable to access password file': 'administrare dezactivată deoarece nu există acces la fișierul cu parole',
'Admin is disabled because insecure channel': 'Adminstrarea este dezactivată deoarece conexiunea nu este sigură',
'Admin is disabled because unsecure channel': 'Administrarea este dezactivată deoarece conexiunea nu este securizată',
'Administration': 'Administrare',
'Administrative Interface': 'Interfață administrare',
'Administrator Password:': 'Parolă administrator:',
'Ajax Recipes': 'Rețete Ajax',
'And': 'Și',
'and rename it (required):': 'și renumiți (obligatoriu):',
'and rename it:': ' și renumiți:',
'appadmin': 'appadmin',
'appadmin is disabled because insecure channel': 'appadmin dezactivat deoarece conexiunea nu e sigură',
'application "%s" uninstalled': 'aplicația "%s" a fost dezinstalată',
'application compiled': 'aplicația a fost compilată',
'application is compiled and cannot be designed': 'aplicația este compilată și nu poate fi editată',
'Are you sure you want to delete file "%s"?': 'Sigur ștergeți fișierul "%s"?',
'Are you sure you want to delete this object?': 'Sigur ștergeți acest obiect?',
'Are you sure you want to uninstall application "%s"': 'Sigur dezinstalați aplicația "%s"',
'Are you sure you want to uninstall application "%s"?': 'Sigur dezinstalați aplicația "%s"?',
'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ATENȚIE: Nu vă puteți conecta decât utilizând o conexiune securizată (HTTPS) sau rulând aplicația pe computerul local.',
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATENȚIE: Nu puteți efectua mai multe teste o dată deoarece lansarea în execuție a mai multor subpocese nu este sigură.',
'ATTENTION: you cannot edit the running application!': 'ATENȚIE: nu puteți edita o aplicație în curs de execuție!',
'Authentication': 'Autentificare',
'Available Databases and Tables': 'Baze de date și tabele disponibile',
'Back': 'Înapoi',
'Buy this book': 'Cumpără această carte',
'Cache': 'Cache',
'cache': 'cache',
'Cache Keys': 'Chei cache',
'cache, errors and sessions cleaned': 'cache, erori și sesiuni golite',
'Cannot be empty': 'Nu poate fi vid',
'Cannot compile: there are errors in your app.        Debug it, correct errors and try again.': 'Compilare imposibilă: aplicația conține erori. Debogați aplicația și încercați din nou.',
'cannot create file': 'fișier imposibil de creat',
'cannot upload file "%(filename)s"': 'imposibil de încărcat fișierul "%(filename)s"',
'Change Password': 'Schimbare parolă',
'Change password': 'Schimbare parolă',
'change password': 'schimbare parolă',
'check all': 'coșați tot',
'Check to delete': 'Coșați pentru a șterge',
'clean': 'golire',
'Clear': 'Golește',
'Clear CACHE?': 'Clear CACHE?',
'Clear DISK': 'Clear DISK',
'Clear RAM': 'Clear RAM',
'click to check for upgrades': 'Clic pentru a verifica dacă există upgrade-uri',
'Client IP': 'IP client',
'Community': 'Comunitate',
'compile': 'compilare',
'compiled application removed': 'aplicația compilată a fost ștearsă',
'Components and Plugins': 'Componente și plugin-uri',
'contains': 'conține',
'Controller': 'Controlor',
'Controllers': 'Controlori',
'controllers': 'controlori',
'Copyright': 'Drepturi de autor',
'create file with filename:': 'crează fișier cu numele:',
'Create new application': 'Creați aplicație nouă',
'create new application:': 'crează aplicație nouă:',
'crontab': 'crontab',
'Current request': 'Cerere curentă',
'Current response': 'Răspuns curent',
'Current session': 'Sesiune curentă',
'currently saved or': 'în prezent salvat sau',
'customize me!': 'Personalizează-mă!',
'data uploaded': 'date încărcate',
'Database': 'bază de date',
'Database %s select': 'selectare bază de date %s',
'database administration': 'administrare bază de date',
'Date and Time': 'Data și ora',
'db': 'db',
'DB Model': 'Model bază de date',
'defines tables': 'definire tabele',
'Delete': 'Șterge',
'delete': 'șterge',
'delete all checked': 'șterge tot ce e coșat',
'Delete:': 'Șterge:',
'Demo': 'Demo',
'Deploy on Google App Engine': 'Instalare pe Google App Engine',
'Deployment Recipes': 'Rețete de instalare',
'Description': 'Descriere',
'design': 'design',
'DESIGN': 'DESIGN',
'Design for': 'Design pentru',
'DISK': 'DISK',
'Disk Cache Keys': 'Chei cache de disc',
'Disk Cleared': 'Disk Cleared',
'Documentation': 'Documentație',
"Don't know what to do?": 'Nu știți ce să faceți?',
'done!': 'gata!',
'Download': 'Descărcare',
'E-mail': 'E-mail',
'E-mail invalid': 'E-mail invalid',
'edit': 'editare',
'EDIT': 'EDITARE',
'Edit': 'Editare',
'Edit application': 'Editare aplicație',
'edit controller': 'editare controlor',
'Edit current record': 'Editare înregistrare curentă',
'Edit Profile': 'Editare profil',
'edit profile': 'editare profil',
'Edit This App': 'Editați această aplicație',
'Editing file': 'Editare fișier',
'Editing file "%s"': 'Editare fișier "%s"',
'Email and SMS': 'E-mail și SMS',
'enter a number between %(min)g and %(max)g': 'introduceți un număr între %(min)g și %(max)g',
'enter an integer between %(min)g and %(max)g': 'introduceți un întreg între %(min)g și %(max)g',
'Error logs for "%(app)s"': 'Log erori pentru "%(app)s"',
'errors': 'erori',
'Errors': 'Erori',
'Export': 'Export',
'export as csv file': 'exportă ca fișier csv',
'exposes': 'expune',
'extends': 'extinde',
'failed to reload module': 'reîncarcare modul nereușită',
'False': 'Neadevărat',
'FAQ': 'Întrebări frecvente',
'file "%(filename)s" created': 'fișier "%(filename)s" creat',
'file "%(filename)s" deleted': 'fișier "%(filename)s" șters',
'file "%(filename)s" uploaded': 'fișier "%(filename)s" încărcat',
'file "%(filename)s" was not deleted': 'fișierul "%(filename)s" n-a fost șters',
'file "%s" of %s restored': 'fișier "%s" de %s restaurat',
'file changed on disk': 'fișier modificat pe disc',
'file does not exist': 'fișier inexistent',
'file saved on %(time)s': 'fișier salvat %(time)s',
'file saved on %s': 'fișier salvat pe %s',
'First name': 'Prenume',
'Forbidden': 'Interzis',
'Forms and Validators': 'Formulare și validatori',
'Free Applications': 'Aplicații gratuite',
'Functions with no doctests will result in [passed] tests.': 'Funcțiile fără doctests vor genera teste [trecute].',
'Group %(group_id)s created': 'Grup %(group_id)s creat',
'Group ID': 'ID grup',
'Group uniquely assigned to user %(id)s': 'Grup asociat în mod unic utilizatorului %(id)s',
'Groups': 'Grupuri',
'Hello World': 'Salutare lume',
'help': 'ajutor',
'Home': 'Acasă',
'How did you get here?': 'Cum ați ajuns aici?',
'htmledit': 'editare html',
'import': 'import',
'Import/Export': 'Import/Export',
'includes': 'include',
'Index': 'Index',
'insert new': 'adaugă nou',
'insert new %s': 'adaugă nou %s',
'Installed applications': 'Aplicații instalate',
'internal error': 'eroare internă',
'Internal State': 'Stare internă',
'Introduction': 'Introducere',
'Invalid action': 'Acțiune invalidă',
'Invalid email': 'E-mail invalid',
'invalid password': 'parolă invalidă',
'Invalid password': 'Parolă invalidă',
'Invalid Query': 'Interogare invalidă',
'invalid request': 'cerere invalidă',
'invalid ticket': 'tichet invalid',
'Key': 'Key',
'language file "%(filename)s" created/updated': 'fișier de limbă "%(filename)s" creat/actualizat',
'Language files (static strings) updated': 'Fișierele de limbă (șirurile statice de caractere) actualizate',
'languages': 'limbi',
'Languages': 'Limbi',
'languages updated': 'limbi actualizate',
'Last name': 'Nume',
'Last saved on:': 'Ultima salvare:',
'Layout': 'Șablon',
'Layout Plugins': 'Șablon plugin-uri',
'Layouts': 'Șabloane',
'License for': 'Licență pentru',
'Live Chat': 'Chat live',
'loading...': 'încarc...',
'Logged in': 'Logat',
'Logged out': 'Delogat',
'Login': 'Autentificare',
'login': 'autentificare',
'Login to the Administrative Interface': 'Logare interfață de administrare',
'logout': 'ieșire',
'Logout': 'Ieșire',
'Lost Password': 'Parolă pierdută',
'Lost password?': 'Parolă pierdută?',
'Main Menu': 'Meniu principal',
'Manage Cache': 'Manage Cache',
'Menu Model': 'Model meniu',
'merge': 'unește',
'Models': 'Modele',
'models': 'modele',
'Modules': 'Module',
'modules': 'module',
'My Sites': 'Site-urile mele',
'Name': 'Nume',
'New': 'Nou',
'new application "%s" created': 'aplicația nouă "%s" a fost creată',
'New password': 'Parola nouă',
'New Record': 'Înregistrare nouă',
'new record inserted': 'înregistrare nouă adăugată',
'next 100 rows': 'următoarele 100 de linii',
'NO': 'NU',
'No databases in this application': 'Aplicație fără bază de date',
'Object or table name': 'Obiect sau nume de tabel',
'Old password': 'Parola veche',
'Online examples': 'Exemple online',
'Or': 'Sau',
'or import from csv file': 'sau importă din fișier csv',
'or provide application url:': 'sau furnizează adresă url:',
'Origin': 'Origine',
'Original/Translation': 'Original/Traducere',
'Other Plugins': 'Alte plugin-uri',
'Other Recipes': 'Alte rețete',
'Overview': 'Prezentare de ansamblu',
'pack all': 'împachetează toate',
'pack compiled': 'pachet compilat',
'Password': 'Parola',
"Password fields don't match": 'Câmpurile de parolă nu se potrivesc',
'Peeking at file': 'Vizualizare fișier',
'please input your password again': 'introduceți parola din nou',
'Plugins': 'Plugin-uri',
'Powered by': 'Pus în mișcare de',
'Preface': 'Prefață',
'previous 100 rows': '100 de linii anterioare',
'Profile': 'Profil',
'Python': 'Python',
'Query': 'Interogare',
'Query:': 'Interogare:',
'Quick Examples': 'Exemple rapide',
'RAM': 'RAM',
'RAM Cache Keys': 'Chei cache RAM',
'Ram Cleared': 'Ram Cleared',
'Recipes': 'Rețete',
'Record': 'înregistrare',
'record does not exist': 'înregistrare inexistentă',
'Record ID': 'ID înregistrare',
'Record id': 'id înregistrare',
'register': 'înregistrare',
'Register': 'Înregistrare',
'Registration identifier': 'Identificator de autentificare',
'Registration key': 'Cheie înregistrare',
'Registration successful': 'Autentificare reușită',
'Remember me (for 30 days)': 'Ține-mă minte (timp de 30 de zile)',
'remove compiled': 'șterge compilate',
'Request reset password': 'Cerere resetare parolă',
'Reset Password key': 'Cheie restare parolă',
'Resolve Conflict file': 'Fișier rezolvare conflict',
'restore': 'restaurare',
'revert': 'revenire',
'Role': 'Rol',
'Rows in Table': 'Linii în tabel',
'Rows selected': 'Linii selectate',
'save': 'salvare',
'Save profile': 'Salvează profil',
'Saved file hash:': 'Hash fișier salvat:',
'Search': 'Căutare',
'Semantic': 'Semantică',
'Services': 'Servicii',
'session expired': 'sesiune expirată',
'shell': 'line de commandă',
'site': 'site',
'Size of cache:': 'Size of cache:',
'some files could not be removed': 'anumite fișiere n-au putut fi șterse',
'starts with': 'începe cu',
'state': 'stare',
'static': 'static',
'Static files': 'Fișiere statice',
'Statistics': 'Statistics',
'Stylesheet': 'Foaie de stiluri',
'Submit': 'Înregistrează',
'submit': 'submit',
'Support': 'Suport',
'Sure you want to delete this object?': 'Sigur ștergeți acest obiect?',
'Table': 'tabel',
'Table name': 'Nume tabel',
'test': 'test',
'Testing application': 'Testare aplicație',
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': '"Interogarea (query)" este o condiție de tipul "db.tabel1.câmp1==\'valoare\'". Ceva de genul "db.tabel1.câmp1==db.tabel2.câmp2" generează un JOIN SQL.',
'the application logic, each URL path is mapped in one exposed function in the controller': 'logica aplicației, fiecare rută URL este mapată într-o funcție expusă de controlor',
'The Core': 'Nucleul',
'the data representation, define database tables and sets': 'reprezentarea datelor, definește tabelele bazei de date și seturile (de date)',
'The output of the file is a dictionary that was rendered by the view %s': 'Fișierul produce un dicționar care a fost prelucrat de vederea %s',
'the presentations layer, views are also known as templates': 'nivelul de prezentare, vederile sunt de asemenea numite și șabloane',
'The Views': 'Vederile',
'There are no controllers': 'Nu există controlori',
'There are no models': 'Nu există modele',
'There are no modules': 'Nu există module',
'There are no static files': 'Nu există fișiere statice',
'There are no translators, only default language is supported': 'Nu există traduceri, doar limba implicită este suportată',
'There are no views': 'Nu există vederi',
'these files are served without processing, your images go here': 'aceste fișiere sunt servite fără procesare, imaginea se plasează acolo',
'This App': 'Această aplicație',
'This is a copy of the scaffolding application': 'Aceasta este o copie a aplicației schelet',
'This is the %(filename)s template': 'Aceasta este șablonul fișierului %(filename)s',
'Ticket': 'Tichet',
'Time in Cache (h:m:s)': 'Time in Cache (h:m:s)',
'Timestamp': 'Moment în timp (timestamp)',
'to  previous version.': 'la versiunea anterioară.',
'too short': 'prea scurt',
'translation strings for the application': 'șiruri de caractere folosite la traducerea aplicației',
'True': 'Adevărat',
'try': 'încearcă',
'try something like': 'încearcă ceva de genul',
'Twitter': 'Twitter',
'Unable to check for upgrades': 'Imposibil de verificat dacă există actualizări',
'unable to create application "%s"': 'imposibil de creat aplicația "%s"',
'unable to delete file "%(filename)s"': 'imposibil de șters fișierul "%(filename)s"',
'Unable to download': 'Imposibil de descărcat',
'Unable to download app': 'Imposibil de descărcat aplicația',
'unable to parse csv file': 'imposibil de analizat fișierul csv',
'unable to uninstall "%s"': 'imposibil de dezinstalat "%s"',
'uncheck all': 'decoșează tot',
'uninstall': 'dezinstalează',
'update': 'actualizează',
'update all languages': 'actualizează toate limbile',
'Update:': 'Actualizare:',
'upload application:': 'incarcă aplicația:',
'Upload existing application': 'Încarcă aplicația existentă',
'upload file:': 'încarcă fișier:',
'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...)  for NOT to build more complex queries.': 'Folosiți (...)&(...) pentru AND, (...)|(...) pentru OR, și ~(...) pentru NOT, pentru a crea interogări complexe.',
'User %(id)s Logged-in': 'Utilizator %(id)s autentificat',
'User %(id)s Logged-out': 'Utilizator %(id)s delogat',
'User %(id)s Password changed': 'Parola utilizatorului %(id)s a fost schimbată',
'User %(id)s Password reset': 'Resetare parola utilizator %(id)s',
'User %(id)s Profile updated': 'Profil utilizator %(id)s actualizat',
'User %(id)s Registered': 'Utilizator %(id)s înregistrat',
'User ID': 'ID utilizator',
'value already in database or empty': 'Valoare existentă în baza de date sau vidă',
'Verify Password': 'Verifică parola',
'versioning': 'versiuni',
'Videos': 'Video-uri',
'View': 'Vedere',
'view': 'vedere',
'Views': 'Vederi',
'views': 'vederi',
'web2py is up to date': 'web2py este la zi',
'web2py Recent Tweets': 'Ultimele tweet-uri web2py',
'Welcome': 'Bine ați venit',
'Welcome %s': 'Bine ați venit %s',
'Welcome to web2py': 'Bun venit la web2py',
'Welcome to web2py!': 'Bun venit la web2py!',
'Which called the function %s located in the file %s': 'Care a apelat funcția %s prezentă în fișierul %s',
'YES': 'DA',
'You are successfully running web2py': 'Rulați cu succes web2py',
'You can modify this application and adapt it to your needs': 'Puteți modifica și adapta aplicația nevoilor dvs.',
'You visited the url %s': 'Ați vizitat adresa %s',
}


text:
import urllib3
import re
import pubchempy
import libsbml
import sympy
from .UsefulFunctions import *
from .Classes import *
__all__ = ["Network"]


text:
/* --- Code blocks --- */

.chroma .ln {
  margin-right: 0.8em;
  padding: 0 0.4em 0 0.4em;
}
pre code.hljs {
  padding: 9.5px;
}

.highlight tr, .highlight pre {
  border: none;
}

.highlight div:first-child {
  border-radius: 4px;
}

.highlight td:first-child pre, .highlight pre {
  border-top-left-radius: 4px;
  border-top-right-radius: unset;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: unset;
  overflow: hidden;
}

.highlight td:last-child pre, .highlight pre {
  border-radius: unset;
}

.highlight td:last-child pre code, .highlight pre code {
  white-space: pre;
}


text:
title: PapljNewExpr.getBraceR - aesi-intellij
---

[aesi-intellij](../../index.html) / [org.metaborg.paplj.psi](../index.html) / [PapljNewExpr](index.html) / [getBraceR](.)

# getBraceR

`@NotNull abstract fun getBraceR(): @NotNull PsiElement`

Overrides [PapljExpr.getBraceR](../-paplj-expr/get-brace-r.html)


text:
package shoujibang.net.nextaf.demo.api;

import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.reflect.TypeToken;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;

import org.json.JSONObject;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;

import java.io.IOException;
import java.util.List;

import rx.Observable;
import rx.Subscriber;
import rx.exceptions.OnErrorFailedException;
import rx.functions.Func1;
import shoujibang.net.nextaf.demo.api.model.Feed;
import shoujibang.net.nextaf.demo.api.model.Gist;
import shoujibang.net.nextaf.demo.api.model.Post;
import shoujibang.net.nextaf.demo.api.model.Repo;

/**
 * Created by xiaoxie on 15/05/02.
 */
public class OkAPIClient {

    public static final String TAG = OkAPIClient.class.getSimpleName();

    private static final OkAPIClient instance = new OkAPIClient();
    private OkHttpClient mOkHttpClient;
    private Serializer mSerializer;
    private Gson mGson;

    private OkAPIClient() {
        mOkHttpClient = new OkHttpClient();
        mSerializer = new Persister();
        mGson = new Gson();
    }

    public static OkAPIClient getInstance() {
        return OkAPIClient.instance;
    }

    public Observable<Response> getResponse(final Request request) {
        return Observable.create(new Observable.OnSubscribe<Response>() {
            @Override
            public void call(Subscriber<? super Response> subscriber) {
                try {
                    Response response = mOkHttpClient.newCall(request).execute();
                    subscriber.onNext(response);
                    subscriber.onCompleted();
                } catch (IOException e) {
                    subscriber.onError(e);
                }
            }
        });
    }

    public Observable<Feed> requestFeed() {
        Request request = new Request.Builder()
//                .url("http://rakuishi.com/index.xml")
                .url("http://shoujibang.net/atom.xml")
                .get()
                .build();
        return getResponse(request)
                .map(convertXMLResponseToObject(mSerializer, Feed.class));
    }

    public Observable<List<Post>> requestPosts() {
        Request request = new Request.Builder()
                .url("http://shoujibang.net/content.json")
                .get()
                .build();
        return getResponse(request)
                .map(convertPostJSONResponseToObject(mGson, new TypeToken<List<Post>>() {
                }));
    }

    public Observable<List<Repo>> requestRepos() {
        Request request = new Request.Builder()
                .url("https://api.github.com/users/xiaoxie/repos")
                .get()
                .build();
        return getResponse(request)
                .map(convertJSONResponseToObject(mGson, new TypeToken<List<Repo>>() {
                }));
    }

    public Observable<List<Gist>> requestGists() {
        Request request = new Request.Builder()
                .url("https://api.github.com/users/xiaoxie/gists")
                .get()
                .build();
        return getResponse(request)
                .map(convertJSONResponseToObject(mGson, new TypeToken<List<Gist>>() {
                }));
    }

    private static <T> Func1<Response, T> convertXMLResponseToObject(final Serializer serializer, final Class<T> clazz) {
        return new Func1<Response, T>() {
            @Override
            public T call(Response response) {
                try {
                    return serializer.read(clazz, response.body().string());
                } catch (Exception e) {
                    throw new OnErrorFailedException(e);
                }
            }
        };
    }

    private static <T> Func1<Response, T> convertPostJSONResponseToObject(final Gson gson, final TypeToken<T> typeToken) {
        return new Func1<Response, T>() {
            @Override
            public T call(Response response) {
                try {
                    JSONObject jo = new JSONObject(response.body().string()) ;
                    JsonElement element = gson.fromJson(jo.optJSONArray("posts").toString(), JsonElement.class);
                    return gson.fromJson(element, typeToken.getType());
                } catch (Exception e) {
                    throw new OnErrorFailedException(e);
                }
            }
        };
    }

    private static <T> Func1<Response, T> convertJSONResponseToObject(final Gson gson, final TypeToken<T> typeToken) {
        return new Func1<Response, T>() {
            @Override
            public T call(Response response) {
                try {
                    JsonElement element = gson.fromJson(response.body().string(), JsonElement.class);
                    return gson.fromJson(element, typeToken.getType());
                } catch (Exception e) {
                    throw new OnErrorFailedException(e);
                }
            }
        };
    }
}


text:
/******************************************************************************
 *                    _   _____   __________                                  *
 *                   | | / / _ | / __/_  __/     Visibility                   *
 *                   | |/ / __ |_\ \  / /          Across                     *
 *                   |___/_/ |_/___/ /_/       Space and Time                 *
 *                                                                            *
 * This file is part of VAST. It is subject to the license terms in the       *
 * LICENSE file found in the top-level directory of this distribution and at  *
 * http://vast.io/license. No part of VAST, including this file, may be       *
 * copied, modified, propagated, or distributed except according to the terms *
 * contained in the LICENSE file.                                             *
 ******************************************************************************/

#include "vast/value_index_factory.hpp"

#include <caf/optional.hpp>

#include "vast/attribute.hpp"
#include "vast/base.hpp"
#include "vast/concept/parseable/numeric/integral.hpp"
#include "vast/concept/parseable/to.hpp"
#include "vast/concept/parseable/vast/base.hpp"
#include "vast/detail/type_traits.hpp"
#include "vast/type.hpp"
#include "vast/value_index.hpp"

namespace vast {
namespace {

template <class T>
size_t extract_max_size(const T& x, size_t default_value = 1024) {
  if (auto a = extract_attribute(x, "max_size"))
    if (auto max_size = to<size_t>(*a))
      return *max_size;
  return default_value;
}

template <class T>
optional<base> parse_base(const T& x) {
  if (auto a = extract_attribute(x, "base")) {
    if (auto b = to<base>(*a))
      return *b;
    return {};
  }
  // Use base 8 by default, as it yields the best performance on average for
  // VAST's indexing.
  return base::uniform<64>(8);
}

template <class T>
value_index_ptr make(type x) {
  return std::make_unique<T>(std::move(x));
}

template <class T>
value_index_ptr make_arithmetic(type x) {
  static_assert(detail::is_any_v<T, integer_type, count_type, real_type,
                timespan_type, timestamp_type>);
  using concrete_data = type_to_data<T>;
  using value_index_type = arithmetic_index<concrete_data>;
  if (auto base = parse_base(x))
    return std::make_unique<value_index_type>(std::move(x), std::move(*base));
  return nullptr;
}

template <class T, class Index>
auto add_value_index_factory() {
  return factory<value_index>::add(T{}, make<Index>);
}

template <class T>
auto add_arithmetic_index_factory() {
  return factory<value_index>::add(T{}, make_arithmetic<T>);
}

template <class T, class Index>
auto add_container_index_factory() {
  static auto f = [](type x) -> value_index_ptr {
    auto max_size = extract_max_size(x);
    return std::make_unique<Index>(std::move(x), max_size);
  };
  return factory<value_index>::add(T{}, f);
}

} // namespace <anonymous>

void factory_traits<value_index>::initialize() {
  add_value_index_factory<boolean_type, arithmetic_index<boolean>>();
  add_arithmetic_index_factory<integer_type>();
  add_arithmetic_index_factory<count_type>();
  add_arithmetic_index_factory<real_type>();
  add_arithmetic_index_factory<timespan_type>();
  add_arithmetic_index_factory<timestamp_type>();
  add_value_index_factory<address_type, address_index>();
  add_value_index_factory<subnet_type, subnet_index>();
  add_value_index_factory<port_type, port_index>();
  add_container_index_factory<string_type, string_index>();
  add_container_index_factory<vector_type, sequence_index>();
  add_container_index_factory<set_type, sequence_index>();
}

factory_traits<value_index>::key_type
factory_traits<value_index>::key(const type& t) {
  auto f = [&](const auto& x) {
    using concrete_type = std::decay_t<decltype(x)>;
    if constexpr (std::is_same_v<concrete_type, alias_type>) {
      return key(x.value_type);
    } else {
      static type instance = concrete_type{};
      return instance;
    }
  };
  return caf::visit(f, t);
}

} // namespace vast


text:
'use strict';

var Backbone = require('backbone'),
    GenreModel = require('./genre.model');

var GenreCollection = Backbone.Collection.extend({
    model: GenreModel
});

module.exports = GenreCollection;


text:
Meteor.publish('images', function(limit) {
    check(limit, Number);

    return Images.find({}, {
        limit: limit
    });
});


text:
package org.dcm4che.tools.printscu;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import javax.swing.BoxLayout;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import javax.swing.table.TableModel;

import org.apache.log4j.Logger;

public class PropertiesPanel extends JPanel implements TableModelListener, MouseListener
{
    private final Logger log = Logger.getLogger(PrintSCUFrame.class);

    private Properties props;
    /*private String host;
    private String callingAET, calledAET;
    private int port;*/

    static final String[] KEYS =
    {
        "Host",
        "Port",
        "CalledAET",
        "CallingAET",
        "MaxPduSize", //ignored
        "Grouplens",  //ignored
        "SOP.Verification",
        "SOP.BasicGrayscalePrintManagement",
        "SOP.BasicColorPrintManagement",
        "SOP.BasicAnnotationBox",
        "SOP.BasicPrintImageOverlayBox",
        "SOP.PresentationLUT",
        "SOP.PrintJob",
        "SOP.PrinterConfigurationRetrieval",
        "Session.NumberOfCopies",
        "Session.PrintPriority",
        "Session.MediumType",
        "Session.FilmDestination",
        "Session.FilmSessionLabel",
        "Session.MemoryAllocation",
        "Session.OwnerID",
        "FilmBox.ImageDisplayFormat",
        "FilmBox.FilmOrientation",
        "FilmBox.FilmSizeID",
        "FilmBox.RequestedResolutionID",
        "FilmBox.AnnotationDisplayFormatID",
        "FilmBox.MagnificationType",
        "FilmBox.SmoothingType",
        "FilmBox.BorderDensity",
        "FilmBox.EmptyImageDensity",
        "FilmBox.MinDensity",
        "FilmBox.MaxDensity",
        "FilmBox.Trim",
        "FilmBox.ConfigurationInformation",
        "FilmBox.Illumination",
        "FilmBox.ReflectedAmbientLight",
        "ImageBox.Polarity",
        "ImageBox.MagnificationType",
        "ImageBox.SmoothingType",
        "ImageBox.MinDensity",
        "ImageBox.MaxDensity",
        "ImageBox.ConfigurationInformation",
        "ImageBox.RequestedDecimateCropBehavior",
        "ImageBox.RequestedImageSize",
        "LUT.Shape",
        "LUT.Gamma",
        //"LUT.Level",
        //"LUT.ScaleToFitBitDepth",
        //"LUT.ApplyBySCU",
        //"User.SendAspectRatio",
        //"User.RequestedZoom",
        //"User.BurnInInfo",
        "User.BurnInOverlays",
        "User.AutoScale",   //added this
        //"User.BurnInInfo.Properties",
        //"User.BitDepth",
        //"User.InflateBitsAlloc",
        //"User.MinMaxWindowing",
        "Verbose",
        //"DumpCmdsetIntoDir",
        //"DumpDatasetIntoDir",
    };

    private static final Properties DEFAULTS;

    static { //initialize some defaults
        DEFAULTS = new Properties();
        DEFAULTS.put("Host", "localhost");
        DEFAULTS.put("CallingAET", "PrintSCU");
        DEFAULTS.put("CalledAET", "TIANI_PRINT");
        DEFAULTS.put("Port", "6104");
        DEFAULTS.put("FilmBox.ImageDisplayFormat", "STANDARD\\1,1");
        DEFAULTS.put("FilmBox.AnnotationDisplayFormatID", "TITLE");
    }

    private static final String[] PRINT_PRIORITY = {
      "","HIGH","MED","LOW"
    };
    private static final String[] MEDIUM_TYPE = {
      "","PAPER","CLEAR FILM","BLUE FILM"
    };
    private static final String[] FILM_DESTINATION = {
      "","MAGAZINE","PROCESSOR","BIN_1","BIN_2","BIN_3","BIN_4","BIN_5","BIN_6","BIN_7","BIN_8"
    };
    private static final String[] IMAGE_DISPLAY_FORMAT = {
      "STANDARD\\1,1","STANDARD\\2,3","ROW\\2","COL\\2","SLIDE","SUPERSLIDE","CUSTOM\\1"
    };
    private static final String[] FILM_ORIENTATION = {
      "","PORTRAIT","LANDSCAPE"
    };
    private static final String[] FILM_SIZE_ID = {
      "","8INX10IN","10INX12IN","10INX14IN","11INX14IN","14INX14IN","14INX17IN","24CMX24CM","24CMX30CM"
    };
    private static final String[] MAGNIFICATION_TYPE= {
      "","REPLICATE","BILINEAR","CUBIC","NONE"
    };
    private static final String[] DENSITY = {
      "","BLACK","WHITE"
    };
    private static final String[] YES_NO = {
      "","YES","NO"
    };
    private static final String[] REQUESTED_RESOLUTION_ID = {
      "","STANDARD","HIGH"
    };
    private static final String[] POLARITY = {
      "","NORMAL","REVERSE"
    };
    private static final String[] REQUESTED_DECIMATE_CROP_BEHAVIOR = {
      "","DECIMATE","CROP","FAIL"
    };
    private static final String[] SEND_ASPECTRATIO = {
      "Always","IfNot1/1"
    };
    private static final String[] BURNIN_INFO = {
      "No", "IfNoOverlays", "Always"
    };

    static final int LUT_FILE = 0;
    static final int LUT_GAMMA = 1;
    static final int LUT_IDENTITY = 2;
    static final int LUT_LIN_OD = 3;
    static final int LUT_INVERSE = 4;

    private static final String[] LUT_SHAPE = {
      "<file>","<gamma>","IDENTITY","LIN OD","INVERSE"
    };
    private static final String[] LUT_LEVEL = {
      "FilmSession","FilmBox","ImageBox"
    };
    private static final String[] INFLATE_BIT_DEPTH = {
      "Always","IfNonLinear","No"
    };
    private static final String[] VERBOSE = {
      "0","1","2","3","4","5","6"
    };

    //maps property names to their corresponding Strng[] of enumerations for the UI
    private static final Map PROP_ENUMS;

    static {
        PROP_ENUMS = new HashMap();
        PROP_ENUMS.put("Session.FilmDestination", FILM_DESTINATION);
        PROP_ENUMS.put("Session.FilmOrientation", FILM_ORIENTATION);
        PROP_ENUMS.put("Session.MediumType", MEDIUM_TYPE);
        PROP_ENUMS.put("Session.PrintPriority", PRINT_PRIORITY);
        PROP_ENUMS.put("FilmBox.ImageDisplayFormat", IMAGE_DISPLAY_FORMAT);
        PROP_ENUMS.put("FilmBox.FilmSizeID", FILM_SIZE_ID);
        PROP_ENUMS.put("FilmBox.MagnificationType", MAGNIFICATION_TYPE);
        PROP_ENUMS.put("FilmBox.RequestedResolutionID", REQUESTED_RESOLUTION_ID);
        PROP_ENUMS.put("ImageBox.RequestedDecimateCropBehavior",
            REQUESTED_DECIMATE_CROP_BEHAVIOR);
        PROP_ENUMS.put("ImageBox.Polarity", POLARITY);
        PROP_ENUMS.put("User.SendAspectRatio", SEND_ASPECTRATIO);
        PROP_ENUMS.put("User.BurnInInfo", BURNIN_INFO);
        PROP_ENUMS.put("User.BurnInOverlays", YES_NO);
        PROP_ENUMS.put("User.AutoScale", YES_NO);
        PROP_ENUMS.put("Verbose", VERBOSE);
    }

    private PrintSCUFrame printSCUFrame;
    private JTable table;
    private TableModel model;

    PropertiesPanel(PrintSCUFrame printSCUFrame, String fileName)
    {
        super();
        this.printSCUFrame = printSCUFrame;
        setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
        //load properties file
        File file = new File(fileName);
        props = loadProperties(file);
        //fill properties table
        table = new JTable(KEYS.length, 2);
        for (int i = 0; i < KEYS.length; i++) {
            table.setValueAt(KEYS[i], i, 0);
            table.setValueAt(props.getProperty(KEYS[i]), i, 1);
        }
        model = table.getModel();
        model.addTableModelListener(this);
        table.addMouseListener(this);
        add(table);
    }

    public void mouseClicked(MouseEvent e)
    {
        int column = table.getSelectedColumn();
        int row = table.getSelectedRow();
        if (column == 0) {
            String prop = (String)table.getValueAt(row, 0);
            String value = props.getProperty(prop);
            String[] choices = (String[])PROP_ENUMS.get(prop);
            if (choices == null)
                return;
            value = (String)JOptionPane.showInputDialog(printSCUFrame,
                "Choose a value:", prop, JOptionPane.QUESTION_MESSAGE,
                null, choices, choices[0]);
            if (value != null) {
                table.setValueAt(value, row, 1);
                if (value.equals(""))
                    props.remove(prop);
                else
                    props.setProperty(prop, value);
            }
        }
    }
    public void mouseExited(MouseEvent e)
    {
    }
    public void mouseEntered(MouseEvent e)
    {
    }
    public void mousePressed(MouseEvent e)
    {
    }
    public void mouseReleased(MouseEvent e)
    {
    }

    public void tableChanged(TableModelEvent e)
    {
        int row = e.getFirstRow();
        int column = e.getColumn();
        if (column != 1)
            return;
        String prop = (String)model.getValueAt(row, 0);
        String data = (String)model.getValueAt(row, 1);
        props.put(prop, data);
        printSCUFrame.propertyChanged(prop);
    }

    private Properties loadProperties(File file) {
        Properties props = new Properties(DEFAULTS);
        try {
            props.load(new BufferedInputStream(new FileInputStream(file)));
        }
        catch (FileNotFoundException e) {
            log.warn("No properties file was found, using default settings");
        }
        catch (IOException e) {
            log.warn("Can not load properties file");
        }
        return props;
    }

    String getProperty(String key)
    {
        return props.getProperty(key);
    }
}


text:
<?php

namespace App\Controller;

use App\Controller\AppController;

/**
 * ContasReceber Controller
 *
 * @property \App\Model\Table\ContasReceberTable $ContasReceber
 */
class ContasReceberController extends AppController {

    public function __construct(\Cake\Network\Request $request = null, \Cake\Network\Response $response = null, $name = null, $eventManager = null, $components = null) {
        parent::__construct($request, $response, $name, $eventManager, $components);
        $this->set('title', 'Contas a Receber');
    }

    /**
     * Index method
     *
     * @return void
     */
    public function index() {
        if (!empty($this->request->query('data_vencimento'))) {
            $this->request->query['data_vencimento'] = implode('-', array_reverse(explode('/', $this->request->query('data_vencimento'))));
        }
        $query = $this->{$this->modelClass}->find('search', $this->{$this->modelClass}->filterParams($this->request->query))->order(['ContasReceber.status' => 'asc', 'ContasReceber.data_vencimento' => 'asc', 'ContasReceber.parcelas' => 'asc'])->contain(['FormasPagamentos', 'Empresas' => function($q) {
                return $q->contain('Pessoas');
            }, 'Pessoas', 'Bancos']);
        $this->set('contasReceber', $this->paginate($query));
        $this->set('_serialize', ['contasReceber']);
        $pessoas = $this->ContasReceber->Pessoas->find('list')->contain(['PessoasAssociacoes' => function($q) {
                return $q->where(['tipo_associacao' => 2, 'status' => 1]);
            }]);
                $bancos = $this->ContasReceber->Bancos->find('list');
                $this->set(compact(['pessoas', 'bancos']));

            }

            /**
             * View method
             *
             * @param string|null $id Contas Receber id.
             * @return void
             * @throws \Cake\Network\Exception\NotFoundException When record not found.
             */
            public function view($id = null) {
                $contasReceber = $this->ContasReceber->get($id, [
                    'contain' => ['Empresas', 'Pessoas', 'Bancos', 'Tradutoras']
                ]);
                $this->set('contasReceber', $contasReceber);
                $this->set('_serialize', ['contasReceber']);
            }

            /**
             * Add method
             *
             * @return void Redirects on successful add, renders view otherwise.
             */
            public function add() {
                $contasReceber = $this->ContasReceber->newEntity();
                if ($this->request->is('post')) {
                    $contasReceber = $this->ContasReceber->patchEntity($contasReceber, $this->request->data);
                    if ($this->ContasReceber->save($contasReceber)) {
                        $this->Flash->success(__('Registro Salvo com Sucesso.'));
                        return $this->redirect(['action' => 'index']);
                    } else {
                        $this->Flash->error(__('Erro ao Salvar o Registro. Tente Novamente.'));
                    }
                }
                $pessoas = $this->ContasReceber->Pessoas->find('list')->contain(['PessoasAssociacoes' => function($q) {
                        return $q->where(['tipo_associacao' => 2, 'status' => 1]);
                    }]);
                        $bancos = $this->ContasReceber->Bancos->find('list');
                        $formasPagamentos = $this->ContasReceber->FormasPagamentos->find('list');
                        $tradutoras = $this->ContasReceber->Tradutoras->find('list');
                        $this->set(compact('contasReceber', 'empresas', 'pessoas', 'bancos', 'formasPagamentos', 'tradutoras'));
                        $this->set('_serialize', ['contasReceber']);
                    }

                    /**
                     * Edit method
                     *
                     * @param string|null $id Contas Receber id.
                     * @return void Redirects on successful edit, renders view otherwise.
                     * @throws \Cake\Network\Exception\NotFoundException When record not found.
                     */
                    public function edit($id = null) {
                        $contasReceber = $this->ContasReceber->get($id, [
                            'contain' => ['FormasPagamentos']
                        ]);

                        if ($this->request->is(['patch', 'post', 'put'])) {
                            $isBaixa = false;
                            if ($contasReceber->formas_pagamento->grupo != 3) {
                                if (!empty($this->request->data['valor_documento'])) {
                                    $this->request->data['valor_liquido'] = $this->request->data['valor_documento'];
                                }
                            }
                            if (!empty($this->request->data['data_recebimento'])) {
                                if ($contasReceber->status == 1) {
                                    $isBaixa = true;
                                    $this->request->data['status'] = 2;
                                }
                            }

                            $contasReceber = $this->ContasReceber->patchEntity($contasReceber, $this->request->data);
                            if ($this->ContasReceber->save($contasReceber)) {
                                if ($isBaixa === true) {
                                    $this->loadModel('ContasPagar');
                                    $this->loadModel('Bancos');
                                    $this->loadModel('Contas');
                                    $findBanco = $this->Bancos->find()->where(['codigo_banco' => '999'])->first();
                                    $findContas = $this->Contas->find()->where(['tradutora' => '601'])->first();
                                    $contasPagar = $this->ContasPagar->newEntity();
                                    $contasPagar->empresa_id = $contasReceber->empresa_id;
                                    $contasPagar->numero_documento = $contasReceber->numero_documento . $contasReceber->parcelas . $contasReceber->pessoa_id . date('mY');
                                    $contasPagar->data_vencimento = $contasReceber->data_recebimento;
                                    $contasPagar->valor_documento = $contasReceber->valor_desconto;
                                    $contasPagar->pessoa_id = $this->request->session()->read('Auth.User.pessoa_id');
                                    $contasPagar->banco_id = $findBanco->id;
                                    $contasPagar->tradutora_id = $findContas->id;
                                    $contasPagar->status = 2;
                                    $contasPagar->data_pagamento = $contasReceber->data_recebimento;
                                    $contasPagar->valor_pagamento = $contasReceber->valor_desconto;
                                    $contasPagar->contas_receber_id = $contasReceber->id;
                                    $save = $this->ContasPagar->save($contasPagar);
                                }
                                $this->Flash->success(__('Registro Salvo com Sucesso.'));
                                return $this->redirect(['action' => 'index']);
                            } else {
                                $this->Flash->error(__('Erro ao Salvar o Registro. Tente Novamente.'));
                            }
                        }
                        $pessoas = $this->ContasReceber->Pessoas->find('list')->contain(['PessoasAssociacoes' => function($q) {
                                return $q->where(['tipo_associacao' => 2, 'status' => 1]);
                            }]);
                                $bancos = $this->ContasReceber->Bancos->find('list');
                                $formasPagamentos = $this->ContasReceber->FormasPagamentos->find('list');
                                $tradutoras = $this->ContasReceber->Tradutoras->find('list');
                                $this->set(compact('contasReceber', 'empresas', 'pessoas', 'bancos', 'formasPagamentos', 'tradutoras'));
                                $this->set('_serialize', ['contasReceber']);
                            }

                            /**
                             * Delete method
                             *
                             * @param string|null $id Contas Receber id.
                             * @return \Cake\Network\Response|null Redirects to index.
                             * @throws \Cake\Network\Exception\NotFoundException When record not found.
                             */
                            public function delete($id = null) {
                                $this->request->allowMethod(['post', 'delete']);
                                $contasReceber = $this->ContasReceber->get($id);
                                $contasReceber->status = 3;
                                if ($this->ContasReceber->save($contasReceber)) {
                                    $this->Flash->success(__('Registro Excluido com Sucesso.'));
                                } else {
                                    $this->Flash->error(__('Erro ao Excluir o Registro. Tente Novamente.'));
                                }
                                return $this->redirect($this->referer());
                            }

                        }


text:
<?php

namespace Arrilot\BitrixMigrations\Autocreate\Handlers;

use Arrilot\BitrixMigrations\Exceptions\StopHandlerException;

class OnBeforeGroupUpdate extends BaseHandler implements HandlerInterface
{
    /**
     * Bitrix group id.
     *
     * @var int
     */
    protected $id;

    /**
     * Constructor.
     *
     * @param array $params
     *
     * @throws StopHandlerException
     */
    public function __construct($params)
    {
        $this->id = $params[0];
        $this->fields = $params[1];

        if (!$this->fields['STRING_ID']) {
            throw new StopHandlerException('Code is required to create a migration');
        }
    }

    /**
     * Get migration name.
     *
     * @return string
     */
    public function getName()
    {
        return "auto_update_group_{$this->fields['STRING_ID']}";
    }

    /**
     * Get template name.
     *
     * @return string
     */
    public function getTemplate()
    {
        return 'auto_update_group';
    }

    /**
     * Get array of placeholders to replace.
     *
     * @return array
     */
    public function getReplace()
    {
        return [
            'fields' => var_export($this->fields, true),
            'id'     => $this->id,
        ];
    }
}


text:
#include "third_party/blink/renderer/modules/speech/speech_synthesis.h"

#include <tuple>

#include "build/build_config.h"
#include "third_party/blink/public/common/browser_interface_broker_proxy.h"
#include "third_party/blink/public/common/privacy_budget/identifiability_metric_builder.h"
#include "third_party/blink/public/common/privacy_budget/identifiability_study_settings.h"
#include "third_party/blink/public/common/privacy_budget/identifiable_token.h"
#include "third_party/blink/public/common/privacy_budget/identifiable_token_builder.h"
#include "third_party/blink/public/common/thread_safe_browser_interface_broker_proxy.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_speech_synthesis_error_event_init.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_speech_synthesis_event_init.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/html/media/autoplay_policy.h"
#include "third_party/blink/renderer/core/timing/dom_window_performance.h"
#include "third_party/blink/renderer/core/timing/performance.h"
#include "third_party/blink/renderer/modules/speech/speech_synthesis_error_event.h"
#include "third_party/blink/renderer/modules/speech/speech_synthesis_event.h"
#include "third_party/blink/renderer/modules/speech/speech_synthesis_voice.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/privacy_budget/identifiability_digest_helpers.h"

namespace blink {

const char SpeechSynthesis::kSupplementName[] = "SpeechSynthesis";

SpeechSynthesisBase* SpeechSynthesis::Create(LocalDOMWindow& window) {
  return MakeGarbageCollected<SpeechSynthesis>(window);
}

SpeechSynthesis* SpeechSynthesis::speechSynthesis(LocalDOMWindow& window) {
  SpeechSynthesis* synthesis =
      Supplement<LocalDOMWindow>::From<SpeechSynthesis>(window);
  if (!synthesis) {
    synthesis = MakeGarbageCollected<SpeechSynthesis>(window);
    ProvideTo(window, synthesis);
#if BUILDFLAG(IS_ANDROID)
    // On Android devices we lazily initialize |mojom_synthesis_| to avoid
    // needlessly binding to the TTS service, see https://crbug.com/811929.
    // TODO(crbug/811929): Consider moving this logic into the Android-
    // specific backend implementation.
#else
    std::ignore = synthesis->TryEnsureMojomSynthesis();
#endif
  }
  return synthesis;
}

void SpeechSynthesis::CreateForTesting(
    LocalDOMWindow& window,
    mojo::PendingRemote<mojom::blink::SpeechSynthesis> mojom_synthesis) {
  DCHECK(!Supplement<LocalDOMWindow>::From<SpeechSynthesis>(window));
  SpeechSynthesis* synthesis = MakeGarbageCollected<SpeechSynthesis>(window);
  ProvideTo(window, synthesis);
  synthesis->SetMojomSynthesisForTesting(std::move(mojom_synthesis));
}

SpeechSynthesis::SpeechSynthesis(LocalDOMWindow& window)
    : Supplement<LocalDOMWindow>(window),
      receiver_(this, &window),
      mojom_synthesis_(&window) {}

void SpeechSynthesis::OnSetVoiceList(
    Vector<mojom::blink::SpeechSynthesisVoicePtr> mojom_voices) {
  voice_list_.clear();
  for (auto& mojom_voice : mojom_voices) {
    voice_list_.push_back(
        MakeGarbageCollected<SpeechSynthesisVoice>(std::move(mojom_voice)));
  }
  VoicesDidChange();
}

const HeapVector<Member<SpeechSynthesisVoice>>& SpeechSynthesis::getVoices() {
  // Kick off initialization here to ensure voice list gets populated.
  std::ignore = TryEnsureMojomSynthesis();
  RecordVoicesForIdentifiability();
  return voice_list_;
}

void SpeechSynthesis::RecordVoicesForIdentifiability() const {
  constexpr IdentifiableSurface surface = IdentifiableSurface::FromTypeAndToken(
      IdentifiableSurface::Type::kWebFeature,
      WebFeature::kSpeechSynthesis_GetVoices_Method);
  if (!IdentifiabilityStudySettings::Get()->ShouldSampleSurface(surface))
    return;
  if (!GetSupplementable()->GetFrame())
    return;

  IdentifiableTokenBuilder builder;
  for (const auto& voice : voice_list_) {
    builder.AddToken(IdentifiabilityBenignStringToken(voice->voiceURI()));
    builder.AddToken(IdentifiabilityBenignStringToken(voice->lang()));
    builder.AddToken(IdentifiabilityBenignStringToken(voice->name()));
    builder.AddToken(voice->localService());
  }
  IdentifiabilityMetricBuilder(GetSupplementable()->UkmSourceID())
      .Add(surface, builder.GetToken())
      .Record(GetSupplementable()->UkmRecorder());
}

bool SpeechSynthesis::Speaking() const {
  // If we have a current speech utterance, then that means we're assumed to be
  // in a speaking state. This state is independent of whether the utterance
  // happens to be paused.
  return CurrentSpeechUtterance();
}

bool SpeechSynthesis::pending() const {
  // This is true if there are any utterances that have not started.
  // That means there will be more than one in the queue.
  return utterance_queue_.size() > 1;
}

bool SpeechSynthesis::paused() const {
  return is_paused_;
}

void SpeechSynthesis::Speak(const String& text, const String& lang) {
  ScriptState* script_state =
      ToScriptStateForMainWorld(GetSupplementable()->GetFrame());
  SpeechSynthesisUtterance* utterance =
      SpeechSynthesisUtterance::Create(GetSupplementable(), text);
  utterance->setLang(lang);
  speak(script_state, utterance);
}

void SpeechSynthesis::speak(ScriptState* script_state,
                            SpeechSynthesisUtterance* utterance) {
  DCHECK(utterance);
  if (!script_state->ContextIsValid())
    return;

  // Note: Non-UseCounter based TTS metrics are of the form TextToSpeech.* and
  // are generally global, whereas these are scoped to a single page load.
  UseCounter::Count(GetSupplementable(), WebFeature::kTextToSpeech_Speak);
  GetSupplementable()->CountUseOnlyInCrossOriginIframe(
      WebFeature::kTextToSpeech_SpeakCrossOrigin);
  if (!IsAllowedToStartByAutoplay()) {
    Deprecation::CountDeprecation(
        GetSupplementable(),
        WebFeature::kTextToSpeech_SpeakDisallowedByAutoplay);
    FireErrorEvent(utterance, 0 /* char_index */, "not-allowed");
    return;
  }

  utterance_queue_.push_back(utterance);

  // If the queue was empty, speak this immediately.
  if (utterance_queue_.size() == 1)
    StartSpeakingImmediately();
}

void SpeechSynthesis::Cancel() {
  // Remove all the items from the utterance queue. The platform
  // may still have references to some of these utterances and may
  // fire events on them asynchronously.
  utterance_queue_.clear();

  if (mojom::blink::SpeechSynthesis* mojom_synthesis =
          TryEnsureMojomSynthesis())
    mojom_synthesis->Cancel();
}

void SpeechSynthesis::Pause() {
  if (is_paused_)
    return;

  if (mojom::blink::SpeechSynthesis* mojom_synthesis =
          TryEnsureMojomSynthesis())
    mojom_synthesis->Pause();
}

void SpeechSynthesis::Resume() {
  if (!CurrentSpeechUtterance())
    return;

  if (mojom::blink::SpeechSynthesis* mojom_synthesis =
          TryEnsureMojomSynthesis())
    mojom_synthesis->Resume();
}

void SpeechSynthesis::DidStartSpeaking(SpeechSynthesisUtterance* utterance) {
  FireEvent(event_type_names::kStart, utterance, 0, 0, String());
}

void SpeechSynthesis::DidPauseSpeaking(SpeechSynthesisUtterance* utterance) {
  is_paused_ = true;
  FireEvent(event_type_names::kPause, utterance, 0, 0, String());
}

void SpeechSynthesis::DidResumeSpeaking(SpeechSynthesisUtterance* utterance) {
  is_paused_ = false;
  FireEvent(event_type_names::kResume, utterance, 0, 0, String());
}

void SpeechSynthesis::DidFinishSpeaking(
    SpeechSynthesisUtterance* utterance,
    mojom::blink::SpeechSynthesisErrorCode error_code) {
  HandleSpeakingCompleted(utterance, error_code);
}

void SpeechSynthesis::SpeakingErrorOccurred(
    SpeechSynthesisUtterance* utterance) {
  HandleSpeakingCompleted(
      utterance, mojom::blink::SpeechSynthesisErrorCode::kErrorOccurred);
}

void SpeechSynthesis::WordBoundaryEventOccurred(
    SpeechSynthesisUtterance* utterance,
    unsigned char_index,
    unsigned char_length) {
  DEFINE_STATIC_LOCAL(const String, word_boundary_string, ("word"));
  FireEvent(event_type_names::kBoundary, utterance, char_index, char_length,
            word_boundary_string);
}

void SpeechSynthesis::SentenceBoundaryEventOccurred(
    SpeechSynthesisUtterance* utterance,
    unsigned char_index,
    unsigned char_length) {
  DEFINE_STATIC_LOCAL(const String, sentence_boundary_string, ("sentence"));
  FireEvent(event_type_names::kBoundary, utterance, char_index, char_length,
            sentence_boundary_string);
}

void SpeechSynthesis::VoicesDidChange() {
  DispatchEvent(*Event::Create(event_type_names::kVoiceschanged));
}

void SpeechSynthesis::StartSpeakingImmediately() {
  SpeechSynthesisUtterance* utterance = CurrentSpeechUtterance();
  DCHECK(utterance);

  double millis;
  if (!GetElapsedTimeMillis(&millis))
    return;

  utterance->SetStartTime(millis / 1000.0);
  is_paused_ = false;

  if (TryEnsureMojomSynthesis())
    utterance->Start(this);
}

void SpeechSynthesis::HandleSpeakingCompleted(
    SpeechSynthesisUtterance* utterance,
    mojom::blink::SpeechSynthesisErrorCode error_code) {
  DCHECK(utterance);

  // Special handling for audio descriptions.
  SpeechSynthesisBase::HandleSpeakingCompleted();

  bool should_start_speaking = false;
  // If the utterance that completed was the one we're currently speaking,
  // remove it from the queue and start speaking the next one.
  if (utterance == CurrentSpeechUtterance()) {
    utterance_queue_.pop_front();
    should_start_speaking = !utterance_queue_.empty();
  }

  // https://wicg.github.io/speech-api/#speechsynthesiserrorevent-attributes
  // The below errors are matched with SpeechSynthesisErrorCode values.
  static constexpr char kErrorCanceled[] = "canceled";
  static constexpr char kErrorInterrupted[] = "interrupted";
  static constexpr char kErrorSynthesisFailed[] = "synthesis-failed";

  // Always fire the event, because the platform may have asynchronously
  // sent an event on an utterance before it got the message that we
  // canceled it, and we should always report to the user what actually
  // happened.
  switch (error_code) {
    case mojom::blink::SpeechSynthesisErrorCode::kInterrupted:
      FireErrorEvent(utterance, 0, kErrorInterrupted);
      break;
    case mojom::blink::SpeechSynthesisErrorCode::kCancelled:
      FireErrorEvent(utterance, 0, kErrorCanceled);
      break;
    case mojom::blink::SpeechSynthesisErrorCode::kErrorOccurred:
      // TODO(csharrison): Actually pass the correct message. For now just use a
      // generic error.
      FireErrorEvent(utterance, 0, kErrorSynthesisFailed);
      break;
    case mojom::blink::SpeechSynthesisErrorCode::kNoError:
      FireEvent(event_type_names::kEnd, utterance, 0, 0, String());
      break;
  }

  // Start the next utterance if we just finished one and one was pending.
  if (should_start_speaking && !utterance_queue_.empty())
    StartSpeakingImmediately();
}

void SpeechSynthesis::FireEvent(const AtomicString& type,
                                SpeechSynthesisUtterance* utterance,
                                uint32_t char_index,
                                uint32_t char_length,
                                const String& name) {
  double millis;
  if (!GetElapsedTimeMillis(&millis))
    return;

  SpeechSynthesisEventInit* init = SpeechSynthesisEventInit::Create();
  init->setUtterance(utterance);
  init->setCharIndex(char_index);
  init->setCharLength(char_length);
  init->setElapsedTime(millis - (utterance->StartTime() * 1000.0));
  init->setName(name);
  utterance->DispatchEvent(*SpeechSynthesisEvent::Create(type, init));
}

void SpeechSynthesis::FireErrorEvent(SpeechSynthesisUtterance* utterance,
                                     uint32_t char_index,
                                     const String& error) {
  double millis;
  if (!GetElapsedTimeMillis(&millis))
    return;

  SpeechSynthesisErrorEventInit* init = SpeechSynthesisErrorEventInit::Create();
  init->setUtterance(utterance);
  init->setCharIndex(char_index);
  init->setElapsedTime(millis - (utterance->StartTime() * 1000.0));
  init->setError(error);
  utterance->DispatchEvent(
      *SpeechSynthesisErrorEvent::Create(event_type_names::kError, init));
}

SpeechSynthesisUtterance* SpeechSynthesis::CurrentSpeechUtterance() const {
  if (utterance_queue_.empty())
    return nullptr;

  return utterance_queue_.front();
}

ExecutionContext* SpeechSynthesis::GetExecutionContext() const {
  return GetSupplementable();
}

void SpeechSynthesis::Trace(Visitor* visitor) const {
  visitor->Trace(receiver_);
  visitor->Trace(mojom_synthesis_);
  visitor->Trace(voice_list_);
  visitor->Trace(utterance_queue_);
  Supplement<LocalDOMWindow>::Trace(visitor);
  EventTargetWithInlineData::Trace(visitor);
  SpeechSynthesisBase::Trace(visitor);
}

bool SpeechSynthesis::GetElapsedTimeMillis(double* millis) {
  if (!GetSupplementable()->GetFrame())
    return false;
  if (GetSupplementable()->document()->IsStopped())
    return false;

  *millis = DOMWindowPerformance::performance(*GetSupplementable())->now();
  return true;
}

bool SpeechSynthesis::IsAllowedToStartByAutoplay() const {
  Document* document = GetSupplementable()->document();
  DCHECK(document);

  // Note: could check the utterance->volume here, but that could be overriden
  // in the case of SSML.
  if (AutoplayPolicy::GetAutoplayPolicyForDocument(*document) !=
      AutoplayPolicy::Type::kDocumentUserActivationRequired) {
    return true;
  }
  return AutoplayPolicy::IsDocumentAllowedToPlay(*document);
}

void SpeechSynthesis::SetMojomSynthesisForTesting(
    mojo::PendingRemote<mojom::blink::SpeechSynthesis> mojom_synthesis) {
  mojom_synthesis_.Bind(
      std::move(mojom_synthesis),
      GetSupplementable()->GetTaskRunner(TaskType::kMiscPlatformAPI));
  receiver_.reset();
  mojom_synthesis_->AddVoiceListObserver(receiver_.BindNewPipeAndPassRemote(
      GetSupplementable()->GetTaskRunner(TaskType::kMiscPlatformAPI)));
}

mojom::blink::SpeechSynthesis* SpeechSynthesis::TryEnsureMojomSynthesis() {
  if (mojom_synthesis_.is_bound())
    return mojom_synthesis_.get();

  // The frame could be detached. In that case, calls on mojom_synthesis_ will
  // just get dropped. That's okay and is simpler than having to null-check
  // mojom_synthesis_ before each use.
  LocalDOMWindow* window = GetSupplementable();
  if (!window->GetFrame())
    return nullptr;

  auto receiver = mojom_synthesis_.BindNewPipeAndPassReceiver(
      window->GetTaskRunner(TaskType::kMiscPlatformAPI));

  window->GetBrowserInterfaceBroker().GetInterface(std::move(receiver));

  mojom_synthesis_->AddVoiceListObserver(receiver_.BindNewPipeAndPassRemote(
      window->GetTaskRunner(TaskType::kMiscPlatformAPI)));
  return mojom_synthesis_.get();
}

const AtomicString& SpeechSynthesis::InterfaceName() const {
  return event_target_names::kSpeechSynthesis;
}

}  // namespace blink


text:
from abc import ABCMeta, abstractmethod;

class BaseResult(object):
	__metaclass__ = ABCMeta;

	@abstractmethod
	def getResultString(varList):
		print "base result";
		pass;


text:
package com.egojit.android.widget;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;

import com.egojit.android.app.ThemeManager;
import com.egojit.android.drawable.RippleDrawable;
import com.egojit.android.util.ViewUtil;

public class TextView extends android.widget.TextView implements ThemeManager.OnThemeChangedListener{

	private RippleManager mRippleManager;
    protected int mStyleId;
    protected int mCurrentStyle = ThemeManager.THEME_UNDEFINED;

    public interface OnSelectionChangedListener{
        public void onSelectionChanged(View v, int selStart, int selEnd);
    }

    private OnSelectionChangedListener mOnSelectionChangedListener;

    public TextView(Context context) {
        super(context);

        init(context, null, 0, 0);
    }

    public TextView(Context context, AttributeSet attrs) {
        super(context, attrs);

        init(context, attrs, 0, 0);
    }

	public TextView(Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr);

		init(context, attrs, defStyleAttr, 0);
	}

    public TextView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr);

        init(context, attrs, defStyleAttr, defStyleRes);
    }

    private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes){
        ViewUtil.applyFont(this, attrs, defStyleAttr, defStyleRes);
        applyStyle(context, attrs, defStyleAttr, defStyleRes);
        mStyleId = ThemeManager.getStyleId(context, attrs, defStyleAttr, defStyleRes);
    }

    public void applyStyle(int resId){
        ViewUtil.applyStyle(this, resId);
        applyStyle(getContext(), null, 0, resId);
    }

    protected void applyStyle(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes){
        getRippleManager().onCreate(this, context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    public void onThemeChanged(ThemeManager.OnThemeChangedEvent event) {
        int style = ThemeManager.getInstance().getCurrentStyle(mStyleId);
        if(mCurrentStyle != style){
            mCurrentStyle = style;
            applyStyle(mCurrentStyle);
        }
    }

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        if(mStyleId != 0) {
            ThemeManager.getInstance().registerOnThemeChangedListener(this);
            onThemeChanged(null);
        }
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        mRippleManager.cancelRipple(this);
        if(mStyleId != 0)
            ThemeManager.getInstance().unregisterOnThemeChangedListener(this);
    }

    @Override
    public void setBackgroundDrawable(Drawable drawable) {
        Drawable background = getBackground();
        if(background instanceof RippleDrawable && !(drawable instanceof RippleDrawable))
            ((RippleDrawable) background).setBackgroundDrawable(drawable);
        else
            super.setBackgroundDrawable(drawable);
    }

    protected RippleManager getRippleManager(){
        if(mRippleManager == null){
            synchronized (RippleManager.class){
                if(mRippleManager == null)
                    mRippleManager = new RippleManager();
            }
        }

        return mRippleManager;
    }

    @Override
    public void setOnClickListener(OnClickListener l) {
        RippleManager rippleManager = getRippleManager();
        if (l == rippleManager)
            super.setOnClickListener(l);
        else {
            rippleManager.setOnClickListener(l);
            setOnClickListener(rippleManager);
        }
    }

    @Override
    public boolean onTouchEvent(@NonNull MotionEvent event) {
        boolean result = super.onTouchEvent(event);
        return  getRippleManager().onTouchEvent(event) || result;
    }

    public void setOnSelectionChangedListener(OnSelectionChangedListener listener){
        mOnSelectionChangedListener = listener;
    }

    @Override
    protected void onSelectionChanged(int selStart, int selEnd) {
        super.onSelectionChanged(selStart, selEnd);

        if(mOnSelectionChangedListener != null)
            mOnSelectionChangedListener.onSelectionChanged(this, selStart, selEnd);
    }
}


text:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import unittest
import transaction
from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid.authorization import ACLAuthorizationPolicy

from pyramid import testing
from .models import DBSession
from unittest.mock import patch

class EuweBlackBoxTests(unittest.TestCase):
    # user max logs in by putting his username and password
    # when he logs in he gets tactics to work on
    # he tries and solve the problem
    # then he gets the next problem
    # he use the hint button
    # he still can not do this, decide to try later
    def setUp(self):
        self.browser = webdriver.Firefox()

    def tearDown(self):
        self.browser.quit()

    def test_browser_title(self):
        self.browser.get('http://localhost:6543')
        self.assertIn('Euwe', self.browser.title)

    def test_login_page(self):
        self.browser.get('http://localhost:6543/login')

        self.assertIn('Euwe', self.browser.title)

        form = self.browser.find_element_by_tag_name('form')
        self.assertIn('/login', form.get_attribute('action'))

        inputbox = self.browser.find_element_by_id('id_username')
        self.assertEqual(inputbox.get_attribute('placeholder'), 'username')

        password = self.browser.find_element_by_id('id_password')
        self.assertEqual(password.get_attribute('placeholder'), 'password')

        submit = self.browser.find_element_by_name('form.submitted')
        inputbox.send_keys('max')
        password.send_keys('max123')
        submit.submit()

    def test_fen_page(self):
        self.browser.get('http://localhost:6543/fen?id=1')
        self.assertIn('Euwe', self.browser.title)
        self.assertIn('r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R',
        self.browser.page_source)
        self.browser.quit()

        self.browser = webdriver.Firefox()
        self.browser.get('http://localhost:6543/fen?id=100')
        self.assertNotIn('r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R',
        self.browser.page_source)

    def test_edit_page(self):
        self.browser.get('http://localhost:6543/edit')
        self.assertIn('Euwe', self.browser.title)

        btn_start = self.browser.find_element_by_id('id_btn_start')
        self.assertEqual(btn_start.get_attribute('value'), 'Start Position')

        btn_clear = self.browser.find_element_by_id('id_btn_clear')
        self.assertEqual(btn_clear.get_attribute('value'), 'Clear')

        btn_save = self.browser.find_element_by_id('id_btn_save')
        self.assertEqual(btn_save.get_attribute('value'), 'Save')

        text_area = self.browser.find_element_by_id('id_text_area')
        self.assertEqual(text_area.get_attribute('col'), '100')
        self.assertEqual(text_area.get_attribute('height'), '20')

        self.fail('Finish position edit !')


text:
'use strict';

angular.module('courseconnect.controllers')
.controller(
    'majorCandidate', ['$scope','$rootScope', '$http',
    'getCourseoffQueryUrl', 'colorFactory',
    function($scope, $rootScope, $http, getCourseoffQueryUrl,colorFactory){
        $scope.$watch($scope.major,$http.get($scope.major.urlRequest).then(
            function(response) {
            // this callback will be called asynchronously
            // when the response is available
                $scope.courses = response.data;
                $rootScope.isGettingMajorData = false;
            }, function(response) {
            // called asynchronously if an error occurs
            // or server returns response with an error status.
            }));
        $scope.addCourseCandidates = function(course){
            if(!$rootScope.courseCandidates) {
                $rootScope.courseCandidates = [];
            }
            var newElement = true;
            $rootScope.courseCandidates.forEach(function(c) {
                if (c.name == course.name && c.ident == course.ident) {
                    newElement = false;
                }
            });
            $rootScope.status.isRecovering = false;
            if (newElement) {
                $rootScope.selectedMajor = $scope.major.ident;
                course.major = $scope.major;
                $rootScope.selectedCourse = course.ident;
                $rootScope.selectedCourseName = course.name;
                course.urlRequest = getCourseoffQueryUrl($rootScope,'sections');
                if(!course.color){
                    course.color = colorFactory.getNextColor();
                }
                $rootScope.courseCandidates.push(course);
            }
        };
}]);


text:
package com.wolandsoft.sss.service.pccomm;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Paired device information. Contains remote host, port and security key.
 */

public class PairedDevice implements Parcelable {
    public static final Parcelable.Creator<PairedDevice> CREATOR = new Parcelable.Creator<PairedDevice>() {
        public PairedDevice createFromParcel(Parcel in) {
            return new PairedDevice(in);
        }

        public PairedDevice[] newArray(int size) {
            return new PairedDevice[size];
        }
    };
    public byte[] mIp;
    public String mHost;
    public int mPort;
    public byte[] mKey;

    public PairedDevice() {

    }

    private PairedDevice(Parcel in) {
        mIp = new byte[in.readInt()];
        in.readByteArray(mIp);
        mHost = in.readString();
        mPort = in.readInt();
        mKey = new byte[in.readInt()];
        in.readByteArray(mKey);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(mIp.length);
        dest.writeByteArray(mIp);
        dest.writeString(mHost);
        dest.writeInt(mPort);
        dest.writeInt(mKey.length);
        dest.writeByteArray(mKey);
    }

}


text:
Let's define mutable values!

So far we've rendered components with immutable properties using `this.props`.
But what if we want to update components?

`this.state` is private to each component and allows us to define mutable
values. Let's set the initial value of `checkbox` to `false` and define
a function to control the behavior of check events.

# Challenge
---

Modify `Todo` in `index.jsx` like below.

Before you start, you may want to check your current `index.jsx` into source
control, or create a new `index.jsx` for this exercise.

```
import React from 'react';

export default class TodoBox extends React.Component {
  // Omitted
}

class TodoList extends React.Component {
  // Omitted
}

class Todo extends React.Component {
    constructor(props) {
        super(props);
        this.state = {checked: false};
    }

    handleChange(e) {
        this.setState({checked: e.target.checked});
    }

    render() {
        return (
            <tr>
                <td style={{border: "1px solid black"}}>
                    <input type="checkbox" checked={this.state.checked} onChange={this.handleChange}/>
                </td>
                <td style={{border: "1px solid black"}}>{this.props.title}</td>
                <td style={{border: "1px solid black"}}>{this.props.children}</td>
            </tr>
        );
    }
}
Todo.propTypes = {
    title: React.PropTypes.string.isRequired
};

class TodoForm extends React.Component {
  // Omitted
}
```

Write code to set the initial value of `checked` and define `handleChange`.
You can set the initial value of `checked` in a special `getInitialState` function.
Within `handleChange`, you should update the component's `state` by using `this.setState`.

The resources are always recommended, but may be especially helpful here:
Component API: https://facebook.github.io/react/docs/component-api.html
Component Specs and Lifecycle: https://facebook.github.io/react/docs/component-specs.html

After fixing your code, test it locally by running `node program.js` and
visiting `http://localhost:3000` in your browser.

Once you're confident, run `learnyoureact verify program.js`.