text:
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
// Window.h for Blackbox - an X11 Window manager
// Copyright (c) 2001 - 2005 Sean 'Shaleh' Perry <shaleh@debian.org>
// Copyright (c) 1997 - 2000, 2002 - 2005
//         Bradley T Hughes <bhughes at trolltech.com>
//
// 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   __Window_h
#define   __Window_h

#include "BlackboxResource.h"
#include "Screen.h"

#include <EWMH.h>

enum WindowType {
  WindowTypeNormal,
  WindowTypeDialog,
  WindowTypeDesktop,
  WindowTypeDock,
  WindowTypeMenu,
  WindowTypeSplash,
  WindowTypeToolbar,
  WindowTypeUtility
};

enum WindowFunction {
  WindowFunctionResize          = 1<<0,
  WindowFunctionMove            = 1<<1,
  WindowFunctionShade           = 1<<2,
  WindowFunctionIconify         = 1<<3,
  WindowFunctionMaximize        = 1<<4,
  WindowFunctionClose           = 1<<5,
  WindowFunctionChangeWorkspace = 1<<6,
  WindowFunctionChangeLayer     = 1<<7,
  WindowFunctionFullScreen      = 1<<8,
  NoWindowFunctions             = 0,
  AllWindowFunctions            = (WindowFunctionResize |
                                   WindowFunctionMove |
                                   WindowFunctionShade |
                                   WindowFunctionIconify |
                                   WindowFunctionMaximize |
                                   WindowFunctionClose |
                                   WindowFunctionChangeWorkspace |
                                   WindowFunctionChangeLayer |
                                   WindowFunctionFullScreen)
};
typedef unsigned short WindowFunctionFlags;

enum WindowDecoration {
  WindowDecorationTitlebar = 1<<0,
  WindowDecorationHandle   = 1<<1,
  WindowDecorationGrip     = 1<<2,
  WindowDecorationBorder   = 1<<3,
  WindowDecorationIconify  = 1<<4,
  WindowDecorationMaximize = 1<<5,
  WindowDecorationClose    = 1<<6,
  NoWindowDecorations      = 0,
  AllWindowDecorations     = (WindowDecorationTitlebar |
                              WindowDecorationHandle |
                              WindowDecorationGrip |
                              WindowDecorationBorder |
                              WindowDecorationIconify |
                              WindowDecorationMaximize |
                              WindowDecorationClose)
};
typedef unsigned char WindowDecorationFlags;

struct EWMH {
  WindowType window_type;
  unsigned int workspace;
  unsigned int modal        : 1;
  unsigned int maxv         : 1;
  unsigned int maxh         : 1;
  unsigned int shaded       : 1;
  unsigned int skip_taskbar : 1;
  unsigned int skip_pager   : 1;
  unsigned int hidden       : 1;
  unsigned int fullscreen   : 1;
  unsigned int above        : 1;
  unsigned int below        : 1;
};
struct MotifHints {
  WindowDecorationFlags decorations;
  WindowFunctionFlags functions;
};
struct WMHints {
  bool accept_focus;
  Window window_group;
  unsigned long initial_state;
};
struct WMNormalHints {
  long flags;
  unsigned int min_width, min_height;
  unsigned int max_width, max_height;
  unsigned int width_inc, height_inc;
  unsigned int min_aspect_x, min_aspect_y;
  unsigned int max_aspect_x, max_aspect_y;
  unsigned int base_width, base_height;
  unsigned int win_gravity;
};
struct WMProtocols {
  unsigned int wm_delete_window : 1;
  unsigned int wm_take_focus    : 1;
};

class BlackboxWindow : public StackEntity, public bt::TimeoutHandler,
                       public bt::EventHandler, public bt::NoCopy {
  Blackbox *blackbox;
  BScreen *_screen;
  bt::Timer *timer;

  Time lastButtonPressTime;  // used for double clicks, when were we clicked

  unsigned int window_number;

  struct ClientState {
    unsigned int visible  : 1; // is visible?
    unsigned int iconic   : 1; // is iconified?
    unsigned int moving   : 1; // is moving?
    unsigned int resizing : 1; // is resizing?
    unsigned int focused  : 1; // has focus?
    unsigned int shaped   : 1; // does the frame use the shape extension?
  };

  struct _client {
    Window window;                    // the client's window
    Colormap colormap;
    Window transient_for;             // which window are we a transient for?
    BlackboxWindowList transientList; // which windows are our transients?

    bt::ustring title, visible_title, icon_title;

    bt::Rect rect, premax;

    int old_bw;                     // client's borderwidth

    unsigned long current_state;

    bt::EWMH::Strut *strut;

    WindowFunctionFlags functions;
    WindowDecorationFlags decorations;

    ClientState state;

    EWMH ewmh;
    MotifHints motif;
    WMHints wmhints;
    WMNormalHints wmnormal;
    WMProtocols wmprotocols;
  } client;

  /*
   * client window = the application's window
   * frame window = the window drawn around the outside of the client window
   *                by the window manager which contains items like the
   *                titlebar and close button
   * title = the titlebar drawn above the client window, it displays the
   *         window's name and any buttons for interacting with the window,
   *         such as iconify, maximize, and close
   * label = the window in the titlebar where the title is drawn
   * buttons = maximize, iconify, close
   * handle = the bar drawn at the bottom of the window, which contains the
   *          left and right grips used for resizing the window
   * grips = the smaller reactangles in the handle, one of each side of it.
   *         When clicked and dragged, these resize the window interactively
   * border = the line drawn around the outside edge of the frame window,
   *          between the title, the bordered client window, and the handle.
   *          Also drawn between the grips and the handle
   */

  struct _frame {
    // u -> unfocused, f -> has focus
    Pixmap ulabel, flabel, utitle, ftitle, uhandle, fhandle,
      ubutton, fbutton, pbutton, ugrip, fgrip;

    Window window,       // the frame
      plate,             // holds the client
      title,
      label,
      handle,
      close_button, iconify_button, maximize_button,
      right_grip, left_grip;

    // frame geometry
    bt::Rect rect;

    // used during move/resize
    bt::Rect changing;
    int corner;

    /*
     * margins between the frame and client, this has nothing to do
     * with EWMH, it is simply code reuse for similar functionality
     */
    bt::EWMH::Strut margin;
    int grab_x, grab_y;         // where was the window when it was grabbed?

    unsigned int label_w;       // width of the label
  } frame;

  Window createToplevelWindow();
  Window createChildWindow(Window parent, unsigned long event_mask,
                           Cursor = None);

  void associateClientWindow(void);

  void decorate(void);

  void positionButtons(bool redecorate_label = false);
  void positionWindows(void);

  void createTitlebar(void);
  void destroyTitlebar(void);
  void createHandle(void);
  void destroyHandle(void);
  void createGrips(void);
  void destroyGrips(void);
  void createIconifyButton(void);
  void destroyIconifyButton(void);
  void createMaximizeButton(void);
  void destroyMaximizeButton(void);
  void createCloseButton(void);
  void destroyCloseButton(void);

  void redrawWindowFrame(void) const;
  void redrawTitle(void) const;
  void redrawLabel(void) const;
  void redrawAllButtons(void) const;
  void redrawCloseButton(bool pressed = false) const;
  void redrawIconifyButton(bool pressed = false) const;
  void redrawMaximizeButton(bool pressed = false) const;
  void redrawHandle(void) const;
  void redrawGrips(void) const;

  void setState(unsigned long new_state);
  void updateEWMHState();
  void updateEWMHAllowedActions();

  void startMove();
  void snapAdjust(int *x, int *y);
  void continueMove(int x_root, int y_root);
  void finishMove();

  void startResize(Window window);
  void continueResize(int x_root, int y_root);
  void finishResize();

  void showGeometry(const bt::Rect &r) const;

public:
  BlackboxWindow(Blackbox *b, Window w, BScreen *s);
  virtual ~BlackboxWindow(void);

  inline bool isTransient(void) const
  { return client.transient_for != 0; }
  inline bool isGroupTransient(void) const
  { return (client.transient_for != 0
            && client.transient_for == client.wmhints.window_group); }
  inline bool isModal(void) const
  { return client.ewmh.modal; }

  inline WindowType windowType(void) const
  { return client.ewmh.window_type; }

  inline bool hasWindowFunction(WindowFunction function) const
  { return client.functions & function; }
  inline bool hasWindowDecoration(WindowDecoration decoration) const
  { return client.decorations & decoration; }

  // ordered newest to oldest
  inline const BlackboxWindowList &transients(void) const
  { return client.transientList; }

  void addTransient(BlackboxWindow *win);
  void removeTransient(BlackboxWindow *win);

  BlackboxWindow *findTransientFor(void) const;
  BlackboxWindow *findNonTransientParent(void) const;
  BlackboxWindowList buildFullTransientList(void) const;

  BWindowGroup *findWindowGroup(void) const;

  inline BScreen *screen(void) const
  { return _screen; }

  // StackEntity interface
  inline Window windowID(void) const
  { return frame.window; }

  inline Window frameWindow(void) const
  { return frame.window; }
  inline Window clientWindow(void) const
  { return client.window; }

  inline const bt::ustring &title(void) const
  { return client.title; }
  inline const bt::ustring &iconTitle(void) const
  { return client.icon_title.empty() ? client.title : client.icon_title; }

  inline unsigned int workspace(void) const
  { return client.ewmh.workspace; }
  void setWorkspace(unsigned int new_workspace);

  enum ChangeWorkspaceOption {
    StayOnCurrentWorkspace,
    SwitchToNewWorkspace
  };
  void changeWorkspace(unsigned int new_workspace,
                       ChangeWorkspaceOption how = StayOnCurrentWorkspace);

  void changeLayer(StackingList::Layer new_layer);

  inline unsigned int windowNumber(void) const
  { return window_number; }
  inline void setWindowNumber(int n)
  { window_number = n; }

  inline const bt::Rect &frameRect(void) const
  { return frame.rect; }
  inline const bt::Rect &clientRect(void) const
  { return client.rect; }

  const WMHints &wmHints(void) const
  { return client.wmhints; }
  const WMNormalHints &wmNormalHints(void) const
  { return client.wmnormal; }
  const WMProtocols &wmProtocols(void) const
  { return client.wmprotocols; }

  unsigned long currentState(void) const
  { return client.current_state; }

  inline bool isFocused(void) const
  { return client.state.focused; }
  void setFocused(bool focused);
  bool setInputFocus(void);

  inline bool isVisible(void) const
  { return client.state.visible; }
  void show(void);
  void hide(void);
  void close(void);
  void activate(void);

  inline bool isShaded(void) const
  { return client.ewmh.shaded; }
  void setShaded(bool shaded);

  inline bool isIconic(void) const
  { return client.state.iconic; }
  void iconify(void); // call show() to deiconify

  inline bool isMaximized(void) const
  { return client.ewmh.maxh || client.ewmh.maxv; }
  // ### change to setMaximized()?
  void maximize(unsigned int button);
  void remaximize(void);

  inline bool isFullScreen(void) const
  { return client.ewmh.fullscreen; }
  void setFullScreen(bool b);

  void reconfigure(void);
  void grabButtons(void);
  void ungrabButtons(void);
  void restore(void);
  void configure(int dx, int dy, unsigned int dw, unsigned int dh);
  inline void configure(const bt::Rect &r)
  { configure(r.x(), r.y(), r.width(), r.height()); }

  void clientMessageEvent(const XClientMessageEvent * const ce);
  void buttonPressEvent(const XButtonEvent * const be);
  void buttonReleaseEvent(const XButtonEvent * const re);
  void motionNotifyEvent(const XMotionEvent * const me);
  void destroyNotifyEvent(const XDestroyWindowEvent * const /*unused*/);
  void unmapNotifyEvent(const XUnmapEvent * const /*unused*/);
  void reparentNotifyEvent(const XReparentEvent * const /*unused*/);
  void propertyNotifyEvent(const XPropertyEvent * const pe);
  void exposeEvent(const XExposeEvent * const ee);
  void configureRequestEvent(const XConfigureRequestEvent * const cr);
  void enterNotifyEvent(const XCrossingEvent * const ce);
  void leaveNotifyEvent(const XCrossingEvent * const /*unused*/);

#ifdef SHAPE
  void configureShape(void);
  void shapeEvent(const XEvent * const /*unused*/);
#endif // SHAPE

  virtual void timeout(bt::Timer *);
};

#endif // __Window_h


text:
package com.cosig.wifiharvester;

/**
 * Created by Jimmy on 2016-06-08.
 */
public class WifiDataFactory {

    public WifiDataFactory(){

    }

    public WifiData createWifiData(String ssid, String bssid, String security){
        if(ssid.isEmpty()){
            ssid = "hidden";
        }
        if(bssid.isEmpty()){
            bssid = "MAC not found";
        }

        return new WifiData(ssid,bssid, security);

    }
}

redpajama_set_name: RedPajamaGithub


text:
RenderableSceneNode::RenderableSceneNode(std::string programName, vec3 position, quat rotation, vec3 scale) :
SceneNode(position, rotation, scale)
{
    _renderComponent = new RenderComponent(programName);
}

RenderableSceneNode::~RenderableSceneNode()
{
    delete _renderComponent;
}

void RenderableSceneNode::render()
{
    preRender();
    _renderComponent->render(_worldTransform);
    postRender();
}

void RenderableSceneNode::preRender() {}
void RenderableSceneNode::postRender() {}


text:
package com.vmware.vim25;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for MoveDirectoryInGuestRequestType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="MoveDirectoryInGuestRequestType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="_this" type="{urn:vim25}ManagedObjectReference"/>
 *         <element name="vm" type="{urn:vim25}ManagedObjectReference"/>
 *         <element name="auth" type="{urn:vim25}GuestAuthentication"/>
 *         <element name="srcDirectoryPath" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="dstDirectoryPath" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MoveDirectoryInGuestRequestType", propOrder = {
    "_this",
    "vm",
    "auth",
    "srcDirectoryPath",
    "dstDirectoryPath"
})
public class MoveDirectoryInGuestRequestType {

    @XmlElement(required = true)
    protected ManagedObjectReference _this;
    @XmlElement(required = true)
    protected ManagedObjectReference vm;
    @XmlElement(required = true)
    protected GuestAuthentication auth;
    @XmlElement(required = true)
    protected String srcDirectoryPath;
    @XmlElement(required = true)
    protected String dstDirectoryPath;

    /**
     * Gets the value of the this property.
     *
     * @return
     *     possible object is
     *     {@link ManagedObjectReference }
     *
     */
    public ManagedObjectReference getThis() {
        return _this;
    }

    /**
     * Sets the value of the this property.
     *
     * @param value
     *     allowed object is
     *     {@link ManagedObjectReference }
     *
     */
    public void setThis(ManagedObjectReference value) {
        this._this = value;
    }

    /**
     * Gets the value of the vm property.
     *
     * @return
     *     possible object is
     *     {@link ManagedObjectReference }
     *
     */
    public ManagedObjectReference getVm() {
        return vm;
    }

    /**
     * Sets the value of the vm property.
     *
     * @param value
     *     allowed object is
     *     {@link ManagedObjectReference }
     *
     */
    public void setVm(ManagedObjectReference value) {
        this.vm = value;
    }

    /**
     * Gets the value of the auth property.
     *
     * @return
     *     possible object is
     *     {@link GuestAuthentication }
     *
     */
    public GuestAuthentication getAuth() {
        return auth;
    }

    /**
     * Sets the value of the auth property.
     *
     * @param value
     *     allowed object is
     *     {@link GuestAuthentication }
     *
     */
    public void setAuth(GuestAuthentication value) {
        this.auth = value;
    }

    /**
     * Gets the value of the srcDirectoryPath property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getSrcDirectoryPath() {
        return srcDirectoryPath;
    }

    /**
     * Sets the value of the srcDirectoryPath property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setSrcDirectoryPath(String value) {
        this.srcDirectoryPath = value;
    }

    /**
     * Gets the value of the dstDirectoryPath property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDstDirectoryPath() {
        return dstDirectoryPath;
    }

    /**
     * Sets the value of the dstDirectoryPath property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDstDirectoryPath(String value) {
        this.dstDirectoryPath = value;
    }

}


text:
declare module 'react-context-toolbox/mapContextToProps' {
  import * as React from 'react';

  type ElementType = React.ComponentType<any> | keyof JSX.IntrinsicElements;

  type Omit<T, U> = Pick<T, Exclude<keyof T, keyof U>>;

  type GetProps<C> = C extends React.ComponentType<infer P> ? P : never;

  interface ContextInjectedComponent<TComponent, TInjectedProps, TExtraProps>
    extends React.ForwardRefExoticComponent<
        Omit<GetProps<TComponent>, TInjectedProps> & TExtraProps
      > {}

  // Single Context
  function mapContextToProps<TComponent, TContext, TContextProps, TOwnProps>(
    context: React.Context<TContext> | [React.Context<TContext>],
    mapToProps: (ctxValue: TContext, props: TOwnProps) => TContextProps,
    Component: TComponent,
  ): ContextInjectedComponent<TComponent, TContextProps, TOwnProps>;
  function mapContextToProps<TContext, TContextProps, TOwnProps>(
    context: React.Context<TContext> | [React.Context<TContext>],
    mapToProps: (ctxValue: TContext, props: TOwnProps) => TContextProps,
  ): <TComponent>(
    component: TComponent,
  ) => ContextInjectedComponent<TComponent, TContextProps, TOwnProps>;

  // 2 Contexts
  function mapContextToProps<
    TComponent,
    TContext1,
    TContext2,
    TContextProps,
    TOwnProps
  >(
    context: [React.Context<TContext1>, React.Context<TContext2>],
    mapToProps: (
      c1: TContext1,
      c2: TContext2,
      props: TOwnProps,
    ) => TContextProps,
    Component: TComponent,
  ): ContextInjectedComponent<TComponent, TContextProps, TOwnProps>;
  function mapContextToProps<TContext1, TContext2, TContextProps, TOwnProps>(
    context: [React.Context<TContext1>, React.Context<TContext2>],
    mapToProps: (
      c1: TContext1,
      c2: TContext2,
      props: TOwnProps,
    ) => TContextProps,
  ): <TComponent>(
    component: TComponent,
  ) => ContextInjectedComponent<TComponent, TContextProps, TOwnProps>;

  // 3 Contexts
  function mapContextToProps<
    TComponent,
    TContext1,
    TContext2,
    TContext3,
    TContextProps,
    TOwnProps
  >(
    context: [
      React.Context<TContext1>,
      React.Context<TContext2>,
      React.Context<TContext3>
    ],
    mapToProps: (
      c1: TContext1,
      c2: TContext2,
      c3: TContext3,
      props: TOwnProps,
    ) => TContextProps,
    Component: TComponent,
  ): ContextInjectedComponent<TComponent, TContextProps, TOwnProps>;
  function mapContextToProps<
    TContext1,
    TContext2,
    TContext3,
    TContextProps,
    TOwnProps
  >(
    context: [
      React.Context<TContext1>,
      React.Context<TContext2>,
      React.Context<TContext3>
    ],
    mapToProps: (
      c1: TContext1,
      c2: TContext2,
      c3: TContext3,
      props: TOwnProps,
    ) => TContextProps,
  ): <TComponent>(
    component: TComponent,
  ) => ContextInjectedComponent<TComponent, TContextProps, TOwnProps>;

  // 4 Contexts
  function mapContextToProps<
    TComponent,
    TContext1,
    TContext2,
    TContext3,
    TContext4,
    TContextProps,
    TOwnProps
  >(
    context: [
      React.Context<TContext1>,
      React.Context<TContext2>,
      React.Context<TContext3>,
      React.Context<TContext4>
    ],
    mapToProps: (
      c1: TContext1,
      c2: TContext2,
      c3: TContext3,
      c4: TContext4,
      props: TOwnProps,
    ) => TContextProps,
    Component: TComponent,
  ): ContextInjectedComponent<TComponent, TContextProps, TOwnProps>;
  function mapContextToProps<
    TContext1,
    TContext2,
    TContext3,
    TContext4,
    TContextProps,
    TOwnProps
  >(
    context: [
      React.Context<TContext1>,
      React.Context<TContext2>,
      React.Context<TContext3>,
      React.Context<TContext4>
    ],
    mapToProps: (
      c1: TContext1,
      c2: TContext2,
      c3: TContext3,
      c4: TContext4,
      props: TOwnProps,
    ) => TContextProps,
  ): <TComponent>(
    component: TComponent,
  ) => ContextInjectedComponent<TComponent, TContextProps, TOwnProps>;

  export default mapContextToProps;
}


text:
namespace RenderCore { namespace Metal_DX11
{
    typedef intrusive_ptr<ID3D::Query>            UnderlyingQuery;
}}


text:
'use strict';

var Step = require('../lib/twoStep').Step,
	expect = require('expect.js'),
	fs = require('fs'),
	selfText = fs.readFileSync(__filename, 'utf8'),
	etcFileName = '/etc/passwd',
	etcText = fs.readFileSync(etcFileName, 'utf8');

describe('Parallel call usage', function() {

	it('should execute parallel and pass values to correct slots', function(done) {
		Step(
			Step.simple(function() {
				fs.readFile(__filename, 'utf8', this.slot());
				fs.readFile(etcFileName, 'utf8', this.slot());
			}),
			Step.throwIfError(function(err, _selfText, _etcText) {
				expect(_selfText).to.be(selfText);
				expect(_etcText).to.be(etcText);
				this.pass(null);
			}),
			done
		);
	});

	it('should pass 2 parameters using this.pass', function(done) {
		var firstExpectString = 'one',
			secondExpectString = 'two';
		Step(
			Step.simple(function() {
				fs.readFile(__filename, 'utf8', this.slot());
				this.pass(firstExpectString, secondExpectString);
			}),
			Step.throwIfError(function(err, _selfText, _first, _second) {
				expect(_selfText).to.be(selfText);
				expect(_first).to.be(firstExpectString);
				expect(_second).to.be(secondExpectString);
				this.pass(null);
			}),
			done
		);
	});

	it('same that previous but parameters order changed', function(done) {
		var firstExpectString = 'one',
			secondExpectString = 'two';
		Step(
			Step.simple(function() {
				this.pass(firstExpectString);
				fs.readFile(__filename, 'utf8', this.slot());
				this.pass(secondExpectString);
			}),
			Step.throwIfError(function(err, _first, _selfText, _second) {
				expect(_selfText).to.be(selfText);
				expect(_first).to.be(firstExpectString);
				expect(_second).to.be(secondExpectString);
				this.pass(null);
			}),
			done
		);
	});

});


text:
/*Admin options pannal data value*/
	function weblizar_option_data_save(name)
	{ 	tinyMCE.triggerSave();
		var weblizar_settings_save= "#weblizar_settings_save_"+name;
		var weblizar_theme_options = "#weblizar_theme_options_"+name;
		var weblizar_settings_save_success = weblizar_settings_save+"_success";
		var loding_image ="#weblizar_loding_"+name;
		var weblizar_loding_image = loding_image +"_image";

		jQuery(weblizar_loding_image).show();
		jQuery(weblizar_settings_save).val("1");
	    jQuery.ajax({
				url:'themes.php?page=weblizar',
				type:'post',
				data : jQuery(weblizar_theme_options).serialize(),
				 success : function(data)
				 {  jQuery(weblizar_loding_image).fadeOut();
					jQuery(weblizar_settings_save_success).show();
					jQuery(weblizar_settings_save_success).fadeOut(5000);
				}
		});
	}
/*Admin options value reset */
	function weblizar_option_data_reset(name)
	{
		var r=confirm("Do you want reset your theme setting!")
		if (r==true)
		{		var weblizar_settings_save= "#weblizar_settings_save_"+name;
				var weblizar_theme_options = "#weblizar_theme_options_"+name;
				var weblizar_settings_save_reset = weblizar_settings_save+"_reset";
				jQuery(weblizar_settings_save).val("2");
				jQuery.ajax({
				   url:'themes.php?page=weblizar',
				   type:'post',
				   data : jQuery(weblizar_theme_options).serialize(),
				   success : function(data){
					jQuery(weblizar_settings_save_reset).show();
					jQuery(weblizar_settings_save_reset).fadeOut(5000);
				}
			});
		} else  {
		alert("Cancel! reset theme setting process");  }
	}
// js to active the link of option pannel
 jQuery(document).ready(function() {
	jQuery('ul li.active ul').slideDown();
	// menu click
	jQuery('#nav > li > a').click(function(){
		if (jQuery(this).attr('class') != 'active')
		{
			jQuery('#nav li ul').slideUp(350);
			jQuery(this).next().slideToggle(350);
			jQuery('#nav li a').removeClass('active');
			jQuery(this).addClass('active');

			jQuery('ul.options_tabs li').removeClass('active');
			jQuery(this).parent().addClass('active');
			var divid =  jQuery(this).attr("id");
			var add="div#option-"+divid;
			var strlenght = add.length;

			if(strlenght<17)
			{
				var add="div#option-ui-id-"+divid;
				var ulid ="#ui-id-"+divid;
				jQuery('ul.options_tabs li li ').removeClass('currunt');
				jQuery(ulid).parent().addClass('currunt');
			}
			jQuery('div.ui-tabs-panel').addClass('deactive').fadeIn(1000);;
			jQuery('div.ui-tabs-panel').removeClass('active');
			jQuery(add).removeClass('deactive');
			jQuery(add).addClass('active');
		}
	});

	// child submenu click
	jQuery('ul.options_tabs li li ').click(function() {
		jQuery('ul.options_tabs li li ').removeClass('currunt');
		jQuery(this).addClass('currunt');
		var option_name =  jQuery(this).children("a").attr("id");
		var option_add="div#option-"+option_name;
		jQuery('div.ui-tabs-panel').addClass('deactive').fadeIn(1000);;
		jQuery('div.ui-tabs-panel').removeClass('active');
		jQuery(option_add).removeClass('deactive');
		jQuery(option_add).addClass('active');

	});

	/********media-upload******/
	// media upload js
	var uploadID = ''; /*setup the var*/
	var showImg= '';
	jQuery('.upload_image_button').click(function() {
		uploadID = jQuery(this).prev('input'); /*grab the specific input*/
		showImg = jQuery(this).nextAll('img');
		formfield = jQuery('.upload').attr('name');
		tb_show('', 'media-upload.php?type=image&TB_iframe=true');

		window.send_to_editor = function(html)
		{	imgurl = jQuery('img',html).attr('src');
		showImg.attr('src',imgurl);
			uploadID.val(imgurl); /*assign the value to the input*/
			tb_remove();
		};
		return false;
	});
});

/****  For Option panle facebook Like ******/
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

/****  For Option panle twitter follower and Like ******/

!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");


text:
package org.ocpsoft.tutorial.regex.server;

/**
 * {@link CharSequence} that notices {@link Thread} interrupts
 *
 * @author gojomo - http://stackoverflow.com/questions/910740/cancelling-a-long-running-regex-match
 */
public class InterruptibleCharSequence implements CharSequence
{
   CharSequence inner;

   public InterruptibleCharSequence(CharSequence inner)
   {
      super();
      this.inner = inner;
   }

   @Override
   public char charAt(int index)
   {
      if (Thread.interrupted()) {
         throw new RuntimeException("Die! ... Why won't you DIE!", new InterruptedException());
      }
      return inner.charAt(index);
   }

   @Override
   public int length()
   {
      return inner.length();
   }

   @Override
   public CharSequence subSequence(int start, int end)
   {
      return new InterruptibleCharSequence(inner.subSequence(start, end));
   }

   @Override
   public String toString()
   {
      return inner.toString();
   }
}


text:
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\widgets\Select2;
use yii\helpers\ArrayHelper;
use backend\models\Person;
use backend\models\User;
use backend\models\Reference;
use backend\models\Organisation;
use kartik\widgets\SwitchInput;
/* @var $this yii\web\View */
/* @var $model backend\models\Employee */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>
	<?= $form->errorSummary($model) ?>

		<?php
		$data = ArrayHelper::map(Person::find()
				->select(['id', 'name'])
				->asArray()
				->all()
				, 'id', 'name');
		if($model->isNewRecord) $model->person_id = $person_id;
		echo $form->field($model, 'person_id')->widget(Select2::classname(), [
			'data' => $data,
			'options' => ['placeholder' => 'Choose person ...','disabled'=>true],
			'pluginOptions' => [
			'allowClear' => true
			],
		]); ?>

		<?php
		$data = ArrayHelper::map(User::find()
				->select(['id', 'username'])
				->asArray()
				->all()
				, 'id', 'username');

		echo $form->field($model, 'user_id')->widget(Select2::classname(), [
			'data' => $data,
			'options' => ['placeholder' => 'Choose user ...','disabled'=>true],
			'pluginOptions' => [
			'allowClear' => true
			],
		]); ?>

		<?= $form->field($model, 'chairman')->widget(SwitchInput::classname(), [
			'pluginOptions' => [
				'onText' => 'On',
				'offText' => 'Off',
			]
		]) ?>

			<?php
			$data = ArrayHelper::map(Organisation::find()
					->select(['ID', 'NM_UNIT_ORG'])
					->where(['JNS_KANTOR'=>13])
					->asArray()
					->all()
					, 'ID', 'NM_UNIT_ORG');

			echo $form->field($model, 'organisation_id')->widget(Select2::classname(), [
				'data' => $data,
				'options' => ['placeholder' => 'Choose organisation ...'],
				'pluginOptions' => [
				'allowClear' => true
				],
			]); ?>

	<?php
	foreach($object_references_array as $object_reference=>$label){;
		$data = ArrayHelper::map(Reference::find()
				->select(['id', 'name'])
				->where(['type'=>$object_reference])
				->asArray()
				->all()
				, 'id', 'name');
		echo '
';
		echo $form->field(${$object_reference}, '['.$object_reference.']reference_id')->widget(Select2::classname(), [
			'data' => $data,
			'options' => ['placeholder' => 'Choose '.$label.' ...'],
			'pluginOptions' => [
			'allowClear' => true
			],
		])->label($label);
		echo '
';
	}
	?>

        <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>
	<?php $this->registerCss('label{display:block !important;}'); ?>