text:
package multicast

import (
	"bytes"
	"context"
	"sync"
	"testing"
	"time"
)

var testMulticastAddress = "[ff12::9000]:30001"

func TestListen(t *testing.T) {
	listener := &Multicast{Address: testMulticastAddress}
	respCh, err := listener.Listen(context.TODO())
	if err != nil {
		t.Fatal(err)
	}

	sender := &Multicast{Address: testMulticastAddress}
	if err := sender.Send(context.TODO(), []byte{0}); err != nil {
		t.Fatal("Multicast Send should fail", err)
	}

	for {
		select {
		case <-respCh:
			listener.Done()
			sender.Done()
			return
		}
	}

}

func TestSend(t *testing.T) {
	var tests = []struct {
		m         *Multicast
		payload   []byte
		shouldErr bool
	}{
		{&Multicast{}, nil, true},
		{&Multicast{Address: testMulticastAddress}, []byte("Hello TestSendAndListen"), false},
		{&Multicast{Address: testMulticastAddress}, []byte("Say hello again"), false},
		{&Multicast{Address: testMulticastAddress}, []byte("123412341234"), false},
	}

	var found = []struct {
		m         *Multicast
		payload   []byte
		shouldErr bool
	}{}

	ctx, cancel := context.WithCancel(context.Background())
	wg := &sync.WaitGroup{}
	errCh := make(chan error, 1)

	// Don't block for test
	go func() {
		listener := &Multicast{Address: testMulticastAddress}

		// Create a listener
		respCh, err := listener.Listen(ctx)
		if err != nil {
			errCh <- err
		}

		// Check if the resp sent over the response channel matches the test's payload
		go func() {
			for {
				select {
				case resp := <-respCh:
					for _, test := range tests {
						skip := false
						// Check the slice of test to see if the response equals what is expected
						if bytes.Equal(resp.Payload, test.payload) {
							// Skip if it's already been found
							for _, f := range found {
								if bytes.Equal(resp.Payload, f.payload) {
									skip = true
								}
							}

							if skip {
								continue
							}

							found = append(found, test)
							test.m.Stop()
							wg.Done()
						}
					}
				case <-ctx.Done():
					return
				case <-listener.Done():
					return
				}
			}
		}()

		for _, test := range tests {
			if !test.shouldErr {
				wg.Add(1)
				if err := test.m.Send(ctx, test.payload); err != nil {
					t.Fatal("Multicast Send failed", err)
				}

			} else {
				if err := test.m.Send(ctx, test.payload); err == nil {
					t.Fatal("Multicast Send should fail", err)
				}
			}
		}

		wg.Wait() // Block until all test multicasts are stopped
		listener.Stop()
		cancel()
	}()

	// Block until the ctx is canceled or we receive an error, such as a timeout
	for {
		select {
		case <-ctx.Done():
			return
		case err := <-errCh:
			if err != nil {
				t.Fatal("err during Send()", err)
			}
			return
		case <-time.After(5000 * time.Millisecond):
			t.Fatal("	 timed out")
			return
		}
	}
}

func TestListenCtxDone(t *testing.T) {
	// Create a listener
	ctx, cancel := context.WithCancel(context.Background())
	listener := &Multicast{Address: testMulticastAddress}
	_, err := listener.Listen(ctx)
	if err != nil {
		t.Fatal(err)
	}

	// Test context Done()
	go func() {
		for {
			select {
			case <-ctx.Done():
				return
			}
		}
	}()
	cancel()
}

func TestListenStop(t *testing.T) {
	// Create a listener
	listener := &Multicast{Address: testMulticastAddress}
	_, err := listener.Listen(context.TODO())
	if err != nil {
		t.Fatal(err)
	}

	// Test listener Done()
	go func() {
		for {
			select {
			case <-listener.Done():
				return
			}
		}
	}()
	listener.Stop()
}

func TestCtxCancelFunc(t *testing.T) {
	m := &Multicast{Address: testMulticastAddress}

	payload := []byte("Hello TestCtxCancelFunc")
	ctx, cancel := context.WithCancel(context.Background())
	if err := m.Send(ctx, payload); err != nil {
		t.Fatal("Send error", err)
	}
	time.AfterFunc(100*time.Millisecond, func() { cancel() })
	timeout := time.AfterFunc(200*time.Millisecond, func() { t.Fatal("TestStopChan timedout") })

	// Block until the stopCh is closed
	for {
		select {
		case <-ctx.Done():
			timeout.Stop() // cancel the timeout
			return
		}
	}
}


text:
package com.github.lburgazzoli.examples.karaf.jpa.batoo.data;

import com.google.common.collect.Lists;
import com.github.lburgazzoli.examples.karaf.jpa.commons.data.IDataService;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import java.util.Collection;

/**
 *
 */
public class ApplicationManagedDataService implements IDataService<Item> {
    private EntityManagerFactory emf;

    public ApplicationManagedDataService() {
        this.emf = null;
    }

    public void setEntityManagerFactory(EntityManagerFactory emf) {
        this.emf = emf;
    }

    @Override
    public Collection<Item> getAll() {
        EntityManager    em  = emf.createEntityManager();
        Collection<Item> ret = Lists.newArrayList();

        try {
            ret = em.createQuery("select i from Item i", Item.class).getResultList();
        } finally {
            em.close();
        }

        return ret;
    }

    @Override
    public void add(Item item) {
        EntityManager em = emf.createEntityManager();
        try {
            em.getTransaction().begin();
            em.persist(item);
            em.getTransaction().commit();
        } catch(Exception e) {
            if(em.getTransaction().isActive()) {
                em.getTransaction().rollback();
            }

            System.out.println("Exception: " + e.getMessage());
        } finally {
            em.close();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.quexten.ravtech.files;

import com.badlogic.gdx.assets.AssetDescriptor;
import com.badlogic.gdx.assets.AssetLoaderParameters;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader;
import com.badlogic.gdx.assets.loaders.FileHandleResolver;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Json;
import com.quexten.ravtech.project.Project;

public class ProjectLoader extends AsynchronousAssetLoader<Project, AssetLoaderParameters<Project>> {

	Project project;

	public ProjectLoader (FileHandleResolver resolver) {
		super(resolver);
	}

	@SuppressWarnings("rawtypes")
	@Override
	public Array<AssetDescriptor> getDependencies (String fileName, FileHandle file, AssetLoaderParameters<Project> parameter) {
		project = new Json().fromJson(Project.class, file.readString());
		Array<AssetDescriptor> assetDependencies = new Array<AssetDescriptor>();
		return assetDependencies;
	}

	@Override
	public void loadAsync (AssetManager manager, String fileName, FileHandle file, AssetLoaderParameters<Project> parameter) {
	}

	@Override
	public Project loadSync (AssetManager manager, String fileName, FileHandle file, AssetLoaderParameters<Project> parameter) {
		return project;
	}
}


text:
package com.limewoodMedia.nsapi.holders;

/**
 * A data object for a nation's budget
 * All values are in percentages
 * @author Joakim Lindskog
 *
 */
public class Budget {
	public float environment;
	public float socialEquality;
	public float education;
	public float lawAndOrder;
	public float administration;
	public float welfare;
	public float spirituality;
	public float defence;
	public float publicTransport;
	public float healthCare;
	public float commerce;

	@Override
	public String toString() {
		return "\n\t\tadministration:"+administration+"%"
				+"\n\t\tcommerce:"+commerce+"%"
				+"\n\t\tdefence:"+defence+"%"
				+"\n\t\teducation:"+education+"%"
				+"\n\t\tenvironment:"+environment+"%"
				+"\n\t\thealthCare:"+healthCare+"%"
				+"\n\t\tlawAndOrder:"+lawAndOrder+"%"
				+"\n\t\tpublicTransport:"+publicTransport+"%"
				+"\n\t\tsocialEquality:"+socialEquality+"%"
				+"\n\t\tspirituality:"+spirituality+"%"
				+"\n\t\twelfare:"+welfare+"%";
	}
}


text:
<datastore-indexes autoGenerate="true">
  <datastore-index kind="HITinstance" ancestor="false" source="manual">
    <property name="groupId" direction="asc"/>
    <property name="timestamp" direction="desc"/>
  </datastore-index>
  <datastore-index kind="ArrivalCompletions " ancestor="false" source="manual">
    <property name="from" direction="asc"/>
    <property name="to" direction="asc"/>
  </datastore-index>
  <datastore-index kind="HITgroup" ancestor="false">
    <property name="active" direction="asc"/>
    <property name="lastSeen" direction="asc"/>
  </datastore-index>
  <datastore-index kind="HITgroup" ancestor="false" source="manual">
    <property name="requesterId" direction="asc"/>
    <property name="expirationDate" direction="asc"/>
  </datastore-index>
  <datastore-index kind="HITgroup" ancestor="false" source="manual">
    <property name="requesterId" direction="asc"/>
    <property name="firstSeen" direction="asc"/>
  </datastore-index>
  <datastore-index kind="HITgroup" ancestor="false" source="manual">
    <property name="requesterId" direction="asc"/>
    <property name="lastSeen" direction="asc"/>
  </datastore-index>
  <datastore-index kind="TopRequester" ancestor="false" source="manual">
    <property name="timestamp" direction="asc"/>
    <property name="reward" direction="desc"/>
  </datastore-index>
</datastore-indexes>


text:
import Ember from 'ember';
import ExecutionEnvironment from '../utils/execution-environment';

/**
 * EVENT_NAME_MAP is used to determine which event fired when a
 * transition/animation ends, based on the style property used to
 * define that event.
 */
var EVENT_NAME_MAP = {
  transitionend: {
    'transition': 'transitionend',
    'WebkitTransition': 'webkitTransitionEnd',
    'MozTransition': 'mozTransitionEnd',
    'OTransition': 'oTransitionEnd',
    'msTransition': 'MSTransitionEnd',
  },

  animationend: {
    'animation': 'animationend',
    'WebkitAnimation': 'webkitAnimationEnd',
    'MozAnimation': 'mozAnimationEnd',
    'OAnimation': 'oAnimationEnd',
    'msAnimation': 'MSAnimationEnd',
  },
};

var endEvents = [];

function detectEvents() {
  var testEl = document.createElement('div');
  var style = testEl.style;

  // On some platforms, in particular some releases of Android 4.x,
  // the un-prefixed "animation" and "transition" properties are defined on the
  // style object but the events that fire will still be prefixed, so we need
  // to check if the un-prefixed events are useable, and if not remove them
  // from the map
  if (!('AnimationEvent' in window)) {
    delete EVENT_NAME_MAP.animationend.animation;
  }

  if (!('TransitionEvent' in window)) {
    delete EVENT_NAME_MAP.transitionend.transition;
  }

  for (var baseEventName in EVENT_NAME_MAP) {
    var baseEvents = EVENT_NAME_MAP[baseEventName];
    for (var styleName in baseEvents) {
      if (styleName in style) {
        endEvents.push(baseEvents[styleName]);
        break;
      }
    }
  }
}

// We use the raw {add|remove}EventListener() call because EventListener
// does not know how to remove event listeners and we really should
// clean up. Also, these events are not triggered in older browsers
// so we should be A-OK here.

function addEventListener(node, eventName, eventListener) {
  node.addEventListener(eventName, eventListener, false);
}

function removeEventListener(node, eventName, eventListener) {
  node.removeEventListener(eventName, eventListener, false);
}

export default Ember.Service.extend({
  init () {
    if (ExecutionEnvironment.canUseDom()) {
      detectEvents();
    }
  },
  addEndEventListener: function(node, eventListener) {
    if (endEvents.length === 0) {
      // If CSS transitions are not supported, trigger an "end animation"
      // event immediately.
      window.setTimeout(eventListener, 0);
      return;
    }
    endEvents.forEach(function(endEvent) {
      addEventListener(node, endEvent, eventListener);
    });
  },

  removeEndEventListener: function(node, eventListener) {
    if (endEvents.length === 0) {
      return;
    }
    endEvents.forEach(function(endEvent) {
      removeEventListener(node, endEvent, eventListener);
    });
  },
});


text:
namespace Xunit
{
    class VsixRunnerSettings
    {
        public VsixRunnerSettings(int? debuggerAttachRetries = null, int? remoteConnectionRetries = null,
            int? processStartRetries = null, int? retrySleepInterval = null,
            int? startupTimeout = null)
        {
            DebuggerAttachRetries = debuggerAttachRetries ?? 5;
            RemoteConnectionRetries = remoteConnectionRetries ?? 2;
            ProcessStartRetries = processStartRetries ?? 1;
            RetrySleepInterval = retrySleepInterval ?? 200;
            StartupTimeout = startupTimeout ?? 300;
        }

        /// <summary>
        /// Number of retries to attach a debugger to the running VS instance.
        /// </summary>
        public int DebuggerAttachRetries { get; private set; }

        /// <summary>
        /// Number of retries to connect to a running VS after it has
        /// been successfully started to start test execution.
        /// </summary>
        public int RemoteConnectionRetries { get; private set; }

        /// <summary>
        /// Number of retries to start VS and connect to its DTE service.
        /// </summary>
        public int ProcessStartRetries { get; private set; }

        /// <summary>
        /// The starting sleep interval across retries, in milliseconds.
        /// Will be used to exponentially increase the wait after each
        /// retry.
        /// </summary>
        public int RetrySleepInterval { get; private set; }

        /// <summary>
        /// The timeout in seconds to wait for Visual Studio to
        /// start and initialize its DTE automation model.
        /// </summary>
        public int StartupTimeout { get; private set; }
    }
}


text:
(function() {
    var fillContent = function(options, create) {
        var element = d3.select(this);

        var calculateCoordinates = function(selection) {
            var center, offsets;
            var width = selection[0][0].clientWidth, height = selection[0][0].clientHeight;
            center = [0, 0];
            if (options.type === "mouse") {
                center = [d3.event.pageX, d3.event.pageY]
                center[0] -= width/2;
            } else {
                offsets = element[0][0].getBoundingClientRect();
                center[0] = offsets.left;
                center[0] += window.scrollX;
                center[1] = offsets.top;
                center[1] += window.scrollY;

                if (options.gravity == "right") {
                    center[0] += offsets.width;
                    center[1] += offsets.height/2 - height/2;
                }
                if (options.gravity == "bottom") {
                    center[0] += offsets.width/2 - width/2;
                    center[1] += offsets.height;
                }
                if (options.gravity == "left") {
                    center[0] -= width;
                    center[1] += offsets.height/2 - height/2;
                }
                if (options.gravity == "top") {
                    center[0] += offsets.width/2 - width/2;
                    center[1] -= height;
                }
            }

            center[0] += options.displacement[0];
            center[1] += options.displacement[1];

            return center;
        };

        element.on("mouseover", function() {
            if (options.show()) {
                var tip = create();
                options.updateContent.call(null);
                var coordinates = calculateCoordinates(tip);
                tip
                    .style("left", coordinates[0] + "px")
                    .style("top", coordinates[1] + "px");
            }
        });

        if (options.type == "mouse") {
            if (options.show()) {
                element.on("mousemove", function() {
                    var tip = d3.selectAll("." + options.cssClass);
                    var coordinates = calculateCoordinates(tip);
                    tip
                        .style("left", coordinates[0] + "px")
                        .style("top", coordinates[1] + "px");
                });
            }
        }

        element.on("mouseout", function() {
            if (options.show()) {
                var tip = d3.selectAll("." + options.cssClass);
                tip.remove();
            }
        });
    };

    d3.selection.prototype.tooltip = function(f) {
        var body = d3.select('body');

        return this.each(function(d, i) {
            var create_tooltip, options;

            options = f.apply(this, arguments);
            if (!options.show) {
                options.show = function() { return true };
            }
            if (!options.updateContent) {
                options.updateContent = function() { };
            }
            if (!options.displacement) {
                options.displacement = [0,0];
            }
            if (!options.cssClass) {
                options.cssClass = "tooltip";
            }
            if (!options.gravity) {
                options.gravity = "right";
            }
            create_tooltip = function() {
                var tip = body.append("div")
                    .classed(options.cssClass, true)
                    .style("position", "absolute")
                    .style("z-index", "10001")
                    .style("display", "block")
                    .style("pointer-events", "none");

                tip.append("div")
                    .html(options.content)
                    .attr("class", "inner");

                return tip;
            }

            return fillContent.call(this, options, create_tooltip);
        });
    }

})();


text:
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">

  <title>translate.filters.checks.KdeChecker</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />

         Home

         Trees

         Indices

         Help

Translate Toolkit

        Package translate ::
        Package filters ::
        Module checks ::
        Class KdeChecker

[hide private]

[frames] | no frames]

Class KdeChecker

source code

  <map id="uml_class_diagram_for_translat_13" name="uml_class_diagram_for_translat_13">
<area shape="rect" href="translate.filters.checks.TranslationChecker-class.html#run_test" title="Runs the given test on the given unit." alt="" coords="103,260,244,278"/>
<area shape="rect" href="translate.filters.checks.TranslationChecker-class.html#run_filters" title="Do some optimisation by caching some data of the unit for the benefit of  run_test()." alt="" coords="103,278,244,297"/>
<area shape="rect" href="translate.filters.checks.TranslationChecker-class.html" title="A checker that passes source and target strings to the checks, not the whole unit." alt="" coords="101,234,245,298"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#preconditions" title="translate.filters.checks.StandardChecker.preconditions" alt="" coords="84,345,263,364"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#untranslated" title="checks whether a string has been translated at all" alt="" coords="84,366,263,385"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#unchanged" title="checks whether a translation is basically identical to the original string" alt="" coords="84,385,263,404"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#blank" title="checks whether a translation only contains spaces" alt="" coords="84,404,263,422"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#short" title="checks whether a translation is much shorter than the original string" alt="" coords="84,422,263,441"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#long" title="checks whether a translation is much longer than the original string" alt="" coords="84,441,263,460"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#escapes" title="checks whether escaping is consistent between the two strings" alt="" coords="84,460,263,478"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#newlines" title="checks whether newlines are consistent between the two strings" alt="" coords="84,478,263,497"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#tabs" title="checks whether tabs are consistent between the two strings" alt="" coords="84,497,263,516"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#singlequoting" title="checks whether singlequoting is consistent between the two strings" alt="" coords="84,516,263,534"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#doublequoting" title="checks whether doublequoting is consistent between the two strings" alt="" coords="84,534,263,553"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#doublespacing" title="checks for bad double-spaces by comparing to original" alt="" coords="84,553,263,572"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#puncspacing" title="checks for bad spacing after punctuation" alt="" coords="84,572,263,590"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#printf" title="checks whether printf format strings match" alt="" coords="84,590,263,609"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html#credits" title="checks for messages containing translation credits instead of normal  translations." alt="" coords="84,628,263,646"/>
<area shape="rect" href="translate.filters.checks.StandardChecker-class.html" title="The basic test suite for source -> target translations." alt="" coords="83,328,264,648"/>
<area shape="rect" href="translate.filters.checks.KdeChecker-class.html#__init__" title="x.__init__(...) initializes x; see x.__class__.__doc__ for signature" alt="" coords="104,702,243,721"/>
<area shape="rect" href="translate.filters.checks.KdeChecker-class.html" title="translate.filters.checks.KdeChecker" alt="" coords="103,677,244,722"/>
<area shape="rect" href="translate.filters.checks.UnitChecker-class.html#getfilters" title="returns dictionary of available filters, including/excluding those in the  given lists" alt="" coords="17,36,329,54"/>
<area shape="rect" href="translate.filters.checks.UnitChecker-class.html#setconfig" title="sets the accelerator list" alt="" coords="17,54,329,73"/>
<area shape="rect" href="translate.filters.checks.UnitChecker-class.html#setsuggestionstore" title="Sets the filename that a checker should use for evaluating suggestions." alt="" coords="17,73,329,92"/>
<area shape="rect" href="translate.filters.checks.UnitChecker-class.html#filtervariables" title="filter out variables from str1" alt="" coords="17,92,329,110"/>
<area shape="rect" href="translate.filters.checks.UnitChecker-class.html#removevariables" title="remove variables from str1" alt="" coords="17,110,329,129"/>
<area shape="rect" href="translate.filters.checks.UnitChecker-class.html#filteraccelerators" title="filter out accelerators from str1" alt="" coords="17,129,329,148"/>
<area shape="rect" href="translate.filters.checks.UnitChecker-class.html#filteraccelerators_by_list" title="filter out accelerators from str1" alt="" coords="17,148,329,166"/>
<area shape="rect" href="translate.filters.checks.UnitChecker-class.html#filterwordswithpunctuation" title="replaces words with punctuation with their unpunctuated equivalents" alt="" coords="17,166,329,185"/>
<area shape="rect" href="translate.filters.checks.UnitChecker-class.html#filterxml" title="filter out XML from the string so only text remains" alt="" coords="17,185,329,204"/>
<area shape="rect" href="translate.filters.checks.UnitChecker-class.html" title="Parent Checker class which does the checking based on functions available in derived classes." alt="" coords="16,10,331,205"/>
</map>

        Instance Methods
        [hide private]

          __init__(self,
        **kwargs)

      x.__init__(...) initializes x; see x.__class__.__doc__ for signature

            source code

Inherited from StandardChecker:
      accelerators,
      acronyms,
      blank,
      brackets,
      compendiumconflicts,
      credits,
      doublequoting,
      doublespacing,
      doublewords,
      emails,
      endpunc,
      endwhitespace,
      escapes,
      filepaths,
      functions,
      kdecomments,
      long,
      musttranslatewords,
      newlines,
      notranslatewords,
      numbers,
      options,
      printf,
      puncspacing,
      purepunc,
      sentencecount,
      short,
      simplecaps,
      simpleplurals,
      singlequoting,
      spellcheck,
      startcaps,
      startpunc,
      startwhitespace,
      tabs,
      unchanged,
      untranslated,
      urls,
      validchars,
      variables,
      xmltags

Inherited from TranslationChecker:
      run_filters,
      run_test

Inherited from UnitChecker:
      filteraccelerators,
      filteraccelerators_by_list,
      filtervariables,
      filterwordswithpunctuation,
      filterxml,
      getfilters,
      removevariables,
      setconfig,
      setsuggestionstore

Inherited from object:
      __delattr__,
      __getattribute__,
      __hash__,
      __new__,
      __reduce__,
      __reduce_ex__,
      __repr__,
      __setattr__,
      __str__

        Class Variables
        [hide private]

Inherited from StandardChecker:
      preconditions

        Properties
        [hide private]

Inherited from object:
      __class__

        Method Details
        [hide private]

__init__(self,
        **kwargs)

(Constructor)

  	source code

x.__init__(...) initializes x; see x.__class__.__doc__ for
  signature

Overrides:
        object.__init__

(inherited documentation)

         Home

         Trees

         Indices

         Help

Translate Toolkit

    Generated by Epydoc 3.0.1 on Wed Mar  3 16:36:06 2010

      http://epydoc.sourceforge.net


text:
SDLGetDTCs Class Reference

Section Contents

-initWithECUName:

-initWithECUName:mask:

ecuName

dtcMask

Overview

This RPC allows to request diagnostic module trouble codes from a certain
vehicle module

Function Group: ProprietaryData

HMILevel needs to be FULL, LIMITED or BACKGROUND

      -initWithECUName:

Convenience init

Objective-C

- (nonnull instancetype)initWithECUName:(UInt16)name;

Swift

init(ecuName name: UInt16)

Parameters

name

Name of the module to receive the DTC form

Return Value

An SDLGetDTCs object

      -initWithECUName:mask:

Convenience init with all properties

Objective-C

- (nonnull instancetype)initWithECUName:(UInt16)name mask:(UInt8)mask;

Swift

init(ecuName name: UInt16, mask: UInt8)

Parameters

name

Name of the module to receive the DTC form

mask

DTC Mask Byte to be sent in diagnostic request to module

Return Value

An SDLGetDTCs object

      ecuName

a name of the module to receive the DTC form
@discussion an NSNumber value representing a name of the module to receive
           the DTC form

           Notes: Minvalue:0; Maxvalue:65535

Objective-C

@property (nonatomic, strong) NSNumber<SDLInt> *_Nonnull ecuName;

Swift

var ecuName: NSNumber & SDLInt { get set }

      dtcMask

DTC Mask Byte to be sent in diagnostic request to module. NSNumber* dtcMask Minvalue:0; Maxvalue:255

Objective-C

@property (nonatomic, strong, nullable) NSNumber<SDLInt> *dtcMask;

Swift

var dtcMask: (NSNumber & SDLInt)? { get set }


text:
package net.floodlightcontroller.accesscontrollist;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

import net.floodlightcontroller.accesscontrollist.ACLRule.Action;
import net.floodlightcontroller.accesscontrollist.ap.AP;
import net.floodlightcontroller.accesscontrollist.ap.APManager;
import net.floodlightcontroller.accesscontrollist.util.IPAddressUtil;
import net.floodlightcontroller.accesscontrollist.web.ACLWebRoutable;
import net.floodlightcontroller.core.module.FloodlightModuleContext;
import net.floodlightcontroller.core.module.FloodlightModuleException;
import net.floodlightcontroller.core.module.IFloodlightModule;
import net.floodlightcontroller.core.module.IFloodlightService;
import net.floodlightcontroller.devicemanager.IDevice;
import net.floodlightcontroller.devicemanager.IDeviceListener;
import net.floodlightcontroller.devicemanager.IDeviceService;
import net.floodlightcontroller.devicemanager.SwitchPort;
import net.floodlightcontroller.packet.IPv4;
import net.floodlightcontroller.restserver.IRestApiService;
import net.floodlightcontroller.staticflowentry.StaticFlowEntryPusher;
import net.floodlightcontroller.storage.IStorageSourceService;

import org.projectfloodlight.openflow.types.IPv4Address;
import org.projectfloodlight.openflow.util.HexString;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ACL implements IACLService, IFloodlightModule, IDeviceListener {

	protected IRestApiService restApi;
	protected IDeviceService deviceManager;
	protected IStorageSourceService storageSource;
	protected static Logger logger;

	private APManager apManager;
	private int lastRuleId = 1; // rule id counter
	private Map<Integer, ACLRule> aclRules;
	private Map<String, Integer> dpid2FlowPriority;
	private Map<Integer, Set<String>> ruleId2Dpid;
	private Map<Integer, Set<String>> ruleId2FlowName;
	private Map<Integer, List<Integer>> deny2Allow;

	private final int DEFAULT_PRIORITY = 30000;

	/**
	 * Checks if an existing ACL rule already works in a given switch.
	 */
	private boolean checkIfRuleWorksInSwitch(int ruleId, String dpid) {
		return ruleId2Dpid.containsKey(ruleId)
				&& ruleId2Dpid.get(ruleId).contains(dpid);
	}

	/**
	 * Adds a new mapping from ACL rule to ACL flow.
	 */
	private void addRuleToFlowMapping(int ruleId, String flowName) {
		if (!ruleId2FlowName.containsKey(ruleId)) {
			ruleId2FlowName.put(ruleId, new HashSet<String>());
		}
		ruleId2FlowName.get(ruleId).add(flowName);
	}

	/**
	 * Adds a new mapping from ACL rule to switch.
	 */
	private void addRuleToSwitchMapping(int ruleId, String dpid) {
		if (!ruleId2Dpid.containsKey(ruleId)) {
			ruleId2Dpid.put(ruleId, new HashSet<String>());
		}
		ruleId2Dpid.get(ruleId).add(dpid);
	}

	/**
	 * Gets the current priority for new ACL flow by device id.
	 */
	private int getPriorityBySwitch(String dpid) {
		if (!dpid2FlowPriority.containsKey(dpid)) {
			dpid2FlowPriority.put(dpid, DEFAULT_PRIORITY - 1);
			return DEFAULT_PRIORITY;
		} else {
			int priority = dpid2FlowPriority.get(dpid);
			dpid2FlowPriority.put(dpid, priority - 1);
			return priority;
		}
	}

	@Override
	public List<ACLRule> getRules() {
		return new ArrayList<ACLRule>(aclRules.values());
	}

	/**
	 * Checks if the new ACL rule matches an existing rule. If existing allowing
	 * rules matches the new denying rule, store the mappings.
	 *
	 * @return true if the new ACL rule matches an existing rule, false
	 *         otherwise
	 */
	private boolean checkRuleMatch(ACLRule newRule) {
		List<Integer> allowRuleList = new ArrayList<>();
		for (ACLRule existingRule : getRules()) {
			if (newRule.match(existingRule)) {
				return true;
			}

			if (existingRule.getAction() == Action.ALLOW
					&& newRule.getAction() == Action.DENY) {
				if (existingRule.match(newRule)) {
					allowRuleList.add(existingRule.getId());
				}
			}
		}
		deny2Allow.put(newRule.getId(), allowRuleList);
		return false;
	}

	@Override
	public boolean addRule(ACLRule rule) {
		rule.setId(lastRuleId++);
		if (checkRuleMatch(rule)) {
			lastRuleId--;
			return false;
		}
		aclRules.put(rule.getId(), rule);
		logger.info("ACL rule(id:{}) is added.", rule.getId());
		if (rule.getAction() != Action.ALLOW) {
			enforceAddedRule(rule);
		}
		return true;
	}

	@Override
	public void removeRule(int ruleId) {
		aclRules.remove(ruleId);
		logger.info("ACL rule(id:{}) is removed.", ruleId);
		enforceRemovedRule(ruleId);
	}

	@Override
	public void removeAllRules() {
		this.lastRuleId = 1;
		this.aclRules = new TreeMap<>();
		this.dpid2FlowPriority = new HashMap<>();
		this.ruleId2Dpid = new HashMap<>();
		this.deny2Allow = new HashMap<>();

		for (Set<String> flowNameSet : ruleId2FlowName.values()) {
			for (String flowName : flowNameSet) {
				storageSource.deleteRowAsync("controller_staticflowtableentry",
						flowName);
				logger.debug("ACL flow(id:{}) is removed.", flowName);
			}
		}
		this.ruleId2FlowName = new HashMap<>();
	}

	/**
	 * Enforces denying ACL rule by ACL flow.
	 */
	private void enforceAddedRule(ACLRule denyRule) {
		Set<String> dpidSet;
		if (denyRule.getNw_src() != null) {
			dpidSet = apManager.getDpidSet(denyRule.getNw_src_prefix(),
					denyRule.getNw_src_maskbits());
		} else {
			dpidSet = apManager.getDpidSet(denyRule.getNw_dst_prefix(),
					denyRule.getNw_dst_maskbits());
		}

		for (String dpid : dpidSet) {
			String flowName;
			List<Integer> allowRuleList = deny2Allow.get(denyRule.getId());
			for (int allowRuleId : allowRuleList) {
				flowName = "ACLRule_" + allowRuleId + "_" + dpid;
				generateFlow(aclRules.get(allowRuleId), dpid, flowName);
			}
			flowName = "ACLRule_" + denyRule.getId() + "_" + dpid;
			generateFlow(denyRule, dpid, flowName);
		}
	}

	/**
	 * Enforces removing an existing ACL rule.
	 */
	private void enforceRemovedRule(int ruleId) {
		if (ruleId2FlowName.containsKey(ruleId)) {
			for (String flowName : ruleId2FlowName.get(ruleId)) {
				storageSource.deleteRowAsync("controller_staticflowtableentry",
						flowName);
				logger.debug("ACL flow(id:{}) is removed.", flowName);
			}
			ruleId2FlowName.remove(ruleId);
		}
		ruleId2Dpid.remove(ruleId);
		deny2Allow.remove(ruleId);
	}

	/**
	 * Generates ACL flow rule according to ACL rule
	 * and installs it into switch.
	 */
	private void generateFlow(ACLRule rule, String dpid, String flowName) {
		if (rule == null || checkIfRuleWorksInSwitch(rule.getId(), dpid)) {
			return;
		}

		int priority = getPriorityBySwitch(dpid);
		if (rule.getNw_src() != null) {

			HashMap<String, Object> flow = new HashMap<String, Object>();

			flow.put(StaticFlowEntryPusher.COLUMN_SWITCH, dpid);
			flow.put(StaticFlowEntryPusher.COLUMN_NAME, flowName);
			flow.put(StaticFlowEntryPusher.COLUMN_ACTIVE,
					Boolean.toString(true));
			flow.put(StaticFlowEntryPusher.COLUMN_COOKIE, "0");
			flow.put(StaticFlowEntryPusher.COLUMN_PRIORITY,
					Integer.toString(priority));

			flow.put(StaticFlowEntryPusher.COLUMN_DL_TYPE, "2048");
			flow.put(StaticFlowEntryPusher.COLUMN_NW_SRC, rule.getNw_src());

			if (rule.getNw_dst() != null) {
				flow.put(StaticFlowEntryPusher.COLUMN_NW_DST, rule.getNw_dst());
			}
			if (rule.getNw_proto() != 0) {
				flow.put(StaticFlowEntryPusher.COLUMN_NW_PROTO,
						Integer.toString(rule.getNw_proto()));
			}
			if (rule.getAction() == Action.ALLOW) {
				flow.put(StaticFlowEntryPusher.COLUMN_ACTIONS,
						"output=controller");
			}
			if (rule.getTp_dst() != 0) {
				flow.put(StaticFlowEntryPusher.COLUMN_TP_DST,
						Integer.toString(rule.getTp_dst()));
			}

			storageSource
					.insertRowAsync(StaticFlowEntryPusher.TABLE_NAME, flow);

		} else {

			HashMap<String, Object> flow = new HashMap<String, Object>();

			flow.put(StaticFlowEntryPusher.COLUMN_SWITCH, dpid);
			flow.put(StaticFlowEntryPusher.COLUMN_NAME, flowName);
			flow.put(StaticFlowEntryPusher.COLUMN_ACTIVE,
					Boolean.toString(true));
			flow.put(StaticFlowEntryPusher.COLUMN_COOKIE, "0");
			flow.put(StaticFlowEntryPusher.COLUMN_PRIORITY,
					Integer.toString(priority));

			flow.put(StaticFlowEntryPusher.COLUMN_DL_TYPE, "2048");
			flow.put(StaticFlowEntryPusher.COLUMN_NW_DST, rule.getNw_dst());

			if (rule.getNw_proto() != 0) {
				flow.put(StaticFlowEntryPusher.COLUMN_NW_PROTO,
						Integer.toString(rule.getNw_proto()));
			}
			if (rule.getAction() == Action.ALLOW) {
				flow.put(StaticFlowEntryPusher.COLUMN_ACTIONS,
						"output=controller");
			}
			if (rule.getTp_dst() != 0) {
				flow.put(StaticFlowEntryPusher.COLUMN_TP_DST,
						Integer.toString(rule.getTp_dst()));
			}

			storageSource
					.insertRowAsync(StaticFlowEntryPusher.TABLE_NAME, flow);

		}
		addRuleToSwitchMapping(rule.getId(), dpid);
		addRuleToFlowMapping(rule.getId(), flowName);
		logger.debug("ACL flow(id:{}) is added in {}.", flowName, dpid);
	}

	@Override
	public Collection<Class<? extends IFloodlightService>> getModuleServices() {
		Collection<Class<? extends IFloodlightService>> l = new ArrayList<Class<? extends IFloodlightService>>();
		l.add(IACLService.class);
		return l;
	}

	@Override
	public Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls() {
		Map<Class<? extends IFloodlightService>, IFloodlightService> m = new HashMap<Class<? extends IFloodlightService>, IFloodlightService>();
		// We are the class that implements the service
		m.put(IACLService.class, this);
		return m;
	}

	@Override
	public Collection<Class<? extends IFloodlightService>> getModuleDependencies() {
		Collection<Class<? extends IFloodlightService>> l = new ArrayList<Class<? extends IFloodlightService>>();
		l.add(IRestApiService.class);
		l.add(IDeviceService.class);
		return l;
	}

	@Override
	public void init(FloodlightModuleContext context)
			throws FloodlightModuleException {
		restApi = context.getServiceImpl(IRestApiService.class);
		deviceManager = context.getServiceImpl(IDeviceService.class);
		logger = LoggerFactory.getLogger(ACL.class);
		storageSource = context.getServiceImpl(IStorageSourceService.class);

		aclRules = new TreeMap<>();
		apManager = new APManager();
		ruleId2FlowName = new HashMap<>();
		ruleId2Dpid = new HashMap<>();
		dpid2FlowPriority = new HashMap<>();
		deny2Allow = new HashMap<>();
	}

	@Override
	public void startUp(FloodlightModuleContext context) {
		// register REST interface
		restApi.addRestletRoutable(new ACLWebRoutable());
		deviceManager.addListener(this);
	}

	@Override
	public void deviceAdded(IDevice device) {
		SwitchPort[] switchPort = device.getAttachmentPoints();
		IPv4Address[] ips = device.getIPv4Addresses();
		if (ips.length == 0) {
			// A new no-ip device added
			return;
		}

		String dpid = HexString.toHexString(switchPort[0].getSwitchDPID()
				.getLong());
		String ip = IPv4.fromIPv4Address(ips[0].getInt());
		logger.debug("AP(dpid:{},ip:{}) is added", dpid, ip);

		AP ap = new AP(ip, dpid);
		apManager.addAP(ap);
		processAPAdded(ap);
	}

	/**
	 * Generates new ACL flow when a new device appears
	 * and existing ACL rules denies its traffic.
	 */
	private void processAPAdded(AP ap) {
		String dpid = ap.getDpid();
		int ip = IPv4.toIPv4Address(ap.getIp());

		for (ACLRule rule : getRules()) {
			if (rule.getAction() != Action.ALLOW) {
				if (rule.getNw_src() != null) {
					if (IPAddressUtil.containIP(rule.getNw_src_prefix(),
							rule.getNw_src_maskbits(), ip)) {
						if (checkIfRuleWorksInSwitch(rule.getId(), dpid)) {
							continue;
						}
						String flowName = "ACLRule_" + rule.getId() + "_"
								+ dpid;
						generateFlow(rule, dpid, flowName);
					}
				} else {
					if (IPAddressUtil.containIP(rule.getNw_dst_prefix(),
							rule.getNw_dst_maskbits(), ip)) {
						if (checkIfRuleWorksInSwitch(rule.getId(), dpid)) {
							continue;
						}
						String flowName = "ACLRule_" + rule.getId() + "_"
								+ dpid;
						generateFlow(rule, dpid, flowName);
					}
				}
			}
		}
	}

	@Override
	public void deviceRemoved(IDevice device) {

	}

	@Override
	public void deviceMoved(IDevice device) {

	}

	@Override
	public void deviceIPV4AddrChanged(IDevice device) {

		SwitchPort[] switchPort = device.getAttachmentPoints();
		IPv4Address[] ips = device.getIPv4Addresses();

		String dpid = HexString.toHexString(switchPort[0].getSwitchDPID()
				.getLong());
		String ip = null;
		// some device may first appear with no IP address(default set to
		// 0.0.0.0), ignore it
		for (IPv4Address i : ips) {
			if (i.getInt() != 0) {
				ip = IPv4.fromIPv4Address(i.getInt());
				break;
			}
		}

		logger.debug("AP(dpid:{},ip:{}) is added", dpid, ip);
		AP ap = new AP(ip, dpid);
		apManager.addAP(ap);
		processAPAdded(ap);
	}

	@Override
	public void deviceVlanChanged(IDevice device) {

	}

	@Override
	public String getName() {
		return "ACL manager";
	}

	@Override
	public boolean isCallbackOrderingPrereq(String type, String name) {
		return false;
	}

	@Override
	public boolean isCallbackOrderingPostreq(String type, String name) {
		return false;
	}

}


text:
namespace Bakery.Time
{
	using System;

	public interface IClock
	{
		DateTime GetUniversalTime();
	}
}


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

	public static class DependencyExtensions
	{
		public static HostConfigurator AddDependency([NotNull] this HostConfigurator configurator, [NotNull] string name)
		{
			if (configurator == null)
				throw new ArgumentNullException("configurator");

			if (name == null)
				throw new ArgumentNullException("name");

			var dependencyConfigurator = new DependencyHostConfigurator(name);

			configurator.AddConfigurator(dependencyConfigurator);

			return configurator;
		}

		public static HostConfigurator DependsOn(this HostConfigurator configurator, string name)
		{
			return AddDependency(configurator, name);
		}

		public static HostConfigurator DependsOnMsmq(this HostConfigurator configurator)
		{
			return AddDependency(configurator, KnownServiceNames.Msmq);
		}

		public static HostConfigurator DependsOnMsSql(this HostConfigurator configurator)
		{
			return AddDependency(configurator, KnownServiceNames.SqlServer);
		}

		public static HostConfigurator DependsOnEventLog(this HostConfigurator configurator)
		{
			return AddDependency(configurator, KnownServiceNames.EventLog);
		}

		public static HostConfigurator DependsOnIis(this HostConfigurator configurator)
		{
			return AddDependency(configurator, KnownServiceNames.IIS);
		}
	}
}


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

import com.facebook.presto.RowPagesBuilder;
import com.facebook.presto.spi.Page;
import com.facebook.presto.sql.planner.plan.PlanNodeId;
import com.facebook.presto.testing.MaterializedResult;
import com.google.common.collect.ImmutableList;
import com.google.common.primitives.Ints;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.util.List;
import java.util.concurrent.ExecutorService;

import static com.facebook.presto.RowPagesBuilder.rowPagesBuilder;
import static com.facebook.presto.SessionTestUtils.TEST_SESSION;
import static com.facebook.presto.spi.type.BigintType.BIGINT;
import static com.facebook.presto.testing.MaterializedResult.resultBuilder;
import static com.facebook.presto.testing.TestingTaskContext.createTaskContext;
import static io.airlift.concurrent.Threads.daemonThreadsNamed;
import static java.util.concurrent.Executors.newCachedThreadPool;

@Test(singleThreaded = true)
public class TestDistinctLimitOperator
{
    private ExecutorService executor;
    private DriverContext driverContext;

    @BeforeMethod
    public void setUp()
    {
        executor = newCachedThreadPool(daemonThreadsNamed("test-%s"));
        driverContext = createTaskContext(executor, TEST_SESSION)
                .addPipelineContext(true, true)
                .addDriverContext();
    }

    @AfterMethod
    public void tearDown()
    {
        executor.shutdownNow();
    }

    @DataProvider(name = "hashEnabledValues")
    public static Object[][] hashEnabledValuesProvider()
    {
        return new Object[][] { { true }, { false } };
    }

    @Test(dataProvider = "hashEnabledValues")
    public void testDistinctLimit(boolean hashEnabled)
            throws Exception
    {
        RowPagesBuilder rowPagesBuilder = rowPagesBuilder(hashEnabled, Ints.asList(0), BIGINT);
        List<Page> input = rowPagesBuilder
                .addSequencePage(3, 1)
                .addSequencePage(5, 2)
                .build();

        OperatorFactory operatorFactory = new DistinctLimitOperator.DistinctLimitOperatorFactory(0, new PlanNodeId("test"), ImmutableList.of(BIGINT), Ints.asList(0), 5, rowPagesBuilder.getHashChannel());
        Operator operator = operatorFactory.createOperator(driverContext);

        MaterializedResult expected = resultBuilder(driverContext.getSession(), BIGINT)
                .row(1L)
                .row(2L)
                .row(3L)
                .row(4L)
                .row(5L)
                .build();

        OperatorAssertion.assertOperatorEquals(operator, input, expected);
    }

    @Test(dataProvider = "hashEnabledValues")
    public void testDistinctLimitWithPageAlignment(boolean hashEnabled)
            throws Exception
    {
        RowPagesBuilder rowPagesBuilder = rowPagesBuilder(hashEnabled, Ints.asList(0), BIGINT);
        List<Page> input = rowPagesBuilder
                .addSequencePage(3, 1)
                .addSequencePage(3, 2)
                .build();

        OperatorFactory operatorFactory = new DistinctLimitOperator.DistinctLimitOperatorFactory(0, new PlanNodeId("test"), ImmutableList.of(BIGINT), Ints.asList(0), 3, rowPagesBuilder.getHashChannel());
        Operator operator = operatorFactory.createOperator(driverContext);

        MaterializedResult expected = resultBuilder(driverContext.getSession(), BIGINT)
                .row(1L)
                .row(2L)
                .row(3L)
                .build();

        OperatorAssertion.assertOperatorEquals(operator, input, expected);
    }

    @Test(dataProvider = "hashEnabledValues")
    public void testDistinctLimitValuesLessThanLimit(boolean hashEnabled)
            throws Exception
    {
        RowPagesBuilder rowPagesBuilder = rowPagesBuilder(hashEnabled, Ints.asList(0), BIGINT);
        List<Page> input = rowPagesBuilder
                .addSequencePage(3, 1)
                .addSequencePage(3, 2)
                .build();

        OperatorFactory operatorFactory = new DistinctLimitOperator.DistinctLimitOperatorFactory(0, new PlanNodeId("test"), ImmutableList.of(BIGINT), Ints.asList(0), 5, rowPagesBuilder.getHashChannel());
        Operator operator = operatorFactory.createOperator(driverContext);

        MaterializedResult expected = resultBuilder(driverContext.getSession(), BIGINT)
                .row(1L)
                .row(2L)
                .row(3L)
                .row(4L)
                .build();

        OperatorAssertion.assertOperatorEquals(operator, input, expected);
    }
}


text:
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php

require_once 'vendor/autoload.php'; // Loads the library
use Twilio\TwiML\MessagingResponse;

$response = new MessagingResponse();
$response->message("The Robots are coming! Head for the hills!");
print $response;


text:
package com.lpii.evma.model;

public class Cmddetail {

	private String cmddetail_id = "cmddetail_id";
	private String cmddetail_Qty = "cmddetail_Qty";
	private String cmddetail_commande_id = "cmddetail_commande_id";
	public Cmddetail(String cmddetail_id, String cmddetail_Qty,
			String cmddetail_commande_id) {
		super();
		this.cmddetail_id = cmddetail_id;
		this.cmddetail_Qty = cmddetail_Qty;
		this.cmddetail_commande_id = cmddetail_commande_id;
	}
	public String getCmddetail_id() {
		return cmddetail_id;
	}
	public void setCmddetail_id(String cmddetail_id) {
		this.cmddetail_id = cmddetail_id;
	}
	public String getCmddetail_Qty() {
		return cmddetail_Qty;
	}
	public void setCmddetail_Qty(String cmddetail_Qty) {
		this.cmddetail_Qty = cmddetail_Qty;
	}
	public String getCmddetail_commande_id() {
		return cmddetail_commande_id;
	}
	public void setCmddetail_commande_id(String cmddetail_commande_id) {
		this.cmddetail_commande_id = cmddetail_commande_id;
	}
	@Override
	public String toString() {
		return "Cmddetail [cmddetail_id=" + cmddetail_id + ", cmddetail_Qty="
				+ cmddetail_Qty + ", cmddetail_commande_id="
				+ cmddetail_commande_id + "]";
	}

}


text:
package fw.common.collection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Stack;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * Collection Factory 方便集合构建的工厂类<p>
 * 省略泛型new的过程,同时在可能的情况下 尽可能使用更优越的实现类
 */
public final class CF {

    /**
     * 构建一个通用的 {@link HashMap} .
     */
    public static <K, V> Map<K, V> newMap() {
        return new HashMap<K, V>();
    }

    public static <V> Map<String, V> newCaseInsensitiveMap() {
        return new CaseInsensitiveMap<V>();
    }

    public static <V> Map<String, V> newCaseInsensitiveMap(Map<String, ? extends V> map) {
        return new CaseInsensitiveMap<V>(map);
    }

    /**
     * Constructs and returns a generic {@link java.util.HashSet} creating.
     */
    public static <T> Set<T> newSet() {
        return new HashSet<T>();
    }

    /**
     * Contructs a new {@link HashSet} and initializes it using the provided collection.
     */
    public static <T, V extends T> Set<T> newSet(Collection<V> values) {
        return new HashSet<T>(values);
    }

    public static <T, V extends T> Set<T> newSet(V... values) {
        // Was a call to newSet(), but Sun JDK can't handle that. Fucking generics.
        return new HashSet<T>(Arrays.asList(values));
    }

    /**
     * Constructs a new {@link java.util.HashMap} creating by copying an existing Map creating.
     */
    public static <K, V> Map<K, V> newMap(Map<? extends K, ? extends V> map) {
        Map ret = new HashMap<K, V>(map.size());
        ret.putAll(map);
        return ret;
    }

    /**
     * Constructs a new concurrent map, which is safe to access via multiple threads.
     */
    public static <K, V> ConcurrentMap<K, V> newConcurrentMap() {
        return new ConcurrentHashMap<K, V>();
    }

    /**
     * Contructs and returns a new generic {@link java.util.ArrayList} creating.
     */
    public static <T> List<T> newList() {
        return new ArrayList<T>();
    }

    /**
     * Creates a new, fully modifiable list from an initial set of elements.
     */
    public static <T, V extends T> List<T> newList(V... elements) {
        // Was call to newList(), but Sun JDK can't handle that.
        return new ArrayList<T>(Arrays.asList(elements));
    }

    /**
     * Useful for queues.
     */
    public static <T> LinkedList<T> newLinkedList() {
        return new LinkedList<T>();
    }

    /**
     * Constructs and returns a new {@link java.util.ArrayList} as a copy of the provided collection.
     */
    public static <T, V extends T> List<T> newList(Collection<V> list) {
        return new ArrayList<T>(list);
    }

    /**
     * Constructs and returns a new {@link java.util.concurrent.CopyOnWriteArrayList}.
     */
    public static <T> List<T> newThreadSafeList() {
        return new CopyOnWriteArrayList<T>();
    }

    public static <T> Stack<T> newStack() {
    	return new Stack<T>();
    }

}


text:
using namespace ns_lexer;

Lexer::Lexer() : new_line(false), error(false), nesting(0) {}

std::vector<Token> Lexer::read_file(std::string filename) {
    ns_scanner::Scanner sc;
    sc.open_file(filename);
    return read(sc);
}

std::vector<Token> Lexer::read_string(std::string string) {
    ns_scanner::Scanner sc;
    sc.open_string(string);
    return read(sc);
}

bool Lexer::okay() {
    return !error;
}

Token Lexer::next(ns_scanner::Scanner& sc) {
    typedef grammar::token_type tt;
    typedef grammar::token_subtype ts;
    typedef grammar::character_type ct;
    using namespace grammar;
    ns_scanner::Character c = sc.get();
    Token current(c);

    if(is(c, ct::WHITESPACE) && c != C_CARRIAGE_RETURN && new_line){ //Whitespace before content
        current.set_type(tt::WHITESPACE);
        return current;
    }else if(is(c, ct::WHITESPACE)){
        sc.discard_while({C_WHITESPACE, C_TAB, C_CARRIAGE_RETURN}); //Discard whitespaces
        c = sc.get();
        current = Token(c); //First non-whitespace character
    }

    if(is(c, ct::END_OF_FILE)){ //The end, my friend
        current.set_type(tt::END);
        return current;
    }

    if(is(c, ct::NEWLINE) || c == '\r'){ //A newline, discard all new lines tho
        new_line = true;
        sc.discard_while({C_NEWLINE, C_CARRIAGE_RETURN, C_CARRIAGE_RETURN});
        current = current + C_NEWLINE;
        current.set_type(tt::NEWLINE);
        return current;
    }

    if(c == C_HASH){ //Single line comment
        current.set_type(tt::COMMENT);
        char n = sc.peek();
        while(n != C_NEWLINE && n != EOF){
            if(n != C_CARRIAGE_RETURN){
                current = current + n;
            }
            c = sc.get();
            n = sc.peek();
        }
        return current;
    }

    if(c == '/' && sc.peek() == '*'){ //Kamments!
        current.set_type(tt::COMMENT);
        int nesting = 1;
        while(nesting > 0){
            c = sc.get();
            if(c == '*' && sc.peek() == '/'){
                nesting--;
                current = current + c;
                c = sc.get();
            }else if(c == '/' && sc.peek() == '*'){
                nesting++;
                current = current + c;
                c = sc.get();
            }
            current = current + c;
        }
        return current;
    }

    new_line = false; //At this point anything would break the new linelyness

    if(is(c, ct::DIGIT) && !(c == '-' && sc.peek() == '>')){ //Numbers and boolean literals
        current.set_type(tt::NUMBER);
        bool done = false;
        bool negative = c == C_MINUS;
        char n = sc.peek();
        while(!done){
            if(what(n) == ct::DIGIT || n == C_DOT){
                current = current + n;
            }else if(what(n) == ct::SYMBOL_BOOLEAN){ //Actually a boolean
                current.set_type(tt::BOOLEAN);
                current = current + n;
                if(negative){
                    current.die("Negative probabilities not allowed");
                }
                done = true;
            }else if(is(n, ct::LETTER) || what(n) == ct::SYMBOL_IDENTIFIER){
                current = current + n;
                current.die("Unexpected symbol near number");
            }else{ //Number ends
                break; //Since we found a space or whatever, don't consume it
            }
            sc.get();
            n = sc.peek();
        }
        return current;
    }

    if(c == C_QUOTE || (c == C_CLOSE_BRACKET && nesting > 0)){ //String
        if(c == C_CLOSE_BRACKET){
            nesting--;
        }
        current.set_type(tt::STRING);
        bool done = false;
        c = sc.get();
        while(!done){
            if(c == '\\'){
                c = sc.get();
                if(c == 'n'){ //TODO Make a map?
                    current = current + C_NEWLINE;
                }else if(c == 't'){
                    current = current + C_TAB;
                }else{
                    current = current + c;
                }
            }else if(c == C_QUOTE){
                current = current + c;
                break;
            }else if(c == C_OPEN_BRACKET){
                current = current + c;
                nesting++;
                break;
            }else if(is(c, ct::NEWLINE)){
                ; //Ignored
            }else if(c == EOF){ //K
                current.die("Unexpected end of string");
            }else{
                current = current + c;
            }
            c = sc.get();
        }
        return current;
    }

    if(!is(c, ct::LETTER) && c != C_UNDERSCORE){ //Symbols!
        current.set_type(tt::SYMBOL);
        std::string lookahead = {c, sc.peek()};
        if(is(lookahead, ts::SYMBOL_STANDALONE)){
            current = current + sc.get();
        }else if(is({c}, ts::SYMBOL_STANDALONE)){
            ; //Nothing
        }else{
            current.die("Unexpected character");
        }
        return current;
    }

    if(is(c, ct::LETTER) || c == C_UNDERSCORE){
        char n = sc.peek();
        while(what(n) == ct::SYMBOL_IDENTIFIER || is(n, ct::LETTER) || is(n, ct::DIGIT)){
            current = current + n;
            c = sc.get();
            n = sc.peek();
        }

        if(is(current, grammar::token_subtype::KEYWORD_BOOLEAN)){
            current.set_type(tt::BOOLEAN);
        }else if(is(current, tt::KEYWORD)){
            current.set_type(tt::KEYWORD);
        }else{
            current.set_type(tt::IDENTIFIER);
        }

        return current;

    }

    current.die("Unexpected character");
    throw std::exception();
}

std::vector<Token> Lexer::read(ns_scanner::Scanner& sc) {
    std::vector<Token> ret;
    while(!sc.done()){
        try {
            ret.push_back(next(sc));
        }catch(ns_lexer::TokenException& ex){
            std::cerr << ex.what() << std::endl;
            error = true;
        }
    }

    return ret;
}


text:
package org.vspace.document;

/**
 * Created by Senthil Maruthaiappan on 3/19/15.
 */
import java.util.concurrent.atomic.AtomicLong;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/media/version")
public class MediaController {

    @RequestMapping(method=RequestMethod.GET)
    public @ResponseBody
    Version getVersion() {
        return new Version("1.0");
    }
}


text:
'use strict';

describe('Filter: doneTodo', function () {

  // load the filter's module
  beforeEach(module('ejemploAngularjsIngewebApp'));

  // initialize a new instance of the filter before each test
  var doneTodo;
  beforeEach(inject(function ($filter) {
    doneTodo = $filter('doneTodo');
  }));

  it('should return the input prefixed with "doneTodo filter:"', function () {
    var text = 'angularjs';
    expect(doneTodo(text)).toBe('doneTodo filter: ' + text);
  });

});


text:
class Loop {

  constructor() {
    this._idRAF = -1
    this._count = 0

    this._listeners = []

    this._binds = {}
    this._binds.update = this._update.bind( this )
  }

  _update() {
    let listener = null
    let i = this._count
    while( --i >= 0 ) {
      listener = this._listeners[ i ]
      if( listener ) {
        listener.apply( this, null )
      }
    }
    this._idRAF = requestAnimationFrame( this._binds.update )
  }

  start() {
    this._update()
  }

  stop() {
    cancelAnimationFrame( this._idRAF )
  }

  add( listener ) {
    const idx = this._listeners.indexOf( listener )
    if( idx >= 0 ) {
      return
    }
    this._listeners.push( listener )
    this._count++
  }

  remove( listener ) {
    const idx = this._listeners.indexOf( listener )
    if( idx < 0 ) {
      return
    }
    this._listeners.splice( idx, 1 )
    this._count--
  }

}

module.exports = new Loop()


text:
package com.ir.cs101.core.impl;

import org.junit.Test;
import org.junit.Assert;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

public class TestLoopAndTempStringReverseImpl {
  private static final Logger log = LogManager.getFormatterLogger(TestLoopAndTempStringReverseImpl.class);

  @Test
  public void testReverseEvenString(){
    log.debug("testReverseEvenString() Enter");

    LoopAndTempStringReverseImpl sri = new LoopAndTempStringReverseImpl();
    String testStart = "abcd";
    String testExpected = "dcba";

    String result = sri.reverse(testStart);

    Assert.assertEquals("Failed to match", testExpected, result);

    log.debug("testReverseEvenString() Exit");
  }

  @Test
  public void testReverseOddString(){
    log.debug("testReverseOddString() Enter");

    LoopAndTempStringReverseImpl sri = new LoopAndTempStringReverseImpl();
    String testStart = "xyz";
    String testExpected = "zyx";

    String result = sri.reverse(testStart);

    Assert.assertEquals("Failed to match", testExpected, result);

    log.debug("testReverseOddString() Exit");
  }

  @Test
  public void testReverseEmptyString(){
    log.debug("testReverseEmptyString() Enter");

    LoopAndTempStringReverseImpl sri = new LoopAndTempStringReverseImpl();
    String testStart = "";
    String testExpected = "";

    String result = sri.reverse(testStart);

    Assert.assertEquals("Failed to match", testExpected, result);

    log.debug("testReverseEmptyString() Exit");
  }

  @Test
  public void testReverseNullString(){
    log.debug("testReverseNullString() Enter");

    LoopAndTempStringReverseImpl sri = new LoopAndTempStringReverseImpl();
    String testStart = null;
    String testExpected = null;

    String result = sri.reverse(testStart);

    Assert.assertEquals("Failed to match", testExpected, result);

    log.debug("testReverseNullString() Exit");
  }

}


text:
package com.ataraxer.apps.chess.scala

import org.scalatest._

import com.ataraxer.apps.chess.scala.Color._
import com.ataraxer.apps.chess.scala.pieces._
import com.ataraxer.apps.chess.scala.pieces.Piece.ImpossibleMoveException

class GameSpec extends UnitSpec {

  "A Chess Game" should "conform to the rules of chess" in {
    val board = Board()

    val firstMove = board.movePiece(Coord(1, 3), Coord(3, 3))
    assert(firstMove == Board().update(
      Cell(Coord(1, 3), None),
      Cell(Coord(3, 3), Some(Pawn(White, true)))
    ))

    val secondMove = firstMove.movePiece(Coord(0, 2), Coord(5, 7))
    assert(secondMove == Board().update(
      Cell(Coord(1, 3), None),
      Cell(Coord(3, 3), Some(Pawn(White, true))),
      Cell(Coord(0, 2), None),
      Cell(Coord(5, 7), Some(Bishop(White, true)))
    ))

    val thirdMove = secondMove.movePiece(Coord(6, 6), Coord(4, 6))
    assert(thirdMove == Board().update(
      Cell(Coord(1, 3), None),
      Cell(Coord(3, 3), Some(Pawn(White, true))),
      Cell(Coord(0, 2), None),
      Cell(Coord(5, 7), Some(Bishop(White, true))),
      Cell(Coord(6, 6), None),
      Cell(Coord(4, 6), Some(Pawn(Black, true)))
    ))

    intercept[ImpossibleMoveException] {
      thirdMove.movePiece(Coord(5, 7), Coord(3, 5))
    }
  }

}

// vim: set ts=2 sw=2 et:


text:
This repository has following kinds of browser-based demos:

1. Text Chat using rooms
2. Text Chat without rooms
3. WebRTC Peer Connection using rooms

You can see three node.js files:

1. signaler.js - HTTP based websocket signaling along with creating websocket channels i.e. rooms
2. ssl.js - HTTPs i.e. SSL based websocket signaling along with creating websocket channels i.e. rooms
3. simple.js - HTTP based websocket signaling however NO-room

=

#### Dependencies

1. WebSocket - for websocket over node.js connection
2. Node-Static - for serving static resources i.e. HTML/CSS/JS files

=

#### Install via `npm`

```
npm install websocket-over-nodejs
```

and run the `signaler.js` nodejs file:

```
node node_modules/websocket-over-nodejs/signaler.js
```

Now, you can open port "12034" on your ip address/domain; or otherwise on localhost: `http://localhost:12034/`

=

#### Install on Linux/Ubuntu/CentOS/Debian/Mac etc.

```
# create a directory
mkdir websocket-over-nodejs

# open directory
cd websocket-over-nodejs

# get package
wget http://www.webrtc-experiment.com/packages/websocket-over-nodejs.tar

# extract package
tar -xf websocket-over-nodejs.tar

# run node.js server
node signaler.js
```

Now, you can open port `12034` on your ip address/domain; or otherwise on localhost: `http://localhost:12034/`

It is using port `12034`; you can edit this port using following commands:

```
vi signaler.js

# now edit port 12034
# and save changes & quit

# press "insert" key; then press "Esc" key and the type
:wq
```

`:wq` command saves changes in the file and exits editing mode. If you don't want to save changes; simply type:

```
# if you don't want to save changes however want to exit editing mode
:q
```

Common Error: `Error: listen EADDRINUSE`. It means that same port is used by another application. You can close all existing processes running on same port:

```
// list all active processes running on same port
sudo fuser -v 12034/tcp

// kill all processes running on port "12034"
sudo fuser -vk 12034/tcp

// list again to verify closing ports
sudo fuser -v 12034/tcp
```

You can delete "directory" and re-install:

```
rm -rf websocket-over-nodejs
mkdir websocket-over-nodejs

# and following above steps to "wget" and "tar" then "node" to run!
```

Following error doesn't matter!!! Simply skip it!

```
Warning: Native modules not compiled.  XOR performance will be degraded.
Warning: Native modules not compiled.  UTF-8 validation disabled.
```

=

#### Download ZIP on windows

http://www.webrtc-experiment.com/packages/websocket-over-nodejs.zip

=

#### Test Demos

```
// replace "localhost" with your domain name!
http://localhost:12034/index.html
http://localhost:12034/one-to-one-peerconnection.html
http://localhost:12034/text-chat-with-simple-websocket.html
```

=

#### If you want to deploy your application

First of all; change **subdomain** in the `package.json` file:

```
{
  "name": "just-a-name",
  "subdomain": "must-be-unique",
  "scripts": {
    "start": "signaler.js"
  },
  main: "signaler.js",
  "version": "0.0.0",
  "engines": {
    "node": "0.10.x"
  },
  "dependencies": {
    "websocket": "1.0.x"
  }
}
```

1. Create an account at `nodejitsu`
2. Use same **Node.js command prompt** window
3. Type `jitsu deploy`

and you're done!

**Remember:** `jitsu deploy` command will deploy the entire directory containing all all files including `node_modules` (i.e. dependencies).

Now, you can listen your nodejitsu server like this:

```javascript
// Remember, must include port "80"!
var websocket = new WebSocket('ws://subdomain.jit.su:80');

// or
var websocket = new WebSocket('ws://subdomain.nodejitsu.com:80');

// or SSL
var websocket = new WebSocket('wss://subdomain.nodejitsu.com:443');
```

=

#### Signaler.js or SSL.js

```javascript
// setting room name
var channelName = location.href.replace(/\/|:|#|%|\.|\[|\]/g, ''); // using URL as room-name

// setting up websocket connection
var websocket = new WebSocket('ws://localhost:12034');

// capturing "onopen" event
websocket.onopen = function () {
    // suggesting node.js server to open a websocket room i.e. channel!
    websocket.push(JSON.stringify({
        open: true,
        channel: channelName
    }));
};

// overriding "send" method to customize default behavior!
websocket.push = websocket.send;
websocket.send = function (data) {
    websocket.push(JSON.stringify({
        data: data,
        channel: channelName
    }));
};

// capturing "onmessage" event!
websocket.onmessage = function (e) {
    console.log(JSON.parse(e.data));
};
```

=

#### How to use?

In `ui.js` files you can find `openSocket` method; or in all libraries; you can find `openSignalingChannel` method.

```javascript
// ws://wsnodejs.jit.su:80
// wss://www.webrtc-experiment.com:8563

var SIGNALING_SERVER = 'ws://' + document.domain + ':12034/';
connection.openSignalingChannel = function(config) {
    config.channel = config.channel || this.channel || 'default-channel';
    var websocket = new WebSocket(SIGNALING_SERVER);
    websocket.channel = config.channel;
    websocket.onopen = function() {
        websocket.push(JSON.stringify({
            open: true,
            channel: config.channel
        }));
        if (config.callback)
            config.callback(websocket);
    };
    websocket.onmessage = function(event) {
        config.onmessage(JSON.parse(event.data));
    };
    websocket.push = websocket.send;
    websocket.send = function(data) {
        websocket.push(JSON.stringify({
            data: data,
            channel: config.channel
        }));
    };
}
```

=

https://github.com/muaz-khan/WebRTC-Experiment/blob/master/Signaling.md

=

#### License

[WebSocket over Node.js](https://github.com/muaz-khan/WebRTC-Experiment/blob/master/websocket-over-nodejs) is released under [MIT licence](https://webrtc-experiment.appspot.com/licence/) . Copyright (c) [Muaz Khan](https://plus.google.com/+MuazKhan).


text:
def add_to_registry():
    finished = False
    name = None
    color = None
    input_ = input('Name and color: ')
    try:
        name, color = input_.split()
    except ValueError:
        finished = True # No input or bad input provided, time to quit
    return finished, name, color

def main():
    finished = False
    registry = {}
    while not finished:
        finished, name, color = add_to_registry()
        if name and color:
            if name not in registry:
                registry[name] = color
            else:
                print(f'{name} already in registry.')
        else:
            finished = True
    for name, color in registry.items():
        print(f'{name} {color}')

if __name__ == '__main__':
    main()


text:
package com.mmnaseri.utils.spring.data.domain.impl;

import com.mmnaseri.utils.spring.data.error.DataOperationExecutionException;
import com.mmnaseri.utils.spring.data.sample.usecases.domain.MappedClass;
import org.testng.annotations.Test;

import java.lang.reflect.Method;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

/**
 * @author Milad Naseri (m.m.naseri@gmail.com)
 * @since 1.0 (4/10/16)
 */
public class MethodInvocationDataStoreOperationTest {

    @Test(expectedExceptions = DataOperationExecutionException.class)
    public void testAccessingPrivateMethod() throws Exception {
        final MethodInvocationDataStoreOperation<Object, Object> operation = new MethodInvocationDataStoreOperation<>(
                new MappedClass(null), MappedClass.class.getDeclaredMethod("privateMethod"));
        operation.execute(null, null, new ImmutableInvocation(null, new Object[]{}));
    }

    @Test(expectedExceptions = DataOperationExecutionException.class)
    public void testAccessingErrorThrowingMethod() throws Exception {
        final MethodInvocationDataStoreOperation<Object, Object> operation = new MethodInvocationDataStoreOperation<>(
                new MappedClass(null), MappedClass.class.getDeclaredMethod("errorThrowingMethod"));
        operation.execute(null, null, new ImmutableInvocation(null, new Object[]{}));
    }

    @Test
    public void testCallingNormalMethod() throws Exception {
        final Object value = new Object();
        final MethodInvocationDataStoreOperation<Object, Object> operation = new MethodInvocationDataStoreOperation<>(
                new MappedClass(value), MappedClass.class.getDeclaredMethod("validMethod"));
        final Object result = operation.execute(null, null, new ImmutableInvocation(null, new Object[]{}));
        assertThat(result, is(value));
    }

    @Test
    public void testToString() throws Exception {
        final Method method = MappedClass.class.getDeclaredMethod("errorThrowingMethod");
        final MappedClass instance = new MappedClass(null);
        final MethodInvocationDataStoreOperation<Object, Object> operation = new MethodInvocationDataStoreOperation<>(
                instance, method);
        assertThat(operation.toString(), is(method + " on " + instance));
    }

}


text:
<?php

if ( ! defined( 'WPINC' ) ) {
	die;
}

if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
	add_action( 'admin_menu', 'reckoning_admin_menu' );
	add_action( 'admin_enqueue_scripts', 'enqueue_reckoning_admin_styles' );
	load_plugin_textdomain( 'reckoning', false, basename( dirname( __FILE__ ) ) . '/languages' );
}

/**
 * Add admin menu link.
 *
 * Adds the admin menu link under the "users" tab.
 *
 * @since 1.0.0
 *
 */
function reckoning_admin_menu() {
	add_submenu_page( 'users.php', __( 'Content Reckoning', 'reckoning' ), __( 'User Summary', 'reckoning' ), 'manage_options', __( 'Reckoning', 'reckoning' ), 'display_reckoning_admin_page' );
} // reckoning_admin_menu

/**
 * Enqueues stylesheet.
 *
 * Enqueues the stylesheet that controls the tables.
 *
 * @since 1.0.0
 *
 */
function enqueue_reckoning_admin_styles() {
	wp_enqueue_style( 'reckoning-admin-styles', plugins_url( 'admin.css', __FILE__ ) );
} // enqueue_reckoning_admin_styles

/**
 * Control function for admin page.
 *
 * Parses the "view" argument in $_GET to display either the page for all users or for a single user.
 *
 * @since 1.0.0
 *
 */
function display_reckoning_admin_page() {
	$view = get_query_var( 'view' );

	if ( ! empty( $view ) ) {
		if ( 'all' === $view ) {
			display_reckoning_admin_page_all();
		} elseif ( $user = get_user_by( 'login', $view ) ) {
			display_reckoning_admin_page_individual( $user );
		} else {
			display_reckoning_admin_page_all();
		}
	} else {
		display_reckoning_admin_page_all();
	}
} // display_reckoning_admin_page

/**
 * Display summary page for user.
 *
 * Displays a summary page that tallies both posts and comments, including the content of each.
 *
 * @since 1.0.0
 *
 * @global $wpdb.
 *
 * @param object $var Description.
 */
function display_reckoning_admin_page_individual( $user ) {
	global $wpdb;
	$blog     = get_blog_details();
	$comments = get_comments( array( 'user_id' => $user->data->ID ) );
	$posts    = get_posts( array(
		 'author' => $user->data->ID,
		 'numberposts' => '-1',
		 'post_status' => array(
				'publish',
				'private',
			),
	) );

	echo '
';
	echo '
' . esc_html( get_admin_page_title() ) . '
';

	// Print a "return to overview" link
	echo '
';
	echo '';
	echo '« ' . esc_html( __( 'Return to Blog Overview',  'reckoning' ) );
	echo '';
	echo '
';

	echo '
';
	echo esc_html( __( 'Summary of User Activity for ',  'reckoning' ) );
	echo '"' . esc_html( ucwords( $user->display_name ) ) . '" ';
	// If the display name and the nicename are different, then show both.
	if ( $user->display_name !== $user->data->user_nicename ) {
		echo '(' . esc_html( $user->data->user_nicename ) . ') ';
	}
	echo 'on "' . esc_html( $blog->blogname ) . '"';
	echo '
';

	// Start processing Posts. Check if there are posts, if so, print the table with all of the posts;
	// if not, print a message saying there are no posts.
	if ( ! count( $posts ) ) {
		echo '
';
		echo '"' . esc_html( ucwords( $user->display_name ) ) . '" ';
		echo esc_html( __( 'has not written a post', 'reckoning' ) ) . '.';
		echo '
';
	} else {
		echo '
' . esc_html( __( 'Total Posts', 'reckoning' ) ) . ': ' . esc_html( count( $posts ) ) . '
';
		echo "
";
		echo "
User Posts
";
		foreach ( $posts as $post ) :
			echo '
';
			preg_match( '/([0-9]{4})-([0-9]{2})-([0-9]{2})/', $post->post_date, $matches );
			$date = "{$matches[2]}/{$matches[3]}/{$matches[1]}";
			echo 'guid ) . '">';
			echo wp_kses_post( $post->post_title );
			echo '	';
			echo '' . esc_html( $date ) . '	';
			echo '
';
			echo '
' . wp_kses_post( $post->post_content ) . '
';
			endforeach;
		echo '
';
	}

	echo '

';

	// Start processing comments. Check if there are comments, if so, print the table with all of the comments;
	// if not, print a message saying there are no comments.
	if ( ! count( $comments ) ) {
		echo '
';
		echo '"' . esc_html( ucwords( $user->display_name ) ) . '" ';
		echo esc_html( __( 'has not posted a comment', 'reckoning' ) );
		echo '.
';
	} else {
		echo '
' . esc_html( __( 'Total Comments', 'reckoning' ) ) . ': ' . count( $comments ) . '
';
		echo "
";
		echo "
User Comments
";
		foreach (  $comments as $comment ) :
			$post = get_post( $comment->comment_post_ID );
			preg_match( '/([0-9]{4})-([0-9]{2})-([0-9]{2})/', $comment->comment_date, $matches );
			$date = "{$matches[2]}/{$matches[3]}/{$matches[1]}";
			echo '
';
			echo '';
			echo esc_html( __( 'On', 'reckoning' ) );
			echo ' guid . '#comment-' . $comment->comment_ID ) . '">';
			echo esc_html( $post->post_title ) . '	';
			echo '' . esc_html( $date ) . '	';
			echo '
';
			echo '
' . wp_kses_post( $comment->comment_content ) . '
';
		endforeach;
		echo '
';
	}
	echo '

';

	// Print a "return to overview" link
	echo '
';
	echo '';
	echo '« ' . esc_html( __( 'Return to Blog Overview', 'reckoning' ) );
	echo '';
	echo '
';

} // display_reckoning_admin_page_individual

/**
 * Display summary page for all users.
 *
 * Displays a summary page that tallies the number of both posts and comments,
 * per user and displays links to the post/comment, sorted by date.
 *
 * @since 1.0.0
 *
 * @global $wpdb.
 */
function display_reckoning_admin_page_all() {
	global $wpdb;
	$blog = get_blog_details();
	$users = get_users( 'orderby=display_name&order=ASC' );
?>

<?php echo esc_html( get_admin_page_title() ); ?>

<?php
	echo '
';
	echo esc_html( __( 'Summary of User Activity on', 'reckoning' ) );
	echo '"' . esc_html( $blog->blogname ) . '"';
	echo '
';
	echo '';
	echo esc_html( __( 'Click the name of the user to see a more detailed report for that user', 'reckoning' ) ) . '.';
	echo '';

	// Start looping through each user.
foreach ( $users as $user ) :
	$posts = get_posts( array(
		'author'      => $user->data->ID,
		'numberposts' => '-1',
		'post_status' => array(
			'publish',
			'private',
		),
	) );
	$comments = get_comments( array( 'user_id' => $user->data->ID ) );

	// Show the username with a link to a more detailed view of the user.
	echo '
';
	echo 'data->user_login ) . '">';
	echo esc_html( ucwords( $user->data->display_name ) );
	echo '';
	// If the display name and the nicename are different, then show both.
	if ( $user->data->display_name !== $user->data->user_nicename ) {
		echo ' (' . esc_html( $user->data->user_nicename ) . ') ';
	}
	echo '
';

	// Start processing Posts. Check if there are posts, if so, print the table with all of the posts;
	// if not, print a message saying there are no posts.
	if ( ! count( $posts ) ) {
		echo '
';
		echo '"' . esc_html( ucwords( $user->display_name ) ) . '" ';
		echo esc_html( __( 'has not written a post', 'reckoning' ) ) . '.';
		echo '
';
	} else {
		echo "
";
		echo "

User Posts

";
		foreach ( $posts as $post ) :
			preg_match( '/([0-9]{4})-([0-9]{2})-([0-9]{2})/', $post->post_date, $matches );
			$date = "$matches[2]/$matches[3]/$matches[1]";
			echo '
';
			echo 'guid ) . '">';
			echo wp_kses_post( $post->post_title );
			echo '';
			echo '	';
			echo '' . esc_html( $date ) . '
';
		endforeach;
		echo '
';
		echo '' . esc_html( __( 'Total Posts', 'reckoning' ) ) . '	';
		echo '' . (int) count( $posts ) . '	';
		echo '
';
		echo '
';
	}

	// Start processing comments. Check if there are comments, if so, print the table with all of the comments;
	// if not, print a message saying there are no comments.
	if ( ! count( $comments ) ) {
		echo '
';
		echo '"' . esc_html( ucwords( $user->display_name ) . '" ' . __( 'has not posted a comment', 'reckoning' ) ) . '.';
		echo '
';
	} else {
		echo '
';
		echo '

User Comments

';
		foreach ( $comments as $comment ) :
			$post = get_post( $comment->comment_post_ID );
			preg_match( '/([0-9]{4})-([0-9]{2})-([0-9]{2})/', $comment->comment_date, $matches );
			$date = "{$matches[2]}/{$matches[3]}/{$matches[1]}";
			echo '
';
			echo 'On ';
			echo 'guid . '#comment-' . $comment->comment_ID ) . '">';
			echo esc_html( $post->post_title );
			echo '';
			echo '	';
			echo '' . esc_html( $date ) . '	';
			echo '
';
		endforeach;
		echo '
';
		echo '' . esc_html( __( 'Total Comments', 'reckoning' ) ) . '	';
		echo '' . (int) count( $comments ) . '	';
		echo '
';
		echo '
';
	}
	echo '

';
	endforeach;

	echo '
';

} // display_reckoning_admin_page_all


text:
<?php

namespace app\modules\wechat\controllers;

use yii\web\Controller;

/**
 * Default controller for the `wechat` module
 */
class PublicController extends Controller
{
	public $title  = '微信后台管理';
	public $layout = 'wechat';
    /**
     * Renders the index view for the module
     * @return string
     */
    public function actionIndex()
    {
        return $this->render('index');
    }
}


text:
require "json"
require "parslet"
require "singleton"
require "forwardable"

module GraphQL
  class ParseError < StandardError
    attr_reader :line, :col, :query
    def initialize(message, line, col, query)
      super(message)
      @line = line
      @col = col
      @query = query
    end
  end

  # Turn a query string into an AST
  # @param string [String] a GraphQL query string
  # @param as [Symbol] If you want to use this to parse some _piece_ of a document, pass the rule name (from {GraphQL::Parser})
  # @return [GraphQL::Language::Nodes::Document]
  def self.parse(string, as: nil)
    parser = as ? GraphQL::PARSER.send(as) : GraphQL::PARSER
    tree = parser.parse(string)
    GraphQL::TRANSFORM.apply(tree)
  rescue Parslet::ParseFailed => error
    line, col = error.cause.source.line_and_column(error.cause.pos)
    raise GraphQL::ParseError.new(error.message, line, col, string)
  end
end

# Order matters for these:

require 'graphql/definition_helpers'
require 'graphql/base_type'
require 'graphql/object_type'

require 'graphql/enum_type'
require 'graphql/input_object_type'
require 'graphql/interface_type'
require 'graphql/list_type'
require 'graphql/non_null_type'
require 'graphql/union_type'

require 'graphql/argument'
require 'graphql/field'
require 'graphql/type_kinds'

require 'graphql/scalar_type'
require 'graphql/boolean_type'
require 'graphql/float_type'
require 'graphql/id_type'
require 'graphql/int_type'
require 'graphql/string_type'

require 'graphql/introspection'
require 'graphql/language'
require 'graphql/directive'
require 'graphql/schema'
require 'graphql/schema/printer'

# Order does not matter for these:

require 'graphql/execution_error'
require 'graphql/query'
require 'graphql/repl'
require 'graphql/static_validation'
require 'graphql/version'


text:
/*	$OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $	*/

/*
 * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/* OPENBSD ORIGINAL: lib/libc/string/strlcat.c */

#include <sys/types.h>
#include <string.h>

/*
 * Appends src to string dst of size siz (unlike strncat, siz is the
 * full size of dst, not space left).  At most siz-1 characters
 * will be copied.  Always NUL terminates (unless siz <= strlen(dst)).
 * Returns strlen(src) + MIN(siz, strlen(initial dst)).
 * If retval >= siz, truncation occurred.
 */
size_t
strlcat(char *dst, const char *src, size_t siz)
{
	char *d = dst;
	const char *s = src;
	size_t n = siz;
	size_t dlen;

	/* Find the end of dst and adjust bytes left but don't go past end */
	while (n-- != 0 && *d != '\0')
		d++;
	dlen = d - dst;
	n = siz - dlen;

	if (n == 0)
		return(dlen + strlen(s));
	while (*s != '\0') {
		if (n != 1) {
			*d++ = *s;
			n--;
		}
		s++;
	}
	*d = '\0';

	return(dlen + (s - src));	/* count does not include NUL */
}


text:
% PUBLIC FUNCTION ne_mkda_addana: add analysis to list
function varargout = ne_mkda_addana(varargin)

% Version:  v0.9c
% Build:    11120211
% Date:     Nov-08 2011, 1:08 PM EST
% Author:   Jochen Weber, SCAN Unit, Columbia University, NYC, NY, USA
% URL/Info: http://neuroelf.net/

% Copyright (c) 2011, Jochen Weber
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are met:
%     * Redistributions of source code must retain the above copyright
%       notice, this list of conditions and the following disclaimer.
%     * Redistributions in binary form must reproduce the above copyright
%       notice, this list of conditions and the following disclaimer in the
%       documentation and/or other materials provided with the distribution.
%     * Neither the name of Columbia University nor the
%       names of its contributors may be used to endorse or promote products
%       derived from this software without specific prior written permission.
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
% ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
% DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
% DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
% (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
% ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
% (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
% SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

% global variable
global ne_gcfg;
hFig = ne_gcfg.h.MKDA.MKDAFig;
ch = ne_gcfg.h.MKDA.h;

% preset output
if nargout > 0
    varargout = cell(1, nargout);
end

% get content of PLP dropdown
plps = ch.PLPs;
plpud = plps.UserData;
plpid = plps.Value;
try
    plp = plpud{plpid, 3};
    if numel(plp) ~= 1 || ...
       ~isxff(plp, 'plp')
        error( ...
            'neuroelf:GUI:BadPLP', ...
            'Bad PLP object.' ...
        );
    end
catch ne_eo;
    ne_gcfg.c.lasterr = ne_eo;
    return;
end
rtv = plp.RunTimeVars;
anas = rtv.MKDAAnalyses;
anaidx = ch.Analyses.Value;

% ask for name for new analysis
newname = inputdlg({'New analysis name:     '}, 'NeuroElf - user input', 1, {''});
if ~iscell(newname) || ...
    numel(newname) ~= 1 || ...
    isempty(ddeblank(newname{1}))
    return;
end
newname = newname{1};

% copy current selection
newana = anas{anaidx, 2};

% where to store
if strcmp(anas{anaidx, 1}, '<no analyses defined>')
    anas(1, :) = {newname, newana};
else
    anas(end+1, :) = {newname, newana};
    anaidx = size(anas, 1);
end

% update control as well as RunTimeVars
ch.Analyses.String = anas(:, 1);
ch.Analyses.Value = anaidx;
plp.RunTimeVars.MKDAAnalyses = anas;

% enable HasAnas group
hFig.SetGroupEnabled('HasAnas', 'on');

% save configuration
if ~isempty(plp.FilenameOnDisk)
    try
        plp.SaveRunTimeVars;
    catch ne_eo;
        ne_gcfg.c.lasterr = ne_eo;
    end
end


text:
layout: post
date: 2018-03-23
title: "Jovani Blue Two-Piece A-Line Prom Dress 32999 Short Sleeves Floor-Length Aline/Princess"
category: Jovani
tags: [Jovani ,Jovani,Aline/Princess ,Illusion,Floor-Length,Short Sleeves]
---
### Jovani Blue Two-Piece A-Line Prom Dress 32999
Just **$451.98**
###   Short Sleeves Floor-Length Aline/Princess

BRANDS	Jovani

Silhouette	Aline/Princess

Neckline	Illusion

Hemline/Train	Floor-Length

Sleeve	Short Sleeves

Buy it: [https://www.readybrides.com/en/jovani-/39217-jovani-blue-two-piece-a-line-prom-dress-32999.html](https://www.readybrides.com/en/jovani-/39217-jovani-blue-two-piece-a-line-prom-dress-32999.html)