text:
package io.gatling.http.client;

import static io.gatling.http.client.util.HttpUtils.*;
import static io.gatling.http.client.util.MiscUtils.isNonEmpty;
import static io.netty.handler.codec.http.HttpHeaderNames.*;
import static java.nio.charset.StandardCharsets.UTF_8;

import io.gatling.http.client.body.RequestBody;
import io.gatling.http.client.body.RequestBodyBuilder;
import io.gatling.http.client.proxy.HttpProxyServer;
import io.gatling.http.client.proxy.ProxyServer;
import io.gatling.http.client.realm.BasicRealm;
import io.gatling.http.client.realm.DigestRealm;
import io.gatling.http.client.realm.Realm;
import io.gatling.http.client.resolver.InetAddressNameResolver;
import io.gatling.http.client.uri.Uri;
import io.netty.handler.codec.http.DefaultHttpHeaders;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpMethod;
import io.netty.handler.codec.http.cookie.ClientCookieEncoder;
import io.netty.handler.codec.http.cookie.Cookie;
import io.netty.util.AsciiString;
import java.net.InetAddress;
import java.nio.charset.Charset;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;

public class RequestBuilder {

  private static final AsciiString ACCEPT_ALL_HEADER_VALUE = new AsciiString("*/*");

  private final String name;
  private final HttpMethod method;
  private final Uri uri;
  private final InetAddressNameResolver nameResolver;
  private HttpHeaders headers = new DefaultHttpHeaders(false);
  private List<Cookie> cookies = Collections.emptyList();
  private RequestBodyBuilder bodyBuilder;
  private long requestTimeout;
  private String virtualHost;
  private boolean autoOrigin;
  private InetAddress localIpV4Address;
  private InetAddress localIpV6Address;
  private Realm realm;
  private ProxyServer proxyServer;
  private Consumer<Request> signatureCalculator;
  private boolean http2Enabled;
  private boolean alpnRequired;
  private boolean http2PriorKnowledge;
  private String wsSubprotocol;
  private Charset defaultCharset = UTF_8;

  public RequestBuilder(
      String name, HttpMethod method, Uri uri, InetAddressNameResolver nameResolver) {
    this.name = name;
    this.method = method;
    this.uri = uri;
    this.nameResolver = nameResolver;
  }

  public Uri getUri() {
    return uri;
  }

  public RequestBuilder setHeaders(HttpHeaders headers) {
    this.headers = headers;
    return this;
  }

  public RequestBuilder addHeader(CharSequence name, Object value) {
    this.headers.add(name, value);
    return this;
  }

  public RequestBuilder setCookies(List<Cookie> cookies) {
    this.cookies = cookies;
    return this;
  }

  public RequestBuilder setBodyBuilder(RequestBodyBuilder bodyBuilder) {
    this.bodyBuilder = bodyBuilder;
    return this;
  }

  public RequestBuilder setRequestTimeout(long requestTimeout) {
    this.requestTimeout = requestTimeout;
    return this;
  }

  public RequestBuilder setVirtualHost(String virtualHost) {
    this.virtualHost = virtualHost;
    return this;
  }

  public RequestBuilder setAutoOrigin(boolean autoOrigin) {
    this.autoOrigin = autoOrigin;
    return this;
  }

  public RequestBuilder setLocalIpV4Address(InetAddress localIpV4Address) {
    this.localIpV4Address = localIpV4Address;
    return this;
  }

  public RequestBuilder setLocalIpV6Address(InetAddress localIpV6Address) {
    this.localIpV6Address = localIpV6Address;
    return this;
  }

  public RequestBuilder setRealm(Realm realm) {
    this.realm = realm;
    return this;
  }

  public RequestBuilder setProxyServer(ProxyServer proxyServer) {
    this.proxyServer = proxyServer;
    return this;
  }

  public RequestBuilder setSignatureCalculator(Consumer<Request> signatureCalculator) {
    this.signatureCalculator = signatureCalculator;
    return this;
  }

  public RequestBuilder setHttp2Enabled(boolean http2Enabled) {
    this.http2Enabled = http2Enabled;
    return this;
  }

  public RequestBuilder setAlpnRequired(boolean alpnRequired) {
    this.alpnRequired = alpnRequired;
    return this;
  }

  public RequestBuilder setHttp2PriorKnowledge(boolean http2PriorKnowledge) {
    this.http2PriorKnowledge = http2PriorKnowledge;
    return this;
  }

  public RequestBuilder setDefaultCharset(Charset defaultCharset) {
    this.defaultCharset = defaultCharset;
    return this;
  }

  public RequestBuilder setWsSubprotocol(String wsSubprotocol) {
    this.wsSubprotocol = wsSubprotocol;
    return this;
  }

  public String getContentType() {
    return headers.get(CONTENT_TYPE);
  }

  public Request build() {
    if (!headers.contains(ACCEPT)) {
      headers.set(ACCEPT, ACCEPT_ALL_HEADER_VALUE);
    }

    String authorization = null;
    if (realm instanceof BasicRealm) {
      authorization = ((BasicRealm) realm).getAuthorizationHeader();
    } else if (realm instanceof DigestRealm) {
      authorization = ((DigestRealm) realm).getAuthorizationHeader(method, uri);
    }
    if (authorization != null) {
      headers.add(AUTHORIZATION, authorization);
    }

    if (!uri.isSecured() && proxyServer instanceof HttpProxyServer) {
      BasicRealm realm = ((HttpProxyServer) proxyServer).getRealm();
      if (realm != null) {
        headers.set(PROXY_AUTHORIZATION, realm.getAuthorizationHeader());
      }
    }

    String originalAcceptEncoding = headers.get(ACCEPT_ENCODING);
    if (originalAcceptEncoding != null) {
      String newAcceptEncodingHeader =
          filterOutBrotliFromAcceptEncodingWhenUnavailable(originalAcceptEncoding);
      if (newAcceptEncodingHeader != null) {
        headers.set(ACCEPT_ENCODING, newAcceptEncodingHeader);
      }
    }

    if (isNonEmpty(cookies)) {
      headers.set(COOKIE, ClientCookieEncoder.LAX.encode(cookies));
    }

    if (autoOrigin) {
      String referer = headers.get(REFERER);
      if (referer != null
          && !HttpMethod.GET.equals(method)
          && !HttpMethod.HEAD.equals(method)
          && !headers.contains(ORIGIN)) {
        String origin = originHeader(referer);
        if (origin != null) {
          headers.set(ORIGIN, origin);
        }
      }
    }

    if (!headers.contains(HOST)) {
      headers.set(HOST, virtualHost != null ? virtualHost : hostHeader(uri));
    }

    RequestBody body = null;
    if (bodyBuilder != null) {
      String contentType = getContentType();
      Charset charset = extractContentTypeCharsetAttribute(contentType);
      body = bodyBuilder.build(contentType, charset, defaultCharset);
      CharSequence patchedContentType = body.getPatchedContentType();
      if (patchedContentType != null) {
        headers.set(CONTENT_TYPE, patchedContentType);
      }
    }

    return new Request(
        name,
        method,
        uri,
        headers,
        cookies != null ? cookies : Collections.emptyList(),
        body,
        requestTimeout,
        virtualHost,
        autoOrigin,
        localIpV4Address,
        localIpV6Address,
        realm,
        proxyServer,
        signatureCalculator,
        nameResolver,
        http2Enabled,
        alpnRequired,
        http2PriorKnowledge,
        wsSubprotocol);
  }
}


text:
package org.wso2.store.bamclient;

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.apache.log4j.Logger;
import org.wso2.carbon.databridge.agent.thrift.exception.AgentException;
import org.wso2.carbon.databridge.agent.thrift.lb.DataPublisherHolder;
import org.wso2.carbon.databridge.agent.thrift.lb.LoadBalancingDataPublisher;
import org.wso2.carbon.databridge.agent.thrift.lb.ReceiverGroup;
import org.wso2.carbon.databridge.agent.thrift.util.DataPublisherUtil;
import org.wso2.store.bamclient.usage.ESBamPublisherUsageConstants;
import org.wso2.store.util.Configuration;
import org.wso2.store.util.ConfigurationConstants;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;

public class EventPublisher {

	private static final Logger log = Logger.getLogger(EventPublisher.class);
	static Gson gson = null;
	private static EventPublisher instance = null;

	private static String assetStatisticsDefaultStream =
			"{\"name\":" + ESBamPublisherUsageConstants.ES_STATISTICS_STREAM_NAME + "," +
			"\"version\":" + ESBamPublisherUsageConstants.ES_STATISTICS_STREAM_VERSION +
			",\"nickName\":\"asseteventsStream\",\"description\":\"assets events stream\"" +
			",\"metaData\":[{\"name\":\"clientType\",\"type\":\"STRING\"}]," +
			"\"payloadData\":[{\"name\":\"userstore\",\"type\":\"STRING\"},{\"name\":\"tenant\"," +
			"\"type\":\"STRING\"},{\"name\":\"user\",\"type\":\"STRING\"},{\"name\":\"event\"," +
			"\"type\":\"STRING\"},{\"name\":\"assetId\",\"type\":\"STRING\"},{\"name\":\"assetType\"," +
			"\"type\":\"STRING\"},{\"name\":\"description\",\"type\":\"STRING\"}]}";

	private static LoadBalancingDataPublisher loadBalancingDataPublisher = null;

	private EventPublisher() throws Exception {

		try {

			InputStream inputStream =
					new FileInputStream(new File(
							System.getProperty("carbon.home") + File.separator
							+ "repository" + File.separator + "conf" + File.separator + "bam" +
							File.separator + "es-bam.xml"));

			Configuration configuration = new Configuration(inputStream);

			String trustStoreFilePath = System.getProperty("carbon.home") + File.separator
			                            + "repository" + File.separator + "resources" +
			                            File.separator + "security" +
			                            File.separator + "client-truststore.jks";

			String trustStorePwd =
					configuration.getFirstProperty(ConfigurationConstants.BAM_TRUST_STORE_PWD);
			String receiverUrls = configuration.getFirstProperty(ConfigurationConstants.BAM_HOST);
			Boolean failOver = Boolean.parseBoolean(
					configuration.getFirstProperty(ConfigurationConstants.BAM_FAILOBER));

			String userName = configuration.getFirstProperty(ConfigurationConstants.BAM_USERNAME);
			String password = configuration.getFirstProperty(ConfigurationConstants.BAM_PWD);

			if (log.isDebugEnabled()) {
				log.debug("trustStoreFilePath:" + trustStoreFilePath);
			}

			System.setProperty("javax.net.ssl.trustStore", trustStoreFilePath);
			System.setProperty("javax.net.ssl.trustStorePassword", trustStorePwd);

			if (log.isDebugEnabled()) {
				log.debug("receiverUrls" + receiverUrls);
			}

			ArrayList<ReceiverGroup> allReceiverGroups = new ArrayList<ReceiverGroup>();
			ArrayList<String> receiverGroupUrls = DataPublisherUtil.getReceiverGroups(receiverUrls);

			for (String aReceiverGroupURL : receiverGroupUrls) {
				ArrayList<DataPublisherHolder> dataPublisherHolders =
						new ArrayList<DataPublisherHolder>();
				String[] urls = aReceiverGroupURL.split(",");

				for (String aUrl : urls) {
					if (log.isDebugEnabled()) {
						log.debug("aUrl:" + aUrl);
					}
					DataPublisherHolder aNode =
							new DataPublisherHolder(null, aUrl.trim(), userName, password);
					dataPublisherHolders.add(aNode);
				}
				ReceiverGroup group = new ReceiverGroup(dataPublisherHolders, failOver);
				allReceiverGroups.add(group);
			}

			loadBalancingDataPublisher = new LoadBalancingDataPublisher(allReceiverGroups);

		} catch (FileNotFoundException fileNotFoundEx) {
			log.error("bam conf file not found", fileNotFoundEx);
			throw fileNotFoundEx;
		}

	}

	public static EventPublisher getInstance() throws Exception {
		if (instance == null) {
			instance = new EventPublisher();
		}
		return instance;
	}

	public static void shutDownPublisher() throws RuntimeException {

		if (loadBalancingDataPublisher != null) {
			loadBalancingDataPublisher.stop();
		}
	}

	public void publishEvents(String streamName, String streamVersion, String streamDefinition,
	                          String metaData, String data) throws Exception {

		if (log.isDebugEnabled()) {
			log.debug("streamName>>" + streamName);
			log.debug("streamVersion>>" + streamVersion);
			log.debug("streamDefinition>>" + streamDefinition);
			log.debug(metaData);
			log.debug(data);
		}

		if (!loadBalancingDataPublisher.isStreamDefinitionAdded(streamName, streamVersion)) {
			loadBalancingDataPublisher
					.addStreamDefinition(streamDefinition, streamName, streamVersion);
			if (log.isDebugEnabled()) {
				log.debug("stream created:");
			}
		}

		try {
			loadBalancingDataPublisher
					.publish(streamName, streamVersion, System.currentTimeMillis(),
					         null, new Object[] { "es" }, data.split(","));
		} catch (AgentException e) {
			log.error("data publish error", e);
			throw e;
		}
	}

	public void publishAssetStatistics(String eventName, String tenantId, String userStore,
	                                   String username,
	                                   String assetUDID, String assetType, String description)
			throws Exception {

		JsonObject streamDefinition =
				(JsonObject) new JsonParser().parse(assetStatisticsDefaultStream);

		String strData =
				userStore + "," + tenantId + "," + username + "," + eventName + "," + assetUDID +
				"," + assetType + "," + description;

		publishEvents(ESBamPublisherUsageConstants.ES_STATISTICS_STREAM_NAME,
		              ESBamPublisherUsageConstants.ES_STATISTICS_STREAM_VERSION,
		              assetStatisticsDefaultStream, streamDefinition.get("metaData").toString(),
		              strData);
	}

}

redpajama_set_name: RedPajamaGithub


text:
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 4.0.2
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.pjsip.pjsua2;

public class TransportInfo {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected TransportInfo(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(TransportInfo obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        pjsua2JNI.delete_TransportInfo(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void setId(int value) {
    pjsua2JNI.TransportInfo_id_set(swigCPtr, this, value);
  }

  public int getId() {
    return pjsua2JNI.TransportInfo_id_get(swigCPtr, this);
  }

  public void setType(int value) {
    pjsua2JNI.TransportInfo_type_set(swigCPtr, this, value);
  }

  public int getType() {
    return pjsua2JNI.TransportInfo_type_get(swigCPtr, this);
  }

  public void setTypeName(String value) {
    pjsua2JNI.TransportInfo_typeName_set(swigCPtr, this, value);
  }

  public String getTypeName() {
    return pjsua2JNI.TransportInfo_typeName_get(swigCPtr, this);
  }

  public void setInfo(String value) {
    pjsua2JNI.TransportInfo_info_set(swigCPtr, this, value);
  }

  public String getInfo() {
    return pjsua2JNI.TransportInfo_info_get(swigCPtr, this);
  }

  public void setFlags(long value) {
    pjsua2JNI.TransportInfo_flags_set(swigCPtr, this, value);
  }

  public long getFlags() {
    return pjsua2JNI.TransportInfo_flags_get(swigCPtr, this);
  }

  public void setLocalAddress(String value) {
    pjsua2JNI.TransportInfo_localAddress_set(swigCPtr, this, value);
  }

  public String getLocalAddress() {
    return pjsua2JNI.TransportInfo_localAddress_get(swigCPtr, this);
  }

  public void setLocalName(String value) {
    pjsua2JNI.TransportInfo_localName_set(swigCPtr, this, value);
  }

  public String getLocalName() {
    return pjsua2JNI.TransportInfo_localName_get(swigCPtr, this);
  }

  public void setUsageCount(long value) {
    pjsua2JNI.TransportInfo_usageCount_set(swigCPtr, this, value);
  }

  public long getUsageCount() {
    return pjsua2JNI.TransportInfo_usageCount_get(swigCPtr, this);
  }

  public TransportInfo() {
    this(pjsua2JNI.new_TransportInfo(), true);
  }

}


text:
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * A class which manages pending restyles.  This handles keeping track
 * of what nodes restyles need to happen on and so forth.
 */

#include "RestyleTracker.h"
#include "nsCSSFrameConstructor.h"
#include "nsStyleChangeList.h"
#include "sampler.h"

namespace mozilla {
namespace css {

inline nsIDocument*
RestyleTracker::Document() const {
  return mFrameConstructor->mDocument;
}

#define RESTYLE_ARRAY_STACKSIZE 128

struct LaterSiblingCollector {
  RestyleTracker* tracker;
  nsTArray< nsRefPtr<dom::Element> >* elements;
};

static PLDHashOperator
CollectLaterSiblings(nsISupports* aElement,
                     RestyleTracker::RestyleData& aData,
                     void* aSiblingCollector)
{
  dom::Element* element =
    static_cast<dom::Element*>(aElement);
  LaterSiblingCollector* collector =
    static_cast<LaterSiblingCollector*>(aSiblingCollector);
  // Only collect the entries that actually need restyling by us (and
  // haven't, for example, already been restyled).
  // It's important to not mess with the flags on entries not in our
  // document.
  if (element->GetCurrentDoc() == collector->tracker->Document() &&
      element->HasFlag(collector->tracker->RestyleBit()) &&
      (aData.mRestyleHint & eRestyle_LaterSiblings)) {
    collector->elements->AppendElement(element);
  }

  return PL_DHASH_NEXT;
}

struct RestyleCollector {
  RestyleTracker* tracker;
  RestyleTracker::RestyleEnumerateData** restyleArrayPtr;
};

static PLDHashOperator
CollectRestyles(nsISupports* aElement,
                RestyleTracker::RestyleData& aData,
                void* aRestyleCollector)
{
  dom::Element* element =
    static_cast<dom::Element*>(aElement);
  RestyleCollector* collector =
    static_cast<RestyleCollector*>(aRestyleCollector);
  // Only collect the entries that actually need restyling by us (and
  // haven't, for example, already been restyled).
  // It's important to not mess with the flags on entries not in our
  // document.
  if (element->GetCurrentDoc() != collector->tracker->Document() ||
      !element->HasFlag(collector->tracker->RestyleBit())) {
    return PL_DHASH_NEXT;
  }

  NS_ASSERTION(!element->HasFlag(collector->tracker->RootBit()) ||
               // Maybe we're just not reachable via the frame tree?
               (element->GetFlattenedTreeParent() &&
                (!element->GetFlattenedTreeParent()->GetPrimaryFrame()||
                 element->GetFlattenedTreeParent()->GetPrimaryFrame()->IsLeaf())) ||
               // Or not reachable due to an async reinsert we have
               // pending?  If so, we'll have a reframe hint around.
               // That incidentally makes it safe that we still have
               // the bit, since any descendants that didn't get added
               // to the roots list because we had the bits will be
               // completely restyled in a moment.
               (aData.mChangeHint & nsChangeHint_ReconstructFrame),
               "Why did this not get handled while processing mRestyleRoots?");

  // Unset the restyle bits now, so if they get readded later as we
  // process we won't clobber that adding of the bit.
  element->UnsetFlags(collector->tracker->RestyleBit() |
                      collector->tracker->RootBit());

  RestyleTracker::RestyleEnumerateData** restyleArrayPtr =
    collector->restyleArrayPtr;
  RestyleTracker::RestyleEnumerateData* currentRestyle =
    *restyleArrayPtr;
  currentRestyle->mElement = element;
  currentRestyle->mRestyleHint = aData.mRestyleHint;
  currentRestyle->mChangeHint = aData.mChangeHint;

  // Increment to the next slot in the array
  *restyleArrayPtr = currentRestyle + 1;

  return PL_DHASH_NEXT;
}

inline void
RestyleTracker::ProcessOneRestyle(Element* aElement,
                                  nsRestyleHint aRestyleHint,
                                  nsChangeHint aChangeHint)
{
  NS_PRECONDITION((aRestyleHint & eRestyle_LaterSiblings) == 0,
                  "Someone should have handled this before calling us");
  NS_PRECONDITION(Document(), "Must have a document");
  NS_PRECONDITION(aElement->GetCurrentDoc() == Document(),
                  "Element has unexpected document");

  nsIFrame* primaryFrame = aElement->GetPrimaryFrame();
  if (aRestyleHint & (eRestyle_Self | eRestyle_Subtree)) {
    mFrameConstructor->RestyleElement(aElement, primaryFrame, aChangeHint,
                                      *this,
                                      (aRestyleHint & eRestyle_Subtree) != 0);
  } else if (aChangeHint &&
             (primaryFrame ||
              (aChangeHint & nsChangeHint_ReconstructFrame))) {
    // Don't need to recompute style; just apply the hint
    nsStyleChangeList changeList;
    changeList.AppendChange(primaryFrame, aElement, aChangeHint);
    mFrameConstructor->ProcessRestyledFrames(changeList);
  }
}

void
RestyleTracker::DoProcessRestyles()
{
  SAMPLE_LABEL("CSS", "ProcessRestyles");
  // Make sure to not rebuild quote or counter lists while we're
  // processing restyles
  mFrameConstructor->BeginUpdate();

  mFrameConstructor->mInStyleRefresh = true;

  // loop so that we process any restyle events generated by processing
  while (mPendingRestyles.Count()) {
    if (mHaveLaterSiblingRestyles) {
      // Convert them to individual restyles on all the later siblings
      nsAutoTArray<nsRefPtr<Element>, RESTYLE_ARRAY_STACKSIZE> laterSiblingArr;
      LaterSiblingCollector siblingCollector = { this, &laterSiblingArr };
      mPendingRestyles.Enumerate(CollectLaterSiblings, &siblingCollector);
      for (uint32_t i = 0; i < laterSiblingArr.Length(); ++i) {
        Element* element = laterSiblingArr[i];
        for (nsIContent* sibling = element->GetNextSibling();
             sibling;
             sibling = sibling->GetNextSibling()) {
          if (sibling->IsElement() &&
              AddPendingRestyle(sibling->AsElement(), eRestyle_Subtree,
                                NS_STYLE_HINT_NONE)) {
              // Nothing else to do here; we'll handle the following
              // siblings when we get to |sibling| in laterSiblingArr.
            break;
          }
        }
      }

      // Now remove all those eRestyle_LaterSiblings bits
      for (uint32_t i = 0; i < laterSiblingArr.Length(); ++i) {
        Element* element = laterSiblingArr[i];
        NS_ASSERTION(element->HasFlag(RestyleBit()), "How did that happen?");
        RestyleData data;
#ifdef DEBUG
        bool found =
#endif
          mPendingRestyles.Get(element, &data);
        NS_ASSERTION(found, "Where did our entry go?");
        data.mRestyleHint =
          nsRestyleHint(data.mRestyleHint & ~eRestyle_LaterSiblings);

        mPendingRestyles.Put(element, data);
      }

      mHaveLaterSiblingRestyles = false;
    }

    uint32_t rootCount;
    while ((rootCount = mRestyleRoots.Length())) {
      // Make sure to pop the element off our restyle root array, so
      // that we can freely append to the array as we process this
      // element.
      nsRefPtr<Element> element;
      element.swap(mRestyleRoots[rootCount - 1]);
      mRestyleRoots.RemoveElementAt(rootCount - 1);

      // Do the document check before calling GetRestyleData, since we
      // don't want to do the sibling-processing GetRestyleData does if
      // the node is no longer relevant.
      if (element->GetCurrentDoc() != Document()) {
        // Content node has been removed from our document; nothing else
        // to do here
        continue;
      }

      RestyleData data;
      if (!GetRestyleData(element, &data)) {
        continue;
      }

      ProcessOneRestyle(element, data.mRestyleHint, data.mChangeHint);
    }

    if (mHaveLaterSiblingRestyles) {
      // Keep processing restyles for now
      continue;
    }

    // Now we only have entries with change hints left.  To be safe in
    // case of reentry from the handing of the change hint, use a
    // scratch array instead of calling out to ProcessOneRestyle while
    // enumerating the hashtable.  Use the stack if we can, otherwise
    // fall back on heap-allocation.
    nsAutoTArray<RestyleEnumerateData, RESTYLE_ARRAY_STACKSIZE> restyleArr;
    RestyleEnumerateData* restylesToProcess =
      restyleArr.AppendElements(mPendingRestyles.Count());
    if (restylesToProcess) {
      RestyleEnumerateData* lastRestyle = restylesToProcess;
      RestyleCollector collector = { this, &lastRestyle };
      mPendingRestyles.Enumerate(CollectRestyles, &collector);

      // Clear the hashtable now that we don't need it anymore
      mPendingRestyles.Clear();

      for (RestyleEnumerateData* currentRestyle = restylesToProcess;
           currentRestyle != lastRestyle;
           ++currentRestyle) {
        ProcessOneRestyle(currentRestyle->mElement,
                          currentRestyle->mRestyleHint,
                          currentRestyle->mChangeHint);
      }
    }
  }

  // Set mInStyleRefresh to false now, since the EndUpdate call might
  // add more restyles.
  mFrameConstructor->mInStyleRefresh = false;

  mFrameConstructor->EndUpdate();

#ifdef DEBUG
  mFrameConstructor->mPresShell->VerifyStyleTree();
#endif
}

bool
RestyleTracker::GetRestyleData(Element* aElement, RestyleData* aData)
{
  NS_PRECONDITION(aElement->GetCurrentDoc() == Document(),
                  "Unexpected document; this will lead to incorrect behavior!");

  if (!aElement->HasFlag(RestyleBit())) {
    NS_ASSERTION(!aElement->HasFlag(RootBit()), "Bogus root bit?");
    return false;
  }

#ifdef DEBUG
  bool gotData =
#endif
  mPendingRestyles.Get(aElement, aData);
  NS_ASSERTION(gotData, "Must have data if restyle bit is set");

  if (aData->mRestyleHint & eRestyle_LaterSiblings) {
    // Someone readded the eRestyle_LaterSiblings hint for this
    // element.  Leave it around for now, but remove the other restyle
    // hints and the change hint for it.  Also unset its root bit,
    // since it's no longer a root with the new restyle data.
    RestyleData newData;
    newData.mChangeHint = nsChangeHint(0);
    newData.mRestyleHint = eRestyle_LaterSiblings;
    mPendingRestyles.Put(aElement, newData);
    aElement->UnsetFlags(RootBit());
    aData->mRestyleHint =
      nsRestyleHint(aData->mRestyleHint & ~eRestyle_LaterSiblings);
  } else {
    mPendingRestyles.Remove(aElement);
    aElement->UnsetFlags(mRestyleBits);
  }

  return true;
}

} // namespace css
} // namespace mozilla


text:
require "cases/helper"
require 'models/topic'
require 'models/reply'
require 'models/developer'

class TransactionTest < ActiveRecord::TestCase
  self.use_transactional_fixtures = false
  fixtures :topics, :developers

  def setup
    @first, @second = Topic.find(1, 2).sort_by { |t| t.id }
  end

  def test_successful
    Topic.transaction do
      @first.approved  = true
      @second.approved = false
      @first.save
      @second.save
    end

    assert Topic.find(1).approved?, "First should have been approved"
    assert !Topic.find(2).approved?, "Second should have been unapproved"
  end

  def transaction_with_return
    Topic.transaction do
      @first.approved  = true
      @second.approved = false
      @first.save
      @second.save
      return
    end
  end

  def test_successful_with_return
    class << Topic.connection
      alias :real_commit_db_transaction :commit_db_transaction
      def commit_db_transaction
        $committed = true
        real_commit_db_transaction
      end
    end

    $committed = false
    transaction_with_return
    assert $committed

    assert Topic.find(1).approved?, "First should have been approved"
    assert !Topic.find(2).approved?, "Second should have been unapproved"
  ensure
    class << Topic.connection
      alias :commit_db_transaction :real_commit_db_transaction rescue nil
    end
  end

  def test_successful_with_instance_method
    @first.transaction do
      @first.approved  = true
      @second.approved = false
      @first.save
      @second.save
    end

    assert Topic.find(1).approved?, "First should have been approved"
    assert !Topic.find(2).approved?, "Second should have been unapproved"
  end

  def test_failing_on_exception
    begin
      Topic.transaction do
        @first.approved  = true
        @second.approved = false
        @first.save
        @second.save
        raise "Bad things!"
      end
    rescue
      # caught it
    end

    assert @first.approved?, "First should still be changed in the objects"
    assert !@second.approved?, "Second should still be changed in the objects"

    assert !Topic.find(1).approved?, "First shouldn't have been approved"
    assert Topic.find(2).approved?, "Second should still be approved"
  end

  def test_callback_rollback_in_save
    add_exception_raising_after_save_callback_to_topic

    begin
      @first.approved = true
      @first.save
      flunk
    rescue => e
      assert_equal "Make the transaction rollback", e.message
      assert !Topic.find(1).approved?
    ensure
      remove_exception_raising_after_save_callback_to_topic
    end
  end

  def test_callback_rollback_in_create
    new_topic = Topic.new(
      :title => "A new topic",
      :author_name => "Ben",
      :author_email_address => "ben@example.com",
      :written_on => "2003-07-16t15:28:11.2233+01:00",
      :last_read => "2004-04-15",
      :bonus_time => "2005-01-30t15:28:00.00+01:00",
      :content => "Have a nice day",
      :approved => false)
    new_record_snapshot = new_topic.new_record?
    id_present = new_topic.has_attribute?(Topic.primary_key)
    id_snapshot = new_topic.id

    # Make sure the second save gets the after_create callback called.
    2.times do
      begin
        add_exception_raising_after_create_callback_to_topic
        new_topic.approved = true
        new_topic.save
        flunk
      rescue => e
        assert_equal "Make the transaction rollback", e.message
        assert_equal new_record_snapshot, new_topic.new_record?, "The topic should have its old new_record value"
        assert_equal id_snapshot, new_topic.id, "The topic should have its old id"
        assert_equal id_present, new_topic.has_attribute?(Topic.primary_key)
      ensure
        remove_exception_raising_after_create_callback_to_topic
      end
    end
  end

  def test_nested_explicit_transactions
    Topic.transaction do
      Topic.transaction do
        @first.approved  = true
        @second.approved = false
        @first.save
        @second.save
      end
    end

    assert Topic.find(1).approved?, "First should have been approved"
    assert !Topic.find(2).approved?, "Second should have been unapproved"
  end

  def test_manually_rolling_back_a_transaction
    Topic.transaction do
      @first.approved  = true
      @second.approved = false
      @first.save
      @second.save

      raise ActiveRecord::Rollback
    end

    assert @first.approved?, "First should still be changed in the objects"
    assert !@second.approved?, "Second should still be changed in the objects"

    assert !Topic.find(1).approved?, "First shouldn't have been approved"
    assert Topic.find(2).approved?, "Second should still be approved"
  end

  uses_mocha 'mocking connection.commit_db_transaction' do
    def test_rollback_when_commit_raises
      Topic.connection.expects(:begin_db_transaction)
      Topic.connection.expects(:commit_db_transaction).raises('OH NOES')
      Topic.connection.expects(:rollback_db_transaction)

      assert_raise RuntimeError do
        Topic.transaction do
          # do nothing
        end
      end
    end
  end

  def test_sqlite_add_column_in_transaction_raises_statement_invalid
    return true unless current_adapter?(:SQLite3Adapter, :SQLiteAdapter)

    # Test first if column creation/deletion works correctly when no
    # transaction is in place.
    #
    # We go back to the connection for the column queries because
    # Topic.columns is cached and won't report changes to the DB

    assert_nothing_raised do
      Topic.reset_column_information
      Topic.connection.add_column('topics', 'stuff', :string)
      assert Topic.column_names.include?('stuff')

      Topic.reset_column_information
      Topic.connection.remove_column('topics', 'stuff')
      assert !Topic.column_names.include?('stuff')
    end

    # Test now inside a transaction: add_column should raise a StatementInvalid
    Topic.transaction do
      assert_raises(ActiveRecord::StatementInvalid) { Topic.connection.add_column('topics', 'stuff', :string) }
      raise ActiveRecord::Rollback
    end
  end

  private
    def add_exception_raising_after_save_callback_to_topic
      Topic.class_eval { def after_save() raise "Make the transaction rollback" end }
    end

    def remove_exception_raising_after_save_callback_to_topic
      Topic.class_eval { remove_method :after_save }
    end

    def add_exception_raising_after_create_callback_to_topic
      Topic.class_eval { def after_create() raise "Make the transaction rollback" end }
    end

    def remove_exception_raising_after_create_callback_to_topic
      Topic.class_eval { remove_method :after_create }
    end
end

if current_adapter?(:PostgreSQLAdapter)
  class ConcurrentTransactionTest < TransactionTest
    def setup
      @allow_concurrency = ActiveRecord::Base.allow_concurrency
      ActiveRecord::Base.allow_concurrency = true
      super
    end

    def teardown
      super
      ActiveRecord::Base.allow_concurrency = @allow_concurrency
    end

    # This will cause transactions to overlap and fail unless they are performed on
    # separate database connections.
    def test_transaction_per_thread
      assert_nothing_raised do
        threads = (1..3).map do
          Thread.new do
            Topic.transaction do
              topic = Topic.find(1)
              topic.approved = !topic.approved?
              topic.save!
              topic.approved = !topic.approved?
              topic.save!
            end
          end
        end

        threads.each { |t| t.join }
      end
    end

    # Test for dirty reads among simultaneous transactions.
    def test_transaction_isolation__read_committed
      # Should be invariant.
      original_salary = Developer.find(1).salary
      temporary_salary = 200000

      assert_nothing_raised do
        threads = (1..3).map do
          Thread.new do
            Developer.transaction do
              # Expect original salary.
              dev = Developer.find(1)
              assert_equal original_salary, dev.salary

              dev.salary = temporary_salary
              dev.save!

              # Expect temporary salary.
              dev = Developer.find(1)
              assert_equal temporary_salary, dev.salary

              dev.salary = original_salary
              dev.save!

              # Expect original salary.
              dev = Developer.find(1)
              assert_equal original_salary, dev.salary
            end
          end
        end

        # Keep our eyes peeled.
        threads << Thread.new do
          10.times do
            sleep 0.05
            Developer.transaction do
              # Always expect original salary.
              assert_equal original_salary, Developer.find(1).salary
            end
          end
        end

        threads.each { |t| t.join }
      end

      assert_equal original_salary, Developer.find(1).salary
    end
  end
end


text:
goog.provide('recoil.errors.HttpError');
goog.require('goog.net.ErrorCode');

goog.require('recoil.errors.Error');

/**.
 *
 * @param {goog.net.ErrorCode} errorCode
 * @extends {Error}
 * @constructor
 */
recoil.errors.HttpError = function(errorCode) {
    this.errorCode_ = errorCode;
    this.name = 'HttpError';
};
goog.inherits(recoil.errors.HttpError, Error);


text:
package com.cg.watbalance;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.cg.watbalance.preferences.Connection;
import com.cg.watbalance.preferences.ConnectionDetails;
import com.cg.watbalance.preferences.Encryption;
import com.cg.watbalance.service.Service;

import org.apache.commons.lang3.text.WordUtils;
import org.joda.time.DateTime;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

import java.util.Calendar;

public class login extends AppCompatActivity {

    EditText IDNum;
    EditText pinNum;
    Connection myConn;
    ConnectionDetails myConnDet;
    Button mySaveButton;
    TextView forgotPIN;
    Encryption myEncryption;
    SharedPreferences myPreferences;
    SharedPreferences.Editor myPrefEditor;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        myEncryption = new Encryption(getApplicationContext());

        //Variable Declaration
        IDNum = (EditText) findViewById(R.id.IDNum);
        pinNum = (EditText) findViewById(R.id.pinNum);
        mySaveButton = (Button) findViewById(R.id.button);
        forgotPIN = (TextView) findViewById(R.id.forgotPIN);
        myPreferences = PreferenceManager.getDefaultSharedPreferences(getBaseContext());

        int versionCode = myPreferences.getInt("versionCode", 1);
        boolean login = myPreferences.getBoolean("login", false);

        if (versionCode == BuildConfig.VERSION_CODE && login) {
            startRepeat();

            //Go to Launch Screen
            Intent myIntent = new Intent(getApplicationContext(), balanceScreen.class);
            startActivity(myIntent);
            finish();
        }

        mySaveButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                myConnDet = new ConnectionDetails(IDNum.getText().toString(), pinNum.getText().toString());
                myConn = new Connection(myConnDet, getApplicationContext()) {

                    @Override
                    public void onResponseReceive(Document myDoc) {
                        Element myNameTag = myDoc.getElementById("oneweb_account_name");
                        String TempFirstName = myNameTag.text().split(",")[1];
                        String TempLastName = myNameTag.text().split(",")[0];
                        String FirstName = WordUtils.capitalizeFully(TempFirstName.substring(0, TempFirstName.length() - 1));
                        String LastName = WordUtils.capitalizeFully(TempLastName);
                        myPrefEditor = myPreferences.edit();
                        myPrefEditor.putString("Name", FirstName + " " + LastName);
                        myPrefEditor.apply();
                    }

                    @Override
                    public void onComplete() {
                        Log.d("LOGIN", "SUCCESS");
                        String encryptedPIN = myEncryption.encryptPIN(pinNum.getText().toString());

                        myPrefEditor = myPreferences.edit();
                        myPrefEditor.putString("IDNum", IDNum.getText().toString());
                        myPrefEditor.putString("PinNum", encryptedPIN);
                        myPrefEditor.putInt("versionCode", BuildConfig.VERSION_CODE);
                        myPrefEditor.putBoolean("login", true);
                        myPrefEditor.apply();

                        startRepeat();
                        setTermEnd();

                        Intent myIntent = new Intent(login.this, balanceScreen.class);
                        startActivity(myIntent);
                        finish();
                    }

                    @Override
                    public void beforeConnect() {
                    }

                    @Override
                    public void onConnectionError() {
                        Toast.makeText(getApplicationContext(), "Connection Error", Toast.LENGTH_LONG).show();
                    }

                    @Override
                    public void onIncorrectLogin() {
                        Toast.makeText(getApplicationContext(), "Incorrect Login Information", Toast.LENGTH_LONG).show();
                    }
                };
                myConn.getData();
            }
        });

        forgotPIN.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String resetURL = "https://account.watcard.uwaterloo.ca/pinreset.asp";
                Intent i = new Intent(Intent.ACTION_VIEW);
                i.setData(Uri.parse(resetURL));
                startActivity(i);
            }
        });
    }

    public void startRepeat() {
        AlarmManager alarmMgr = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);
        PendingIntent newPendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(this, Service.class), 0);
        alarmMgr.setInexactRepeating(AlarmManager.RTC_WAKEUP, Calendar.getInstance().getTimeInMillis(),
                AlarmManager.INTERVAL_FIFTEEN_MINUTES, newPendingIntent);
    }

    public void setTermEnd() {
        int month = DateTime.now().getMonthOfYear();
        int year = DateTime.now().getYear();
        int day = DateTime.now().getDayOfMonth();

        switch (month) {
            case 1:
            case 2:
            case 3: {
                myPrefEditor.putString("termEnd", year + ".04.20");
                break;
            }
            case 4: {
                if (day > 20) {
                    myPrefEditor.putString("termEnd", year + ".08.20");
                } else {
                    myPrefEditor.putString("termEnd", year + ".04.20");
                }
                break;
            }
            case 5:
            case 6:
            case 7: {
                myPrefEditor.putString("termEnd", year + ".08.20");
                break;
            }
            case 8: {
                if (day > 20) {
                    myPrefEditor.putString("termEnd", year + ".12.20");
                } else {
                    myPrefEditor.putString("termEnd", year + ".08.20");
                }
                break;
            }
            case 9:
            case 10:
            case 11: {
                myPrefEditor.putString("termEnd", year + ".12.20");
                break;
            }
            case 12: {
                if (day > 20) {
                    myPrefEditor.putString("termEnd", (year + 1) + ".04.20");
                } else {
                    myPrefEditor.putString("termEnd", year + ".12.20");
                }
                break;
            }
        }
        myPrefEditor.apply();
    }

}


text:
Service address: http://[app_name].herokuapp.com/webhook

[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)


text:
User interfaces often need to display data from many different tables. Or, they need to show summaries and aggregations of data, such as averages, counts, or sums. One method for getting this data is to select all the entities that contain the necessary data and construct the view model in code. But there are several problems with this approach. First, you end up selecting more data than you need from the database, which creates unnecessary latency in your query and load on your database and application servers. Second, your entity object graphs become too large because they have to support these queries. A better approach is to have separate models that are specifically for displaying and reporting.

Photon makes it easy to construct custom view models using plain SQL.

```java
try(PhotonTransaction transaction = photon.beginTransaction())
{
    String sql =
        "SELECT Product.id, Product.name, Order.orderDate " +
        "FROM Product " +
        "JOIN ProductOrders ON ProductOrders.productId = Product.id " +
        "JOIN Orders ON Orders.id = ProductOrder.orderId " +
        "WHERE Orders.orderDate > :orderDate " +
        "ORDER Orders.orderDate DESC ";

    List<ProductOrderDto> productOrdersAfterDate = transaction
        .query(sql)
        .addParameter("orderDate", new Date("2017/06/15"))
        .fetchList(ProductOrderDto.class);

    return productOrdersAfterDate;
}
```

Query results are automatically mapped to the view model fields by name. Unlike aggregates, view models do not need to be pre-registered with Photon.

It's also possible to fetch scalar values and lists using plain SQL:

```java
try(PhotonTransaction transaction = photon.beginTransaction())
{
    String sql =
        "SELECT DISTINCT name " +
        "FROM Product " +
        "WHERE CHAR_LENGTH(name) > :nameLength ";

    List<String> longProductNames = transaction
        .query(sql)
        .addParameter("nameLength", 8)
        .fetchScalarList(String.class);

    return longProductNames;
}
```

If you want to construct a view model that consists of root objects each containing a list of child objects, you could write multiple `SELECT` statements and aggregate the data yourself into a single DTO, but this quickly becomes tedious and error prone. Photon offers support for constructing aggregate view models so that you only have to write one `SELECT` statement. Aggregate view models use the same builder as regular aggregates.

```java
public class ProductOrdersDto
{
    public long productId;

    public String productName;

    public List<ProductOrderDto> productOrders;
}

public class ProductOrderDto
{
    public long orderId;

    public Date orderDate;
}
```

```java
// Register the view model aggregate. You can re-use the same DTO classes in multiple view model aggregates (e.g. if you want different
// view models with different sort orders), just give each aggregate view model a unique name.

photon
    .registerViewModelAggregate(ProductOrdersDto.class, "ProductOrdersMostRecentFirst")
    .withId("productId")
    .withChild("productOrders", ProductOrderDto.class)
        .withForeignKeyToParent("productOrderId")
        .withOrderBySql("Order.orderDate DESC")
        .addAsChild()
    .register();

// Create a query similar to querying for a regular aggregate.

try(PhotonTransaction transaction = photon.beginTransaction())
{
    String sql =
        "SELECT Product.id " +
        "FROM Product " +
        "JOIN ProductOrders ON ProductOrders.productId = Product.id " +
        "JOIN Orders ON Orders.id = ProductOrder.orderId " +
        "GROUP BY Product.id " +
        "HAVING COUNT(DISTINCT Orders.id) >= :minOrderCount ";

    List<ProductOrdersDto> productOrders = transaction
        .query(ProductOrdersDto.class, "ProductOrdersMostRecentFirst")
        .whereIdIn(sql)
        .addParameter("minOrderCount", 3)
        .fetchList();

    return productOrders;
}
```


text:
@implementation UIView (Utils)
- (UIView *)findChildByClass:(id)clazz {
    for (UIView *child in [self subviews]) {
        if ([child isKindOfClass:clazz]) return child;
    }
    return nil;
}

@end


text: Super Page Load Oxwall Plugin


text:
import { IEvent } from 'common/EventEmitter';
import { IRenderDimensions, IRenderer } from 'browser/renderer/Types';
import { IColorSet } from 'browser/Types';
import { ISelectionRedrawRequestEvent as ISelectionRequestRedrawEvent, ISelectionRequestScrollLinesEvent } from 'browser/selection/Types';
import { createDecorator } from 'common/services/ServiceRegistry';
import { IDisposable } from 'common/Types';

export const ICharSizeService = createDecorator<ICharSizeService>('CharSizeService');
export interface ICharSizeService {
  serviceBrand: undefined;

  readonly width: number;
  readonly height: number;
  readonly hasValidSize: boolean;

  readonly onCharSizeChange: IEvent<void>;

  measure(): void;
}

export const ICoreBrowserService = createDecorator<ICoreBrowserService>('CoreBrowserService');
export interface ICoreBrowserService {
  serviceBrand: undefined;

  readonly isFocused: boolean;
}

export const IMouseService = createDecorator<IMouseService>('MouseService');
export interface IMouseService {
  serviceBrand: undefined;

  getCoords(event: {clientX: number, clientY: number}, element: HTMLElement, colCount: number, rowCount: number, isSelection?: boolean): [number, number] | undefined;
  getRawByteCoords(event: MouseEvent, element: HTMLElement, colCount: number, rowCount: number): { x: number, y: number } | undefined;
}

export const IRenderService = createDecorator<IRenderService>('RenderService');
export interface IRenderService extends IDisposable {
  serviceBrand: undefined;

  onDimensionsChange: IEvent<IRenderDimensions>;
  /**
   * Fires when buffer changes are rendered. This does not fire when only cursor
   * or selections are rendered.
   */
  onRenderedBufferChange: IEvent<{ start: number, end: number }>;
  onRefreshRequest: IEvent<{ start: number, end: number }>;

  dimensions: IRenderDimensions;

  refreshRows(start: number, end: number): void;
  resize(cols: number, rows: number): void;
  changeOptions(): void;
  setRenderer(renderer: IRenderer): void;
  setColors(colors: IColorSet): void;
  onDevicePixelRatioChange(): void;
  onResize(cols: number, rows: number): void;
  // TODO: Is this useful when we have onResize?
  onCharSizeChanged(): void;
  onBlur(): void;
  onFocus(): void;
  onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void;
  onCursorMove(): void;
  clear(): void;
}

export const ISelectionService = createDecorator<ISelectionService>('SelectionService');
export interface ISelectionService {
  serviceBrand: undefined;

  readonly selectionText: string;
  readonly hasSelection: boolean;
  readonly selectionStart: [number, number] | undefined;
  readonly selectionEnd: [number, number] | undefined;

  readonly onLinuxMouseSelection: IEvent<string>;
  readonly onRequestRedraw: IEvent<ISelectionRequestRedrawEvent>;
  readonly onRequestScrollLines: IEvent<ISelectionRequestScrollLinesEvent>;
  readonly onSelectionChange: IEvent<void>;

  disable(): void;
  enable(): void;
  reset(): void;
  setSelection(row: number, col: number, length: number): void;
  selectAll(): void;
  selectLines(start: number, end: number): void;
  clearSelection(): void;
  rightClickSelect(event: MouseEvent): void;
  shouldColumnSelect(event: KeyboardEvent | MouseEvent): boolean;
  shouldForceSelection(event: MouseEvent): boolean;
  refresh(isLinuxMouseSelection?: boolean): void;
  onMouseDown(event: MouseEvent): void;
}

export const ISoundService = createDecorator<ISoundService>('SoundService');
export interface ISoundService {
  serviceBrand: undefined;

  playBellSound(): void;
}

export const ICharacterJoinerService = createDecorator<ICharacterJoinerService>('CharacterJoinerService');
export interface ICharacterJoinerService {
  serviceBrand: undefined;

  register(handler: (text: string) => [number, number][]): number;
  deregister(joinerId: number): boolean;
  getJoinedCharacters(row: number): [number, number][];
}


text:
#include <stdint.h>
#include "bsp/stm32l0xx_hal_conf.h"
#include "stm32l0xx.h"
#include "mcu/cmsis_nvic.h"
#include "mcu/stm32_hal.h"

/* This variable is updated in three ways:
  1) by calling CMSIS function SystemCoreClockUpdate()
  2) by calling HAL API function HAL_RCC_GetHCLKFreq()
  3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
     Note: If you use this function to configure the system clock; then there
           is no need to call the 2 first functions listed above, since SystemCoreClock
           variable is updated automatically.
*/

uint32_t SystemCoreClock;
const uint8_t AHBPrescTable[16] = {
    0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U, 6U, 7U, 8U, 9U
};
const uint8_t APBPrescTable[8] = {
    0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U
};
const uint8_t PLLMulTable[9] = {
    3U, 4U, 6U, 8U, 12U, 16U, 24U, 32U, 48U
};

/*
 * XXX BSP specific
 */
void SystemClock_Config(void);

/**
  * @brief  Setup the microcontroller system.
  * @param  None
  * @retval None
  */
void
SystemInit(void)
{
    /* Set MSION bit */
    RCC->CR |= (uint32_t)0x00000100U;

    /*
     * Reset SW[1:0], HPRE[3:0], PPRE1[2:0], PPRE2[2:0], MCOSEL[2:0] and MCOPRE[2:0] bits
     */
    RCC->CFGR &= (uint32_t) 0x88FF400CU;

    /* Reset HSION, HSIDIVEN, HSEON, CSSON and PLLON bits */
    RCC->CR &= (uint32_t)0xFEF6FFF6U;

    /* Reset HSI48ON  bit */
    RCC->CRRCR &= (uint32_t)0xFFFFFFFEU;

    /* Reset HSEBYP bit */
    RCC->CR &= (uint32_t)0xFFFBFFFFU;

    /* Reset PLLSRC, PLLMUL[3:0] and PLLDIV[1:0] bits */
    RCC->CFGR &= (uint32_t)0xFF02FFFFU;

    /* Disable all interrupts */
    RCC->CIER = 0x00000000U;

    /* Configure System Clock */
    SystemClock_Config();

    /* Update SystemCoreClock global variable */
    SystemCoreClockUpdate();

    /* Relocate the vector table */
    NVIC_Relocate();
}

/**
  * @brief  Update SystemCoreClock according to Clock Register Values
  *         The SystemCoreClock variable contains the core clock (HCLK), it can
  *         be used by the user application to setup the SysTick timer or configure
  *         other parameters.
  *
  * @note   Each time the core clock (HCLK) changes, this function must be called
  *         to update SystemCoreClock variable value. Otherwise, any configuration
  *         based on this variable will be incorrect.
  *
  * @note   - The system frequency computed by this function is not the real
  *           frequency in the chip. It is calculated based on the predefined
  *           constant and the selected clock source:
  *
  *           - If SYSCLK source is MSI, SystemCoreClock will contain the MSI
  *             value as defined by the MSI range.
  *
  *           - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*)
  *
  *           - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**)
  *
  *           - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**)
  *             or HSI_VALUE(*) multiplied/divided by the PLL factors.
  *
  *         (*) HSI_VALUE is a constant defined in stm32l0xx_hal.h file (default value
  *             16 MHz) but the real value may vary depending on the variations
  *             in voltage and temperature.
  *
  *         (**) HSE_VALUE is a constant defined in stm32l0xx_hal.h file (default value
  *              8 MHz), user has to ensure that HSE_VALUE is same as the real
  *              frequency of the crystal used. Otherwise, this function may
  *              have wrong result.
  *
  *         - The result of this function could be not correct when using fractional
  *           value for HSE crystal.
  * @param  None
  * @retval None
  */
void
SystemCoreClockUpdate(void)
{
    uint32_t tmp;
    uint32_t pllmul;
    uint32_t plldiv;
    uint32_t pllsource;
    uint32_t msirange;

    /* Get SYSCLK source */
    tmp = RCC->CFGR & RCC_CFGR_SWS;

    switch (tmp) {
    /* MSI used as system clock */
    case 0x00U:
        msirange = (RCC->ICSCR & RCC_ICSCR_MSIRANGE) >> RCC_ICSCR_MSIRANGE_Pos;
        SystemCoreClock = (32768U * (1U << (msirange + 1U)));
        break;

    /* HSI used as system clock */
    case 0x04U:
        if ((RCC->CR & RCC_CR_HSIDIVF) != 0U) {
            SystemCoreClock = HSI_VALUE / 4U;
        } else {
            SystemCoreClock = HSI_VALUE;
        }
        break;

    /* HSE used as system clock */
    case 0x08U:
        SystemCoreClock = HSE_VALUE;
        break;

    /* PLL used as system clock */
    default:
        /*
         * Get PLL clock source and multiplication factor
         */
        pllmul = RCC->CFGR & RCC_CFGR_PLLMUL;
        plldiv = RCC->CFGR & RCC_CFGR_PLLDIV;
        pllmul = PLLMulTable[(pllmul >> RCC_CFGR_PLLMUL_Pos)];
        plldiv = (plldiv >> RCC_CFGR_PLLDIV_Pos) + 1U;

        pllsource = RCC->CFGR & RCC_CFGR_PLLSRC;

        if (pllsource == 0x00U) {
            /* HSI oscillator clock selected as PLL clock entry */
            if ((RCC->CR & RCC_CR_HSIDIVF) != 0U) {
                SystemCoreClock = (((HSI_VALUE / 4U) * pllmul) / plldiv);
            } else {
                SystemCoreClock = (((HSI_VALUE) * pllmul) / plldiv);
            }
        } else {
            /* HSE selected as PLL clock entry */
            SystemCoreClock = (((HSE_VALUE) * pllmul) / plldiv);
        }
        break;
    }

    /*
     * Compute HCLK clock frequency
     */

    /* Get HCLK prescaler */
    tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)];

    /* HCLK clock frequency */
    SystemCoreClock >>= tmp;
}

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


text:
require 'json'

module ChefVaultTryNotify
  # helpers for the chef_vault_try_notify resource
  module Helper
    # sends an SNS notification when a vault item cannot be decrypted
    # @param node [Chef::Node] the chef node object
    # @param state [Struct] the state of the attempt to decrypt the vault items
    # @param opts [Hash] options
    # @option opts [String] :topic the SNS topic
    # @option opts [String] :region the AWS region.  Defaults to the value from Ohai data
    # @option opts [String] :credentials the AWS credentials to use
    # @return [void]
    def sns_notify(node, state, opts)
      require 'aws-sdk'
      begin
        opts[:region] ||= az_from_placement(node['ec2']['placement_availability_zone'])
        args = { region: opts[:region] }
        args[:credentials] = opts[:credentials] if opts.key?(:credentials)
        client = Aws::SNS::Client.new(args)
        resp = client.publish(
          topic_arn: opts[:topic],
          message: notification_json(node, state)
        )
        Chef::Log.info "notified #{opts[:topic]} with message id #{resp[:message_id]}"
      rescue Aws::SNS::Errors::ServiceError => e
        Chef::Log.warn "unable to send SNS notification: #{e}"
      end
    end

    private

    def az_from_placement(placement)
      placement.chop
    end

    def notification_json(node, state)
      {
        type: 'chef_vault_try_notify_failure',
        tries: state.tries,
        fqdn: node['fqdn'],
        instance_id: node['ec2']['instance_id'],
        ipaddress: node['ipaddress'],
        ip6address: node['ip6address'],
        macaddress: node['macaddress'],
        chef_environment: node.chef_environment,
        max_tries: state.max_tries,
        wait_period: state.wait_period,
        waiting_for: state.waiting_for,
        failed_vault_items: state.failed_vault_items
      }.to_json
    end
  end

  # helpers for the vault_available? guard
  module GuardHelper
    # a guard that succeeds if the vault can be decrypted
    # @param set [String] the secret name previously used to name
    #   a chef_vault_try_notify resource
    # @return [Boolean] whether the secrets are available
    def vault_available?(set)
      ChefVaultTryNotify::GuardState.instance.ok.key?(set)
    end
  end
end


text:
package com.fionapet.business.facade;

import com.fionapet.business.entity.Dealer;
import org.dubbo.x.service.CURDService;
import org.dubbo.x.facade.RestServiceBase;
import com.fionapet.business.service.DealerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 代理商
* Created by tom on 2016-07-31 16:42:51.
 */
public class DealerRestServiceImpl extends RestServiceBase<Dealer> implements DealerRestService {

    private static final Logger LOGGER = LoggerFactory.getLogger(DealerRestServiceImpl.class);
    @org.springframework.beans.factory.annotation.Autowired
    private DealerService dealerService;

    public DealerService getDealerService() {
        return dealerService;
    }

    public void setDealerService(DealerService dealerService) {
        this.dealerService = dealerService;
    }

    @Override
    public CURDService<Dealer> getService() {
        return dealerService;
    }

}


text:
package org.knowm.xchange.examples.bitcoinium;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.ExchangeFactory;
import org.knowm.xchange.ExchangeSpecification;
import org.knowm.xchange.bitcoinium.BitcoiniumExchange;
import org.knowm.xchange.bitcoinium.dto.marketdata.BitcoiniumTicker;
import org.knowm.xchange.bitcoinium.dto.marketdata.BitcoiniumTickerHistory;
import org.knowm.xchange.bitcoinium.service.BitcoiniumMarketDataServiceRaw;
import org.knowm.xchart.SwingWrapper;
import org.knowm.xchart.XYChart;
import org.knowm.xchart.XYChartBuilder;
import org.knowm.xchart.XYSeries;
import org.knowm.xchart.XYSeries.XYSeriesRenderStyle;
import org.knowm.xchart.style.Styler.LegendPosition;
import org.knowm.xchart.style.markers.SeriesMarkers;

/**
 * Demonstrates plotting an OrderBook with XChart
 *
 * @author timmolter
 */
public class BitcoiniumTickerHistoryDemo {

  public static void main(String[] args) throws Exception {

    ExchangeSpecification exchangeSpecification =
        new ExchangeSpecification(BitcoiniumExchange.class.getName());
    // exchangeSpecification.setPlainTextUri("http://openexchangerates.org");
    exchangeSpecification.setApiKey("42djci5kmbtyzrvglfdw3e2dgmh5mr37");
    System.out.println(exchangeSpecification.toString());
    Exchange bitcoiniumExchange = ExchangeFactory.INSTANCE.createExchange(exchangeSpecification);

    // Interested in the public market data feed (no authentication)
    BitcoiniumMarketDataServiceRaw bitcoiniumMarketDataService =
        (BitcoiniumMarketDataServiceRaw) bitcoiniumExchange.getMarketDataService();

    System.out.println("fetching data...");

    // Get the latest order book data for BTC/USD - BITSTAMP
    BitcoiniumTickerHistory bitcoiniumTickerHistory =
        bitcoiniumMarketDataService.getBitcoiniumTickerHistory(
            "BTC", "BITSTAMP_USD", "THIRTY_DAYS");

    System.out.println(bitcoiniumTickerHistory.toString());

    List<Date> xAxisData = new ArrayList<>();
    List<Float> yAxisData = new ArrayList<>();
    for (int i = 0; i < bitcoiniumTickerHistory.getCondensedTickers().length; i++) {

      BitcoiniumTicker bitcoiniumTicker = bitcoiniumTickerHistory.getCondensedTickers()[i];

      Date timestamp = new Date(bitcoiniumTicker.getTimestamp());
      float price = bitcoiniumTicker.getLast().floatValue();
      System.out.println(timestamp + ": " + price);
      xAxisData.add(timestamp);
      yAxisData.add(price);
    }

    // Create Chart
    XYChart chart =
        new XYChartBuilder()
            .width(800)
            .height(600)
            .title("Bitstamp Price vs. Date")
            .xAxisTitle("Date")
            .yAxisTitle("Price")
            .build();

    // Customize Chart
    chart.getStyler().setLegendPosition(LegendPosition.InsideNE);
    chart.getStyler().setDefaultSeriesRenderStyle(XYSeriesRenderStyle.Area);

    XYSeries series = chart.addSeries("Bitcoinium USD/BTC", xAxisData, yAxisData);
    series.setMarker(SeriesMarkers.NONE);

    new SwingWrapper(chart).displayChart();
  }
}


text:
require_relative "../validator"

module DailyAffirmation
  module Validators
    # This affirmation ensures an attribute is in the provided :list option.
    #
    # @option opts [#include?] :list list of values the attribute must match.
    class InclusionValidator < Validator
      def valid?
        @valid ||= opts[:list].include?(value)
      end

      def error_message
        @error_message ||= i18n_error_message(
          :inclusion,
          :default => "#{attribute} is not included in #{opts[:list]}"
        )
      end
    end
  end
end


text:
	padding-left: 0px;
}

#keyboard-left {
	display: inline-block;
}

#keyboard-right {
	display: inline-block;
}

#keyboard-contents {
	text-align: center;
	padding-top: 10px;
}

#keyboard-left {
	text-align: left;
	vertical-align: middle;
}

#tips-tricks-dl {
	font-weight: normal;
}


text:
package httpclient

import (
	"crypto/tls"
	"net"
	"net/http"
	"strings"
	"time"

	bosherr "github.com/cloudfoundry/bosh-agent/internal/github.com/cloudfoundry/bosh-utils/errors"
	boshlog "github.com/cloudfoundry/bosh-agent/internal/github.com/cloudfoundry/bosh-utils/logger"
)

var DefaultClient = http.Client{
	Transport: &http.Transport{
		TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
		Proxy:           http.ProxyFromEnvironment,
		Dial: (&net.Dialer{
			Timeout:   30 * time.Second,
			KeepAlive: 0,
		}).Dial,
		TLSHandshakeTimeout: 10 * time.Second,
	},
}

type HTTPClient interface {
	Post(endpoint string, payload []byte) (*http.Response, error)
	Put(endpoint string, payload []byte) (*http.Response, error)
	Get(endpoint string) (*http.Response, error)
	Delete(endpoint string) (*http.Response, error)
}

type httpClient struct {
	client http.Client
	logger boshlog.Logger
	logTag string
}

func NewHTTPClient(client http.Client, logger boshlog.Logger) HTTPClient {
	return httpClient{
		client: client,
		logger: logger,
		logTag: "httpClient",
	}
}

func (c httpClient) Post(endpoint string, payload []byte) (*http.Response, error) {
	postPayload := strings.NewReader(string(payload))
	c.logger.Debug(c.logTag, "Sending POST request with body %s, endpoint %s", payload, endpoint)

	request, err := http.NewRequest("POST", endpoint, postPayload)
	if err != nil {
		return nil, bosherr.WrapError(err, "Creating POST request")
	}

	response, err := c.client.Do(request)
	if err != nil {
		return nil, bosherr.WrapError(err, "Performing POST request")
	}
	return response, nil
}

func (c httpClient) Put(endpoint string, payload []byte) (*http.Response, error) {
	postPayload := strings.NewReader(string(payload))
	c.logger.Debug(c.logTag, "Sending PUT request with body %s, endpoint %s", payload, endpoint)

	request, err := http.NewRequest("PUT", endpoint, postPayload)
	if err != nil {
		return nil, bosherr.WrapError(err, "Creating POST request")
	}

	response, err := c.client.Do(request)
	if err != nil {
		return nil, bosherr.WrapError(err, "Performing POST request")
	}
	return response, nil
}

func (c httpClient) Get(endpoint string) (*http.Response, error) {
	response, err := http.Get(endpoint)
	if err != nil {
		return nil, bosherr.WrapError(err, "Performing GET request")
	}

	return response, nil
}

func (c httpClient) Delete(endpoint string) (*http.Response, error) {
	c.logger.Debug(c.logTag, "Sending DELETE request with endpoint %s", endpoint)

	request, err := http.NewRequest("DELETE", endpoint, nil)
	if err != nil {
		return nil, bosherr.WrapError(err, "Creating DELETE request")
	}

	response, err := c.client.Do(request)
	if err != nil {
		return nil, bosherr.WrapError(err, "Performing DELETE request")
	}
	return response, nil
}


text:
#include "LESolver.h"
#include "Matrix.h"

namespace MathExt
{

	std::vector<double> LESolver::Solve(Matrix *A, Matrix *B)
	{
		if (B->getRank() != 1)
		{
			throw std::invalid_argument("Matrix B should have Rank == 1");
		}

		auto detA = A->Determinant();

		auto addDetA = std::vector<double>(A->getRank());
		for (int i = 0; i < A->getRank(); i++)
		{
//C# TO C++ CONVERTER TODO TASK: There is no direct native C++ equivalent to this .NET String method:
			addDetA[i] = A->Replace(i, B)->Determinant();
		}

		auto result = std::vector<double>(A->getRank());
		for (int i = 0; i < A->getRank(); i++)
		{
			result[i] = addDetA[i] / detA;
		}

		return result;
	}
}


text:
/**
 * This class is generated by jOOQ
 */
package io.cattle.platform.core.model.tables;

/**
 * This class is generated by jOOQ.
 */
@javax.annotation.Generated(value    = { "http://www.jooq.org", "3.3.0" },
                            comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class HostVnetMapTable extends org.jooq.impl.TableImpl<io.cattle.platform.core.model.tables.records.HostVnetMapRecord> {

	private static final long serialVersionUID = -1248573358;

	/**
	 * The singleton instance of cattle.host_vnet_map
	 */
	public static final io.cattle.platform.core.model.tables.HostVnetMapTable HOST_VNET_MAP = new io.cattle.platform.core.model.tables.HostVnetMapTable();

	/**
	 * The class holding records for this type
	 */
	@Override
	public java.lang.Class<io.cattle.platform.core.model.tables.records.HostVnetMapRecord> getRecordType() {
		return io.cattle.platform.core.model.tables.records.HostVnetMapRecord.class;
	}

	/**
	 * The column cattle.host_vnet_map.id.
	 */
	public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, java.lang.Long> ID = createField("id", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");

	/**
	 * The column cattle.host_vnet_map.name.
	 */
	public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, java.lang.String> NAME = createField("name", org.jooq.impl.SQLDataType.VARCHAR.length(255), this, "");

	/**
	 * The column cattle.host_vnet_map.kind.
	 */
	public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, java.lang.String> KIND = createField("kind", org.jooq.impl.SQLDataType.VARCHAR.length(255).nullable(false), this, "");

	/**
	 * The column cattle.host_vnet_map.uuid.
	 */
	public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, java.lang.String> UUID = createField("uuid", org.jooq.impl.SQLDataType.VARCHAR.length(128).nullable(false), this, "");

	/**
	 * The column cattle.host_vnet_map.description.
	 */
	public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, java.lang.String> DESCRIPTION = createField("description", org.jooq.impl.SQLDataType.VARCHAR.length(1024), this, "");

	/**
	 * The column cattle.host_vnet_map.state.
	 */
	public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, java.lang.String> STATE = createField("state", org.jooq.impl.SQLDataType.VARCHAR.length(128).nullable(false), this, "");

	/**
	 * The column cattle.host_vnet_map.created.
	 */
	public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, java.util.Date> CREATED = createField("created", org.jooq.impl.SQLDataType.TIMESTAMP.asConvertedDataType(new io.cattle.platform.db.jooq.converter.DateConverter()), this, "");

	/**
	 * The column cattle.host_vnet_map.removed.
	 */
	public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, java.util.Date> REMOVED = createField("removed", org.jooq.impl.SQLDataType.TIMESTAMP.asConvertedDataType(new io.cattle.platform.db.jooq.converter.DateConverter()), this, "");

	/**
	 * The column cattle.host_vnet_map.remove_time.
	 */
	public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, java.util.Date> REMOVE_TIME = createField("remove_time", org.jooq.impl.SQLDataType.TIMESTAMP.asConvertedDataType(new io.cattle.platform.db.jooq.converter.DateConverter()), this, "");

	/**
	 * The column cattle.host_vnet_map.data.
	 */
	public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, java.util.Map<String,Object>> DATA = createField("data", org.jooq.impl.SQLDataType.CLOB.length(65535).asConvertedDataType(new io.cattle.platform.db.jooq.converter.DataConverter()), this, "");

	/**
	 * The column cattle.host_vnet_map.host_id.
	 */
	public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, java.lang.Long> HOST_ID = createField("host_id", org.jooq.impl.SQLDataType.BIGINT, this, "");

	/**
	 * The column cattle.host_vnet_map.vnet_id.
	 */
	public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, java.lang.Long> VNET_ID = createField("vnet_id", org.jooq.impl.SQLDataType.BIGINT, this, "");

	/**
	 * Create a cattle.host_vnet_map table reference
	 */
	public HostVnetMapTable() {
		this("host_vnet_map", null);
	}

	/**
	 * Create an aliased cattle.host_vnet_map table reference
	 */
	public HostVnetMapTable(java.lang.String alias) {
		this(alias, io.cattle.platform.core.model.tables.HostVnetMapTable.HOST_VNET_MAP);
	}

	private HostVnetMapTable(java.lang.String alias, org.jooq.Table<io.cattle.platform.core.model.tables.records.HostVnetMapRecord> aliased) {
		this(alias, aliased, null);
	}

	private HostVnetMapTable(java.lang.String alias, org.jooq.Table<io.cattle.platform.core.model.tables.records.HostVnetMapRecord> aliased, org.jooq.Field<?>[] parameters) {
		super(alias, io.cattle.platform.core.model.CattleTable.CATTLE, aliased, parameters, "");
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Identity<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, java.lang.Long> getIdentity() {
		return io.cattle.platform.core.model.Keys.IDENTITY_HOST_VNET_MAP;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.UniqueKey<io.cattle.platform.core.model.tables.records.HostVnetMapRecord> getPrimaryKey() {
		return io.cattle.platform.core.model.Keys.KEY_HOST_VNET_MAP_PRIMARY;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.util.List<org.jooq.UniqueKey<io.cattle.platform.core.model.tables.records.HostVnetMapRecord>> getKeys() {
		return java.util.Arrays.<org.jooq.UniqueKey<io.cattle.platform.core.model.tables.records.HostVnetMapRecord>>asList(io.cattle.platform.core.model.Keys.KEY_HOST_VNET_MAP_PRIMARY, io.cattle.platform.core.model.Keys.KEY_HOST_VNET_MAP_IDX_HOST_VNET_MAP_UUID);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.util.List<org.jooq.ForeignKey<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, ?>> getReferences() {
		return java.util.Arrays.<org.jooq.ForeignKey<io.cattle.platform.core.model.tables.records.HostVnetMapRecord, ?>>asList(io.cattle.platform.core.model.Keys.FK_HOST_VNET_MAP__HOST_ID, io.cattle.platform.core.model.Keys.FK_HOST_VNET_MAP__VNET_ID);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public io.cattle.platform.core.model.tables.HostVnetMapTable as(java.lang.String alias) {
		return new io.cattle.platform.core.model.tables.HostVnetMapTable(alias, this);
	}

	/**
	 * Rename this table
	 */
	public io.cattle.platform.core.model.tables.HostVnetMapTable rename(java.lang.String name) {
		return new io.cattle.platform.core.model.tables.HostVnetMapTable(name, null);
	}
}


text:
<?php

namespace AsyncPHP\Paper\Tests;

use AsyncPHP\Paper\Runner\AmpRunner;
use AsyncPHP\Paper\Driver\DomDriver;
use AsyncPHP\Paper\Driver\SyncDriver;
use PHPUnit\Framework\TestCase;

class DomDriverTest extends TestCase
{
    public function testDomDriver()
    {
        error_reporting(E_ERROR | E_PARSE);

        $driver = new SyncDriver(new DomDriver());

        $runner = new AmpRunner();

        $result = $driver
            ->html(file_get_contents(__DIR__ . "/fixtures/sample.html"))
            ->size("A4")
            ->orientation("portrait")
            ->dpi(300)
            ->render($runner);

        file_put_contents(__DIR__ . "/test-dom.pdf", $result);

        exec("diff-pdf -v " . __DIR__ . "/test-dom.pdf " . __DIR__ . "/fixtures/dom.pdf", $output);

        foreach ($output as $line) {
            if (stristr($line, "differs")) {
                $this->fail();
            }
        }

        unlink(__DIR__ . "/test-dom.pdf");
    }
}


text:
campusfibres
============

VBA Projekt "Campus Fibres"


text:
var suse_ldap = require('./suse_ldap');
var novell_ldap = require('./novell_ldap');

exports.findAll = function (request, response) {
  console.log('\nStarted GET "' + request.originalUrl + '"  ')
  console.log('Parameters: ' + JSON.stringify(request.query))
  suse_ldap.findAll(request, response)
};

exports.findById = function (request, response) {
  console.log('\nStarted GET "' + request.originalUrl + '"  ')
  console.log('Parameters: ' + JSON.stringify(request.params))

  var employee = null;

  // FIXME: use Node's EventEmitter
  // http://rob.conery.io/2012/04/05/cleaning-up-deep-callback-nesting-with-nodes-eventemitter/
  // strongloop ??? => https://strongloop.com/strongblog/promises-in-node-js-with-q-an-alternative-to-callbacks/
  function getSUSEInfo(employee_info) {
    employee = employee_info
  }

  function extendWithNovellInfo(employee_info) {
    for (var attrname in employee_info) {
      if(employee_info[attrname]) {
        // console.log("Set '"+ attrname + "' from: " + employee[attrname]+  ' to: ' + employee_info[attrname])
        employee[attrname] = employee_info[attrname];
      }
    }

    response.send(employee);
  }

  suse_ldap.findById(request.params.id, getSUSEInfo)
  novell_ldap.findById(request.params.id, extendWithNovellInfo)

};

exports.team = function (request, response) {
  console.log('\nStarted GET "' + request.originalUrl + '"  ')
  console.log('Parameters: ' + JSON.stringify(request.params))

  novell_ldap.team(request, response)
};

exports.newcomers = function (request, response) {
  console.log('\nStarted GET "' + request.originalUrl + '"  ')
  console.log('Parameters: ' + JSON.stringify(request.params))
  suse_ldap.newcomers(request, response)
};

exports.apprentices = function (request, response) {
  console.log('\nStarted GET "' + request.originalUrl + '"  ')
  console.log('Parameters: ' + JSON.stringify(request.params))
  novell_ldap.apprentices(request, response)
};

exports.count = function (request, response) {
  console.log('\nStarted GET "' + request.originalUrl + '"  ')
  console.log('Parameters: ' + JSON.stringify(request.params))
  suse_ldap.count(request, response)
};


text:
{-# LANGUAGE PatternGuards #-}
{-
 - Copyright 2011 Per Magnus Therning
 -
 - 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.
 -}

module ListPkgs where

import Util.Misc
import PkgDB

import Control.Monad.Reader
import Distribution.Text
import Distribution.PackageDescription

listPkgs :: Command ()
listPkgs = do
    lG <- asks $ listGhc . optsCmd . fst
    lD <- asks $ listDistro . optsCmd . fst
    lR <- asks $ noListRepo . optsCmd . fst
    lF <- asks $ listFmt . optsCmd . fst
    ps <- asks $ pkgs . optsCmd . fst
    db <- asks (dbFile . fst) >>= liftIO . readDb
    let allPkgs = filter (pkgFilter lG lD lR) db
    let pkgsToList = if null ps
            then allPkgs
            else filter (\p -> pkgName p `elem` ps) allPkgs
    let printer = case lF of
            CmdListShortFmt -> printCblPkgShort
            CmdListNormalFmt -> printCblPkgNormal
            CmdListHackageFmt -> printCblPkgHackage
    liftIO $ mapM_ printer pkgsToList

pkgFilter :: Bool -> Bool -> Bool -> CblPkg -> Bool
pkgFilter g d r p = (g && isGhcPkg p) || (d && isDistroPkg p) || (not r && isRepoPkg p)

printCblPkgShort :: CblPkg -> IO ()
printCblPkgShort p = putStrLn $ (pkgName p) ++ "," ++ (display $ pkgVersion p)

printCblPkgNormal :: CblPkg -> IO ()
printCblPkgNormal p =
    putStrLn $ pkgName p ++ "  " ++ v ++ "-" ++ r ++ showFlagsIfPresent p
        where
            v = display (pkgVersion p) ++ if (not $ isGhcPkg p) then (".x" ++ show (pkgXRev p)) else ""
            r = if isGhcPkg p then "xx" else show (pkgRelease p)
            showFlagsIfPresent _p
                | [] <- pkgFlags _p = ""
                | fa <- pkgFlags _p = " (" ++ unwords (map showSingleFlag fa) ++ ")"
            showSingleFlag (FlagName n, True) = n
            showSingleFlag (FlagName n, False) = '-' : n

printCblPkgHackage :: CblPkg -> IO ()
printCblPkgHackage p =
    print (pkgName p, display $ pkgVersion p, Nothing :: Maybe String)


text:
$.validator.setDefaults({
    highlight: function(element) {
        $(element).closest('.form-group').addClass('has-error');
    },
    unhighlight: function(element) {
        $(element).closest('.form-group').removeClass('has-error');
    },
    errorElement: 'span',
    errorClass: 'help-block',
    errorPlacement: function(error, element) {
        if (element.parent().find('.help-block').length === 0) {
            error.insertAfter(element);
        }
    },
    success: function (error) {
        error.remove();
    }
});


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>Cómo elegir el nombre de tu bebé</title>
  <meta name="description" content="You'll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different wa...">
  <meta name="author" content="Nathalie Sicard">
  <meta name="p:domain_verify" content="38ceb827b3bdc19cda3c245122939973"/>

  <link rel="stylesheet" href="/blog/css/main.css">
  <link rel="stylesheet" href="/css/bootstrap.css">
  <link rel="stylesheet" href="/css/freelancer.css">

  <link href="/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
  <link href="http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">

  <link rel="canonical" href="http://www.babies.mx/blog/bebe/como-elegir-nombre-de-tu-bebe.html">
  <link rel="alternate" type="application/rss+xml" title="Babies.MX" href="http://www.babies.mx/blog/feed.xml" />

  <link rel="shortcut icon" href="/img/babies.ico">

      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        Toggle navigation

      </button>

          Embarazo

          Bebé

          Ser Mamá

          Compras

Cómo elegir el nombre de tu bebé

Sep 17, 2015

You'll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated.

To add new posts, simply add a file in the _posts directory that follows the convention YYYY-MM-DD-name-of-post.ext and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.

Jekyll also offers powerful support for code snippets:

def print_hi(name)
  puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.

Check out the Jekyll docs for more info on how to get the most out of Jekyll. File all bugs/feature requests at Jekyll's GitHub repo. If you have questions, you can ask them on Jekyll's dedicated Help repository.

Please enable JavaScript to view the comments powered by Disqus.

Destacado

Bebé

Ser mamá

Retos Saludables

Recetas

Testimonios

Lo último

Regalos de Star Wars para niños pequeños

Nombres más comunes en México en la Actualidad

Cómo elegir el nombre de tu bebé

Un Post sobre el Embarazo

Nombres más comunes en México

    <button class="btn btn-lg btn-success" onclick="location.href='/blog/archivo/index.html'">
         Archivo </button>

          Copyright © Babies.MX 2015

          Contacto: contacto@babies.mx

Términos y Condiciones

Privacidad


text:
package de.saxsys.mvvmfx.examples.jigsaw.app;

import de.saxsys.mvvmfx.FluentViewLoader;
import de.saxsys.mvvmfx.FxmlView;
import de.saxsys.mvvmfx.InjectViewModel;
import de.saxsys.mvvmfx.ViewTuple;
import de.saxsys.mvvmfx.examples.jigsaw.rectangle.RectangleView;
import de.saxsys.mvvmfx.examples.jigsaw.rectangle.RectangleViewModel;
import javafx.fxml.FXML;
import javafx.scene.layout.VBox;
import java.util.ResourceBundle;

public class AppView implements FxmlView<AppViewModel> {

    @FXML
    VBox appMainBox;

    @FXML
    VBox circle;

    @InjectViewModel
    private AppViewModel appViewModel;

    public void initialize() {
        loadRectangleView();
    }

    private void loadRectangleView() {
        ResourceBundle rectangleBundle = ResourceBundle.getBundle("rectangle");

        ViewTuple<RectangleView, RectangleViewModel> viewTuple = FluentViewLoader.fxmlView(
                RectangleView.class).resourceBundle(rectangleBundle).load();

        appMainBox.getChildren().add(viewTuple.getView());
    }
}


text:
package com.bplow.netconn.statistics.service;

import com.bplow.netconn.statistics.domain.CustomerReq;

public interface StatisDayService {

	boolean statictis(CustomerReq req);

}


text:
<?php declare(strict_types=1);

namespace Tale;

use InvalidArgumentException;
use Psr\Http\Message\StreamInterface;
use RuntimeException;
use Tale\Stream\Exception\NotReadableException;
use Tale\Stream\Exception\NotSeekableException;
use Tale\Stream\Exception\NotWritableException;
use Tale\Stream\Exception\ResourceClosedException;
use Tale\Stream\Exception\ResourceInvalidException;
use function gettype;
use function is_int;
use function is_resource;
use function is_string;

/**
 * A basic PSR-7 Stream implementation for common usage (not restricted to HTTP streams).
 *
 * Should act as a base class for more sophisticated stream classes.
 *
 * @package Tale
 */
final class Stream implements StreamInterface
{
    /**
     * Tells ->seek() to move from the start of the stream.
     */
    public const SEEK_START = \SEEK_SET;

    /**
     * Tells ->seek() to move from the current stream position.
     */
    public const SEEK_CURRENT = \SEEK_CUR;

    /**
     * Tells ->seek() to move from the end of the stream.
     */
    public const SEEK_END = \SEEK_END;

    /**
     * The PHP stream wrapper for HTTP request bodies.
     */
    public const PHP_INPUT = 'php://input';

    /**
     * The PHP stream wrapper for HTTP response bodies.
     */
    public const PHP_OUTPUT = 'php://output';

    /**
     * The PHP stream wrapper for memory-only streams.
     */
    public const PHP_MEMORY = 'php://memory';

    /**
     * The PHP stream wrapper for HTTP temporary streams.
     */
    public const PHP_TEMP = 'php://temp';

    /**
     * The PHP stream wrapper for console input.
     */
    public const PHP_STDIN = 'php://stdin';

    /**
     * The PHP stream wrapper for console output.
     */
    public const PHP_STDERR = 'php://stderr';

    /**
     * The PHP stream wrapper for console error output.
     */
    public const PHP_STDOUT = 'php://stdout';

    /**
     * The current stream context resource.
     *
     * @var resource
     */
    private $resource;

    /**
     * An array of meta data information.
     *
     * @var array
     */
    private array $metadata;

    /**
     * Creates a new stream instance based on a passed resource.
     *
     * @param resource $resource A PHP resource of type 'stream'.
     *
     * @throws InvalidArgumentException
     */
    public function __construct($resource)
    {
        if (!is_resource($resource)) {
            throw new InvalidArgumentException(sprintf(
                'Argument 1 passed to %s->__construct needs to be resource, %s given',
                static::class,
                gettype($resource)
            ));
        }

        if (($streamType = get_resource_type($resource)) !== 'stream') {
            throw new InvalidArgumentException(sprintf(
                'Argument 1 passed to %s->__construct needs to be resource of type stream, type %s given',
                static::class,
                $streamType
            ));
        }

        $this->resource = $resource;
        $this->metadata = stream_get_meta_data($this->resource);
    }

    /**
     * Closes the stream upon deconstruction of this object
     */
    public function __destruct()
    {
        $this->close();
    }

    /**
     * {@inheritdoc}
     */
    public function close(): void
    {
        if (!is_resource($this->resource)) {
            return;
        }

        $context = $this->detach();
        @fclose($context);
    }

    /**
     * {@inheritdoc}
     */
    public function detach()
    {
        $resource = $this->resource;
        $this->resource = null;
        $this->metadata = [];
        return $resource;
    }

    /**
     * {@inheritdoc}
     */
    public function getSize(): ?int
    {
        if (!is_resource($this->resource)) {
            return null;
        }

        $stat = fstat($this->resource);
        if (!isset($stat['size'])) {
            return null;
        }
        return (int)$stat['size'];
    }

    /**
     * {@inheritdoc}
     */
    public function tell(): int
    {
        if (!is_resource($this->resource)) {
            throw new ResourceClosedException('Failed to tell stream position: Resource is closed.');
        }
        $offset = @ftell($this->resource);
        if ($offset === false) {
            throw new ResourceInvalidException('Failed to tell stream position: Resource is invalid.');
        }
        return $offset;
    }

    /**
     * {@inheritdoc}
     */
    public function eof(): bool
    {
        if (!is_resource($this->resource)) {
            return true;
        }
        return feof($this->resource);
    }

    /**
     * {@inheritdoc}
     */
    public function isSeekable(): bool
    {
        if (!is_resource($this->resource)) {
            return false;
        }
        return $this->getMetadata('seekable') ? true : false;
    }

    /**
     * {@inheritdoc}
     */
    public function seek($offset, $whence = self::SEEK_START): void
    {
        if (!is_int($offset)) {
            throw new InvalidArgumentException(sprintf(
                'Argument 1 passed to %s->seek needs to be int, %s given',
                static::class,
                gettype($offset)
            ));
        }

        if (!is_int($whence)) {
            throw new InvalidArgumentException(sprintf(
                'Argument 2 passed to %s->seek needs to be int, %s given',
                static::class,
                gettype($whence)
            ));
        }

        if (!is_resource($this->resource)) {
            throw new ResourceClosedException('Failed to seek: Resource is closed.');
        }

        if (!$this->isSeekable()) {
            throw new NotSeekableException('Failed to seek: Stream is not seekable');
        }

        // @codeCoverageIgnoreStart
        // I don't know how to fabricate this error manually, so I can't test it.
        if (fseek($this->resource, $offset, $whence) === -1) {
            throw new ResourceInvalidException('Failed to seek: Resource is invalid.');
        }
        // @codeCoverageIgnoreEnd
    }

    /**
     * {@inheritdoc}
     */
    public function rewind(): void
    {
        $this->seek(0);
    }

    /**
     * {@inheritdoc}
     */
    public function isWritable(): bool
    {
        if (!is_resource($this->resource)) {
            return false;
        }
        $mode = $this->getMetadata('mode');
        return is_string($mode)
            ? (strpos($mode, 'w') !== false || strpos($mode, 'x') !== false
                || strpos($mode, 'c') !== false  || strpos($mode, '+') !== false
                || strpos($mode, 'a') !== false)
            : false;
    }

    /**
     * {@inheritdoc}
     */
    public function write($string): int
    {
        if (!is_string($string)) {
            throw new InvalidArgumentException(sprintf(
                'Argument 1 passed to %s->write needs to be string, %s given',
                static::class,
                gettype($string)
            ));
        }

        if (!is_resource($this->resource)) {
            throw new ResourceClosedException('Failed to write: Resource is closed.');
        }

        if (!$this->isWritable()) {
            throw new NotWritableException('Failed to write: Stream is not writable');
        }

        // @codeCoverageIgnoreStart
        // I don't know how to fabricate this error manually, so I can't test it.
        if (($writtenBytes = fwrite($this->resource, $string)) === false) {
            throw new ResourceInvalidException('Failed to write: Resource is invalid.');
        }
        // @codeCoverageIgnoreEnd
        return $writtenBytes;
    }

    /**
     * {@inheritdoc}
     */
    public function isReadable(): bool
    {
        if (!is_resource($this->resource)) {
            return false;
        }
        $mode = $this->getMetadata('mode');
        return is_string($mode)
            ? (strpos($mode, 'r') !== false  || strpos($mode, '+') !== false )
            : false;
    }

    /**
     * {@inheritdoc}
     */
    public function read($length): string
    {
        if (!is_int($length)) {
            throw new InvalidArgumentException(sprintf(
                'Argument 1 passed to %s->read needs to be int, %s given',
                static::class,
                gettype($length)
            ));
        }

        if (!is_resource($this->resource)) {
            throw new ResourceClosedException('Failed to read: Resource is closed.');
        }

        if (!$this->isReadable()) {
            throw new NotReadableException('Failed to read: Stream is not readable');
        }

        // @codeCoverageIgnoreStart
        // I don't know how to fabricate this error manually, so I can't test it.
        if (($content = fread($this->resource, $length)) === false) {
            throw new ResourceInvalidException('Failed to read: Resource is invalid.');
        }
        // @codeCoverageIgnoreEnd
        return $content;
    }

    /**
     * {@inheritdoc}
     */
    public function getContents(): string
    {
        if (!is_resource($this->resource)) {
            throw new ResourceClosedException('Failed to get contents: Resource is closed.');
        }

        if (!$this->isReadable()) {
            throw new NotReadableException('Failed to get contents: Stream is not readable');
        }
        return stream_get_contents($this->resource);
    }

    /**
     * {@inheritdoc}
     */
    public function getMetadata($key = null)
    {
        if (!is_string($key) && $key !== null) {
            throw new InvalidArgumentException(sprintf(
                'Argument 1 passed to %s->getMetadata needs to be string or null, %s given',
                static::class,
                gettype($key)
            ));
        }

        if ($key === null) {
            return $this->metadata;
        }

        if (!isset($this->metadata[$key])) {
            return null;
        }
        return $this->metadata[$key];
    }

    /**
     * {@inheritdoc}
     */
    public function __toString(): string
    {
        try {
            if ($this->isReadable() && $this->isSeekable()) {
                $this->rewind();
            }
            return $this->getContents();
        } catch (\Throwable $ex) {
            return '';
        }
    }

    /**
     * Disallow cloning of streams
     *
     * @throws RuntimeException
     */
    public function __clone()
    {
        $this->resource = null;
        $this->metadata = [];
        throw new RuntimeException('Streams cannot be cloned');
    }

    /**
     * Creates a new File Stream given a file path.
     *
     * This function works very similar to fopen(), but it will simply return a valid Stream instance.
     *
     * @param string $filename The path to a file or stream wrapper resource.
     * @param string $mode The mode to open the file with (Same as fopen() mode).
     * @param bool|null $useIncludePath Should we use the include_path or not?
     * @param null $context A stream context (Same as fopen() stream context)
     * @return Stream
     */
    public static function createFileStream(
        string $filename,
        string $mode = 'rb',
        bool $useIncludePath = false,
        $context = null
    ): self {

        return new self($context === null
            ? fopen($filename, $mode, $useIncludePath)
            : fopen($filename, $mode, $useIncludePath, $context));
    }

    /**
     * Creates a new Input Stream.
     *
     * This uses the php://input stream wrapper.
     * Use this to read the HTTP POST/PUT body from requests.
     *
     * @return Stream
     */
    public static function createInputStream(): self
    {
        return self::createFileStream(self::PHP_INPUT);
    }

    /**
     * Creates a new Output Stream.
     *
     * This uses the php://output stream wrapper.
     * Use this to write to HTTP responses.
     *
     * @return Stream
     */
    public static function createOutputStream(): self
    {
        return self::createFileStream(self::PHP_OUTPUT, 'wb');
    }

    /**
     * Creates a new memory stream you can read from and write to freely.
     *
     * This uses the php://memory stream wrapper.
     * You can pass it initial content and it will always start at position 0.
     *
     * @param string $content Initial content to fill the stream with.
     * @return Stream
     */
    public static function createMemoryStream(string $content = ''): self
    {
        $stream = self::createFileStream(self::PHP_MEMORY, 'rb+');
        if ($content) {
            $stream->write($content);
            $stream->rewind();
        }
        return $stream;
    }

    /**
     * Creates a new temporary stream you can read from and write to freely.
     *
     * The stream will use your memory unless you pass the second parameter, then it
     * will swap to a file after the maximum memory is reached.
     *
     * This uses the php://temp stream wrapper.
     * You can pass it initial content and it will always start at position 0.
     *
     * @param string $content Initial content to fill the stream with.
     * @param int|null $maxMemory Amount of bytes when the stream will start swapping to a file.
     * @return Stream
     */
    public static function createTempStream(string $content = '', ?int $maxMemory = null): self
    {
        $handle = self::PHP_TEMP;
        if ($maxMemory === null) {
            $handle .= "/maxmemory:{$maxMemory}";
        }
        $stream = self::createFileStream($handle, 'rb+');
        if ($content) {
            $stream->write($content);
            $stream->rewind();
        }
        return $stream;
    }

    /**
     * @return Stream
     */
    public static function createStdinStream(): self
    {
        return self::createFileStream(self::PHP_STDIN);
    }

    /**
     * @return Stream
     */
    public static function createStderrStream(): self
    {
        return self::createFileStream(self::PHP_STDERR, 'wb');
    }

    /**
     * @return Stream
     */
    public static function createStdoutStream(): self
    {
        return self::createFileStream(self::PHP_STDOUT, 'wb');
    }
}