text:
#ifndef __GPORT__H
#define __GPORT__H
#include "maxheap.h"

class GPort: public MaxHeapOperators {
	public:
		// get the palette index associated with the ith slot
		virtual int AnimPalIndex(int i)=0;

		// returns a slot number if available, -1 if not:
		// typically called in WM_INITDIALOG processing for as
		// may slots as you need (total availible is 8)
		virtual int GetAnimPalSlot()=0;

		// Release an animated palete slot slot
		// Typically called in WM_DESTROY for each slot
		// obtained with GetAnimPalSlot
		virtual void ReleaseAnimPalSlot(int i)=0;

		// set the color associated with the ith animated slot
		virtual void SetAnimPalEntry(int i, COLORREF cr)=0;

		// Stuff the standard MAX palette the palette for the HDC,
		// handing back a handle to the old palette.
		virtual HPALETTE PlugPalette(HDC hdc)=0;

		// Create a brush for drawing with the ith animated palette slot color
		virtual HBRUSH MakeAnimBrush(int slotNum, COLORREF col )=0;

		// Update colors calls the Windows UpdateColors on the hdc.
		// Returns 1 iff it changed screen pixel values .
	 	// Call this when get WM_PALETTECHANGED Msg
		virtual int UpdateColors(HDC hdc)=0;

		// After several SetAnimPalEntry calls, call this to affect the
		// HDC's palette
		virtual void AnimPalette(HDC hdc)=0;

		// The companion function to PlugPalette.
		virtual void RestorePalette(HDC hDC,HPALETTE hOldPal)=0;

		// Map an single row of pixels 24 bit color to indices into
		// the current GPort palette, applying a dither pattern.
		// This routine does NOT do gamma correction.
		// inp points to an array of width RGB triples.
		// outp is an array of width bytes.  x and y are necessary to
		// establish dither pattern alignment.
		virtual void MapPixels(UBYTE* inp, UBYTE *outp, int x, int y, int width)=0;

		// Display an array of 24bit colors in the HDC: if the current display is 8 bit
		//  it will display it (with dither) using in the GPort palette, otherwise it
		//  will just blit to the screen. Does NOT do gamma correction.
		//   "drect" is the destination rectangle in the hdc.
		//   "map" points to an array of RGB triples, with bytesPerRow bytes on each scanline.
		//   "xsrc" and "ysrc" are the position within this source raster of the upper left
		//    corner of the rectangle to be copied..
		virtual void DisplayMap(HDC hdc, Rect& drect,int xsrc, int ysrc, UBYTE *map, int bytesPerRow)=0;

		// This version stretches the image (if src!=dest).
		//  "dest" is the destination rectangle in the hdc;
		//  "src" is the source rectangle in map.
		virtual void DisplayMap(HDC hdc, Rect& dest, Rect& src, UBYTE *map, int bytesPerRow)=0;

		// DitherColorSwatch first gamma corrects Color c using the current
		// display gamma. In paletted modes, it will fill rectangle "r" with
		// a dithered pattern  approximating Color c.  In 24 bit modes it just
		// fills the rectange with c.
		virtual void DitherColorSwatch(HDC hdc, Rect& r, Color c)=0;

		// This attempts to use the animated color slot indicated by "slot"
		// to paint a rectangular color swatch.
		// If slot is -1, it will uses DitherColorSwatch.  It does gamma correction.
		virtual void PaintAnimPalSwatch(HDC hdc, DWORD col, int slot, int left, int top, int right, int bottom)=0;

		// get the current GPort palette.
		virtual HPALETTE GetPalette()=0;
	};

// Normally this is the only one of these, and this gets you a pointer to it.
extern CoreExport GPort* GetGPort();

#endif // __GPORT__H


text:
using OpenMetaverse;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading;
using log4net;
using pCampBot.Interfaces;

namespace pCampBot
{
    /// <summary>
    /// This behavior is for the systematic study of some performance improvements made
    /// for OSCC'13.
    /// Walk around, sending AgentUpdate packets all the time.
    /// </summary>
    public class PhysicsBehaviour2 : AbstractBehaviour
    {
//        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

        public PhysicsBehaviour2()
        {
            AbbreviatedName = "ph2";
            Name = "Physics2";
        }

        private const int TIME_WALKING = 5 * 10; // 5 seconds
        private int counter = 0;

        public override void Action()
        {

            if (counter >= TIME_WALKING)
            {
                counter = 0;

                Vector3 target = new Vector3(Bot.Random.Next(1, 254), Bot.Random.Next(1, 254), Bot.Client.Self.SimPosition.Z);
                MyTurnToward(target);

                Bot.Client.Self.Movement.AtPos = true;

            }
            else
                counter++;
            // In any case, send an update
            Bot.Client.Self.Movement.SendUpdate();
        }

        private void MyTurnToward(Vector3 target)
        {
            Quaternion between = Vector3.RotationBetween(Vector3.UnitX, Vector3.Normalize(target - Bot.Client.Self.SimPosition));
            Quaternion rot = between ;

            Bot.Client.Self.Movement.BodyRotation = rot;
            Bot.Client.Self.Movement.HeadRotation = rot;
            Bot.Client.Self.Movement.Camera.LookAt(Bot.Client.Self.SimPosition, target);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
class SkyInfoDefinition
{
private:
	std::vector<SkyLandDefinition> lands;
	std::vector<SkyAirDefinition> airs;
	std::vector<SkyStarDefinition> stars;
	std::vector<SkySunDefinition> suns;
	std::vector<SkyMoonDefinition> moons;

	// Not referenced by SkyDefinition since lightning bolts are generated at random placements.
	std::vector<SkyLightningDefinition> lightnings;
public:
	const SkyLandDefinition &getLand(SkyDefinition::LandDefID id) const;
	const SkyAirDefinition &getAir(SkyDefinition::AirDefID id) const;
	const SkyStarDefinition &getStar(SkyDefinition::StarDefID id) const;
	const SkySunDefinition &getSun(SkyDefinition::SunDefID id) const;
	const SkyMoonDefinition &getMoon(SkyDefinition::MoonDefID id) const;

	int getLightningCount() const;
	const SkyLightningDefinition &getLightning(int index) const;

	SkyDefinition::LandDefID addLand(SkyLandDefinition &&def);
	SkyDefinition::AirDefID addAir(SkyAirDefinition &&def);
	SkyDefinition::StarDefID addStar(SkyStarDefinition &&def);
	SkyDefinition::SunDefID addSun(SkySunDefinition &&def);
	SkyDefinition::MoonDefID addMoon(SkyMoonDefinition &&def);
	void addLightning(SkyLightningDefinition &&def);
};

#endif


text:
`Home <index.html>`_ Installation and Operations Manual

===============================
Install Infrastructure Services
===============================

.. contents::
    :backlinks: none
    :local:

First execute basic states on all nodes to ensure Salt minion, system and
OpenSSH are set up.

.. code-block:: bash

   salt '*' state.sls linux,salt,openssh,ntp

Support infrastructure deployment
---------------------------------

Metering node is deployed by running highstate:

.. code-block:: bash

   salt 'mtr*' state.highstate

On monitoring node, git needs to be setup first:

.. code-block:: bash

   salt 'mon*' state.sls git
   salt 'mon*' state.highstate

--------------

.. include:: navigation.txt


text:
namespace chainerx {
namespace native {
namespace native_internal {

Array Im2Col(
        const Array& x,
        const StackVector<int64_t, kMaxNdim>& kernel_size,
        const StackVector<int64_t, kMaxNdim>& stride,
        const StackVector<int64_t, kMaxNdim>& pad,
        bool cover_all,
        Scalar pad_value = 0);

}  // namespace native_internal
}  // namespace native
}  // namespace chainerx


text:
package com.tle.web.sections.js.generic.function;

import com.tle.annotation.NonNullByDefault;
import com.tle.annotation.Nullable;
import com.tle.web.sections.events.RenderContext;
import com.tle.web.sections.js.JSExpression;
import com.tle.web.sections.js.JSStatements;

@NonNullByDefault
public interface FunctionDefinition {
  String getFunctionName(@Nullable RenderContext context);

  JSStatements createFunctionBody(@Nullable RenderContext context, JSExpression[] params);

  @Nullable
  JSExpression[] getFunctionParams(@Nullable RenderContext context);
}


text:
#ifndef MITKSCALARBAROVERLAY_H_HEADER_INCLUDED_C10DC4EB
#define MITKSCALARBAROVERLAY_H_HEADER_INCLUDED_C10DC4EB

#include <MitkQtOverlaysExports.h>

// MITK-Stuff
#include "QmitkOverlay.h"
#include "mitkCommon.h"
#include "mitkPropertyList.h"
#include <QmitkScalarBar.h>

/** \class  QmitkScalarBarOverlay
* \brief object representing a text that is drawn as an overlay
*
* \ingroup Qmitk
*/

class MITKQTOVERLAYS_EXPORT QmitkScalarBarOverlay : public QmitkOverlay
{
  Q_OBJECT

public:
  /**
  * @brief Default Constructor
  **/
  QmitkScalarBarOverlay(const char *id);

  /**
  * @brief Default Destructor
  **/
  virtual ~QmitkScalarBarOverlay();

  /**
  * \brief Setup the QLabel with overlay specific information
  *
  * First, this method sets text-overlay specific properties as described in the class docu above.
  * Secondly, the actual text of the label is set.
  *
  * \WARNING No error will be issued if the property containing the text is not found, the TextOverlay
  * will show an empty string!
  */
  virtual void GenerateData(mitk::PropertyList::Pointer) override;

  QSize GetNeededSize() override;

protected:
  /**
  * \brief internal helper class to determine text-properties
  *
  * This method is only used internally to apply the text specific properties that can be set
  * using a mitk::PropertyList. If a property cannot be found, a default value is used.
  *
  * The values of these properties are then attributed to the label using QFont and QPalette.
  */
  void GetProperties(mitk::PropertyList::Pointer);

  void SetupCallback(mitk::BaseProperty::Pointer prop);

  void SetScaleFactor();
  /** \brief QWidget internally representing the TextOverlay */
  QmitkScalarBar *m_ScalarBar;

  mitk::BaseProperty::Pointer m_ObservedProperty;

  mitk::PropertyList::Pointer m_PropertyList;
  unsigned long m_ObserverTag;
};

#endif /* MITKSCALARBAROVERLAY_H_HEADER_INCLUDED_C10DC4EB */


text:
class CFWL_MessageMouse;
class CFWL_Widget;

class CFWL_MonthCalendar : public CFWL_Widget {
 public:
  CFWL_MonthCalendar(const CFWL_App* app,
                     std::unique_ptr<CFWL_WidgetProperties> properties,
                     CFWL_Widget* pOuter);
  ~CFWL_MonthCalendar() override;

  // FWL_WidgetImp
  FWL_Type GetClassID() const override;
  CFX_RectF GetAutosizedWidgetRect() override;
  void Update() override;
  void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override;
  void OnProcessMessage(CFWL_Message* pMessage) override;
  void OnDrawWidget(CFX_Graphics* pGraphics,
                    const CFX_Matrix* pMatrix) override;

  void SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay);

 private:
  struct DATE {
    DATE() : iYear(0), iMonth(0), iDay(0) {}

    DATE(int32_t year, int32_t month, int32_t day)
        : iYear(year), iMonth(month), iDay(day) {}

    bool operator<(const DATE& right) {
      if (iYear < right.iYear)
        return true;
      if (iYear == right.iYear) {
        if (iMonth < right.iMonth)
          return true;
        if (iMonth == right.iMonth)
          return iDay < right.iDay;
      }
      return false;
    }

    bool operator>(const DATE& right) {
      if (iYear > right.iYear)
        return true;
      if (iYear == right.iYear) {
        if (iMonth > right.iMonth)
          return true;
        if (iMonth == right.iMonth)
          return iDay > right.iDay;
      }
      return false;
    }

    int32_t iYear;
    int32_t iMonth;
    int32_t iDay;
  };
  struct DATEINFO {
    DATEINFO(int32_t day,
             int32_t dayofweek,
             uint32_t dwSt,
             CFX_RectF rc,
             CFX_WideString& wsday);
    ~DATEINFO();

    int32_t iDay;
    int32_t iDayOfWeek;
    uint32_t dwStates;
    CFX_RectF rect;
    CFX_WideString wsDay;
  };

  void DrawBackground(CFX_Graphics* pGraphics,
                      IFWL_ThemeProvider* pTheme,
                      const CFX_Matrix* pMatrix);
  void DrawHeadBK(CFX_Graphics* pGraphics,
                  IFWL_ThemeProvider* pTheme,
                  const CFX_Matrix* pMatrix);
  void DrawLButton(CFX_Graphics* pGraphics,
                   IFWL_ThemeProvider* pTheme,
                   const CFX_Matrix* pMatrix);
  void DrawRButton(CFX_Graphics* pGraphics,
                   IFWL_ThemeProvider* pTheme,
                   const CFX_Matrix* pMatrix);
  void DrawCaption(CFX_Graphics* pGraphics,
                   IFWL_ThemeProvider* pTheme,
                   const CFX_Matrix* pMatrix);
  void DrawSeperator(CFX_Graphics* pGraphics,
                     IFWL_ThemeProvider* pTheme,
                     const CFX_Matrix* pMatrix);
  void DrawDatesInBK(CFX_Graphics* pGraphics,
                     IFWL_ThemeProvider* pTheme,
                     const CFX_Matrix* pMatrix);
  void DrawWeek(CFX_Graphics* pGraphics,
                IFWL_ThemeProvider* pTheme,
                const CFX_Matrix* pMatrix);
  void DrawToday(CFX_Graphics* pGraphics,
                 IFWL_ThemeProvider* pTheme,
                 const CFX_Matrix* pMatrix);
  void DrawDatesIn(CFX_Graphics* pGraphics,
                   IFWL_ThemeProvider* pTheme,
                   const CFX_Matrix* pMatrix);
  void DrawDatesOut(CFX_Graphics* pGraphics,
                    IFWL_ThemeProvider* pTheme,
                    const CFX_Matrix* pMatrix);
  void DrawDatesInCircle(CFX_Graphics* pGraphics,
                         IFWL_ThemeProvider* pTheme,
                         const CFX_Matrix* pMatrix);
  CFX_SizeF CalcSize();
  void Layout();
  void CalcHeadSize();
  void CalcTodaySize();
  void CalDateItem();
  void GetCapValue();
  void InitDate();
  void ClearDateItem();
  void ResetDateItem();
  void NextMonth();
  void PrevMonth();
  void ChangeToMonth(int32_t iYear, int32_t iMonth);
  void RemoveSelDay();
  void AddSelDay(int32_t iDay);
  void JumpToToday();
  CFX_WideString GetHeadText(int32_t iYear, int32_t iMonth);
  CFX_WideString GetTodayText(int32_t iYear, int32_t iMonth, int32_t iDay);
  int32_t GetDayAtPoint(const CFX_PointF& point) const;
  CFX_RectF GetDayRect(int32_t iDay);
  void OnLButtonDown(CFWL_MessageMouse* pMsg);
  void OnLButtonUp(CFWL_MessageMouse* pMsg);
  void DisForm_OnLButtonUp(CFWL_MessageMouse* pMsg);
  void OnMouseMove(CFWL_MessageMouse* pMsg);
  void OnMouseLeave(CFWL_MessageMouse* pMsg);

  bool m_bInitialized;
  CFX_RectF m_rtHead;
  CFX_RectF m_rtWeek;
  CFX_RectF m_rtLBtn;
  CFX_RectF m_rtRBtn;
  CFX_RectF m_rtDates;
  CFX_RectF m_rtHSep;
  CFX_RectF m_rtHeadText;
  CFX_RectF m_rtToday;
  CFX_RectF m_rtTodayFlag;
  CFX_RectF m_rtWeekNum;
  CFX_RectF m_rtWeekNumSep;
  CFX_WideString m_wsHead;
  CFX_WideString m_wsToday;
  std::unique_ptr<CFX_DateTime> m_pDateTime;
  std::vector<std::unique_ptr<DATEINFO>> m_arrDates;
  int32_t m_iCurYear;
  int32_t m_iCurMonth;
  int32_t m_iYear;
  int32_t m_iMonth;
  int32_t m_iDay;
  int32_t m_iHovered;
  int32_t m_iLBtnPartStates;
  int32_t m_iRBtnPartStates;
  DATE m_dtMin;
  DATE m_dtMax;
  CFX_SizeF m_szHead;
  CFX_SizeF m_szCell;
  CFX_SizeF m_szToday;
  std::vector<int32_t> m_arrSelDays;
  CFX_RectF m_rtClient;
  bool m_bFlag;
};

#endif  // XFA_FWL_CFWL_MONTHCALENDAR_H_


text:
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { HomePage } from '../pages/home/home';

@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  rootPage:any = HomePage;

  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      statusBar.styleDefault();
      splashScreen.hide();
    });
  }
  // I log Clipboard "copy" errors.
    public logError( error: Error ) : void {

        console.group( "Clipboard Error" );
        console.error( error );
        console.groupEnd();

    }

    // I log Clipboard "copy" successes.
    public logSuccess( value: string ) : void {

        console.group( "Clipboard Success" );
        console.log( value );
        console.groupEnd();

    }
}


text:
import * as React from "react";
import { Widget, WidgetHeader, FallbackImg, WidgetBody } from "../../ui/index";

import { ToolTips } from "../../constants";
import { WebcamPanelProps } from "./interfaces";
import { PLACEHOLDER_FARMBOT } from "../../farmware/images/image_flipper";
import { Flipper } from "./flipper";
import { sortedFeeds } from "./edit";
import { t } from "../../i18next_wrapper";

type State = {
  /** Current index in the webcam feed list.
   *
   * We might need to move this in to Redux and use a UUID instead of an index,
   * depending on user needs.
   */
  current: number;
};

const FALLBACK_FEED = { name: "", url: PLACEHOLDER_FARMBOT };

export function IndexIndicator(props: { i: number, total: number }): JSX.Element {
  const percentWidth = 100 / props.total;
  return props.total > 1 ? <div
    className="index-indicator"
    style={{
      width: `${percentWidth}%`,
      left: `calc(-10px + ${props.i} * ${percentWidth}%)`
    }} /> :
;
}

export class Show extends React.Component<WebcamPanelProps, State> {
  NO_FEED = t(`No webcams yet. Click the edit button to add a feed URL.`);
  PLACEHOLDER_FEED = t(`Click the edit button to add or edit a feed URL.`);

  getMessage(currentUrl: string) {
    if (this.props.feeds.length) {
      if (currentUrl.includes(PLACEHOLDER_FARMBOT)) {
        return this.PLACEHOLDER_FEED;
      } else {
        return "";
      }
    } else {
      return this.NO_FEED;
    }
  }

  state: State = { current: 0 };

  render() {
    const { props } = this;
    const feeds = sortedFeeds(this.props.feeds).map(x => x.body);
    const flipper = new Flipper(feeds, FALLBACK_FEED, this.state.current);
    const title = flipper.current.name || t("Webcam Feeds");
    const msg = this.getMessage(flipper.current.url);
    const imageClass = msg.length > 0 ? "no-flipper-image-container" : "";
    return <Widget className="webcam-widget">
      <WidgetHeader title={title} helpText={ToolTips.WEBCAM}>
        <button
          className="fb-button gray"
          onClick={props.onToggle}>
          {t("Edit")}
        </button>
        <IndexIndicator i={this.state.current} total={feeds.length} />
      </WidgetHeader>
      <WidgetBody>

{msg}

            <FallbackImg className="image-flipper-image"
              src={flipper.current.url}
              fallback={PLACEHOLDER_FARMBOT} />

          <button
            onClick={() => flipper.down((_, current) => this.setState({ current }))}
            hidden={feeds.length < 2}
            disabled={false}
            className="image-flipper-left fb-button">
            {t("Prev")}
          </button>
          <button
            onClick={() => flipper.up((_, current) => this.setState({ current }))}
            hidden={feeds.length < 2}
            disabled={false}
            className="image-flipper-right fb-button">
            {t("Next")}
          </button>

      </WidgetBody>
    </Widget>;
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Credentials (HttpComponents Client 4.1.3 API)
</TITLE>

<META NAME="keywords" CONTENT="org.apache.http.auth.Credentials interface">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.http.auth

Interface Credentials

All Known Implementing Classes:
NTCredentials, UsernamePasswordCredentials

public interface Credentials

This interface represents a set of credentials consisting of a security
 principal and a secret (password) that can be used to establish user
 identity

Since:

4.0

Method Summary

 String
getPassword()

 Principal
getUserPrincipal()

Method Detail

getUserPrincipal

Principal getUserPrincipal()

getPassword

String getPassword()

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2012 The Apache Software Foundation. All Rights Reserved.


text:
<?php

namespace Callingallpapers\Parser;

use DOMNode;
use Callingallpapers\Entity\Cfp;

interface EventParserInterface
{
    public function parseEvent(DOMNode $node) : Cfp;
}


text:
layout: post
title:  "CSV and ActiveRecord"
date:   2017-09-11 22:44:55 +0000
---

I might be working with CSV (comma seperated values) files soon. I think that I might have to load the data from those files into an SQL database so that I can access the information using a Ruby on Rails backend. I am a little out of my depth but from the Google searches I have made so far it seems that I am not the first person to try to do this. I would like to write a React front end that uses the backend as an API so that the data will become available remotely. It is all very interesting and I am sure Iwill learn a lot as I go.


text:
package server;

import com.github.seratch.signedrequest4j.HttpMethod;
import org.eclipse.jetty.server.Request;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class DeleteHandler extends BasicHandler {

	@Override
	public void handle(String target,
	                   Request baseRequest,
	                   HttpServletRequest request,
	                   HttpServletResponse response) {
		try {
			_handle(request.getMethod() == HttpMethod.DELETE.name(), HttpMethod.DELETE, baseRequest, request, response);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

}


text:
module ThreeScaleToolbox
  module Commands
    module PlansCommand
      module Import
        class ImportBackendMetricsStep
          include Step
          ##
          # Writes Plan metrics and methods
          def call
            resource_backend_metrics.each(&method(:create_metric))
            resource_backend_methods.each(&method(:create_method))
          end

          private

          def create_metric(metric_attrs)
            backend = find_backend(metric_attrs.fetch('backend_system_name'))

            unless backend.metrics.any? { |m| m.system_name == metric_attrs.fetch('system_name') }
              Entities::BackendMetric.create(backend: backend, attrs: metric_attrs)
              puts "Created backend metric: #{metric_attrs.fetch('system_name')}; backend: #{backend.system_name}"
            end
          end

          def create_method(method_attrs)
            backend = find_backend(method_attrs.fetch('backend_system_name'))

            unless backend.methods.any? { |m| m.system_name == method_attrs.fetch('system_name') }
              Entities::BackendMethod.create(backend: backend, attrs: method_attrs)
              puts "Created backend method: #{method_attrs.fetch('system_name')}; backend: #{backend.system_name}"
            end
          end
        end
      end
    end
  end
end


text:
if [ "$#" == 0 ] ; then
	echo Needs an argument: clean, edit, submit.
	exit 0
fi

# usage: call doit.sh directly from the shell, giving
# an argument
#   	clean -- to clean the directories of junk.
#	edit  -- where sed does the magic.
#       submit -- submit to the que.

# if you don't run this script from the directory
# containing the windows, this next line won't produce
# the right value. double check to make sure it
# produces the NC bond length, e.g. 3.4, 3.45, etc.
localdir=$PWD
constant_list="$( seq -w 1.00 0.05 2.30 )"
window_list="0.95-1.95 1.95-2.95"

for constant in ${constant_list} ; do
	cd ch_${constant} || exit 1
	for window in ${window_list}; do
		cd nh_${window} || exit 2
		case "$1" in
			submit | s)
				q -i win*.csh | tee -a ../jobs.txt
				;;
			clean | c )
				rm -r *.gz log *.csh.* images &> /dev/null
				;;

			edit | e )
				;;

			*)
				exit 0
				;;

		esac
		cd ..
	done
	cd ..
done

exit 0


text:
%% $Date: 2012-07-06 17:42:54#$
%% $Revision: 152 $
\index{planck\_emission}
\algdesc{Planck Emission}
{ %%%%%% Algorithm name %%%%%%
planck\_emission
}
{ %%%%%% Algorithm summary %%%%%%
Calculates the Planck emission of a surface at a given wavelength given its temperature.
}
{ %%%%%% Category %%%%%%
Radiation
}
{ %%%%%% Inputs %%%%%%
$T$ & Vector & Temperature [K] \\
$\lambda$ & Coeff & Wavelength [nm] \\
}
{ %%%%%% Outputs %%%%%%
$rad$ & Vector & Black body radiance [W m-2 sr-1 nm-1] \\
}
{ %%%%%% Formula %%%%%%
After converting $\lambda$ to meters, the radiance is calculated by:
%
\begin{displaymath}
rad = \frac{2 h c^2}{\lambda^5 (\exp(\frac{h c}{k_B \lambda T}) - 1)} * 10^{-9}
\end{displaymath}

where $c$ is the speed of light in m/s, $h$ is the Planck constant in J s and $k_B$ is the Boltzmann
constant in J/K.

}
{ %%%%%% Author %%%%%%
Andre Ehrlich, Leipzig Institute for Meteorology (a.ehrlich@uni-leipzig.de)
}
{ %%%%%% References %%%%%%

}


text:
package io.github.froger.instamaterial.ui.activity;

import android.annotation.SuppressLint;
import android.app.FragmentTransaction;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.os.Handler;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;

import com.parse.Parse;
import com.parse.ParseFacebookUtils;
import com.parse.ParseObject;
import com.parse.ParseUser;

import io.github.froger.instamaterial.R;
import io.github.froger.instamaterial.ui.parse_backend.Activity;
import io.github.froger.instamaterial.ui.parse_backend.Category;
import io.github.froger.instamaterial.ui.parse_backend.Comment;
import io.github.froger.instamaterial.ui.parse_backend.Like;
import io.github.froger.instamaterial.ui.parse_backend.Photo;
import io.github.froger.instamaterial.ui.parse_backend.Question;
import io.github.froger.instamaterial.ui.parse_backend.QuestionOption;
import io.github.froger.instamaterial.ui.parse_backend.Tags;

/**
 * Created by ankit on 13/4/16.
 */
public class FreshStart extends AppCompatActivity {

    private static final boolean AUTO_HIDE = true;
    private static final int AUTO_HIDE_DELAY_MILLIS = 3000;
    private static final int UI_ANIMATION_DELAY = 300;
    private final Handler mHideHandler = new Handler();
    private ViewPager mViewPager;
    private View mContentView;
    private final Runnable mHidePart2Runnable = new Runnable() {
        @SuppressLint("InlinedApi")
        @Override
        public void run() {
            mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE
                    | View.SYSTEM_UI_FLAG_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
        }
    };
    public enum SwipeDirection {
        all, left, right, none ;
    }

    private View mControlsView;
    private final Runnable mShowPart2Runnable = new Runnable() {
        @Override
        public void run() {
            // Delayed display of UI elements
            ActionBar actionBar = getSupportActionBar();
            if (actionBar != null) {
                actionBar.show();
            }
            mControlsView.setVisibility(View.VISIBLE);
        }
    };
    private boolean mVisible;
    private final Runnable mHideRunnable = new Runnable() {
        @Override
        public void run() {
            hide();
        }
    };
    private final View.OnTouchListener mDelayHideTouchListener = new View.OnTouchListener() {
        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            if (AUTO_HIDE) {
                delayedHide(AUTO_HIDE_DELAY_MILLIS);
            }
            return false;
        }
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_login);
        ParseObject.registerSubclass(Activity.class);
        ParseObject.registerSubclass(Comment.class);
        ParseObject.registerSubclass(Like.class);
        ParseObject.registerSubclass(Photo.class);
        ParseObject.registerSubclass(Question.class);
        ParseObject.registerSubclass(QuestionOption.class);
        ParseObject.registerSubclass(Category.class);
        ParseObject.registerSubclass(Tags.class);
        Parse.enableLocalDatastore(this);
        Parse.initialize(this);
        ParseFacebookUtils.initialize(getApplicationContext());
        mViewPager = (ViewPager) findViewById(R.id.LoginPager);
        FragmentManager frm = getSupportFragmentManager();
        mViewPager.setAdapter(new SectionsPagerAdapter(frm));

        mVisible = true;
        mContentView = findViewById(R.id.LoginContent);
    }

    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        delayedHide(100);
    }

    private void toggle() {
        if (mVisible) {
            hide();
        } else {
            show();
        }
    }
    private void hide() {
        // Hide UI first
        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.hide();
        }
        //mControlsView.setVisibility(View.GONE);
        mVisible = false;

        // Schedule a runnable to remove the status and navigation bar after a delay
        mHideHandler.removeCallbacks(mShowPart2Runnable);
        mHideHandler.postDelayed(mHidePart2Runnable, UI_ANIMATION_DELAY);
    }

    @SuppressLint("InlinedApi")
    private void show() {
        mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
        mVisible = true;

        mHideHandler.removeCallbacks(mHidePart2Runnable);
        mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);
    }

    private void delayedHide(int delayMillis) {
        mHideHandler.removeCallbacks(mHideRunnable);
        mHideHandler.postDelayed(mHideRunnable, delayMillis);
    }

    public class SectionsPagerAdapter extends FragmentPagerAdapter {

        public SectionsPagerAdapter(FragmentManager fm) {
            super(fm);
        }
        @Override
        public Fragment getItem(int position) {
            Fragment fr = null;
            switch (position) {
                case 0:
                    fr = new FreshStartFragment();
                    break;
            }
            return fr;
        }

        @Override
        public int getCount() {
            return 1;
        }
    }
    protected void setFragment(Fragment fragment) {
        FragmentManager fragmentManager = getSupportFragmentManager();
        android.support.v4.app.FragmentTransaction fragmentTransaction =
                fragmentManager.beginTransaction();
        fragmentTransaction.replace(android.R.id.content, fragment);
        fragmentTransaction.commit();
    }
    @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        ParseFacebookUtils.onActivityResult(requestCode, resultCode, data);
    }

}


text:
package serene.restrictor;

import java.util.ArrayList;
import java.util.Stack;
import java.util.Map;
import java.util.HashMap;

import serene.util.BooleanStack;
import serene.util.IntList;

import serene.validation.schema.simplified.SExceptPattern;
import serene.validation.schema.simplified.SExceptNameClass;

import serene.validation.schema.simplified.SElement;
import serene.validation.schema.simplified.SAttribute;
import serene.validation.schema.simplified.SChoicePattern;
import serene.validation.schema.simplified.SInterleave;
import serene.validation.schema.simplified.SGroup;
import serene.validation.schema.simplified.SListPattern;
import serene.validation.schema.simplified.SEmpty;
import serene.validation.schema.simplified.SText;
import serene.validation.schema.simplified.SNotAllowed;
import serene.validation.schema.simplified.SRef;
import serene.validation.schema.simplified.SData;
import serene.validation.schema.simplified.SValue;
import serene.validation.schema.simplified.SGrammar;
import serene.validation.schema.simplified.SDummy;

import serene.validation.schema.simplified.SName;
import serene.validation.schema.simplified.SAnyName;
import serene.validation.schema.simplified.SNsName;
import serene.validation.schema.simplified.SChoiceNameClass;

import serene.validation.schema.simplified.RecursionModel;
import serene.validation.schema.simplified.SimplifiedComponent;
import serene.validation.schema.simplified.SimplifiedComponentVisitor;

class AlternativeSeeker implements SimplifiedComponentVisitor{
	RecursionModel recursionModel;
	ArrayList<ArrayList<SRef>> definitionBlindLoops;
	ArrayList<ArrayList<SRef>> definitionInfiniteLoops;
	ArrayList<Map<SRef, ArrayList<SRef>>> definitionOpenAlternatives;

	IntList handledDefinitions;

	boolean isFiniteAlternative;
	SRef testRecursion;
	int testIndex;

	AlternativeSeeker(){
	}

	void init(RecursionModel recursionModel,
					ArrayList<ArrayList<SRef>> definitionBlindLoops,
					ArrayList<ArrayList<SRef>> definitionInfiniteLoops,
					ArrayList<Map<SRef, ArrayList<SRef>>> definitionOpenAlternatives,
					IntList handledDefinitions){
		this.recursionModel = recursionModel;
		this.definitionBlindLoops = definitionBlindLoops;
		this.definitionInfiniteLoops = definitionInfiniteLoops;
		this.definitionOpenAlternatives = definitionOpenAlternatives;
		this.handledDefinitions = handledDefinitions;
	}

	boolean hasAlternatives(SRef testRecursion,
					Stack<SChoicePattern> loopChoices){
		this.testRecursion = testRecursion;
		this.testIndex = testRecursion.getDefinitionIndex();
		isFiniteAlternative = false;

		for(SChoicePattern choice : loopChoices){
			choice.accept(this);
			if(isFiniteAlternative){
				definitionOpenAlternatives.set(testIndex, null);
				return true;
			}
		}
		if(definitionOpenAlternatives.get(testIndex) != null &&
			!definitionOpenAlternatives.get(testIndex).isEmpty())return true;
		return false;
	}

	public void visit(SExceptPattern exceptPattern){
		SimplifiedComponent child = exceptPattern.getChild();
		if(child != null) child.accept(this);
	}
	public void visit(SExceptNameClass exceptNameClass){
		throw new IllegalStateException();
	}

	public void visit(SName component){
		throw new IllegalStateException();
	}
	public void visit(SAnyName anyName){
		throw new IllegalStateException();
	}
	public void visit(SNsName nsName){
		throw new IllegalStateException();
	}
	public void visit(SChoiceNameClass choice){
		throw new IllegalStateException();
	}

	public void visit(SElement element){
		SimplifiedComponent child = element.getChild();
		if(child != null) child.accept(this);
		else isFiniteAlternative = true;
	}
	public void visit(SAttribute attribute){
		SimplifiedComponent[] children = attribute.getChildren();
		if(children != null)next(children);
	}
	public void visit(SChoicePattern choice){
		SimplifiedComponent[] children = choice.getChildren();
		if(children != null) next(children);
	}
	public void visit(SInterleave interleave){
		SimplifiedComponent[] children = interleave.getChildren();
		if(children != null) next(children);
	}
	public void visit(SGroup group){
		SimplifiedComponent[] children = group.getChildren();
		if(children != null) next(children);
	}
	public void visit(SListPattern list){
		SimplifiedComponent child = list.getChild();
		if(child != null) child.accept(this);
	}
	public void visit(SEmpty empty){
		isFiniteAlternative = true;
	}
	public void visit(SText text){
		isFiniteAlternative = true;
	}
	public void visit(SNotAllowed notAllowed){}
	public void visit(SRef ref){
		int index = ref.getDefinitionIndex();
        if(index < 0)return;
		if(testIndex == index) return;
		if(isProvenIllegalRecursionDefinition(index)){
			return;
		}
		if(isProvenLegalRecursionDefinition(index)){
			isFiniteAlternative = true;
			return;
		}

		Map<SRef, ArrayList<SRef>> openAlternatives = definitionOpenAlternatives.get(testIndex);
		if(openAlternatives == null){
			openAlternatives  = new HashMap<SRef, ArrayList<SRef>>();
			definitionOpenAlternatives.set(testIndex, openAlternatives);
		}
		ArrayList<SRef> alt = openAlternatives.get(testRecursion);
		if(alt == null){
			alt = new ArrayList<SRef>();
			openAlternatives.put(testRecursion, alt);
		}
		alt.add(ref);
	}

	private boolean isProvenIllegalRecursionDefinition(int index){
		return (definitionBlindLoops.get(index) != null
			&& !definitionBlindLoops.get(index).isEmpty())
			|| (definitionInfiniteLoops.get(index) != null
			&& !definitionInfiniteLoops.get(index).isEmpty());
	}

	private boolean isProvenLegalRecursionDefinition(int index){
		if(!recursionModel.isRecursiveDefinition(index)){
			return true;
		}

		return  handledDefinitions.contains(index)
				&&(definitionBlindLoops.get(index) == null ||
				definitionBlindLoops.get(index).isEmpty())
				&&(definitionInfiniteLoops.get(index) == null ||
				definitionInfiniteLoops.get(index).isEmpty())
				&& definitionOpenAlternatives.get(index) == null;
	}
	public void visit(SValue value){
		isFiniteAlternative = true;
	}
	public void visit(SData data){
		SimplifiedComponent[] exceptPattern = data.getExceptPattern();
		if(exceptPattern != null) next(exceptPattern);
		if(exceptPattern == null)isFiniteAlternative = true;
        // TODO review, it might be finite alternatie even if it has an exceptPattern
	}
	public void visit(SGrammar grammar){
		SimplifiedComponent child = grammar.getChild();
		if(child != null) child.accept(this);
	}

	public void visit(SDummy dummy){
		SimplifiedComponent[] children = dummy.getChildren();
		if(children != null) next(children);
	}

	protected void next(SimplifiedComponent[] children){
		for(SimplifiedComponent child : children){
			child.accept(this);
		}
	}
}


text:
package gnu.classpath.jdwp.processor;

import gnu.classpath.jdwp.Jdwp;
import gnu.classpath.jdwp.JdwpConstants;
import gnu.classpath.jdwp.exception.JdwpException;
import gnu.classpath.jdwp.transport.JdwpCommandPacket;
import gnu.classpath.jdwp.transport.JdwpConnection;
import gnu.classpath.jdwp.transport.JdwpPacket;
import gnu.classpath.jdwp.transport.JdwpReplyPacket;

import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.security.PrivilegedAction;

/**
 * This class is responsible for processing packets from the
 * debugger. It waits for an available packet from the connection
 * ({@link gnu.classpath.jdwp.transport.JdwpConnection}) and then
 * processes the packet and any reply.
 *
 * @author Keith Seitz (keiths@redhat.com)
 */
public class PacketProcessor
  implements PrivilegedAction
{
  // The connection to the debugger
  private JdwpConnection _connection;

  // Shutdown this thread?
  private boolean _shutdown;

  // A Mapping of the command set (Byte) to the specific CommandSet
  private CommandSet[] _sets;

  // Contents of the ReplyPackets data field
  private ByteArrayOutputStream _outputBytes;

  // Output stream around _outputBytes
  private DataOutputStream _os;

  /**
   * Constructs a new PacketProcessor object
   * Connection must be validated before getting here!
   *
   * @param con  the connection
   */
  public PacketProcessor (JdwpConnection con)
  {
    _connection = con;
    _shutdown = false;

    // MAXIMUM is the value of the largest command set we may receive
    _sets = new CommandSet[JdwpConstants.CommandSet.MAXIMUM + 1];
    _outputBytes = new ByteArrayOutputStream();
    _os = new DataOutputStream (_outputBytes);

    // Create all the Command Sets and add them to our array
    _sets[JdwpConstants.CommandSet.VirtualMachine.CS_VALUE] =
      new VirtualMachineCommandSet();
    _sets[JdwpConstants.CommandSet.ReferenceType.CS_VALUE] =
      new ReferenceTypeCommandSet();
    _sets[JdwpConstants.CommandSet.ClassType.CS_VALUE] =
      new ClassTypeCommandSet();
    _sets[JdwpConstants.CommandSet.ArrayType.CS_VALUE] =
      new ArrayTypeCommandSet();
    _sets[JdwpConstants.CommandSet.InterfaceType.CS_VALUE] =
      new InterfaceTypeCommandSet();
    _sets[JdwpConstants.CommandSet.Method.CS_VALUE] =
      new MethodCommandSet();
    _sets[JdwpConstants.CommandSet.Field.CS_VALUE] =
      new FieldCommandSet();
    _sets[JdwpConstants.CommandSet.ObjectReference.CS_VALUE] =
      new ObjectReferenceCommandSet();
    _sets[JdwpConstants.CommandSet.StringReference.CS_VALUE] =
      new StringReferenceCommandSet();
    _sets[JdwpConstants.CommandSet.ThreadReference.CS_VALUE] =
      new ThreadReferenceCommandSet();
    _sets[JdwpConstants.CommandSet.ThreadGroupReference.CS_VALUE] =
      new ThreadGroupReferenceCommandSet();
    _sets[JdwpConstants.CommandSet.ArrayReference.CS_VALUE] =
      new ArrayReferenceCommandSet();
    _sets[JdwpConstants.CommandSet.ClassLoaderReference.CS_VALUE] =
      new ClassLoaderReferenceCommandSet();
    _sets[JdwpConstants.CommandSet.EventRequest.CS_VALUE] =
      new EventRequestCommandSet();
    _sets[JdwpConstants.CommandSet.StackFrame.CS_VALUE] =
      new StackFrameCommandSet();
    _sets[JdwpConstants.CommandSet.ClassObjectReference.CS_VALUE] =
      new ClassObjectReferenceCommandSet();
  }

  /**
   * Main run routine for this thread. Will loop getting packets
   * from the connection and processing them.
   */
  public Object run ()
  {
    // Notify initialization thread (gnu.classpath.jdwp.Jdwp) that
    // the PacketProcessor thread is ready.
    Jdwp.getDefault().subcomponentInitialized ();

    try
      {
        while (!_shutdown)
          {
            _processOnePacket ();
          }
      }
    catch (Exception ex)
      {
        ex.printStackTrace();
      }
    // Time to shutdown, tell Jdwp to shutdown
    Jdwp.getDefault().shutdown();
    return null;
  }

  /**
   * Shutdown the packet processor
   */
  public void shutdown ()
  {
    _shutdown = true;
  }

  // Helper function which actually does all the work of waiting
  // for a packet and getting it processed.
  private void _processOnePacket ()
    throws IOException
  {
    JdwpPacket pkt = _connection.getPacket ();

    if (!(pkt instanceof JdwpCommandPacket))
      {
        // We're not supposed to get these from the debugger!
        // Drop it on the floor
        return;
      }

    if (pkt != null)
      {
        JdwpCommandPacket commandPkt = (JdwpCommandPacket) pkt;
        JdwpReplyPacket reply = new JdwpReplyPacket(commandPkt);

        // Reset our output stream
        _outputBytes.reset();

        // Create a ByteBuffer around the command packet
        ByteBuffer bb = ByteBuffer.wrap(commandPkt.getData());
        byte command = commandPkt.getCommand();
        byte commandSet = commandPkt.getCommandSet();

        CommandSet set = null;
        try
          {
            // There is no command set with value 0
            if (commandSet > 0 && commandSet < _sets.length)
              {
                set = _sets[commandPkt.getCommandSet()];
              }
            if (set != null)
              {
                _shutdown = set.runCommand(bb, _os, command);
                reply.setData(_outputBytes.toByteArray());
              }
            else
              {
                // This command set wasn't in our tree
                reply.setErrorCode(JdwpConstants.Error.NOT_IMPLEMENTED);
              }
          }
          catch (JdwpException ex)
            {
            reply.setErrorCode(ex.getErrorCode ());
            }
          _connection.sendPacket (reply);
      }
  }
}


text:
Utils for Chef and AWS

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'chef-aws'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install chef-aws

## Usage

create_db_instance

## Contributing

1. Fork it ( https://github.com/inetsyssl/chef-aws/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request


text:
using System.Collections.Generic;

namespace Azure.ResourceManager.Network.Models
{
    /// <summary> Response for ListAzureFirewallFqdnTags API service call. </summary>
    public partial class AzureFirewallFqdnTagListResult
    {
        /// <summary> Initializes a new instance of AzureFirewallFqdnTagListResult. </summary>
        internal AzureFirewallFqdnTagListResult()
        {
        }

        /// <summary> Initializes a new instance of AzureFirewallFqdnTagListResult. </summary>
        /// <param name="value"> List of Azure Firewall FQDN Tags in a resource group. </param>
        /// <param name="nextLink"> URL to get the next set of results. </param>
        internal AzureFirewallFqdnTagListResult(IReadOnlyList<AzureFirewallFqdnTag> value, string nextLink)
        {
            Value = value;
            NextLink = nextLink;
        }

        /// <summary> List of Azure Firewall FQDN Tags in a resource group. </summary>
        public IReadOnlyList<AzureFirewallFqdnTag> Value { get; }
        /// <summary> URL to get the next set of results. </summary>
        public string NextLink { get; }
    }
}


text:
// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download.
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================

/*
CalendarPopup.js
Author: Matt Kruse
Last modified: 3/21/02

DESCRIPTION: This object implements a popup calendar to allow the user to
select a date, month, quarter, or year.

COMPATABILITY: Works with Netscape 4.x, 6.x, IE 5.x on Windows. Some small
positioning errors - usually with Window positioning - occur on the
Macintosh platform.
The calendar can be modified to work for any location in the world by
changing which weekday is displayed as the first column, changing the month
names, and changing the column headers for each day.

USAGE:
// Create a new CalendarPopup object of type WINDOW
var cal = new CalendarPopup();

// Create a new CalendarPopup object of type DIV using the DIV named 'mydiv'
var cal = new CalendarPopup('mydiv');

// Easy method to link the popup calendar with an input box.
cal.select(inputObject, anchorname, dateFormat);
// This is an example call to the popup calendar from a link to populate an
// input box. Note that to use this, date.js must also be included!!
Select

// Set the type of date select to be used. By default it is 'date'.
cal.setDisplayType(type);

// When a date, month, quarter, or year is clicked, a function is called and
// passed the details. You must write this function, and tell the calendar
// popup what the function name is.
// Function to be called for 'date' select receives y, m, d
cal.setReturnFunction(functionname);
// Function to be called for 'month' select receives y, m
cal.setReturnMonthFunction(functionname);
// Function to be called for 'quarter' select receives y, q
cal.setReturnQuarterFunction(functionname);
// Function to be called for 'year' select receives y
cal.setReturnYearFunction(functionname);

// Show the calendar relative to a given anchor
cal.showCalendar(anchorname);

// Hide the calendar. The calendar is set to autoHide automatically
cal.hideCalendar();

// Set the month names to be used. Default are English month names
cal.setMonthNames("January","February","March",...);

// Set the month abbreviations to be used. Default are English month abbreviations
cal.setMonthAbbreviations("Jan","Feb","Mar",...);

// Set the text to be used above each day column. The days start with
// sunday regardless of the value of WeekStartDay
cal.setDayHeaders("S","M","T",...);

// Set the day for the first column in the calendar grid. By default this
// is Sunday (0) but it may be changed to fit the conventions of other
// countries.
cal.setWeekStartDay(1); // week is Monday - Saturday

// Set the weekdays which should be disabled in the 'date' select popup. You can
// then allow someone to only select week end dates, or Tuedays, for example
cal.setDisabledWeekDays(0,1); // To disable selecting the 1st or 2nd days of the week

// When the 'year' select is displayed, set the number of years back from the
// current year to start listing years. Default is 2.
cal.setYearSelectStartOffset(2);

// Text for the word "Today" appearing on the calendar
cal.setTodayText("Today");

// Set the calendar offset to be different than the default. By default it
// will appear just below and to the right of the anchorname. So if you have
// a text box where the date will go and and anchor immediately after the
// text box, the calendar will display immediately under the text box.
cal.offsetX = 20;
cal.offsetY = 20;

NOTES:
1) Requires the functions in AnchorPosition.js and PopupWindow.js

2) Your anchor tag MUST contain both NAME and ID attributes which are the
   same. For example:

3) There must be at least a space between   for IE5.5 to see the
   anchor tag correctly. Do not do  with no space.

4) When a CalendarPopup object is created, a handler for 'onmouseup' is
   attached to any event handler you may have already defined. Do NOT define
   an event handler for 'onmouseup' after you define a CalendarPopup object
   or the autoHide() will not work correctly.

5) The calendar display uses "graypixel.gif" which is a 1x1 gray pixel of
   color #C0C0C0. If this file is not present, the calendar display should
   still be fine but will not show the gray lines.

6) The calendar popup display uses style sheets to make it look nice.

*/

// CONSTRUCTOR for the CalendarPopup Object
function CalendarPopup() {
	var c;
	if (arguments.length>0) {
		c = new PopupWindow(arguments[0]);
		}
	else {
		c = new PopupWindow();
		c.setSize(150,175);
		}
	c.offsetX = -152;
	c.offsetY = 25;
	c.autoHide();
	// Calendar-specific properties
	c.monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	c.monthAbbreviations = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	c.dayHeaders = new Array("S","M","T","W","T","F","S");
	c.returnFunction = "CalendarPopup_tmpReturnFunction";
	c.returnMonthFunction = "CalendarPopup_tmpReturnMonthFunction";
	c.returnQuarterFunction = "CalendarPopup_tmpReturnQuarterFunction";
	c.returnYearFunction = "CalendarPopup_tmpReturnYearFunction";
	c.weekStartDay = 0;
	c.isShowYearNavigation = false;
	c.displayType = "date";
	c.disabledWeekDays = new Object();
	c.yearSelectStartOffset = 2;
	c.currentDate = null;
	c.todayText="Today";
	window.CalendarPopup_targetInput = null;
	window.CalendarPopup_dateFormat = "mm/dd/yyyy";
	// Method mappings
	c.setReturnFunction = CalendarPopup_setReturnFunction;
	c.setReturnMonthFunction = CalendarPopup_setReturnMonthFunction;
	c.setReturnQuarterFunction = CalendarPopup_setReturnQuarterFunction;
	c.setReturnYearFunction = CalendarPopup_setReturnYearFunction;
	c.setMonthNames = CalendarPopup_setMonthNames;
	c.setMonthAbbreviations = CalendarPopup_setMonthAbbreviations;
	c.setDayHeaders = CalendarPopup_setDayHeaders;
	c.setWeekStartDay = CalendarPopup_setWeekStartDay;
	c.setDisplayType = CalendarPopup_setDisplayType;
	c.setDisabledWeekDays = CalendarPopup_setDisabledWeekDays;
	c.setYearSelectStartOffset = CalendarPopup_setYearSelectStartOffset;
	c.setTodayText = CalendarPopup_setTodayText;
	c.showYearNavigation = CalendarPopup_showYearNavigation;
	c.showCalendar = CalendarPopup_showCalendar;
	c.hideCalendar = CalendarPopup_hideCalendar;
	c.getStyles = CalendarPopup_getStyles;
	c.refreshCalendar = CalendarPopup_refreshCalendar;
	c.getCalendar = CalendarPopup_getCalendar;
	c.select = CalendarPopup_select;
	// Return the object
	return c;
	}

// Temporary default functions to be called when items clicked, so no error is thrown
function CalendarPopup_tmpReturnFunction(y,m,d) {
	if (window.CalendarPopup_targetInput!=null) {
		var dt = new Date(y,m-1,d,0,0,0);
		window.CalendarPopup_targetInput.value = formatDate(dt,window.CalendarPopup_dateFormat);
		}
	else {
		alert('Use setReturnFunction() to define which function will get the clicked results!');
		}
	}
function CalendarPopup_tmpReturnMonthFunction(y,m) {
	alert('Use setReturnMonthFunction() to define which function will get the clicked results!\nYou clicked: year='+y+' , month='+m);
	}
function CalendarPopup_tmpReturnQuarterFunction(y,q) {
	alert('Use setReturnQuarterFunction() to define which function will get the clicked results!\nYou clicked: year='+y+' , quarter='+q);
	}
function CalendarPopup_tmpReturnYearFunction(y) {
	alert('Use setReturnYearFunction() to define which function will get the clicked results!\nYou clicked: year='+y);
	}

// Set the name of the functions to call to get the clicked item
function CalendarPopup_setReturnFunction(name) { this.returnFunction = name; }
function CalendarPopup_setReturnMonthFunction(name) { this.returnMonthFunction = name; }
function CalendarPopup_setReturnQuarterFunction(name) { this.returnQuarterFunction = name; }
function CalendarPopup_setReturnYearFunction(name) { this.returnYearFunction = name; }

// Over-ride the built-in month names
function CalendarPopup_setMonthNames() {
	for (var i=0; i<arguments.length; i++) { this.monthNames[i] = arguments[i]; }
	}

// Over-ride the built-in month abbreviations
function CalendarPopup_setMonthAbbreviations() {
	for (var i=0; i<arguments.length; i++) { this.monthAbbreviations[i] = arguments[i]; }
	}

// Over-ride the built-in column headers for each day
function CalendarPopup_setDayHeaders() {
	for (var i=0; i<arguments.length; i++) { this.dayHeaders[i] = arguments[i]; }
	}

// Set the day of the week (0-7) that the calendar display starts on
// This is for countries other than the US whose calendar displays start on Monday(1), for example
function CalendarPopup_setWeekStartDay(day) { this.weekStartDay = day; }

// Show next/last year navigation links
function CalendarPopup_showYearNavigation() { this.isShowYearNavigation = true; }

// Which type of calendar to display
function CalendarPopup_setDisplayType(type) {
	if (type!="date"&&type!="week-end"&&type!="month"&&type!="quarter"&&type!="year") { alert("Invalid display type! Must be one of: date,week-end,month,quarter,year"); return false; }
	this.displayType=type;
	}

// How many years back to start by default for year display
function CalendarPopup_setYearSelectStartOffset(num) { this.yearSelectStartOffset=num; }

// Set which weekdays should not be clickable
function CalendarPopup_setDisabledWeekDays() {
	this.disabledWeekDays = new Object();
	for (var i=0; i<arguments.length; i++) { this.disabledWeekDays[arguments[i]] = true; }
	}

// Set the text to use for the "Today" link
function CalendarPopup_setTodayText(text) {
	this.todayText = text;
	}

// Hide a calendar object
function CalendarPopup_hideCalendar() {
	if (arguments.length > 0) { window.popupWindowObjects[arguments[0]].hidePopup(); }
	else { this.hidePopup(); }
	}

// Refresh the contents of the calendar display
function CalendarPopup_refreshCalendar(index) {
	var calObject = window.popupWindowObjects[index];
	if (arguments.length>1) {
		calObject.populate(calObject.getCalendar(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]));
		}
	else {
		calObject.populate(calObject.getCalendar());
		}
	calObject.refresh();
	}

// Populate the calendar and display it
function CalendarPopup_showCalendar(anchorname) {
	this.populate(this.getCalendar());
	this.showPopup(anchorname);
	}

// Simple method to interface popup calendar with a text-entry box
function CalendarPopup_select(inputobj, linkname, format) {
	if (!window.getDateFromFormat) {
		alert("calendar.select: To use this method you must also include 'date.js' for date formatting");
		return;
		}
	if (this.displayType!="date"&&this.displayType!="week-end") {
		alert("calendar.select: This function can only be used with displayType 'date' or 'week-end'");
		return;
		}
	if (inputobj.type!="text" && inputobj.type!="hidden" && inputobj.type!="textarea") {
		alert("calendar.select: Input object passed is not a valid form input object");
		window.CalendarPopup_targetInput=null;
		return;
		}
	window.CalendarPopup_targetInput = inputobj;
	if (inputobj.value!="") {
		var time = getDateFromFormat(inputobj.value,format);
		if (time==0) { this.currentDate=null; }
		else { this.currentDate=new Date(time); }
		}
	else { this.currentDate=null; }
	window.CalendarPopup_dateFormat = format;
	this.showCalendar(linkname);
	}

// Get style block needed to display the calendar correctly
function CalendarPopup_getStyles() {
	var result = "";
	result += "\n";
	return result;
	}

// Return a string containing all the calendar code to be displayed
function CalendarPopup_getCalendar() {
	var now = new Date();
	// Reference to window
	if (this.type == "WINDOW") { var windowref = "window.opener."; }
	else { var windowref = ""; }
	var result = "";
	// If POPUP, write entire HTML document
	if (this.type == "WINDOW") {
		result += "<TITLE>Calendar</TITLE>"+this.getStyles()+"\n";
		result += '
\n';
		}
	else {
		result += '
\n';
		result += '
\n';
		result += '\n';
		}

	// Code for DATE display (default)
	// -------------------------------
	if (this.displayType=="date" || this.displayType=="week-end") {
		if (this.currentDate==null) { this.currentDate = now; }
		if (arguments.length > 0) { var month = arguments[0]; }
			else { var month = this.currentDate.getMonth()+1; }
		if (arguments.length > 1) { var year = arguments[1]; }
			else { var year = this.currentDate.getFullYear(); }
		var daysinmonth= new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
		if ( ( (year%4 == 0)&&(year%100 != 0) ) || (year%400 == 0) ) {
			daysinmonth[2] = 29;
			}
		var current_month = new Date(year,month-1,1);
		var display_year = year;
		var display_month = month;
		var display_date = 1;
		var weekday= current_month.getDay();
		var offset = 0;
		if (weekday >= this.weekStartDay) {
			offset = weekday - this.weekStartDay;
			}
		else {
			offset = 7-this.weekStartDay+weekday;
			}
		if (offset > 0) {
			display_month--;
			if (display_month < 1) { display_month = 12; display_year--; }
			display_date = daysinmonth[display_month]-offset+1;
			}
		var next_month = month+1;
		var next_month_year = year;
		if (next_month > 12) { next_month=1; next_month_year++; }
		var last_month = month-1;
		var last_month_year = year;
		if (last_month < 1) { last_month=12; last_month_year--; }
		var date_class;
		if (this.type!="WINDOW") {
			result += '
\n';
			}
		result += '
\n';
		var refresh = 'javascript:'+windowref+'CalendarPopup_refreshCalendar';
		if (this.isShowYearNavigation) {
			var td = '<	';
			result += td + ' WIDTH=58>'+this.monthNames[month-1]+'	';
			result += td + ' WIDTH=10>>	';
			result += td + ' WIDTH=10> 	';
			result += td + ' WIDTH=10><	';
			result += td + ' WIDTH=36>'+year+'	';
			result += td + ' WIDTH=10>>	';
			}
		else {
			result += '	<<	\n';
			result += '	'+this.monthNames[month-1]+' '+year+'	\n';
			result += '	>>	\n';
			}
		result += '

\n';
		result += '
\n';
		result += '
\n';
		var td = '	';
		for (var j=0; j<7; j++) {
			result += td+this.dayHeaders[(this.weekStartDay+j)%7]+'	\n';
			}
		result += '
\n';
		result += '

\n';
		for (var row=1; row<=6; row++) {
			result += '
\n';
			for (var col=1; col<=7; col++) {
				if (display_month == month) {
					date_class = "calthismonth";
					}
				else {
					date_class = "calothermonth";
					}
				if ((display_month == this.currentDate.getMonth()+1) && (display_date==this.currentDate.getDate()) && (display_year==this.currentDate.getFullYear())) {
					td_class="caltoday";
					}
				else {
					td_class="calmonth";
					}
				if (this.disabledWeekDays[col-1]) {
					date_class="calnotclickable";
					result += '	'+display_date+'	\n';
					}
				else {
					var selected_date = display_date;
					var selected_month = display_month;
					var selected_year = display_year;
					if (this.displayType=="week-end") {
						var d = new Date(selected_year,selected_month-1,selected_date,0,0,0,0);
						d.setDate(d.getDate() + (7-col));
						selected_year = d.getYear();
						if (selected_year < 1000) { selected_year += 1900; }
						selected_month = d.getMonth()+1;
						selected_date = d.getDate();
						}
					result += '	'+display_date+'	\n';
					}
				display_date++;
				if (display_date > daysinmonth[display_month]) {
					display_date=1;
					display_month++;
					}
				if (display_month > 12) {
					display_month=1;
					display_year++;
					}
				}
			result += '
';
			}
		var current_weekday = now.getDay();
		result += '

\n';
		result += '
\n';
		result += '	\n';
		if (this.disabledWeekDays[current_weekday+1]) {
			result += '		'+this.todayText+'\n';
			}
		else {
			result += '		'+this.todayText+'\n';
			}
		result += '
\n';
		result += '

\n';
	}

	// Code common for MONTH, QUARTER, YEAR
	// ------------------------------------
	if (this.displayType=="month" || this.displayType=="quarter" || this.displayType=="year") {
		if (arguments.length > 0) { var year = arguments[0]; }
		else {
			if (this.displayType=="year") {	var year = now.getFullYear()-this.yearSelectStartOffset; }
			else { var year = now.getFullYear(); }
			}
		if (this.displayType!="year" && this.isShowYearNavigation) {
			result += '
\n';
			result += '
\n';
			result += '	<<	\n';
			result += '	'+year+'	\n';
			result += '	>>	\n';
			result += '

\n';
			}
		}

	// Code for MONTH display (default)
	// -------------------------------
	if (this.displayType=="month") {
		// If POPUP, write entire HTML document
		result += '
\n';
		for (var i=0; i<4; i++) {
			result += '
';
			for (var j=0; j<3; j++) {
				var monthindex = ((i*3)+j);
				result += ''+this.monthAbbreviations[monthindex]+'	';
				}
			result += '
';
			}
		result += '

\n';
		}

	// Code for QUARTER display (default)
	// ----------------------------------
	if (this.displayType=="quarter") {
		result += '

\n';
		for (var i=0; i<2; i++) {
			result += '
';
			for (var j=0; j<2; j++) {
				var quarter = ((i*2)+j+1);
				result += '
Q'+quarter+'

	';
				}
			result += '
';
			}
		result += '

\n';
		}

	// Code for YEAR display (default)
	// -------------------------------
	if (this.displayType=="year") {
		var yearColumnSize = 4;
		result += '
\n';
		result += '
\n';
		result += '	<<	\n';
		result += '	>>	\n';
		result += '

\n';
		result += '
\n';
		for (var i=0; i<yearColumnSize; i++) {
			for (var j=0; j<2; j++) {
				var currentyear = year+(j*yearColumnSize)+i;
				result += ''+currentyear+'	';
				}
			result += '
';
			}
		result += '

\n';
		}
	// Common
	if (this.type == "WINDOW") {
		result += "\n";
		}
	return result;
	}


text:
% STEP 1: Use getHSVColorFromDirectory(dirName) in order to estimate the
% average HSV values of your objects of interest.

HSV = getHSVColorFromDirectory('train');

%
% The above function call will let the user choose manually (through simple
% mouse clicks) several "seeds" from each image.
% At the end the HSV matrix contains M rows (M is the total number of jpeg files
% in dirName): each row corresponds to the average HSV value of the
% selected seeds in the respective image.
% The average (or median) value of this matrix (column-wise) can be used,
% in the sequence for detecting the speficic color values.
%

% STEP 2: Use the estimated (average) hsv value for detecting the specified
% color in a specific image.

colorDetectHSV('test/face01.jpg', median(HSV), [0.05 0.05 0.2]);


text:
<?php
require_once('class/global.config.php');
require_once('class/database.inc.php');
/*
 * Please note this is a quick mockup, I will be making this its own class
 * http://slimcrm.com/webdevel/svn/eapi/trunk/phoneapi.php?action=RING&phone_number=6084060226&user_id=100&call_id=123990sdf&direction=in
 *
 */

$action = $_REQUEST["action"];
$phone_number = $_REQUEST["phone_number"];
$exten = $_REQUEST["exten"];

//$user_id = $_REQUEST["user_id"];
$call_id = $_REQUEST["uid"];
$ip = $_SERVER["REMOTE_ADDR"];
$direction = strtolower($_REQUEST["direction"]);
if( $call_id == '' ){
    $call_id = md5($user_id . $phone_number);
}
$ok = "NO ACTION";
$db = new database(DATABASE_HOST,DATABASE_PORT,DATABASE_USER,DATABASE_PASSWORD,DATABASE_NAME);
if( $exten == "s"){
    $res = $db->query("SELECT * FROM user_settings WHERE name='phone_main_incomming' AND value='true' GROUP BY user_id");
} elseif( substr($exten,0,3 ) == '101' ) {
    $exten_orig = $exten;
    $exten = substr($exten,3 );
    $res = $db->query("SELECT * FROM user_settings WHERE name='phone_extention' AND value='$exten' GROUP BY user_id");
    echo "SELECT * FROM user_settings WHERE name='phone_extention' AND value='$exten' GROUP BY user_id";
}
//$action = "RING";
$phone_number = substr( $phone_number , -10 );
while($row=$db->fetch_assoc($res)){
    $user_id = $row['user_id'];
    switch( strtoupper($action) ){
        case "RING":
            $db->query("DELETE FROM currentcalls WHERE user_id = '$user_id'");
            $db->insert("currentcalls", array(
                "direction" => $direction ,
                "call_id" => $call_id ,
                "user_id" => $row['user_id'] ,
                'phone_number' => $phone_number ,
                'exten' => $exten ,
                'status' => 'RING',
                'ip_address' =>  $ip ) );
            $ok = "OK";
        break;
        case "ANSWER":
            //$db->query("DELETE FROM currentcalls WHERE call_id='$call_id' AND user_id <> '$user_id'");
            $sql = "UPDATE currentcalls SET status = 'ANSWER', exten = '$exten' WHERE call_id = '$call_id' AND user_id = '$user_id'";
            echo $sql . "\n";
            $db->query($sql);
            $ok = "OK";
        break;
        case "HANGUP":
            $db->query("DELETE FROM currentcalls WHERE call_id = '$call_id' AND user_id = '$user_id'");
            $ok = "OK";
        break;
    }
}
echo "$ok . $phone_number . $exten . $exten_orig";

?>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>src/pixi/renderers/webgl/WebGLRenderer.js - pixi.js</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">

            API Docs for: 2.1.0

APIs

Classes

Modules

            <input type="search" id="api-filter" placeholder="Type to filter APIs">

AbstractFilter

AjaxRequest

AlphaMaskFilter

AsciiFilter

AssetLoader

AtlasLoader

autoDetectRecommendedRenderer

autoDetectRenderer

BaseTexture

BitmapFontLoader

BitmapText

BlurFilter

BlurXFilter

BlurYFilter

CanvasBuffer

CanvasGraphics

CanvasMaskManager

CanvasRenderer

CanvasTinter

Circle

ColorMatrixFilter

ColorStepFilter

ComplexPrimitiveShader

ConvolutionFilter

CrossHatchFilter

DisplacementFilter

DisplayObject

DisplayObjectContainer

DotScreenFilter

Ellipse

Event

EventTarget

FilterBlock

FilterTexture

Graphics

GraphicsData

GrayFilter

ImageLoader

InteractionData

InteractionManager

InvertFilter

JsonLoader

Matrix

MovieClip

NoiseFilter

NormalMapFilter

PixelateFilter

PixiFastShader

PixiShader

Point

Polygon

PolyK

PrimitiveShader

Rectangle

RenderTexture

RGBSplitFilter

Rope

Rounded Rectangle

SepiaFilter

SmartBlurFilter

Spine

SpineLoader

Sprite

SpriteBatch

SpriteSheetLoader

Stage

Strip

StripShader

Text

Texture

TilingSprite

TiltShiftFilter

TiltShiftXFilter

TiltShiftYFilter

TwistFilter

WebGLBlendModeManager

WebGLFastSpriteBatch

WebGLFilterManager

WebGLGraphics

WebGLGraphicsData

WebGLMaskManager

WebGLRenderer

WebGLShaderManager

WebGLSpriteBatch

WebGLStencilManager

PIXI

        Show:

            <input type="checkbox" id="api-show-inherited" checked>
            Inherited

            <input type="checkbox" id="api-show-protected">
            Protected

            <input type="checkbox" id="api-show-private">
            Private

            <input type="checkbox" id="api-show-deprecated">
            Deprecated

File: src/pixi/renderers/webgl/WebGLRenderer.js

/**
 * @author Mat Groves http://matgroves.com/ @Doormat23
 */

PIXI.glContexts = []; // this is where we store the webGL contexts for easy access.
PIXI.instances = [];

/**
 * The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer
 * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs.
 * So no need for Sprite Batches or Sprite Clouds.
 * Don't forget to add the view to your DOM or you will not see anything :)
 *
 * @class WebGLRenderer
 * @constructor
 * @param [width=0] {Number} the width of the canvas view
 * @param [height=0] {Number} the height of the canvas view
 * @param [options] {Object} The optional renderer parameters
 * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
 * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
 * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false
 * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment)
 * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context
 * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
 */
PIXI.WebGLRenderer = function(width, height, options)
{
    if(options)
    {
        for (var i in PIXI.defaultRenderOptions)
        {
            if (typeof options[i] === 'undefined') options[i] = PIXI.defaultRenderOptions[i];
        }
    }
    else
    {
        options = PIXI.defaultRenderOptions;
    }

    if(!PIXI.defaultRenderer)
    {
        PIXI.sayHello('webGL');
        PIXI.defaultRenderer = this;
    }

    /**
     * @property type
     * @type Number
     */
    this.type = PIXI.WEBGL_RENDERER;

    /**
     * The resolution of the renderer
     *
     * @property resolution
     * @type Number
     * @default 1
     */
    this.resolution = options.resolution;

    // do a catch.. only 1 webGL renderer..

    /**
     * Whether the render view is transparent
     *
     * @property transparent
     * @type Boolean
     */
    this.transparent = options.transparent;

    /**
     * Whether the render view should be resized automatically
     *
     * @property autoResize
     * @type Boolean
     */
    this.autoResize = options.autoResize || false;

    /**
     * The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.
     *
     * @property preserveDrawingBuffer
     * @type Boolean
     */
    this.preserveDrawingBuffer = options.preserveDrawingBuffer;

    /**
     * This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true:
     * If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0).
     * If the Stage is transparent, Pixi will clear to the target Stage's background color.
     * Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.
     *
     * @property clearBeforeRender
     * @type Boolean
     * @default
     */
    this.clearBeforeRender = options.clearBeforeRender;

    /**
     * The width of the canvas view
     *
     * @property width
     * @type Number
     * @default 800
     */
    this.width = width || 800;

    /**
     * The height of the canvas view
     *
     * @property height
     * @type Number
     * @default 600
     */
    this.height = height || 600;

    /**
     * The canvas element that everything is drawn to
     *
     * @property view
     * @type HTMLCanvasElement
     */
    this.view = options.view || document.createElement( 'canvas' );

    // deal with losing context..

    /**
     * @property contextLostBound
     * @type Function
     */
    this.contextLostBound = this.handleContextLost.bind(this);

    /**
     * @property contextRestoredBound
     * @type Function
     */
    this.contextRestoredBound = this.handleContextRestored.bind(this);

    this.view.addEventListener('webglcontextlost', this.contextLostBound, false);
    this.view.addEventListener('webglcontextrestored', this.contextRestoredBound, false);

    /**
     * @property _contextOptions
     * @type Object
     * @private
     */
    this._contextOptions = {
        alpha: this.transparent,
        antialias: options.antialias, // SPEED UP??
        premultipliedAlpha:this.transparent && this.transparent !== 'notMultiplied',
        stencil:true,
        preserveDrawingBuffer: options.preserveDrawingBuffer
    };

    /**
     * @property projection
     * @type Point
     */
    this.projection = new PIXI.Point();

    /**
     * @property offset
     * @type Point
     */
    this.offset = new PIXI.Point(0, 0);

    // time to create the render managers! each one focuses on managing a state in webGL

    /**
     * Deals with managing the shader programs and their attribs
     * @property shaderManager
     * @type WebGLShaderManager
     */
    this.shaderManager = new PIXI.WebGLShaderManager();

    /**
     * Manages the rendering of sprites
     * @property spriteBatch
     * @type WebGLSpriteBatch
     */
    this.spriteBatch = new PIXI.WebGLSpriteBatch();

    /**
     * Manages the masks using the stencil buffer
     * @property maskManager
     * @type WebGLMaskManager
     */
    this.maskManager = new PIXI.WebGLMaskManager();

    /**
     * Manages the filters
     * @property filterManager
     * @type WebGLFilterManager
     */
    this.filterManager = new PIXI.WebGLFilterManager();

    /**
     * Manages the stencil buffer
     * @property stencilManager
     * @type WebGLStencilManager
     */
    this.stencilManager = new PIXI.WebGLStencilManager();

    /**
     * Manages the blendModes
     * @property blendModeManager
     * @type WebGLBlendModeManager
     */
    this.blendModeManager = new PIXI.WebGLBlendModeManager();

    /**
     * TODO remove
     * @property renderSession
     * @type Object
     */
    this.renderSession = {};
    this.renderSession.gl = this.gl;
    this.renderSession.drawCount = 0;
    this.renderSession.shaderManager = this.shaderManager;
    this.renderSession.maskManager = this.maskManager;
    this.renderSession.filterManager = this.filterManager;
    this.renderSession.blendModeManager = this.blendModeManager;
    this.renderSession.spriteBatch = this.spriteBatch;
    this.renderSession.stencilManager = this.stencilManager;
    this.renderSession.renderer = this;
    this.renderSession.resolution = this.resolution;

    // time init the context..
    this.initContext();

    // map some webGL blend modes..
    this.mapBlendModes();
};

// constructor
PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer;

/**
* @method initContext
*/
PIXI.WebGLRenderer.prototype.initContext = function()
{
    var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions);
    this.gl = gl;

    if (!gl) {
        // fail, not able to get a context
        throw new Error('This browser does not support webGL. Try using the canvas renderer');
    }

    this.glContextId = gl.id = PIXI.WebGLRenderer.glContextId ++;

    PIXI.glContexts[this.glContextId] = gl;

    PIXI.instances[this.glContextId] = this;

    // set up the default pixi settings..
    gl.disable(gl.DEPTH_TEST);
    gl.disable(gl.CULL_FACE);
    gl.enable(gl.BLEND);

    // need to set the context for all the managers...
    this.shaderManager.setContext(gl);
    this.spriteBatch.setContext(gl);
    this.maskManager.setContext(gl);
    this.filterManager.setContext(gl);
    this.blendModeManager.setContext(gl);
    this.stencilManager.setContext(gl);

    this.renderSession.gl = this.gl;

    // now resize and we are good to go!
    this.resize(this.width, this.height);
};

/**
 * Renders the stage to its webGL view
 *
 * @method render
 * @param stage {Stage} the Stage element to be rendered
 */
PIXI.WebGLRenderer.prototype.render = function(stage)
{
    // no point rendering if our context has been blown up!
    if(this.contextLost)return;

    // if rendering a new stage clear the batches..
    if(this.__stage !== stage)
    {
        if(stage.interactive)stage.interactionManager.removeEvents();

        // TODO make this work
        // dont think this is needed any more?
        this.__stage = stage;
    }

    // update the scene graph
    stage.updateTransform();

    var gl = this.gl;

    // interaction
    if(stage._interactive)
    {
        //need to add some events!
        if(!stage._interactiveEventsAdded)
        {
            stage._interactiveEventsAdded = true;
            stage.interactionManager.setTarget(this);
        }
    }
    else
    {
        if(stage._interactiveEventsAdded)
        {
            stage._interactiveEventsAdded = false;
            stage.interactionManager.setTarget(this);
        }
    }

    // -- Does this need to be set every frame? -- //
    gl.viewport(0, 0, this.width, this.height);

    // make sure we are bound to the main frame buffer
    gl.bindFramebuffer(gl.FRAMEBUFFER, null);

    if (this.clearBeforeRender)
        {
        if(this.transparent)
        {
            gl.clearColor(0, 0, 0, 0);
        }
        else
        {
            gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1);
        }

        gl.clear (gl.COLOR_BUFFER_BIT);
    }

    this.renderDisplayObject( stage, this.projection );
};

/**
 * Renders a Display Object.
 *
 * @method renderDisplayObject
 * @param displayObject {DisplayObject} The DisplayObject to render
 * @param projection {Point} The projection
 * @param buffer {Array} a standard WebGL buffer
 */
PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer)
{
    this.renderSession.blendModeManager.setBlendMode(PIXI.blendModes.NORMAL);

    // reset the render session data..
    this.renderSession.drawCount = 0;

    // set the default projection
    this.renderSession.projection = projection;

    //set the default offset
    this.renderSession.offset = this.offset;

    // start the sprite batch
    this.spriteBatch.begin(this.renderSession);

    // start the filter manager
    this.filterManager.begin(this.renderSession, buffer);

    // render the scene!
    displayObject._renderWebGL(this.renderSession);

    // finish the sprite batch
    this.spriteBatch.end();
};

/**
 * Resizes the webGL view to the specified width and height.
 *
 * @method resize
 * @param width {Number} the new width of the webGL view
 * @param height {Number} the new height of the webGL view
 */
PIXI.WebGLRenderer.prototype.resize = function(width, height)
{
    this.width = width * this.resolution;
    this.height = height * this.resolution;

    this.view.width = this.width;
    this.view.height = this.height;

    if (this.autoResize) {
        this.view.style.width = this.width / this.resolution + 'px';
        this.view.style.height = this.height / this.resolution + 'px';
    }

    this.gl.viewport(0, 0, this.width, this.height);

    this.projection.x =  this.width / 2 / this.resolution;
    this.projection.y =  -this.height / 2 / this.resolution;
};

/**
 * Updates and Creates a WebGL texture for the renderers context.
 *
 * @method updateTexture
 * @param texture {Texture} the texture to update
 */
PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
{
    if(!texture.hasLoaded )return;

    var gl = this.gl;

    if(!texture._glTextures[gl.id])texture._glTextures[gl.id] = gl.createTexture();

    gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]);

    gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha);
    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);

    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);

    // reguler...
    if(!texture._powerOf2)
    {
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    }
    else
    {
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
    }

    texture._dirty[gl.id] = false;

    return  texture._glTextures[gl.id];
};

/**
 * Handles a lost webgl context
 *
 * @method handleContextLost
 * @param event {Event}
 * @private
 */
PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
{
    event.preventDefault();
    this.contextLost = true;
};

/**
 * Handles a restored webgl context
 *
 * @method handleContextRestored
 * @param event {Event}
 * @private
 */
PIXI.WebGLRenderer.prototype.handleContextRestored = function()
{
    this.initContext();

    // empty all the ol gl textures as they are useless now
    for(var key in PIXI.TextureCache)
    {
        var texture = PIXI.TextureCache[key].baseTexture;
        texture._glTextures = [];
    }

    this.contextLost = false;
};

/**
 * Removes everything from the renderer (event listeners, spritebatch, etc...)
 *
 * @method destroy
 */
PIXI.WebGLRenderer.prototype.destroy = function()
{
    // remove listeners
    this.view.removeEventListener('webglcontextlost', this.contextLostBound);
    this.view.removeEventListener('webglcontextrestored', this.contextRestoredBound);

    PIXI.glContexts[this.glContextId] = null;

    this.projection = null;
    this.offset = null;

    // time to create the render managers! each one focuses on managine a state in webGL
    this.shaderManager.destroy();
    this.spriteBatch.destroy();
    this.maskManager.destroy();
    this.filterManager.destroy();

    this.shaderManager = null;
    this.spriteBatch = null;
    this.maskManager = null;
    this.filterManager = null;

    this.gl = null;
    this.renderSession = null;
};

/**
 * Maps Pixi blend modes to WebGL blend modes.
 *
 * @method mapBlendModes
 */
PIXI.WebGLRenderer.prototype.mapBlendModes = function()
{
    var gl = this.gl;

    if(!PIXI.blendModesWebGL)
    {
        PIXI.blendModesWebGL = [];

        PIXI.blendModesWebGL[PIXI.blendModes.NORMAL]        = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.ADD]           = [gl.SRC_ALPHA, gl.DST_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY]      = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.SCREEN]        = [gl.SRC_ALPHA, gl.ONE];
        PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY]       = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.DARKEN]        = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN]       = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE]   = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION]     = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.HUE]           = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.SATURATION]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.COLOR]         = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
        PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    }
};

PIXI.WebGLRenderer.glContextId = 0;
PIXI.WebGLRenderer.instances = [];


text:
1. Download the jar file from any of the following places. The same jar will work with any server software.
	* [Github](https://github.com/AngrySoundTech/CouponCodes3/releases)
	* [BukkitDev](http://dev.bukkit.org/bukkit-plugins/couponcodes-revived/files/)
	* [Canary Nest](http://canarymod.net/plugins/couponcodes)
2. Copy the jar to the plugins/mods folder of your server
3. Start or restart your server. A full restart is preferred over any reload command.


text:
<?php

namespace SclZfCart\Mapper;

use Doctrine\Common\Persistence\ObjectManager;
use SclZfGenericMapper\Doctrine\FlushLock;
use SclZfGenericMapper\DoctrineMapper as GenericDoctrineMapper;
use SclZfCart\Entity\Order;

class DoctrineOrderMapper extends GenericDoctrineMapper implements
    OrderMapperInterface
{
    public function __construct(
        ObjectManager $entityManager,
        FlushLock $flushLock
    ) {
        parent::__construct(
            new \SclZfCart\Entity\Order(),
            $entityManager,
            $flushLock
        );
    }

    /**
     * @return Order
     */
    public function create()
    {
        $order = parent::create();
        $order->setStatus(Order::STATUS_PENDING);

        return $order;
    }
}


text:
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
 *  Main authors:
 *     Christopher Mears <chris.mears@monash.edu>
 *
 *  Copyright:
 *     Christopher Mears, 2012
 *
 *  Last modified:
 *     $Date: 2013-05-08 13:30:48 +0200 (Wed, 08 May 2013) $ by $Author: schulte $
 *     $Revision: 13622 $
 *
 *  This file is part of Gecode, the generic constraint
 *  development environment:
 *     http://www.gecode.org
 *
 *  Permission is hereby granted, free of charge, to any person obtaining
 *  a copy of this software and associated documentation files (the
 *  "Software"), to deal in the Software without restriction, including
 *  without limitation the rights to use, copy, modify, merge, publish,
 *  distribute, sublicense, and/or sell copies of the Software, and to
 *  permit persons to whom the Software is furnished to do so, subject to
 *  the following conditions:
 *
 *  The above copyright notice and this permission notice shall be
 *  included in all copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */

#ifndef __GECODE_SET_LDSB_HH__
#define __GECODE_SET_LDSB_HH__

#include <gecode/set.hh>
#include <gecode/int/ldsb.hh>

/**
 * \namespace Gecode::Set::LDSB
 * \brief Symmetry breaking for set variables
 */
namespace Gecode { namespace Set { namespace LDSB {

  using namespace Int::LDSB;

  /**
   * \brief Symmetry-breaking brancher with generic view and value
   * selection
   *
   * Implements view-based branching for an array of views (of type
   * \a View) on set variables and value (of type \a Val).
   *
   */
  template<class View, int n, class Val, unsigned int a>
  class LDSBSetBrancher : public LDSBBrancher<View,n,Val,a> {
  public:
    /// Function type for printing variable and value selection
    typedef void (*VarValPrint)(const Space& home, const BrancherHandle& bh,
                                unsigned int b,
                                typename View::VarType x, int i,
                                const Val& m,
                                std::ostream& o);
    /// Position of previous variable that was branched on
    int _prevPos;
    /// Number of non-value symmetries
    int _nNonValueSymmetries;
    /// Number of value symmetries
    int _nValueSymmetries;
    /// Copy of value symmetries from the first node where the current
    /// variable was branched on.
    ValueSymmetryImp<View>** _copiedSyms;
    /// Number of copied symmetries
    int _nCopiedSyms;
    /// Set of values used on left branches for the current variable
    IntSet _leftBranchValues;
    /**
     * \brief Is the state of the brancher "stable"?
     *
     * The brancher is unstable if we are about to run either "choice"
     * or "commit", but "updatePart1" has not been run.  After
     * "updatePart1" has been run the brancher is stable, until the
     * second part of the update is done (in commit).
     */
    bool _stable;

    /// Constructor for cloning \a b
    LDSBSetBrancher(Space& home, bool share, LDSBSetBrancher& b);
    /// Constructor for creation
    LDSBSetBrancher(Home home,
                    ViewArray<View>& x,
                    ViewSel<View>* vs[n],
                    ValSelCommitBase<View,Val>* vsc,
                    SymmetryImp<View>** syms, int nsyms,
                    SetBranchFilter bf,
                    VarValPrint vvp);
    /// Return choice
    virtual const Choice* choice(Space& home);
    /// Perform commit for choice \a c and alternative \a b
    virtual ExecStatus commit(Space& home, const Choice& c, unsigned int b);
    /// Perform cloning
    virtual Actor* copy(Space& home, bool share);
    /// Brancher post function
    static BrancherHandle post(Home home,
                               ViewArray<View>& x,
                               ViewSel<View>* vs[n],
                               ValSelCommitBase<View,Val>* vsc,
                               SymmetryImp<View>** _syms,
                               int _nsyms,
                               SetBranchFilter bf,
                               VarValPrint vvp);

    /**
     * \brief Part one of the update phase
     *
     * If the branching is at a new variable, restore previously
     * copied value symmetries, do bulk update of values used on left
     * branches for the previous variable, and make fresh copy of
     * resulting value symmetries.
     */
    void updatePart1(Space& home, int choicePos);
  };

}}}

namespace Gecode { namespace Int { namespace LDSB {
  template <>
  ArgArray<Literal>
  VariableSequenceSymmetryImp<Set::SetView>
  ::symmetric(Literal l, const ViewArray<Set::SetView>& x) const;
}}}

#include <gecode/set/ldsb/brancher.hpp>

#endif

// STATISTICS: set-branch


text:
'use strict';

angular.module('issueTracker.users.authentication', [])
    .factory('Authentication', [
        '$http',
        '$route',
        '$cookies',
        '$q',
        'Identity',
        'BASE_URL',
        function ($http, $route, $cookies, $q, identity, BASE_URL) {

        var AUTHENTICATION_COOKIE_KEY = '-__-Auth-__-';

        function loginUser(user) {
            var loginUserData = 'grant_type=password&username=' + user.email + '&password=' + user.password;

            var deffered = $q.defer();

            $http.post(BASE_URL + 'api/Token', loginUserData, {

            }).then(function (success) {
                $http.defaults.headers.common.Authorization = 'Bearer ' + success.data.access_token;
                $cookies.put(AUTHENTICATION_COOKIE_KEY, $http.defaults.headers.common.Authorization);

                identity.requestUserInfo()
                    .then(function (success) {
                        deffered.resolve(success);
                    }, function (error) {
                        deffered.reject(error);
                    });
                console.log(success);
                console.log(!!$cookies.get(AUTHENTICATION_COOKIE_KEY));

            }, function (error) {
                deffered.reject(error);
                console.log(error);
            });
            return deffered.promise;
        }

        function registerUser(user) {
            var loginUserData = 'Email=' + user.email + '&Password=' + user.password + '&ConfirmPassword=' + user.confirmPassword;

            var deffered = $q.defer();

            var request = {
                method: 'POST',
                url: BASE_URL + 'api/Account/Register',
                data: {
                    'Email': user.email,
                    'Password' : user.password,
                    'ConfirmPassword': user.confirmPassword
                },
                headers: {
                    ContentType: 'application/x-www-form-urlencoded'
                }
            };

            $http(request)
                .then(function (success) {
                deffered.resolve(success);
            }, function (error) {
                deffered.reject(error);
                console.log(error);
            });
            return deffered.promise;
        }

        function logoutUser() {
            $http.defaults.headers.common.Authorization = undefined;
            $cookies.remove(AUTHENTICATION_COOKIE_KEY);
            identity.resetUserData();
        }

        function isAuthenticated() {
            return !!$cookies.get(AUTHENTICATION_COOKIE_KEY);
        }

        function refreshCookie() {
            if (isAuthenticated()) {
                $http.defaults.headers.common.Authorization = $cookies.get(AUTHENTICATION_COOKIE_KEY);
                identity.requestUserInfo()
                    .then(function (success) {
                        $route.reload();
                    });
            }
        }

        return {
            registerUser: registerUser,
            loginUser: loginUser,
            logoutUser: logoutUser,
            refreshCookie: refreshCookie,
            isAuthenticated: isAuthenticated
        };
    }]);


text:
require_dependency "renalware/hd"

module Renalware
  module HD
    class DialysersController < BaseController
      def new
        dialyser = Dialyser.new
        authorize dialyser
        render locals: { dialyser: dialyser }
      end

      def create
        dialyser = Dialyser.new(dialyser_params)
        authorize dialyser

        if dialyser.save
          redirect_to hd_dialysers_path, notice: success_msg_for("dialyser")
        else
          flash.now[:error] = failed_msg_for("dialyser")
          render :new, locals: { dialyser: dialyser }
        end
      end

      def index
        dialysers = Dialyser.all
        authorize dialysers
        render locals: { dialysers: dialysers }
      end

      def edit
        dialyser = load_and_authorize_dialyser
        render locals: { dialyser: dialyser }
      end

      def update
        dialyser = load_and_authorize_dialyser
        if dialyser.update(dialyser_params)
          redirect_to hd_dialysers_path, notice: success_msg_for("dialyser")
        else
          flash.now[:error] = failed_msg_for("dialyser")
          render :edit, locals: { dialyser: dialyser }
        end
      end

      def destroy
        dialyser = load_and_authorize_dialyser
        dialyser.destroy
        redirect_to hd_dialysers_path, notice: success_msg_for("dialyser")
      end

      private

      def dialyser_params
        params
          .require(:hd_dialyser)
          .permit(:group, :name, :membrane_surface_area, :membrane_surface_area_coefficient_k0a)
      end

      def load_and_authorize_dialyser
        dialyser = Dialyser.find(params[:id])
        authorize dialyser
        dialyser
      end
    end
  end
end