text:
var fs = require('fs');

var process_wb = (function() {
	var HTMLOUT = document.getElementById('htmlout');
	var XPORT = document.getElementById('xport');

	return function process_wb(wb) {
		XPORT.disabled = false;
		HTMLOUT.innerHTML = "";
		wb.SheetNames.forEach(function(sheetName) {
			var htmlstr = XLSX.utils.sheet_to_html(wb.Sheets[sheetName],{editable:true});
			HTMLOUT.innerHTML += htmlstr;
		});
	};
})();

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-36810333-1']);
_gaq.push(['_trackPageview']);

(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

var do_file = (function() {
	return function do_file(files) {
		var f = files[0];
		var reader = new FileReader();
		reader.onload = function(e) {
			var data = e.target.result;
			data = new Uint8Array(data);
			process_wb(XLSX.read(data, {type: 'array'}));
		};
		reader.readAsArrayBuffer(f);
	};
})();

(function() {
	var drop = document.getElementById('drop');

	function handleDrop(e) {
		e.stopPropagation();
		e.preventDefault();
		do_file(e.dataTransfer.files);
	}

	function handleDragover(e) {
		e.stopPropagation();
		e.preventDefault();
		e.dataTransfer.dropEffect = 'copy';
	}

	drop.addEventListener('dragenter', handleDragover, false);
	drop.addEventListener('dragover', handleDragover, false);
	drop.addEventListener('drop', handleDrop, false);
})();

(function() {
	var xlf = document.getElementById('xlf');
	function handleFile(e) { do_file(e.target.files); }
	xlf.addEventListener('change', handleFile, false);
})();

var export_xlsx = (function() {
	/* pre-build the nwsaveas input element */
	var HTMLOUT = document.getElementById('htmlout');
	var input = document.createElement('input');
	input.style.display = 'none';
	input.setAttribute('nwsaveas', 'sheetjs.xlsx');
	input.setAttribute('type', 'file');
	document.body.appendChild(input);
	input.addEventListener('cancel',function(){ alert("Save was canceled!"); });
	input.addEventListener('change',function(e){
		var filename=this.value, bookType=(filename.match(/[^\.]*$/)||["xlsx"])[0];
		var wb = XLSX.utils.table_to_book(HTMLOUT);
		var wbout = XLSX.write(wb, {type:'buffer', bookType:bookType});
		fs.writeFile(filename, wbout, function(err) {
			if(!err) return alert("Saved to " + filename);
			alert("Error: " + (err.message || err));
		});
	});

	return function() { input.click(); };
})();


text:
package org.apache.qpid.proton.hawtdispatch.api;

import org.apache.qpid.proton.hawtdispatch.impl.Defer;
import org.apache.qpid.proton.hawtdispatch.impl.Watch;
import org.apache.qpid.proton.engine.Delivery;
import org.apache.qpid.proton.engine.Sender;
import org.apache.qpid.proton.message.Message;
import org.apache.qpid.proton.amqp.messaging.Accepted;
import org.apache.qpid.proton.amqp.messaging.Modified;
import org.apache.qpid.proton.amqp.messaging.Rejected;
import org.apache.qpid.proton.amqp.messaging.Released;
import org.apache.qpid.proton.amqp.transport.DeliveryState;
import org.fusesource.hawtbuf.Buffer;

import java.io.UnsupportedEncodingException;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;

/**
 * @author Hiram Chirino
 */
public class AmqpSender extends AmqpLink {

    private  byte[] EMPTY_BYTE_ARRAY = new byte[]{};
    long nextTagId = 0;
    HashSet<byte[]> tagCache = new HashSet<byte[]>();

    final AmqpSession parent;
    private final QoS qos;
    final Sender sender;

    public AmqpSender(AmqpSession parent, Sender sender2, QoS qos) {
        this.parent = parent;
        this.sender = sender2;
        this.qos = qos;
        attach();
        getConnection().senders.add(this);
    }

    @Override
    public void close() {
        super.close();
        getConnection().senders.remove(this);
    }

    @Override
    protected Sender getEndpoint() {
        return sender;
    }

    @Override
    protected AmqpSession getParent() {
        return parent;
    }

    final LinkedList<MessageDelivery> outbound = new LinkedList<MessageDelivery>();
    long outboundBufferSize;

    public MessageDelivery send(Message message) {
        assertExecuting();
        MessageDelivery rc = new MessageDelivery(message) {
            @Override
            AmqpLink link() {
                return AmqpSender.this;
            }

            @Override
            public void redeliver(boolean incrementDeliveryCounter) {
                super.redeliver(incrementDeliveryCounter);
                outbound.add(this);
                outboundBufferSize += initialSize;
                defer(deferedPumpDeliveries);
            }
        };
        outbound.add(rc);
        outboundBufferSize += rc.initialSize;
        pumpDeliveries();
        pumpOut();
        return rc;
    }

    Buffer currentBuffer;
    Delivery currentDelivery;

    Defer deferedPumpDeliveries = new Defer() {
        public void run() {
            pumpDeliveries();
        }
    };

    public long getOverflowBufferSize() {
        return outboundBufferSize;
    }

    protected void pumpDeliveries() {
        assertExecuting();
        try {
            while(true) {
                while( currentBuffer !=null ) {
                    if( sender.getCredit() > 0 ) {
                        int sent = sender.send(currentBuffer.data, currentBuffer.offset, currentBuffer.length);
                        currentBuffer.moveHead(sent);
                        if( currentBuffer.length == 0 ) {
                            Delivery current = currentDelivery;
                            MessageDelivery md = (MessageDelivery) current.getContext();
                            currentBuffer = null;
                            currentDelivery = null;
                            if( qos == QoS.AT_MOST_ONCE ) {
                                current.settle();
                            } else {
                                sender.advance();
                            }
                            md.fireWatches();
                        }
                    } else {
                        return;
                    }
                }

                if( outbound.isEmpty() ) {
                    return;
                }

                final MessageDelivery md = outbound.removeFirst();
                outboundBufferSize -= md.initialSize;
                currentBuffer = md.encoded();
                if( qos == QoS.AT_MOST_ONCE ) {
                    currentDelivery = sender.delivery(EMPTY_BYTE_ARRAY, 0, 0);
                } else {
                    final byte[] tag = nextTag();
                    currentDelivery = sender.delivery(tag, 0, tag.length);
                }
                md.delivery = currentDelivery;
                currentDelivery.setContext(md);
            }
        } finally {
            fireWatches();
        }
    }

    @Override
    protected void processDelivery(Delivery delivery) {
        final MessageDelivery md  = (MessageDelivery) delivery.getContext();
        if( delivery.remotelySettled() ) {
            if( delivery.getTag().length > 0 ) {
                checkinTag(delivery.getTag());
            }

            final DeliveryState state = delivery.getRemoteState();
            if( state==null || state instanceof Accepted) {
                if( !delivery.remotelySettled() ) {
                    delivery.disposition(new Accepted());
                }
            } else if( state instanceof Rejected) {
                // re-deliver /w incremented delivery counter.
                md.delivery = null;
                md.incrementDeliveryCount();
                outbound.addLast(md);
            } else if( state instanceof Released) {
                // re-deliver && don't increment the counter.
                md.delivery = null;
                outbound.addLast(md);
            } else if( state instanceof Modified) {
                Modified modified = (Modified) state;
                if ( modified.getDeliveryFailed() ) {
                  // increment delivery counter..
                  md.incrementDeliveryCount();
                }
            }
            delivery.settle();
        }
        md.fireWatches();
    }

    byte[] nextTag() {
        byte[] rc;
        if (tagCache != null && !tagCache.isEmpty()) {
            final Iterator<byte[]> iterator = tagCache.iterator();
            rc = iterator.next();
            iterator.remove();
        } else {
            try {
                rc = Long.toHexString(nextTagId++).getBytes("UTF-8");
            } catch (UnsupportedEncodingException e) {
                throw new RuntimeException(e);
            }
        }
        return rc;
    }

    void checkinTag(byte[] data) {
        if( tagCache.size() < 1024 ) {
            tagCache.add(data);
        }
    }

    public void onOverflowBufferDrained(final Callback<Void> cb) {
        addWatch(new Watch() {
            @Override
            public boolean execute() {
                if (outboundBufferSize==0) {
                    cb.onSuccess(null);
                    return true;
                }
                return false;
            }
        });
    }
}

redpajama_set_name: RedPajamaGithub


text:
  <?php get_template_part('modal'); ?>

        <script src="<?php echo get_stylesheet_directory_uri(); ?>/bower_components/jquery/dist/jquery.min.js"></script>
        <script src="<?php echo get_stylesheet_directory_uri(); ?>/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
        <script src="<?php echo get_stylesheet_directory_uri(); ?>/bower_components/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js"></script>
        <script src="<?php echo get_stylesheet_directory_uri(); ?>/bower_components/jquery.stellar/jquery.stellar.min.js"></script>
        <script src="<?php echo get_stylesheet_directory_uri(); ?>/js/plugins.js"></script>
        <script src="<?php echo get_stylesheet_directory_uri(); ?>/js/main.js"></script>

        <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
        <script>
            (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
            function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
            e=o.createElement(i);r=o.getElementsByTagName(i)[0];
            e.src='https://www.google-analytics.com/analytics.js';
            r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
            ga('create','UA-XXXXX-X','auto');ga('send','pageview');
        </script>

        <script>

        </script>

        <?php wp_footer(); ?>

    </body>
</html>


text:
module Language
  module Node
    def self.npm_cache_config
      "cache=#{HOMEBREW_CACHE}/npm_cache\n"
    end

    def self.setup_npm_environment
      npmrc = Pathname.new("#{ENV["HOME"]}/.npmrc")
      # only run setup_npm_environment once per formula
      return if npmrc.exist?
      # explicitly set npm's cache path to HOMEBREW_CACHE/npm_cache to fix
      # issues caused by overriding $HOME (long build times, high disk usage)
      # https://github.com/Homebrew/brew/pull/37#issuecomment-208840366
      npmrc.write npm_cache_config
      # explicitly use our npm and node-gyp executables instead of the user
      # managed ones in HOMEBREW_PREFIX/lib/node_modules which might be broken
      ENV.prepend_path "PATH", Formula["node"].opt_libexec/"npm/bin"
    end

    def self.std_npm_install_args(libexec)
      setup_npm_environment
      # tell npm to not install .brew_home by adding it to the .npmignore file
      # (or creating a new one if no .npmignore file already exists)
      open(".npmignore", "a") { |f| f.write("\n.brew_home\n") }
      # npm install args for global style module format installed into libexec
      ["--verbose", "--global", "--prefix=#{libexec}", "."]
    end

    def self.local_npm_install_args
      setup_npm_environment
      # npm install args for local style module format
      ["--verbose"]
    end
  end
end


text:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/scrollojt"
android:fillViewport="true" >

   <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#e5e5e5"
 >

<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:dividerHeight="0dp"
android:divider="@null"
 >
 </ListView>

 <ListView
android:id="@+id/listView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/listView1"
android:layout_marginTop="10dp"
android:dividerHeight="0dp"
android:divider="@null"
 >
</ListView>
    </RelativeLayout>
  </ScrollView>


text:
package org.caleydo.vis.lineup.ui.column;

import org.caleydo.vis.lineup.config.IRankTableUIConfig;
import org.caleydo.vis.lineup.model.ARankColumnModel;

/**
 * @author Samuel Gratzl
 *
 */
public class ColumnHeaderUI extends AColumnHeaderUI {
	public ColumnHeaderUI(ARankColumnModel model, IRankTableUIConfig config) {
		super(model, config, true, true);
	}
}


text:
"""Tests for edge predicate builders."""

import unittest

from pybel.constants import CITATION, CITATION_AUTHORS, CITATION_TYPE_PUBMED
from pybel.language import citation_dict
from pybel.struct.filters.edge_predicate_builders import (
    build_author_inclusion_filter,
    build_pmid_inclusion_filter,
)

pmid1 = "1"
pmid2 = "2"
pmid3 = "3"

author1 = "1"
author2 = "2"
author3 = "3"

class TestEdgePredicateBuilders(unittest.TestCase):
    """Tests for edge predicate builders."""

    def test_build_pmid_inclusion_filter(self):
        """Test building a predicate for a single PubMed identifier."""
        pmid_inclusion_filter = build_pmid_inclusion_filter(pmid1)

        self.assertTrue(
            pmid_inclusion_filter(
                {
                    CITATION: citation_dict(namespace=CITATION_TYPE_PUBMED, identifier=pmid1),
                }
            )
        )

        self.assertFalse(
            pmid_inclusion_filter(
                {
                    CITATION: citation_dict(namespace=CITATION_TYPE_PUBMED, identifier=pmid2),
                }
            )
        )

    def test_build_pmid_set_inclusion_filter(self):
        """Test building a predicate for multiple PubMed identifiers."""
        pmids = {pmid1, pmid2}
        pmid_inclusion_filter = build_pmid_inclusion_filter(pmids)

        self.assertTrue(
            pmid_inclusion_filter(
                {
                    CITATION: citation_dict(namespace=CITATION_TYPE_PUBMED, identifier=pmid1),
                }
            )
        )

        self.assertTrue(
            pmid_inclusion_filter(
                {
                    CITATION: citation_dict(namespace=CITATION_TYPE_PUBMED, identifier=pmid2),
                }
            )
        )

        self.assertFalse(
            pmid_inclusion_filter(
                {
                    CITATION: citation_dict(namespace=CITATION_TYPE_PUBMED, identifier=pmid3),
                }
            )
        )

    def test_build_author_inclusion_filter(self):
        """Test building a predicate for a single author."""
        author_inclusion_filter = build_author_inclusion_filter(author1)

        self.assertTrue(
            author_inclusion_filter(
                {
                    CITATION: citation_dict(
                        namespace=CITATION_TYPE_PUBMED,
                        identifier=pmid3,
                        authors=[author1],
                    ),
                }
            )
        )

        self.assertTrue(
            author_inclusion_filter(
                {
                    CITATION: citation_dict(
                        namespace=CITATION_TYPE_PUBMED,
                        identifier=pmid3,
                        authors=[author1, author2],
                    ),
                }
            )
        )

        self.assertFalse(
            author_inclusion_filter(
                {
                    CITATION: citation_dict(
                        namespace=CITATION_TYPE_PUBMED,
                        identifier=pmid3,
                        authors=[author3],
                    ),
                }
            )
        )

    def test_build_author_set_inclusion_filter(self):
        """Test building a predicate for multiple authors."""
        author = {author1, author2}
        author_inclusion_filter = build_author_inclusion_filter(author)

        self.assertTrue(author_inclusion_filter({CITATION: {CITATION_AUTHORS: [author1]}}))

        self.assertTrue(author_inclusion_filter({CITATION: {CITATION_AUTHORS: [author1, author2]}}))

        self.assertFalse(author_inclusion_filter({CITATION: {CITATION_AUTHORS: [author3]}}))


text:
var products = {
	ajos_cebolla : {
		name : 'Ajos y Cebollas',
		img  : 'images/products/ajos-cebollas.jpg',
		promo : true,
		descrip : 'Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.'
	},
	lemon : {
		name : 'Limon persa',
		img  : 'images/products/limon-persa.jpg',
		promo : true,
		descrip : 'Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.'
	},
	avocado : {
		name : 'Avocado',
		img  : 'images/products/avocado.jpg',
		promo : true,
		descrip : 'Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.'
	},
	brocolli : {
		name : 'Tomatillos',
		img  : 'images/products/tomatillos.jpg',
		promo : false,
		descrip : 'Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.'
	},
	cilantro : {
		name : 'Carrot',
		img  : 'images/products/carrot.jpg',
		promo : false,
		descrip : 'Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.'
	}
}
module.exports = products;


text:
import logging
import os
import re

from django.conf import settings
from django.core.management.base import BaseCommand

from relax import DEFAULT_FORMATTER, json, settings
from relax.couchdb import replicate, shortcuts
from relax.utils import logrotate

class Command(BaseCommand):

    help = 'Replicate CouchDB databases.'
    args = 'source_specifier target_specifier'

    def handle(self, source_spec, target_spec, *args, **options):
        # Set up logger
        logger = logging.getLogger('relax.couchdb.replicate')
        handler = logging.StreamHandler()
        handler.setFormatter(DEFAULT_FORMATTER)
        logger.addHandler(handler)
        if settings._('DEBUG', True):
            logger.setLevel(logging.DEBUG)
        logger.propagate = False
        # Replicate the databases
        logger.info('Beginning replication.')
        try:
            replicate.replicate(source_spec, target_spec)
        except replicate.ReplicationFailure, exc:
            # If there was an error, write the error output from CouchDB to a
            # rotated replication log file.
            log_filename = logrotate('replication.log')
            logger.error('Dumping JSON error information to "%s"' % (
                log_filename,))
            fp = open(log_filename, 'w')
            try:
                fp.write('response_headers = %s' % (
                    json.dumps(exc.response_headers),))
                fp.write(os.linesep * 2)
                fp.write('result = %s' % (
                    json.dumps(exc.response_headers),))
                fp.write(os.linesep)
            finally:
                fp.close()


text:
@interface ISLoginViewController : UIViewController

#pragma mark - Properties

#pragma mark - Class Methods

#pragma mark - Instance Methods

@end


text:
Data Analytics Course Session:
---------------------------------------------------------
Sessions 2-3 of INSEAD Data Analytics for Business Course: Dimensionality Reduction and Derived Attributes
---------------------------------------------------------

**Organization:** INSEAD

**Industry:** Education

**Project Description:** Introduction to Data Analytics for Business (INSEAD COURSE)

**Data Description:** Basic Example Data

**Author(s):** T. Evgeniou

**Author(s)' Affiliations:** INSEAD

INSTRUCTIONS FOR PROJECT
---------------------------------------------------------

(*NOTE: The very first time you run the project it may take a couple of minutes as it will also install all necessary R libraries. These are listed in the library.R file in the R_code directory*).

[1] Please open and source the file RunStudy.R

This will reproduce the default report and slides of this project, as well as  start the web-application for this project

You can then click on the generated HTML files in the doc directory to view the report or the slides.

**MODIFYING AND RE-RUNNING**

[2] To modify the project parameters, please edit them in the file

RunStudy.R

and source this file again. A new report, slides, and (if needed) web application will be launched.

(NOTE: if the web application is running, you will need to first stop that by clicking on the "stop" button in the concole window of your Rstudio)

[3] To modify the text of the report or the slides, please edit the .Rmd files in the Reports_Slides directory. To modify the Web Application please edit the ui.R and server.R files in the tools directory. After any modifications please repeat step 2 to generate the new report, slides, and launch the new Web application.

[4] You can modify the parameters of the project and generate new customized reports through the web application.

**Note:** Please press the stop button in the Console window to stop running the web application when needed.

**Note:** Sourcing the RunStudy.R file will create 2 new html file in the doc directory (one for the report and one for the slides). If you want to publish those online, you will need to move them to a gh-pages branch and delete them from the master branch afterwards. To do so please follow the following steps:

1. commit the files in your master branch

2. switch to the gh-pages branch (from the *Shell* (under the *Tools* menu), type *git checkout gh-pages*)

3. Once in the gh-pages branch, you can copy the html files from the master branch by typing in the shell file the command *git checkout master doc/Report_s23.html* and *git checkout master doc/Slides_s23.html*. Your report and slides are now available online through gh-pages.

4. You should now go back to the master branch (in the *Shell* type *git checkout master*) and delete the 2 html files from the doc directory (before pushing any new material back on your master branch on github).


text:
namespace BrickPile.Core.Routing
{
    /// <summary>
    ///     Defines the methods that are required for an <see cref="IRouteResolver" />.
    /// </summary>
    internal interface IRouteResolver
    {
        /// <summary>
        /// Resolves the route based on the incoming <see cref="string" /> url.
        /// </summary>
        /// <param name="virtualPath">The virtual path.</param>
        /// <returns></returns>
        ResolveResult Resolve(string virtualPath);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Brass9.Data.Entity
{
	/// <summary>
	/// Helps sort a query by 1 or more columns without having to consider when OrderBy() vs ThenBy() would be best.
	/// </summary>
	public class EFSorter
	{
		public static EFSorter<TModel> Create<TModel>(IQueryable<TModel> unsorted)
		{
			return new EFSorter<TModel>(unsorted);
		}
	}
	public class EFSorter<TModel> : EFSorter
	{
		protected IQueryable<TModel> unsorted;
		protected IOrderedQueryable<TModel> sorted;

		public EFSorter(IQueryable<TModel> unsorted)
		{
			this.unsorted = unsorted;
		}

		public EFSorter<TModel> SortBy<TCol>(Expression<Func<TModel, TCol>> col, bool isDesc = false)
		{
			if (sorted == null)
			{
				sorted = isDesc ? unsorted.OrderByDescending(col) : unsorted.OrderBy(col);
				unsorted = null;
			}
			else
			{
				sorted = isDesc ? sorted.ThenByDescending(col) : sorted.ThenBy(col);
			}

			return this;
		}

		public EFDirectionedSorter<TModel> Direction(bool isDesc)
		{
			return new EFDirectionedSorter<TModel>(isDesc, this);
		}

		public IOrderedQueryable<TModel> Sorted
		{
			get
			{
				return sorted;
			}
		}
	}

	public class EFDirectionedSorter<TModel>
	{
		protected bool isDesc;
		protected EFSorter<TModel> sorter;

		public EFDirectionedSorter(bool isDesc, EFSorter<TModel> sorter)
		{
			this.isDesc = isDesc;
			this.sorter = sorter;
		}

		public bool SortBy<TCol>(Expression<Func<TModel, TCol>> col)
		{
			sorter.SortBy<TCol>(col, isDesc);
			return isDesc;
		}
	}
}


text:
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

'use strict';

function main(parent) {
  // [START datalabeling_v1beta1_generated_DataLabelingService_ListEvaluationJobs_async]
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Evaluation job resource parent. Format:
   *  "projects/<var>{project_id}</var>"
   */
  // const parent = 'abc123'
  /**
   *  Optional. You can filter the jobs to list by model_id (also known as
   *  model_name, as described in
   *  EvaluationJob.modelVersion google.cloud.datalabeling.v1beta1.EvaluationJob.model_version) or by
   *  evaluation job state (as described in EvaluationJob.state google.cloud.datalabeling.v1beta1.EvaluationJob.state). To filter
   *  by both criteria, use the `AND` operator or the `OR` operator. For example,
   *  you can use the following string for your filter:
   *  "evaluation_job.model_id = <var>{model_name}</var> AND
   *  evaluation_job.state = <var>{evaluation_job_state}</var>"
   */
  // const filter = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer results than
   *  requested. Default value is 100.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results for the server to return.
   *  Typically obtained by the
   *  nextPageToken google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.next_page_token  in the response
   *  to the previous request. The request returns the first page if this is
   *  empty.
   */
  // const pageToken = 'abc123'

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callListEvaluationJobs() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await datalabelingClient.listEvaluationJobsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListEvaluationJobs();
  // [END datalabeling_v1beta1_generated_DataLabelingService_ListEvaluationJobs_async]
}

process.on('unhandledRejection', err => {
  console.error(err.message);
  process.exitCode = 1;
});
main(...process.argv.slice(2));


text:
package net.ripe.db.whois.common.dao.jdbc.index;

import net.ripe.db.whois.common.dao.RpslObjectInfo;
import net.ripe.db.whois.common.rpsl.AttributeType;
import net.ripe.db.whois.common.rpsl.RpslObject;
import org.junit.Before;
import org.junit.Test;

import java.util.List;

import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

public class IndexWithRoute6Test extends IndexTestBase {
    private IndexWithRoute6 subject;

    private RpslObject route6;
    private RpslObjectInfo route6Info;

    @Before
    public void setup() {
        subject = new IndexWithRoute6(AttributeType.ROUTE);

        route6 = RpslObject.parse("" +
                "route6:          a001:1578:0200::/40\n" +
                "origin:          AS12817\n");

        route6Info = new RpslObjectInfo(1, route6.getType(), route6.getKey());
    }

    @Test
    public void addToIndex() {
        subject.addToIndex(whoisTemplate, route6Info, route6, route6.getTypeAttribute().getCleanValue());

        assertThat(whoisTemplate.queryForInt("SELECT COUNT(*) FROM route6"), is(1));
    }

    @Test
    public void findInIndex() {
        databaseHelper.addObject(route6);

        final List<RpslObjectInfo> infos = subject.findInIndex(whoisTemplate, route6Info.getKey());
        assertThat(infos, hasSize(1));
        assertThat(infos.get(0).getKey(), is(route6Info.getKey()));
    }

    @Test
    public void findInIndex_lc() {
        databaseHelper.addObject(route6);

        final List<RpslObjectInfo> infos = subject.findInIndex(whoisTemplate, route6Info.getKey().toLowerCase());
        assertThat(infos, hasSize(1));
        assertThat(infos.get(0).getKey(), is(route6Info.getKey()));
    }

    @Test
    public void removeFromIndex() {
        databaseHelper.addObject(route6);

        subject.removeFromIndex(whoisTemplate, route6Info);
        final List<RpslObjectInfo> infos = subject.findInIndex(whoisTemplate, route6Info.getKey());
        assertThat(infos, hasSize(0));
    }
}


text:
package com.vaadin.tests.push;

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

import com.vaadin.annotations.Push;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.Grid;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

@Push
public class MakeComponentVisibleWithPush extends AbstractTestUI {

    private VerticalLayout rootLayout;
    private Grid<Person> grid;
    private SearchThread searchThread;
    private List<Person> data;

    @Override
    protected void setup(VaadinRequest request) {
        data = new ArrayList<>();

        rootLayout = new VerticalLayout();
        setContent(rootLayout);

        grid = new Grid<Person>();
        grid.addColumn(Person::getName);
        grid.setVisible(false);
        rootLayout.addComponent(grid);

        Button doUpdateButton = new Button("Do Update", event -> {
            try {
                doUpdate();
            } catch (InterruptedException e) {
            }
        });

        rootLayout.addComponent(doUpdateButton);
    }

    private void doUpdate() throws InterruptedException {

        cancelSuggestThread();

        grid.setVisible(false);
        grid.setItems(data);

        UI ui = UI.getCurrent();
        searchThread = new SearchThread(ui);
        searchThread.start();

    }

    class SearchThread extends Thread {
        private UI ui;

        public SearchThread(UI ui) {
            this.ui = ui;
        }

        @Override
        public void run() {
            data = new ArrayList<Person>(data);
            data.add(new Person("Person " + (data.size() + 1)));

            if (!searchThread.isInterrupted()) {
                ui.access(() -> {
                    grid.setItems(data);
                    grid.setVisible(true);
                });
            }
        }

    }

    private void cancelSuggestThread() {

        if ((searchThread != null) && !searchThread.isInterrupted()) {
            searchThread.interrupt();
            searchThread = null;
        }
    }

    class Person {

        private String name;

        public Person(String name) {
            this.name = name;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

}


text:
class Parse < Cask
  version :latest
  sha256 :no_check

  url 'https://www.parse.com/downloads/cloud_code/parse'
  homepage 'https://parse.com'
  license :unknown

  container :type => :naked
  binary 'parse'

  postflight do
    system '/bin/chmod', '--', '0755', "#{destination_path}/parse"
  end
end


text:
IoT Node's onboard microcontroller is responsible for reading analog inputs and handling infrared remote controller communications. As we increase the capabilities of your device, you may wish to update the firmware according to this documentation.

## Notice
_Firmware update process requires essential microcontroller programming experience. Any mistakes during the update makes your device inoperable._

## Prerequisites
You'll need a PIC programmer, just like PICKit 3, and 5x male to male jumper wires.

## Connection Schema
IoT HAT uses Microchip PIC16F182X series microcontroller. It's ICSP pins are exposed via IoT HAT's 40-pin headers on the rear side. Use the following schema to connect the programmer to your IoT HAT.

![IoTHAT ICSP Connection](https://turta.io/githubimg/IoTHAT_ICSP.png)

IoT HAT Header Pin 12 -> ICSP CLK
IoT HAT Header Pin 13 -> ICSP DAT
IoT HAT Header Pin 17 -> ICSP 3.3V
IoT HAT Header Pin 20 -> ICSP GND
IoT HAT Header Pin 26 -> ICSP MCLR

## Programmer Settings
There are two important settings you'll need to make on the programmer software.

* Set the VDD setting to 3.3V. Do not use the default 5V setting.
* Select "power target circuit from tool" setting on the programmer, to supply power to the microcontroller during the programming.

Two different PIC models have been used in the IoT HAT's production. You can find the appropriate HEX file in the HEX folder.

## Change Log
* FW 1.05 (February 25, 2018):
IR Remote transmitter timings are improved.
* FW 1.04 (April 05, 2017):
I2C Communication settings are improved.


text:
'use strict';

angular
  .module('rac', [
    'ui.router',
    'ngAnimate',
    'datatables'
  ])
  .config(function($stateProvider, $urlRouterProvider) {

    $urlRouterProvider.when('/dashboard', '/dashboard/notificaciones-listar');
    $urlRouterProvider.otherwise('/login');

    $stateProvider
      .state('base', {
        abstract: true,
        url: '',
        templateUrl: 'views/base.html'
      })
        .state('login', {
          url: '/login',
          parent: 'base',
          templateUrl: 'views/login.html',
          controller: 'LoginCtrl'
        })
        .state('dashboard', {
          url: '/dashboard',
          parent: 'base',
          templateUrl: 'views/dashboard.html',
          controller: 'DashboardCtrl'
        })

          .state('usuarios-listar', {
            url: '/usuarios-listar',
            parent: 'dashboard',
            templateUrl: 'views/dashboard/usuarios-listar.html',
            controller: 'UsuariosListarCtrl'
          })
          .state('usuarios-editar', {
            url: '/usuarios-editar',
            parent: 'dashboard',
            templateUrl: 'views/dashboard/usuarios-editar.html',
            controller: 'UsuariosEditarCtrl'
          })

          .state('reglas-listar', {
            url: '/reglas-listar',
            parent: 'dashboard',
            templateUrl: 'views/dashboard/reglas-listar.html',
            controller: 'ReglasListarCtrl'
          })
          .state('reglas-editar', {
            url: '/reglas-editar',
            parent: 'dashboard',
            templateUrl: 'views/dashboard/reglas-editar.html',
            controller: 'ReglasEditarCtrl'
          })

          .state('medios-listar', {
            url: '/medios-listar',
            parent: 'dashboard',
            templateUrl: 'views/dashboard/medios-listar.html',
            controller: 'MediosListarCtrl'
          })
          .state('medios-editar', {
            url: '/medios-editar',
            parent: 'dashboard',
            templateUrl: 'views/dashboard/medios-editar.html',
            controller: 'MediosEditarCtrl'
          })

          .state('notificaciones-listar', {
            url: '/notificaciones-listar',
            parent: 'dashboard',
            templateUrl: 'views/dashboard/notificaciones-listar.html',
            controller: 'NotificacionesListarCtrl'
          })
          .state('reportes-listar', {
            url: '/reportes-listar',
            parent: 'dashboard',
            templateUrl: 'views/dashboard/reportes-listar.html',
            controller: 'ReportesListarCtrl'
          })
          .state('auditorias-listar', {
            url: '/auditorias-listar',
            parent: 'dashboard',
            templateUrl: 'views/dashboard/auditorias-listar.html',
            controller: 'AuditoriasListarCtrl'
          });
  });


text:
"""Tests for gde.edit"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import numpy as np
import tensorflow.compat.v1 as tf
tf.disable_eager_execution()
import unittest

import graph_def_editor as gde

class EditTest(unittest.TestCase):
  """edit module test.

  Generally the tests are in two steps:
  - modify an existing graph.
  - then make sure it has the expected topology using the graph matcher.
  """

  # TODO(frreiss): Merge duplicate setup code across test cases
  def setUp(self):
    tf_graph = tf.Graph()
    with tf_graph.as_default():
      a = tf.constant([1., 1.], shape=[2], name="a")
      with tf.name_scope("foo"):
        b = tf.constant([2., 2.], shape=[2], name="b")
        c = tf.add(a, b, name="c")
        d = tf.constant([3., 3.], shape=[2], name="d")
        with tf.name_scope("bar"):
          e = tf.add(c, d, name="e")
          f = tf.add(c, d, name="f")
          g = tf.add(c, a, name="g")
          with tf.control_dependencies([c.op]):
            h = tf.add(f, g, name="h")
    self.graph = gde.Graph(tf_graph)
    self.a = self.graph.get_tensor_by_name(a.name)
    self.b = self.graph.get_tensor_by_name(b.name)
    self.c = self.graph.get_tensor_by_name(c.name)
    self.d = self.graph.get_tensor_by_name(d.name)
    self.e = self.graph.get_tensor_by_name(e.name)
    self.f = self.graph.get_tensor_by_name(f.name)
    self.g = self.graph.get_tensor_by_name(g.name)
    self.h = self.graph.get_tensor_by_name(h.name)

  def test_detach(self):
    """Test for ge.detach."""
    sgv = gde.sgv(self.c.op, self.a.op)
    control_outputs = gde.ControlOutputs(self.graph)
    gde.detach(sgv, control_ios=control_outputs)
    # make sure the detached graph is as expected.
    self.assertTrue(
        gde.OpMatcher("^foo/c$").input_ops("a", "geph__b_0")(self.c.op))

  def test_connect(self):
    """Test for gde.connect."""
    # Original code:
    # with self.graph.as_default():
    #   x = constant_op.constant([1., 1.], shape=[2], name="x")
    #   y = constant_op.constant([2., 2.], shape=[2], name="y")
    #   z = math_ops.add(x, y, name="z")
    x = gde.make_const(self.graph, "x", np.array([1., 1.], dtype=np.float32))
    y = gde.make_const(self.graph, "y", np.array([2., 2.], dtype=np.float32))
    z = self.graph.add_node("z", "Add")
    z.add_attr("T", tf.float32)
    z.set_inputs([x.outputs[0], y.outputs[0]])
    z.infer_outputs()

    sgv = gde.sgv(x, y, z)
    gde.connect(sgv, gde.sgv(self.e.op).remap_inputs([0]))
    self.assertTrue(
        gde.OpMatcher("^foo/bar/e$").input_ops("^z$", "foo/d$")(self.e.op))

  def test_bypass(self):
    """Test for ge.bypass."""
    gde.bypass(gde.sgv(self.f.op).remap_inputs([0]))
    self.assertTrue(
        gde.OpMatcher("^foo/bar/h$").input_ops("^foo/c$", "foo/bar/g$")(
            self.h.op))

if __name__ == "__main__":
  unittest.main()


text:
class ApplicationController < ActionController::Base
  include AuthenticationHelper
  include FlashHelper

  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :null_session
  before_action :configure_permitted_paramaters, if: :devise_controller?

  def after_sign_in_path_for(resource)
    root_path
  end

  protected

  def configure_devise_params
    devise_parameter_sanitizer.permit(:sign_up) {|u| u.permit(:uid, :password)}
  end

  def configure_permitted_paramaters
    devise_parameter_sanitizer.permit(:sign_in) {|u| u.permit(:uid, :password, :remember_me)}
    devise_parameter_sanitizer.permit(:sign_up) {|u| u.permit(:uid, :password)}
  end
end


text:
package main

import (
	"flag"
	"fmt"
	"os"
	"time"

	"github.com/coreos/etcd/raft"
	"github.com/judwhite/go-svc/svc"
	"github.com/judwhite/httplog"
	log "github.com/judwhite/logrjack"
)

type program struct {
	webServer *webServer
}

type webServer struct {
	httplog.Server
	raftServer *raftServer
}

var settings appSettings

func main() {
	id := flag.Uint64("nodeid", 0, "node id")

	flag.Parse()

	if *id == 0 {
		flag.PrintDefaults()
		fmt.Println("nodeid must be >= 1")
		os.Exit(1)
	}

	settings.HTTPListenAddress = fmt.Sprintf(":62%02d", *id)

	prg := program{
		webServer: &webServer{
			Server: httplog.Server{
				FormatJSON:      true,
				ShutdownTimeout: 2 * time.Second,
				NewLogEntry:     func() httplog.Entry { return log.NewEntry() },
			},
			raftServer: newRaftServer(*id),
		},
	}
	if err := svc.Run(&prg); err != nil {
		log.Fatal(err)
	}
}

func (p *program) Init(env svc.Environment) error {
	isWindowsService := env.IsWindowsService()

	// TODO (judwhite): allow specifying log filename

	log.Setup(log.Settings{
		WriteStdout: !isWindowsService,
		MaxAgeDays:  15,
		MaxSizeMB:   5,
		MaxBackups:  50,
	})

	raft.SetLogger(raftLogger{})

	return nil
}

func (p *program) Start() error {
	log.Info("program starting...")
	if err := p.webServer.Start(); err != nil {
		return err
	}
	log.Info("program started")
	return nil
}

func (p *program) Stop() error {
	log.Info("program stopping...")
	p.webServer.Stop()
	log.Info("program stopped")
	return nil
}

type raftLogger struct{}

func (_ raftLogger) NewEntry() log.Entry {
	e := log.NewEntry()
	e.AddField("module", "coreos/etcd/raft")
	return e
}

func (l raftLogger) Debug(v ...interface{})                   { l.NewEntry().Info(v) }
func (l raftLogger) Debugf(format string, v ...interface{})   { l.NewEntry().Infof(format, v...) }
func (l raftLogger) Info(v ...interface{})                    { l.NewEntry().Info(v) }
func (l raftLogger) Infof(format string, v ...interface{})    { l.NewEntry().Infof(format, v...) }
func (l raftLogger) Warning(v ...interface{})                 { l.NewEntry().Warn(v) }
func (l raftLogger) Warningf(format string, v ...interface{}) { l.NewEntry().Warnf(format, v...) }
func (l raftLogger) Error(v ...interface{})                   { l.NewEntry().Error(v) }
func (l raftLogger) Errorf(format string, v ...interface{})   { l.NewEntry().Errorf(format, v...) }
func (l raftLogger) Fatal(v ...interface{})                   { l.NewEntry().Fatal(v) }
func (l raftLogger) Fatalf(format string, v ...interface{})   { l.NewEntry().Fatalf(format, v...) }
func (l raftLogger) Panic(v ...interface{})                   { l.NewEntry().Fatal(v) }
func (l raftLogger) Panicf(format string, v ...interface{})   { l.NewEntry().Fatalf(format, v...) }


text:
'use strict';

describe('Directive: box', function () {

  // load the directive's module
  beforeEach(module('familyhistorydatabaseApp'));

  var element,
    scope;

  beforeEach(inject(function ($rootScope) {
    scope = $rootScope.$new();
  }));

  it('should make hidden element visible', inject(function ($compile) {
    element = angular.element('<box></box>');
    element = $compile(element)(scope);
    expect(element.text()).toBe('this is the box directive');
  }));
});


text:
require "google/cloud/datastream/v1alpha1"

##
# Example demonstrating basic usage of
# Google::Cloud::Datastream::V1alpha1::Datastream::Client#get_private_connection
#
def get_private_connection
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Datastream::V1alpha1::GetPrivateConnectionRequest.new

  # Call the get_private_connection method.
  result = client.get_private_connection request

  # The returned object is of type Google::Cloud::Datastream::V1alpha1::PrivateConnection.
  p result
end
# [END datastream_v1alpha1_generated_Datastream_GetPrivateConnection_sync]


text:
'''Unit test for autoconfig.py'''
import unittest

import autoconfig

known_data = {'basics': {'string': 'abc',
                         'integer': 123,
                         'float': 123.,
                         'boolean': True,
                         'none': None},
              'strings': {'multiline strings': ['a','b','c'],
                          'commalist strings': ['a','b','c'],
                          'multiline commalist strings': [['a','b','c'],
                                                          ['d','e','f'],
                                                          ['g','h','i']]},
              'integers': {'multiline integers': [1,22,333],
                           'commalist integers': [1,22,333],
                           'multiline commalist integers': [[1,22,333],
                                                            [4444,55555,6666],
                                                            [777,88,9]]},
              'floats': {'multiline floats': [1., 2.2, .333],
                         'commalist floats': [1., 2.2, .333],
                         'multiline commalist floats': [[1.,2.2,.333],
                                                        [4.444,55.555,666.6],
                                                        [777.,8.8,.9]]},
              'booleans': {'multiline booleans': [True,False,False],
                           'commalist booleans': [True,False,False],
                           'multiline commalist booleans': [[True,True,True],
                                                            [False,False,False],
                                                            [False,True,True]]},
              'nones': {'commalist nones': [None,None,None]}}
##              'gotchas': {'all or none': ['1','a']}}

### don't write a test for every piece of the code.
### write a test for each piece of behavior that should be expected to work
### probably best to focus on public methods first at least

class TestConstruction(unittest.TestCase):
    def setUp(self):
        global known_data
        self.ac_byfile = autoconfig.AutoConfig.from_file('autoconfig_test.ini',
                                                         interpret_data = True)

    def test_from_file(self):
        self.assertDictEqual(self.ac_byfile._base_data,known_data)

    def test_from_external(self):
        ac_byexternal = autoconfig.AutoConfig.from_external(self.ac_byfile)
        self.assertDictEqual(ac_byexternal._base_external._base_data,known_data)

class TestSections(unittest.TestCase):
    def setUp(self):
        global known_data
        self.known_sections = [s for s in known_data.keys()]
        self.ac_byfile = autoconfig.AutoConfig.from_file('autoconfig_test.ini')

    def test_Sections_from_file_fresh(self):
        '''Test Sections() with fresh file-based data.'''
        self.assertSameElements(list(self.ac_byfile.sections()),
                                self.known_sections)

    def test_Sections_from_file_with_overrides(self):
        '''Test Sections() with overrides on file-based data.'''
        self.ac_byfile.override('basics', 'integer', None)
        self.assertSameElements(list(self.ac_byfile.sections()),
                                self.known_sections)

    def test_Sections_from_external_fresh(self):
        '''Test Sections() with fresh external-based data.'''
        ac_byexternal = autoconfig.AutoConfig.from_external(self.ac_byfile)
        self.assertSameElements(list(ac_byexternal.sections()),
                                self.known_sections)

    def test_Sections_from_external_with_overrides(self):
        '''Test Sections() with overrides on external-based data.'''
        ac_byexternal = autoconfig.AutoConfig.from_external(self.ac_byfile)
        ac_byexternal.override('strings', 'multiline strings', None)
        self.assertSameElements(list(ac_byexternal.sections()),
                                self.known_sections)

    def test_Sections_with_new_key_override(self):
        '''Test Sections() with a new key override.'''
        ac_byexternal = autoconfig.AutoConfig.from_external(self.ac_byfile,
                                                            allow_new_keys=True)
        ac_byexternal.override('new section', None, None)
        self.assertEqual(set(ac_byexternal.sections()) ^
                         set(self.known_sections),
                         set(['new section']))

class TestOptions(unittest.TestCase):
    def setUp(self):
        global known_data
        self.section  = 'floats'
        self.known_options = [o for o in known_data[self.section].keys()]
        self.ac_byfile = autoconfig.AutoConfig.from_file('autoconfig_test.ini')

    def test_Options_from_file_fresh(self):
        '''Test Options() with fresh file-based data.'''
        self.assertSameElements(list(self.ac_byfile.options(self.section)),
                                self.known_options)

    def test_Options_from_file_with_overrides(self):
        '''Test Options() with overrides on file-based data.'''
        self.ac_byfile.override(self.section, 'commalist floats', None)
        self.assertSameElements(list(self.ac_byfile.options(self.section)),
                                self.known_options)

    def test_Options_from_external_fresh(self):
        '''Test Options() with fresh external-based data.'''
        ac_byexternal = autoconfig.AutoConfig.from_external(self.ac_byfile)
        self.assertSameElements(list(ac_byexternal.options(self.section)),
                                self.known_options)

    def test_Options_from_external_with_overrides(self):
        '''Test Options() with overrides on external-based data.'''
        ac_byexternal = autoconfig.AutoConfig.from_external(self.ac_byfile)
        ac_byexternal.override(self.section, 'commalist floats', None)
        self.assertSameElements(list(ac_byexternal.options(self.section)),
                                self.known_options)

    def test_Options_with_new_key_override(self):
        '''Test Options() with a new key override.'''
        ac_byexternal = autoconfig.AutoConfig.from_external(self.ac_byfile,
                                                            allow_new_keys=True)
        ac_byexternal.override(self.section, 'new option', None)
        self.assertEqual(set(ac_byexternal.options(self.section)) ^
                         set(self.known_options),
                         set(['new option']))

class TestGet(unittest.TestCase):
    def setUp(self):
        global known_data
        self.ac_byfile = autoconfig.AutoConfig.from_file('autoconfig_test.ini',
                                                         interpret_data = True,
                                                         allow_new_keys = True)

    def test_get_fresh(self):
        for section, options in known_data.items():
            for option, value in options.items():
                self.assertEqual(self.ac_byfile.get(section,option),
                                 value)

    def test_get_with_overrides(self):
        self.ac_byfile.override('new section', 'new option', 'new value')
        self.assertEqual(self.ac_byfile.get('new section', 'new option'),
                         'new value')

class TestOverride(unittest.TestCase):
    def setUp(self):
        global known_data
        self.original_s = 'basics'
        self.original_o = 'float'
        self.new_s = 'new section'
        self.new_o = 'new option'
        self.new_v = 'new value'
        self.ac_byfile = autoconfig.AutoConfig.from_file('autoconfig_test.ini',
                                                         allow_new_keys = True)

    def test_override_section(self):
        self.ac_byfile.override(self.new_s, self.new_o, self.new_v)
        self.assertDictEqual(self.ac_byfile._override[self.new_s],
                             {self.new_o: self.new_v})

    def test_override_option(self):
        self.ac_byfile.override(self.original_s, self.new_o, self.new_v)
        self.assertDictEqual(self.ac_byfile._override[self.original_s],
                             {self.new_o: self.new_v})

    def test_override_override(self):
        self.ac_byfile.override(self.original_s, self.new_o, self.new_v)
        self.ac_byfile.override(self.original_s, self.new_o, 'new 2')
        self.assertDictEqual(self.ac_byfile._override[self.original_s],
                             {self.new_o: 'new 2'})

if __name__ == "__main__":
    try: unittest.main()
    except SystemExit: pass


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <link rel="apple-touch-icon" sizes="76x76" href="../assets/img/logo-inf.png">
  <link rel="icon" type="image/png" href="../assets/img/logo-inf.png">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <title>Bacharelado em Engenharia de Software</title>
  <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport' />

  <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet" />
  <link rel="stylesheet" href="../assets/css/font-awesome.min.css" />

  <link href="../assets/css/bootstrap.min.css" rel="stylesheet" />
  <link href="../assets/css/now-ui-kit.css?v=1.1.0" rel="stylesheet" />
	<link href="../assets/css/bes.css" rel="stylesheet" />

        <button class="navbar-toggler navbar-toggler-menu" type="button" data-toggle="collapse" data-target="#navigation" aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation">

        </button>

Home

Disciplinas

Informações

Acessibilidade

                  Acessibilidade
                  <button class="dropdown-item" onclick="enableContrast()">Ativar Contraste</button>
                  Fonte
                  <button class="dropdown-item" onclick="fontSize(0)">A</button>
                  <button class="dropdown-item" onclick="fontSize(-1)">A-</button>
                  <button class="dropdown-item" onclick="fontSize(1)">A+</button>

Código-fonte

							<form class="form-inline" action="../search.html" method="get">
									<input class="form-control mr-2" name="pesquisa" type="text" placeholder="Buscar" aria-label="Search" required>
									<button class="btn btn-warning btn-icon  btn-icon-mini btn-round" type="submit">

									</button>
							</form>
							<button class="navbar-toggler navbar-toggler" type="button" data-toggle="collapse" data-target="#information-index" aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation">

			        </button>

									Apresentação(current)

									Identificação

									Contexto

									Exposição de Motivos

									Objetivos

									Expectativas de Formação Profissional

									Princípios Norteadores

									Núcleo Docente Estruturante (NDE)

									Política de Gestão de Estágio Não Obrigatório

									Trabalho de Conclusao de Curso (TCC)

									Integracao, Ensino, Pesquisa e Extensao

									Avaliacao do Processo de Ensino e Aprendizagem

									Avaliacao do Projeto de Curso

									Politica de Qualificação

									Requisitos Legais e Normativos

									Estrutura Curricular

Trabalho de Conclusão de Curso (TCC)

O Trabalho de Conclusão de Curso (TCC) no BES é um componente curricular obrigatório regulado pelas Normas e Procedimentos de Trabalho de Conclusão de Curso do Bacharelado em Engenharia de Software.

O TCC é desenvolvido na última etapa da graduação, sob a orientação de um professor e compreende um relatório e uma apresentação.

O relatório é individual e tem como objetivo a expressão do estudante na forma escrita, a capacidade de analisar, caracterizar, investigar, discutir, implantar, pesquisar, realizar, sintetizar e avaliar, entre outras. Neste sentido, o relatório descreve, de forma crítica, as atividades teórico-práticas e de formação profissional relacionadas ao desenvolvimento do estudante como profissional, em especial, durante a disciplina Prática em Engenharia de Software.

A apresentação do relatório, também individual, é realizada como última atividade do curso e tem como objetivo a expressão do estudante, agora na forma oral, das atividades descritas no relatório, em seção pública e para uma banca formada por professores do INF. A banca de professores tem o direito a um período de arguição e é responsável pela avaliação tanto do relatório quanto da apresentação.


text:
package at.outdated.bitcoin.exchange.btce;

import at.outdated.bitcoin.exchange.api.jaxb.StringBigDecimalAdapter;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.math.BigDecimal;

/**
 * Created by ebirn on 06.10.13.
 */
@XmlAccessorType(XmlAccessType.FIELD)
public class BtceFunds {

    @XmlJavaTypeAdapter(StringBigDecimalAdapter.class)
    BigDecimal usd;

    @XmlJavaTypeAdapter(StringBigDecimalAdapter.class)
    BigDecimal btc;

    @XmlJavaTypeAdapter(StringBigDecimalAdapter.class)
    BigDecimal ltc;

    @XmlJavaTypeAdapter(StringBigDecimalAdapter.class)
    BigDecimal nmc;

    @XmlJavaTypeAdapter(StringBigDecimalAdapter.class)
    BigDecimal rur;

    @XmlJavaTypeAdapter(StringBigDecimalAdapter.class)
    BigDecimal eur;

    @XmlJavaTypeAdapter(StringBigDecimalAdapter.class)
    BigDecimal nvc;

    @XmlJavaTypeAdapter(StringBigDecimalAdapter.class)
    BigDecimal trc;

    @XmlJavaTypeAdapter(StringBigDecimalAdapter.class)
    BigDecimal ppc;

    @XmlJavaTypeAdapter(StringBigDecimalAdapter.class)
    BigDecimal ftc;
}


text:
/**
 * @author mvasquezj
 * @param {string} nombre de clase
 * @param {object} atributos de clase.
 */
Ext.define('sisprod.store.WellGroupStore', {
    extend: 'Ext.data.Store',
    model: 'sisprod.model.WellGroupModel',
    requires: [
        'Ext.data.Store',
        'sisprod.model.WellGroupModel'
    ],
    remoteSort: true,
    proxy:{
        type: 'ajax',
        api: {
            read: 'rest/wellGroup/list.htm',
            create : 'rest/wellGroup/register.htm',
            update: 'rest/wellGroup/update.htm',
            destroy: 'rest/wellGroup/delete.htm',
            activate: 'rest/wellGroup/activate.htm'
        },

        actionMethods: {
            create : 'POST',
            read   : 'POST',
            update : 'POST',
            destroy: 'POST'
        },

        reader: {
            type: 'json',
            root: 'data',
            idProperty: 'idWellGroup',
            totalProperty: 'total',
            messageProperty: 'message'
        }
    }
});


text:
using namespace std;
using namespace ngraph;

static string s_manifest = "${MANIFEST}";

NGRAPH_TEST(${BACKEND_NAME}, squeeze)
{
    const auto data_node = make_shared<op::v0::Parameter>(element::f32, Shape{1, 4, 1, 1, 2});
    const auto axes_node =
        make_shared<ngraph::op::v0::Constant>(element::i64, Shape{2}, vector<int64_t>{0, 2});
    const auto squeeze = make_shared<op::v0::Squeeze>(data_node, axes_node);

    const auto function = make_shared<Function>(OutputVector{squeeze}, ParameterVector{data_node});
    auto test_case = ngraph::test::NgraphTestCase(function, "${BACKEND_NAME}");

    const auto data = vector<float>{1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f};
    test_case.add_input(data);
    test_case.add_expected_output<float>(Shape{4, 1, 2}, data);
    test_case.run();
}

NGRAPH_TEST(${BACKEND_NAME}, squeeze_default_axes)
{
    const auto data_node = make_shared<op::v0::Parameter>(element::f32, Shape{1, 4, 1, 1, 2});
    const auto axes_node =
        make_shared<ngraph::op::v0::Constant>(element::i64, Shape{0}, vector<int64_t>{});
    const auto squeeze = make_shared<op::v0::Squeeze>(data_node, axes_node);

    const auto function = make_shared<Function>(OutputVector{squeeze}, ParameterVector{data_node});
    auto test_case = ngraph::test::NgraphTestCase(function, "${BACKEND_NAME}");

    const auto data = vector<float>{1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f};
    test_case.add_input(data);
    test_case.add_expected_output<float>(Shape{4, 2}, data);
    test_case.run();
}

NGRAPH_TEST(${BACKEND_NAME}, squeeze_dynamic)
{
    const auto data_param = make_shared<op::v0::Parameter>(element::f32, Shape{1, 4, 1, 1, 2});
    const auto axes_param = make_shared<op::v0::Parameter>(element::i64, Shape{2});
    EXPECT_THROW(make_shared<op::v0::Squeeze>(data_param, axes_param), CheckFailure);
}


text:
package com.amazonaws.services.detective.model.transform;

import java.util.List;
import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.detective.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * BatchGetGraphMemberDatasourcesRequestMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class BatchGetGraphMemberDatasourcesRequestMarshaller {

    private static final MarshallingInfo<String> GRAPHARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("GraphArn").build();
    private static final MarshallingInfo<List> ACCOUNTIDS_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("AccountIds").build();

    private static final BatchGetGraphMemberDatasourcesRequestMarshaller instance = new BatchGetGraphMemberDatasourcesRequestMarshaller();

    public static BatchGetGraphMemberDatasourcesRequestMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(BatchGetGraphMemberDatasourcesRequest batchGetGraphMemberDatasourcesRequest, ProtocolMarshaller protocolMarshaller) {

        if (batchGetGraphMemberDatasourcesRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(batchGetGraphMemberDatasourcesRequest.getGraphArn(), GRAPHARN_BINDING);
            protocolMarshaller.marshall(batchGetGraphMemberDatasourcesRequest.getAccountIds(), ACCOUNTIDS_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
pygaarst
========================================================

**Python geospatial analysis and remote sensing toolkit**

Pygaarst is a Python library to simplify the manipulation of
remote sensing and other geospatial data. Features include data and metadata
access for a number of frequently used freely available satellite remote sensing data such as Landsat TM/ETM+/OLI/TIRS, VIIRS, and MODIS; access and processing of generic raster formats such as GeoTIFF, HDF-EOS, HDF5 and netCDF  and combination with vector formats such as ESRI Shapefile and GeoJSON;
georeferencing and re-projecting; combining raster and vector datasets;
mapping and plotting.

Pygaarst relies heavily on numpy for data structures and GDAL for data access
and geospatial functionality. The main goal is to
provide a friendly API that makes common tasks on widely used data formats easy to accomplish in few lines of code.

The project was initiated on 2013-09-18 and in an early stage of development.

**The documentation for this project can be found [on ReadTheDocs] [2].**

  [2]: http://pygaarst.readthedocs.org/en/latest/

Dependencies
------------

**NOTE:** Most of the dependencies require the isntallation of C (or even
Fortran) libraries beforehand.

Pygaarst requires Python 2.7. Python 3(>=3.3) is planned.

For all raster handling:

* numpy
* GDAL for gdal, ogr and osr
* pyproj

For HDF5 rasters (such as VIIRS):

* h5py

For HDF4 rasters (such as MODIS, ASTER)

* python-hdf4

For vector overlays:

* Shapely
* Fiona

Future probably:

* netCDF4

For plotting and mapping:

* matplotlib and mpl_toolkits.basemap for `pygaarst.basemaputils`

Documentation is also still in the very early stages of development.

The following modules are available and fulfil useful functions at the current time:

pygaarst.raster
---------------

This module provides several classes to represent common raster dataset formats. Implemented currently:

**`class GeoTiff(object)`**

A generic representation of a GeoTIFF file.

Args:
  filepath - path to GeoTiff file

**`class HDF5(object)`**

A representation of a HDF5 data file. This is currently tailored to NPP/VIIRS SDR
or EDR files.

Args:
  filepath - path to HDF5 file

**`class Landsatscene(object)`**

A representation of a Landsat 4, 5, 7 or 8 scene for TM, ETM+ or OLI/TIRS sensor data.
Will parse the metadata file in both pre and post August 2012 formats.

Args:
  dirname - name of the directory to which the scene files are unzipped

Individual Landsat bands (for the above sensors and Landsat versions) can be accessed via:

**`class Landsatband(GeoTIFF)`**

A representation of a single-band dataset. Is aware of its metadata. Inherits from `GeoTIFF`.

Further examples are provided in a [tutorial walkthrough] [1] of data access and map plotting for GeoTIFF and HDF5/VIIRS.

TODO:
* move the VIIRS-specific functionality to a separate class
* GeoTIFF improvements: clean handling of multiband datasets
* lat/long and native coordinate arrays for both "middle of pixel" and "corner" specs
* HDF-EOS, HDF4, netCDF
* MODIS and ASTER swath and gridded data including XML metadata file parsing

  [1]: http://nbviewer.ipython.org/7593127

pygaarst.mtlutils
---------------------

**`pygaarst.mtlutils.parsemeta(metadatafilepath)`**

Parses a metadata file and returns a dictionary of metadata values in the same
nested structure as the USGS metadata file decription language. Used for
`pygaarst.raster.Landsatscene`, `pygaarst.raster.ALIscene` and
`pygaarst.raster.Hyperionscene`.

pygaarst.landsatutils
---------------------
Contains some Landsat-specific data and helper functions that facilitate the
conversion of digintal numbers (DN) to radiance, reflectance,
and brighness temperature data, the calculation of vegetation indices
and cloud masking.

Provides functions used by the `pygaarst.raster.Landsatscene` and `pygaarst.raster.Landsatband` classes, including:

**`pygaarst.landsatutils.get_bands(spacecraftid)`**

Returns permissible band labels (TM, ETM+ or OLI/TIRS) for a given spacecraft (L4, L5, L7 or L8).

**`pygaarst.landsatutils.getKconstants(spacecraftid)`**

pygaarst.irutils
---------------------

Functions to work with infrared raster data.

**`pygaarst.irutils.gainbias(lmax, lmin, qcalmax, qcalmin)`**

**`pygaarst.irutils.dn2rad(data, gain, bias)`**

**`pygaarst.irutils.rad2kelvin(data, k1, k2)`**

**`pygaarst.irutils.rad2celsius(data, k1, k2)`**

pygaarst.vector
---------------

TODO:
* `shapefile` class
* `geojson` class

pygaarst.basemaputils
---------------------

`pygaarst.basemaputils.map_interiorAK()` returns a Basmap object for a map of
the bulk of the Alaska mainland for convenient plotting.

(TODO: Other quick maps, possibility to override more parameters.)


text: {% extends "shop_example/base.html" %}


text: List of US states in JSON


text:
#include "condor_common.h"

#include "string_list.h"
#include "condor_debug.h"
#include "internet.h"
#include "strcasestr.h"
#include "condor_random_num.h"

// initialize the List<char> from the VALID_*_FILES variable in the
// config file; the files are separated by commas
	//changed isSeparator to allow constructor to redefine
//#define isSeparator(x) (isspace(x) || x == ',' )

char *strnewp( const char * );

int
StringList::isSeparator( char x )
{
	for ( char *sep = m_delimiters; *sep; sep++ ) {
		if ( x == ( *sep ) ) {
			return 1;
		}
	}
	return 0;
}

StringList::StringList(const char *s, const char *delim )
{
	if ( delim ) {
		m_delimiters = strnewp( delim );
	} else {
		m_delimiters = strnewp( "" );
	}
	if ( s ) {
		initializeFromString(s);
	}
}

StringList::StringList(const char *s, char delim_char, bool keep_empty_fields )
{
	char delims[2] = { delim_char, 0 };
	m_delimiters = strnewp( delims );
	if ( s ) {
		if (keep_empty_fields) {
			initializeFromString(s, delim_char);
		} else {
			initializeFromString(s);
		}
	}
}

StringList::StringList( const StringList &other )
		: m_delimiters( NULL )
{
	char				*str;
	ListIterator<char>	 iter;

	const char *delim = other.getDelimiters();
	if ( delim ) {
		m_delimiters = strnewp( delim );
	}

	// Walk through the other list, verify that everything is in my list
	iter.Initialize( other.getList() );
	iter.ToBeforeFirst( );
	while ( iter.Next(str) ) {
		char	*dup = strdup( str );
		ASSERT( dup );
		m_strings.Append( dup );
	}
}

void
StringList::initializeFromString (const char *s)
{
	if(!s)
	{
		EXCEPT("StringList::initializeFromString passed a null pointer");
	}

	/* If initializeFromString is called on an existing string_list,
     * it appends to that list, and does not reinitialize the list
     * if you change that, please check all hte call sites, some things
     * are depending on it
     */

	const char *walk_ptr = s;

	while (*walk_ptr != '\0')
	{
		// skip leading separators & whitespace
		while ((isSeparator (*walk_ptr) || isspace(*walk_ptr))
					&& *walk_ptr != '\0')
			walk_ptr++;

		if (*walk_ptr == '\0')
			break;

		// mark the beginning of this String in the list.
		const char *begin_ptr = walk_ptr;

		// walk to the end of this string
		while (!isSeparator (*walk_ptr) && *walk_ptr != '\0')
			walk_ptr++;

		// malloc new space for just this item
		int len = (walk_ptr - begin_ptr);
		char *tmp_string = (char*)malloc( 1 + len );
		ASSERT( tmp_string );
		strncpy (tmp_string, begin_ptr, len);
		tmp_string[len] = '\0';

		// put the string into the StringList
		m_strings.Append (tmp_string);
	}
}

// This version allows for a single delimiter character,
// it will trim leading and trailing whitespace from items, but
// it will not skip empty items or extra delimiters.
void
StringList::initializeFromString (const char *s, char delim_char)
{
	if(!s)
	{
		EXCEPT("StringList::initializeFromString passed a null pointer");
	}

	const char * p = s;
	while (*p) {

		// skip leading whitespace but not leading separators.
		while (isspace(*p)) ++p;

		// scan for end of string or for a delimiter char
		const char * e = p;
		while (*e && *e != delim_char) ++e;

		size_t len = e-p;

		// rewind back over trailing whitespace
		while (len && isspace(p[len-1])) --len;

		char *tmp_string = (char*)malloc(1 + len);
		ASSERT(tmp_string);
		strncpy(tmp_string, p, len);
		tmp_string[len] = 0;

		// put the string into the StringList
		m_strings.Append (tmp_string);

		p = e;

		// if we ended at a delimiter, skip over it.
		if (*p == delim_char) ++p;
	}
}

void
StringList::print (void)
{
	char *x;
	m_strings.Rewind ();
	while ((x = m_strings.Next ()))
		printf ("[%s]\n", x);
}

void
StringList::clearAll()
{
	char *x;
	m_strings.Rewind ();
	while ((x = m_strings.Next ()))
	{
		deleteCurrent();
	}
}

StringList::~StringList ()
{
	clearAll();
	if ( m_delimiters )
		delete [] m_delimiters;
}

bool
StringList::create_union(StringList & subset, bool anycase)
{
	char *x;
	bool ret_val = true;
	bool result = false;	// true if list modified

	subset.rewind ();
	while ((x = subset.next ())) {
		if ( anycase ) {
			ret_val = contains_anycase(x);
		} else {
			ret_val = contains(x);
		}
			// not there, add it.
		if( ret_val == false ) {
			result = true;
			append(x);
		}
	}
	return result;
}

bool
StringList::contains_list(StringList & subset, bool anycase)
{
	char *x;
	bool ret_val;

	subset.rewind ();
	while ((x = subset.next ())) {
		if ( anycase ) {
			ret_val = contains_anycase(x);
		} else {
			ret_val = contains(x);
		}
		if( ret_val == false ) {
			return false;
		}
	}
	return true;
}

bool
StringList::contains( const char *st )
{
	char	*x;

	m_strings.Rewind ();
	while ((x = m_strings.Next ())) {
		if( strcmp(st, x) == MATCH ) {
			return true;
		}
	}
	return false;
}

bool
StringList::contains_anycase( const char *st )
{
	char	*x;

	m_strings.Rewind ();
	while ((x = m_strings.Next ())) {
		if( strcasecmp(st, x) == MATCH ) {
			return true;
		}
	}
	return false;
}

void
StringList::remove(const char *str)
{
	char *x;

	m_strings.Rewind();
	while ((x = m_strings.Next())) {
		if (strcmp(str, x) == MATCH) {
			deleteCurrent();
		}
	}
}

void
StringList::remove_anycase(const char *str)
{
	char *x;

	m_strings.Rewind();
	while ((x = m_strings.Next())) {
		if (strcasecmp(str, x) == MATCH) {
			deleteCurrent();
		}
	}
}

bool
StringList::substring( const char *st )
{
	char    *x;
	int len;

	m_strings.Rewind ();
	while( (x = m_strings.Next()) ) {
		len = strlen(x);
		if( strncmp(st, x, len) == MATCH ) {
			return true;
		}
	}
	return false;
}

bool
StringList::contains_withwildcard(const char *string)
{
	return (contains_withwildcard(string, false) != NULL);
}

bool
StringList::contains_anycase_withwildcard(const char *string)
{
	return (contains_withwildcard(string, true) != NULL);
}

bool
StringList::find_matches_anycase_withwildcard( const char * string, StringList *matches)
{
    return contains_withwildcard(string, true, matches)!=NULL;
}

// contains_withwildcard() is just like the contains() method except that
// list members can have an asterisk wildcard in them.  So, if
// the string passed in is "pppmiron.cs.wisc.edu", and an entry in the
// the list is "ppp*", then it will return TRUE.
const char *
StringList::contains_withwildcard(const char *string, bool anycase, StringList *matches)
{
	char *x;
	char *matchstart;
	char *matchend;
	char *asterisk;
	int matchendlen, len;
    bool result;
	int temp;

	if ( !string )
		return NULL;

	m_strings.Rewind();

	while ( (x=m_strings.Next()) ) {

		if ( (asterisk = strchr(x,'*')) == NULL ) {
			// There is no wildcard in this entry; just compare
			if (anycase) {
				temp = strcasecmp(x,string);
			} else {
				temp = strcmp(x,string);
			}
			if ( temp == MATCH ) {
				if( matches ) {
					matches->append(x);
				}
				else {
					return x;
				}
			}
			continue;
		}

		if ( asterisk == x ) {
			char *asterisk2 = strrchr(x,'*');
			if ( asterisk2 && asterisk2[1] == '\0' && asterisk2 != asterisk) {
				// asterisks at start and end behavior
				const char *pos;
				*asterisk2 = '\0';
				if (anycase) {
					pos = strcasestr(string,&x[1]);
				} else {
					pos = strstr(string,&x[1]);
				}
				*asterisk2 = '*';
				if ( pos ) {
					if( matches ) {
						matches->append( x );
					}
					else {
						return x;
					}
				}
				continue;
			}
			// asterisk at the start behavior
			matchstart = NULL;
			matchend = &(x[1]);
		} else {
			if ( asterisk[1] == '\0' ) {
				// asterisk at the end behavior.
				*asterisk = '\0';	// remove asterisk
				if (anycase) {
					temp = strncasecmp(x,string,strlen(x));
				} else {
					temp = strncmp(x,string,strlen(x));
				}
				*asterisk = '*';	// replace asterisk
				if ( temp == MATCH ) {
					if( matches ) {
						matches->append( x );
					}
					else {
						return x;
					}
				}
				continue;
			} else {
				// asterisk must be in the middle somewhere
				matchstart = x;
				matchend = &(asterisk[1]);
			}
		}

		// at this point, we know that there is an  asterisk either at the start
		// or in the middle somewhere, and both matchstart and matchend are set
		// appropiately with what we want

		result = true;
		*asterisk = '\0';	// replace asterisk with a NULL
		if ( matchstart ) {
			if ( anycase ) {
				temp = strncasecmp(matchstart,string,strlen(matchstart));
			} else {
				temp = strncmp(matchstart,string,strlen(matchstart));
			}
			if ( temp != MATCH )
				result = false;
		}
		if ( matchend && result == true) {
			len = strlen(string);
			matchendlen = strlen(matchend);
			if ( matchendlen > len )	// make certain we do not SEGV below
				result = false;
			if ( result == true ) {
				if (anycase) {
					temp = strcasecmp(&(string[len-matchendlen]),matchend);
				} else {
					temp = strcmp(&(string[len-matchendlen]),matchend);
				}
				if ( temp != MATCH )
					result = false;
			}
		}
		*asterisk = '*';	// set asterisk back no matter what the result
		if ( result == true ) {
			if( matches ) {
				matches->append( x );
			}
			else {
				return x;
			}
		}

	}	// end of while loop

	if( matches && !matches->isEmpty() ) {
		matches->rewind();
		return matches->next();
	}
	return NULL;
}

bool
StringList::find( const char *str, bool anycase ) const
{
	char	*x;

    ListIterator<char> iter ( m_strings );
    iter.ToBeforeFirst ();
	while ( iter.Next(x) ) {
		if( (anycase) && (strcasecmp( str, x ) == MATCH) ) {
			return true;
		}
		else if( (!anycase) && (strcmp(str, x) == MATCH) ) {
			return true;
		}
	}
	return false;
}

bool
StringList::identical( const StringList &other, bool anycase ) const
{
	char *x;
	ListIterator<char> iter;

	// First, if they're different sizes, quit
	if ( other.number() != this->number() ) {
		return false;
	}

	// Walk through the other list, verify that everything is in my list
	iter.Initialize ( other.getList() );
	iter.ToBeforeFirst ();
	while ( iter.Next(x) ) {
		if ( !find( x, anycase ) ) {
			return false;
		}
	}

	// Walk through my list, verify that everything is in the other list
	iter.Initialize ( m_strings );
	iter.ToBeforeFirst ();
	while ( iter.Next(x) ) {
		if ( !other.find( x, anycase ) ) {
			return false;
		}
	}

	return true;
}

/* returns a malloc'ed string that contains a comma delimited list of
the internals of the string list. */
char*
StringList::print_to_string(void) const
{
	return print_to_delimed_string(",");
}

char *
StringList::print_to_delimed_string(const char *delim) const
{

    ListIterator<char>	 iter;
	char				*tmp;

	if ( delim == NULL ) {
		delim = m_delimiters;
	}

	/* no string at all if there isn't anything in it */
	int num = m_strings.Number();
	if(num == 0) {
		return NULL;
	}

    iter.Initialize( m_strings );
    iter.ToBeforeFirst ();
	int		len = 1;
	while ( iter.Next(tmp) ) {
		len += ( strlen(tmp) + strlen(delim) );
	}

	/* get memory for all of the m_strings, plus the delimiter characters
	   between them and one more for the \0 */
	char *buf = (char*)calloc( len, 1);
	if (buf == NULL) {
		EXCEPT("Out of memory in StringList::print_to_string");
	}
	*buf = '\0';

    iter.Initialize( m_strings );
    iter.ToBeforeFirst ();
	int		n = 0;
	while ( iter.Next(tmp) ) {
		strcat( buf, tmp );

		/* add delimiters until the last attr entry in the list */
		if ( ++n < num ) {
			strcat(buf, delim);
		}
	}

	return buf;
}

void
StringList::deleteCurrent() {
	if( m_strings.Current() ) {
		FREE( m_strings.Current() );
	}
	m_strings.DeleteCurrent();
}

static int string_compare(const void *x, const void *y) {
	return strcmp(*(char * const *) x, *(char * const *) y);
}

void
StringList::qsort() {
	int count = m_strings.Length();
	if (count < 2)
		return;

	char **list = (char **) calloc(count, sizeof(char *));
	ASSERT( list );

 	int i;
	char *str;
	for (i = 0, m_strings.Rewind(); (str = m_strings.Next()); i++) {
		list[i] = strdup(str); // If only we had InsertAt on List...
	}

	::qsort(list, count, sizeof(char *), string_compare);

	for (i = 0, clearAll(); i < count; i++) {
		m_strings.Append(list[i]);
	}

	free(list);
}

void
StringList::shuffle() {
	char *str;
 	unsigned int i;
	unsigned int count = m_strings.Length();
	char **list = (char **) calloc(count, sizeof(char *));
	ASSERT( list );

	for (i = 0, m_strings.Rewind(); (str = m_strings.Next()); i++) {
		list[i] = strdup(str);
	}

	for (i = 0; i+1 < count; i++) {
		unsigned int j = (unsigned int)(i + (get_random_float() * (count-i)));
		// swap m_strings at i and j
		str = list[i];
		list[i] = list[j];
		list[j] = str;
	}

	for (i = 0, clearAll(); i < count; i++) {
		m_strings.Append(list[i]);
	}

	free(list);
}


text:
<?php
namespace Stato\Webflow\Plugin;

use Stato\TestSuite;

require_once __DIR__ . '/../../TestsHelper.php';

class AllTests
{
    public static function suite()
    {
        $suite = new TestSuite('Stato Webflow Plugins');
        $suite->addTestSuite('Stato\Webflow\Plugin\BrokerTest');
        return $suite;
    }
}


text:
This mixin can be used in components to detect tap gestures on the body element.
In that event it calls the `bodyTap` function.
The intention of this is to allow components which open overlays which cover
the viewport partially to handle user interactions outside the overlays.
This is useful for example to close a dropdown when a user taps on the
background.

## Usage

```js
import BodyTapMixin from 'ember-vcl-body-tap-handler-support';

var Menu = Ember.Component.extend(BodyTapMixin, {

  bodyTap: function(e) {
    // controlling body taps with `ignoreNextBodyTap`
    // if `ignoreNextBodyTap` === false, update the component - e.g. hide menu
    var ignoreNextBodyTap = this.get('ignoreNextBodyTap');
    if (ignoreNextBodyTap !== true) {
      this.hide();
    } else {
      this.set('ignoreNextBodyTap', false);
    }
  },

  tap: function(e) {
    e.preventDefault();
    this.set('ignoreNextBodyTap', true);
    var ignoreNextTap = this.get('ignoreNextTap');
    if (ignoreNextTap) {
      this.set('ignoreNextTap', false);
    } else {
      Ember.run.throttle(this, this.show, 150);
    }
    return false;
  },
});
```

## Usage Examples

 - [Ember VCL Extended Select Box](https://github.com/ember-vcl/extended-select-box)
 - [Ember VCL Date Picker](https://github.com/ember-vcl/date-picker)

[example1](/demo/example1/)

## Public API
### Public Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
### Action Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
## Included Mixins

## Private API
### Private Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |

## Running demo locally

[See instructions how to run a demo app](https://github.com/ember-vcl/build-demo)


text:
package cm.dart.math;

import org.apache.commons.math3.linear.Array2DRowRealMatrix;
import org.apache.commons.math3.linear.ArrayRealVector;
import org.apache.commons.math3.linear.DecompositionSolver;
import org.apache.commons.math3.linear.LUDecomposition;
import org.apache.commons.math3.linear.RealMatrix;
import org.apache.commons.math3.linear.RealVector;

/**
 * Simple class to solve a linear equation.
 * @author bwa
 *
 */
public class LinearEquationSolver {

	public RealVector solveDefaultEquation() {
		RealMatrix coefficients =
			    new Array2DRowRealMatrix(new double[][] { { 2, 3, -2 }, { -1, 7, 6 }, { 4, -3, -5 } },
			                       false);
			DecompositionSolver solver = new LUDecomposition(coefficients).getSolver();
			RealVector constants = new ArrayRealVector(new double[] { 1, -2, 1 }, false);
			RealVector solution = solver.solve(constants);
			return solution;
	}
}


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/documentai/v1/document.proto

namespace Google\Cloud\DocumentAI\V1\Document\Page;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * A detected barcode.
 *
 * Generated from protobuf message google.cloud.documentai.v1.Document.Page.DetectedBarcode
 */
class DetectedBarcode extends \Google\Protobuf\Internal\Message
{
    /**
     * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
     *
     * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1;
     */
    private $layout = null;
    /**
     * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
     *
     * Generated from protobuf field .google.cloud.documentai.v1.Barcode barcode = 2;
     */
    private $barcode = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout
     *           [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
     *     @type \Google\Cloud\DocumentAI\V1\Barcode $barcode
     *           Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce();
        parent::__construct($data);
    }

    /**
     * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
     *
     * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1;
     * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null
     */
    public function getLayout()
    {
        return $this->layout;
    }

    public function hasLayout()
    {
        return isset($this->layout);
    }

    public function clearLayout()
    {
        unset($this->layout);
    }

    /**
     * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
     *
     * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1;
     * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var
     * @return $this
     */
    public function setLayout($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class);
        $this->layout = $var;

        return $this;
    }

    /**
     * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
     *
     * Generated from protobuf field .google.cloud.documentai.v1.Barcode barcode = 2;
     * @return \Google\Cloud\DocumentAI\V1\Barcode|null
     */
    public function getBarcode()
    {
        return $this->barcode;
    }

    public function hasBarcode()
    {
        return isset($this->barcode);
    }

    public function clearBarcode()
    {
        unset($this->barcode);
    }

    /**
     * Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
     *
     * Generated from protobuf field .google.cloud.documentai.v1.Barcode barcode = 2;
     * @param \Google\Cloud\DocumentAI\V1\Barcode $var
     * @return $this
     */
    public function setBarcode($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Barcode::class);
        $this->barcode = $var;

        return $this;
    }

}


text:
/**
 * LawyerDataServiceService.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */

package com.lenchy.lms.service.ws;

public interface LawyerDataServiceService extends javax.xml.rpc.Service {
    public java.lang.String getLawyerDataServicePortAddress();

    public com.lenchy.lms.service.ws.ILawyerDataService getLawyerDataServicePort() throws javax.xml.rpc.ServiceException;

    public com.lenchy.lms.service.ws.ILawyerDataService getLawyerDataServicePort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;
}


text:
class RemoveStudySubjectsFatherGenerationalSuffix < ActiveRecord::Migration
  def self.up
		remove_column :study_subjects, :father_generational_suffix
  end
  def self.down
		add_column :study_subjects, :father_generational_suffix, :string, :limit => 10
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:mybatis="http://mybatis.org/schema/mybatis-spring"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
			http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
			http://mybatis.org/schema/mybatis-spring http://mybatis.org/schema/mybatis-spring.xsd">

	<mybatis:scan annotation="org.springframework.stereotype.Repository"
		base-package="com.yueny.demo.annotations.dao"
		factory-ref="sqlSessionFactory"/>

	<bean id="dataSourceChecker" class="com.yueny.superclub.util.storage.db.DataSourceChecker"
          init-method="check" p:dataSourceName="dataSource"/>

	<!-- 加载myBatis-config.xml配置文件,以及扫描myBatis/目录下每个DAO对应的SQL配置的XML文件 -->
	<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"
		depends-on="dataSourceChecker">
		<property name="dataSource" ref="dataSource"/>
		<property name="mapperLocations">
			<list>
				<value>classpath*:com/yueny/kapo/maps/singleTable-**-Mapping.xml</value>
				<value>classpath*:com/yueny/demo/annotations/maps/*Mapping.xml</value>
			</list>
		</property>
		<!-- configLocation属性指定mybatis的核心配置文件 -->
		<property name="configLocation" value="classpath:/config/mybatis.xml"/>
	</bean>

	<!-- SqlSessionTemplate是我们代码中使用的SQL模板对象,用来操作数据库  -->
    <bean class="org.mybatis.spring.SqlSessionTemplate">
        <constructor-arg ref="sqlSessionFactory"/>
    </bean>

	<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
		<property name="dataSource" ref="dataSource" />
	</bean>

</beans>


text:
<label for="date">Date:</label>
<input type="text" id="date" class="form-control" value="{{courseDate | date : 'dd/MM/yyyy'}}">