text:
package com.amazonaws.services.waf.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 *
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListSizeConstraintSetsResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {

    /**
     *

     * If you have more SizeConstraintSet objects than the number that you specified for Limit
     * in the request, the response includes a NextMarker value. To list more
     * SizeConstraintSet objects, submit another ListSizeConstraintSets request, and specify
     * the NextMarker value from the response in the NextMarker value in the next request.
     *

     */
    private String nextMarker;
    /**
     *

     * An array of SizeConstraintSetSummary objects.
     *

     */
    private java.util.List<SizeConstraintSetSummary> sizeConstraintSets;

    /**
     *

     * If you have more SizeConstraintSet objects than the number that you specified for Limit
     * in the request, the response includes a NextMarker value. To list more
     * SizeConstraintSet objects, submit another ListSizeConstraintSets request, and specify
     * the NextMarker value from the response in the NextMarker value in the next request.
     *

     *
     * @param nextMarker
     *        If you have more SizeConstraintSet objects than the number that you specified for
     *        Limit in the request, the response includes a NextMarker value. To list more
     *        SizeConstraintSet objects, submit another ListSizeConstraintSets request, and
     *        specify the NextMarker value from the response in the NextMarker value in the
     *        next request.
     */

    public void setNextMarker(String nextMarker) {
        this.nextMarker = nextMarker;
    }

    /**
     *

     * If you have more SizeConstraintSet objects than the number that you specified for Limit
     * in the request, the response includes a NextMarker value. To list more
     * SizeConstraintSet objects, submit another ListSizeConstraintSets request, and specify
     * the NextMarker value from the response in the NextMarker value in the next request.
     *

     *
     * @return If you have more SizeConstraintSet objects than the number that you specified for
     *         Limit in the request, the response includes a NextMarker value. To list more
     *         SizeConstraintSet objects, submit another ListSizeConstraintSets request, and
     *         specify the NextMarker value from the response in the NextMarker value in the
     *         next request.
     */

    public String getNextMarker() {
        return this.nextMarker;
    }

    /**
     *

     * If you have more SizeConstraintSet objects than the number that you specified for Limit
     * in the request, the response includes a NextMarker value. To list more
     * SizeConstraintSet objects, submit another ListSizeConstraintSets request, and specify
     * the NextMarker value from the response in the NextMarker value in the next request.
     *

     *
     * @param nextMarker
     *        If you have more SizeConstraintSet objects than the number that you specified for
     *        Limit in the request, the response includes a NextMarker value. To list more
     *        SizeConstraintSet objects, submit another ListSizeConstraintSets request, and
     *        specify the NextMarker value from the response in the NextMarker value in the
     *        next request.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListSizeConstraintSetsResult withNextMarker(String nextMarker) {
        setNextMarker(nextMarker);
        return this;
    }

    /**
     *

     * An array of SizeConstraintSetSummary objects.
     *

     *
     * @return An array of SizeConstraintSetSummary objects.
     */

    public java.util.List<SizeConstraintSetSummary> getSizeConstraintSets() {
        return sizeConstraintSets;
    }

    /**
     *

     * An array of SizeConstraintSetSummary objects.
     *

     *
     * @param sizeConstraintSets
     *        An array of SizeConstraintSetSummary objects.
     */

    public void setSizeConstraintSets(java.util.Collection<SizeConstraintSetSummary> sizeConstraintSets) {
        if (sizeConstraintSets == null) {
            this.sizeConstraintSets = null;
            return;
        }

        this.sizeConstraintSets = new java.util.ArrayList<SizeConstraintSetSummary>(sizeConstraintSets);
    }

    /**
     *

     * An array of SizeConstraintSetSummary objects.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setSizeConstraintSets(java.util.Collection)} or {@link #withSizeConstraintSets(java.util.Collection)} if
     * you want to override the existing values.
     *

     *
     * @param sizeConstraintSets
     *        An array of SizeConstraintSetSummary objects.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListSizeConstraintSetsResult withSizeConstraintSets(SizeConstraintSetSummary... sizeConstraintSets) {
        if (this.sizeConstraintSets == null) {
            setSizeConstraintSets(new java.util.ArrayList<SizeConstraintSetSummary>(sizeConstraintSets.length));
        }
        for (SizeConstraintSetSummary ele : sizeConstraintSets) {
            this.sizeConstraintSets.add(ele);
        }
        return this;
    }

    /**
     *

     * An array of SizeConstraintSetSummary objects.
     *

     *
     * @param sizeConstraintSets
     *        An array of SizeConstraintSetSummary objects.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListSizeConstraintSetsResult withSizeConstraintSets(java.util.Collection<SizeConstraintSetSummary> sizeConstraintSets) {
        setSizeConstraintSets(sizeConstraintSets);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getNextMarker() != null)
            sb.append("NextMarker: ").append(getNextMarker()).append(",");
        if (getSizeConstraintSets() != null)
            sb.append("SizeConstraintSets: ").append(getSizeConstraintSets());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ListSizeConstraintSetsResult == false)
            return false;
        ListSizeConstraintSetsResult other = (ListSizeConstraintSetsResult) obj;
        if (other.getNextMarker() == null ^ this.getNextMarker() == null)
            return false;
        if (other.getNextMarker() != null && other.getNextMarker().equals(this.getNextMarker()) == false)
            return false;
        if (other.getSizeConstraintSets() == null ^ this.getSizeConstraintSets() == null)
            return false;
        if (other.getSizeConstraintSets() != null && other.getSizeConstraintSets().equals(this.getSizeConstraintSets()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getNextMarker() == null) ? 0 : getNextMarker().hashCode());
        hashCode = prime * hashCode + ((getSizeConstraintSets() == null) ? 0 : getSizeConstraintSets().hashCode());
        return hashCode;
    }

    @Override
    public ListSizeConstraintSetsResult clone() {
        try {
            return (ListSizeConstraintSetsResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}


text:
@(menu: Html)

    @if(menu.body.trim != "") {

          Panop

            @menu

            @menu

          menu

    }

redpajama_set_name: RedPajamaGithub


text:
/**
 * Play HTML Compressor
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://github.com/mohiva/play-html-compressor/blob/master/LICENSE.md
 */
package com.mohiva.play.htmlcompressor.fixtures.java;

import com.mohiva.play.htmlcompressor.HTMLCompressorFilter;
import play.mvc.EssentialFilter;
import play.filters.gzip.GzipFilter;
import play.http.DefaultHttpFilters;

import java.util.LinkedList;
import java.util.List;
import javax.inject.Inject;

/**
 * Provides the default HTML compressor filter with a Gzip filter.
 */
public class WithGzipFilter extends DefaultHttpFilters {

    private HTMLCompressorFilter htmlCompressor;
    private GzipFilter gzip;

    @Inject
    public WithGzipFilter(HTMLCompressorFilter htmlCompressor, GzipFilter gzip) {
        this.htmlCompressor = htmlCompressor;
        this.gzip = gzip;
    }

    @Override
    public List<EssentialFilter> getFilters() {
        List<EssentialFilter> l = new LinkedList<EssentialFilter>();
        l.add(gzip.asJava());
        l.add(htmlCompressor.asJava());
        return l;
    }
}


text:
import {connect} from 'react-redux';

import {Preferences} from 'mattermost-redux/constants';
import {getCustomEmojisByName} from 'mattermost-redux/selectors/entities/emojis';
import {getTheme, getBool} from 'mattermost-redux/selectors/entities/preferences';
import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams';
import {getCurrentUser, getCurrentUserMentionKeys, getUsersByUsername} from 'mattermost-redux/selectors/entities/users';

import {EmojiMap} from 'stores/emoji_store.jsx';

import {getSiteURL} from 'utils/url.jsx';

import PostMessageView from './post_message_view.jsx';

function makeMapStateToProps() {
    let emojiMap;
    let oldCustomEmoji;

    return function mapStateToProps(state, ownProps) {
        const newCustomEmoji = getCustomEmojisByName(state);
        if (newCustomEmoji !== oldCustomEmoji) {
            emojiMap = new EmojiMap(newCustomEmoji);
        }
        oldCustomEmoji = newCustomEmoji;

        const user = getCurrentUser(state);

        return {
            ...ownProps,
            emojis: emojiMap,
            enableFormatting: getBool(state, Preferences.CATEGORY_ADVANCED_SETTINGS, 'formatting', true),
            mentionKeys: getCurrentUserMentionKeys(state),
            usernameMap: getUsersByUsername(state),
            team: getCurrentTeam(state),
            siteUrl: getSiteURL(),
            theme: getTheme(state),
            pluginPostTypes: state.plugins.postTypes,
            currentUser: user
        };
    };
}

export default connect(makeMapStateToProps)(PostMessageView);


text:
import {
  _IDLE_,
  _JOINED_,
  _CALL_,
  _LEFT_,
  MEETING_END_REASON,
  MEDIA_STATE,
  AUDIO,
  VIDEO,
  MediaContent
} from '../constants';
import ParameterError from '../common/errors/parameter';

const SelfUtils = {};

/**
 * parses the relevant values for self: muted, guest, moderator, mediaStatus, state, joinedWith, creator, id
 * @param {Object} self
 * @param {String} deviceId
 * @returns {undefined}
 */
SelfUtils.parse = (self, deviceId) => {
  if (self) {
    const joinedWith = self.devices.find((device) => deviceId === device.url);

    return {
      muted: SelfUtils.getMuted(self),
      lastModified: SelfUtils.getLastModified(self),
      modifiedBy: SelfUtils.getModifiedBy(self),
      guest: self.guest,
      moderator: self.moderator,
      // cumulative media stats
      mediaStatus: SelfUtils.getStatus(self.status),
      state: self.state,
      // TODO: give a proper name . With same device as login or different login`
      // Some times we might have joined with both mobile and web
      joinedWith,
      // current media stats is for the current device who has joined
      currentMediaStatus: SelfUtils.getMediaStatus(
        joinedWith?.mediaSessions
      ),
      creator: self.isCreator, // check if its used,
      selfId: self.id,
      selfIdentity: SelfUtils.getSelfIdentity(self),
      selfUrl: self.url,
      removed: self.removed
    };
  }

  return null;
};

SelfUtils.getSelves = (oldSelf, newSelf, deviceId) => {
  const previous = oldSelf && SelfUtils.parse(oldSelf, deviceId);
  const current = newSelf && SelfUtils.parse(newSelf, deviceId);
  const updates = {};

  updates.isUnadmittedGuest = SelfUtils.isUnadmittedGuest(current);
  updates.isAdmittedGuest = SelfUtils.isAdmittedGuest(previous, current);
  updates.isMutedByOthers = SelfUtils.mutedByOthers(previous, current);
  updates.moderatorChanged = SelfUtils.moderatorChanged(previous, current);
  updates.isMediaInactiveOrReleased = SelfUtils.wasMediaInactiveOrReleased(previous, current);

  updates.isMediaInactive = SelfUtils.isMediaInactive(previous, current);
  updates.audioStateChange = previous?.currentMediaStatus.audio !== current.currentMediaStatus.audio;
  updates.videoStateChange = previous?.currentMediaStatus.video !== current.currentMediaStatus.video;
  updates.shareStateChange = previous?.currentMediaStatus.share !== current.currentMediaStatus.share;

  return {
    previous,
    current,
    updates
  };
};

SelfUtils.isMediaInactive = (previous, current) => {
  if (
    previous &&
    previous.joinedWith &&
    previous.joinedWith.mediaSessions &&
    current &&
    current.joinedWith &&
    current.joinedWith.mediaSessions
  ) {
    const previousMediaStatus = SelfUtils.getMediaStatus(
      previous.joinedWith.mediaSessions
    );
    const currentMediaStatus = SelfUtils.getMediaStatus(
      current.joinedWith.mediaSessions
    );

    if (
      previousMediaStatus.audio && currentMediaStatus.audio &&
      previousMediaStatus.audio.state !== MEDIA_STATE.inactive &&
      currentMediaStatus.audio.state === MEDIA_STATE.inactive &&
      currentMediaStatus.audio.direction !== MEDIA_STATE.inactive
    ) {
      return true;
    }

    if (
      previousMediaStatus.video && currentMediaStatus.video &&
      previousMediaStatus.video.state !== MEDIA_STATE.inactive &&
      currentMediaStatus.video.state === MEDIA_STATE.inactive &&
      currentMediaStatus.video.direction !== MEDIA_STATE.inactive
    ) {
      return true;
    }

    if (
      previousMediaStatus.share && currentMediaStatus.share &&
      previousMediaStatus.share.state !== MEDIA_STATE.inactive &&
      currentMediaStatus.share.state === MEDIA_STATE.inactive &&
      currentMediaStatus.share.direction !== MEDIA_STATE.inactive
    ) {
      return true;
    }

    return false;
  }

  return false;
};

SelfUtils.getLastModified = (self) => {
  if (!self || !self.controls || !self.controls.audio || !self.controls.audio.meta || !self.controls.audio.meta.lastModified) {
    return null;
  }

  return self.controls.audio.meta.lastModified;
};

SelfUtils.getModifiedBy = (self) => {
  if (!self || !self.controls || !self.controls.audio || !self.controls.audio.meta || !self.controls.audio.meta.modifiedBy) {
    return null;
  }

  return self.controls.audio.meta.modifiedBy;
};

/**
 * get the id from the self object
 * @param {Object} self
 * @returns {String}
 */
SelfUtils.getSelfIdentity = (self) => {
  if (!self && !self.person) {
    return null;
  }

  return self.person.id;
};

/**
 * get the muted property from the self object
 * @param {Object} self
 * @returns {Boolean}
 */
SelfUtils.getMuted = (self) => {
  if (!self || !self.controls || !self.controls.audio) {
    return null;
  }

  return self.controls.audio.muted;
};

SelfUtils.getStatus = (status) => ({
  audio: status.audioStatus,
  video: status.videoStatus,
  slides: status.videoSlidesStatus
});

/**
 * @param {Object} oldSelf
 * @param {Object} changedSelf
 * @returns {Boolean}
 */
SelfUtils.wasMediaInactiveOrReleased = (oldSelf = {}, changedSelf) => oldSelf.joinedWith && oldSelf.joinedWith.state === _JOINED_ && changedSelf.joinedWith.state === _LEFT_ &&
 (changedSelf.joinedWith.reason === MEETING_END_REASON.INACTIVE || changedSelf.joinedWith.reason === MEETING_END_REASON.MEDIA_RELEASED);

/**
 * @param {Object} check
 * @returns {Boolean}
 */
SelfUtils.isLocusGuestUnadmitted = (check) => check && check.guest && check.state === _IDLE_;

/**
 * @param {Object} check
 * @returns {Boolean}
 */
SelfUtils.isLocusGuestAdmitted = (check) => check && check.guest && check.state === _JOINED_;

/**
 * @param {Object} self
 * @returns {Boolean}
 * @throws {Error} when self is undefined
 */
SelfUtils.isUnadmittedGuest = (self) => {
  if (!self) {
    throw new ParameterError('self must be defined to determine if self is unadmitted as guest.');
  }

  return SelfUtils.isLocusGuestUnadmitted(self);
};

SelfUtils.moderatorChanged = (oldSelf, changedSelf) => {
  if (!oldSelf) {
    return true;
  }
  if (!changedSelf) {
    throw new ParameterError('New self must be defined to determine if self transitioned moderator status.');
  }

  return oldSelf.moderator !== changedSelf.moderator;
};

/**
 * @param {Object} oldSelf
 * @param {Object} changedSelf
 * @returns {Boolean}
 * @throws {Error} if changed self was undefined
 */
SelfUtils.isAdmittedGuest = (oldSelf, changedSelf) => {
  if (!oldSelf) {
    // if there was no previous locus, it couldn't have been admitted yet
    return false;
  }
  if (!changedSelf) {
    throw new ParameterError('New self must be defined to determine if self transitioned to admitted as guest.');
  }

  return SelfUtils.isLocusGuestUnadmitted(oldSelf) && SelfUtils.isLocusGuestAdmitted(changedSelf);
};

SelfUtils.mutedByOthers = (oldSelf = {}, changedSelf) => {
  if (!changedSelf) {
    throw new ParameterError('New self must be defined to determine if self was muted by others.');
  }

  return changedSelf.muted && (oldSelf.lastModified !== changedSelf.lastModified || oldSelf.modifiedBy !== changedSelf.modifiedBy);
};

/**
 * extract the sipUrl from the partner
 * @param {Object} partner
 * @param {Object} info
 * @returns {Object}
 */

SelfUtils.getSipUrl = (partner, type, sipUri) => {
  // For webex meeting the sipUrl gets updated in info parser
  if (partner && type === _CALL_) {
    return {sipUri: partner.person.sipUrl || partner.person.id};
  }

  return {sipUri};
};

SelfUtils.getMediaStatus = (mediaSessions = []) => {
  const mediaStatus = {
    audio: {},
    video: {},
    share: {}
  };

  mediaStatus.audio = mediaSessions.find((media) => media.mediaType === AUDIO && media.mediaContent === MediaContent.main);
  mediaStatus.video = mediaSessions.find((media) => media.mediaType === VIDEO && media.mediaContent === MediaContent.main);
  mediaStatus.share = mediaSessions.find((media) => media.mediaType === VIDEO && media.mediaContent === MediaContent.slides);

  return mediaStatus;
};

export default SelfUtils;


text:
export GOPATH="${PROJECTS}/gocode"
PATH=$PATH:${GOPATH}/bin


text:
package com.coleman.util;

import android.widget.Toast;

public class ToastUtil {

    public static void show(String msg) {
        showMsg(msg, Toast.LENGTH_SHORT);
    }

    public static void show(String msg, int length) {
        showMsg(msg, length);
    }

    private static void showMsg(final String msg, final int length) {
        MyApp.handler.post(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(MyApp.context, msg, length).show();
            }
        });
    }
}


text:
import React from 'react';
import Coroutine from 'react-coroutine';
import SearchAPI from './SearchAPI';

/* A coroutine becomes a React component via this wrapper. */
export default Coroutine.create(SearchForm);

/* Async generator is used as a component that represents a stateful component
   with search results. The same rules are applicable as to functional component.
   The main difference comparing to plain functional component is that async generator
   yields particular UI state and then performs additional actions (awaitg for data)
   to create and yield new UI state. */
/* If you don't know what the thing is async generator, check the TC39 proposal:
   https://github.com/tc39/proposal-async-iteration#async-generator-functions */
async function* SearchForm({ query }) {
  /* Not really important. There is nothing to show if query is empty. */
  if (query.length === 0) return null;

  /* This call does not finish the execution of the component. It just provides a
     state of UI and then doing another stuff. */
  yield
Searching {query}...
;

  try {
    /* This piece is the same as with async functions. Some data is fetched and
       used with another plain functional component. */
    let { results } = await SearchAPI.retrieve(query);
    return <SearchResults results={results} />;
  } catch (error) {
    return <ErrorMessage error={error} />;
  }
}

function SearchResults({ results }) {
  return results.length === 0 ? (

No results

  ) : (

      {results.map((result) => (

{result.package.name} ({result.package.version})

{result.package.description}

      ))}

  );
}

function ErrorMessage({ error }) {
  return (

      Something went wrong!

{error.message}

  );
}


text:
import gfBadge from './googlefontsbadge.js';
gfBadge();


text:
require "spec_helper"

describe ShopsController do
  describe "routing" do

    it "recognizes and generates #index" do
      { :get => "/shops" }.should route_to(:controller => "shops", :action => "index")
    end

    it "recognizes and generates #new" do
      { :get => "/shops/new" }.should route_to(:controller => "shops", :action => "new")
    end

    it "recognizes and generates #show" do
      { :get => "/shops/1" }.should route_to(:controller => "shops", :action => "show", :id => "1")
    end

    it "recognizes and generates #edit" do
      { :get => "/shops/1/edit" }.should route_to(:controller => "shops", :action => "edit", :id => "1")
    end

    it "recognizes and generates #create" do
      { :post => "/shops" }.should route_to(:controller => "shops", :action => "create")
    end

    it "recognizes and generates #update" do
      { :put => "/shops/1" }.should route_to(:controller => "shops", :action => "update", :id => "1")
    end

    it "recognizes and generates #destroy" do
      { :delete => "/shops/1" }.should route_to(:controller => "shops", :action => "destroy", :id => "1")
    end

  end
end


text:
package gorpcqueryservice

import (
	"sync"

	mproto "github.com/youtube/vitess/go/mysql/proto"
	"github.com/youtube/vitess/go/vt/callerid"
	"github.com/youtube/vitess/go/vt/callinfo"
	"github.com/youtube/vitess/go/vt/rpc"
	"github.com/youtube/vitess/go/vt/servenv"
	"github.com/youtube/vitess/go/vt/tabletserver"
	"github.com/youtube/vitess/go/vt/tabletserver/proto"
	"github.com/youtube/vitess/go/vt/tabletserver/queryservice"
	"golang.org/x/net/context"

	pb "github.com/youtube/vitess/go/vt/proto/query"
)

// SqlQuery is the server object for gorpc SqlQuery
type SqlQuery struct {
	server queryservice.QueryService
}

// GetSessionId is exposing tabletserver.SqlQuery.GetSessionId
func (sq *SqlQuery) GetSessionId(sessionParams *proto.SessionParams, sessionInfo *proto.SessionInfo) (err error) {
	defer sq.server.HandlePanic(&err)
	tErr := sq.server.GetSessionId(sessionParams, sessionInfo)
	tabletserver.AddTabletError(tErr, &sessionInfo.Err)
	return nil
}

// GetSessionId2 should not be used by anything other than tests.
// It will eventually replace GetSessionId, but it breaks compatibility with older clients.
// Once all clients are upgraded, it can be replaced.
func (sq *SqlQuery) GetSessionId2(sessionIdReq *proto.GetSessionIdRequest, sessionInfo *proto.SessionInfo) (err error) {
	defer sq.server.HandlePanic(&err)
	tErr := sq.server.GetSessionId(&sessionIdReq.Params, sessionInfo)
	tabletserver.AddTabletError(tErr, &sessionInfo.Err)
	return nil
}

// Begin is exposing tabletserver.SqlQuery.Begin
func (sq *SqlQuery) Begin(ctx context.Context, session *proto.Session, txInfo *proto.TransactionInfo) (err error) {
	defer sq.server.HandlePanic(&err)
	tErr := sq.server.Begin(callinfo.RPCWrapCallInfo(ctx), nil, session, txInfo)
	tabletserver.AddTabletError(tErr, &txInfo.Err)
	return nil
}

// Begin2 should not be used by anything other than tests.
// It will eventually replace Begin, but it breaks compatibility with older clients.
// Once all clients are upgraded, it can be replaced.
func (sq *SqlQuery) Begin2(ctx context.Context, beginRequest *proto.BeginRequest, beginResponse *proto.BeginResponse) (err error) {
	defer sq.server.HandlePanic(&err)
	session := &proto.Session{
		SessionId: beginRequest.SessionId,
	}
	txInfo := new(proto.TransactionInfo)
	ctx = callerid.NewContext(ctx,
		callerid.GoRPCEffectiveCallerID(beginRequest.EffectiveCallerID),
		callerid.GoRPCImmediateCallerID(beginRequest.ImmediateCallerID),
	)
	tErr := sq.server.Begin(callinfo.RPCWrapCallInfo(ctx), proto.TargetToProto3(beginRequest.Target), session, txInfo)
	// Convert from TxInfo => beginResponse for the output
	beginResponse.TransactionId = txInfo.TransactionId
	tabletserver.AddTabletError(tErr, &beginResponse.Err)
	return nil
}

// Commit is exposing tabletserver.SqlQuery.Commit
func (sq *SqlQuery) Commit(ctx context.Context, session *proto.Session, noOutput *rpc.Unused) (err error) {
	defer sq.server.HandlePanic(&err)
	return sq.server.Commit(callinfo.RPCWrapCallInfo(ctx), nil, session)
}

// Commit2 should not be used by anything other than tests.
// It will eventually replace Commit, but it breaks compatibility with older clients.
// Once all clients are upgraded, it can be replaced.
func (sq *SqlQuery) Commit2(ctx context.Context, commitRequest *proto.CommitRequest, commitResponse *proto.CommitResponse) (err error) {
	defer sq.server.HandlePanic(&err)
	session := &proto.Session{
		SessionId:     commitRequest.SessionId,
		TransactionId: commitRequest.TransactionId,
	}
	ctx = callerid.NewContext(ctx,
		callerid.GoRPCEffectiveCallerID(commitRequest.EffectiveCallerID),
		callerid.GoRPCImmediateCallerID(commitRequest.ImmediateCallerID),
	)
	tErr := sq.server.Commit(callinfo.RPCWrapCallInfo(ctx), proto.TargetToProto3(commitRequest.Target), session)
	tabletserver.AddTabletError(tErr, &commitResponse.Err)
	return nil
}

// Rollback is exposing tabletserver.SqlQuery.Rollback
func (sq *SqlQuery) Rollback(ctx context.Context, session *proto.Session, noOutput *rpc.Unused) (err error) {
	defer sq.server.HandlePanic(&err)
	return sq.server.Rollback(callinfo.RPCWrapCallInfo(ctx), nil, session)
}

// Rollback2 should not be used by anything other than tests.
// It will eventually replace Rollback, but it breaks compatibility with older clients.
// Once all clients are upgraded, it can be replaced.
func (sq *SqlQuery) Rollback2(ctx context.Context, rollbackRequest *proto.RollbackRequest, rollbackResponse *proto.RollbackResponse) (err error) {
	defer sq.server.HandlePanic(&err)
	session := &proto.Session{
		SessionId:     rollbackRequest.SessionId,
		TransactionId: rollbackRequest.TransactionId,
	}
	ctx = callerid.NewContext(ctx,
		callerid.GoRPCEffectiveCallerID(rollbackRequest.EffectiveCallerID),
		callerid.GoRPCImmediateCallerID(rollbackRequest.ImmediateCallerID),
	)
	tErr := sq.server.Rollback(callinfo.RPCWrapCallInfo(ctx), proto.TargetToProto3(rollbackRequest.Target), session)
	tabletserver.AddTabletError(tErr, &rollbackResponse.Err)
	return nil
}

// Execute is exposing tabletserver.SqlQuery.Execute
func (sq *SqlQuery) Execute(ctx context.Context, query *proto.Query, reply *mproto.QueryResult) (err error) {
	defer sq.server.HandlePanic(&err)
	tErr := sq.server.Execute(callinfo.RPCWrapCallInfo(ctx), nil, query, reply)
	tabletserver.AddTabletError(tErr, &reply.Err)
	return nil
}

// Execute2 should not be used by anything other than tests
// It will eventually replace Execute, but it breaks compatibility with older clients
// Once all clients are upgraded, it can be replaced
func (sq *SqlQuery) Execute2(ctx context.Context, executeRequest *proto.ExecuteRequest, reply *mproto.QueryResult) (err error) {
	defer sq.server.HandlePanic(&err)
	ctx = callerid.NewContext(ctx,
		callerid.GoRPCEffectiveCallerID(executeRequest.EffectiveCallerID),
		callerid.GoRPCImmediateCallerID(executeRequest.ImmediateCallerID),
	)
	tErr := sq.server.Execute(callinfo.RPCWrapCallInfo(ctx), proto.TargetToProto3(executeRequest.Target), &executeRequest.QueryRequest, reply)
	tabletserver.AddTabletError(tErr, &reply.Err)
	return nil
}

// StreamExecute is exposing tabletserver.SqlQuery.StreamExecute
func (sq *SqlQuery) StreamExecute(ctx context.Context, query *proto.Query, sendReply func(reply interface{}) error) (err error) {
	defer sq.server.HandlePanic(&err)
	return sq.server.StreamExecute(callinfo.RPCWrapCallInfo(ctx), nil, query, func(reply *mproto.QueryResult) error {
		return sendReply(reply)
	})
}

// StreamExecute2 should not be used by anything other than tests.
// It will eventually replace Rollback, but it breaks compatibility with older clients.
// Once all clients are upgraded, it can be replaced.
func (sq *SqlQuery) StreamExecute2(ctx context.Context, req *proto.StreamExecuteRequest, sendReply func(reply interface{}) error) (err error) {
	defer sq.server.HandlePanic(&err)
	if req == nil || req.Query == nil {
		return nil
	}
	ctx = callerid.NewContext(ctx,
		callerid.GoRPCEffectiveCallerID(req.EffectiveCallerID),
		callerid.GoRPCImmediateCallerID(req.ImmediateCallerID),
	)
	tErr := sq.server.StreamExecute(callinfo.RPCWrapCallInfo(ctx), proto.TargetToProto3(req.Target), req.Query, func(reply *mproto.QueryResult) error {
		return sendReply(reply)
	})
	if tErr == nil {
		return nil
	}
	// If there was an app error, send a QueryResult back with it.
	qr := new(mproto.QueryResult)
	tabletserver.AddTabletError(tErr, &qr.Err)
	return sendReply(qr)
}

// ExecuteBatch is exposing tabletserver.SqlQuery.ExecuteBatch
func (sq *SqlQuery) ExecuteBatch(ctx context.Context, queryList *proto.QueryList, reply *proto.QueryResultList) (err error) {
	defer sq.server.HandlePanic(&err)
	tErr := sq.server.ExecuteBatch(callinfo.RPCWrapCallInfo(ctx), nil, queryList, reply)
	tabletserver.AddTabletError(tErr, &reply.Err)
	return nil
}

// ExecuteBatch2 should not be used by anything other than tests
// It will eventually replace ExecuteBatch, but it breaks compatibility with older clients.
// Once all clients are upgraded, it can be replaced.
func (sq *SqlQuery) ExecuteBatch2(ctx context.Context, req *proto.ExecuteBatchRequest, reply *proto.QueryResultList) (err error) {
	defer sq.server.HandlePanic(&err)
	if req == nil {
		return nil
	}
	ctx = callerid.NewContext(ctx,
		callerid.GoRPCEffectiveCallerID(req.EffectiveCallerID),
		callerid.GoRPCImmediateCallerID(req.ImmediateCallerID),
	)
	tErr := sq.server.ExecuteBatch(callinfo.RPCWrapCallInfo(ctx), proto.TargetToProto3(req.Target), &req.QueryBatch, reply)
	tabletserver.AddTabletError(tErr, &reply.Err)
	return nil
}

// SplitQuery is exposing tabletserver.SqlQuery.SplitQuery
func (sq *SqlQuery) SplitQuery(ctx context.Context, req *proto.SplitQueryRequest, reply *proto.SplitQueryResult) (err error) {
	defer sq.server.HandlePanic(&err)
	ctx = callerid.NewContext(ctx,
		callerid.GoRPCEffectiveCallerID(req.EffectiveCallerID),
		callerid.GoRPCImmediateCallerID(req.ImmediateCallerID),
	)
	tErr := sq.server.SplitQuery(callinfo.RPCWrapCallInfo(ctx), proto.TargetToProto3(req.Target), req, reply)
	tabletserver.AddTabletError(tErr, &reply.Err)
	return nil
}

// StreamHealth is exposing tabletserver.SqlQuery.StreamHealthRegister and
// tabletserver.SqlQuery.StreamHealthUnregister
func (sq *SqlQuery) StreamHealth(ctx context.Context, query *rpc.Unused, sendReply func(reply interface{}) error) (err error) {
	defer sq.server.HandlePanic(&err)

	c := make(chan *pb.StreamHealthResponse, 10)
	wg := sync.WaitGroup{}
	wg.Add(1)
	go func() {
		defer wg.Done()
		for shr := range c {
			// we send until the client disconnects
			if err := sendReply(shr); err != nil {
				return
			}
		}
	}()

	id, err := sq.server.StreamHealthRegister(c)
	if err != nil {
		close(c)
		wg.Wait()
		return err
	}
	wg.Wait()
	return sq.server.StreamHealthUnregister(id)
}

// New returns a new SqlQuery based on the QueryService implementation
func New(server queryservice.QueryService) *SqlQuery {
	return &SqlQuery{server}
}

func init() {
	tabletserver.RegisterFunctions = append(tabletserver.RegisterFunctions, func(qsc tabletserver.Controller) {
		servenv.Register("queryservice", New(qsc.QueryService()))
	})
}


text:
	<wrapper class="no-padding">
		<container>
				<wrapper>
					<container>
						<spacer size="32"></spacer>

						<row><columns>
Здравствуйте!
</columns></row>

						<row>
							<columns>

Это короткий опрос, который займет пару секунд.

Мы хотим, чтобы письма, которые вы получаете от Ескай, одинаково легко читались и на широких мониторах, и на компактных экранах смартфонов.

Нам очень поможет ответ на вопрос – в каком приложении вы читаете электронную почту?

Просто кликните по тому варианту, который предпочитаете, и ваш ответ будет засчитан.

Если в списке нет подходящего варианта, выберите "по-другому" и напишите пару слов об этом в комментариях на странице опроса.

								<spacer size="16"></spacer>

							</columns>
						</row>

						<row>
							<columns>

Я читаю почту в браузере:

(кликните на подходящий вариант)

							</columns>
						</row>

						<row>
							<columns>

									<row>

										<columns class="show-for-large" small="1" large="2"> </columns>
										<columns small="4" large="2">

Firefox

										</columns>
										<columns class="show-for-large" small="1" large="1"> </columns>
										<columns small="4" large="2">

Chrome

										</columns>
										<columns class="show-for-large" small="1" large="1"> </columns>
										<columns small="4" large="2">

Safari

										</columns>
										<columns class="show-for-large" small="1" large="2"> </columns>

									</row>

									<spacer size="16"></spacer>

							</columns>
						</row>

						<row>
							<columns>

Я читаю в приложении на планшете/смартфоне:

(кликните на подходящий вариант)

							</columns>
						</row>

						<row>
							<columns>

									<row>

										<columns class="show-for-large" small="1" large="2"> </columns>
										<columns small="4" large="2">

Я.Почта

										</columns>
										<columns class="show-for-large" small="1" large="1"> </columns>
										<columns small="4" large="2">

Mail.Ru

										</columns>
										<columns class="show-for-large" small="1" large="1"> </columns>
										<columns small="4" large="2">

Gmail

										</columns>
										<columns class="show-for-large" small="1" large="2"> </columns>

									</row>

									<spacer size="16"></spacer>

									<row>

										<columns class="show-for-large" small="1" large="2"> </columns>
										<columns small="4" large="2">

Outlook

										</columns>
										<columns class="show-for-large" small="1" large="1"> </columns>
										<columns small="4" large="2">

Почта для Android

										</columns>
										<columns class="show-for-large" small="1" large="1"> </columns>
										<columns small="4" large="2">

Apple Mail

										</columns>
										<columns class="show-for-large" small="1" large="2"> </columns>

									</row>

									<spacer size="16"></spacer>

									<spacer size="24"></spacer>

							</columns>
						</row>

						<row>
							<columns>

									<button class="secondary expanded rounded" href="http://esky.ru/campaigns/email/20170421/?rr_setemail={{{{raw}}}}{{Email}}{{{{/raw}}}}&rrsd_app=other">нет, по-другому</button>
									<spacer size="8"></spacer>
									<button class="secondary expanded rounded" href="http://esky.ru/campaigns/email/20170421/?rr_setemail={{{{raw}}}}{{Email}}{{{{/raw}}}}&rrsd_app=none">не знаю</button>
									<spacer size="16"></spacer>

Спасибо!

							</columns>
						</row>
						<spacer size="32"></spacer>
					</container>
				</wrapper>

		</container>
	</wrapper>


text:
package org.redisson.executor;

import java.util.Arrays;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;

import org.redisson.BaseRemoteService;
import org.redisson.RedissonExecutorService;
import org.redisson.api.RFuture;
import org.redisson.api.RMap;
import org.redisson.api.RedissonClient;
import org.redisson.client.codec.Codec;
import org.redisson.client.codec.LongCodec;
import org.redisson.client.codec.StringCodec;
import org.redisson.client.protocol.RedisCommands;
import org.redisson.codec.CompositeCodec;
import org.redisson.command.CommandAsyncExecutor;
import org.redisson.executor.params.TaskParameters;
import org.redisson.misc.RPromise;
import org.redisson.misc.RedissonPromise;
import org.redisson.remote.RemoteServiceCancelRequest;
import org.redisson.remote.RemoteServiceCancelResponse;
import org.redisson.remote.RemoteServiceRequest;
import org.redisson.remote.RequestId;
import org.redisson.remote.ResponseEntry;

import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.FutureListener;

/**
 *
 * @author Nikita Koksharov
 *
 */
public class TasksService extends BaseRemoteService {

    protected String terminationTopicName;
    protected String tasksCounterName;
    protected String statusName;
    protected String tasksName;
    protected String schedulerQueueName;
    protected String schedulerChannelName;
    protected String tasksRetryIntervalName;
    protected long tasksRetryInterval;

    public TasksService(Codec codec, RedissonClient redisson, String name, CommandAsyncExecutor commandExecutor, String executorId, ConcurrentMap<String, ResponseEntry> responses) {
        super(codec, redisson, name, commandExecutor, executorId, responses);
    }

    public void setTasksRetryIntervalName(String tasksRetryIntervalName) {
        this.tasksRetryIntervalName = tasksRetryIntervalName;
    }

    public void setTasksRetryInterval(long tasksRetryInterval) {
        this.tasksRetryInterval = tasksRetryInterval;
    }

    public void setTerminationTopicName(String terminationTopicName) {
        this.terminationTopicName = terminationTopicName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public void setTasksCounterName(String tasksCounterName) {
        this.tasksCounterName = tasksCounterName;
    }

    public void setTasksName(String tasksName) {
        this.tasksName = tasksName;
    }

    public void setSchedulerChannelName(String schedulerChannelName) {
        this.schedulerChannelName = schedulerChannelName;
    }

    public void setSchedulerQueueName(String scheduledQueueName) {
        this.schedulerQueueName = scheduledQueueName;
    }

    @Override
    protected final RFuture<Boolean> addAsync(String requestQueueName,
            RemoteServiceRequest request, RemotePromise<Object> result) {
        final RPromise<Boolean> promise = new RedissonPromise<Boolean>();
        RFuture<Boolean> future = addAsync(requestQueueName, request);
        result.setAddFuture(future);

        future.addListener(new FutureListener<Boolean>() {
            @Override
            public void operationComplete(Future<Boolean> future) throws Exception {
                if (!future.isSuccess()) {
                    promise.tryFailure(future.cause());
                    return;
                }

                if (!future.getNow()) {
                    promise.cancel(true);
                    return;
                }

                promise.trySuccess(true);
            }
        });

        return promise;
    }

    protected CommandAsyncExecutor getAddCommandExecutor() {
        return commandExecutor;
    }

    protected RFuture<Boolean> addAsync(String requestQueueName, RemoteServiceRequest request) {
        TaskParameters params = (TaskParameters) request.getArgs()[0];
        params.setRequestId(request.getId());

        long retryStartTime = 0;
        if (tasksRetryInterval > 0) {
            retryStartTime = System.currentTimeMillis() + tasksRetryInterval;
        }

        return getAddCommandExecutor().evalWriteAsync(name, StringCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN,
                // check if executor service not in shutdown state
                "if redis.call('exists', KEYS[2]) == 0 then "
                    + "redis.call('hset', KEYS[5], ARGV[2], ARGV[3]);"
                    + "redis.call('rpush', KEYS[6], ARGV[2]); "
                    + "redis.call('incr', KEYS[1]);"

                    + "if tonumber(ARGV[1]) > 0 then "
                        + "redis.call('set', KEYS[7], ARGV[4]);"
                        + "redis.call('zadd', KEYS[3], ARGV[1], 'ff' .. ARGV[2]);"
                        + "local v = redis.call('zrange', KEYS[3], 0, 0); "
                        // if new task added to queue head then publish its startTime
                        // to all scheduler workers
                        + "if v[1] == ARGV[2] then "
                            + "redis.call('publish', KEYS[4], ARGV[1]); "
                        + "end "
                    + "end;"
                    + "return 1;"
                + "end;"
                + "return 0;",
                Arrays.<Object>asList(tasksCounterName, statusName, schedulerQueueName, schedulerChannelName, tasksName, requestQueueName, tasksRetryIntervalName),
                retryStartTime, request.getId(), encode(request), tasksRetryInterval);
    }

    @Override
    protected RFuture<Boolean> removeAsync(String requestQueueName, RequestId taskId) {
        return commandExecutor.evalWriteAsync(name, LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN,
                "redis.call('zrem', KEYS[2], 'ff' .. ARGV[1]); "
              + "local task = redis.call('hget', KEYS[6], ARGV[1]); "
              + "redis.call('hdel', KEYS[6], ARGV[1]); "
               // remove from executor queue
              + "if task ~= false and redis.call('exists', KEYS[3]) == 1 and redis.call('lrem', KEYS[1], 1, ARGV[1]) > 0 then "
                  + "if redis.call('decr', KEYS[3]) == 0 then "
                     + "redis.call('del', KEYS[3]);"
                     + "if redis.call('get', KEYS[4]) == ARGV[2] then "
                        + "redis.call('del', KEYS[7]);"
                        + "redis.call('set', KEYS[4], ARGV[3]);"
                        + "redis.call('publish', KEYS[5], ARGV[3]);"
                     + "end;"
                  + "end;"
                  + "return 1;"
              + "end;"
              + "if task == false then "
                  + "return 1; "
              + "end;"
              + "return 0;",
          Arrays.<Object>asList(requestQueueName, schedulerQueueName, tasksCounterName, statusName, terminationTopicName, tasksName, tasksRetryIntervalName),
          taskId.toString(), RedissonExecutorService.SHUTDOWN_STATE, RedissonExecutorService.TERMINATED_STATE);
    }

    public RFuture<Boolean> cancelExecutionAsync(final RequestId requestId) {
        final RPromise<Boolean> result = new RedissonPromise<Boolean>();

        String requestQueueName = getRequestQueueName(RemoteExecutorService.class);
        RFuture<Boolean> removeFuture = removeAsync(requestQueueName, requestId);
        removeFuture.addListener(new FutureListener<Boolean>() {
            @Override
            public void operationComplete(Future<Boolean> future) throws Exception {
                if (!future.isSuccess()) {
                    result.tryFailure(future.cause());
                    return;
                }

                if (future.getNow()) {
                    result.trySuccess(true);
                } else {
                    RMap<String, RemoteServiceCancelRequest> canceledRequests = redisson.getMap(cancelRequestMapName, new CompositeCodec(StringCodec.INSTANCE, codec, codec));
                    canceledRequests.putAsync(requestId.toString(), new RemoteServiceCancelRequest(true, true));
                    canceledRequests.expireAsync(60, TimeUnit.SECONDS);

                    final RPromise<RemoteServiceCancelResponse> response = new RedissonPromise<RemoteServiceCancelResponse>();
                    scheduleCheck(cancelResponseMapName, requestId, response);
                    response.addListener(new FutureListener<RemoteServiceCancelResponse>() {
                        @Override
                        public void operationComplete(Future<RemoteServiceCancelResponse> future) throws Exception {
                            if (!future.isSuccess()) {
                                result.tryFailure(future.cause());
                                return;
                            }

                            if (response.getNow() == null) {
                                result.trySuccess(false);
                                return;
                            }
                            result.trySuccess(response.getNow().isCanceled());
                        }
                    });
                }
            }
        });

        return result;
    }

}


text:
#include "modules/audio_processing/agc2/rnn_vad/auto_correlation.h"

#include <algorithm>

#include "rtc_base/checks.h"

namespace webrtc {
namespace rnn_vad {
namespace {

constexpr int kAutoCorrelationFftOrder = 9;  // Length-512 FFT.
static_assert(1 << kAutoCorrelationFftOrder >
                  kNumInvertedLags12kHz + kBufSize12kHz - kMaxPitch12kHz,
              "");

}  // namespace

AutoCorrelationCalculator::AutoCorrelationCalculator()
    : fft_(1 << kAutoCorrelationFftOrder, Pffft::FftType::kReal),
      tmp_(fft_.CreateBuffer()),
      X_(fft_.CreateBuffer()),
      H_(fft_.CreateBuffer()) {}

AutoCorrelationCalculator::~AutoCorrelationCalculator() = default;

// The auto-correlations coefficients are computed as follows:
// |.........|...........|  <- pitch buffer
//           [ x (fixed) ]
// [   y_0   ]
//         [ y_{m-1} ]
// x and y are sub-array of equal length; x is never moved, whereas y slides.
// The cross-correlation between y_0 and x corresponds to the auto-correlation
// for the maximum pitch period. Hence, the first value in |auto_corr| has an
// inverted lag equal to 0 that corresponds to a lag equal to the maximum
// pitch period.
void AutoCorrelationCalculator::ComputeOnPitchBuffer(
    rtc::ArrayView<const float, kBufSize12kHz> pitch_buf,
    rtc::ArrayView<float, kNumInvertedLags12kHz> auto_corr) {
  RTC_DCHECK_LT(auto_corr.size(), kMaxPitch12kHz);
  RTC_DCHECK_GT(pitch_buf.size(), kMaxPitch12kHz);
  constexpr size_t kFftFrameSize = 1 << kAutoCorrelationFftOrder;
  constexpr size_t kConvolutionLength = kBufSize12kHz - kMaxPitch12kHz;
  static_assert(kConvolutionLength == kFrameSize20ms12kHz,
                "Mismatch between pitch buffer size, frame size and maximum "
                "pitch period.");
  static_assert(kFftFrameSize > kNumInvertedLags12kHz + kConvolutionLength,
                "The FFT length is not sufficiently big to avoid cyclic "
                "convolution errors.");
  auto tmp = tmp_->GetView();

  // Compute the FFT for the reversed reference frame - i.e.,
  // pitch_buf[-kConvolutionLength:].
  std::reverse_copy(pitch_buf.end() - kConvolutionLength, pitch_buf.end(),
                    tmp.begin());
  std::fill(tmp.begin() + kConvolutionLength, tmp.end(), 0.f);
  fft_.ForwardTransform(*tmp_, H_.get(), /*ordered=*/false);

  // Compute the FFT for the sliding frames chunk. The sliding frames are
  // defined as pitch_buf[i:i+kConvolutionLength] where i in
  // [0, kNumInvertedLags12kHz). The chunk includes all of them, hence it is
  // defined as pitch_buf[:kNumInvertedLags12kHz+kConvolutionLength].
  std::copy(pitch_buf.begin(),
            pitch_buf.begin() + kConvolutionLength + kNumInvertedLags12kHz,
            tmp.begin());
  std::fill(tmp.begin() + kNumInvertedLags12kHz + kConvolutionLength, tmp.end(),
            0.f);
  fft_.ForwardTransform(*tmp_, X_.get(), /*ordered=*/false);

  // Convolve in the frequency domain.
  constexpr float kScalingFactor = 1.f / static_cast<float>(kFftFrameSize);
  std::fill(tmp.begin(), tmp.end(), 0.f);
  fft_.FrequencyDomainConvolve(*X_, *H_, tmp_.get(), kScalingFactor);
  fft_.BackwardTransform(*tmp_, tmp_.get(), /*ordered=*/false);

  // Extract the auto-correlation coefficients.
  std::copy(tmp.begin() + kConvolutionLength - 1,
            tmp.begin() + kConvolutionLength + kNumInvertedLags12kHz - 1,
            auto_corr.begin());
}

}  // namespace rnn_vad
}  // namespace webrtc


text:
'use strict';

var React = require('react');
var classNames = require('classnames');
var omit = require('object.omit');
var ClassNameMixin = require('./mixins/ClassNameMixin');

var Table = React.createClass({
  mixins: [ClassNameMixin],

  propTypes: {
    classPrefix: React.PropTypes.string.isRequired,
    bordered: React.PropTypes.bool,
    compact: React.PropTypes.bool,
    hover: React.PropTypes.bool,
    striped: React.PropTypes.bool,
    radius: React.PropTypes.bool,
    responsive: React.PropTypes.bool
  },

  getDefaultProps: function() {
    return {
      classPrefix: 'table'
    };
  },

  render: function() {
    var classSet = this.getClassSet();
    var responsive = this.props.responsive;
    var restProps = omit(this.props, Object.keys(this.constructor.propTypes));

    classSet[this.prefixClass('bordered')] = this.props.bordered;
    classSet[this.prefixClass('compact')] = this.props.compact;
    classSet[this.prefixClass('hover')] = this.props.hover;
    classSet[this.prefixClass('striped')] = this.props.striped;
    classSet[this.prefixClass('radius')] = this.props.radius;

    // add `.am-text-nowrap` to responsive table
    classSet[this.setClassNamespace('text-nowrap')] = responsive;

    var table = (
      <table
        {...restProps}
        className={classNames(this.props.className, classSet)}
      >
        {this.props.children}
      </table>
    );

    return responsive ? (
      <div className={this.setClassNamespace('scrollable-horizontal')}>
        {table}
      </div>
    ) : table;
  }
});

module.exports = Table;


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>{{ page.title }}</title>
    {% if page.description %}<meta name="description" content="{{ page.description }}">{% endif %}
    <meta name="author" content="{{ site.author.name }}">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="{{ ASSET_PATH }}/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <link href="{{ ASSET_PATH }}/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet">

    <link href="{{ ASSET_PATH }}/bootstrap/css/bs-sticky-footer.css" rel="stylesheet">

    <link href="{{ ASSET_PATH }}/css/style.css?body=1" rel="stylesheet" type="text/css" media="all">

    <link href="{{ BASE_PATH }}{{ site.JB.atom_path }}" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed">
    <link href="{{ BASE_PATH }}{{ site.JB.rss_path }}" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed">

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

          </button>
          {{ site.title }}

            {% assign pages_list = site.pages %}
            {% assign group = 'navigation' %}
            {% include JB/pages_list %}

          <form class="navbar-form navbar-right" role="search">

              <input type="text" class="form-control" placeholder="Search">

            <button type="submit" class="btn btn-default">Submit</button>
          </form>

        {{ content }}

© {{ site.time | date: '%Y' }} {{ site.author.name }}

    {% include JB/analytics %}


text:
var webpack = require('webpack');
var path = require('path');
var isProduction = process.env.NODE_ENV === 'production';
var node_modules = path.resolve(__dirname, 'node_modules');

var config = {
  entry: {
    // split vendor to another file
    vendors: ['react', 'cerebral', 'immutable-store', 'event-emitter'],
    app: path.resolve(__dirname, 'src', 'main.js'),
  },
  // devtool: 'source-map',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'bundle.js'
  },
  module: {
    loaders: [{
      test: /\.css$/,
      loader: 'style!css'
    }, {
      test: /\.js$/,
      loader: 'babel?optional=es7.decorators',
      exclude: node_modules
    }, {
      test: /\.json$/,
      loader: 'json'
    }]
  },
  plugins: [
    // split vendor to another file
    new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js'),
  ]
};

module.exports = config;


text:
Our docs have moved! Please visit the below link:

http://docs.php-opencloud.com/en/latest/caching-creds.html


text:
import { override } from '@microsoft/decorators';
import { Log } from '@microsoft/sp-core-library';
import {
  BaseListViewCommandSet,
  Command,
  IListViewCommandSetListViewUpdatedParameters,
  IListViewCommandSetExecuteEventParameters
} from '@microsoft/sp-listview-extensibility';
import { Dialog } from '@microsoft/sp-dialog';

import * as strings from 'MetadataSitePagesCommandSetStrings';
import FillMetadataDialog from './FillMetadataDialog';

const LOG_SOURCE: string = 'MetadataSitePagesCommandSet';

export default class MetadataSitePagesCommandSet extends BaseListViewCommandSet<{}> {

  @override
  public onInit(): Promise<void> {
    Log.info(LOG_SOURCE, 'Initialized MetadataSitePagesCommandSet');
    return Promise.resolve();
  }

  @override
  public onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters): void {
    const fillMetadataCommand: Command = this.tryGetCommand('FILL_METADATA');
    if (fillMetadataCommand) {
      // This command should be hidden unless exactly one row is selected.
      fillMetadataCommand.visible = event.selectedRows.length === 1;
    }
  }

  @override
  public onExecute(event: IListViewCommandSetExecuteEventParameters): void {
    switch (event.itemId) {
      case 'FILL_METADATA':
        const dialog: FillMetadataDialog = new FillMetadataDialog();
        dialog.webUrl = this.context.pageContext.web.absoluteUrl;
        dialog.itemId = parseInt(event.selectedRows[0].getValueByName("ID"));
        dialog.show().then(() => {

          // console.log('after dialog close');
        });
        break;
      default:
        throw new Error('Unknown command');
    }
  }
}


text:
using System.Collections.Generic;
using System.Security.Principal;
using JabbR.ContentProviders.Core;
using JabbR.Infrastructure;
using JabbR.Models;
using JabbR.Services;
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs;
using Moq;

namespace JabbR.Test
{
    public class ChatFacts
    {
        public static TestableChat GetTestableChat(string clientId, StateChangeTracker clientState, ChatUser user)
        {
            return GetTestableChat(clientId, clientState, user, new Dictionary<string, Cookie>());
        }

        public static TestableChat GetTestableChat(string connectionId, StateChangeTracker clientState, ChatUser user, IDictionary<string, Cookie> cookies)
        {
            // setup things needed for chat
            var repository = new InMemoryRepository();
            var resourceProcessor = new Mock<ContentProviderProcessor>();
            var chatService = new Mock<IChatService>();
            var connection = new Mock<IConnection>();
            var settings = new ApplicationSettings();
            var mockPipeline = new Mock<IHubPipelineInvoker>();

            // add user to repository
            repository.Add(user);

            // create testable chat
            var chat = new TestableChat(resourceProcessor, chatService, repository, connection);
            var mockedConnectionObject = chat.MockedConnection.Object;

            chat.Clients = new HubConnectionContext(mockPipeline.Object, mockedConnectionObject, "Chat", connectionId, clientState);

            var prinicipal = new Mock<IPrincipal>();

            var request = new Mock<IRequest>();
            request.Setup(m => m.Cookies).Returns(cookies);
            request.Setup(m => m.User).Returns(prinicipal.Object);

            // setup context
            chat.Context = new HubCallerContext(request.Object, connectionId);

            return chat;
        }

        public class TestableChat : Chat
        {
            public Mock<ContentProviderProcessor> MockedResourceProcessor { get; private set; }
            public Mock<IChatService> MockedChatService { get; private set; }
            public IJabbrRepository Repository { get; private set; }
            public Mock<IConnection> MockedConnection { get; private set; }

            public TestableChat(Mock<ContentProviderProcessor> mockedResourceProcessor, Mock<IChatService> mockedChatService, IJabbrRepository repository, Mock<IConnection> connection)
                : base(mockedResourceProcessor.Object, mockedChatService.Object, repository, new Mock<ICache>().Object, new Mock<ILogger>().Object)
            {
                MockedResourceProcessor = mockedResourceProcessor;
                MockedChatService = mockedChatService;
                Repository = repository;
                MockedConnection = connection;
            }
        }
    }
}


text:
/* global self, fetch, caches */
'use strict';

const VERSION = 'cache-v{{VERSION}}';

const urls = [
  '/',
  '/404.html',
  '/icon-192.png',
  '/icon-512.png',
  '/index.html',
  '/manifest.json',
  '/robots.txt',
  '/vinkla.css',
  '/vinkla.js',
  'https://avatars2.githubusercontent.com/u/499192'
];

self.addEventListener('install', event => {
  event.waitUntil(caches.open(VERSION).then(cache => cache.addAll(urls)));
});

self.addEventListener('activate', event => {
  event.waitUntil(
    caches.keys().then(keys => {
      return Promise.all(keys
        .filter(key => key !== VERSION)
        .map(key => caches.delete(key))
      );
    })
  );
});

self.addEventListener('fetch', event => {
  event.respondWith(
    caches.match(event.request).then(response => response || fetch(event.request))
  );
});


text:
<!DOCTYPE html>
<html>
<head>
<script src="../resources/common.js"></script>
<script src="../resources/picker-common.js"></script>
</head>
<body>
<select id="menu">
  <option>foo</option>
  <option selected>bar</option>
  <option style="font-size:8px;">qux</option>
  <option style="font-size:40px;">baz</option>
  <optgroup label="Group1">
    <option>Item 5</option>
    <option>Item 6</option>
  </optgroup>
</select>

<style>
select {
  appearance: none;
  padding: 1px 16px 1px 4px;
}
select:focus-visible {
  outline: none;
}
</style>
<script>
function touchOn(selector) {
  return new Promise((resolve, reject) => {
    let pos = elementCenterPosition(document.querySelector(selector));
    chrome.gpuBenchmarking.pointerActionSequence([{source:'touch', actions: [
        {name:'pointerDown', x:pos[0], y:pos[1]},
        {name:'pointerUp'}]}], resolve);
  });
}

function popup() {
  return new Promise((resolve, reject) => {
    internals.pagePopupWindow = internals.pagePopupWindow;
    setPopupOpenCallback(resolve);
  });
}

async function openPickerByTouch() {
  testRunner.waitUntilDone();
  await touchOn('#menu');
  await popup();
  testRunner.notifyDone();
}

openPickerByTouch();
</script>
</body>
</html>


text:
//
// AL_TouchScreen.h
//
// Implement resistive touch screen on graphic screen module.
//
// Copyright Anders Liu.
//
// For more information, visit https://github.com/anders-liu/arduino-libs
//

#ifndef AL_TOUCHSCREEN__H
#define AL_TOUCHSCREEN__H

#include <Arduino.h>
#include <stdint.h>

#include "AL_GraphicScreen.h"

typedef void (*AL_TouchScreenPosEventHandler)(uint16_t x, uint16_t y);
typedef void (*AL_TouchScreenEventHandler)();

class AL_TouchScreen
{
public:
  AL_TouchScreen(
      uint8_t xpPin, uint8_t xmPin, uint8_t ypPin, uint8_t ymPin,
      uint16_t longSide, uint16_t shortSide)
      : xpPin(xpPin), xmPin(xmPin), ypPin(ypPin), ymPin(ymPin),
        longSide(longSide), shortSide(shortSide),
        width(shortSide), height(longSide),
        orientation(AL_SO_PORTRAIT1),
        state(0), curX(0), curY(0), lastMillis(0),
        touchStartHandler(nullptr), touchEndHandler(nullptr)
  {
  }

public:
  uint16_t getWidth() { return width; }
  uint16_t getHeight() { return height; }
  uint8_t /* AL_SO_x */ getOrientation() { return orientation; }
  void setOrientation(uint8_t /* AL_SO_x */ o)
  {
    switch (o)
    {
    case AL_SO_PORTRAIT1:
    case AL_SO_PORTRAIT2:
      width = shortSide;
      height = longSide;
      break;
    case AL_SO_LANDSCAPE1:
    case AL_SO_LANDSCAPE2:
      width = longSide;
      height = shortSide;
      break;
    }
    orientation = o;
  }

  void loop();

public:
  void handleTouchStart(AL_TouchScreenPosEventHandler handler) { touchStartHandler = handler; }
  void handleTouchMove(AL_TouchScreenPosEventHandler handler) { touchMoveHandler = handler; }
  void handleTouchEnd(AL_TouchScreenEventHandler handler) { touchEndHandler = handler; }

private:
  void read();

private:
  uint8_t xpPin, xmPin, ypPin, ymPin;
  uint16_t longSide, shortSide, width, height;
  uint8_t /* AL_SO_x */ orientation;
  uint8_t state;
  uint16_t curX, curY;
  uint16_t sampleX, sampleY, tempSampleX, tempSampleY;
  uint32_t lastMillis;

  AL_TouchScreenPosEventHandler touchStartHandler;
  AL_TouchScreenPosEventHandler touchMoveHandler;
  AL_TouchScreenEventHandler touchEndHandler;
};

#endif // AL_TOUCHSCREEN__H


text:
define(["storymaps/swipe/core/WebApplicationData", "storymaps/utils/Helper", "dojo/topic", "./SaveErrorPopupSocial"],
	function (WebApplicationData, Helper, topic, SaveErrorPopupSocial) {
		return function BuilderPanel(container, builderSave, builderDirectCreationFirstSave, saveWebmap)
		{
			var _this = this;
			var _displayBuilderSaveIntro = true;
			var _builderView = null;

			this.init = function(builderView)
			{
				_builderView = builderView;
				initLocalization();

				container.show();
				setUpGeneralPanelButtonAction();
				setUpPopover();
				createAppSavedConfirmation();

				// Map popover callback to app.builder
				app.builder.closeBuilderSaveIntro = closeBuilderSaveIntro;
				app.builder.switchToView = switchToView;
				app.builder.discard = discard;
				app.builder.hideSaveConfirmation = hideSaveConfirmation;

				container.find('.builder-save').click(save);
				container.find(".builder-share").click(function(){
					app.builder.openSharePopup(false);
				});
				container.find('.builder-settings').click(showSettingsPopup);
				container.find('.builder-help').click(showHelpPopup);

				_saveErrorPopupSocial = new SaveErrorPopupSocial($("#saveErrorPopupSocial"));
			};

			//
			// Panel buttons
			//

			function save()
			{
				console.log("swipe.builder.Builder - save");

				changeBuilderPanelButtonState(false);
				closeBuilderSaveIntro();
				container.find(".builder-settings").popover('show');

				if (app.isDirectCreationFirstSave) {
					var appTitle = $('#headerDesktop .title .text_edit_label').text();
					var appSubTitle = $('#headerDesktop .subtitle .text_edit_label').text();
					if ( appSubTitle == i18n.builder.header.editMe )
						appSubTitle = "";

					if ( ! appTitle || appTitle == i18n.builder.header.editMe ) {
						_this.saveFailed("NONAME");
						return;
					}

					// Save the webmap
					// If ok get the new id
					// Call saveApp
					// If ok call appSaveSucceeded
					builderDirectCreationFirstSave(appTitle, appSubTitle);
				}
				/*else if (app.isGalleryCreation) {
					builderGalleryCreationFirstSave();
				}*/
				else {
					// Save of an existing app

					var storyTitle = "",
						itemTitle = "";

					if ( WebApplicationData.getTitle() ) {
						storyTitle = WebApplicationData.getTitle().trim();
					}

					if ( app.data.getAppItem() && app.data.getAppItem().title ) {
						itemTitle = app.data.getAppItem().title.trim();
					}

					var saveCallback = function(response){
						if (!response || !response.success) {
							appSaveFailed("APP");
							return;
						}
						else
							saveWebmap(response);
					};

					// if item and story title don't match
					//  and user hasn't chose to not be warned about it
					//  and story is public
					if ( ! app.builder.titleMatchOnLoad
							&& ! WebApplicationData.getDoNotWarnTitle()
							&& app.data.getAppItem().access == "public"
							// Extra check that title actually differs - don't show the dialog it title where not matching but user fixed it
							&& storyTitle != itemTitle
					) {
						// If the warning dialog has already been displayed in the session, skip it and reuse the choice
						if ( app.builder.titleMatchDialogDisplayed ) {
							builderSave(app.builder.titleFromItem, saveCallback);
						}
						// Show the warning dialog
						else {
							app.builder.titleMatchDialogDisplayed = true;

							_saveErrorPopupSocial.present().then(
								function(p) {
									app.builder.titleFromItem = p && p.choice == 'item';
									builderSave(app.builder.titleFromItem, saveCallback);
								}
							);
						}
					}
					else {
						// Save the app
						// If OK and needed call save webmap
						// If OK call appSaveSucceeded
						var keepItemTitle = WebApplicationData.getDoNotWarnTitle()
							|| (app.data.getAppItem().access != "public" && ! app.builder.titleMatchOnLoad);
						builderSave(keepItemTitle, saveCallback);
					}
				}

				// Save the app
				// If OK and needed call save webmap
				// If OK call appSaveSucceeded
				//builderSave();
			}

			function discard(confirmed)
			{
				if( confirmed ){
					changeBuilderPanelButtonState(false);
					WebApplicationData.restoreOriginalData();
					app.data.discardChanges();
					resetSaveCounter();
					topic.publish("CORE_UPDATE_UI");
					changeBuilderPanelButtonState(true);
				}

				container.find(".builder-discard").popover('hide');
			}

			function showSettingsPopup()
			{
				closePopover();
				_builderView.openSettingPopup(false);
			}

			function showHelpPopup()
			{
				closePopover();
				window.open('https://storymaps.arcgis.com/en/app-list/swipe-spyglass/','_blank');
				//app.builder.openHelpPopup();

			}

			function switchToView(confirmed)
			{
				if( confirmed )
					document.location = '?' + document.location.search.split('edit')[0].slice(1, -1);
				else
					container.find(".builder-view").popover('hide');
			}

			function openItem()
			{
				window.open(
					Helper.getItemURL(configOptions.sharingurl, app.data.getAppItem().id),
					'_blank'
				);
			}

			//
			// Save callbacks
			//

			this.saveSucceeded = function()
			{
				//container.find(".builder-settings").next(".popover").find(".stepSaved").css("display", "block");
				/*setTimeout(function(){
					container.find(".builder-settings").popover('hide');
				}, 2500);*/

				container.find(".builder-settings").popover('hide');

				if( app.isDirectCreationFirstSave || app.isGalleryCreation )
					app.builder.openSharePopup(true);

				closePopover();
				resetSaveCounter();
				changeBuilderPanelButtonState(true);
			};

			this.saveFailed = function(source)
			{
				container.find(".builder-settings").next(".popover").find(".stepSave").css("display", "none");
				//container.find(".builder-settings").next(".popover").find(".stepFailed").css("display", "block");
				if (source == "NONAME") {
					container.find(".builder-settings").next(".popover").find(".stepFailed3").css("display", "block");

					$("#headerDesktop .title").addClass("titleEmpty");

					container.find(".builder-save").attr("disabled", false);
					container.find(".builder-settings").attr("disabled", false);
					container.find(".builder-help").attr("disabled", false);

					return;
				}
				else
					container.find(".builder-save").next(".popover").find(".stepFailed").css("display", "block");

				changeBuilderPanelButtonState(true);
			};

			//
			// Counter
			//

			this.hasPendingChange = function()
			{
				return container.find("#save-counter").html() && container.find("#save-counter").html() != i18n.builder.builder.noPendingChange;
			};

			this.incrementSaveCounter = function(nb)
			{
				var value = container.find("#save-counter").html();
				if (! _this.hasPendingChange()) {
					value = 0;

					if (_displayBuilderSaveIntro) {
						// Timer cause the header can be hidden
						setTimeout(function(){
							container.find(".builder-save").popover('show');
						}, 250);
						setTimeout(function(){
							if( _displayBuilderSaveIntro )
								container.find(".builder-save").popover('destroy');
						},  3500);
					}
				}

				if( value == 0 ) {
					if ( nb == 1 || isNaN(parseInt(nb)) )
						value = i18n.builder.builder.unSavedChangeSingular;
					else
						value = nb + " " + i18n.builder.builder.unSavedChangePlural;
				}
				else
					value = (parseInt(value) + (nb ? nb : 1)) + " " + i18n.builder.builder.unSavedChangePlural;

				container.find("#save-counter").html(value);
				container.find("#save-counter").css("color", "#FFF");
			};

			function resetSaveCounter()
			{
				container.find("#save-counter").html(i18n.builder.builder.noPendingChange);
				container.find("#save-counter").css("color", "#999");
				setUpGeneralPanelButtonAction();
			}

			//
			// Popover
			//

			function closePopover()
			{
				if( container.find(".discard-popover").length > 0 )
					container.find(".builder-discard").popover('hide');
				if( container.find(".view-popover").length > 0 )
					container.find(".builder-view").popover('hide');
			}

			function setUpPopover()
			{
				var containerId = "#" + container.attr("id");

				// Discard button
				container.find(".builder-discard").popover({
					trigger: 'manual',
					placement: 'bottom',
					html: true,
					// Inject the CSS properties
					content: ''
								+ i18n.builder.builder.popoverDiscard +' '
								+ '<button type="button" class="btn btn-danger btn-small" onclick="app.builder.discard(true)">'+i18n.builder.builder.yes+'</button> '
								+ '<button type="button" class="btn btn-small" onClick="app.builder.discard(false)">'+i18n.builder.builder.no+'</button>'
				});

				// Switch to view button
				container.find(".builder-view").popover({
					trigger: 'manual',
					html: true,
					content: ''
								+ i18n.builder.builder.popoverOpenViewExplain + ' '
								+ '<button type="button" class="btn btn-danger btn-small" onclick="app.builder.switchToView(true)">'+i18n.builder.builder.popoverOpenViewOk+'</button> '
								+ '<button type="button" class="btn btn-small" onClick="app.builder.switchToView(false)">'+i18n.builder.builder.popoverOpenViewCancel+'</button>'
				});

				// Confirmation that user need to use the save button
				container.find(".builder-save").popover({
					trigger: 'manual',
					placement: 'left',
					html: true,
					content: ''
								+ i18n.builder.builder.popoverSaveWhenDone
				});

				//container.find('.builder-settings').attr('title', i18n.builder.builder.buttonSettings);
				container.find('.builder-view').attr('title', i18n.builder.builder.buttonView);
			}

			function createAppSavedConfirmation()
			{
				var containerId = "#" + container.attr("id");

				// App saved confirmation
				container.find(".builder-settings").popover({
					containerId: containerId,
					html: true,
					trigger: 'manual',
					placement: 'bottom',
					content: ''
								+ '
'
								+  i18n.builder.builder.savingApplication + '... '
								+ '
'
								+ '
'
								+  i18n.builder.builder.saveSuccess + ' '
								+ '<button type="button" class="btn btn-success btn-small" onclick="app.builder.hideSaveConfirmation()" style="vertical-align: 1px;">'+i18n.builder.builder.gotIt+'</button> '
								+ '
'
								+ '
'
								+  i18n.builder.builder.saveError + ' '
								+ '<button type="button" class="btn btn-danger btn-small" onclick="app.builder.hideSaveConfirmation()" style="vertical-align: 1px;">'+i18n.builder.builder.gotIt+'</button> '
								+ '
'
								+ '
'
								+  i18n.builder.builder.saveError3 + ' '
								+ '<button type="button" class="btn btn-danger btn-small" onclick="app.builder.hideSaveConfirmation()" style="vertical-align: 1px;">'+i18n.builder.builder.gotIt+'</button> '
								+ '
'
				});

				//container.find('.builder-settings').attr('title', i18n.builder.builder.buttonSettings);
			}

			function closeBuilderSaveIntro()
			{
				container.find(".builder-save").popover('destroy');
				_displayBuilderSaveIntro = false;
			}

			//
			// UI
			//

			function setUpGeneralPanelButtonAction()
			{
				container.find(".builder-view").click(clickView);
				container.find(".builder-discard").click(clickDiscard);
			}

			function clickDiscard()
			{
				if( _this.hasPendingChange() )
					container.find(".builder-discard").popover('show');
			}

			function clickView()
			{
				if( _this.hasPendingChange() )
					container.find(".builder-view").popover('show');
				else
					switchToView(true);
			}

			function hideSaveConfirmation()
			{
				container.find(".builder-settings").popover('hide');
				$("#headerDesktop .title").removeClass("titleEmpty");
			}

			function changeBuilderPanelButtonState(activate)
			{
				container.find(".builder-cmd").attr("disabled", ! activate);
			}

			this.updateSharingStatus = function()
			{
				var appAccess = app.data.getAppItem().access;
				if( app.isDirectCreationFirstSave || app.isGalleryCreation ) {
					$("#sharing-status").html("; " + i18n.swipe.share.shareStatus1 + "");
					container.find('.builder-share').attr("disabled", "disabled");
				}
				else if ( appAccess == "public" )
					$("#sharing-status").html("; " + i18n.swipe.share.shareStatus2);
				else if ( appAccess == "account" || appAccess == "org" )
					$("#sharing-status").html("; " + i18n.swipe.share.shareStatus3);
				else
					$("#sharing-status").html("; " + i18n.swipe.share.shareStatus4);
			};

			this.resize = function()
			{
				// Make all buttons the same size
				/*
				var buttonWidth = Math.max(container.find("div > button").eq(0).width(), container.find("div > button").eq(1).width());
				container.find("div > button").eq(0).width(buttonWidth);
				container.find("div > button").eq(1).width(buttonWidth);
				*/

				// Reposition
				container.css("margin-left", $("body").width() / 2 - container.outerWidth() / 2);
			};

			function initLocalization()
			{
				container.find('h4').html(i18n.builder.builder.panelHeader);
				container.find('button').eq(0).html(i18n.builder.builder.buttonSave);
				container.find('button').eq(1).html(i18n.builder.builder.buttonShare.toUpperCase());
				//container.find('button').eq(1).html(i18n.builder.builder.buttonDiscard);
				container.find('button').eq(2).html(i18n.builder.builder.buttonSettings.toUpperCase());
				container.find('button').eq(3).html(i18n.builder.builder.buttonHelp.toUpperCase());
				//container.find('button').eq(3).html('');
				//container.find('button').eq(4).html('').attr("title", i18n.builder.builder.buttonItem);
				container.find('#save-counter').html(i18n.builder.builder.noPendingChange);
			}
		}
	}
);


text:
/* main.c - this program is a 'hotfix' that uses the shared Xlib Desktop/Root Window hack library - by StephaneAG - 2013  */

/* 	this short program is a 'hotfix' in the sense that it should be executable
*	from a shell command, a bash script, or even from Java/Python programs
*	when ran as a shell command.
*
*	It should not throw any dependencies errors as it has already been linked against
*	the right libraries during compiling.
*
*	Internally, it uses the 'desktopwindow' C shared library,
*	wich may be a little bit 'overkill' since it doesn't ( and won't )
*	contain some much stuff after all (...)
*
*	Still, for a wip impl, it may indeed help in the resolution of the original 'problem'
*/

/* std libs */
#include <stdio.h>
#include <stdlib.h>

/* custom shared C libray: libdesktopwindow */
#include "desktopwindow.h" // we include our library

//int main(void)
int main(int argc, char **argv)
{
	/* check the number of arguments */
	if (argc < 3)
	{
		fprintf(stderr, "DESKTOPWINDOWHACK_HOTFIX: Error: invalid number of argmuments\n");
		fprintf(stderr,"Usage: ./desktopwindowhack_hotfix <program_window_id> <desktop_window_id>\n");
		exit (1);
	}

	/* get the arguments 'as is' */
	char *progwinid = argv[1];
	char *deskwinid = argv[2];

	/* debug testing to get those hex out of char pointers correctly ... */
	//unsigned long int Fakeprogwinid = 0x2000079;
        //unsigned long int Fakedeskwinid = 0x2000004:

	/* print the hadcoded fake args */
        //fprintf(stdout, "DESKTOPWINDOWHACK_HOTFIX: Fake Arguments: %08lx as Program Window Id and %08lx as Desktop Window Id\n", Fakeprogwinid, Fakedeskwinid);

	/* prepare to get them as 'unsigned long int' */
	unsigned long int ulong_progwinid;
	unsigned long int ulong_deskwinid;

	/* print the arguments 'as is'*/
	fprintf(stdout, "DESKTOPWINDOWHACK_HOTFIX: Received: %s as Program Window Id and %s as Desktop Window Id\n", progwinid, deskwinid);
	//fprintf(stdout, "DESKTOPWINDOWHACK_HOTFIX: Received: %lu as Program Window Id (ulong) and %lu as Desktop Window Id (ulong)\n", ulong_progwinid, ulong_deskwinid);
	printf("ld: %ld\n", strtol(argv[1], NULL, 16)); // print the hexadecimal received as argument in decimals ( works as 'xwininfo -int ...' )
	printf("lu: %lu\n", strtoul(argv[1], NULL, 16)); // same as above ?!
	//printf("%ld\n", strtol(argv[2], NULL, 16)); // print the hexadecimal received as argument in decimals ( works as 'xwininfo -int ...' )
        //printf("%lu\n", strtoul(argv[2], NULL, 16)); // same as above ?!
	printf("li: %li\n", strtoul(argv[1], NULL, 16)); // li
	printf("lx: %lx\n", strtoul(argv[1], NULL, 16)); // lx
	printf("lo: %lo\n", strtoul(argv[1], NULL, 16)); // lo
	printf("0x08lx: 0x%08lx\n", strtoul(argv[1], NULL, 16)); // lx
	printf("08lx: %08lx\n", strtoul(argv[1], NULL, 16)); // lx
	printf("8lx: %8lx\n", strtoul(argv[1], NULL, 16)); // lx

	printf("#8lx: %#8lx\n", strtoul(argv[1], NULL, 16)); // lx : seems to be the correct formatting for my current purpose

	/* get the arguments into 'unsigned long int' and print them to stdout  */
	//sscanf(argv[1], "%ld", &ulong_progwinid);
	//sscanf(argv[2], "%ld", &ulong_deskwinid);
	//fprintf(stdout, "DESKTOPWINDOWHACK_HOTFIX: Received: %lu as Program Window Id (ulong) and %lu as Desktop Window Id (ulong)\n", ulong_progwinid, ulong_deskwinid);

	sscanf(argv[1], "%08lx", &ulong_progwinid);
        sscanf(argv[2], "%08lx", &ulong_deskwinid);
        fprintf(stdout, "DESKTOPWINDOWHACK_HOTFIX: Received: Ox%08lx as Program Window Id (ulong) and 0x%08lx as Desktop Window Id (ulong)\n", ulong_progwinid, ulong_deskwinid);

	sscanf(argv[1], "0x%08lx", &ulong_progwinid);
        sscanf(argv[2], "0x%08lx", &ulong_deskwinid);
	fprintf(stdout, "DESKTOPWINDOWHACK_HOTFIX: Received: %08lx as Program Window Id (ulong) and %08lx as Desktop Window Id (ulong)\n", ulong_progwinid, ulong_deskwinid);

	sscanf(argv[1], "%9lx", &ulong_progwinid);
        sscanf(argv[2], "%9lx", &ulong_deskwinid);
        fprintf(stdout, "DESKTOPWINDOWHACK_HOTFIX: Received ( 9lx printed with format #8lx ): %#8lx as Program Window Id (ulong) and %#8lx as Desktop Window Id (ulong)\n", ulong_progwinid, ulong_deskwinid);
	fprintf(stdout, "DESKTOPWINDOWHACK_HOTFIX: Received ( 9lx printed with format 9lx ): %9lx as Program Window Id (ulong) and %#8lx as Desktop Window Id (ulong)\n", ulong_progwinid, ulong_deskwinid);

	sscanf(argv[1], "0x%lx", &ulong_progwinid);
        sscanf(argv[2], "0x%lx", &ulong_deskwinid);
        fprintf(stdout, "DESKTOPWINDOWHACK_HOTFIX: Received ( 0x lx printed with format #lx ): %#lx as Program Window Id (ulong) and %#lx as Desktop Window Id (ulong)\n", ulong_progwinid, ulong_deskwinid);

	puts("DESKTOPWINDOWHACK_HOTFIX: Shared Library test below for: libdesktopwindow");
	/* custom shared C libray: libdesktopwindow */
	foo(); // call the library test fcn

	/* 'fingercrossed' call of the embed 'XReparentWindow()' fcn inside libdesktopwindow */
	//reparentWindowTo(unsigned long int ProgWinId, unsigned long int DeskWinId, int xpos, int ypos);
	reparentWindowTo(ulong_progwinid, ulong_deskwinid, 0, 0);

	return 0;
}


text:
using System;
using System.Collections;
using System.Collections.Specialized;
using System.ComponentModel;
using Android.Content;
using AndroidX.RecyclerView.Widget;
using FastListView.Renderers;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

[assembly: ExportRenderer(typeof(FastListView.Forms.VisualElements.FastListView), typeof(FastListViewRenderer))]
namespace FastListView.Renderers
{
	public class FastListViewRenderer : ViewRenderer<Forms.VisualElements.FastListView, RecyclerView>
    {
        public FastListViewRenderer(Context context) : base(context)
        {
        }

        public static new void Init()
        {
            // needed because of this STUPID linker issue: https://bugzilla.xamarin.com/show_bug.cgi?id=31076
#pragma warning disable 0219
            var ignore = typeof(FastListViewRenderer);
#pragma warning restore 0219
        }

        protected override void OnElementChanged(ElementChangedEventArgs<FastListView.Forms.VisualElements.FastListView> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                var itemsSource = e.OldElement.ItemsSource as INotifyCollectionChanged;
                if (itemsSource != null)
                {
                    itemsSource.CollectionChanged -= ItemsSourceOnCollectionChanged;
                }
            }

            if (e.NewElement != null)
            {
                if (Control == null)
                {
                    var recyclerView = new RecyclerView(Context);
                    recyclerView.SetBackgroundColor(Element.BackgroundColor.ToAndroid());
                    SetNativeControl(recyclerView);

                    var linearLayout = new LinearLayoutManager(Context, OrientationHelper.Vertical, false);

                    recyclerView.SetLayoutManager(linearLayout);

                    UpdateAdapter();
                }

                var itemsSource = e.NewElement.ItemsSource as INotifyCollectionChanged;
                if (itemsSource != null)
                {
                    itemsSource.CollectionChanged += ItemsSourceOnCollectionChanged;
                }
                Control.GetAdapter().NotifyDataSetChanged();

                Control.LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
                Control.HasFixedSize = true;

                Control.SetClipToPadding(false);
            }
        }

        protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(Element.ItemsSource))
            {
                UpdateAdapter();
            }
        }

        private void UpdateAdapter()
        {
            var newItemsSource = this.Element.ItemsSource as INotifyCollectionChanged;
            if (newItemsSource != null)
            {
                newItemsSource.CollectionChanged += ItemsSourceOnCollectionChanged;
            }
            var adapter = new RecyclerViewAdapter(Element) { HasStableIds = true };
            Control.SetAdapter(adapter);
        }

        private void ItemsSourceOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            var adapter = Control.GetAdapter();
            Console.WriteLine("Action : {0}", e.Action);
            switch (e.Action)
            {
                case NotifyCollectionChangedAction.Add:
                    adapter.NotifyItemRangeInserted(
                        positionStart: e.NewStartingIndex,
                        itemCount: e.NewItems.Count
                    );
                    break;
                case NotifyCollectionChangedAction.Remove:
                    if (((IList)Element.ItemsSource).Count == 0)
                    {
                        adapter.NotifyDataSetChanged();
                        return;
                    }
                    ((RecyclerViewAdapter)adapter).ClearRowHeight(e.OldStartingIndex);
                    adapter.NotifyItemRangeRemoved(
                        positionStart: e.OldStartingIndex,
                        itemCount: e.OldItems.Count
                    );
                    break;
                case NotifyCollectionChangedAction.Replace:
                    ((RecyclerViewAdapter)adapter).ClearRowHeight(e.OldStartingIndex);
                    adapter.NotifyItemRangeChanged(
                        positionStart: e.OldStartingIndex,
                        itemCount: e.OldItems.Count
                    );
                    break;
                case NotifyCollectionChangedAction.Move:
                    for (var i = 0; i < e.NewItems.Count; i++)
                        adapter.NotifyItemMoved(
                            fromPosition: e.OldStartingIndex + i,
                            toPosition: e.NewStartingIndex + i
                        );
                    break;
                case NotifyCollectionChangedAction.Reset:
                    adapter.NotifyDataSetChanged();
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }
    }
}


text:
package org.apache.ignite.internal.processors.cache.datastructures;

import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.datastructures.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.testframework.*;

import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;

import static org.apache.ignite.cache.CacheMode.*;

/**
 * Set failover tests.
 */
public abstract class GridCacheSetFailoverAbstractSelfTest extends IgniteCollectionAbstractTest {
    /** */
    private static final String SET_NAME = "testFailoverSet";

    /** */
    private static final long TEST_DURATION = 60_000;

    /** {@inheritDoc} */
    @Override protected int gridCount() {
        return 4;
    }

    /** {@inheritDoc} */
    @Override protected void beforeTestsStarted() throws Exception {
        // No-op.
    }

    /** {@inheritDoc} */
    @Override protected void afterTestsStopped() throws Exception {
        // No-op.
    }

    /** {@inheritDoc} */
    @Override protected void beforeTest() throws Exception {
        startGrids(gridCount());
    }

    /** {@inheritDoc} */
    @Override protected void afterTest() throws Exception {
        stopAllGrids();
    }

    /** {@inheritDoc} */
    @Override protected CacheMode collectionCacheMode() {
        return PARTITIONED;
    }

    /** {@inheritDoc} */
    @Override protected long getTestTimeout() {
        return TEST_DURATION + 60_000;
    }

    /**
     * @throws Exception If failed.
     */
    @SuppressWarnings("WhileLoopReplaceableByForEach")
    public void testNodeRestart() throws Exception {
        IgniteSet<Integer> set = grid(0).set(SET_NAME, config(false));

        final int ITEMS = 10_000;

        Collection<Integer> items = new ArrayList<>(ITEMS);

        for (int i = 0; i < ITEMS; i++)
            items.add(i);

        set.addAll(items);

        assertEquals(ITEMS, set.size());

        AtomicBoolean stop = new AtomicBoolean();

        IgniteInternalFuture<?> killFut = startNodeKiller(stop);

        long stopTime = System.currentTimeMillis() + TEST_DURATION;

        try {
            ThreadLocalRandom rnd = ThreadLocalRandom.current();

            while (System.currentTimeMillis() < stopTime) {
                for (int i = 0; i < 10; i++) {
                    try {
                        int size = set.size();

                        // TODO: GG-7952, check for equality when GG-7952 fixed.
                        assertTrue(size > 0);
                    }
                    catch (IgniteException ignore) {
                        // No-op.
                    }

                    try {
                        Iterator<Integer> iter = set.iterator();

                        int cnt = 0;

                        while (iter.hasNext()) {
                            assertNotNull(iter.next());

                            cnt++;
                        }

                        // TODO: GG-7952, check for equality when GG-7952 fixed.
                        assertTrue(cnt > 0);
                    }
                    catch (IgniteException ignore) {
                        // No-op.
                    }

                    int val = rnd.nextInt(ITEMS);

                    assertTrue("Not contains: " + val, set.contains(val));

                    val = ITEMS + rnd.nextInt(ITEMS);

                    assertFalse("Contains: " + val, set.contains(val));
                }

                log.info("Remove set.");

                set.close();

                log.info("Create new set.");

                set = grid(0).set(SET_NAME, config(false));

                set.addAll(items);
            }
        }
        finally {
            stop.set(true);
        }

        killFut.get();

        set.close();

        if (false) { // TODO GG-8962: enable check when fixed.
            int cnt = 0;

            Set<IgniteUuid> setIds = new HashSet<>();

            for (int i = 0; i < gridCount(); i++) {
                Iterator<GridCacheEntryEx> entries =
                    ((IgniteKernal)grid(i)).context().cache().internalCache().map().allEntries0().iterator();

                while (entries.hasNext()) {
                    GridCacheEntryEx entry = entries.next();

                    if (entry.hasValue()) {
                        cnt++;

                        if (entry.key() instanceof GridCacheSetItemKey) {
                            GridCacheSetItemKey setItem = (GridCacheSetItemKey)entry.key();

                            if (setIds.add(setItem.setId()))
                                log.info("Unexpected set item [setId=" + setItem.setId() +
                                    ", grid: " + grid(i).name() +
                                    ", entry=" + entry + ']');
                        }
                    }
                }
            }

            assertEquals("Found unexpected cache entries", 0, cnt);
        }
    }

    /**
     * Starts thread restarting random node.
     *
     * @param stop Stop flag.
     * @return Future completing when thread finishes.
     */
    private IgniteInternalFuture<?> startNodeKiller(final AtomicBoolean stop) {
        return GridTestUtils.runAsync(new Callable<Void>() {
            @Override public Void call() throws Exception {
                ThreadLocalRandom rnd = ThreadLocalRandom.current();

                while (!stop.get()) {
                    int idx = rnd.nextInt(1, gridCount());

                    U.sleep(rnd.nextLong(2000, 3000));

                    log.info("Killing node: " + idx);

                    stopGrid(idx);

                    U.sleep(rnd.nextLong(500, 1000));

                    startGrid(idx);
                }

                return null;
            }
        });
    }
}