text:
package org.apache.geode.distributed.internal.membership.gms;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.EOFException;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;

import org.jgroups.util.UUID;

import org.apache.geode.DataSerializer;
import org.apache.geode.distributed.DurableClientAttributes;
import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.distributed.internal.membership.MemberAttributes;
import org.apache.geode.distributed.internal.membership.NetMember;
import org.apache.geode.internal.DataSerializableFixedID;
import org.apache.geode.internal.InternalDataSerializer;
import org.apache.geode.internal.Version;
import org.apache.geode.internal.i18n.LocalizedStrings;

/**
 * This is the fundamental representation of a member of a GemFire distributed system.
 *
 * Unfortunately, this class serves two distinct functions. First, it is the fundamental element of
 * membership in the GemFire distributed system. As such, it is used in enumerations and properly
 * responds to hashing and equals() comparisons.
 *
 * Second, it is used as a cheap way of representing an address. This is unfortunate, because as a
 * NetMember, it holds two separate port numbers: the "membership" descriptor as well as a direct
 * communication channel.
 *
 */
public class GMSMember implements NetMember, DataSerializableFixedID {
  // whether to show UUID info in toString()
  private static final boolean SHOW_UUIDS =
      Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "show_UUIDs");

  private int udpPort = 0;
  private boolean preferredForCoordinator;
  private boolean networkPartitionDetectionEnabled;
  private byte memberWeight;
  private InetAddress inetAddr;
  private int processId;
  private byte vmKind;
  private int vmViewId = -1;
  private int directPort;
  private String name;
  private DurableClientAttributes durableClientAttributes;
  private String[] groups;
  private short versionOrdinal = Version.CURRENT_ORDINAL;
  private long uuidLSBs;
  private long uuidMSBs;

  // Used only by Externalization
  public GMSMember() {}

  public MemberAttributes getAttributes() {
    return new MemberAttributes(directPort, processId, vmKind, vmViewId, name, groups,
        durableClientAttributes);
  }

  public void setAttributes(MemberAttributes p_attr) {
    MemberAttributes attr = p_attr;
    if (attr == null) {
      attr = MemberAttributes.INVALID;
    }
    processId = attr.getVmPid();
    vmKind = (byte) attr.getVmKind();
    directPort = attr.getPort();
    vmViewId = attr.getVmViewId();
    name = attr.getName();
    groups = attr.getGroups();
    durableClientAttributes = attr.getDurableClientAttributes();
  }

  /**
   * Create a CacheMember referring to the current host (as defined by the given string).
   *
   * @param i the hostname, must be for the current host
   * @param p the membership listening port
   */
  public GMSMember(String i, int p) {
    udpPort = p;
    try {
      inetAddr = InetAddress.getByName(i);
    } catch (UnknownHostException e) {
      // oops
    }
  }

  /**
   * Create a CacheMember referring to the current host (as defined by the given string).
   *
   * @param i the hostname, must be for the current host
   * @param p the membership listening port
   * @param networkPartitionDetectionEnabled whether the member has network partition detection
   *        enabled
   * @param preferredForCoordinator whether the member can be group coordinator
   * @param version the member's version ordinal
   * @param msbs - most significant bytes of UUID
   * @param lsbs - least significant bytes of UUID
   */
  public GMSMember(MemberAttributes attr, InetAddress i, int p,
      boolean networkPartitionDetectionEnabled, boolean preferredForCoordinator, short version,
      long msbs, long lsbs) {
    setAttributes(attr);
    this.inetAddr = i;
    this.udpPort = p;
    this.networkPartitionDetectionEnabled = networkPartitionDetectionEnabled;
    this.preferredForCoordinator = preferredForCoordinator;
    this.versionOrdinal = version;
    this.uuidMSBs = msbs;
    this.uuidLSBs = lsbs;
  }

  public GMSMember(InetAddress i, int p, short version, long msbs, long lsbs, int viewId) {
    this.inetAddr = i;
    this.udpPort = p;
    this.versionOrdinal = version;
    this.uuidMSBs = msbs;
    this.uuidLSBs = lsbs;
    this.vmViewId = viewId;
  }

  /**
   * Clone a GMSMember
   *
   * @param other the member to create a copy of
   */
  public GMSMember(GMSMember other) {
    this.udpPort = other.udpPort;
    this.preferredForCoordinator = other.preferredForCoordinator;
    this.networkPartitionDetectionEnabled = other.networkPartitionDetectionEnabled;
    this.memberWeight = other.memberWeight;
    this.inetAddr = other.inetAddr;
    this.processId = other.processId;
    this.vmKind = other.vmKind;
    this.vmViewId = other.vmViewId;
    this.directPort = other.directPort;
    this.name = other.name;
    this.durableClientAttributes = other.durableClientAttributes;
    this.groups = other.groups;
    this.versionOrdinal = other.versionOrdinal;
    this.uuidLSBs = other.uuidLSBs;
    this.uuidMSBs = other.uuidMSBs;
  }

  public int getPort() {
    return this.udpPort;
  }

  public boolean isMulticastAddress() {
    return false;
  }

  public boolean preferredForCoordinator() {
    return this.preferredForCoordinator;
  }

  public void setPreferredForCoordinator(boolean preferred) {
    this.preferredForCoordinator = preferred;
  }

  public InetAddress getInetAddress() {
    return this.inetAddr;
  }

  public short getVersionOrdinal() {
    return this.versionOrdinal;
  }

  public void setVersionOrdinal(short versionOrdinal) {
    this.versionOrdinal = versionOrdinal;
  }

  public void setUUID(UUID u) {
    this.uuidLSBs = u.getLeastSignificantBits();
    this.uuidMSBs = u.getMostSignificantBits();
  }

  /**
   * return the jgroups logical address for this member, if it's been established
   */
  public UUID getUUID() {
    if (this.uuidLSBs == 0 && this.uuidMSBs == 0) {
      return null;
    }
    return new UUID(this.uuidMSBs, this.uuidLSBs);
  }

  public long getUuidMSBs() {
    return this.uuidMSBs;
  }

  public long getUuidLSBs() {
    return this.uuidLSBs;
  }

  /*
   * implements the java.lang.Comparable interface
   *
   * @see java.lang.Comparable
   *
   * @param o - the Object to be compared
   *
   * @return a negative integer, zero, or a positive integer as this object is less than, equal to,
   * or greater than the specified object.
   *
   * @exception java.lang.ClassCastException - if the specified object's type prevents it from being
   * compared to this Object.
   */
  public int compareTo(NetMember o) {
    if (o == this) {
      return 0;
    }
    // obligatory type check
    if (o == null || !(o instanceof GMSMember)) {
      throw new ClassCastException(
          LocalizedStrings.Member_MEMBERCOMPARETO_COMPARISON_BETWEEN_DIFFERENT_CLASSES
              .toLocalizedString());
    }
    byte[] myAddr = inetAddr.getAddress();
    GMSMember his = (GMSMember) o;
    byte[] hisAddr = his.inetAddr.getAddress();
    if (myAddr != hisAddr) {
      for (int idx = 0; idx < myAddr.length; idx++) {
        if (idx >= hisAddr.length) {
          return 1;
        } else if (myAddr[idx] > hisAddr[idx]) {
          return 1;
        } else if (myAddr[idx] < hisAddr[idx]) {
          return -1;
        }
      }
      // After checking both addresses we have only gone up to myAddr.length, their address could be
      // longer
      if (hisAddr.length > myAddr.length) {
        return -1;
      }
    }
    if (udpPort < his.udpPort)
      return -1;
    if (his.udpPort < udpPort)
      return 1;
    int result = 0;

    // bug #41983, address of kill-9'd member is reused
    // before it can be ejected from membership
    if (this.vmViewId >= 0 && his.vmViewId >= 0) {
      if (this.vmViewId < his.vmViewId) {
        result = -1;
      } else if (his.vmViewId < this.vmViewId) {
        result = 1;
      }
    }
    if (result == 0 && this.uuidMSBs != 0 && his.uuidMSBs != 0) {
      if (this.uuidMSBs < his.uuidMSBs) {
        result = -1;
      } else if (his.uuidMSBs < this.uuidMSBs) {
        result = 1;
      } else if (this.uuidLSBs < his.uuidLSBs) {
        result = -1;
      } else if (his.uuidLSBs < this.uuidLSBs) {
        result = 1;
      }
    }
    return result;
  }

  @Override
  public int compareAdditionalData(NetMember other) {
    GMSMember his = (GMSMember) other;
    int result = 0;
    if (this.uuidMSBs != 0 && his.uuidMSBs != 0) {
      if (this.uuidMSBs < his.uuidMSBs) {
        result = -1;
      } else if (his.uuidMSBs < this.uuidMSBs) {
        result = 1;
      } else if (this.uuidLSBs < his.uuidLSBs) {
        result = -1;
      } else if (his.uuidLSBs < this.uuidLSBs) {
        result = 1;
      }
    }
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    // GemStone fix for 29125
    if ((obj == null) || !(obj instanceof GMSMember)) {
      return false;
    }
    return compareTo((GMSMember) obj) == 0;
  }

  @Override
  public int hashCode() {
    if (this.inetAddr == null) {
      return this.udpPort;
    }
    return this.udpPort + inetAddr.hashCode();
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder(100);
    String uuid = SHOW_UUIDS ? (";uuid=" + getUUID().toStringLong())
        : ((this.uuidLSBs == 0 && this.uuidMSBs == 0) ? "; no uuid" : "; uuid set");

    sb.append("GMSMember[addr=").append(inetAddr).append(";port=").append(udpPort)
        .append(";processId=").append(processId).append(";name=").append(name).append(uuid)
        .append("]");
    return sb.toString();
  }

  public int getUdpPort() {
    return udpPort;
  }

  public boolean isNetworkPartitionDetectionEnabled() {
    return networkPartitionDetectionEnabled;
  }

  public byte getMemberWeight() {
    return memberWeight;
  }

  public InetAddress getInetAddr() {
    return inetAddr;
  }

  public int getProcessId() {
    return processId;
  }

  public byte getVmKind() {
    return vmKind;
  }

  public int getVmViewId() {
    return vmViewId;
  }

  @Override
  public void setVmViewId(int id) {
    this.vmViewId = id;
  }

  public int getDirectPort() {
    return directPort;
  }

  public String getName() {
    return name;
  }

  public DurableClientAttributes getDurableClientAttributes() {
    return durableClientAttributes;
  }

  public String[] getRoles() {
    return groups;
  }

  public void setUdpPort(int udpPort) {
    this.udpPort = udpPort;
  }

  public void setNetworkPartitionDetectionEnabled(boolean networkPartitionDetectionEnabled) {
    this.networkPartitionDetectionEnabled = networkPartitionDetectionEnabled;
  }

  public void setMemberWeight(byte memberWeight) {
    this.memberWeight = memberWeight;
  }

  public void setInetAddr(InetAddress inetAddr) {
    this.inetAddr = inetAddr;
  }

  public void setProcessId(int processId) {
    this.processId = processId;
  }

  public void setVmKind(int vmKind) {
    this.vmKind = (byte) vmKind;
  }

  public void setVersion(Version v) {
    this.versionOrdinal = v.ordinal();
  }

  public void setBirthViewId(int birthViewId) {
    this.vmViewId = birthViewId;
  }

  public void setDirectPort(int directPort) {
    this.directPort = directPort;
  }

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

  public void setDurableClientAttributes(DurableClientAttributes durableClientAttributes) {
    this.durableClientAttributes = durableClientAttributes;
  }

  @Override
  public String[] getGroups() {
    return groups;
  }

  public void setGroups(String[] groups) {
    this.groups = groups;
  }

  public void setPort(int p) {
    this.udpPort = p;
  }

  /**
   * checks to see if this address has UUID information needed to send messages via JGroups
   */
  public boolean hasUUID() {
    return !(this.uuidLSBs == 0 && this.uuidMSBs == 0);
  }

  @Override
  public Version[] getSerializationVersions() {
    return null;
  }

  @Override
  public int getDSFID() {
    return GMSMEMBER;
  }

  static final int NPD_ENABLED_BIT = 0x01;
  static final int PREFERRED_FOR_COORD_BIT = 0x02;

  @Override
  public void toData(DataOutput out) throws IOException {
    writeEssentialData(out);
    out.writeInt(directPort);
    out.writeByte(memberWeight);
    out.writeByte(vmKind);
    out.writeInt(processId);

    DataSerializer.writeString(name, out);
    DataSerializer.writeStringArray(groups, out);
  }

  public void writeEssentialData(DataOutput out) throws IOException {
    Version.writeOrdinal(out, this.versionOrdinal, true);

    int flags = 0;
    if (networkPartitionDetectionEnabled)
      flags |= NPD_ENABLED_BIT;
    if (preferredForCoordinator)
      flags |= PREFERRED_FOR_COORD_BIT;
    out.writeShort(flags);

    DataSerializer.writeInetAddress(inetAddr, out);
    out.writeInt(udpPort);
    out.writeInt(vmViewId);
    out.writeLong(uuidMSBs);
    out.writeLong(uuidLSBs);
    if (InternalDataSerializer.getVersionForDataStream(out).compareTo(Version.GEODE_120) >= 0) {
      out.writeByte(vmKind);
    }
  }

  @Override
  public void fromData(DataInput in) throws IOException, ClassNotFoundException {
    readEssentialData(in);
    this.directPort = in.readInt();
    this.memberWeight = in.readByte();
    this.vmKind = in.readByte();
    this.processId = in.readInt();

    this.name = DataSerializer.readString(in);
    this.groups = DataSerializer.readStringArray(in);
  }

  public void readEssentialData(DataInput in) throws IOException, ClassNotFoundException {
    this.versionOrdinal = Version.readOrdinal(in);

    int flags = in.readShort();
    this.networkPartitionDetectionEnabled = (flags & NPD_ENABLED_BIT) != 0;
    this.preferredForCoordinator = (flags & PREFERRED_FOR_COORD_BIT) != 0;

    this.inetAddr = DataSerializer.readInetAddress(in);
    this.udpPort = in.readInt();
    this.vmViewId = in.readInt();
    this.uuidMSBs = in.readLong();
    this.uuidLSBs = in.readLong();
    if (InternalDataSerializer.getVersionForDataStream(in).compareTo(Version.GEODE_120) >= 0) {
      this.vmKind = in.readByte();
    }
  }

  @Override
  public boolean hasAdditionalData() {
    return uuidMSBs != 0 || uuidLSBs != 0 || memberWeight != 0;
  }

  @Override
  public void writeAdditionalData(DataOutput out) throws IOException {
    out.writeLong(uuidMSBs);
    out.writeLong(uuidLSBs);
    out.write(memberWeight);
  }

  @Override
  public void readAdditionalData(DataInput in) throws ClassNotFoundException, IOException {
    try {
      this.uuidMSBs = in.readLong();
      this.uuidLSBs = in.readLong();
      memberWeight = (byte) (in.readByte() & 0xFF);
    } catch (EOFException e) {
      // some IDs do not have UUID or membership weight information
    }
  }
}


text:
namespace harb {

Graph::Graph(FILE *f) {
  fseeko(f, 0, SEEK_END);
  Progress progress("parsing", ftello(f));
  fseeko(f, 0, SEEK_SET);
  progress.start();

  parser_ = new Parser(f);

  root_ = parser_->create_heap_object(RUBY_T_ROOT);

  parser_->parse([&] (RubyHeapObj *obj) {
    obj->graph = this;
    if (obj->is_root_object()) {
      root_->as.root.children->push_back(obj);
    } else {
      heap_map_[obj->as.obj.addr] = obj;
    }
    progress.update(ftello(f));
  });

  progress.complete();

  update_references();

  build_dominator_tree();
}

void Graph::add_inverse_obj_references(RubyHeapObj *obj) {
  if (obj->refs_to.obj == NULL) {
    return;
  }

  for (int i = 0; obj->refs_to.obj[i] != NULL; ++i) {
    obj->refs_to.obj[i]->refs_from.push_back(obj);
  }
}

void Graph::update_obj_references(RubyHeapObj *obj) {
  if (obj->refs_to.addr) {
    size_t count = 0;
    for (size_t i = 0; obj->refs_to.addr[i]; ++i) {
      RubyHeapObj *ref = get_heap_object(obj->refs_to.addr[i]);
      if (ref) {
        obj->refs_to.obj[count++] = ref;
      } else {
        // TODO: warn here?
      }
    }
    for (size_t i = count; obj->refs_to.addr[i]; ++i) {
      obj->refs_to.addr[i] = 0;
    }
  }

  obj->as.obj.clazz.obj = get_heap_object(obj->as.obj.clazz.addr);
}

void Graph::update_references() {
  size_t num_heap_objects = heap_map_.size();
  RubyHeapObjList *roots = root_->as.root.children;
  harb::Progress progress("updating references", num_heap_objects + roots->size());
  progress.start();
  for (auto it = heap_map_.begin(); it != heap_map_.end(); ++it) {
    update_obj_references(it->second);
    add_inverse_obj_references(it->second);
    progress.increment();
  }
  for (auto it = roots->begin(); it != roots->end(); ++it) {
    update_obj_references(*it);
    add_inverse_obj_references(*it);
    progress.increment();
  }
  progress.complete();
}

void Graph::build_dominator_tree() {
  dominator_tree_ = new DominatorTree(root_, parser_->get_heap_object_count());
  dominator_tree_->calculate();
}

RubyHeapObj* Graph::get_heap_object(uint64_t addr) {
  auto it = heap_map_.find(addr);
  if (it == heap_map_.end()) {
    return NULL;
  }
  return it->second;
}

}

redpajama_set_name: RedPajamaGithub


text:
package ro.pub.cs.systems.pdsd.lab05.addressbook.view;

import ro.pub.cs.systems.pdsd.lab05.addressbook.R;
import ro.pub.cs.systems.pdsd.lab05.addressbook.general.Constants;
import android.app.Fragment;
import android.app.LoaderManager;
import android.content.CursorLoader;
import android.content.Loader;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.ContactsContract.CommonDataKinds.Email;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.Data;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class ContactAdditionalDetailsFragment extends Fragment implements LoaderManager.LoaderCallbacks<Cursor> {

	private static final String[] PROJECTION = {
		Data._ID,
		Data.MIMETYPE,
		Data.DATA1,
		Data.DATA2
	};

	private static final int MIMETYPE_INDEX = 1;
	private static final int DATA1_INDEX = 2;
	private static final int DATA2_INDEX = 3;

	private static final String SELECTION = Data.LOOKUP_KEY + " = ?"
			+ " AND "
		    + "(" + Data.MIMETYPE + " = " + "'" + Phone.CONTENT_ITEM_TYPE + "'"
			+ " OR " + Data.MIMETYPE + " = " + "'" + Email.CONTENT_ITEM_TYPE + "')";
	private String[] selectionArguments;

	private static final String SORT_ORDER = Data.MIMETYPE;

	TextView contactPhonesTextView;
	TextView contactEmailsTextView;

	public ContactAdditionalDetailsFragment(String selectionCriteria) {
		this.selectionArguments = new String[] { selectionCriteria };
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle state) {
		return inflater.inflate(R.layout.fragment_contact_additional_details, parent, false);
	}

	@Override
	public void onActivityCreated(Bundle state) {
		super.onActivityCreated(state);
		contactPhonesTextView = (TextView)getActivity().findViewById(R.id.contact_phones_text_view);
		contactEmailsTextView = (TextView)getActivity().findViewById(R.id.contact_emails_text_view);
		refresh();
	}

	@Override
	public Loader<Cursor> onCreateLoader(int id, Bundle args) {
		return new CursorLoader(
				getActivity(),
				Data.CONTENT_URI,
				PROJECTION,
				SELECTION,
				selectionArguments,
				SORT_ORDER);
	}

	@Override
	public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
		if (cursor.getCount() != 0) {
			cursor.moveToFirst();
			StringBuffer phoneContent = new StringBuffer();
			StringBuffer emailContent = new StringBuffer();
			do {
				String data1 = cursor.getString(cursor.getColumnIndex(PROJECTION[DATA1_INDEX]));
				int data2 = cursor.getInt(cursor.getColumnIndex(PROJECTION[DATA2_INDEX]));
				String type = new String();
				if(cursor.getString(cursor.getColumnIndex(PROJECTION[MIMETYPE_INDEX])).equals(Phone.CONTENT_ITEM_TYPE)) {
					switch(data2) {
						case Phone.TYPE_HOME:
							type = getActivity().getResources().getString(R.string.home);
							break;
						case Phone.TYPE_MOBILE:
							type = getActivity().getResources().getString(R.string.mobile);
							break;
						case Phone.TYPE_WORK:
							type = getActivity().getResources().getString(R.string.work);
							break;
						default:
							type = getActivity().getResources().getString(R.string.other);
							break;
					}
					phoneContent.append(type+" "+data1+"\n");
				}
				if(cursor.getString(cursor.getColumnIndex(PROJECTION[MIMETYPE_INDEX])).equals(Email.CONTENT_ITEM_TYPE)) {
					switch(data2) {
						case Email.TYPE_HOME:
							type = getActivity().getResources().getString(R.string.home);
							break;
						case Email.TYPE_MOBILE:
							type = getActivity().getResources().getString(R.string.mobile);
							break;
						case Email.TYPE_WORK:
							type = getActivity().getResources().getString(R.string.work);
							break;
						default:
							type = getActivity().getResources().getString(R.string.other);
							break;
					}
					emailContent.append(type+" "+data1+"\n");
				}
			} while (cursor.moveToNext());
			contactPhonesTextView.setText(phoneContent.toString());
			contactEmailsTextView.setText(emailContent.toString());
			if (contactPhonesTextView.getText() == null || contactPhonesTextView.getText().toString().isEmpty()) {
				contactPhonesTextView.setText(getActivity().getResources().getString(R.string.empty));
				contactPhonesTextView.setGravity(Gravity.CENTER);
			}
			if (contactEmailsTextView.getText() == null || contactEmailsTextView.getText().toString().isEmpty()) {
				contactEmailsTextView.setText(getActivity().getResources().getString(R.string.empty));
				contactEmailsTextView.setGravity(Gravity.CENTER);
			}
		}
	}

	@Override
	public void onLoaderReset(Loader<Cursor> loader) {
	}

	public void refresh() {
		getLoaderManager().initLoader(Constants.ADDITIONAL_DETAILS_QUERY, null, this);
	}

}


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

namespace Microsoft.Samples.WindowsAzure.ServiceManagement
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Runtime.Serialization;
    using System.Text;
    using System.Xml;
#if SERVER
    using Microsoft.Cis.DevExp.Services.Rdfe.ServiceManagement;
#endif

    [DataContract(Namespace = Constants.ServiceManagementNS)]
    public class SubscriptionOperationCollection : IExtensibleDataObject
    {
        [DataMember(Order = 0)]
        public SubscriptionOperationList SubscriptionOperations { get; set; }

        [DataMember(Order = 1, EmitDefaultValue = false)]
        public string ContinuationToken { get; set; }

        public ExtensionDataObject ExtensionData { get; set; }
    }

    [CollectionDataContract(Namespace = Constants.ServiceManagementNS, Name = "SubscriptionOperations", ItemName = "SubscriptionOperation")]
    public class SubscriptionOperationList : List<SubscriptionOperation>, IExtensibleDataObject
    {
        public ExtensionDataObject ExtensionData { get; set; }

        public SubscriptionOperationList()
        {
        }

        public SubscriptionOperationList(IEnumerable<SubscriptionOperation> subscriptions)
            : base(subscriptions)
        {
        }
    }

    [DataContract(Namespace = Constants.ServiceManagementNS)]
    public class SubscriptionOperationCaller : IExtensibleDataObject
    {
        [DataMember(Order = 0)]
        public bool UsedServiceManagementApi { get; set; }

        [DataMember(Order = 1, EmitDefaultValue = false)]
        public string UserEmailAddress { get; set; }

        [DataMember(Order = 2, EmitDefaultValue = false)]
        public string SubscriptionCertificateThumbprint { get; set; }

        [DataMember(Order = 3, EmitDefaultValue = false)]
        public string ClientIP { get; set; }

        public ExtensionDataObject ExtensionData { get; set; }
    }

    [CollectionDataContract(Namespace = Constants.ServiceManagementNS, Name = "OperationParameters", ItemName = "OperationParameter")]
    public class OperationParameterList : List<OperationParameter>, IExtensibleDataObject
    {
        public ExtensionDataObject ExtensionData { get; set; }

        public OperationParameterList()
        {
        }

        public OperationParameterList(IEnumerable<OperationParameter> operations)
            : base(operations)
        {
        }
    }

    /// <summary>
    /// Represents a parameter for operation.
    /// </summary>
    [DataContract]
    public class OperationParameter : IExtensibleDataObject
    {
        /// <summary>
        /// Name of the parameter, return value for the operation will have name
        /// as @return.
        /// </summary>
        [DataMember(Order = 0)]
        public string Name { get; set; }

        [DataMember(Order = 1)]
        private string Value { get; set; }

        private static Type[] KnownTypes =
        {
            typeof(CreateAffinityGroupInput),
            typeof(UpdateAffinityGroupInput),
            typeof(CertificateFile),
            typeof(ChangeConfigurationInput),
            typeof(CreateDeploymentInput),
            typeof(CreateHostedServiceInput),
            typeof(CreateStorageServiceInput),
            typeof(PrepareImageUploadInput),
            typeof(RegenerateKeys),
            typeof(SetMachineImagePropertiesInput),
            typeof(SetParentImageInput),
            typeof(StorageDomain),
            typeof(SubscriptionCertificate),
            typeof(SwapDeploymentInput),
            typeof(UpdateDeploymentStatusInput),
            typeof(UpdateHostedServiceInput),
            typeof(UpdateStorageServiceInput),
            typeof(UpgradeDeploymentInput),
            typeof(WalkUpgradeDomainInput),
            typeof(CaptureRoleOperation),
            typeof(ShutdownRoleOperation),
            typeof(StartRoleOperation),
            typeof(RestartRoleOperation),
            typeof(OSImage),
            typeof(PersistentVMRole),
            typeof(Deployment),
            typeof(DataVirtualHardDisk),
            typeof(OSImage),
            typeof(Disk),
            typeof(ExtendedProperty)
        };

        /// <summary>
        /// Helper to retrieve the serialized value of the parameter.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public string GetSerializedValue()
        {
            return this.Value;
        }

        /// <summary>
        /// Helper to retrieve the value with it's type being discoverable
        /// </summary>
        /// <returns></returns>
        public object GetValue()
        {
            DataContractSerializer serializer;

            if (string.IsNullOrEmpty(this.Value))
            {
                return null;
            }

            serializer = new DataContractSerializer(typeof(object), OperationParameter.KnownTypes);

            try
            {
                return serializer.ReadObject(XmlReader.Create(new StringReader(this.Value)));
            }
            catch
            {
                // If we can't deserialize for some reason, we give back the raw XML
                return this.Value;
            }
        }

        public void SetValue(object value)
        {
            if (value != null)
            {
                Type valueType = value.GetType();

                ////Avoid serialization for string datatype.
                if (valueType.Equals(typeof(string)))
                {
                    this.Value = (string)value;
                    return;
                }

                DataContractSerializer serializer = new DataContractSerializer(typeof(object), OperationParameter.KnownTypes);
                StringBuilder target = new StringBuilder();
                using (XmlWriter writer = XmlWriter.Create(target))
                {
                    serializer.WriteObject(writer, value);
                    writer.Flush();
                    this.Value = target.ToString();
                }
            }
        }

        public ExtensionDataObject ExtensionData { get; set; }
    }

    [DataContract(Namespace = Constants.ServiceManagementNS)]
    public class SubscriptionOperation : IExtensibleDataObject
    {
        [DataMember(Order = 0)]
        public string OperationId { get; set; }

        [DataMember(Order = 1)]
        public string OperationObjectId { get; set; }

        [DataMember(Order = 2)]
        public string OperationName { get; set; }

        [DataMember(Order = 3)]
        public OperationParameterList OperationParameters { get; set; }

        [DataMember(Order = 4)]
        public SubscriptionOperationCaller OperationCaller { get; set; }

        [DataMember(Order = 5)]
        public Operation OperationStatus { get; set; }

        [DataMember(Order = 7, EmitDefaultValue = false)]
        public string OperationStartedTime { get; set; }

        [DataMember(Order = 8, EmitDefaultValue = false)]
        public string OperationCompletedTime { get; set; }

        public ExtensionDataObject ExtensionData { get; set; }
    }

    [DataContract(Namespace = Constants.ServiceManagementNS)]
    public class Subscription : IExtensibleDataObject
    {
        [DataMember(Order = 0)]
        public string SubscriptionID { get; set; }

        [DataMember(Order = 1)]
        public string SubscriptionName { get; set; }

        [DataMember(Order = 2)]
        public string SubscriptionStatus { get; set; }

        [DataMember(Order = 3)]
        public string AccountAdminLiveEmailId { get; set; }

        [DataMember(Order = 4)]
        public string ServiceAdminLiveEmailId { get; set; }

        [DataMember(Order = 5)]
        public int MaxCoreCount { get; set; }

        [DataMember(Order = 6)]
        public int MaxStorageAccounts { get; set; }

        [DataMember(Order = 7)]
        public int MaxHostedServices { get; set; }

        [DataMember(Order = 8)]
        public int CurrentCoreCount { get; set; }

        [DataMember(Order = 9)]
        public int CurrentHostedServices { get; set; }

        [DataMember(Order = 10)]
        public int CurrentStorageAccounts { get; set; }

        [DataMember(Order = 11, EmitDefaultValue = false)]
        public int MaxVirtualNetworkSites { get; set; }

        [DataMember(Order = 12, EmitDefaultValue = false)]
        public int CurrentVirtualNetworkSites { get; set; }

        [DataMember(Order = 13, EmitDefaultValue = false)]
        public int MaxLocalNetworkSites { get; set; }

        [DataMember(Order = 14, EmitDefaultValue = false)]
        public int CurrentLocalNetworkSites { get; set; }

        [DataMember(Order = 15, EmitDefaultValue = false)]
        public int MaxDnsServers { get; set; }

        [DataMember(Order = 16, EmitDefaultValue = false)]
        public int CurrentDnsServers { get; set; }

        public ExtensionDataObject ExtensionData { get; set; }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 330626 $ -->

<refentry xml:id="function.cubrid-query" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>cubrid_query</refname>
  <refpurpose>Send a CUBRID query</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>resource</type><methodname>cubrid_query</methodname>
   <methodparam><type>string</type><parameter>query</parameter></methodparam>
   <methodparam choice="opt"><type>resource</type><parameter>conn_identifier</parameter></methodparam>
  </methodsynopsis>
  <para>
   <function>cubrid_query</function> sends a unique query (multiple queries are not supported) to the
   currently active database on the server that's associated with the specified <parameter>conn_identifier</parameter>.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>query</parameter></term>
     <listitem>
      <para>
       An SQL query
      </para>
      <para>
       Data inside the query should be <link linkend="function.cubrid-real-escape-string">properly escaped</link>.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>conn_identifier</parameter></term>
     <listitem>
      <para>
       The CUBRID connection. If the connection identifier is not specified,
       the last connection opened by <function>cubrid_connect</function> is
       assumed.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset,
   <function>cubrid_query</function> returns a <type>resource</type> on success, or &false; on error.
  </para>
  <para>
   For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc,
   <function>cubrid_query</function> returns &true; on success or &false; on error.
  </para>
  <para>
   The returned result resource should be passed to <function>cubrid_fetch_array</function>, and other
   functions for dealing with result tables, to access the returned data.
  </para>
  <para>
   Use <function>cubrid_num_rows</function> to find out how many rows were returned for a SELECT statement or
   <function>cubrid_affected_rows</function> to find out how many rows were affected by a DELETE, INSERT, REPLACE, or UPDATE statement.
  </para>
  <para>
   <function>cubrid_query</function> will also fail and return &false;
   if the user does not have permission to access the table(s) referenced by the query.
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title>Invalid Query</title>
    <para>
     The following query is syntactically invalid, so <function>cubrid_query</function> fails and returns &false;.
    </para>
    <programlisting role="php">
<![CDATA[
<?php
$conn = cubrid_connect('localhost', 33000, 'demodb');

$result = cubrid_query('SELECT * WHERE 1=1');
if (!$result) {
    die('Invalid query: ' . cubrid_error());
}

?>
]]>
    </programlisting>
   </example>
  </para>
  <para>
   <example>
    <title>Valid Query</title>
    <para>
     The following query is valid, so <function>cubrid_query</function> returns a <type>resource</type>.
    </para>
    <programlisting role="php">
<![CDATA[
<?php
// This could be supplied by a user, for example
$firstname = 'fred';
$lastname  = 'fox';

$conn = cubrid_connect('localhost', 33000, 'demodb');

cubrid_execute($conn,"DROP TABLE if exists friends");
cubrid_execute($conn,"create table friends(firstname varchar,lastname varchar,address char(24),age int)");
cubrid_execute($conn,"insert into friends values('fred','fox','home-1','20')");
cubrid_execute($conn,"insert into friends values('blue','cat','home-2','21')");
// Formulate Query
// This is the best way to perform an SQL query
// For more examples, see cubrid_real_escape_string()
$query = sprintf("SELECT firstname, lastname, address, age FROM friends WHERE firstname='%s' AND lastname='%s'",
cubrid_real_escape_string($firstname),
cubrid_real_escape_string($lastname));

// Perform Query
$result = cubrid_query($query);

// Check result
// This shows the actual query sent to CUBRID, and the error. Useful for debugging.
if (!$result) {
    $message  = 'Invalid query: ' . cubrid_error() . "\n";
    $message .= 'Whole query: ' . $query;
    die($message);
}

// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the cubrid result functions must be used
// See also cubrid_result(), cubrid_fetch_array(), cubrid_fetch_row(), etc.
while ($row = cubrid_fetch_assoc($result)) {
    echo $row['firstname'];
    echo $row['lastname'];
    echo $row['address'];
    echo $row['age'];
}

// Free the resources associated with the result set
// This is done automatically at the end of the script
cubrid_free_result($result);
?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>cubrid_connect</function></member>
    <member><function>cubrid_error</function></member>
    <member><function>cubrid_real_escape_string</function></member>
    <member><function>cubrid_result</function></member>
    <member><function>cubrid_fetch_assoc</function></member>
    <member><function>cubrid_unbuffered_query</function></member>
   </simplelist>
  </para>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
/*
 * @Date 04-02-2015
 * @Param from actions/UserAction userDetails
 * Author Accel Frontline@Cochin
 */

var AppDispatcher 	= 	require('../dispatcher/AppDispatcher');
var EventEmitter 	= 	require('events').EventEmitter;
var UserConstants 	= 	require('../constants/UserConstants');
var assign 			=	require('object-assign');
var fetchOp 		=   require('../RESTService/GET');

var users=[];
var CHANGE_EVENT = 'change';

var UserStore	=	 assign({}, EventEmitter.prototype, {

init : function(initialData){
   users = initialData ;
},
create : function(userDetails){

			var userAllDetail = [userDetails];
			var indexVal = users.length;
	 		users[indexVal] = {
								    "SINo": indexVal+1,
								    "First Name": userAllDetail[0].firstName,
								    "Last Name": userAllDetail[0].lastName,
								    "Employee ID": userAllDetail[0].employeeId,
								    "Employee Email": userAllDetail[0].userEmail,
								    "Action": userAllDetail[0].firstName
							  }

	fetchOp.employeeCreate(userAllDetail,function(data){});

	 },
userList : function(){
	  fetchOp.userGet(function(data){
		 return users = data;
		 });

	 return users;
	 },
userDelete:function(userDetails){

	userId = userDetails.Action;

	var arr = users;

			var removeByAttr = function(arr, attr, value){
				    var i = arr.length;
				    while(i--){
				       if( arr[i]
				           && arr[i].hasOwnProperty(attr)
				           && (arguments.length > 2 && arr[i][attr] === value ) ){

				           arr.splice(i,1);

				       }
				    }
		users=arr;
 		}

	removeByAttr(arr, 'Action', userId);
	fetchOp.projectDelete(userId,function(data){
 			users = data ;
     });

  },
userEdit:function(userDetails){
  			     fetchOp.employeeEdit(userDetails);
  			     console.log(userDetails);

  				 for (var i in users) {

  					 	 updatedUser =users[i];
   							  if (updatedUser['Employee ID'] == userDetails.employeeId) {

   							  		 updatedUser['First Name'] = userDetails.firstName;
      								 updatedUser['Last Name']= userDetails.lastName;

      		 }

  		 }

  },
userProjectAssign:function(userDetails){

		fetchOp.employeeProjectAssign(userDetails,function(data){});

},
emitChange: function() {
			    this.emit(CHANGE_EVENT);
  },
addChangeListener: function(callback) {
			    this.on(CHANGE_EVENT, callback);
  },
removeChangeListener: function(callback) {
			    this.removeListener(CHANGE_EVENT, callback);
  },

});

AppDispatcher.register(function(playload){

	 var action = playload.action;
	 var userDetails;

	 switch(action.actionType) {

	 		case UserConstants.USER_CREATE:
	 			 userDetails = action.UserDetails;
     	 		 UserStore.create(userDetails);
     	 		 UserStore.emitChange();
     	 	break;

	 		case UserConstants.USER_LIST:
	 	     	 UserStore.userList();
	 		break;

	 		case UserConstants.USER_DELETE:
	 			 userDetails = action.userDetails;
	 	    	 UserStore.userDelete(userDetails);
	 	    	 UserStore.emitChange();
	 	    	break;

	 	    case UserConstants.USER_EDIT:
	 	    		 userDetails = action.userDetails;
	 	    		 UserStore.userEdit(userDetails);
	 	    		 UserStore.emitChange();
	 	    	break;
	 	    case UserConstants.USER_PROJECT_ASSIGN:
	 	    		 userDetails = action.userDetails;
	 	    		 UserStore.userProjectAssign(userDetails);
	 	    		 UserStore.emitChange();
	 	    	break;
	 		default:
	 		break;
	 }

	 return true;
});

module.exports = UserStore;


text:
<?php

namespace LaravelPlus\Extension\Generators\Commands;

use Jumilla\Generators\Laravel\OneFileGeneratorCommand as BaseCommand;
use Jumilla\Generators\FileGenerator;
use LaravelPlus\Extension\Addons\Addon;
use LaravelPlus\Extension\Generators\GeneratorCommandTrait;

class EventMakeCommand extends BaseCommand
{
    use GeneratorCommandTrait;

    /**
     * The console command singature.
     *
     * @var string
     */
    protected $signature = 'make:event
        {name : The name of the class}
        {--a|addon= : The name of the addon}
    ';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '[+] Create a new event class';

    /**
     * The type of class being generated.
     *
     * @var string
     */
    protected $type = 'Event';

    /**
     * The constructor.
     */
    public function __construct()
    {
        parent::__construct();

        $this->setStubDirectory(__DIR__.'/../stubs');
    }

    /**
     * Get the default namespace for the class.
     *
     * @return string
     */
    protected function getDefaultNamespace()
    {
        return $this->getRootNamespace().'\\Events';
    }

    /**
     * Get the stub file for the generator.
     *
     * @return string
     */
    protected function getStub()
    {
        return 'event.stub';
    }

    /**
     * Generate file.
     *
     * @param \Jumilla\Generators\FileGenerator $generator
     * @param string $path
     * @param string $fqcn
     *
     * @return bool
     */
    protected function generateFile(FileGenerator $generator, $path, $fqcn)
    {
        list($namespace, $class) = $this->splitFullQualifyClassName($fqcn);

        return $generator->file($path)->template($this->getStub(), [
            'namespace' => $namespace,
            'root_namespace' => $this->getAppNamespace(),     // use App\Events\Event
            'class' => $class,
        ]);
    }
}


text:
package bonsai.examples.test;

import org.junit.Test;
import static org.junit.Assert.*;

import java.util.Set;
import java.util.HashSet;
import bonsai.examples.model.*;

import org.chocosolver.solver.*;
import org.chocosolver.solver.variables.*;
import org.chocosolver.solver.constraints.*;

import java.util.function.Consumer;

public class TestJunit {
   @Test

   public void testPeterson() {
     //build the model
     IModel model = new Model("PertersonProblem");
     Transition_System ts = ModelFactory.createPetersonExample(model);
     //caution !
     //System.out.println("****** start ******");
     //printModel((Model) model);

     //cmp loc & transition

     //** Initial states **//
     Set<Location> inits = new HashSet();
     Location li1 = ModelFactory.createLocation("init_1");
     Location li2 = ModelFactory.createLocation("init_2");
     Location lw1 = ModelFactory.createLocation("request_1");
     Location lw2 = ModelFactory.createLocation("request_2");
     Location le1 = ModelFactory.createLocation("end_1");
     Location le2 = ModelFactory.createLocation("end_2");

     Location lunlock = ModelFactory.createLocation("unlock");
     Location llock = ModelFactory.createLocation("lock");
     inits.add(li1);
     inits.add(li2);
     inits.add(lunlock);

     //assertEquals(true, ts.getCurrentStates().equals(inits)); same
     assertTrue(ts.getCurrentStates().equals(inits));
     assertTrue(0 == ((Model) model).getNbCstrs()); //test constraints (from guard)

     //** First post **//
     Set<Transition> expectedTrs = new HashSet();
     // Create transitions used several times (we cannot add twice a same transition in a location)
     Transition choosed_one = ModelFactory.createTransition(li1, null/*if*/, null, null, lw1);
     Transition tiw2 = ModelFactory.createTransition(li2, null/*if*/, null, null, lw2);
     Transition tie2 = ModelFactory.createTransition(li2, null/*if*/, null, null, le2);
     expectedTrs.add(choosed_one); //to request
     expectedTrs.add(tiw2);
     expectedTrs.add(ModelFactory.createTransition(li1, null/*if*/, null, null, le1)); //to end
     expectedTrs.add(tie2);

     Set<Transition> actualTrs = ts.post();

     //test2
     //System.out.println("test2: " + actualTrs.toString() + " and " + expectedTrs.toString());
     assertTrue(actualTrs.equals(expectedTrs));
     //System.out.println(ts.toString());

     //test3 apply
     try
     {
       actualTrs = ts.apply(choosed_one, model);
     } catch (NotEnabled_exp e) {assertTrue(false);}
     assertTrue(null == actualTrs); //test locations
     assertTrue(1 == ((Model) model).getNbCstrs()); //test constraints (from guard)

     //System.out.println("****** first apply ******");
     //printModel((Model) model);

     //test4 post again
     Location lc1 = ModelFactory.createLocation("crit_1");

     expectedTrs = new HashSet();
     Transition choosed_two = ModelFactory.createTransition(lw1, null, null, null, lc1);
     expectedTrs.add(choosed_two);  //to critic
     expectedTrs.add(tiw2); //to request
     expectedTrs.add(tie2); //to end

     //System.out.println(ts.toString());
     actualTrs = ts.post();

     //System.out.println("test4: " + actualTrs.toString() + " and " + expectedTrs.toString());
     assertTrue(actualTrs.equals(expectedTrs));

     //test 5
     //apply a sync-transition (should return the set of complementary tr.)
     try
     {
       actualTrs = ts.apply(choosed_two, model);
     } catch (NotEnabled_exp e) {assertTrue(false);}
     assert(null == actualTrs); //it is null since just one solution is possible (sync-tr)

     //test 6 locations
     Set<Location> expectedLocations = new HashSet();
     expectedLocations.add(li2);   //init_2
     expectedLocations.add(lc1);   //critic_1
     expectedLocations.add(llock); //lock

     assertTrue(ts.getCurrentStates().equals(expectedLocations));

     //test 7 effect (x++)
     Location lrel1 = ModelFactory.createLocation("release_1");

     expectedTrs = new HashSet();
     Transition choosed_three = ModelFactory.createTransition(lc1, null, null, null, lrel1);
     expectedTrs.add(choosed_three);  //to incr
     expectedTrs.add(tiw2);           //to request
     expectedTrs.add(tie2);           //to end

     //System.out.println(ts.toString());
     actualTrs = ts.post();

     //System.out.println("test4: " + actualTrs.toString() + " and " + expectedTrs.toString());
     assertTrue(actualTrs.equals(expectedTrs));

     // test 8 apply
     try
     {
       actualTrs = ts.apply(choosed_three, model);
     } catch (NotEnabled_exp e) {assertTrue(false);}
     assert(null == actualTrs); //it is null (tau-tr)
     assertTrue(2 == ((Model) model).getNbCstrs()); //test constraints (from guard)

     //test 9 locations
     expectedLocations = new HashSet();
     expectedLocations.add(li2);      //init_2
     expectedLocations.add(lrel1);    //release_1
     expectedLocations.add(llock);    //lock

     assertTrue(ts.getCurrentStates().equals(expectedLocations));

     System.out.println("****** end ******");
     printModel((Model) model);

     System.out.println("We pass !");
   }

   /**
     Auxiliary debug functions
   **/
   public static void printModel(Model model)
   {
     //constraints
     System.out.println("~~~ ~~~ constraints");
     Consumer<Model> CtrPrint = (Model m) -> {
       System.out.print(m.getNbCstrs()+ ": ");
       for(Constraint c : m.getCstrs()) {System.out.print(c.toString() + " ");}
       System.out.print("\n");
     };
     CtrPrint.accept(model);

     //variables
     System.out.println("~~~ ~~~ vars");
     Consumer<Model> VarPrint = (Model m) -> {
       System.out.print(m.getNbVars()+ ": ");
       for(Variable v : m.getVars()) {System.out.print(v.getName() + " ");}
       System.out.print("\n");
     };
     VarPrint.accept(model);
   }
}


text:
<?php

namespace AppBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\Type;

class AppBundle extends Bundle
{
    public function boot()
    {
        $em = $this->container->get('doctrine.orm.entity_manager');

        // Ajout des nouveaux types à notre entity manager
        Type::addType('json', 'AppBundle\Types\JsonType');
        $em->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('json', 'json');
    }
}


text:
package com.github.rosmith.service.logic;

import java.lang.reflect.Constructor;
import java.util.concurrent.Future;

/**
 * @author Ronald Smith, Djomkam Yotedje
 */
public abstract class LogicServer extends Logic<Future<Object>, Object, Object> {

	protected static Logic<Future<Object>, Object, Object> logic;

	private static Class<? extends LogicServer> clzz;

	public static void setSingletonClass(Class<? extends LogicServer> clzz){
		LogicServer.clzz = clzz;
	}

	public static Logic<Future<Object>, Object, Object> singleton(){
		if(logic == null){
			verifyClassIsNotNull();
			try {
				Constructor<? extends LogicServer> constructor = clzz.getDeclaredConstructor();
				constructor.setAccessible(true);
				logic = constructor.newInstance();
			} catch (Exception e) {
				logic = null;
			}
		}
		return logic;
	}

	private static void verifyClassIsNotNull() {
		if(clzz == null) {
			clzz = DefaultLogicServer.class;
		}
	}

}


text:
require "rails_helper"

RSpec.describe Atoms::Event::Click, type: :model  do
  describe "when executing" do
    xit "can click" do
      raise TODO
    end
  end
end


text:
package com.kaltiz.cc.command.commands;

import com.kaltiz.cc.CharacterCards;
import com.kaltiz.cc.character.RpChar;
import com.kaltiz.cc.command.BasicCommand;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class UnsetFieldCommand extends BasicCommand
{
    public UnsetFieldCommand(CharacterCards plugin)
    {
        super(plugin, "cc unset");
        description = "Unset a field";
        usage = "/cc unset <field>";
        minArgs = 1;
        maxArgs = 1;
        aliases = new String[] {"cc unset"};
        permission = "cc.command.unset";
    }

    @Override
    public boolean execute(CommandSender sender, String cmd, String[] args)
    {
        if (!(sender instanceof Player)) {
            return false;
        }

        if (!this.plugin.getCharacterManager().getFields().containsKey(args[0]))
        {
            sender.sendMessage("The Field `" + args[0] + "` does not exist");
            return true;
        }

        RpChar playerChar = plugin.getCharacterManager().getCharacter(sender.getName());
        if (playerChar == null) return true;

        playerChar.removeField(args[0]);
        sender.sendMessage("Field Removed!");

        return true;
    }
}


text:
* [BUGFIX] No longer requires global ember-cli

### 0.1.0-beta.1
* [FEATURE] Added an `sane install` command that allows to install addons such as `sane install sane-auth`. More details on how to write addons comming soon! In the mean-time check out https://github.com/sane/sane-auth/
* [BREAKING BUGFIX] Only supports ember-cli 0.2.3 and above for the addon system
* [ENHANCEMENT] Switched to `enpeem` module
* [ENHANCEMENT] Switch to babeljs for better debugging statements.
* [BUGFIX] Fixed installTest
* [BUGFIX] Added logic to ensure case of resources generated through `sane generate` https://github.com/artificialio/sane/pull/143
* [ENHANCEMENT] Added [eslint](http://eslint.org/) through [mocha-eslint](https://github.com/BadgeLabs/mocha-eslint)
* [BUGFIX] Fixed docker root issue for linux
* [ENHANCEMENT] Added stack trace to errors in `sane new`
* [ENHANCEMENT] Use master version of [sails-hook-dev](https://github.com/balderdashy/sails-hook-dev) since `1.0.0` runs into issues on Linux
* [BUGFIX] Enabled SANE to run without requiring a global ember-cli installation.

### 0.1.0-alpha.7
* [ENHANCEMENT] Switched from traceur to babeljs for better error messages
* [ENHANCEMENT] Added diffing support to file generator
* [BUGFIX] Fixed error with npmInstall

### 0.0.24
* [FEATURE] Added autoreload of sails server using [sails-hook-autoreload](https://github.com/sgress454/sails-hook-autoreload) hook
* [ENHANCEMENT] Added [sails-hook-dev](https://github.com/balderdashy/sails-hook-dev) and removed morgan request logging.
* [ENHANCEMENT] Bumped lodash to latest `3.x` version because of latest blueprints.
* [BUGFIX] Improved `sane new` command in certain edge cases
* [BUGFIX] Fixed a sails response bug that view is missing.
* [BUGFIX] Fixed errors in `sane new --skip-npm`.
* [BUGFIX] Fixed tests on Windows and AppVeyor.
* [BUGFIX] Full Windows support.
* [ENHANCEMENT] Changed to using `expect` instead of `assert` from chai module to match ember-cli [commit 2435679](https://github.com/ember-cli/ember-cli/commit/24356790ba1a6aead425c8bddfd96f6cb06ab1cb).
* [FEATURE] Added sane install command that installs any sane addons published on npm with a 'sane-addon' keyword. These addons can add custom generators that are automatically tun by the install command.

### 0.0.23
* [BUGFIX] Fixed ember-cli version check on `sane new`.

### 0.0.22
* [BUGFIX] Reverted a planned windows change which fixed `sane up` on Mac/Linus

### 0.0.21
* [BUGFIX] Fixed `cleanupSails()` procedure when creating a new project.
* [BUGFIX] Installing `sane-cli` now locally on new project creation.

### 0.0.20
* [BUGFIX] Forgot a change to `superspawn` to fix the windows issues.

### 0.0.19
* [BUGFIX] Changed to `superspawn` to fix issues on windows

### 0.0.18
* [FEATURE] Added support for local sane-cli (so you can have a fixed sane-cli per project)
* [ENHANCEMENT] Improved boot2docker running check
* [BUGFIX] explicit `sane up --docker=false` now working
* [ENHANCEMENT] No analytics for tests anymore by adding undocumented `--skip-analytics` flag
* [BUGFIX] Fixed installation for certain Unix platforms
* [BUGFIX] Fixed installation for Windows: Traceur was not loading modules properly.
* [BUGFIX] Fixed sails assets path for usage without grunt
* [ENHANCEMENT] Creating a new project now cleans up Sails to be API only (still including assets folder for easy deployment)

### 0.0.17
* [ENHANCEMENT] Update `leek` version which improves start-up time for commands that don't use tracking.
* [FEATURE] Added redis support.
* [FEATURE] Added `--skip-sails` and `--skip-ember flags to the `up` command, if you want to only start the backend or frontend server.

### 0.0.16

* [BUGFIX] Fixed bug with `sane new` not working without `--docker`
* [BUGFIX] Possibly fixing the EHOSTUNREACH issue.

### 0.0.15
* [BUGFIX] Fixed some bug with `sails-disk`
* [BUGFIX] Fixed a bug with `sane up`, using local install as well as recognizing a changed client folder
* [BUGFIX] Showing the right `sails version` when running `sane new` with docker

### 0.0.14
* [FEATURE] Added [https://github.com/expressjs/morgan](morgan) hook to sails app so each http request gets logged
* [FEATURE] Added `sane new --skip-npm --skip-bower` flags to skip npm and bower installation.
* [FEATURE] You can now rename your client/server folders, by renaming them and then adding the new name to your .sane-cli `apps`. See Docs for details
* [FEATURE] Added `--verbose` flag for `sane up`, which displays additional `boot2docker` output, only on windows & mac
* [BREAKING ENHANCEMENT] On windows and mac your sails-container-server gets automatically forwarded to localhost. Right now only supports the fixed 1337 porty. Removed the `--port-forward/-p` flag.
* [ENHANCEMENT] `pod` option is now supported in your `.sane-cli`
* [BUGFIX] Changed tracking code to an GA App
* [BREAKING BUGFIX] For consistency the short version of the `--docker` flag is now `-D` for all commands

### 0.0.13
* [ENHANCEMENT] Updated `fs-extra` to 0.13.0
* [ENHANCEMENT] Switched again to `traceur` so no compilation step is needed.
* [FEATURE] Added new feature behind `sane up -p` flag, to forward docker IP to localhost (using boot2docker).

### 0.0.12
* [BUGFIX] Fixed `sane generate resource` command.

### 0.0.11
* [BUGFIX] Fixed & improved database setup and config
* [ENHANCEMENT] Switched to [traceur](https://github.com/google/traceur-compiler) for easier development and fewer dependencies
* [ENHANCEMENT] Disabled grunt hook for sails per default which should reduce CPU usage
* [ENHANCEMENT] Added package.json to root folder, preparing for having a local sane-cli in the future
* [ENHANCEMENT] Added .editorconfig for better development consistency
* [FEATURE] Added `--live-reload` option to `sane up` to proxy through to `ember-cli`
* [ENHANCEMENT] Added anonymous google analytics tracking for sane-cli usage that can be disabled in the .sane-cli via the `disableAnalytics` option

### 0.0.10
* [BUGFIX] fixed missing comma in connections.js

### 0.0.9
* [ENHANCEMENT] Updated [es6-shim](https://github.com/paulmillr/es6-shim) to 0.21.0
* [BUGFIX] Fixed setup of blueprints for ember-data, as well as the right database adapter. Would recommend to setup the project new, or run the following commands in the `server` folder: `npm i sails-generate-ember-blueprints --save`, `npm i lodash --save`, `npm i pluralize --save`, `sails generate ember-blueprints` and depending on your database: `npm i --save sails-mongo`

### 0.0.8
* [ENHANCEMENT] Made installation of Docker optional to get quick dev setup running.
* [FEATURE] Added basic `sane up` command. To start with docker add `--docker` flag
* [FEAURE] Added possibility to add a .sane-cli in your project root and/or home directory so you don't have to specifiy cli options such as --docker with each command
* [FEAURE] Added `sane generate resource name attribue:type` command, to add models on the frontend as well as the backend
* [ENHANCEMENT] Now showing proper docker ip on `sane up --docker`
* [ENHANCEMENT] Now showing better log output when setting up new project.
* [BUGFIX] Does not create git repo within client folder anymore

### 0.0.6
* [ENHANCEMENT] Updated [commander.js](https://github.com/tj/commander.js) to 2.5.0
* [FEATURE] added `--verbose` flag to `sane new` command to display more output for debugging purposes
* [BUGFIX] Fixed an issue that the setup would never complete if no db (or disk) was given

### 0.0.5
* [ENHANCEMENT] Added pleasent-progress for better output of setup progress [#11](https://github.com/artificialio/sane/issues/11)

### 0.0.4

* [ENHANCEMENT] Changed to new, smaller and tagged docker container.
* [FEATURE] You can now specify latest or stable node versions in the fig.yml, as well as a fixed 0.10.32

### 0.0.3

* [FEATURE] added a basic CLI that can set up a Sails Container with Fig and a separate ember project, linking them together.


text:
using System;
using System.Reflection;
using WebApiHypermediaExtensionsCore.Exceptions;
using WebApiHypermediaExtensionsCore.Query;
using WebApiHypermediaExtensionsCore.WebApi.RouteResolver;

namespace WebApiHypermediaExtensionsCore.Hypermedia.Links
{
    public abstract class HypermediaObjectReferenceBase
    {
        protected readonly Type HypermediaObjectType;

        protected HypermediaObjectReferenceBase(Type hypermediaObjectType)
        {
            if (!typeof(HypermediaObject).IsAssignableFrom(hypermediaObjectType))
            {
                throw new HypermediaException($"Type does not derive from {typeof(HypermediaObject)}.");
            }

            this.HypermediaObjectType = hypermediaObjectType;
        }

        /// <summary>
        ///  Indicates if this reference can be resolved to a instance.
        /// </summary>
        public abstract bool CanResolve();

        /// <summary>
        /// Derived classes may choose to return the actual referenced <see cref="HypermediaObject"/>
        /// </summary>
        /// <returns></returns>
        public abstract HypermediaObject GetInstance();

        /// <summary>
        ///  Indicates if this reference is backed by a instance.
        /// </summary>
        public abstract bool IsResolved();

        /// <summary>
        ///  Creates a object which can be used as key for the referenced.
        /// </summary>
        /// <param name="keyProducer"></param>
        /// <returns>The key object to this <see cref="HypermediaObject"/> or null if it has no key.</returns>
        public abstract object GetKey(IKeyProducer keyProducer);

        /// <summary>
        /// Return a related query object. Null if none is related.
        /// </summary>
        /// <returns></returns>
        public abstract IHypermediaQuery GetQuery();

        /// <summary>
        /// Get the referenced <see cref="HypermediaObject"/> type
        /// </summary>
        /// <returns>Referenced Type</returns>
        public Type GetHypermediaType()
        {
            return this.HypermediaObjectType;
        }
    }
}


text:
<!DOCTYPE HTML>

<html manifest="{name}.manifest">
	<head>
		<title>{name}</title>
		<script type="text/javascript">
			document.write('<link rel="apple-touch-startup-image" href="assets/startup'+(navigator.platform=='iPad'?'_ipad':'')+'.jpg">');
		</script>
		<link rel="apple-touch-icon" href="assets/icon.png"/>
		<link rel="shortcut icon" href="assets/icon.png"/>
	</head>
	<body>
		<script type="text/javascript">
			(function(name, firstFunc){
				function getObjectByName(name, opt_obj) {
					var parts = name.split('.');
					var cur = opt_obj || window;
					var part;
					while (part = parts.shift()) {
						if (cur[part]) {
							cur = cur[part];
						} else {
							return null;
						}
					}
					return cur;
				};
				function loadJS(call){
					var script = document.createElement('script');
					script.setAttribute('type','text/javascript');
					script.setAttribute('src',name);
					script.onload = function(){
						(getObjectByName(firstFunc))();
						call();
					};
					document.getElementsByTagName('head')[0].appendChild(script);
				};
				var webappCache = window.applicationCache;
				if(webappCache){
					var WIDTH = 200, HEIGHT = 100;
					var scripts = document.getElementsByTagName('script');
					var script = scripts[scripts.length - 1];
					var el = document.createElement('div');
					var parent = script.parentNode;
					if(parent.style.position!='absolute' && parent.style.position!='relative'){
						parent.style.cssText = 'relative';
					}
					var pwidth = window.innerWidth;
					var pheight = window.innerHeight;
					el.style.cssText = 'text-align:center;width:'+WIDTH+'px;height:'+HEIGHT+'px;position:absolute;left:'+Math.round((pwidth-WIDTH)*.5)+'px;top:'+Math.round((pheight-HEIGHT)*.5)+'px';
					script.parentNode.insertBefore(el,script);
					script.parentNode.removeChild(script);
					var started = false;
					var lastProgress = new Date
					var timeout;
					function init(){
						if(started) return;
						el.innerHTML = '';
						loadJS(function(){ el.parentNode.removeChild(el); });
						started = true;
						clearTimeout(timeout);
					};
					function timeoutFunc() {
						if (new Date - lastProgress > 3000) {
							init()
						} else {
							lastProgress = new Date
							timeout = setTimeout(timeoutFunc, 3000)
						}
					};
					timeoutFunc();
					webappCache.addEventListener('checking', function(){
						el.innerHTML = 'Initializing...';
					}, false);
					webappCache.addEventListener('cached', function(){
						init();
					}, false);
					webappCache.addEventListener('noupdate', function(){
						init();
					}, false);
					webappCache.addEventListener('updateready', function(){
						//webappCache.swapCache();
						window.location.reload()
					}, false);
					webappCache.addEventListener('progress', function(e){
						lastProgress = new Date
						var message = 'Loading... ';
						if(typeof e.loaded !== "undefined" && typeof e.total !== "undefined") {
							message += Math.round(e.loaded / e.total * 100) + '%';
						}
						el.innerHTML = message;
					}, false);
					webappCache.addEventListener('obsolete', function(){
						init();
					}, false);
					webappCache.addEventListener('error', function(e){
						init();
					}, false);
				} else {
					loadJS(function(){});
				}
			})('{name}.js','{callback}');
		</script>
	</body>
</html>


text:
"""Wrappers for protocol buffer enum types."""

import enum

class AnnotationSentiment(enum.IntEnum):
    """
    Attributes:
      ANNOTATION_SENTIMENT_UNSPECIFIED (int)
      NEGATIVE (int): This annotation describes negatively about the data.
      POSITIVE (int): This label describes positively about the data.
    """

    ANNOTATION_SENTIMENT_UNSPECIFIED = 0
    NEGATIVE = 1
    POSITIVE = 2

class AnnotationSource(enum.IntEnum):
    """
    Specifies where is the answer from.

    Attributes:
      ANNOTATION_SOURCE_UNSPECIFIED (int)
      OPERATOR (int): Answer is provided by a human contributor.
    """

    ANNOTATION_SOURCE_UNSPECIFIED = 0
    OPERATOR = 3

class AnnotationType(enum.IntEnum):
    """
    Attributes:
      ANNOTATION_TYPE_UNSPECIFIED (int)
      IMAGE_CLASSIFICATION_ANNOTATION (int): Classification annotations in an image.
      IMAGE_BOUNDING_BOX_ANNOTATION (int): Bounding box annotations in an image.
      IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION (int): Oriented bounding box. The box does not have to be parallel to horizontal
      line.
      IMAGE_BOUNDING_POLY_ANNOTATION (int): Bounding poly annotations in an image.
      IMAGE_POLYLINE_ANNOTATION (int): Polyline annotations in an image.
      IMAGE_SEGMENTATION_ANNOTATION (int): Segmentation annotations in an image.
      VIDEO_SHOTS_CLASSIFICATION_ANNOTATION (int): Classification annotations in video shots.
      VIDEO_OBJECT_TRACKING_ANNOTATION (int): Video object tracking annotation.
      VIDEO_OBJECT_DETECTION_ANNOTATION (int): Video object detection annotation.
      VIDEO_EVENT_ANNOTATION (int): Video event annotation.
      TEXT_CLASSIFICATION_ANNOTATION (int): Classification for text.
      TEXT_ENTITY_EXTRACTION_ANNOTATION (int): Entity extraction for text.
      GENERAL_CLASSIFICATION_ANNOTATION (int): General classification.
    """

    ANNOTATION_TYPE_UNSPECIFIED = 0
    IMAGE_CLASSIFICATION_ANNOTATION = 1
    IMAGE_BOUNDING_BOX_ANNOTATION = 2
    IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION = 13
    IMAGE_BOUNDING_POLY_ANNOTATION = 10
    IMAGE_POLYLINE_ANNOTATION = 11
    IMAGE_SEGMENTATION_ANNOTATION = 12
    VIDEO_SHOTS_CLASSIFICATION_ANNOTATION = 3
    VIDEO_OBJECT_TRACKING_ANNOTATION = 4
    VIDEO_OBJECT_DETECTION_ANNOTATION = 5
    VIDEO_EVENT_ANNOTATION = 6
    TEXT_CLASSIFICATION_ANNOTATION = 8
    TEXT_ENTITY_EXTRACTION_ANNOTATION = 9
    GENERAL_CLASSIFICATION_ANNOTATION = 14

class DataType(enum.IntEnum):
    """
    Attributes:
      DATA_TYPE_UNSPECIFIED (int)
      IMAGE (int)
      VIDEO (int)
      TEXT (int)
      GENERAL_DATA (int)
    """

    DATA_TYPE_UNSPECIFIED = 0
    IMAGE = 1
    VIDEO = 2
    TEXT = 4
    GENERAL_DATA = 6

class StringAggregationType(enum.IntEnum):
    """
    Attributes:
      STRING_AGGREGATION_TYPE_UNSPECIFIED (int)
      MAJORITY_VOTE (int): Majority vote to aggregate answers.
      UNANIMOUS_VOTE (int): Unanimous answers will be adopted.
      NO_AGGREGATION (int): Preserve all answers by crowd compute.
    """

    STRING_AGGREGATION_TYPE_UNSPECIFIED = 0
    MAJORITY_VOTE = 1
    UNANIMOUS_VOTE = 2
    NO_AGGREGATION = 3

class EvaluationJob(object):
    class State(enum.IntEnum):
        """
        State of the job.

        Attributes:
          STATE_UNSPECIFIED (int)
          SCHEDULED (int)
          RUNNING (int)
          PAUSED (int)
          STOPPED (int)
        """

        STATE_UNSPECIFIED = 0
        SCHEDULED = 1
        RUNNING = 2
        PAUSED = 3
        STOPPED = 4

class LabelImageRequest(object):
    class Feature(enum.IntEnum):
        """
        Image labeling task feature.

        Attributes:
          FEATURE_UNSPECIFIED (int)
          CLASSIFICATION (int): Label whole image with one or more of labels.
          BOUNDING_BOX (int): Label image with bounding boxes for labels.
          ORIENTED_BOUNDING_BOX (int): Label oriented bounding box. The box does not have to be parallel to
          horizontal line.
          BOUNDING_POLY (int): Label images with bounding poly. A bounding poly is a plane figure that
          is bounded by a finite chain of straight line segments closing in a loop.
          POLYLINE (int): Label images with polyline. Polyline is formed by connected line segments
          which are not in closed form.
          SEGMENTATION (int): Label images with segmentation. Segmentation is different from bounding
          poly since it is more fine-grained, pixel level annotation.
        """

        FEATURE_UNSPECIFIED = 0
        CLASSIFICATION = 1
        BOUNDING_BOX = 2
        ORIENTED_BOUNDING_BOX = 6
        BOUNDING_POLY = 3
        POLYLINE = 4
        SEGMENTATION = 5

class LabelTextRequest(object):
    class Feature(enum.IntEnum):
        """
        Text labeling task feature.

        Attributes:
          FEATURE_UNSPECIFIED (int)
          TEXT_CLASSIFICATION (int): Label text content to one of more labels.
          TEXT_ENTITY_EXTRACTION (int): Label entities and their span in text.
        """

        FEATURE_UNSPECIFIED = 0
        TEXT_CLASSIFICATION = 1
        TEXT_ENTITY_EXTRACTION = 2

class LabelVideoRequest(object):
    class Feature(enum.IntEnum):
        """
        Video labeling task feature.

        Attributes:
          FEATURE_UNSPECIFIED (int)
          CLASSIFICATION (int): Label whole video or video segment with one or more labels.
          OBJECT_DETECTION (int): Label objects with bounding box on image frames extracted from the video.
          OBJECT_TRACKING (int): Label and track objects in video.
          EVENT (int): Label the range of video for the specified events.
        """

        FEATURE_UNSPECIFIED = 0
        CLASSIFICATION = 1
        OBJECT_DETECTION = 2
        OBJECT_TRACKING = 3
        EVENT = 4


text:
var _ = require('lodash');
var User = require('../models/user');

exports.hasToken = function(req, res, next) {

    if (!req.get('X-K-Authorization')) {
        res.send(401, "Unauthorized");
        return;
    }
    var token = req.get('X-K-Authorization');

    User.findOne({
        token: token.replace('Bearer ', '')
    }, function(err, user) {
        if (err) return next(err);
        if (!user) return res.send(401, "Unauthorized");
        req.user = user;
        next();
    });

    // res.redirect('/');
};

function fullfilesRole(roles, user, params){
    if(_.isEmpty(roles)) return true;
    if (_.isArray(roles)) {
        return _.contains(roles, user.role) || ( _.contains(roles,'$self') && (user._id.toString()===params.id || user._id.toString()===params.uid) );
    }
    var role = _.find(roles.roles, {role:user.role});
    // console.log(role);
    if(!role) return false;
    if(role.all) return true;
    // console.log(user[role.in], params.id);
    return _.some(user[role.in], function(id){ return id.toString()===params.id;});
}

// requiering a role will also require that a user is logged in
exports.requireRole = function(roles) {
    return function(req, res, next) {
        if (req.user && _.contains(roles, req.user.role))
            next();
        else if (!req.get('X-K-Authorization')) {
            res.send(401, "Unauthorized");
            return;
        }
        var token = req.get('X-K-Authorization');

        User.findOne({
            token: token.replace('Bearer ', '')
        }, function(err, user) {
            // console.log(err, roles, user.role, (roles&& _.contains(roles,user.role)), _.contains(roles,'self'));
            // user && console.log(_.contains(roles,'$self'),user._id,req.params.id,user._id.equals(req.params.id));
            if (err) return next(err);
            if  (!user || !fullfilesRole(roles, user, req.params))
            {
                return res.send(401, "Unauthorized");
            }
            req.user = user;
            next();
        });

        // res.redirect('/');
    };
};

/**
 * checks if id is in one of the users relationship array
 * eg. an id should be in his trials
 * @param  {String} attrs     the relationship to look for the id in
 */
exports.requireIn = function (attrs) {
    return function(req,res,next) {
        if(_.find(req.user[attrs], function(id){ return id.toString()===params.id;})) return next();
        res.send(401, "Unauthorized");
    };
};


text:
using MahApps.Metro.Controls;

namespace OuiGui.WPF
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : MetroWindow
    {
        public MainWindow()
        {
            InitializeComponent();
        }
    }
}


text: resultados.html


text:
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

using System;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("Microsoft.Owin.Security.Google")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
[assembly: NeutralResourcesLanguage("en-US")]


text:
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// 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.

using System;
using System.Collections.Generic;
using System.Windows;
using ICSharpCode.NRefactory.Editor;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Editing;

namespace ICSharpCode.AvalonEdit.Snippets
{
	/// <summary>
	/// Represents the context of a snippet insertion.
	/// </summary>
	public class InsertionContext : IWeakEventListener
	{
		enum Status
		{
			Insertion,
			RaisingInsertionCompleted,
			Interactive,
			RaisingDeactivated,
			Deactivated
		}

		Status currentStatus = Status.Insertion;

		/// <summary>
		/// Creates a new InsertionContext instance.
		/// </summary>
		public InsertionContext(TextArea textArea, int insertionPosition)
		{
			if (textArea == null)
				throw new ArgumentNullException("textArea");
			this.TextArea = textArea;
			this.Document = textArea.Document;
			this.SelectedText = textArea.Selection.GetText();
			this.InsertionPosition = insertionPosition;
			this.startPosition = insertionPosition;

			DocumentLine startLine = this.Document.GetLineByOffset(insertionPosition);
			ISegment indentation = TextUtilities.GetWhitespaceAfter(this.Document, startLine.Offset);
			this.Indentation = Document.GetText(indentation.Offset, Math.Min(indentation.EndOffset, insertionPosition) - indentation.Offset);
			this.Tab = textArea.Options.IndentationString;

			this.LineTerminator = TextUtilities.GetNewLineFromDocument(this.Document, startLine.LineNumber);
		}

		/// <summary>
		/// Gets the text area.
		/// </summary>
		public TextArea TextArea { get; private set; }

		/// <summary>
		/// Gets the text document.
		/// </summary>
		public ICSharpCode.AvalonEdit.Document.TextDocument Document { get; private set; }

		/// <summary>
		/// Gets the text that was selected before the insertion of the snippet.
		/// </summary>
		public string SelectedText { get; private set; }

		/// <summary>
		/// Gets the indentation at the insertion position.
		/// </summary>
		public string Indentation { get; private set; }

		/// <summary>
		/// Gets the indentation string for a single indentation level.
		/// </summary>
		public string Tab { get; private set; }

		/// <summary>
		/// Gets the line terminator at the insertion position.
		/// </summary>
		public string LineTerminator { get; private set; }

		/// <summary>
		/// Gets/Sets the insertion position.
		/// </summary>
		public int InsertionPosition { get; set; }

		readonly int startPosition;
		ICSharpCode.AvalonEdit.Document.AnchorSegment wholeSnippetAnchor;
		bool deactivateIfSnippetEmpty;

		/// <summary>
		/// Gets the start position of the snippet insertion.
		/// </summary>
		public int StartPosition {
			get {
				if (wholeSnippetAnchor != null)
					return wholeSnippetAnchor.Offset;
				else
					return startPosition;
			}
		}

		/// <summary>
		/// Inserts text at the insertion position and advances the insertion position.
		/// This method will add the current indentation to every line in <paramref name="text"/> and will
		/// replace newlines with the expected newline for the document.
		/// </summary>
		public void InsertText(string text)
		{
			if (text == null)
				throw new ArgumentNullException("text");
			if (currentStatus != Status.Insertion)
				throw new InvalidOperationException();

			text = text.Replace("\t", this.Tab);

			using (this.Document.RunUpdate()) {
				int textOffset = 0;
				SimpleSegment segment;
				while ((segment = NewLineFinder.NextNewLine(text, textOffset)) != SimpleSegment.Invalid) {
					string insertString = text.Substring(textOffset, segment.Offset - textOffset)
						+ this.LineTerminator + this.Indentation;
					this.Document.Insert(InsertionPosition, insertString);
					this.InsertionPosition += insertString.Length;
					textOffset = segment.EndOffset;
				}
				string remainingInsertString = text.Substring(textOffset);
				this.Document.Insert(InsertionPosition, remainingInsertString);
				this.InsertionPosition += remainingInsertString.Length;
			}
		}

		Dictionary<SnippetElement, IActiveElement> elementMap = new Dictionary<SnippetElement, IActiveElement>();
		List<IActiveElement> registeredElements = new List<IActiveElement>();

		/// <summary>
		/// Registers an active element. Elements should be registered during insertion and will be called back
		/// when insertion has completed.
		/// </summary>
		/// <param name="owner">The snippet element that created the active element.</param>
		/// <param name="element">The active element.</param>
		public void RegisterActiveElement(SnippetElement owner, IActiveElement element)
		{
			if (owner == null)
				throw new ArgumentNullException("owner");
			if (element == null)
				throw new ArgumentNullException("element");
			if (currentStatus != Status.Insertion)
				throw new InvalidOperationException();
			elementMap.Add(owner, element);
			registeredElements.Add(element);
		}

		/// <summary>
		/// Returns the active element belonging to the specified snippet element, or null if no such active element is found.
		/// </summary>
		public IActiveElement GetActiveElement(SnippetElement owner)
		{
			if (owner == null)
				throw new ArgumentNullException("owner");
			IActiveElement element;
			if (elementMap.TryGetValue(owner, out element))
				return element;
			else
				return null;
		}

		/// <summary>
		/// Gets the list of active elements.
		/// </summary>
		public IEnumerable<IActiveElement> ActiveElements {
			get { return registeredElements; }
		}

		/// <summary>
		/// Calls the <see cref="IActiveElement.OnInsertionCompleted"/> method on all registered active elements
		/// and raises the <see cref="InsertionCompleted"/> event.
		/// </summary>
		/// <param name="e">The EventArgs to use</param>
		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate",
		                                                 Justification="There is an event and this method is raising it.")]
		public void RaiseInsertionCompleted(EventArgs e)
		{
			if (currentStatus != Status.Insertion)
				throw new InvalidOperationException();
			if (e == null)
				e = EventArgs.Empty;

			currentStatus = Status.RaisingInsertionCompleted;
			int endPosition = this.InsertionPosition;
			this.wholeSnippetAnchor = new AnchorSegment(Document, startPosition, endPosition - startPosition);
			TextDocumentWeakEventManager.UpdateFinished.AddListener(Document, this);
			deactivateIfSnippetEmpty = (endPosition != startPosition);

			foreach (IActiveElement element in registeredElements) {
				element.OnInsertionCompleted();
			}
			if (InsertionCompleted != null)
				InsertionCompleted(this, e);
			currentStatus = Status.Interactive;
			if (registeredElements.Count == 0) {
				// deactivate immediately if there are no interactive elements
				Deactivate(new SnippetEventArgs(DeactivateReason.NoActiveElements));
			} else {
				myInputHandler = new SnippetInputHandler(this);
				// disable existing snippet input handlers - there can be only 1 active snippet
				foreach (TextAreaStackedInputHandler h in TextArea.StackedInputHandlers) {
					if (h is SnippetInputHandler)
						TextArea.PopStackedInputHandler(h);
				}
				TextArea.PushStackedInputHandler(myInputHandler);
			}
		}

		SnippetInputHandler myInputHandler;

		/// <summary>
		/// Occurs when the all snippet elements have been inserted.
		/// </summary>
		public event EventHandler InsertionCompleted;

		/// <summary>
		/// Calls the <see cref="IActiveElement.Deactivate"/> method on all registered active elements.
		/// </summary>
		/// <param name="e">The EventArgs to use</param>
		public void Deactivate(SnippetEventArgs e)
		{
			if (currentStatus == Status.Deactivated || currentStatus == Status.RaisingDeactivated)
				return;
			if (currentStatus != Status.Interactive)
				throw new InvalidOperationException("Cannot call Deactivate() until RaiseInsertionCompleted() has finished.");
			if (e == null)
				e = new SnippetEventArgs(DeactivateReason.Unknown);

			TextDocumentWeakEventManager.UpdateFinished.RemoveListener(Document, this);
			currentStatus = Status.RaisingDeactivated;
			TextArea.PopStackedInputHandler(myInputHandler);
			foreach (IActiveElement element in registeredElements) {
				element.Deactivate(e);
			}
			if (Deactivated != null)
				Deactivated(this, e);
			currentStatus = Status.Deactivated;
		}

		/// <summary>
		/// Occurs when the interactive mode is deactivated.
		/// </summary>
		public event EventHandler<SnippetEventArgs> Deactivated;

		bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs e)
		{
			return ReceiveWeakEvent(managerType, sender, e);
		}

		/// <inheritdoc cref="IWeakEventListener.ReceiveWeakEvent"/>
		protected virtual bool ReceiveWeakEvent(Type managerType, object sender, EventArgs e)
		{
			if (managerType == typeof(TextDocumentWeakEventManager.UpdateFinished)) {
				// Deactivate if snippet is deleted. This is necessary for correctly leaving interactive
				// mode if Undo is pressed after a snippet insertion.
				if (wholeSnippetAnchor.Length == 0 && deactivateIfSnippetEmpty)
					Deactivate(new SnippetEventArgs(DeactivateReason.Deleted));
				return true;
			}
			return false;
		}

		/// <summary>
		/// Adds existing segments as snippet elements.
		/// </summary>
		public void Link(ISegment mainElement, ISegment[] boundElements)
		{
			var main = new SnippetReplaceableTextElement { Text = Document.GetText(mainElement) };
			RegisterActiveElement(main, new ReplaceableActiveElement(this, mainElement.Offset, mainElement.EndOffset));
			foreach (var boundElement in boundElements) {
				var bound = new SnippetBoundElement { TargetElement = main };
				var start = Document.CreateAnchor(boundElement.Offset);
				start.MovementType = AnchorMovementType.BeforeInsertion;
				start.SurviveDeletion = true;
				var end = Document.CreateAnchor(boundElement.EndOffset);
				end.MovementType = AnchorMovementType.BeforeInsertion;
				end.SurviveDeletion = true;

				RegisterActiveElement(bound, new BoundActiveElement(this, main, bound, new AnchorSegment(start, end)));
			}
		}
	}
}


text:
import logging
import ctypes
import platform
import os
import sys
import psutil
from icrawl_plugin import IHostCrawler
from utils.dockerutils import exec_dockerps
from utils.misc import get_host_ipaddr

logger = logging.getLogger('crawlutils')
pynvml = None

class GPUHostCrawler(IHostCrawler):

    def get_feature(self):
        return 'gpu'

    def _load_nvidia_lib(self):
        try:
            lib_dir = os.getcwd() + '/utils/nvidialib'
            if platform.architecture()[0] == '64bit':
                ctypes.cdll.LoadLibrary(
                    lib_dir + '/lib64/libnvidia-ml.so.375.66')
            else:
                ctypes.cdll.LoadLibrary(
                    lib_dir + '/lib/libnvidia-ml.so.375.66')
        except:
            logger.debug(sys.exc_info()[0])
            return -1

    def _init_nvml(self):
        if self._load_nvidia_lib() == -1:
            return -1

        try:
            global pynvml
            import pip
            pip.main(['install', '--quiet', 'nvidia-ml-py'])
            import pynvml as pynvml
            pynvml.nvmlInit()
            return 0
        except pynvml.NVMLError, err:
            logger.debug('Failed to initialize NVML: ', err)
            return -1

    def _shutdown_nvml(self):
        try:
            pynvml.nvmlShutdown()
        except pynvml.NVMLError, err:
            logger.debug('Failed to shutdown NVML: ', err)

    def _get_children_pids(self, pid):
        try:
            p = psutil.Process(pid=pid)
            child_pids = [c.pid for c in p.children(recursive=True)]
            return child_pids
        except:
            logger.debug(sys.exc_info()[0])
            return []

    def _get_container_label(self, envs):
        for env in envs:
            label = env.split("=")
            key = label[0]
            val = label[1]
            if key == "TRAINING_ID":
                return val
        return None

    def _get_containerid_from_pid(self, pid):
        # possible race conditions / stale info
        for inspect in self.inspect_arr:
            state = inspect['State']
            cont_pid = int(state['Pid'])
            cont_name = inspect['Name']
            cont_child_pids = self._get_children_pids(cont_pid)
            if pid in cont_child_pids:
                labels = inspect['Config']['Labels']
                envs = inspect['Config']['Env']
                namespace = labels.get('io.kubernetes.pod.namespace', 'NA')
                pod_name = labels.get('io.kubernetes.pod.name', cont_name)
                # following change is specific to DlaaS usecase
                label = self._get_container_label(envs)
                if not label:
                    label = pod_name
                name = "{}.{}".format(namespace, label)
                return name
        return 'NA.NA'

    def _get_container_id(self, gpuhandle):
        cont_ids = []
        pids = []
        try:
            proc_objs = pynvml.nvmlDeviceGetComputeRunningProcesses(gpuhandle)
            if not proc_objs:
                return ['NA.NA']
            for proc_obj in proc_objs:
                pids.append(proc_obj.pid)
            for pid in pids:
                cont_ids.append(self._get_containerid_from_pid(pid))
            return cont_ids
        except pynvml.NVMLError, err:
            logger.debug('Failed to get pid on gpu: ', err)

    def _get_feature_key(self, gpuhandle, gpuid):
        hostip = get_host_ipaddr().replace('.', '/')
        key = '{}.gpu{}'.format(hostip, gpuid)
        cont_ids = self._get_container_id(gpuhandle)
        for cont_id in cont_ids:
            key = key + '.' + cont_id
        return key

    def crawl(self, **kwargs):
        logger.debug('Crawling GPU metrics for the host')
        return self._crawl_in_system()

    def _crawl_in_system(self):
        '''
        nvidia-smi returns following: MEMORY, UTILIZATION, ECC, TEMPERATURE,
        POWER, CLOCK, COMPUTE, PIDS, PERFORMANCE, SUPPORTED_CLOCKS,
        PAGE_RETIREMENT, ACCOUNTING

        currently, following are requested based on dlaas requirements:
            utilization.gpu, utilization.memory,
            memory.total, memory.free, memory.used
        nvidia-smi --query-gpu=utilization.gpu,utilization.memory,\
            memory.total,memory.free,memory.used --format=csv,noheader,nounits
        '''

        if self._init_nvml() == -1:
            return

        self.inspect_arr = exec_dockerps()

        num_gpus = pynvml.nvmlDeviceGetCount()

        for gpuid in range(0, num_gpus):
            gpuhandle = pynvml.nvmlDeviceGetHandleByIndex(gpuid)
            temperature = pynvml.nvmlDeviceGetTemperature(
                gpuhandle, pynvml.NVML_TEMPERATURE_GPU)
            memory = pynvml.nvmlDeviceGetMemoryInfo(gpuhandle)
            mem_total = memory.total / 1024 / 1024
            mem_used = memory.used / 1024 / 1024
            mem_free = memory.free / 1024 / 1024
            power_draw = pynvml.nvmlDeviceGetPowerUsage(gpuhandle) / 1000
            power_limit = pynvml.nvmlDeviceGetEnforcedPowerLimit(
                gpuhandle) / 1000
            util = pynvml.nvmlDeviceGetUtilizationRates(gpuhandle)
            util_gpu = util.gpu
            util_mem = util.memory
            entry = {
                'utilization': {'gpu': util_gpu, 'memory': util_mem},
                'memory': {'total': mem_total, 'free': mem_free,
                           'used': mem_used},
                'temperature': temperature,
                'power': {'draw': power_draw, 'limit': power_limit}
            }
            key = self._get_feature_key(gpuhandle, gpuid)
            if gpuid == num_gpus - 1:
                self._shutdown_nvml()

            yield (key, entry, 'gpu')

        return


text:
<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin" group="antispam">
	<name>plg_antispam_blacklist</name>
	<creationDate>January 2015</creationDate>
	<author>HUBzero</author>
	<authorUrl>hubzero.org</authorUrl>
	<authorEmail>support@hubzero.org</authorEmail>
	<copyright>Copyright 2005-2019 HUBzero Foundation, LLC.</copyright>
	<license>http://opensource.org/licenses/MIT MIT</license>
	<version>1.0.0</version>
	<description>PLG_ANTISPAM_BLACKLIST_XML_DESCRIPTION</description>
	<files>
		<filename plugin="blacklist">blacklist.php</filename>
		<filename>index.html</filename>
		<filename>Detector.php</filename>
	</files>
	<languages>
		<language tag="en-GB">en-GB.plg_antispam_blacklist.ini</language>
		<language tag="en-GB">en-GB.plg_antispam_blacklist.sys.ini</language>
	</languages>
	<config>
		<fields name="params">
			<fieldset name="basic">
				<field name="badwords" type="textarea" rows="25" cols="40" label="PLG_ANTISPAM_BLACKLIST_PARAM_WORDS_LABEL" description="PLG_ANTISPAM_BLACKLIST_PARAM_WORDS_DESC" default="viagra, xanax, phentermine, ringtones, tramadol, hydrocodone, levitra, ambien, vicodin, fioricet, diazepam, accarat, casino, fuck, crap, shit, asshole, cunt, fucker, fuckers, motherfucker, fucking, milf, cocksucker, porno, videosex, hentai, kasino, kasinos, poker" />
			</fieldset>
		</fields>
	</config>
</extension>


text:
/**
* Class for an 8 bit data buffer for reading and writing of data.
*
* (C) 2014-2016 Stefan Marks
* Auckland University of Technology
*/

#pragma once

#include <memory>
#include <vector>
#include <string>

/******************************************************************************
 * Class for extracting numbers and strings from a byte buffer in Big Endian order.
 */
class XBeeReadBuffer
{
public:

	/**
	 * Prepares the buffer for receiving into.
	 *
	 * @param length the length of the pure data bytes to receive
	 *
	 * @return pointer to the beginning of the buffer
	 */
	uint8_t* prepareBuffer(uint16_t length);

	/**
	 * Copies data from another buffer.
	 *
	 * @param refBuffer  the buffer to copy from
	 * @param startPos   the position to start copying from
	 * @param endPos     the position to end copying
	 */
	void copy(const XBeeReadBuffer& refBuffer, size_t startPos, size_t endPos);

	/**
	 * Function for extracting a byte from the buffer.
	 *
	 * @param pos  the position from where to extract
	 *
	 * @return the extracted byte
	 */
	uint8_t getByteAt(size_t pos) const;

	/**
	 * Function for extracting the next byte from the buffer.
	 *
	 * @return the next byte
	 */
	uint8_t getNextByte() const;

	/**
	 * Function for extracting a 16 bit integer number from a specific position in the buffer.
	 *
	 * @param pos  the position from where to extract
	 *
	 * @return the 16 bit number
	 */
	uint16_t getUInt16At(size_t pos) const;

	/**
	 * Function for extracting the next 16 bit integer number from the buffer.
	 *
	 * @return the next 16 bit integer number
	 */
	uint16_t getNextUInt16() const;

	/**
	 * Function for extracting a 32 bit integer number from a specific position in the buffer.
	 *
	 * @param pos  the position from where to extract
	 *
	 * @return the 32 bit number
	 */
	uint32_t getUInt32At(size_t pos) const;

	/**
	 * Function for extracting the next 32 bit integer number from the buffer.
	 *
	 * @return the next 32 bit integer number
	 */
	uint32_t getNextUInt32() const;

	/**
	 * Function for extracting a 64 bit integer number from a specific position in the buffer.
	 *
	 * @param pos  the position from where to extract
	 *
	 * @return the 64 bit number
	 */
	uint64_t getUInt64At(size_t pos) const;

	/**
	 * Function for extracting the next 64 bit integer number from the buffer.
	 *
	 * @return the next 64 bit integer number
	 */
	uint64_t getNextUInt64() const;

	/**
	 * Function for extracting a string from a specific position in the buffer.
	 *
	 * @param pos  the position from where to extract
	 * @param len  the maximum number of characters to extract
	 *             (0: extract until the end of the buffer or encountering a '\0')
	 *
	 * @return the extracted string
	 */
	std::string getStringAt(size_t pos, size_t len = 0) const;

	/**
	 * Function for extracting the next string from the buffer.
	 *
	 * @param len  the maximum number of characters to extract
	 *             (0: extract until the end of the buffer or encountering a '\0')
	 *
	 * @return the extracted string
	 */
	std::string getNextString(size_t len = 0) const;

	/**
	 * Gets the amount of bytes in the buffer.
	 *
	 * @return  the amount of bytes in the buffer
	 */
	size_t size() const;

	/**
	 * Calculates the additive checksum over the XBee buffer content.
	 *
	 * @return  the sum of all bytes in the buffer starting at position 3
	 */
	uint8_t calculateChecksum() const;

	/**
	 * Gets the raw pointer to the buffer content.
	 *
	 * @return a pointer to the buffer
	 */
	const void* data() const;

protected:

	        std::vector<uint8_t>                 m_buffer;
	mutable std::vector<uint8_t>::const_iterator m_read;

};

/******************************************************************************
 * Class for adding numbers and strings to a byte buffer in Big Endian order.
 */
class XBeeWriteBuffer
{
public:

	/**
	 * Clears the buffer.
	 */
	void clear();

	/**
	 * Appends a byte to the buffer.
	 *
	 * @param value  the byte to append.
	 */
	void addByte(uint8_t value);

	/**
	 * Sets a 16 bit integer number in the buffer.
	 *
	 * @param pos    the position where to change the number
	 * @param value  the value to change
	 */
	void setUInt16At(size_t pos, uint16_t value);

	/**
	 * Appends a 16 bit integer number to the buffer.
	 *
	 * @param value  the 16 bit integer number to append.
	 */
	void addUInt16(uint16_t value);

	/**
	* Appends a 64 bit integer number to the buffer.
	*
	* @param value  the 64 bit integer number to append.
	*/
	void addUInt64(uint64_t value);

	/**
	 * Appends a string to the buffer.
	 *
	 * @param value   the string to append.
	 * @param maxLen  the maximum amount of characters to append (0: all)
	 */
	void addString(const std::string& value, size_t maxLen = 0);

	/**
	 * Gets the amount of bytes in the buffer.
	 *
	 * @return  the amount of bytes in the buffer
	 */
	size_t size() const;

	/**
	 * Calculates the additive checksum over the XBee buffer content.
	 *
	 * @return  the sum of all bytes in the buffer starting at position 3
	 */
	uint8_t calculateChecksum() const;

	/**
	 * Gets the raw pointer to the buffer content.
	 *
	 * @return a pointer to the buffer
	 */
	const void* data() const;

protected:

	std::vector<uint8_t>  m_buffer;

};


text:
<!doctype html>
<html xmlns:wicket="http://wicket.apache.org">
<head>
	<title>AbstractModalPanel</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
	<wicket:panel>
	</wicket:panel>
</body>
</html>