text:
class ModelView;

// Bit fields for Controller-related requests and masks.
// 1. Characteristics of the Rendering Context
#define MVC_USE_ACCUM_BIT 1
#define MVC_USE_ALPHA_BIT 2
#define MVC_USE_DEPTH_BIT 4
#define MVC_USE_STENCIL_BIT 8
// 2. Modifier masks in event callbacks
#define MVC_SHIFT_BIT 1
#define MVC_CTRL_BIT 2
#define MVC_ALT_BIT 4

#define GLFW_MOUSE_BUTTON_1   0

class Controller
{
public:
	Controller();
	virtual ~Controller();

	enum MouseButton
	{
		LEFT_BUTTON, MIDDLE_BUTTON, RIGHT_BUTTON
	};

	enum SpecialKey
	{
		LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW, HOME
	};

	// 1. MANAGING THE LIST OF MODELS
	void addModel(ModelView* m);
	int getNumModels() const { return models.size(); }
	ModelView* getModel(int which) const;
	// The following method returns the ModelView removed from the
	// list (e.g., so the caller can issue a "delete" on it)
	ModelView* removeModel(int which);
	void removeModel(ModelView* m);
	// if (do_delete) each model will have "delete" applied to it as
	// it is removed from the list
	void removeAllModels(bool do_delete);
	void toggleVisibility(int which);

	// 2. OTHER METHODS
	void getOverallMCBoundingBox(double* xyzLimits) const;
	double getViewportAspectRatio() const; // height/width
	virtual void redraw() const {} // to force a display update
	void reportVersions(std::ostream& os) const;
	virtual void run() = 0;
	virtual void setWindowTitle(const std::string& title) = 0;

	// 3. CLASS METHODS
	static bool checkForErrors(std::ostream& os, const std::string& context);
	static Controller* getCurrentController() { return curController; }

protected:
	Controller(const Controller& c) {} // do not allow copies, including pass-by-value
	std::vector<ModelView*> models;
	std::vector<bool> visible;

	// Virtual methods for event handling (any can be overridden)
	// --> Keyboard-related event handling
	virtual void handleAsciiChar(unsigned char theChar, int x, int y);
	virtual void handleFunctionKey(int whichFunctionKey, int x, int y, int mods){}
	virtual void handleSpecialKey(SpecialKey key, int x, int y, int mods){}

	// --> Mouse-related event handling
	virtual void handleMouseButton(MouseButton button, bool pressed, int x, int y, int mods);
	virtual void handleMouseMotion(int x, int y);
	virtual void handleScroll(bool up);

	// --> Window-related event handling
	virtual void handleReshape(int width, int height);

	// --> Miscellaneous
	virtual void endProgram() { exit(0); }
	virtual void reportWindowInterfaceVersion(std::ostream& os) const = 0;
	void screenXYToLDS(int x, int y, double& ldsX, double& ldsY);
	void setClearFlags(int rcFlags);
	virtual void swapBuffers() const = 0;

	// Data the Controller uses to track the overall MC box bounding all models.
	double overallMCBoundingBox[6];
	int glClearFlags;

	static Controller* curController;
	static int newWindowWidth, newWindowHeight;
	static std::string titleString(const std::string& str);

private:

	void updateMCBoundingBox(ModelView* m);
};

#endif


text:
"""
This module provides custom exceptions.
"""

from astropy.utils.exceptions import AstropyWarning

__all__ = ['NoDetectionsWarning']

class NoDetectionsWarning(AstropyWarning):
    """
    A warning class to indicate no sources were detected.
    """

redpajama_set_name: RedPajamaGithub


text:
describe('hello events', function() {

	it('should bind handler using hello.on(eventName, handler) and trigger hello.emit', function(done) {
		function handler() {
			done();
		}

		hello.on('auth.login', handler);
		hello.emit('auth.login');
		hello.off('auth.login', handler);
	});

	it('should support legacy handlers using hello.subscribe(eventName, handler) and trigger hello.emit', function(done) {

		function handler() {
			done();
		}

		hello.subscribe('auth.login', handler);
		hello.emit('auth.login');
		hello.unsubscribe('auth.login', handler);
	});

});


text:
/* $Id: CbcStatistics.hpp 1573 2011-01-05 01:12:36Z lou $ */
// Copyright (C) 2005, International Business Machines
// Corporation and others.  All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).

#ifndef CbcStatistics_H
#define CbcStatistics_H

#include "CbcModel.hpp"

/** For gathering statistics */

class CbcStatistics {
public:
    // Default Constructor
    CbcStatistics ();
    // Branch
    CbcStatistics(CbcNode * node, CbcModel * model);

    ~CbcStatistics();
    // Copy
    CbcStatistics(const CbcStatistics & rhs);
    // Assignment
    CbcStatistics& operator=(const CbcStatistics & rhs);
    // Update at end of branch
    void endOfBranch(int numberIterations, double objectiveValue);
    // Update number of infeasibilities
    void updateInfeasibility(int numberInfeasibilities);
    // Branch found to be infeasible by chooseBranch
    void sayInfeasible();
    // Just prints
    void print(const int * sequenceLookup = NULL) const;
    // Node number
    inline int node() const {
        return id_;
    }
    // Parent node number
    inline int parentNode() const {
        return parentId_;
    }
    // depth
    inline int depth() const {
        return depth_;
    }
    // way
    inline int way() const {
        return way_;
    }
    // value
    inline double value() const {
        return value_;
    }
    // starting objective
    inline double startingObjective() const {
        return startingObjective_;
    }
    // Unsatisfied at beginning
    inline int startingInfeasibility() const {
        return startingInfeasibility_;
    }
    // starting objective
    inline double endingObjective() const {
        return endingObjective_;
    }
    // Unsatisfied at end
    inline int endingInfeasibility() const {
        return endingInfeasibility_;
    }
    // Number iterations
    inline int numberIterations() const {
        return numberIterations_;
    }

protected:
    // Data
    /// Value
    double value_;
    /// Starting objective
    double startingObjective_;
    /// Ending objective
    double endingObjective_;
    /// id
    int id_;
    /// parent id
    int parentId_;
    /// way -1 or +1 is first branch -10 or +10 is second branch
    int way_;
    /// sequence number branched on
    int sequence_;
    /// depth
    int depth_;
    /// starting number of integer infeasibilities
    int startingInfeasibility_;
    /// ending number of integer infeasibilities
    int endingInfeasibility_;
    /// number of iterations
    int numberIterations_;
};

#endif


text:
package org.motechproject.security.exception;

/**
 * Exception which signalizes that server url property in platform settings is empty
 */
public class ServerUrlIsEmptyException extends RuntimeException {
    private static final long serialVersionUID = -6704453759425844235L;

    public ServerUrlIsEmptyException() {
        super();
    }

    public ServerUrlIsEmptyException(String message) {
        super(message);
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">

<TITLE>
Apache Struts API Documentation: Class  FormTag
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  SUMMARY:  INNER | FIELD | CONSTR | METHOD

DETAIL:  FIELD | CONSTR | METHOD

org.apache.struts.taglib.html

Class  FormTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--org.apache.struts.taglib.html.FormTag

All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class FormTag
extends javax.servlet.jsp.tagext.TagSupport

Custom tag that represents an input form, associated with a bean whose
 properties correspond to the various fields of the form.

Version:
$Revision: 1.1 $ $Date: 2001-09-18 05:13:30 +0900 (火, 18  9月 2001) $

Author:
Craig R. McClanahan

See Also:
Serialized Form

Field Summary

protected  java.lang.String
action

          The action URL to which this form should be submitted, if any.

protected  java.lang.String
enctype

          The content encoding to be used on a POST submit.

protected  java.lang.String
focus

          The name of the field to receive focus, if any.

protected static MessageResources
messages

          The message resources for this package.

protected  java.lang.String
method

          The request method used when submitting this form.

protected  java.lang.String
name

          The attribute key under which our associated bean is stored.

protected  java.lang.String
onreset

          The onReset event script.

protected  java.lang.String
onsubmit

          The onSubmit event script.

protected  java.lang.String
scope

          The scope (request or session) under which our associated bean
 is stored.

protected  ActionServlet
servlet

          The ActionServlet instance we are associated with (so that we can
 initialize the servlet property on any form bean that
 we create).

protected  java.lang.String
style

          The style attribute associated with this tag.

protected  java.lang.String
styleClass

          The style class associated with this tag.

protected  java.lang.String
styleId

          The identifier associated with this tag.

protected  java.lang.String
target

          The window target.

protected  java.lang.String
type

          The Java class name of the bean to be created, if necessary.

Fields inherited from class javax.servlet.jsp.tagext.TagSupport

id, pageContext, parent, values

Fields inherited from interface javax.servlet.jsp.tagext.IterationTag

EVAL_BODY_AGAIN

Fields inherited from interface javax.servlet.jsp.tagext.Tag

EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE

Constructor Summary

FormTag()

Method Summary

 int
doEndTag()

          Render the end of this form.

 int
doStartTag()

          Render the beginning of this form.

 java.lang.String
getAction()

          Return the action URL to which this form should be submitted.

protected  java.lang.String
getActionMappingName()

          Return the form action converted into an action mapping path.

protected  java.lang.String
getActionMappingURL()

          Return the form action converted into a server-relative URL.

 java.lang.String
getEnctype()

 java.lang.String
getFocus()

          Return the focus field name for this form.

 java.lang.String
getMethod()

          Return the request method used when submitting this form.

 java.lang.String
getName()

          Return the attribute key name of our bean.

 java.lang.String
getOnreset()

          Return the onReset event script.

 java.lang.String
getOnsubmit()

          Return the onSubmit event script.

 java.lang.String
getScope()

          Return the attribute scope of our bean.

 java.lang.String
getStyle()

          Return the style attribute for this tag.

 java.lang.String
getStyleClass()

          Return the style class for this tag.

 java.lang.String
getStyleId()

          Return the style identifier for this tag.

 java.lang.String
getTarget()

          Return the window target.

 java.lang.String
getType()

          Return the Java class of our bean.

protected  void
lookup()

          Look up values for the name, scope, and
 type properties if necessary.

 void
release()

          Release any acquired resources.

 void
setAction(java.lang.String action)

          Set the action URL to which this form should be submitted.

 void
setEnctype(java.lang.String enctype)

 void
setFocus(java.lang.String focus)

          Set the focus field name for this form.

 void
setMethod(java.lang.String method)

          Set the request method used when submitting this form.

 void
setName(java.lang.String name)

          Set the attribute key name of our bean.

 void
setOnreset(java.lang.String onReset)

          Set the onReset event script.

 void
setOnsubmit(java.lang.String onSubmit)

          Set the onSubmit event script.

 void
setScope(java.lang.String scope)

          Set the attribute scope of our bean.

 void
setStyle(java.lang.String style)

          Set the style attribute for this tag.

 void
setStyleClass(java.lang.String styleClass)

          Set the style class for this tag.

 void
setStyleId(java.lang.String styleId)

          Set the style identifier for this tag.

 void
setTarget(java.lang.String target)

          Set the window target.

 void
setType(java.lang.String type)

          Set the Java class of our bean.

Methods inherited from class javax.servlet.jsp.tagext.TagSupport

doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue

Methods inherited from class java.lang.Object

<clinit>, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait

Field Detail

action

protected java.lang.String action

The action URL to which this form should be submitted, if any.

enctype

protected java.lang.String enctype

The content encoding to be used on a POST submit.

focus

protected java.lang.String focus

The name of the field to receive focus, if any.

messages

protected static MessageResources messages

The message resources for this package.

method

protected java.lang.String method

The request method used when submitting this form.

name

protected java.lang.String name

The attribute key under which our associated bean is stored.

onreset

protected java.lang.String onreset

The onReset event script.

onsubmit

protected java.lang.String onsubmit

The onSubmit event script.

scope

protected java.lang.String scope

The scope (request or session) under which our associated bean
 is stored.

servlet

protected ActionServlet servlet

The ActionServlet instance we are associated with (so that we can
 initialize the servlet property on any form bean that
 we create).

style

protected java.lang.String style

The style attribute associated with this tag.

styleClass

protected java.lang.String styleClass

The style class associated with this tag.

styleId

protected java.lang.String styleId

The identifier associated with this tag.

target

protected java.lang.String target

The window target.

type

protected java.lang.String type

The Java class name of the bean to be created, if necessary.

Constructor Detail

FormTag

public FormTag()

Method Detail

getEnctype

public java.lang.String getEnctype()

setEnctype

public void setEnctype(java.lang.String enctype)

getAction

public java.lang.String getAction()

Return the action URL to which this form should be submitted.

setAction

public void setAction(java.lang.String action)

Set the action URL to which this form should be submitted.

Parameters:
action - The new action URL

getFocus

public java.lang.String getFocus()

Return the focus field name for this form.

setFocus

public void setFocus(java.lang.String focus)

Set the focus field name for this form.

Parameters:
focus - The new focus field name

getMethod

public java.lang.String getMethod()

Return the request method used when submitting this form.

setMethod

public void setMethod(java.lang.String method)

Set the request method used when submitting this form.

Parameters:
method - The new request method

getName

public java.lang.String getName()

Return the attribute key name of our bean.

setName

public void setName(java.lang.String name)

Set the attribute key name of our bean.

Parameters:
name - The new attribute key name

getOnreset

public java.lang.String getOnreset()

Return the onReset event script.

setOnreset

public void setOnreset(java.lang.String onReset)

Set the onReset event script.

Parameters:
onReset - The new event script

getOnsubmit

public java.lang.String getOnsubmit()

Return the onSubmit event script.

setOnsubmit

public void setOnsubmit(java.lang.String onSubmit)

Set the onSubmit event script.

Parameters:
onSubmit - The new event script

getScope

public java.lang.String getScope()

Return the attribute scope of our bean.

setScope

public void setScope(java.lang.String scope)

Set the attribute scope of our bean.

Parameters:
scope - The new attribute scope

getStyle

public java.lang.String getStyle()

Return the style attribute for this tag.

setStyle

public void setStyle(java.lang.String style)

Set the style attribute for this tag.

Parameters:
style - The new style attribute

getStyleClass

public java.lang.String getStyleClass()

Return the style class for this tag.

setStyleClass

public void setStyleClass(java.lang.String styleClass)

Set the style class for this tag.

Parameters:
styleClass - The new style class

getStyleId

public java.lang.String getStyleId()

Return the style identifier for this tag.

setStyleId

public void setStyleId(java.lang.String styleId)

Set the style identifier for this tag.

Parameters:
styleId - The new style identifier

getTarget

public java.lang.String getTarget()

Return the window target.

setTarget

public void setTarget(java.lang.String target)

Set the window target.

Parameters:
target - The new window target

getType

public java.lang.String getType()

Return the Java class of our bean.

setType

public void setType(java.lang.String type)

Set the Java class of our bean.

Parameters:
type - The new Java class

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException

Render the beginning of this form.

Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport

Throws:
javax.servlet.jsp.JspException - if a JSP exception has occurred

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException

Render the end of this form.

Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport

Throws:
javax.servlet.jsp.JspException - if a JSP exception has occurred

release

public void release()

Release any acquired resources.

Overrides:
release in class javax.servlet.jsp.tagext.TagSupport

getActionMappingName

protected java.lang.String getActionMappingName()

Return the form action converted into an action mapping path.  The
 value of the action property is manipulated as follows in
 computing the name of the requested mapping:

Any filename extension is removed (on the theory that extension
     mapping is being used to select the controller servlet).

If the resulting value does not start with a slash, then a
     slash is prepended.

getActionMappingURL

protected java.lang.String getActionMappingURL()

Return the form action converted into a server-relative URL.

lookup

protected void lookup()
               throws javax.servlet.jsp.JspException

Look up values for the name, scope, and
 type properties if necessary.

Throws:
javax.servlet.jsp.JspException - if a required value cannot be looked up

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  SUMMARY:  INNER | FIELD | CONSTR | METHOD

DETAIL:  FIELD | CONSTR | METHOD

Copyright © 2000-2001 - Apache Software Foundation


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Hosagoudar, Meliolales of India (Calcutta) 92 (1996)

#### Original name
Asteridiella kapoorii Hosag. & Raghu

### Remarks
null


text:
@interface NodataView : UIView

@end


text:
package consulo.ui.web.internal.base;

import com.vaadin.shared.ui.AbstractSingleComponentContainerState;
import com.vaadin.ui.AbstractSingleComponentContainer;
import consulo.ui.Component;

import javax.annotation.Nonnull;

/**
 * @author VISTALL
 * @since 2019-02-17
 */
public abstract class VaadinSingleComponentContainer extends AbstractSingleComponentContainer implements FromVaadinComponentWrapper, ComponentHolder {
  private Component myComponent;

  public void removeIfContent(@Nonnull com.vaadin.ui.Component component) {
    if (getContent() == component) {
      setContent(null);
    }
  }

  @Override
  public AbstractSingleComponentContainerState getState() {
    return super.getState();
  }

  @Override
  public void setComponent(Component component) {
    myComponent = component;
  }

  @Nonnull
  @Override
  public Component toUIComponent() {
    return myComponent;
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<ripple android:color="?colorControlHighlight"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <color android:color="?colorAccent" />
    </item>
</ripple>


text:
extern "C"
{
#include "libavcodec/avcodec.h"
}

namespace avkit
{

// Adjusts requestedWidth X requestedHeight to maintain aspect ratio of streamWidth X streamHeight.

CK_API void aspect_correct_dimensions( uint16_t streamWidth, uint16_t streamHeight,
				       uint16_t requestedWidth, uint16_t requestedHeight,
				       uint16_t& destWidth, uint16_t& destHeight );

CK_API double q_to_d( int num, int den );

CK_API void d_to_q( double val, int& num, int& den, int max = INT_MAX );

CK_API AVCodecID _codec_name_to_id( const cppkit::ck_string& name );

}

#endif


text:
CREATE PROCEDURE [dbo].[uspUserUpdateByConfirmMail]
       @OperationString  nvarchar(200),
	   @Type tinyint
AS

/*

 ♦ All possible value for parameter @Type.

╔════════════╦══════════════════╗
╟ Type       ║ Description      ║
╠════════════╬══════════════════╣
║  # 0       │ Confirmation Mail║
╟────────────┼──────────────────╢
║  # 1		 │ Reset Request    ║
╟────────────┼──────────────────╢
║  # 2       │ Accept be Owner  ║
╟────────────┼──────────────────╢
║  # 3       │ Refused be Owner ║
╟────────────┼──────────────────╢
║  # 4       │ Accept be owner  ║
║            │ and Orginal owner║
║            │ leave org.       ║
╚════════════╧══════════════════╝
 ♦ Member status for user in his organization

	▄ O-Owner M-Member
	▄ M (Pending Member - Member - Pending Owner) OK
	▄ MM =Member or Pending Owner

	-- PendingMember = 0;
    -- Member        = 1;
    -- PendingOwner  = 2;
    -- Owner         = 3;
*/
	/*User Id Of The OperationString*/
	Declare  @UserID uniqueidentifier;
	Declare  @NewEmailAddress nvarchar(300);
	Declare  @IsEmailExists nvarchar(300);
	Declare  @RequestUserID uniqueidentifier;
	Declare  @OrganizationID uniqueidentifier;

	SET NOCOUNT ON
	SET XACT_ABORT ON

	BEGIN TRAN

	/*------------------------------------------------------------------
	Getting the Value of UserID and If New Email Address exists.
	------------------------------------------------------------------*/

	--Select User ID
	(Select Top 1 @UserID=[UserID],
	              @NewEmailAddress=[NewEmailAddress] ,
	              @RequestUserID =[RequestUserID],
	              @OrganizationID=[OrganizationID]
	 from UserOperation
     where UserOperation.OperationString=@OperationString AND
		   UserOperation.[Type]=@Type /*According to the operation string type*/);

	/*------------------------------------------------------------------
	In case confirmation mail is for accepting role owner for organization.
	------------------------------------------------------------------*/

	if(@Type = 2)/*eNegConstant.UserOperation = AcceptToBeOwner*/
		begin
			update [dbo].[UserOrganization]
			set [MemberStatus] = 3 /*eNegConstant.OrganizationMemberStatus = Owner*/
			where [UserID]= @UserID AND
			      OrganizationID= @OrganizationID;

			--User can not be owner for two oragnization so if he accept to be
			-- owner for one all other requests (Pending owner) must be cancelled
			UPDATE [dbo].[UserOrganization]
			SET [MemberStatus] = 1 /*Memeber*/
			where [UserID]= @UserID AND
			      [MemberStatus] = 2 /*Pending Owner*/
		end

	/*------------------------------------------------------------------
	In case confirmation mail is for refusing role owner for organization.
	------------------------------------------------------------------*/

	if(@Type = 3)/*eNegConstant.UserOperation = RefuseToBeOwner*/
		begin
			update [dbo].[UserOrganization]
			set [MemberStatus] = 1 /*eNegConstant.OrganizationMemberStatus = Member*/
			where [UserID]= @UserID AND
			      OrganizationID= @OrganizationID;
		end

	/*------------------------------------------------------------------
	In case confirmation mail is for accepting role owner and removing original one for organization.
	------------------------------------------------------------------*/

	if(@Type = 4)/*eNegConstant.UserOperation = AcceptToBeOwner_RemoveOriginal*/
		begin
			update [dbo].[UserOrganization]
			set [MemberStatus] = 3 /*eNegConstant.OrganizationMemberStatus = Owner*/
			where [UserID]= @UserID AND
			      OrganizationID= @OrganizationID

			update [dbo].[UserOrganization]
			set [Deleted] = 1,[DeletedOn] = GetDate()
			where [UserID]= @RequestUserID AND
			      OrganizationID= @OrganizationID

			--User can not be owner for two oragnization so if he accept to be
			-- owner for one all other requests (Pending owner) must be cancelled
			UPDATE [dbo].[UserOrganization]
			SET [MemberStatus] = 1 /*Memeber*/
			where [UserID]= @UserID AND
			      [MemberStatus] = 2 /*Pending Owner*/
		end

	/*------------------------------------------------------------------
	In case it is normal confirmation mail.
	------------------------------------------------------------------*/
	if (ISNULL(@NewEmailAddress,'')='')
		begin
			--Confirm Ths User
			UPDATE [dbo].[User]
			SET     [Locked] =0
			WHERE  [UserID] = @UserID;
		end

	/*------------------------------------------------------------------
	In case if the user change his email.
	------------------------------------------------------------------*/
	if ((ISNULL(@NewEmailAddress,'')<>'') and
	   (Not exists( Select *
					from [User]
					where UserID <> @UserID and
						EmailAddress=@NewEmailAddress and
		                [User].Disabled=0)))
		begin

			--Confirm Ths User
			UPDATE [dbo].[User]
			SET     [Locked] =0,
					[EmailAddress]=@NewEmailAddress
			WHERE  [UserID] = @UserID;
		end

	/*------------------------------------------------------------------*/

	/*----------------------------------------------------------------
	- In case of Confirmation mail and reset request mail.
	----------------------------------------------------------------*/

	IF (@Type IN (0,1))
		BEGIN
			--Delete User Operations
			Delete [dbo].UserOperation
			Where  [dbo].UserOperation.[UserID] = @UserID AND
				   [Type] in (0/*Confirmation*/,1/*Reset Request*/);
		END

    /*----------------------------------------------------------------
	- In case of Accept,refused and accept and delete owner mail .
	----------------------------------------------------------------*/

	IF (@Type IN (2/*Accept*/,3/*Refused*/,4/*Accept and Delete*/))
		BEGIN
			--Delete User Operations (Include in  you mind that
			--if one is pending owner in two organization)
			Delete [dbo].UserOperation
			Where  [dbo].UserOperation.[UserID] = @UserID AND
				   [Type] in (2/*Accept*/,3/*Refused*/,4/*Accept and Delete*/) AND
				   ( @Type in (2/*Accept*/,4/*Accept and Delete*/) OR
				     (@Type=3/*Refused*/ and OrganizationID=@OrganizationID)
				   );

		END

    -- Begin Return Select <- do not remove
    Select [UserID], [EmailAddress], [PasswordHash], [PasswordSalt], [Locked], [LockedDate], [LastLoginDate], [CreateDate], [AccountTypeID], [IPAddress], [SecurityQuestionID], [AnswerHash], [AnswerSalt], [Online], [Disabled], [FirstName], [LastName], [CompanyName], [LCID], [Address], [City], [CountryID], [Phone], [Mobile], [Gender], [Reset] ,[CultureID],[HasPublicProfile],[ProfileDescription],[PostalCode]
     FROM (
		SELECT 0 OrderID,[UserID], [EmailAddress], [PasswordHash], [PasswordSalt], [Locked], [LockedDate], [LastLoginDate], [CreateDate], [AccountTypeID], [IPAddress], [SecurityQuestionID], [AnswerHash], [AnswerSalt], [Online], [Disabled], [FirstName], [LastName], [CompanyName], [LCID], [Address], [City], [CountryID], [Phone], [Mobile], [Gender], [Reset] ,[CultureID],[HasPublicProfile],[ProfileDescription],[PostalCode]
		FROM   [dbo].[User]
		WHERE  [UserID] = @RequestUserID
	union
		SELECT 1 OrderID,[UserID], [EmailAddress], [PasswordHash], [PasswordSalt], [Locked], [LockedDate], [LastLoginDate], [CreateDate], [AccountTypeID], [IPAddress], [SecurityQuestionID], [AnswerHash], [AnswerSalt], [Online], [Disabled], [FirstName], [LastName], [CompanyName], [LCID], [Address], [City], [CountryID], [Phone], [Mobile], [Gender], [Reset] ,[CultureID],[HasPublicProfile],[ProfileDescription],[PostalCode]
		FROM   [dbo].[User]
		WHERE  [UserID] = @userID
    ) T
    order By [OrderID]

	-- End Return Select <- do not remove
	COMMIT TRAN


text:
// for win7/8
export const calcLpszClass = Buffer.from('CalcFrame\0', 'ucs2')
// for win10
// export const calcLpszWindow = Buffer.from('Calculator\0', 'ucs2')
// export const calcLpszWindowNotepad = Buffer.from('Notepad\0', 'ucs2')
export const calcLpszWindow = 'Calculator'
export const calcLpszWindowNotepad = 'Notepad'

export const calcLpszClassNotepad = Buffer.from('Notepad\0', 'ucs2')
export const calcLpszClassNotepadEdit = Buffer.from('Edit\0', 'ucs2')

export const calcLpszNotepad = 'Notepad'
export const calcLpszNotepadEdit = 'Edit'

/** GitHub CI */
export const githubPrinterNames: string[] = [
  'Microsoft Print to PDF',
  'Microsoft XPS Document Writer',
]

export const processDataTypes: string[] = [
  'RAW',
  // 'RAW[FF appended]',
  // 'RAW[FF auto]',
  // 'NT EMF 1.003',
  // 'NT EMF 1.006',
  // 'NT EMF 1.007',
  // 'NT EMF 1.008',
  'NT EMF',
  'TEXT',
  'XPS2GDI',
]


text:
param([int]$GroupNumber = 0, [bool]$IsRunningOnWindows = $false)

Push-Location
try {
    # Import BuildTools.psm1
    $private:invocation = (Get-Variable MyInvocation -Scope 0).Value
    Set-Location (Join-Path (Split-Path $invocation.MyCommand.Path) ..)
    Import-Module  .\BuildTools.psm1 -DisableNameChecking

    # Import secrets:
    .\.kokoro-windows\Import-Secrets.ps1

    # The list of changed subdirectories.
    git config --global --add safe.directory /tmpfs/src/github/dotnet-docs-samples
    $changedDirs = ($(git diff main --name-only | cut -d/ -f 1 | uniq))

    # The list of all subdirectories.
    $allDirs = Get-ChildItem | Where-Object {$_.PSIsContainer} | Select-Object -ExpandProperty Name

    # If no dirs have changed we run everything since we are most likely on CI.
    if ($changedDirs.Count -gt 0)
    {
        $testDirs = $changedDirs
    }
    else
    {
        $testDirs = $allDirs
    }

    # For diagnosis purposes only
    Write-Output "Changed dirs: $changedDirs"
    Write-Output "Test dirs: $testDirs"

    # There are too many tests to run in a single Kokoro job.  So, we split
    # the tests into groups.  Each Kokoro job runs one group.

    # Groups of subdirectories.
    $groups = @(
        $false,  # 0: Everything.
        $false,  # 1: Everything starting from a to e.
        $false,  # 2: Everything starting from f to r, except for iot when on Linux because of the BouncyCastle and other dependencies.
        $false   # 3: Everything starting from s to z.
    )

    $groups[0] = $testDirs
    $groups[1] = $testDirs | Where-Object { ($_.Substring(0, 1).CompareTo("a") -ge 0) -and ($_.Substring(0, 1).CompareTo("e") -le 0) }
    $groups[2] = $testDirs | Where-Object { ($_.Substring(0, 1).CompareTo("f") -ge 0) -and ($_.Substring(0, 1).CompareTo("r") -le 0) -and ($IsRunningOnWindows -or -not ($_.Equals("iot"))) }
    $groups[3] = $testDirs | Where-Object { ($_.Substring(0, 1).CompareTo("s") -ge 0) -and ($_.Substring(0, 1).CompareTo("z") -le 0) }
    $dirs = $groups[$GroupNumber]

    Write-Output "Shard: $GroupNumber"
    Write-Output "Sharded dirs: $dirs"

    if ($dirs.Count -gt 0)
    {
        # Find all the runTest scripts.
        $scripts = Get-ChildItem -Path $dirs -Filter *runTest*.ps* -Recurse
        Write-Output "Scripts: $scripts"

        if ($scripts.Count -gt 0)
        {
            $scripts.VersionInfo.FileName `
                | Sort-Object -Descending -Property {Get-GitTimeStampForScript $_} `
                | Run-TestScripts -TimeoutSeconds 600
        }
    }
} finally {
    Pop-Location
}


text:
/* Home Controller */

(function() {

	'use strict';

		angular.module('myApp')

			.controller('mainCtrl', ['$scope', 'userData', function($scope, userData) {
				$scope.items = 0;
				$scope.total = 0;

				//listens for any updates within users data and is imediately updated
				//when data is changed for two way binding across controllers
				 $scope.$on('handleBroadCast', function(){

					$scope.items = userData.getItemCount();
					$scope.total = userData.getTotalPrice();

				})

			}]);
}());


text:
<?php namespace App\Domain\Repository\Interfaces;

interface IRepository {
    public function create($entity);
    public function update($entity);
    public function delete($id);
    public function findById($id);
    public function findAll();
}


text:
module Middleman
  module Blog
    VERSION = "3.3.0"
  end
end


text:
---
uid: InsightConnect.VMApplication
summary:
remarks: This object is used to create/get an instance of "View and Markup" application. To use below sample code add reference of iCnct.tlb in VS solution.
example: [*content]
---
[!code-vb[Main](..\snippets\InsightConnect.VMApplication.vb]
[!code-csharp[Main](..\snippets\InsightConnect.VMApplication.cs]


text:
'use strict';

module.exports = angular
	.module('ae.registry', [])
	.provider('apiRegistry', require('./registry-provider'))
	.name;


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="@dimen/navigation_header_height"
    android:background="@drawable/nav_header_background"
    android:paddingLeft="@dimen/default_padding"
    android:paddingRight="@dimen/default_padding"
    app:theme="@style/ThemeOverlay.AppCompat.Dark"
    android:paddingBottom="@dimen/navigation_padding_bottom">

    <ImageView
        android:id="@+id/nav_imageView"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:src="@drawable/xurxodev_image"
        android:layout_alignParentTop="true"
        android:layout_marginTop="38dp"/>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="56dp"
        android:orientation="vertical"
        android:layout_alignParentBottom="true"
        android:gravity="center|left">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="xurxodev"
            android:textColor="?android:textColorPrimary"

            android:layout_marginLeft="10dp"
            android:focusableInTouchMode="false"
            android:textAppearance="@style/Base.TextAppearance.AppCompat.Small"
            android:fontFamily="@string/font_fontFamily_medium" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="plus.google.com/+JorgeSanchez-Xurxo"
            android:textColor="?android:textColorPrimary"
            android:layout_marginLeft="10dp"
            android:textAppearance="@style/Base.TextAppearance.AppCompat.Small"
            android:fontFamily="@string/font_fontFamily_regular" />
    </LinearLayout>

</RelativeLayout>


text:
package de.slackspace.rmanager.gameengine.service;

import java.math.BigDecimal;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.List;

import de.slackspace.rmanager.gameengine.domain.City;
import de.slackspace.rmanager.gameengine.domain.DepartmentType;
import de.slackspace.rmanager.gameengine.domain.Person;

public class PersonnelService {

	SecureRandom random = new SecureRandom();

	public List<Person> createPersonnel(City city) {
		List<Person> personnel = new ArrayList<>();
		for (int i = 0; i < 6; i++) {
			personnel.add(createPerson(city.getRateOfPriceIncrease()));
		}

		return personnel;
	}

	protected Person createPerson(BigDecimal rateOfPriceIncrease) {
		int power = random.nextInt(10) + 1;
		int quality = random.nextInt(10) + 1;
		int age = random.nextInt(49) + 16;

		BigDecimal monthlyCosts = new BigDecimal(power + quality).multiply(new BigDecimal(100)).multiply(rateOfPriceIncrease);

		return new Person(monthlyCosts, age, quality, power, DepartmentType.randomType());
	}
}


text:
<?php defined('C5_EXECUTE') or die('Access Denied.'); ?>

    <form method="post" data-dialog-form="edit-file-folder-node" class="form-horizontal" action="<?= $controller->action('update_file_folder_node'); ?>">
        <?= $validation_token->output('update_file_folder_node'); ?>
        <input type="hidden" name="treeNodeID" value="<?= $node->getTreeNodeID(); ?>" />

            <?= $form->label('fileFolderName', t('Name')); ?>
            <?= $form->text('fileFolderName', $node->getTreeNodeName()); ?>

            <?= $form->label('fileFolderFileStorageLocation', t('Storage Location')); ?>
            <?= $form->select('fileFolderFileStorageLocation', $locations, $node->getTreeNodeStorageLocationID()); ?>

            <button class="btn btn-default" data-dialog-action="cancel"><?= t('Cancel'); ?></button>
            <button class="btn btn-primary pull-right" data-dialog-action="submit" type="submit"><?= t('Update'); ?></button>

    </form>


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="16dp">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/tv_item_number"
        style="@style/TextAppearance.AppCompat.Title"
        android:fontFamily="monospace"
        android:textSize="42sp"
        android:layout_gravity="center_vertical|start"/>

</FrameLayout>


text:
package org.ovirt.engine.core.common.businessentities;

import java.io.Serializable;

import javax.persistence.Embeddable;

import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;

import org.ovirt.engine.core.common.businessentities.mapping.GuidType;
import org.ovirt.engine.core.compat.Guid;

@Embeddable
@TypeDef(name = "guid", typeClass = GuidType.class)
public class RoleGroupMapId implements Serializable {
    private static final long serialVersionUID = 2602534834702940699L;

    Integer actionGroup;

    @Type(type = "guid")
    Guid roleId;

    public RoleGroupMapId() {
    }

    public RoleGroupMapId(Guid roleId, ActionGroup actionGroup) {
        this.roleId = roleId;
        this.actionGroup = actionGroup.getId();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((actionGroup == null) ? 0 : actionGroup.hashCode());
        result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        RoleGroupMapId other = (RoleGroupMapId) obj;
        if (actionGroup == null) {
            if (other.actionGroup != null)
                return false;
        } else if (!actionGroup.equals(other.actionGroup))
            return false;
        if (roleId == null) {
            if (other.roleId != null)
                return false;
        } else if (!roleId.equals(other.roleId))
            return false;
        return true;
    }
}


text:
/*=============================
jquery.barousel.js
v.0.1
Julien Decaudin - 03/2010
www.juliendecaudin.com
=============================*/

(function ($) {
    $.fn.barousel = function (callerSettings) {
        var settings = $.extend({
            imageWrapper: '.barousel_image',
            contentWrapper: '.barousel_content',
            contentLinksWrapper: null,
            navWrapper: '.barousel_nav',
            slideDuration: 3000, //duration of each slide in milliseconds
            navType: 2, //1: boxes navigation; 2: prev/next navigation; 3: custom navigation
            fadeIn: 0, //fade between slides; activated by default
            fadeInSpeed: 600, //fade duration in milliseconds
            manualCarousel: 0, //manual carousel if set to 1
            contentResize: 1, //resize content container
            contentResizeSpeed: 100, //content resize speed in milliseconds
            debug: 0
        }, callerSettings || {});

        settings.imageWrapper = $(this).find(settings.imageWrapper);
        settings.contentWrapper = $(this).find(settings.contentWrapper);
        settings.contentLinksWrapper = $(settings.contentLinksWrapper);
        settings.navWrapper = $(this).find(settings.navWrapper);
        settings.imageList = settings.imageWrapper.find('img').not('[class*=intro]'); //list of the items' background image (intro image is ignored)
        settings.contentList = settings.contentWrapper.find('div').not('[class*=intro]'); //list of the items' content (intro content is ignored)
        settings.contentLinksList = settings.contentLinksWrapper.find('a'); //list of the items' content links (optional)
        settings.imageIntro = settings.imageWrapper.find('img[class*=intro]');
        settings.contentIntro = settings.contentWrapper.find('div[class*=intro]');
        settings.currentIndex = 0; //index of the current displayed item
        settings.totalItem = settings.imageList.length; //total number of items
        settings.stopCarousel = 0; //flag to stop the carousel
        settings.timerCarousel; //timer for the carousel
        settings.navFreeze = 0; //flag to avoid clicking too fast on the nav
        settings.introActive = 0; //flag to know if there is an intro state and if it's active

        if (settings.imageWrapper.find('img[class*=intro]').length > 0) {
            settings.introActive = 1;
        }

        if (settings.totalItem == 1) {
            //$(settings.navWrapper).hide();
        } else {
            //set the index of each image
            settings.imageList.each(function (n) { this.index = n; });

            //set the index of each content
            settings.contentList.each(function (n) { this.index = n; });

            //set the index of each content link (optional)
            settings.contentLinksList.each(function (n) { this.index = n; });

            //return error if different number of images and contents
            if (settings.imageList.length != settings.contentList.length) {
                /* DEBUG */
                if (settings.debug == 1) console.log('[Barousel error] images and contents must be the same number');
                return this;
            }

            //init the default content height
            if (settings.contentResize == 1 && settings.introActive == 0) {
                $(settings.contentWrapper).height($(settings.contentList[settings.currentIndex]).height() + 10);
            }

            //init the content link default state (optional)
            if (settings.contentLinksWrapper != null) {
                $(settings.contentLinksList[settings.currentIndex]).addClass('current');
            }

            //build the navigation
            if (settings.navType == 1) {
                //items navigation type
                var strNavList = "
";
                settings.imageList.each(function (n) {
                    var currentClass = "";
                    if (n == 0) currentClass = "current";
                    strNavList += "

";
                });
                strNavList += "
";
                settings.navWrapper.append(strNavList);
                settings.navList = settings.navWrapper.find('a'); //list of the items' nav link

                //set the index of each nav link
                settings.navList.each(function (n) { this.index = n; });

            } else if (settings.navType == 2) {
                //prev/next navigation type
                var strNavList = "
";
                strNavList += "

";
                strNavList += "

";
                strNavList += "

1/" + settings.totalItem + "
";
                settings.navWrapper.append(strNavList);
                settings.navList = settings.navWrapper.find('a'); //list of the items' nav link
            } else if (settings.navType == 3) {
                //custom navigation [static build]
                settings.navList = settings.navWrapper.find('a'); //list of the items' nav link
                //set the index of each nav link
                settings.navList.each(function (n) { this.index = n; });
            }

            //init the navigation click event
            if (settings.navType == 1 || settings.navType == 3) {
                //items navigation type
                settings.navList.each(function (n) {
                    $(this).click(function () {
                        if (settings.navFreeze == 0) {
                            window.clearTimeout(settings.timerCarousel);
                            settings.stopCarousel = 1;
                            if (settings.currentIndex != n || settings.introActive == 1) {
                                loadItem(settings, n);
                                settings.currentIndex = n;
                            }
                        }
                        settings.introActive = 0;
                        return false;
                    });
                });
            } else if (settings.navType == 2) {
                //prev/next navigation type
                settings.navList.each(function () {
                    $(this).click(function () {
                        if (settings.navFreeze == 0) {
                            window.clearTimeout(settings.timerCarousel);
                            settings.stopCarousel = 1;

                            if ($(this).parent().hasClass('prev')) {
                                var previousIndex;

                                if (parseInt(settings.currentIndex) == 0) {
                                    previousIndex = parseInt(settings.totalItem) - 1;
                                } else {
                                    previousIndex = parseInt(settings.currentIndex) - 1;
                                }
                                loadItem(settings, previousIndex);
                                settings.currentIndex = previousIndex;

                            } else if ($(this).parent().hasClass('next')) {
                                var nextIndex;

                                if (parseInt(settings.currentIndex) == (parseInt(settings.totalItem) - 1)) {
                                    nextIndex = 0;
                                } else {
                                    nextIndex = parseInt(settings.currentIndex) + 1;
                                }
                                loadItem(settings, nextIndex);
                                settings.currentIndex = nextIndex;
                            }
                        }
                        settings.introActive = 0;
                        return false;
                    });
                });
            }

            //start the carousel
            if (settings.manualCarousel == 0) {
                var loadItemCall = function () { loadItem(settings, 1); };
                settings.timerCarousel = window.setTimeout(loadItemCall, settings.slideDuration);
            }
        }

        return this;
    };

    var loadItem = function (settings, index) {
        //reset the nav link current state
        if (settings.navType != 2) {
            settings.navList.each(function (n) { $(this).removeClass('current'); });
            $(settings.navList[index]).addClass('current');
        }

        //Change the background image then display the new content
        var currentImage;
        if (settings.introActive == 1) {
            currentImage = $(settings.imageIntro);
        } else {
            currentImage = $(settings.imageList[settings.currentIndex]);
        }
        var nextImage = $(settings.imageList[index]);

        /* DEBUG */
        if (settings.debug == 1) {
            console.log('[Barousel loadItem] currentImage:' + currentImage.attr('src'));
            console.log('[Barousel loadItem] nextImage:' + nextImage.attr('src'));
        }

        if (!currentImage.hasClass('default')) { currentImage.attr('class', 'previous'); }
        nextImage.attr('class', 'current');

        //fade-in effect
        if (settings.fadeIn == 0) {
            nextImage.show();
            currentImage.hide();
            loadModuleContent(settings, index);
        } else {
            settings.navFreeze = 1;
            $(settings.contentList).hide();
            nextImage.fadeIn(settings.fadeInSpeed, function () {
                currentImage.hide();
                currentImage.removeClass('previous');
                settings.navFreeze = 0;
            });
            loadModuleContent(settings, index);
        }

        //carousel functionnality (deactivated when the user click on an item)
        if (settings.stopCarousel == 0) {
            settings.currentIndex = index;
            var nextIndex;

            if (settings.currentIndex == settings.totalItem - 1) {
                nextIndex = 0;
            } else {
                nextIndex = parseInt(settings.currentIndex) + 1;
            }
            var loadItemCall = function () { loadItem(settings, nextIndex); };
            settings.timerCarousel = window.setTimeout(loadItemCall, settings.slideDuration);
        }
    };

    var loadModuleContent = function (settings, index) {
        if (settings.introActive == 1) {
            $(settings.contentIntro).hide();
            $(settings.contentWrapper).attr('class', '');
        }

        //Resize content
        if (settings.contentResize == 1 && parseInt($(settings.contentWrapper).height()) != parseInt($(settings.contentList[index]).height() + 10)) {
            $(settings.contentWrapper).animate({
                height: $(settings.contentList[index]).height() + 10
            }, settings.contentResizeSpeed, function () {
                loadModuleContentAction(settings, index);
            });
        } else {
            loadModuleContentAction(settings, index);
        }

        //update counter for previous/next nav
        if (settings.navType == 2) {
            $(settings.navWrapper).find('.counter_current').text(index + 1);
        }
    };

    var loadModuleContentAction = function (settings, index) {
        //display the loaded content
        $(settings.contentList).hide();
        $(settings.contentList[index]).show();

        if (settings.contentLinksWrapper != null) {
            $(settings.contentLinksList).removeClass('current');
            $(settings.contentLinksList[index]).addClass('current');
        }
    };

    $('#any_id').barousel();

})(jQuery);


text:
A sample ddp client in vanilla javascript using browserify

## running

- `npm browserify -g`
- `npm install`
- `browserify endpointcon.js -o build/endpointcon.js`
- open index.html in a browser


text:
<!DOCTYPE html>
<html lang="en">
<!--<![endif]-->
<!-- BEGIN HEAD -->

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>MyMaidz | Vendor</title>
	<meta content="width=device-width,initial-scale=1" name="viewport">
	<link rel="icon" href="./favicon.ico" type="image/x-icon">
	<!--[if IE]>
			<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<![endif]-->
	<!-- GLOBAL STYLES -->
	<!-- PAGE LEVEL STYLES -->
	<link rel="stylesheet" href="<?php echo plugin_url("bootstrap/css/bootstrap.css") ?>">
	<link rel="stylesheet" media="all" href="<?php echo css_url("app") ?>">

        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
	<!-- END PAGE LEVEL STYLES -->
	<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
	<!--[if lt IE 9]>
			<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
			<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
		<![endif]-->
        <script src="<?php echo js_url('app.min'); ?>"></script>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->

<body style="overflow: auto;">


text:
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003-2013, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

package scala.concurrent.impl

import scala.concurrent.{ ExecutionContext, CanAwait, OnCompleteRunnable, TimeoutException, ExecutionException }
import scala.concurrent.Future.InternalCallbackExecutor
import scala.concurrent.duration.{ Duration, FiniteDuration }
import scala.annotation.tailrec
import scala.util.control.NonFatal
import scala.util.{ Try, Success, Failure }

import java.util.concurrent.locks.AbstractQueuedSynchronizer
import java.util.concurrent.atomic.AtomicReference

private[concurrent] trait Promise[T] extends scala.concurrent.Promise[T] with scala.concurrent.Future[T] {
  def future: this.type = this

  import scala.concurrent.Future
  import scala.concurrent.impl.Promise.DefaultPromise

  override def transform[S](f: Try[T] => Try[S])(implicit executor: ExecutionContext): Future[S] = {
    val p = new DefaultPromise[S]()
    onComplete { result => p.complete(try f(result) catch { case NonFatal(t) => Failure(t) }) }
    p.future
  }

  // If possible, link DefaultPromises to avoid space leaks
  override def transformWith[S](f: Try[T] => Future[S])(implicit executor: ExecutionContext): Future[S] = {
    val p = new DefaultPromise[S]()
    onComplete {
      v => try f(v) match {
        case fut if fut eq this => p complete v.asInstanceOf[Try[S]]
        case dp: DefaultPromise[_] => dp.asInstanceOf[DefaultPromise[S]].linkRootOf(p)
        case fut => p completeWith fut
      } catch { case NonFatal(t) => p failure t }
    }
    p.future
  }

  override def toString: String = value match {
    case Some(result) => "Future("+result+")"
    case None => "Future(<not completed>)"
  }
}

/* Precondition: `executor` is prepared, i.e., `executor` has been returned from invocation of `prepare` on some other `ExecutionContext`.
 */
private final class CallbackRunnable[T](val executor: ExecutionContext, val onComplete: Try[T] => Any) extends Runnable with OnCompleteRunnable {
  // must be filled in before running it
  var value: Try[T] = null

  override def run() = {
    require(value ne null) // must set value to non-null before running!
    try onComplete(value) catch { case NonFatal(e) => executor reportFailure e }
  }

  def executeWithValue(v: Try[T]): Unit = {
    require(value eq null) // can't complete it twice
    value = v
    // Note that we cannot prepare the ExecutionContext at this point, since we might
    // already be running on a different thread!
    try executor.execute(this) catch { case NonFatal(t) => executor reportFailure t }
  }
}

private[concurrent] object Promise {

  private def resolveTry[T](source: Try[T]): Try[T] = source match {
    case Failure(t) => resolver(t)
    case _          => source
  }

  private def resolver[T](throwable: Throwable): Try[T] = throwable match {
    case t: scala.runtime.NonLocalReturnControl[_] => Success(t.value.asInstanceOf[T])
    case t: scala.util.control.ControlThrowable    => Failure(new ExecutionException("Boxed ControlThrowable", t))
    case t: InterruptedException                   => Failure(new ExecutionException("Boxed InterruptedException", t))
    case e: Error                                  => Failure(new ExecutionException("Boxed Error", e))
    case t                                         => Failure(t)
  }

   /**
    * Latch used to implement waiting on a DefaultPromise's result.
    *
    * Inspired by: http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
    * Written by Doug Lea with assistance from members of JCP JSR-166
    * Expert Group and released to the public domain, as explained at
    * http://creativecommons.org/publicdomain/zero/1.0/
    */
    private final class CompletionLatch[T] extends AbstractQueuedSynchronizer with (Try[T] => Unit) {
      override protected def tryAcquireShared(ignored: Int): Int = if (getState != 0) 1 else -1
      override protected def tryReleaseShared(ignore: Int): Boolean = {
        setState(1)
        true
      }
      override def apply(ignored: Try[T]): Unit = releaseShared(1)
    }

  /** Default promise implementation.
   *
   *  A DefaultPromise has three possible states. It can be:
   *
   *  1. Incomplete, with an associated list of callbacks waiting on completion.
   *  2. Complete, with a result.
   *  3. Linked to another DefaultPromise.
   *
   *  If a DefaultPromise is linked to another DefaultPromise, it will
   *  delegate all its operations to that other promise. This means that two
   *  DefaultPromises that are linked will appear, to external callers, to have
   *  exactly the same state and behaviour. For instance, both will appear as
   *  incomplete, or as complete with the same result value.
   *
   *  A DefaultPromise stores its state entirely in the AnyRef cell exposed by
   *  AtomicReference. The type of object stored in the cell fully describes the
   *  current state of the promise.
   *
   *  1. List[CallbackRunnable] - The promise is incomplete and has zero or more callbacks
   *     to call when it is eventually completed.
   *  2. Try[T] - The promise is complete and now contains its value.
   *  3. DefaultPromise[T] - The promise is linked to another promise.
   *
   * The ability to link DefaultPromises is needed to prevent memory leaks when
   * using Future.flatMap. The previous implementation of Future.flatMap used
   * onComplete handlers to propagate the ultimate value of a flatMap operation
   * to its promise. Recursive calls to flatMap built a chain of onComplete
   * handlers and promises. Unfortunately none of the handlers or promises in
   * the chain could be collected until the handlers had been called and
   * detached, which only happened when the final flatMap future was completed.
   * (In some situations, such as infinite streams, this would never actually
   * happen.) Because of the fact that the promise implementation internally
   * created references between promises, and these references were invisible to
   * user code, it was easy for user code to accidentally build large chains of
   * promises and thereby leak memory.
   *
   * The problem of leaks is solved by automatically breaking these chains of
   * promises, so that promises don't refer to each other in a long chain. This
   * allows each promise to be individually collected. The idea is to "flatten"
   * the chain of promises, so that instead of each promise pointing to its
   * neighbour, they instead point directly the promise at the root of the
   * chain. This means that only the root promise is referenced, and all the
   * other promises are available for garbage collection as soon as they're no
   * longer referenced by user code.
   *
   * To make the chains flattenable, the concept of linking promises together
   * needed to become an explicit feature of the DefaultPromise implementation,
   * so that the implementation to navigate and rewire links as needed. The idea
   * of linking promises is based on the [[Twitter promise implementation
   * https://github.com/twitter/util/blob/master/util-core/src/main/scala/com/twitter/util/Promise.scala]].
   *
   * In practice, flattening the chain cannot always be done perfectly. When a
   * promise is added to the end of the chain, it scans the chain and links
   * directly to the root promise. This prevents the chain from growing forwards
   * But the root promise for a chain can change, causing the chain to grow
   * backwards, and leaving all previously-linked promise pointing at a promise
   * which is no longer the root promise.
   *
   * To mitigate the problem of the root promise changing, whenever a promise's
   * methods are called, and it needs a reference to its root promise it calls
   * the `compressedRoot()` method. This method re-scans the promise chain to
   * get the root promise, and also compresses its links so that it links
   * directly to whatever the current root promise is. This ensures that the
   * chain is flattened whenever `compressedRoot()` is called. And since
   * `compressedRoot()` is called at every possible opportunity (when getting a
   * promise's value, when adding an onComplete handler, etc), this will happen
   * frequently. Unfortunately, even this eager relinking doesn't absolutely
   * guarantee that the chain will be flattened and that leaks cannot occur.
   * However eager relinking does greatly reduce the chance that leaks will
   * occur.
   *
   * Future.flatMap links DefaultPromises together by calling the `linkRootOf`
   * method. This is the only externally visible interface to linked
   * DefaultPromises, and `linkedRootOf` is currently only designed to be called
   * by Future.flatMap.
   */
  // Left non-final to enable addition of extra fields by Java/Scala converters
  // in scala-java8-compat.
  class DefaultPromise[T] extends AtomicReference[AnyRef](Nil) with Promise[T] {

    /** Get the root promise for this promise, compressing the link chain to that
     *  promise if necessary.
     *
     *  For promises that are not linked, the result of calling
     *  `compressedRoot()` will the promise itself. However for linked promises,
     *  this method will traverse each link until it locates the root promise at
     *  the base of the link chain.
     *
     *  As a side effect of calling this method, the link from this promise back
     *  to the root promise will be updated ("compressed") to point directly to
     *  the root promise. This allows intermediate promises in the link chain to
     *  be garbage collected. Also, subsequent calls to this method should be
     *  faster as the link chain will be shorter.
     */
    private def compressedRoot(): DefaultPromise[T] =
      get() match {
        case linked: DefaultPromise[_] => compressedRoot(linked)
        case _ => this
      }

    @tailrec
    private[this] final def compressedRoot(linked: DefaultPromise[_]): DefaultPromise[T] = {
      val target = linked.asInstanceOf[DefaultPromise[T]].root
      if (linked eq target) target
      else if (compareAndSet(linked, target)) target
      else {
        get() match {
          case newLinked: DefaultPromise[_] => compressedRoot(newLinked)
          case _ => this
        }
      }
    }

    /** Get the promise at the root of the chain of linked promises. Used by `compressedRoot()`.
     *  The `compressedRoot()` method should be called instead of this method, as it is important
     *  to compress the link chain whenever possible.
     */
    @tailrec
    private def root: DefaultPromise[T] =
      get() match {
        case linked: DefaultPromise[_] => linked.asInstanceOf[DefaultPromise[T]].root
        case _ => this
      }

    /** Try waiting for this promise to be completed.
     */
    protected final def tryAwait(atMost: Duration): Boolean = if (!isCompleted) {
      import Duration.Undefined
      atMost match {
        case e if e eq Undefined => throw new IllegalArgumentException("cannot wait for Undefined period")
        case Duration.Inf        =>
          val l = new CompletionLatch[T]()
          onComplete(l)(InternalCallbackExecutor)
          l.acquireSharedInterruptibly(1)
        case Duration.MinusInf   => // Drop out
        case f: FiniteDuration   =>
          if (f > Duration.Zero) {
            val l = new CompletionLatch[T]()
            onComplete(l)(InternalCallbackExecutor)
            l.tryAcquireSharedNanos(1, f.toNanos)
          }
      }

      isCompleted
    } else true // Already completed

    @throws(classOf[TimeoutException])
    @throws(classOf[InterruptedException])
    final def ready(atMost: Duration)(implicit permit: CanAwait): this.type =
      if (tryAwait(atMost)) this
      else throw new TimeoutException("Futures timed out after [" + atMost + "]")

    @throws(classOf[Exception])
    final def result(atMost: Duration)(implicit permit: CanAwait): T =
      ready(atMost).value.get.get // ready throws TimeoutException if timeout so value.get is safe here

    def value: Option[Try[T]] = value0

    @tailrec
    private def value0: Option[Try[T]] = get() match {
      case c: Try[_] => Some(c.asInstanceOf[Try[T]])
      case dp: DefaultPromise[_] => compressedRoot(dp).value0
      case _ => None
    }

    override final def isCompleted: Boolean = isCompleted0

    @tailrec
    private def isCompleted0: Boolean = get() match {
      case _: Try[_] => true
      case dp: DefaultPromise[_] => compressedRoot(dp).isCompleted0
      case _ => false
    }

    final def tryComplete(value: Try[T]): Boolean = {
      val resolved = resolveTry(value)
      tryCompleteAndGetListeners(resolved) match {
        case null             => false
        case rs if rs.isEmpty => true
        case rs               => rs.foreach(r => r.executeWithValue(resolved)); true
      }
    }

    /** Called by `tryComplete` to store the resolved value and get the list of
     *  listeners, or `null` if it is already completed.
     */
    @tailrec
    private def tryCompleteAndGetListeners(v: Try[T]): List[CallbackRunnable[T]] = {
      get() match {
        case raw: List[_] =>
          val cur = raw.asInstanceOf[List[CallbackRunnable[T]]]
          if (compareAndSet(cur, v)) cur else tryCompleteAndGetListeners(v)
        case dp: DefaultPromise[_] => compressedRoot(dp).tryCompleteAndGetListeners(v)
        case _ => null
      }
    }

    final def onComplete[U](func: Try[T] => U)(implicit executor: ExecutionContext): Unit =
      dispatchOrAddCallback(new CallbackRunnable[T](executor.prepare(), func))

    /** Tries to add the callback, if already completed, it dispatches the callback to be executed.
     *  Used by `onComplete()` to add callbacks to a promise and by `link()` to transfer callbacks
     *  to the root promise when linking two promises together.
     */
    @tailrec
    private def dispatchOrAddCallback(runnable: CallbackRunnable[T]): Unit = {
      get() match {
        case r: Try[_]          => runnable.executeWithValue(r.asInstanceOf[Try[T]])
        case dp: DefaultPromise[_] => compressedRoot(dp).dispatchOrAddCallback(runnable)
        case listeners: List[_] => if (compareAndSet(listeners, runnable :: listeners)) ()
                                   else dispatchOrAddCallback(runnable)
      }
    }

    /** Link this promise to the root of another promise using `link()`. Should only be
     *  be called by transformWith.
     */
    protected[concurrent] final def linkRootOf(target: DefaultPromise[T]): Unit = link(target.compressedRoot())

    /** Link this promise to another promise so that both promises share the same
     *  externally-visible state. Depending on the current state of this promise, this
     *  may involve different things. For example, any onComplete listeners will need
     *  to be transferred.
     *
     *  If this promise is already completed, then the same effect as linking -
     *  sharing the same completed value - is achieved by simply sending this
     *  promise's result to the target promise.
     */
    @tailrec
    private def link(target: DefaultPromise[T]): Unit = if (this ne target) {
      get() match {
        case r: Try[_] =>
          if (!target.tryComplete(r.asInstanceOf[Try[T]]))
            throw new IllegalStateException("Cannot link completed promises together")
        case dp: DefaultPromise[_] =>
          compressedRoot(dp).link(target)
        case listeners: List[_] if compareAndSet(listeners, target) =>
          if (listeners.nonEmpty)
            listeners.asInstanceOf[List[CallbackRunnable[T]]].foreach(target.dispatchOrAddCallback(_))
        case _ =>
          link(target)
      }
    }
  }

  /** An already completed Future is given its result at creation.
   *
   *  Useful in Future-composition when a value to contribute is already available.
   */
  object KeptPromise {
    import scala.concurrent.Future
    import scala.reflect.ClassTag

    private[this] sealed trait Kept[T] extends Promise[T] {
      def result: Try[T]

      override def value: Option[Try[T]] = Some(result)

      override def isCompleted: Boolean = true

      override def tryComplete(value: Try[T]): Boolean = false

      override def onComplete[U](func: Try[T] => U)(implicit executor: ExecutionContext): Unit =
        (new CallbackRunnable(executor.prepare(), func)).executeWithValue(result)

      override def ready(atMost: Duration)(implicit permit: CanAwait): this.type = this

      override def result(atMost: Duration)(implicit permit: CanAwait): T = result.get
    }

    private[this] final class Successful[T](val result: Success[T]) extends Kept[T] {
      override def onFailure[U](pf: PartialFunction[Throwable, U])(implicit executor: ExecutionContext): Unit = ()
      override def failed: Future[Throwable] = KeptPromise(Failure(new NoSuchElementException("Future.failed not completed with a throwable."))).future
      override def recover[U >: T](pf: PartialFunction[Throwable, U])(implicit executor: ExecutionContext): Future[U] = this
      override def recoverWith[U >: T](pf: PartialFunction[Throwable, Future[U]])(implicit executor: ExecutionContext): Future[U] = this
      override def fallbackTo[U >: T](that: Future[U]): Future[U] = this
    }

    private[this] final class Failed[T](val result: Failure[T]) extends Kept[T] {
      private[this] final def thisAs[S]: Future[S] = future.asInstanceOf[Future[S]]

      override def onSuccess[U](pf: PartialFunction[T, U])(implicit executor: ExecutionContext): Unit = ()
      override def failed: Future[Throwable] = KeptPromise(Success(result.exception)).future
      override def foreach[U](f: T => U)(implicit executor: ExecutionContext): Unit = ()
      override def map[S](f: T => S)(implicit executor: ExecutionContext): Future[S] = thisAs[S]
      override def flatMap[S](f: T => Future[S])(implicit executor: ExecutionContext): Future[S] = thisAs[S]
      override def flatten[S](implicit ev: T <:< Future[S]): Future[S] = thisAs[S]
      override def filter(p: T => Boolean)(implicit executor: ExecutionContext): Future[T] = this
      override def collect[S](pf: PartialFunction[T, S])(implicit executor: ExecutionContext): Future[S] = thisAs[S]
      override def zip[U](that: Future[U]): Future[(T, U)] = thisAs[(T,U)]
      override def zipWith[U, R](that: Future[U])(f: (T, U) => R)(implicit executor: ExecutionContext): Future[R] = thisAs[R]
      override def fallbackTo[U >: T](that: Future[U]): Future[U] =
        if (this eq that) this else that.recoverWith({ case _ => this })(InternalCallbackExecutor)
      override def mapTo[S](implicit tag: ClassTag[S]): Future[S] = thisAs[S]
    }

    def apply[T](result: Try[T]): scala.concurrent.Promise[T] =
      resolveTry(result) match {
        case s @ Success(_) => new Successful(s)
        case f @ Failure(_) => new Failed(f)
      }
  }

}


text:
var _ = require('lodash');

// We don't need to publish all of a doc's data to the app, that will
// add many kilobytes of loading overhead.
function publicDocData(doc, extraData) {
  doc = doc || {};
  return _.assign({
    name: doc.name,
    type: doc.docType,
    outputPath: doc.outputPath,
    url: doc.path,
    label: doc.label || doc.name
  }, extraData || {});
}

module.exports = function componentsGenerateProcessor(log, moduleMap) {
  return {
    $runAfter: ['paths-computed'],
    $runBefore: ['rendering-docs'],
    $process: process
  };

  function process(docs) {

    var components = _(docs)
      .filter(function(doc) {
        // We are not interested in docs that are not in a module
        // We are only interested in pages that are not landing pages
        return doc.docType !== 'componentGroup' && doc.module;
      })
      .filter('module')
      .groupBy('module')
      .map(function(moduleDocs, moduleName) {

        var moduleDoc = _.find(docs, {
          docType: 'module',
          name: moduleName
        });
        if (!moduleDoc) return;

        return publicDocData(moduleDoc, {
          docs: moduleDocs
            .filter(function(doc) {
              // Private isn't set to true, just to an empty string if @private is supplied
              return doc.docType !== 'module';
            })
            .map(publicDocData)
        });

      })
      .filter() //remove null items
      .value();

    docs.push({
      template: 'components-data.template.js',
      outputPath: 'js/components-data.js',
      components: components
    });

  }
};


text:
package org.ujorm.ujoservlet.ajax.ao;

import java.math.BigDecimal;

/**
 *
 * @author Pavel Ponec
 */
public class Hotel {

    private Long id;
    /** Name of the Hotel */
    private String name;
    /** Description of the hotel */
    private String note;
    /** Relation to the City address */
    private City city;
    /** Street of address */
    private String street;
    /** Phone */
    private String phone;
    /** Stars */
    private Float stars;
    /** URL to the HomePage */
    private String homePage;
    /** Price per night in USD */
    private BigDecimal price;
    /** Currency of the price */
    private String currency;
    /** Is active */
    private Boolean active;

    public String getCityName() {
        final City city = getCity();
        return city != null ? city.getName() : null;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

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

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public City getCity() {
        return city;
    }

    public void setCity(City city) {
        this.city = city;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Float getStars() {
        return stars;
    }

    public void setStars(Float stars) {
        this.stars = stars;
    }

    public String getHomePage() {
        return homePage;
    }

    public void setHomePage(String homePage) {
        this.homePage = homePage;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

}


text:
layout: default
title: Galleri
permalink: /galleri/
modal: all
image: galleri.jpg
---

{% include general/top-section.html %}

{% if site.data.[site.lang].galleri.galleri.showSessions %}
    {% include galleri/galleri-list.html %}
{% else %}
    {% include galleri/galleri-list-2.html %}
{% endif %}


text:
package com.google.android.gms.games.multiplayer.turnbased;

@Deprecated
public abstract interface OnTurnBasedMatchLoadedListener
{
  public abstract void onTurnBasedMatchLoaded(int paramInt, TurnBasedMatch paramTurnBasedMatch);
}

/* Location:           /Users/vikas/Documents/Mhacks_Real_app/classes-dex2jar.jar
 * Qualified Name:     com.google.android.gms.games.multiplayer.turnbased.OnTurnBasedMatchLoadedListener
 * JD-Core Version:    0.6.2
 */


text:
package server

import (
	"context"
	"encoding/json"
	"fmt"
	"net/http"
	"time"

	"github.com/jingweno/jqplay/config"
	"github.com/jingweno/jqplay/jq"
	"github.com/sirupsen/logrus"
	"gopkg.in/gin-gonic/gin.v1"
)

const (
	jqExecTimeout = 15 * time.Second
)

type JQHandlerContext struct {
	*config.Config
	JQ string
}

func (c *JQHandlerContext) Asset(path string) string {
	return fmt.Sprintf("%s/%s", c.AssetHost, path)
}

func (c *JQHandlerContext) ShouldInitJQ() bool {
	return c.JQ != ""
}

type JQHandler struct {
	DB     *DB
	Config *config.Config
}

func (h *JQHandler) handleIndex(c *gin.Context) {
	c.HTML(200, "index.tmpl", &JQHandlerContext{Config: h.Config})
}

func (h *JQHandler) handleJqPost(c *gin.Context) {
	var j *jq.JQ
	if err := c.BindJSON(&j); err != nil {
		err = fmt.Errorf("error parsing JSON: %s", err)
		h.logger(c).WithError(err).Info("error parsing JSON")
		c.String(http.StatusUnprocessableEntity, err.Error())
		return
	}

	ctx, cancel := context.WithTimeout(c.Request.Context(), jqExecTimeout)
	defer cancel()

	// Evaling into ResponseWriter sets the status code to 200
	// appending error message in the end if there's any
	if err := j.Eval(ctx, c.Writer); err != nil {
		fmt.Fprint(c.Writer, err.Error())
		h.logger(c).WithError(err).Info("jq error")
	}
}

func (h *JQHandler) handleJqGet(c *gin.Context) {
	jq := &jq.JQ{
		J: c.Query("j"),
		Q: c.Query("q"),
	}

	var jqData string
	if err := jq.Validate(); err == nil {
		d, err := json.Marshal(jq)
		if err == nil {
			jqData = string(d)
		}
	}

	c.HTML(http.StatusOK, "index.tmpl", &JQHandlerContext{Config: h.Config, JQ: jqData})
}

func (h *JQHandler) handleJqSharePost(c *gin.Context) {
	var jq *jq.JQ
	if err := c.BindJSON(&jq); err != nil {
		err = fmt.Errorf("error parsing JSON: %s", err)
		h.logger(c).WithError(err).Info("error parsing JSON")
		c.String(http.StatusUnprocessableEntity, err.Error())
		return
	}

	if err := jq.Validate(); err != nil {
		c.String(http.StatusUnprocessableEntity, err.Error())
		return
	}

	id, err := h.DB.UpsertSnippet(FromJQ(jq))
	if err != nil {
		h.logger(c).WithError(err).Info("error upserting snippet")
		c.String(http.StatusUnprocessableEntity, "error sharing snippet")
		return
	}

	c.String(http.StatusCreated, id)
}

func (h *JQHandler) handleJqShareGet(c *gin.Context) {
	id := c.Param("id")

	s, err := h.DB.GetSnippet(id)
	if err != nil {
		h.logger(c).WithError(err).WithField("id", id).Info("error getting snippet")
		c.Redirect(http.StatusFound, "/")
		return
	}

	var jqData string
	d, err := json.Marshal(ToJQ(s))
	if err == nil {
		jqData = string(d)
	}

	c.HTML(200, "index.tmpl", &JQHandlerContext{
		Config: h.Config,
		JQ:     jqData,
	})
}

func (h *JQHandler) logger(c *gin.Context) *logrus.Entry {
	l, _ := c.Get("logger")
	return l.(*logrus.Entry)
}

func shouldLogJQError(err error) bool {
	return err == jq.ExecTimeoutError || err == jq.ExecCancelledError
}


text:
/**
 *For Mao online; stores and accesses preferences about connection
 *Author: James Koppel
 *School: Lindbergh High School
 *Date: 3/18/09
 *Computer used: Sandro
 *IDE: JCreator LE v4.0
 */

 package mao.online;

 import mao.util.*;
 import java.io.*;
 import java.net.*;
 import javax.swing.JOptionPane;

 //Mastery aspects:
 //HL: Adding data to a RandomAccessFile, finding data from a RandomAccessFile,
 //    parsing a file
 //SL: 1,3,4,8,9,10,13

 public class Preferences
 {
 	//Maximum length of the name a player may have
 	public final static int MAX_NAME_LENGTH = 30;

 	//The default IP is stored in the file first
 	private final static int DEFAULT_IP = 0;
 	//The default name is stored in the file second
 	private final static int DEFAULT_NAME = 1;

 	//At which byte in the file the properties should begin
 	//The final number is the index of the end of the file
 	private final static int[] offsets = {0, 4, 34};

 	//The file in which prefences are stored
 	private static RandomAccessFile prefFile;

 	/*
 	 *Loads the preferences file. If it must be created or if it
 	 *was created with an older version that had less preferences,
 	 *then it initializesthe rest of the file to blank values
 	 */
 	static
 	{
 		try
 		{
 			prefFile = new RandomAccessFile("pref.dat","rwd");
 			/*
 			 *If file is too small
 			 */
 			if(prefFile.length() < offsets[offsets.length-1])
 			{
 				//Then initialize the rest of the file by zeroing it out.
 				prefFile.seek(prefFile.length());
 				for(int i =(int) prefFile.length(); i <
 										offsets[offsets.length-1]; i++)
 					prefFile.writeByte(0);
 			}
 		}
 		catch(IOException e)
 		{
 			fileError();
 		}
 	}

 	//Called signify there was an error with the file
 	private static void fileError()
 	{
 		JOptionPane.showMessageDialog(null,
 					"Error reading from or writing to preferences file.");
 		System.exit(0);
 	}

 	//In a general fashion, gets the property from the file
 	//with index prop
 	//Uses the offets field to know where and how long the
 	//property is stored
 	public static byte[] getProperty(int prop)
 	{
 		try
 		{
 			prefFile.seek(offsets[prop]);
 			int len = offsets[prop+1]-offsets[prop];
 			byte[] b = new byte[len];
 			prefFile.readFully(b, 0, len);
 			return b;
 		}
 		catch(IOException e)
 		{
 			fileError();
 			return null;
 		}
 	}

 	//In a general fashion, sets the property in the file
 	//with index prop
 	//Uses the offets field to know where and how long the
 	//property is stored
 	public static void setProperty(int prop, byte[] val)
 	{
 		try
 		{
 			prefFile.seek(offsets[prop]);
 			int len = offsets[prop+1]-offsets[prop];
 			if(val.length > len)
 				throw new IllegalArgumentException();
 			else if(val.length < len)
 			{
 				byte[] oldVal = val;
 				val = new byte[len];
 				System.arraycopy(oldVal,0,val,0,oldVal.length);
 			}
 			prefFile.write(val);
 		}
 		catch(IOException e)
 		{
 			fileError();
 		}
 	}

 	//Convenience method for getting the default IP from the file
 	public static InetAddress getDefaultIP()
 	{
 		byte[] b = getProperty(DEFAULT_IP);
 		try
 		{
 			return InetAddress.getByAddress(b);
 		}
 		catch(UnknownHostException e)
 		{
 			return null;
 		}
 	}

 	//Convenience method for setting the default IP in the file
 	public static void setDefaultIP(InetAddress ip)
 	{
 		setProperty(DEFAULT_IP, ip.getAddress());
 	}

 	//Convenience method for getting the default name from the file
 	//Name is stored as a C-style (null-terminated) string
 	public static String getDefaultName()
 	{
 		return new String(getProperty(DEFAULT_NAME)
 								).replace("\000","");
 	}

 	//Convenience method for setting the default name in the file
 	//Name is stored as a C-style (null-terminated) string
 	public static void setDefaultName(String name)
 	{
 		setProperty(DEFAULT_NAME, name.getBytes());
 	}
 }


text:
<?php namespace IPay88\Security\Exceptions;

class InvalidReferrerException extends \Exception
{
	protected $message = 'Invalid referrer';
}


text:
FROM fpco/stack-build:latest

RUN stack update

ADD ./hshort.cabal /app/hshort.cabal
WORKDIR /app

ADD . /app/
RUN stack build


text:
// This file was generated by jmlunit on Tue May 20 17:43:00 EDT 2008.

package org.jmlspecs.samples.misc;

/** Automatically-generated test driver for JML and JUnit based
 * testing of Meter. The superclass of this class should be edited
 * to supply test data. However it's best not to edit this class
 * directly; instead use the command
 * <pre>
 *  jmlunit Meter.java
 * </pre>
 * to regenerate this class whenever Meter.java changes.
 */
public class Meter_JML_Test
     extends Meter_JML_TestData
{
    /** Initialize this class. */
    public Meter_JML_Test(java.lang.String name) {
        super(name);
    }

    /** Run the tests. */
    public static void main(java.lang.String[] args) {
        org.jmlspecs.jmlunit.JMLTestRunner.run(suite());
        // You can also use a JUnit test runner such as:
        // junit.textui.TestRunner.run(suite());
    }

    /** Test to see if the code for class Meter
     * has been compiled with runtime assertion checking (i.e., by jmlc).
     * Code that is not compiled with jmlc would not make an effective test,
     * since no assertion checking would be done. */
    public void test$IsRACCompiled() {
        junit.framework.Assert.assertTrue("code for class Meter"
                + " was not compiled with jmlc"
                + " so no assertions will be checked!",
            org.jmlspecs.jmlrac.runtime.JMLChecker.isRACCompiled(Meter.class)
            );
    }

    /** Return the test suite for this test class.  This will have
    * added to it at least test$IsRACCompiled(), and any test methods
    * written explicitly by the user in the superclass.  It will also
    * have added test suites for each testing each method and
    * constructor.
    */
    //@ ensures \result != null;
    public static junit.framework.Test suite() {
        Meter_JML_Test testobj
            = new Meter_JML_Test("Meter_JML_Test");
        junit.framework.TestSuite testsuite = testobj.overallTestSuite();
        // Add instances of Test found by the reflection mechanism.
        testsuite.addTestSuite(Meter_JML_Test.class);
        testobj.addTestSuiteForEachMethod(testsuite);
        return testsuite;
    }

    /** A JUnit test object that can run a single test method.  This
     * is defined as a nested class solely for convenience; it can't
     * be defined once and for all because it must subclass its
     * enclosing class.
     */
    protected static abstract class OneTest extends Meter_JML_Test {

        /** Initialize this test object. */
        public OneTest(String name) {
            super(name);
        }

        /** The result object that holds information about testing. */
        protected junit.framework.TestResult result;

        //@ also
        //@ requires result != null;
        public void run(junit.framework.TestResult result) {
            this.result = result;
            super.run(result);
        }

        /* Run a single test and decide whether the test was
         * successful, meaningless, or a failure.  This is the
         * Template Method pattern abstraction of the inner loop in a
         * JML/JUnit test. */
        public void runTest() throws java.lang.Throwable {
            try {
                // The call being tested!
                doCall();
            }
            catch (org.jmlspecs.jmlrac.runtime.JMLEntryPreconditionError e) {
                // meaningless test input
                addMeaningless();
            } catch (org.jmlspecs.jmlrac.runtime.JMLAssertionError e) {
                // test failure
                int l = org.jmlspecs.jmlrac.runtime.JMLChecker.getLevel();
                org.jmlspecs.jmlrac.runtime.JMLChecker.setLevel
                    (org.jmlspecs.jmlrac.runtime.JMLOption.NONE);
                try {
                    java.lang.String failmsg = this.failMessage(e);
                    junit.framework.AssertionFailedError err
                        = new junit.framework.AssertionFailedError(failmsg);
                    err.setStackTrace(new java.lang.StackTraceElement[]{});
                    err.initCause(e);
                    result.addFailure(this, err);
                } finally {
                    org.jmlspecs.jmlrac.runtime.JMLChecker.setLevel(l);
                }
            } catch (java.lang.Throwable e) {
                // test success
            }
        }

        /** Call the method to be tested with the appropriate arguments. */
        protected abstract void doCall() throws java.lang.Throwable;

        /** Format the error message for a test failure, based on the
         * method's arguments. */
        protected abstract java.lang.String failMessage
            (org.jmlspecs.jmlrac.runtime.JMLAssertionError e);

        /** Inform listeners that a meaningless test was run. */
        private void addMeaningless() {
            if (result instanceof org.jmlspecs.jmlunit.JMLTestResult) {
                ((org.jmlspecs.jmlunit.JMLTestResult)result)
                    .addMeaningless(this);
            }
        }
    }

    /** Create the tests that are to be run for testing the class
     * Meter.  The framework will then run them.
     * @param overallTestSuite$ The suite accumulating all of the tests
     * for this driver class.
     */
    //@ requires overallTestSuite$ != null;
    public void addTestSuiteForEachMethod
        (junit.framework.TestSuite overallTestSuite$)
    {
        try {
            this.addTestSuiteFor$TestInc(overallTestSuite$);
        } catch (java.lang.Throwable ex) {
            overallTestSuite$.addTest
                (new org.jmlspecs.jmlunit.strategies.ConstructorFailed(ex));
        }
        try {
            this.addTestSuiteFor$TestValue(overallTestSuite$);
        } catch (java.lang.Throwable ex) {
            overallTestSuite$.addTest
                (new org.jmlspecs.jmlunit.strategies.ConstructorFailed(ex));
        }
        try {
            this.addTestSuiteFor$TestMeter(overallTestSuite$);
        } catch (java.lang.Throwable ex) {
            overallTestSuite$.addTest
                (new org.jmlspecs.jmlunit.strategies.ConstructorFailed(ex));
        }
    }

    /** Add tests for the inc method
     * to the overall test suite. */
    private void addTestSuiteFor$TestInc
        (junit.framework.TestSuite overallTestSuite$)
    {
        junit.framework.TestSuite methodTests$
            = this.emptyTestSuiteFor("inc");
        try {
            org.jmlspecs.jmlunit.strategies.IndefiniteIterator
                receivers$iter
                = new org.jmlspecs.jmlunit.strategies.NonNullIteratorDecorator
                    (this.vorg_jmlspecs_samples_misc_MeterIter("inc", 0));
            this.check_has_data
                (receivers$iter,
                 "new NonNullIteratorDecorator(this.vorg_jmlspecs_samples_misc_MeterIter(\"inc\", 0))");
            while (!receivers$iter.atEnd()) {
                final org.jmlspecs.samples.misc.Meter receiver$
                    = (org.jmlspecs.samples.misc.Meter) receivers$iter.get();
                methodTests$.addTest
                    (new TestInc(receiver$));
                receivers$iter.advance();
            }
        } catch (org.jmlspecs.jmlunit.strategies.TestSuiteFullException e$) {
            // methodTests$ doesn't want more tests
        }
        overallTestSuite$.addTest(methodTests$);
    }

    /** Test for the inc method. */
    protected static class TestInc extends OneTest {
        /** The receiver */
        private org.jmlspecs.samples.misc.Meter receiver$;

        /** Initialize this instance. */
        public TestInc(org.jmlspecs.samples.misc.Meter receiver$) {
            super("inc");
            this.receiver$ = receiver$;
        }

        protected void doCall() throws java.lang.Throwable {
            receiver$.inc();
        }

        protected java.lang.String failMessage
            (org.jmlspecs.jmlrac.runtime.JMLAssertionError e$)
        {
            java.lang.String msg = "\n\tMethod 'inc' applied to";
            msg += "\n\tReceiver: " + this.receiver$;
            return msg;
        }
    }

    /** Add tests for the value method
     * to the overall test suite. */
    private void addTestSuiteFor$TestValue
        (junit.framework.TestSuite overallTestSuite$)
    {
        junit.framework.TestSuite methodTests$
            = this.emptyTestSuiteFor("value");
        try {
            org.jmlspecs.jmlunit.strategies.IndefiniteIterator
                receivers$iter
                = new org.jmlspecs.jmlunit.strategies.NonNullIteratorDecorator
                    (this.vorg_jmlspecs_samples_misc_MeterIter("value", 0));
            this.check_has_data
                (receivers$iter,
                 "new NonNullIteratorDecorator(this.vorg_jmlspecs_samples_misc_MeterIter(\"value\", 0))");
            while (!receivers$iter.atEnd()) {
                final org.jmlspecs.samples.misc.Meter receiver$
                    = (org.jmlspecs.samples.misc.Meter) receivers$iter.get();
                methodTests$.addTest
                    (new TestValue(receiver$));
                receivers$iter.advance();
            }
        } catch (org.jmlspecs.jmlunit.strategies.TestSuiteFullException e$) {
            // methodTests$ doesn't want more tests
        }
        overallTestSuite$.addTest(methodTests$);
    }

    /** Test for the value method. */
    protected static class TestValue extends OneTest {
        /** The receiver */
        private org.jmlspecs.samples.misc.Meter receiver$;

        /** Initialize this instance. */
        public TestValue(org.jmlspecs.samples.misc.Meter receiver$) {
            super("value");
            this.receiver$ = receiver$;
        }

        protected void doCall() throws java.lang.Throwable {
            receiver$.value();
        }

        protected java.lang.String failMessage
            (org.jmlspecs.jmlrac.runtime.JMLAssertionError e$)
        {
            java.lang.String msg = "\n\tMethod 'value' applied to";
            msg += "\n\tReceiver: " + this.receiver$;
            return msg;
        }
    }

    /** Add tests for the Meter contructor
     * to the overall test suite. */
    private void addTestSuiteFor$TestMeter
        (junit.framework.TestSuite overallTestSuite$)
    {
        junit.framework.TestSuite methodTests$
            = this.emptyTestSuiteFor("Meter");
        try {
            methodTests$.addTest
                (new TestMeter());
        } catch (org.jmlspecs.jmlunit.strategies.TestSuiteFullException e$) {
            // methodTests$ doesn't want more tests
        }
        overallTestSuite$.addTest(methodTests$);
    }

    /** Test for the Meter contructor. */
    protected static class TestMeter extends OneTest {

        /** Initialize this instance. */
        public TestMeter() {
            super("Meter");
        }

        protected void doCall() throws java.lang.Throwable {
            new Meter();
        }

        protected java.lang.String failMessage
            (org.jmlspecs.jmlrac.runtime.JMLAssertionError e$)
        {
            java.lang.String msg = "\n\tContructor 'Meter'";
            return msg;
        }
    }

    /** Check that the iterator is non-null and not empty. */
    private void
    check_has_data(org.jmlspecs.jmlunit.strategies.IndefiniteIterator iter,
                   String call)
    {
        if (iter == null) {
            junit.framework.Assert.fail(call + " returned null");
        }
        if (iter.atEnd()) {
            junit.framework.Assert.fail(call + " returned an empty iterator");
        }
    }

    /** Converts a char to a printable String for display */
    public static String charToString(char c) {
        if (c == '\n') {
            return "NL";
        } else if (c == '\r') {
            return "CR";
        } else if (c == '\t') {
            return "TAB";
        } else if (Character.isISOControl(c)) {
            int i = (int)c;
            return "\\u"
                    + Character.forDigit((i/2048)%16,16)
                    + Character.forDigit((i/256)%16,16)
                    + Character.forDigit((i/16)%16,16)
                    + Character.forDigit((i)%16,16);
        }
        return Character.toString(c);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;

namespace ClassLibrary1
{
    public interface IID
    {
         Int32 ID { get; set; }

    }
}