text:
<?php echo @$title; ?>
				<a href="<?php echo site_url('handover/bastout/lists'); ?>" class="btn pull-right"> BAST Out List

				<?php if((isset($bastout)?(!empty($bastout['code']) && !is_null($bastout['code'])?TRUE:FALSE):FALSE)){ ?>
				 Print
				<?php } ?>

				<?php echo @$message; ?>

<form role="form" id="form" action="<?php echo current_url(); ?>" method="POST" class="form-horizontal" data-provide="wizard" novalidate="true">

			Biodata Pemenang

			Stock

			Biodata Penerima

			Document

Biodata Pemenang

				Winner Number

					<input type="text" name="biodata[winner]"
						value="<?=($winner?$winner['WinnerAuctionId']:"")?>"
						placeholder="Winner Number"
						class="form-control required <?php echo (null != form_error('biodata[winner]')) ? 'error':''; ?>" disabled>
					<?php echo form_error('biodata[winner]'); ?>

				Name

					<input type="text" name="biodata[name]"
						value="<?=($winner?$winner['WinnerId']['users']['Name']:'')?>"
						placeholder="Nama Lengkap"
						class="form-control required <?php echo (null != form_error('biodata[name]')) ? 'error':''; ?>" disabled>
					<?php echo form_error('biodata[name]'); ?>

				Address

					<input type="text" name="bastout[address]"
						value="<?=($winner?$winner['WinnerId']['users']['Address']:'')?>"
						placeholder="Address"
						class="form-control required <?php echo (null != form_error('bastout[address]')) ? 'error':''; ?>" disabled>
					<?php echo form_error('bastout[address]'); ?>

				Phone

					<input type="text" name="biodata[handphone]"
						value="<?=($winner?$winner['WinnerId']['users']['Handphone']:'')?>"
						placeholder="Phone"
						class="form-control required <?php echo (null != form_error('biodata[handphone]')) ? 'error':''; ?>" disabled>
					<?php echo form_error('biodata[handphone]'); ?>

				City

					<input type="text" name="biodata[city]"
						value="<?=($winner?$winner['WinnerId']['users']['City']:'')?>"
						placeholder="City"
						class="form-control required <?php echo (null != form_error('biodata[city]')) ? 'error':''; ?>" disabled>
					<?php echo form_error('biodata[city]'); ?>

				Province

					<input type="text" name="biodata[province]"
						value="<?=($winner?$winner['WinnerId']['users']['Province']:'')?>"
						placeholder="Province"
						class="form-control required <?php echo (null != form_error('biodata[province]')) ? 'error':''; ?>" disabled>
					<?php echo form_error('biodata[province]'); ?>

				Postal Code

					<input type="text" name="biodata[postalcode]"
						value="<?=($winner?$winner['WinnerId']['users']['PostalCode']:'')?>"
						placeholder="Postal Code"
						class="form-control required <?php echo (null != form_error('biodata[postalcode]')) ? 'error':''; ?>" disabled>
					<?php echo form_error('biodata[postalcode]'); ?>

Item  Stock

			<input type="hidden" name="idauction_item" value="kodelelang<?php echo @$countitem['number']; ?>">
			<input type="hidden" name="iditem" value="<?php echo $id; ?>">
					<?php
					for($i=0; $i<count($formDinamis); $i++){
						if ($i%2==0) echo '
';
						$divTutupDinamis = '
';
						?>

							<label for="<?php echo $formDinamis[$i]['idInput']; ?>" class="col-md-3 control-label">
								<?php echo $formDinamis[$i]['namaLabel']; ?>

								<?php echo $formDinamis[$i]['typeInput']; ?>

						<?php
						if ($i%2!=0) echo $divTutupDinamis;
					}
					if ($i%2!=0) echo $divTutupDinamis;
					?>

Biodata Penerima

				BAST Out Number

					<input type="text" name="bastout[code]"
						value="<?=(isset($bastout)?$bastout['code']:'')?>"
						placeholder="Auto Generate BAST Out Number"
						class="form-control <?php echo (null != form_error('bastout[code]')) ? 'error':''; ?>"
						readonly>
					<?php echo form_error('bastout[code]'); ?>

				BAST Out Date

					<input type="text" name="bastout[date]"
						value="<?=(isset($bastout)?$bastout['date']:'')?>"
						data-provide="datepicker" data-date-format="dd-mm-yyyy" required
						class="form-control required <?php echo (null != form_error('bastout[date]')) ? 'error':''; ?>">
					<?php echo form_error('bastout[date]'); ?>

				Type of Delivery

					<select class="form-control" name="bastout[lettertype]" required>
						<?php foreach ($lettertype as $i => $row) { ?>
						<option value="<?=$row['HandoverTypeId']?>" <?=(isset($bastout)?($bastout['lettertype'] == $row['HandoverTypeId']?'selected':''):'')?>><?=$row['Name']?></option>
						<?php } ?>
					</select>
					<?php echo form_error('bastout[lettertype]'); ?>

				Name

					<input type="text" name="bastout[name]"
						placeholder="Nama Lengkap" required
						value="<?=(isset($bastout)?$bastout['name']:'')?>"
						class="form-control required <?php echo (null != form_error('bastout[name]')) ? 'error':''; ?>">
					<?php echo form_error('bastout[name]'); ?>

				Address

					<input type="text" name="bastout[address]"
						value="<?=(isset($bastout)?$bastout['address']:'')?>"
						placeholder="address" required
						class="form-control required <?php echo (null != form_error('bastout[address]')) ? 'error':''; ?>">
					<?php echo form_error('bastout[address]'); ?>

				Phone

					<input type="text" name="bastout[phone]"
						value="<?=(isset($bastout)?$bastout['phone']:'')?>"
						placeholder="Phone" required
						class="form-control required <?php echo (null != form_error('bastout[phone]')) ? 'error':''; ?>">
					<?php echo form_error('bastout[phone]'); ?>

				City

					<input type="text" name="bastout[city]"
						value="<?=(isset($bastout)?$bastout['city']:'')?>"
						placeholder="City" required
						class="form-control required <?php echo (null != form_error('bastout[city]')) ? 'error':''; ?>">
					<?php echo form_error('bastout[city]'); ?>

				Note

					<textarea class="form-control <?php echo (null != form_error('bastout[note]')) ? 'error':''; ?>" name="bastout[note]" placeholder="Note"><?=(isset($bastout)?$bastout['note']:'')?></textarea>
					<?php echo form_error('bastout[note]'); ?>

Document

Document IN

					<?php
					for($i=0; $i<count($arrTypeDokumen); $i++){
						$arrType = $arrTypeDokumen[$i];
						?>

									Document Type <?php echo $arrType; ?>

									No
									Component Name
									Real
									Copy
									-

								<?php $no=0; foreach($komponenDokumen[$arrType] as $row){
									$checked = isset($detailKomponenDokumen[$row['DocumentComponentId']])? $detailKomponenDokumen[$row['DocumentComponentId']]: false;
								?>

									<?php echo ++$no; ?>
									<?php echo $row['ComponentName']; ?>
									<input type="checkbox" name="docCompReal_<?php echo $row['DocumentComponentId']; ?>" value="1" <?=($checked?($checked['RealDoc']==1?"checked":""):"")?> disabled>
									<input type="checkbox" name="docCompCopy_<?php echo $row['DocumentComponentId']; ?>" value="1" <?=($checked?($checked['CopyDoc']==1?"checked":""):"")?> disabled>
									<input type="checkbox" name="docCompMin_<?php echo $row['DocumentComponentId']; ?>" value="1" <?=($checked?($checked['MinDoc']==1?"checked":""):"")?> disabled>

								<?php } ?>

						<?php
					}
					?>

Document OUT

					<?php
					for($i=0; $i<count($arrTypeDokumen); $i++){
						$arrType = $arrTypeDokumen[$i];
						?>

									Document Type <?php echo $arrType; ?>

									No
									Component Name
									Real
									Copy
									-

								<?php $no=0; foreach($komponenDokumen[$arrType] as $row){
									$checked = isset($detailKomponenDokumenOut[$row['DocumentComponentId']])? $detailKomponenDokumenOut[$row['DocumentComponentId']]: false;
								?>

									<?php echo ++$no; ?>
									<?php echo $row['ComponentName']; ?>
									<input type="checkbox" name="docCompReal_<?php echo $row['DocumentComponentId']; ?>" value="1" <?=($checked?($checked['RealDoc']==1?"checked":""):"")?>>
									<input type="checkbox" name="docCompCopy_<?php echo $row['DocumentComponentId']; ?>" value="1" <?=($checked?($checked['CopyDoc']==1?"checked":""):"")?>>
									<input type="checkbox" name="docCompMin_<?php echo $row['DocumentComponentId']; ?>" value="1" <?=($checked?($checked['MinDoc']==1?"checked":""):"")?>>

								<?php } ?>

						<?php
					}
					?>

		<input type="hidden" name="ProofDocumentId" value="<?=$ProofDocumentId?>">
		<input type="hidden" name="AuctionItemId" value="<?=$AuctionItemId?>">
		<input type="hidden" name="id_cabang" value="<?=$id_cabang?>">
		<input type="hidden" name="iditem" value="<?=$id?>">
		<button class="btn btn-secondary" data-wizard="prev" type="button">Back</button>
		<button class="btn btn-secondary" data-wizard="next" type="button">Next</button>
		<button class="btn btn-primary d-none" data-wizard="finish" type="submit">Finish</button>

</form>

<link rel="stylesheet" type="text/css" href="<?=base_url('assetsadmin/vendor/jqueryui/jquery-ui.css')?>">


text:
using System;

namespace StaticAdding
{
    /// <summary>
    /// Represents the main place where the program starts the execution.
    /// </summary>
    class Program
    {
        /// <summary>
        /// The starting point of the application.
        /// </summary>
        static void Main(string[] args)
        {
            // Which static method is called?
            int sum = MyMath.Add(123, 456);
            Console.WriteLine($"Summan är: {sum}\n");

            // Which static method is called?
            double anotherSum = MyMath.Add(9.87, 6.54);
            Console.WriteLine($"Summan är: {anotherSum}\n");

            // Which static method is called?
            Console.WriteLine("Summan är: {0}\n", MyMath.Add(123, 6.54));
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package jp.tonyu.js;

import java.util.Iterator;
import java.util.Vector;

import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;

public class RQ implements Iterable<Object> {
    Scriptable t;
    public RQ(Scriptable s) {
        t=s;
    }
    public static RQ $(Object o) {
        if (o instanceof RQ) {
            RQ r = (RQ) o;
            return r;
        }
        if (o instanceof Scriptable) {
            Scriptable s = (Scriptable) o;
            return new RQ(s);
        }
        if ("{}".equals(o)) {
            return new RQ(obj());
        }
        return new RQ(null);
    }

    public static BlankScriptableObject obj() {
        return new BlankScriptableObject();
    }
    public boolean isEmpty() {
        return t==null;
    }
    public Iterable<Object> values() {
        Vector<Object> res=new Vector<Object>();
        if (isEmpty()) return res;
        for (Object key: t.getIds()) {
            res.add( attr(key) );
        }
        return res;
    }
    public Object get() {
        return t;
    }
    public static Object unwrap(Object value) {
        if (value instanceof RQ) {
            RQ r = (RQ) value;
            return r.get();
        }
        return value;
    }
    public RQ attr$(Object key) {
        return $(attr(key));
    }
    public Object attr(Object key) {
        if (isEmpty()) return null;
        if (key instanceof String) {
            String s = (String) key;
            return ScriptableObject.getProperty(t, s);
        }
        if (key instanceof Integer) {
            Integer i = (Integer) key;
            return ScriptableObject.getProperty(t, i);
        }
        throw new RuntimeException("Invalid key : "+key);
    }
    public RQ attr(Object key, Object value) {
        if (isEmpty()) return this;
        if (key instanceof String) {
            String s = (String) key;
            ScriptableObject.putProperty(t, s, unwrap(value));
            return this;
        }
        if (key instanceof Integer) {
            int i = (Integer) key;
            ScriptableObject.putProperty(t, i, unwrap(value));
            return this;
        }
        throw new RuntimeException("Invalid key : "+key);
    }

    public boolean has(Object key) {
        if (isEmpty()) return false;
        if (key instanceof String) {
            String s = (String) key;
            return ScriptableObject.hasProperty(t, s);
        }
        if (key instanceof Integer) {
            int i = (Integer) key;
            return ScriptableObject.hasProperty(t, i);
        }
        return false;
    }

    @Override
    public Iterator<Object> iterator() {
        Vector<Object> res = new Vector<Object> ();
        if (isEmpty()) return res.iterator();
        for (Object o: t.getIds()) {
            res.add(o);
        }
        return res.iterator();
    }
    public boolean remove(Object key) {
        if (isEmpty()) return false;
        if (!has(key)) return false;
        if (key instanceof String) {
            String s = (String) key;
            t.delete(s);
            return true;
        }
        if (key instanceof Integer) {
            int i = (Integer) key;
            t.delete(i);
            return true;
        }
        throw new RuntimeException("Invalid key : "+key);
    }

}


text:
using System.Diagnostics;
using System.Linq;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace RightpointLabs.ConferenceRoom.Bot
{
    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseMvc();

            Trace.WriteLine("Startup complete");

            var prov = (IActionDescriptorCollectionProvider)app.ApplicationServices.GetRequiredService(typeof(IActionDescriptorCollectionProvider));
            Trace.WriteLine($"Count: {prov.ActionDescriptors.Items.Count}");
            foreach (var x in prov.ActionDescriptors.Items.Select(i =>
                string.Join(", ", i.RouteValues.Select(ii => $"{ii.Key}: {ii.Value}"))))
            {
                Trace.WriteLine(x);
            }
        }
    }
}


text:
require 'spec_helper'
require 'support/features/credentials'
include Credentials

feature 'req editor user' do

	scenario 'requirement editor creates a requirement group' , :js => true do

		logs_in_with "#{REQ_EDITOR_USERNAME}", "#{REQ_EDITOR_PASSWORD}", "#{REQ_EDITOR_INSTITUTION_NAME}"
		within('#quick_dashboard') do
			click_link 'DMP Templates'
		end
		click_link 'Institution only'
		find('#ucop_institutional_template_informal_review').hover
		find('.details').click
		expect(page).to have_content "ucop_institutional_template_informal_review"
		click_link 'Add Group'
		@temp = Time.now.to_s
		fill_in "requirement_text_brief", with: "new_group_#{@temp}"
		within('.buttons') do
			click_button 'Save'
		end
		expect(page).to have_content("Group was successfully created.")
		expect(page).to have_content("new_group_#{@temp}")

		click_link "delete_requirement_new_group_#{@temp}"

		find('.confirm').click
		expect(page).to have_no_content("new_group_#{@temp}")

	end

	scenario 'requirement editor creates a DMP Template' do #, :js => true do

		logs_in_with "#{REQ_EDITOR_USERNAME}", "#{REQ_EDITOR_PASSWORD}", "#{REQ_EDITOR_INSTITUTION_NAME}"

		expect(page).to have_link('My Dashboard')
		expect(page).to have_link('My Profile')
		expect(page).to have_link('DMP Templates')

		expect(page).to have_no_link('Customizations')
		expect(page).to have_no_link('Institution Profile')
		expect(page).to have_no_link('DMP Administration')

		#My Dashboard sections are present
		within('#quick_dashboard') do
			click_link 'My Dashboard'
		end
		expect(page).to have_content(%r{#{"Overview"}}i)
		expect(page).to have_content("DMP Templates")

		within('#quick_dashboard') do
			click_link 'DMP Templates'
		end
		within('#dmp_templates') do
  		expect(page).to have_content("Visibility")
		end

		#create new DMP template
		click_button 'Create New Template'
		expect(page).to have_content(%r{#{"Create New DMP Template"}}i)
		click_button 'Create New Template'

		expect(page).to have_content(%r{#{"DMP TEMPLATE OVERVIEW"}}i)
		#expect(page).to have_field("institution_name", :disabled => true)
		expect(page).to have_content("UCOP")
		@temp = Time.now.to_s
		fill_in 'requirements_template_name', with: "test-template-1-public_#{@temp}"
		page.choose 'public'
		click_button 'Save and Next >>'
		expect(page).to have_content("DMP Template was successfully created.")

		#delete DMP template just created
		within('#quick_dashboard') do
			click_link 'DMP Templates'
		end
		click_link 'view_all_templates'
		expect(page).to have_content("test-template-1-public_#{@temp}")

	end

	scenario 'requirement editor creates a single requirement' , :js => true do

		logs_in_with "#{REQ_EDITOR_USERNAME}", "#{REQ_EDITOR_PASSWORD}", "#{REQ_EDITOR_INSTITUTION_NAME}"
		within('#quick_dashboard') do
			click_link 'DMP Templates'
		end
		click_link 'Institution only'
		find('#ucop_institutional_template_informal_review').hover
		find('.details').click
		expect(page).to have_content "ucop_institutional_template_informal_review"
		@temp = Time.now.to_s
		fill_in 'requirement_text_brief', with: "bla_#{@temp}"
		fill_in 'requirement_text_full', with: "bla_question_#{@temp}"
		click_button 'Save'
		expect(page).to have_content("Requirement was successfully created.")
		expect(page).to have_content("bla_#{@temp}")
		click_link "delete_requirement_bla_#{@temp}"
		find('.confirm').click
		expect(page).to have_no_content("bla_#{@temp}")

	end

end


text:
title: Security
keywords: assure, pattern, security
tags: [assure, security]
sidebar: foundations_sidebar
permalink: assure_security.html
summary: "The security page shows how to establish initial security credentials (where necessary) with the API provided"
---

{% include important.html content="The API security described in this section is not meant to be complete but a starting point to understand some design considerations to consider when implementing APIs." %}

# Security within Assure #

The following four key principles should be considered during the assurance process:

- Authentication
- Authorisation
- Encryption
- Signatures

{% include note.html content="Provided as an overview" %}

# API Considerations #

Other API consideration are shown below. Please click on the parts of the API process to continue your API creation journey.

{% include custom/provide_api.svg %}

{% include custom/contribute.html content="Get in involved and contribute to the above API considerations careconnect@interopen.org"%}


text:
require 'spec_helper'

describe Clin::LineReader::Readline do
  let(:shell) { Clin::Shell.new }
  describe '#readline' do
    it 'call Readline.readline' do
      expect(Readline).to receive(:readline).with('> ', true).and_return('val')
      expect(Readline).not_to receive(:completion_proc=)
      subject = Clin::LineReader::Readline.new(shell, '> ', {})
      expect(subject.readline).to eq('val')
    end

    it 'provides tab completion when given a limited_to option' do
      countries = ['United States', 'France', 'United Kingdom']
      expect(Readline).to receive(:readline)
      expect(Readline).to receive(:completion_proc=) do |proc|
        expect(proc.call('')).to eq countries
        expect(proc.call('U')).to eq ['United States', 'United Kingdom']
        expect(proc.call('United S')).to eq ['United States']
      end

      subject = Clin::LineReader::Readline.new(shell, 'Where are you from? ',
                                               autocomplete: countries)
      subject.readline
    end

    it 'default back to the basic when echo is false' do
      expect(shell.out).to receive(:print).with('Where are you from? ')
      noecho_stdin = double('noecho_stdin')
      expect(noecho_stdin).to receive(:gets).and_return('Asgard')
      expect(shell.in).to receive(:noecho).and_yield(noecho_stdin)
      subject = Clin::LineReader::Readline.new(shell, 'Where are you from? ', echo: false)
      expect(subject.readline).to eq('Asgard')
    end
  end

  describe '.available?' do
    it 'returns is available by default' do
      expect(Clin::LineReader::Readline).to be_available
    end

    it 'returns not available if disable ' do
      allow(Clin).to receive(:use_readline?).and_return(false)
      expect(Clin::LineReader::Readline).not_to be_available
    end
  end

  describe '#autocomplete?' do
    it 'return true if defined' do
      subject = Clin::LineReader::Readline.new(shell, '> ', autocomplete: [''])
      expect(subject.send(:autocomplete?)).to be_truthy
    end

    it 'return false if false' do
      subject = Clin::LineReader::Readline.new(shell, '> ', autocomplete: false)
      expect(subject.send(:autocomplete?)).to be_falsey
    end

    it 'return false if not defined' do
      subject = Clin::LineReader::Readline.new(shell, '> ')
      expect(subject.send(:autocomplete?)).to be_falsey
    end
  end
end


text:
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>DeleteXMLNode</title>

DeleteXMLNode()

语法

DeleteXMLNode(Node)

概要

Deletes the specified XML node and all its contained text and children from its XML tree.

参数

Node

The node to delete.

备注

The root node of a tree cannot be deleted.

参阅

CreateXMLNode()

已支持操作系统
所有

<- CreateXMLNode() - XML Index - ExamineXMLAttributes() ->


text:
using namespace std;
//Added for the json-example:
using namespace boost::property_tree;

typedef SimpleWeb::Server<SimpleWeb::HTTPS> HttpsServer;
typedef SimpleWeb::Client<SimpleWeb::HTTPS> HttpsClient;

int main() {
    //HTTPS-server at port 8080 using 4 threads
    HttpsServer server(8080, 4, "server.crt", "server.key");

    //Add resources using path-regex and method-string, and an anonymous function
    //POST-example for the path /string, responds the posted string
    server.resource["^/string$"]["POST"]=[](HttpsServer::Response& response, shared_ptr<HttpsServer::Request> request) {
        //Retrieve string:
        auto content=request->content.string();
        //request->content.string() is a convenience function for:
        //stringstream ss;
        //ss << request->content.rdbuf();
        //string content=ss.str();

        response << "HTTP/1.1 200 OK\r\nContent-Length: " << content.length() << "\r\n\r\n" << content;
    };

    //POST-example for the path /json, responds firstName+" "+lastName from the posted json
    //Responds with an appropriate error message if the posted json is not valid, or if firstName or lastName is missing
    //Example posted json:
    //{
    //  "firstName": "John",
    //  "lastName": "Smith",
    //  "age": 25
    //}
    server.resource["^/json$"]["POST"]=[](HttpsServer::Response& response, shared_ptr<HttpsServer::Request> request) {
        try {
            ptree pt;
            read_json(request->content, pt);

            string name=pt.get<string>("firstName")+" "+pt.get<string>("lastName");

            response << "HTTP/1.1 200 OK\r\nContent-Length: " << name.length() << "\r\n\r\n" << name;
        }
        catch(exception& e) {
            response << "HTTP/1.1 400 Bad Request\r\nContent-Length: " << strlen(e.what()) << "\r\n\r\n" << e.what();
        }
    };

    //GET-example for the path /info
    //Responds with request-information
    server.resource["^/info$"]["GET"]=[](HttpsServer::Response& response, shared_ptr<HttpsServer::Request> request) {
        stringstream content_stream;
        content_stream << "
Request from " << request->remote_endpoint_address << " (" << request->remote_endpoint_port << ")
";
        content_stream << request->method << " " << request->path << " HTTP/" << request->http_version << "
";
        for(auto& header: request->header) {
            content_stream << header.first << ": " << header.second << "
";
        }

        //find length of content_stream (length received using content_stream.tellp())
        content_stream.seekp(0, ios::end);

        response <<  "HTTP/1.1 200 OK\r\nContent-Length: " << content_stream.tellp() << "\r\n\r\n" << content_stream.rdbuf();
    };

    //GET-example for the path /match/[number], responds with the matched string in path (number)
    //For instance a request GET /match/123 will receive: 123
    server.resource["^/match/([0-9]+)$"]["GET"]=[](HttpsServer::Response& response, shared_ptr<HttpsServer::Request> request) {
        string number=request->path_match[1];
        response << "HTTP/1.1 200 OK\r\nContent-Length: " << number.length() << "\r\n\r\n" << number;
    };

    //Default GET-example. If no other matches, this anonymous function will be called.
    //Will respond with content in the web/-directory, and its subdirectories.
    //Default file: index.html
    //Can for instance be used to retrieve an HTML 5 client that uses REST-resources on this server
    server.default_resource["GET"]=[](HttpsServer::Response& response, shared_ptr<HttpsServer::Request> request) {
        boost::filesystem::path web_root_path("web");
        if(!boost::filesystem::exists(web_root_path))
            cerr << "Could not find web root." << endl;
        else {
            auto path=web_root_path;
            path+=request->path;
            if(boost::filesystem::exists(path)) {
                if(boost::filesystem::canonical(web_root_path)<=boost::filesystem::canonical(path)) {
                    if(boost::filesystem::is_directory(path))
                        path+="/index.html";
                    if(boost::filesystem::exists(path) && boost::filesystem::is_regular_file(path)) {
                        ifstream ifs;
                        ifs.open(path.string(), ifstream::in | ios::binary);

                        if(ifs) {
                            ifs.seekg(0, ios::end);
                            size_t length=ifs.tellg();

                            ifs.seekg(0, ios::beg);

                            response << "HTTP/1.1 200 OK\r\nContent-Length: " << length << "\r\n\r\n";

                            //read and send 128 KB at a time
                            size_t buffer_size=131072;
                            vector<char> buffer;
                            buffer.reserve(buffer_size);
                            size_t read_length;
                            try {
                                while((read_length=ifs.read(&buffer[0], buffer_size).gcount())>0) {
                                    response.write(&buffer[0], read_length);
                                    response.flush();
                                }
                            }
                            catch(const exception &e) {
                                cerr << "Connection interrupted, closing file" << endl;
                            }

                            ifs.close();
                            return;
                        }
                    }
                }
            }
        }
        string content="Could not open path "+request->path;
        response << "HTTP/1.1 400 Bad Request\r\nContent-Length: " << content.length() << "\r\n\r\n" << content;
    };

    thread server_thread([&server](){
        //Start server
        server.start();
    });

    //Wait for server to start so that the client can connect
    this_thread::sleep_for(chrono::seconds(1));

    //Client examples
    //Second Client() parameter set to false: no certificate verification
    HttpsClient client("localhost:8080", false);
    auto r1=client.request("GET", "/match/123");
    cout << r1->content.rdbuf() << endl;

    string json="{\"firstName\": \"John\",\"lastName\": \"Smith\",\"age\": 25}";
    stringstream ss(json);
    auto r2=client.request("POST", "/string", ss);
    cout << r2->content.rdbuf() << endl;

    ss.str(json);
    auto r3=client.request("POST", "/json", ss);
    cout << r3->content.rdbuf() << endl;

    server_thread.join();

    return 0;
}


text:
package org.andengine.extension.tmx.util.exception;

/**
 * (c) 2010 Nicolas Gramlich
 * (c) 2011 Zynga Inc.
 *
 * @author Nicolas Gramlich
 * @since 18:37:53 - 08.08.2010
 */
public class TSXLoadException extends TMXException {
	// ===========================================================
	// Constants
	// ===========================================================

	private static final long serialVersionUID = 10055223972707703L;

	// ===========================================================
	// Fields
	// ===========================================================

	// ===========================================================
	// Constructors
	// ===========================================================

	public TSXLoadException() {
		super();
	}

	public TSXLoadException(final String pDetailMessage, final Throwable pThrowable) {
		super(pDetailMessage, pThrowable);
	}

	public TSXLoadException(final String pDetailMessage) {
		super(pDetailMessage);
	}

	public TSXLoadException(final Throwable pThrowable) {
		super(pThrowable);
	}

	// ===========================================================
	// Getter & Setter
	// ===========================================================

	// ===========================================================
	// Methods for/from SuperClass/Interfaces
	// ===========================================================

	// ===========================================================
	// Methods
	// ===========================================================

	// ===========================================================
	// Inner and Anonymous Classes
	// ===========================================================
}


text:
name: Marek Mansell
---
[www.marekmansell.sk](http://www.marekmansell.sk)

[www.linkedin.com/in/marekmansell](http://www.linkedin.com/in/marekmansell)


text:
import test from "ava";
import { parse } from "..";

test("interface definition", t => {
  const [actual] = parse(`
    // A character in the Star Wars Trilogy
    interface Character {
      id: String!
      name: String
      friends: [Character]
      appearsIn: [Episode]
    }
  `);

  const expected = {
    type: "INTERFACE",
    name: "Character",
    description: "A character in the Star Wars Trilogy",
    fields: {
      id: { type: "String", required: true },
      name: { type: "String" },
      friends: { type: "Character", list: true },
      appearsIn: { type: "Episode", list: true }
    }
  };

  return t.deepEqual(actual, expected);
});


text:
If you need to submit a new issue please go to: http://app.tyne-tickets.org/Tobscher/TYNE/issues/new

## Merging requests

If you have permissions to merge pull requests please ensure the code has been reviewed and all the comments have been addressed.
Please make sure that the current build is not broken before you merge any code changes: https://travis-ci.org/tyne/tyne

## Making a pull request

If you'd like to submit a pull request and contribute to the project please ensure your pull request meets the following requirements:

1. Your code is fully documented. We are using [YARD](http://yardoc.org/) to ensure 100% documentation coverage.
2. Your code is fully tested. We are using [SimpleCov](https://github.com/colszowka/simplecov) to ensure 100% code coverage.
3. You have merged with master.
4. You have ran the test suite and it passes. You have to run ```script/ci``` from the top level of your project.


text:
from django.contrib import admin
from adminsortable.admin import SortableAdmin, SortableStackedInline
from .models import Gallery, Photo

class PhotoInline(SortableStackedInline):
    model = Photo
    extra = 5

class GalleryAdmin(SortableAdmin):
    list_display = ('title', 'order', 'date', 'modified', 'public')
    search_fields = ('title', 'description')
    list_filter = ('public',)
    ordering = ('order',)
    prepopulated_fields = {'slug': ('title',)}
    inlines = [PhotoInline]

admin.site.register(Gallery, GalleryAdmin)


text:
#pragma once

#include <string>

namespace hku {

std::string url_escape(const char* istr);
std::string url_unescape(const char* istr);

}  // namespace hku


text:
{% load i18n %}

{{ title }}

    {% for user in users|slice:":10" %}

        {% if title == _("Organizer") %}

{{ user.username }}

        {% endif %}

    {% empty %}

{{ title }}{% trans " not found" %}

    {% endfor %}
    {% if title == _("Participants") %}
      {% trans "See more" %}
    {% endif %}


text:
<!DOCTYPE html>

  <base href="/"/>
  <title>
   Hypatia
  </title>
  <meta charset="utf-8"/>
  <meta content="Hypatia visualizes a set of cryospheric parameters provided by NOAA's Global Forecasing System (GFS), " name="description"/>
  <meta content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" name="viewport"/>
  <meta content="yes" name="mobile-web-app-capable"/>
  <meta content="yes" name="apple-mobile-web-app-capable"/>
  <meta content="no" name="msapplication-tap-highlight"/>
  <meta content="yes" name="apple-mobile-web-app-capable"/>
  <meta content="black-translucent" name="apple-mobile-web-app-status-bar-style"/>
  <meta content="Hypatia" name="apple-mobile-web-app-title"/>
  <link href="" rel="apple-touch-icon"/>
  <meta content="yes" name="mobile-web-app-capable"/>

  <meta content="Hypatia - Weather-Simulation" property="og:title"/>
  <meta content="website" property="og:type"/>
  <meta content="Hypatia visualizes a set of earth parameters provided by NOAA's Global Forecasing System (GFS) and others" property="og:description"/>
  <meta content="https://arcticio.github.io/weather-simulation/images/preview.lg.png" property="og:image"/>
  <meta content="https://arcticio.github.io/weather-simulation/" property="og:url"/>
  <meta content="summary_large_image" name="twitter:card"/>

  <link href="css/style.css" rel="stylesheet"/>
  <link href="images/favicon.ico" rel="icon" type="image/x-icon"/>

        Hypatia - Weather Simulation

         Help & Info

         arctic.io

        ...

        10, 9, 8, 7, ...

   <canvas class="simulator noselect">
   </canvas>


text:
__all__ = [
    "getMin"
]

__doc__ = "Different algorithms used for optimization"

import Optizelle.InequalityConstrained.State
import Optizelle.InequalityConstrained.Functions
from Optizelle.Utility import *
from Optizelle.Properties import *
from Optizelle.Functions import *

def getMin(X, Z, msg, fns, state, smanip=None):
    """Solves an inequality constrained optimization problem
    Basic solve: getMin(X,Z,msg,fns,state)
    Solve with a state manipulator: getMin(X,Z,msg,fns,state,smanip)
    """
    if smanip is None:
        smanip = StateManipulator()

    # Check the arguments
    checkVectorSpace("X",X)
    checkVectorSpace("Z",Z)
    checkMessaging("msg",msg)
    Optizelle.InequalityConstrained.Functions.checkT("fns",fns)
    Optizelle.InequalityConstrained.State.checkT("state",state)
    checkStateManipulator("smanip",smanip)

    # Call the optimization
    InequalityConstrainedAlgorithmsGetMin(X,Z,msg,fns,state,smanip)


text:
package hello

import org.apache.flink.streaming.api.scala._

/**
 * Skeleton for a Flink Streaming Job.
 *
 * For a tutorial how to write a Flink streaming application, check the
 * tutorials and examples on the Flink Website.
 *
 * To package your application into a JAR file for execution, run
 * 'mvn clean package' on the command line.
 *
 * If you change the name of the main class (with the public static void main(String[] args))
 * method, change the respective entry in the POM.xml file (simply search for 'mainClass').
 */
object StreamingJob {
  def main(args: Array[String]) {
    // set up the streaming execution environment
    val env = StreamExecutionEnvironment.getExecutionEnvironment

    /*
     * Here, you can start creating your execution plan for Flink.
     *
     * Start with getting some data from the environment, like
     *  env.readTextFile(textPath);
     *
     * then, transform the resulting DataStream[String] using operations
     * like
     *   .filter()
     *   .flatMap()
     *   .join()
     *   .group()
     *
     * and many more.
     * Have a look at the programming guide:
     *
     * http://flink.apache.org/docs/latest/apis/streaming/index.html
     *
     */

    // execute program
    env.execute("Flink Streaming Scala API Skeleton")
  }
}


text:
using System;

namespace AspectCore.DynamicProxy
{
    [NonAspect]
    public interface IAspectCachingProvider : IDisposable
    {
        IAspectCaching GetAspectCaching(string name);
    }
}


text:
// The MIT License
//
// Copyright (c) 2016 Dariusz Bukowski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <DBDebugToolkitTrigger.h>
#import <DBLongPressTrigger.h>
#import <DBShakeTrigger.h>
#import <DBTapTrigger.h>
#import <DBCustomAction.h>
#import <DBCustomVariable.h>

/**
 `DBDebugToolkit` provides the interface that can be used to setup and customize the debugging tools.
 */
@interface DBDebugToolkit : NSObject

///------------
/// @name Setup
///------------

/**
 Sets up the `DBDebugToolkit` with one default trigger: `DBShakeTrigger`.
*/
+ (void)setup;

/**
 Sets up the `DBDebugToolkit` with provided triggers.

 @param triggers Array of triggers that should be used to open the `DBDebugToolkit` menu. The objects it contains should adopt the protocol `DBDebugToolkitTrigger`.
 */
+ (void)setupWithTriggers:(NSArray <id <DBDebugToolkitTrigger>> *)triggers;

///--------------------------
/// @name Convenience methods
///--------------------------

/**
 Enables or disables console output capturing, which by default is enabled.

 @param enabled Determines whether console output capturing should be enabled or disabled.
 */
+ (void)setCapturingConsoleOutputEnabled:(BOOL)enabled;

/**
 Enables or disables network requests logging, which by default is enabled.

 @param enabled Determines whether network requests logging should be enabled or disabled.
 */
+ (void)setNetworkRequestsLoggingEnabled:(BOOL)enabled;

/**
 Removes all your application's entries from the keychain.
 */
+ (void)clearKeychain;

/**
 Removes all your application's entries from the `NSUserDefaults`.
 */
+ (void)clearUserDefaults;

/**
 Removes all files from the documents directory.
 */
+ (void)clearDocuments;

/**
 Removes all cookies.
 */
+ (void)clearCookies;

/**
 Returns the menu view controller.
 */
+ (UIViewController*)menuViewController;

/**
 Shows the menu.
 */
+ (void)showMenu;

/**
 Closes the menu.
 */
+ (void)closeMenu;

/**
 Shows the performance widget.
 */
+ (void)showPerformanceWidget;

/**
 Shows the `UIDebuggingInformationOverlay` (if available).
 */
+ (void)showDebuggingInformationOverlay;

///---------------------
/// @name Custom actions
///---------------------

/**
 Adds a single `DBCustomAction` instance to the array accessible in the menu.

 @param customAction The `DBCustomAction` instance that should be accessible in the menu.
 */
+ (void)addCustomAction:(DBCustomAction *)customAction;

/**
 Adds multiple `DBCustomAction` instances to the array accessible in the menu.

 @param customActions An array of `DBCustomAction` instances that should be accessible in the menu.
 */
+ (void)addCustomActions:(NSArray <DBCustomAction *> *)customActions;

/**
 Removes a single `DBCustomAction` instance from the array accessible in the menu.

 @param customAction The `DBCustomAction` instance that should be removed.
 */
+ (void)removeCustomAction:(DBCustomAction *)customAction;

/**
 Removes multiple `DBCustomAction` instances from the array accessible in the menu.

 @param customActions An array of `DBCustomAction` instances that should be accessible in the menu.
 */
+ (void)removeCustomActions:(NSArray <DBCustomAction *> *)customActions;

///-----------------------
/// @name Custom variables
///-----------------------

/**
 Adds a single `DBCustomVariable` instance to the array accessible in the menu.

 @param customVariable The `DBCustomVariable` instance that should be accessible in the menu.
 */
+ (void)addCustomVariable:(DBCustomVariable *)customVariable;

/**
 Adds multiple `DBCustomVariable` instances to the array accessible in the menu.

 @param customVariables An array of `DBCustomVariable` instances that should be accessible in the menu.
 */
+ (void)addCustomVariables:(NSArray <DBCustomVariable *> *)customVariables;

/**
 Removes a single `DBCustomVariable` instance with the given name.

 @param variableName The name of the variable that should be removed.
 */
+ (void)removeCustomVariableWithName:(NSString *)variableName;

/**
 Removes multiple `DBCustomVariable` instances with the names contained in the given array.

 @param variableNames An array of the names of the variables that should be removed.
 */
+ (void)removeCustomVariablesWithNames:(NSArray <NSString *> *)variableNames;

/**
 Returns a `DBCustomVariable` instance with a given name. If there is no such an instance, the method returns `nil`.

 @param variableName The name of the accessed variable.
 */
+ (DBCustomVariable *)customVariableWithName:(NSString *)variableName;

///--------------------
/// @name Crash reports
///--------------------

/**
 Enables collecting crash reports.
 */
+ (void)setupCrashReporting;

///---------------------
/// @name Shortcut Items
///---------------------

/**
 Adds a `Clear data` shortcut item.
 */
+ (void)addClearDataShortcutItem NS_AVAILABLE_IOS(9_0);

/**
 Handles `Clear data` shortcut item action.
 */
+ (void)handleClearDataShortcutItemAction NS_AVAILABLE_IOS(9_0);

@end


text:
<?php

namespace SAREhub\Microt\App\Auth\ApiKey;

use DI\ContainerBuilder;
use SAREhub\Microt\App\ContainerConfigurator;
use function DI\factory;

class ApiKeyAuthContainerConfigurator implements ContainerConfigurator
{
    public function configure(ContainerBuilder $builder)
    {
        $builder->addDefinitions([
            ApiKeyAuthMiddleware::class => factory(ApiKeyAuthMiddlewareProvider::class)
        ]);
    }
}


text:
Builds are run from a docker build image that is configured with the node and go we support.
Our circle.yml uses this docker container to build, test and create release packages.

### Updating new node/go versions
After updating the Dockerfile_build run

`docker build -t quay.io/influxdb/builder:chronograf-$(date "+%Y%m%d") -f Dockerfile_build .`

and push to quay with:
`docker push quay.io/influxdb/builder:chronograf-$(date "+%Y%m%d")`

### Update circle
Update DOCKER_TAG in circle.yml to the new container.


text:
package demo

import geotrellis.raster._
import geotrellis.raster.io.geotiff._
import geotrellis.raster.render._
import com.typesafe.config.ConfigFactory

object CoreExample {
  val maskedPath = "data/r-ir.tif"
  val ndviPath = "data/ndvi.png"

  def main(args: Array[String]): Unit = {
    if(args.length > 0) {
      createNDVI()
      println(s"Done. Created $ndviPath")
    } else {
      createMasked()
      println(s"Done. Created $maskedPath")
    }
  }

  def createMasked(): Unit = {
    def bandPath(b: String) = s"data/landsat/LC80140322014139LGN00_${b}.TIF"

    val rGeoTiff = SingleBandGeoTiff(bandPath("B4"))
    val irGeoTiff = SingleBandGeoTiff(bandPath("B5"))
    val qaGeoTiff = SingleBandGeoTiff(bandPath("BQA"))

    val (rTile, irTile, qaTile) = (rGeoTiff.tile, irGeoTiff.tile, qaGeoTiff.tile)

    def maskClouds(tile: Tile): Tile =
      tile.combine(qaTile) { (v, qa) =>
        val isCloud = qa & 0x8000
        val isCirrus = qa & 0x2000
        if(isCloud > 0 || isCirrus > 0) { NODATA}
        else { v }
      }

    val rMasked = maskClouds(rTile)

    val irMasked = maskClouds(irTile)

    val mb = ArrayMultiBandTile(rMasked, irMasked).convert(TypeInt)
    MultiBandGeoTiff(mb, rGeoTiff.extent, rGeoTiff.crs).write(maskedPath)
  }

  def createNDVI(): Unit = {
    val ndvi = {
      val tile = MultiBandGeoTiff(maskedPath).convert(TypeDouble)

      tile.combineDouble(0, 1) { (r, ir) =>
        if(isData(r) && isData(ir)) {
          (ir - r) / (ir + r)
        } else {
          Double.NaN
        }
      }
    }

    val cb = ColorBreaks.fromStringDouble(ConfigFactory.load().getString("demo.colorbreaks")).get

    ndvi.renderPng(cb).write(ndviPath)
  }
}


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller {

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

	}

	public function index()
      {

            $this->globals->fb_init();
            $user = $this->facebook->getUser();
            if(!$user && empty($_GET['auth'])){
              redirect(base_url('teaser'));
            }

          $this->globals->fb_auth();
          $params = array('table' => 'tbl_settings','where' => 'type = \'analytics\'');
          $analytics = $this->mysql_queries->get_data($params);
          $data = array(  'title'          => "Home",
                                  'analytics'  => @$analytics[0],
                                  'content'    => $this->content()
                               );
          $this->load->view('main-template', $data, FALSE);

    }

    public function content()
    {
      $limit   = 16;
      $curpage = $this->uri->segment(3, 1);
      $offset  = ($curpage-1)*$limit;
      $currentTheme= $this->globals->current_theme();
      $post = array('activated'=>1);
      $params = array('table'=>'tbl_theme','where'=>'theme_id='.$currentTheme[0]['theme_id'],'post'=>$post);
      $this->mysql_queries->update_data($params);
      $has_entry = $this->session->userdata('entry_id');
      $params = array('table'=>'v_entry','where'=>'status=1','limit'=>$limit,'offset'=>$offset,'order'=>'entry_id DESC');
      $entries = $this->mysql_queries->get_data($params);
      $params = array('table'=>'tbl_theme','where'=>'activated = 1');
      $themes = $this->mysql_queries->get_data($params);
      $user_liked = $this->globals->check_if_fan($_SESSION['fbme']['userid']);
      $data =array('themes'=>$themes,'liked'=>$user_liked,'current_theme'=>$currentTheme,'duration'=>$this->globals->promo_duration(),'entry_id'=>$has_entry,'entries'=>$entries);
      return $this->load->view('home-content', $data, TRUE);
    }

    public function theme(){
      $currentTheme= $this->globals->current_theme();
      $this->load->view('theme-content',array('data'=>$currentTheme[0]['image']));
    }

}

?>


text:
using namespace v8;

#define PROTO(proto, js_name, cpp_name)    \
    (proto)->Set(NanNew<String>(#js_name), \
                 NanNew<FunctionTemplate>(cpp_name)->GetFunction())

static Persistent<FunctionTemplate> key_value_tmplt;
static Persistent<FunctionTemplate> key_tmplt;
static Persistent<FunctionTemplate> value_tmplt;

void PairNodeIterator::init() {
    Local<FunctionTemplate> tmplt = NanNew<FunctionTemplate>();
    tmplt->SetClassName(NanNew<String>("NodeIterator"));
    tmplt->InstanceTemplate()->SetInternalFieldCount(1);
    Local<ObjectTemplate> key_value_prototype = tmplt->PrototypeTemplate();
    NanAssignPersistent(key_value_tmplt, tmplt);

    tmplt = NanNew<FunctionTemplate>();
    tmplt->SetClassName(NanNew<String>("NodeIterator"));
    tmplt->InstanceTemplate()->SetInternalFieldCount(1);
    Local<ObjectTemplate> key_prototype = tmplt->PrototypeTemplate();
    NanAssignPersistent(key_tmplt, tmplt);

    tmplt = NanNew<FunctionTemplate>();
    tmplt->SetClassName(NanNew<String>("NodeIterator"));
    tmplt->InstanceTemplate()->SetInternalFieldCount(1);
    Local<ObjectTemplate> value_prototype = tmplt->PrototypeTemplate();
    NanAssignPersistent(value_tmplt, tmplt);

    PROTO(key_value_prototype, next, Next);
    PROTO(key_prototype, next, Next);
    PROTO(value_prototype, next, Next);
}

Local<Object> PairNodeIterator::New(int type, MapType::const_iterator new_iter, MapType::const_iterator new_end) {
    Handle<FunctionTemplate> tmplt;
    if ((PairNodeIterator::KEY_TYPE & type) && (PairNodeIterator::VALUE_TYPE & type)) {
        tmplt = NanNew<FunctionTemplate>(key_value_tmplt);
    } else if (KEY_TYPE & type) {
        tmplt = NanNew<FunctionTemplate>(key_tmplt);
    } else {
        tmplt = NanNew<FunctionTemplate>(value_tmplt);
    }

    Local<Object> obj = tmplt->InstanceTemplate()->NewInstance();
    PairNodeIterator *iter = new PairNodeIterator(new_iter, new_end);

    iter->Wrap(obj);

    Local<String> key = NanNew<String>("key");
    Local<String> value = NanNew<String>("value");
    Local<String> done = NanNew<String>("done");

    if (PairNodeIterator::KEY_TYPE & type) {
        obj->SetAccessor(key, GetKey);
    }
    if (PairNodeIterator::VALUE_TYPE & type) {
        obj->SetAccessor(value, GetValue);
    }

    obj->SetAccessor(done, GetDone);

    return obj;
}

PairNodeIterator::PairNodeIterator(MapType::const_iterator new_iter, MapType::const_iterator new_end) : iter(new_iter), end(new_end) {}

// iterator.done : boolean
NAN_GETTER(PairNodeIterator::GetDone) {
    NanScope();

    PairNodeIterator *obj = ObjectWrap::Unwrap<PairNodeIterator>(args.This());

    if (obj->iter == obj->end) {
        NanReturnValue(NanTrue());
    }
    NanReturnValue(NanFalse());
}

// iterator.key : value
NAN_GETTER(PairNodeIterator::GetKey) {
    NanScope();

    PairNodeIterator *obj = ObjectWrap::Unwrap<PairNodeIterator>(args.This());

    if (obj->iter == obj->end) {
        NanReturnUndefined();
    }

    NanReturnValue(obj->iter->first->Extract());
}

// iterator.value : value
NAN_GETTER(PairNodeIterator::GetValue) {
    NanScope();

    PairNodeIterator *obj = ObjectWrap::Unwrap<PairNodeIterator>(args.This());

    if (obj->iter == obj->end) {
        NanReturnUndefined();
    }

    NanReturnValue(obj->iter->second->Extract());
}

// iterator.next() : undefined
NAN_METHOD(PairNodeIterator::Next) {
    NanScope();

    PairNodeIterator *obj = ObjectWrap::Unwrap<PairNodeIterator >(args.This());

    if (obj->iter == obj->end) {
        NanReturnThis();
    }

    obj->iter++;

    NanReturnThis();
}


text:
package io.imgn.srd5.db.model;

import static io.imgn.common.base.Preconditions.checkArgument;

import com.google.auto.value.AutoValue;

@AutoValue
public abstract class AbilityScoreIncrease {

  static AbilityScoreIncrease create(Ability ability, int increase) {
    checkArgument(increase > 0);
    return new AutoValue_AbilityScoreIncrease(ability, increase);
  }

  AbilityScoreIncrease() {
  }

  public abstract Ability ability();

  public abstract int increase();
}


text:
package client

import (
	"errors"
	"io"
	"net/url"
	"os"

	flag "github.com/docker/docker/pkg/mflag"
)

// CmdSave saves one or more images to a tar archive.
//
// The tar archive is written to STDOUT by default, or written to a file.
//
// Usage: docker save [OPTIONS] IMAGE [IMAGE...]
func (cli *DockerCli) CmdSave(args ...string) error {
	cmd := cli.Subcmd("save", []string{"IMAGE [IMAGE...]"}, "Save an image(s) to a tar archive (streamed to STDOUT by default)", true)
	outfile := cmd.String([]string{"o", "-output"}, "", "Write to an file, instead of STDOUT")
	cmd.Require(flag.Min, 1)

	cmd.ParseFlags(args, true)

	var (
		output io.Writer = cli.out
		err    error
	)
	if *outfile != "" {
		output, err = os.Create(*outfile)
		if err != nil {
			return err
		}
	} else if cli.isTerminalOut {
		return errors.New("Cowardly refusing to save to a terminal. Use the -o flag or redirect.")
	}

	sopts := &streamOpts{
		rawTerminal: true,
		out:         output,
	}

	if len(cmd.Args()) == 1 {
		image := cmd.Arg(0)
		if err := cli.stream("GET", "/images/"+image+"/get", sopts); err != nil {
			return err
		}
	} else {
		v := url.Values{}
		for _, arg := range cmd.Args() {
			v.Add("names", arg)
		}
		if err := cli.stream("GET", "/images/get?"+v.Encode(), sopts); err != nil {
			return err
		}
	}
	return nil
}


text:
using System;
using System.Collections.Generic;
using System.Threading;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Renci.SshNet.Channels;
using Renci.SshNet.Common;
using Renci.SshNet.Messages.Connection;

namespace Renci.SshNet.Tests.Classes.Channels
{
    [TestClass]
    public class ChannelSessionTest_Dispose_Disposed : ChannelSessionTestBase
    {
        private ChannelSession _channel;
        private uint _localChannelNumber;
        private uint _localWindowSize;
        private uint _localPacketSize;
        private uint _remoteWindowSize;
        private uint _remotePacketSize;
        private uint _remoteChannelNumber;
        private TimeSpan _channelCloseTimeout;
        private SemaphoreLight _sessionSemaphore;
        private IList<ChannelEventArgs> _channelClosedRegister;
        private List<ExceptionEventArgs> _channelExceptionRegister;

        protected override void SetupData()
        {
            var random = new Random();

            _localChannelNumber = (uint)random.Next(0, int.MaxValue);
            _localWindowSize = (uint)random.Next(2000, 3000);
            _localPacketSize = (uint)random.Next(1000, 2000);
            _remoteChannelNumber = (uint)random.Next(0, int.MaxValue);
            _remoteWindowSize = (uint)random.Next(0, int.MaxValue);
            _remotePacketSize = (uint)random.Next(100, 200);
            _channelCloseTimeout = TimeSpan.FromSeconds(random.Next(10, 20));
            _sessionSemaphore = new SemaphoreLight(1);
            _channelClosedRegister = new List<ChannelEventArgs>();
            _channelExceptionRegister = new List<ExceptionEventArgs>();
        }

        protected override void SetupMocks()
        {
            var sequence = new MockSequence();

            SessionMock.InSequence(sequence).Setup(p => p.ConnectionInfo).Returns(ConnectionInfoMock.Object);
            ConnectionInfoMock.InSequence(sequence).Setup(p => p.RetryAttempts).Returns(1);
            SessionMock.Setup(p => p.SessionSemaphore).Returns(_sessionSemaphore);
            SessionMock.InSequence(sequence)
                .Setup(
                    p =>
                        p.SendMessage(
                            It.Is<ChannelOpenMessage>(
                                m =>
                                    m.LocalChannelNumber == _localChannelNumber &&
                                    m.InitialWindowSize == _localWindowSize && m.MaximumPacketSize == _localPacketSize &&
                                    m.Info is SessionChannelOpenInfo)));
            SessionMock.InSequence(sequence)
                .Setup(p => p.WaitOnHandle(It.IsNotNull<WaitHandle>()))
                .Callback<WaitHandle>(
                    w =>
                        {
                            SessionMock.Raise(
                                s => s.ChannelOpenConfirmationReceived += null,
                                new MessageEventArgs<ChannelOpenConfirmationMessage>(
                                    new ChannelOpenConfirmationMessage(
                                        _localChannelNumber,
                                        _remoteWindowSize,
                                        _remotePacketSize,
                                        _remoteChannelNumber)));
                        w.WaitOne();
                    });
            SessionMock.InSequence(sequence).Setup(p => p.IsConnected).Returns(true);
            SessionMock.InSequence(sequence)
                .Setup(p => p.TrySendMessage(It.Is<ChannelEofMessage>(m => m.LocalChannelNumber == _remoteChannelNumber))).Returns(true);
            SessionMock.InSequence(sequence).Setup(p => p.IsConnected).Returns(true);
            SessionMock.InSequence(sequence)
                .Setup(p => p.TrySendMessage(It.Is<ChannelCloseMessage>(m => m.LocalChannelNumber == _remoteChannelNumber))).Returns(true);
            SessionMock.InSequence(sequence).Setup(p => p.ConnectionInfo).Returns(ConnectionInfoMock.Object);
            ConnectionInfoMock.InSequence(sequence).Setup(p => p.ChannelCloseTimeout).Returns(_channelCloseTimeout);
            SessionMock.InSequence(sequence)
                       .Setup(p => p.TryWait(It.IsNotNull<WaitHandle>(), _channelCloseTimeout))
                       .Callback<WaitHandle, TimeSpan>(
                           (waitHandle, channelCloseTimeout) =>
                           {
                               SessionMock.Raise(
                                   s => s.ChannelCloseReceived += null,
                                   new MessageEventArgs<ChannelCloseMessage>(new ChannelCloseMessage(_localChannelNumber)));
                               waitHandle.WaitOne();
                           })
                       .Returns(WaitResult.Success);
        }

        protected override void Arrange()
        {
            base.Arrange();

            _channel = new ChannelSession(SessionMock.Object, _localChannelNumber, _localWindowSize, _localPacketSize);
            _channel.Closed += (sender, args) => _channelClosedRegister.Add(args);
            _channel.Exception += (sender, args) => _channelExceptionRegister.Add(args);
            _channel.Open();
            _channel.Dispose();
        }

        protected override void Act()
        {
            _channel.Dispose();
        }

        internal ChannelSession Channel
        {
            get { return _channel; }
        }

        [TestMethod]
        public void ChannelEofMessageShouldBeSentOnce()
        {
            SessionMock.Verify(p => p.TrySendMessage(It.Is<ChannelEofMessage>(m => m.LocalChannelNumber == _remoteChannelNumber)), Times.Once);
        }

        [TestMethod]
        public void ChannelCloseMessageShouldBeSentOnce()
        {
            SessionMock.Verify(p => p.TrySendMessage(It.Is<ChannelCloseMessage>(m => m.LocalChannelNumber == _remoteChannelNumber)), Times.Once);
        }

        [TestMethod]
        public void ExceptionShouldNeverHaveFired()
        {
            Assert.AreEqual(0, _channelExceptionRegister.Count);
        }

        [TestMethod]
        public void ClosedEventShouldHaveFiredOnce()
        {
            Assert.AreEqual(1, _channelClosedRegister.Count);
            Assert.AreEqual(_localChannelNumber, _channelClosedRegister[0].ChannelNumber);
        }

        [TestMethod]
        public void IsOpenShouldReturnFalse()
        {
            Assert.IsFalse(_channel.IsOpen);
        }
    }
}


text:
"""
    FC operation with task obj
"""

from nova.fusioncompute.virt.huaweiapi import ops_base
from nova.fusioncompute.virt.huaweiapi import taskops

class OpsTaskBase(ops_base.OpsBase):
    """
    fc operation with task obj
    """
    def __init__(self, fc_client, task_ops):
        super(OpsTaskBase, self).__init__(fc_client)
        self.task_ops = task_ops

    def post(self, path, data=None, excp=None, **kwargs):
        """
            Post.
        :param path: path under Context, something like '/app/resource'
        :param data: (Optional) data of request
        :param kwargs: headers, etc.
        :return: Response object in requests
        """
        @taskops.wait_task_done(self.task_ops, excp)
        def _post():
            """
            inner post func
            """
            #ignore pylint:disable=W0142
            return super(OpsTaskBase, self).post(path, data, **kwargs)
        return _post()

    def put(self, path, data=None, excp=None, **kwargs):
        """
            Put.
        :param path: path under Context, something like '/app/resource/id'
        :param data: (Optional) data of request
        :param kwargs: headers, etc.
        :return: Response object in requests
        """
        @taskops.wait_task_done(self.task_ops, excp)
        def _put():
            """
            inner put func
            """
            #ignore pylint:disable=W0142
            return super(OpsTaskBase, self).put(path, data, **kwargs)
        return _put()

    def delete(self, path, excp=None, **kwargs):
        """
            Delete.
        :param path: path under Context, something like '/app/resource/id'
        :param kwargs: headers, etc.
        :return: Response object in requests
        """
        @taskops.wait_task_done(self.task_ops, excp)
        def _delete():
            """
            inner delete func
            :return:
            """
            #ignore pylint:disable=W0142
            return super(OpsTaskBase, self).delete(path, **kwargs)
        return _delete()


text:
def refine_DATABASES(original):
    from django_productline.context import PRODUCT_CONTEXT
    return {
        'default': {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': '%s/db.sqlite' % PRODUCT_CONTEXT.PRODUCT_DIR
        }
    }


text:
/**
 * @author Aaron Ponti
 *
 */
package ch.ethz.scu.obit.updater.gui.dialogs;


text:
package com.amazonaws.services.appregistry.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * The information about the resource.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Resource implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * The name of the resource.
     *

     */
    private String name;
    /**
     *

     * The Amazon resource name (ARN) of the resource.
     *

     */
    private String arn;
    /**
     *

     * The time the resource was associated with the application.
     *

     */
    private java.util.Date associationTime;
    /**
     *

     * The service integration information about the resource.
     *

     */
    private ResourceIntegrations integrations;

    /**
     *

     * The name of the resource.
     *

     *
     * @param name
     *        The name of the resource.
     */

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

    /**
     *

     * The name of the resource.
     *

     *
     * @return The name of the resource.
     */

    public String getName() {
        return this.name;
    }

    /**
     *

     * The name of the resource.
     *

     *
     * @param name
     *        The name of the resource.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Resource withName(String name) {
        setName(name);
        return this;
    }

    /**
     *

     * The Amazon resource name (ARN) of the resource.
     *

     *
     * @param arn
     *        The Amazon resource name (ARN) of the resource.
     */

    public void setArn(String arn) {
        this.arn = arn;
    }

    /**
     *

     * The Amazon resource name (ARN) of the resource.
     *

     *
     * @return The Amazon resource name (ARN) of the resource.
     */

    public String getArn() {
        return this.arn;
    }

    /**
     *

     * The Amazon resource name (ARN) of the resource.
     *

     *
     * @param arn
     *        The Amazon resource name (ARN) of the resource.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Resource withArn(String arn) {
        setArn(arn);
        return this;
    }

    /**
     *

     * The time the resource was associated with the application.
     *

     *
     * @param associationTime
     *        The time the resource was associated with the application.
     */

    public void setAssociationTime(java.util.Date associationTime) {
        this.associationTime = associationTime;
    }

    /**
     *

     * The time the resource was associated with the application.
     *

     *
     * @return The time the resource was associated with the application.
     */

    public java.util.Date getAssociationTime() {
        return this.associationTime;
    }

    /**
     *

     * The time the resource was associated with the application.
     *

     *
     * @param associationTime
     *        The time the resource was associated with the application.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Resource withAssociationTime(java.util.Date associationTime) {
        setAssociationTime(associationTime);
        return this;
    }

    /**
     *

     * The service integration information about the resource.
     *

     *
     * @param integrations
     *        The service integration information about the resource.
     */

    public void setIntegrations(ResourceIntegrations integrations) {
        this.integrations = integrations;
    }

    /**
     *

     * The service integration information about the resource.
     *

     *
     * @return The service integration information about the resource.
     */

    public ResourceIntegrations getIntegrations() {
        return this.integrations;
    }

    /**
     *

     * The service integration information about the resource.
     *

     *
     * @param integrations
     *        The service integration information about the resource.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Resource withIntegrations(ResourceIntegrations integrations) {
        setIntegrations(integrations);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getName() != null)
            sb.append("Name: ").append(getName()).append(",");
        if (getArn() != null)
            sb.append("Arn: ").append(getArn()).append(",");
        if (getAssociationTime() != null)
            sb.append("AssociationTime: ").append(getAssociationTime()).append(",");
        if (getIntegrations() != null)
            sb.append("Integrations: ").append(getIntegrations());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof Resource == false)
            return false;
        Resource other = (Resource) obj;
        if (other.getName() == null ^ this.getName() == null)
            return false;
        if (other.getName() != null && other.getName().equals(this.getName()) == false)
            return false;
        if (other.getArn() == null ^ this.getArn() == null)
            return false;
        if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
            return false;
        if (other.getAssociationTime() == null ^ this.getAssociationTime() == null)
            return false;
        if (other.getAssociationTime() != null && other.getAssociationTime().equals(this.getAssociationTime()) == false)
            return false;
        if (other.getIntegrations() == null ^ this.getIntegrations() == null)
            return false;
        if (other.getIntegrations() != null && other.getIntegrations().equals(this.getIntegrations()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
        hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
        hashCode = prime * hashCode + ((getAssociationTime() == null) ? 0 : getAssociationTime().hashCode());
        hashCode = prime * hashCode + ((getIntegrations() == null) ? 0 : getIntegrations().hashCode());
        return hashCode;
    }

    @Override
    public Resource clone() {
        try {
            return (Resource) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.appregistry.model.transform.ResourceMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
sed -i.bak 's/schema_salad ==/schema_salad >=/' setup.py
$PYTHON setup.py install


text:
package com.minelittlepony.client.mixin;

import com.minelittlepony.api.pony.IPonyManager;
import com.minelittlepony.client.MineLittlePony;
import com.minelittlepony.settings.PonyLevel;

import net.minecraft.client.util.DefaultSkinHelper;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import java.util.UUID;

@Mixin(DefaultSkinHelper.class)
abstract class MixinDefaultPlayerSkin {
    @Inject(method = "getTexture()Lnet/minecraft/util/Identifier;",
            at = @At("HEAD"),
            cancellable = true)
    private static void legacySkin(CallbackInfoReturnable<Identifier> cir) {
        if (MineLittlePony.getInstance().getConfig().ponyLevel.get() == PonyLevel.PONIES) {
            cir.setReturnValue(IPonyManager.STEVE);
        }
    }

    @Inject(method = "getTexture(Ljava/util/UUID;)Lnet/minecraft/util/Identifier;",
            at = @At("HEAD"),
            cancellable = true)
    private static void defaultSkin(UUID uuid, CallbackInfoReturnable<Identifier> cir) {
        if (MineLittlePony.getInstance().getConfig().ponyLevel.get() == PonyLevel.PONIES) {
            cir.setReturnValue(IPonyManager.getDefaultSkin(uuid));
        }
    }

    @Inject(method = "getModel(Ljava/util/UUID;)Ljava/lang/String;",
            at = @At("HEAD"),
            cancellable = true)
    private static void skinType(UUID uuid, CallbackInfoReturnable<String> cir) {
        if (MineLittlePony.getInstance().getConfig().ponyLevel.get() == PonyLevel.PONIES) {

            cir.setReturnValue(MineLittlePony.getInstance().getManager()
                    .getPony(IPonyManager.getDefaultSkin(uuid), uuid)
                    .getRace()
                    .getModelId(IPonyManager.isSlimSkin(uuid)));
        }
    }
}


text:
module Dux
  # Calculate the object's inspection id
  module InspectID
    # Calculates the id shown in the default
    # version of `#inspect` methods.
    #
    # @note This is currently limited to the implementation
    #   used in MRI. Rubinius and JRuby have their own
    #   implementations that are not currently served
    #   by this.
    # @param [Object] object
    # @return [String]
    def inspect_id(object = self)
      "0x%0.14x" % ( object.object_id << 1 )
    end

    extend self
  end

  extend InspectID
end


text:
public class Test01 {
	public static void main(String args[]){
		try{
			int i=1/0;
		}catch(Exception e){
			e.printStackTrace(System.out);
			System.out.println("execption");
		}finally {
			System.out.println("finally");
		}
	}
}


text:
<?php
/**
 * Credits administration panel.
 *
 * @package WordPress
 * @subpackage Administration
 */

/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require_once __DIR__ . '/includes/credits.php';

// Used in the HTML title tag.
$title = __( 'Credits' );

list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );

require_once ABSPATH . 'wp-admin/admin-header.php';

$credits = wp_credits();
?>

				<?php _e( 'Contributors' ); ?>

			<?php
			printf(
				/* translators: %s: Version number. */
				__( 'WordPress %s was created by a worldwide team of passionate individuals' ),
				$display_version
			);
			?>

		<nav class="about__header-navigation nav-tab-wrapper wp-clearfix" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
			<?php _e( 'What’s New' ); ?>
			<?php _e( 'Credits' ); ?>
			<?php _e( 'Freedoms' ); ?>
			<?php _e( 'Privacy' ); ?>

			<?php if ( ! $credits ) : ?>

				<?php
				printf(
					/* translators: 1: https://wordpress.org/about/ */
					__( 'WordPress is created by a worldwide team of passionate individuals.' ),
					__( 'https://wordpress.org/about/' )
				);
				?>

				<?php _e( 'Get involved in WordPress.' ); ?>

			<?php else : ?>

				<?php _e( 'Want to see your name in lights on this page?' ); ?>

				<?php _e( 'Get involved in WordPress.' ); ?>

			<?php endif; ?>

<?php
if ( ! $credits ) {
	echo '
';
	require_once ABSPATH . 'wp-admin/admin-footer.php';
	exit;
}
?>

			<?php wp_credits_section_title( $credits['groups']['core-developers'] ); ?>
			<?php wp_credits_section_list( $credits, 'core-developers' ); ?>
			<?php wp_credits_section_list( $credits, 'contributing-developers' ); ?>

			<?php wp_credits_section_title( $credits['groups']['props'] ); ?>
			<?php wp_credits_section_list( $credits, 'props' ); ?>

	<?php if ( isset( $credits['groups']['translators'] ) || isset( $credits['groups']['validators'] ) ) : ?>

			<?php wp_credits_section_title( $credits['groups']['validators'] ); ?>
			<?php wp_credits_section_list( $credits, 'validators' ); ?>
			<?php wp_credits_section_list( $credits, 'translators' ); ?>

	<?php endif; ?>

			<?php wp_credits_section_title( $credits['groups']['libraries'] ); ?>
			<?php wp_credits_section_list( $credits, 'libraries' ); ?>

<?php

require_once ABSPATH . 'wp-admin/admin-footer.php';

return;

// These are strings returned by the API that we want to be translatable.
__( 'Project Leaders' );
/* translators: %s: The current WordPress version number. */
__( 'Core Contributors to WordPress %s' );
__( 'Noteworthy Contributors' );
__( 'Cofounder, Project Lead' );
__( 'Lead Developer' );
__( 'Release Lead' );
__( 'Release Design Lead' );
__( 'Release Deputy' );
__( 'Core Developer' );
__( 'External Libraries' );


text:
$stderr.puts "WARN: Ohai::Mixin::Command is deprecated, please use Ohai::Mixin::ShellOut or remove if the reference is unnecessary"
require_relative "shell_out"
Ohai::Mixin::Command = Ohai::Mixin::ShellOut unless defined?(Ohai::Mixin::Command)


text:
class MaxNodeDesc : public ReferenceCount, public Namable {
 public:
  MaxNodeDesc(MaxNodeDesc *parent = NULL, INode *max_node = NULL);
  ~MaxNodeDesc();

  void from_INode(INode *max_node);
  bool has_max_node() const;
  INode *get_max_node() const;

  void set_joint(bool onoff);
  bool is_joint() const;
  bool is_joint_parent() const;
  bool is_node_joint() const;

  MaxNodeDesc *_parent;
  MaxNodeDesc *_joint_entry;
  typedef pvector< MaxNodeDesc* > Children;
  Children _children;

 private:
  void clear_egg();
  void mark_joint_parent();
  void check_pseudo_joints(bool joint_above);

  INode *_max_node;

  EggGroup *_egg_group;
  EggTable *_egg_table;
  EggXfmSAnim *_anim;

  enum JointType {
    JT_none,         // Not a joint.
    JT_node_joint,    // Node that represents a joint in the geometry
                                         // but not the actual joint itself
    JT_joint,        // An actual joint in Max.
    JT_pseudo_joint, // Not a joint in Max, but treated just like a
                     // joint for the purposes of the converter.
    JT_joint_parent, // A parent or ancestor of a joint or pseudo joint.
  };
  JointType _joint_type;

 public:
  static TypeHandle get_class_type() {
    return _type_handle;
  }
  static void init_type() {
    ReferenceCount::init_type();
    Namable::init_type();
    register_type(_type_handle, "MaxNodeDesc",
                  ReferenceCount::get_class_type(),
                  Namable::get_class_type());
  }

 private:
  static TypeHandle _type_handle;

  friend class MaxNodeTree;
};

#endif


text:
package instance

func (l *LocalInstance) Output(key string) (string, error) {
	if err := l.assertExists(); err != nil {
		return "", err
	}

	return l.Terraform.Output(l.Dir, key)
}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <link rel="apple-touch-icon" sizes="180x180" href="/SonghayCore/assets/favicons/apple-touch-icon.png">
        <link rel="icon" type="image/png" sizes="32x32" href="/SonghayCore/assets/favicons/favicon-32x32.png">
        <link rel="icon" type="image/png" sizes="16x16" href="/SonghayCore/assets/favicons/favicon-16x16.png">
        <link rel="manifest" href="/SonghayCore/assets/favicons/site.webmanifest">
        <link rel="shortcut icon" type="image/png" href="/SonghayCore/assets/favicons/favicon.ico"/>
        <link rel="mask-icon" href="/SonghayCore/assets/favicons/safari-pinned-tab.svg" color="#e9ecef">
        <meta name="msapplication-config" content="/SonghayCore/assets/favicons/browserconfig.xml" />
        <meta name="msapplication-TileColor" content="#e9ecef">
        <meta name="theme-color" content="#e9ecef">

        <link href="/SonghayCore/assets/bootstrap/bootstrap.css" rel="stylesheet" />
                <link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&family=Roboto+Slab:wght@400;700&family=Roboto:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap" rel="stylesheet" data-no-mirror>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.26.0/themes/prism.css">
        <link href="/SonghayCore/assets/css/theme.css" rel="stylesheet" />
        <link href="/SonghayCore/assets/css/styles.css" rel="stylesheet" />

        <title>SonghayCore - FindParentDirectoryInfo(string, string, int)</title>

                SonghayCore

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

    </button>

            API

			ProgramFileUtility.

Find<wbr>Parent<wbr>Directory<wbr>Info<wbr>(string, <wbr>string, <wbr>int)<wbr> Method

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

                                            </button>

Namespace

Songhay

Type

ProgramFileUtility

Method Members

Count<wbr>Parent<wbr>Directory<wbr>Chars<wbr>(string)<wbr>

FindParentDirectory<wbr>(string, <wbr>string, <wbr>int)<wbr>

Find<wbr>Parent<wbr>Directory<wbr>Info<wbr>(string, <wbr>string, <wbr>int)<wbr>

GetCombinedPath<wbr>(string, <wbr>string)<wbr>

GetCombinedPath<wbr>(string, <wbr>string, <wbr>bool)<wbr>

GetEncodedString<wbr>(string)<wbr>

GetEncodedString<wbr>(string, <wbr>Encoding)<wbr>

GetParentDirectory<wbr>(string, <wbr>int)<wbr>

Get<wbr>Parent<wbr>Directory<wbr>Info<wbr>(string, <wbr>int)<wbr>

GetRelativePath<wbr>(string)<wbr>

IsForwardSlashSystem<wbr>()<wbr>

NormalizePath<wbr>(string)<wbr>

Read<wbr>Zip<wbr>Archive<wbr>Entries<wbr>(FileInfo?, <wbr>Action<wbr><string><wbr>?)<wbr>

Read<wbr>Zip<wbr>Archive<wbr>Entries<wbr>(FileInfo?, <wbr>Action<wbr><string><wbr>?, <wbr>Func<wbr><<wbr>Read<wbr>Only<wbr>Collection<wbr><<wbr>Zip<wbr>Archive<wbr>Entry><wbr>, <wbr>IEnumerable<wbr><<wbr>Zip<wbr>Archive<wbr>Entry><wbr>><wbr>?)<wbr>

Read<wbr>Zip<wbr>Archive<wbr>Entries<wbr>By<wbr>Line<wbr>(FileInfo?, <wbr>Action<wbr><int, <wbr>string><wbr>?)<wbr>

Read<wbr>Zip<wbr>Archive<wbr>Entries<wbr>By<wbr>Line<wbr>(FileInfo?, <wbr>Action<wbr><int, <wbr>string><wbr>?, <wbr>Func<wbr><<wbr>Read<wbr>Only<wbr>Collection<wbr><<wbr>Zip<wbr>Archive<wbr>Entry><wbr>, <wbr>IEnumerable<wbr><<wbr>Zip<wbr>Archive<wbr>Entry><wbr>><wbr>?)<wbr>

Remove<wbr>Backslash<wbr>Prefixes<wbr>(string)<wbr>

Remove<wbr>Conventional<wbr>Prefixes<wbr>(string)<wbr>

Remove<wbr>Forwardslash<wbr>Prefixes<wbr>(string)<wbr>

Trim<wbr>Leading<wbr>Directory<wbr>Separator<wbr>Chars<wbr>(string)<wbr>

UseZipArchive<wbr>(FileInfo?, <wbr>Action<wbr><ZipArchive?><wbr>?)<wbr>

UseZipArchive<wbr>(FileInfo?, <wbr>Action<wbr><ZipArchive?><wbr>?, <wbr>ZipArchiveMode)<wbr>

UseZipArchiveEntries<wbr>(FileInfo?, <wbr>Action<wbr><<wbr>Read<wbr>Only<wbr>Collection<wbr><<wbr>Zip<wbr>Archive<wbr>Entry><wbr>><wbr>?)<wbr>

UseZipArchiveEntries<wbr>(FileInfo?, <wbr>Action<wbr><<wbr>Read<wbr>Only<wbr>Collection<wbr><<wbr>Zip<wbr>Archive<wbr>Entry><wbr>><wbr>?, <wbr>Func<wbr><<wbr>Read<wbr>Only<wbr>Collection<wbr><<wbr>Zip<wbr>Archive<wbr>Entry><wbr>, <wbr>IEnumerable<wbr><<wbr>Zip<wbr>Archive<wbr>Entry><wbr>><wbr>?)<wbr>

WriteZipArchiveEntry<wbr>(FileInfo?, <wbr>FileInfo)<wbr>

WriteZipArchiveEntry<wbr>(FileInfo?, <wbr>FileInfo, <wbr>CompressionLevel)<wbr>

    Finds the parent DirectoryInfo.

Namespace

Songhay

Containing Type

ProgramFileUtility

Syntax

public static DirectoryInfo? FindParentDirectoryInfo(string path, string parentName, int levels)

Parameters

						Name
						Type
						Description

							path
							string
							The path.

							parentName
							string
							Name of the parent.

							levels
							int
							The levels.

Return Value

						Type
						Description

						DirectoryInfo?

On This Page

Syntax

Parameters

Return Value

            Generated By Statiq


text:
(function(helpers) {
    "use strict";

    describe("bindings.disabledCssClass", function() {
        var containerElement = null;

        beforeEach(function() {
            containerElement = document.createElement("div");
            helpers.dom.appendElementToBody(containerElement);
        });

        afterEach(function() {
            helpers.dom.removeElementFromBody(containerElement);
        });

        it("When the enable binding is true, the CSS class is not on the element", function() {
            containerElement.innerHTML = "<button data-bind=\"disabledCssClass: 'foo', enable: true\"></button>";

            ko.applyBindings({}, containerElement);

            var button = document.getElementsByTagName("button")[0];

            expect(button.classList.contains("foo")).toBeFalsy();
        });

        it("When the enable binding is false, the CSS class is on the element", function() {
            containerElement.innerHTML = "<button data-bind=\"disabledCssClass: 'foo', enable: false\"></button>";

            ko.applyBindings({}, containerElement);

            var button = document.getElementsByTagName("button")[0];

            expect(button.classList.contains("foo")).toBeTruthy();
        });

        it("When the disable binding is true, the CSS class is on the element", function() {
            containerElement.innerHTML = "<button data-bind=\"disabledCssClass: 'foo', disable: true\"></button>";

            ko.applyBindings({}, containerElement);

            var button = document.getElementsByTagName("button")[0];

            expect(button.classList.contains("foo")).toBeTruthy();
        });

        it("When the disable binding is false, the CSS class is not on the element", function() {
            containerElement.innerHTML = "<button data-bind=\"disabledCssClass: 'foo', disable: false\"></button>";

            ko.applyBindings({}, containerElement);

            var button = document.getElementsByTagName("button")[0];

            expect(button.classList.contains("foo")).toBeFalsy();
        });

        describe("When the enable binding value is an observable", function() {
            it("It works when value is true", function() {
                containerElement.innerHTML = "<button data-bind=\"disabledCssClass: 'foo', enable: isEnabled\"></button>";

                var viewModel = {
                    isEnabled: ko.observable(true)
                };

                ko.applyBindings(viewModel, containerElement);

                var button = document.getElementsByTagName("button")[0];

                expect(button.classList.contains("foo")).toBeFalsy();
            });

            it("It works when value is false", function() {
                containerElement.innerHTML = "<button data-bind=\"disabledCssClass: 'foo', enable: isEnabled\"></button>";

                var viewModel = {
                    isEnabled: ko.observable(false)
                };

                ko.applyBindings(viewModel, containerElement);

                var button = document.getElementsByTagName("button")[0];

                expect(button.classList.contains("foo")).toBeTruthy();
            });

            it("When the value changed, the CSS class is reevaluated", function() {
                containerElement.innerHTML = "<button data-bind=\"disabledCssClass: 'foo', enable: isEnabled\"></button>";

                var viewModel = {
                    isEnabled: ko.observable(false)
                };

                ko.applyBindings(viewModel, containerElement);

                viewModel.isEnabled(true);

                var button = document.getElementsByTagName("button")[0];

                expect(button.classList.contains("foo")).toBeFalsy();
            });
        });

        describe("When the disable binding value is an observable", function() {
            it("It works when value is true", function() {
                containerElement.innerHTML = "<button data-bind=\"disabledCssClass: 'foo', disable: isDisabled\"></button>";

                var viewModel = {
                    isDisabled: ko.observable(true)
                };

                ko.applyBindings(viewModel, containerElement);

                var button = document.getElementsByTagName("button")[0];

                expect(button.classList.contains("foo")).toBeTruthy();
            });

            it("It works when value is false", function() {
                containerElement.innerHTML = "<button data-bind=\"disabledCssClass: 'foo', disable: isDisabled\"></button>";

                var viewModel = {
                    isDisabled: ko.observable(false)
                };

                ko.applyBindings(viewModel, containerElement);

                var button = document.getElementsByTagName("button")[0];

                expect(button.classList.contains("foo")).toBeFalsy();
            });

            it("When the value changed, the CSS class is reevaluated", function() {
                containerElement.innerHTML = "<button data-bind=\"disabledCssClass: 'foo', disable: isDisabled\"></button>";

                var viewModel = {
                    isDisabled: ko.observable(false)
                };

                ko.applyBindings(viewModel, containerElement);

                viewModel.isDisabled(true);

                var button = document.getElementsByTagName("button")[0];

                expect(button.classList.contains("foo")).toBeTruthy();
            });
        });

        it("When the value is an observable, throw an exception", function() {
            containerElement.innerHTML = "<button data-bind=\"disabledCssClass: ko.observable('foo'), disable: true\"></button>";

            expect(function() { ko.applyBindings({}, containerElement); }).toThrow();
        });

        it("When the enable and disable bindings are not specified, throw an exception", function() {
            containerElement.innerHTML = "<button data-bind=\"disabledCssClass: 'foo'\"></button>";

            expect(function() { ko.applyBindings({}, containerElement); }).toThrow();
        });
    });
})(test.helpers);

// jscs:enable requireBlocksOnNewline