text:
package main

import (
	"fmt"
	"log"
	"net"
	"os"
	"time"
	"io/ioutil"
	"gosilk"
	"path"

	"github.com/calmh/ipfix"
)

type IP []byte

type UDPAddr struct {
	IP   IP
	Port int
	Zone string // IPv6 scoped addressing zone
}

type UDP4Addr struct {
	IP   [4]byte
	Port int
}

func writeData(f os.File, ifs []ipfix.InterpretedField) {

	//var mymap = map[string]interface{}
	mymap := make(map[string]interface{})

	for k, iif := range ifs {
		fmt.Println(iif.Name)
		mymap[iif.Name] = iif.Value
		fmt.Println(k, iif)

	}

}

func createFileandTemp(addr *net.UDPAddr) (finalname string, tempname string) {
        now:= time.Now()
        filename := fmt.Sprintf("%d%d%d%d%d%d.%v:%d.", now.Year(), now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), addr.IP, addr.Port)
        prefix := "/tmp"
        f,err:=ioutil.TempFile(prefix,filename)
        checkError(err)
        finalname=f.Name()
        fmt.Println("Opening ",finalname)
        f.Close()
        tempname=path.Dir(finalname)+"/."+path.Base(finalname)
	fmt.Println("Temp name",tempname)
	return finalname,tempname
}

func process(addr *net.UDPAddr, in <-chan []byte, tick <-chan time.Time) {
	fmt.Println("plop")
	s := ipfix.NewSession()
	i := ipfix.NewInterpreter(s)

	opts := gosilk.Header{Probename: "P4444", Invocation: "i ran this file"}

	finalname,tempname:=createFileandTemp(addr)
	stream := gosilk.New(tempname)
	stream.CreateHeader(&opts)

	for {

		select {
		case data := <-in:
			fmt.Println("Length of data ", len(data))
			msg, err := s.ParseBuffer(data)
			if err != nil {
				fmt.Println("Error", err)
				continue
			}

			fmt.Println("Header ", msg.Header)
			//.DomainID," Sequence",msg.Header.SequenceNumber)
			fmt.Println("DataRecords ", len(msg.DataRecords), "Templates ", len(msg.TemplateRecords))
			//fmt.Println("Writing to ",f.Name())
			for j, record := range msg.DataRecords {
				fmt.Printf("Record number ", j)
				//		//	writeData(*f,record)
				ifs := i.Interpret(record)
				//fmt.Println(ifs)
				//	writeData(*f,ifs)
  				var rec gosilk.Rec
			        fmt.Println("ifs length ",len(ifs))
				for k, iif := range ifs {
					//fmt.Fprintln(f,iif)
					fmt.Println(k, iif)
					if iif.EnterpriseID == 0 {
						switch iif.FieldID {
						case 1:
							fmt.Println("bytes")
						case 2:
							fmt.Println("packets")
						case 4:
							fmt.Println("protocol")
						case 6:
							fmt.Println("flags")
						case 7:
							fmt.Println("sport")
							rec.SPort=2222
						case 8:
							fmt.Println("4sIP")
							rec.SIP=net.IPv4(1,2,3,4)
						case 10:
							fmt.Println("in")
						case 11:
							fmt.Println("dport")
						case 12:
							fmt.Println("4dIP")
							rec.DIP=net.IPv4(1,2,3,4)
						case 14:
							fmt.Println("out")
						case 15:
							fmt.Println("4nhip")
						case 153:
							fmt.Println("flowEndMilliseconds")
						case 154:
							fmt.Println("flowStartMilliseconds")
						case 136:
							fmt.Println("flowendReason")
						default:
							fmt.Println("Unhandled field",iif.Name,iif.FieldID)

						}
					}
				}
				rec.SIP=net.IPv4(1,2,3,4)
				rec.DIP=net.IPv4(1,2,3,4)
				stream.WriteRecord(&rec)
			}
			//f.Sync()
			fmt.Println("synced to disk")

		case <-tick:
			//Timer ticked.  Open another file
			stream.CloseStream()
			if stream.HaveWritten() {
			err:=os.Rename(tempname,finalname)
			checkError(err)
			} else {
			err:=os.Remove(tempname)
			checkError(err)
			err=os.Remove(finalname)
                        checkError(err)
			}

			finalname,tempname=createFileandTemp(addr)
			stream = gosilk.New(tempname)
        		stream.CreateHeader(&opts)
			// Do we need the above?
			//f,err=ioutil.TempFile("/tmp/",prefix)
			//checkError(err)
			//defer f.Close()
			fmt.Println("Tick")
			//writeHeader(*f)
		}

	}
}

func main() {
	log.Println("Wang")
	raddr, err := net.ResolveUDPAddr("udp", ":47000")
	checkError(err)
	rsock, err := net.ListenUDP("udp", raddr)
	defer rsock.Close()
	checkError(err)
	interval := 5

	//buf := make([]byte, 1500)
	var channels = make(map[UDP4Addr]chan []byte)
	tick := time.Tick(time.Duration(interval) * time.Second)

	for {
		buf := make([]byte, 1500)
		n, addr, err := rsock.ReadFromUDP(buf)
		fmt.Println("Received ", n, " bytes from ", addr.IP)
		//addrS:=addr.IP.String()

		// Check to see if we already have a session open for this source ip/port traffic
		addr4 := UDP4Addr{Port: addr.Port}
		copy(addr4.IP[:], addr.IP.To4()[0:4])
		fmt.Println(addr4)
		_, ok := channels[addr4]

		if ok {
			// We've seen this before
			fmt.Println("Session seen before")
			channels[addr4] <- buf[:n]
		} else {
			fmt.Println("New session")
			channels[addr4] = make(chan []byte)
			// Make a new goroutine to receive this data
			go process(addr, channels[addr4], tick)
			channels[addr4] <- buf[:n]

		}

		if err != nil {
			fmt.Println("Error: ", err)
		}
	}

}

func checkError(err error) {
	if err != nil {
		fmt.Fprintf(os.Stderr, "Fatal error: %s", err.Error())
		os.Exit(1)
	}
}


text:
/*************************************************************************/
/*  CustomSSLSocketFactory.java                                          */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)    */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/
package org.godotengine.godot.utils;
import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;

import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManagerFactory;

import org.apache.http.conn.ssl.SSLSocketFactory;

/**
 *
 * @author Luis Linietsky <luis.linietsky@gmail.com>
 */
public class CustomSSLSocketFactory extends SSLSocketFactory {
    SSLContext sslContext = SSLContext.getInstance("TLS");

    public CustomSSLSocketFactory(KeyStore truststore) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
        super(truststore);

        TrustManagerFactory tmf = TrustManagerFactory.getInstance("X509");
        tmf.init(truststore);

        sslContext.init(null, tmf.getTrustManagers(), null);
    }

    @Override
    public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException, UnknownHostException {
        return sslContext.getSocketFactory().createSocket(socket, host, port, autoClose);
    }

    @Override
    public Socket createSocket() throws IOException {
        return sslContext.getSocketFactory().createSocket();
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.seeran.common.ui.mine;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.text.Editable;
import android.text.Selection;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.TextView;

import com.seeran.common.R;
import com.seeran.common.app.CommonApp;
import com.seeran.common.base.BaseActivity;
import com.seeran.common.utils.DeviceUtils;
import com.seeran.common.utils.StringToolUtils;

/**
 * 本地提醒
 * Created by zhyf
 */
public class LocalNoticeDialogActivity extends BaseActivity {

    public static OnBtnClickListener mListener;
    private String mTitle;
    private String mHint;

    public static void start(Context context, String title, String content, OnBtnClickListener onBtnClickListener) {
        Intent intent = new Intent(context, LocalNoticeDialogActivity.class);
        intent.putExtra("title", title);
        intent.putExtra("hint", content);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mListener = onBtnClickListener;
        context.startActivity(intent);
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_local_notice_dialog);
        super.onCreate(savedInstanceState);
        showDialog();
    }

    @Override
    protected void getIntentData(Intent intent) {
        mTitle = intent.getStringExtra("title");
        mHint = intent.getStringExtra("hint");
    }

    @Override
    protected void initComponent() {
    }

    private void initView(final Dialog dialog) {
        TextView tvDialogTitle = (TextView) dialog.findViewById(R.id.tvDialogTitle);
        TextView tvCancel = (TextView) dialog.findViewById(R.id.tvCancel);
        TextView tvCommit = (TextView) dialog.findViewById(R.id.tvCommit);
        TextView tvContent = (TextView) dialog.findViewById(R.id.tvContent);

        tvDialogTitle.setText(mTitle);
        tvContent.setText(mHint);

        tvCommit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mListener != null) {
                    mListener.onClick(true);
                }
                dialog.dismiss();
            }
        });
        tvCancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mListener != null) {
                    mListener.onClick(false);
                }
                dialog.dismiss();
            }
        });
        dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public void onDismiss(DialogInterface dialog) {
                LocalNoticeDialogActivity.this.finish();
                mListener = null;
            }
        });
    }

    @Override
    public void overridePendingTransition(int enterAnim, int exitAnim) {
        super.overridePendingTransition(0, 0);
    }

    public void showDialog() {
        Dialog reminderDialog = new Dialog(this, R.style.FullHeightDialog);
        reminderDialog.requestWindowFeature(-1);
        reminderDialog.setContentView(R.layout.diolog_local_notice);
        initView(reminderDialog);
        Window dialogWindow = reminderDialog.getWindow();
        ColorDrawable dw = new ColorDrawable('\uff00');
        dialogWindow.setBackgroundDrawable(dw);
        WindowManager.LayoutParams lp = dialogWindow.getAttributes();
        dialogWindow.setGravity(Gravity.CENTER_VERTICAL);
        lp.y = -DeviceUtils.dip2px(CommonApp.getContext(), 30);
        dialogWindow.setAttributes(lp);
        reminderDialog.show();
    }

    public interface OnBtnClickListener {
        void onClick(boolean confirmOrCancel);
    }
}


text:
var CommandBase = require('../commands/commandbase');
var inherits = require('util').inherits;
var Joi = require('joi');

/**
 * @module Core
 */

/**
 * Provides the StartTls command used to start a TLS session with Riak.
 * @class StartTls
 * @constructor
 * @param {Function} callback the function to call when the command completes or errors
 * @extends CommandBase
 */
function StartTls(callback) {
    CommandBase.call(this, 'RpbStartTls', 'RpbStartTls', callback);

}

inherits(StartTls, CommandBase);

StartTls.prototype.constructPbRequest = function() {
    /*
     * NB: since this is just a message code there is nothing to return
     */
    return;
};

StartTls.prototype.onSuccess = function(rpbStartTlsResp) {

    if (rpbStartTlsResp === null) {
        // TODO ERROR
    }

    return true;
};

module.exports = StartTls;


text:
$(document).ready(function(){

});
  var app = angular.module('login',['firebase']);
  var id;

	app.controller('LoginCtrl', ['$scope', '$firebaseObject', '$firebaseArray', function($scope, $firebaseObject, $firebaseArray, uid) {

	// TODO: implementation of AdminCtrl

	// Initialize $scope.param as an empty JSON object
	$scope.param = {};
  $scope.login = false;
	// Call Firebase initialization code defined in site.js

  var provider = new firebase.auth.GoogleAuthProvider();
  firebase.auth().onAuthStateChanged(function(user) {

  if (user) {
    // User is signed in.

    user.providerData.forEach(function (profile) {
    $('#user_name').html(profile.displayName);
    $('#user_name2').text(profile.displayName);
    $('.user-image').attr('src',profile.photoURL);
    $('.img-circle').attr('src',profile.photoURL);
  });
      $scope.login = true;
      $scope.$apply();

  } else {
    // No user is signed in.
  }
  });

	function onSignIn(googleUser) {
	  console.log('Google Auth Response', googleUser);
	  // We need to register an Observer on Firebase Auth to make sure auth is initialized.
	  var unsubscribe = firebase.auth().onAuthStateChanged(function(firebaseUser) {
	    unsubscribe();
	    // Check if we are already signed-in Firebase with the correct user.
	    if (!isUserEqual(googleUser, firebaseUser)) {
	      // Build Firebase credential with the Google ID token.
	      var credential = firebase.auth.GoogleAuthProvider.credential(
	          googleUser.getAuthResponse().id_token);
	      // Sign in with credential from the Google user.
	      firebase.auth().signInWithCredential(credential).then(function(data){
          location.reload();
        }).catch(function(error) {
	        // Handle Errors here.
	        var errorCode = error.code;
	        var errorMessage = error.message;
	        // The email of the user's account used.
	        var email = error.email;
	        // The firebase.auth.AuthCredential type that was used.
	        var credential = error.credential;
	        // ...

	      });

				firebase.auth().onAuthStateChanged(function(user) {
				if (user) {
					// User is signed in.
					user.providerData.forEach(function (profile) {

					var refPath;
					id = firebase.auth().currentUser.uid;

					refPath = "/users/" + id;
					// Link and sync a firebase object

						$scope[id] = $firebaseObject(firebase.database().ref(refPath));
						$scope[id].$loaded()
						.then( function(data) {
						$scope[id].name = profile.displayName;
						$scope[id].$save();
            return id;
						})
						.catch(function(error) {
							// Database connection error handling...
							//console.error("Error:", error);
						});

				});
				} else {
					// No user is signed in.
				}
				});

	    }
			else {
	      console.log('User already sign in');
	    }
	  });

	}

	function isUserEqual(googleUser, firebaseUser)
	{
	  if (firebaseUser) {
	    var providerData = firebaseUser.providerData;
	    for (var i = 0; i < providerData.length; i++) {

	      if (providerData[i].providerId === firebase.auth.GoogleAuthProvider.PROVIDER_ID &&
	          providerData[i].uid === googleUser.getBasicProfile().getId()) {
	        // We don't need to reauth the Firebase connection.
	        return true;
	      }
	    }
	  }
		return false;

	}

  	$scope.saveFunc = function() {
  	$scope[id].$save();
  	// Finally, go back to the front-end
  	window.location.href= "index.html";
	}
 	window.onSignIn = onSignIn;

}]);

function signOut()
{
    firebase.auth().signOut().then(function() {
      // Sign-out successful.
    }, function(error) {
      // An error happened.
    });

    var auth2 = gapi.auth2.getAuthInstance();
    auth2.signOut().then(function () {
      location.reload();
    });
}


text:
package org.hyperledger.fabric.sdk;

import java.util.Objects;
import java.util.Properties;

import com.google.common.util.concurrent.ListenableFuture;
import io.netty.util.internal.StringUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hyperledger.fabric.protos.peer.FabricProposal;
import org.hyperledger.fabric.protos.peer.FabricProposalResponse;
import org.hyperledger.fabric.sdk.exception.InvalidArgumentException;
import org.hyperledger.fabric.sdk.exception.PeerException;

import static java.lang.String.format;
import static org.hyperledger.fabric.sdk.helper.SDKUtil.checkGrpcUrl;

/**
 * The Peer class represents a peer to which SDK sends deploy, or query proposals requests.
 */
public class Peer {
    private static final Log logger = LogFactory.getLog(Peer.class);
    private volatile EndorserClient endorserClent;
    private final Properties properties;
    private final String name;
    private final String url;
    private boolean shutdown = false;
    private Chain chain;

    Peer(String name, String grpcURL, Properties properties) throws InvalidArgumentException {

        Exception e = checkGrpcUrl(grpcURL);
        if (e != null) {
            throw new InvalidArgumentException("Bad peer url.", e);

        }

        if (StringUtil.isNullOrEmpty(name)) {
            throw new InvalidArgumentException("Invalid name for peer");
        }

        this.url = grpcURL;
        this.name = name;
        this.properties = properties == null ? null : (Properties) properties.clone(); //keep our own copy.

    }

    /**
     * Peer's name
     *
     * @return return the peer's name.
     */

    public String getName() {

        return name;
    }

    public Properties getProperties() {

        return properties == null ? null : (Properties) properties.clone();
    }

    /**
     * Set the chain the peer is on.
     *
     * @param chain
     */

    void setChain(Chain chain) throws InvalidArgumentException {

        if (null != this.chain) {
            throw new InvalidArgumentException(format("Can not add peer %s to chain %s because it already belongs to chain %s.",
                    name, chain.getName(), this.chain.getName()));
        }

        this.chain = chain;

    }

    /**
     * The chain the peer is set on.
     *
     * @return
     */

    Chain getChain() {

        return chain;

    }

    /**
     * Get the URL of the peer.
     *
     * @return {string} Get the URL associated with the peer.
     */
    public String getUrl() {

        return this.url;
    }

    /**
     * for use in list of peers comparisons , e.g. list.contains() calls
     *
     * @param otherPeer the peer instance to compare against
     * @return true if both peer instances have the same name and url
     */
    @Override
    public boolean equals(Object otherPeer) {
        if (this == otherPeer) {
            return true;
        }
        if (otherPeer == null) {
            return false;
        }
        if (!(otherPeer instanceof Peer)) {
            return false;
        }
        Peer p = (Peer) otherPeer;
        return Objects.equals(getName(), p.getName()) && Objects.equals(getUrl(), p.getUrl());
    }

    ListenableFuture<FabricProposalResponse.ProposalResponse> sendProposalAsync(FabricProposal.SignedProposal proposal)
            throws PeerException, InvalidArgumentException {
        checkSendProposal(proposal);

        logger.debug(format("peer.sendProposalAsync name: %s, url: %s", name, url));

        EndorserClient localEndorserClient = endorserClent; //work off thread local copy.

        if (null == localEndorserClient || !localEndorserClient.isChannelActive()) {
            endorserClent = localEndorserClient = new EndorserClient(new Endpoint(url, properties).getChannelBuilder());
        }

        try {
            return localEndorserClient.sendProposalAsync(proposal);
        } catch (PeerException e) { //Any error start with a clean connection.
            endorserClent = null;
            throw e;
        } catch (Throwable t) {
            endorserClent = null;
            throw t;
        }
    }

    FabricProposalResponse.ProposalResponse sendProposal(FabricProposal.SignedProposal proposal)
            throws PeerException, InvalidArgumentException {
        checkSendProposal(proposal);

        logger.debug(format("peer.sendProposalAsync name: %s, url: %s", name, url));

        EndorserClient localEndorserClient = endorserClent; //work off thread local copy.

        if (null == localEndorserClient || !localEndorserClient.isChannelActive()) {
            endorserClent = localEndorserClient = new EndorserClient(new Endpoint(url, properties).getChannelBuilder());
        }

        try {
            return localEndorserClient.sendProposal(proposal);
        } catch (PeerException e) { //Any error start with a clean connection.
            endorserClent = null;
            throw e;
        } catch (Throwable t) {
            endorserClent = null;
            throw t;
        }
    }

    private void checkSendProposal(FabricProposal.SignedProposal proposal) throws PeerException, InvalidArgumentException {

        if (shutdown) {
            throw new PeerException(format("Peer %s was shutdown.", name));
        }
        if (proposal == null) {
            throw new PeerException("Proposal is null");
        }
        Exception e = checkGrpcUrl(url);
        if (e != null) {
            throw new InvalidArgumentException("Bad peer url.", e);

        }
    }

    static Peer createNewInstance(String name, String grpcURL, Properties properties) throws InvalidArgumentException {

        return new Peer(name, grpcURL, properties);
    }

    synchronized void shutdown(boolean force) {
        if (shutdown) {
            return;
        }
        shutdown = true;
        chain = null;

        EndorserClient lendorserClent = endorserClent;

        //allow resources to finalize

        endorserClent = null;

        if (lendorserClent == null) {
            return;
        }

        lendorserClent.shutdown(force);
    }

    @Override
    protected void finalize() throws Throwable {
        shutdown(true);
        super.finalize();
    }
} // end Peer


text:
<?php

namespace Pnpc\Bundle\TortueHermannBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class PnpcTortueHermannBundle extends Bundle
{
}


text:
package ca.blarg.gdx.entities;

import com.badlogic.gdx.utils.Pool;

public abstract class Component implements Pool.Poolable {
}


text:
/**
 * @unrestricted
 */
Components.BreakpointsSidebarPaneBase = class extends UI.VBox {
  constructor() {
    super();
    this.registerRequiredCSS('components/breakpointsList.css');

    this.listElement = createElement('ol');
    this.listElement.className = 'breakpoint-list';

    this.emptyElement = createElement('div');
    this.emptyElement.className = 'gray-info-message';
    this.emptyElement.textContent = Common.UIString('No Breakpoints');

    this.element.appendChild(this.emptyElement);
  }

  /**
   * @param {!Element} element
   * @param {?Node=} beforeNode
   * @protected
   */
  addListElement(element, beforeNode) {
    if (beforeNode) {
      this.listElement.insertBefore(element, beforeNode);
    } else {
      if (!this.listElement.firstChild) {
        this.element.removeChild(this.emptyElement);
        this.element.appendChild(this.listElement);
      }
      this.listElement.appendChild(element);
    }
  }

  /**
   * @param {!Element} element
   * @protected
   */
  removeListElement(element) {
    this.listElement.removeChild(element);
    if (!this.listElement.firstChild) {
      this.element.removeChild(this.listElement);
      this.element.appendChild(this.emptyElement);
    }
  }

  /**
   * @protected
   */
  reset() {
    this.listElement.removeChildren();
    if (this.listElement.parentElement) {
      this.element.removeChild(this.listElement);
      this.element.appendChild(this.emptyElement);
    }
  }
};


text:
<?php

namespace Aivo\Highchart\Test\Axis;

use Aivo\Highchart\Axis\XAxis;

class XAxisTest extends AbstractAxisTest
{
    /**
     * @return XAxis
     */
    protected function getAxis()
    {
        return new XAxis();
    }

    public function testFactory()
    {
        $this->assertInstanceOf('Aivo\Highchart\Axis\XAxisInterface', XAxis::factory());
    }
}


text:
<?php

namespace Frontend\Modules\MediaLibrary\Widgets;

use Backend\Modules\MediaLibrary\Domain\MediaGroupMediaItem\MediaGroupMediaItem;
use Frontend\Modules\MediaLibrary\Widgets\Base\FrontendMediaWidget;

class OneRandomImage extends FrontendMediaWidget
{
    public function execute(): void
    {
        $this->loadData();

        // We need to have a MediaGroup to show this widget
        if (!$this->mediaGroup) {
            return;
        }

        parent::execute();
        $this->loadTemplate();
        $this->parse();
    }

    protected function parse(): void
    {
        /** @var MediaGroupMediaItem $randomConnectedItem */
        $randomConnectedItem = $this->mediaGroup->getConnectedItems()->get(
            array_rand($this->mediaGroup->getConnectedItems()->toArray())
        );

        if ($randomConnectedItem === null) {
            return;
        }

        // Add OpenGraph image
        $this->header->addOpenGraphImage($randomConnectedItem->getItem()->getAbsoluteWebPath());

        // Assign item (and their source and other custom resolutions)
        $this->template->assign('mediaItem', $randomConnectedItem->getItem());
    }
}


text:
from .AzureBlobStorageProcessorBase import AzureBlobStorageProcessorBase

class PutAzureBlobStorage(AzureBlobStorageProcessorBase):
    def __init__(self):
        super(PutAzureBlobStorage, self).__init__(
            'PutAzureBlobStorage',
            {'Create Container': 'true'})


text:
using System;
using System.Collections.Generic;
using System.Drawing;

using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.MapKit;

using MonoTouch.CoreLocation;
using System.IO;
using System.Linq;

namespace Mappir
{
  public enum tiposPuntos{
		Bache,
		Accidente,
		Bloqueo,
		CondicionInsegura,
		RadarVelocidad,
		Congestionamiento,
		Manifestacion,
		Reten,
		Policia,
		Obras
	}

	public class MenuAlertas: AlertasMap
	{

		public double currentLongitud {
			get;
			set;
		}
		public double currentLatitud {
			get;
			set;
		}

		private UIButton backgroundLayout {
			get;
			set;
		}

		private UIImageView backgroundMenuAlertas {
			get;
			set;
		}
		private UIImageView backgroundIconos {
			get;
			set;
		}

		public CLLocationManager locManager {
			get;
			set;
		}

		public MenuAlertas (UIView container, MKMapView mapa, MappirViewController parent )
		{
			this.container = container;
			this.map = mapa;
			this.parent = parent;

			locManager = new CLLocationManager();

			if (locManager.Location == null) {
		    	//Activando gps
				locManager.StartUpdatingLocation ();
			}

			if (locManager.Location != null) {
				this.currentLatitud = locManager.Location.Coordinate.Latitude;
				this.currentLongitud = locManager.Location.Coordinate.Longitude;

				//Evento para actualizar la coordenada
				locManager.LocationsUpdated += delegate(object sender, CLLocationsUpdatedEventArgs e) {

					foreach (CLLocation l in e.Locations) {
						Console.WriteLine (l.Coordinate.Latitude.ToString () + ", " + l.Coordinate.Longitude.ToString ());
						this.currentLatitud = l.Coordinate.Latitude;
						this.currentLongitud = l.Coordinate.Longitude;
					}
				};

				crearFondoMenuAlerta ();
				crearAlertas ();

				//cargar imagen transparente
				crearImagenTransparente ();

				mostrarBackGroundMenu ();
				mostrarAlertasIconos ();
			} else {

				UIAlertView _error = new UIAlertView ("gps desactivado", "Para crear alertas, es necesario activar el gps en ajustes", null, "Aceptar", null);

				_error.Show ();

			//gps esta apagado activarlo
				//map.ShowsUserLocation = true;
				locManager.StartUpdatingLocation ();
			}

			//Alertas en el mapa
			parent.lstAlertas = new List<Alerta> ();

			//mostrarTodasAlertasGuardadas ();
		}

		private void crearImagenTransparente(){

			backgroundLayout = UIButton.FromType(UIButtonType.Custom);
			backgroundLayout.Frame = new RectangleF(0, 0, container.Bounds.Width, container.Bounds.Height);
			backgroundLayout.SetImage(UIImage.FromFile(imageLayout), UIControlState.Normal);

		    //Configuraciones de eventos________________________________________________________
            backgroundLayout.TouchUpInside += (object sender, EventArgs e) => {
				   backgroundLayout.RemoveFromSuperview();

					ocultaBackGroundMenu();
					ocultaAlertasIconos ();
			};

			//Colocar el boton en el contenedor _______________________________________________
				container.Add(backgroundLayout);

		}
		private void crearFondoMenuAlerta(){

			backgroundMenuAlertas =  new UIImageView (UIImage.FromBundle(imageBackgroundMenu));

			backgroundMenuAlertas.Hidden = true;

			backgroundIconos =  new UIImageView (UIImage.FromBundle(imageFondoIconos));

			backgroundIconos.Hidden = true;

		}

		protected override UIButton crearAlerta(string imagePath){

			var toolButton = UIButton.FromType(UIButtonType.Custom);
			toolButton.SetImage(UIImage.FromFile (imagePath), UIControlState.Normal);

			toolButton.TouchUpInside += delegate
			{

				selectorAlerta(imagePath);

			};

			return toolButton;
		}

		private	void mostrarBackGroundMenu(){

			backgroundMenuAlertas.RemoveFromSuperview ();

			backgroundIconos.RemoveFromSuperview ();

			backgroundMenuAlertas.Frame = new RectangleF((float)((container.Bounds.Width -withBackground)/2  ), (float)(container.Bounds.Height -heightBackground - 50 ),(float) withBackground,(float)heightBackground);
			container.Add (backgroundMenuAlertas);

			backgroundMenuAlertas.Hidden = false;

			backgroundIconos.Frame = new RectangleF((float)((container.Bounds.Width -withBackground)/2 + 15 ), (float)(container.Bounds.Height -heightBackground -50 ),(float) (withBackground -30),(float)heightBackground);
			container.Add (backgroundIconos);

			backgroundIconos.Hidden = false;

		}
		private void ocultaBackGroundMenu(){

			backgroundMenuAlertas.RemoveFromSuperview ();
			backgroundIconos.RemoveFromSuperview ();

		}

		private void selectorAlerta (string image){

			//Esconder
			backgroundLayout.RemoveFromSuperview();
			ocultaBackGroundMenu();
			ocultaAlertasIconos ();

			//Crear anotacion

			//Agregar anotacion en el mapa
			Alerta actualAlerta = crearAlertaPunto(image);

			if (actualAlerta != null) {

				//guardar la alerta en la base de datos
				AlertaManager.SaveAlerta(actualAlerta);

				///Agregar la alerta a la lista de alertas visibles en el mapa
				parent.lstAlertas.Add (actualAlerta);

				ActualizarAlertasMapa ();
			}

		}
		public Alerta crearAlertaPunto(string image){
			//Obtener las alertas de archivo guardado

			Alerta alerta = null;

			//Los valores de georeferencia son validos?
			if (this.currentLatitud > 0) {

				string title = image.Replace (".png","" ).Replace ("MenuAlertas/", "");

				alerta = new Alerta (title, this.currentLatitud, this.currentLongitud, image, Convert.ToInt32 (HelperUtilities.getTypePoint (image)));

			} else {
				//buscar la coordenada actual

			}

			return alerta;
		}

	}
}


text:
/**
 * @author Xu, Yuan
 */
package de.naoth.rc.dialogs;

import com.sun.j3d.exp.swing.JCanvas3D;
import de.naoth.rc.Helper;
import de.naoth.rc.RobotControl;
import de.naoth.rc.core.dialog.AbstractDialog;
import de.naoth.rc.core.dialog.DialogPlugin;
import de.naoth.rc.core.dialog.RCDialog;
import de.naoth.rc.core.manager.ObjectListener;
import de.naoth.rc.dataformats.JanusImage;
import de.naoth.rc.drawings3d.OrbitBehavior;
import de.naoth.rc.drawings3d.Scene;
import de.naoth.rc.drawings3d.VirtualWorld;
import de.naoth.rc.manager.ImageManagerBottom;
import de.naoth.rc.manager.ImageManagerTop;
import de.naoth.rc.manager.ThreeDimensionSceneManager;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
import javax.media.j3d.Appearance;
import javax.media.j3d.BoundingSphere;
import javax.media.j3d.BranchGroup;
import javax.media.j3d.GraphicsConfigTemplate3D;
import javax.media.j3d.ImageComponent2D;
import javax.media.j3d.PhysicalBody;
import javax.media.j3d.PhysicalEnvironment;
import javax.media.j3d.QuadArray;
import javax.media.j3d.Shape3D;
import javax.media.j3d.Texture2D;
import javax.media.j3d.TextureAttributes;
import javax.media.j3d.TransformGroup;
import javax.media.j3d.View;
import javax.media.j3d.ViewPlatform;
import javax.vecmath.Point3d;
import javax.vecmath.Point3f;
import javax.vecmath.TexCoord2f;
import javax.vecmath.Vector3d;
import javax.vecmath.Vector3f;
import net.xeoh.plugins.base.annotations.PluginImplementation;
import net.xeoh.plugins.base.annotations.injections.InjectPlugin;

//@PluginImplementation
public class ThreeDimensionViewer extends AbstractDialog
        implements ObjectListener<Scene>
{

  @RCDialog(category = RCDialog.Category.View, name = "3D")
  @PluginImplementation
  public static class Plugin extends DialogPlugin<ThreeDimensionViewer>
  {
      @InjectPlugin
      public static RobotControl parent;
      @InjectPlugin
      public static ThreeDimensionSceneManager threeDimensionSceneManager;
      @InjectPlugin
      public static ImageManagerBottom imageManager;
      @InjectPlugin
      public static ImageManagerTop imageTopManager;
  }//end Plugin

  private VirtualWorld vw;
  private JCanvas3D canvas;
  private final BoundingSphere globalBounds = new BoundingSphere(new Point3d(0, 0, 0), Double.MAX_VALUE);
  // Entities
  private Scene activeScene;
  private static boolean java3dAvailable = true;

  private ObjectListener imageListener;
  private ObjectListener imageListenerTop;

  private JanusImage image;
  private JanusImage imageTop;

  /** Creates new form ThreeDimensionViewer */
  public ThreeDimensionViewer()
  {
    super();
    initComponents();
    if (java3dAvailable)
    {
      try
      {
        vw = VirtualWorld.get();
//        GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();
//
//        GraphicsConfiguration gconf = GraphicsEnvironment.getLocalGraphicsEnvironment()
//          .getDefaultScreenDevice().getBestConfiguration(template);
//
//        canvas = new Canvas3D(gconf);
        canvas = new JCanvas3D(new GraphicsConfigTemplate3D());
      } catch (java.lang.UnsatisfiedLinkError e)
      {
        Helper.handleException("Java 3D is not installed!\n" +
                "Visit https://java3d.dev.java.net", new Exception(e));
        java3dAvailable = false;
      }
    }
  }

  /** This method is called from within the constructor to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanelCanvas = new javax.swing.JPanel();
        jToolBar = new javax.swing.JToolBar();
        jToggleButtonUpdate = new javax.swing.JToggleButton();
        cbProcess = new javax.swing.JComboBox<>();
        jCheckBoxField = new javax.swing.JCheckBox();
        jCheckBoxGrid = new javax.swing.JCheckBox();
        jCheckBoxImage = new javax.swing.JCheckBox();
        cbUseFieldViewer = new javax.swing.JCheckBox();

        javax.swing.GroupLayout jPanelCanvasLayout = new javax.swing.GroupLayout(jPanelCanvas);
        jPanelCanvas.setLayout(jPanelCanvasLayout);
        jPanelCanvasLayout.setHorizontalGroup(
            jPanelCanvasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        jPanelCanvasLayout.setVerticalGroup(
            jPanelCanvasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 269, Short.MAX_VALUE)
        );

        jToolBar.setFloatable(false);
        jToolBar.setRollover(true);

        jToggleButtonUpdate.setText("Update");
        jToggleButtonUpdate.setToolTipText("Update scene from robot.");
        jToggleButtonUpdate.setFocusable(false);
        jToggleButtonUpdate.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jToggleButtonUpdate.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToggleButtonUpdate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButtonUpdateActionPerformed(evt);
            }
        });
        jToolBar.add(jToggleButtonUpdate);

        cbProcess.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Cognition", "Motion" }));
        cbProcess.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbProcessActionPerformed(evt);
            }
        });
        jToolBar.add(cbProcess);

        jCheckBoxField.setSelected(true);
        jCheckBoxField.setText("Field");
        jCheckBoxField.setToolTipText("Show the soccer field.");
        jCheckBoxField.setFocusable(false);
        jCheckBoxField.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        jCheckBoxField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBoxFieldActionPerformed(evt);
            }
        });
        jToolBar.add(jCheckBoxField);

        jCheckBoxGrid.setText("Grid");
        jCheckBoxGrid.setToolTipText("Show the soccer field.");
        jCheckBoxGrid.setFocusable(false);
        jCheckBoxGrid.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jCheckBoxGrid.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBoxGridActionPerformed(evt);
            }
        });
        jToolBar.add(jCheckBoxGrid);

        jCheckBoxImage.setText("Image");
        jCheckBoxImage.setToolTipText("Receive image from camera of robot.");
        jCheckBoxImage.setFocusable(false);
        jCheckBoxImage.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        jCheckBoxImage.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jCheckBoxImage.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBoxImageActionPerformed(evt);
            }
        });
        jToolBar.add(jCheckBoxImage);

        cbUseFieldViewer.setText("Use FieldViewer");
        cbUseFieldViewer.setFocusable(false);
        cbUseFieldViewer.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        cbUseFieldViewer.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar.add(cbUseFieldViewer);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBar, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
            .addComponent(jPanelCanvas, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelCanvas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

  private void jCheckBoxFieldActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jCheckBoxFieldActionPerformed
  {//GEN-HEADEREND:event_jCheckBoxFieldActionPerformed
    vw.enableField(jCheckBoxField.isSelected());
  }//GEN-LAST:event_jCheckBoxFieldActionPerformed

  private void jToggleButtonUpdateActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jToggleButtonUpdateActionPerformed
  {//GEN-HEADEREND:event_jToggleButtonUpdateActionPerformed
    if (jToggleButtonUpdate.isSelected())
    {
      if (Plugin.parent.checkConnected())
      {
        Plugin.threeDimensionSceneManager.addListener(this);
      } else
      {
        jToggleButtonUpdate.setSelected(false);
      }
    } else
    {
      Plugin.threeDimensionSceneManager.removeListener(this);
    }
  }//GEN-LAST:event_jToggleButtonUpdateActionPerformed

  private void jCheckBoxImageActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jCheckBoxImageActionPerformed
  {//GEN-HEADEREND:event_jCheckBoxImageActionPerformed
    if (jCheckBoxImage.isSelected())
    {
      if (Plugin.parent.checkConnected())
      {
        Plugin.imageManager.addListener(imageListener);
        Plugin.imageTopManager.addListener(imageListenerTop);
      } else
      {
        jCheckBoxImage.setSelected(false);
      }
    } else
    {
      Plugin.imageManager.removeListener(imageListener);
      Plugin.imageTopManager.removeListener(imageListenerTop);
      image = null;
      imageTop = null;
    }
  }//GEN-LAST:event_jCheckBoxImageActionPerformed

    private void jCheckBoxGridActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxGridActionPerformed
        vw.enableCoordinates(jCheckBoxGrid.isSelected());
    }//GEN-LAST:event_jCheckBoxGridActionPerformed

    private void cbProcessActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbProcessActionPerformed
        String process = (String) cbProcess.getSelectedItem();
        Plugin.threeDimensionSceneManager.setModuleOwner(process);
    }//GEN-LAST:event_cbProcessActionPerformed

  @Override
  public void init()
  {
    if (!java3dAvailable)
    {
      jToggleButtonUpdate.setEnabled(false);
      jCheckBoxField.setEnabled(false);
      return;
    }

    jPanelCanvas.add(canvas);
    canvas.setSize(1, 1);
    jPanelCanvas.addComponentListener(new ComponentListener()
    {
      @Override
      public void componentResized(ComponentEvent e)
      {
        try
        {
          canvas.setSize(jPanelCanvas.getSize());
        } catch (IllegalArgumentException ex)
        {
        }
      }

      @Override
      public void componentMoved(ComponentEvent e){}

      @Override
      public void componentShown(ComponentEvent e){}

      @Override
      public void componentHidden(ComponentEvent e){}
    });

    createViewBranch(new Vector3f(2, 0, 0.5f));

    imageListener = new ObjectListener<JanusImage>()
    {

      @Override
      public void newObjectReceived(JanusImage object)
      {
        image = object;
      }

      @Override
      public void errorOccured(String cause)
      {
        jCheckBoxImage.setSelected(false);
        ThreeDimensionViewer.Plugin.imageManager.removeListener(imageListener);
        image = null;
      }
    };

    imageListenerTop = new ObjectListener<JanusImage>()
    {

      @Override
      public void newObjectReceived(JanusImage object)
      {
        imageTop = object;
      }

      @Override
      public void errorOccured(String cause)
      {
        jCheckBoxImage.setSelected(false);
        ThreeDimensionViewer.Plugin.imageTopManager.removeListener(imageListenerTop);
        imageTop = null;
      }
    };

  }

  private void createViewBranch(Vector3f homeViewPos)
  {
    BranchGroup viewBranch = new BranchGroup();

    TransformGroup viewTG = new TransformGroup();
    viewTG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);

    ViewPlatform vp = new ViewPlatform();

    View view = new View();
    view.setPhysicalBody(new PhysicalBody());
    view.setPhysicalEnvironment(new PhysicalEnvironment());

    view.attachViewPlatform(vp);
    // View renders into the off-screen Canvas3D
    view.addCanvas3D(canvas.getOffscreenCanvas3D());

    OrbitBehavior orbit = new OrbitBehavior(canvas, viewTG, view);
    orbit.setSchedulingBounds(globalBounds);
    orbit.setClippingEnabled(false);

    orbit.setViewingTransform(new Point3d(homeViewPos), new Point3d(0, 0, 0),
            new Vector3d(0, 0, 1), new Point3d(0, 0, 0));

    viewTG.addChild(vp);
    viewTG.addChild(orbit);

    viewBranch.addChild(viewTG);
    vw.add(viewBranch);
  }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox<String> cbProcess;
    private javax.swing.JCheckBox cbUseFieldViewer;
    private javax.swing.JCheckBox jCheckBoxField;
    private javax.swing.JCheckBox jCheckBoxGrid;
    private javax.swing.JCheckBox jCheckBoxImage;
    private javax.swing.JPanel jPanelCanvas;
    private javax.swing.JToggleButton jToggleButtonUpdate;
    private javax.swing.JToolBar jToolBar;
    // End of variables declaration//GEN-END:variables

  @Override
  public void newObjectReceived(Scene object)
  {
    if (object == activeScene)
    {
      return;
    }

    // attach the image of camera
    object.addCameraImage(image, "bottom");
    object.addCameraImage(imageTop, "top");

    if(this.cbUseFieldViewer.isSelected() && FieldViewer.getCanvas() != null)
    {
        object.addChild(createFieldViewertexture());
    }

    vw.add(object);
    if (activeScene != null)
    {
      activeScene.detach();
    }
    activeScene = object;

    //exportScreenshotToPNG(new File("test3d_" + (kkk++) + ".png"));
  }

  private Shape3D createFieldViewertexture()
  {
    float width = 3.7f; // in m
    float height = 2.7f; // in m
    int width_px = (int)(width*2000); // 1mm^2 ~ 1px
    int height_px = (int)(height*2000); // 1mm^2 ~ 1px

    // create the texture image
    BufferedImage image = new BufferedImage(height_px, width_px, BufferedImage.TYPE_INT_RGB);
    Graphics2D g2d = image.createGraphics();
    g2d.setColor(new Color(0.9f,0.9f,0.9f));
    g2d.fillRect(0, 0, height_px, width_px);
    FieldViewer.getCanvas().paintDrawings(g2d, height_px/2, width_px/2, -Math.PI*0.5, 0.5);

    // create the texture appearence
    ImageComponent2D imageComponent = new ImageComponent2D(ImageComponent2D.FORMAT_RGB, image);
    Texture2D tex = new Texture2D(Texture2D.INTENSITY, Texture2D.RGB, imageComponent.getWidth(), imageComponent.getHeight());
    tex.setImage(0, imageComponent);
    TextureAttributes texAttr = new TextureAttributes();
    texAttr.setPerspectiveCorrectionMode(TextureAttributes.NICEST);
    Appearance app = new Appearance();
    app.setTexture(tex);
    app.setTextureAttributes(texAttr);

    // create the geometry for the texture
    QuadArray rect = new QuadArray(4, QuadArray.COORDINATES | QuadArray.TEXTURE_COORDINATE_2);
    rect.setCoordinate(0, new Point3f(-width,  height, 0.0001f));
    rect.setCoordinate(1, new Point3f(-width, -height, 0.0001f));
    rect.setCoordinate(2, new Point3f( width, -height, 0.0001f));
    rect.setCoordinate(3, new Point3f( width,  height, 0.0001f));

    rect.setTextureCoordinate(0, 0, new TexCoord2f(1.0f, 1.0f));
    rect.setTextureCoordinate(0, 1, new TexCoord2f(0.0f, 1.0f));
    rect.setTextureCoordinate(0, 2, new TexCoord2f(0.0f, 0.0f));
    rect.setTextureCoordinate(0, 3, new TexCoord2f(1.0f, 0.0f));

    // create the 3D shape representing the image object
    return new Shape3D(rect, app);
  }

  private void exportScreenshotToPNG(File file) {
    BufferedImage image = new BufferedImage(canvas.getWidth(), canvas.getHeight(), BufferedImage.TYPE_INT_RGB);
    Graphics2D g2d = image.createGraphics();
    canvas.paintAll(g2d);
    try{
        ImageIO.write(image, "PNG", file);
    }catch(Exception e){}
  }

  @Override
  public void errorOccured(String cause)
  {
    jToggleButtonUpdate.setSelected(false);
    Plugin.threeDimensionSceneManager.removeListener(this);
//    Helper.handleException(cause, null);
  }

  @Override
  public void dispose()
  {
    Plugin.threeDimensionSceneManager.removeListener(this);
    Plugin.imageManager.removeListener(imageListener);
    Plugin.imageTopManager.removeListener(imageListenerTop);
    //System.out.println("Dispose is not implemented for: " + this.getClass().getName());
  }//end dispose
}


text:
<?php
error_reporting(E_ALL|E_STRICT);
date_default_timezone_set('Europe/London');

set_include_path('.' . PATH_SEPARATOR . './library/'
	 . PATH_SEPARATOR . './application/models/'
	 . PATH_SEPARATOR . './application/lib/'
	 . PATH_SEPARATOR . get_include_path());
include "Zend/Loader.php";

Zend_Loader::loadClass('Zend_Controller_Front');
Zend_Loader::loadClass('Zend_Registry');
Zend_Loader::loadClass('Zend_View');
Zend_Loader::loadClass('Zend_Config_Ini');
Zend_Loader::loadClass('Zend_Db');
Zend_Loader::loadClass('Zend_Db_Table');
Zend_Loader::loadClass('Zend_Debug');
Zend_Loader::loadClass('Zend_Auth');

// load configuration
$config = new Zend_Config_Ini('./application/config.ini', 'general');
Zend_Registry::set('config', $config);

// setup database
$db = Zend_Db::factory($config->db->adapter,
        $config->db->config->toArray());
Zend_Db_Table::setDefaultAdapter($db);
Zend_Registry::set('db', $db);

// setup controller
$frontController = Zend_Controller_Front::getInstance();
$frontController->throwExceptions(true);
$frontController->setControllerDirectory('./application/controllers');

// run!
$frontController->dispatch();


text:
#ifndef _LINUX_VIRTIO_CONFIG_H
#define _LINUX_VIRTIO_CONFIG_H

/* Virtio devices use a standardized configuration space to define their
 * features and pass configuration information, but each implementation can
 * store and access that space differently. */
#include <linux/types.h>

/* Status byte for guest to report progress, and synchronize features. */
/* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */
#define VIRTIO_CONFIG_S_ACKNOWLEDGE	1
/* We have found a driver for the device. */
#define VIRTIO_CONFIG_S_DRIVER		2
/* Driver has used its parts of the config, and is happy */
#define VIRTIO_CONFIG_S_DRIVER_OK	4
/* We've given up on this device. */
#define VIRTIO_CONFIG_S_FAILED		0x80

/* Some virtio feature bits (currently bits 28 through 31) are reserved for the
 * transport being used (eg. virtio_ring), the rest are per-device feature
 * bits. */
#define VIRTIO_TRANSPORT_F_START	28
#define VIRTIO_TRANSPORT_F_END		32

/* Do we get callbacks when the ring is completely used, even if we've
 * suppressed them? */
#define VIRTIO_F_NOTIFY_ON_EMPTY	24

#ifdef __KERNEL__
#include <linux/err.h>
#include <linux/bug.h>
#include <linux/virtio.h>

/**
 * virtio_config_ops - operations for configuring a virtio device
 * @get: read the value of a configuration field
 *	vdev: the virtio_device
 *	offset: the offset of the configuration field
 *	buf: the buffer to write the field value into.
 *	len: the length of the buffer
 * @set: write the value of a configuration field
 *	vdev: the virtio_device
 *	offset: the offset of the configuration field
 *	buf: the buffer to read the field value from.
 *	len: the length of the buffer
 * @get_status: read the status byte
 *	vdev: the virtio_device
 *	Returns the status byte
 * @set_status: write the status byte
 *	vdev: the virtio_device
 *	status: the new status byte
 * @reset: reset the device
 *	vdev: the virtio device
 *	After this, status and feature negotiation must be done again
 *	Device must not be reset from its vq/config callbacks, or in
 *	parallel with being added/removed.
 * @find_vqs: find virtqueues and instantiate them.
 *	vdev: the virtio_device
 *	nvqs: the number of virtqueues to find
 *	vqs: on success, includes new virtqueues
 *	callbacks: array of callbacks, for each virtqueue
 *	names: array of virtqueue names (mainly for debugging)
 *	Returns 0 on success or error status
 * @del_vqs: free virtqueues found by find_vqs().
 * @get_features: get the array of feature bits for this device.
 *	vdev: the virtio_device
 *	Returns the first 32 feature bits (all we currently need).
 * @finalize_features: confirm what device features we'll be using.
 *	vdev: the virtio_device
 *	This gives the final feature bits for the device: it can change
 *	the dev->feature bits if it wants.
 * @bus_name: return the bus name associated with the device
 *	vdev: the virtio_device
 *      This returns a pointer to the bus name a la pci_name from which
 *      the caller can then copy.
 */
typedef void vq_callback_t(struct virtqueue *);
struct virtio_config_ops {
	void (*get)(struct virtio_device *vdev, unsigned offset,
		    void *buf, unsigned len);
	void (*set)(struct virtio_device *vdev, unsigned offset,
		    const void *buf, unsigned len);
	u8 (*get_status)(struct virtio_device *vdev);
	void (*set_status)(struct virtio_device *vdev, u8 status);
	void (*reset)(struct virtio_device *vdev);
	int (*find_vqs)(struct virtio_device *, unsigned nvqs,
			struct virtqueue *vqs[],
			vq_callback_t *callbacks[],
			const char *names[]);
	void (*del_vqs)(struct virtio_device *);
	u32 (*get_features)(struct virtio_device *vdev);
	void (*finalize_features)(struct virtio_device *vdev);
	const char *(*bus_name)(struct virtio_device *vdev);
};

/* If driver didn't advertise the feature, it will never appear. */
void virtio_check_driver_offered_feature(const struct virtio_device *vdev,
					 unsigned int fbit);

/**
 * virtio_has_feature - helper to determine if this device has this feature.
 * @vdev: the device
 * @fbit: the feature bit
 */
static inline bool virtio_has_feature(const struct virtio_device *vdev,
				      unsigned int fbit)
{
	/* Did you forget to fix assumptions on max features? */
	if (__builtin_constant_p(fbit))
		BUILD_BUG_ON(fbit >= 32);
	else
		BUG_ON(fbit >= 32);

	if (fbit < VIRTIO_TRANSPORT_F_START)
		virtio_check_driver_offered_feature(vdev, fbit);

	return test_bit(fbit, vdev->features);
}

/**
 * virtio_config_val - look for a feature and get a virtio config entry.
 * @vdev: the virtio device
 * @fbit: the feature bit
 * @offset: the type to search for.
 * @v: a pointer to the value to fill in.
 *
 * The return value is -ENOENT if the feature doesn't exist.  Otherwise
 * the config value is copied into whatever is pointed to by v. */
#define virtio_config_val(vdev, fbit, offset, v) \
	virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v))

#define virtio_config_val_len(vdev, fbit, offset, v, len) \
	virtio_config_buf((vdev), (fbit), (offset), (v), (len))

static inline int virtio_config_buf(struct virtio_device *vdev,
				    unsigned int fbit,
				    unsigned int offset,
				    void *buf, unsigned len)
{
	if (!virtio_has_feature(vdev, fbit))
		return -ENOENT;

	vdev->config->get(vdev, offset, buf, len);
	return 0;
}

static inline
struct virtqueue *virtio_find_single_vq(struct virtio_device *vdev,
					vq_callback_t *c, const char *n)
{
	vq_callback_t *callbacks[] = { c };
	const char *names[] = { n };
	struct virtqueue *vq;
	int err = vdev->config->find_vqs(vdev, 1, &vq, callbacks, names);
	if (err < 0)
		return ERR_PTR(err);
	return vq;
}

static inline
const char *virtio_bus_name(struct virtio_device *vdev)
{
	if (!vdev->config->bus_name)
		return "virtio";
	return vdev->config->bus_name(vdev);
}

#endif /* __KERNEL__ */
#endif /* _LINUX_VIRTIO_CONFIG_H */


text:
"doc"

from xml.sax import saxutils

def afunc():
    stuff = saxutils.escape.make_parser('junk')
    return stuff


text:
package v1alpha1

import (
	"context"
	"testing"

	"github.com/google/go-cmp/cmp"
	corev1 "k8s.io/api/core/v1"
	duckv1 "knative.dev/pkg/apis/duck/v1"
	"knative.dev/pkg/webhook/resourcesemantics"

	"knative.dev/pkg/apis"
)

func TestMongoDbSourceValidation(t *testing.T) {
	testCases := map[string]struct {
		cr   resourcesemantics.GenericCRD
		want *apis.FieldError
	}{
		"missing all": {
			cr: &MongoDbSource{
				Spec: MongoDbSourceSpec{},
			},
			want: func() *apis.FieldError {
				var errs *apis.FieldError
				fe := apis.ErrMissingField("spec.database, spec.secret, spec.serviceAccountName, spec.sink")
				errs = errs.Also(fe)
				return errs
			}(),
		},
		"Incorrect Sink": {
			cr: &MongoDbSource{
				Spec: MongoDbSourceSpec{
					ServiceAccountName: "google",
					Secret: corev1.LocalObjectReference{
						Name: "pwd",
					},
					Database:   "db",
					Collection: "col1",
					SourceSpec: duckv1.SourceSpec{
						Sink: duckv1.Destination{
							Ref: &duckv1.KReference{
								APIVersion: "foo",
								// Kind:       "bar",
								Namespace: "baz",
								Name:      "qux",
							},
						},
					},
				},
			},
			want: func() *apis.FieldError {
				var errs *apis.FieldError
				fe := apis.ErrMissingField("spec.sink.ref.kind")
				errs = errs.Also(fe)
				return errs
			}(),
		},
		"No Secret": {
			cr: &MongoDbSource{
				Spec: MongoDbSourceSpec{
					ServiceAccountName: "google",
					Secret: corev1.LocalObjectReference{
						Name: "",
					},
					Database:   "db",
					Collection: "col1",
					SourceSpec: duckv1.SourceSpec{
						Sink: duckv1.Destination{
							Ref: &duckv1.KReference{
								APIVersion: "foo",
								Kind:       "bar",
								Namespace:  "baz",
								Name:       "qux",
							},
						},
					},
				},
			},
			want: func() *apis.FieldError {
				var errs *apis.FieldError
				fe := apis.ErrMissingField("spec.secret")
				errs = errs.Also(fe)
				return errs
			}(),
		},
		"All fields present": {
			cr: &MongoDbSource{
				Spec: MongoDbSourceSpec{
					ServiceAccountName: "google",
					Secret: corev1.LocalObjectReference{
						Name: "pwd",
					},
					Database:   "db",
					Collection: "col1",
					SourceSpec: duckv1.SourceSpec{
						Sink: duckv1.Destination{
							Ref: &duckv1.KReference{
								APIVersion: "foo",
								Kind:       "bar",
								Namespace:  "baz",
								Name:       "qux",
							},
						},
					},
				},
			},
			want: nil,
		},
	}

	for n, test := range testCases {
		t.Run(n, func(t *testing.T) {
			got := test.cr.Validate(context.Background())
			if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
				t.Errorf("%s: validate (-want, +got) = %v", n, diff)
			}
		})
	}
}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('studygroups', '0096_delete_activity'),
    ]

    operations = [
        migrations.AddField(
            model_name='profile',
            name='reason_for_registration',
            field=models.CharField(choices=[('Learn', 'Learn'), ('Facilitate', 'Facilitate'), ('Join the community', 'Join the community')], default='Facilitate', max_length=30),
        ),
    ]


text:
package io.quarkus.it.spring;

import static io.restassured.RestAssured.when;
import static org.hamcrest.Matchers.containsString;
import static org.junit.jupiter.api.Assertions.assertNotEquals;

import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.response.Response;

@QuarkusTest
public class InjectedSpringBeansResourceTest {

    @Test
    public void testInjection() {
        RestAssured.when().get("/spring-test").then()
                .body(containsString("YOLO WORLD!"));
    }

    @Test
    public void testRequestScope() {
        RestAssured.when().get("/spring-test/request").then()
                .body(Matchers.is("0"));
        RestAssured.when().get("/spring-test/request").then()
                .body(Matchers.is("1"));
    }

    @Test
    public void testSessionScope() {
        final Response first = when().get("/spring-test/session");
        final String sessionId = first.sessionId();
        first.then()
                .statusCode(200)
                .body(Matchers.is("0"));
        RestAssured.given()
                .sessionId(sessionId)
                .when()
                .get("/spring-test/session")
                .then()
                .statusCode(200)
                .body(Matchers.is("1"));

        RestAssured.given()
                .sessionId(sessionId)
                .when()
                .post("/spring-test/invalidate")
                .then();

        final Response second = RestAssured.given()
                .sessionId(sessionId)
                .when()
                .get("/spring-test/session");
        assertNotEquals(sessionId, second.sessionId());
        second.then()
                .statusCode(200)
                .body(Matchers.is("0"));
    }

    @Test
    public void testPrototypeScope() {
        RestAssured.when().get("/spring-test/prototype").then()
                .body(Matchers.containsString("0"))
                .body(Matchers.containsString("1"));
    }
}


text:
namespace bluez {

namespace {

constexpr uint16_t kServiceUuidAttributeId = 0x0003;

constexpr char kServiceUuid1[] = "00001801-0000-1000-8000-00805f9b34fb";
constexpr char kServiceUuid2[] = "00001801-0000-1000-7000-00805f9b34fb";
constexpr char kServiceUuid3[] = "00001801-0000-1000-3000-00805f9b34fb";

}  // namespace

class BluetoothServiceRecordBlueZTest : public device::BluetoothTestBlueZ {
 public:
  BluetoothServiceRecordBlueZTest()
      : adapter_bluez_(nullptr),
        success_callbacks_(0),
        error_callbacks_(0),
        last_seen_handle_(0) {}

  void SetUp() override {
    BluetoothTestBlueZ::SetUp();
    InitWithFakeAdapter();
    adapter_bluez_ = static_cast<bluez::BluetoothAdapterBlueZ*>(adapter_.get());
  }

  uint32_t CreateServiceRecordWithCallbacks(
      const BluetoothServiceRecordBlueZ& record) {
    const size_t old_success_callbacks = success_callbacks_;
    const size_t old_error_callbacks = error_callbacks_;
    // Note: Our fake implementation will never give us a handle of 0, so we
    // can know that we will never have a record with the handle 0. Hence using
    // 0 as an invalid handle return value is okay.
    last_seen_handle_ = 0;
    adapter_bluez_->CreateServiceRecord(
        record,
        base::Bind(
            &BluetoothServiceRecordBlueZTest::CreateServiceSuccessCallback,
            base::Unretained(this)),
        base::Bind(&BluetoothServiceRecordBlueZTest::ErrorCallback,
                   base::Unretained(this)));
    EXPECT_EQ(old_success_callbacks + 1, success_callbacks_);
    EXPECT_EQ(old_error_callbacks, error_callbacks_);
    EXPECT_NE(0u, last_seen_handle_);
    return last_seen_handle_;
  }

  void RemoveServiceRecordWithCallbacks(uint32_t handle, bool expect_success) {
    const size_t old_success_callbacks = success_callbacks_;
    const size_t old_error_callbacks = error_callbacks_;
    adapter_bluez_->RemoveServiceRecord(
        handle,
        base::Bind(
            &BluetoothServiceRecordBlueZTest::RemoveServiceSuccessCallback,
            base::Unretained(this)),
        base::Bind(&BluetoothServiceRecordBlueZTest::ErrorCallback,
                   base::Unretained(this)));
    size_t success = expect_success ? 1 : 0;
    EXPECT_EQ(old_success_callbacks + success, success_callbacks_);
    EXPECT_EQ(old_error_callbacks + 1 - success, error_callbacks_);
  }

  void GetServiceRecords(BluetoothDeviceBlueZ* device, bool expect_success) {
    const size_t old_success_callbacks = success_callbacks_;
    const size_t old_error_callbacks = error_callbacks_;
    records_.clear();
    device->GetServiceRecords(
        base::Bind(&BluetoothServiceRecordBlueZTest::GetServiceRecordsCallback,
                   base::Unretained(this)),
        base::Bind(&BluetoothServiceRecordBlueZTest::ErrorCallback,
                   base::Unretained(this)));
    size_t success = expect_success ? 1 : 0;
    EXPECT_EQ(old_success_callbacks + success, success_callbacks_);
    EXPECT_EQ(old_error_callbacks + 1 - success, error_callbacks_);
  }

  void VerifyRecords() {
    EXPECT_EQ(2u, records_.size());

    std::vector<uint16_t> ids0 = records_[0].GetAttributeIds();
    EXPECT_EQ(2u, ids0.size());

    BluetoothServiceAttributeValueBlueZ service_handle0 =
        records_[0].GetAttributeValue(ids0[0]);
    int32_t int_value;
    EXPECT_TRUE(service_handle0.value().GetAsInteger(&int_value));
    EXPECT_EQ(0x1337, int_value);

    BluetoothServiceAttributeValueBlueZ service_class_list =
        records_[0].GetAttributeValue(ids0[1]);
    std::string str_value;
    EXPECT_TRUE(
        service_class_list.sequence()[0].value().GetAsString(&str_value));
    EXPECT_EQ("1802", str_value);

    std::vector<uint16_t> ids1 = records_[1].GetAttributeIds();
    EXPECT_EQ(1u, ids1.size());

    BluetoothServiceAttributeValueBlueZ service_handle1 =
        records_[1].GetAttributeValue(ids1[0]);
    EXPECT_TRUE(service_handle1.value().GetAsInteger(&int_value));
    EXPECT_EQ(0xffffffff, static_cast<uint32_t>(int_value));
  }

 protected:
  BluetoothServiceRecordBlueZ CreateaServiceRecord(const std::string uuid) {
    BluetoothServiceRecordBlueZ record;
    record.AddRecordEntry(kServiceUuidAttributeId,
                          BluetoothServiceAttributeValueBlueZ(
                              BluetoothServiceAttributeValueBlueZ::UUID, 16,
                              base::MakeUnique<base::StringValue>(uuid)));
    return record;
  }

  BluetoothAdapterBlueZ* adapter_bluez_;
  size_t success_callbacks_;
  size_t error_callbacks_;

 private:
  void CreateServiceSuccessCallback(uint32_t handle) {
    last_seen_handle_ = handle;
    ++success_callbacks_;
  }

  void RemoveServiceSuccessCallback() { ++success_callbacks_; }

  void ErrorCallback(BluetoothServiceRecordBlueZ::ErrorCode code) {
    ++error_callbacks_;
  }

  void GetServiceRecordsCallback(
      const std::vector<BluetoothServiceRecordBlueZ>& records) {
    records_ = records;
    ++success_callbacks_;
  }

  uint32_t last_seen_handle_;
  std::vector<BluetoothServiceRecordBlueZ> records_;

  DISALLOW_COPY_AND_ASSIGN(BluetoothServiceRecordBlueZTest);
};

TEST_F(BluetoothServiceRecordBlueZTest, CreateAndRemove) {
  uint32_t handle1 =
      CreateServiceRecordWithCallbacks(CreateaServiceRecord(kServiceUuid1));
  uint32_t handle2 =
      CreateServiceRecordWithCallbacks(CreateaServiceRecord(kServiceUuid2));
  uint32_t handle3 =
      CreateServiceRecordWithCallbacks(CreateaServiceRecord(kServiceUuid1));
  uint32_t handle4 =
      CreateServiceRecordWithCallbacks(CreateaServiceRecord(kServiceUuid3));

  RemoveServiceRecordWithCallbacks(handle1, true);
  RemoveServiceRecordWithCallbacks(handle3, true);
  RemoveServiceRecordWithCallbacks(handle1, false);
  RemoveServiceRecordWithCallbacks(handle4, true);
  RemoveServiceRecordWithCallbacks(handle2, true);
}

TEST_F(BluetoothServiceRecordBlueZTest, GetServiceRecords) {
  BluetoothDeviceBlueZ* device =
      static_cast<BluetoothDeviceBlueZ*>(adapter_->GetDevice(
          bluez::FakeBluetoothDeviceClient::kPairedDeviceAddress));
  GetServiceRecords(device, false);
  device->Connect(nullptr, GetCallback(Call::EXPECTED),
                  GetConnectErrorCallback(Call::NOT_EXPECTED));
  GetServiceRecords(device, true);
  VerifyRecords();
}

}  // namespace bluez


text:
package org.apache.ignite.spi.discovery.tcp.internal;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.spi.discovery.DiscoveryDataBag;

import static org.apache.ignite.internal.GridComponent.DiscoveryDataExchangeType.CONTINUOUS_PROC;

/**
 * Carries discovery data in marshalled form
 * and allows convenient way of converting it to and from {@link DiscoveryDataBag} objects.
 */
public class DiscoveryDataPacket implements Serializable {
    /** */
    private static final long serialVersionUID = 0L;

    /** */
    private final UUID joiningNodeId;

    /** */
    private Map<Integer, byte[]> joiningNodeData = new HashMap<>();

    /** */
    private transient Map<Integer, Serializable> unmarshalledJoiningNodeData;

    /** */
    private Map<Integer, byte[]> commonData = new HashMap<>();

    /** */
    private Map<UUID, Map<Integer, byte[]>> nodeSpecificData = new LinkedHashMap<>();

    /** */
    private transient boolean joiningNodeClient;

    /**
     * @param joiningNodeId Joining node id.
     */
    public DiscoveryDataPacket(UUID joiningNodeId) {
        this.joiningNodeId = joiningNodeId;
    }

    /**
     *
     */
    public UUID joiningNodeId() {
        return joiningNodeId;
    }

    /**
     * @param bag Bag.
     * @param nodeId Node id.
     * @param marsh Marsh.
     * @param log Logger.
     */
    public void marshalGridNodeData(DiscoveryDataBag bag, UUID nodeId, Marshaller marsh, IgniteLogger log) {
        marshalData(bag.commonData(), commonData, marsh, log);

        Map<Integer, Serializable> locNodeSpecificData = bag.localNodeSpecificData();

        if (locNodeSpecificData != null) {
            Map<Integer, byte[]> marshLocNodeSpecificData = U.newHashMap(locNodeSpecificData.size());

            marshalData(locNodeSpecificData, marshLocNodeSpecificData, marsh, log);

            filterDuplicatedData(marshLocNodeSpecificData);

            if (!marshLocNodeSpecificData.isEmpty())
                nodeSpecificData.put(nodeId, marshLocNodeSpecificData);
        }
    }

    /**
     * @param bag Bag.
     * @param marsh Marsh.
     * @param log Logger.
     */
    public void marshalJoiningNodeData(DiscoveryDataBag bag, Marshaller marsh, IgniteLogger log) {
        marshalData(bag.joiningNodeData(), joiningNodeData, marsh, log);
    }

    /**
     * @param marsh Marsh.
     * @param clsLdr Class loader.
     * @param clientNode Client node.
     * @param log Logger.
     */
    public DiscoveryDataBag unmarshalGridData(
            Marshaller marsh,
            ClassLoader clsLdr,
            boolean clientNode,
            IgniteLogger log
    ) {
        DiscoveryDataBag dataBag = new DiscoveryDataBag(joiningNodeId, joiningNodeClient);

        if (commonData != null && !commonData.isEmpty()) {
            Map<Integer, Serializable> unmarshCommonData = unmarshalData(commonData, marsh, clsLdr, clientNode, log);

            dataBag.commonData(unmarshCommonData);
        }

        if (nodeSpecificData != null && !nodeSpecificData.isEmpty()) {
            Map<UUID, Map<Integer, Serializable>> unmarshNodeSpecData = U.newLinkedHashMap(nodeSpecificData.size());

            for (Map.Entry<UUID, Map<Integer, byte[]>> nodeBinEntry : nodeSpecificData.entrySet()) {
                Map<Integer, byte[]> nodeBinData = nodeBinEntry.getValue();

                if (nodeBinData == null || nodeBinData.isEmpty())
                    continue;

                Map<Integer, Serializable> unmarshData = unmarshalData(nodeBinData, marsh, clsLdr, clientNode, log);

                unmarshNodeSpecData.put(nodeBinEntry.getKey(), unmarshData);
            }

            dataBag.nodeSpecificData(unmarshNodeSpecData);
        }

        return dataBag;
    }

    /**
     * @param marsh Marsh.
     * @param clsLdr Class loader.
     * @param clientNode Client node.
     * @param log Logger.
     */
    public DiscoveryDataBag unmarshalJoiningNodeData(
            Marshaller marsh,
            ClassLoader clsLdr,
            boolean clientNode,
            IgniteLogger log
    ) {
        DiscoveryDataBag dataBag = new DiscoveryDataBag(joiningNodeId, joiningNodeClient);

        if (joiningNodeData != null && !joiningNodeData.isEmpty()) {
            unmarshalledJoiningNodeData = unmarshalData(
                    joiningNodeData,
                    marsh,
                    clsLdr,
                    clientNode,
                    log);

            dataBag.joiningNodeData(unmarshalledJoiningNodeData);
        }

        return dataBag;
    }

    /**
     *
     */
    public boolean hasJoiningNodeData() {
        return joiningNodeData != null && !joiningNodeData.isEmpty();
    }

    /**
     * @param nodeId Node id.
     */
    public boolean hasDataFromNode(UUID nodeId) {
        return nodeSpecificData.containsKey(nodeId);
    }

    /**
     * @param existingDataPacket Existing data packet.
     * @param mrgdCmnDataKeys Mrgd cmn data keys.
     * @param mrgdSpecifDataKeys Mrgd specif data keys.
     */
    public boolean mergeDataFrom(
            DiscoveryDataPacket existingDataPacket,
            Collection<Integer> mrgdCmnDataKeys,
            Collection<UUID> mrgdSpecifDataKeys
    ) {
        if (commonData.size() != mrgdCmnDataKeys.size()) {
            for (Map.Entry<Integer, byte[]> e : commonData.entrySet()) {
                if (!mrgdCmnDataKeys.contains(e.getKey())) {
                    byte[] data = existingDataPacket.commonData.get(e.getKey());

                    if (data != null && Arrays.equals(e.getValue(), data)) {
                        e.setValue(data);

                        boolean add = mrgdCmnDataKeys.add(e.getKey());

                        assert add;

                        if (mrgdCmnDataKeys.size() == commonData.size())
                            break;
                    }
                }
            }
        }

        if (nodeSpecificData.size() != mrgdSpecifDataKeys.size()) {
            for (Map.Entry<UUID, Map<Integer, byte[]>> e : nodeSpecificData.entrySet()) {
                if (!mrgdSpecifDataKeys.contains(e.getKey())) {
                    Map<Integer, byte[]> data = existingDataPacket.nodeSpecificData.get(e.getKey());

                    if (data != null && mapsEqual(e.getValue(), data)) {
                        e.setValue(data);

                        boolean add = mrgdSpecifDataKeys.add(e.getKey());

                        assert add;

                        if (mrgdSpecifDataKeys.size() == nodeSpecificData.size())
                            break;
                    }
                }
            }
        }

        return (mrgdCmnDataKeys.size() == commonData.size()) && (mrgdSpecifDataKeys.size() == nodeSpecificData.size());
    }

    /**
     * @param m1 first map to compare.
     * @param m2 second map to compare.
     */
    private boolean mapsEqual(Map<Integer, byte[]> m1, Map<Integer, byte[]> m2) {
        if (m1 == m2)
            return true;

        if (m1.size() == m2.size()) {
            for (Map.Entry<Integer, byte[]> e : m1.entrySet()) {
                byte[] data = m2.get(e.getKey());

                if (!Arrays.equals(e.getValue(), data))
                    return false;
            }

            return true;
        }

        return false;
    }

    /**
     * @param src Source.
     * @param marsh Marsh.
     * @param clsLdr Class loader.
     * @param log Logger.
     */
    private Map<Integer, Serializable> unmarshalData(
            Map<Integer, byte[]> src,
            Marshaller marsh,
            ClassLoader clsLdr,
            boolean clientNode,
            IgniteLogger log
    ) {
        Map<Integer, Serializable> res = U.newHashMap(src.size());

        for (Map.Entry<Integer, byte[]> binEntry : src.entrySet()) {
            try {
                Serializable compData = marsh.unmarshal(binEntry.getValue(), clsLdr);
                res.put(binEntry.getKey(), compData);
            }
            catch (IgniteCheckedException e) {
                if (CONTINUOUS_PROC.ordinal() == binEntry.getKey() &&
                        X.hasCause(e, ClassNotFoundException.class) && clientNode)
                    U.warn(log, "Failed to unmarshal continuous query remote filter on client node. Can be ignored.");
                else
                    U.error(log, "Failed to unmarshal discovery data for component: "  + binEntry.getKey(), e);
            }
        }

        return res;
    }

    /**
     * @param src Source.
     * @param target Target.
     * @param marsh Marsh.
     * @param log Logger.
     */
    private void marshalData(
            Map<Integer, Serializable> src,
            Map<Integer, byte[]> target,
            Marshaller marsh,
            IgniteLogger log
    ) {
        //may happen if nothing was collected from components,
        // corresponding map (for common data or for node specific data) left null
        if (src == null)
            return;

        for (Map.Entry<Integer, Serializable> entry : src.entrySet()) {
            try {
                target.put(entry.getKey(), marsh.marshal(entry.getValue()));
            }
            catch (IgniteCheckedException e) {
                U.error(log, "Failed to marshal discovery data " +
                        "[comp=" + entry.getKey() + ", data=" + entry.getValue() + ']', e);
            }
        }
    }

    /**
     * TODO https://issues.apache.org/jira/browse/IGNITE-4435
     */
    private void filterDuplicatedData(Map<Integer, byte[]> discoData) {
        for (Map<Integer, byte[]> existingData : nodeSpecificData.values()) {
            Iterator<Map.Entry<Integer, byte[]>> it = discoData.entrySet().iterator();

            while (it.hasNext()) {
                Map.Entry<Integer, byte[]> discoDataEntry = it.next();

                byte[] curData = existingData.get(discoDataEntry.getKey());

                if (Arrays.equals(curData, discoDataEntry.getValue()))
                    it.remove();
            }

            if (discoData.isEmpty())
                break;
        }
    }

    /**
     * Returns {@link DiscoveryDataBag} aware of components with already initialized common data
     * (e.g. on nodes prior in cluster to the one where this method is called).
     */
    public DiscoveryDataBag bagForDataCollection() {
        DiscoveryDataBag dataBag = new DiscoveryDataBag(joiningNodeId, commonData.keySet(), joiningNodeClient);

        if (unmarshalledJoiningNodeData != null)
            dataBag.joiningNodeData(unmarshalledJoiningNodeData);

        return dataBag;
    }

    /**
     * @param joiningNodeClient Joining node is client flag.
     */
    public void joiningNodeClient(boolean joiningNodeClient) {
        this.joiningNodeClient = joiningNodeClient;
    }
}


text:
require File.expand_path('spec/spec_helper')

describe 'Lexic' do

  context FlashDevelop::Word do
    subject {FlashDevelop::Word}

    it "should identify a class" do
      word = subject.new("Something")
      word.class?.should be_true
      word.const?.should be_false
      word.instance?.should be_false
    end

    it "should identify a constant" do
      word = subject.new("CONSTANT")
      word.class?.should be_false
      word.const?.should be_true
      word.instance?.should be_false
    end

    it "should identify a instance" do
      word = subject.new("something")
      word.class?.should be_false
      word.const?.should be_false
      word.instance?.should be_true

      word = subject.new("somethingCamelCased")
      word.class?.should be_false
      word.const?.should be_false
      word.instance?.should be_true
    end
  end

  context FlashDevelop::Statement do
    subject {FlashDevelop::Statement}

    it "should identify classes" do
      puts FlashDevelop::Statement.new("MyClass", "MyClass()").inspect
    end
  end

  context FlashDevelop::Sentence do

  end

  context FlashDevelop::Word do

  end
end


text:
import { assert } from 'chai';
import sinon from 'sinon';
import FreeGeoIpLocation from '../../src/FreeGeoIpLocation';
import geocode from '../fixtures/geocode.json';

const PROVIDER_CONFIG = {};

describe('FreeGeoIpLocation', () => {
  it('Should properly export', () => {
    assert.isFunction(FreeGeoIpLocation);
  });

  it('Should properly geocode address', done => {
    let location = new FreeGeoIpLocation(PROVIDER_CONFIG);

    sinon.stub(location.getProvider(), 'geocode', address => Promise.resolve(geocode));

    location
      .geocode('Kirovohrad, Ukraine')
      .then(result => {
        assert.deepEqual(result, geocode);
        assert.ok(location.getProvider().geocode.calledOnce);
        assert.equal(location.getProvider().geocode.getCall(0).args[0], 'Kirovohrad, Ukraine');

        location.getProvider().geocode.restore();

        done();
      })
      .catch(done);
  });

  it('Should properly reverse latitude/longitude', done => {
    let location = new FreeGeoIpLocation(PROVIDER_CONFIG);

    sinon.stub(location.getProvider(), 'reverse', (latitude, longitude) => Promise.resolve('Kirovohrad, Ukraine'));

    location
      .reverse(48.5131978440005, 32.25969628100046)
      .then(result => {
        assert.equal(result, 'Kirovohrad, Ukraine');
        assert.ok(location.getProvider().reverse.calledOnce);
        assert.deepEqual(location.getProvider().reverse.getCall(0).args[0], {
          lat: 48.5131978440005,
          lon: 32.25969628100046
        });

        location.getProvider().reverse.restore();

        done();
      })
      .catch(done);
  });
});


text:
const AbstractBundler = require('./abstract')

class NodeBundler extends AbstractBundler {
  dev () {
    return super.dev()
      .then(() => new Promise((resolve) => {
        const watchOptions = {}
        let resolved = false

        this.watcher = this.webpackCompiler.watch(watchOptions, (err, stats) => {
          this.log.debug('build finished', {
            err,
            statsHasErrors: stats.hasErrors(),
            statsHasWarnings: stats.hasWarnings()
          })

          if (!resolved) {
            resolved = true
            resolve()
          }
        })
      }))
  }
}

module.exports = NodeBundler


text:
var util = require("util");
var AbstractTag = require("./abstractTag");
var Parent = function() {};
module.exports = Parent;
util.inherits(Parent, AbstractTag);

Parent.prototype.start = function() {
    var par = this.getParentBlock(this.parent).el.parent;
    var defName = this.parent.name;
    if (this.parent.deps || !defName) defName = "def";
    this.parent.body.write("res.getBlock('" + par + "')['" + defName +"'](attrs, res);");
};


text:
#include "IdDictionary.hpp"

#include <ros/console.h>

using namespace std;

/**
 * Creates a new empty dictionary.
 */
IdDictionary::IdDictionary()
{
	translated = false;
}

/**
 * Checks if the dictionary contains the given id of space A.
 *
 * @param n The id to check.
 * @return True if space A contains n, false otherwise.
 */
bool IdDictionary::contains(int n)
{
	{
		boost::mutex::scoped_lock lock(mutex);

		for (vector<int>::iterator it = ids.begin(); it != ids.end(); it++) {
			if (*it == n) {
				return true;
			}
		}

		return false;
	}
}

/**
 * Inserts a new id in space A.
 *
 * @param n The id to insert.
 */
void IdDictionary::insert(int n)
{
	if (contains(n)) {
		return;
	}

	if (translated) {
		ROS_ERROR("insert: Ids already translated!");
	}

	{
		boost::mutex::scoped_lock lock(mutex);

		ROS_DEBUG("Inserted id %d", n);
		ids.push_back(n);
	}
}

/**
 * Returns the size of id space A.
 *
 * @return The size of id space A.
 */
int IdDictionary::size()
{
	{
		boost::mutex::scoped_lock lock(mutex);

		return ids.size();
	}
}

/**
 * Translates the ids from id space A to id space B. This method can be called
 * only once and has to be called before translation works.
 * It takes all ids from space A, sorts them, and assigns ids from space B to
 * them. The lowest id from space A gets the zero in space B,
 * the second lowest id from space A gets one in space B and so on...
 */
void IdDictionary::translateIds()
{
	if (translated) {
		return;
	}

	{
		boost::mutex::scoped_lock lock(mutex);

		ROS_DEBUG("Translating dictionary with %ld ids", ids.size());

		translated = true;

		std::sort(ids.begin(), ids.end());
		int id = 0;

		for (vector<int>::iterator it = ids.begin(); it != ids.end(); it++, id++) {
			backward[id] = *it;
			forward[*it] = id;
		}
	}
}

/**
 * Returns true if the ids were already translated.
 *
 * @return True if the translateIds() function was called, false otherwise.
 */
bool IdDictionary::isTranslated()
{
	return translated;
}

/**
 * Translates the given id from space A to the corresponding id from space B.
 *
 * @param n The id from space A.
 * @return The corresponding id from space B.
 */
int IdDictionary::getForward(int n)
{
	if (!translated) {
		ROS_ERROR("getForward: Ids not translated!");
	}

	{
		boost::mutex::scoped_lock lock(mutex);

		if (forward.count(n)) {
			int result = forward[n];
			return result;
		} else {
			ROS_ERROR("getForward: Unknown id %d", n);
			return -1;
		}
	}
}

/**
 * Translates the given id from space B to the corresponding id from space A.
 *
 * @param n The id from space B.
 * @return The corresponding id from space A.
 */
int IdDictionary::getBackward(int n)
{
	if (!translated) {
		ROS_ERROR("getBackward: Ids not translated!");
	}

	{
		boost::mutex::scoped_lock lock(mutex);

		if (backward.count(n)) {
			int result = backward[n];
			return result;
		} else {
			ROS_ERROR("getBackward: Unknown id %d", n);
			return -1;
		}
	}
}


text:
/**
 * @ngdoc interface
 * @name guh.devices.controller:DevicesDetailCtrl
 *
 * @description
 * Load and show details of certain device.
 *
 */

(function(){
  'use strict';

  angular
    .module('guh.devices')
    .controller('NewDeviceCtrl', NewDeviceCtrl);

  NewDeviceCtrl.$inject = ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'DSVendor', 'DSDevice'];

  function NewDeviceCtrl($log, $rootScope, $scope, $state, $stateParams, DSVendor, DSDevice) {

    var vm = this;

    // Public variables

    // Public methods
    vm.reset = reset;
    vm.selectVendor = selectVendor;
    vm.selectDeviceClass = selectDeviceClass;
    vm.discoverDevices = discoverDevices;
    vm.back = back;
    vm.add = add;
    vm.save = save;

    function _init() {
      // First step
      // vm.showVendors = true;
      // vm.showDeviceClasses = false;
      // vm.showCreateMethod = false;
      // vm.showSetupMethod = false;

      _findAllVendors()
        .then(function(vendors) {
          vm.supportedVendors = vendors;
        });
    }

    function _findAllVendors() {
      return DSVendor.findAll();
    }

    function _findVendorRelations() {
      return DSVendor.loadRelations(vendor, ['deviceClass']);
    }

    function reset() {
      _init();
    }

    function selectVendor(vendor) {
      // Check relations & set selected vendor
      if(angular.isUndefined(vendor.deviceClass) && vendor.deviceClass === {}) {
        _findVendorRelations()
          .then(function(vendor) {
            vm.selectedVendor = vendor;
          });
      } else {
        vm.selectedVendor = vendor;
      }

      // Remove deviceClasses that are auto discovered
      vm.supportedDeviceClasses = [];
      angular.forEach(vendor.deviceClasses, function(deviceClass) {
        var createMethod = deviceClass.getCreateMethod();

        if(createMethod.title !== 'Auto' && (deviceClass.classType === 'device' || deviceClass.classType === 'gateway')) {
          vm.supportedDeviceClasses.push(deviceClass);
        }
      });

      // Next step
      $rootScope.$broadcast('wizard.next', 'newDevice');
    }

    function selectDeviceClass(deviceClass) {
      vm.selectedDeviceClass = deviceClass;
      vm.createMethod = deviceClass.getCreateMethod();
      vm.setupMethod = deviceClass.getSetupMethod();

      // Next step
      $rootScope.$broadcast('wizard.next', 'newDevice');
    }

    function discoverDevices(params) {
      vm.discover = false;
      vm.loading = true;
      vm.params = angular.copy(params);

      vm.selectedDeviceClass
        .discover(params)
        .then(function(discoveredDevices) {
          vm.discover = true;
          vm.loading = false;
          vm.discoveredDevices = discoveredDevices.data;
        })
        .catch(function(error) {
          vm.discover = true;
          vm.loading = false;
          $log.error(error);
        });
    }

    function pairDevice(deviceClassId, deviceDescriptorId, deviceParams) {
      DSDevice
        .pair(deviceClassId, deviceDescriptorId, deviceParams)
        .then(function(pairingData) {
          vm.displayMessage = pairingData.data.displayMessage;
          vm.pairingTransactionId = pairingData.data.pairingTransactionId;

          // Next step
          $rootScope.$broadcast('wizard.next', 'newDevice');
        })
        .catch(function(error) {
          $log.error(error);
        });
    }

    function back() {
      // Previous step
      $rootScope.$broadcast('wizard.prev', 'newDevice');
    }

    // deviceData can be device information (discovered device) or params (user created device)
    function add(deviceData) {
      var deviceClassId = vm.selectedDeviceClass.id;
      var deviceDescriptorId = (angular.isDefined(deviceData) && angular.isString(deviceData.id)) ? deviceData.id : '';
      var deviceParams = (deviceDescriptorId === '' && angular.isDefined(deviceData) && angular.isArray(deviceData)) ? deviceData : [];

      $log.log('add', deviceClassId, deviceDescriptorId, deviceParams);

      // Without setupMethod the device can be saved directly
      if(vm.setupMethod) {
        pairDevice(deviceClassId, deviceDescriptorId, deviceParams);
      } else {
        save(deviceClassId, deviceDescriptorId, deviceParams);
      }
    }

    function save(deviceClassId, deviceDescriptorId, deviceParams) {
      $log.log('Close modal: save', deviceClassId, deviceDescriptorId, deviceParams);

      DSDevice
        .add(deviceClassId, deviceDescriptorId, deviceParams)
        .then(function(device) {
          $log.log('device saved', device);

          DSDevice
            .inject({
              deviceClassId: deviceClassId,
              id: device.id,
              name: device.name,
              params: deviceParams,
              setupComplete: true
            });

          $scope.closeThisDialog();

          // $state.go('guh.rules.master', { bypassCache: true }, { reload: true });
          $state.go('guh.devices.master', { bypassCache: true }, {
            reload: true,
            inherit: false,
            notify: true
          });
        })
        .catch(function(error) {
          $log.log(error);
        });

      $log.log('$scope', $scope);

      // vm.closeModal({
      //   device: {
      //     deviceClassId: vm.selectedDeviceClass.id,
      //     deviceData: deviceData
      //   },
      //   httpCreate: true
      // });
    }

    _init();

  }

}());


text:
using namespace hect;

GeometrySurface::GeometrySurface()
{
}

GeometrySurface::GeometrySurface(const AssetHandle<Mesh>& mesh, const AssetHandle<Material>& material) :
    mesh(mesh),
    material(material)
{
}

void GeometryComponent::add_surface(const AssetHandle<Mesh>& mesh, const AssetHandle<Material>& material)
{
    surfaces.push_back(GeometrySurface(mesh, material));
}

void GeometryComponent::add_surface(const GeometrySurface& surface)
{
    surfaces.push_back(surface);
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>presto-root</artifactId>
        <groupId>com.facebook.presto</groupId>
        <version>0.235-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>presto-spark-base</artifactId>

    <properties>
        <air.main.basedir>${project.parent.basedir}</air.main.basedir>
    </properties>

    <dependencies>

        <dependency>
            <groupId>com.facebook.presto</groupId>
            <artifactId>presto-spark-classloader-interface</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.facebook.presto</groupId>
            <artifactId>presto-client</artifactId>
        </dependency>

        <dependency>
            <groupId>com.facebook.presto</groupId>
            <artifactId>presto-parser</artifactId>
        </dependency>

        <dependency>
            <groupId>com.facebook.presto.spark</groupId>
            <artifactId>spark-core</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Presto -->
        <dependency>
            <groupId>com.facebook.presto</groupId>
            <artifactId>presto-spi</artifactId>
        </dependency>

        <dependency>
            <groupId>com.facebook.presto</groupId>
            <artifactId>presto-main</artifactId>
        </dependency>

        <dependency>
            <groupId>com.facebook.presto</groupId>
            <artifactId>presto-memory-context</artifactId>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>slice</artifactId>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>units</artifactId>
        </dependency>

        <dependency>
            <groupId>com.facebook.airlift</groupId>
            <artifactId>stats</artifactId>
        </dependency>

        <dependency>
            <groupId>com.facebook.airlift</groupId>
            <artifactId>json</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
        </dependency>

        <dependency>
            <groupId>com.facebook.airlift</groupId>
            <artifactId>concurrent</artifactId>
        </dependency>

        <dependency>
            <groupId>com.facebook.airlift</groupId>
            <artifactId>configuration</artifactId>
        </dependency>

        <dependency>
            <groupId>com.facebook.airlift</groupId>
            <artifactId>bootstrap</artifactId>
        </dependency>

        <dependency>
            <groupId>com.facebook.airlift</groupId>
            <artifactId>node</artifactId>
        </dependency>

        <dependency>
            <groupId>com.facebook.airlift</groupId>
            <artifactId>log</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
        </dependency>

        <dependency>
            <groupId>org.weakref</groupId>
            <artifactId>jmxutils</artifactId>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.facebook.presto.hadoop</groupId>
            <artifactId>hadoop-apache2</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.facebook.presto</groupId>
            <artifactId>presto-tpch</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.facebook.presto</groupId>
            <artifactId>presto-hive</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.xerial.snappy</groupId>
                    <artifactId>snappy-java</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.facebook.presto</groupId>
            <artifactId>presto-hive-metastore</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.facebook.presto</groupId>
            <artifactId>presto-tests</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.basepom.maven</groupId>
                <artifactId>duplicate-finder-maven-plugin</artifactId>
                <configuration>
                    <ignoredResourcePatterns>
                        <ignoredResourcePattern>parquet.thrift</ignoredResourcePattern>
                        <ignoredResourcePattern>about.html</ignoredResourcePattern>
                    </ignoredResourcePatterns>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
#ifndef PLATFORMS_NEMORA_PORTABLE_NET_TYPES_H_
#define PLATFORMS_NEMORA_PORTABLE_NET_TYPES_H_

#include <stdint.h>

// Buffer big enough for largest frame we expect
// to receive from EMAC (in bytes)
//   1500 (max payload IEEE 802.3) +
//   14 (header) +
//   4 (crc, if not stripped by EMAC) +
//   4 (optional VLAN tag, if not stripped by EMAC)
#define ETH_BUFFER_SIZE 1522
#define IPV4_ETHERTYPE 0x0800
#define IPV6_ADDR_SIZE 16
#define MAC_ADDR_SIZE 6

#ifndef __packed
#define __packed __attribute__((packed))
#endif

/* MAC address */
typedef struct __packed {
  uint8_t octet[MAC_ADDR_SIZE];  // network order
} mac_addr_t;

/*
 * Ethernet header.
 * Note: This assumes a packet without VLAN tags.
 * TODO: configure HW to strip VLAN field.
 */
typedef struct __packed {
  mac_addr_t dest;
  mac_addr_t src;
  uint16_t ethertype;
} eth_hdr_t;

#endif  // PLATFORMS_NEMORA_PORTABLE_NET_TYPES_H_


text: import 'antd/lib/layout/style/css';


text:
package errorpages;

import pages.ParsingFileException;

public class MigrateErrorPages {

    public static void main(String[] args) {
        System.out.println("Importing Errors");
        ErrorsPageMigrator migrator = null;
        try {
            migrator = new ErrorsPageMigrator();
            migrator.run();
        } catch (ParsingFileException ex) {
            System.err.println(ex.getMessage());
        }
    }
}