text:
package fr.free.nrw.commons.contributions;

import static android.view.View.GONE;
import static android.view.View.VISIBLE;
import static fr.free.nrw.commons.di.NetworkingModule.NAMED_LANGUAGE_WIKI_PEDIA_WIKI_SITE;

import android.content.Context;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.AdapterDataObserver;
import androidx.recyclerview.widget.RecyclerView.ItemAnimator;
import androidx.recyclerview.widget.RecyclerView.OnItemTouchListener;
import androidx.recyclerview.widget.SimpleItemAnimator;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import fr.free.nrw.commons.Media;
import fr.free.nrw.commons.R;
import fr.free.nrw.commons.Utils;
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment;
import fr.free.nrw.commons.utils.DialogUtil;
import fr.free.nrw.commons.media.MediaClient;
import fr.free.nrw.commons.utils.ViewUtil;
import java.util.Locale;
import javax.inject.Inject;
import javax.inject.Named;
import org.wikipedia.dataclient.WikiSite;
import timber.log.Timber;

/**
 * Created by root on 01.06.2018.
 */

public class ContributionsListFragment extends CommonsDaggerSupportFragment implements
    ContributionsListContract.View, ContributionsListAdapter.Callback,
    WikipediaInstructionsDialogFragment.Callback {

  private static final String RV_STATE = "rv_scroll_state";

  @BindView(R.id.contributionsList)
  RecyclerView rvContributionsList;
  @BindView(R.id.loadingContributionsProgressBar)
  ProgressBar progressBar;
  @BindView(R.id.fab_plus)
  FloatingActionButton fabPlus;
  @BindView(R.id.fab_camera)
  FloatingActionButton fabCamera;
  @BindView(R.id.fab_gallery)
  FloatingActionButton fabGallery;
  @BindView(R.id.noContributionsYet)
  TextView noContributionsYet;
  @BindView(R.id.fab_layout)
  LinearLayout fab_layout;

  @Inject
  ContributionController controller;
  @Inject
  MediaClient mediaClient;

  @Named(NAMED_LANGUAGE_WIKI_PEDIA_WIKI_SITE)
  @Inject
  WikiSite languageWikipediaSite;

  @Inject
  ContributionsListPresenter contributionsListPresenter;

  private Animation fab_close;
  private Animation fab_open;
  private Animation rotate_forward;
  private Animation rotate_backward;

  private boolean isFabOpen;

  private ContributionsListAdapter adapter;

  private Callback callback;

  private final int SPAN_COUNT_LANDSCAPE = 3;
  private final int SPAN_COUNT_PORTRAIT = 1;

  private int contributionsSize;

  @Override
  public View onCreateView(
      final LayoutInflater inflater, @Nullable final ViewGroup container,
      @Nullable final Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.fragment_contributions_list, container, false);
    ButterKnife.bind(this, view);
    contributionsListPresenter.onAttachView(this);
    initAdapter();
    return view;
  }

  @Override
  public void onAttach(Context context) {
    super.onAttach(context);
    if (getParentFragment() != null && getParentFragment() instanceof ContributionsFragment) {
      callback = ((ContributionsFragment) getParentFragment());
    }
  }

  @Override
  public void onDetach() {
    super.onDetach();
    callback = null;//To avoid possible memory leak
  }

  private void initAdapter() {
    adapter = new ContributionsListAdapter(this, mediaClient);
  }

  @Override
  public void onViewCreated(final View view, @Nullable final Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    initRecyclerView();
    initializeAnimations();
    setListeners();
  }

  private void initRecyclerView() {
    final GridLayoutManager layoutManager = new GridLayoutManager(getContext(),
        getSpanCount(getResources().getConfiguration().orientation));
    rvContributionsList.setLayoutManager(layoutManager);

    //Setting flicker animation of recycler view to false.
    final ItemAnimator animator = rvContributionsList.getItemAnimator();
    if (animator instanceof SimpleItemAnimator) {
      ((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
    }

    contributionsListPresenter.setup();
    contributionsListPresenter.contributionList.observe(this.getViewLifecycleOwner(), list -> {
      contributionsSize = list.size();
      adapter.submitList(list);
      callback.notifyDataSetChanged();
    });
    rvContributionsList.setAdapter(adapter);
    adapter.registerAdapterDataObserver(new AdapterDataObserver() {
      @Override
      public void onItemRangeInserted(int positionStart, int itemCount) {
        super.onItemRangeInserted(positionStart, itemCount);
        if (itemCount > 0 && positionStart == 0) {
          if(adapter.getContributionForPosition(positionStart)!=null) {
            rvContributionsList.scrollToPosition(0);//Newly upload items are always added to the top
          }
        }
      }

      /**
       * Called whenever items in the list have changed
       * Calls viewPagerNotifyDataSetChanged() that will notify the viewpager
       */
      @Override
      public void onItemRangeChanged(final int positionStart, final int itemCount) {
        super.onItemRangeChanged(positionStart, itemCount);
        callback.viewPagerNotifyDataSetChanged();
      }
    });

    //Fab close on touch outside (Scrolling or taping on item triggers this action).
    rvContributionsList.addOnItemTouchListener(new OnItemTouchListener() {

      /**
       * Silently observe and/or take over touch events sent to the RecyclerView before
       * they are handled by either the RecyclerView itself or its child views.
       */
      @Override
      public boolean onInterceptTouchEvent(@NonNull RecyclerView rv, @NonNull MotionEvent e) {
        if (e.getAction() == MotionEvent.ACTION_DOWN) {
          if (isFabOpen) {
            animateFAB(isFabOpen);
          }
        }
        return false;
      }

      /**
       * Process a touch event as part of a gesture that was claimed by returning true
       * from a previous call to {@link #onInterceptTouchEvent}.
       *
       * @param rv
       * @param e  MotionEvent describing the touch event. All coordinates are in the
       *           RecyclerView's coordinate system.
       */
      @Override
      public void onTouchEvent(@NonNull RecyclerView rv, @NonNull MotionEvent e) {
        //required abstract method DO NOT DELETE
      }

      /**
       * Called when a child of RecyclerView does not want RecyclerView and its ancestors
       * to intercept touch events with {@link ViewGroup#onInterceptTouchEvent(MotionEvent)}.
       *
       * @param disallowIntercept True if the child does not want the parent to intercept
       *                          touch events.
       */
      @Override
      public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
        //required abstract method DO NOT DELETE
      }

    });
  }

  private int getSpanCount(final int orientation) {
    return orientation == Configuration.ORIENTATION_LANDSCAPE ?
        SPAN_COUNT_LANDSCAPE : SPAN_COUNT_PORTRAIT;
  }

  @Override
  public void onConfigurationChanged(final Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    // check orientation
    fab_layout.setOrientation(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE ?
        LinearLayout.HORIZONTAL : LinearLayout.VERTICAL);
    rvContributionsList
        .setLayoutManager(new GridLayoutManager(getContext(), getSpanCount(newConfig.orientation)));
  }

  private void initializeAnimations() {
    fab_open = AnimationUtils.loadAnimation(getActivity(), R.anim.fab_open);
    fab_close = AnimationUtils.loadAnimation(getActivity(), R.anim.fab_close);
    rotate_forward = AnimationUtils.loadAnimation(getActivity(), R.anim.rotate_forward);
    rotate_backward = AnimationUtils.loadAnimation(getActivity(), R.anim.rotate_backward);
  }

  private void setListeners() {
    fabPlus.setOnClickListener(view -> animateFAB(isFabOpen));
    fabCamera.setOnClickListener(view -> {
      controller.initiateCameraPick(getActivity());
      animateFAB(isFabOpen);
    });
    fabGallery.setOnClickListener(view -> {
      controller.initiateGalleryPick(getActivity(), true);
      animateFAB(isFabOpen);
    });
  }

  private void animateFAB(final boolean isFabOpen) {
    this.isFabOpen = !isFabOpen;
    if (fabPlus.isShown()) {
      if (isFabOpen) {
        fabPlus.startAnimation(rotate_backward);
        fabCamera.startAnimation(fab_close);
        fabGallery.startAnimation(fab_close);
        fabCamera.hide();
        fabGallery.hide();
      } else {
        fabPlus.startAnimation(rotate_forward);
        fabCamera.startAnimation(fab_open);
        fabGallery.startAnimation(fab_open);
        fabCamera.show();
        fabGallery.show();
      }
      this.isFabOpen = !isFabOpen;
    }
  }

  /**
   * Shows welcome message if user has no contributions yet i.e. new user.
   */
  @Override
  public void showWelcomeTip(final boolean shouldShow) {
    noContributionsYet.setVisibility(shouldShow ? VISIBLE : GONE);
  }

  /**
   * Responsible to set progress bar invisible and visible
   *
   * @param shouldShow True when contributions list should be hidden.
   */
  @Override
  public void showProgress(final boolean shouldShow) {
    progressBar.setVisibility(shouldShow ? VISIBLE : GONE);
  }

  @Override
  public void showNoContributionsUI(final boolean shouldShow) {
    noContributionsYet.setVisibility(shouldShow ? VISIBLE : GONE);
  }

  @Override
  public void onSaveInstanceState(@NonNull Bundle outState) {
    super.onSaveInstanceState(outState);
    final GridLayoutManager layoutManager = (GridLayoutManager) rvContributionsList
        .getLayoutManager();
    outState.putParcelable(RV_STATE, layoutManager.onSaveInstanceState());
  }

  @Override
  public void onViewStateRestored(@Nullable Bundle savedInstanceState) {
    super.onViewStateRestored(savedInstanceState);
    if (null != savedInstanceState) {
      final Parcelable savedRecyclerLayoutState = savedInstanceState.getParcelable(RV_STATE);
      rvContributionsList.getLayoutManager().onRestoreInstanceState(savedRecyclerLayoutState);
    }
  }

  @Override
  public void retryUpload(final Contribution contribution) {
    if (null != callback) {//Just being safe, ideally they won't be called when detached
      callback.retryUpload(contribution);
    }
  }

  @Override
  public void deleteUpload(final Contribution contribution) {
    contributionsListPresenter.deleteUpload(contribution);
  }

  @Override
  public void openMediaDetail(final int position, boolean isWikipediaButtonDisplayed) {
    if (null != callback) {//Just being safe, ideally they won't be called when detached
      callback.showDetail(position, isWikipediaButtonDisplayed);
    }
  }

  /**
   * Handle callback for wikipedia icon clicked
   *
   * @param contribution
   */
  @Override
  public void addImageToWikipedia(Contribution contribution) {
    DialogUtil.showAlertDialog(getActivity(),
        getString(R.string.add_picture_to_wikipedia_article_title),
        String.format(getString(R.string.add_picture_to_wikipedia_article_desc),
            Locale.getDefault().getDisplayLanguage()),
        () -> {
          showAddImageToWikipediaInstructions(contribution);
        }, () -> {
          // do nothing
        });
  }

  /**
   * Pauses the current upload
   * @param contribution
   */
  @Override
  public void pauseUpload(Contribution contribution) {
    ViewUtil.showShortToast(getContext(), R.string.pausing_upload);
    callback.pauseUpload(contribution);
  }

  /**
   * Resumes the current upload
   * @param contribution
   */
  @Override
  public void resumeUpload(Contribution contribution) {
    ViewUtil.showShortToast(getContext(), R.string.resuming_upload);
    callback.retryUpload(contribution);
  }

  /**
   * Display confirmation dialog with instructions when the user tries to add image to wikipedia
   *
   * @param contribution
   */
  private void showAddImageToWikipediaInstructions(Contribution contribution) {
    FragmentManager fragmentManager = getFragmentManager();
    WikipediaInstructionsDialogFragment fragment = WikipediaInstructionsDialogFragment
        .newInstance(contribution);
    fragment.setCallback(this::onConfirmClicked);
    fragment.show(fragmentManager, "WikimediaFragment");
  }

  public Media getMediaAtPosition(final int i) {
    if(adapter.getContributionForPosition(i) != null) {
      return adapter.getContributionForPosition(i).getMedia();
    }
    return null;
  }

  public int getTotalMediaCount() {
    return contributionsSize;
  }

  /**
   * Open the editor for the language Wikipedia
   *
   * @param contribution
   */
  @Override
  public void onConfirmClicked(@Nullable Contribution contribution, boolean copyWikicode) {
    if (copyWikicode) {
      String wikicode = contribution.getMedia().getWikiCode();
      Utils.copy("wikicode", wikicode, getContext());
    }

    final String url =
        languageWikipediaSite.mobileUrl() + "/wiki/" + contribution.getWikidataPlace()
            .getWikipediaPageTitle();
    Utils.handleWebUrl(getContext(), Uri.parse(url));
  }

  public Integer getContributionStateAt(int position) {
    return adapter.getContributionForPosition(position).getState();
  }

  public interface Callback {

    void notifyDataSetChanged();

    void retryUpload(Contribution contribution);

    void showDetail(int position, boolean isWikipediaButtonDisplayed);

    void pauseUpload(Contribution contribution);

    // Notify the viewpager that number of items have changed.
    void viewPagerNotifyDataSetChanged();
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="(C) Copyright 2005" />
<meta name="DC.rights.owner" content="(C) Copyright 2005" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="concept" name="DC.Type" />
<meta name="DC.Title" content="About locales" />
<meta scheme="URI" name="DC.Relation" content="ctoolsijtools11318.html" />
<meta scheme="URI" name="DC.Relation" content="ctoolsijtools45180.html" />
<meta scheme="URI" name="DC.Relation" content="ctoolsijtools70959.html" />
<meta scheme="URI" name="DC.Relation" content="ctoolsijtools90477.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="ctools1004764" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="commonltr.css" type="text/css" rel="stylesheet" />
<title>About locales</title>

About locales

In the Derby documentation, we refer to three locales:

Java system locale

This is the locale of your machine, which is automatically
detected by your JVM.   For Derby and Derby tools, the Java system
locale determines the default locale.

Database locale

This is the locale associated
with your database when it is created. By default, this is the same as the
Java system locale. The database locale determines
the language of database errors.

Tools session locale

This locale is associated with your session,
        when using Derby
        tools such as <samp class="codeph">ij</samp> or <samp class="codeph">dblook</samp>.
        This locale determines the language of messages, as well as
the localized display format for numbers, dates, times, and timestamps.
You can use the
<samp class="codeph">derby.ui.locale</samp>
property to specify the session locale that should be used.

Parent topic: Tools and localization

Related concepts

Database locale

Specifying an alternate codeset

Formatting display of locale-sensitive data

redpajama_set_name: RedPajamaGithub


text:
'use strict';
/* Handlebars Helper */
/* Rate transformiert den Score (Ausprägung des Ratings) in HTML
 Der gültige Wertebereich beträgt 0 bis BESTRATING.
 Wird ein ungüliger Wert übergeben, wird die class error-sign generiert*/
Handlebars.registerHelper('rate', function (rating) {
    var RatingHTML = "";
    var BESTRATING = 5;
    if (rating >= 0 && rating <= BESTRATING) {
        for (var i = 1; i <= BESTRATING; i++) {
            if (rating >= i) {
                RatingHTML = RatingHTML + ' ';
            }
            else {
                RatingHTML = RatingHTML + ' ';
            }
        }
    }
    else {
        var ERRORSIGNSPAN = ' ';
        for (var i = 1; i <= BESTRATING; i++) {
            RatingHTML = RatingHTML + ERRORSIGNSPAN;
        }
    }
    return new Handlebars.SafeString(RatingHTML);
});
/* Showdate zeigt ein Datum der Note mit einem Präfix an
 *  Mit dem Präfix (optional) kann eine Beschreibung des Datums mitgegeben werden*/
Handlebars.registerHelper('showdate', function (date, prefixText) {
    var DATEFORMAT = "LL";
    var outDate = "";
    if (!(typeof (prefixText) === "string")) {
        prefixText = "";
    }
    if (moment(date).isValid()) {
        outDate = prefixText + " " + moment(date).format(DATEFORMAT);
    }
    else {
        outDate = "";
        console.log("Invalid Date: " + moment(date));
    }
    return new Handlebars.SafeString(outDate);
});
Handlebars.registerHelper('SetFinishedCheckBox', function (finishedDate) {
    var CheckboxHTML = "";
    var CheckboxLabelHTML = '';
    if (moment(finishedDate).isValid()) {
        CheckboxHTML = CheckboxLabelHTML;
        CheckboxHTML += '<input type="checkbox" id="cb_note-finished" checked class="note-finished">';
    }
    else {
        CheckboxHTML = CheckboxLabelHTML;
        CheckboxHTML += '<input type="checkbox" id="cb_note-finished" class="note-unfinished">';
    } // set Checkbox unchecked
    return new Handlebars.SafeString(CheckboxHTML);
});
Handlebars.registerHelper('SetDescription', function (description) {
    var descriptionHTML = "";
    var accFirstLine = "";
    var accContent = "";
    var MaxLen = 60;
    if (typeof (description) === "string") {
        if (description.length > MaxLen) {
            // descriptionHTML="Accordion: " + description.length.toString();
            accFirstLine = description.substr(0, MaxLen);
            accContent = description.substr(MaxLen, description.length);
            descriptionHTML = "
" + accFirstLine + "

" + accContent + "
";
        }
        else {
            descriptionHTML = "
" + description + "
";
        }
    }
    return new Handlebars.SafeString(descriptionHTML);
});
//# sourceMappingURL=NoteHandlebars.js.map


text:
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: api.proto

package v2alpha1

import (
	context "context"
	fmt "fmt"
	proto "github.com/gogo/protobuf/proto"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	math "math"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package

type StatusRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *StatusRequest) Reset()         { *m = StatusRequest{} }
func (m *StatusRequest) String() string { return proto.CompactTextString(m) }
func (*StatusRequest) ProtoMessage()    {}
func (*StatusRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_00212fb1f9d3bf1c, []int{0}
}
func (m *StatusRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_StatusRequest.Unmarshal(m, b)
}
func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic)
}
func (m *StatusRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_StatusRequest.Merge(m, src)
}
func (m *StatusRequest) XXX_Size() int {
	return xxx_messageInfo_StatusRequest.Size(m)
}
func (m *StatusRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_StatusRequest.DiscardUnknown(m)
}

var xxx_messageInfo_StatusRequest proto.InternalMessageInfo

type StatusResponse struct {
	// Version of the KMS plugin API.  Must match the configured .resources[].providers[].kms.apiVersion
	Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	// Any value other than "ok" is failing healthz.  On failure, the associated API server healthz endpoint will contain this value as part of the error message.
	Healthz string `protobuf:"bytes,2,opt,name=healthz,proto3" json:"healthz,omitempty"`
	// the current write key, used to determine staleness of data updated via value.Transformer.TransformFromStorage.
	KeyId                string   `protobuf:"bytes,3,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *StatusResponse) Reset()         { *m = StatusResponse{} }
func (m *StatusResponse) String() string { return proto.CompactTextString(m) }
func (*StatusResponse) ProtoMessage()    {}
func (*StatusResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_00212fb1f9d3bf1c, []int{1}
}
func (m *StatusResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_StatusResponse.Unmarshal(m, b)
}
func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic)
}
func (m *StatusResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_StatusResponse.Merge(m, src)
}
func (m *StatusResponse) XXX_Size() int {
	return xxx_messageInfo_StatusResponse.Size(m)
}
func (m *StatusResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_StatusResponse.DiscardUnknown(m)
}

var xxx_messageInfo_StatusResponse proto.InternalMessageInfo

func (m *StatusResponse) GetVersion() string {
	if m != nil {
		return m.Version
	}
	return ""
}

func (m *StatusResponse) GetHealthz() string {
	if m != nil {
		return m.Healthz
	}
	return ""
}

func (m *StatusResponse) GetKeyId() string {
	if m != nil {
		return m.KeyId
	}
	return ""
}

type DecryptRequest struct {
	// The data to be decrypted.
	Ciphertext []byte `protobuf:"bytes,1,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"`
	// UID is a unique identifier for the request.
	Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"`
	// The keyID that was provided to the apiserver during encryption.
	// This represents the KMS KEK that was used to encrypt the data.
	KeyId string `protobuf:"bytes,3,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"`
	// Additional metadata that was sent by the KMS plugin during encryption.
	Annotations          map[string][]byte `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (m *DecryptRequest) Reset()         { *m = DecryptRequest{} }
func (m *DecryptRequest) String() string { return proto.CompactTextString(m) }
func (*DecryptRequest) ProtoMessage()    {}
func (*DecryptRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_00212fb1f9d3bf1c, []int{2}
}
func (m *DecryptRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_DecryptRequest.Unmarshal(m, b)
}
func (m *DecryptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_DecryptRequest.Marshal(b, m, deterministic)
}
func (m *DecryptRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_DecryptRequest.Merge(m, src)
}
func (m *DecryptRequest) XXX_Size() int {
	return xxx_messageInfo_DecryptRequest.Size(m)
}
func (m *DecryptRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_DecryptRequest.DiscardUnknown(m)
}

var xxx_messageInfo_DecryptRequest proto.InternalMessageInfo

func (m *DecryptRequest) GetCiphertext() []byte {
	if m != nil {
		return m.Ciphertext
	}
	return nil
}

func (m *DecryptRequest) GetUid() string {
	if m != nil {
		return m.Uid
	}
	return ""
}

func (m *DecryptRequest) GetKeyId() string {
	if m != nil {
		return m.KeyId
	}
	return ""
}

func (m *DecryptRequest) GetAnnotations() map[string][]byte {
	if m != nil {
		return m.Annotations
	}
	return nil
}

type DecryptResponse struct {
	// The decrypted data.
	Plaintext            []byte   `protobuf:"bytes,1,opt,name=plaintext,proto3" json:"plaintext,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *DecryptResponse) Reset()         { *m = DecryptResponse{} }
func (m *DecryptResponse) String() string { return proto.CompactTextString(m) }
func (*DecryptResponse) ProtoMessage()    {}
func (*DecryptResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_00212fb1f9d3bf1c, []int{3}
}
func (m *DecryptResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_DecryptResponse.Unmarshal(m, b)
}
func (m *DecryptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_DecryptResponse.Marshal(b, m, deterministic)
}
func (m *DecryptResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_DecryptResponse.Merge(m, src)
}
func (m *DecryptResponse) XXX_Size() int {
	return xxx_messageInfo_DecryptResponse.Size(m)
}
func (m *DecryptResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_DecryptResponse.DiscardUnknown(m)
}

var xxx_messageInfo_DecryptResponse proto.InternalMessageInfo

func (m *DecryptResponse) GetPlaintext() []byte {
	if m != nil {
		return m.Plaintext
	}
	return nil
}

type EncryptRequest struct {
	// The data to be encrypted.
	Plaintext []byte `protobuf:"bytes,1,opt,name=plaintext,proto3" json:"plaintext,omitempty"`
	// UID is a unique identifier for the request.
	Uid                  string   `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *EncryptRequest) Reset()         { *m = EncryptRequest{} }
func (m *EncryptRequest) String() string { return proto.CompactTextString(m) }
func (*EncryptRequest) ProtoMessage()    {}
func (*EncryptRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_00212fb1f9d3bf1c, []int{4}
}
func (m *EncryptRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_EncryptRequest.Unmarshal(m, b)
}
func (m *EncryptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_EncryptRequest.Marshal(b, m, deterministic)
}
func (m *EncryptRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_EncryptRequest.Merge(m, src)
}
func (m *EncryptRequest) XXX_Size() int {
	return xxx_messageInfo_EncryptRequest.Size(m)
}
func (m *EncryptRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_EncryptRequest.DiscardUnknown(m)
}

var xxx_messageInfo_EncryptRequest proto.InternalMessageInfo

func (m *EncryptRequest) GetPlaintext() []byte {
	if m != nil {
		return m.Plaintext
	}
	return nil
}

func (m *EncryptRequest) GetUid() string {
	if m != nil {
		return m.Uid
	}
	return ""
}

type EncryptResponse struct {
	// The encrypted data.
	Ciphertext []byte `protobuf:"bytes,1,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"`
	// The KMS key ID used to encrypt the data. This must always refer to the KMS KEK and not any local KEKs that may be in use.
	// This can be used to inform staleness of data updated via value.Transformer.TransformFromStorage.
	KeyId string `protobuf:"bytes,2,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"`
	// Additional metadata to be stored with the encrypted data.
	// This metadata can contain the encrypted local KEK that was used to encrypt the DEK.
	// This data is stored in plaintext in etcd. KMS plugin implementations are responsible for pre-encrypting any sensitive data.
	Annotations          map[string][]byte `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (m *EncryptResponse) Reset()         { *m = EncryptResponse{} }
func (m *EncryptResponse) String() string { return proto.CompactTextString(m) }
func (*EncryptResponse) ProtoMessage()    {}
func (*EncryptResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_00212fb1f9d3bf1c, []int{5}
}
func (m *EncryptResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_EncryptResponse.Unmarshal(m, b)
}
func (m *EncryptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_EncryptResponse.Marshal(b, m, deterministic)
}
func (m *EncryptResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_EncryptResponse.Merge(m, src)
}
func (m *EncryptResponse) XXX_Size() int {
	return xxx_messageInfo_EncryptResponse.Size(m)
}
func (m *EncryptResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_EncryptResponse.DiscardUnknown(m)
}

var xxx_messageInfo_EncryptResponse proto.InternalMessageInfo

func (m *EncryptResponse) GetCiphertext() []byte {
	if m != nil {
		return m.Ciphertext
	}
	return nil
}

func (m *EncryptResponse) GetKeyId() string {
	if m != nil {
		return m.KeyId
	}
	return ""
}

func (m *EncryptResponse) GetAnnotations() map[string][]byte {
	if m != nil {
		return m.Annotations
	}
	return nil
}

func init() {
	proto.RegisterType((*StatusRequest)(nil), "v2alpha1.StatusRequest")
	proto.RegisterType((*StatusResponse)(nil), "v2alpha1.StatusResponse")
	proto.RegisterType((*DecryptRequest)(nil), "v2alpha1.DecryptRequest")
	proto.RegisterMapType((map[string][]byte)(nil), "v2alpha1.DecryptRequest.AnnotationsEntry")
	proto.RegisterType((*DecryptResponse)(nil), "v2alpha1.DecryptResponse")
	proto.RegisterType((*EncryptRequest)(nil), "v2alpha1.EncryptRequest")
	proto.RegisterType((*EncryptResponse)(nil), "v2alpha1.EncryptResponse")
	proto.RegisterMapType((map[string][]byte)(nil), "v2alpha1.EncryptResponse.AnnotationsEntry")
}

func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) }

var fileDescriptor_00212fb1f9d3bf1c = []byte{
	// 391 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0xcf, 0x4f, 0xe2, 0x40,
	0x14, 0xc7, 0x29, 0x5d, 0x60, 0x79, 0xb0, 0x40, 0x26, 0x6c, 0xb6, 0x4b, 0x36, 0x1b, 0x32, 0x27,
	0x76, 0x0f, 0xdd, 0x2c, 0x5e, 0x8c, 0x89, 0x06, 0x13, 0x39, 0x18, 0xf4, 0x52, 0x8e, 0x1e, 0xcc,
	0x08, 0x2f, 0x76, 0x42, 0x9d, 0xd6, 0x76, 0xda, 0x58, 0xff, 0x50, 0x13, 0xff, 0x01, 0xff, 0x0e,
	0xd3, 0x76, 0xa0, 0x2d, 0x88, 0x9e, 0xbc, 0xcd, 0xfb, 0xd1, 0xef, 0xf7, 0xcd, 0x67, 0x5e, 0xa1,
	0xc9, 0x3c, 0x6e, 0x7a, 0xbe, 0x2b, 0x5d, 0xf2, 0x35, 0x1a, 0x33, 0xc7, 0xb3, 0xd9, 0x7f, 0xda,
	0x85, 0x6f, 0x73, 0xc9, 0x64, 0x18, 0x58, 0x78, 0x1f, 0x62, 0x20, 0xe9, 0x15, 0x74, 0xd6, 0x89,
	0xc0, 0x73, 0x45, 0x80, 0xc4, 0x80, 0x46, 0x84, 0x7e, 0xc0, 0x5d, 0x61, 0x68, 0x43, 0x6d, 0xd4,
	0xb4, 0xd6, 0x61, 0x52, 0xb1, 0x91, 0x39, 0xd2, 0x7e, 0x34, 0xaa, 0x59, 0x45, 0x85, 0xe4, 0x3b,
	0xd4, 0x57, 0x18, 0x5f, 0xf3, 0xa5, 0xa1, 0xa7, 0x85, 0xda, 0x0a, 0xe3, 0xf3, 0x25, 0x7d, 0xd1,
	0xa0, 0x73, 0x86, 0x0b, 0x3f, 0xf6, 0xa4, 0xf2, 0x23, 0xbf, 0x01, 0x16, 0xdc, 0xb3, 0xd1, 0x97,
	0xf8, 0x20, 0x53, 0x83, 0xb6, 0x55, 0xc8, 0x90, 0x1e, 0xe8, 0x21, 0x5f, 0x2a, 0xfd, 0xe4, 0xb8,
	0x47, 0x9b, 0xcc, 0xa0, 0xc5, 0x84, 0x70, 0x25, 0x93, 0xdc, 0x15, 0x81, 0xf1, 0x65, 0xa8, 0x8f,
	0x5a, 0xe3, 0x3f, 0xe6, 0xfa, 0xa6, 0x66, 0xd9, 0xd7, 0x3c, 0xcd, 0x7b, 0xa7, 0x42, 0xfa, 0xb1,
	0x55, 0xfc, 0x7a, 0x70, 0x02, 0xbd, 0xed, 0x86, 0x64, 0x92, 0x15, 0xc6, 0x8a, 0x41, 0x72, 0x24,
	0x7d, 0xa8, 0x45, 0xcc, 0x09, 0x31, 0x9d, 0xae, 0x6d, 0x65, 0xc1, 0x51, 0xf5, 0x50, 0xa3, 0xff,
	0xa0, 0xbb, 0xf1, 0x53, 0x18, 0x7f, 0x41, 0xd3, 0x73, 0x18, 0x17, 0x85, 0x7b, 0xe6, 0x09, 0x3a,
	0x81, 0xce, 0x54, 0x94, 0xc0, 0xbc, 0xdb, 0xbf, 0x8b, 0x85, 0x3e, 0x69, 0xd0, 0xdd, 0x48, 0x28,
	0xcf, 0x8f, 0xe0, 0xe6, 0x28, 0xab, 0x45, 0x94, 0x17, 0x65, 0x94, 0x7a, 0x8a, 0xf2, 0x6f, 0x8e,
	0x72, 0xcb, 0xe6, 0x73, 0x59, 0x8e, 0x9f, 0x35, 0xe8, 0xcf, 0x30, 0xbe, 0x64, 0x82, 0xdd, 0xe2,
	0x1d, 0x0a, 0x39, 0x47, 0x3f, 0xe2, 0x0b, 0x24, 0xc7, 0x50, 0xcf, 0x56, 0x95, 0xfc, 0xc8, 0x67,
	0x2b, 0x6d, 0xf3, 0xc0, 0xd8, 0x2d, 0x64, 0x33, 0xd3, 0x0a, 0x99, 0x40, 0x43, 0xbd, 0x11, 0x31,
	0xf6, 0xad, 0xc9, 0xe0, 0xe7, 0x1b, 0x95, 0xa2, 0x82, 0x42, 0x51, 0x54, 0x28, 0xbf, 0x63, 0x51,
	0x61, 0x8b, 0x1b, 0xad, 0xdc, 0xd4, 0xd3, 0xff, 0xf1, 0xe0, 0x35, 0x00, 0x00, 0xff, 0xff, 0xa7,
	0xdd, 0xa1, 0x79, 0x9c, 0x03, 0x00, 0x00,
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// KeyManagementServiceClient is the client API for KeyManagementService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type KeyManagementServiceClient interface {
	// this API is meant to be polled
	Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
	// Execute decryption operation in KMS provider.
	Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error)
	// Execute encryption operation in KMS provider.
	Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error)
}

type keyManagementServiceClient struct {
	cc *grpc.ClientConn
}

func NewKeyManagementServiceClient(cc *grpc.ClientConn) KeyManagementServiceClient {
	return &keyManagementServiceClient{cc}
}

func (c *keyManagementServiceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
	out := new(StatusResponse)
	err := c.cc.Invoke(ctx, "/v2alpha1.KeyManagementService/Status", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *keyManagementServiceClient) Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) {
	out := new(DecryptResponse)
	err := c.cc.Invoke(ctx, "/v2alpha1.KeyManagementService/Decrypt", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *keyManagementServiceClient) Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) {
	out := new(EncryptResponse)
	err := c.cc.Invoke(ctx, "/v2alpha1.KeyManagementService/Encrypt", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// KeyManagementServiceServer is the server API for KeyManagementService service.
type KeyManagementServiceServer interface {
	// this API is meant to be polled
	Status(context.Context, *StatusRequest) (*StatusResponse, error)
	// Execute decryption operation in KMS provider.
	Decrypt(context.Context, *DecryptRequest) (*DecryptResponse, error)
	// Execute encryption operation in KMS provider.
	Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error)
}

// UnimplementedKeyManagementServiceServer can be embedded to have forward compatible implementations.
type UnimplementedKeyManagementServiceServer struct {
}

func (*UnimplementedKeyManagementServiceServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
}
func (*UnimplementedKeyManagementServiceServer) Decrypt(ctx context.Context, req *DecryptRequest) (*DecryptResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Decrypt not implemented")
}
func (*UnimplementedKeyManagementServiceServer) Encrypt(ctx context.Context, req *EncryptRequest) (*EncryptResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Encrypt not implemented")
}

func RegisterKeyManagementServiceServer(s *grpc.Server, srv KeyManagementServiceServer) {
	s.RegisterService(&_KeyManagementService_serviceDesc, srv)
}

func _KeyManagementService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StatusRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KeyManagementServiceServer).Status(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/v2alpha1.KeyManagementService/Status",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KeyManagementServiceServer).Status(ctx, req.(*StatusRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _KeyManagementService_Decrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DecryptRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KeyManagementServiceServer).Decrypt(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/v2alpha1.KeyManagementService/Decrypt",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KeyManagementServiceServer).Decrypt(ctx, req.(*DecryptRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _KeyManagementService_Encrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EncryptRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KeyManagementServiceServer).Encrypt(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/v2alpha1.KeyManagementService/Encrypt",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KeyManagementServiceServer).Encrypt(ctx, req.(*EncryptRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _KeyManagementService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "v2alpha1.KeyManagementService",
	HandlerType: (*KeyManagementServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Status",
			Handler:    _KeyManagementService_Status_Handler,
		},
		{
			MethodName: "Decrypt",
			Handler:    _KeyManagementService_Decrypt_Handler,
		},
		{
			MethodName: "Encrypt",
			Handler:    _KeyManagementService_Encrypt_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api.proto",
}


text:
define(['underscore', 'backbone'], function(_, Backbone) {
    'use strict';

    return Backbone.Collection.extend({
        url: "/translate.me/api/json/translations",

        model: Backbone.Model.extend({
            idAttribute: '_id',

            parse: function(response) {
                response.created = new Date(response.created);
                _.each(response.translations, function(translation) {
                    translation.created = new Date(translation.created);
                    translation.changed = new Date(translation.changed);
                });
                return response;
            },

            getValue: function(locale) {
                var value = null,
                    translatedValue = _.findWhere(this.get('translations'), {
                        locale: locale
                    });

                if(translatedValue && translatedValue.value) {
                    value = translatedValue.value;
                }
                return value;
            },

            setValue: function(locale, value) {
                var translation = _.findWhere(this.get('translations'), {
                    locale: locale
                });

                if(value.length > 0) {
                    if(translation) {
                        translation.value = value;
                    } else {
                        this.get('translations').push({
                            locale: locale,
                            value: value
                        });
                    }
                } else {
                    this.set('translations', _.reject(this.get('translations'), function(translation) {
                        return translation.locale === locale;
                    }));
                }
            },

            getLastChanged: function(locale) {
                var lastChanged = null,
                    translation;

                if(locale) {
                    translation = _.findWhere(this.get('translations'), {
                        locale: locale
                    });
                    if(translation) {
                        lastChanged = translation.changed;
                    }
                }

                return lastChanged;
            }
        })
    });
});


text:
export default {
    block: <Blockly.Block> {
        init: function () {
            this.appendDummyInput()
                .appendField("turn")
                .appendField(new Blockly.FieldDropdown([["left ↺", "left"], ["right ↻", "right"]]), "direction");
            this.setInputsInline(true);
            this.setPreviousStatement(true, null);
            this.setNextStatement(true, null);
            this.setColour(120);
            this.setTooltip('');
            this.setHelpUrl('https://github.com/leMaik/EduCraft/wiki/The-API#turnleft');
        }
    },
    codeGenerator: function (block:Blockly.Block) {
        switch (block.getFieldValue('direction')) {
            case 'left':
                return 'turnLeft()\n';
            case 'right':
                return 'turnRight()\n';
        }
    }
};


text:
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Debugger.Interop;
using System;

namespace ly.VSLogcat
{
    public class DebugOutputEventCallback : IDebugEventCallback2
    {
        string[] sp = { "\r\n" };
        public int Event(IDebugEngine2 pEngine, IDebugProcess2 pProcess, IDebugProgram2 pProgram, IDebugThread2 pThread, IDebugEvent2 pEvent, ref Guid riidEvent, uint dwAttrib)
        {
            if (riidEvent == typeof(IDebugOutputStringEvent2).GUID)
            {
                IDebugOutputStringEvent2 ev = pEvent as IDebugOutputStringEvent2;
                if (ev != null)
                {
                    string message;
                    if (ErrorHandler.Succeeded(ev.GetString(out message)))
                    {
                        var lines = message.Split(sp, StringSplitOptions.RemoveEmptyEntries);

                        foreach(var line in lines)
                        {
                            HandleMessage(line);
                        }
                    }
                }
            }

            return VSConstants.S_OK;
        }

        void HandleMessage(string message)
        {
            var classificationName = ly.VSLogcat.Logcat.Current.GetLogType(message);

            var type = Logcat.Current.GetLogType(message);
            if (LogType.Contains(type))
            {
                message = message.Substring(message.IndexOf(']') + 1);
                if (!string.IsNullOrWhiteSpace(message))
                {
                    Logcat.Current.Log(type, string.Format("{0}\r\n", message));
                }
            }
        }
    }
}


text:
Connected to your database!

	Awesome! Connection to your database was successful, but we couldn't find the database tables for this app. Would you like to create them? (you can
	also set them up yourself using the db.sql file in the project root directory. lol)

<form name="billy"  method="post" action="/admin/create_tables">
	<input type="submit" name="wendy" value="Yes! Set up my database tables!"/>
</form>


text:
require 'rails_helper'

module B1Admin
  RSpec.describe Login, :type => :model do
    pending "add some examples to (or delete) #{__FILE__}"
  end
end


text:
(function(angular) {

	document.addEventListener("DOMContentLoaded", function() {

		// document.getElementsByTagName("body")[0]

		angular.bootstrap(document.querySelector("body"), ["WidgetApp"]);

	})

})(angular);


text:
package utils

import (
	"fmt"
	"github.com/toolkits/ldap"
)

func LdapBind(addr,
	BaseDN,
	BindDN,
	BindPasswd,
	UserField,
	user,
	password string) (success bool, err error) {

	filter := "(" + UserField + "=" + user + ")"
	conn, err := ldap.Dial("tcp", addr)

	if err != nil {
		return false, fmt.Errorf("dial ldap fail: %s", err.Error())
	}

	defer conn.Close()
	if BindDN != "" {
		err = conn.Bind(BindDN, BindPasswd)
	}
	if err != nil {
		return false, fmt.Errorf("ldap Bind fail: %s", err.Error())
	}
	search := ldap.NewSearchRequest(
		BaseDN,
		ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false,
		filter,
		nil,
		nil)

	sr, err := conn.Search(search)

	if err != nil {

		return false, fmt.Errorf("ldap search fail: %s", err.Error())
	}

	defer func() {
		if err := recover(); err != nil {
			//fmt.Println("ERROR:", err)
			success = false
		}
	}()
	err = conn.Bind(sr.Entries[0].DN, password)
	return err == nil, err
}

func Ldapsearch(addr,
	BaseDN,
	BindDN,
	BindPasswd,
	UserField,
	user string,
	Attributes []string) (map[string]string, error) {

	filter := "(" + UserField + "=" + user + ")"
	conn, err := ldap.Dial("tcp", addr)

	if err != nil {
		return nil, fmt.Errorf("dial ldap fail: %s", err.Error())
	}

	defer conn.Close()

	if BindDN != "" {
		err = conn.Bind(BindDN, BindPasswd)
	}
	if err != nil {
		return nil, fmt.Errorf("ldap Bind fail: %s", err.Error())
	}
	search := ldap.NewSearchRequest(
		BaseDN,
		ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false,
		filter,
		Attributes,
		nil)

	sr, err := conn.Search(search)
	defer func() {
		if err := recover(); err != nil {
			fmt.Println("ERROR:", err)
		}
	}()
	if err != nil {
		return nil, fmt.Errorf("ldap search fail: %s", err.Error())
	}
	var User_Attributes map[string]string
	User_Attributes = make(map[string]string)

	userSn := sr.Entries[0].GetAttributeValue(Attributes[0])
	userMail := sr.Entries[0].GetAttributeValue(Attributes[1])
	userTel := sr.Entries[0].GetAttributeValue(Attributes[2])

	User_Attributes["sn"] = userSn
	User_Attributes["telephoneNumber"] = userTel
	User_Attributes["mail"] = userMail
	return User_Attributes, err
}


text:
'use strict';

import { TextDocument, Position, LanguageService, TokenType, Range } from 'vscode-wml-languageservice';

export interface LanguageRange extends Range {
	languageId: string;
	attributeValue?: boolean;
}

export interface WMLDocumentRegions {
	getEmbeddedDocument(languageId: string, ignoreAttributeValues?: boolean): TextDocument;
	getLanguageRanges(range: Range): LanguageRange[];
	getLanguageAtPosition(position: Position): string;
	getLanguagesInDocument(): string[];
	getImportedScripts(): string[];
}

export var CSS_STYLE_RULE = '__';

interface EmbeddedRegion { languageId: string; start: number; end: number; attributeValue?: boolean; };

export function getDocumentRegions(languageService: LanguageService, document: TextDocument): WMLDocumentRegions {
	let regions: EmbeddedRegion[] = [];
	let scanner = languageService.createScanner(document.getText());
	let lastTagName: string;
	let lastAttributeName: string;
	let languageIdFromType: string;
	let importedScripts = [];

	let token = scanner.scan();
	while (token !== TokenType.EOS) {
		switch (token) {
			case TokenType.StartTag:
				lastTagName = scanner.getTokenText();
				lastAttributeName = null;
				languageIdFromType = 'javascript';
				break;
			case TokenType.Styles:
				regions.push({ languageId: 'css', start: scanner.getTokenOffset(), end: scanner.getTokenEnd() });
				break;
			case TokenType.Script:
				regions.push({ languageId: languageIdFromType, start: scanner.getTokenOffset(), end: scanner.getTokenEnd() });
				break;
			case TokenType.AttributeName:
				lastAttributeName = scanner.getTokenText();
				break;
			case TokenType.AttributeValue:
				if (lastAttributeName === 'src' && lastTagName.toLowerCase() === 'script') {
					let value = scanner.getTokenText();
					if (value[0] === '\'' || value[0] === '"') {
						value = value.substr(1, value.length - 1);
					}
					importedScripts.push(value);
				} else if (lastAttributeName === 'type' && lastTagName.toLowerCase() === 'script') {
					if (/["'](text|application)\/(java|ecma)script["']/.test(scanner.getTokenText())) {
						languageIdFromType = 'javascript';
					} else {
						languageIdFromType = void 0;
					}
				} else {
					let attributeLanguageId = getAttributeLanguage(lastAttributeName);
					if (attributeLanguageId) {
						let start = scanner.getTokenOffset();
						let end = scanner.getTokenEnd();
						let firstChar = document.getText()[start];
						if (firstChar === '\'' || firstChar === '"') {
							start++;
							end--;
						}
						regions.push({ languageId: attributeLanguageId, start, end, attributeValue: true });
					}
				}
				lastAttributeName = null;
				break;
		}
		token = scanner.scan();
	}
	return {
		getLanguageRanges: (range: Range) => getLanguageRanges(document, regions, range),
		getEmbeddedDocument: (languageId: string, ignoreAttributeValues: boolean) => getEmbeddedDocument(document, regions, languageId, ignoreAttributeValues),
		getLanguageAtPosition: (position: Position) => getLanguageAtPosition(document, regions, position),
		getLanguagesInDocument: () => getLanguagesInDocument(document, regions),
		getImportedScripts: () => importedScripts
	};
}

function getLanguageRanges(document: TextDocument, regions: EmbeddedRegion[], range: Range): LanguageRange[] {
	let result: LanguageRange[] = [];
	let currentPos = range ? range.start : Position.create(0, 0);
	let currentOffset = range ? document.offsetAt(range.start) : 0;
	let endOffset = range ? document.offsetAt(range.end) : document.getText().length;
	for (let region of regions) {
		if (region.end > currentOffset && region.start < endOffset) {
			let start = Math.max(region.start, currentOffset);
			let startPos = document.positionAt(start);
			if (currentOffset < region.start) {
				result.push({
					start: currentPos,
					end: startPos,
					languageId: 'wml'
				});
			}
			let end = Math.min(region.end, endOffset);
			let endPos = document.positionAt(end);
			if (end > region.start) {
				result.push({
					start: startPos,
					end: endPos,
					languageId: region.languageId,
					attributeValue: region.attributeValue
				});
			}
			currentOffset = end;
			currentPos = endPos;
		}
	}
	if (currentOffset < endOffset) {
		let endPos = range ? range.end : document.positionAt(endOffset);
		result.push({
			start: currentPos,
			end: endPos,
			languageId: 'wml'
		});
	}
	return result;
}

function getLanguagesInDocument(document: TextDocument, regions: EmbeddedRegion[]): string[] {
	let result = [];
	for (let region of regions) {
		if (region.languageId && result.indexOf(region.languageId) === -1) {
			result.push(region.languageId);
			if (result.length === 3) {
				return result;
			}
		}
	}
	result.push('wml');
	return result;
}

function getLanguageAtPosition(document: TextDocument, regions: EmbeddedRegion[], position: Position): string {
	let offset = document.offsetAt(position);
	for (let region of regions) {
		if (region.start <= offset) {
			if (offset <= region.end) {
				return region.languageId;
			}
		} else {
			break;
		}
	}
	return 'wml';
}

function getEmbeddedDocument(document: TextDocument, contents: EmbeddedRegion[], languageId: string, ignoreAttributeValues: boolean): TextDocument {
	let currentPos = 0;
	let oldContent = document.getText();
	let result = '';
	let lastSuffix = '';
	for (let c of contents) {
		if (c.languageId === languageId && (!ignoreAttributeValues || !c.attributeValue)) {
			result = substituteWithWhitespace(result, currentPos, c.start, oldContent, lastSuffix, getPrefix(c));
			result += oldContent.substring(c.start, c.end);
			currentPos = c.end;
			lastSuffix = getSuffix(c);
		}
	}
	result = substituteWithWhitespace(result, currentPos, oldContent.length, oldContent, lastSuffix, '');
	return TextDocument.create(document.uri, languageId, document.version, result);
}

function getPrefix(c: EmbeddedRegion) {
	if (c.attributeValue) {
		switch (c.languageId) {
			case 'css': return CSS_STYLE_RULE + '{';
		}
	}
	return '';
}
function getSuffix(c: EmbeddedRegion) {
	if (c.attributeValue) {
		switch (c.languageId) {
			case 'css': return '}';
			case 'javascript': return ';';
		}
	}
	return '';
}

function substituteWithWhitespace(result: string, start: number, end: number, oldContent: string, before: string, after: string) {
	let accumulatedWS = 0;
	result += before;
	for (let i = start + before.length; i < end; i++) {
		let ch = oldContent[i];
		if (ch === '\n' || ch === '\r') {
			// only write new lines, skip the whitespace
			accumulatedWS = 0;
			result += ch;
		} else {
			accumulatedWS++;
		}
	}
	result = append(result, ' ', accumulatedWS - after.length);
	result += after;
	return result;
}

function append(result: string, str: string, n: number): string {
	while (n > 0) {
		if (n & 1) {
			result += str;
		}
		n >>= 1;
		str += str;
	}
	return result;
}

function getAttributeLanguage(attributeName: string): string {
	let match = attributeName.match(/^(style)$|^(on\w+)$/i);
	if (!match) {
		return null;
	}
	return match[1] ? 'css' : 'javascript';
}


text:
#include "tensorflow/lite/tools/optimize/reduced_precision_support.h"

#include <string>
#include <vector>

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "absl/memory/memory.h"
#include "tensorflow/core/platform/init_main.h"
#include "tensorflow/lite/model.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/schema/schema_utils.h"
#include "tensorflow/lite/testing/util.h"
#include "tensorflow/lite/tools/optimize/test_util.h"

namespace tflite {
namespace optimize {
namespace utils {
namespace {

class ReducedPrecisionSupportTest : public testing::Test {
 protected:
  tflite::TestErrorReporter error_reporter_;
};

TEST_F(ReducedPrecisionSupportTest, BitwiseOps) {
  ReducedPrecisionSupport mask0 = ReducedPrecisionSupport::None;
  ReducedPrecisionSupport mask1 = ReducedPrecisionSupport::Float16Inference;
  ReducedPrecisionSupport bf16 = ReducedPrecisionSupport::Bfloat16Inference;
  ReducedPrecisionSupport fp16 = ReducedPrecisionSupport::Float16Inference;
  EXPECT_EQ(mask0, mask0 & mask1);
  EXPECT_EQ(mask1, mask0 | mask1);
  mask0 |= fp16;
  EXPECT_EQ(true, SupportsFP16Inference(mask0));
  mask0 |= bf16;
  EXPECT_EQ(true, SupportsBfloat16Inference(mask0));
  ReducedPrecisionSupport mask2 = ReducedPrecisionSupport::Float16Accumulation;
  mask2 &= fp16;
  EXPECT_EQ(mask2, ReducedPrecisionSupport::None);
}

TEST_F(ReducedPrecisionSupportTest, SupportTests) {
  ReducedPrecisionSupport bf16 = ReducedPrecisionSupport::Bfloat16Inference;
  ReducedPrecisionSupport fp16 = ReducedPrecisionSupport::Float16Inference;
  ReducedPrecisionSupport mask = bf16 | fp16;
  EXPECT_EQ(true, SupportsFP16Inference(mask));
  EXPECT_EQ(true, SupportsBfloat16Inference(mask));
  EXPECT_EQ(false, SupportsFP16Accumulation(mask));
  EXPECT_EQ(false, SupportsFP32Accumulation(mask));
  EXPECT_EQ(true, SupportsReducedPrecisionInference(mask));
  EXPECT_EQ(true, SupportsReducedPrecisionInference(mask));
  EXPECT_EQ(false, SupportsEitherFP16OrFP32Accumulation(mask));
  mask = mask | ReducedPrecisionSupport::Float16Accumulation;
  EXPECT_EQ(true, SupportsFP16Accumulation(mask));
  EXPECT_EQ(false, SupportsFP32Accumulation(mask));
  EXPECT_EQ(true, SupportsEitherFP16OrFP32Accumulation(mask));
}

TEST_F(ReducedPrecisionSupportTest, MetadataStrings) {
  ReducedPrecisionSupport bf16 = ReducedPrecisionSupport::Bfloat16Inference;
  ReducedPrecisionSupport fp16 = ReducedPrecisionSupport::Float16Inference;
  ReducedPrecisionSupport accfp32 =
      ReducedPrecisionSupport::Float32Accumulation;
  ReducedPrecisionSupport accfp16 =
      ReducedPrecisionSupport::Float16Accumulation;
  ReducedPrecisionSupport maskA = bf16 | fp16 | accfp32;
  std::pair<std::string, std::string> ans =
      MetadataForReducedPrecisionSupport(maskA);
  EXPECT_EQ("fp16bf16accfp32", ans.second);
  EXPECT_EQ("reduced_precision_support", ans.first);
  ReducedPrecisionSupport maskB = fp16 | accfp16;
  EXPECT_EQ("fp16accfp16", MetadataForReducedPrecisionSupport(maskB).second);
}

TEST_F(ReducedPrecisionSupportTest, ReadStringsIntoMasks) {
  ReducedPrecisionSupport fp16 = ReducedPrecisionSupport::Float16Inference;
  ReducedPrecisionSupport accfp16 =
      ReducedPrecisionSupport::Float16Accumulation;
  ReducedPrecisionSupport maskfp16 = fp16;
  ReducedPrecisionSupport maskfp16accfp16 = fp16 | accfp16;
  ReducedPrecisionSupport mask = ReducedPrecisionSupport::None;
  size_t idx = 0;
  std::string metadata = "fp16accfp16";
  EXPECT_EQ(true, ReadInferenceType(metadata, &idx, &mask));
  EXPECT_EQ(maskfp16, mask);
  EXPECT_EQ(idx, 4);
  idx = 7;
  EXPECT_EQ(true, ReadAccumulationType(metadata, &idx, &mask));
  EXPECT_EQ(maskfp16accfp16, mask);
  EXPECT_EQ(idx, 11);
}

TEST_F(ReducedPrecisionSupportTest, SetMasks) {
  ReducedPrecisionSupport fp16 = ReducedPrecisionSupport::Float16Inference;
  ReducedPrecisionSupport bf16 = ReducedPrecisionSupport::Bfloat16Inference;
  ReducedPrecisionSupport accfp16 =
      ReducedPrecisionSupport::Float16Accumulation;
  ReducedPrecisionSupport accfp32 =
      ReducedPrecisionSupport::Float32Accumulation;
  ReducedPrecisionSupport mask = ReducedPrecisionSupport::None;
  EXPECT_EQ(true, SetMaskFromReducedPrecisionMetadata("bf16accfp32", &mask));
  EXPECT_EQ(mask, bf16 | accfp32);
  mask = ReducedPrecisionSupport::None;
  EXPECT_EQ(true, SetMaskFromReducedPrecisionMetadata("fp16accfp16", &mask));
  EXPECT_EQ(mask, fp16 | accfp16);
  mask = ReducedPrecisionSupport::None;
  EXPECT_EQ(true,
            SetMaskFromReducedPrecisionMetadata("fp16bf16accfp32", &mask));
  EXPECT_EQ(mask, fp16 | bf16 | accfp32);
  mask = ReducedPrecisionSupport::None;
  EXPECT_EQ(false, SetMaskFromReducedPrecisionMetadata("accfp32", &mask));
  EXPECT_EQ(mask, ReducedPrecisionSupport::None);
  EXPECT_EQ(false, SetMaskFromReducedPrecisionMetadata("qwerwer", &mask));
  EXPECT_EQ(mask, ReducedPrecisionSupport::None);
  EXPECT_EQ(false,
            SetMaskFromReducedPrecisionMetadata("fp16accfp32fp16", &mask));
  EXPECT_EQ(mask, ReducedPrecisionSupport::None);
  EXPECT_EQ(false, SetMaskFromReducedPrecisionMetadata("fp16accbf16", &mask));
  EXPECT_EQ(mask, ReducedPrecisionSupport::None);
}

}  // namespace
}  // namespace utils
}  // namespace optimize
}  // namespace tflite

int main(int argc, char** argv) {
  ::tensorflow::port::InitMain(argv[0], &argc, &argv);
  return RUN_ALL_TESTS();
}


text:
from django.contrib import admin
from . import models

admin.site.register(models.Manager)
admin.site.register(models.Observer)
admin.site.register(models.Updater)


text:
<?php

declare(strict_types=1);

namespace Sylius\Bundle\ThemeBundle\Context;

use Sylius\Bundle\ThemeBundle\Model\ThemeInterface;

interface ThemeContextInterface
{
    /**
     * Should not throw any exception if failed to get theme.
     */
    public function getTheme(): ?ThemeInterface;
}


text:
import React from 'react'
import styled from 'styled-components'
import PropTypes from 'prop-types'
import Link from 'gatsby-link'

const Container = styled.ul`
  display: flex;
  list-style: none;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
`
const Item = styled.li`
  display: inline-block;
  margin: 0;
`
const NavLink = styled.div`
  font-size: ${(props) => props.large ? '1.25em' : '1em'};
  font-weight: 100;
  color: #6B6B6B;
  display: inline-block;
  padding: 0.5em 1em;
  text-transform: uppercase;
  text-decoration: none;
  // &:hover {
  //   text-decoration: underline;
  // }
`

const Menu = ({items, large}) =>
  <Container>
    {items.map((item) =>
      <Item><NavLink large={large}>{item.title}</NavLink></Item>
    )}
  </Container>

Menu.propTypes = {
  items: PropTypes.object.isRequired,
  large: PropTypes.bool
}

export default Menu


text:
package org.seaborne.delta.client;

import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;

import org.apache.jena.atlas.lib.Lib;
import org.apache.jena.atlas.logging.FmtLog;
import org.apache.jena.atlas.logging.LogCtl;
import org.apache.jena.atlas.web.HttpException;
import org.apache.jena.web.HttpSC;
import org.seaborne.delta.Delta;
import org.seaborne.delta.Id;
import org.seaborne.delta.LockState;
import org.seaborne.delta.link.DeltaLink;
import org.slf4j.Logger;

/** A patch log lock */
public class LogLock {

    private static Logger LOG = Delta.DELTA_CLIENT;

    // Keep for debugging
    private DeltaConnection dConn;

    private final DeltaLink dLink;

    private final Id dataSourceId;
    private final AtomicReference<Id> lockSessionId = new AtomicReference<>();

    public LogLock(DeltaConnection dConn) {
        this(dConn.getLink(), dConn.getDataSourceId());
        this.dConn = dConn;
    }

    public LogLock(DeltaLink dLink, Id datasourceId) {
        this.dLink = dLink;
        this.dataSourceId = datasourceId;
    }

    public DeltaConnection getConnection() {
        return dConn;
    }

    public DeltaLink getLink() {
        return dLink;
    }

    public Id getDataSourceId() {
        return dataSourceId;
    }

    public Id getLockSessionId() {
        return lockSessionId.get();
    }

    public boolean acquireLock() {
        Id session = _acquireLock(dLink, dataSourceId);
        if ( session == null )
            return false;
        lockSessionId.set(session);
        return true;
    }

    public boolean refreshLock() {
        Id session = lockSessionId.get();
        if ( session == null )
            return false;
        return _refreshLock(dLink, dataSourceId, session);
    }

    public LockState readLock() {
        return _readLock(dLink, dataSourceId);
    }

    public Id grabLock() {
        Id session = lockSessionId.get();
        if ( session == null )
            return null;
        return _grabLock(dLink, dataSourceId, session);
    }

    public boolean isLocked() { return lockSessionId.get() != null ; }

    public void releaseLock() {
        Id sessionId =  lockSessionId.get();
        if ( sessionId == null )
            return;
        _releaseLock(dLink, dataSourceId, sessionId);
        lockSessionId.set(null);
    }

    private static Id _acquireLock(DeltaLink dLink, Id datasourceId) {
        try {
            Id id = attemptToAcquireLock(0, dLink, datasourceId);
            DEV("==> acquireLock (%s, %s)", datasourceId, id);
            return id;
        } catch (HttpException ex) {
            failedConnection();
            FmtLog.warn(LOG, "Failed to acquire the patch log lock: %s", datasourceId);
            if ( ex.getStatusCode() == -1 )
                throw new HttpException(HttpSC.SERVICE_UNAVAILABLE_503, HttpSC.getMessage(HttpSC.SERVICE_UNAVAILABLE_503), ex.getMessage());
            throw ex;
        }
    }

    private static boolean _refreshLock(DeltaLink dLink, Id datasourceId, Id lockSession) {
        try {
            return dLink.refreshLock(datasourceId, lockSession);
        } catch (HttpException ex) {
            failedConnection();
            FmtLog.warn(LOG, "Failed to refresh the patch log lock: %s", datasourceId);
            if ( ex.getStatusCode() == -1 )
                throw new HttpException(HttpSC.SERVICE_UNAVAILABLE_503, HttpSC.getMessage(HttpSC.SERVICE_UNAVAILABLE_503), ex.getMessage());
            throw ex;
        }
    }

    private static LockState _readLock(DeltaLink dLink, Id datasourceId) {
        try {
            return dLink.readLock(datasourceId);
        } catch (HttpException ex) {
            failedConnection();
            FmtLog.warn(LOG, "Failed to read the patch log lock: %s", datasourceId);
            if ( ex.getStatusCode() == -1 )
                throw new HttpException(HttpSC.SERVICE_UNAVAILABLE_503, HttpSC.getMessage(HttpSC.SERVICE_UNAVAILABLE_503), ex.getMessage());
            throw ex;
        }
    }

    private static Id _grabLock(DeltaLink dLink, Id datasourceId, Id oldLockSession) {
        try {
            return dLink.grabLock(datasourceId, oldLockSession);
        } catch (HttpException ex) {
            FmtLog.warn(LOG, "Failed to grab the patch log lock: %s", datasourceId);
            if ( ex.getStatusCode() == -1 )
                throw new HttpException(HttpSC.SERVICE_UNAVAILABLE_503, HttpSC.getMessage(HttpSC.SERVICE_UNAVAILABLE_503), ex.getMessage());
            failedConnection();
            throw ex;
        }
    }

    /**
     * Release the patch log lock.
     * If there is an error, the patch service is probably down (single server version).
     * All we can do is ignore, and resync later.
     */
    private static void _releaseLock(DeltaLink dLink, Id datasourceId, Id lockSession) {
        try {
            dLink.releaseLock(datasourceId, lockSession);
        } catch (HttpException ex) {
            FmtLog.warn(LOG, "Release lock failed: %s", datasourceId.toString());
        }
    }

    private static void failedConnection() {}

    // ---- The acquire algorithm.

    // Development only!
    private static boolean DEBUG = false;

    public static void verbose() {
        LogCtl.enable(LOG);
        DEBUG = true;
    }

    public static void testMode() {
        LOCK_ACQUIRE_MAX_DEPTH = 2 ;
        LOCK_POLL_WAIT_MS = 500;
        LOCK_SAME_TICKS_RETRIES = 3;
        LOCK_STATE_CHANGE_RETRIES = 2;
        FmtLog.info(LOG,"POLL_WAIT_MS = %d SAME_TICKS_RETRIES = %d STATE_CHANGE_RETRIES = %d",
                        LOCK_POLL_WAIT_MS, LOCK_SAME_TICKS_RETRIES, LOCK_STATE_CHANGE_RETRIES);
    }

    private static void DEV(String fmt, Object... args) {
        if ( DEBUG )
            FmtLog.debug(LOG,  fmt,  args);
    }

    /**
     * Maximum number of full cycles of acquire / poll read / someone else grabs the lock
     * or lock becomes free.
     */
    private static int LOCK_ACQUIRE_MAX_DEPTH           = 5 ;

    /**
     * Number of attempts watching for the session to change or ticks not to change.
     *
     * This is the inner loop.
     */
    private static int LOCK_SAME_TICKS_RETRIES          = 60;

    /**
     * Number of times to read the lock when the session changes.
     *
     * This is the outer loop.
     */
    private static int LOCK_STATE_CHANGE_RETRIES        = 10;

    /**
     * Gap between attempts to read the patch log lock (milliseconds).
     */
    private static int LOCK_POLL_WAIT_MS                = 1000;

    /**
     * Acquire the patch log lock else bail out.
     *

     * The patch log is a discretion lock provided by the patch log server that can be
     * used to serialise updates across the cluster.
     *

     * The server provides certain actions on locks, none of which block or wait. The
     * policy for the lock is determined by the clients.
     *

     * This is not perfect - it does not always acquire the lock when unexpected
     * combinations of failures occur. It is intended first and foremost to protect the
     * data, in some cases by rejecting an "acquire" request. The algorithm is skewed to
     * address the typical use cases of a predominately read workload, or updates being
     * directed via one distinguished replica.
     *

     * The server-side lock has token to identify the current critical section; it also
     * has a ticks field that is incremented to show the current lock owner is still alive
     * and making progress.
     *

     * If an update request sees the lock increasing, it waits for the lock to become
     * free. If it sees the ticks field stop changing, then after a timeout, it can grab
     * the lock, breaking the presumed dead session.
     *

     * The patch log protocol checks that a patch names the previous patch in the log so
     * if a update request on one machine grabs the lock for itself, and the original
     * request is still going, one or other will be bounced when the append the patch
     * because they can't both name the same head of the log.
     *

     * This optimistic concurrency failure is what protects the integrity of the log.
     *

     * Algorithm:
     *

     *
 Try to acquire the lock and return if successful
     *
 Otherwise, read the lock state (being careful the lock may become free at this point).
     *
 Poll, noting whether the lock ticks are advancing, or the lock becomes free, or for someone else
     * to get it. Id the ticks advance, loop.
     *
 If the lock became free, start again.
     *
 If someone else grabbed it, start again.
     *
 If the ticks aren't advancing, grab (break and acquire) the lock.
     *
If waiting too long (there is a slow writer), grab (break and acquire).
     *     This is not an ideal outcome and has a quite long timeout.
     *

     *
     * This is not perfect. It is intended first and foremost to protect the data, in some
     * cases by rejecting an "acquire" request. The algortihm is skewed to address the
     * typical use cases of a predominately read workload, or updates being directed via
     * one distinguished replica.
     *

     *
Waiting for the lock is not a queue. If the system is under heavy write load,
     * one writer may not manage to acquire the lock because it does not manage to get the
     * lock when all the waiting writers try to acquire the lock.
     *

     *

     */
    private static Id attemptToAcquireLock(int depth, DeltaLink dLink, Id datasourceId) {
        // One attempt. If someone else grabs the lock, while we are waiting, go down one depth (tail recursion). */
        DEV("acquireLockOneCycle(%d, %s)", depth, datasourceId);
        if ( depth > LOCK_ACQUIRE_MAX_DEPTH ) {
            // Protect against excessive retries.
            FmtLog.warn(LOG, "Failed to initially acquire lock after %d cycles", depth);
            return null;
        }
        // This is stackdepth = restart attempts.
        depth++;

        // Step 1: Acquire the lock or read the lock.
        DEV(">%d Attempt to acquire lock: %s", depth, datasourceId);
        Id lockSession = dLink.acquireLock(datasourceId);

        if ( lockSession != null )
            // Success!
            return lockSession;

        // Step 2: Read the state.
        //DEV(">%d Read lock: %s", depth, datasourceId);
        LockState state = dLink.readLock(datasourceId);
        if ( LockState.isFree(state) )
            // Lock released. Restart.
            return attemptToAcquireLock(depth, dLink, datasourceId);

        DEV(">%d Initial read lock: %s state=%s", depth, datasourceId, state);

        // Step 3: Poll the lock.
        // Someone else has the lock.
        // Start polling by reading the lock and checking the ticks make progress indicating the holder is still alive.

        // Our record of the state.
        int pollWaitAttempts = 0;
        Id sessionToken = state.session;

        // One loop for each change of lock ownership (someone else grabs).
        // pollReadLock includes the tracking of ticks advancing.
        for(;;) {
            pollWaitAttempts++;
            if ( pollWaitAttempts > LOCK_STATE_CHANGE_RETRIES )
                break;
            // Loop looking for ticks change.
            DEV(">%d Poll lock : %s", depth, datasourceId);

            LockState state2 = pollReadLock(dLink, datasourceId, state);

            if ( LockState.isFree(state2) ) {
                DEV("Lock became free: %s", datasourceId);
                // Lock now free : restart.
                return attemptToAcquireLock(depth, dLink, datasourceId);
            }

            DEV(">%d Observe lock: (poll=%d) %s state=%s", depth, pollWaitAttempts, datasourceId, state);
            // Two cases: same session, ticks have not advanced; and different session (any ticks)
            Id sessionToken2 = state2.session;
            if ( sessionToken.equals(sessionToken2) )
                // Ticks not advancing.
                break;

            // Someone else grabbed the session
            DEV("Restart/other party");
            // Move to new state.
            state = state2;
            // Loop
        }

        FmtLog.warn(LOG, "Grabbing the lock: "+datasourceId);

        // Lock has been changing but we have waited too long.
        // Grab the lock.

        Id id = dLink.grabLock(datasourceId, sessionToken);
        DEV("Grab: "+id);

        if ( id != null )
            // Grab succeeds.
            return id;
        // Grab fails. Someone else got it or it became free. Start again.
        return attemptToAcquireLock(depth, dLink, datasourceId);
    }

    /** Watch the lock advance.
     * Loop watching for the lock
     *

     *
 If the the ticks do not advance, timeout and return null.
     *

     *
ticks advance, reset the observed tick setting and keep polling
     *
if the lock changes owner, return the new lock state
     *

     */
    private static LockState pollReadLock(DeltaLink dLink, Id datasourceId, LockState lockState) {
        int totalAttempts = 0;
        int sameTickAttempts = 0;

        for(;;) {
            Id lockSession = lockState.session;
            long ticks = lockState.ticks;
            sameTickAttempts++;
            totalAttempts++;
            if ( sameTickAttempts > LOCK_SAME_TICKS_RETRIES ) {
                DEV("{%d} Lock not advancing - end polling", totalAttempts);
                return lockState;
            }
            Lib.sleep(LOCK_POLL_WAIT_MS);
            DEV("{%d} ticks=%s", totalAttempts, ticks);
            LockState state2 = dLink.readLock(datasourceId);
            if ( LockState.isFree(state2) ) {
                // Lock became free.
                DEV("Poll lock attempt=%d - lock became free", sameTickAttempts);
                return LockState.UNLOCKED;
            }

            DEV("{%d} lock state %s", totalAttempts, state2);
            Id sessionToken2 = state2.session;
            long ticks2 = state2.ticks;

            if ( ! Objects.equals(lockSession, sessionToken2) ) {
                // Lock session id changed.
                DEV("{%d} owner changed to %s", totalAttempts, sessionToken2);
                return state2;
            }
            if ( ticks2 > ticks ) {
                DEV("{%d} ticks advanced %d", totalAttempts, ticks2);
                lockState = state2;
                sameTickAttempts = 0;
            } else
                DEV("{%d} ticks did not advance", totalAttempts);
            // And loop.
        }
    }
}


text:
package args

import (
	"bytes"
	"flag"
	"fmt"
	"io/ioutil"
	"os"
	"path"
	"path/filepath"
	"strconv"
	"strings"
	"time"

	"go-common/app/tool/gengo/generator"
	"go-common/app/tool/gengo/namer"
	"go-common/app/tool/gengo/parser"
	"go-common/app/tool/gengo/types"
)

// Default returns a defaulted GeneratorArgs. You may change the defaults
// before calling AddFlags.
func Default() *GeneratorArgs {
	return &GeneratorArgs{
		OutputBase:                 DefaultSourceTree(),
		GoHeaderFilePath:           filepath.Join(DefaultSourceTree(), "go-common/app/tool/gengo/boilerplate/boilerplate.go.txt"),
		GeneratedBuildTag:          "ignore_autogenerated",
		GeneratedByCommentTemplate: "// Code generated by GENERATOR_NAME. DO NOT EDIT.",
		defaultCommandLineFlags:    true,
	}
}

// GeneratorArgs has arguments that are passed to generators.
type GeneratorArgs struct {
	// Which directories to parse.
	InputDirs StringSliceVar

	// Source tree to write results to.
	OutputBase string

	// Package path within the source tree.
	OutputPackagePath string

	// Output file name.
	OutputFileBaseName string

	// Where to get copyright header text.
	GoHeaderFilePath string

	// If GeneratedByCommentTemplate is set, generate a "Code generated by" comment
	// below the bloilerplate, of the format defined by this string.
	// Any instances of "GENERATOR_NAME" will be replaced with the name of the code generator.
	GeneratedByCommentTemplate string

	// If true, only verify, don't write anything.
	VerifyOnly bool

	// GeneratedBuildTag is the tag used to identify code generated by execution
	// of this type. Each generator should use a different tag, and different
	// groups of generators (external API that depends on Kube generations) should
	// keep tags distinct as well.
	GeneratedBuildTag string

	// Any custom arguments go here
	CustomArgs interface{}

	// Whether to use default command line flags
	defaultCommandLineFlags bool
}

// WithoutDefaultFlagParsing disables implicit addition of command line flags and parsing.
func (g *GeneratorArgs) WithoutDefaultFlagParsing() *GeneratorArgs {
	g.defaultCommandLineFlags = false
	return g
}

// AddFlags is
func (g *GeneratorArgs) AddFlags(fs *flag.FlagSet) {
	fs.Var(&g.InputDirs, "input-dirs", "Comma-separated list of import paths to get input types from.")
	fs.StringVar(&g.OutputBase, "output-base", g.OutputBase, "Output base; defaults to $GOPATH/src/ or ./ if $GOPATH is not set.")
	fs.StringVar(&g.OutputPackagePath, "output-package", g.OutputPackagePath, "Base package path.")
	fs.StringVar(&g.OutputFileBaseName, "output-file-base", g.OutputFileBaseName, "Base name (without .go suffix) for output files.")
	fs.StringVar(&g.GoHeaderFilePath, "go-header-file", g.GoHeaderFilePath, "File containing boilerplate header text. The string YEAR will be replaced with the current 4-digit year.")
	fs.BoolVar(&g.VerifyOnly, "verify-only", g.VerifyOnly, "If true, only verify existing output, do not write anything.")
	fs.StringVar(&g.GeneratedBuildTag, "build-tag", g.GeneratedBuildTag, "A Go build tag to use to identify files generated by this command. Should be unique.")
}

// LoadGoBoilerplate loads the boilerplate file passed to --go-header-file.
func (g *GeneratorArgs) LoadGoBoilerplate() ([]byte, error) {
	b, err := ioutil.ReadFile(g.GoHeaderFilePath)
	if err != nil {
		return nil, err
	}
	b = bytes.Replace(b, []byte("YEAR"), []byte(strconv.Itoa(time.Now().Year())), -1)

	if g.GeneratedByCommentTemplate != "" {
		if len(b) != 0 {
			b = append(b, byte('\n'))
		}
		generatorName := path.Base(os.Args[0])
		generatedByComment := strings.Replace(g.GeneratedByCommentTemplate, "GENERATOR_NAME", generatorName, -1)
		s := fmt.Sprintf("%s\n\n", generatedByComment)
		b = append(b, []byte(s)...)
	}
	return b, nil
}

// NewBuilder makes a new parser.Builder and populates it with the input
// directories.
func (g *GeneratorArgs) NewBuilder() (*parser.Builder, error) {
	b := parser.New()
	// Ignore all auto-generated files.
	b.AddBuildTags(g.GeneratedBuildTag)

	for _, d := range g.InputDirs {
		var err error
		if strings.HasSuffix(d, "/...") {
			err = b.AddDirRecursive(strings.TrimSuffix(d, "/..."))
		} else {
			err = b.AddDir(d)
		}
		if err != nil {
			return nil, fmt.Errorf("unable to add directory %q: %v", d, err)
		}
	}
	return b, nil
}

// InputIncludes returns true if the given package is a (sub) package of one of
// the InputDirs.
func (g *GeneratorArgs) InputIncludes(p *types.Package) bool {
	for _, dir := range g.InputDirs {
		d := dir
		if strings.HasSuffix(d, "...") {
			d = strings.TrimSuffix(d, "...")
		}
		if strings.HasPrefix(p.Path, d) {
			return true
		}
	}
	return false
}

// DefaultSourceTree returns the /src directory of the first entry in $GOPATH.
// If $GOPATH is empty, it returns "./". Useful as a default output location.
func DefaultSourceTree() string {
	paths := strings.Split(os.Getenv("GOPATH"), string(filepath.ListSeparator))
	if len(paths) > 0 && len(paths[0]) > 0 {
		return filepath.Join(paths[0], "src")
	}
	return "./"
}

// Execute implements main().
// If you don't need any non-default behavior, use as:
// args.Default().Execute(...)
func (g *GeneratorArgs) Execute(nameSystems namer.NameSystems, defaultSystem string, pkgs func(*generator.Context, *GeneratorArgs) generator.Packages) error {
	if g.defaultCommandLineFlags {
		g.AddFlags(flag.CommandLine)
		// flag.CommandLine.AddGoFlagSet(goflag.CommandLine)
		flag.Parse()
	}

	b, err := g.NewBuilder()
	if err != nil {
		return fmt.Errorf("Failed making a parser: %v", err)
	}

	c, err := generator.NewContext(b, nameSystems, defaultSystem)
	if err != nil {
		return fmt.Errorf("Failed making a context: %v", err)
	}

	c.Verify = g.VerifyOnly
	packages := pkgs(c, g)
	if err := c.ExecutePackages(g.OutputBase, packages); err != nil {
		return fmt.Errorf("Failed executing generator: %v", err)
	}

	return nil
}


text:
<!doctype html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="generator" content="PHPDoctor 2.0.5 (http://peej.github.com/phpdoctor/)">
<meta name="when" content="Mon, 09 Feb 2015 02:37:40 +0000">

<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
<link rel="start" href="../../../overview-summary.html">

<title>MarkLogic/MLPHP/ElementQueryConstraint.php (MLPHP)</title>

MLPHP

Overview

Package

Class

Tree

Files

Deprecated

Todo

Index

Frames
No frames

MarkLogic/MLPHP/ElementQueryConstraint.php

<?php

namespace MarkLogic\MLPHP;

/**
 * Represents an element-query constraint for search.
 *
 * @package MLPHP
 * @author Mike Wooldridge <mike.wooldridge@marklogic.com>
 */
class ElementQueryConstraint extends AbstractConstraint
{
    private $elem; // @var string
    private $ns; // @var string

    /**
     * Create a ElementQueryConstraint object.
     *
     * @see http://docs.marklogic.com/search:search#opt-constraint
     *
     * @param string $name Constraint name.
     * @param string $elem Element name.
     * @param string $ns Element namespace.
     */
    public function __construct($name, $elem, $ns = '')
    {
        $this->elem = (string)$elem;
        $this->ns = (string)$ns;
        parent::__construct($name);
    }

    /**
     * Get the constraint as a DOMElement object.
     *
     * @param DOMDocument $dom The DOMDocument object with which to create the element.
     */
    public function getAsElem($dom)
    {
        $constElem = $dom->createElement('constraint');
        $constElem->setAttribute('name', $this->name);
        $eqElem = $dom->createElement('element-query');
        $eqElem->setAttribute('ns', $this->ns);
        $eqElem->setAttribute('name', $this->elem);
        $constElem->appendChild($eqElem);
        /* <constraint name='sample-element-constraint'>
              <element-query name='title' ns='http://my/namespace' />
         </constraint> */
        return $constElem;
    }
}

MLPHP

Overview

Package

Class

Tree

Files

Deprecated

Todo

Index

Frames
No frames

Copyright 2002-2013 MarkLogic Corporation.  All Rights Reserved.


text:
var http=require('http');
var url=require('url');
var util=require('util');
var rssresult= require('./RSS');
var utf8 = require('utf8');
var rssArr=[];

var FeedParser=require('feedparser')
	,request=require('request');
var rssPath='http://habrahabr.ru/rss/feed/posts/3579533107158215c7375135d25f59b2/';
var options ={feedurl:'http://habrahabr.ru/rss/feed/posts/3579533107158215c7375135d25f59b2/'};
var req=request(rssPath)
	,feedparser=new FeedParser([options]);

	req.on('error',function(error){

	});

req.on('response', function (res) {
  var stream = this;

  if (res.statusCode != 200) return this.emit('error', new Error('Bad status code'));

  stream.pipe(feedparser);
});
feedparser.on('error', function(error) {
  // always handle errors
  console.error(error.message+' '+error.stacktrace);
});
feedparser.on('readable', function() {
  // This is where the action is!
  var stream = this
    , meta = this.meta // **NOTE** the "meta" is always available in the context of the feedparser instance
    , item;
var i=0;
  while (item = stream.read()) {
	rssArr[i]=item;
	i=i+1;
  }
});

var server=new http.Server(function(req,res){
	console.log(req.method,req.url)

	var urlParsed=url.parse(req.url,true);
	console.log(urlParsed);
	if(urlParsed.pathname=='/echo' &&urlParsed.query.message)
	{
		res.end(urlParsed.query.message);
	}
	else if(urlParsed.pathname=='/rss' &&urlParsed.query.message)
	{
		options.feedurl=urlParsed.query.message;
		req=request(options.feedurl);
		req.emit('response',options.feedurl);
		//res.end(util.format("%s",rssresult.title));
		var index;

for	(index = 0; index < rssArr.length; index++) {
   res.write(utf8.encode(rssArr[index].title)+" "
   +utf8.encode(rssArr[index].author)+" "+utf8.encode(rssArr[index].link+
   "

"+rssArr[index].description+"
/div>"));
}
res.end();
	}
	else {
		res.statusCode=404;
		res.end("Page not found!")
	}

});
server.listen(1337,'127.0.0.1');


text:
var binding = require("../build/Release/profiler");

function Snapshot() {}

Snapshot.prototype.compare = function (other) {
  var my_objects = this.nodeCounts(),
      their_objects = other.nodeCounts(),
      diff = {}, i, k, my_val, their_val;
      all_keys = Object.keys(my_objects).concat(Object.keys(their_objects)); //has dupes, oh well
  for (i = 0; i < all_keys.length; i++) {
    k = all_keys[i];
    my_val = my_objects[k] || 0;
    their_val = their_objects[k] || 0;
    diff[k] = their_val - my_val;
  }
  return diff;
};

Snapshot.prototype.hotPath = function() {
  var path = [], node = this.root, c, i = 0;
  c = this.children(node);
  while (c.length > 0 && i < 1000) {
    node = c[0].to;
    c = this.children(node);
    path.push(node);
    i++;
  }
  return path;
};

Snapshot.prototype.children = function(node) {
  var i, children = [];
  for(i = 0; i < node.childrenCount; i++) {
    children[i] = node.getChild(i);
  }
  children.sort(function (a, b){
    return b.to.retainedSize() - a.to.retainedSize();
  });
  return children;
};

Snapshot.prototype.topDominatorIds = function() {
  var doms = {}, arr;
  this.allNodes().forEach(function(node){
    var dom = node.dominatorNode || { id: "none"};
    if (doms[dom.id]) {
      doms[dom.id] += 1;
    }
    else {
      doms[dom.id] = 1;
    }
  });
  arr = Object.keys(doms).map(function(d){
    return {id: d, count: doms[d]};
  });
  arr.sort(function(a, b) {
    return b.count - a.count;
  });
  return arr;
};

Snapshot.prototype.topDominators = function() {
  var self = this;
  return this.topDominatorIds().map(function(d){
    return self.getNodeById(+d.id);
  });
};

Snapshot.prototype.allNodes = function() {
  var n = this.nodesCount, i, nodes = [];
  for (i = 0; i < n; i++) {
    nodes[i] = this.getNode(i);
  }
  return nodes;
};

Snapshot.prototype.nodeCounts = function() {
  var objects = {};
  this.allNodes().forEach(function(n){
    if(n.type === "Object") {
      if (objects[n.name]) {
        objects[n.name] += 1;
      }
      else {
        objects[n.name] = 1;
      }
    }
    else {
      if (objects[n.type]) {
        objects[n.type] += 1;
      }
      else {
        objects[n.type] = 1;
      }
    }
  });
  return objects;
};

//adapted from WebCore/bindings/v8/ScriptHeapSnapshot.cpp
Snapshot.prototype.stringify = function() {
  var root = this.root, i, j, count_i, count_j, node,
      lowLevels = {}, entries = {}, entry,
      children = {}, child, edge, result = {};
  for (i = 0, count_i = root.childrenCount; i < count_i; i++) {
    node = root.getChild(i).to;
    if (node.type === 'Hidden') {
      lowLevels[node.name] = {
        count: node.instancesCount,
        size: node.size,
        type: node.name
      };
    }
    else if (node.instancesCount > 0) {
      entries[node.name] = {
        constructorName: node.name,
        count: node.instancesCount,
        size: node.size
      };
    }
    // FIXME: the children portion is too slow and bloats the results
    //*
    else {
      entry = {
        constructorName: node.name
      };
      for(j = 0, count_j = node.childrenCount; j < count_j; j++) {
        edge = node.getChild(j);
        child = edge.to;
        entry[child.ptr.toString()] = {
          constructorName: child.name,
          count: parseInt(edge.name, 10)
        };
      }
      children[node.ptr.toString()] = entry;
    }//*/
  }
  result.lowlevels = lowLevels;
  result.entries = entries;
  result.children = children;
  return JSON.stringify(result);
};

function CpuProfile() {}

function inspectorObjectFor(node) {
  var i, count, child,
      result = {
        functionName: node.functionName,
        url: node.scriptName,
        lineNumber: node.lineNumber,
        totalTime: node.totalTime,
        selfTime: node.selfTime,
        numberOfCalls: 0,
        visible: true,
        callUID: node.callUid,
        children: []
      };
  for(i = 0, count = node.childrenCount; i < count; i++) {
    child = node.getChild(i);
    result.children.push(inspectorObjectFor(child));
  }
  return result;
}

CpuProfile.prototype.getTopDownRoot = function() {
  return inspectorObjectFor(this.topRoot);
};

CpuProfile.prototype.getBottomUpRoot = function() {
  return inspectorObjectFor(this.bottomRoot);
};

var heapCache = [];

exports.takeSnapshot = function(name, control) {
  if (typeof name == 'function') {
    control = name;
    name = '';
  }

  if (!name || !name.length) {
    name = 'org.nodejs.profiles.heap.user-initiated.' + (heapCache.length + 1);
  }

  var snapshot = binding.heapProfiler.takeSnapshot(name, control);
  snapshot.__proto__ = Snapshot.prototype;
  heapCache.push(snapshot);

  return snapshot;
};

exports.getSnapshot = function(index) {
  return heapCache[index];
};

exports.findSnapshot = function(uid) {
  return heapCache.filter(function(s) {return s.uid === uid;})[0];
};

exports.snapshotCount = function() {
  return heapCache.length;
};

exports.deleteAllSnapshots = function () {
	heapCache = [];
	binding.heapProfiler.deleteAllSnapshots();
};

var cpuCache = [];

exports.startProfiling = function(name) {
  if (!name || !name.length) {
    name = 'org.nodejs.profiles.cpu.user-initiated.' + (cpuCache.length + 1);
  }

  binding.cpuProfiler.startProfiling(name);
};

exports.stopProfiling = function(name) {
  name = name ? name : '';
  var profile = binding.cpuProfiler.stopProfiling(name);
  profile.__proto__ = CpuProfile.prototype;
  cpuCache.push(profile);
  return profile;
};

exports.getProfile = function(index) {
  return cpuCache[index];
};

exports.findProfile = function(uid) {
  return cpuCache.filter(function(s) {return s.uid === uid;})[0];
};

exports.profileCount = function() {
  return cpuCache.length;
};

exports.deleteAllProfiles = function() {
  cpuCache = [];
  binding.cpuProfiler.deleteAllProfiles();
};

process.profiler = exports;