text:
<?xml version="1.0"?>
<resources xmlns="https://api-platform.com/schema/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://api-platform.com/schema/metadata https://api-platform.com/schema/metadata/metadata-2.0.xsd">
    <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://api-platform.com/schema/metadata https://api-platform.com/schema/metadata/metadata-2.0.xsd" class="App\Entity\Book">
        <attribute>
            <attribute name="normalization_context">
                <attribute name="groups">
                    <attribute>read</attribute>
                </attribute>
            </attribute>
            <attribute name="denormalization_context">
                <attribute name="groups">
                    <attribute>write</attribute>
                </attribute>
            </attribute>
            <attribute name="Create a Book instead"/>
        </attribute>
        <graphql>
            <operation name="query">
                <attribute name="normalization_context">
                    <attribute name="groups">
                        <attribute>query</attribute>
                    </attribute>
                </attribute>
            </operation>
            <operation name="create">
                <attribute name="normalization_context">
                    <attribute name="groups">
                        <attribute>query</attribute>
                    </attribute>
                </attribute>
                <attribute name="denormalization_context">
                    <attribute name="groups">
                        <attribute>mutation</attribute>
                    </attribute>
                </attribute>
            </operation>
            <operation name="delete"/>
        </graphql>
        <itemOperations>
            <itemOperation name="get">
                <attribute name="method">GET</attribute>
                <attribute name="path">/grimoire/{id}</attribute>
                <attribute name="requirements">
                    <attribute name="id">\d+</attribute>
                </attribute>
                <attribute name="defaults">
                    <attribute name="color">brown</attribute>
                </attribute>
                <attribute name="options">
                    <attribute name="my_option">my_option_value</attribute>
                </attribute>
                <attribute name="schemes">
                    <attribute>https</attribute>
                </attribute>
                <attribute name="host">{subdomain}.api-platform.com</attribute>
            </itemOperation>
            <itemOperation name="put">
                <attribute name="method">PUT</attribute>
                <attribute name="path">/grimoire/{id}/update</attribute>
                <attribute name="hydra_context">
                    <attribute name="foo">bar</attribute>
                </attribute>
            </itemOperation>
            <itemOperation name="post_publication">
                <attribute name="route_name">book_post_publication</attribute>
                <attribute name="deprecation_reason">Retrieve a Book instead</attribute>
                <attribute name="sunset">01/01/2020</attribute>
            </itemOperation>
            <itemOperation name="book_post_discontinuation"/>
        </itemOperations>
        <property name="id" description="identifiant unique" iri="http://schema.org/id" identifier="1"/>
        <property name="name" readable="1" writable="1"/>
        <property name="author" readable="1">
            <subresource resourceClass="App\Entity\Holder"/>
        </property>
        <property name="scribus">
            <attribute>
                <attribute name="Use the author property instead"/>
            </attribute>
        </property>
    </resource>
</resources>


text:
import {Inject, Component, View} from 'angular2/core';
import {ROUTER_DIRECTIVES, Router, Location, RouteParams} from 'angular2/router';
import {PATHS} from '../../../config/paths';

import {TaskService} from '../task.service';
import {TaskModel} from '../task.model';

@Component({
    selector: 'task-update'
})
@View({
    templateUrl: PATHS.taskifyPath + '/task/update/update.html',
    directives: ROUTER_DIRECTIVES
})

export class TaskUpdate {
    private taskService: TaskService;
    public router: Router;
    public task:TaskModel= new TaskModel();

    constructor(@Inject(TaskService) taskService:TaskService,
                @Inject(Router) router:Router,
                @Inject(RouteParams) params: RouteParams) {
        this.taskService = taskService;
        this.router = router;

        this.taskService.getTask(parseInt(params.get("id")))
            .subscribe(result => {
                this.task = result;
            });
    }

    public update():void {
        this.taskService.updateTask(this.task)
            .subscribe(() => {
                this.router.navigateByUrl('/');
            })
    }
}

redpajama_set_name: RedPajamaGithub


text:
package net.johnewart.gearman.common.packets.response;

import net.johnewart.gearman.common.JobState;
import net.johnewart.gearman.common.JobStatus;
import net.johnewart.gearman.constants.PacketType;

import java.util.concurrent.atomic.AtomicReference;

public class StatusRes extends ResponsePacket {
    private final AtomicReference<String> jobHandle;
    private final boolean statusKnown;
    private final boolean running;
    private final int numerator;
    private final int denominator;

    public StatusRes(String jobHandle, boolean running, boolean statusKnown, int numerator, int denominator)
    {
        this.jobHandle = new AtomicReference<>(jobHandle);
        this.running = running;
        this.statusKnown = statusKnown;
        this.numerator = numerator;
        this.denominator = denominator;
        this.type = PacketType.STATUS_RES;
    }

    public StatusRes(byte[] pktdata)
    {
        super(pktdata);
        jobHandle = new AtomicReference<>();
        AtomicReference<String> numeratorStr = new AtomicReference<>();
        AtomicReference<String> denominatorStr = new AtomicReference<>();

        AtomicReference<String> statusStr = new AtomicReference<>();
        AtomicReference<String> runningStr = new AtomicReference<>();

        int pOff = 0;
        pOff = parseString(pOff, jobHandle);
        pOff = parseString(pOff, statusStr);
        pOff = parseString(pOff, runningStr);
        pOff = parseString(pOff, numeratorStr);
        parseString(pOff, denominatorStr);

        if(Integer.parseInt(runningStr.get()) == 1)
        {
            running = true;
        } else {
            running = false;
        }

        if(Integer.parseInt(statusStr.get()) == 1)
        {
            statusKnown = true;
        } else {
            statusKnown = false;
        }

        denominator = Integer.parseInt(denominatorStr.get());
        numerator = Integer.parseInt(numeratorStr.get());
        type = PacketType.STATUS_RES;
    }

    public StatusRes(JobStatus jobStatus) {
        running = jobStatus.isRunning();
        statusKnown = jobStatus.isStatusKnown();
        denominator = jobStatus.getDenominator();
        numerator = jobStatus.getNumerator();
        jobHandle = new AtomicReference<>(jobStatus.getJobHandle());
        type = PacketType.STATUS_RES;
    }

    public byte[] toByteArray()
    {
        int knownStatus = statusKnown ? 1 : 0;
        int runningStatus = running ? 1 : 0;
        byte[] metadata = stringsToTerminatedByteArray(
                false,  // No final terminator
                jobHandle.get(),
                String.valueOf(knownStatus),
                String.valueOf(runningStatus),
                String.valueOf(numerator),
                String.valueOf(denominator)
        );

        return concatByteArrays(getHeader(), metadata);
    }

    public String getJobHandle()
    {
        return jobHandle.get();
    }

    public int getNumerator() {
        return numerator;
    }

    public int getDenominator() {
        return denominator;
    }

    public boolean isRunning() {
        return running;
    }

    public boolean isStatusKnown() {
        return statusKnown;
    }

    public float percentComplete()
    {
        if(denominator != 0)
        {
            return  (float)numerator / (float)denominator;
        } else {
            return 0.0F;
        }
    }

    @Override
    public int getPayloadSize()
    {
        return jobHandle.get().length() + 1 + 2 + 2 + String.valueOf(numerator).length() + 1 + String.valueOf(denominator).length();
    }

    public String toString()
    {
        return jobHandle.get() + ":" + statusKnown + ":" + running + ":" + numerator + ":" + denominator;
    }

    public JobStatus toJobStatus() {
        return new JobStatus(
                numerator,
                denominator,
                this.running ? JobState.WORKING : JobState.QUEUED,
                getJobHandle()
        );
    }
}


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using Microsoft.Azure.Commands.RecoveryServices.SiteRecovery;
using Microsoft.WindowsAzure.Management.SiteRecovery.Models;

namespace Microsoft.Azure.Commands.RecoveryServices
{
    /// <summary>
    /// Retrieves Azure Site Recovery Storage.
    /// </summary>
    [Cmdlet(VerbsCommon.Get, "AzureSiteRecoveryStorage")]
    [OutputType(typeof(ASRStorage))]
    [Obsolete("This cmdlet has been marked for deprecation in an upcoming release. Please use the " +
        "equivalent cmdlet from the AzureRm.RecoveryServices.SiteRecovery module instead.",
        false)]
    public class GetAzureSiteRecoveryStorage : RecoveryServicesCmdletBase
    {
        #region Parameters
        /// <summary>
        /// Gets or sets Server object.
        /// </summary>
        [Parameter(Mandatory = true, ValueFromPipeline = true)]
        [ValidateNotNullOrEmpty]
        public ASRServer Server { get; set; }
        #endregion Parameters

        /// <summary>
        /// ProcessRecord of the command.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            try
            {
                this.WriteWarningWithTimestamp(
                    string.Format(
                        Properties.Resources.CmdletWillBeDeprecatedSoon,
                        this.MyInvocation.MyCommand.Name));

                StorageListResponse storageListResponse =
                    RecoveryServicesClient.GetAzureSiteRecoveryStorages(this.Server.ID);

                this.WriteStorages(storageListResponse.Storages);
            }
            catch (Exception exception)
            {
                this.HandleException(exception);
            }
        }

        /// <summary>
        /// Write Storages.
        /// </summary>
        /// <param name="storages">List of Storages</param>
        private void WriteStorages(IList<AsrStorage> storages)
        {
            this.WriteObject(storages.Select(s => new ASRStorage(s)), true);
        }
    }
}


text:
<?php

/**
 * This example shows how to produce a "GRAPHVIZ" representation of a tree.
 */

include __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

use dbeurive\Tree\Tree;

$tree = new Tree("getRoot");
$tree->getRoot()
            ->addChild("A")->end()
            ->addChild("B")->end()
            ->addChild("C")
                ->addChild("D")
                    ->addChild("E")
                        ->addChild("EE")->end()
                        ->addChild("EEE")->end()
                    ->end()
                    ->addChild("F")->end()
                ->end()
                ->addChild("A")
                    ->addChild('H')
                        ->addChild("I")
                            ->addChild("J")
                                ->addChild("K")->end()
                                ->addChild("L")->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ->end();

/**
 * @var callable Function that convert a node's data into a printable string.
 * @param mixed $data The node's data.
 * @return string The function returns a string that represents the node's data.
 */
$optionalToString = function($data) {
    return $data;
};

$dot = $tree->toDot($optionalToString);
$fd = fopen(__DIR__ . DIRECTORY_SEPARATOR . "tree2dot.dot", "w");
fwrite($fd, $dot);
fclose($fd);
print "To create a graphical representation of the tree, install GRAPHVIZ and run the following command:\n";
print "dot -Tgif -Ograph tree2dot.dot\n";


text:
package com.github.jrh3k5.inventory.application.taglib;

import static com.github.jrh3k5.inventory.application.DomUtils.dom;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.SimpleTagSupport;

import com.github.jrh3k5.inventory.application.DomUtils.DomBuilder;

public class ContentTagLib extends SimpleTagSupport {
    private String title;

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public void doTag() throws JspException, IOException {
        final JspWriter writer = getJspContext().getOut();
        final DomBuilder contentBuilder = dom("div").withId("content");
        if (title != null) {
            contentBuilder.withDom(dom("h1").withBody(title));
        }
        contentBuilder.withBody(getJspBody());
        writer.println(contentBuilder.build());
    }
}


text:
function test_suite = test_grDilate
%TEST_GRDILATE  test suite for function grDilate
%
%   output = test_grDilate(input)
%
%   Example
%   testGrDilate
%
%   See also
%
%
% ------
% Author: David Legland
% e-mail: david.legland@grignon.inra.fr
% Created: 2011-05-18,    using Matlab 7.9.0.529 (R2009b)
% Copyright 2011 INRA - Cepia Software Platform.

test_suite = functiontests(localfunctions);

function testSimpleGraph(testCase) %#ok<*DEFNU>

[nodes, edges, values] = createTestGraph01(); %#ok<ASGLU>

valDil = grDilate(edges, values);
exp = [80;80;70;70;80;50;80;40];
testCase.assertEqual(exp, valDil);


text:
package com.thoughtworks.studios.mingle.hg.cmdline;

import org.junit.Test;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.equalTo;

public class ProcessWatcherTest {

  @Test
  public void destroysProcessIfExecutionExceedsTimeout() throws Exception {
    String[] cmd = TestProgram.cmdFor(new String[]{"sleep" , "20000"});
    Process process = Runtime.getRuntime().exec(cmd);
    ProcessWatcher watcher = new ProcessWatcher(process, 100L);
    watcher.start();
    int returnCode = process.waitFor();

    assertThat(returnCode, not(equalTo(0)));
    assertThat(watcher.timedOut(), equalTo(true));
  }

  @Test
  public void watcherCanBeCanceled() throws Exception {
    String[] cmd = TestProgram.cmdFor(new String[]{"sleep" , "200"});
    Process process = Runtime.getRuntime().exec(cmd);
    ProcessWatcher watcher = new ProcessWatcher(process, 50L);
    watcher.start();
    watcher.cancel();
    int returnCode = process.waitFor();

    assertThat(returnCode, equalTo(0));
  }
}


text:
package org.umlg.sqlg.structure;

import org.umlg.sqlg.sql.parse.SchemaTableTree;

/**
 * Created by pieter on 2015/01/25.
 */
@FunctionalInterface
public interface Visitor<R> {
    R visit(SchemaTableTree schemaTableTree);
}


text:
from django.test import TestCase, Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User, Group
from foraliving.models import Volunteer_User_Add_Ons, Skill, Interest, User_Add_Ons

class ContactForm(TestCase):
    """
        Test Calls fot all method related with the complete videos interface
    """
    fixtures = ['initial_data']

    def setUp(self):
        """
            Setup the initial conditions for execute the tests
        :return:
        """

    def test_first_name_required(self):
        """
            Reason: First Name is required
        """
        response = self.client.post(
            reverse('vSignup'),
            data={'first_name': '', 'last_name': 'Pazos', 'email': 'noelia.pazos@viaro.net',
                  'password': 'admin123', 'phone': '181-12578946', 'canGetText': True,
                  'yearsSinceHSGraduation': 1, 'collegeLevel': 1, 'yearsInIndustry': 5},
            follow=True
        )
        self.assertContains(response, "This field is required", 1)
        self.assertEquals(response.status_code, 200)

    def test_last_name_required(self):
        """
            Reason: Last Name is required
        """
        response = self.client.post(
            reverse('vSignup'),
            data={'first_name': 'Noelia', 'last_name': '', 'email': 'noelia.pazos@viaro.net',
                  'password': 'admin123', 'phone': '181-12578946', 'canGetText': True,
                  'yearsSinceHSGraduation': 1, 'collegeLevel': 1, 'yearsInIndustry': 5},
            follow=True
        )
        self.assertContains(response, "This field is required", 1)
        self.assertEquals(response.status_code, 200)

    def test_email_required(self):
        """
            Reason: Email is required
        """
        response = self.client.post(
            reverse('vSignup'),
            data={'first_name': 'Noelia', 'last_name': 'Pazos', 'email': '',
                  'password': 'admin123', 'phone': '181-12578946', 'canGetText': True,
                  'yearsSinceHSGraduation': 1, 'collegeLevel': 1, 'yearsInIndustry': 5},
            follow=True
        )
        self.assertContains(response, "This field is required", 1)
        self.assertEquals(response.status_code, 200)

    def test_username_required(self):
        """
            Reason: Username is required
        """
        response = self.client.post(
            reverse('vSignup'),
            data={'first_name': 'Noelia', 'last_name': 'Pazos', 'email': 'noelia.pazos@viaro.net', 'username': '',
                  'password': 'admin123', 'phone': '181-12578946', 'canGetText': True,
                  'yearsSinceHSGraduation': 1, 'collegeLevel': 1, 'yearsInIndustry': 5},
            follow=True
        )
        self.assertContains(response, "This field is required", 1)
        self.assertEquals(response.status_code, 200)

    def test_password_required(self):
        """
            Reason: Password is required
        """
        response = self.client.post(
            reverse('vSignup'),
            data={'first_name': 'Noelia', 'last_name': 'Pazos', 'email': 'noelia.pazos@viaro.net',
                  'username': 'noelia_pazos',
                  'password': '', 'phone': '181-12578946', 'canGetText': True,
                  'yearsSinceHSGraduation': 1, 'collegeLevel': 1, 'yearsInIndustry': 5},
            follow=True
        )
        self.assertContains(response, "This field is required", 1)
        self.assertEquals(response.status_code, 200)

    def test_phone_required(self):
        """
            Reason: Phone is required
        """
        response = self.client.post(
            reverse('vSignup'),
            data={'first_name': 'Noelia', 'last_name': 'Pazos', 'email': 'noelia.pazos@viaro.net',
                  'username': 'noelia_pazos',
                  'password': 'admin123', 'phone': '', 'canGetText': True,
                  'yearsSinceHSGraduation': 1, 'collegeLevel': 1, 'yearsInIndustry': 5},
            follow=True
        )
        self.assertContains(response, "This field is required", 1)
        self.assertEquals(response.status_code, 200)

    def test_can_get_text_required(self):
        """
            Reason: Can Get Text is required
        """
        response = self.client.post(
            reverse('vSignup'),
            data={'first_name': 'Noelia', 'last_name': 'Pazos', 'email': 'noelia.pazos@viaro.net',
                  'username': 'noelia_pazos',
                  'password': 'admin123', 'phone': '181-1235889', 'canGetText': '',
                  'yearsSinceHSGraduation': 1, 'collegeLevel': 1, 'yearsInIndustry': 5},
            follow=True
        )
        self.assertContains(response, "This field is required", 1)
        self.assertEquals(response.status_code, 200)

    def test_yearssincehsgraduation_required(self):
        """
            Reason: Years Since HS Graduation is required
        """
        response = self.client.post(
            reverse('vSignup'),
            data={'first_name': 'Noelia', 'last_name': 'Pazos', 'email': 'noelia.pazos@viaro.net',
                  'username': 'noelia_pazos',
                  'password': 'admin123', 'phone': '181-1235889', 'canGetText': True,
                  'yearsSinceHSGraduation': "", 'collegeLevel': 1, 'yearsInIndustry': 5},
            follow=True
        )
        self.assertContains(response, "This field is required", 1)
        self.assertEquals(response.status_code, 200)

    def test_collegelevel_required(self):
        """
            Reason: College Level is required
        """
        response = self.client.post(
            reverse('vSignup'),
            data={'first_name': 'Noelia', 'last_name': 'Pazos', 'email': 'noelia.pazos@viaro.net',
                  'username': 'noelia_pazos',
                  'password': 'admin123', 'phone': '181-1235889', 'canGetText': True,
                  'yearsSinceHSGraduation': 1, 'collegeLevel': '', 'yearsInIndustry': 5},
            follow=True
        )
        self.assertContains(response, "This field is required", 1)
        self.assertEquals(response.status_code, 200)

    def test_years_in_industry_required(self):
        """
            Reason: Years in the Industry is required
        """
        response = self.client.post(
            reverse('vSignup'),
            data={'first_name': 'Noelia', 'last_name': 'Pazos', 'email': 'noelia.pazos@viaro.net',
                  'username': 'noelia_pazos',
                  'password': 'admin123', 'phone': '181-1235889', 'canGetText': True,
                  'yearsSinceHSGraduation': 1, 'collegeLevel': 1, 'yearsInIndustry': ''},
            follow=True
        )
        self.assertContains(response, "This field is required", 1)
        self.assertEquals(response.status_code, 200)

    def test_user_created(self):
        """
        When the user fill the form, a user should be created in the system
        :return:
        """
        response = self.client.post(
            reverse('vSignup'),
            data={'first_name': 'Noelia', 'last_name': 'Pazos', 'email': 'noelia.pazos@viaro.net',
                  'username': 'noelia_pazos',
                  'password': 'admin123', 'phone': '181-1235889', 'canGetText': True,
                  'yearsSinceHSGraduation': 1, 'collegeLevel': 1, 'yearsInIndustry': 5},
            follow=True
        )
        user = User.objects.get(username="noelia_pazos")
        self.assertEquals(user.username, "noelia_pazos")
        self.assertEquals(response.status_code, 200)

    def test_volunteer_created(self):
        """
        When the user fill the form, a volunteer should be created in the system
        :return:
        """
        response = self.client.post(
            reverse('vSignup'),
            data={'first_name': 'Noelia', 'last_name': 'Pazos', 'email': 'noelia.pazos@viaro.net',
                  'username': 'noelia_pazos',
                  'password': 'admin123', 'phone': '181-1235889', 'canGetText': True,
                  'yearsSinceHSGraduation': 1, 'collegeLevel': 1, 'yearsInIndustry': 5},
            follow=True
        )
        user = User.objects.get(username="noelia_pazos")
        volunteer = Volunteer_User_Add_Ons.objects.get(user=user)
        self.assertEquals(volunteer.user.username, "noelia_pazos")
        self.assertEquals(response.status_code, 200)

    def test_edit_volunteer(self):
        """
        A volunteer could edit their profile
        :return:
        """
        self.client.login(username='volunteer_admin', password='admin123')
        user = User.objects.get(username="volunteer_admin")
        response = self.client.post(
            reverse('volunteer_profile_edit', kwargs={'user_id': user.id}),
            data={
                'first_name': 'Noelia', 'last_name': 'Pazos', 'email': 'noelia.pazos@viaro.net',
                'username': 'noelia_pazos',
                'password': 'admin123', 'phone': '181-1235889', 'canGetText': True,
                'yearsSinceHSGraduation': 1, 'collegeLevel': 1, 'yearsInIndustry': 5
            }
        )

        volunteer_edit = Volunteer_User_Add_Ons.objects.get(user=user)
        self.assertEquals(volunteer_edit.phone, "181-1235889")
        self.assertEquals(response.status_code, 200)

    def test_volunteer_create_skills(self):
        """
        The volunteer can add a list of skills in the volunteer form
        :return:
        """

        skill = Skill(name='business')
        skill.save()
        import json
        skills = json.dumps([{"label": skill.name, "value": skill.name}])
        user = User.objects.get(username="volunteer_admin")
        volunteer = Volunteer_User_Add_Ons.objects.get(user=user)
        response = self.client.post(
            reverse('createSkill', kwargs={'volunteer_id': volunteer.id}),
            data={
                "skills": [skills]
            }
        )
        volunteer_skill = Volunteer_User_Add_Ons.objects.get(skills=skill)
        self.assertEquals(volunteer_skill.user.username, "volunteer_admin")
        self.assertEquals(response.status_code, 200)

    def test_volunteer_create_interests(self):
        """
        The volunteer can add a list of interests in the volunteer form
        :return:
        """

        interest = Interest(name='Education')
        interest.save()
        import json
        interests = json.dumps([{"label": interest.name, "value": interest.name}])
        user = User.objects.get(username="volunteer_admin")
        volunteer = Volunteer_User_Add_Ons.objects.get(user=user)
        response = self.client.post(
            reverse('createSkill', kwargs={'volunteer_id': volunteer.id}),
            data={
                "interests": [interests]
            }
        )
        volunteer_interest = Volunteer_User_Add_Ons.objects.get(interests=interest)
        self.assertEquals(volunteer_interest.user.username, "volunteer_admin")
        self.assertEquals(response.status_code, 200)

    def test_volunteer_edit_interests(self):
        """
        When a volunteer edits their profile, the volunteer can edit the interests in the system
        :return:
        """
        interest = Interest(name='Software')
        interest.save()
        import json
        interests = json.dumps([{"label": interest.name, "value": interest.name}])
        user = User.objects.get(username="volunteer_admin")
        volunteer = Volunteer_User_Add_Ons.objects.get(user=user)
        response = self.client.post(
            reverse('editSkill', kwargs={'volunteer_id': volunteer.id}),
            data={
                "interests": [interests]
            }
        )
        volunteer_interest = Volunteer_User_Add_Ons.objects.get(interests=interest)
        self.assertEquals(volunteer_interest.user.username, "volunteer_admin")
        self.assertEquals(response.status_code, 200)

    def test_volunteer_edit_skills(self):
        """
        When a volunteer edits their profile, the volunteer can edit the skills in the system
        :return:
        """

        skill = Skill(name='numerical')
        skill.save()
        import json
        skills = json.dumps([{"label": skill.name, "value": skill.name}])
        user = User.objects.get(username="volunteer_admin")
        volunteer = Volunteer_User_Add_Ons.objects.get(user=user)
        response = self.client.post(
            reverse('editSkill', kwargs={'volunteer_id': volunteer.id}),
            data={
                "skills": [skills]
            }
        )
        volunteer_skill = Volunteer_User_Add_Ons.objects.get(skills=skill)
        self.assertEquals(volunteer_skill.user.username, "volunteer_admin")
        self.assertEquals(response.status_code, 200)


text:
package io.joynr.messaging.routing;

import java.util.concurrent.ScheduledExecutorService;

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.joynr.accesscontrol.AccessController;
import io.joynr.accesscontrol.HasConsumerPermissionCallback;
import io.joynr.messaging.ConfigurableMessagingSettings;
import io.joynr.messaging.MessagingSkeletonFactory;
import io.joynr.runtime.ClusterControllerRuntimeModule;
import io.joynr.runtime.ShutdownNotifier;
import joynr.ImmutableMessage;

public class CcMessageRouter extends AbstractMessageRouter {
    private static final Logger logger = LoggerFactory.getLogger(CcMessageRouter.class);
    private AccessController accessController;
    private boolean enableAccessControl;

    @Inject
    @Singleton
    // CHECKSTYLE IGNORE ParameterNumber FOR NEXT 8 LINES
    public CcMessageRouter(RoutingTable routingTable,
                           @Named(SCHEDULEDTHREADPOOL) ScheduledExecutorService scheduler,
                           @Named(ConfigurableMessagingSettings.PROPERTY_SEND_MSG_RETRY_INTERVAL_MS) long sendMsgRetryIntervalMs,
                           @Named(ConfigurableMessagingSettings.PROPERTY_MESSAGING_MAXIMUM_PARALLEL_SENDS) int maxParallelSends,
                           @Named(ConfigurableMessagingSettings.PROPERTY_ROUTING_TABLE_GRACE_PERIOD_MS) long routingTableGracePeriodMs,
                           @Named(ConfigurableMessagingSettings.PROPERTY_ROUTING_TABLE_CLEANUP_INTERVAL_MS) long routingTableCleanupIntervalMs,
                           MessagingStubFactory messagingStubFactory,
                           MessagingSkeletonFactory messagingSkeletonFactory,
                           AddressManager addressManager,
                           MulticastReceiverRegistry multicastReceiverRegistry,
                           AccessController accessController,
                           @Named(ClusterControllerRuntimeModule.PROPERTY_ACCESSCONTROL_ENABLE) boolean enableAccessControl,
                           BoundedDelayQueue<DelayableImmutableMessage> messageQueue,
                           ShutdownNotifier shutdownNotifier) {
        super(routingTable,
              scheduler,
              sendMsgRetryIntervalMs,
              maxParallelSends,
              routingTableGracePeriodMs,
              routingTableCleanupIntervalMs,
              messagingStubFactory,
              messagingSkeletonFactory,
              addressManager,
              multicastReceiverRegistry,
              messageQueue,
              shutdownNotifier);

        this.accessController = accessController;
        this.enableAccessControl = enableAccessControl;
    }

    @Override
    public void route(final ImmutableMessage message) {
        if (enableAccessControl) {
            accessController.hasConsumerPermission(message, new HasConsumerPermissionCallback() {
                @Override
                public void hasConsumerPermission(boolean hasPermission) {
                    if (hasPermission) {
                        CcMessageRouter.super.route(message);
                    } else {
                        logger.warn("Dropping message {} from {} to {} because of insufficient access rights",
                                    message.getId(),
                                    message.getSender(),
                                    message.getRecipient());
                    }
                }
            });
        } else {
            super.route(message);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <artifactId>commons-parent</artifactId>
        <groupId>com.github.tomschi</groupId>
        <version>0.2.2-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>commons-slf4j</artifactId>
    <name>commons-slf4j</name>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>uk.org.lidalia</groupId>
            <artifactId>slf4j-test</artifactId>
            <version>1.2.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>


text:
// Copyright 2014 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.devtools.build.lib.analysis;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.buildeventstream.BuildEventContext;
import com.google.devtools.build.lib.buildeventstream.BuildEventIdUtil;
import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos;
import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.BuildEventId;
import com.google.devtools.build.lib.buildeventstream.BuildEventWithOrderConstraint;
import com.google.devtools.build.lib.buildeventstream.GenericBuildEvent;
import com.google.devtools.build.lib.events.ExtendedEventHandler;
import java.util.Collection;
import java.util.Map;

/** This event is fired once build info data is available. */
public final class BuildInfoEvent
    implements BuildEventWithOrderConstraint, ExtendedEventHandler.ProgressLike {
  private final Map<String, String> buildInfoMap;

  /**
   * Construct the event from a map.
   */
  public BuildInfoEvent(Map<String, String> buildInfo) {
    buildInfoMap = ImmutableMap.copyOf(buildInfo);
  }

  /**
   * Return immutable map populated with build info key/value pairs.
   */
  public Map<String, String> getBuildInfoMap() {
    return buildInfoMap;
  }

  @Override
  public BuildEventId getEventId() {
    return BuildEventIdUtil.workspaceStatusId();
  }

  @Override
  public Collection<BuildEventId> getChildrenEvents() {
    return ImmutableList.of();
  }

  @Override
  public Collection<BuildEventId> postedAfter() {
    return ImmutableList.of(BuildEventIdUtil.buildStartedId());
  }

  @Override
  public BuildEventStreamProtos.BuildEvent asStreamProto(BuildEventContext converters) {
    BuildEventStreamProtos.WorkspaceStatus.Builder status =
        BuildEventStreamProtos.WorkspaceStatus.newBuilder();
    for (Map.Entry<String, String> entry : getBuildInfoMap().entrySet()) {
      status.addItem(
          BuildEventStreamProtos.WorkspaceStatus.Item.newBuilder()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build());
    }
    return GenericBuildEvent.protoChaining(this).setWorkspaceStatus(status.build()).build();
  }
}


text:
package mailgun

import (
	"encoding/json"
	"net/url"
	"strconv"
	"time"
)

type Complaint struct {
	Count     int    `json:"count"`
	CreatedAt string `json:"created_at"`
	Address   string `json:"address"`
}

func (c *Complaint) Time() time.Time {
	t, _ := time.Parse(time.RFC1123, c.CreatedAt)
	return t
}

func (c *Client) Complaints(domain string, limit, skip int) (total int, res []Complaint, err error) {
	v := url.Values{}
	v.Set("limit", strconv.Itoa(limit))
	v.Set("skip", strconv.Itoa(skip))
	body, err := c.api("GET", "/"+domain+"/complaints", v)
	if err != nil {
		return
	}

	var j struct {
		Total int         `json:"total_count"`
		Items []Complaint `json:"items"`
	}

	err = json.Unmarshal(body, &j)
	if err != nil {
		return
	}
	total, res = j.Total, j.Items
	return
}


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

Option Strict On
Option Explicit On

Namespace NEvoWeb.Modules.NB_Store

    Partial Public Class AdminReportEdit

        '''
        '''cmdUpdate control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents cmdUpdate As Global.System.Web.UI.WebControls.LinkButton

        '''
        '''cmdCancel control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents cmdCancel As Global.System.Web.UI.WebControls.LinkButton

        '''
        '''cmdDelete control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents cmdDelete As Global.System.Web.UI.WebControls.LinkButton

        '''
        '''plReportName control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plReportName As Global.System.Web.UI.UserControl

        '''
        '''txtReportName control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents txtReportName As Global.System.Web.UI.WebControls.TextBox

        '''
        '''plReportRef control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plReportRef As Global.System.Web.UI.UserControl

        '''
        '''txtReportRef control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents txtReportRef As Global.System.Web.UI.WebControls.TextBox

        '''
        '''cmdAddParam control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents cmdAddParam As Global.System.Web.UI.WebControls.LinkButton

        '''
        '''txtAddParams control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents txtAddParams As Global.System.Web.UI.WebControls.TextBox

        '''
        '''Label1 control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents Label1 As Global.System.Web.UI.WebControls.Label

        '''
        '''dgParam control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents dgParam As Global.System.Web.UI.WebControls.DataGrid

        '''
        '''plSQLText control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plSQLText As Global.System.Web.UI.UserControl

        '''
        '''txtSQLText control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents txtSQLText As Global.System.Web.UI.WebControls.TextBox

        '''
        '''plSchedulerFlag control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plSchedulerFlag As Global.System.Web.UI.UserControl

        '''
        '''chkSchedulerFlag control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents chkSchedulerFlag As Global.System.Web.UI.WebControls.CheckBox

        '''
        '''plSchStartHour control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plSchStartHour As Global.System.Web.UI.UserControl

        '''
        '''ddlSchStartHour control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents ddlSchStartHour As Global.System.Web.UI.WebControls.DropDownList

        '''
        '''plSchStartMins control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plSchStartMins As Global.System.Web.UI.UserControl

        '''
        '''ddlSchStartMins control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents ddlSchStartMins As Global.System.Web.UI.WebControls.DropDownList

        '''
        '''plSchReRunMins control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plSchReRunMins As Global.System.Web.UI.UserControl

        '''
        '''ddlSchReRunMins control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents ddlSchReRunMins As Global.System.Web.UI.WebControls.DropDownList

        '''
        '''plEmailResults control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plEmailResults As Global.System.Web.UI.UserControl

        '''
        '''chkEmailResults control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents chkEmailResults As Global.System.Web.UI.WebControls.CheckBox

        '''
        '''plEmailFrom control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plEmailFrom As Global.System.Web.UI.UserControl

        '''
        '''txtEmailFrom control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents txtEmailFrom As Global.System.Web.UI.WebControls.TextBox

        '''
        '''plEmailTo control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plEmailTo As Global.System.Web.UI.UserControl

        '''
        '''txtEmailTo control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents txtEmailTo As Global.System.Web.UI.WebControls.TextBox

        '''
        '''plReportTitle control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plReportTitle As Global.System.Web.UI.UserControl

        '''
        '''txtReportTitle control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents txtReportTitle As Global.System.Web.UI.WebControls.TextBox

        '''
        '''plAllowExport control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plAllowExport As Global.System.Web.UI.UserControl

        '''
        '''chkAllowExport control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents chkAllowExport As Global.System.Web.UI.WebControls.CheckBox

        '''
        '''plAllowDisplay control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plAllowDisplay As Global.System.Web.UI.UserControl

        '''
        '''chkAllowDisplay control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents chkAllowDisplay As Global.System.Web.UI.WebControls.CheckBox

        '''
        '''plDisplayInLine control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plDisplayInLine As Global.System.Web.UI.UserControl

        '''
        '''chkDisplayInLine control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents chkDisplayInLine As Global.System.Web.UI.WebControls.CheckBox

        '''
        '''plShowSQL control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents plShowSQL As Global.System.Web.UI.UserControl

        '''
        '''chkShowSQL control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents chkShowSQL As Global.System.Web.UI.WebControls.CheckBox

        '''
        '''txtFieldDelimeter control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents txtFieldDelimeter As Global.System.Web.UI.WebControls.TextBox

        '''
        '''lblFieldDelimeter control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents lblFieldDelimeter As Global.System.Web.UI.WebControls.Label

        '''
        '''txtFieldQualifier control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents txtFieldQualifier As Global.System.Web.UI.WebControls.TextBox

        '''
        '''lblFieldQualifier control.
        '''
        '''<remarks>
        '''Auto-generated field.
        '''To modify move field declaration from designer file to code-behind file.
        '''</remarks>
        Protected WithEvents lblFieldQualifier As Global.System.Web.UI.WebControls.Label
    End Class
End Namespace


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Ukr. bot. Zh. 60(4): 431 (2003)

#### Original name
Xanthoria hermonii S.Y. Kondr.

### Remarks
null


text:
package com.example.a64.listviewapplication;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;

/**
 * Created by 64 on 19/11/2016.
 */

public class ListaActividad extends ListActivity {
    private String [] ciudades = {"Bogotá", "Cali", "Medellin", "Pasto"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, ciudades);
        setListAdapter(arrayAdapter);
    }
}


text:
(function( $ ){
	var methods = {
		init : function( props ) {
			var options = $.extend({
				offset: 0,
				move: function(elem, x, y, newtouch){ }
				}, props || {});

			return this.each(function(){

				var doc = $(document);
				var handle = $(this);
				//var top = handle.find(".top");

				var newTouch = true;

				handle.on("mousedown touchstart", function(e) {

					e.preventDefault();

					// try to avoid having to calculate the size and offset of the turnable each move event
					var offset = handle.offset();
					/*var center = { x: top.width() / 2, y: top.height() / 2 };
					var origin = top.css("transform-origin");
					if (origin) {
						var sp = origin.split(" ");
						center.x = parseInt(sp[0]);
						center.y = parseInt(sp[1]);
					}	*/

					doc.on("mousemove.rem touchmove.rem", function(e) {

						e = (e.originalEvent.touches) ? e.originalEvent.touches[0] : e;

						var offset = handle.parent().offset();

						var dx = e.pageX - offset.left;
						var dy = e.pageY - offset.top;

						//trace("dx/dy: " + dx + " " + dy);

						var p = options.move(handle, dx, dy, newTouch);
						//trace("p: " + p.x + " " + p.y);
						if (p.x != undefined) handle.css("left", p.x + "px");
						if (p.y != undefined) handle.css("top", p.y + "px");

						/*var deg = Math.atan2(dy, dx) * 180 / Math.PI;
						deg = (deg + 360) % 360;
						var userdeg = options.turn(handle, deg, newTouch);
						if (userdeg != undefined) {
							setRotation(top, userdeg + options.offset); // XXX: not portable..
						}*/

						newTouch = false;
					});

					doc.on("mouseup.rem touchend.rem", function(e) {
						handle.off(".rem");
						doc.off(".rem");
						newTouch = true;
					});
				});

			});
		},
		destroy : function( ) {
			return this.each(function(){
			});
		}

	};

	$.fn.draggable = function( method ) {

		if ( methods[method] ) {
			return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
		} else if ( typeof method === 'object' || ! method ) {
			return methods.init.apply( this, arguments );
		} else {
			$.error( 'Method ' +  method + ' does not exist on jQuery.draggable' );
		}

	};

})( jQuery );


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\widgets\Pjax;
use common\models\Services;
use common\models\Currency;
use common\models\Contacts;
use common\models\Debtor;
use common\models\Appointment;
use common\models\PortBreakTimings;
use yii\helpers\ArrayHelper;
use yii\db\Expression;
use common\components\AppointmentWidget;
use common\models\UploadFile;

/* @var $this yii\web\View */
/* @var $model common\models\PortCallData */
$stat = $_GET['stat'];
$this->title = 'Update Port Call Data: ';
$this->params['breadcrumbs'][] = ['label' => 'Port Call Datas', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';
?>

<?= Html::encode($this->title) . ' # ' . $model->appointment->appointment_no . '' ?>

                                                –
                                                +

                                                ×

                                <?= AppointmentWidget::widget(['id' => $model_appointment->id]) ?>

                                        <?php //if (Yii::$app->session->hasFlash('error')): ?>
                                        <?= Yii::$app->session->getFlash('porterror'); ?>
                                        <?php // endif; ?>

                                        <?= Html::beginForm(['port-call-data/reports'], 'post', ['target' => 'print_popup', 'onSubmit' => "window.open('about:blank','print_popup','width=1000,height=500');"]) ?>
                                        <input type="hidden" name="app_id" value="<?= $model_appointment->id ?>">
                                        <input type="checkbox" id="queue-order" name="check" value="1" checked="checked" uncheckValue="0">
                                        <?= Html::submitButton('SOF Report', ['class' => 'btn btn-secondary btn-icon btn-icon-standalone']) ?>
                                        <?= Html::endForm() ?>

                                <?php
                                //echo Html::a('SOF Report', ['port-call-data/reports'], ['class' => 'btn btn-secondary btn-icon btn-icon-standalone', 'onclick' => "window.open('reports?id=$model_appointment->id', 'newwindow', 'width=750, height=800');return false;"]);
                                echo Html::a('Sailing Report', ['port-call-data/sailing'], ['class' => 'btn btn-secondary btn-icon btn-icon-standalone', 'onclick' => "window.open('sailing?id=$model_appointment->id', 'newwindow', 'width=750, height=500');return false;"]);
                                echo Html::a('Arrival Report', ['port-call-data/arrival'], ['class' => 'btn btn-secondary btn-icon btn-icon-standalone', 'onclick' => "window.open('arrival?id=$model_appointment->id', 'newwindow', 'width=750, height=500');return false;"]);
                                ?>

                                                <?php
                                                echo Html::a('Appointment', ['appointment/update', 'id' => $model_appointment->id]);
                                                ?>

                                                <?php
                                                echo Html::a('Estimated Proforma', ['estimated-proforma/add', 'id' => $model_appointment->id]);
                                                ?>

                                                <?php
                                                echo Html::a('Port call Data', ['port-call-data/update', 'id' => $model_appointment->id]);
                                                ?>

                                                <?php
                                                echo Html::a('Close Estimate', ['close-estimate/add', 'id' => $model_appointment->id]);
                                                ?>

                                <?php //Html::a(' Manage Port Call Data', ['index'], ['class' => 'btn btn-warning  btn-icon btn-icon-standalone'])  ?>

                                        <li class="<?= $stat == 1 || $stat == NULL ? 'active' : '' ?>">

                                                        Port Call Data

                                        <li class="<?= $stat == 2 ? 'active' : '' ?>">

                                                        Port Call Data Draft-Rob

                                        <li class="<?= $stat == 3 ? 'active' : '' ?>">

                                                        Cargo Details

                                        <div class="tab-pane <?= $stat == 1 || $stat == NULL ? 'active' : '' ?>" id="port-data">

                                                                <?=
                                                                $this->render('_form', [
                                                                    'model' => $model,
                                                                    'model_add' => $model_add,
                                                                    'model_imigration' => $model_imigration,
                                                                    'model_appointment' => $model_appointment,
                                                                    'model_additional' => $model_additional,
                                                                ])
                                                                ?>

                                        <div class="tab-pane <?= $stat == 2 ? 'active' : '' ?>" id="port-draft">

                                                                <?=
                                                                $this->render('_form_draft_rob', [
                                                                    'model_draft' => $model_draft,
                                                                    'model_rob' => $model_rob,
                                                                    'model_appointment' => $model_appointment,
                                                                    'model' => $model,
                                                                ])
                                                                ?>

                                        <div class="tab-pane <?= $stat == 3 ? 'active' : '' ?>" id="port-rob">

                                                                <?=
                                                                $this->render('_form_port_break', [
                                                                    'model_appointment' => $model_appointment,
                                                                    'model_port_break' => $model_port_break,
                                                                    'model_port_cargo_details' => $model_port_cargo_details,
                                                                    'model_port_stoppages' => $model_port_stoppages,
                                                                ])
                                                                ?>

                                                <?php // Yii::$app->UploadFile->ListFile($model_appointment->id, Yii::$app->params['datPath']); ?>
                                                <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data'], 'action' => Yii::$app->homeUrl . 'appointment/port-call-data/uploads', 'method' => 'post']) ?>
                                                <?php
                                                $model_upload->appointment_id = $model_appointment->id;
                                                $model_upload->type = Yii::$app->params['datPath'];
                                                ?>
                                                <?php //$form->field($model_upload, 'filee[]')->fileInput(['multiple' => true]) ?>
                                                <?= $form->field($model_upload, 'filee[]')->fileInput(['multiple' => true]) ?>
                                                <?= $form->field($model_upload, 'appointment_id')->hiddenInput()->label(false) ?>
                                                <?= $form->field($model_upload, 'type')->hiddenInput()->label(false) ?>
                                                <?= Html::submitButton('Upload', ['class' => 'btn btn-success']) ?>

                                                <?php ActiveForm::end() ?>

Uploaded Files

                                                        <?php
                                                        if (!empty(Yii::$app->UploadFile->ListFile($model_appointment->id, Yii::$app->params['datPath']))) {
                                                                $string = Yii::$app->UploadFile->ListFile($model_appointment->id, Yii::$app->params['datPath']);
                                                                $uploads = explode("|", $string);
                                                                array_pop($uploads);
                                                                foreach ($uploads as $upload) {
                                                                        ?>
                                                                        <?= $upload ?>
                                                                        <?php
                                                                }
                                                        }
                                                        ?>

                                <?php
                                echo Html::a(' Portcall Data Completed & Proceed to Close Estimate', ['port-call-data/portcall-complete', 'id' => $model_appointment->id], ['class' => 'btn btn-secondary']);
                                ?>


text:
Create new task

        <form class="" th:object="${task}" th:action="@{/tasks/create}" method="post" role="form">

                Select project
                <select class="form-control" name="project_id">
                    <option value="-"> - Select - </option>
                    <option th:each="project : ${projects}" th:value="${project.id}" th:text="${project.name}"></option>
                </select>

                Summary *
                <input type="text" class="form-control" th:field="*{summary}" />
                Summary errors

                Description *
                <textarea rows="3" class="form-control" th:field="*{description}" />
                Description errors

                Stasus
                <select class="form-control" th:field="*{status}">
                    <option value="-"> - Select - </option>
                    <option value="In progress">In progress</option>
                    <option value="Not started">Not started</option>
                    <option value="Completed">Completed</option>
                </select>

            <button type="submit" id="submit" class="btn btn-primary pull-left">Submit</button>
        </form>


text:
@implementation CommonMarkProxyObject
+ (instancetype)CommonMark____instantiate
{
	return	[super new];
}
@end


text:
/*
 * Created on 24-Mar-2005
 */
package com.foc.gui.table.cellControler.renderer;

import java.awt.*;

import java.util.*;
import javax.swing.*;

import com.foc.Globals;
import com.foc.desc.field.FField;
import com.foc.desc.field.FMultipleChoiceField;
import com.foc.desc.field.FMultipleChoiceItem;
import com.foc.gui.DisplayManager;
import com.foc.gui.table.FAbstractTableModel;
import com.foc.property.FProperty;

/**
 * @author 01Barmaja
 */
@SuppressWarnings("serial")
public class FComboBoxRenderer extends FDefaultCellRenderer{

  private FGComboBoxInTable box = null;
  private HashMap map = null;

  public void dispose(){
  	if(box != null){
  		box.dispose();
  	}
    box = null;
    map = null;
  }

  public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    JComponent comp = null;
    FAbstractTableModel model = (FAbstractTableModel) table.getModel();
    int modelCol = model.getTableView().getVisibleColumnIndex(column);
    if(model.isCellEditable(row, modelCol)){
      if(map == null){
        map = new HashMap();
      }
      if(box == null){
        box = new FGComboBoxInTable(table);
        //box.setBorder(null);
        /*
        ComboBoxUI ui = (ComboBoxUI)box.getUI();
        ui.
        */
        //box.setUI(new javax.swing.plaf.metal.MetalComboBoxUI());

        //javax.swing.plaf.metal.MetalLookAndFeel metal = new javax.swing.plaf.metal.MetalLookAndFeel();
        //metal.getC
        //UIManager.getLookAndFeel(new com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel());
        //javax.swing.plaf.metal.MetalLookAndFeel
        //box.setUI()
      }
      if(map.get(value) == null){
        map.put(value, value);
        box.addItem(value);
      }
      box.setSelectedItem(value);
      comp = box;
    }else{
      comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);

      FProperty prop  = model.getFProperty(row, modelCol);
      if(prop != null){
	      FField field = prop.getFocField();
	      if(field != null && field instanceof FMultipleChoiceField){
	      	FMultipleChoiceField multiFld = (FMultipleChoiceField) field;
	      	FMultipleChoiceItem item = multiFld.getChoiceItemForKey(prop.getInteger());
	      	if(item != null && item.getImageIcon() != null){
	      		FComboBoxRenderer comboRenderer = (FComboBoxRenderer) comp;
	      		comboRenderer.setIcon(item.getImageIcon());
	      	}
	      }
      }
    }

    /*
    if(isSelected){
      comp.setBackground(table.getSelectionBackground());
    }else{
      comp.setBackground(table.getBackground());
    }
    */
    setCellColor(comp, table,value,isSelected,hasFocus,row,column);
    if(Globals.getDisplayManager().getLookAndFeel() == DisplayManager.LOOK_AND_FEEL_NIMBUS){
    	//Otherwize we get a white uncolored component
    	comp.setOpaque(true);
    }
    return comp;
  }
}


text:
*Read this in other languages:[Korean](translations/grin4bitcoiners_KR.md)

## Privacy and Fungibility

There are 3 main properties of Grin transactions that make them private:

1. There are no addresses.
1. There are no amounts.
1. 2 transactions, one spending the other, can be merged in a block to form only one, removing all intermediary information.

The 2 first properties mean that all transactions are indistinguishable from one another. Unless you directly participated in the transaction, all inputs and outputs look like random pieces of data (in lingo, they're all random curve points).

Moreover, there are no more transactions in a block. A Grin block looks just like one giant transaction and all original association between inputs and outputs is lost.

## Scalability

As explained in the previous section, thanks to the Mimblewimble transaction and block format we can merge transactions when an output is directly spent by the input of another. It's as if when Alice gives money to Bob, and then Bob gives it all to Carol, Bob was never involved and his transaction is actually never even seen on the blockchain.

Pushing that further, between blocks, most outputs end up being spent sooner or later by another input. So *all spent outputs can be safely removed*. And the whole blockchain can be stored, downloaded and fully verified in just a few gigabytes or less (assuming a number of transactions similar to bitcoin).

This means that the Grin blockchain scales with the number of users (unspent outputs), not the number of transactions. At the moment, there is one caveat to that: a small piece of data (called a *kernel*, about 100 bytes) needs to stay around for each transaction. But we're working on optimizing that as well.

## Scripting

Maybe you've heard that Mimblewimble doesn't support scripts. And in some way, that's true. But thanks to cryptographic trickery, many contracts that in Bitcoin would require a script can be achieved with Grin using properties of Elliptic Curve Cryptography. So far, we know how to do:

* Multi-signature transactions.
* Atomic swaps.
* Time-locked transactions and outputs.
* Lightning Network

## Emission Rate

Bitcoin's 10 minute block time has its initial 50 btc reward cut in half every 4 years until there are 21 million bitcoin in circulation. Grin's emission rate is linear, meaning it never drops. The block reward is currently set at 60 grin with a block goal of 60 seconds. This still works because 1) dilution trends toward zero and 2) a non-negligible amount of coins gets lost or destroyed every year.

## FAQ

### Wait, what!? No address?

Nope, no address. All outputs in Grin are unique and have no common data with any previous output. Instead of relying on a known address to send money, transactions have to be built interactively, with two (or more) wallets exchanging data with one another. This interaction **does not require both parties to be online at the same time**. Practically speaking, there are many ways for two programs to interact privately and securely. This interaction could even take place over email or Signal (or carrier pigeons).

### If transaction information gets removed, can I just cheat and create money?

No, and this is where Mimblewimble and Grin shine. Confidential transactions are a form of [homomorphic encryption](https://en.wikipedia.org/wiki/Homomorphic_encryption). Without revealing any amount, Grin can verify that the sum of all transaction inputs equal the sum of transaction outputs, plus the fee. Going even further, comparing the sum of all money created by mining with the total sum of money that's being held, Grin nodes can check the correctness of the total money supply.

### If I listen to transaction relay, can't I just figure out who they belong to before being cut-through?

You can figure out which outputs are being spent by which transaction, but the trail of data stops here. All inputs and outputs look like random pieces of data, so you can't tell if the money was transferred, still belongs to the same person, which output is the actual transfer and which is the change, etc. Grin transactions are built with *no identifiable piece of information*.

In addition, Grin leverages [Dandelion relay](dandelion/dandelion.md), which provides additional anonymity as to which IP or client the transaction originated from, and allows for transactions to be aggregated.

### What about the quantum computaggedon?

In every Grin output, we also include a bit of hashed data, which is quantum safe. If quantum computing was to become a reality, we can safely introduce additional verification that would protect existing coins from being hacked.

### How does all this magic work?

See our [technical introduction](intro.md) to get started.


text:
using namespace std;

namespace ElectionSystem
{
	ElectoralDistrict::ElectoralDistrict(char* name, int votersCount, int politicalPartiesCount, PoliticalParty** politicalParties)
	{
		this->SetName(name);
		this->SetVotersCount(votersCount);
		this->SetPoliticalPartiesCount(politicalPartiesCount);
		this->SetPoliticalParties(politicalParties);
	}

	ElectoralDistrict::~ElectoralDistrict()
	{
		delete [] this->name;
		delete [] this->politicalParties;
	}

	void ElectoralDistrict::SetName(char* name)
	{
		if (name == NULL)
		{
			throw "Electoral district name cannot be null!";
		}

		int nameLength = strlen(name);
		if (nameLength < MIN_ELECTORAL_DISTRICT_NAME_LENGTH || nameLength > MAX_ELECTORAL_DISTRICT_NAME_LENGTH)
		{
			char* message = new char[80];
			sprintf(
				message,
				"Electoral district name must be between %d and %d characters long!",
				MIN_ELECTORAL_DISTRICT_NAME_LENGTH,
				MAX_ELECTORAL_DISTRICT_NAME_LENGTH);

			throw message;
		}

		this->name = name;
	}

	char* ElectoralDistrict::GetName()
	{
		return this->name;
	}

	void ElectoralDistrict::SetVotersCount(int votersCount)
	{
		if (votersCount < 0)
		{
			throw "Electoral district voters count cannot be a negative number!";
		}

		this->votersCount = votersCount;
	}

	int ElectoralDistrict::GetVotersCount()
	{
		return this->votersCount;
	}

	void ElectoralDistrict::SetPoliticalPartiesCount(int politicalPartiesCount)
	{
		if (politicalPartiesCount < 0)
		{
			throw "Electoral district political parties count cannot be a negative number!";
		}

		this->politicalPartiesCount = politicalPartiesCount;
	}

	int ElectoralDistrict::GetPoliticalPartiesCount()
	{
		return this->politicalPartiesCount;
	}

	void ElectoralDistrict::SetPoliticalParties(PoliticalParty** politicalParties)
	{
		if (politicalParties == NULL)
		{
			throw "Political parties cannot be null!";
		}

		this->politicalParties = politicalParties;
	}

	PoliticalParty** ElectoralDistrict::GetPoliticalParties()
	{
		return this->politicalParties;
	}

	PoliticalParty* ElectoralDistrict::GetWinnerPoliticalParty()
	{
		int maxVotes = INT_MIN;
		PoliticalParty* maxVotesPoliticalParty;
		bool duplicatedWinner = false;
		for (int i = 0; i < this->politicalPartiesCount; i++)
		{
			if (this->politicalParties[i]->GetVotesCount() > maxVotes)
			{
				maxVotes = this->politicalParties[i]->GetVotesCount();
				maxVotesPoliticalParty = this->politicalParties[i];
				duplicatedWinner = false;
			}
			else if (this->politicalParties[i]->GetVotesCount() == maxVotes)
			{
				duplicatedWinner = true;
			}
		}

		if (duplicatedWinner)
		{
			return NULL;
		}
		else
		{
			return maxVotesPoliticalParty;
		}
	}

	ostream& operator << (ostream& output, const ElectoralDistrict& district)
	{
		output << "Electoral district: " << district.name << endl;
		output << "Voters count: " << district.votersCount << endl;

		output << "Political parties: ";
		if (district.politicalPartiesCount > 0)
		{
			for (int i = 0; i < district.politicalPartiesCount - 1; i++)
			{
				output << *district.politicalParties[i] << ", ";
			}

			output << *district.politicalParties[district.politicalPartiesCount - 1] << endl;
		}
		else
		{
			output << "no political parties" << endl;
		}

		return output;
	}
}


text:
package io.insideout.stanbol.enhancer.nlp.freeling.impl;

import java.io.File;
import java.lang.reflect.Field;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Collection;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Utility used to ensure the Freeling native library is loaded.
 * @author Rupert Westenthaler
 *
 */
public class NativeLibsUtil {

    private static final Logger log = LoggerFactory.getLogger(NativeLibsUtil.class);

    /**
     * Ensures that the parsed native library is loaded to the JVM.

     * This first
     * checks of the parsed libName is (1) a file (2) a File accessible via
     * the classpath (Resources in JARs do not work!). If (1) and (2) do fail
     * it assumes that the parsed lib is in a "lib directory" of the system.
     *

     * As next step is is checked if the resloved lib is already loaded in the
     * System. This is done by accessing the values of the private field
     * 'loadedLibraryNames' in the {@link ClassLoader} (NOTE that
     * this will likely fail if a {@link SecurityManager} is in place).
     *

     * If neither the resolved lib (case (1) or (2)) nor the parsed lib is
     * present than the native lib is loaded. In case of (1) or (2)
     * {@link System#load(String)} will be used. In case of (3)
     * {@link System#loadLibrary(String)} is used. In the later case a
     * {@link UnsatisfiedLinkError} will be thrown if the parsed lib string is
     * not a valid path relative to one of the systems lib directories.
     *
     * @param libName the native lib to check/load
     */
    @SuppressWarnings("unchecked")
    public static void ensureNativeLib(String libName){
        Field nativeLibs;
        ClassLoader cl = NativeLibsUtil.class.getClassLoader();
        try {
            nativeLibs = ClassLoader.class.getDeclaredField("loadedLibraryNames");
            nativeLibs.setAccessible(true);
        } catch (NoSuchFieldException e) {
            throw new IllegalStateException("Unable to check native libs because "
                + "Field 'loadedLibraryNames' is missing in Classloader impl "
                + cl.getClass()+"!",e);
        }
        String nativLibPath = getNativeLibPath(libName);
        Collection<String> libraries;
        try {
            libraries = (Collection<String>) nativeLibs.get(cl);
        } catch (IllegalAccessException e) {
            throw new IllegalStateException("Unable to check native libs because "
                    + "Field 'loadedLibraryNames' is not accessible for classloader impl "
                    + cl.getClass()+"!",e);
        }
        cl.getResource(libName);
        if(!libraries.contains(nativLibPath) && !libraries.contains(libName)){
            try {
                System.load(nativLibPath);
                log.info(" ... loaded native lib "+nativLibPath);
            } catch (UnsatisfiedLinkError e) {
                log.warn("Unable to load '{}' to JVM. (will retry with LoadLibrary)",e);
                System.loadLibrary(libName);
                log.info(" ... loaded native lib "+nativLibPath);
            }
        }
    }

    private static String getNativeLibPath(String libName){
        File nativeLibFile = new File(libName);
        if(!nativeLibFile.isFile()){
            URL libUrl = AnalyzerFactory.class.getClassLoader().getResource(libName);
            if(libUrl != null){
                try {
                    nativeLibFile = new File(libUrl.toURI());
                  } catch(URISyntaxException e) {
                    nativeLibFile = new File(libUrl.getPath());
                  }
            }
            if(libUrl == null || !nativeLibFile.isFile()){
                log.info(" The parsed Freeling native library '" + libName
                    + "' does not exist (not a file and not in classpath)."
                    + " It might still by loaded if placed in a lib directory"
                    + "of the system.");
                return libName; //
            }
        }
        return nativeLibFile.getAbsolutePath();
    }
}


text:
import * as React from 'react';
import Avatar from '@mui/material/Avatar';
import Button from '@mui/material/Button';
import CssBaseline from '@mui/material/CssBaseline';
import TextField from '@mui/material/TextField';
import FormControlLabel from '@mui/material/FormControlLabel';
import Checkbox from '@mui/material/Checkbox';
import Link from '@mui/material/Link';
import Grid from '@mui/material/Grid';
import Box from '@mui/material/Box';
import LockOutlinedIcon from '@mui/icons-material/LockOutlined';
import Typography from '@mui/material/Typography';
import Container from '@mui/material/Container';
import { createTheme, ThemeProvider } from '@mui/material/styles';

function Copyright(props) {
  return (
    <Typography variant="body2" color="text.secondary" align="center" {...props}>
      {'Copyright © '}
      <Link color="inherit" href="https://mui.com/">
        Your Website
      </Link>{' '}
      {new Date().getFullYear()}
      {'.'}
    </Typography>
  );
}

const theme = createTheme();

export default function SignIn() {
  const handleSubmit = (event) => {
    event.preventDefault();
    const data = new FormData(event.currentTarget);
    // eslint-disable-next-line no-console
    console.log({
      email: data.get('email'),
      password: data.get('password'),
    });
  };

  return (
    <ThemeProvider theme={theme}>
      <Container component="main" maxWidth="xs">
        <CssBaseline />
        <Box
          sx={{
            marginTop: 8,
            display: 'flex',
            flexDirection: 'column',
            alignItems: 'center',
          }}
        >
          <Avatar sx={{ m: 1, bgcolor: 'secondary.main' }}>
            <LockOutlinedIcon />
          </Avatar>
          <Typography component="h1" variant="h5">
            Sign in
          </Typography>
          <Box component="form" onSubmit={handleSubmit} noValidate sx={{ mt: 1 }}>
            <TextField
              margin="normal"
              required
              fullWidth
              id="email"
              label="Email Address"
              name="email"
              autoComplete="email"
              autoFocus
            />
            <TextField
              margin="normal"
              required
              fullWidth
              name="password"
              label="Password"
              type="password"
              id="password"
              autoComplete="current-password"
            />
            <FormControlLabel
              control={<Checkbox value="remember" color="primary" />}
              label="Remember me"
            />
            <Button
              type="submit"
              fullWidth
              variant="contained"
              sx={{ mt: 3, mb: 2 }}
            >
              Sign In
            </Button>
            <Grid container>
              <Grid item xs>
                <Link href="#" variant="body2">
                  Forgot password?
                </Link>
              </Grid>
              <Grid item>
                <Link href="#" variant="body2">
                  {"Don't have an account? Sign Up"}
                </Link>
              </Grid>
            </Grid>
          </Box>
        </Box>
        <Copyright sx={{ mt: 8, mb: 4 }} />
      </Container>
    </ThemeProvider>
  );
}


text:
<!doctype html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Parallel Sand</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

...