text:
.class Lcom/htc/app/FilePickerCore$20;
.super Ljava/lang/Object;
.source "FilePickerCore.java"

# interfaces
.implements Landroid/content/DialogInterface$OnClickListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/htc/app/FilePickerCore;->createNetworkSettingDialog()Landroid/app/Dialog;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/htc/app/FilePickerCore;

# direct methods
.method constructor <init>(Lcom/htc/app/FilePickerCore;)V
    .locals 0
    .parameter

    .prologue
    .line 3802
    iput-object p1, p0, Lcom/htc/app/FilePickerCore$20;->this$0:Lcom/htc/app/FilePickerCore;

    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onClick(Landroid/content/DialogInterface;I)V
    .locals 3
    .parameter "dialog"
    .parameter "whichButton"

    .prologue
    .line 3804
    new-instance v1, Landroid/content/Intent;

    const-string v2, "android.settings.WIRELESS_SETTINGS"

    invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 3806
    .local v1, i:Landroid/content/Intent;
    invoke-interface {p1}, Landroid/content/DialogInterface;->dismiss()V

    .line 3807
    iget-object v2, p0, Lcom/htc/app/FilePickerCore$20;->this$0:Lcom/htc/app/FilePickerCore;

    invoke-virtual {v2}, Lcom/htc/app/FilePickerCore;->getActivity()Landroid/app/Activity;

    move-result-object v0

    .line 3808
    .local v0, activity:Landroid/app/Activity;
    invoke-virtual {v0, v1}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V

    .line 3809
    return-void
.end method

redpajama_set_name: RedPajamaGithub


text:
layout: default
---
### Open Glasgow API's

*   [Mobility API](./mobility.md).
*   [Traffic API](./traffic.md).

[back](../)


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html lang=en xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>{{site.title}} - {{page.title}}</title>
		<meta name="description" content="{% if page.description %}{{page.description}}{% else %}{{site.description}}{% endif %}">
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">

		<link rel="stylesheet" href="/assets/css/styles.css">

		<script src="/assets/js/jquery.js"></script>
		<script src="/assets/js/scroll.js"></script>
		<script src="/assets/js/forms.js"></script>

		<!--[if lte IE 8]><script src="{{site.url}}/assets/js/ie.js"></script><![endif]-->
		<!--<script src=/assets/js/bundle.js></script>-->
		<!--<script src=/assets/js/components.js></script>-->
		{% if page.theme-color %}
			<meta name="theme-color" content="{{ page.theme-color }}">
		{% else %}
			<meta name="theme-color" content="#689f38">
		{% endif %}
		<meta name="keywords" content="Liam Craver,Lime Studios,Lime,Studios,web design,graphic design,css,html,{{site.keywords}},{{page.keywords}}">
		<meta name="author" content="{{author.name.first}} {{author.name.last}}">
		<meta name="google-site-verification" content="7RrfJovl477GocUkq4QOPIybas99RN2zebN46jgN_Lo">
		<meta name="format-detection" content="telephone=yes">
		<meta name="apple-mobile-web-app-title" content="{{site.title}}">
		<meta property="og:type" content="website">
		<meta property="og:title" content="{{page.title}}">
		<meta property="og:description" content="{% if page.subtitle %}{{page.subtitle}}{% else %}{{site.description}}{% endif %}">
		<meta property="og:url" content="{{site.url}}">
		<meta property="og:site_name" content="{{site.title}}">
		<meta property="og:profile:first_name" content="{{author.name.first}}">
		<meta property="og:profile:last_name" content="{{author.name.last}}">
		<meta property="og:image" content="{% if page.cover-image %}{{page.cover-image}}{% else %}{{site.icon}}{% endif %}">
		<!--<meta property="og:image:type" content="image/png">-->
		<meta name="twitter:card" content="summary">
		<meta name="twitter:site" content="{{site.title}}">
		<meta name="twitter:title" content="{{page.title}}">
		<meta name="twitter:description" content="{% if page.subtitle %}{{page.subtitle}}{% else %}{{site.description}}{% endif %}">
		<meta name="twitter:creator" content="{{author.name.first}} {{author.name.last}}">
		<meta name="twitter:image:src" content="{% if page.cover-image %}{{page.cover-image}}{% else %}{{site.icon}}{% endif %}">
		<meta name="twitter:domain" content="{{site.url}}">
		<link rel="apple-touch-icon-precomposed" href="/assets/img/site/icon/logo.png">
		<link rel="icon" href="/assets/img/site/icon/logo16.png" size="16x16">
		<link rel="icon" href="/assets/img/site/icon/logo32.png" size="32x32">
		<link rel="icon" href="/assets/img/site/icon/logo48.png" size="48x48">
		<link rel="icon" href="/assets/img/site/icon/logo64.png" size="64x64">
		<link rel="icon" href="/assets/img/site/icon/logo128.png" size="128x128">

		<link rel="icon" type="image/png" href="/assets/img/site/icon/logo64.png">
		<link rel="shortcut icon" href="/assets/img/site/icon/logo64.png" type="image/x-icon" />

		<link rel="icon" sizes="192x192" href="/assets/img/site/icon/logo192.png">
		<link rel="apple-touch-icon" href="/assets/img/site/icon/logo64.png">
		<meta name="msapplication-square310x310logo" content="/assets/img/site/icon/logo310.png">

		<!-- [if IE]><link rel="shortcut icon" href="/assets/img/site/icon/ie.ico"><![endif]-->
		<script>
			//document.getElementById("date").innerHTML = new Date().getTime();
		</script>
	</head>
<body id="page-top" class="{{page.ref}}">


text:
Qiankun::Admin.controllers :activities do
  get :index do
    @title = "Activities"
    @activities = Activity.all
    render 'activities/index'
  end

  get :new do
    @title = pat(:new_title, :model => 'activity')
    @activity = Activity.new
    render 'activities/new'
  end

  post :create do
    @activity = Activity.new(params[:activity])
    if @activity.save
      @title = pat(:create_title, :model => "activity #{@activity.id}")
      flash[:success] = pat(:create_success, :model => 'Activity')
      params[:save_and_continue] ? redirect(url(:activities, :index)) : redirect(url(:activities, :edit, :id => @activity.id))
    else
      @title = pat(:create_title, :model => 'activity')
      flash.now[:error] = pat(:create_error, :model => 'activity')
      render 'activities/new'
    end
  end

  get :edit, :with => :id do
    @title = pat(:edit_title, :model => "activity #{params[:id]}")
    @activity = Activity.find(params[:id])
    if @activity
      render 'activities/edit'
    else
      flash[:warning] = pat(:create_error, :model => 'activity', :id => "#{params[:id]}")
      halt 404
    end
  end

  put :update, :with => :id do
    @title = pat(:update_title, :model => "activity #{params[:id]}")
    @activity = Activity.find(params[:id])
    if @activity
      if @activity.update_attributes(params[:activity])
        flash[:success] = pat(:update_success, :model => 'Activity', :id =>  "#{params[:id]}")
        params[:save_and_continue] ?
          redirect(url(:activities, :index)) :
          redirect(url(:activities, :edit, :id => @activity.id))
      else
        flash.now[:error] = pat(:update_error, :model => 'activity')
        render 'activities/edit'
      end
    else
      flash[:warning] = pat(:update_warning, :model => 'activity', :id => "#{params[:id]}")
      halt 404
    end
  end

  delete :destroy, :with => :id do
    @title = "Activities"
    activity = Activity.find(params[:id])
    if activity
      if activity.destroy
        flash[:success] = pat(:delete_success, :model => 'Activity', :id => "#{params[:id]}")
      else
        flash[:error] = pat(:delete_error, :model => 'activity')
      end
      redirect url(:activities, :index)
    else
      flash[:warning] = pat(:delete_warning, :model => 'activity', :id => "#{params[:id]}")
      halt 404
    end
  end

  delete :destroy_many do
    @title = "Activities"
    unless params[:activity_ids]
      flash[:error] = pat(:destroy_many_error, :model => 'activity')
      redirect(url(:activities, :index))
    end
    ids = params[:activity_ids].split(',').map(&:strip)
    activities = Activity.find(ids)

    if Activity.destroy activities

      flash[:success] = pat(:destroy_many_success, :model => 'Activities', :ids => "#{ids.to_sentence}")
    end
    redirect url(:activities, :index)
  end
end


text:
/*
 * 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 org.gbif.checklistbank.ws.mapper;

import org.gbif.ws.NotFoundException;
import org.gbif.ws.WebApplicationException;

import java.util.Map;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.error.ErrorAttributeOptions;
import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.context.request.WebRequest;

@ControllerAdvice
public class ExceptionMapper {

  @Autowired private ErrorAttributes errorAttributes;

  @SuppressWarnings("rawtypes")
  @ExceptionHandler(WebApplicationException.class)
  public ResponseEntity<Object> handleWebApplicationException(
      WebRequest request, NotFoundException e) {
    return buildResponse(request, e.getStatus(), e.getMessage());
  }

  private ResponseEntity<Object> buildResponse(WebRequest request, int status, String message) {
    HttpStatus httpStatus = HttpStatus.resolve(status);
    if (httpStatus == null) {
      throw new IllegalArgumentException("Invalid http status: " + status);
    }

    Map<String, Object> body =
        errorAttributes.getErrorAttributes(request, ErrorAttributeOptions.defaults());
    body.put("status", httpStatus.value());
    Optional.ofNullable(message).ifPresent(m -> body.put("message", m));
    body.put("error", "");

    return ResponseEntity.status(status).contentType(MediaType.APPLICATION_JSON).body(body);
  }
}


text:
#pragma once
#include <aws/ram/RAM_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace RAM
{
namespace Model
{
  class AWS_RAM_API DisassociateResourceSharePermissionResult
  {
  public:
    DisassociateResourceSharePermissionResult();
    DisassociateResourceSharePermissionResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    DisassociateResourceSharePermissionResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
A return value of true indicates that the request succeeded. A
     * value of false indicates that the request failed.

     */
    inline bool GetReturnValue() const{ return m_returnValue; }

    /**
     *
A return value of true indicates that the request succeeded. A
     * value of false indicates that the request failed.

     */
    inline void SetReturnValue(bool value) { m_returnValue = value; }

    /**
     *
A return value of true indicates that the request succeeded. A
     * value of false indicates that the request failed.

     */
    inline DisassociateResourceSharePermissionResult& WithReturnValue(bool value) { SetReturnValue(value); return *this;}

    /**
     *
The idempotency identifier associated with this request. If you want to
     * repeat the same operation in an idempotent manner then you must include this
     * value in the clientToken request parameter of that later call. All
     * other parameters must also have the same values that you used in the first
     * call.

     */
    inline const Aws::String& GetClientToken() const{ return m_clientToken; }

    /**
     *
The idempotency identifier associated with this request. If you want to
     * repeat the same operation in an idempotent manner then you must include this
     * value in the clientToken request parameter of that later call. All
     * other parameters must also have the same values that you used in the first
     * call.

     */
    inline void SetClientToken(const Aws::String& value) { m_clientToken = value; }

    /**
     *
The idempotency identifier associated with this request. If you want to
     * repeat the same operation in an idempotent manner then you must include this
     * value in the clientToken request parameter of that later call. All
     * other parameters must also have the same values that you used in the first
     * call.

     */
    inline void SetClientToken(Aws::String&& value) { m_clientToken = std::move(value); }

    /**
     *
The idempotency identifier associated with this request. If you want to
     * repeat the same operation in an idempotent manner then you must include this
     * value in the clientToken request parameter of that later call. All
     * other parameters must also have the same values that you used in the first
     * call.

     */
    inline void SetClientToken(const char* value) { m_clientToken.assign(value); }

    /**
     *
The idempotency identifier associated with this request. If you want to
     * repeat the same operation in an idempotent manner then you must include this
     * value in the clientToken request parameter of that later call. All
     * other parameters must also have the same values that you used in the first
     * call.

     */
    inline DisassociateResourceSharePermissionResult& WithClientToken(const Aws::String& value) { SetClientToken(value); return *this;}

    /**
     *
The idempotency identifier associated with this request. If you want to
     * repeat the same operation in an idempotent manner then you must include this
     * value in the clientToken request parameter of that later call. All
     * other parameters must also have the same values that you used in the first
     * call.

     */
    inline DisassociateResourceSharePermissionResult& WithClientToken(Aws::String&& value) { SetClientToken(std::move(value)); return *this;}

    /**
     *
The idempotency identifier associated with this request. If you want to
     * repeat the same operation in an idempotent manner then you must include this
     * value in the clientToken request parameter of that later call. All
     * other parameters must also have the same values that you used in the first
     * call.

     */
    inline DisassociateResourceSharePermissionResult& WithClientToken(const char* value) { SetClientToken(value); return *this;}

  private:

    bool m_returnValue;

    Aws::String m_clientToken;
  };

} // namespace Model
} // namespace RAM
} // namespace Aws


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="esgi.project.wehud.activity.PublishActivity">

    <include
        android:id="@+id/toolbar"
        layout="@layout/toolbar" />

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="@dimen/newPost_padding">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <EditText
                android:id="@+id/newPost_video"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/hint_video"
                android:maxLines="@integer/text_maxLines" />

            <MultiAutoCompleteTextView
                android:id="@+id/newPost_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/newPost_marginTop"
                android:hint="@string/hint_text"
                android:maxLines="@integer/text_maxLines" />

            <CheckBox
                android:id="@+id/newPost_isOpinion"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/newPost_marginTop"
                android:text="@string/newPost_isOpinion" />

            <CheckBox
                android:id="@+id/newPost_encryptMessage"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/newPost_marginTop"
                android:text="@string/newPost_encryptMessage"
                android:visibility="gone" />

            <RatingBar
                android:id="@+id/newPost_mark"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginTop="@dimen/newPost_marginTop"
                android:numStars="@integer/newOpinion_numStars"
                android:visibility="gone" />

            <AutoCompleteTextView
                android:id="@+id/newPost_game"
                style="@style/TextAppearance.AppCompat.Medium"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/newPost_marginTop"
                android:hint="@string/newPost_gameOptional"
                android:textColor="@android:color/holo_blue_dark" />

            <AutoCompleteTextView
                android:id="@+id/newPost_receiver"
                style="@style/TextAppearance.AppCompat.Medium"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/newPost_marginTop"
                android:clickable="true"
                android:hint="@string/newPost_receiverOptional"
                android:textColor="@android:color/holo_blue_dark" />

            <Button
                android:id="@+id/newPost_publishButton"
                style="@style/Widget.AppCompat.Button.Colored"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/publishButton_marginTop"
                android:text="@string/publish" />

        </LinearLayout>

    </ScrollView>

</LinearLayout>


text:
if defined? Localeapp
  Localeapp.configure do |config|
    config.api_key = ENV['LOCALE_APP_KEY']
    config.sending_environments = []
    config.polling_environments = []
    config.reloading_environments = [:development, :production]
    config.cache_missing_translations = true
  end
end


text:
package plugin

import "github.com/docker/docker/pkg/plugins"

// Plugin represents a plugin. It is used to abstract from an older plugin architecture (in pkg/plugins).
type Plugin interface {
	Client() *plugins.Client
	Name() string
	IsLegacy() bool
}


text:
import conftest

def test_new(client):
	expected_keys = {"Hash"}
	res = client.object.new()
	assert set(res.keys()).issuperset(expected_keys)

def test_stat(client):
	expected_keys = {"Hash", "CumulativeSize", "DataSize", "NumLinks", "LinksSize", "BlockSize"}
	resource = client.add_str("Mary had a little lamb")
	resp_stat = client.object.stat(resource)
	assert set(resp_stat.keys()).issuperset(expected_keys)

def test_put_get(client):
	# Set paths to test json files
	path_no_links = conftest.TEST_DIR / "fake_json" / "no_links.json"
	path_links = conftest.TEST_DIR / "fake_json" / "links.json"

	# Put the json objects on the DAG
	no_links = client.object.put(path_no_links)
	links = client.object.put(path_links)

	# Verify the correct content was put
	assert no_links["Hash"] == "QmXg9Pp2ytZ14xgmQjYEiHjVjMFXzCVVEcRTWJBmLgR39V"
	assert links["Hash"] == "QmZZmY4KCu9r3e7M2Pcn46Fc5qbn6NpzaAGaYb22kbfTqm"

	# Get the objects from the DAG
	get_no_links = client.object.get("QmXg9Pp2ytZ14xgmQjYEiHjVjMFXzCVVEcRTWJBmLgR39V")
	get_links = client.object.get("QmZZmY4KCu9r3e7M2Pcn46Fc5qbn6NpzaAGaYb22kbfTqm")

	# Verify the objects we put have been gotten
	assert get_no_links["Data"] == "abc"
	assert get_links["Data"] == "another"
	assert get_links["Links"][0]["Name"] == "some link"

def test_links(client):
	# Set paths to test json files
	path_links = conftest.TEST_DIR / "fake_json" / "links.json"

	# Put json object on the DAG and get its links
	client.object.put(path_links)
	links = client.object.links("QmZZmY4KCu9r3e7M2Pcn46Fc5qbn6NpzaAGaYb22kbfTqm")

	# Verify the correct link has been gotten
	assert links["Links"][0]["Hash"] == "QmXg9Pp2ytZ14xgmQjYEiHjVjMFXzCVVEcRTWJBmLgR39V"

def test_data(client):
	# Set paths to test json files
	path_links = conftest.TEST_DIR / "fake_json" / "links.json"

	# Put json objects on the DAG and get its data
	client.object.put(path_links)
	data = client.object.data("QmZZmY4KCu9r3e7M2Pcn46Fc5qbn6NpzaAGaYb22kbfTqm")

	# Verify the correct bytes have been gotten
	assert data == b"another"

def test_patch_append_data(client):
	"""Warning, this test depends on the contents of
		test/functional/fake_dir/fsdfgh
	"""
	result = client.object.patch.append_data(
		"QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n",
		conftest.TEST_DIR / "fake_dir" / "fsdfgh"
	)
	assert result == {"Hash": "QmcUsyoGVxWoQgYKgmLaDBGm8J3eHWfchMh3oDUD5FrrtN"}

def test_patch_add_link(client):
	"""Warning, this test depends on the contents of
		test/functional/fake_dir/fsdfgh
	"""
	result = client.object.patch.add_link(
		"QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n", "self",
		"QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n"
	)
	assert result == {"Hash": "QmbWSr7YXBLcF23VVb7yPvUuogUPn46GD7gXftXC6mmsNM"}

def test_patch_rm_link(client):
	"""Warning, this test depends on the contents of
		test/functional/fake_dir/fsdfgh
	"""
	result = client.object.patch.rm_link(
		"QmbWSr7YXBLcF23VVb7yPvUuogUPn46GD7gXftXC6mmsNM", "self"
	)
	assert result == {"Hash": "QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n"}

def test_patch_set_data(client):
	"""Warning, this test depends on the contents of
		test/functional/fake_dir/popoiopiu
	"""
	result = client.object.patch.set_data(
		"QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n",
		conftest.TEST_DIR / "fake_dir" / "popoiopiu"
	)
	assert result == {"Hash": "QmV4QR7MCBj5VTi6ddHmXPyjWGzbaKEtX2mx7axA5PA13G"}


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.4.4.22-9-6
description: >
    Array.prototype.reduceRight visits deleted element in array after
    the call when same index is also present in prototype
---*/

  function callbackfn(prevVal, curVal, idx, obj)
  {
    delete arr[1];
    delete arr[2];
    return prevVal + curVal;
  }
  Array.prototype[2] = 6;
  var arr = ['1',2,3,4,5];
  var res = arr.reduceRight(callbackfn);
  delete Array.prototype[2];

//one element deleted
assert.sameValue(res, "151", 'res');


text:
using System;
using System.Collections.Generic;
using System.Net;
using UnityEngine;
using UnityEngine.Networking;

namespace MLAPI.Transports.UNET
{
    public static class RelayTransport
    {
        private enum MessageType
        {
            StartServer,
            ConnectToServer,
            Data,
            ClientDisconnect,
            AddressReport
        }

        private static byte s_DefaultChannelId;
        private static int s_RelayConnectionId;
        private static bool s_IsClient = false;
        private static string s_Address;
        private static ushort s_Port;
        private static List<ChannelQOS> s_Channels = new List<ChannelQOS>();

        public static bool Enabled { get; set; } = true;
        public static string RelayAddress { get; set; } = "127.0.0.1";
        public static ushort RelayPort { get; set; } = 8888;

        public static event Action<IPEndPoint> OnRemoteEndpointReported;

        public static int Connect(int hostId, string serverAddress, int serverPort, int exceptionConnectionId, out byte error)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.Connect(hostId, serverAddress, serverPort, exceptionConnectionId, out error);

            s_IsClient = true;

            s_Address = serverAddress;
            s_Port = (ushort)serverPort;

            s_RelayConnectionId = UnityEngine.Networking.NetworkTransport.Connect(hostId, RelayAddress, RelayPort, exceptionConnectionId, out error); // Requests connection

            return s_RelayConnectionId;
        }

        public static int ConnectWithSimulator(int hostId, string serverAddress, int serverPort, int exceptionConnectionId, out byte error, ConnectionSimulatorConfig conf)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.ConnectWithSimulator(hostId, serverAddress, serverPort, exceptionConnectionId, out error, conf);

            s_IsClient = true;

            s_Address = serverAddress;
            s_Port = (ushort)serverPort;

            s_RelayConnectionId = UnityEngine.Networking.NetworkTransport.ConnectWithSimulator(hostId, RelayAddress, RelayPort, exceptionConnectionId, out error, conf); // Requests connection

            return s_RelayConnectionId;
        }

        public static int ConnectEndPoint(int hostId, EndPoint endPoint, int exceptionConnectionId, out byte error)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.ConnectEndPoint(hostId, endPoint, exceptionConnectionId, out error);

            s_IsClient = true;

            s_Address = ((IPEndPoint)endPoint).Address.ToString();
            s_Port = (ushort)((IPEndPoint)endPoint).Port;

            s_RelayConnectionId = UnityEngine.Networking.NetworkTransport.Connect(hostId, RelayAddress, RelayPort, exceptionConnectionId, out error); // Requests connection

            return s_RelayConnectionId;
        }

        private static void SetChannelsFromTopology(HostTopology topology) => s_Channels = topology.DefaultConfig.Channels;

        public static int AddHost(HostTopology topology, bool createServer)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.AddHost(topology, 0, null);

            s_IsClient = !createServer;

            s_DefaultChannelId = topology.DefaultConfig.AddChannel(QosType.ReliableSequenced);

            SetChannelsFromTopology(topology);

            int ret = UnityEngine.Networking.NetworkTransport.AddHost(topology, 0, null);

            if (createServer) s_RelayConnectionId = UnityEngine.Networking.NetworkTransport.Connect(ret, RelayAddress, RelayPort, 0, out byte b);

            return ret;
        }

        public static int AddHost(HostTopology topology, int port, bool createServer)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.AddHost(topology, port);

            s_IsClient = !createServer;

            s_DefaultChannelId = topology.DefaultConfig.AddChannel(QosType.ReliableSequenced);

            SetChannelsFromTopology(topology);

            int ret = UnityEngine.Networking.NetworkTransport.AddHost(topology, port);

            if (createServer) s_RelayConnectionId = UnityEngine.Networking.NetworkTransport.Connect(ret, RelayAddress, RelayPort, 0, out byte b);

            return ret;
        }

        public static int AddHost(HostTopology topology, int port, string ip, bool createServer)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.AddHost(topology, port, ip);

            s_IsClient = !createServer;

            s_DefaultChannelId = topology.DefaultConfig.AddChannel(QosType.ReliableSequenced);

            SetChannelsFromTopology(topology);

            int ret = UnityEngine.Networking.NetworkTransport.AddHost(topology, port, ip);

            if (createServer) s_RelayConnectionId = UnityEngine.Networking.NetworkTransport.Connect(ret, RelayAddress, RelayPort, 0, out byte b);

            return ret;
        }

        public static int AddHostWithSimulator(HostTopology topology, int minTimeout, int maxTimeout, int port, string ip, bool createServer)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.AddHostWithSimulator(topology, minTimeout, maxTimeout);

            s_IsClient = !createServer;

            s_DefaultChannelId = topology.DefaultConfig.AddChannel(QosType.ReliableSequenced);

            SetChannelsFromTopology(topology);

            int ret = UnityEngine.Networking.NetworkTransport.AddHostWithSimulator(topology, minTimeout, maxTimeout, port, ip);

            if (createServer) s_RelayConnectionId = UnityEngine.Networking.NetworkTransport.Connect(ret, RelayAddress, RelayPort, 0, out byte b);

            return ret;
        }

        public static int AddHostWithSimulator(HostTopology topology, int minTimeout, int maxTimeout, bool createServer)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.AddHostWithSimulator(topology, minTimeout, maxTimeout);

            s_IsClient = !createServer;

            s_DefaultChannelId = topology.DefaultConfig.AddChannel(QosType.ReliableSequenced);

            SetChannelsFromTopology(topology);

            int ret = UnityEngine.Networking.NetworkTransport.AddHostWithSimulator(topology, minTimeout, maxTimeout);

            if (createServer) s_RelayConnectionId = UnityEngine.Networking.NetworkTransport.Connect(ret, RelayAddress, RelayPort, 0, out byte b);

            return ret;
        }

        public static int AddHostWithSimulator(HostTopology topology, int minTimeout, int maxTimeout, int port, bool createServer)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.AddHostWithSimulator(topology, minTimeout, maxTimeout, port);

            s_IsClient = !createServer;

            SetChannelsFromTopology(topology);

            int ret = UnityEngine.Networking.NetworkTransport.AddHostWithSimulator(topology, minTimeout, maxTimeout, port);

            if (createServer) s_RelayConnectionId = UnityEngine.Networking.NetworkTransport.Connect(ret, RelayAddress, RelayPort, 0, out byte b);

            return ret;
        }

        public static int AddWebsocketHost(HostTopology topology, int port, bool createServer)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.AddWebsocketHost(topology, port);

            s_IsClient = !createServer;

            s_DefaultChannelId = topology.DefaultConfig.AddChannel(QosType.ReliableSequenced);

            SetChannelsFromTopology(topology);

            int ret = UnityEngine.Networking.NetworkTransport.AddWebsocketHost(topology, port);

            if (createServer) s_RelayConnectionId = UnityEngine.Networking.NetworkTransport.Connect(ret, RelayAddress, RelayPort, 0, out byte b);

            return ret;
        }

        public static int AddWebsocketHost(HostTopology topology, int port, string ip, bool createServer)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.AddWebsocketHost(topology, port, ip);

            s_IsClient = !createServer;

            s_DefaultChannelId = topology.DefaultConfig.AddChannel(QosType.ReliableSequenced);

            SetChannelsFromTopology(topology);

            int ret = UnityEngine.Networking.NetworkTransport.AddWebsocketHost(topology, port, ip);

            if (createServer) s_RelayConnectionId = UnityEngine.Networking.NetworkTransport.Connect(ret, RelayAddress, RelayPort, 0, out byte b);

            return ret;
        }

        private static readonly byte[] disconnectBuffer = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, (byte)MessageType.ClientDisconnect };

        public static bool Disconnect(int hostId, int connectionId, out byte error)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.Disconnect(hostId, connectionId, out error);

            if (!s_IsClient)
            {
                for (byte i = 0; i < sizeof(ulong); i++) disconnectBuffer[i] = ((byte)((ulong)connectionId >> (i * 8)));

                return UnityEngine.Networking.NetworkTransport.Send(hostId, s_RelayConnectionId, s_DefaultChannelId, disconnectBuffer, 9, out error);
            }

            return UnityEngine.Networking.NetworkTransport.Disconnect(hostId, connectionId, out error);
        }

        public static bool Send(int hostId, int connectionId, int channelId, byte[] buffer, int size, out byte error)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.Send(hostId, connectionId, channelId, buffer, size, out error);

            ++size;

            if (!s_IsClient)
            {
                size += 8;

                int connectionIdOffset = size - 9;

                for (byte i = 0; i < sizeof(ulong); i++) buffer[connectionIdOffset + i] = ((byte)((ulong)connectionId >> (i * 8)));
            }

            buffer[size - 1] = (byte)MessageType.Data;

            return UnityEngine.Networking.NetworkTransport.Send(hostId, s_RelayConnectionId, channelId, buffer, size, out error);
        }

        public static bool QueueMessageForSending(int hostId, int connectionId, int channelId, byte[] buffer, int size, out byte error)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.QueueMessageForSending(hostId, connectionId, channelId, buffer, size, out error);

            ++size;

            if (!s_IsClient)
            {
                size += 8;

                int connectionIdOffset = size - 9;

                for (byte i = 0; i < sizeof(ulong); i++) buffer[connectionIdOffset + i] = ((byte)((ulong)connectionId >> (i * 8)));
            }

            buffer[size - 1] = (byte)MessageType.Data;

            return UnityEngine.Networking.NetworkTransport.QueueMessageForSending(hostId, s_RelayConnectionId, channelId, buffer, size, out error);
        }

        public static bool SendQueuedMessages(int hostId, int connectionId, out byte error)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.SendQueuedMessages(hostId, connectionId, out error);

            return UnityEngine.Networking.NetworkTransport.SendQueuedMessages(hostId, s_RelayConnectionId, out error);
        }

        public static NetworkEventType ReceiveFromHost(int hostId, out int connectionId, out int channelId, byte[] buffer, int bufferSize, out int receivedSize, out byte error)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.ReceiveFromHost(hostId, out connectionId, out channelId, buffer, bufferSize, out receivedSize, out error);

            var eventType = UnityEngine.Networking.NetworkTransport.ReceiveFromHost(hostId, out connectionId, out channelId, buffer, bufferSize, out receivedSize, out error);

            return BaseReceive(eventType, hostId, ref connectionId, ref channelId, buffer, bufferSize, ref receivedSize, ref error);
        }

        public static NetworkEventType Receive(out int hostId, out int connectionId, out int channelId, byte[] buffer, int bufferSize, out int receivedSize, out byte error)
        {
            if (!Enabled) return UnityEngine.Networking.NetworkTransport.Receive(out hostId, out connectionId, out channelId, buffer, bufferSize, out receivedSize, out error);

            var eventType = UnityEngine.Networking.NetworkTransport.Receive(out hostId, out connectionId, out channelId, buffer, bufferSize, out receivedSize, out error);

            return BaseReceive(eventType, hostId, ref connectionId, ref channelId, buffer, bufferSize, ref receivedSize, ref error);
        }

        private static NetworkEventType BaseReceive(NetworkEventType netEvent, int hostId, ref int connectionId, ref int channelId, byte[] buffer, int bufferSize, ref int receivedSize, ref byte error)
        {
            switch (netEvent)
            {
                case NetworkEventType.DataEvent:
                {
                    var messageType = (MessageType)buffer[receivedSize - 1];

                    switch (messageType)
                    {
                        case MessageType.AddressReport:
                        {
                            byte[] addressBytes = new byte[16];

                            for (int i = 0; i < addressBytes.Length; i++)
                            {
                                addressBytes[i] = buffer[i];
                            }

                            ushort remotePort = (ushort)(((ushort)buffer[16]) |
                                                         ((ushort)buffer[17] << 8));

                            var remoteEndPoint = new IPEndPoint(new IPAddress(addressBytes), remotePort);

                            OnRemoteEndpointReported?.Invoke(remoteEndPoint);

                            break;
                        }
                        case MessageType.ConnectToServer: // Connection approved
                        {
                            if (!s_IsClient)
                            {
                                ulong _connectionId = (((ulong)buffer[receivedSize - 9]) |
                                                       ((ulong)buffer[receivedSize - 8] << 8) |
                                                       ((ulong)buffer[receivedSize - 7] << 16) |
                                                       ((ulong)buffer[receivedSize - 6] << 24) |
                                                       ((ulong)buffer[receivedSize - 5] << 32) |
                                                       ((ulong)buffer[receivedSize - 4] << 40) |
                                                       ((ulong)buffer[receivedSize - 3] << 48) |
                                                       ((ulong)buffer[receivedSize - 2] << 56));

                                connectionId = (int)_connectionId;
                            }

                            return NetworkEventType.ConnectEvent;
                        }
                        case MessageType.Data:
                        {
                            // Implicitly remove header
                            if (s_IsClient) --receivedSize;
                            else
                            {
                                receivedSize -= 9;

                                ulong _connectionId = (((ulong)buffer[receivedSize]) |
                                                       ((ulong)buffer[receivedSize + 1] << 8) |
                                                       ((ulong)buffer[receivedSize + 2] << 16) |
                                                       ((ulong)buffer[receivedSize + 3] << 24) |
                                                       ((ulong)buffer[receivedSize + 4] << 32) |
                                                       ((ulong)buffer[receivedSize + 5] << 40) |
                                                       ((ulong)buffer[receivedSize + 6] << 48) |
                                                       ((ulong)buffer[receivedSize + 7] << 56));

                                connectionId = (int)_connectionId;
                            }

                            return NetworkEventType.DataEvent;
                        }
                        case MessageType.ClientDisconnect:
                        {
                            ulong _connectionId = (((ulong)buffer[0]) |
                                                   ((ulong)buffer[1] << 8) |
                                                   ((ulong)buffer[2] << 16) |
                                                   ((ulong)buffer[3] << 24) |
                                                   ((ulong)buffer[4] << 32) |
                                                   ((ulong)buffer[5] << 40) |
                                                   ((ulong)buffer[6] << 48) |
                                                   ((ulong)buffer[7] << 56));

                            connectionId = (int)_connectionId;

                            return NetworkEventType.DisconnectEvent;
                        }
                    }
                }
                    break;
                case NetworkEventType.ConnectEvent:
                {
                    if (s_IsClient)
                    {
                        //Connect via relay

                        byte[] ipv6AddressBuffer;
                        var ipAddress = IPAddress.Parse(s_Address);

                        if (ipAddress.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
                        {
                            ipv6AddressBuffer = ipAddress.GetAddressBytes();
                        }
                        else if (ipAddress.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                        {
                            byte[] ipv4Address = ipAddress.GetAddressBytes();
                            ipv6AddressBuffer = new byte[16] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, ipv4Address[0], ipv4Address[1], ipv4Address[2], ipv4Address[3] };
                        }
                        else
                        {
                            // TODO: Throw wrong type
                            ipv6AddressBuffer = null;
                        }

                        // TODO: Throw if address is not 16 bytes. It should always be
                        for (int i = 0; i < ipv6AddressBuffer.Length; i++) buffer[i] = ipv6AddressBuffer[i];

                        for (byte i = 0; i < sizeof(ushort); i++) buffer[16 + i] = ((byte)(s_Port >> (i * 8)));

                        buffer[16 + 2] = (byte)MessageType.ConnectToServer;

                        UnityEngine.Networking.NetworkTransport.Send(hostId, connectionId, s_DefaultChannelId, buffer, 16 + 2 + 1, out error);
                    }
                    else
                    {
                        //Register us as a server
                        buffer[0] = (byte)MessageType.StartServer;

                        UnityEngine.Networking.NetworkTransport.Send(hostId, connectionId, s_DefaultChannelId, buffer, 1, out error);
                    }

                    return NetworkEventType.Nothing; // Connect event is ignored
                }
                case NetworkEventType.DisconnectEvent:
                {
                    if ((NetworkError)error == NetworkError.CRCMismatch) Debug.LogError("[MLAPI.Relay] The MLAPI Relay detected a CRC mismatch. This could be due to the maxClients or other connectionConfig settings not being the same");

                    return NetworkEventType.DisconnectEvent;
                }
            }

            return netEvent;
        }
    }

    public class InvalidConfigException : SystemException
    {
        public InvalidConfigException() { }
        public InvalidConfigException(string issue) : base(issue) { }
    }
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
#pragma warning restore 618


text:
package genapi

import (
	"bufio"
	"fmt"
	"io"
	"net"
	. "testing"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

// simple middleware for testing. all accepted connections have the prefix
// immediately written to them
type prefixerListener struct {
	net.Listener
	prefix string
}

func (pl prefixerListener) Accept() (net.Conn, error) {
	c, err := pl.Listener.Accept()
	if err != nil {
		return c, err
	}

	fmt.Fprint(c, pl.prefix)
	return c, nil
}

func TestListenerReloader(t *T) {
	l, err := net.Listen("tcp", ":0") // any port
	require.Nil(t, err)

	assertReadLine := func(expect string, in io.Reader) {
		b, err := bufio.NewReader(in).ReadString('\n')
		require.Nil(t, err)
		assert.Equal(t, expect, string(b))
	}

	prefix := "foo\n"
	maker := func(ll net.Listener) (net.Listener, error) {
		return prefixerListener{ll, prefix}, nil
	}
	lr, err := newListenerReloader(l, maker)
	require.Nil(t, err)
	_, portStr, err := net.SplitHostPort(l.Addr().String())
	require.Nil(t, err)

	go func() {
		for {
			c, err := lr.Accept()
			require.Nil(t, err)
			c.Read(make([]byte, 1)) // block till close
		}
	}()

	c, err := net.Dial("tcp", "127.0.0.1:"+portStr)
	require.Nil(t, err)
	assertReadLine("foo\n", c)

	// swap the listener before closing that connection, so that when Accept is
	// called next it will be on the new "bar" listener
	prefix = "bar\n"
	require.Nil(t, lr.Reload())

	c.Close()

	c, err = net.Dial("tcp", "127.0.0.1:"+portStr)
	require.Nil(t, err)
	assertReadLine("bar\n", c)
	c.Close()
}

func TestListenerReloaderClose(t *T) {
	l, err := net.Listen("tcp", ":0") // any port
	require.Nil(t, err)

	maker := func(ll net.Listener) (net.Listener, error) {
		return prefixerListener{ll, "foo\n"}, nil
	}
	lr, err := newListenerReloader(l, maker)
	require.Nil(t, err)

	ch := make(chan error)
	// we do 2 at once to test for races
	go func() {
		ch <- lr.Close()
	}()
	go func() {
		ch <- lr.Close()
	}()

	// since we don't know how long Close() takes on a listener, the ordering is
	// unknown here, but one should be nil and one should not be
	err1 := <-ch
	err2 := <-ch
	assert.NotEqual(t, err1, err2)
	assert.True(t, err1 == nil || err2 == nil)
	assert.True(t, err1 != nil || err2 != nil)
}


text:
(*

category:      Test
synopsis:      Basic two reactions with four species in one 2D compartment,
               with non-unity stoichiometry.
componentTags: Compartment, Species, Reaction, Parameter
testTags:      Amount, NonUnityStoichiometry
testType:      TimeCourse
levels:        2.1, 2.2, 2.3, 2.4, 3.1
generatedBy:   Numeric

The model contains one compartment called "compartment".  There are four
species named S1, S2, S3 and S4 and two parameters named k1 and k2.
Compartment "compartment" is 2-dimensional.  The model contains two
reactions defined as:

[{width:30em,margin: 1em auto}|  *Reaction*  |  *Rate*  |
| S1 + S2 -> S3 + 2S4 | $k1 * S1 * S2 * compartment$  |
| S3 + S4 -> S1 + S2  | $k2 * S3 * S4 * compartment$  |]

The initial conditions are as follows:

[{width:30em,margin: 1em auto}|       |*Value*          |*Units*  |
|Initial amount of S1              |$ 1.0 \x 10^-6$ |mole                      |
|Initial amount of S2              |$ 0.5 \x 10^-6$ |mole                      |
|Initial amount of S3              |$ 2.0 \x 10^-6$ |mole                      |
|Initial amount of S4              |$            0$ |mole                      |
|Value of parameter k1             |$  0.9 \x 10^6$ |metre^2^ mole^-1^ second^-1^ |
|Value of parameter k2             |$ 0.15 \x 10^6$ |metre^2^ mole^-1^ second^-1^ |
|Area of compartment "compartment" |$1$             |metre^2^                     |]

The species values are given as amounts of substance to make it easier to
use the model in a discrete stochastic simulator, but (as per usual SBML
principles) their symbols represent their values in concentration units
where they appear in expressions.

*)

newcase[ "00266" ];

addCompartment[ compartment, size -> 1, spatialDimensions -> 2 ];
addSpecies[ S1, initialAmount -> 1.0 10^-6];
addSpecies[ S2, initialAmount -> 0.5 10^-6];
addSpecies[ S3, initialAmount -> 2.0 10^-6];
addSpecies[ S4, initialAmount -> 0];
addParameter[ k1, value -> 0.9 10^6 ];
addParameter[ k2, value -> 0.15 10^6 ];
addReaction[ S1 + S2 -> S3 + 2S4, reversible -> False,
	     kineticLaw -> k1 * S1 * S2 * compartment ];
addReaction[ S3 + S4 -> S1 + S2, reversible -> False,
	     kineticLaw -> k2 * S3 * S4 * compartment ];

makemodel[]


text:
using System;

class Program
{
    static void Main(string[] args)
    {
        System.Func<int, int> del = x => x + 1;
        System.Linq.Expressions.Expression<Func<int, int>> exp = x => x + 1;
    }
}


text:
/*
© 2017 Altavant Technologies Inc.
Web: http://www.altavant.com
*/

namespace Altavant.Fusion.UI.Lite
{
	using System;
	using Fusion.UI.Layers;
	using Fusion.Graphics;

	public class LayerCover : ICover
	{
		private ILayer _layer;
		private IPlane _plane;
		private ICleaner _cleaner;

		public LayerCover(ILayer layer)
			: this(layer, null)
		{

		}

		public LayerCover(ILayer layer, ICleaner cleaner)
		{
			if (layer == null)
				throw new ArgumentNullException(nameof(layer));

			_layer = layer;

			_plane = new Plane(this, null, _layer.GetNative(), new LayerBridge(_layer));
			_plane.Touchable = true;

			_cleaner = cleaner;
		}

		public CoverType Type
		{
			get
			{
				return CoverType.Layer;
			}
		}

		public ILayer Layer
		{
			get
			{
				return _layer;
			}
		}

		public IPlane Plane
		{
			get
			{
				return _plane;
			}
		}

		public ICleaner Cleaner
		{
			get
			{
				return _cleaner;
			}
		}

		public IWindow GetWindow()
		{
			return _layer.Widget.Window;
		}

		public bool WindowPointInside(Point pt)
		{
			return _layer.WindowPointInside(pt);
		}

		public bool WindowPointInside(float x, float y)
		{
			return _layer.WindowPointInside(x, y);
		}

		public bool ClientPointInside(Point pt)
		{
			return _layer.ClientPointInside(pt);
		}

		public bool ClientPointInside(float x, float y)
		{
			return _layer.ClientPointInside(x, y);
		}

		public Point ClientToWindow(Point pt)
		{
			return _layer.ClientToWindow(pt);
		}

		public Point ClientToWindow(float x, float y)
		{
			return _layer.ClientToWindow(x, y);
		}

		public Point WindowToClient(Point pt)
		{
			return _layer.WindowToClient(pt);
		}

		public Point WindowToClient(float x, float y)
		{
			return _layer.WindowToClient(x, y);
		}

		public Matrix ClientToWindow()
		{
			return _layer.ClientToWindow();
		}

		public Matrix WindowToClient()
		{
			return _layer.WindowToClient();
		}
	}
}


text:
/*
 * resizable_events.js
 */
(function($) {

module("resizable: events");

test("start", function() {

	expect(5);

	var count = 0,
		handle = ".ui-resizable-se";

	$("#resizable1").resizable({
		handles: "all",
		start: function(event, ui) {
			equal( ui.size.width, 100, "compare width" );
			equal( ui.size.height, 100, "compare height" );
			equal( ui.originalSize.width, 100, "compare original width" );
			equal( ui.originalSize.height, 100, "compare original height" );
			count++;
		}
	});

	TestHelpers.resizable.drag(handle, 50, 50);

	equal(count, 1, "start callback should happen exactly once");

});

test( "resize", function() {

	expect( 9 );

	var count = 0,
		handle = ".ui-resizable-se";

	$("#resizable1").resizable({
		handles: "all",
		resize: function( event, ui ) {
			if ( count === 0 ) {
				equal( ui.size.width, 125, "compare width" );
				equal( ui.size.height, 125, "compare height" );
				equal( ui.originalSize.width, 100, "compare original width" );
				equal( ui.originalSize.height, 100, "compare original height" );
			} else {
				equal( ui.size.width, 150, "compare width" );
				equal( ui.size.height, 150, "compare height" );
				equal( ui.originalSize.width, 100, "compare original width" );
				equal( ui.originalSize.height, 100, "compare original height" );
			}
			count++;
		}
	});

	TestHelpers.resizable.drag( handle, 50, 50 );

	equal( count, 2, "resize callback should happen exactly once per size adjustment" );

});

test( "resize (min/max dimensions)", function() {

	expect( 5 );

	var count = 0,
		handle = ".ui-resizable-se";

	$("#resizable1").resizable({
		handles: "all",
		minWidth: 60,
		minHeight: 60,
		maxWidth: 100,
		maxHeight: 100,
		resize: function( event, ui ) {
			equal( ui.size.width, 60, "compare width" );
			equal( ui.size.height, 60, "compare height" );
			equal( ui.originalSize.width, 100, "compare original width" );
			equal( ui.originalSize.height, 100, "compare original height" );
			count++;
		}
	});

	TestHelpers.resizable.drag( handle, -200, -200 );

	equal( count, 1, "resize callback should happen exactly once per size adjustment" );

});

test( "resize (containment)", function() {

	expect( 5 );

	var count = 0,
		handle = ".ui-resizable-se",
		container = $("#resizable1").wrap("<div>").parent().css({
			height: "100px",
			width: "100px"
		});

	$("#resizable1").resizable({
		handles: "all",
		containment: container,
		resize: function( event, ui ) {
			equal( ui.size.width, 10, "compare width" );
			equal( ui.size.height, 10, "compare height" );
			equal( ui.originalSize.width, 100, "compare original width" );
			equal( ui.originalSize.height, 100, "compare original height" );
			count++;
		}
	});

	// Prove you can't resize outside containment by dragging southeast corner southeast
	TestHelpers.resizable.drag( handle, 100, 100 );

	// Prove you can't resize outside containment by dragging southeast corner northwest
	TestHelpers.resizable.drag( handle, -200, -200 );

	equal( count, 1, "resize callback should happen exactly once per size adjustment" );

});

test("resize (grid)", function() {

	expect(5);

	var count = 0,
		handle = ".ui-resizable-se";

	$("#resizable1").resizable({
		handles: "all",
		grid: 50,
		resize: function(event, ui) {
			equal( ui.size.width, 150, "compare width" );
			equal( ui.size.height, 150, "compare height" );
			equal( ui.originalSize.width, 100, "compare original width" );
			equal( ui.originalSize.height, 100, "compare original height" );
			count++;
		}
	});

	TestHelpers.resizable.drag(handle, 50, 50);

	equal(count, 1, "resize callback should happen exactly once per grid-unit size adjustment");

});

test("stop", function() {

	expect(5);

	var count = 0,
		handle = ".ui-resizable-se";

	$("#resizable1").resizable({
		handles: "all",
		stop: function(event, ui) {
			equal( ui.size.width, 150, "compare width" );
			equal( ui.size.height, 150, "compare height" );
			equal( ui.originalSize.width, 100, "compare original width" );
			equal( ui.originalSize.height, 100, "compare original height" );
			count++;
		}
	});

	TestHelpers.resizable.drag(handle, 50, 50);

	equal(count, 1, "stop callback should happen exactly once");

});

test( "resize (containment) works with parent with negative offset", function() {

	expect( 1 );

	var widthBefore, widthAfter,
		handle = ".ui-resizable-e",
		target = $( "#resizable1" ),
		absoluteContainer = target.wrap( "<div />" ).parent(),
		fixedContainer = absoluteContainer.wrap( "<div />" ).parent(),
		increaseWidthBy = 50;

	// position fixed container in window top left
	fixedContainer.css({
		width: 400,
		height: 100,
		position: "fixed",
		top: 0,
		left: 0
	});

	// position absolute container within fixed on slightly outside window
	absoluteContainer.css({
		width: 400,
		height: 100,
		position: "absolute",
		top: 0,
		left: -50
	});

	// set up resizable to be contained within absolute container
	target.resizable({
		handles: "all",
		containment: "parent"
	}).css({
		width: 300
	});

	widthBefore = target.width();

	TestHelpers.resizable.drag( handle, increaseWidthBy, 0 );

	widthAfter = target.width();

	equal( widthAfter, ( widthBefore + increaseWidthBy ), "resizable width should be increased by the value dragged" );

});

})(jQuery);


text:
- Added the *Take Ownership* option to the multi select field options.

#### Scripts
##### New: ShowCampaignIncidentsOwners
- Displays all the campaign incident owners and their quantity (available from Cortex XSOAR version 6.0.0).

##### PerformActionOnCampaignIncidents
- Added *Take Ownership* option to the possible actions of the interactive management section.
- Updated the Docker image to: *demisto/python3:3.9.6.22912*.


text:
import * as RJSON from 'relaxed-json';

const relaxedString = `
    {                               // comment
        foo: "bar",                 // identifier
        "arr": [1,2,3,],            // trailing comma in array
        "single-quoted": 'string',
        'trailing': 4,
    },
`;

RJSON.transform(relaxedString);

function revive(key: string, value: any): any {
    return typeof value === 'number'
        ? value * 2  // return value * 2 for numbers
        : value;     // return everything else unchanged
}

RJSON.parse(relaxedString, revive);

RJSON.parse(relaxedString, {
    reviver: revive,
    relaxed: true,
    warnings: true,
    tolerant: true,
    duplicate: true,
});

RJSON.parse(relaxedString, {
    tolerant: false,
    duplicate: true,
});

RJSON.parse(relaxedString, {
    reviver: revive,
});

RJSON.parse(relaxedString, {});

const parsed = RJSON.parse(relaxedString);
RJSON.stringify(parsed);

RJSON.stringify({
    foo: 'bar',
});
RJSON.stringify([1, 2, 3]);
RJSON.stringify(3);
RJSON.stringify('a');


text:
import {Component} from 'angular2/core';
import {Location, RouteConfig, RouterLink, Router} from 'angular2/router';

import {LoggedInRouterOutlet} from './LoggedInOutlet';
import {Home} from '../home/home';
import {Login} from '../login/login';
import {Signup} from '../signup/signup';
import {Editor} from '../editor/editor';
import {SavedClips} from '../savedClips/savedClips';

declare var require;

let template = require('./app.html');

@Component({
  selector: 'auth-app',
  template: template,
  directives: [ LoggedInRouterOutlet ]
})

@RouteConfig([
  { path: '/', redirectTo: ['/Home'] },
  { path: '/home', component: Home, as: 'Home' },
  { path: '/login', component: Login, as: 'Login' },
  { path: '/signup', component: Signup, as: 'Signup' },
  { path: '/editor', component: Editor, as: 'Editor', data: {isLoggedIn: localStorage.getItem('jwt')} },
  { path: '/savedClips', component: SavedClips, as: 'SavedClips', data: {isLoggedIn: localStorage.getItem('jwt')} }
])

export class App {
  public loggedIn=false;

  constructor(public router: Router) {
    if(localStorage.getItem('jwt')){
      this.loggedIn=true;
    }

  }

  logout() {
    localStorage.removeItem('jwt');
    this.router.parent.navigateByUrl('/login');
  }

}


text:
using namespace seqan;

// ============================================================================
// Classes
// ============================================================================

// ----------------------------------------------------------------------------
// Class ReadsClassifier
// ----------------------------------------------------------------------------
// One instance per thread.

template <typename TSpec, typename TConfig>
struct ReadsClassifier
{
    typedef typename TConfig::TReadsContext     TReadsContext;
    typedef typename TConfig::THits             THits;
    typedef typename TConfig::TSeeds            TSeeds;
    typedef typename TConfig::TReadSeqs         TReadSeqs;

    // Shared-memory read-write data.
    TReadsContext &     ctx;
    THits &             hits;

    // Shared-memory read-only data.
    TSeeds const &      seeds;
    TReadSeqs const &   readSeqs;
    Options const &     options;

    ReadsClassifier(TReadsContext & ctx,
                    THits & hits,
                    TSeeds const & seeds,
                    Options const & options) :
        ctx(ctx),
        hits(hits),
        seeds(seeds),
        readSeqs(host(seeds)),
        options(options)
    {
        _classifyReadsImpl(*this, typename TConfig::TStrategy()); //, typename TConfig::TAnchoring());
    }

    template <typename TReadSeqsIterator>
    void operator() (TReadSeqsIterator const & it)
    {
        _classifyReadImpl(*this, it, typename TConfig::TStrategy()); //, typename TConfig::TAnchoring());
    }
};

// ============================================================================
// Functions
// ============================================================================

// ----------------------------------------------------------------------------
// Function _classifyReadsImpl(); Default
// ----------------------------------------------------------------------------

template <typename TSpec, typename TConfig>
inline void _classifyReadsImpl(ReadsClassifier<TSpec, TConfig> & me, All)
{
    // Iterate over all reads.
    iterate(me.readSeqs, me, Rooted(), typename TConfig::TThreading());
}

// ----------------------------------------------------------------------------
// Function _classifyReadsImpl(); AnchorOne
// ----------------------------------------------------------------------------

template <typename TSpec, typename TConfig>
inline void _classifyReadsImpl(ReadsClassifier<TSpec, TConfig> & me, Strata)//AnchorOne)
{
    typedef typename TConfig::TReadSeqs             TReadSeqs;
    typedef Segment<TReadSeqs const, PrefixSegment> TPrefix;

    TPrefix pairs(me.readSeqs, getReadsCount(me.readSeqs));

    // Iterate over all pairs.
    iterate(pairs, me, Rooted(), typename TConfig::TThreading());
}

// ----------------------------------------------------------------------------
// Function _classifyReadImpl(); Default
// ----------------------------------------------------------------------------
// Raises the seeds errors, mark for reseeding and clears the hits of hard reads.

template <typename TSpec, typename TConfig, typename TReadSeqsIterator>
inline void _classifyReadImpl(ReadsClassifier<TSpec, TConfig> & me, TReadSeqsIterator const & it, All)
{
    typedef typename TConfig::THits                     THits;
    typedef typename Value<THits>::Type                 THit;
    typedef typename Id<THit>::Type                     THitId;
    typedef Pair<THitId>                                THitIds;
    typedef typename Size<THit>::Type                   THitSize;
    typedef typename TConfig::TSeeds                    TSeeds;
    typedef typename Id<TSeeds>::Type                   TSeedId;
    typedef Pair<TSeedId>                               TSeedIds;
    typedef typename TConfig::TReadSeqs                 TReadSeqs;
    typedef typename Size<TReadSeqs>::Type              TReadId;

    TReadId readSeqId = position(it);

    // Count the hits per read.
    TSeedIds readSeedIds = getSeedIds(me.seeds, readSeqId);
    THitIds readHitIds = getHitIds(me.hits, readSeedIds);
    THitSize readHits = countHits<THitSize>(me.hits, readHitIds);

    // Re-seed hard reads.
    if (readHits > me.options.hitsThreshold)
    {
        // Guess a good seeding stragegy.
        setSeedErrors(me.ctx, readSeqId, (readHits < 200 * me.options.hitsThreshold) ? 1 : 2);

        // Clear the hits of the read.
        clearHits(me.hits, readHitIds);
    }
}

// ----------------------------------------------------------------------------
// Function _classifyReadImpl(); Strata
// ----------------------------------------------------------------------------

template <typename TSpec, typename TConfig, typename TReadSeqsIterator>
inline void _classifyReadImpl(ReadsClassifier<TSpec, TConfig> & me, TReadSeqsIterator const & it, Strata)
{
    typedef typename TConfig::THits                     THits;
    typedef typename Value<THits>::Type                 THit;
    typedef typename Id<THit>::Type                     THitId;
    typedef Pair<THitId>                                THitIds;
    typedef typename Size<THit>::Type                   THitSize;
    typedef typename TConfig::TSeeds                    TSeeds;
    typedef typename Id<TSeeds>::Type                   TSeedId;
    typedef Pair<TSeedId>                               TSeedIds;
    typedef typename TConfig::TReadSeqs                 TReadSeqs;
    typedef typename Size<TReadSeqs>::Type              TReadId;

    // Get readSeqId.
    TReadId fwdSeqId = position(it);

    // Get mate id.
    TReadId revSeqId = getFirstMateRevSeqId(me.readSeqs, fwdSeqId);

    // Get seed ids.
    TSeedIds fwdSeedIds = getSeedIds(me.seeds, fwdSeqId);
    TSeedIds revSeedIds = getSeedIds(me.seeds, revSeqId);

    // Get hit ids.
    THitIds fwdHitIds = getHitIds(me.hits, fwdSeedIds);
    THitIds revHitIds = getHitIds(me.hits, revSeedIds);

    // Count the hits of each read.
    THitSize fwdHits = countHits<THitSize>(me.hits, fwdHitIds);
    THitSize revHits = countHits<THitSize>(me.hits, revHitIds);
    THitSize readHits = fwdHits + revHits;

    // Re-seed hard reads.
    if (readHits > me.options.hitsThreshold)
    {
        // Guess a good seeding stragegy.
        unsigned seedErrors = (readHits < 2 * 200 * me.options.hitsThreshold) ? 1 : 2;
        setSeedErrors(me.ctx, fwdSeqId, seedErrors);
        setSeedErrors(me.ctx, revSeqId, seedErrors);

        // Clear the hits of the read.
        clearHits(me.hits, fwdHitIds);
        clearHits(me.hits, revHitIds);
    }
}

// ----------------------------------------------------------------------------
// Function _classifyReadImpl(); AnchorOne
// ----------------------------------------------------------------------------
// Selects the mate to anchor; raises the seeds errors, mark for reseeding and clears the hits of hard anchors.

template <typename TSpec, typename TConfig, typename TReadSeqsIterator>
inline void _classifyReadImpl(ReadsClassifier<TSpec, TConfig> & me, TReadSeqsIterator const & it, All, AnchorOne)
{
    typedef typename TConfig::THits                     THits;
    typedef typename Value<THits>::Type                 THit;
    typedef typename Id<THit>::Type                     THitId;
    typedef Pair<THitId>                                THitIds;
    typedef typename Size<THit>::Type                   THitSize;
    typedef typename TConfig::TSeeds                    TSeeds;
    typedef typename Id<TSeeds>::Type                   TSeedId;
    typedef Pair<TSeedId>                               TSeedIds;
    typedef typename TConfig::TReadSeqs                 TReadSeqs;
    typedef typename Size<TReadSeqs>::Type              TReadId;

    // Get readSeqId.
    TReadId readSeqId = position(it);

    // Get mate id.
    TReadId mateSeqId = getMateSeqId(me.readSeqs, readSeqId);

    // Get seed ids.
    TSeedIds readSeedIds = getSeedIds(me.seeds, readSeqId);
    TSeedIds mateSeedIds = getSeedIds(me.seeds, mateSeqId);

    // Get hit ids.
    THitIds readHitIds = getHitIds(me.hits, readSeedIds);
    THitIds mateHitIds = getHitIds(me.hits, mateSeedIds);

    // Count the hits of each read.
    THitSize readHits = countHits<THitSize>(me.hits, readHitIds);
    THitSize mateHits = countHits<THitSize>(me.hits, mateHitIds);

    TReadId anchorSeqId;
    TReadId otherSeqId;
    THitIds anchorHitIds;
    THitIds otherHitIds;

    // Choose the easiest read as the anchor.
    THitSize anchorHits = std::min(readHits, mateHits);

    if (anchorHits == readHits)
    {
        anchorSeqId = readSeqId;
        anchorHitIds = readHitIds;
        otherSeqId = mateSeqId;
        otherHitIds = mateHitIds;
    }
    else
    {
        anchorSeqId = mateSeqId;
        anchorHitIds = mateHitIds;
        otherSeqId = readSeqId;
        otherHitIds = readHitIds;
    }

    // Clear the hits of the other read.
    clearHits(me.hits, otherHitIds);

    // Re-seed hard anchors.
    if (anchorHits > me.options.hitsThreshold)
    {
        // Guess a good seeding stragegy.
        setSeedErrors(me.ctx, anchorSeqId, (anchorHits < 200 * me.options.hitsThreshold) ? 1 : 2);

        // Clear the hits of the anchor.
        clearHits(me.hits, anchorHitIds);
    }
}

#endif  // #ifndef APP_YARA_MAPPER_CLASSIFIER_H_


text:
package org.onosproject.ospf.controller;

/**
 * Representation of a wrapper object to store LSA and associated metadata.
 * Metadata consists about the origination of LSA, age of LSA when received etc.
 */
public interface LsaWrapper {
    /**
     * Gets the type of LSA, it can be a router,network,summary,external.
     *
     * @return lsa type
     */
    public OspfLsaType lsaType();

    /**
     * Sets the LSA type during the initialization of wrapper.
     *
     * @param lsaType lsa type
     */
    public void setLsaType(OspfLsaType lsaType);

    /**
     * Determines the origination of LSA , this is called during ls refresh interval.
     *
     * @return true if self originated else false
     */
    public boolean isSelfOriginated();

    /**
     * Sets is self originated or not.
     *
     * @param isSelfOriginated true if self originated else false
     */
    public void setIsSelfOriginated(boolean isSelfOriginated);

    /**
     * Age of LSA when received during the adjacency formation.
     *
     * @return Age of LSA when received
     */
    public int lsaAgeReceived();

    /**
     * Sets the Age of LSA when received during the adjacency formation.
     *
     * @param lsaAgeReceived Age of LSA when received
     */
    public void setLsaAgeReceived(int lsaAgeReceived);

    /**
     * Gets the LSA present in the wrapper instance.
     *
     * @return LSA instance
     */
    public OspfLsa ospfLsa();

    /**
     * Sets the LSA instance to the wrapper.
     *
     * @param ospfLsa LSA instance
     */
    public void setOspfLsa(OspfLsa ospfLsa);

    /**
     * Gets the current LSA Age, using this we calculate current age.
     * It is done against the age counter which is incremented every second.
     *
     * @return lsa age
     */
    public int currentAge();

    /**
     * Gets the age counter when received.
     *
     * @return the age counter when received
     */
    public int ageCounterWhenReceived();

    /**
     * Sets the age counter when received.
     *
     * @param ageCounterWhenReceived the age counter when received
     */
    public void setAgeCounterWhenReceived(int ageCounterWhenReceived);

    /**
     * Gets the LSA process command, like max age, ls refresh, based on the command set.
     * The queue consumer will pick the LSA and start performing the actions, like flooding
     * out of the domain or generating a new LSA and flooding.
     *
     * @return lsa process command
     */
    public String lsaProcessing();

    /**
     * Sets the LSA process command, like max age , ls refresh , based on the command set.
     * The queue consumer will pick the LSA and start performing the actions, like flooding
     * out of the domain or generating a new LSA and flooding.
     *
     * @param lsaProcessing lsa process command
     */
    public void setLsaProcessing(String lsaProcessing);

    /**
     * Gets bin number into which the LSA wrapper is put for aging process.
     *
     * @return bin number
     */
    public int binNumber();

    /**
     * Sets bin number into which the LSA wrapper is put for aging process.
     *
     * @param binNumber bin number
     */
    public void setBinNumber(int binNumber);

    /**
     * Gets the interface on which the LSA was received.
     *
     * @return the interface instance
     */
    public OspfInterface ospfInterface();

    /**
     * Sets the interface on which the LSA was received, this is used later to flood the information.
     *
     * @param ospfInterface interface instance
     */
    public void setOspfInterface(OspfInterface ospfInterface);

    /**
     * Sets the LSDB age.
     * Using LSDB age we are calculating age of a particular LSA.
     *
     * @param lsdbAge lsdbAge instance
     */
    public void setLsdbAge(LsdbAge lsdbAge);
}


text:
function D3_BubbleRepresentation(){}

/**
 * Fonction show : appelle la fonction load en lui passant le json
 *
 * @param data : le json sous forme d'objet json ou de chaine de caractères
 */
D3_BubbleRepresentation.prototype.show = function(data) {
	// data is file path
	if(typeof data === "string"){
		d3.json(data, function(error, root) {
			if (error) alert(error);
			D3_BubbleRepresentation.load(root);
		});
	}
	// data is json
	else {
		D3_BubbleRepresentation.load(data);
	}
}

/**
 * Fonction load : ajoute les balises svg au conteneur pour afficher la vue bubble pour le json donné
 *
 * @param json : fichier json rendu par la recherche
 */
D3_BubbleRepresentation.load = function(json) {

	//On transforme le json format commun en json format tree accepté par D3
	var formatter = new D3_Formatter();
	var treeJson = formatter.to_tree(json);

	//Variables indiquant les paramètres de notre visualisation (marges, taille, couleurs)
	var margin = 20,
			diameter = $("#contentCenter").width();

	var color = d3.scale.linear()
			.domain([-1, 5])
			.range(["hsl(152,80%,80%)", "hsl(228,30%,40%)"])
			.interpolate(d3.interpolateHcl);

	//Le packlayout de D3 permet d'agencer des ensembles de cercles dans des cercles
	var pack = d3.layout.pack()
			.padding(50)
			.size([diameter - margin, diameter - margin])
			.value(function(d) { return d.size; })

	//On configure le svg qui contiendra toute la figure
	var svg = d3.select("#contentCenter").append("svg")
			.attr("width", diameter)
			.attr("height", diameter)
		.append("g")
			.attr("transform", "translate(" + diameter/2 + "," + diameter/2 + ")");

	var container = svg.append("g")
	.attr("class", "representationContainer");

	//focus indique sur quel noeud doit se centrer la vue (au départ c'est la racine)
	var focus = treeJson;
	console.log(treeJson);
	//view contiendra un vecteur correspondant au zoom sur le focus (vecteur (x,y,r) où (x,y) = coordonnées du centre et r = taille de la zone visible)
	var view;

	//pack.nodes transforme le treeJson en un objet contenant les infos nécessaires au packlayout.
	//ces infos sont calculées automatiquement par D3 à partir du json qu'on lui fournit.
	var nodes = pack.nodes(treeJson);

	//On ajoute les cercles représentant les noeuds de l'arbre
	var circle = container.selectAll("circle")
			.data(nodes)
		.enter().append("circle")
			.attr("class", function(d) { return d.parent ? d.children ? "node" : "node node--leaf" : "node node--treeJson"; })
			.style("fill", function(d) { return d.children ? color(d.depth) : null; })
			.on("click", function(d) {
					//Le click sur un cercle provoque 2 choses :
						//La vue se centre sur ce cercle
					if (focus !== d) zoomfonc(d), d3.event.stopPropagation();
						//Le résultat d'une recherche wikipedia s'affiche dans le cadre wikipedia
						//Si le noeud a un nom contenant des espaces, on cherche un mot sans espace dans son voisinage pour faire la recherche.
					var sansEspace = new RegExp(/\s/);
					var d3_utils = new D3_Utils();
					if(sansEspace.test(d.name.toString()) == false) d3_utils.show_wikipedia(d.name);
					else if(sansEspace.test(d.children[0].name.toString()) == false) d3_utils.show_wikipedia(d.children[0].name);
					else if(sansEspace.test(d.parent.name.toString()) == false) d3_utils.show_wikipedia(d.parent.name);

			})
			.on("dblclick", function(d){
				var d3_utils = new D3_Utils();
				var sansEspace = new RegExp(/\s/);
				if(sansEspace.test(d.name.toString()) == false) d3_utils.load_json(d);
				else if(sansEspace.test(d.children[0].name.toString()) == false) d3_utils.load_json(d.children[0]);
				else if(sansEspace.test(d.parent.name.toString()) == false) d3_utils.load_json(d.parent.name);
			});

	//On ajoute le texte représentant le noeud dans chaque cercle.
	var text = container.selectAll("text")
			.data(nodes)
		.enter()
			.append("text")
			.attr("class", "label")
			/*.style("fill-opacity", function(d) { return d.parent === treeJson ? 1 : 0; })
			.style("display", function(d) { return d.parent === treeJson ? null : "none"; })
			.text(function(d) { return d.name; });*/
			.style("display", function(d) {
				var sansEspace = new RegExp(/\s/);
				return sansEspace.test(d.name.toString()) ? "none" : null;
			 })
			.style("font-size", '10px')
			.text(function(d) { return d.name; });

	//On ajoute un title pour voir les définitions en entier lorsque les noeuds contiennent plus d'un mot
	var node = container.selectAll("circle,text");
	node.append("title")
		.text(function(d) { return d.name; });

	//Gestion du zoom pour faire un focus sur un cercle
	d3.select("#contentCenter")
			.style("background", color(-1))
			.on("click", function() { zoomfonc(treeJson); });

	zoomTo([treeJson.x, treeJson.y, treeJson.r * 2 + margin]);

	//Lance le zoom sur un noeud
	function zoomfonc(d) {
		var focus0 = focus; focus = d;

		var transition = d3.transition()
				.duration(d3.event.altKey ? 7500 : 750)
				.tween("zoom", function(d) {
					var i = d3.interpolateZoom(view, [focus.x, focus.y, focus.r * 2 + margin]);
					return function(t) { zoomTo(i(t)); };
				});

    /*transition.selectAll("text")
      .filter(function(d) { return d.parent === focus || this.style.display === "inline"; })
        .style("fill-opacity", function(d) { return d.parent === focus ? 1 : 0; })
        .each("start", function(d) { if (d.parent === focus) this.style.display = "inline"; })
        .each("end", function(d) { if (d.parent !== focus) this.style.display = "none"; });*/
	}

	//Zoom sur une position
	function zoomTo(v) {
		var k = diameter / v[2]; view = v;
		node.attr("transform", function(d) { return "translate(" + (d.x - v[0]) * k + "," + (d.y - v[1]) * k + ")"; });
		circle.attr("r", function(d) { return d.r * k; });
	}

	//On adapte la taille de la figure à la taille du conteneur
	d3.select(self.frameElement).style("height", diameter + "px");

	// On ajoute des etiquettes sur les noeuds
	$('svg g circle').tipsy({
		gravity: 'w',
		html: true,
		title: function() {
			var d = this.__data__;
			if(d.type != null){
				return "
"+ d.type + "

"+d.name+"
";
			}else{
				return "

"+d.name+"
";
			}
		}
	});

	//On désactive les boutons inutiles
	d3.selectAll('.rotate').attr("value","0").attr("class","inactif");
	d3.selectAll('.dragAndDrop').attr("value","0").attr("class","inactif");
	d3.selectAll('.zoom').attr("class","inactif");

}


text:
This project is intended to be a starting point for a basic Hello World NodeJS ExpressJS and React application
that I repeatedly revisit for many proof of concept projects. The idea is to implement a Todo app, which will
serve as a decent starting point and introduce concepts such as routing, templating, ORM capabilities using SQLite
databases, etc.

The structure of the project is broken into 2 distinct components:

* `client/`: Directory containing the React components.
* `server/`: Directory containing the ExpressJS components (API that the client will interact with).

## Creation of Starter Code

This repository was created using the following starter code:

```bash
# create client
$ npx create-react-app client --view=pug

# create server
$ npx express-generator server --view=pug
$ cd server/
$ npm install --save
```

Following code generation, simply update the port number in `server/bin/www` from `3000` to some other port (e.g. `8000`).
Then you can start the client and server components via the following:

```bash
# client
$ cd client/
$ npm run start

# server
$ cd server/
$ npm run serverstart
```

## Quick Start

If you want to get up and running quickly, simply launch the back-end server, front-end client, and navigate to
[http://localhost:3000](http://localhost:3000) in your browser:

```bash
# server
$ cd server/
$ npm run serverstart

# client
$ cd ../client/
$ npm run start
```

## Server

The following sections detail how to set up some of the server API components, including database and ORM components.

### Models

Models and associated migrations were created and executed using the following (for example) - these steps perform
the following (in order):

* Initialize the database.
* Generate a model and corresponding migration for `Todo`
* Apply the migration to the database (create the `Todo` table and schema)
* Seed the database `Todo` table with a record

```bash
$ ./node_modules/.bin/sequelize init
# then edit config/config.json to your liking

$ npx sequelize-cli model:generate --name todo --attributes text:string,done:boolean
$ npx sequelize-cli db:migrate

$ npx sequelize-cli seed:generate --name first-todo
$ npx sequelize-cli db:seed:all
```

### Starting Server

Start the server in debug mode, after which you can visit [http://localhost:8000/todos](http://localhost:8000/todos)
in your browser:

```bash
$ npm start serverstart
```

You should see a JSON representation of the Todo items in the database.

As a note, the development environment utilizes `nodemon` to manage the services and enables automatic reloads
when local file changes are made (without the need to restart the services each time a file is changed).

### Credit

This tutorial was pieced together with some information from the following sites/resources, among others that were likely missed
in this list:

* [Create React Frontend and Node Express Backend...](https://www.freecodecamp.org/news/create-a-react-frontend-a-node-express-backend-and-connect-them-together-c5798926047c/)
* [Skeleton Website](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/skeleton_website)
* [Sequelize Express](https://sequelize.readthedocs.io/en/1.7.0/articles/express/)
* [Sequelize ORM with NodeJS and Express](https://stackabuse.com/using-sequelize-orm-with-nodejs-and-express/)
* [Building a Blog...](https://scotch.io/tutorials/build-a-blog-using-expressjs-and-react-in-30-minutes)
* [Build a Basic CRUD App...](https://developer.okta.com/blog/2018/07/10/build-a-basic-crud-app-with-node-and-react)


text:
<?php

/**
 * Class FunctionConvertUuencodeTest
 * @link http://php.net/manual/en/function.convert-uudecode.php
 */
class FunctionConvertUuencodeTest extends PHPUnit_Framework_TestCase
{
    public function testFunctionConvertUuencode()
    {
        $this->assertEquals("+22!L;W9E(%!(4\"$`\n`\n", convert_uuencode('I love PHP!'));
    }
}


text:
package org.apache.reef.evaluator.context.parameters;

import org.apache.reef.evaluator.context.events.ContextStart;
import org.apache.reef.runtime.common.evaluator.context.defaults.DefaultContextStartHandler;
import org.apache.reef.tang.annotations.Name;
import org.apache.reef.tang.annotations.NamedParameter;
import org.apache.reef.wake.EventHandler;

import java.util.Set;

/**
 * The set of event handlers for the ContextStart event.
 */
@NamedParameter(doc = "The set of event handlers for the ContextStart event.",
    default_classes = DefaultContextStartHandler.class)
public class ContextStartHandlers implements Name<Set<EventHandler<ContextStart>>> {
}


text:
module RailsDynamicUserRoles
	VERSION = '0.0.1'
end


text:
OmniauthDemo::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb

  # In the development environment your application's code is reloaded on
  # every request.  This slows down response time but is perfect for development
  # since you don't have to restart the webserver when you make code changes.
  config.cache_classes = false

  # Log error messages when you accidentally call methods on nil.
  config.whiny_nils = true

  # Show full error reports and disable caching
  config.consider_all_requests_local       = true
  config.action_view.debug_rjs             = true
  config.action_controller.perform_caching = false

  # Don't care if the mailer can't send
  config.action_mailer.raise_delivery_errors = false

  # Print deprecation notices to the Rails logger
  config.active_support.deprecation = :log

  # Only use best-standards-support built into browsers
  config.action_dispatch.best_standards_support = :builtin

  Rails.application.config.middleware.use OmniAuth::Builder do
    # ALWAYS RESTART YOUR SERVER IF YOU MAKE CHANGES TO THESE SETTINGS!

    # you need a store for OpenID; (if you deploy on heroku you need Filesystem.new('./tmp') instead of Filesystem.new('/tmp'))
    require 'openid/store/filesystem'

    # load certificates
    require "openid/fetchers"
    OpenID.fetcher.ca_file = "#{Rails.root}/config/ca-bundle.crt"

    # providers with id/secret, you need to sign up for their services (see below) and enter the parameters here
    #provider :twitter, '4LuPjNvVgNXcobblIdHw', 'fpS0STTUKW5jRq72lzIihgC5DO1oPhP0IR8iJ9k34tA'
    provider :facebook, '113226698778341', '351db8099aab1c34cddde7cfce69254d'

    # generic openid
    provider :openid, OpenID::Store::Filesystem.new('./tmp'), :name => 'openid'

    # dedicated openid
    provider :openid, OpenID::Store::Filesystem.new('./tmp'), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
    # provider :google_apps, OpenID::Store::Filesystem.new('./tmp'), :name => 'google_apps'
    # /auth/google_apps; you can bypass the prompt for the domain with /auth/google_apps?domain=somedomain.com

    provider :openid, OpenID::Store::Filesystem.new('./tmp'), :name => 'yahoo', :identifier => 'yahoo.com'
    provider :openid, OpenID::Store::Filesystem.new('./tmp'), :name => 'aol', :identifier => 'openid.aol.com'
    provider :openid, OpenID::Store::Filesystem.new('./tmp'), :name => 'myopenid', :identifier => 'myopenid.com'

    # Sign-up urls for Facebook, Twitter, and Github
    # https://developers.facebook.com/setup
    # https://github.com/account/applications/new
    # https://developer.twitter.com/apps/new
 end
end


text:
package otbuiltin

import (
	"strings"
	"unsafe"
)

// #cgo pkg-config: ostree-1
// #include <stdlib.h>
// #include <glib.h>
// #include <ostree.h>
// #include "builtin.go.h"
import "C"

// initOptions contains all of the options for initializing an ostree repo
//
// Note: while this is private, exported fields are public and part of the API.
type initOptions struct {
	// Mode defines repository mode: either bare, archive-z2, or bare-user
	Mode string
}

// NewInitOptions instantiates and returns an initOptions struct with default values set
func NewInitOptions() initOptions {
	return initOptions{
		Mode: "bare",
	}
}

// Init initializes a new ostree repository at the given path.  Returns true
// if the repo exists at the location, regardless of whether it was initialized
// by the function or if it already existed.  Returns an error if the repo could
// not be initialized
func Init(path string, options initOptions) (bool, error) {
	repoMode, err := parseRepoMode(options.Mode)
	if err != nil {
		return false, err
	}

	// Create a repo struct from the path
	cpath := C.CString(path)
	defer C.free(unsafe.Pointer(cpath))
	pathc := C.g_file_new_for_path(cpath)
	defer C.g_object_unref(C.gpointer(pathc))
	repo := C.ostree_repo_new(pathc)

	// If the repo exists in the filesystem, return an error but set exists to true
	/* var exists C.gboolean = 0
	success := glib.GoBool(glib.GBoolean(C.ostree_repo_exists(crepo, &exists, &cerr)))
	if exists != 0 {
	  err = errors.New("repository already exists")
	  return true, err
	} else if !success {
	  return false, generateError(cerr)
	}*/

	var cErr *C.GError
	defer C.free(unsafe.Pointer(cErr))
	if r := C.ostree_repo_create(repo, repoMode, nil, &cErr); !isOk(r) {
		err := generateError(cErr)
		if strings.Contains(err.Error(), "File exists") {
			return true, err
		}
		return false, err
	}
	return true, nil
}

// parseRepoMode converts a mode string to a C.OSTREE_REPO_MODE enum value
func parseRepoMode(modeLabel string) (C.OstreeRepoMode, error) {
	var cErr *C.GError
	defer C.free(unsafe.Pointer(cErr))

	cModeLabel := C.CString(modeLabel)
	defer C.free(unsafe.Pointer(cModeLabel))

	var retMode C.OstreeRepoMode
	if r := C.ostree_repo_mode_from_string(cModeLabel, &retMode, &cErr); !isOk(r) {
		// NOTE(lucab): zero-value for this C enum has no special/invalid meaning.
		return C.OSTREE_REPO_MODE_BARE, generateError(cErr)
	}

	return retMode, nil
}


text:
<?php

class Google_Service_TrafficDirectorService_DynamicListener extends Google_Model
{
  protected $activeStateType = 'Google_Service_TrafficDirectorService_DynamicListenerState';
  protected $activeStateDataType = '';
  protected $drainingStateType = 'Google_Service_TrafficDirectorService_DynamicListenerState';
  protected $drainingStateDataType = '';
  protected $errorStateType = 'Google_Service_TrafficDirectorService_UpdateFailureState';
  protected $errorStateDataType = '';
  public $name;
  protected $warmingStateType = 'Google_Service_TrafficDirectorService_DynamicListenerState';
  protected $warmingStateDataType = '';

  /**
   * @param Google_Service_TrafficDirectorService_DynamicListenerState
   */
  public function setActiveState(Google_Service_TrafficDirectorService_DynamicListenerState $activeState)
  {
    $this->activeState = $activeState;
  }
  /**
   * @return Google_Service_TrafficDirectorService_DynamicListenerState
   */
  public function getActiveState()
  {
    return $this->activeState;
  }
  /**
   * @param Google_Service_TrafficDirectorService_DynamicListenerState
   */
  public function setDrainingState(Google_Service_TrafficDirectorService_DynamicListenerState $drainingState)
  {
    $this->drainingState = $drainingState;
  }
  /**
   * @return Google_Service_TrafficDirectorService_DynamicListenerState
   */
  public function getDrainingState()
  {
    return $this->drainingState;
  }
  /**
   * @param Google_Service_TrafficDirectorService_UpdateFailureState
   */
  public function setErrorState(Google_Service_TrafficDirectorService_UpdateFailureState $errorState)
  {
    $this->errorState = $errorState;
  }
  /**
   * @return Google_Service_TrafficDirectorService_UpdateFailureState
   */
  public function getErrorState()
  {
    return $this->errorState;
  }
  public function setName($name)
  {
    $this->name = $name;
  }
  public function getName()
  {
    return $this->name;
  }
  /**
   * @param Google_Service_TrafficDirectorService_DynamicListenerState
   */
  public function setWarmingState(Google_Service_TrafficDirectorService_DynamicListenerState $warmingState)
  {
    $this->warmingState = $warmingState;
  }
  /**
   * @return Google_Service_TrafficDirectorService_DynamicListenerState
   */
  public function getWarmingState()
  {
    return $this->warmingState;
  }
}


text:
// Generated with http://www.jsonschema2pojo.org/
package biz.dfch.j.clickatell.rest.message;

import com.fasterxml.jackson.annotation.*;

import javax.annotation.Generated;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
@JsonPropertyOrder({
        "message"
})
public class Data {

    @JsonProperty("message")
    private List<Message> message = new ArrayList<Message>();
    @JsonIgnore
    private Map<String, Object> additionalProperties = new HashMap<String, Object>();

    /**
     *
     * @return
     * The message
     */
    @JsonProperty("message")
    public List<Message> getMessage() {
        return message;
    }

    /**
     *
     * @param message
     * The message
     */
    @JsonProperty("message")
    public void setMessage(List<Message> message) {
        this.message = message;
    }

    @JsonAnyGetter
    public Map<String, Object> getAdditionalProperties() {
        return this.additionalProperties;
    }

    @JsonAnySetter
    public void setAdditionalProperty(String name, Object value) {
        this.additionalProperties.put(name, value);
    }

}


text:
// jshint ignore: start
// fetch command line arguments
let dev = false;

const arg = (argList => {
    let arg = {}, a, opt, thisOpt, curOpt;
    for (a = 0; a < argList.length; a++) {

        thisOpt = argList[a].trim();
        opt = thisOpt.replace(/^\-+/, '');

        if (opt === thisOpt) {

            // argument value
            if (curOpt) arg[curOpt] = opt;
            curOpt = null;

        }
        else {

            // argument name
            curOpt = opt;
            arg[curOpt] = true;
        }
    }
    return arg;
})(process.argv);

const gulp = require('gulp'),
    run = require('gulp-run'),
    sass = require('gulp-sass'),
    install = require("gulp-install"),
    gulpif = require('gulp-if'),
    rename = require('gulp-rename'),
    plumber = require('gulp-plumber'),
    notify = require('gulp-notify'),
    sassLint = require('gulp-sass-lint'),
    sourcemaps = require('gulp-sourcemaps'),
    tildeImporter = require('node-sass-tilde-importer'),
    runSequence = require('run-sequence'),
    amdOptimize = require('amd-optimize'),
    postcss = require('gulp-postcss'),
    autoprefixer = require('autoprefixer'),
    cssnano = require('cssnano');

let target = "../../../target/classes/static/assets";
let origin = "./src";

let displayError = function(error) {
    // Initial building up of the error
    var errorString = '[' + error.plugin.error.bold + ']';
    errorString += ' ' + error.message.replace("\n", ''); // Removes new line at the end

    // If the error contains the filename or line number add it to the string
    if (error.fileName)
        errorString += ' in ' + error.fileName;

    if (error.lineNumber)
        errorString += ' on line ' + error.lineNumber.bold;

    // This will output an error like the following:
    // [gulp-sass] error message in file_name on line 1
    console.error(errorString);
};

let onError = function(err) {
    notify.onError({
        title: "Gulp",
        subtitle: "Failure!",
        message: "Error: <%= error.message %>",
        sound: "Basso"
    })(err);
    this.emit('end');
};

let sassOptions = {
    outputStyle: 'expanded',
    importer: tildeImporter
};

let autoprefixerConfig = {
    browsers: ['last 3 versions'],
    remove: false
};
let cssnanoConfig = {
    reduceIdents: false
};

function runSass(filename, cssTarget) {
    let plugins = [
        autoprefixer(autoprefixerConfig),
        cssnano(cssnanoConfig)
    ];

    return gulp.src(filename)
        .pipe(plumber({errorHandler: onError}))
        .pipe(sass(sassOptions))
        .pipe(postcss([plugins[0]]))
        .pipe(gulp.dest(cssTarget))
        .pipe(postcss(plugins))
        .pipe(rename({suffix: '.min'}))
        .pipe(gulp.dest(cssTarget));
}

gulp.task('typechain', function() {
    return run("npm run typechain").exec();
});

gulp.task('copy-dependencies', function() {
    let copy = [];
    copy.push(gulp.src(['node_modules/jquery/dist/*']).pipe(gulp.dest(`${target}/vendors/jquery`)));
    //copy.push(gulp.src(['node_modules/bootstrap/dist/**/*']).pipe(gulp.dest(`${target}/vendors/bootstrap`)));
    copy.push(gulp.src(['node_modules/mdbootstrap/js/mdb.*']).pipe(gulp.dest(`${target}/vendors/mdbootstrap/js`)));
    copy.push(gulp.src(['node_modules/mdbootstrap/font/**/*']).pipe(gulp.dest(`${target}/vendors/mdbootstrap/font`)));
    copy.push(gulp.src(['node_modules/mdbootstrap/img/**/*']).pipe(gulp.dest(`${target}/vendors/mdbootstrap/img`)));
    //copy.push(gulp.src(['node_modules/clipboard/dist/**/*']).pipe(gulp.dest(`${target}/vendors/clipboard/js`)));
    //copy.push(gulp.src(['node_modules/headroom.js/dist/headroom.*']).pipe(gulp.dest(`${target}/vendors/headroom.js`)));
    //copy.push(gulp.src(['node_modules/node-waves/dist/*']).pipe(gulp.dest(`${target}/vendors/node-waves`)));
    //copy.push(gulp.src(['node_modules/requirejs/*.js']).pipe(gulp.dest(`${target}/vendors/requirejs`)));
    //copy.push(gulp.src(['node_modules/lightslider/dist/**/*']).pipe(gulp.dest(`${target}/vendors/lightslider`)));
    copy.push(gulp.src(['node_modules/web3/dist/*']).pipe(gulp.dest(`${target}/vendors/web3`)));
    return copy;
});

gulp.task('copy-assets', function() {
    let copy = [];
    copy.push(gulp.src([`${origin}/fonts/**/*`]).pipe(gulp.dest(`${target}/fonts`)));
    copy.push(gulp.src([`${origin}/img/**/*`]).pipe(gulp.dest(`${target}/img`)));
    copy.push(gulp.src([`${origin}/js/**/*.js`, `!${origin}/js/vue/**/*`]).pipe(gulp.dest(`${target}/js`)));

    return copy;
});

gulp.task('styles-bootstrap', function() {
    return runSass(`${origin}/scss/bootstrap.scss`, `${target}/vendors/bootstrap/css`)
});

gulp.task('styles-mdb', function() {
    return runSass(`${origin}/scss/mdb.scss`, `${target}/vendors/mdbootstrap/css`)
});

gulp.task('styles-core', function() {
    return runSass(`${origin}/scss/core.scss`, `${target}/css`)
});

gulp.task('styles-website', function() {
    return runSass(`${origin}/scss/website.scss`, `${target}/css`);
});

gulp.task('install', function() {
    return gulp.src(["./package.json"]).pipe(install());
});

gulp.task('run-watch', function() {
    gulp.watch([`${origin}/scss/bootstrap.scss`, `${origin}/scss/fundrequest/+(_variables|_colors).scss`], ['styles-bootstrap']);
    gulp.watch([`${origin}/scss/mdb.scss`, `${origin}/scss/mdb-overrides/*.scss`, `${origin}/scss/fundrequest/+(_variables|_colors).scss`], ['styles-mdb']);
    gulp.watch([`${origin}/scss/core.scss`, `${origin}/scss/fundrequest/**/*.scss`, `!${origin}/scss/fundrequest/website/*.scss`], ['styles-core']);
    gulp.watch([`${origin}/scss/website.scss`, `${origin}/scss/fundrequest/website/*.scss`], ['styles-website']);
});

gulp.task('default', function(done) {
    target = (arg && arg.target) || target;
    runSequence('copy-dependencies', 'copy-assets', 'styles-bootstrap', 'styles-mdb', 'styles-core', 'styles-website', 'typechain', done);
});

gulp.task('watch', function(done) {
    target = (arg && arg.target) || target;
    runSequence('copy-dependencies', 'copy-assets', 'styles-bootstrap', 'styles-mdb', 'styles-core', 'styles-website', 'run-watch', done);
});


text:
window.onload = function() {
	function showInputValue() {
		var input = document.getElementById("searched-input");
		alert(input.value);
	};

	document.getElementById("clickMe").onclick = showInputValue;
}