text:
// Copyright (c) 2008-2022, Hazelcast, Inc. 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.

// <auto-generated>
//   This code was generated by a tool.
//     Hazelcast Client Protocol Code Generator
//     https://github.com/hazelcast/hazelcast-client-protocol
//   Change to this file will be lost if the code is regenerated.
// </auto-generated>

#pragma warning disable IDE0051 // Remove unused private members
// ReSharper disable UnusedMember.Local
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace

using System;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using Hazelcast.Protocol.BuiltInCodecs;
using Hazelcast.Protocol.CustomCodecs;
using Hazelcast.Core;
using Hazelcast.Messaging;
using Hazelcast.Clustering;
using Hazelcast.Serialization;
using Microsoft.Extensions.Logging;

namespace Hazelcast.Protocol.Codecs
{
    ///
    /// Inserts the specified element into this queue, waiting up to the specified wait time if necessary for space to
    /// become available.
    ///
#if SERVER_CODEC
    internal static class TransactionalQueueOfferServerCodec
#else
    internal static class TransactionalQueueOfferCodec
#endif
    {
        public const int RequestMessageType = 1179904; // 0x120100
        public const int ResponseMessageType = 1179905; // 0x120101
        private const int RequestTxnIdFieldOffset = Messaging.FrameFields.Offset.PartitionId + BytesExtensions.SizeOfInt;
        private const int RequestThreadIdFieldOffset = RequestTxnIdFieldOffset + BytesExtensions.SizeOfGuid;
        private const int RequestTimeoutFieldOffset = RequestThreadIdFieldOffset + BytesExtensions.SizeOfLong;
        private const int RequestInitialFrameSize = RequestTimeoutFieldOffset + BytesExtensions.SizeOfLong;
        private const int ResponseResponseFieldOffset = Messaging.FrameFields.Offset.ResponseBackupAcks + BytesExtensions.SizeOfByte;
        private const int ResponseInitialFrameSize = ResponseResponseFieldOffset + BytesExtensions.SizeOfBool;

#if SERVER_CODEC
        public sealed class RequestParameters
        {

            ///
            /// Name of the Transcational Queue
            ///
            public string Name { get; set; }

            ///
            /// ID of the transaction
            ///
            public Guid TxnId { get; set; }

            ///
            /// The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.
            ///
            public long ThreadId { get; set; }

            ///
            /// The element to add
            ///
            public IData Item { get; set; }

            ///
            /// How long to wait before giving up, in milliseconds
            ///
            public long Timeout { get; set; }
        }
#endif

        public static ClientMessage EncodeRequest(string name, Guid txnId, long threadId, IData item, long timeout)
        {
            var clientMessage = new ClientMessage
            {
                IsRetryable = false,
                OperationName = "TransactionalQueue.Offer"
            };
            var initialFrame = new Frame(new byte[RequestInitialFrameSize], (FrameFlags) ClientMessageFlags.Unfragmented);
            initialFrame.Bytes.WriteIntL(Messaging.FrameFields.Offset.MessageType, RequestMessageType);
            initialFrame.Bytes.WriteIntL(Messaging.FrameFields.Offset.PartitionId, -1);
            initialFrame.Bytes.WriteGuidL(RequestTxnIdFieldOffset, txnId);
            initialFrame.Bytes.WriteLongL(RequestThreadIdFieldOffset, threadId);
            initialFrame.Bytes.WriteLongL(RequestTimeoutFieldOffset, timeout);
            clientMessage.Append(initialFrame);
            StringCodec.Encode(clientMessage, name);
            DataCodec.Encode(clientMessage, item);
            return clientMessage;
        }

#if SERVER_CODEC
        public static RequestParameters DecodeRequest(ClientMessage clientMessage)
        {
            using var iterator = clientMessage.GetEnumerator();
            var request = new RequestParameters();
            var initialFrame = iterator.Take();
            request.TxnId = initialFrame.Bytes.ReadGuidL(RequestTxnIdFieldOffset);
            request.ThreadId = initialFrame.Bytes.ReadLongL(RequestThreadIdFieldOffset);
            request.Timeout = initialFrame.Bytes.ReadLongL(RequestTimeoutFieldOffset);
            request.Name = StringCodec.Decode(iterator);
            request.Item = DataCodec.Decode(iterator);
            return request;
        }
#endif

        public sealed class ResponseParameters
        {

            ///
            /// <tt>true</tt> if successful, or <tt>false</tt> if the specified waiting time elapses before space is available
            ///
            public bool Response { get; set; }
        }

#if SERVER_CODEC
        public static ClientMessage EncodeResponse(bool response)
        {
            var clientMessage = new ClientMessage();
            var initialFrame = new Frame(new byte[ResponseInitialFrameSize], (FrameFlags) ClientMessageFlags.Unfragmented);
            initialFrame.Bytes.WriteIntL(Messaging.FrameFields.Offset.MessageType, ResponseMessageType);
            initialFrame.Bytes.WriteBoolL(ResponseResponseFieldOffset, response);
            clientMessage.Append(initialFrame);
            return clientMessage;
        }
#endif

        public static ResponseParameters DecodeResponse(ClientMessage clientMessage)
        {
            using var iterator = clientMessage.GetEnumerator();
            var response = new ResponseParameters();
            var initialFrame = iterator.Take();
            response.Response = initialFrame.Bytes.ReadBoolL(ResponseResponseFieldOffset);
            return response;
        }

    }
}


text:
package com.github.dexecutor.ignite;

import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Set;

import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteAtomicLong;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.configuration.CollectionConfiguration;

import com.github.dexecutor.core.DexecutorState;
import com.github.dexecutor.core.Phase;
import com.github.dexecutor.core.graph.Dag;
import com.github.dexecutor.core.graph.DefaultDag;
import com.github.dexecutor.core.graph.Node;
import com.github.dexecutor.core.graph.Traversar;
import com.github.dexecutor.core.graph.TraversarAction;
import com.github.dexecutor.core.graph.Validator;
import com.github.dexecutor.core.task.ExecutionResult;
import com.github.dexecutor.core.task.ExecutionResults;
/**
 *
 * @author Nadeem Mohammad
 *
 * @param <T> Type of Node/Task ID
 * @param <R> Type of Node/Task result
 */
public class IgniteDexecutorState<T, R> implements DexecutorState<T, R> {

	private final String CACHE_ID_PHASE;
	private final String CACHE_ID_GRAPH;
	private final String CACHE_ID_NODES_COUNT;
	private final String CACHE_ID_PROCESSED_NODES;
	private final String CACHE_ID_DISCONDINUED_NODES;
	private final String CACHE_ID_ERRORED_NODES;

	private IgniteCache<String, Object> distributedCache;

	private IgniteAtomicLong nodesCount;
	private Collection<Node<T, R>> processedNodes;
	private Collection<Node<T, R>> discontinuedNodes;
	private Collection<ExecutionResult<T, R>> erroredNodes;

	public IgniteDexecutorState(final String cacheName, final Ignite ignite) {
		CACHE_ID_PHASE = cacheName + "-phase";
		CACHE_ID_GRAPH = cacheName + "-graph";
		CACHE_ID_NODES_COUNT = cacheName + "-nodes-count";
		CACHE_ID_PROCESSED_NODES = cacheName + "-processed-nodes";
		CACHE_ID_DISCONDINUED_NODES = cacheName + "-discontinued-nodes";
		CACHE_ID_ERRORED_NODES = cacheName + "-errored-nodes";

		this.distributedCache = ignite.getOrCreateCache(cacheName + "distribute");
		this.distributedCache.put(CACHE_ID_PHASE, Phase.BUILDING);

		this.distributedCache.put(CACHE_ID_GRAPH, new DefaultDag<>());

		this.nodesCount = ignite.atomicLong(
				CACHE_ID_NODES_COUNT, // Atomic long name.
			    0,            // Initial value.
			    true         // Create if it does not exist.
			);

		CollectionConfiguration setCfg = new CollectionConfiguration();

        setCfg.setAtomicityMode(TRANSACTIONAL);
        setCfg.setCacheMode(PARTITIONED);
		this.processedNodes = ignite.queue(
				CACHE_ID_PROCESSED_NODES, // Queue name.
				0,
				setCfg       // Collection configuration.
			);

		this.discontinuedNodes = ignite.queue(
				CACHE_ID_DISCONDINUED_NODES, // Queue name.
				0,
				setCfg       // Collection configuration.
			);

		this.erroredNodes = ignite.queue(
				CACHE_ID_ERRORED_NODES, // Queue name.
				0,
				setCfg       // Collection configuration.
			);

	}

	@SuppressWarnings("unchecked")
	private Dag<T, R> getDag() {
		return (Dag<T, R>) this.distributedCache.get(CACHE_ID_GRAPH);
	}

	@Override
	public void addIndependent(T nodeValue) {
		Dag<T, R> graph = this.getDag();
		graph.addIndependent(nodeValue);
		this.distributedCache.put(CACHE_ID_GRAPH, graph);
	}

	@Override
	public void addDependency(T evalFirstValue, T evalAfterValue) {
		Dag<T, R> graph = this.getDag();
		graph.addDependency(evalFirstValue, evalAfterValue);
		this.distributedCache.put(CACHE_ID_GRAPH, graph);
	}

	@Override
	public void addAsDependentOnAllLeafNodes(T nodeValue) {
		Dag<T, R> dag = this.getDag();
		dag.addAsDependentOnAllLeafNodes(nodeValue);
		this.distributedCache.put(CACHE_ID_GRAPH, dag);

	}

	@Override
	public void addAsDependencyToAllInitialNodes(T nodeValue) {
		Dag<T, R> dag = this.getDag();
		dag.addAsDependencyToAllInitialNodes(nodeValue);
		this.distributedCache.put(CACHE_ID_GRAPH, dag);
	}

	@Override
	public Set<Node<T, R>> getInitialNodes() {
		return this.getDag().getInitialNodes();
	}

	@Override
	public Node<T, R> getGraphNode(T id) {
		return this.getDag().get(id);
	}

	@Override
	public int graphSize() {
		return this.getDag().size();
	}

	@Override
	public Set<Node<T, R>> getNonProcessedRootNodes() {
		return this.getDag().getNonProcessedRootNodes();
	}

	@Override
	public void validate(Validator<T, R> validator) {
		validator.validate(this.getDag());
	}

	@Override
	public void setCurrentPhase(Phase currentPhase) {
		this.distributedCache.put(CACHE_ID_PHASE, currentPhase);
	}

	@Override
	public Phase getCurrentPhase() {
		return (Phase) this.distributedCache.get(CACHE_ID_PHASE);
	}

	@Override
	public int getUnProcessedNodesCount() {
		return (int) this.nodesCount.get();
	}

	@Override
	public void incrementUnProcessedNodesCount() {
		this.nodesCount.incrementAndGet();
	}

	@Override
	public void decrementUnProcessedNodesCount() {
		this.nodesCount.decrementAndGet();
	}

	@Override
	public boolean shouldProcess(Node<T, R> node) {
		return !isAlreadyProcessed(node) && allIncomingNodesProcessed(node);
	}

	private boolean isAlreadyProcessed(final Node<T, R> node) {
		return this.processedNodes.contains(node);
	}

	private boolean allIncomingNodesProcessed(final Node<T, R> node) {
		if (node.getInComingNodes().isEmpty() || areAlreadyProcessed(node.getInComingNodes())) {
			return true;
		}
		return false;
	}

	private boolean areAlreadyProcessed(final Set<Node<T, R>> nodes) {
        return this.processedNodes.containsAll(nodes);
    }

	@Override
	public void markProcessingDone(Node<T, R> node) {
		this.processedNodes.add(node);
	}

	@Override
	public Collection<Node<T, R>> getProcessedNodes() {
		return new ArrayList<>(this.processedNodes);
	}

	@Override
	public boolean isDiscontinuedNodesNotEmpty() {
		return !this.discontinuedNodes.isEmpty();
	}

	@Override
	public Collection<Node<T, R>> getDiscontinuedNodes() {
		return new ArrayList<Node<T, R>>(this.discontinuedNodes);
	}

	@Override
	public void markDiscontinuedNodesProcessed() {
		this.discontinuedNodes.clear();
	}

	@Override
	public void processAfterNoError(Collection<Node<T, R>> nodes) {
		this.discontinuedNodes.addAll(nodes);
	}

	@Override
	public void print(Traversar<T, R> traversar, TraversarAction<T, R> action) {
		traversar.traverse(this.getDag(), action);
	}

	@Override
	public void addErrored(ExecutionResult<T, R> task) {
		this.erroredNodes.add(task);
	}

	@Override
	public void removeErrored(ExecutionResult<T, R> task) {
		this.erroredNodes.remove(task);
	}

	@Override
	public ExecutionResults<T, R> getErrored() {
		ExecutionResults<T, R> result = new ExecutionResults<>();
		for (ExecutionResult<T, R> r : this.erroredNodes) {
			result.add(r);
		}
		return result;
	}

	@Override
	public int erroredCount() {
		return this.erroredNodes.size();
	}

	@Override
	public void forcedStop() {
		// TODO Auto-generated method stub

	}

	@Override
	public void onTerminate() {
		// TODO Auto-generated method stub

	}

	@Override
	public void onRecover() {
		// TODO Auto-generated method stub

	}
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Foundation.Metadata;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using AwfulRedux.Tools.Web;
using AwfulRedux.UI.Models.Threads;
using AwfulRedux.ViewModels;

// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236

namespace AwfulRedux.Controls
{
    public sealed partial class ThreadView : UserControl
    {
        public static ThreadView Instance { get; set; }
        public ThreadView()
        {
            this.InitializeComponent();
            ThreadFullView.NavigationCompleted += WebViewCommands.WebView_OnNavigationCompleted;
            ThreadFullView.ScriptNotify += WebViewCommands.WebViewNotifyCommand.WebView_ScriptNotify;
            if(PageNumberButton2.Flyout != null)
                PageNumberButton2.Flyout.Opened += FlyoutOnOpened;
            Instance = this;
            ViewModel.ShareDevicesViewModel = ShareView.ViewModel;
        }

        private void FlyoutOnOpened(object sender, object o)
        {
            PageNumberTextBox.Focus(FocusState.Programmatic);
        }

        // strongly-typed view models enable x:bind
        public ThreadViewModel ViewModel => this.DataContext as ThreadViewModel;

        public async Task LoadThread(Thread thread, bool fromSuspend = false, bool lastPage = false)
        {
            if (lastPage)
            {
                thread.CurrentPage = thread.TotalPages;
                thread.RepliesSinceLastOpened = 0;
            }
            else if (thread.CurrentPage == 0)
            {
                thread.CurrentPage = 1;
            }
            if (fromSuspend && ViewModel.Selected != null)
            {
                return;
            }
            ViewModel.Selected = thread;
            await ViewModel.LoadThread();
        }

        private async void ScrollToBottom(object sender, RoutedEventArgs e)
        {
            await ThreadFullView.InvokeScriptAsync("ScrollToBottom", null);
        }

        private void PageNumberTextBox_OnTextChanged(object sender, TextChangedEventArgs e)
        {
            int n;
            bool isNumeric = int.TryParse(PageNumberTextBox.Text, out n);
            if (isNumeric)
            {
                ViewModel.PageSelection = PageNumberTextBox.Text;
            }
        }
    }
}


text:
<?php

/** @file
* @brief
*/

include ('../inc/includes.php');

$dropdown = new DevicePci();
include (GLPI_ROOT . "/front/dropdown.common.php");
?>


text:
namespace eopcc {

// For a given kml_file (containing a polygon) and a spacing this
// function generates a PointCloud covering that polygon with spacing meters
// between points
PointCloud GenerateSample(std::string kml_file, double spacing) {
	PolygonExtent poly_extent = ExtentFromKML(kml_file);
	Extent cube_extent = poly_extent.to_extent();

	OGRSpatialReference pj_utm, pj_latlong;

	// Gets the best zone for the corner of the extent
	int zone = GetUTMZone(cube_extent.min_y, cube_extent.min_x);

	pj_latlong.importFromProj4("+proj=latlong +datum=WGS84");
	pj_utm.importFromProj4("+proj=utm +datum=WGS84");

	pj_utm.SetUTM(zone, IsNorthernHemisphere(cube_extent.min_y));

	OGRCoordinateTransformation* coordinate_transform;
	coordinate_transform = OGRCreateCoordinateTransformation(&pj_latlong, &pj_utm);

	coordinate_transform->Transform(1, &cube_extent.min_x, &cube_extent.min_y);
	coordinate_transform->Transform(1, &cube_extent.max_x, &cube_extent.max_y);

	PointCloud pc;
	double z = poly_extent.average_z();
	pc.has_time = false;
	pc.has_color = false;

	char* proj4_str;
	pj_utm.exportToProj4(&proj4_str);
	pc.spatial_ref.SetProj4(proj4_str);
	CPLFree(proj4_str);

	int number_x = (cube_extent.max_x - cube_extent.min_x)/spacing + 1;
	int number_y = (cube_extent.max_y - cube_extent.min_y)/spacing + 1;
	pc.resize(number_x * number_y);
	int count = 0;

	for (double x=cube_extent.min_x; x < cube_extent.max_x; x += spacing) {
		for (double y=cube_extent.min_y; y < cube_extent.max_y; y += spacing) {
			pc.loc[count] = Point(x, y, z);
			count++;
		}
	}
	pc.update_extent();

	assert(count == pc.size());

	return pc;
}

} // eopcc namespace end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
com.facebook.internal
</TITLE>

<META NAME="date" CONTENT="2013-03-20">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      Overview
    Package
      Class
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package com.facebook.internal

com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android.

See:

          Description

Class Summary

CacheableRequestBatch
com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android.

FileLruCache
com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android.

FileLruCache.Limits

Logger
com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android.

ServerProtocol
com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android.

SessionTracker
com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android.

Utility
com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android.

Validate
com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android.

Enum Summary

SessionAuthorizationType
com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android.

Package com.facebook.internal Description

com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android. Use of
 any of the classes in this package is unsupported, and they may be modified or removed without warning at
 any time.

      Overview
    Package
      Class
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes


text:
package com.intellij.openapi.roots.ui.configuration.artifacts.actions;

import com.intellij.icons.AllIcons;
import com.intellij.ide.JavaUiBundle;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.roots.ui.configuration.artifacts.LayoutTreeComponent;
import org.jetbrains.annotations.NotNull;

public class SortElementsToggleAction extends ToggleAction implements DumbAware {
  private final LayoutTreeComponent myLayoutTreeComponent;

  public SortElementsToggleAction(final LayoutTreeComponent layoutTreeComponent) {
    super(JavaUiBundle.message("action.text.sort.elements.by.names.and.types"), JavaUiBundle.message(
      "action.text.sort.elements.by.names.and.types"), AllIcons.ObjectBrowser.Sorted);
    myLayoutTreeComponent = layoutTreeComponent;
  }

  @Override
  public boolean isSelected(@NotNull AnActionEvent e) {
    return myLayoutTreeComponent.isSortElements();
  }

  @Override
  public void setSelected(@NotNull AnActionEvent e, boolean state) {
    myLayoutTreeComponent.setSortElements(state);
  }
}


text:
from __future__ import unicode_literals

import datetime

from .base import OccurrenceDataTestCase
from ..models import Occurrence, Notification
from ..tasks import generate_occurrences, send_occurrence_notifications

class OccurrenceAppTestCase(OccurrenceDataTestCase):
    "Integration test for larger SMS workflow."

    def setUp(self):
        super(OccurrenceAppTestCase, self).setUp()
        self.timeline = self.create_timeline(name='Test', slug='foo')
        self.milestone = self.create_milestone(timeline=self.timeline, offset=1)
        self.connection = self.lookup_connections('5555555555')[0]

    def test_join(self):
        "Join timeline then generate upcoming occurrences."
        msg = self.receive('APPT NEW FOO 123', self.connection)
        reply = self.outbound.pop()
        self.assertTrue(reply.text.startswith('Thank you'))
        # Single occurrence should be created
        generate_occurrences()
        occurrence = Occurrence.objects.get(subscription__connection=self.connection, milestone=self.milestone)
        tomorrow = datetime.date.today() + datetime.timedelta(days=self.milestone.offset)
        self.assertEqual(tomorrow, occurrence.date)

    def test_confirm_occurrence(self):
        "Generate a notification and confirm an occurrence."
        subscription = self.create_timeline_subscription(connection=self.connection, timeline=self.timeline)
        generate_occurrences()
        send_occurrence_notifications()
        reminder = self.outbound.pop()
        self.assertTrue(reminder.text.startswith('This is a reminder'))
        msg = self.receive('APPT CONFIRM FOO {0}'.format(subscription.pin), self.connection)
        reply = self.outbound.pop()
        self.assertTrue(reply.text.startswith('Thank you'))
        occurrence = Occurrence.objects.get(subscription__connection=self.connection, milestone=self.milestone)
        self.assertTrue(occurrence.completed)

    def test_made_occurrence(self):
        "Mark an occurrence as seen."
        yesterday = datetime.date.today() - datetime.timedelta(days=self.milestone.offset)
        # Joined yesterday so occurrence would be today
        subscription = self.create_timeline_subscription(
            connection=self.connection, timeline=self.timeline, start=yesterday)
        generate_occurrences()
        send_occurrence_notifications()
        reminder = self.outbound.pop()
        self.assertTrue(reminder.text.startswith('This is a reminder'))
        msg = self.receive('APPT STATUS FOO {0} ACHIEVED'.format(subscription.pin), self.connection)
        reply = self.outbound.pop()
        self.assertTrue(reply.text.startswith('Thank you'))
        occurrence = Occurrence.objects.get(subscription__connection=self.connection, milestone=self.milestone)
        self.assertEqual(Occurrence.STATUS_ACHIEVED, occurrence.status)

    def test_missed_occurrence(self):
        "Mark an occurrence as missed."
        yesterday = datetime.date.today() - datetime.timedelta(days=self.milestone.offset)
        # Joined yesterday so occurrence would be today
        subscription = self.create_timeline_subscription(
            connection=self.connection, timeline=self.timeline, start=yesterday)
        generate_occurrences()
        send_occurrence_notifications()
        reminder = self.outbound.pop()
        self.assertTrue(reminder.text.startswith('This is a reminder'))
        msg = self.receive('APPT STATUS FOO {0} MISSED'.format(subscription.pin), self.connection)
        reply = self.outbound.pop()
        self.assertTrue(reply.text.startswith('Thank you'))
        occurrence = Occurrence.objects.get(subscription__connection=self.connection, milestone=self.milestone)
        self.assertEqual(Occurrence.STATUS_MISSED, occurrence.status)

    def test_join_then_quit(self):
        "Join a timeline then quit."
        msg = self.receive('APPT NEW FOO 123', self.connection)
        reply = self.outbound.pop()
        self.assertTrue(reply.text.startswith('Thank you'))
        msg = self.receive('APPT QUIT FOO 123', self.connection)
        reply = self.outbound.pop()
        self.assertTrue(reply.text.startswith('Thank you'))
        generate_occurrences()
        # No occurrences should be generated
        occurrences = Occurrence.objects.filter(subscription__connection=self.connection)
        self.assertEqual(0, occurrences.count())

    def test_quit_reminders(self):
        "Don't send reminders for unsubscribed users."
        msg = self.receive('APPT NEW FOO 123', self.connection)
        reply = self.outbound.pop()
        self.assertTrue(reply.text.startswith('Thank you'))
        generate_occurrences()
        msg = self.receive('APPT QUIT FOO 123', self.connection)
        reply = self.outbound.pop()
        self.assertTrue(reply.text.startswith('Thank you'))
        send_occurrence_notifications()
        self.assertEqual(0, len(self.outbound), self.outbound)
        occurrence = Occurrence.objects.get(subscription__connection=self.connection, milestone=self.milestone)
        notifications = Notification.objects.filter(occurrence=occurrence)
        self.assertEqual(0, notifications.count())


text:
'use strict';

const mm = require('mm');
const request = require('supertest');
const koa = require('koa');
const session = require('koa-generic-session');
const userauth = require('../');
const createApp = require('./app');

function match(path) {
  return path.indexOf('/user') === 0;
}

describe('test/index.test.js', () => {
  describe('userauth([match, ]options)', () => {
    it('should support match="" to match all', () => {
      const app = new koa();
      app.keys = ['i m secret'];
      app.use(session());
      app.use(userauth('', {
        loginURLFormater: () => 'http://auth.example.com/login',
        getUser: async () => null,
      }));
      return request(app.callback())
      .get('/')
      .expect('Location', '/login?redirect=%2F')
      .expect(302);
    });

    it('should support options.match="" to match all', () => {
      const app = new koa();
      app.keys = ['i m secret'];
      app.use(session());
      app.use(userauth({
        match: '',
        loginURLFormater: () => 'http://auth.example.com/login',
        getUser: async () => null,
      }));
      return request(app.callback())
      .get('/')
      .expect('Location', '/login?redirect=%2F')
      .expect(302);
    });

    it('should support options.match=null to not match all', () => {
      const app = new koa();
      app.keys = ['i m secret'];
      app.use(session());
      app.use(userauth({
        match: null,
        loginURLFormater: () => 'http://auth.example.com/login',
        getUser: async () => null,
      }));
      app.use(async ctx => ctx.body = 'pass');
      return request(app.callback())
      .get('/')
      .expect('pass')
      .expect(200);
    });

    it('should GET /login redirect to login url', () => {
      const app = new koa();
      app.keys = ['i m secret'];
      app.use(session());
      app.use(userauth({
        match: '',
        loginURLFormater: () => 'http://auth.example.com/login',
        getUser: async () => null,
      }));
      return request(app.callback())
      .get('/login')
      .expect('Location', 'http://auth.example.com/login')
      .expect(302);
    });

    it('should support https', () => {
      const app = new koa();
      app.proxy = true;
      app.keys = ['i m secret'];
      app.use(session());
      app.use(userauth({
        match: '',
        loginURLFormater: url => 'https://auth.example.com/login?callback=' + url,
        getUser: async () => null,
      }));
      return request(app.callback())
      .get('/login')
      .set('X-Forwarded-Proto', 'https')
      .expect('Location', /https:\/\/auth\.example\.com\/login\?callback=https:\/\//)
      .expect(302);
    });

    it('should support rootPath=/foo', () => {
      const app = new koa();
      app.keys = ['i m secret'];
      app.use(session());
      app.use(userauth({
        match: '',
        rootPath: '/foo',
        loginURLFormater: () => 'http://auth.example.com/login',
        getUser: async () => null,
      }));
      return request(app.callback())
      .get('/foo/login')
      .expect('Location', 'http://auth.example.com/login')
      .expect(302);
    });

    it('should always redirect to login page when session not exists', () => {
      const app = new koa();
      app.keys = ['i m secret'];
      app.use(userauth({
        match: '/user',
        loginURLFormater: () => 'http://auth.example.com/login',
        getUser: async () => null,
      }));
      return request(app.callback())
      .get('/user')
      .expect('Location', 'http://auth.example.com/login')
      .expect(302);
    });

    it('should pass when session not exists and not match need login', () => {
      const app = new koa();
      app.keys = ['i m secret'];
      app.use(userauth({
        match: '/user',
        loginURLFormater: () => 'http://auth.example.com/login',
        getUser: async () => null,
      }));
      app.use(async ctx => ctx.body = 'pass');
      return request(app.callback())
      .get('/')
      .expect('pass')
      .expect(200);
    });
  });

  [
    ['string', '/user'],
    ['regexp', /^\/user/],
    ['function', match],
  ].forEach(function (matchs) {
    const type = matchs[0];
    const match = matchs[1];
    const app = createApp({ match });
    describe('with ' + type, () => {
      afterEach(mm.restore);

      it('should request /login redirect to /mocklogin', async () => {
        let res = await request(app)
        .get('/login')
        .expect('Location', /^\/mocklogin\?redirect/)
        .expect('Location', /\/login\/callback$/)
        .expect('Set-Cookie', /^koa\.sid/)
        .expect(302);

        let cookie = res.headers['set-cookie'].join(';');
        // should login redirect to /
        await request(app)
        .get('/login/callback')
        .set('Cookie', cookie)
        .expect('Location', '/')
        .expect(302);

        await request(app)
        .get('/login?foo=bar')
        .expect('Location', /^\/mocklogin\?redirect/)
        .expect('Location', /\/login\/callback$/)
        .expect(302);

        await request(app)
        .get('/login?foo=bar')
        .set('Accept', 'application/json')
        .expect('Location', /^\/mocklogin\?redirect/)
        .expect({ error: '401 Unauthorized' })
        .expect(401);

        res = await request(app)
        .get('/login?redirect=user/index')
        .expect('Location', /^\/mocklogin\?redirect/)
        .expect('Set-Cookie', /^koa\.sid/)
        .expect(302);

        cookie = res.headers['set-cookie'].join(';');
        // should login redirect to /
        await request(app)
        .get('/login/callback')
        .set('Cookie', cookie)
        .expect('Location', '/')
        .expect(302);

        res = await request(app)
        .get('/login?redirect=/index2')
        .expect('Location', /^\/mocklogin\?redirect/)
        .expect('Set-Cookie', /^koa\.sid/)
        .expect(302);

        cookie = res.headers['set-cookie'].join(';');
        // should login redirect to /
        await request(app)
        .get('/login/callback')
        .set('Cookie', cookie)
        .expect('Location', '/index2')
        .expect(302);
      });

      it('should login success and visit /user/foo status 200', async () => {
        let res = await request(app)
        .get('/login/callback')
        .set('mocklogin', 1)
        .expect('Location', '/')
        .expect('Set-Cookie', /^koa\.sid/)
        .expect(302);

        let cookie = res.headers['set-cookie'].join(';');
        await request(app)
        .get('/user/foo')
        .set('Cookie', cookie)
        .expect({"user":{"nick":"mock user","userid":1234},"message":"GET /user/foo"})
        .expect(200);
      });

      it('should login callback redirect success with referer', async () => {
        let res = await request(app)
        .get('/login?redirect=')
        .set('Referer', 'http://demo.com/foo')
        .expect('Location', /^\/mocklogin\?redirect/)
        .expect('Set-Cookie', /^koa\.sid/)
        .expect(302);

        let cookie = res.headers['set-cookie'].join(';');
        // should login redirect to /
        await request(app)
        .get('/login/callback')
        .set('Cookie', cookie)
        .set('mocklogin', 1)
        .expect('Location', '/')
        .expect(302);

        res = await request(app)
        .get('/login')
        .set('Referer', 'foo/bar')
        .expect('Location', /^\/mocklogin\?redirect/)
        .expect('Set-Cookie', /^koa\.sid/)
        .expect(302);

        cookie = res.headers['set-cookie'].join(';');
        // should login redirect to /
        await request(app)
        .get('/login/callback')
        .set('Cookie', cookie)
        .set('mocklogin', 1)
        .expect('Location', '/')
        .expect(302);

        res = await request(app)
        .get('/login')
        .set('Referer', '/foo/bar')
        .expect('Location', /^\/mocklogin\?redirect/)
        .expect('Set-Cookie', /^koa\.sid/)
        .expect(302);

        cookie = res.headers['set-cookie'].join(';');
        // should login redirect to /
        await request(app)
        .get('/login/callback')
        .set('Cookie', cookie)
        .set('mocklogin', 1)
        .expect('Location', '/foo/bar')
        .expect(302);

        res = await request(app)
        .get('/login')
        .set('Referer', '/login')
        .expect('Location', /^\/mocklogin\?redirect/)
        .expect('Set-Cookie', /^koa\.sid/)
        .expect(302);

        cookie = res.headers['set-cookie'].join(';');
        // should login redirect to /
        await request(app)
        .get('/login/callback?foo')
        .set('Cookie', cookie)
        .set('mocklogin', 1)
        .expect('Location', '/')
        .expect(302);
      });

      it('should login callback redirect success with ctx.getRedirectTarget', async () => {
        let res;
        let cookie;
        const app = createApp({
          match,
          getRedirectTarget(ctx) {
            return '/foo';
          }
        })
        res = await request(app)
        .get('/login')
        .set('Referer', '/foo/bar')
        .expect('Location', /^\/mocklogin\?redirect/)
        .expect('Set-Cookie', /^koa\.sid/)
        .expect(302);

        cookie = res.headers['set-cookie'].join(';');
        // should login redirect to /
        await request(app)
        .get('/login/callback')
        .set('Cookie', cookie)
        .set('mocklogin', 1)
        .expect('Location', '/foo')
        .expect(302);
      });

      it('should redirect to /login when not auth user visit /user*',  async () => {
        await request(app)
        .get('/user')
        .expect('Location', '/login?redirect=%2Fuser')
        .expect(302);

        // fixed: encodeURIComponent(url) error: URIError: URI malformed
        // skip this test, node v10 will throw ERR_UNESCAPED_CHARACTERS
        // await request(app)
        // .get('/user/' + String.fromCharCode(0xDFFF))
        // // .expect('Location', '/login?redirect=/user/' + String.fromCharCode(0xDFFF))
        // .expect(302);

        await request(app)
        .get('/user/foo')
        .set({ Cookie: 'cookie2=' })
        .expect('Location', '/login?redirect=%2Fuser%2Ffoo')
        .expect(302);

        await request(app)
        .get('/user/')
        .set({ Cookie: 'cookie2= ;foo=bar' })
        .expect('Location', '/login?redirect=%2Fuser%2F')
        .expect(302);

        await request(app)
        .get('/user?foo=bar')
        .set('Accept', 'application/json')
        .expect('Location', '/login?redirect=%2Fuser%3Ffoo%3Dbar')
        .expect({ error: '401 Unauthorized' })
        .expect(401);
      });

      it('should 200 status when request url no need to login', async () => {
        await request(app)
        .get('/')
        .expect({
          user: null,
          message: 'GET /'
        })
        .expect(200);

        await request(app)
        .get('/use')
        .set({ Cookie: 'cookie2=' })
        .expect({
          user: null,
          message: 'GET /use'
        })
        .expect(200);

        await request(app)
        .get('/use/foo/bar')
        .set({ Cookie: 'cookie2= ;foo=bar' })
        .expect({
          user: null,
          message: 'GET /use/foo/bar'
        })
        .expect(200);
      });

      it('should login directly when use contain logined token', () => {
        return request(app)
        .get('/user/foo')
        .set('mocklogin', 1)
        .expect({"user":{"nick":"mock user","userid":1234},"message":"GET /user/foo"})
        .expect(200);
      });

      it('should return 302 when getUser directly', () => {
        return request(app)
        .get('/user/foo')
        .set('mockerror', 1)
        .expect('Location', '/login?redirect=%2Fuser%2Ffoo')
        .expect(302);
      });

      it('should return 200 status and user info after user logined', async () => {
        let res = await request(app)
        .get('/login?redirect=%2F')
        .expect(302);

        let cookie = res.headers['set-cookie'].join(';');

        res = await request(app)
        .get('/login/callback')
        .set('mocklogin', 1)
        .set({ Cookie: 'cookie2=1234; ' + cookie })
        .expect('Location', '/')
        .expect(302);

        res = await request(app)
        .get('/')
        .set({ Cookie: 'cookie2=1234; ' + cookie })
        .expect({
          user: {
            nick: 'mock user',
            userid: 1234
          },
          message: 'GET /'
        })
        .expect(200);

        res = await request(app)
        .get('/logout')
        .set({ Cookie: 'cookie2=1234; ' + cookie })
        .expect('Location', '/')
        .expect(302);

        await request(app)
        .get('/logout')
        .set({ referer: '/login' })
        .expect('Location', '/login')
        .expect(302);
      });

      it('should return 302 to / what ever visit logincallback', async () => {
        let res = await request(app)
        .get('/login/callback')
        .set('mocklogin', 1)
        .expect('Location', '/')
        .expect(302);

        let cookie = res.headers['set-cookie'].join(';');
        let times = 10;
        for (let i = 0; i < times; i++) {
          await request(app)
          .get('/login/callback')
          .set('Cookie', cookie)
          .expect('Location', '/')
          .expect(302);
        }
      });

      it('should return error when /login/callback request session proxy error', () => {
        return request(app)
        .get('/login/callback')
        .set({ mockerror: 'true' })
        .expect({
          error: 'mock getUser error',
          message: 'GET /login/callback'
        })
        .expect(500);
      });

      it('should user login fail when getUser return empty', async () => {
        let res = await request(app)
        .get('/login/callback')
        .set({ mockempty: '1' })
        .expect('Location', '/')
        .expect(302);
        res.should.not.have.header('set-cookie');

        res = await request(app)
        .get('/login/callback')
        .set({ Cookie: 'cookie2=wrong', mockempty: '1' })
        .set('Accept', 'application/json')
        .expect('Location', '/')
        .expect({ error: '401 Unauthorized' })
        .expect(401);
        res.should.not.have.header('set-cookie');
      });

      it('should logout success', async () => {
        await request(app)
        .get('/logout')
        .set({ Cookie: 'cookie2=1234' })
        .expect('Location', '/')
        .expect(302);

        await request(app)
        .get('/logout?redirect=/foo')
        .set({ Cookie: 'cookie2=1234' })
        .expect('Location', '/foo')
        .expect(302);

        await request(app)
        .get('/logout?redirect=foo')
        .set({ Cookie: 'cookie2=1234' })
        .expect('Location', '/')
        .expect(302);

        await request(app)
        .get('/logout')
        .set('Referer', '/logout?foo=bar')
        .set({ Cookie: 'cookie2=1234' })
        .expect('Location', '/')
        .expect(302);
      });

      it('should logout redirect to login page when the referer require user auth', async () => {
        await request(app)
        .get('/logout')
        .set('Referer', '/user/article')
        .set({ Cookie: 'cookie2=1234' })
        .expect('Location', '/user/article')
        .expect(302);

        await request(app)
        .get('/user/article')
        .expect('Location', '/login?redirect=%2Fuser%2Farticle')
        .expect(302);
      });

      it('should mock loginCallback error', () => {
        return request(app)
        .get('/login/callback')
        .set('mocklogin', 1)
        .set('mocklogin_callbackerror', 'mock login callback error')
        .expect({
          error: 'mock login callback error',
          message: 'GET /login/callback'
        })
        .expect(500);
      });

      it('should mock loginCallback redirect to new url', () => {
        return request(app)
        .get('/login/callback')
        .set('mocklogin', 1)
        .set('mocklogin_redirect', '/newurl')
        .expect('Location', '/newurl')
        .expect(302);
      });

      it('should directly login with mock loginCallback redirect to new url', () => {
        return request(app)
        .get('/user')
        .set('mocklogin', 1)
        .set('mocklogin_redirect', '/user/newurl')
        .expect('Location', '/user/newurl')
        .expect(302);
      });

      it('should mock logoutCallback error', async () => {
        let res = await request(app)
        .get('/user/foo')
        .set('mocklogin', 1)
        .set('mocklogout_callbackerror', 'mock logout callback error')
        .expect(200);

        let cookie = res.headers['set-cookie'].join(';');
        await request(app)
        .get('/logout')
        .set('Cookie', cookie)
        .expect('X-Logout', 'logoutCallback header')
        .expect({
          error: 'mock logout callback error',
          message: 'GET /logout'
        })
        .expect(500);
      });

      it('should mock loginCallback error', () => {
        return request(app)
        .get('/user/foo')
        .set('mocklogin', 1)
        .set('mocklogin_callbackerror', 'mock login callback error')
        .expect({
          error: 'mock login callback error',
          message: 'GET /user/foo'
        })
        .expect(500);
      });

      it('should mock logoutCallback redirect to new url', async () => {
        let res = await request(app)
        .get('/user/foo')
        .set('mocklogin', 1)
        .set('mocklogout_redirect', '/user/foo/newurl')
        .expect(200);

        res.statusCode.should.equal(200);
        let cookie = res.headers['set-cookie'].join(';');
        await request(app)
        .get('/logout')
        .set('Cookie', cookie)
        .expect('Location', '/user/foo/newurl')
        .expect(302);
      });
    });
  });
});


text:
<?php

namespace SkankyDev;

use MongoDB\BSON\Persistable;
use MongoDB\BSON\UTCDateTime;
use MongoDB\BSON\ObjectID;
use MongoDB\Model\BSONArray;
use DateTime;

class MasterDocument implements Persistable{

	public $_id;

	public function __construct($data){
		$properties = get_class_vars(get_class($this));
		foreach ($properties as $key=>$value){
			if(isset($data->{$key})){
				$this->{$key} = $data->{$key};
				if(preg_match('/[a-zA-Z0-9_-]*_id/', $key)){
					if(empty($data->{$key})){
						$this->{$key} = new ObjectID();
					}else{
						$this->{$key} = new ObjectID($data->{$key});
					}
				}
			}
		}
	}

	/**
	 * convert the document to be saved in database
	 * @return array the document
	 */
	public function bsonSerialize(){
		$prop = get_object_vars($this);
		foreach ($prop as $key=>$value) {
			$prop[$key] = $this->{$key};
			if($prop[$key] instanceof DateTime){
				$prop[$key] = new UTCDateTime(strtotime($this->{$key}->format("Y-m-d H:i:s")));
			}else if(preg_match('/[a-zA-Z0-9_-]*_id/', $key)){
				if(empty($value)){
					$prop[$key] = new ObjectID();
				}else{
					$prop[$key] = new ObjectID($value);
				}
			}
		}
		return $prop;
	}

	/**
	 * convert the result to the database in document
	 * @param  array  $data the data form database
	 * @return void
	 */
	public function bsonUnserialize(array $data){
		unset($data['__pclass']);
		foreach ($data as $key => $value) {
			$this->{$key} = $value;
			if($this->{$key} instanceof UTCDateTime ){
				$date = $this->{$key};
				$myDate = new DateTime();
				$ts = (int)$date->__toString();
				$myDate->setTimestamp($ts);
				$this->{$key} = $myDate;
			}elseif($this->{$key} instanceof BSONArray){
				$this->{$key} = $this->{$key}->getArrayCopy();
			}
		}
	}

}


text:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (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.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is the Netscape Portable Runtime (NSPR).
 *
 * The Initial Developer of the Original Code is
 * Netscape Communications Corporation.
 * Portions created by the Initial Developer are Copyright (C) 1998-2000
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#include "prio.h"
#include "prmem.h"
#include "prprf.h"
#include "prinit.h"
#include "prerror.h"
#include "prthread.h"

#include "plerror.h"
#include "plgetopt.h"

#define DEFAULT_COUNT 10
#define DEFAULT_FILESIZE 1
#define BUFFER_SIZE 1000000

typedef enum {v_silent, v_whisper, v_shout} Verbosity;
static void Verbose(Verbosity, const char*, const char*, PRIntn);

#define VERBOSE(_l, _m) Verbose(_l, _m, __FILE__, __LINE__)

static PRIntn test_result = 2;
static PRFileDesc *output = NULL;
static PRIntn verbose = v_silent;
static PRIntn filesize = DEFAULT_FILESIZE;

static PRIntn Usage(void)
{
    PR_fprintf(output, "Bigfile test usage:\n");
    PR_fprintf(output, ">bigfile [-G] [-d] [-v[*v]] [-s <n>] <filename>\n");
    PR_fprintf(output, "\td\tdebug mode (equivalent to -vvv)\t(false)\n");
    PR_fprintf(output, "\tv\tAdditional levels of output\t(none)\n");
    PR_fprintf(output, "\tk\tKeep data file after exit\t(false)\n");
    PR_fprintf(output, "\ts <n>\tFile size in megabytes\t\t(1 megabyte)\n");
    PR_fprintf(output, "\t<filename>\tName of test file\t(none)\n");
    return 2;  /* nothing happened */
}  /* Usage */

static PRStatus DeleteIfFound(const char *filename)
{
    PRStatus rv;
    VERBOSE(v_shout, "Checking for existing file");
    rv = PR_Access(filename, PR_ACCESS_WRITE_OK);
    if (PR_SUCCESS == rv)
    {
        VERBOSE(v_shout, "Deleting existing file");
        rv = PR_Delete(filename);
        if (PR_FAILURE == rv) VERBOSE(v_shout, "Cannot delete big file");
    }
    else if (PR_FILE_NOT_FOUND_ERROR !=  PR_GetError())
        VERBOSE(v_shout, "Cannot access big file");
    else rv = PR_SUCCESS;
    return rv;
}  /* DeleteIfFound */

static PRIntn Error(const char *msg, const char *filename)
{
    PRInt32 error = PR_GetError();
    if (NULL != msg)
    {
        if (0 == error) PR_fprintf(output, msg);
        else PL_FPrintError(output, msg);
    }
    (void)DeleteIfFound(filename);
    if (v_shout == verbose) PR_Abort();
    return 1;
}  /* Error */

static void Verbose(
    Verbosity level, const char *msg, const char *file, PRIntn line)
{
    if (level <= verbose)
        PR_fprintf(output, "[%s : %d]: %s\n", file, line, msg);
}  /* Verbose */

static void PrintInfo(PRFileInfo64 *info, const char *filename)
{
    PRExplodedTime tm;
    char ctime[40], mtime[40];
    static const char *types[] = {"FILE", "DIRECTORY", "OTHER"};
    PR_fprintf(
        output, "[%s : %d]: File info for %s\n",
        __FILE__, __LINE__, filename);
    PR_fprintf(
        output, "    type: %s, size: %llu bytes,\n",
        types[info->type - 1], info->size);

    PR_ExplodeTime(info->creationTime, PR_GMTParameters, &tm);
    (void)PR_FormatTime(ctime, sizeof(ctime), "%c GMT", &tm);
    PR_ExplodeTime(info->modifyTime, PR_GMTParameters, &tm);
    (void)PR_FormatTime(mtime, sizeof(mtime), "%c GMT", &tm);

    PR_fprintf(
        output, "    creation: %s,\n    modify: %s\n", ctime, mtime);
}  /* PrintInfo */

PRIntn main(PRIntn argc, char **argv)
{
    PRStatus rv;
    char *buffer;
    PLOptStatus os;
    PRInt32 loop, bytes;
    PRFileInfo small_info;
    PRFileInfo64 big_info;
    PRBool keep = PR_FALSE;
    PRFileDesc *file = NULL;
    const char *filename = NULL;
    PRIntn count = DEFAULT_COUNT;
    PRInt64 filesize64, big_answer, big_size, one_meg, zero_meg, big_fragment;
    PRInt64 sevenFox = LL_INIT(0,0x7fffffff);

    PLOptState *opt = PL_CreateOptState(argc, argv, "dtvhs:");

    output = PR_GetSpecialFD(PR_StandardError);
    PR_STDIO_INIT();

    while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
    {
        if (PL_OPT_BAD == os) continue;
        switch (opt->option)
        {
        case 0:
            filename = opt->value;
            break;
        case 'd':  /* debug mode */
            verbose = v_shout;
            break;
        case 'k':  /* keep file */
            keep = PR_TRUE;
            break;
        case 'v':  /* verbosity */
            if (v_shout > verbose) verbose += 1;
            break;
        case 'c':  /* loop counter */
            count = atoi(opt->value);
            break;
        case 's':  /* filesize */
            filesize = atoi(opt->value);
            break;
        case 'h':  /* confused */
        default:
            return Usage();
        }
    }
    PL_DestroyOptState(opt);

    if (0 == count) count = DEFAULT_COUNT;
    if (0 == filesize) filesize = DEFAULT_FILESIZE;
    if (NULL == filename)
    {
        if (DEFAULT_FILESIZE != filesize) return Usage();
        else filename = "bigfile.dat";
    }

    if (PR_FAILURE == DeleteIfFound(filename)) return 1;

    test_result = 0;

    LL_I2L(zero_meg, 0);
    LL_I2L(one_meg, 1000000);
    LL_I2L(filesize64, filesize);
    buffer = (char*)PR_MALLOC(BUFFER_SIZE);
    LL_I2L(big_fragment, BUFFER_SIZE);
    LL_MUL(filesize64, filesize64, one_meg);

    for (loop = 0; loop < BUFFER_SIZE; ++loop) buffer[loop] = (char)loop;

    VERBOSE(v_whisper, "Creating big file");
    file = PR_Open(filename, PR_CREATE_FILE | PR_WRONLY, 0666);
    if (NULL == file) return Error("PR_Open()", filename);

    VERBOSE(v_whisper, "Testing available space in empty file");
    big_answer = file->methods->available64(file);
    if (!LL_IS_ZERO(big_answer)) return Error("empty available64()", filename);

	LL_SUB(big_size, filesize64, one_meg);
    VERBOSE(v_whisper, "Creating sparse big file by seeking to end");
	big_answer = file->methods->seek64(file, big_size, PR_SEEK_SET);
    if (!LL_EQ(big_answer, big_size)) return Error("seek", filename);

    VERBOSE(v_whisper, "Writing block at end of sparse file");
	bytes = file->methods->write(file, buffer, BUFFER_SIZE);
    if (bytes != BUFFER_SIZE) return Error("write", filename);

    VERBOSE(v_whisper, "Testing available space at end of sparse file");
    big_answer = file->methods->available64(file);
    if (!LL_IS_ZERO(big_answer)) return Error("eof available64()", filename);

    VERBOSE(v_whisper, "Getting big info on sparse big file");
    rv = file->methods->fileInfo64(file, &big_info);
    if (PR_FAILURE == rv) return Error("fileInfo64()", filename);
    if (v_shout <= verbose) PrintInfo(&big_info, filename);

    VERBOSE(v_whisper, "Getting small info on sparse big file");
    rv = file->methods->fileInfo(file, &small_info);
    if (LL_CMP(sevenFox, <, filesize64) && (PR_SUCCESS == rv))
    {
        VERBOSE(v_whisper, "Should have failed and didn't");
        return Error("fileInfo()", filename);
    }
    else if (LL_CMP(sevenFox, >, filesize64) && (PR_FAILURE == rv))
    {
        VERBOSE(v_whisper, "Should have succeeded and didn't");
        return Error("fileInfo()", filename);
    }

    VERBOSE(v_whisper, "Rewinding big file");
    big_answer = file->methods->seek64(file, zero_meg, PR_SEEK_SET);
    if (!LL_IS_ZERO(big_answer)) return Error("rewind seek64()", filename);

    VERBOSE(v_whisper, "Establishing available space in rewound file");
    big_answer = file->methods->available64(file);
    if (LL_NE(filesize64, big_answer))
        return Error("bof available64()", filename);

    VERBOSE(v_whisper, "Closing big file");
    rv = file->methods->close(file);
    if (PR_FAILURE == rv) return Error("close()", filename);

    VERBOSE(v_whisper, "Reopening big file");
    file = PR_Open(filename, PR_RDWR, 0666);
    if (NULL == file) return Error("open failed", filename);

    VERBOSE(v_whisper, "Checking available data in reopened file");
    big_answer = file->methods->available64(file);
    if (LL_NE(filesize64, big_answer))
        return Error("reopened available64()", filename);

    big_answer = zero_meg;
    VERBOSE(v_whisper, "Rewriting every byte of big file data");
    do
    {
        bytes = file->methods->write(file, buffer, BUFFER_SIZE);
        if (bytes != BUFFER_SIZE)
            return Error("write", filename);
        LL_ADD(big_answer, big_answer, big_fragment);
    } while (LL_CMP(big_answer, <, filesize64));

    VERBOSE(v_whisper, "Checking position at eof");
    big_answer = file->methods->seek64(file, zero_meg, PR_SEEK_CUR);
    if (LL_NE(big_answer, filesize64))
        return Error("file size error", filename);

    VERBOSE(v_whisper, "Testing available space at eof");
    big_answer = file->methods->available64(file);
    if (!LL_IS_ZERO(big_answer))
        return Error("eof available64()", filename);

    VERBOSE(v_whisper, "Rewinding full file");
    big_answer = file->methods->seek64(file, zero_meg, PR_SEEK_SET);
    if (!LL_IS_ZERO(big_answer)) return Error("bof seek64()", filename);

    VERBOSE(v_whisper, "Testing available space in rewound file");
    big_answer = file->methods->available64(file);
    if (LL_NE(big_answer, filesize64)) return Error("bof available64()", filename);

    VERBOSE(v_whisper, "Seeking to end of big file");
    big_answer = file->methods->seek64(file, filesize64, PR_SEEK_SET);
    if (LL_NE(big_answer, filesize64)) return Error("eof seek64()", filename);

    VERBOSE(v_whisper, "Getting info on big file while it's open");
    rv = file->methods->fileInfo64(file, &big_info);
    if (PR_FAILURE == rv) return Error("fileInfo64()", filename);
    if (v_shout <= verbose) PrintInfo(&big_info, filename);

    VERBOSE(v_whisper, "Closing big file");
    rv = file->methods->close(file);
    if (PR_FAILURE == rv) return Error("close()", filename);

    VERBOSE(v_whisper, "Getting info on big file after it's closed");
    rv = PR_GetFileInfo64(filename, &big_info);
    if (PR_FAILURE == rv) return Error("fileInfo64()", filename);
    if (v_shout <= verbose) PrintInfo(&big_info, filename);

    VERBOSE(v_whisper, "Deleting big file");
    rv = PR_Delete(filename);
    if (PR_FAILURE == rv) return Error("PR_Delete()", filename);

    PR_DELETE(buffer);
    return test_result;
} /* main */

/* bigfile.c */


text:
package rreeggkk.nuclearsciences.common.block.centrifuge;

import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import rreeggkk.nuclearsciences.NuclearSciences;
import rreeggkk.nuclearsciences.common.block.BlockContainerNSBase;
import rreeggkk.nuclearsciences.common.gui.GuiHandler;
import rreeggkk.nuclearsciences.common.tile.centrifuge.TileEntityCondensor;

public class BlockCondensor extends BlockContainerNSBase {
	public BlockCondensor() {
		super(Material.IRON, "condensor", TileEntityCondensor.class);

		setHardness(5.0F);
		setResistance(10.0F);
		setSoundType(SoundType.METAL);
		setHarvestLevel("pickaxe", 1);
	}

	@Override
	public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side,
			float hitX, float hitY, float hitZ) {

		// Get the tile entity
		TileEntity tileEntity = world.getTileEntity(pos);
		// If the tile entity doesn't exsist or the player is sneaking
		if (tileEntity == null || player.isSneaking()) {
			// Let the normal action happen
			return false;
		}

		// Open the GUI
		player.openGui(NuclearSciences.instance, GuiHandler.MULTIBLOCK_GAS_CENTRIFUGE, world, pos.getX(), pos.getY(), pos.getZ());

		// Stop any other right click actions
		return true;
	}

	@Override
	public TileEntity createNewTileEntity(World worldIn, int meta) {
		return new TileEntityCondensor();
	}

    public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
        if (hasTileEntity(state)){
            worldIn.removeTileEntity(pos);
        }
    }
}


text:
package org.wso2.carbon.url.mapper.internal.exception;

/**
 * To handle urlmapper component specific exception.
 */
public class UrlMapperException extends Exception {

    /**
	 *
	 */
	private static final long serialVersionUID = 1L;

	public UrlMapperException(String s) {
        super(s);
    }

    public UrlMapperException(String s, Throwable e) {
        super(s, e);
    }

}


text:
require 'spec_helper'

RSpec.describe ProjectPage, type: :model do
end


text:
package com.ppmessage.sdk.core.bean.common;

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

import com.ppmessage.sdk.core.L;
import com.ppmessage.sdk.core.utils.Utils;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by ppmessage on 5/6/16.
 */
public class User implements Parcelable {

    private String uuid;
    private String name;
    private String icon;
    private String deviceUUID;
    private String sha1Password;
    private boolean serviceUser;
    private String email;
    private String signature;
    private String serverUrl;

    public User() {

    }

    protected User(Parcel in) {
        uuid = in.readString();
        name = in.readString();
        icon = in.readString();
        deviceUUID = in.readString();
        sha1Password = in.readString();
        serviceUser = in.readByte() != 0;
        email = in.readString();
        signature = in.readString();
        serverUrl = in.readString();
    }

    public static final Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel in) {
            return new User(in);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getName() {
        return name;
    }

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

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getDeviceUUID() {
        return deviceUUID;
    }

    public void setDeviceUUID(String deviceUUID) {
        this.deviceUUID = deviceUUID;
    }

    public String getSha1Password() {
        return sha1Password;
    }

    public void setSha1Password(String sha1Password) {
        this.sha1Password = sha1Password;
    }

    public boolean isServiceUser() {
        return serviceUser;
    }

    public void setServiceUser(boolean serviceUser) {
        this.serviceUser = serviceUser;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public String getServerUrl() {
        return serverUrl;
    }

    public void setServerUrl(String serverUrl) {
        this.serverUrl = serverUrl;
    }

    @Override
    public String toString() {
        return "User{" +
                "uuid='" + uuid + '\'' +
                ", name='" + name + '\'' +
                ", icon='" + icon + '\'' +
                ", deviceUUID='" + deviceUUID + '\'' +
                ", email='" + email + '\'' +
                ", signature='" + signature + '\'' +
                '}';
    }

    public static User parse(JSONObject userJsonObject) {
        if (userJsonObject.has("error_code")) {
            try {
                if (userJsonObject.getInt("error_code") != 0) return null;
            } catch (JSONException e) {
                L.e(e);
            }
        }

        User user = new User();
        try {
            // Find userName
            String userName = null;
            if (userJsonObject.has("user_fullname")) {
                userName = Utils.safeNull(userJsonObject.getString("user_fullname"));
            }
            if (userName == null) {
                if (userJsonObject.has("fullname")) {
                    userName = Utils.safeNull(userJsonObject.getString("fullname"));
                }
            }
            if (userName == null) {
                // Sometimes it will return user_email ... is this a bug ?
                if (userJsonObject.has("user_name")) {
                    userName = Utils.safeNull(userJsonObject.getString("user_name"));
                }
            }

            String userIcon = Utils.getFileDownloadUrl(userJsonObject.has("user_icon") ? userJsonObject.getString("user_icon") :
                    (userJsonObject.has("icon") ? userJsonObject.getString("icon") : null));
            String userUUID = userJsonObject.has("uuid") ? userJsonObject.getString("uuid") :
                    (userJsonObject.has("user_uuid") ? userJsonObject.getString("user_uuid") : null);
            String mobileDeviceUUID = userJsonObject.has("mobile_device_uuid") ? Utils.safeNull(userJsonObject.getString("mobile_device_uuid")) : null;
            String userEmail = userJsonObject.has("user_email") ? Utils.safeNull(userJsonObject.getString("user_email")) : null;
            String userSignature = userJsonObject.has("user_signature") ? Utils.safeNull(userJsonObject.getString("user_signature")) : null;
            String password = userJsonObject.has("user_password") ? Utils.safeNull(userJsonObject.getString("user_password")) : null;

            user.setName(userName);
            user.setIcon(userIcon);
            user.setUuid(userUUID);
            user.setDeviceUUID(mobileDeviceUUID);
            user.setEmail(userEmail);
            user.setSignature(userSignature);
            user.setSha1Password(password);

        } catch (JSONException e) {
            L.e(e);
        }

        return user;
    }

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

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(uuid);
        dest.writeString(name);
        dest.writeString(icon);
        dest.writeString(deviceUUID);
        dest.writeString(sha1Password);
        dest.writeByte((byte) (serviceUser ? 1 : 0));
        dest.writeString(email);
        dest.writeString(signature);
        dest.writeString(serverUrl);
    }
}


text:
<!DOCTYPE html>

<meta charset="UTF-8">
<title>TinyMCE Accessibility Milestone 1</title>

Milestone 1 adds simple toolbar buttons and a separator.

<form name="edit">

Title: <input type="text" id="title" name="title">

Main content:

<textarea name="main" id="main" style="width: 100%; height: 400px;" aria-label="Main content rich text area">
<p>This is the editor content</p>
</textarea>

Category: <input type="text" id="category" name="category" />


text:
class X {
  void test(Object obj) {
    if (obj instanceof Point(double x, double y) point && y == x) {
      Point p<caret> = (Point) obj;
    }
  }
}

record Point(double x, double y) {
}


text:
/**
 * InStreamNonLinearAd.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
 */

package com.google.api.ads.dfa.axis.v1_20;

public class InStreamNonLinearAd  implements java.io.Serializable {
    private java.lang.String adParameters;

    private java.lang.String clickThroughUrl;

    private int expandedHeight;

    private int expandedWidth;

    private java.lang.String fileName;

    private int height;

    private long id;

    private boolean maintainAspectRatio;

    private boolean scalable;

    private java.lang.String url;

    private int width;

    public InStreamNonLinearAd() {
    }

    public InStreamNonLinearAd(
           java.lang.String adParameters,
           java.lang.String clickThroughUrl,
           int expandedHeight,
           int expandedWidth,
           java.lang.String fileName,
           int height,
           long id,
           boolean maintainAspectRatio,
           boolean scalable,
           java.lang.String url,
           int width) {
           this.adParameters = adParameters;
           this.clickThroughUrl = clickThroughUrl;
           this.expandedHeight = expandedHeight;
           this.expandedWidth = expandedWidth;
           this.fileName = fileName;
           this.height = height;
           this.id = id;
           this.maintainAspectRatio = maintainAspectRatio;
           this.scalable = scalable;
           this.url = url;
           this.width = width;
    }

    /**
     * Gets the adParameters value for this InStreamNonLinearAd.
     *
     * @return adParameters
     */
    public java.lang.String getAdParameters() {
        return adParameters;
    }

    /**
     * Sets the adParameters value for this InStreamNonLinearAd.
     *
     * @param adParameters
     */
    public void setAdParameters(java.lang.String adParameters) {
        this.adParameters = adParameters;
    }

    /**
     * Gets the clickThroughUrl value for this InStreamNonLinearAd.
     *
     * @return clickThroughUrl
     */
    public java.lang.String getClickThroughUrl() {
        return clickThroughUrl;
    }

    /**
     * Sets the clickThroughUrl value for this InStreamNonLinearAd.
     *
     * @param clickThroughUrl
     */
    public void setClickThroughUrl(java.lang.String clickThroughUrl) {
        this.clickThroughUrl = clickThroughUrl;
    }

    /**
     * Gets the expandedHeight value for this InStreamNonLinearAd.
     *
     * @return expandedHeight
     */
    public int getExpandedHeight() {
        return expandedHeight;
    }

    /**
     * Sets the expandedHeight value for this InStreamNonLinearAd.
     *
     * @param expandedHeight
     */
    public void setExpandedHeight(int expandedHeight) {
        this.expandedHeight = expandedHeight;
    }

    /**
     * Gets the expandedWidth value for this InStreamNonLinearAd.
     *
     * @return expandedWidth
     */
    public int getExpandedWidth() {
        return expandedWidth;
    }

    /**
     * Sets the expandedWidth value for this InStreamNonLinearAd.
     *
     * @param expandedWidth
     */
    public void setExpandedWidth(int expandedWidth) {
        this.expandedWidth = expandedWidth;
    }

    /**
     * Gets the fileName value for this InStreamNonLinearAd.
     *
     * @return fileName
     */
    public java.lang.String getFileName() {
        return fileName;
    }

    /**
     * Sets the fileName value for this InStreamNonLinearAd.
     *
     * @param fileName
     */
    public void setFileName(java.lang.String fileName) {
        this.fileName = fileName;
    }

    /**
     * Gets the height value for this InStreamNonLinearAd.
     *
     * @return height
     */
    public int getHeight() {
        return height;
    }

    /**
     * Sets the height value for this InStreamNonLinearAd.
     *
     * @param height
     */
    public void setHeight(int height) {
        this.height = height;
    }

    /**
     * Gets the id value for this InStreamNonLinearAd.
     *
     * @return id
     */
    public long getId() {
        return id;
    }

    /**
     * Sets the id value for this InStreamNonLinearAd.
     *
     * @param id
     */
    public void setId(long id) {
        this.id = id;
    }

    /**
     * Gets the maintainAspectRatio value for this InStreamNonLinearAd.
     *
     * @return maintainAspectRatio
     */
    public boolean isMaintainAspectRatio() {
        return maintainAspectRatio;
    }

    /**
     * Sets the maintainAspectRatio value for this InStreamNonLinearAd.
     *
     * @param maintainAspectRatio
     */
    public void setMaintainAspectRatio(boolean maintainAspectRatio) {
        this.maintainAspectRatio = maintainAspectRatio;
    }

    /**
     * Gets the scalable value for this InStreamNonLinearAd.
     *
     * @return scalable
     */
    public boolean isScalable() {
        return scalable;
    }

    /**
     * Sets the scalable value for this InStreamNonLinearAd.
     *
     * @param scalable
     */
    public void setScalable(boolean scalable) {
        this.scalable = scalable;
    }

    /**
     * Gets the url value for this InStreamNonLinearAd.
     *
     * @return url
     */
    public java.lang.String getUrl() {
        return url;
    }

    /**
     * Sets the url value for this InStreamNonLinearAd.
     *
     * @param url
     */
    public void setUrl(java.lang.String url) {
        this.url = url;
    }

    /**
     * Gets the width value for this InStreamNonLinearAd.
     *
     * @return width
     */
    public int getWidth() {
        return width;
    }

    /**
     * Sets the width value for this InStreamNonLinearAd.
     *
     * @param width
     */
    public void setWidth(int width) {
        this.width = width;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof InStreamNonLinearAd)) return false;
        InStreamNonLinearAd other = (InStreamNonLinearAd) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.adParameters==null && other.getAdParameters()==null) ||
             (this.adParameters!=null &&
              this.adParameters.equals(other.getAdParameters()))) &&
            ((this.clickThroughUrl==null && other.getClickThroughUrl()==null) ||
             (this.clickThroughUrl!=null &&
              this.clickThroughUrl.equals(other.getClickThroughUrl()))) &&
            this.expandedHeight == other.getExpandedHeight() &&
            this.expandedWidth == other.getExpandedWidth() &&
            ((this.fileName==null && other.getFileName()==null) ||
             (this.fileName!=null &&
              this.fileName.equals(other.getFileName()))) &&
            this.height == other.getHeight() &&
            this.id == other.getId() &&
            this.maintainAspectRatio == other.isMaintainAspectRatio() &&
            this.scalable == other.isScalable() &&
            ((this.url==null && other.getUrl()==null) ||
             (this.url!=null &&
              this.url.equals(other.getUrl()))) &&
            this.width == other.getWidth();
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getAdParameters() != null) {
            _hashCode += getAdParameters().hashCode();
        }
        if (getClickThroughUrl() != null) {
            _hashCode += getClickThroughUrl().hashCode();
        }
        _hashCode += getExpandedHeight();
        _hashCode += getExpandedWidth();
        if (getFileName() != null) {
            _hashCode += getFileName().hashCode();
        }
        _hashCode += getHeight();
        _hashCode += new Long(getId()).hashCode();
        _hashCode += (isMaintainAspectRatio() ? Boolean.TRUE : Boolean.FALSE).hashCode();
        _hashCode += (isScalable() ? Boolean.TRUE : Boolean.FALSE).hashCode();
        if (getUrl() != null) {
            _hashCode += getUrl().hashCode();
        }
        _hashCode += getWidth();
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(InStreamNonLinearAd.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.doubleclick.net/dfa-api/v1.20", "InStreamNonLinearAd"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("adParameters");
        elemField.setXmlName(new javax.xml.namespace.QName("", "adParameters"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"));
        elemField.setNillable(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("clickThroughUrl");
        elemField.setXmlName(new javax.xml.namespace.QName("", "clickThroughUrl"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"));
        elemField.setNillable(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("expandedHeight");
        elemField.setXmlName(new javax.xml.namespace.QName("", "expandedHeight"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("expandedWidth");
        elemField.setXmlName(new javax.xml.namespace.QName("", "expandedWidth"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("fileName");
        elemField.setXmlName(new javax.xml.namespace.QName("", "fileName"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"));
        elemField.setNillable(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("height");
        elemField.setXmlName(new javax.xml.namespace.QName("", "height"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("id");
        elemField.setXmlName(new javax.xml.namespace.QName("", "id"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("maintainAspectRatio");
        elemField.setXmlName(new javax.xml.namespace.QName("", "maintainAspectRatio"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("scalable");
        elemField.setXmlName(new javax.xml.namespace.QName("", "scalable"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("url");
        elemField.setXmlName(new javax.xml.namespace.QName("", "url"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"));
        elemField.setNillable(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("width");
        elemField.setXmlName(new javax.xml.namespace.QName("", "width"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}


text:
const DASHBOARD = 'Dashboard'
const USERS = 'Users'
const SETTINGS = 'Settings'
const PROFILE = 'Profile'
const ID = 'ID'
const FIRST_NAME = 'First Name'
const LAST_NAME = 'Last Name'
const GENDER = 'Gender'
const EMAIL = 'Email'

module.exports = {
  DASHBOARD,
  USERS,
  SETTINGS,
  PROFILE,
  ID,
  FIRST_NAME,
  LAST_NAME,
  GENDER,
  EMAIL
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package DefPackage;

import java.util.ArrayList;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;

/**
 *
 * @author tiialehikoinen
 */
public class Ruoka_annos {

    private Ruokalaji paaruoka;
    private Ruokalaji lisuke;
    private Ruokalaji jalkkari;

    public Ruoka_annos() {

    }

    public Ruoka_annos(Ruokalaji jalkkari) {
        this.jalkkari = jalkkari;
    }

    public Ruoka_annos(Ruokalaji paaruoka, Ruokalaji lisuke) {
        this.paaruoka = paaruoka;
        this.lisuke = lisuke;

    }

    public void setPaaruoka(Ruokalaji paaruoka) {
        this.paaruoka = paaruoka;
    }

    public void setLisuke(Ruokalaji lisuke) {
        this.lisuke = lisuke;
    }

    public void setJalkkari(Ruokalaji jalkkari) {
        this.jalkkari = jalkkari;
    }

    public double annosHinta(Ruoka_annos annos) {
        paaruoka = annos.getPaaruoka();
        lisuke = annos.getLisuke();
        double hinta = ((lisuke.getOstohinta()) + (paaruoka.getOstohinta()));
        return hinta;

    }

    public double jalkkariHinta(Ruoka_annos annos) {
        jalkkari = annos.getJalkkari();
        double hinta = jalkkari.getOstohinta();
        return hinta;
    }

    public Ruokalaji getPaaruoka() {
        return paaruoka;
    }

    public Ruokalaji getJalkkari() {
        return jalkkari;
    }

    public Ruokalaji getLisuke() {
        return lisuke;
    }

    @Override
    public String toString() {
        return paaruoka + " ja " + lisuke;
    }

    public ObservableList listaus(Ruokalaji paaruoka, Ruokalaji lisuke) {
        ObservableList<Ruokalaji> lista = FXCollections.observableArrayList();
        lista.add(paaruoka);
        lista.add(lisuke);

        return lista;
    }

    public double annosMyyntiHinta(Ruoka_annos annos){
        paaruoka = annos.getPaaruoka();
        lisuke = annos.getLisuke();
        double hinta = ((lisuke.getMyyntihinta()) + (paaruoka.getMyyntihinta()));
        return hinta;
    }

    public double jalkkariMyyntiHinta(Ruoka_annos annos){
        jalkkari = annos.getJalkkari();
        double hinta = jalkkari.getMyyntihinta();
        return hinta;
    }

}


text:
package java.lang.annotation;

/**
 * <p>
 * A meta-annotation used to indicate that a type's annotation are documented
 * and part of the public API.
 * </p>
 *
 * @since 1.5
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface Documented {
}